diff --git a/.eslintignore b/.eslintignore index b23b36b69..c9ec50de9 100644 --- a/.eslintignore +++ b/.eslintignore @@ -8,6 +8,7 @@ src/geom/polygon/Earcut.js src/utils/array/StableSort.js src/utils/object/Extend.js src/structs/RTree.js +plugins/spine/dist/ plugins/spine/src/runtimes/ webpack.* webpack.config.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 111f20be2..3e7b5e9a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,24 @@ # Change Log -## Version 3.19.0 - Naofumi - in development +## Version 3.20.0 - Fitoria - in dev + +### New Features + +* `GameConfig.antialiasGL` is a new boolean that allows you to set the `antialias` property of the WebGL context during creation, without impacting any subsequent textures or the canvas CSS. + +### Updates + +* When calling `Shader.setRenderToTexture()` it will now draw the shader just once, immediately to the texture, to avoid the texture being blank for a single frame (thanks Kyle) +* The private `Shader._savedKey` property has been removed as it wasn't used anywhere internally. + +### Bug Fixes + +* `SpineCanvasPlugin.shutdown` would try to dispose of the `sceneRenderer`, but the property isn't set for Canvas. +* `ArcadePhysics.Body.checkWorldBounds` would incorrectly report as being on the World bounds if the `blocked.none` flag had been toggled elsewhere in the Body. It now only sets if it toggles a new internal flag (thanks Pablo) +* `RenderTexture.resize` wouldn't update the CanvasTexture width and height, causing the cal to draw or drawFrame to potentially distort the texture (thanks @yhwh) +* `InputPlugin.processDragMove` has been updated so that the resulting `dragX` and `dragY` values, sent to the event handler, now compensate for the scale of the Game Objects parent container, if inside of one. This means dragging a child of a scale Container will now still drag at 'full' speed. + +## Version 3.19.0 - Naofumi - 8th August 2019 ### Tween Updates @@ -46,9 +64,11 @@ ### Spine Updates +The Spine Plugin is now 100% complete. It has been updated to use the Spine 3.7 Runtimes. Improvements have been made across the entire plugin, including proper batched rendering support in WebGL, cleaner skin and slot functions and lots and lots of updates. It's fully documented and there are lots of examples to be found. The following legacy bugs have also been fixed: + * Adding Spine to physics causes position to become NaN. Fix #4501 (thanks @hizzd) * Destroying a Phaser Game instance and then re-creating it would cause an error trying to re-create Spine Game Objects ("Cannot read property get of null"). Fix #4532 (thanks @Alex-Badea) -* Rendering a Spine object when a Camer has `renderToTexture` enabled on it would cause the object to be vertically flipped. It now renders correctly in both cases. Fix #4647 (thanks @probt) +* Rendering a Spine object when a Camera has `renderToTexture` enabled on it would cause the object to be vertically flipped. It now renders correctly in both cases. Fix #4647 (thanks @probt) ### New Features @@ -77,6 +97,19 @@ * `WebGLRenderer.newType` is a boolean that indicates if the current Game Object has a new type, i.e. different to the previous one in the display list. * `WebGLRenderer.nextTypeMatch` is a boolean that indicates if the _next_ Game Object in the display list has the same type as the one being currently rendered. This allows you to build batching into separated Game Objects. * `PluginManager.removeGameObject` is a new method that allows you to de-register custom Game Object types from the global Game Object Factory and/or Creator. Useful for when custom plugins are destroyed and need to clean-up after themselves. +* `GEOM_CONST` is a new constants object that contains the different types of Geometry Objects, such as `RECTANGLE` and `CIRCLE`. +* `Circle.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Ellipse.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Line.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Point.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Polygon.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Rectangle.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Triangle.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `InputPlugin.enableDebug` is a new method that will create a debug shape for the given Game Objects hit area. This allows you to quickly check the size and placement of an input hit area. You can customzie the shape outline color. The debug shape will automatically track the Game Object to which it is bound. +* `InputPlugion.removeDebug` will remove a Debug Input Shape from the given Game Object and destroy it. +* `Pointer.updateWorldPoint` is a new method that takes a Camera and then updates the Pointers `worldX` and `worldY` values based on the cameras transform (thanks @Nick-lab) +* `ScaleManager._resetZoom` is a new internal flag that is set when the game zoom factor changes. +* `Texture.remove` is a new method that allows you to remove a Frame from a Texture based on its name. Fix #4460 (thanks @BigZaphod) ### Updates @@ -93,6 +126,13 @@ * The `WebAudioSoundManager` will now remove the document touch handlers even if the Promise fails, preventing it from throwing a rejection handler error. * `GameObjectFactory.remove` is a new static function that will remove a custom Game Object factory type. * `GameObjectCreator.remove` is a new static function that will remove a custom Game Object creator type. +* `CanvasTexture.getPixels` now defaults to 0x0 by width x height as the default area, allowing you to call the method with no arguments to get all the pixels for the canvas. +* `CreateDOMContainer` will now use `div.style.cssText` to set the inline styles of the container, so it now works on IE11. Fix #4674 (thanks @DanLiamco) +* `TransformMatrix.rotation` now returns the properly normalized rotation value. +* `PhysicsEditorParser` has now been exposed under the `Phaser.Physics.Matter` namespace, so you can call methods on it directly. +* Calling `CanvasTexture.update` will now automatically call `refresh` if running under WebGL. This happens for both `draw` and `drawFrame`, meaning you no longer need to remember to call `refresh` after drawing to a Canvas Texture in WebGL, keeping it consistent with the Canvas renderer. +* `Frame.destroy` will now null the Frames reference to its parent texture, glTexture and clear the data and customData objects. +* The Container renderer functions will now read the childs `alpha` property, instead of `_alpha`, allowing it to work with more variety of custom children. ### Bug Fixes @@ -121,14 +161,14 @@ * The `DESTROY` event hook wasn't removed from Group children when destroying the Group and `destroyChildren` was set to false. Now, the hook is removed regardless (thanks @rexrainbow) * The WebGL Lost and Restored Context callbacks were never removed, which could cause them to hold onto stale references. Fix #3610 (thanks @Twilrom) * `Origin.updateDisplayOrigin` no longer applies a Math.floor to the display origins, allowing you to have a 0.x origin for a Game Object that only has a width or height of 1. This fixes issues with things like 1x1 rectangles displaying incorrectly during rendering. Fix #4126 (thanks @rexrainbow) +* `InputManager.resetCursor` will now check if the canvas element still exists before resetting the cursor on it. Fix #4662 (thanks @fromnowhereuser) +* It was not possible to set the zoom value of the Scale Manager back to 1 again, having changed it to a different value. Fix #4633 (thanks @lgibson02 @BinaryMoon) ### Examples, Documentation and TypeScript My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs: -@vacarsu @KennethGomez @samme @ldd @Jazcash - - +@vacarsu @KennethGomez @samme @ldd @Jazcash @jcyuan @LearningCode2023 @PhaserEditor2D ## Version 3.18.1 - Raphtalia - 20th June 2019 diff --git a/README.md b/README.md index b15baca9d..e70376d98 100644 --- a/README.md +++ b/README.md @@ -22,17 +22,17 @@ Grab the source and join the fun!
-> 20th June 2019 +> 8th August 2019 -After another month of hard work, we're very happy to announce the release of Phaser 3.18. In this release we took the time to rewrite large chunks of the Input API. This allowed us to fix a number of issues that had arisen, as well as optimizing the internal event flow. Native support for complete Multi-Touch support, Mouse Wheels and more advanced Pointer Button handling are now available. The whole API is smaller and tidier after the clean-up, which is always a good thing. +I'm pleased to announce that Phaser 3.19 is now available. This release includes our brand new Spine plugin. Spine allows you to bring animation to life in your games, offering a dedicated 2D skeletal animation system and workflow. Our plugin makes integration with Phaser seamless and is fully updated for the Spine 3.7 Runtimes with support for WebGL and Canvas renderers. This version will properly batch Spine skeletons where possible, potentially saving hundreds of draw calls. The plugin is fully documented and exports both debug and minified files, suitable for ES6 'importing' or ES5 plugin inclusion. The whole plugin is just 68KB in size (min+gz), or a paltry 57KB if you only need the Canvas renderer! That's a really tiny payload for such a massive feature-set. You can find out more about Spine from the [Esoteric Software website](http://esotericsoftware.com/). -We've also added lots of other features and updates, including better Matter physics constraint handling, Arcade Physics improvements, Audio decoding events, Text justification, new Bounds methods and a lot, lot more. As usual, it doesn't end there, though. You'll find hundreds of great new features, updates and fixes. So, as usual, please do spend some time digging through the [Change Log](#changelog). I assure you, it's worth while :) +3.19 also introduces a huge overhaul to the Tween system. Tweens now have 100% documentation and we've extended their capabilities significantly. There are lots of new Tween Events to listen for, such as 'COMPLETE' or 'REPEAT' to allow you to trigger actions without needing to create callbacks. Tweens can now tween both 'from' and 'to' a value, with the ability to set a starting value for any tweened property. There are lots of new handy methods and properties, such as `Tween.hasStarted` and a rewrite of the Tween seeking function, so it now allows you to seek to any point in time across a tween. Finally, we've added in the great new 'StaggerBuilder'. This allows you to easily add staggered offsets to a bunch of tween targets, including all kinds of options such as staggering across a grid layout, stagger directions, starting values and a lot more. Please see the docs and examples for more details. -If you're coming from an earlier release then you may not be aware of what the previous release, 3.17, included. It was a huge release, introducing some big new features. The first was that we moved the DOM Element Game Objects from the 'experimental' flag they were previously hidden under, finished them off, fully documented them and moved them to main. DOM Elements are a great way to layer HTML content over the top of your game and control it, just as if it was a standard Game Object. Have a look at the demos, read the docs and get stuck-in using them! +As usual, it doesn't end there, though :) Another very useful feature is `Shader.setRenderToTexture`. This allows you to redirect a shader to its own framebuffer / WebGL Texture instead of to the display list. This allows you to use the output of the shader as an input for another shader, by mapping a sampler2D uniform to it. It also allows you to save the Shader to the Texture Manager, allowing you to use it as a texture for any other texture based Game Object such as a Sprite. Combined with the new `setSampler2DBuffer` method you can now easily chain shaders together, using them as buffers for other shaders. -Also brand new in 3.17 were Shader Game Objects. Previously, if you wished to use a custom shader in your game, you'd have to create your own WebGL pipeline to handle it. Now, with 3.17, adding a shader is a single line of code - and what's more, you can manipulate them just like regular Game Objects, so they can be rotated, scaled, have hit areas and so on. As with DOM Elements please see the new examples and read the fully complete API Docs to learn how to use them. +One thing I've been seeing asked for a lot on the Phaser Discord is the ability to 'save' a Render Texture to an image. So, I added the new methods `RenderTexture.snapshot` and `snapshotArea`. This allows you to grab whatever is on the Render Texture at that point in time and turn it into an Image. You could then save this image to the Texture Manager, if needed, or just save it out to the filesystem, or transmit it to as web service. Great for things like avatar creators or art packages. -The final significant 3.17 feature came in the way of masks. Phaser 3 has always supported Bitmap and Geometry Masks, but using them was limited (you couldn't mask children inside Containers, for example), and they were pretty slow. After a lot of development they're now fully batched, meaning the same mask applied to thousands of game objects no longer impacts performance. They can also be nested and will restore the mask stack as they're used and what's more, you can now add masks to Cameras. This is a great feature in itself and opens up the possibility for lots of visual effects in your games. +You'll find loads more great new features, updates and fixes. So, as usual, please do spend some time digging through the [Change Log](#changelog). I assure you, it's worth while :) A massive thank-you to everyone who supports Phaser on Patreon and PayPal. Your continued backing has allowed me to work on Phaser all year, and this great new releases is the very real result of that. If you've ever considered becoming a backer, now is the perfect time! @@ -75,8 +75,9 @@ Extra special thanks to the following companies who's support makes Phaser possi * [Texture Packer](https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?utm_source=ad&utm_medium=banner&utm_campaign=phaser-2018-10-16) * [Twilio](https://www.twilio.com) * [Y8 Games](https://www.y8.com) +* [Poki](https://developers.poki.com/) -![Sponsors](https://phaser.io/images/github/sponsors-2019-05.png "Awesome Sponsors") +![Sponsors](https://phaser.io/images/github/sponsors-2019-08.png "Awesome Sponsors") ![Phaser Newsletter](https://phaser.io/images/github/div-newsletter.png "Phaser Newsletter") @@ -110,13 +111,13 @@ npm install phaser [Phaser is on jsDelivr](https://www.jsdelivr.com/projects/phaser) which is a "super-fast CDN for developers". Include the following in your html: ```html - + ``` or the minified version: ```html - + ``` ### API Documentation @@ -197,13 +198,13 @@ We've 3 tutorials related to Facebook Instant Games and Phaser: A special build of Phaser with the Facebook Instant Games Plugin ready-enabled is [available on jsDelivr](https://www.jsdelivr.com/projects/phaser). Include the following in your html: ```html - + ``` or the minified version: ```html - + ``` The build files are in the git repository in the `dist` folder, and you can also include the plugin in custom builds. @@ -220,7 +221,7 @@ Create an `index.html` page locally and paste the following code into it: - + @@ -331,210 +332,157 @@ You can then run `webpack` to create a development build in the `build` folder w # Change Log -## Version 3.18.1 - Raphtalia - 20th June 2019 +## Version 3.19.0 - Naofumi - 8th August 2019 -### Bug Fixes +### Tween Updates -* `InputManager.preRender` didn't get the `time` property correctly, causing input plugin methods that relied on it to fail. -* `KeyboardPlugin.time` wasn't being set to the correct value, causing `checkDown` to fail constantly. +* All Tween classes and functions have 100% complete JSDocs :) +* `StaggerBuilder` is a new function that allows you to define a staggered tween property. For example, as part of a tween config: `delay: this.tweens.stagger(500)` would stagger the delay by 500ms for every target of the tween. You can also provide a range: `delay: this.tweens.stagger([ 500, 1000 ])` which is spread across all targets. Finally, you can provide a Stagger Config object as the second argument. This allows you to define a stagger grid, direction, starting value and more. Please see the API Docs and new Examples for further details. +* `Tween` now extends the Event Emitter class, allowing it to emit its own events and be listened to. +* `Tween.ACTIVE_EVENT` is a new event that is dispatched when a tween becomes active. Listen to it with `tween.on('active')`. +* `Tween.COMPLETE_EVENT` is a new event that is dispatched when a tween completes or is stopped. Listen to it with `tween.on('complete')`. +* `Tween.LOOP_EVENT` is a new event that is dispatched when a tween loops, after any loop delay expires. Listen to it with `tween.on('loop')`. +* `Tween.REPEAT_EVENT` is a new event that is dispatched when a tween property repeats, after any repeat delay expires. Listen to it with `tween.on('repeat')`. +* `Tween.START_EVENT` is a new event that is dispatched when a tween starts. Listen to it with `tween.on('start')`. +* `Tween.UPDATE_EVENT` is a new event that is dispatched when a tween property updates. Listen to it with `tween.on('update')`. +* `Tween.YOYO_EVENT` is a new event that is dispatched when a tween property yoyos, after any hold delay expires. Listen to it with `tween.on('yoyo')`. +* `Tween.onActive` is a new callback that is invoked the moment the Tween Manager brings the tween to life, even though it may not have yet started actively tweening anything due to delay settings. +* `Tween.onStart` is now only invoked when the Tween actually starts tweening a value. Previously, it was invoked as soon as the Tween Manager activated the Tween. This has been recoded and this action is now handled by the `onActive` callback. Fix #3330 (thanks @wtravO) +* `Tween.seek` has been rewritten so you can now seek to any point in the Tween, regardless of repeats, loops, delays and hold settings. Seeking will not invoke any callbacks or events during the seek. Fix #4409 (thanks @cristib84) +* You can now set `from` and `to` values for a property, i.e. `alpha: { from: 0, to: 1 }` which would set the alpha of the target to 0 and then tween it to 1 _after_ any delays have expired. Fix #4493 (thanks @BigZaphod) +* You can now set `start` and `to` values for a property, i.e. `alpha: { start: 0, to: 1 }` which would set the alpha of the target to 0 immediately, as soon as the Tween becomes active, and then tween it to 1 over the duration of the tween. +* You can now set `start`, `from` and `to` values for a property, i.e. `alpha: { start: 0, from: 0.5, to: 1 }` which would set the alpha of the target to 0 immediately, as soon as the Tween becomes active, then after any delays it would set the alpha to 0.5 and then tween it to 1 over the duration of the Tween. +* `Tween.hasStarted` is a new property that holds a flag signifying if the Tween has started or not. A Tween that has started is one that is actively tweening a property and not just in a delayed state. +* `Tween.startDelay` is a new property that is set during the Tween init to hold the shortest possible time before the Tween will start tweening a value. It is decreased each update until it hits zero, after which the `onStart` callback is invoked. +* `Tween.init` and `Tween.play` have been rewritten so they are not run multiple times when a Tween is paused before playback, or is part of a Timeline. This didn't cause any problems previously, but it was a redundant duplication of calls. +* `Tween.onLoop` will now be invoked _after_ the `loopDelay` has expired, if any was set. +* `Tween.onRepeat` will now be invoked _after_ the `repeatDelay` has expired, if any was set. +* `easeParams` would be ignored for tweens that _didn't_ use a string for the ease function name. Fix #3826 (thanks @SBCGames) +* You can now specify `easeParams` for any custom easing function you wish to use. Fix #3826 (thanks @SBCGames) +* All changes to `Tween.state` are now set _before_ any events or callbacks, allowing you to modify the state of the Tween in those handlers (thanks @Cudabear) +* `Tween.dispatchTweenEvent` is a new internal method that handles dispatching the new Tween Events and callbacks. This consolidates a lot of duplicate code into a single method. +* `Tween.dispatchTweenDataEvent` is a new internal method that handles dispatching the new TweenData Events and callbacks. This consolidates a lot of duplicate code into a single method. +* `Tween.isSeeking` is a new internal boolean flag that is used to keep track of the seek progress of a Tween. +* `Timeline.onLoop` will now be invoked _after_ the `loopDelay` has expired, if any was set. +* `Timeline.onComplete` will now be invoked _after_ the `completeDelay` has expired, if any was set. +* All changes to `Timeline.state` are now set _before_ any events or callbacks, allowing you to modify the state of the Timeline in those handlers. +* The `TIMELINE_LOOP_EVENT` has had the `loopCounter` argument removed from it. It didn't actually send the number of times the Timeline had looped (it actually sent the total remaining). +* When a TweenData completes it will now set the `current` property to be exactly either `start` or `end` depending on playback direction. +* When a TweenData completes it will set the exact `start` or `end` value into the target property. +* `TweenData` has a new function signature, with the new `index` and `getActive`arguments added to it. `TweenBuilder` has been updated to set these, but if you create any TweenData objects directly, use the new signature. +* `TweenData.getActiveValue` is a new property that, if not null, returns a value to immediately sets the property value to on activation. +* `GetEaseFunction`, and by extension anything that uses it, such as setting the ease for a Tween, will now accept a variety of input strings as valid. You can now use lower-case, such as `back`, and omit the 'ease' part of the direction, such as `back.in` or `back.inout`. +* The signature of `getStart` and `getEnd` custom property functions has changed to `(target, key, value, targetIndex, totalTargets, tween)`, previously it was just `(target, key, value)`. Custom functions don't need to change as the new arguments are in addition to those sent previously. +* The signature of the LoadValue generator functions (such as `delay` and `repeat`) has changed to `(target, key, value, targetIndex, totalTargets, tween)` to match those of the custom property functions. If you used a custom generator function for your Tween configs you'll need to modify the signature to the new one. +* Tweens created via `TweenManager.create` wouldn't start when `Tween.play` was called without first making them active manually. They now start automatically. Fix #4632 (thanks @mikewesthad) -## Version 3.18.0 - Raphtalia - 19th June 2019 +### Spine Updates -### Input System Changes +The Spine Plugin is now 100% complete. It has been updated to use the Spine 3.7 Runtimes. Improvements have been made across the entire plugin, including proper batched rendering support in WebGL, cleaner skin and slot functions and lots and lots of updates. It's fully documented and there are lots of examples to be found. The following legacy bugs have also been fixed: -#### Mouse Wheel Support - -3.18 now includes native support for reading mouse wheel events. - -* `POINTER_WHEEL` is a new event dispatched by the Input Plugin allowing you to listen for global wheel events. -* `GAMEOBJECT_WHEEL` is a new event dispatched by the Input Plugin allowing you to listen for global wheel events over all interactive Game Objects in a Scene. -* `GAMEOBJECT_POINTER_WHEEL` is a new event dispatched by a Game Object allowing you to listen for wheel events specifically on that Game Object. -* `Pointer.deltaX` is a new property that holds the horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. -* `Pointer.deltaY` is a new property that holds the vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. -* `Pointer.deltaZ` is a new property that holds the z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device. -* `Pointer.wheel` is a new internal method that handles the wheel event. -* `InputManager.onMouseWheel` is a new internal method that handles processing the wheel event. -* `InputManager.processWheelEvent` is a new internal method that handles processing the wheel event sent by the Input Manager. - -#### Button Released Support - -* `Pointer.button` is a new property that indicates which button was pressed, or released, on the pointer during the most recent event. It is only set during `up` and `down` events and is always 0 for Touch inputs. -* `Pointer.leftButtonReleased` is a new method that returns `true` if it was the left mouse button that was just released. This can be checked in a `pointerup` event handler to find out which button was released. -* `Pointer.rightButtonReleased` is a new method that returns `true` if it was the right mouse button that was just released. This can be checked in a `pointerup` event handler to find out which button was released (thanks @BobtheUltimateProgrammer) -* `Pointer.middleButtonReleased` is a new method that returns `true` if it was the middle mouse button that was just released. This can be checked in a `pointerup` event handler to find out which button was released. -* `Pointer.backButtonReleased` is a new method that returns `true` if it was the back mouse button that was just released. This can be checked in a `pointerup` event handler to find out which button was released. -* `Pointer.forwardButtonReleased` is a new method that returns `true` if it was the forward mouse button that was just released. This can be checked in a `pointerup` event handler to find out which button was released. - -#### Input System Bug Fixes - -* Calling `setPollAlways()` would cause the `'pointerdown'` event to fire multiple times. Fix #4541 (thanks @Neyromantik) -* The pointer events were intermittently not registered, causing `pointerup` to often fail. Fix #4538 (thanks @paulsymphony) -* Due to a regression in 3.16 the drag events were not performing as fast as before, causing drags to feel lagged. Fix #4500 (thanks @aliblong) -* The Touch Manager will now listen for Touch Cancel events on the Window object (if `inputWindowEvents` is enabled in the game config, which it is by default). This allows it to prevent touch cancel actions, like opening the dock on iOS, from causing genuinely active pointers to enter an active locked state. -* Over and Out events now work for any number of pointers in multi-touch environments, not just the first touch pointer registered. They also now fire correctly on touch start and touch end / cancel events. -* If you enable a Game Object for drag and place it inside a rotated Container (of any depth), the `dragX` and `dragY` values sent to the `drag` callback didn't factor the rotation in, so you had to do it manually. This is now done automatically, so the values account for parent rotation before being sent to the event handler. Fix #4437 (thanks @aliblong) - -#### Input System API Changes - -The old 'input queue' legacy system, which was deprecated in 3.16, has been removed entirely in order to tidy-up the API and keep input events consistent. This means the following changes: - -* Removed the `inputQueue` Game config property. -* Removed the `useQueue`, `queue` and `_updatedThisFrame` properties from the Input Manager. -* Removed the `legacyUpdate` and `update` methods from the Input Manager. -* Removed the `ignoreEvents` property as this should now be handled on a per-event basis. -* The Input Manager no longer listens for the `GameEvents.POST_STEP` event. -* The following Input Manager methods are no longer required so have been removed: `startPointer`, `updatePointer`, `stopPointer` and `cancelPointer`. - -As a result, all of the following Input Manager methods have been renamed: - -* `queueTouchStart` is now called `onTouchStart` and invoked by the Touch Manager. -* `queueTouchMove` is now called `onTouchMove` and invoked by the Touch Manager. -* `queueTouchEnd` is now called `onTouchEnd` and invoked by the Touch Manager. -* `queueTouchCancel` is now called `onTouchCancel` and invoked by the Touch Manager. -* `queueMouseDown` is now called `onMouseDown` and invoked by the Mouse Manager. -* `queueMouseMove` is now called `onMouseMove` and invoked by the Mouse Manager. -* `queueMouseUp` is now called `onMouseUp` and invoked by the Mouse Manager. - -Each of these handlers used to check the `enabled` state of the Input Manager, but this now handled directly in the Touch and Mouse Managers instead, leading to less branching and cleaner tests. They also all used to run an IIFE that updated motion on the changed pointers array, but this is now handled directly in the event handler, allowing it to be removed from here. - -Because the legacy queue mode is gone, there is no longer any need for the DOM Callbacks: - -* Removed the `_hasUpCallback`, `_hasDownCallback` and `_hasMoveCallback` properties from the Input Manager -* Removed the `processDomCallbacks`, `addDownCallback`, `addUpCallback`, `addMoveCallback`, `domCallbacks`, `addDownCallback`, `addUpCallback` and `addMoveCallback` methods. - -Also, CSS cursors can now be set directly: - -* Cursors are now set and reset immediately on the canvas, leading to the removal of `_setCursor` and `_customCursor` properties. - -The following changes took place in the Input Plugin class: - -* The method `processDragEvents` has been removed as it's now split across smaller, more explicit methods. -* `processDragDownEvent` is a new method that handles a down event for drag enabled Game Objects. -* `processDragMoveEvent` is a new method that handles a move event for drag enabled Game Objects. -* `processDragUpEvent` is a new method that handles an up event for drag enabled Game Objects. -* `processDragStartList` is a new internal method that builds a drag list for a pointer. -* `processDragThresholdEvent` is a new internal method that tests when a pointer with drag thresholds can drag. -* `processOverEvents` is a new internal method that handles when a touch pointer starts and checks for over events. -* `processOutEvents` is a new internal method that handles when a touch pointer stops and checks for out events. - -The following changes took place in the Pointer class: - -* `Pointer.dirty` has been removed as it's no longer required. -* `Pointer.justDown` has been removed as it's not used internally and makes no sense under the DOM event system. -* `Pointer.justUp` has been removed as it's not used internally and makes no sense under the DOM event system. -* `Pointer.justMoved` has been removed as it's not used internally and makes no sense under the DOM event system. -* The `Pointer.reset` method has been removed as it's no longer required internally. -* `Pointer.touchstart` now has two arguments, the Touch List entry and the Touch Event. The full Touch Event is now stored in `Pointer.event` (instead of the Touch List entry). -* `Pointer.touchmove` now has two arguments, the Touch List entry and the Touch Event. The full Touch Event is now stored in `Pointer.event` (instead of the Touch List entry). -* `Pointer.touchend` now has two arguments, the Touch List entry and the Touch Event. The full Touch Event is now stored in `Pointer.event` (instead of the Touch List entry). -* `Pointer.touchcancel` now has two arguments, the Touch List entry and the Touch Event. The full Touch Event is now stored in `Pointer.event` (instead of the Touch List entry). +* Adding Spine to physics causes position to become NaN. Fix #4501 (thanks @hizzd) +* Destroying a Phaser Game instance and then re-creating it would cause an error trying to re-create Spine Game Objects ("Cannot read property get of null"). Fix #4532 (thanks @Alex-Badea) +* Rendering a Spine object when a Camera has `renderToTexture` enabled on it would cause the object to be vertically flipped. It now renders correctly in both cases. Fix #4647 (thanks @probt) ### New Features -* `Matter.Factory.velocity` is a new method that allows you to set the velocity on a Matter Body directly. -* `Matter.Factory.angularVelocity` is a new method that allows you to set the angular velocity on a Matter Body directly. -* `Matter.Factory.force` is a new method that allows you to apply a force from a world position on a Matter Body directly. -* `GetBounds.getTopCenter` is a new method that will return the top-center point from the bounds of a Game Object. -* `GetBounds.getBottomCenter` is a new method that will return the bottom-center point from the bounds of a Game Object. -* `GetBounds.getLeftCenter` is a new method that will return the left-center point from the bounds of a Game Object. -* `GetBounds.getRightCenter` is a new method that will return the right-center point from the bounds of a Game Object. -* You can now create a desynchronized 2D or WebGL canvas by setting the Game Config property `desynchronized` to `true` (the default is `false`). For more details about what this means see https://developers.google.com/web/updates/2019/05/desynchronized. -* The CanvasRenderer can now use the `transparent` Game Config property in order to tell the browser an opaque background is in use, leading to faster rendering in a 2D context. -* `GameObject.scale` is a new property, that exists as part of the Transform component, that allows you to set the horizontal and vertical scale of a Game Object via a setter, rather than using the `setScale` method. This is handy for uniformly scaling objects via tweens, for example. -* `Base64ToArrayBuffer` is a new utility function that will convert a base64 string into an ArrayBuffer. It works with plain base64 strings, or those with data uri headers attached to them. The resulting ArrayBuffer can be fed to any suitable function that may need it, such as audio decoding. -* `ArrayBufferToBase64` is a new utility function that converts an ArrayBuffer into a base64 string. You can also optionally included a media type, such as `image/jpeg` which will result in a data uri being returned instead of a plain base64 string. -*`WebAudioSoundManager.decodeAudio` is a new method that allows you to decode audio data into a format ready for playback and stored in the audio cache. The audio data can be provided as an ArrayBuffer, a base64 string or a data uri. Listen for the events to know when the data is ready for use. -* `Phaser.Sound.Events#DECODED` is a new event emitted by the Web Audio Sound Manager when it has finished decoding audio data. -* `Phaser.Sound.Events#DECODED_ALL` is a new event emitted by the Web Audio Sound Manager when it has finished decoding all of the audio data files passed to the `decodeAudio` method. -* `Phaser.Utils.Objects.Pick` is a new function that will take an object and an array of keys and return a new object containing just the keys provided in the array. -* `Text.align` and `Text.setAlign` can now accept `justify` as a type. It will apply basic justification to multi-line text, adding in extra spaces in order to justify the content. Fix #4291 (thanks @andrewbaranov @Donerkebap13 @dude78GH) -* `Arcade.Events.WORLD_STEP` is a new event you can listen to. It is emitted by the Arcade Physics World every time the world steps once. It is emitted _after_ the bodies and colliders have been updated. Fix #4289 (thanks @fant0m) +* `Shader.setRenderToTexture` is a new method that will redirect the Shader to render to its own framebuffer / WebGLTexture instead of to the display list. This allows you to use the output of the shader as an input for another shader, by mapping a sampler2D uniform to it. It also allows you to save the Shader to the Texture Manager, allowing you to use it as a texture for any other texture based Game Object such as a Sprite. +* `Shader.setSampler2DBuffer` is a new method that allows you to pass a WebGLTexture directly into a Shader as a sampler2D uniform, such as when linking shaders together as buffers for each other. +* `Shader.renderToTexture` is a new property flag that is set if you set the Shader to render to a texture. +* `Shader.framebuffer` is a new property that contains a WebGLFramebuffer reference which is set if you set the Shader to render to a texture. +* `Shader.glTexture` is a new property that contains a WebGLTexture reference which is set if you set the Shader to render to a texture. +* `Shader.texture` is a new property that contains a Phaser Texture reference which is set if you set the Shader to save to the Texture Manager. +* `TextureManager.addGLTexture` is a new method that allows you to add a WebGLTexture directly into the Texture Manager, saved under the given key. +* `TextureSource.isGLTexture` is a new boolean property that reflects if the data backing the underlying Texture Source is a WebGLTexture or not. +* `TextureTintPipeline.batchSprite` will now flip the UV if the TextureSource comes from a GLTexture. +* `Math.ToXY` is a new mini function that will take a given index and return a Vector2 containing the x and y coordinates of that index within a grid. +* `RenderTexture.glTexture` is a new property that holds a reference to the WebGL Texture being used by the Render Texture. Useful for passing to a shader as a sampler2D. +* `GroupCreateConfig.quantity` - when creating a Group using a config object you can now use the optional property `quantity` to set the number of objects to be created. Use this for quickly creating groups of single frame objects that don't need the advanced capabilities of `frameQuantity` and `repeat`. +* `Pointer.locked` is a new read-only property that indicates if the pointer has been Pointer Locked, or not, via the Pointer Lock API. +* `WebGLRenderer.snapshotFramebuffer`, and the corresponding utility function `WebGLSnapshot`, allows you to take a snapshot of a given WebGL framebuffer, such as the one used by a Render Texture or Shader, and either get a single pixel from it as a Color value, or get an area of it as an Image object, which can then optionally be saved to the Texture Manager for use by Game Object textures. +* `CanvasRenderer.snapshotCanvas` allows you to take a snapshot of a given Canvas object, such as the one used by a Render Texture, and either get a single pixel from it as a Color value, or get an area of it as an Image object, which can then optionally be saved to the Texture Manager for use by Game Object textures. +* `RenderTexture.snapshot` is a new method that will take a snapshot of the whole current state of the Render Texture and return it as an Image object, which could then be saved to the Texture Manager if needed. +* `RenderTexture.snapshotArea` is a new method that will take a snapshot of an area of a Render Texture and return it as an Image object, which could then be saved to the Texture Manager if needed. +* `RenderTexture.snapshotPixel` is a new method that will take extract a single pixel color value from a Render Texture and return it as a Color object. +* The `SnapshotState` object has three new properties: `isFramebuffer` boolean and `bufferWidth` and `bufferHeight` integers. +* `Game.CONTEXT_LOST_EVENT` is a new event that is dispatched by the Game instance when the WebGL Renderer webgl context is lost. Use this instead of the old 'lostContextCallbacks' for cleaner context handling. +* `Game.CONTEXT_RESTORED_EVENT` is a new event that is dispatched by the Game instance when the WebGL Renderer webgl context is restored. Use this instead of the old 'restoredContextCallbacks' for cleaner context handling. +* `WebGLRenderer.currentType` contains the type of the Game Object currently being rendered. +* `WebGLRenderer.newType` is a boolean that indicates if the current Game Object has a new type, i.e. different to the previous one in the display list. +* `WebGLRenderer.nextTypeMatch` is a boolean that indicates if the _next_ Game Object in the display list has the same type as the one being currently rendered. This allows you to build batching into separated Game Objects. +* `PluginManager.removeGameObject` is a new method that allows you to de-register custom Game Object types from the global Game Object Factory and/or Creator. Useful for when custom plugins are destroyed and need to clean-up after themselves. +* `GEOM_CONST` is a new constants object that contains the different types of Geometry Objects, such as `RECTANGLE` and `CIRCLE`. +* `Circle.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Ellipse.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Line.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Point.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Polygon.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Rectangle.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `Triangle.type` is a new property containing the shapes geometry type, which can be used for quick type comparisons. +* `InputPlugin.enableDebug` is a new method that will create a debug shape for the given Game Objects hit area. This allows you to quickly check the size and placement of an input hit area. You can customzie the shape outline color. The debug shape will automatically track the Game Object to which it is bound. +* `InputPlugion.removeDebug` will remove a Debug Input Shape from the given Game Object and destroy it. +* `Pointer.updateWorldPoint` is a new method that takes a Camera and then updates the Pointers `worldX` and `worldY` values based on the cameras transform (thanks @Nick-lab) +* `ScaleManager._resetZoom` is a new internal flag that is set when the game zoom factor changes. +* `Texture.remove` is a new method that allows you to remove a Frame from a Texture based on its name. Fix #4460 (thanks @BigZaphod) ### Updates -* `Zones` will now use the new `customHitArea` property introduced in 3.17 to avoid their hit areas from being resized if you specified your own custom hit area (thanks @rexrainbow) -* The default `BaseShader` vertex shader has a new uniform `uResolution` which is set during the Shader init and load to be the size of the Game Object to which the shader is bound. -* The default `BaseShader` vertex shader will now set the `fragCoord` varying to be the Game Object height minus the y inPosition. This will give the correct y axis in the fragment shader, causing 'inverted' shaders to display normally when using the default vertex code. -* There was some test code left in the `DOMElementCSSRenderer` file that caused `getBoundingClientRect` to be called every render. This has been removed, which increases performance significantly for DOM heavy games. -* The `TimeStep` will no longer set its `frame` property to zero in the `resetDelta` method. Instead, this property is incremented every step, no matter what, giving an accurate indication of exactly which frame something happened on internally. -* The `TimeStep.step` method no longer uses the time value passed to the raf callback, as it's not actually the current point in time, but rather the time that the main thread began at. Which doesn't help if we're comparing it to event timestamps. -* `TimeStep.now` is a new property that holds the exact `performance.now` value, as set at the start of the current game step. -* `Matter.Factory.fromVertices` can now take a vertices path string as its `vertexSets` argument, as well as an array of vertices. -* `GetBounds.prepareBoundsOutput` is a new private method that handles processing the output point. All of the bounds methods now use this, allowing us to remove a lot of duplicated code. -* The PluginManager will now display a console warning if it skips installing a plugin (during boot) because the plugin value is missing or empty (thanks @samme) -* When creating a Matter Constraint via the Factory you can now optionally provide a `length`. If not given, it will determine the length automatically from the position of the two bodies. -* When creating a Matter Game Object you can now pass in a pre-created Matter body instead of a config object. -* When Debug Draw is enabled for Arcade Physics it will now use `Graphics.defaultStrokeWidth` to drawn the body with, this makes static bodies consistent with dynamic ones (thanks @samme) -* `Group.name` is a new property that allows you to set a name for a Group, just like you can with all other Game Objects. Phaser itself doesn't use this, it's there for you to take advantage of (thanks @samme) -* Calling `ScaleManager.setGameSize` will now adjust the size of the canvas element as well. Fix #4482 (thanks @sudhirquestai) -* `Scale.Events.RESIZE` now sends two new arguments to the handler: `previousWidth` and `previousHeight`. If, and only if, the Game Size has changed, these arguments contain the previous size, before the change took place. -* The Camera Manager has a new method `onSize` which is invoked by handling the Scale Manager `RESIZE` event. When it receives it, it will iterate the cameras it manages. If the camera _doesn't_ have a custom offset and _is_ the size of the game, then it will be automatically resized for you. This means you no longer need to call `this.cameras.resize(width, height)` from within your own resize handler, although you can still do so if you wish, as that will resize _every_ Camera being managed to the new size, instead of just 'full size' cameras. -* `Graphics.translate` has been renamed to `Graphics.translateCanvas` to make it clearer what it's actually translating (i.e. the drawing buffer, not the Graphics object itself) -* `Graphics.scale` has been renamed to `Graphics.scaleCanvas` to make it clearer what it's actually scaling (i.e. the drawing buffer, not the Graphics object itself) -* `Graphics.rotate` has been renamed to `Graphics.rotateCanvas` to make it clearer what it's actually rotating (i.e. the drawing buffer, not the Graphics object itself) -* The `width` and `height` of an Arc / Circle Shape Game Object is now set to be the diameter of the arc, not the radius (thanks @rexrainbow) -* `LineStyleCanvas` now takes an `altColor` argument which is used to override the context color. -* `LineStyleCanvas` now takes an `altAlpha` argument which is used to override the context alpha. -* `FillStyleCanvas` now takes an `altAlpha` argument which is used to override the context alpha. -* `StaticPhysicsGroup` can now take a `classType` property in its Group Config and will use the value of it, rather than override it. If none is provided it'll default to `ArcadeSprite`. Fix #4401 (thanks @Legomite) -* `Phaser.Tilemaps.Parsers.Tiled` used to run the static function `ParseJSONTiled`. `Parsers.Tiled` is now just a namespace, so access the function within it: `Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled`. -* `Phaser.Tilemaps.Parsers.Impact` used to run the static function `ParseWeltmeister`. `Parsers.Impact` is now just a namespace, so access the function within it: `Phaser.Tilemaps.Parsers.Impact.ParseWeltmeister`. -* `Phaser.Tilemaps.Parsers.Tiled.AssignTileProperties` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Tiled.Base64Decode` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Tiled.BuildTilesetIndex` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Tiled.ParseGID` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Tiled.ParseImageLayers` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Tiled.ParseObject` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Tiled.ParseObjectLayers` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Tiled.ParseTileLayers` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Tiled.ParseTilesets` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Tiled.ParseTilesets` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Impact.ParseTileLayers` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Impact.ParseTilesets` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Impact.ParseWeltmeister` is now a public static function, available to be called directly. -* `Phaser.Tilemaps.Parsers.Tiled.Pick` has been removed. It is now available under `Phaser.Utils.Objects.Pick`, which is a more logical place for it. -* You can now call `this.scene.remove` at the end of a Scene's `create` method without it throwing an error. Why you'd ever want to do this is beyond me, but you now can (thanks @samme) -* The `Arcade.StaticBody.setSize` arguments have changed from `(width, height, offsetX, offsetY)` to `(width, height, center)`. They now match Dynamic Body setSize and the Size Component method (thanks @samme) -* When enabling Arcade Physics Body debug it will now draw only the faces marked for collision, allowing you to easily see if a face is disabled or not (thanks @BdR76) -* `Transform.getParentRotation` is a new method available to all GameObjects that will return the sum total rotation of all of the Game Objects parent Containers, if it has any. -* `Tween.restart` now sets the Tween properties `elapsed`, `progress`, `totalElapsed` and `totalProgress` to zero when called, rather than adding to existing values should the tween already be running. -* `ArcadePhysics.Body.resetFlags` is a new method that prepares the Body for a physics step by resetting the `wasTouching`, `touching` and `blocked` states. -* `ArcadePhysics.Body.preUpdate` has two new arguments `willStep` and `delta`. If `willStep` is true then the body will call resetFlags, sync with the parent Game Object and then run one iteration of `Body.update`, using the provided delta. If false, only the Game Object sync takes place. -* `ArcadePhysics.World.update` will now determine if a physics step is going to happen this frame or not. If not, it no longer calls `World.step` (fix #4529, thanks @ampled). If a step _is_ going to happen, then it now handles this with one iteration of the bodies array, instead of two. It has also inlined a single world step, avoiding branching out. If extra world steps are required this frame (such as in high Hz environments) then `World.step` is called accordingly. -* `ArcadePhysics.World.postUpdate` will no longer call `Body.postUpdate` on all of the bodies if no World step has taken place this frame. -* `ArcadePhysics.World.step` will now increment the `stepsLastFrame` counter, allowing `postUpdate` to determine if bodies should be processed should World.step have been invoked manually. +* When calling `setHitArea` and not providing a shape (i.e. a texture based hit area), it will now set `customHitArea` to `false` by default (thanks @rexrainbow) +* The Shader will no longer set uniforms if the values are `null`, saving on GL ops. +* The Animation Manager will now emit a console warning if you try and play an animation on a Sprite that doesn't exist. +* The Animation component will no longer start an animation on a Sprite if the animation doesn't exist. Previously it would throw an error saying "Unable to read the property getFirstTick of null". +* `InputManager.onPointerLockChange` is a new method that handles pointer lock change events and dispatches the lock event. +* `CanvasTexture` has been added to the `Textures` namespace so it can be created without needing to import it. The correct way to create a `CanvasTexture` is via the Texture Manager, but you can now do it directly if required. Fix #4651 (thanks @Jugacu) +* The `SmoothedKeyControl` minimum zoom a Camera can go to is now 0.001. Previously it was 0.1. This is to make it match the minimum zoom a Base Camera can go to. Fix #4649 (thanks @giviz) +* `WebGLRenderer.lostContextCallbacks` and the `onContextLost` method have been removed. Please use the new `CONTEXT_LOST` event instead. +* `WebGLRenderer.restoredContextCallbacks` and the `onContextRestored` method have been removed. Please use the new `CONTEXT_RESTORED` event instead. +* `TextureManager.getBase64` will now emit a console warning if you try to get a base64 from a non-image based texture, such as a WebGL Texture. +* The `WebAudioSoundManager` will now remove the document touch handlers even if the Promise fails, preventing it from throwing a rejection handler error. +* `GameObjectFactory.remove` is a new static function that will remove a custom Game Object factory type. +* `GameObjectCreator.remove` is a new static function that will remove a custom Game Object creator type. +* `CanvasTexture.getPixels` now defaults to 0x0 by width x height as the default area, allowing you to call the method with no arguments to get all the pixels for the canvas. +* `CreateDOMContainer` will now use `div.style.cssText` to set the inline styles of the container, so it now works on IE11. Fix #4674 (thanks @DanLiamco) +* `TransformMatrix.rotation` now returns the properly normalized rotation value. +* `PhysicsEditorParser` has now been exposed under the `Phaser.Physics.Matter` namespace, so you can call methods on it directly. +* Calling `CanvasTexture.update` will now automatically call `refresh` if running under WebGL. This happens for both `draw` and `drawFrame`, meaning you no longer need to remember to call `refresh` after drawing to a Canvas Texture in WebGL, keeping it consistent with the Canvas renderer. +* `Frame.destroy` will now null the Frames reference to its parent texture, glTexture and clear the data and customData objects. +* The Container renderer functions will now read the childs `alpha` property, instead of `_alpha`, allowing it to work with more variety of custom children. ### Bug Fixes -* Tweens created in a paused state couldn't be started by a call to `play`. Fix #4525 (thanks @TonioParis) -* If both Arcade Physics circle body positions and the delta equaled zero, the `separateCircle` function would cause the position to be set `NaN` (thanks @hizzd) -* The `CameraManager` would incorrectly destroy the `default` Camera in its shutdown method, meaning that if you used a fixed mask camera and stopped then resumed a Scene, the masks would stop working. The default camera is now destroyed only in the `destroy` method. Fix #4520 (thanks @telinc1) -* Passing a Frame object to `Bob.setFrame` would fail, as it expected a string or integer. It now checks the type of object, and if a Frame it checks to make sure it's a Frame belonging to the parent Blitter's texture, and if so sets it. Fix #4516 (thanks @NokFrt) -* The ScaleManager full screen call had an arrow function in it. Despite being within a conditional block of code it still broke really old browsers like IE11, so has been removed. Fix #4530 (thanks @jorbascrumps @CNDW) -* `Game.getTime` would return `NaN` because it incorrectly accessed the time value from the TimeStep. -* Text with a `fixedWidth` or `fixedHeight` could cause the canvas to be cropped if less than the size of the Text itself (thanks @rexrainbow) -* Changing the `radius` of an Arc Game Object wouldn't update the size, causing origin issues. It now updates the size and origin correctly in WebGL. Fix #4542 (thanks @@PhaserEditor2D) -* Setting `padding` in a Text style configuration object would cause an error about calling split on undefined. Padding can now be applied both in the config and via `setPadding`. -* `Tilemap.createBlankDynamicLayer` would fail if you provided a string for the tileset as the base tile width and height were incorrectly read from the tileset argument. Fix #4495 (thanks @jppresents) -* `Tilemap.createDynamicLayer` would fail if you called it without setting the `x` and `y` arguments, even though they were flagged as being optional. Fix #4508 (thanks @jackfreak) -* `RenderTexture.draw` didn't work if no `x` and `y` arguments were provided, even though they are optional, due to a problem with the way the frame cut values were added. The class has been refactored to prevent this, fixing issues like `RenderTexture.erase` not working with Groups. Fix #4528 (thanks @jbgomez21 @telinc1) -* The `Grid` Game Object wouldn't render in Canvas mode at all. Fix #4585 (thanks @fyyyyy) -* If you had a `Graphics` object in the display list immediately after an object with a Bitmap Mask it would throw an error `Uncaught TypeError: Cannot set property 'TL' of undefined`. Fix #4581 (thanks @Petah @Loonride) -* Calling Arcade Physics `Body.reset` on a Game Object that doesn't have any bounds, like a Container, would throw an error about being unable to access `getTopLeft`. If this is the case, it will now set the position to the given x/y values (thanks Jazz) -* All of the `Tilemaps.Parsers.Tiled` static functions are now available to be called directly. Fix #4318 (thanks @jestarray) -* `Arcade.StaticBody.setSize` now centers the body correctly, as with the other similar methods. Fix #4213 (thanks @samme) -* Setting `random: false` in a Particle Emitter config option no longer causes it to think random is true (thanks @samme) -* `Zone.setSize` didn't update the displayOrigin, causing touch events to be inaccurate as the origin was out. Fix #4131 (thanks @rexrainbow) -* `Tween.restart` wouldn't restart the tween properly. Fix #4594 (thanks @NokFrt) -* Looped Tween Timelines would mess-up the tween values on every loop repeat, causing the loop to fail. They now loop correctly due to a fix in the Tween.play method. Fix #4558 (thanks @peteroravec) -* `Timeline.setTimeScale` would only impact the Timeline loop and completion delays, not the actively running Tweens. It now scales the time for all child tweens as well. Fix #4164 (thanks @garethwhittaker) +* The Scale Manager would throw the error 'TypeError: this.removeFullscreenTarget is not a function' when entering full-screen mode. It would still enter fullscreen, but the error would appear in the console. Fix #4605 (thanks @darklightcode) +* `Tilemap.renderDebug` was calling out-dated Graphics API methods, which would cause the debug to fail (thanks @Fabadiculous) +* The `Matter.Factory.constraint`, `joint` and `worldConstraint` methods wouldn't allow a zero length constraint to be created due to a falsey check of the length argument. You can now set length to be any value, including zero, or leave it undefined to have it automatically calculated (thanks @olilanz) +* `Pointer.getDuration` would return a negative / static value on desktop, or NaN on mobile, because the base time wasn't being pulled in from the Input Manager properly. Fix #4612 (thanks @BobtheUltimateProgrammer) +* `Pointer.downTime`, `Pointer.upTime` and `Pointer.moveTime` would be set to NaN on mobile browsers where Touch.timeStamp didn't exist. Fix #4612 (thanks @BobtheUltimateProgrammer) +* `WebGLRenderer.setScissor` will default the `drawingBufferHeight` if no argument is provided, stopping NaN scissor heights. +* If you called `Scene.destroy` within a Game Object `pointerdown` or `pointerup` handler, it would cause the error "Cannot read property 'game' of null" if the event wasn't cancelled in your handler. It now checks if the manager is still there before accessing its property. Fix #4436 (thanks @jcyuan) +* The `Arc / Circle` Game Object wasn't rendering centered correctly in WebGL due to an issue in a previous size related commit, it would be half a radius off. Fix #4620 (thanks @CipSoft-Components @rexrainbow) +* Destroying a Scene in HEADLESS mode would throw an error as it tried to access the gl renderer in the Camera class. Fix #4467 (thanks @AndreaBoeAbrahamsen @samme) +* `Tilemap.createFromObjects` would ignore the `scene` argument passed in to the method. It's now used (thanks @samme) +* Fixed a bug in the WebGL and Canvas Renderers where a Sprite with a `flipX` or `flipY` value set would render the offset frames slightly out of place, causing the animation to appear jittery. Also, the sprite would be out of place by its origin. Fix #4636 #3813 (thanks @jronn @B3L7) +* Animations with custom pivots, like those created in Texture Packer with the pivot option enabled, would be mis-aligned if flipped. They now render in the correct position, regardless of scale or flip on either axis. Fix #4155 (thanks @Zax37) +* Removing a frame from a 2 frame animation would cause an error when a Sprite using that animation next tried to render. Fix #4621 (thanks @orlicgms) +* Calling `Animation.setRepeat()` wouldn't reset the `repeatCounter` properly, causing Sprite bound animation instances to fail to change their repeat rate. Fix #4553 (thanks @SavedByZero) +* The `UpdateList.remove` method wouldn't flag the Game Object for removal properly if it was active. It now checks that the Game Object is in the current update list and hasn't already been inserted into the 'pending removal' list before flagging it. Fix #4544 (thanks @jcyuan) +* `DynamicTilemapLayer.destroy` will now no longer run its destroy sequence again if it has already been run once. Fix #4634 (thanks @CipSoft-Components) +* `StaticTilemapLayer.destroy` will now no longer run its destroy sequence again if it has already been run once. +* `Shader.uniforms` now uses Extend instead of Clone to perform a deep object copy, instead of a shallow one, avoiding multiple instances of the same shader sharing uniforms. Fix #4641 (thanks @davidmball) +* Calling `input.mouse.requestPointerLock()` will no longer throw an error about being unable to push to the Input Manager events queue. +* The `POINTERLOCK_CHANGE` event is now dispatched by the Input Manager again. +* The `Pointer.movementX` and `Pointer.movementY` properties are now taken directly from the DOM pointer event values, if the pointer is locked, and no longer incremental. Fix #4611 (thanks @davidmball) +* The `Pointer.velocity` and `Pointer.midPoint` values are now updated every frame. Based on the `motionFactor` setting they are smoothed towards zero, for velocity, and the pointer position for the mid point. This now happens regardless if the Pointer moves or not, which is how it was originally intended to behave. +* The `DESTROY` event hook wasn't removed from Group children when destroying the Group and `destroyChildren` was set to false. Now, the hook is removed regardless (thanks @rexrainbow) +* The WebGL Lost and Restored Context callbacks were never removed, which could cause them to hold onto stale references. Fix #3610 (thanks @Twilrom) +* `Origin.updateDisplayOrigin` no longer applies a Math.floor to the display origins, allowing you to have a 0.x origin for a Game Object that only has a width or height of 1. This fixes issues with things like 1x1 rectangles displaying incorrectly during rendering. Fix #4126 (thanks @rexrainbow) +* `InputManager.resetCursor` will now check if the canvas element still exists before resetting the cursor on it. Fix #4662 (thanks @fromnowhereuser) +* It was not possible to set the zoom value of the Scale Manager back to 1 again, having changed it to a different value. Fix #4633 (thanks @lgibson02 @BinaryMoon) ### Examples, Documentation and TypeScript My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs: -@PhaserEditor2D @samme @Nallebeorn @Punkiebe @rootasjey @Sun0fABeach +@vacarsu @KennethGomez @samme @ldd @Jazcash @jcyuan @LearningCode2023 @PhaserEditor2D Please see the complete [Change Log](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md) for previous releases. @@ -565,8 +513,8 @@ All rights reserved. "Above all, video games are meant to be just one thing: fun. Fun for everyone." - Satoru Iwata -[get-js]: https://github.com/photonstorm/phaser/releases/download/v3.18.1/phaser.js -[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v3.18.1/phaser.min.js +[get-js]: https://github.com/photonstorm/phaser/releases/download/v3.19.0/phaser.js +[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v3.19.0/phaser.min.js [clone-http]: https://github.com/photonstorm/phaser.git [clone-ssh]: git@github.com:photonstorm/phaser.git [clone-ghwin]: github-windows://openRepo/https://github.com/photonstorm/phaser diff --git a/dist/phaser-arcade-physics.js b/dist/phaser-arcade-physics.js index cd907c61e..e0d3217d9 100644 --- a/dist/phaser-arcade-physics.js +++ b/dist/phaser-arcade-physics.js @@ -91,7 +91,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1402); +/******/ return __webpack_require__(__webpack_require__.s = 1414); /******/ }) /************************************************************************/ /******/ ([ @@ -422,87 +422,6 @@ module.exports = GetFastValue; /* 3 */ /***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); - -/** - * @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 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 {Phaser.Geom.Point} 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; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -1139,7 +1058,7 @@ module.exports = Vector2; /***/ }), -/* 5 */ +/* 4 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -1149,8 +1068,172 @@ module.exports = Vector2; */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); +var GEOM_CONST = __webpack_require__(47); + +/** + * @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 {integer} + * @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 {Phaser.Geom.Point} 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; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Source object +// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' +// The default value to use if the key doesn't exist + +/** + * Retrieves a value from an object. + * + * @function Phaser.Utils.Objects.GetValue + * @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 GetValue = function (source, key, defaultValue) +{ + if (!source || typeof source === 'number') + { + return defaultValue; + } + else if (source.hasOwnProperty(key)) + { + return source[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parent = source; + var value = defaultValue; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parent.hasOwnProperty(keys[i])) + { + // Yes it has a key property, let's carry on down + value = parent[keys[i]]; + + parent = parent[keys[i]]; + } + else + { + // Can't go any further, so reset to default + value = defaultValue; + break; + } + } + + return value; + } + else + { + return defaultValue; + } +}; + +module.exports = GetValue; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -1321,80 +1404,17 @@ GameObjectFactory.register = function (factoryType, factoryFunction) } }; -PluginCache.register('GameObjectFactory', GameObjectFactory, 'add'); - -module.exports = GameObjectFactory; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Source object -// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' -// The default value to use if the key doesn't exist - -/** - * Retrieves a value from an object. - * - * @function Phaser.Utils.Objects.GetValue - * @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 GetValue = function (source, key, defaultValue) +GameObjectFactory.remove = function (factoryType) { - if (!source || typeof source === 'number') + if (GameObjectFactory.prototype.hasOwnProperty(factoryType)) { - return defaultValue; - } - else if (source.hasOwnProperty(key)) - { - return source[key]; - } - else if (key.indexOf('.') !== -1) - { - var keys = key.split('.'); - var parent = source; - var value = defaultValue; - - // Use for loop here so we can break early - for (var i = 0; i < keys.length; i++) - { - if (parent.hasOwnProperty(keys[i])) - { - // Yes it has a key property, let's carry on down - value = parent[keys[i]]; - - parent = parent[keys[i]]; - } - else - { - // Can't go any further, so reset to default - value = defaultValue; - break; - } - } - - return value; - } - else - { - return defaultValue; + delete GameObjectFactory.prototype[factoryType]; } }; -module.exports = GetValue; +PluginCache.register('GameObjectFactory', GameObjectFactory, 'add'); + +module.exports = GameObjectFactory; /***/ }), @@ -1661,6 +1681,349 @@ module.exports = { /* 10 */ /***/ (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; +} + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -1668,11 +2031,12 @@ module.exports = { */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(47); -var GetPoint = __webpack_require__(147); -var GetPoints = __webpack_require__(249); -var Line = __webpack_require__(54); -var Random = __webpack_require__(150); +var Contains = __webpack_require__(48); +var GetPoint = __webpack_require__(148); +var GetPoints = __webpack_require__(252); +var GEOM_CONST = __webpack_require__(47); +var Line = __webpack_require__(55); +var Random = __webpack_require__(151); /** * @classdesc @@ -1699,6 +2063,17 @@ var Rectangle = new Class({ 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 {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.RECTANGLE; + /** * The X coordinate of the top left corner of the Rectangle. * @@ -2156,349 +2531,6 @@ var Rectangle = new Class({ module.exports = Rectangle; -/***/ }), -/* 11 */ -/***/ (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; -} - - /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { @@ -2515,27 +2547,27 @@ if (true) { module.exports = { - Alpha: __webpack_require__(244), - Animation: __webpack_require__(479), - BlendMode: __webpack_require__(247), - ComputedSize: __webpack_require__(522), - Crop: __webpack_require__(523), - Depth: __webpack_require__(248), - Flip: __webpack_require__(524), - GetBounds: __webpack_require__(525), - Mask: __webpack_require__(252), - Origin: __webpack_require__(526), - PathFollower: __webpack_require__(527), - Pipeline: __webpack_require__(151), - ScrollFactor: __webpack_require__(255), - Size: __webpack_require__(528), - Texture: __webpack_require__(529), - TextureCrop: __webpack_require__(530), - Tint: __webpack_require__(531), - ToJSON: __webpack_require__(256), - Transform: __webpack_require__(257), + Alpha: __webpack_require__(247), + Animation: __webpack_require__(481), + BlendMode: __webpack_require__(250), + ComputedSize: __webpack_require__(524), + Crop: __webpack_require__(525), + Depth: __webpack_require__(251), + Flip: __webpack_require__(526), + GetBounds: __webpack_require__(527), + Mask: __webpack_require__(255), + Origin: __webpack_require__(544), + PathFollower: __webpack_require__(545), + Pipeline: __webpack_require__(152), + ScrollFactor: __webpack_require__(258), + Size: __webpack_require__(546), + Texture: __webpack_require__(547), + TextureCrop: __webpack_require__(548), + Tint: __webpack_require__(549), + ToJSON: __webpack_require__(259), + Transform: __webpack_require__(260), TransformMatrix: __webpack_require__(32), - Visible: __webpack_require__(258) + Visible: __webpack_require__(261) }; @@ -2551,10 +2583,10 @@ module.exports = { */ var Class = __webpack_require__(0); -var ComponentsToJSON = __webpack_require__(256); -var DataManager = __webpack_require__(109); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(110); +var ComponentsToJSON = __webpack_require__(259); +var DataManager = __webpack_require__(110); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(111); /** * @classdesc @@ -2859,8 +2891,8 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#setData * @since 3.0.0 * - * @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 GameObject. */ @@ -3191,8 +3223,8 @@ module.exports = GameObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH = __webpack_require__(165); -var GetValue = __webpack_require__(6); +var MATH = __webpack_require__(166); +var GetValue = __webpack_require__(5); /** * Retrieves a value from an object. Allows for more advanced selection options, including: @@ -3272,6 +3304,105 @@ module.exports = GetAdvancedValue; /* 15 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2019 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 + * + * @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; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -3279,8 +3410,8 @@ module.exports = GetAdvancedValue; */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -3423,13 +3554,21 @@ GameObjectCreator.register = function (factoryType, factoryFunction) } }; +GameObjectCreator.remove = function (factoryType) +{ + if (GameObjectCreator.prototype.hasOwnProperty(factoryType)) + { + delete GameObjectCreator.prototype[factoryType]; + } +}; + PluginCache.register('GameObjectCreator', GameObjectCreator, 'make'); module.exports = GameObjectCreator; /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, exports) { /** @@ -3581,7 +3720,7 @@ module.exports = FILE_CONST; /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3590,97 +3729,34 @@ module.exports = FILE_CONST; * @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 - * - * @return {object} The extended object. + * @namespace Phaser.Core.Events */ -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] || {}; +module.exports = { - // skip the boolean and the target - i = 2; - } + BLUR: __webpack_require__(528), + BOOT: __webpack_require__(529), + CONTEXT_LOST: __webpack_require__(530), + CONTEXT_RESTORED: __webpack_require__(531), + DESTROY: __webpack_require__(532), + FOCUS: __webpack_require__(533), + HIDDEN: __webpack_require__(534), + PAUSE: __webpack_require__(535), + POST_RENDER: __webpack_require__(536), + POST_STEP: __webpack_require__(537), + PRE_RENDER: __webpack_require__(538), + PRE_STEP: __webpack_require__(539), + READY: __webpack_require__(540), + RESUME: __webpack_require__(541), + STEP: __webpack_require__(542), + VISIBLE: __webpack_require__(543) - // 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; - /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports) { /** @@ -3889,7 +3965,7 @@ module.exports = PluginCache; /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3904,31 +3980,31 @@ module.exports = PluginCache; module.exports = { - BOOT: __webpack_require__(661), - CREATE: __webpack_require__(662), - DESTROY: __webpack_require__(663), - PAUSE: __webpack_require__(664), - POST_UPDATE: __webpack_require__(665), - PRE_UPDATE: __webpack_require__(666), - READY: __webpack_require__(667), - RENDER: __webpack_require__(668), - RESUME: __webpack_require__(669), - SHUTDOWN: __webpack_require__(670), - SLEEP: __webpack_require__(671), - START: __webpack_require__(672), - TRANSITION_COMPLETE: __webpack_require__(673), - TRANSITION_INIT: __webpack_require__(674), - TRANSITION_OUT: __webpack_require__(675), - TRANSITION_START: __webpack_require__(676), - TRANSITION_WAKE: __webpack_require__(677), - UPDATE: __webpack_require__(678), - WAKE: __webpack_require__(679) + BOOT: __webpack_require__(665), + CREATE: __webpack_require__(666), + DESTROY: __webpack_require__(667), + PAUSE: __webpack_require__(668), + POST_UPDATE: __webpack_require__(669), + PRE_UPDATE: __webpack_require__(670), + READY: __webpack_require__(671), + RENDER: __webpack_require__(672), + RESUME: __webpack_require__(673), + SHUTDOWN: __webpack_require__(674), + SLEEP: __webpack_require__(675), + START: __webpack_require__(676), + TRANSITION_COMPLETE: __webpack_require__(677), + TRANSITION_INIT: __webpack_require__(678), + TRANSITION_OUT: __webpack_require__(679), + TRANSITION_START: __webpack_require__(680), + TRANSITION_WAKE: __webpack_require__(681), + UPDATE: __webpack_require__(682), + WAKE: __webpack_require__(683) }; /***/ }), -/* 20 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3938,13 +4014,13 @@ module.exports = { */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var Events = __webpack_require__(80); +var CONST = __webpack_require__(17); +var Events = __webpack_require__(81); var GetFastValue = __webpack_require__(2); -var GetURL = __webpack_require__(204); -var MergeXHRSettings = __webpack_require__(205); -var XHRLoader = __webpack_require__(428); -var XHRSettings = __webpack_require__(133); +var GetURL = __webpack_require__(206); +var MergeXHRSettings = __webpack_require__(207); +var XHRLoader = __webpack_require__(431); +var XHRSettings = __webpack_require__(134); /** * @classdesc @@ -4469,7 +4545,79 @@ module.exports = File; /***/ }), -/* 21 */ +/* 22 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + +}; + +module.exports = MATH_CONST; + + +/***/ }), +/* 23 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4553,7 +4701,7 @@ module.exports = GetTilesWithin; /***/ }), -/* 22 */ +/* 24 */ /***/ (function(module, exports) { /** @@ -4583,79 +4731,7 @@ module.exports = Clamp; /***/ }), -/* 23 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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 - -}; - -module.exports = MATH_CONST; - - -/***/ }), -/* 24 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4664,8 +4740,8 @@ module.exports = MATH_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(26); -var Smoothing = __webpack_require__(113); +var CONST = __webpack_require__(31); +var Smoothing = __webpack_require__(114); // The pool into which the canvas elements are placed. var pool = []; @@ -4916,7 +4992,7 @@ module.exports = CanvasPool(); /***/ }), -/* 25 */ +/* 26 */ /***/ (function(module, exports) { /** @@ -5000,144 +5076,6 @@ var SetTransform = function (renderer, ctx, src, camera, parentMatrix) module.exports = SetTransform; -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 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.18.1', - - BlendModes: __webpack_require__(52), - - ScaleModes: __webpack_require__(104), - - /** - * AUTO Detect Renderer. - * - * @name Phaser.AUTO - * @const - * @type {integer} - * @since 3.0.0 - */ - AUTO: 0, - - /** - * Canvas Renderer. - * - * @name Phaser.CANVAS - * @const - * @type {integer} - * @since 3.0.0 - */ - CANVAS: 1, - - /** - * WebGL Renderer. - * - * @name Phaser.WEBGL - * @const - * @type {integer} - * @since 3.0.0 - */ - WEBGL: 2, - - /** - * Headless Renderer. - * - * @name Phaser.HEADLESS - * @const - * @type {integer} - * @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 {integer} - * @since 3.0.0 - */ - FOREVER: -1, - - /** - * Direction constant. - * - * @name Phaser.NONE - * @const - * @type {integer} - * @since 3.0.0 - */ - NONE: 4, - - /** - * Direction constant. - * - * @name Phaser.UP - * @const - * @type {integer} - * @since 3.0.0 - */ - UP: 5, - - /** - * Direction constant. - * - * @name Phaser.DOWN - * @const - * @type {integer} - * @since 3.0.0 - */ - DOWN: 6, - - /** - * Direction constant. - * - * @name Phaser.LEFT - * @const - * @type {integer} - * @since 3.0.0 - */ - LEFT: 7, - - /** - * Direction constant. - * - * @name Phaser.RIGHT - * @const - * @type {integer} - * @since 3.0.0 - */ - RIGHT: 8 - -}; - -module.exports = CONST; - - /***/ }), /* 27 */ /***/ (function(module, exports) { @@ -5215,41 +5153,7 @@ module.exports = PropertyValueSet; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.Core.Events - */ - -module.exports = { - - BLUR: __webpack_require__(580), - BOOT: __webpack_require__(581), - DESTROY: __webpack_require__(582), - FOCUS: __webpack_require__(583), - HIDDEN: __webpack_require__(584), - PAUSE: __webpack_require__(585), - POST_RENDER: __webpack_require__(586), - POST_STEP: __webpack_require__(587), - PRE_RENDER: __webpack_require__(588), - PRE_STEP: __webpack_require__(589), - READY: __webpack_require__(590), - RESUME: __webpack_require__(591), - STEP: __webpack_require__(592), - VISIBLE: __webpack_require__(593) - -}; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(52); +var BlendModes = __webpack_require__(53); var GetAdvancedValue = __webpack_require__(14); var ScaleModes = __webpack_require__(104); @@ -5373,7 +5277,7 @@ module.exports = BuildGameObject; /***/ }), -/* 30 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5385,7 +5289,7 @@ module.exports = BuildGameObject; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var Line = __webpack_require__(54); +var Line = __webpack_require__(55); /** * @classdesc @@ -5673,7 +5577,7 @@ module.exports = Shape; /***/ }), -/* 31 */ +/* 30 */ /***/ (function(module, exports) { /** @@ -5727,6 +5631,144 @@ module.exports = { }; +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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.19.0', + + BlendModes: __webpack_require__(53), + + ScaleModes: __webpack_require__(104), + + /** + * AUTO Detect Renderer. + * + * @name Phaser.AUTO + * @const + * @type {integer} + * @since 3.0.0 + */ + AUTO: 0, + + /** + * Canvas Renderer. + * + * @name Phaser.CANVAS + * @const + * @type {integer} + * @since 3.0.0 + */ + CANVAS: 1, + + /** + * WebGL Renderer. + * + * @name Phaser.WEBGL + * @const + * @type {integer} + * @since 3.0.0 + */ + WEBGL: 2, + + /** + * Headless Renderer. + * + * @name Phaser.HEADLESS + * @const + * @type {integer} + * @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 {integer} + * @since 3.0.0 + */ + FOREVER: -1, + + /** + * Direction constant. + * + * @name Phaser.NONE + * @const + * @type {integer} + * @since 3.0.0 + */ + NONE: 4, + + /** + * Direction constant. + * + * @name Phaser.UP + * @const + * @type {integer} + * @since 3.0.0 + */ + UP: 5, + + /** + * Direction constant. + * + * @name Phaser.DOWN + * @const + * @type {integer} + * @since 3.0.0 + */ + DOWN: 6, + + /** + * Direction constant. + * + * @name Phaser.LEFT + * @const + * @type {integer} + * @since 3.0.0 + */ + LEFT: 7, + + /** + * Direction constant. + * + * @name Phaser.RIGHT + * @const + * @type {integer} + * @since 3.0.0 + */ + RIGHT: 8 + +}; + +module.exports = CONST; + + /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { @@ -5738,7 +5780,8 @@ module.exports = { */ var Class = __webpack_require__(0); -var Vector2 = __webpack_require__(4); +var MATH_CONST = __webpack_require__(22); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -5758,8 +5801,8 @@ var Vector2 = __webpack_require__(4); * @since 3.0.0 * * @param {number} [a=1] - The Scale X value. - * @param {number} [b=0] - The Shear Y value. - * @param {number} [c=0] - The Shear 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. @@ -5824,7 +5867,7 @@ var TransformMatrix = new Class({ }, /** - * The Shear Y value. + * The Skew Y value. * * @name Phaser.GameObjects.Components.TransformMatrix#b * @type {number} @@ -5845,7 +5888,7 @@ var TransformMatrix = new Class({ }, /** - * The Shear X value. + * The Skew X value. * * @name Phaser.GameObjects.Components.TransformMatrix#c * @type {number} @@ -5971,7 +6014,7 @@ var TransformMatrix = new Class({ }, /** - * The rotation of the Matrix. + * The rotation of the Matrix. Value is in radians. * * @name Phaser.GameObjects.Components.TransformMatrix#rotation * @type {number} @@ -5982,13 +6025,53 @@ var TransformMatrix = new Class({ get: function () { - return Math.acos(this.a / this.scaleX) * (Math.atan(-this.c / this.a) < 0 ? -1 : 1); + return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1); } }, /** - * The horizontal scale of the Matrix. + * 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} @@ -5999,13 +6082,13 @@ var TransformMatrix = new Class({ get: function () { - return Math.sqrt((this.a * this.a) + (this.c * this.c)); + return Math.sqrt((this.a * this.a) + (this.b * this.b)); } }, /** - * The vertical scale of the Matrix. + * The decomposed vertical scale of the Matrix. This value is always positive. * * @name Phaser.GameObjects.Components.TransformMatrix#scaleY * @type {number} @@ -6016,7 +6099,7 @@ var TransformMatrix = new Class({ get: function () { - return Math.sqrt((this.b * this.b) + (this.d * this.d)); + return Math.sqrt((this.c * this.c) + (this.d * this.d)); } }, @@ -6665,10 +6748,10 @@ module.exports = TransformMatrix; */ var Class = __webpack_require__(0); -var GetColor = __webpack_require__(160); -var GetColor32 = __webpack_require__(270); -var HSVToRGB = __webpack_require__(161); -var RGBToHSV = __webpack_require__(271); +var GetColor = __webpack_require__(161); +var GetColor32 = __webpack_require__(273); +var HSVToRGB = __webpack_require__(162); +var RGBToHSV = __webpack_require__(274); /** * @namespace Phaser.Display.Color @@ -7594,7 +7677,7 @@ module.exports = PropertyValueInc; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); +var CONST = __webpack_require__(22); /** * Convert the given angle from degrees, to the equivalent angle in radians. @@ -7941,6 +8024,86 @@ module.exports = Contains; /* 47 */ /***/ (function(module, exports) { +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @since 3.19.0 + */ + CIRCLE: 0, + + /** + * An Ellipse Geometry object type. + * + * @name Phaser.Geom.ELLIPSE + * @type {integer} + * @since 3.19.0 + */ + ELLIPSE: 1, + + /** + * A Line Geometry object type. + * + * @name Phaser.Geom.LINE + * @type {integer} + * @since 3.19.0 + */ + LINE: 2, + + /** + * A Point Geometry object type. + * + * @name Phaser.Geom.POINT + * @type {integer} + * @since 3.19.0 + */ + POINT: 3, + + /** + * A Polygon Geometry object type. + * + * @name Phaser.Geom.POLYGON + * @type {integer} + * @since 3.19.0 + */ + POLYGON: 4, + + /** + * A Rectangle Geometry object type. + * + * @name Phaser.Geom.RECTANGLE + * @type {integer} + * @since 3.19.0 + */ + RECTANGLE: 5, + + /** + * A Triangle Geometry object type. + * + * @name Phaser.Geom.TRIANGLE + * @type {integer} + * @since 3.19.0 + */ + TRIANGLE: 6 + +}; + +module.exports = GEOM_CONST; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -7973,7 +8136,7 @@ module.exports = Contains; /***/ }), -/* 48 */ +/* 49 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -7988,27 +8151,27 @@ module.exports = Contains; module.exports = { - DESTROY: __webpack_require__(602), - FADE_IN_COMPLETE: __webpack_require__(603), - FADE_IN_START: __webpack_require__(604), - FADE_OUT_COMPLETE: __webpack_require__(605), - FADE_OUT_START: __webpack_require__(606), - FLASH_COMPLETE: __webpack_require__(607), - FLASH_START: __webpack_require__(608), - PAN_COMPLETE: __webpack_require__(609), - PAN_START: __webpack_require__(610), - POST_RENDER: __webpack_require__(611), - PRE_RENDER: __webpack_require__(612), - SHAKE_COMPLETE: __webpack_require__(613), - SHAKE_START: __webpack_require__(614), - ZOOM_COMPLETE: __webpack_require__(615), - ZOOM_START: __webpack_require__(616) + DESTROY: __webpack_require__(606), + FADE_IN_COMPLETE: __webpack_require__(607), + FADE_IN_START: __webpack_require__(608), + FADE_OUT_COMPLETE: __webpack_require__(609), + FADE_OUT_START: __webpack_require__(610), + FLASH_COMPLETE: __webpack_require__(611), + FLASH_START: __webpack_require__(612), + PAN_COMPLETE: __webpack_require__(613), + PAN_START: __webpack_require__(614), + POST_RENDER: __webpack_require__(615), + PRE_RENDER: __webpack_require__(616), + SHAKE_COMPLETE: __webpack_require__(617), + SHAKE_START: __webpack_require__(618), + ZOOM_COMPLETE: __webpack_require__(619), + ZOOM_START: __webpack_require__(620) }; /***/ }), -/* 49 */ +/* 50 */ /***/ (function(module, exports) { /** @@ -8046,7 +8209,7 @@ module.exports = LineStyleCanvas; /***/ }), -/* 50 */ +/* 51 */ /***/ (function(module, exports) { /** @@ -8175,7 +8338,7 @@ module.exports = CONST; /***/ }), -/* 51 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8184,8 +8347,8 @@ module.exports = CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(137); -var GetTilesWithin = __webpack_require__(21); +var GetTileAt = __webpack_require__(138); +var GetTilesWithin = __webpack_require__(23); /** * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the @@ -8241,7 +8404,7 @@ module.exports = CalculateFacesWithin; /***/ }), -/* 52 */ +/* 53 */ /***/ (function(module, exports) { /** @@ -8580,7 +8743,7 @@ module.exports = { /***/ }), -/* 53 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8595,58 +8758,58 @@ module.exports = { module.exports = { - BOOT: __webpack_require__(782), - DESTROY: __webpack_require__(783), - DRAG_END: __webpack_require__(784), - DRAG_ENTER: __webpack_require__(785), - DRAG: __webpack_require__(786), - DRAG_LEAVE: __webpack_require__(787), - DRAG_OVER: __webpack_require__(788), - DRAG_START: __webpack_require__(789), - DROP: __webpack_require__(790), - GAME_OUT: __webpack_require__(791), - GAME_OVER: __webpack_require__(792), - GAMEOBJECT_DOWN: __webpack_require__(793), - GAMEOBJECT_DRAG_END: __webpack_require__(794), - GAMEOBJECT_DRAG_ENTER: __webpack_require__(795), - GAMEOBJECT_DRAG: __webpack_require__(796), - GAMEOBJECT_DRAG_LEAVE: __webpack_require__(797), - GAMEOBJECT_DRAG_OVER: __webpack_require__(798), - GAMEOBJECT_DRAG_START: __webpack_require__(799), - GAMEOBJECT_DROP: __webpack_require__(800), - GAMEOBJECT_MOVE: __webpack_require__(801), - GAMEOBJECT_OUT: __webpack_require__(802), - GAMEOBJECT_OVER: __webpack_require__(803), - GAMEOBJECT_POINTER_DOWN: __webpack_require__(804), - GAMEOBJECT_POINTER_MOVE: __webpack_require__(805), - GAMEOBJECT_POINTER_OUT: __webpack_require__(806), - GAMEOBJECT_POINTER_OVER: __webpack_require__(807), - GAMEOBJECT_POINTER_UP: __webpack_require__(808), - GAMEOBJECT_POINTER_WHEEL: __webpack_require__(809), - GAMEOBJECT_UP: __webpack_require__(810), - GAMEOBJECT_WHEEL: __webpack_require__(811), - MANAGER_BOOT: __webpack_require__(812), - MANAGER_PROCESS: __webpack_require__(813), - MANAGER_UPDATE: __webpack_require__(814), - POINTER_DOWN: __webpack_require__(815), - POINTER_DOWN_OUTSIDE: __webpack_require__(816), - POINTER_MOVE: __webpack_require__(817), - POINTER_OUT: __webpack_require__(818), - POINTER_OVER: __webpack_require__(819), - POINTER_UP: __webpack_require__(820), - POINTER_UP_OUTSIDE: __webpack_require__(821), - POINTER_WHEEL: __webpack_require__(822), - POINTERLOCK_CHANGE: __webpack_require__(823), - PRE_UPDATE: __webpack_require__(824), - SHUTDOWN: __webpack_require__(825), - START: __webpack_require__(826), - UPDATE: __webpack_require__(827) + BOOT: __webpack_require__(787), + DESTROY: __webpack_require__(788), + DRAG_END: __webpack_require__(789), + DRAG_ENTER: __webpack_require__(790), + DRAG: __webpack_require__(791), + DRAG_LEAVE: __webpack_require__(792), + DRAG_OVER: __webpack_require__(793), + DRAG_START: __webpack_require__(794), + DROP: __webpack_require__(795), + GAME_OUT: __webpack_require__(796), + GAME_OVER: __webpack_require__(797), + GAMEOBJECT_DOWN: __webpack_require__(798), + GAMEOBJECT_DRAG_END: __webpack_require__(799), + GAMEOBJECT_DRAG_ENTER: __webpack_require__(800), + GAMEOBJECT_DRAG: __webpack_require__(801), + GAMEOBJECT_DRAG_LEAVE: __webpack_require__(802), + GAMEOBJECT_DRAG_OVER: __webpack_require__(803), + GAMEOBJECT_DRAG_START: __webpack_require__(804), + GAMEOBJECT_DROP: __webpack_require__(805), + GAMEOBJECT_MOVE: __webpack_require__(806), + GAMEOBJECT_OUT: __webpack_require__(807), + GAMEOBJECT_OVER: __webpack_require__(808), + GAMEOBJECT_POINTER_DOWN: __webpack_require__(809), + GAMEOBJECT_POINTER_MOVE: __webpack_require__(810), + GAMEOBJECT_POINTER_OUT: __webpack_require__(811), + GAMEOBJECT_POINTER_OVER: __webpack_require__(812), + GAMEOBJECT_POINTER_UP: __webpack_require__(813), + GAMEOBJECT_POINTER_WHEEL: __webpack_require__(814), + GAMEOBJECT_UP: __webpack_require__(815), + GAMEOBJECT_WHEEL: __webpack_require__(816), + MANAGER_BOOT: __webpack_require__(817), + MANAGER_PROCESS: __webpack_require__(818), + MANAGER_UPDATE: __webpack_require__(819), + POINTER_DOWN: __webpack_require__(820), + POINTER_DOWN_OUTSIDE: __webpack_require__(821), + POINTER_MOVE: __webpack_require__(822), + POINTER_OUT: __webpack_require__(823), + POINTER_OVER: __webpack_require__(824), + POINTER_UP: __webpack_require__(825), + POINTER_UP_OUTSIDE: __webpack_require__(826), + POINTER_WHEEL: __webpack_require__(827), + POINTERLOCK_CHANGE: __webpack_require__(828), + PRE_UPDATE: __webpack_require__(829), + SHUTDOWN: __webpack_require__(830), + START: __webpack_require__(831), + UPDATE: __webpack_require__(832) }; /***/ }), -/* 54 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8656,10 +8819,11 @@ module.exports = { */ var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(250); -var GetPoints = __webpack_require__(148); -var Random = __webpack_require__(149); -var Vector2 = __webpack_require__(4); +var GetPoint = __webpack_require__(253); +var GetPoints = __webpack_require__(149); +var GEOM_CONST = __webpack_require__(47); +var Random = __webpack_require__(150); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -8686,6 +8850,17 @@ var Line = new Class({ if (x2 === undefined) { x2 = 0; } if (y2 === undefined) { y2 = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.LINE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Line#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.LINE; + /** * The x coordinate of the lines starting point. * @@ -8971,7 +9146,7 @@ module.exports = Line; /***/ }), -/* 55 */ +/* 56 */ /***/ (function(module, exports) { /** @@ -8999,7 +9174,7 @@ module.exports = Length; /***/ }), -/* 56 */ +/* 57 */ /***/ (function(module, exports) { /** @@ -9031,7 +9206,7 @@ module.exports = Wrap; /***/ }), -/* 57 */ +/* 58 */ /***/ (function(module, exports) { /** @@ -9065,7 +9240,7 @@ module.exports = DistanceBetween; /***/ }), -/* 58 */ +/* 59 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -9075,11 +9250,11 @@ module.exports = DistanceBetween; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); var IsPlainObject = __webpack_require__(7); /** @@ -9295,7 +9470,7 @@ module.exports = JSONFile; /***/ }), -/* 59 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -9489,8 +9664,8 @@ module.exports = MultiFile; /***/ }), -/* 60 */, -/* 61 */ +/* 61 */, +/* 62 */ /***/ (function(module, exports) { /** @@ -9541,7 +9716,7 @@ module.exports = WorldToTileX; /***/ }), -/* 62 */ +/* 63 */ /***/ (function(module, exports) { /** @@ -9592,7 +9767,7 @@ module.exports = WorldToTileY; /***/ }), -/* 63 */ +/* 64 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10274,7 +10449,7 @@ earcut.flatten = function (data) { /***/ }), -/* 64 */ +/* 65 */ /***/ (function(module, exports) { /** @@ -10316,7 +10491,7 @@ module.exports = Clone; /***/ }), -/* 65 */ +/* 66 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10331,35 +10506,35 @@ module.exports = Clone; module.exports = { - COMPLETE: __webpack_require__(851), - DECODED: __webpack_require__(852), - DECODED_ALL: __webpack_require__(853), - DESTROY: __webpack_require__(854), - DETUNE: __webpack_require__(855), - GLOBAL_DETUNE: __webpack_require__(856), - GLOBAL_MUTE: __webpack_require__(857), - GLOBAL_RATE: __webpack_require__(858), - GLOBAL_VOLUME: __webpack_require__(859), - LOOP: __webpack_require__(860), - LOOPED: __webpack_require__(861), - MUTE: __webpack_require__(862), - PAUSE_ALL: __webpack_require__(863), - PAUSE: __webpack_require__(864), - PLAY: __webpack_require__(865), - RATE: __webpack_require__(866), - RESUME_ALL: __webpack_require__(867), - RESUME: __webpack_require__(868), - SEEK: __webpack_require__(869), - STOP_ALL: __webpack_require__(870), - STOP: __webpack_require__(871), - UNLOCKED: __webpack_require__(872), - VOLUME: __webpack_require__(873) + COMPLETE: __webpack_require__(855), + DECODED: __webpack_require__(856), + DECODED_ALL: __webpack_require__(857), + DESTROY: __webpack_require__(858), + DETUNE: __webpack_require__(859), + GLOBAL_DETUNE: __webpack_require__(860), + GLOBAL_MUTE: __webpack_require__(861), + GLOBAL_RATE: __webpack_require__(862), + GLOBAL_VOLUME: __webpack_require__(863), + LOOP: __webpack_require__(864), + LOOPED: __webpack_require__(865), + MUTE: __webpack_require__(866), + PAUSE_ALL: __webpack_require__(867), + PAUSE: __webpack_require__(868), + PLAY: __webpack_require__(869), + RATE: __webpack_require__(870), + RESUME_ALL: __webpack_require__(871), + RESUME: __webpack_require__(872), + SEEK: __webpack_require__(873), + STOP_ALL: __webpack_require__(874), + STOP: __webpack_require__(875), + UNLOCKED: __webpack_require__(876), + VOLUME: __webpack_require__(877) }; /***/ }), -/* 66 */ +/* 67 */ /***/ (function(module, exports) { /** @@ -10408,7 +10583,7 @@ module.exports = SafeRange; /***/ }), -/* 67 */ +/* 68 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10420,7 +10595,7 @@ module.exports = SafeRange; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var SpriteRender = __webpack_require__(926); +var SpriteRender = __webpack_require__(930); /** * @classdesc @@ -10586,7 +10761,7 @@ module.exports = Sprite; /***/ }), -/* 68 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10661,7 +10836,7 @@ module.exports = StrokePathWebGL; /***/ }), -/* 69 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10671,11 +10846,12 @@ module.exports = StrokePathWebGL; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(81); -var GetPoint = __webpack_require__(396); -var GetPoints = __webpack_require__(397); -var Line = __webpack_require__(54); -var Random = __webpack_require__(153); +var Contains = __webpack_require__(83); +var GetPoint = __webpack_require__(399); +var GetPoints = __webpack_require__(400); +var GEOM_CONST = __webpack_require__(47); +var Line = __webpack_require__(55); +var Random = __webpack_require__(154); /** * @classdesc @@ -10708,6 +10884,17 @@ var Triangle = new Class({ if (x3 === undefined) { x3 = 0; } if (y3 === undefined) { y3 = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.TRIANGLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Triangle#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.TRIANGLE; + /** * `x` coordinate of the first point. * @@ -11096,7 +11283,7 @@ module.exports = Triangle; /***/ }), -/* 70 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11106,8 +11293,8 @@ module.exports = Triangle; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -11370,7 +11557,7 @@ module.exports = ImageFile; /***/ }), -/* 71 */ +/* 72 */ /***/ (function(module, exports) { /** @@ -11406,7 +11593,7 @@ module.exports = SetTileCollision; /***/ }), -/* 72 */ +/* 73 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11417,7 +11604,7 @@ module.exports = SetTileCollision; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Rectangle = __webpack_require__(417); +var Rectangle = __webpack_require__(420); /** * @classdesc @@ -12244,7 +12431,7 @@ module.exports = Tile; /***/ }), -/* 73 */ +/* 74 */ /***/ (function(module, exports) { /** @@ -12272,7 +12459,7 @@ module.exports = GetCenterX; /***/ }), -/* 74 */ +/* 75 */ /***/ (function(module, exports) { /** @@ -12307,7 +12494,7 @@ module.exports = SetCenterX; /***/ }), -/* 75 */ +/* 76 */ /***/ (function(module, exports) { /** @@ -12342,7 +12529,7 @@ module.exports = SetCenterY; /***/ }), -/* 76 */ +/* 77 */ /***/ (function(module, exports) { /** @@ -12370,7 +12557,7 @@ module.exports = GetCenterY; /***/ }), -/* 77 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12381,9 +12568,10 @@ module.exports = GetCenterY; var Class = __webpack_require__(0); var Contains = __webpack_require__(46); -var GetPoint = __webpack_require__(241); -var GetPoints = __webpack_require__(242); -var Random = __webpack_require__(145); +var GetPoint = __webpack_require__(244); +var GetPoints = __webpack_require__(245); +var GEOM_CONST = __webpack_require__(47); +var Random = __webpack_require__(146); /** * @classdesc @@ -12412,6 +12600,17 @@ var Circle = new Class({ if (y === undefined) { y = 0; } if (radius === undefined) { radius = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.CIRCLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Circle#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.CIRCLE; + /** * The x position of the center of the circle. * @@ -12733,7 +12932,7 @@ module.exports = Circle; /***/ }), -/* 78 */ +/* 79 */ /***/ (function(module, exports) { /** @@ -12779,7 +12978,7 @@ module.exports = SpliceOne; /***/ }), -/* 79 */ +/* 80 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12789,9 +12988,9 @@ module.exports = SpliceOne; */ var Class = __webpack_require__(0); -var FromPoints = __webpack_require__(172); -var Rectangle = __webpack_require__(10); -var Vector2 = __webpack_require__(4); +var FromPoints = __webpack_require__(173); +var Rectangle = __webpack_require__(11); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -12987,10 +13186,8 @@ var Curve = new Class({ return this.getPointAt(1, out); }, - // Get total curve arc length - /** - * [description] + * Get total curve arc length * * @method Phaser.Curves.Curve#getLength * @since 3.0.0 @@ -13004,10 +13201,9 @@ var Curve = new Class({ return lengths[lengths.length - 1]; }, - // Get list of cumulative segment lengths /** - * [description] + * Get list of cumulative segment lengths * * @method Phaser.Curves.Curve#getLengths * @since 3.0.0 @@ -13166,13 +13362,11 @@ var Curve = new Class({ return this.getPointAt(0, out); }, - // Returns a unit vector tangent at t - // In case any sub curve does not implement its tangent derivation, - // 2 points a small delta apart will be used to find its gradient - // which seems to give a reasonable approximation - /** - * [description] + * Returns a unit vector tangent at t + * In case any sub curve does not implement its tangent derivation, + * 2 points a small delta apart will be used to find its gradient + * which seems to give a reasonable approximation * * @method Phaser.Curves.Curve#getTangent * @since 3.0.0 @@ -13354,7 +13548,7 @@ module.exports = Curve; /***/ }), -/* 80 */ +/* 81 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13369,22 +13563,131 @@ module.exports = Curve; module.exports = { - ADD: __webpack_require__(829), - COMPLETE: __webpack_require__(830), - FILE_COMPLETE: __webpack_require__(831), - FILE_KEY_COMPLETE: __webpack_require__(832), - FILE_LOAD_ERROR: __webpack_require__(833), - FILE_LOAD: __webpack_require__(834), - FILE_PROGRESS: __webpack_require__(835), - POST_PROCESS: __webpack_require__(836), - PROGRESS: __webpack_require__(837), - START: __webpack_require__(838) + ADD: __webpack_require__(834), + COMPLETE: __webpack_require__(835), + FILE_COMPLETE: __webpack_require__(836), + FILE_KEY_COMPLETE: __webpack_require__(837), + FILE_LOAD_ERROR: __webpack_require__(838), + FILE_LOAD: __webpack_require__(839), + FILE_PROGRESS: __webpack_require__(840), + POST_PROCESS: __webpack_require__(841), + PROGRESS: __webpack_require__(842), + START: __webpack_require__(843) }; /***/ }), -/* 81 */ +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var EaseMap = __webpack_require__(164); +var UppercaseFirst = __webpack_require__(178); + +/** + * This internal function is used to return the correct ease function for a Tween. + * + * It can take a variety of input, including an EaseMap based string, or a custom function. + * + * @function Phaser.Tweens.Builders.GetEaseFunction + * @since 3.0.0 + * + * @param {(string|function)} ease - The ease to find. This can be either a string from the EaseMap, or a custom function. + * @param {number[]} [easeParams] - An optional array of ease parameters to go with the ease. + * + * @return {function} The ease function. + */ +var GetEaseFunction = function (ease, easeParams) +{ + // Default ease function + var easeFunction = EaseMap.Power0; + + // Prepare ease function + if (typeof ease === 'string') + { + // String based look-up + + // 1) They specified it correctly + if (EaseMap.hasOwnProperty(ease)) + { + easeFunction = EaseMap[ease]; + } + else + { + // Do some string manipulation to try and find it + var direction = ''; + + if (ease.indexOf('.')) + { + // quad.in = Quad.easeIn + // quad.out = Quad.easeOut + // quad.inout =Quad.easeInOut + + direction = ease.substr(ease.indexOf('.') + 1); + + if (direction.toLowerCase() === 'in') + { + direction = 'easeIn'; + } + else if (direction.toLowerCase() === 'out') + { + direction = 'easeOut'; + } + else if (direction.toLowerCase() === 'inout') + { + direction = 'easeInOut'; + } + } + + ease = UppercaseFirst(ease.substr(0, ease.indexOf('.') + 1) + direction); + + if (EaseMap.hasOwnProperty(ease)) + { + easeFunction = EaseMap[ease]; + } + } + } + else if (typeof ease === 'function') + { + // Custom function + easeFunction = ease; + } + else if (Array.isArray(ease) && ease.length === 4) + { + // Bezier function (TODO) + } + + // No custom ease parameters? + if (!easeParams) + { + // Return ease function + return easeFunction; + } + + var cloneParams = easeParams.slice(0); + + cloneParams.unshift(0); + + // Return ease function with custom ease parameters + return function (v) + { + cloneParams[0] = v; + + return easeFunction.apply(this, cloneParams); + }; +}; + +module.exports = GetEaseFunction; + + +/***/ }), +/* 83 */ /***/ (function(module, exports) { /** @@ -13437,7 +13740,7 @@ module.exports = Contains; /***/ }), -/* 82 */ +/* 84 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13446,7 +13749,7 @@ module.exports = Contains; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); // This is based off an explanation and expanded math presented by Paul Bourke: // See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ @@ -13513,7 +13816,7 @@ module.exports = LineToLine; /***/ }), -/* 83 */ +/* 85 */ /***/ (function(module, exports) { /** @@ -13541,8 +13844,8 @@ module.exports = Angle; /***/ }), -/* 84 */, -/* 85 */ +/* 86 */, +/* 87 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13551,49 +13854,7 @@ module.exports = Angle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(64); - -/** - * Creates a new Object using all values from obj1 and obj2. - * If a value exists in both obj1 and obj2, the value in obj1 is used. - * - * @function Phaser.Utils.Objects.Merge - * @since 3.0.0 - * - * @param {object} obj1 - The first object. - * @param {object} obj2 - The second object. - * - * @return {object} A new object containing the union of obj1's and obj2's properties. - */ -var Merge = function (obj1, obj2) -{ - var clone = Clone(obj1); - - for (var key in obj2) - { - if (!clone.hasOwnProperty(key)) - { - clone[key] = obj2[key]; - } - } - - return clone; -}; - -module.exports = Merge; - - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); /** * Return a value based on the range between `min` and `max` and the percentage given. @@ -13618,7 +13879,7 @@ module.exports = FromPercent; /***/ }), -/* 87 */ +/* 88 */ /***/ (function(module, exports) { /** @@ -13659,7 +13920,7 @@ module.exports = GetBoolean; /***/ }), -/* 88 */ +/* 89 */ /***/ (function(module, exports) { /** @@ -13831,7 +14092,7 @@ module.exports = TWEEN_CONST; /***/ }), -/* 89 */ +/* 90 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13846,18 +14107,18 @@ module.exports = TWEEN_CONST; module.exports = { - ENTER_FULLSCREEN: __webpack_require__(655), - FULLSCREEN_FAILED: __webpack_require__(656), - FULLSCREEN_UNSUPPORTED: __webpack_require__(657), - LEAVE_FULLSCREEN: __webpack_require__(658), - ORIENTATION_CHANGE: __webpack_require__(659), - RESIZE: __webpack_require__(660) + ENTER_FULLSCREEN: __webpack_require__(659), + FULLSCREEN_FAILED: __webpack_require__(660), + FULLSCREEN_UNSUPPORTED: __webpack_require__(661), + LEAVE_FULLSCREEN: __webpack_require__(662), + ORIENTATION_CHANGE: __webpack_require__(663), + RESIZE: __webpack_require__(664) }; /***/ }), -/* 90 */ +/* 91 */ /***/ (function(module, exports) { /** @@ -13901,7 +14162,7 @@ module.exports = SnapFloor; /***/ }), -/* 91 */ +/* 92 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13911,8 +14172,8 @@ module.exports = SnapFloor; */ var Class = __webpack_require__(0); -var Clamp = __webpack_require__(22); -var Extend = __webpack_require__(17); +var Clamp = __webpack_require__(24); +var Extend = __webpack_require__(15); /** * @classdesc @@ -14613,16 +14874,18 @@ var Frame = new Class({ }, /** - * Destroys this Frames references. + * 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.texture = null; - this.source = null; + this.texture = null; + this.glTexture = null; + this.customData = null; + this.data = null; }, /** @@ -14718,7 +14981,7 @@ module.exports = Frame; /***/ }), -/* 92 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14728,10 +14991,11 @@ module.exports = Frame; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(93); -var GetPoint = __webpack_require__(368); -var GetPoints = __webpack_require__(369); -var Random = __webpack_require__(152); +var Contains = __webpack_require__(94); +var GetPoint = __webpack_require__(371); +var GetPoints = __webpack_require__(372); +var GEOM_CONST = __webpack_require__(47); +var Random = __webpack_require__(153); /** * @classdesc @@ -14762,6 +15026,17 @@ var Ellipse = new Class({ if (width === undefined) { width = 0; } if (height === undefined) { height = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.ELLIPSE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Ellipse#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.ELLIPSE; + /** * The x position of the center of the ellipse. * @@ -15086,7 +15361,7 @@ module.exports = Ellipse; /***/ }), -/* 93 */ +/* 94 */ /***/ (function(module, exports) { /** @@ -15128,7 +15403,7 @@ module.exports = Contains; /***/ }), -/* 94 */ +/* 95 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15137,15 +15412,15 @@ module.exports = Contains; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Actions = __webpack_require__(229); +var Actions = __webpack_require__(232); var Class = __webpack_require__(0); -var Events = __webpack_require__(110); +var Events = __webpack_require__(111); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); var IsPlainObject = __webpack_require__(7); -var Range = __webpack_require__(362); -var Set = __webpack_require__(105); -var Sprite = __webpack_require__(67); +var Range = __webpack_require__(365); +var Set = __webpack_require__(106); +var Sprite = __webpack_require__(68); /** * @classdesc @@ -15482,14 +15757,15 @@ var Group = new Class({ var randomKey = GetFastValue(options, 'randomKey', false); var randomFrame = GetFastValue(options, 'randomFrame', false); var yoyo = GetFastValue(options, 'yoyo', false); - var quantity = GetFastValue(options, 'frameQuantity', 1); + var quantity = GetFastValue(options, 'quantity', false); + var frameQuantity = GetFastValue(options, 'frameQuantity', 1); var max = GetFastValue(options, 'max', 0); - // If a grid is set we use that to override the quantity? + // If a quantity value is set we use that to override the frameQuantity var range = Range(key, frame, { max: max, - qty: quantity, + qty: (quantity) ? quantity : frameQuantity, random: randomKey, randomB: randomFrame, repeat: repeat, @@ -16266,22 +16542,7 @@ var Group = new Class({ return; } - if (destroyChildren) - { - var children = this.children; - - for (var i = 0; i < children.size; i++) - { - var gameObject = children.entries[i]; - - // Remove the event hook first or it'll go all recursive hell on us - gameObject.off(Events.DESTROY, this.remove, this); - - gameObject.destroy(); - } - } - - this.children.clear(); + this.clear(false, destroyChildren); this.scene = undefined; this.children = undefined; @@ -16293,7 +16554,7 @@ module.exports = Group; /***/ }), -/* 95 */ +/* 96 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16305,7 +16566,7 @@ module.exports = Group; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var ImageRender = __webpack_require__(929); +var ImageRender = __webpack_require__(933); /** * @classdesc @@ -16393,68 +16654,6 @@ var Image = new Class({ module.exports = Image; -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var EaseMap = __webpack_require__(163); - -/** - * [description] - * - * @function Phaser.Tweens.Builders.GetEaseFunction - * @since 3.0.0 - * - * @param {(string|function)} ease - [description] - * @param {array} easeParams - [description] - * - * @return {function} [description] - */ -var GetEaseFunction = function (ease, easeParams) -{ - if (typeof ease === 'string' && EaseMap.hasOwnProperty(ease)) - { - if (easeParams) - { - var cloneParams = easeParams.slice(0); - - cloneParams.unshift(0); - - return function (v) - { - cloneParams[0] = v; - - return EaseMap[ease].apply(this, cloneParams); - }; - } - else - { - // String based look-up - return EaseMap[ease]; - } - } - else if (typeof ease === 'function') - { - // Custom function - return ease; - } - else if (Array.isArray(ease) && ease.length === 4) - { - // Bezier function (TODO) - } - - return EaseMap.Power0; -}; - -module.exports = GetEaseFunction; - - /***/ }), /* 97 */ /***/ (function(module, exports) { @@ -17084,6 +17283,51 @@ module.exports = ScaleModes; /* 105 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clone = __webpack_require__(65); + +/** + * Creates a new Object using all values from obj1 and obj2. + * If a value exists in both obj1 and obj2, the value in obj1 is used. + * + * This is only a shallow copy. Deeply nested objects are not cloned, so be sure to only use this + * function on shallow objects. + * + * @function Phaser.Utils.Objects.Merge + * @since 3.0.0 + * + * @param {object} obj1 - The first object. + * @param {object} obj2 - The second object. + * + * @return {object} A new object containing the union of obj1's and obj2's properties. + */ +var Merge = function (obj1, obj2) +{ + var clone = Clone(obj1); + + for (var key in obj2) + { + if (!clone.hasOwnProperty(key)) + { + clone[key] = obj2[key]; + } + } + + return clone; +}; + +module.exports = Merge; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -17530,7 +17774,7 @@ module.exports = Set; /***/ }), -/* 106 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17539,14 +17783,14 @@ module.exports = Set; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(52); -var Circle = __webpack_require__(77); +var BlendModes = __webpack_require__(53); +var Circle = __webpack_require__(78); var CircleContains = __webpack_require__(46); var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var Rectangle = __webpack_require__(10); -var RectangleContains = __webpack_require__(47); +var Rectangle = __webpack_require__(11); +var RectangleContains = __webpack_require__(48); /** * @classdesc @@ -17843,7 +18087,7 @@ module.exports = Zone; /***/ }), -/* 107 */ +/* 108 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17858,30 +18102,30 @@ module.exports = Zone; module.exports = { - ADD_ANIMATION: __webpack_require__(504), - ANIMATION_COMPLETE: __webpack_require__(505), - ANIMATION_REPEAT: __webpack_require__(506), - ANIMATION_RESTART: __webpack_require__(507), - ANIMATION_START: __webpack_require__(508), - PAUSE_ALL: __webpack_require__(509), - REMOVE_ANIMATION: __webpack_require__(510), - RESUME_ALL: __webpack_require__(511), - SPRITE_ANIMATION_COMPLETE: __webpack_require__(512), - SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(513), - SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(514), - SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(515), - SPRITE_ANIMATION_KEY_START: __webpack_require__(516), - SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(517), - SPRITE_ANIMATION_REPEAT: __webpack_require__(518), - SPRITE_ANIMATION_RESTART: __webpack_require__(519), - SPRITE_ANIMATION_START: __webpack_require__(520), - SPRITE_ANIMATION_UPDATE: __webpack_require__(521) + ADD_ANIMATION: __webpack_require__(506), + ANIMATION_COMPLETE: __webpack_require__(507), + ANIMATION_REPEAT: __webpack_require__(508), + ANIMATION_RESTART: __webpack_require__(509), + ANIMATION_START: __webpack_require__(510), + PAUSE_ALL: __webpack_require__(511), + REMOVE_ANIMATION: __webpack_require__(512), + RESUME_ALL: __webpack_require__(513), + SPRITE_ANIMATION_COMPLETE: __webpack_require__(514), + SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(515), + SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(516), + SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(517), + SPRITE_ANIMATION_KEY_START: __webpack_require__(518), + SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(519), + SPRITE_ANIMATION_REPEAT: __webpack_require__(520), + SPRITE_ANIMATION_RESTART: __webpack_require__(521), + SPRITE_ANIMATION_START: __webpack_require__(522), + SPRITE_ANIMATION_UPDATE: __webpack_require__(523) }; /***/ }), -/* 108 */ +/* 109 */ /***/ (function(module, exports) { /** @@ -17909,7 +18153,7 @@ module.exports = Perimeter; /***/ }), -/* 109 */ +/* 110 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17919,7 +18163,7 @@ module.exports = Perimeter; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(259); +var Events = __webpack_require__(262); /** * @callback DataEachCallback @@ -18550,7 +18794,7 @@ module.exports = DataManager; /***/ }), -/* 110 */ +/* 111 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -18563,11 +18807,11 @@ module.exports = DataManager; * @namespace Phaser.GameObjects.Events */ -module.exports = { DESTROY: __webpack_require__(536) }; +module.exports = { DESTROY: __webpack_require__(554) }; /***/ }), -/* 111 */ +/* 112 */ /***/ (function(module, exports) { /** @@ -18605,7 +18849,7 @@ module.exports = Shuffle; /***/ }), -/* 112 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -18617,12 +18861,12 @@ module.exports = Shuffle; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var DegToRad = __webpack_require__(35); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(48); -var Rectangle = __webpack_require__(10); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(49); +var Rectangle = __webpack_require__(11); var TransformMatrix = __webpack_require__(32); -var ValueToColor = __webpack_require__(159); -var Vector2 = __webpack_require__(4); +var ValueToColor = __webpack_require__(160); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -20526,7 +20770,7 @@ module.exports = BaseCamera; /***/ }), -/* 113 */ +/* 114 */ /***/ (function(module, exports) { /** @@ -20658,7 +20902,7 @@ module.exports = Smoothing(); /***/ }), -/* 114 */ +/* 115 */ /***/ (function(module, exports) { /** @@ -20688,7 +20932,7 @@ module.exports = Linear; /***/ }), -/* 115 */ +/* 116 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -20857,10 +21101,10 @@ function init () module.exports = init(); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(681))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(685))) /***/ }), -/* 116 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -20869,7 +21113,7 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(115); +var OS = __webpack_require__(116); /** * Determines the browser type and version running this Phaser Game instance. @@ -20970,7 +21214,7 @@ module.exports = init(); /***/ }), -/* 117 */ +/* 118 */ /***/ (function(module, exports) { /** @@ -21000,7 +21244,7 @@ module.exports = IsSizePowerOfTwo; /***/ }), -/* 118 */ +/* 119 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21015,17 +21259,17 @@ module.exports = IsSizePowerOfTwo; module.exports = { - ADD: __webpack_require__(727), - ERROR: __webpack_require__(728), - LOAD: __webpack_require__(729), - READY: __webpack_require__(730), - REMOVE: __webpack_require__(731) + ADD: __webpack_require__(732), + ERROR: __webpack_require__(733), + LOAD: __webpack_require__(734), + READY: __webpack_require__(735), + REMOVE: __webpack_require__(736) }; /***/ }), -/* 119 */ +/* 120 */ /***/ (function(module, exports) { /** @@ -21083,7 +21327,7 @@ module.exports = AddToDOM; /***/ }), -/* 120 */ +/* 121 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21092,7 +21336,7 @@ module.exports = AddToDOM; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(78); +var SpliceOne = __webpack_require__(79); /** * Removes the given item, or array of items, from the array. @@ -21174,7 +21418,7 @@ module.exports = Remove; /***/ }), -/* 121 */ +/* 122 */ /***/ (function(module, exports) { /** @@ -22062,7 +22306,7 @@ module.exports = KeyCodes; /***/ }), -/* 122 */ +/* 123 */ /***/ (function(module, exports) { /** @@ -22185,7 +22429,7 @@ module.exports = CONST; /***/ }), -/* 123 */ +/* 124 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22196,10 +22440,10 @@ module.exports = CONST; */ var Class = __webpack_require__(0); -var Clone = __webpack_require__(64); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(65); -var GameEvents = __webpack_require__(28); +var Clone = __webpack_require__(65); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(66); +var GameEvents = __webpack_require__(18); var NOOP = __webpack_require__(1); /** @@ -22809,7 +23053,7 @@ module.exports = BaseSoundManager; /***/ }), -/* 124 */ +/* 125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22820,9 +23064,9 @@ module.exports = BaseSoundManager; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(65); -var Extend = __webpack_require__(17); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(66); +var Extend = __webpack_require__(15); var NOOP = __webpack_require__(1); /** @@ -23309,7 +23553,7 @@ module.exports = BaseSound; /***/ }), -/* 125 */ +/* 126 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23318,10 +23562,10 @@ module.exports = BaseSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(178); +var ArrayUtils = __webpack_require__(180); var Class = __webpack_require__(0); var NOOP = __webpack_require__(1); -var StableSort = __webpack_require__(127); +var StableSort = __webpack_require__(128); /** * @callback EachListCallback @@ -24125,7 +24369,7 @@ module.exports = List; /***/ }), -/* 126 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -24134,8 +24378,8 @@ module.exports = List; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CheckMatrix = __webpack_require__(179); -var TransposeMatrix = __webpack_require__(360); +var CheckMatrix = __webpack_require__(181); +var TransposeMatrix = __webpack_require__(363); /** * Rotates the array matrix based on the given rotation value. @@ -24197,7 +24441,7 @@ module.exports = RotateMatrix; /***/ }), -/* 127 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -24342,7 +24586,7 @@ else {} })(); /***/ }), -/* 128 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -24354,10 +24598,10 @@ else {} var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var GetBitmapTextSize = __webpack_require__(904); -var ParseFromAtlas = __webpack_require__(905); -var ParseXMLBitmapFont = __webpack_require__(181); -var Render = __webpack_require__(906); +var GetBitmapTextSize = __webpack_require__(908); +var ParseFromAtlas = __webpack_require__(909); +var ParseXMLBitmapFont = __webpack_require__(183); +var Render = __webpack_require__(910); /** * @classdesc @@ -24984,7 +25228,7 @@ module.exports = BitmapText; /***/ }), -/* 129 */ +/* 130 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -24996,7 +25240,7 @@ module.exports = BitmapText; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var MeshRender = __webpack_require__(1026); +var MeshRender = __webpack_require__(1030); var NOOP = __webpack_require__(1); /** @@ -25157,7 +25401,7 @@ module.exports = Mesh; /***/ }), -/* 130 */ +/* 131 */ /***/ (function(module, exports) { /** @@ -25193,7 +25437,7 @@ module.exports = RectangleToRectangle; /***/ }), -/* 131 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25202,7 +25446,7 @@ module.exports = RectangleToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); // Contains the plugins that Phaser uses globally and locally. // These are the source objects, not instantiated. @@ -25305,7 +25549,7 @@ module.exports = InputPluginCache; /***/ }), -/* 132 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25320,19 +25564,19 @@ module.exports = InputPluginCache; module.exports = { - ANY_KEY_DOWN: __webpack_require__(1164), - ANY_KEY_UP: __webpack_require__(1165), - COMBO_MATCH: __webpack_require__(1166), - DOWN: __webpack_require__(1167), - KEY_DOWN: __webpack_require__(1168), - KEY_UP: __webpack_require__(1169), - UP: __webpack_require__(1170) + ANY_KEY_DOWN: __webpack_require__(1168), + ANY_KEY_UP: __webpack_require__(1169), + COMBO_MATCH: __webpack_require__(1170), + DOWN: __webpack_require__(1171), + KEY_DOWN: __webpack_require__(1172), + KEY_UP: __webpack_require__(1173), + UP: __webpack_require__(1174) }; /***/ }), -/* 133 */ +/* 134 */ /***/ (function(module, exports) { /** @@ -25396,7 +25640,7 @@ module.exports = XHRSettings; /***/ }), -/* 134 */ +/* 135 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25406,8 +25650,8 @@ module.exports = XHRSettings; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(207); -var Sprite = __webpack_require__(67); +var Components = __webpack_require__(209); +var Sprite = __webpack_require__(68); /** * @classdesc @@ -25497,8 +25741,8 @@ module.exports = ArcadeSprite; /***/ }), -/* 135 */, -/* 136 */ +/* 136 */, +/* 137 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25513,54 +25757,54 @@ module.exports = ArcadeSprite; module.exports = { - CalculateFacesAt: __webpack_require__(210), - CalculateFacesWithin: __webpack_require__(51), - Copy: __webpack_require__(1257), - CreateFromTiles: __webpack_require__(1258), - CullTiles: __webpack_require__(1259), - Fill: __webpack_require__(1260), - FilterTiles: __webpack_require__(1261), - FindByIndex: __webpack_require__(1262), - FindTile: __webpack_require__(1263), - ForEachTile: __webpack_require__(1264), - GetTileAt: __webpack_require__(137), - GetTileAtWorldXY: __webpack_require__(1265), - GetTilesWithin: __webpack_require__(21), - GetTilesWithinShape: __webpack_require__(1266), - GetTilesWithinWorldXY: __webpack_require__(1267), - HasTileAt: __webpack_require__(451), - HasTileAtWorldXY: __webpack_require__(1268), + CalculateFacesAt: __webpack_require__(212), + CalculateFacesWithin: __webpack_require__(52), + Copy: __webpack_require__(1261), + CreateFromTiles: __webpack_require__(1262), + CullTiles: __webpack_require__(1263), + Fill: __webpack_require__(1264), + FilterTiles: __webpack_require__(1265), + FindByIndex: __webpack_require__(1266), + FindTile: __webpack_require__(1267), + ForEachTile: __webpack_require__(1268), + GetTileAt: __webpack_require__(138), + GetTileAtWorldXY: __webpack_require__(1269), + GetTilesWithin: __webpack_require__(23), + GetTilesWithinShape: __webpack_require__(1270), + GetTilesWithinWorldXY: __webpack_require__(1271), + HasTileAt: __webpack_require__(454), + HasTileAtWorldXY: __webpack_require__(1272), IsInLayerBounds: __webpack_require__(101), - PutTileAt: __webpack_require__(211), - PutTileAtWorldXY: __webpack_require__(1269), - PutTilesAt: __webpack_require__(1270), - Randomize: __webpack_require__(1271), - RemoveTileAt: __webpack_require__(452), - RemoveTileAtWorldXY: __webpack_require__(1272), - RenderDebug: __webpack_require__(1273), - ReplaceByIndex: __webpack_require__(450), - SetCollision: __webpack_require__(1274), - SetCollisionBetween: __webpack_require__(1275), - SetCollisionByExclusion: __webpack_require__(1276), - SetCollisionByProperty: __webpack_require__(1277), - SetCollisionFromCollisionGroup: __webpack_require__(1278), - SetTileIndexCallback: __webpack_require__(1279), - SetTileLocationCallback: __webpack_require__(1280), - Shuffle: __webpack_require__(1281), - SwapByIndex: __webpack_require__(1282), - TileToWorldX: __webpack_require__(138), - TileToWorldXY: __webpack_require__(1283), - TileToWorldY: __webpack_require__(139), - WeightedRandomize: __webpack_require__(1284), - WorldToTileX: __webpack_require__(61), - WorldToTileXY: __webpack_require__(1285), - WorldToTileY: __webpack_require__(62) + PutTileAt: __webpack_require__(213), + PutTileAtWorldXY: __webpack_require__(1273), + PutTilesAt: __webpack_require__(1274), + Randomize: __webpack_require__(1275), + RemoveTileAt: __webpack_require__(455), + RemoveTileAtWorldXY: __webpack_require__(1276), + RenderDebug: __webpack_require__(1277), + ReplaceByIndex: __webpack_require__(453), + SetCollision: __webpack_require__(1278), + SetCollisionBetween: __webpack_require__(1279), + SetCollisionByExclusion: __webpack_require__(1280), + SetCollisionByProperty: __webpack_require__(1281), + SetCollisionFromCollisionGroup: __webpack_require__(1282), + SetTileIndexCallback: __webpack_require__(1283), + SetTileLocationCallback: __webpack_require__(1284), + Shuffle: __webpack_require__(1285), + SwapByIndex: __webpack_require__(1286), + TileToWorldX: __webpack_require__(139), + TileToWorldXY: __webpack_require__(1287), + TileToWorldY: __webpack_require__(140), + WeightedRandomize: __webpack_require__(1288), + WorldToTileX: __webpack_require__(62), + WorldToTileXY: __webpack_require__(1289), + WorldToTileY: __webpack_require__(63) }; /***/ }), -/* 137 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25616,7 +25860,7 @@ module.exports = GetTileAt; /***/ }), -/* 138 */ +/* 139 */ /***/ (function(module, exports) { /** @@ -25661,7 +25905,7 @@ module.exports = TileToWorldX; /***/ }), -/* 139 */ +/* 140 */ /***/ (function(module, exports) { /** @@ -25706,7 +25950,7 @@ module.exports = TileToWorldY; /***/ }), -/* 140 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26110,7 +26354,7 @@ module.exports = Tileset; /***/ }), -/* 141 */ +/* 142 */ /***/ (function(module, exports) { /** @@ -26120,16 +26364,17 @@ module.exports = Tileset; */ /** - * [description] + * Internal function used by the Tween Builder to create a function that will return + * the given value from the source. * * @function Phaser.Tweens.Builders.GetNewValue * @since 3.0.0 * - * @param {object} source - [description] - * @param {string} key - [description] - * @param {*} defaultValue - [description] + * @param {any} source - The source object to get the value from. + * @param {string} key - The property to get from the source. + * @param {any} defaultValue - A default value to return should the source not have the property set. * - * @return {function} [description] + * @return {function} A function which when called will return the property value from the source. */ var GetNewValue = function (source, key, defaultValue) { @@ -26141,9 +26386,9 @@ var GetNewValue = function (source, key, defaultValue) if (t === 'function') { - valueCallback = function (index, totalTargets, target) + valueCallback = function (target, targetKey, value, targetIndex, totalTargets, tween) { - return source[key](index, totalTargets, target); + return source[key](target, targetKey, value, targetIndex, totalTargets, tween); }; } else @@ -26173,7 +26418,7 @@ module.exports = GetNewValue; /***/ }), -/* 142 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26182,17 +26427,17 @@ module.exports = GetNewValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Defaults = __webpack_require__(219); +var Defaults = __webpack_require__(221); var GetAdvancedValue = __webpack_require__(14); -var GetBoolean = __webpack_require__(87); -var GetEaseFunction = __webpack_require__(96); -var GetNewValue = __webpack_require__(141); -var GetProps = __webpack_require__(473); -var GetTargets = __webpack_require__(217); -var GetValue = __webpack_require__(6); -var GetValueOp = __webpack_require__(218); -var Tween = __webpack_require__(220); -var TweenData = __webpack_require__(221); +var GetBoolean = __webpack_require__(88); +var GetEaseFunction = __webpack_require__(82); +var GetNewValue = __webpack_require__(142); +var GetProps = __webpack_require__(476); +var GetTargets = __webpack_require__(219); +var GetValue = __webpack_require__(5); +var GetValueOp = __webpack_require__(220); +var Tween = __webpack_require__(222); +var TweenData = __webpack_require__(224); /** * Creates a new Tween. @@ -26246,9 +26491,11 @@ var TweenBuilder = function (parent, config, defaults) var tweenData = TweenData( targets[t], + t, key, ops.getEnd, ops.getStart, + ops.getActive, GetEaseFunction(GetValue(value, 'ease', ease), easeParams), GetNewValue(value, 'delay', delay), GetNewValue(value, 'duration', duration), @@ -26304,7 +26551,7 @@ module.exports = TweenBuilder; /***/ }), -/* 143 */ +/* 144 */ /***/ (function(module, exports) { /** @@ -26438,7 +26685,7 @@ module.exports = ALIGN_CONST; /***/ }), -/* 144 */ +/* 145 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26447,7 +26694,7 @@ module.exports = ALIGN_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle. @@ -26477,7 +26724,7 @@ module.exports = CircumferencePoint; /***/ }), -/* 145 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26486,7 +26733,7 @@ module.exports = CircumferencePoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a uniformly distributed random point from anywhere within the given Circle. @@ -26521,7 +26768,7 @@ module.exports = Random; /***/ }), -/* 146 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26530,13 +26777,13 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(107); -var FindClosestInSorted = __webpack_require__(245); -var Frame = __webpack_require__(246); -var GetValue = __webpack_require__(6); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(108); +var FindClosestInSorted = __webpack_require__(248); +var Frame = __webpack_require__(249); +var GetValue = __webpack_require__(5); /** * @classdesc @@ -27369,9 +27616,11 @@ var Animation = new Class({ var len = this.frames.length; var slice = 1 / (len - 1); + var frame; + for (var i = 0; i < len; i++) { - var frame = this.frames[i]; + frame = this.frames[i]; frame.index = i + 1; frame.isFirst = false; @@ -27381,11 +27630,21 @@ var Animation = new Class({ if (i === 0) { frame.isFirst = true; - frame.isLast = (len === 1); - frame.prevFrame = this.frames[len - 1]; - frame.nextFrame = this.frames[i + 1]; + + if (len === 1) + { + frame.isLast = true; + frame.nextFrame = frame; + frame.prevFrame = frame; + } + else + { + frame.isLast = false; + frame.prevFrame = this.frames[len - 1]; + frame.nextFrame = this.frames[i + 1]; + } } - else if (i === len - 1) + else if (i === len - 1 && len > 1) { frame.isLast = true; frame.prevFrame = this.frames[len - 2]; @@ -27462,7 +27721,7 @@ module.exports = Animation; /***/ }), -/* 147 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27471,8 +27730,8 @@ module.exports = Animation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Perimeter = __webpack_require__(108); -var Point = __webpack_require__(3); +var Perimeter = __webpack_require__(109); +var Point = __webpack_require__(4); /** * Position is a value between 0 and 1 where 0 = the top-left of the rectangle and 0.5 = the bottom right. @@ -27539,7 +27798,7 @@ module.exports = GetPoint; /***/ }), -/* 148 */ +/* 149 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27548,8 +27807,8 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); -var Point = __webpack_require__(3); +var Length = __webpack_require__(56); +var Point = __webpack_require__(4); /** * Get a number of points along a line's length. @@ -27604,7 +27863,7 @@ module.exports = GetPoints; /***/ }), -/* 149 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27613,7 +27872,7 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a random point on a given Line. @@ -27644,7 +27903,7 @@ module.exports = Random; /***/ }), -/* 150 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27653,7 +27912,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a random point within a Rectangle. @@ -27682,7 +27941,7 @@ module.exports = Random; /***/ }), -/* 151 */ +/* 152 */ /***/ (function(module, exports) { /** @@ -27811,7 +28070,7 @@ module.exports = Pipeline; /***/ }), -/* 152 */ +/* 153 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27820,7 +28079,7 @@ module.exports = Pipeline; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a uniformly distributed random point from anywhere within the given Ellipse. @@ -27852,7 +28111,7 @@ module.exports = Random; /***/ }), -/* 153 */ +/* 154 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27861,7 +28120,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * [description] @@ -27908,7 +28167,7 @@ module.exports = Random; /***/ }), -/* 154 */ +/* 155 */ /***/ (function(module, exports) { /** @@ -27945,7 +28204,7 @@ module.exports = RotateAroundDistance; /***/ }), -/* 155 */ +/* 156 */ /***/ (function(module, exports) { /** @@ -27984,7 +28243,7 @@ module.exports = SmootherStep; /***/ }), -/* 156 */ +/* 157 */ /***/ (function(module, exports) { /** @@ -28031,7 +28290,7 @@ module.exports = SmoothStep; /***/ }), -/* 157 */ +/* 158 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28404,7 +28663,7 @@ module.exports = Map; /***/ }), -/* 158 */ +/* 159 */ /***/ (function(module, exports) { /** @@ -28480,7 +28739,7 @@ module.exports = Pad; /***/ }), -/* 159 */ +/* 160 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28489,10 +28748,10 @@ module.exports = Pad; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HexStringToColor = __webpack_require__(269); -var IntegerToColor = __webpack_require__(272); -var ObjectToColor = __webpack_require__(274); -var RGBStringToColor = __webpack_require__(275); +var HexStringToColor = __webpack_require__(272); +var IntegerToColor = __webpack_require__(275); +var ObjectToColor = __webpack_require__(277); +var RGBStringToColor = __webpack_require__(278); /** * Converts the given source color value into an instance of a Color class. @@ -28536,7 +28795,7 @@ module.exports = ValueToColor; /***/ }), -/* 160 */ +/* 161 */ /***/ (function(module, exports) { /** @@ -28566,7 +28825,7 @@ module.exports = GetColor; /***/ }), -/* 161 */ +/* 162 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28575,7 +28834,7 @@ module.exports = GetColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColor = __webpack_require__(160); +var GetColor = __webpack_require__(161); /** * Converts an HSV (hue, saturation and value) color value to RGB. @@ -28667,7 +28926,7 @@ module.exports = HSVToRGB; /***/ }), -/* 162 */ +/* 163 */ /***/ (function(module, exports) { /** @@ -28704,7 +28963,7 @@ module.exports = CenterOn; /***/ }), -/* 163 */ +/* 164 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28713,18 +28972,18 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Back = __webpack_require__(277); -var Bounce = __webpack_require__(278); -var Circular = __webpack_require__(279); -var Cubic = __webpack_require__(280); -var Elastic = __webpack_require__(281); -var Expo = __webpack_require__(282); -var Linear = __webpack_require__(283); -var Quadratic = __webpack_require__(284); -var Quartic = __webpack_require__(285); -var Quintic = __webpack_require__(286); -var Sine = __webpack_require__(287); -var Stepped = __webpack_require__(288); +var Back = __webpack_require__(280); +var Bounce = __webpack_require__(281); +var Circular = __webpack_require__(282); +var Cubic = __webpack_require__(283); +var Elastic = __webpack_require__(284); +var Expo = __webpack_require__(285); +var Linear = __webpack_require__(286); +var Quadratic = __webpack_require__(287); +var Quartic = __webpack_require__(288); +var Quintic = __webpack_require__(289); +var Sine = __webpack_require__(290); +var Stepped = __webpack_require__(291); // EaseMap module.exports = { @@ -28785,7 +29044,7 @@ module.exports = { /***/ }), -/* 164 */ +/* 165 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28794,9 +29053,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(115); -var Browser = __webpack_require__(116); -var CanvasPool = __webpack_require__(24); +var OS = __webpack_require__(116); +var Browser = __webpack_require__(117); +var CanvasPool = __webpack_require__(25); /** * Determines the features of the browser running this Phaser Game instance. @@ -28977,7 +29236,7 @@ module.exports = init(); /***/ }), -/* 165 */ +/* 166 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28986,8 +29245,8 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(22); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Math @@ -28996,61 +29255,62 @@ var Extend = __webpack_require__(17); var PhaserMath = { // Collections of functions - Angle: __webpack_require__(686), - Distance: __webpack_require__(694), - Easing: __webpack_require__(696), - Fuzzy: __webpack_require__(697), - Interpolation: __webpack_require__(700), - Pow2: __webpack_require__(705), - Snap: __webpack_require__(707), + Angle: __webpack_require__(690), + Distance: __webpack_require__(698), + Easing: __webpack_require__(700), + Fuzzy: __webpack_require__(701), + Interpolation: __webpack_require__(704), + Pow2: __webpack_require__(709), + Snap: __webpack_require__(711), // Expose the RNG Class - RandomDataGenerator: __webpack_require__(709), + RandomDataGenerator: __webpack_require__(713), // Single functions - Average: __webpack_require__(710), - Bernstein: __webpack_require__(297), - Between: __webpack_require__(168), - CatmullRom: __webpack_require__(167), - CeilTo: __webpack_require__(711), - Clamp: __webpack_require__(22), + Average: __webpack_require__(714), + Bernstein: __webpack_require__(300), + Between: __webpack_require__(169), + CatmullRom: __webpack_require__(168), + CeilTo: __webpack_require__(715), + Clamp: __webpack_require__(24), DegToRad: __webpack_require__(35), - Difference: __webpack_require__(712), - Factorial: __webpack_require__(298), - FloatBetween: __webpack_require__(304), - FloorTo: __webpack_require__(713), - FromPercent: __webpack_require__(86), - GetSpeed: __webpack_require__(714), - IsEven: __webpack_require__(715), - IsEvenStrict: __webpack_require__(716), - Linear: __webpack_require__(114), - MaxAdd: __webpack_require__(717), - MinSub: __webpack_require__(718), - Percent: __webpack_require__(719), - RadToDeg: __webpack_require__(169), - RandomXY: __webpack_require__(720), - RandomXYZ: __webpack_require__(721), - RandomXYZW: __webpack_require__(722), - Rotate: __webpack_require__(305), - RotateAround: __webpack_require__(251), - RotateAroundDistance: __webpack_require__(154), - RoundAwayFromZero: __webpack_require__(306), - RoundTo: __webpack_require__(723), - SinCosTableGenerator: __webpack_require__(724), - SmootherStep: __webpack_require__(155), - SmoothStep: __webpack_require__(156), - TransformXY: __webpack_require__(307), - Within: __webpack_require__(725), - Wrap: __webpack_require__(56), + Difference: __webpack_require__(716), + Factorial: __webpack_require__(301), + FloatBetween: __webpack_require__(307), + FloorTo: __webpack_require__(717), + FromPercent: __webpack_require__(87), + GetSpeed: __webpack_require__(718), + IsEven: __webpack_require__(719), + IsEvenStrict: __webpack_require__(720), + Linear: __webpack_require__(115), + MaxAdd: __webpack_require__(721), + MinSub: __webpack_require__(722), + Percent: __webpack_require__(723), + RadToDeg: __webpack_require__(170), + RandomXY: __webpack_require__(724), + RandomXYZ: __webpack_require__(725), + RandomXYZW: __webpack_require__(726), + Rotate: __webpack_require__(308), + RotateAround: __webpack_require__(254), + RotateAroundDistance: __webpack_require__(155), + RoundAwayFromZero: __webpack_require__(309), + RoundTo: __webpack_require__(727), + SinCosTableGenerator: __webpack_require__(728), + SmootherStep: __webpack_require__(156), + SmoothStep: __webpack_require__(157), + ToXY: __webpack_require__(729), + TransformXY: __webpack_require__(310), + Within: __webpack_require__(730), + Wrap: __webpack_require__(57), // Vector classes - Vector2: __webpack_require__(4), - Vector3: __webpack_require__(170), - Vector4: __webpack_require__(308), - Matrix3: __webpack_require__(309), - Matrix4: __webpack_require__(310), - Quaternion: __webpack_require__(311), - RotateVec3: __webpack_require__(726) + Vector2: __webpack_require__(3), + Vector3: __webpack_require__(171), + Vector4: __webpack_require__(311), + Matrix3: __webpack_require__(312), + Matrix4: __webpack_require__(313), + Quaternion: __webpack_require__(314), + RotateVec3: __webpack_require__(731) }; @@ -29064,7 +29324,7 @@ module.exports = PhaserMath; /***/ }), -/* 166 */ +/* 167 */ /***/ (function(module, exports) { /** @@ -29098,7 +29358,7 @@ module.exports = Equal; /***/ }), -/* 167 */ +/* 168 */ /***/ (function(module, exports) { /** @@ -29135,7 +29395,7 @@ module.exports = CatmullRom; /***/ }), -/* 168 */ +/* 169 */ /***/ (function(module, exports) { /** @@ -29164,7 +29424,7 @@ module.exports = Between; /***/ }), -/* 169 */ +/* 170 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29173,7 +29433,7 @@ module.exports = Between; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); +var CONST = __webpack_require__(22); /** * Convert the given angle in radians, to the equivalent angle in degrees. @@ -29194,7 +29454,7 @@ module.exports = RadToDeg; /***/ }), -/* 170 */ +/* 171 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30004,7 +30264,7 @@ module.exports = Vector3; /***/ }), -/* 171 */ +/* 172 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30105,7 +30365,7 @@ module.exports = DefaultPlugins; /***/ }), -/* 172 */ +/* 173 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30114,7 +30374,7 @@ module.exports = DefaultPlugins; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); // points is an array of Point-like objects, // either 2 dimensional arrays, or objects with public x/y properties: @@ -30190,7 +30450,7 @@ module.exports = FromPoints; /***/ }), -/* 173 */ +/* 174 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30201,10 +30461,10 @@ module.exports = FromPoints; var CONST = { - CENTER: __webpack_require__(331), - ORIENTATION: __webpack_require__(332), - SCALE_MODE: __webpack_require__(333), - ZOOM: __webpack_require__(334) + CENTER: __webpack_require__(334), + ORIENTATION: __webpack_require__(335), + SCALE_MODE: __webpack_require__(336), + ZOOM: __webpack_require__(337) }; @@ -30212,7 +30472,7 @@ module.exports = CONST; /***/ }), -/* 174 */ +/* 175 */ /***/ (function(module, exports) { /** @@ -30241,7 +30501,7 @@ module.exports = RemoveFromDOM; /***/ }), -/* 175 */ +/* 176 */ /***/ (function(module, exports) { /** @@ -30339,7 +30599,7 @@ module.exports = INPUT_CONST; /***/ }), -/* 176 */ +/* 177 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30349,13 +30609,13 @@ module.exports = INPUT_CONST; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(122); -var DefaultPlugins = __webpack_require__(171); -var Events = __webpack_require__(19); -var GetPhysicsPlugins = __webpack_require__(839); -var GetScenePlugins = __webpack_require__(840); +var CONST = __webpack_require__(123); +var DefaultPlugins = __webpack_require__(172); +var Events = __webpack_require__(20); +var GetPhysicsPlugins = __webpack_require__(844); +var GetScenePlugins = __webpack_require__(845); var NOOP = __webpack_require__(1); -var Settings = __webpack_require__(348); +var Settings = __webpack_require__(350); /** * @classdesc @@ -30510,7 +30770,7 @@ var Systems = new Class({ * In the default set-up you can access this from within a Scene via the `this.sound` property. * * @name Phaser.Scenes.Systems#sound - * @type {Phaser.Sound.BaseSoundManager} + * @type {(Phaser.Sound.NoAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager)} * @since 3.0.0 */ this.sound; @@ -31097,7 +31357,44 @@ module.exports = Systems; /***/ }), -/* 177 */ +/* 178 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Capitalizes the first letter of a string if there is one. + * @example + * UppercaseFirst('abc'); + * // returns 'Abc' + * @example + * UppercaseFirst('the happy family'); + * // returns 'The happy family' + * @example + * UppercaseFirst(''); + * // returns '' + * + * @function Phaser.Utils.String.UppercaseFirst + * @since 3.0.0 + * + * @param {string} str - The string to capitalize. + * + * @return {string} A new string, same as the first, but with the first letter capitalized. + */ +var UppercaseFirst = function (str) +{ + return str && str[0].toUpperCase() + str.slice(1); +}; + +module.exports = UppercaseFirst; + + +/***/ }), +/* 179 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31107,8 +31404,8 @@ module.exports = Systems; */ var Class = __webpack_require__(0); -var Frame = __webpack_require__(91); -var TextureSource = __webpack_require__(350); +var Frame = __webpack_require__(92); +var TextureSource = __webpack_require__(353); var TEXTURE_MISSING_ERROR = 'Texture.frame missing: '; @@ -31279,6 +31576,35 @@ var Texture = new Class({ return frame; }, + /** + * Removes the given Frame from this Texture. The Frame is destroyed immediately. + * + * Any Game Objects using this Frame should stop using it _before_ you remove it, + * as it does not happen automatically. + * + * @method Phaser.Textures.Texture#remove + * @since 3.19.0 + * + * @param {string} name - The key of the Frame to remove. + * + * @return {boolean} True if a Frame with the matching key was removed from this Texture. + */ + remove: function (name) + { + if (this.has(name)) + { + var frame = this.get(name); + + frame.destroy(); + + delete this.frames[name]; + + return true; + } + + return false; + }, + /** * Checks to see if a Frame matching the given key exists within this Texture. * @@ -31588,7 +31914,7 @@ module.exports = Texture; /***/ }), -/* 178 */ +/* 180 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31603,45 +31929,45 @@ module.exports = Texture; module.exports = { - Matrix: __webpack_require__(876), + Matrix: __webpack_require__(880), - Add: __webpack_require__(883), - AddAt: __webpack_require__(884), - BringToTop: __webpack_require__(885), - CountAllMatching: __webpack_require__(886), - Each: __webpack_require__(887), - EachInRange: __webpack_require__(888), - FindClosestInSorted: __webpack_require__(245), - GetAll: __webpack_require__(889), - GetFirst: __webpack_require__(890), - GetRandom: __webpack_require__(180), - MoveDown: __webpack_require__(891), - MoveTo: __webpack_require__(892), - MoveUp: __webpack_require__(893), - NumberArray: __webpack_require__(894), - NumberArrayStep: __webpack_require__(895), - QuickSelect: __webpack_require__(361), - Range: __webpack_require__(362), - Remove: __webpack_require__(120), - RemoveAt: __webpack_require__(896), - RemoveBetween: __webpack_require__(897), - RemoveRandomElement: __webpack_require__(898), - Replace: __webpack_require__(899), - RotateLeft: __webpack_require__(261), - RotateRight: __webpack_require__(262), - SafeRange: __webpack_require__(66), - SendToBack: __webpack_require__(900), - SetAll: __webpack_require__(901), - Shuffle: __webpack_require__(111), - SpliceOne: __webpack_require__(78), - StableSort: __webpack_require__(127), - Swap: __webpack_require__(902) + Add: __webpack_require__(887), + AddAt: __webpack_require__(888), + BringToTop: __webpack_require__(889), + CountAllMatching: __webpack_require__(890), + Each: __webpack_require__(891), + EachInRange: __webpack_require__(892), + FindClosestInSorted: __webpack_require__(248), + GetAll: __webpack_require__(893), + GetFirst: __webpack_require__(894), + GetRandom: __webpack_require__(182), + MoveDown: __webpack_require__(895), + MoveTo: __webpack_require__(896), + MoveUp: __webpack_require__(897), + NumberArray: __webpack_require__(898), + NumberArrayStep: __webpack_require__(899), + QuickSelect: __webpack_require__(364), + Range: __webpack_require__(365), + Remove: __webpack_require__(121), + RemoveAt: __webpack_require__(900), + RemoveBetween: __webpack_require__(901), + RemoveRandomElement: __webpack_require__(902), + Replace: __webpack_require__(903), + RotateLeft: __webpack_require__(264), + RotateRight: __webpack_require__(265), + SafeRange: __webpack_require__(67), + SendToBack: __webpack_require__(904), + SetAll: __webpack_require__(905), + Shuffle: __webpack_require__(112), + SpliceOne: __webpack_require__(79), + StableSort: __webpack_require__(128), + Swap: __webpack_require__(906) }; /***/ }), -/* 179 */ +/* 181 */ /***/ (function(module, exports) { /** @@ -31702,7 +32028,7 @@ module.exports = CheckMatrix; /***/ }), -/* 180 */ +/* 182 */ /***/ (function(module, exports) { /** @@ -31737,7 +32063,7 @@ module.exports = GetRandom; /***/ }), -/* 181 */ +/* 183 */ /***/ (function(module, exports) { /** @@ -31878,7 +32204,7 @@ module.exports = ParseXMLBitmapFont; /***/ }), -/* 182 */ +/* 184 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31887,13 +32213,13 @@ module.exports = ParseXMLBitmapFont; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlitterRender = __webpack_require__(909); -var Bob = __webpack_require__(912); +var BlitterRender = __webpack_require__(913); +var Bob = __webpack_require__(916); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Frame = __webpack_require__(91); +var Frame = __webpack_require__(92); var GameObject = __webpack_require__(13); -var List = __webpack_require__(125); +var List = __webpack_require__(126); /** * @callback CreateCallback @@ -32177,7 +32503,7 @@ module.exports = Blitter; /***/ }), -/* 183 */ +/* 185 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32187,16 +32513,16 @@ module.exports = Blitter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(178); -var BlendModes = __webpack_require__(52); +var ArrayUtils = __webpack_require__(180); +var BlendModes = __webpack_require__(53); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Events = __webpack_require__(110); +var Events = __webpack_require__(111); var GameObject = __webpack_require__(13); -var Rectangle = __webpack_require__(10); -var Render = __webpack_require__(913); -var Union = __webpack_require__(364); -var Vector2 = __webpack_require__(4); +var Rectangle = __webpack_require__(11); +var Render = __webpack_require__(917); +var Union = __webpack_require__(367); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -33502,7 +33828,7 @@ module.exports = Container; /***/ }), -/* 184 */ +/* 186 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33511,9 +33837,9 @@ module.exports = Container; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(128); +var BitmapText = __webpack_require__(129); var Class = __webpack_require__(0); -var Render = __webpack_require__(918); +var Render = __webpack_require__(922); /** * @classdesc @@ -33735,7 +34061,7 @@ module.exports = DynamicBitmapText; /***/ }), -/* 185 */ +/* 187 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33744,26 +34070,26 @@ module.exports = DynamicBitmapText; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(112); +var BaseCamera = __webpack_require__(113); var Class = __webpack_require__(0); -var Commands = __webpack_require__(186); -var ComponentsAlpha = __webpack_require__(244); -var ComponentsBlendMode = __webpack_require__(247); -var ComponentsDepth = __webpack_require__(248); -var ComponentsMask = __webpack_require__(252); -var ComponentsPipeline = __webpack_require__(151); -var ComponentsTransform = __webpack_require__(257); -var ComponentsVisible = __webpack_require__(258); -var ComponentsScrollFactor = __webpack_require__(255); +var Commands = __webpack_require__(188); +var ComponentsAlpha = __webpack_require__(247); +var ComponentsBlendMode = __webpack_require__(250); +var ComponentsDepth = __webpack_require__(251); +var ComponentsMask = __webpack_require__(255); +var ComponentsPipeline = __webpack_require__(152); +var ComponentsTransform = __webpack_require__(260); +var ComponentsVisible = __webpack_require__(261); +var ComponentsScrollFactor = __webpack_require__(258); var TransformMatrix = __webpack_require__(32); -var Ellipse = __webpack_require__(92); +var Ellipse = __webpack_require__(93); var GameObject = __webpack_require__(13); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); -var MATH_CONST = __webpack_require__(23); -var Render = __webpack_require__(924); +var GetValue = __webpack_require__(5); +var MATH_CONST = __webpack_require__(22); +var Render = __webpack_require__(928); /** * @classdesc @@ -35285,7 +35611,7 @@ module.exports = Graphics; /***/ }), -/* 186 */ +/* 188 */ /***/ (function(module, exports) { /** @@ -35322,7 +35648,7 @@ module.exports = { /***/ }), -/* 187 */ +/* 189 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35331,7 +35657,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse based on the given angle. @@ -35364,7 +35690,7 @@ module.exports = CircumferencePoint; /***/ }), -/* 188 */ +/* 190 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35376,10 +35702,10 @@ module.exports = CircumferencePoint; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var GravityWell = __webpack_require__(372); -var List = __webpack_require__(125); -var ParticleEmitter = __webpack_require__(374); -var Render = __webpack_require__(934); +var GravityWell = __webpack_require__(375); +var List = __webpack_require__(126); +var ParticleEmitter = __webpack_require__(377); +var Render = __webpack_require__(938); /** * @classdesc @@ -35838,7 +36164,7 @@ module.exports = ParticleEmitterManager; /***/ }), -/* 189 */ +/* 191 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35847,17 +36173,17 @@ module.exports = ParticleEmitterManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(52); -var Camera = __webpack_require__(112); -var CanvasPool = __webpack_require__(24); +var BlendModes = __webpack_require__(53); +var Camera = __webpack_require__(113); +var CanvasPool = __webpack_require__(25); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(26); -var Frame = __webpack_require__(91); +var CONST = __webpack_require__(31); +var Frame = __webpack_require__(92); var GameObject = __webpack_require__(13); -var Render = __webpack_require__(938); +var Render = __webpack_require__(942); var Utils = __webpack_require__(9); -var UUID = __webpack_require__(380); +var UUID = __webpack_require__(383); /** * @classdesc @@ -36103,6 +36429,17 @@ var RenderTexture = new Class({ */ this.gl = null; + /** + * A reference to the WebGLTexture that is being rendered to in a WebGL Context. + * + * @name Phaser.GameObjects.RenderTexture#glTexture + * @type {WebGLTexture} + * @default null + * @readonly + * @since 3.19.0 + */ + this.glTexture = null; + var renderer = this.renderer; if (renderer.type === CONST.WEBGL) @@ -36110,8 +36447,9 @@ var RenderTexture = new Class({ var gl = renderer.gl; this.gl = gl; + this.glTexture = this.frame.source.glTexture; this.drawGameObject = this.batchGameObjectWebGL; - this.framebuffer = renderer.createFramebuffer(width, height, this.frame.source.glTexture, false); + this.framebuffer = renderer.createFramebuffer(width, height, this.glTexture, false); } else if (renderer.type === CONST.CANVAS) { @@ -36176,7 +36514,8 @@ var RenderTexture = new Class({ { if (this.frame.name === '__BASE') { - // Tesize the texture + // Resize the texture + this.canvas.width = width; this.canvas.height = height; @@ -36187,10 +36526,14 @@ var RenderTexture = new Class({ this.renderer.deleteTexture(this.frame.source.glTexture); this.renderer.deleteFramebuffer(this.framebuffer); - this.frame.source.glTexture = this.renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false); - this.framebuffer = this.renderer.createFramebuffer(width, height, this.frame.source.glTexture, false); + var glTexture = this.renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false); - this.frame.glTexture = this.frame.source.glTexture; + this.framebuffer = this.renderer.createFramebuffer(width, height, glTexture, false); + + this.frame.source.isRenderTexture = true; + + this.frame.glTexture = glTexture; + this.glTexture = glTexture; } this.frame.source.width = width; @@ -36843,8 +37186,6 @@ var RenderTexture = new Class({ * @param {number} [y=0] - The y position to offset the Game Object by. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. * @param {number} [tint] - The tint color to use. If not specified it uses the `globalTint` property. - * - * @return {boolean} `true` if the frame was found and drawn, otherwise `false`. */ batchTextureFrameKey: function (key, frame, x, y, alpha, tint) { @@ -36896,6 +37237,114 @@ var RenderTexture = new Class({ } }, + /** + * Takes a snapshot of the given area of this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture the whole Render Texture see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.GameObjects.RenderTexture#snapshotArea + * @since 3.19.0 + * + * @param {integer} x - The x coordinate to grab from. + * @param {integer} y - The y coordinate to grab from. + * @param {integer} width - The width of the area to grab. + * @param {integer} height - The height of the area to grab. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This Render Texture instance. + */ + snapshotArea: function (x, y, width, height, callback, type, encoderOptions) + { + if (this.gl) + { + this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, x, y, width, height, type, encoderOptions); + } + else + { + this.renderer.snapshotCanvas(this.canvas, callback, false, x, y, width, height, type, encoderOptions); + } + + return this; + }, + + /** + * Takes a snapshot of the whole of this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture just a portion of the Render Texture see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.GameObjects.RenderTexture#snapshot + * @since 3.19.0 + * + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This Render Texture instance. + */ + snapshot: function (callback, type, encoderOptions) + { + if (this.gl) + { + this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, 0, 0, this.width, this.height, type, encoderOptions); + } + else + { + this.renderer.snapshotCanvas(this.canvas, callback, false, 0, 0, this.width, this.height, type, encoderOptions); + } + + return this; + }, + + /** + * Takes a snapshot of the given pixel from this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture the whole Render Texture see the `snapshot` method. To capture a specific portion, see `snapshotArea`. + * + * Unlike the other two snapshot methods, this one will send your callback a `Color` object containing the color data for + * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, + * using less memory, than the other snapshot methods. + * + * @method Phaser.GameObjects.RenderTexture#snapshotPixel + * @since 3.19.0 + * + * @param {integer} x - The x coordinate of the pixel to get. + * @param {integer} y - The y coordinate of the pixel to get. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. + * + * @return {this} This Render Texture instance. + */ + snapshotPixel: function (x, y, callback) + { + if (this.gl) + { + this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, true, x, y); + } + else + { + this.renderer.snapshotCanvas(this.canvas, callback, true, x, y); + } + + return this; + }, + /** * Internal destroy handler, called as part of the destroy process. * @@ -36921,6 +37370,7 @@ var RenderTexture = new Class({ this.context = null; this.framebuffer = null; this.texture = null; + this.glTexture = null; } } @@ -36930,7 +37380,7 @@ module.exports = RenderTexture; /***/ }), -/* 190 */ +/* 192 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36939,17 +37389,17 @@ module.exports = RenderTexture; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(119); -var CanvasPool = __webpack_require__(24); +var AddToDOM = __webpack_require__(120); +var CanvasPool = __webpack_require__(25); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(26); +var GameEvents = __webpack_require__(18); var GameObject = __webpack_require__(13); -var GetTextSize = __webpack_require__(944); -var GetValue = __webpack_require__(6); -var RemoveFromDOM = __webpack_require__(174); -var TextRender = __webpack_require__(945); -var TextStyle = __webpack_require__(948); +var GetTextSize = __webpack_require__(948); +var GetValue = __webpack_require__(5); +var RemoveFromDOM = __webpack_require__(175); +var TextRender = __webpack_require__(949); +var TextStyle = __webpack_require__(952); /** * @classdesc @@ -37016,7 +37466,7 @@ var TextStyle = __webpack_require__(948); * @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|string[])} text - The text this Text object will display. - * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The text style configuration object. + * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The text style configuration object. */ var Text = new Class({ @@ -37223,13 +37673,10 @@ var Text = new Class({ this.lineSpacing = style.lineSpacing; } - if (scene.sys.game.config.renderType === CONST.WEBGL) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function () { - scene.sys.game.renderer.onContextRestored(function () - { - this.dirty = true; - }, this); - } + this.dirty = true; + }, this); }, /** @@ -38338,7 +38785,7 @@ module.exports = Text; /***/ }), -/* 191 */ +/* 193 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38347,15 +38794,15 @@ module.exports = Text; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); +var CanvasPool = __webpack_require__(25); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(26); +var GameEvents = __webpack_require__(18); var GameObject = __webpack_require__(13); -var GetPowerOfTwo = __webpack_require__(302); -var Smoothing = __webpack_require__(113); -var TileSpriteRender = __webpack_require__(950); -var Vector2 = __webpack_require__(4); +var GetPowerOfTwo = __webpack_require__(305); +var Smoothing = __webpack_require__(114); +var TileSpriteRender = __webpack_require__(954); +var Vector2 = __webpack_require__(3); // bitmask flag for GameObject.renderMask var _FLAG = 8; // 1000 @@ -38618,17 +39065,15 @@ var TileSprite = new Class({ this.setOriginFromFrame(); this.initPipeline(); - if (scene.sys.game.config.renderType === CONST.WEBGL) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) { - scene.sys.game.renderer.onContextRestored(function (renderer) - { - var gl = renderer.gl; + var gl = renderer.gl; - this.dirty = true; - this.fillPattern = null; - this.fillPattern = renderer.createTexture2D(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.fillCanvas, this.potWidth, this.potHeight); - }, this); - } + this.dirty = true; + this.fillPattern = null; + this.fillPattern = renderer.createTexture2D(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.fillCanvas, this.potWidth, this.potHeight); + + }, this); }, /** @@ -38975,7 +39420,7 @@ module.exports = TileSprite; /***/ }), -/* 192 */ +/* 194 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38985,8 +39430,9 @@ module.exports = TileSprite; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(193); -var GetPoints = __webpack_require__(390); +var Contains = __webpack_require__(195); +var GetPoints = __webpack_require__(393); +var GEOM_CONST = __webpack_require__(47); /** * @classdesc @@ -39017,6 +39463,17 @@ var Polygon = new Class({ function Polygon (points) { + /** + * The geometry constant type of this object: `GEOM_CONST.POLYGON`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Polygon#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.POLYGON; + /** * The area of this Polygon. * @@ -39196,7 +39653,7 @@ module.exports = Polygon; /***/ }), -/* 193 */ +/* 195 */ /***/ (function(module, exports) { /** @@ -39245,7 +39702,7 @@ module.exports = Contains; /***/ }), -/* 194 */ +/* 196 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39255,7 +39712,7 @@ module.exports = Contains; */ var Class = __webpack_require__(0); -var Mesh = __webpack_require__(129); +var Mesh = __webpack_require__(130); /** * @classdesc @@ -39906,7 +40363,7 @@ module.exports = Quad; /***/ }), -/* 195 */ +/* 197 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39919,9 +40376,9 @@ var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); var GetFastValue = __webpack_require__(2); -var Merge = __webpack_require__(85); -var SetValue = __webpack_require__(398); -var ShaderRender = __webpack_require__(1029); +var Extend = __webpack_require__(15); +var SetValue = __webpack_require__(401); +var ShaderRender = __webpack_require__(1033); var TransformMatrix = __webpack_require__(32); /** @@ -40211,12 +40668,163 @@ var Shader = new Class({ */ this._textureCount = 0; + /** + * A reference to the GL Frame Buffer this Shader is drawing to. + * This property is only set if you have called `Shader.setRenderToTexture`. + * + * @name Phaser.GameObjects.Shader#framebuffer + * @type {?WebGLFramebuffer} + * @since 3.19.0 + */ + this.framebuffer = null; + + /** + * A reference to the WebGLTexture this Shader is rendering to. + * This property is only set if you have called `Shader.setRenderToTexture`. + * + * @name Phaser.GameObjects.Shader#glTexture + * @type {?WebGLTexture} + * @since 3.19.0 + */ + this.glTexture = null; + + /** + * A flag that indicates if this Shader has been set to render to a texture instead of the display list. + * + * This property is `true` if you have called `Shader.setRenderToTexture`, otherwise it's `false`. + * + * A Shader that is rendering to a texture _does not_ appear on the display list. + * + * @name Phaser.GameObjects.Shader#renderToTexture + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this.renderToTexture = false; + + /** + * A reference to the Phaser.Textures.Texture that has been stored in the Texture Manager for this Shader. + * + * This property is only set if you have called `Shader.setRenderToTexture`, otherwise it is `null`. + * + * @name Phaser.GameObjects.Shader#texture + * @type {Phaser.Textures.Texture} + * @since 3.19.0 + */ + this.texture = null; + + /** + * Internal saved texture key. + * + * @name Phaser.GameObjects.Shader#_savedKey + * @type {boolean} + * @private + * @since 3.19.0 + */ + this._savedKey = ''; + this.setPosition(x, y); this.setSize(width, height); this.setOrigin(0.5, 0.5); this.setShader(key, textures); }, + /** + * 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.Shader#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) + { + if (this.renderToTexture) + { + return true; + } + else + { + return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + } + }, + + /** + * Changes this Shader so instead of rendering to the display list it renders to a + * WebGL Framebuffer and WebGL Texture instead. This allows you to use the output + * of this shader as an input for another shader, by mapping a sampler2D uniform + * to it. + * + * After calling this method the `Shader.framebuffer` and `Shader.glTexture` properties + * are populated. + * + * Additionally, you can provide a key to this method. Doing so will create a Phaser Texture + * from this Shader and save it into the Texture Manager, allowing you to then use it for + * any texture-based Game Object, such as a Sprite or Image: + * + * ```javascript + * var shader = this.add.shader('myShader', x, y, width, height); + * + * shader.setRenderToTexture('doodle'); + * + * this.add.image(400, 300, 'doodle'); + * ``` + * + * Note that it stores an active reference to this Shader. That means as this shader updates, + * so does the texture and any object using it to render with. Also, if you destroy this + * shader, be sure to clear any objects that may have been using it as a texture too. + * + * You can access the Phaser Texture that is created via the `Shader.texture` property. + * + * By default it will create a single base texture. You can add frames to the texture + * by using the `Texture.add` method. After doing this, you can then allow Game Objects + * to use a specific frame from a Render Texture. + * + * @method Phaser.GameObjects.Shader#setRenderToTexture + * @since 3.19.0 + * + * @param {string} [key] - The unique key to store the texture as within the global Texture Manager. + * @param {boolean} [flipY=false] - Does this texture need vertically flipping before rendering? This should usually be set to `true` if being fed from a buffer. + * + * @return {this} This Shader instance. + */ + setRenderToTexture: function (key, flipY) + { + if (flipY === undefined) { flipY = false; } + + if (!this.renderToTexture) + { + var width = this.width; + var height = this.height; + var renderer = this.renderer; + + this.glTexture = renderer.createTextureFromSource(null, width, height, 0); + + this.glTexture.flipY = flipY; + + this.framebuffer = renderer.createFramebuffer(width, height, this.glTexture, false); + + this._rendererWidth = width; + this._rendererHeight = height; + + this.renderToTexture = true; + + this.projOrtho(0, this.width, this.height, 0); + + if (key) + { + this._savedKey = key; + + this.texture = this.scene.sys.textures.addGLTexture(key, this.glTexture, width, height); + } + } + + return this; + }, + /** * Sets the fragment and, optionally, the vertex shader source code that this Shader will use. * This will immediately delete the active shader program, if set, and then create a new one @@ -40272,7 +40880,7 @@ var Shader = new Class({ // The default uniforms available within the fragment shader var defaultUniforms = { - resolution: { type: '2f', value: { x: this.width, y: this.height }}, + resolution: { type: '2f', value: { x: this.width, y: this.height } }, time: { type: '1f', value: 0 }, mouse: { type: '2f', value: { x: this.width / 2, y: this.height / 2 } }, date: { type: '4fv', value: [ d.getFullYear(), d.getMonth(), d.getDate(), d.getHours() * 60 * 60 + d.getMinutes() * 60 + d.getSeconds() ] }, @@ -40282,10 +40890,10 @@ var Shader = new Class({ iChannel2: { type: 'sampler2D', value: null, textureData: { repeat: true } }, iChannel3: { type: 'sampler2D', value: null, textureData: { repeat: true } } }; - + if (this.shader.uniforms) { - this.uniforms = Merge(this.shader.uniforms, defaultUniforms); + this.uniforms = Extend(true, {}, this.shader.uniforms, defaultUniforms); } else { @@ -40302,7 +40910,7 @@ var Shader = new Class({ this.initUniforms(); - this.projOrtho(0, renderer.width, renderer.height, 0); + this.projOrtho(0, this._rendererWidth, this._rendererHeight, 0); return this; }, @@ -40402,12 +41010,66 @@ var Shader = new Class({ } }, + /** + * Sets a sampler2D uniform on this shader where the source texture is a WebGLTexture. + * + * This allows you to feed the output from one Shader into another: + * + * ```javascript + * let shader1 = this.add.shader(baseShader1, 0, 0, 512, 512).setRenderToTexture(); + * let shader2 = this.add.shader(baseShader2, 0, 0, 512, 512).setRenderToTexture('output'); + * + * shader1.setSampler2DBuffer('iChannel0', shader2.glTexture, 512, 512); + * shader2.setSampler2DBuffer('iChannel0', shader1.glTexture, 512, 512); + * ``` + * + * In the above code, the result of baseShader1 is fed into Shader2 as the `iChannel0` sampler2D uniform. + * The result of baseShader2 is then fed back into shader1 again, creating a feedback loop. + * + * If you wish to use an image from the Texture Manager as a sampler2D input for this shader, + * see the `Shader.setSampler2D` method. + * + * @method Phaser.GameObjects.Shader#setSampler2DBuffer + * @since 3.19.0 + * + * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`. + * @param {WebGLTexture} texture - A WebGLTexture reference. + * @param {integer} width - The width of the texture. + * @param {integer} height - The height of the texture. + * @param {integer} [textureIndex=0] - The texture index. + * @param {any} [textureData] - Additional texture data. + * + * @return {this} This Shader instance. + */ + setSampler2DBuffer: function (uniformKey, texture, width, height, textureIndex, textureData) + { + if (textureIndex === undefined) { textureIndex = 0; } + if (textureData === undefined) { textureData = {}; } + + var uniform = this.uniforms[uniformKey]; + + uniform.value = texture; + + textureData.width = width; + textureData.height = height; + + uniform.textureData = textureData; + + this._textureCount = textureIndex; + + this.initSampler2D(uniform); + + return this; + }, + /** * Sets a sampler2D uniform on this shader. * * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. * + * If you wish to use another Shader as a sampler2D input for this shader, see the `Shader.setSampler2DBuffer` method. + * * @method Phaser.GameObjects.Shader#setSampler2D * @since 3.17.0 * @@ -40428,11 +41090,23 @@ var Shader = new Class({ { var frame = textureManager.getFrame(textureKey); var uniform = this.uniforms[uniformKey]; + var source = frame.source; uniform.textureKey = textureKey; - uniform.source = frame.source.image; + uniform.source = source.image; uniform.value = frame.glTexture; + if (source.isGLTexture) + { + if (!textureData) + { + textureData = {}; + } + + textureData.width = source.width; + textureData.height = source.height; + } + if (textureData) { uniform.textureData = textureData; @@ -40674,6 +41348,11 @@ var Shader = new Class({ location = uniform.uniformLocation; value = uniform.value; + if (value === null) + { + continue; + } + if (length === 1) { if (uniform.glMatrix) @@ -40720,35 +41399,40 @@ var Shader = new Class({ * @method Phaser.GameObjects.Shader#load * @since 3.17.0 * - * @param {Phaser.GameObjects.Components.TransformMatrix} matrix2D - The transform matrix to use during rendering. + * @param {Phaser.GameObjects.Components.TransformMatrix} [matrix2D] - The transform matrix to use during rendering. */ load: function (matrix2D) { // ITRS + var gl = this.gl; var width = this.width; var height = this.height; var renderer = this.renderer; var program = this.program; - - var x = -this._displayOriginX; - var y = -this._displayOriginY; - var vm = this.viewMatrix; - vm[0] = matrix2D[0]; - vm[1] = matrix2D[1]; - vm[4] = matrix2D[2]; - vm[5] = matrix2D[3]; - vm[8] = matrix2D[4]; - vm[9] = matrix2D[5]; - vm[12] = vm[0] * x + vm[4] * y; - vm[13] = vm[1] * x + vm[5] * y; + if (!this.renderToTexture) + { + var x = -this._displayOriginX; + var y = -this._displayOriginY; + + vm[0] = matrix2D[0]; + vm[1] = matrix2D[1]; + vm[4] = matrix2D[2]; + vm[5] = matrix2D[3]; + vm[8] = matrix2D[4]; + vm[9] = matrix2D[5]; + vm[12] = vm[0] * x + vm[4] * y; + vm[13] = vm[1] * x + vm[5] * y; + } // Update vertex shader uniforms - this.renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); - this.renderer.setFloat2(program, 'uResolution', this.width, this.height); + gl.useProgram(program); + + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uViewMatrix'), false, vm); + gl.uniform2f(gl.getUniformLocation(program, 'uResolution'), this.width, this.height); // Update fragment shader uniforms @@ -40797,8 +41481,16 @@ var Shader = new Class({ var renderer = this.renderer; var vertexSize = Float32Array.BYTES_PER_ELEMENT * 2; - renderer.setProgram(program); - renderer.setVertexBuffer(vertexBuffer); + if (this.renderToTexture) + { + renderer.setFramebuffer(this.framebuffer); + + gl.clearColor(0, 0, 0, 0); + + gl.clear(gl.COLOR_BUFFER_BIT); + } + + gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); var location = gl.getAttribLocation(program, 'inPosition'); @@ -40827,6 +41519,11 @@ var Shader = new Class({ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); gl.drawArrays(gl.TRIANGLES, 0, vertexCount); + + if (this.renderToTexture) + { + renderer.setFramebuffer(null, false); + } }, /** @@ -40866,6 +41563,17 @@ var Shader = new Class({ gl.deleteProgram(this.program); gl.deleteBuffer(this.vertexBuffer); + + if (this.renderToTexture) + { + this.renderer.deleteFramebuffer(this.framebuffer); + + this.texture.destroy(); + + this.framebuffer = null; + this.glTexture = null; + this.texture = null; + } } }); @@ -40874,7 +41582,7 @@ module.exports = Shader; /***/ }), -/* 196 */ +/* 198 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40884,8 +41592,8 @@ module.exports = Shader; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var LineToCircle = __webpack_require__(197); +var Point = __webpack_require__(4); +var LineToCircle = __webpack_require__(199); /** * Checks for intersection between the line segment and circle, @@ -40966,7 +41674,7 @@ module.exports = GetLineToCircle; /***/ }), -/* 197 */ +/* 199 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40976,7 +41684,7 @@ module.exports = GetLineToCircle; */ var Contains = __webpack_require__(46); -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); var tmp = new Point(); @@ -41050,7 +41758,7 @@ module.exports = LineToCircle; /***/ }), -/* 198 */ +/* 200 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41060,9 +41768,9 @@ module.exports = LineToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var LineToLine = __webpack_require__(82); -var LineToRectangle = __webpack_require__(405); +var Point = __webpack_require__(4); +var LineToLine = __webpack_require__(84); +var LineToRectangle = __webpack_require__(408); /** * Checks for intersection between the Line and a Rectangle shape, @@ -41110,7 +41818,7 @@ module.exports = GetLineToRectangle; /***/ }), -/* 199 */ +/* 201 */ /***/ (function(module, exports) { /** @@ -41197,7 +41905,7 @@ module.exports = ContainsArray; /***/ }), -/* 200 */ +/* 202 */ /***/ (function(module, exports) { /** @@ -41245,7 +41953,7 @@ module.exports = RotateAroundXY; /***/ }), -/* 201 */ +/* 203 */ /***/ (function(module, exports) { /** @@ -41273,7 +41981,7 @@ module.exports = GetAspectRatio; /***/ }), -/* 202 */ +/* 204 */ /***/ (function(module, exports) { /** @@ -41327,7 +42035,7 @@ module.exports = RotateAroundXY; /***/ }), -/* 203 */ +/* 205 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41342,18 +42050,18 @@ module.exports = RotateAroundXY; module.exports = { - BUTTON_DOWN: __webpack_require__(1150), - BUTTON_UP: __webpack_require__(1151), - CONNECTED: __webpack_require__(1152), - DISCONNECTED: __webpack_require__(1153), - GAMEPAD_BUTTON_DOWN: __webpack_require__(1154), - GAMEPAD_BUTTON_UP: __webpack_require__(1155) + BUTTON_DOWN: __webpack_require__(1154), + BUTTON_UP: __webpack_require__(1155), + CONNECTED: __webpack_require__(1156), + DISCONNECTED: __webpack_require__(1157), + GAMEPAD_BUTTON_DOWN: __webpack_require__(1158), + GAMEPAD_BUTTON_UP: __webpack_require__(1159) }; /***/ }), -/* 204 */ +/* 206 */ /***/ (function(module, exports) { /** @@ -41394,7 +42102,7 @@ module.exports = GetURL; /***/ }), -/* 205 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41403,8 +42111,8 @@ module.exports = GetURL; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(17); -var XHRSettings = __webpack_require__(133); +var Extend = __webpack_require__(15); +var XHRSettings = __webpack_require__(134); /** * Takes two XHRSettings Objects and creates a new XHRSettings object from them. @@ -41442,7 +42150,7 @@ module.exports = MergeXHRSettings; /***/ }), -/* 206 */ +/* 208 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41452,12 +42160,12 @@ module.exports = MergeXHRSettings; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var ParseXML = __webpack_require__(336); +var ParseXML = __webpack_require__(339); /** * @classdesc @@ -41627,7 +42335,7 @@ module.exports = XMLFile; /***/ }), -/* 207 */ +/* 209 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41642,24 +42350,24 @@ module.exports = XMLFile; module.exports = { - Acceleration: __webpack_require__(1209), - Angular: __webpack_require__(1210), - Bounce: __webpack_require__(1211), - Debug: __webpack_require__(1212), - Drag: __webpack_require__(1213), - Enable: __webpack_require__(1214), - Friction: __webpack_require__(1215), - Gravity: __webpack_require__(1216), - Immovable: __webpack_require__(1217), - Mass: __webpack_require__(1218), - Size: __webpack_require__(1219), - Velocity: __webpack_require__(1220) + Acceleration: __webpack_require__(1213), + Angular: __webpack_require__(1214), + Bounce: __webpack_require__(1215), + Debug: __webpack_require__(1216), + Drag: __webpack_require__(1217), + Enable: __webpack_require__(1218), + Friction: __webpack_require__(1219), + Gravity: __webpack_require__(1220), + Immovable: __webpack_require__(1221), + Mass: __webpack_require__(1222), + Size: __webpack_require__(1223), + Velocity: __webpack_require__(1224) }; /***/ }), -/* 208 */ +/* 210 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41674,21 +42382,21 @@ module.exports = { module.exports = { - COLLIDE: __webpack_require__(1222), - OVERLAP: __webpack_require__(1223), - PAUSE: __webpack_require__(1224), - RESUME: __webpack_require__(1225), - TILE_COLLIDE: __webpack_require__(1226), - TILE_OVERLAP: __webpack_require__(1227), - WORLD_BOUNDS: __webpack_require__(1228), - WORLD_STEP: __webpack_require__(1229) + COLLIDE: __webpack_require__(1226), + OVERLAP: __webpack_require__(1227), + PAUSE: __webpack_require__(1228), + RESUME: __webpack_require__(1229), + TILE_COLLIDE: __webpack_require__(1230), + TILE_OVERLAP: __webpack_require__(1231), + WORLD_BOUNDS: __webpack_require__(1232), + WORLD_STEP: __webpack_require__(1233) }; /***/ }), -/* 209 */, -/* 210 */ +/* 211 */, +/* 212 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41697,7 +42405,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(137); +var GetTileAt = __webpack_require__(138); /** * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting @@ -41764,7 +42472,7 @@ module.exports = CalculateFacesAt; /***/ }), -/* 211 */ +/* 213 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41773,10 +42481,10 @@ module.exports = CalculateFacesAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tile = __webpack_require__(72); +var Tile = __webpack_require__(73); var IsInLayerBounds = __webpack_require__(101); -var CalculateFacesAt = __webpack_require__(210); -var SetTileCollision = __webpack_require__(71); +var CalculateFacesAt = __webpack_require__(212); +var SetTileCollision = __webpack_require__(72); /** * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index @@ -41844,7 +42552,7 @@ module.exports = PutTileAt; /***/ }), -/* 212 */ +/* 214 */ /***/ (function(module, exports) { /** @@ -41883,7 +42591,7 @@ module.exports = SetLayerCollisionIndex; /***/ }), -/* 213 */ +/* 215 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41892,10 +42600,10 @@ module.exports = SetLayerCollisionIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); +var Formats = __webpack_require__(30); var LayerData = __webpack_require__(102); var MapData = __webpack_require__(103); -var Tile = __webpack_require__(72); +var Tile = __webpack_require__(73); /** * Parses a 2D array of tile indexes into a new MapData object with a single layer. @@ -41975,7 +42683,7 @@ module.exports = Parse2DArray; /***/ }), -/* 214 */ +/* 216 */ /***/ (function(module, exports) { /** @@ -42065,7 +42773,7 @@ module.exports = ParseGID; /***/ }), -/* 215 */ +/* 217 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42074,8 +42782,8 @@ module.exports = ParseGID; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pick = __webpack_require__(461); -var ParseGID = __webpack_require__(214); +var Pick = __webpack_require__(464); +var ParseGID = __webpack_require__(216); var copyPoints = function (p) { return { x: p.x, y: p.y }; }; @@ -42147,7 +42855,7 @@ module.exports = ParseObject; /***/ }), -/* 216 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42156,10 +42864,10 @@ module.exports = ParseObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); +var Formats = __webpack_require__(30); var MapData = __webpack_require__(103); -var Parse = __webpack_require__(453); -var Tilemap = __webpack_require__(469); +var Parse = __webpack_require__(456); +var Tilemap = __webpack_require__(472); /** * Create a Tilemap from the given key or data. If neither is given, make a blank Tilemap. When @@ -42233,7 +42941,7 @@ module.exports = ParseToTilemap; /***/ }), -/* 217 */ +/* 219 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42242,7 +42950,7 @@ module.exports = ParseToTilemap; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** * Extracts an array of targets from a Tween configuration object. @@ -42282,7 +42990,7 @@ module.exports = GetTargets; /***/ }), -/* 218 */ +/* 220 */ /***/ (function(module, exports) { /** @@ -42291,6 +42999,14 @@ module.exports = GetTargets; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +/** + * @ignore + */ +function hasGetActive (def) +{ + return (!!def.getActive && typeof def.getActive === 'function'); +} + /** * @ignore */ @@ -42312,13 +43028,28 @@ function hasGetEnd (def) */ function hasGetters (def) { - return hasGetStart(def) || hasGetEnd(def); + return hasGetStart(def) || hasGetEnd(def) || hasGetActive(def); } /** - * Returns `getStart` and `getEnd` functions for a Tween's Data based on a target property and end value. + * Returns `getActive`, `getStart` and `getEnd` functions for a TweenData based on a target property and end value. + * + * `getActive` if not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * `getEnd` is invoked once any start delays have expired and returns what the value should tween to. + * `getStart` is invoked when the tween reaches the end and needs to either repeat or yoyo, it returns the value to go back to. * - * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. A string can be provided to specify a relative end value which consists of an operation (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current value, or `/=` to divide the current value) followed by its operand. A function can be provided to allow greater control over the end value; it will receive the target object being tweened, the name of the property being tweened, and the current value of the property as its arguments. If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` property is provided, the property will be used as the effective value under the same rules described here. + * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. + * A string can be provided to specify a relative end value which consists of an operation + * (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current + * value, or `/=` to divide the current value) followed by its operand. + * + * A function can be provided to allow greater control over the end value; it will receive the target + * object being tweened, the name of the property being tweened, and the current value of the property + * as its arguments. + * + * If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` + * callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` + * property is provided, the property will be used as the effective value under the same rules described here. * * @function Phaser.Tweens.Builders.GetValueOp * @since 3.0.0 @@ -42326,7 +43057,7 @@ function hasGetters (def) * @param {string} key - The name of the property to modify. * @param {*} propertyValue - The ending value of the property, as described above. * - * @return {function} An array of two functions, `getStart` and `getEnd`, which return the starting and the ending value of the property based on the provided value. + * @return {function} An array of functions, `getActive`, `getStart` and `getEnd`, which return the starting and the ending value of the property based on the provided value. */ var GetValueOp = function (key, propertyValue) { @@ -42338,6 +43069,9 @@ var GetValueOp = function (key, propertyValue) // The returned value sets what the property will be at the START of the Tween (usually called at the end of the Tween) var getStart = function (target, key, value) { return value; }; + // What to set the property to the moment the TweenData is invoked + var getActive = null; + var t = typeof(propertyValue); if (t === 'number') @@ -42406,54 +43140,112 @@ var GetValueOp = function (key, propertyValue) // The same as setting just the getEnd function and no getStart // props: { - // x: function (target, key, value) { return value + 50); }, + // x: function (target, key, value, targetIndex, totalTargets, tween) { return value + 50); }, // } getEnd = propertyValue; } - else if (t === 'object' && hasGetters(propertyValue)) + else if (t === 'object') { - /* - x: { - // Called at the start of the Tween. The returned value sets what the property will be at the END of the Tween. - getEnd: function (target, key, value) - { - return value; - }, + if (hasGetters(propertyValue)) + { + /* + x: { + // Called the moment Tween is active. The returned value sets the property on the target immediately. + getActive: function (target, key, value, targetIndex, totalTargets, tween) + { + return value; + }, - // Called at the end of the Tween. The returned value sets what the property will be at the START of the Tween. - getStart: function (target, key, value) + // Called at the start of the Tween. The returned value sets what the property will be at the END of the Tween. + getEnd: function (target, key, value, targetIndex, totalTargets, tween) + { + return value; + }, + + // Called at the end of the Tween. The returned value sets what the property will be at the START of the Tween. + getStart: function (target, key, value, targetIndex, totalTargets, tween) + { + return value; + } + } + */ + + if (hasGetActive(propertyValue)) { - return value; + getActive = propertyValue.getActive; + } + + if (hasGetEnd(propertyValue)) + { + getEnd = propertyValue.getEnd; + } + + if (hasGetStart(propertyValue)) + { + getStart = propertyValue.getStart; } } - */ - - if (hasGetEnd(propertyValue)) + else if (propertyValue.hasOwnProperty('value')) { - getEnd = propertyValue.getEnd; - } + // 'value' may still be a string, function or a number + // props: { + // x: { value: 400, ... }, + // y: { value: 300, ... } + // } - if (hasGetStart(propertyValue)) + callbacks = GetValueOp(key, propertyValue.value); + } + else { - getStart = propertyValue.getStart; - } - } - else if (propertyValue.hasOwnProperty('value')) - { - // Value may still be a string, function or a number - // props: { - // x: { value: 400, ... }, - // y: { value: 300, ... } - // } + // 'from' and 'to' may still be a string, function or a number + // props: { + // x: { from: 400, to: 600 }, + // y: { from: 300, to: 500 } + // } - callbacks = GetValueOp(key, propertyValue.value); + // Same as above, but the 'start' value is set immediately on the target + // props: { + // x: { start: 400, to: 600 }, + // y: { start: 300, to: 500 } + // } + + // 'start' value is set immediately, then it goes 'from' to 'to' during the tween + // props: { + // x: { start: 200, from: 400, to: 600 }, + // y: { start: 300, from: 300, to: 500 } + // } + + var hasTo = propertyValue.hasOwnProperty('to'); + var hasFrom = propertyValue.hasOwnProperty('from'); + var hasStart = propertyValue.hasOwnProperty('start'); + + if (hasTo && (hasFrom || hasStart)) + { + callbacks = GetValueOp(key, propertyValue.to); + + if (hasStart) + { + var startCallbacks = GetValueOp(key, propertyValue.start); + + callbacks.getActive = startCallbacks.getEnd; + } + + if (hasFrom) + { + var fromCallbacks = GetValueOp(key, propertyValue.from); + + callbacks.getStart = fromCallbacks.getEnd; + } + } + } } // If callback not set by the else if block above then set it here and return it if (!callbacks) { callbacks = { + getActive: getActive, getEnd: getEnd, getStart: getStart }; @@ -42466,7 +43258,7 @@ module.exports = GetValueOp; /***/ }), -/* 219 */ +/* 221 */ /***/ (function(module, exports) { /** @@ -42510,7 +43302,7 @@ module.exports = TWEEN_DEFAULTS; /***/ }), -/* 220 */ +/* 222 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42520,9 +43312,11 @@ module.exports = TWEEN_DEFAULTS; */ var Class = __webpack_require__(0); -var GameObjectCreator = __webpack_require__(15); -var GameObjectFactory = __webpack_require__(5); -var TWEEN_CONST = __webpack_require__(88); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(223); +var GameObjectCreator = __webpack_require__(16); +var GameObjectFactory = __webpack_require__(6); +var TWEEN_CONST = __webpack_require__(89); /** * @classdesc @@ -42532,6 +43326,7 @@ var TWEEN_CONST = __webpack_require__(88); * * @class Tween * @memberof Phaser.Tweens + * @extends Phaser.Events.EventEmitter * @constructor * @since 3.0.0 * @@ -42541,10 +43336,14 @@ var TWEEN_CONST = __webpack_require__(88); */ var Tween = new Class({ + Extends: EventEmitter, + initialize: function Tween (parent, data, targets) { + EventEmitter.call(this); + /** * A reference to the parent of this Tween. * Either the Tween Manager or a Tween Timeline instance. @@ -42652,6 +43451,40 @@ var Tween = new Class({ */ this.loopCounter = 0; + /** + * Time in ms/frames before the 'onStart' event fires. + * This is the shortest `delay` value across all of the TweenDatas of this Tween. + * + * @name Phaser.Tweens.Tween#startDelay + * @type {number} + * @default 0 + * @since 3.19.0 + */ + this.startDelay = 0; + + /** + * Has this Tween started playback yet? + * This boolean is toggled when the Tween leaves the 'delayed' state and starts running. + * + * @name Phaser.Tweens.Tween#hasStarted + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this.hasStarted = false; + + /** + * Is this Tween currently seeking? + * This boolean is toggled in the `Tween.seek` method. + * When a tween is seeking it will not dispatch any events or callbacks. + * + * @name Phaser.Tweens.Tween#isSeeking + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this.isSeeking = false; + /** * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = -1 (as it never completes) * @@ -42709,7 +43542,7 @@ var Tween = new Class({ * @private * @since 3.0.0 */ - this._pausedState = TWEEN_CONST.PENDING_ADD; + this._pausedState = TWEEN_CONST.INIT; /** * Does the Tween start off paused? (if so it needs to be started with Tween.play) @@ -42782,14 +43615,24 @@ var Tween = new Class({ this.totalProgress = 0; /** - * An object containing the various Tween callback references. + * An object containing the different Tween callback functions. + * + * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. + * + * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. + * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. + * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely. + * `onUpdate` When a TweenData updates a property on a source target during playback. + * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. * * @name Phaser.Tweens.Tween#callbacks * @type {object} - * @default 0 * @since 3.0.0 */ this.callbacks = { + onActive: null, onComplete: null, onLoop: null, onRepeat: null, @@ -42798,6 +43641,13 @@ var Tween = new Class({ onYoyo: null }; + /** + * The context in which all callbacks are invoked. + * + * @name Phaser.Tweens.Tween#callbackScope + * @type {any} + * @since 3.0.0 + */ this.callbackScope; }, @@ -42969,7 +43819,8 @@ var Tween = new Class({ */ calcDuration: function () { - var max = 0; + var maxDuration = 0; + var minDelay = Number.MAX_SAFE_INTEGER; var data = this.data; @@ -43000,10 +43851,15 @@ var Tween = new Class({ tweenData.totalDuration += (tweenData.t2 * tweenData.repeat); } - if (tweenData.totalDuration > max) + if (tweenData.totalDuration > maxDuration) { // Get the longest TweenData from the Tween, used to calculate the Tween TD - max = tweenData.totalDuration; + maxDuration = tweenData.totalDuration; + } + + if (tweenData.delay < minDelay) + { + minDelay = tweenData.delay; } } @@ -43011,7 +43867,7 @@ var Tween = new Class({ // If duration has been set to 0 then we give it a super-low value so that it always // renders at least 1 frame, but no more, without causing divided by zero errors elsewhere. - this.duration = Math.max(max, 0.001); + this.duration = Math.max(maxDuration, 0.001); this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; @@ -43023,6 +43879,9 @@ var Tween = new Class({ { this.totalDuration = this.duration + this.completeDelay; } + + // How long before this Tween starts playback? + this.startDelay = minDelay; }, /** @@ -43036,6 +43895,15 @@ var Tween = new Class({ */ init: function () { + // You can't have a paused Tween if it's part of a Timeline + if (this.paused && !this.parentIsTimeline) + { + this.state = TWEEN_CONST.PENDING_ADD; + this._pausedState = TWEEN_CONST.INIT; + + return false; + } + var data = this.data; var totalTargets = this.totalTargets; @@ -43044,12 +43912,17 @@ var Tween = new Class({ var tweenData = data[i]; var target = tweenData.target; var gen = tweenData.gen; + var key = tweenData.key; + var targetIndex = tweenData.index; - tweenData.delay = gen.delay(i, totalTargets, target); - tweenData.duration = Math.max(gen.duration(i, totalTargets, target), 0.001); - tweenData.hold = gen.hold(i, totalTargets, target); - tweenData.repeat = gen.repeat(i, totalTargets, target); - tweenData.repeatDelay = gen.repeatDelay(i, totalTargets, target); + // Old function signature: i, totalTargets, target + // New function signature: target, key, value, index, total, tween + + tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); + tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); + tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); } this.calcDuration(); @@ -43059,26 +43932,32 @@ var Tween = new Class({ this.elapsed = 0; this.totalElapsed = 0; - // You can't have a paused Tween if it's part of a Timeline - if (this.paused && !this.parentIsTimeline) - { - this.state = TWEEN_CONST.PENDING_ADD; - this._pausedState = TWEEN_CONST.INIT; + this.state = TWEEN_CONST.INIT; - return false; - } - else - { - this.state = TWEEN_CONST.INIT; + return true; + }, - return true; - } + /** + * Internal method that makes this Tween active within the TweenManager + * and emits the onActive event and callback. + * + * @method Phaser.Tweens.Tween#makeActive + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.19.0 + */ + makeActive: function () + { + this.parent.makeActive(this); + + this.dispatchTweenEvent(Events.TWEEN_ACTIVE, this.callbacks.onActive); }, /** * Internal method that advances to the next state of the Tween during playback. * * @method Phaser.Tweens.Tween#nextState + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP * @since 3.0.0 */ nextState: function () @@ -43089,15 +43968,6 @@ var Tween = new Class({ this.progress = 0; this.loopCounter--; - var onLoop = this.callbacks.onLoop; - - if (onLoop) - { - onLoop.params[1] = this.targets; - - onLoop.func.apply(onLoop.scope, onLoop.params); - } - this.resetTweenData(true); if (this.loopDelay > 0) @@ -43108,25 +43978,21 @@ var Tween = new Class({ else { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); } } else if (this.completeDelay > 0) { - this.countdown = this.completeDelay; this.state = TWEEN_CONST.COMPLETE_DELAY; + + this.countdown = this.completeDelay; } else { - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.params[1] = this.targets; - - onComplete.func.apply(onComplete.scope, onComplete.params); - } - this.state = TWEEN_CONST.PENDING_REMOVE; + + this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); } }, @@ -43176,11 +44042,21 @@ var Tween = new Class({ { if (resetFromTimeline === undefined) { resetFromTimeline = false; } - if (this.state === TWEEN_CONST.ACTIVE || (this.state === TWEEN_CONST.PENDING_ADD && this._pausedState === TWEEN_CONST.PENDING_ADD)) + var state = this.state; + + if (state === TWEEN_CONST.INIT && !this.parentIsTimeline) + { + this.resetTweenData(false); + + this.state = TWEEN_CONST.ACTIVE; + + return this; + } + else if (state === TWEEN_CONST.ACTIVE || (state === TWEEN_CONST.PENDING_ADD && this._pausedState === TWEEN_CONST.PENDING_ADD)) { return this; } - else if (!this.parentIsTimeline && (this.state === TWEEN_CONST.PENDING_REMOVE || this.state === TWEEN_CONST.REMOVED)) + else if (!this.parentIsTimeline && (state === TWEEN_CONST.PENDING_REMOVE || state === TWEEN_CONST.REMOVED)) { this.seek(0); this.parent.makeActive(this); @@ -43188,21 +44064,12 @@ var Tween = new Class({ return this; } - var onStart = this.callbacks.onStart; - if (this.parentIsTimeline) { this.resetTweenData(resetFromTimeline); if (this.calculatedOffset === 0) { - if (onStart) - { - onStart.params[1] = this.targets; - - onStart.func.apply(onStart.scope, onStart.params); - } - this.state = TWEEN_CONST.ACTIVE; } else @@ -43216,7 +44083,7 @@ var Tween = new Class({ { this.paused = false; - this.parent.makeActive(this); + this.makeActive(); } else { @@ -43224,14 +44091,7 @@ var Tween = new Class({ this.state = TWEEN_CONST.ACTIVE; - if (onStart) - { - onStart.params[1] = this.targets; - - onStart.func.apply(onStart.scope, onStart.params); - } - - this.parent.makeActive(this); + this.makeActive(); } return this; @@ -43248,11 +44108,17 @@ var Tween = new Class({ resetTweenData: function (resetFromLoop) { var data = this.data; + var total = this.totalData; + var totalTargets = this.totalTargets; - for (var i = 0; i < this.totalData; i++) + for (var i = 0; i < total; i++) { var tweenData = data[i]; + var target = tweenData.target; + var key = tweenData.key; + var targetIndex = tweenData.index; + tweenData.progress = 0; tweenData.elapsed = 0; @@ -43260,9 +44126,9 @@ var Tween = new Class({ if (resetFromLoop) { - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.start = tweenData.getStartValue(target, key, tweenData.start, targetIndex, totalTargets, this); - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.end); + tweenData.end = tweenData.getEndValue(target, key, tweenData.end, targetIndex, totalTargets, this); tweenData.current = tweenData.start; @@ -43276,8 +44142,14 @@ var Tween = new Class({ if (tweenData.delay > 0) { tweenData.elapsed = tweenData.delay; + tweenData.state = TWEEN_CONST.DELAY; } + + if (tweenData.getActiveValue) + { + target[key] = tweenData.getActiveValue(tweenData.target, tweenData.key, tweenData.start); + } } }, @@ -43306,73 +44178,110 @@ var Tween = new Class({ }, /** - * Attempts to seek to a specific position in a Tween. + * Seeks to a specific point in the Tween. + * + * **Note:** You cannot seek a Tween that repeats or loops forever, or that has an unusually long total duration. + * + * The given position is a value between 0 and 1 which represents how far through the Tween to seek to. + * A value of 0.5 would seek to half-way through the Tween, where-as a value of zero would seek to the start. + * + * Note that the seek takes the entire duration of the Tween into account, including delays, loops and repeats. + * For example, a Tween that lasts for 2 seconds, but that loops 3 times, would have a total duration of 6 seconds, + * so seeking to 0.5 would seek to 3 seconds into the Tween, as that's half-way through its _entire_ duration. + * + * Seeking works by resetting the Tween to its initial values and then iterating through the Tween at `delta` + * jumps per step. The longer the Tween, the longer this can take. * * @method Phaser.Tweens.Tween#seek * @since 3.0.0 * * @param {number} toPosition - A value between 0 and 1 which represents the progress point to seek to. + * @param {number} [delta=16.6] - The size of each step when seeking through the Tween. A higher value completes faster but at a cost of less precision. * * @return {this} This Tween instance. */ - seek: function (toPosition) + seek: function (toPosition, delta) { + if (delta === undefined) { delta = 16.6; } + + if (this.totalDuration >= 3600000) + { + console.warn('Tween.seek duration too long'); + + return this; + } + + if (this.state === TWEEN_CONST.REMOVED) + { + this.makeActive(); + } + + this.elapsed = 0; + this.progress = 0; + this.totalElapsed = 0; + this.totalProgress = 0; + var data = this.data; + var totalTargets = this.totalTargets; for (var i = 0; i < this.totalData; i++) { - // This won't work with loop > 0 yet - var ms = this.totalDuration * toPosition; - var tweenData = data[i]; - var progress = 0; - var elapsed = 0; + var target = tweenData.target; + var gen = tweenData.gen; + var key = tweenData.key; + var targetIndex = tweenData.index; - if (ms <= tweenData.delay) + tweenData.progress = 0; + tweenData.elapsed = 0; + + tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat; + + // Old function signature: i, totalTargets, target + // New function signature: target, key, value, index, total, tween + + tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); + tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); + tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); + + tweenData.current = tweenData.start; + tweenData.state = TWEEN_CONST.PLAYING_FORWARD; + + this.updateTweenData(this, tweenData, 0, targetIndex, totalTargets); + + if (tweenData.delay > 0) { - progress = 0; - elapsed = 0; + tweenData.elapsed = tweenData.delay; + tweenData.state = TWEEN_CONST.DELAY; } - else if (ms >= tweenData.totalDuration) - { - progress = 1; - elapsed = tweenData.duration; - } - else if (ms > tweenData.delay && ms <= tweenData.t1) - { - // Keep it zero bound - ms = Math.max(0, ms - tweenData.delay); + } - // Somewhere in the first playthru range - progress = ms / tweenData.t1; - elapsed = tweenData.duration * progress; - } - else if (ms > tweenData.t1 && ms < tweenData.totalDuration) - { - // Somewhere in repeat land - ms -= tweenData.delay; - ms -= tweenData.t1; + this.calcDuration(); - // var repeats = Math.floor(ms / tweenData.t2); + var wasPaused = false; - // remainder - ms = ((ms / tweenData.t2) % 1) * tweenData.t2; + if (this.state === TWEEN_CONST.PAUSED) + { + wasPaused = true; - if (ms > tweenData.repeatDelay) - { - progress = ms / tweenData.t1; - elapsed = tweenData.duration * progress; - } - } + this.state = TWEEN_CONST.ACTIVE; + } - tweenData.progress = progress; - tweenData.elapsed = elapsed; + this.isSeeking = true; - var v = tweenData.ease(tweenData.progress); + do + { + this.update(0, delta); - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + } while (this.totalProgress < toPosition); - tweenData.target[tweenData.key] = tweenData.current; + this.isSeeking = false; + + if (wasPaused) + { + this.state = TWEEN_CONST.PAUSED; } return this; @@ -43380,14 +44289,26 @@ var Tween = new Class({ /** * Sets an event based callback to be invoked during playback. + * + * Calling this method will replace a previously set callback for the given type, if any exists. + * + * The types available are: + * + * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. + * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. + * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely. + * `onUpdate` When a TweenData updates a property on a source target during playback. + * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. * * @method Phaser.Tweens.Tween#setCallback * @since 3.0.0 * - * @param {string} type - Type of the callback. - * @param {function} callback - Callback function. + * @param {string} type - Type of the callback to set. + * @param {function} callback - The function to invoke when this callback happens. * @param {array} [params] - An array of parameters for specified callbacks types. - * @param {object} [scope] - The context the callback will be invoked in. + * @param {any} [scope] - The context the callback will be invoked in. * * @return {this} This Tween instance. */ @@ -43407,6 +44328,7 @@ var Tween = new Class({ * If you don't need a delay, or have an onComplete callback, then call `Tween.stop` instead. * * @method Phaser.Tweens.Tween#complete + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE * @since 3.2.0 * * @param {number} [delay=0] - The time to wait before invoking the complete callback. If zero it will fire immediately. @@ -43419,21 +44341,15 @@ var Tween = new Class({ if (delay) { - this.countdown = delay; this.state = TWEEN_CONST.COMPLETE_DELAY; + + this.countdown = delay; } else { - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.params[1] = this.targets; - - onComplete.func.apply(onComplete.scope, onComplete.params); - } - this.state = TWEEN_CONST.PENDING_REMOVE; + + this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); } return this; @@ -43494,6 +44410,8 @@ var Tween = new Class({ } } + this.removeAllListeners(); + this.state = TWEEN_CONST.PENDING_REMOVE; } @@ -43504,6 +44422,9 @@ var Tween = new Class({ * Internal method that advances the Tween based on the time values. * * @method Phaser.Tweens.Tween#update + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP + * @fires Phaser.Tweens.Events#TWEEN_START * @since 3.0.0 * * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. @@ -43535,11 +44456,25 @@ var Tween = new Class({ { case TWEEN_CONST.ACTIVE: + if (!this.hasStarted && !this.isSeeking) + { + this.startDelay -= delta; + + if (this.startDelay <= 0) + { + this.hasStarted = true; + + this.dispatchTweenEvent(Events.TWEEN_START, this.callbacks.onStart); + } + } + var stillRunning = false; for (var i = 0; i < this.totalData; i++) { - if (this.updateTweenData(this, this.data[i], delta)) + var tweenData = this.data[i]; + + if (this.updateTweenData(this, tweenData, delta)) { stillRunning = true; } @@ -43560,6 +44495,8 @@ var Tween = new Class({ if (this.countdown <= 0) { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); } break; @@ -43570,15 +44507,6 @@ var Tween = new Class({ if (this.countdown <= 0) { - var onStart = this.callbacks.onStart; - - if (onStart) - { - onStart.params[1] = this.targets; - - onStart.func.apply(onStart.scope, onStart.params); - } - this.state = TWEEN_CONST.ACTIVE; } @@ -43590,14 +44518,9 @@ var Tween = new Class({ if (this.countdown <= 0) { - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.func.apply(onComplete.scope, onComplete.params); - } - this.state = TWEEN_CONST.PENDING_REMOVE; + + this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); } break; @@ -43606,10 +44529,61 @@ var Tween = new Class({ return (this.state === TWEEN_CONST.PENDING_REMOVE); }, + /** + * Internal method that will emit a TweenData based Event and invoke the given callback. + * + * @method Phaser.Tweens.Tween#dispatchTweenDataEvent + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData object that caused this event. + */ + dispatchTweenDataEvent: function (event, callback, tweenData) + { + if (!this.isSeeking) + { + this.emit(event, this, tweenData.key, tweenData.target); + + if (callback) + { + callback.params[1] = tweenData.target; + + callback.func.apply(callback.scope, callback.params); + } + } + }, + + /** + * Internal method that will emit a Tween based Event and invoke the given callback. + * + * @method Phaser.Tweens.Tween#dispatchTweenEvent + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchTweenEvent: function (event, callback) + { + if (!this.isSeeking) + { + this.emit(event, this, this.targets); + + if (callback) + { + callback.params[1] = this.targets; + + callback.func.apply(callback.scope, callback.params); + } + } + }, + /** * Internal method used as part of the playback process that sets a tween to play in reverse. * * @method Phaser.Tweens.Tween#setStateFromEnd + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to update. @@ -43633,25 +44607,14 @@ var Tween = new Class({ tweenData.target.toggleFlipX(); } - // Problem: The flip and callback and so on gets called for every TweenData that triggers it at the same time. - // If you're tweening several properties it can fire for all of them, at once. - if (tweenData.flipY) { tweenData.target.toggleFlipY(); } - var onYoyo = tween.callbacks.onYoyo; + this.dispatchTweenDataEvent(Events.TWEEN_YOYO, tween.callbacks.onYoyo, tweenData); - if (onYoyo) - { - // Element 1 is reserved for the target of the yoyo (and needs setting here) - onYoyo.params[1] = tweenData.target; - - onYoyo.func.apply(onYoyo.scope, onYoyo.params); - } - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); return TWEEN_CONST.PLAYING_BACKWARD; } @@ -43676,19 +44639,9 @@ var Tween = new Class({ tweenData.target.toggleFlipY(); } - var onRepeat = tween.callbacks.onRepeat; + tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - if (onRepeat) - { - // Element 1 is reserved for the target of the repeat (and needs setting here) - onRepeat.params[1] = tweenData.target; - - onRepeat.func.apply(onRepeat.scope, onRepeat.params); - } - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); // Delay? if (tweenData.repeatDelay > 0) @@ -43703,6 +44656,8 @@ var Tween = new Class({ } else { + this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); + return TWEEN_CONST.PLAYING_FORWARD; } } @@ -43714,6 +44669,7 @@ var Tween = new Class({ * Internal method used as part of the playback process that sets a tween to play from the start. * * @method Phaser.Tweens.Tween#setStateFromStart + * @fires Phaser.Tweens.Events#TWEEN_REPEAT * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to update. @@ -43742,17 +44698,7 @@ var Tween = new Class({ tweenData.target.toggleFlipY(); } - var onRepeat = tween.callbacks.onRepeat; - - if (onRepeat) - { - // Element 1 is reserved for the target of the repeat (and needs setting here) - onRepeat.params[1] = tweenData.target; - - onRepeat.func.apply(onRepeat.scope, onRepeat.params); - } - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); // Delay? if (tweenData.repeatDelay > 0) @@ -43767,6 +44713,8 @@ var Tween = new Class({ } else { + this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); + return TWEEN_CONST.PLAYING_FORWARD; } } @@ -43778,22 +44726,26 @@ var Tween = new Class({ * Internal method that advances the TweenData based on the time value given. * * @method Phaser.Tweens.Tween#updateTweenData + * @fires Phaser.Tweens.Events#TWEEN_UPDATE + * @fires Phaser.Tweens.Events#TWEEN_REPEAT * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to update. * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true + * @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true. * * @return {boolean} True if the tween is not complete (e.g., playing), or false if the tween is complete. */ updateTweenData: function (tween, tweenData, delta) { + var target = tweenData.target; + switch (tweenData.state) { case TWEEN_CONST.PLAYING_FORWARD: case TWEEN_CONST.PLAYING_BACKWARD: - if (!tweenData.target) + if (!target) { tweenData.state = TWEEN_CONST.COMPLETE; break; @@ -43814,37 +44766,16 @@ var Tween = new Class({ var forward = (tweenData.state === TWEEN_CONST.PLAYING_FORWARD); var progress = elapsed / duration; - var v; - - if (forward) - { - v = tweenData.ease(progress); - } - else - { - v = tweenData.ease(1 - progress); - } - - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); - - tweenData.target[tweenData.key] = tweenData.current; - tweenData.elapsed = elapsed; tweenData.progress = progress; - var onUpdate = tween.callbacks.onUpdate; - - if (onUpdate) - { - onUpdate.params[1] = tweenData.target; - - onUpdate.func.apply(onUpdate.scope, onUpdate.params); - } - if (progress === 1) { if (forward) { + tweenData.current = tweenData.end; + target[tweenData.key] = tweenData.end; + if (tweenData.hold > 0) { tweenData.elapsed = tweenData.hold - diff; @@ -43858,9 +44789,22 @@ var Tween = new Class({ } else { + tweenData.current = tweenData.start; + target[tweenData.key] = tweenData.start; + tweenData.state = this.setStateFromStart(tween, tweenData, diff); } } + else + { + var v = (forward) ? tweenData.ease(progress) : tweenData.ease(1 - progress); + + tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + + target[tweenData.key] = tweenData.current; + } + + this.dispatchTweenDataEvent(Events.TWEEN_UPDATE, tween.callbacks.onUpdate, tweenData); break; @@ -43886,6 +44830,8 @@ var Tween = new Class({ tweenData.elapsed = Math.abs(tweenData.elapsed); tweenData.state = TWEEN_CONST.PLAYING_FORWARD; + + this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); } break; @@ -43903,15 +44849,15 @@ var Tween = new Class({ case TWEEN_CONST.PENDING_RENDER: - if (tweenData.target) + if (target) { - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.target[tweenData.key]); + tweenData.start = tweenData.getStartValue(target, tweenData.key, target[tweenData.key], tweenData.index, tween.totalTargets, tween); - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.end = tweenData.getEndValue(target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); tweenData.current = tweenData.start; - tweenData.target[tweenData.key] = tweenData.start; + target[tweenData.key] = tweenData.start; tweenData.state = TWEEN_CONST.PLAYING_FORWARD; } @@ -43929,7 +44875,16 @@ var Tween = new Class({ }); +// onActive = 'active' event = When the Tween is moved from the pending to the active list in the manager, even if playback delayed +// onStart = 'start' event = When the Tween starts playing from a delayed state (will happen same time as onActive if no delay) +// onYoyo = 'yoyo' event = When the Tween starts a yoyo +// onRepeat = 'repeat' event = When a TweenData repeats playback (if any) +// onComplete = 'complete' event = When the Tween finishes all playback (can sometimes never happen if repeat -1), also when 'stop' called +// onUpdate = 'update' event = When the Tween updates a TweenData during playback (expensive!) +// onLoop = 'loop' event = Used to loop ALL TweenDatas in a Tween + Tween.TYPES = [ + 'onActive', 'onComplete', 'onLoop', 'onRepeat', @@ -43941,7 +44896,7 @@ Tween.TYPES = [ /** * Creates a new Tween object. * - * Note: This method will only be available Tweens have been built into Phaser. + * Note: This method will only be available if Tweens have been built into Phaser. * * @method Phaser.GameObjects.GameObjectFactory#tween * @since 3.0.0 @@ -43986,7 +44941,40 @@ module.exports = Tween; /***/ }), -/* 221 */ +/* 223 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tweens.Events + */ + +module.exports = { + + TIMELINE_COMPLETE: __webpack_require__(1306), + TIMELINE_LOOP: __webpack_require__(1307), + TIMELINE_PAUSE: __webpack_require__(1308), + TIMELINE_RESUME: __webpack_require__(1309), + TIMELINE_START: __webpack_require__(1310), + TIMELINE_UPDATE: __webpack_require__(1311), + TWEEN_ACTIVE: __webpack_require__(1312), + TWEEN_COMPLETE: __webpack_require__(1313), + TWEEN_LOOP: __webpack_require__(1314), + TWEEN_REPEAT: __webpack_require__(1315), + TWEEN_START: __webpack_require__(1316), + TWEEN_UPDATE: __webpack_require__(1317), + TWEEN_YOYO: __webpack_require__(1318) + +}; + + +/***/ }), +/* 224 */ /***/ (function(module, exports) { /** @@ -43996,17 +44984,21 @@ module.exports = Tween; */ /** - * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. + * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. + * A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. * - * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, Tweens should be created using the GameObjectFactory or GameObjectCreator. + * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, + * Tweens should be created using the GameObjectFactory or GameObjectCreator. * * @function Phaser.Tweens.TweenData * @since 3.0.0 * - * @param {object} target - The target to tween. + * @param {any} target - The target to tween. + * @param {integer} index - The target index within the Tween targets array. * @param {string} key - The property of the target to tween. * @param {function} getEnd - What the property will be at the END of the Tween. * @param {function} getStart - What the property will be at the START of the Tween. + * @param {?function} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * @param {function} ease - The ease function this tween uses. * @param {number} delay - Time in ms/frames before tween will start. * @param {number} duration - Duration of the tween in ms/frames. @@ -44019,16 +45011,22 @@ module.exports = Tween; * * @return {Phaser.Types.Tweens.TweenDataConfig} The config object describing this TweenData. */ -var TweenData = function (target, key, getEnd, getStart, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) +var TweenData = function (target, index, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) { return { // The target to tween target: target, + // The index of the target within the tween targets array + index: index, + // The property of the target to tween key: key, + // What to set the property to the moment the TweenData is invoked. + getActiveValue: getActive, + // The returned value sets what the property will be at the END of the Tween. getEndValue: getEnd, @@ -44102,7 +45100,7 @@ module.exports = TweenData; /***/ }), -/* 222 */ +/* 225 */ /***/ (function(module, exports) { var g; @@ -44128,7 +45126,7 @@ module.exports = g; /***/ }), -/* 223 */ +/* 226 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44137,7 +45135,7 @@ module.exports = g; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathWrap = __webpack_require__(56); +var MathWrap = __webpack_require__(57); /** * Wrap an angle. @@ -44160,7 +45158,7 @@ module.exports = Wrap; /***/ }), -/* 224 */ +/* 227 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44169,7 +45167,7 @@ module.exports = Wrap; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Wrap = __webpack_require__(56); +var Wrap = __webpack_require__(57); /** * Wrap an angle in degrees. @@ -44192,7 +45190,7 @@ module.exports = WrapDegrees; /***/ }), -/* 225 */ +/* 228 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44957,7 +45955,7 @@ module.exports = WebGLPipeline; /***/ }), -/* 226 */ +/* 229 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44968,14 +45966,14 @@ module.exports = WebGLPipeline; */ var Class = __webpack_require__(0); -var Earcut = __webpack_require__(63); +var Earcut = __webpack_require__(64); var GetFastValue = __webpack_require__(2); -var ModelViewProjection = __webpack_require__(487); -var ShaderSourceFS = __webpack_require__(735); -var ShaderSourceVS = __webpack_require__(736); +var ModelViewProjection = __webpack_require__(489); +var ShaderSourceFS = __webpack_require__(740); +var ShaderSourceVS = __webpack_require__(741); var TransformMatrix = __webpack_require__(32); var Utils = __webpack_require__(9); -var WebGLPipeline = __webpack_require__(225); +var WebGLPipeline = __webpack_require__(228); /** * @classdesc @@ -45495,9 +46493,13 @@ var TextureTintPipeline = new Class({ var frameY = frame.y; var frameWidth = frame.cutWidth; var frameHeight = frame.cutHeight; + var customPivot = frame.customPivot; - var x = -sprite.displayOriginX + frameX; - var y = -sprite.displayOriginY + frameY; + var displayOriginX = sprite.displayOriginX; + var displayOriginY = sprite.displayOriginY; + + var x = -displayOriginX + frameX; + var y = -displayOriginY + frameY; if (sprite.isCropped) { @@ -45519,26 +46521,35 @@ var TextureTintPipeline = new Class({ frameX = crop.x; frameY = crop.y; - x = -sprite.displayOriginX + frameX; - y = -sprite.displayOriginY + frameY; + x = -displayOriginX + frameX; + y = -displayOriginY + frameY; } + var flipX = 1; + var flipY = 1; + if (sprite.flipX) { - x += frameWidth; - frameWidth *= -1; + if (!customPivot) + { + x += (-frame.realWidth + (displayOriginX * 2)); + } + + flipX = -1; } - if (sprite.flipY) + // Auto-invert the flipY if this is coming from a GLTexture + if (sprite.flipY || (frame.source.isGLTexture && !texture.flipY)) { - y += frameHeight; - frameHeight *= -1; + if (!customPivot) + { + y += (-frame.realHeight + (displayOriginY * 2)); + } + + flipY = -1; } - var xw = x + frameWidth; - var yh = y + frameHeight; - - spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX, sprite.scaleY); + spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX * flipX, sprite.scaleY * flipY); camMatrix.copyFrom(camera.matrix); @@ -45563,6 +46574,9 @@ var TextureTintPipeline = new Class({ camMatrix.multiply(spriteMatrix, calcMatrix); } + var xw = x + frameWidth; + var yh = y + frameHeight; + var tx0 = calcMatrix.getX(x, y); var ty0 = calcMatrix.getY(x, y); @@ -46449,9 +47463,9 @@ module.exports = TextureTintPipeline; /***/ }), -/* 227 */, -/* 228 */, -/* 229 */ +/* 230 */, +/* 231 */, +/* 232 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46466,61 +47480,61 @@ module.exports = TextureTintPipeline; module.exports = { - Angle: __webpack_require__(499), - Call: __webpack_require__(500), - GetFirst: __webpack_require__(501), - GetLast: __webpack_require__(502), - GridAlign: __webpack_require__(503), - IncAlpha: __webpack_require__(537), - IncX: __webpack_require__(538), - IncXY: __webpack_require__(539), - IncY: __webpack_require__(540), - PlaceOnCircle: __webpack_require__(541), - PlaceOnEllipse: __webpack_require__(542), - PlaceOnLine: __webpack_require__(543), - PlaceOnRectangle: __webpack_require__(544), - PlaceOnTriangle: __webpack_require__(545), - PlayAnimation: __webpack_require__(546), + Angle: __webpack_require__(501), + Call: __webpack_require__(502), + GetFirst: __webpack_require__(503), + GetLast: __webpack_require__(504), + GridAlign: __webpack_require__(505), + IncAlpha: __webpack_require__(555), + IncX: __webpack_require__(556), + IncXY: __webpack_require__(557), + IncY: __webpack_require__(558), + PlaceOnCircle: __webpack_require__(559), + PlaceOnEllipse: __webpack_require__(560), + PlaceOnLine: __webpack_require__(561), + PlaceOnRectangle: __webpack_require__(562), + PlaceOnTriangle: __webpack_require__(563), + PlayAnimation: __webpack_require__(564), PropertyValueInc: __webpack_require__(34), PropertyValueSet: __webpack_require__(27), - RandomCircle: __webpack_require__(547), - RandomEllipse: __webpack_require__(548), - RandomLine: __webpack_require__(549), - RandomRectangle: __webpack_require__(550), - RandomTriangle: __webpack_require__(551), - Rotate: __webpack_require__(552), - RotateAround: __webpack_require__(553), - RotateAroundDistance: __webpack_require__(554), - ScaleX: __webpack_require__(555), - ScaleXY: __webpack_require__(556), - ScaleY: __webpack_require__(557), - SetAlpha: __webpack_require__(558), - SetBlendMode: __webpack_require__(559), - SetDepth: __webpack_require__(560), - SetHitArea: __webpack_require__(561), - SetOrigin: __webpack_require__(562), - SetRotation: __webpack_require__(563), - SetScale: __webpack_require__(564), - SetScaleX: __webpack_require__(565), - SetScaleY: __webpack_require__(566), - SetTint: __webpack_require__(567), - SetVisible: __webpack_require__(568), - SetX: __webpack_require__(569), - SetXY: __webpack_require__(570), - SetY: __webpack_require__(571), - ShiftPosition: __webpack_require__(572), - Shuffle: __webpack_require__(573), - SmootherStep: __webpack_require__(574), - SmoothStep: __webpack_require__(575), - Spread: __webpack_require__(576), - ToggleVisible: __webpack_require__(577), - WrapInRectangle: __webpack_require__(578) + RandomCircle: __webpack_require__(565), + RandomEllipse: __webpack_require__(566), + RandomLine: __webpack_require__(567), + RandomRectangle: __webpack_require__(568), + RandomTriangle: __webpack_require__(569), + Rotate: __webpack_require__(570), + RotateAround: __webpack_require__(571), + RotateAroundDistance: __webpack_require__(572), + ScaleX: __webpack_require__(573), + ScaleXY: __webpack_require__(574), + ScaleY: __webpack_require__(575), + SetAlpha: __webpack_require__(576), + SetBlendMode: __webpack_require__(577), + SetDepth: __webpack_require__(578), + SetHitArea: __webpack_require__(579), + SetOrigin: __webpack_require__(580), + SetRotation: __webpack_require__(581), + SetScale: __webpack_require__(582), + SetScaleX: __webpack_require__(583), + SetScaleY: __webpack_require__(584), + SetTint: __webpack_require__(585), + SetVisible: __webpack_require__(586), + SetX: __webpack_require__(587), + SetXY: __webpack_require__(588), + SetY: __webpack_require__(589), + ShiftPosition: __webpack_require__(590), + Shuffle: __webpack_require__(591), + SmootherStep: __webpack_require__(592), + SmoothStep: __webpack_require__(593), + Spread: __webpack_require__(594), + ToggleVisible: __webpack_require__(595), + WrapInRectangle: __webpack_require__(596) }; /***/ }), -/* 230 */ +/* 233 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46529,19 +47543,19 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ALIGN_CONST = __webpack_require__(143); +var ALIGN_CONST = __webpack_require__(144); var AlignInMap = []; -AlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(231); -AlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(232); -AlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(233); -AlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(234); -AlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(236); -AlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(237); -AlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(238); -AlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(239); -AlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(240); +AlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(234); +AlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(235); +AlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(236); +AlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(237); +AlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(239); +AlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(240); +AlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(241); +AlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(242); +AlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(243); /** * Takes given Game Object and aligns it so that it is positioned relative to the other. @@ -46569,7 +47583,7 @@ module.exports = QuickSet; /***/ }), -/* 231 */ +/* 234 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46579,9 +47593,9 @@ module.exports = QuickSet; */ var GetBottom = __webpack_require__(38); -var GetCenterX = __webpack_require__(73); +var GetCenterX = __webpack_require__(74); var SetBottom = __webpack_require__(39); -var SetCenterX = __webpack_require__(74); +var SetCenterX = __webpack_require__(75); /** * Takes given Game Object and aligns it so that it is positioned in the bottom center of the other. @@ -46613,7 +47627,7 @@ module.exports = BottomCenter; /***/ }), -/* 232 */ +/* 235 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46657,7 +47671,7 @@ module.exports = BottomLeft; /***/ }), -/* 233 */ +/* 236 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46701,7 +47715,7 @@ module.exports = BottomRight; /***/ }), -/* 234 */ +/* 237 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46710,9 +47724,9 @@ module.exports = BottomRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CenterOn = __webpack_require__(235); -var GetCenterX = __webpack_require__(73); -var GetCenterY = __webpack_require__(76); +var CenterOn = __webpack_require__(238); +var GetCenterX = __webpack_require__(74); +var GetCenterY = __webpack_require__(77); /** * Takes given Game Object and aligns it so that it is positioned in the center of the other. @@ -46743,7 +47757,7 @@ module.exports = Center; /***/ }), -/* 235 */ +/* 238 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46752,8 +47766,8 @@ module.exports = Center; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetCenterX = __webpack_require__(74); -var SetCenterY = __webpack_require__(75); +var SetCenterX = __webpack_require__(75); +var SetCenterY = __webpack_require__(76); /** * Positions the Game Object so that it is centered on the given coordinates. @@ -46780,7 +47794,7 @@ module.exports = CenterOn; /***/ }), -/* 236 */ +/* 239 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46789,9 +47803,9 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(76); +var GetCenterY = __webpack_require__(77); var GetLeft = __webpack_require__(40); -var SetCenterY = __webpack_require__(75); +var SetCenterY = __webpack_require__(76); var SetLeft = __webpack_require__(41); /** @@ -46824,7 +47838,7 @@ module.exports = LeftCenter; /***/ }), -/* 237 */ +/* 240 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46833,9 +47847,9 @@ module.exports = LeftCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(76); +var GetCenterY = __webpack_require__(77); var GetRight = __webpack_require__(42); -var SetCenterY = __webpack_require__(75); +var SetCenterY = __webpack_require__(76); var SetRight = __webpack_require__(43); /** @@ -46868,7 +47882,7 @@ module.exports = RightCenter; /***/ }), -/* 238 */ +/* 241 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46877,9 +47891,9 @@ module.exports = RightCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterX = __webpack_require__(73); +var GetCenterX = __webpack_require__(74); var GetTop = __webpack_require__(44); -var SetCenterX = __webpack_require__(74); +var SetCenterX = __webpack_require__(75); var SetTop = __webpack_require__(45); /** @@ -46912,7 +47926,7 @@ module.exports = TopCenter; /***/ }), -/* 239 */ +/* 242 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46956,7 +47970,7 @@ module.exports = TopLeft; /***/ }), -/* 240 */ +/* 243 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47000,7 +48014,7 @@ module.exports = TopRight; /***/ }), -/* 241 */ +/* 244 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47009,10 +48023,10 @@ module.exports = TopRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircumferencePoint = __webpack_require__(144); -var FromPercent = __webpack_require__(86); -var MATH_CONST = __webpack_require__(23); -var Point = __webpack_require__(3); +var CircumferencePoint = __webpack_require__(145); +var FromPercent = __webpack_require__(87); +var MATH_CONST = __webpack_require__(22); +var Point = __webpack_require__(4); /** * Returns a Point object containing the coordinates of a point on the circumference of the Circle @@ -47043,7 +48057,7 @@ module.exports = GetPoint; /***/ }), -/* 242 */ +/* 245 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47052,10 +48066,10 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circumference = __webpack_require__(243); -var CircumferencePoint = __webpack_require__(144); -var FromPercent = __webpack_require__(86); -var MATH_CONST = __webpack_require__(23); +var Circumference = __webpack_require__(246); +var CircumferencePoint = __webpack_require__(145); +var FromPercent = __webpack_require__(87); +var MATH_CONST = __webpack_require__(22); /** * Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle, @@ -47095,7 +48109,7 @@ module.exports = GetPoints; /***/ }), -/* 243 */ +/* 246 */ /***/ (function(module, exports) { /** @@ -47123,7 +48137,7 @@ module.exports = Circumference; /***/ }), -/* 244 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47132,7 +48146,7 @@ module.exports = Circumference; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); // bitmask flag for GameObject.renderMask var _FLAG = 2; // 0010 @@ -47418,7 +48432,7 @@ module.exports = Alpha; /***/ }), -/* 245 */ +/* 248 */ /***/ (function(module, exports) { /** @@ -47502,7 +48516,7 @@ module.exports = FindClosestInSorted; /***/ }), -/* 246 */ +/* 249 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47676,7 +48690,7 @@ module.exports = AnimationFrame; /***/ }), -/* 247 */ +/* 250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47685,7 +48699,7 @@ module.exports = AnimationFrame; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(52); +var BlendModes = __webpack_require__(53); /** * Provides methods used for setting the blend mode of a Game Object. @@ -47798,7 +48812,7 @@ module.exports = BlendMode; /***/ }), -/* 248 */ +/* 251 */ /***/ (function(module, exports) { /** @@ -47891,7 +48905,7 @@ module.exports = Depth; /***/ }), -/* 249 */ +/* 252 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47900,8 +48914,8 @@ module.exports = Depth; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoint = __webpack_require__(147); -var Perimeter = __webpack_require__(108); +var GetPoint = __webpack_require__(148); +var Perimeter = __webpack_require__(109); // Return an array of points from the perimeter of the rectangle // each spaced out based on the quantity or step required @@ -47945,7 +48959,7 @@ module.exports = GetPoints; /***/ }), -/* 250 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47954,7 +48968,7 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Get a point on a line that's a given percentage along its length. @@ -47984,7 +48998,7 @@ module.exports = GetPoint; /***/ }), -/* 251 */ +/* 254 */ /***/ (function(module, exports) { /** @@ -48024,7 +49038,7 @@ module.exports = RotateAround; /***/ }), -/* 252 */ +/* 255 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48033,8 +49047,8 @@ module.exports = RotateAround; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(253); -var GeometryMask = __webpack_require__(254); +var BitmapMask = __webpack_require__(256); +var GeometryMask = __webpack_require__(257); /** * Provides methods used for getting and setting the mask of a Game Object. @@ -48171,7 +49185,7 @@ module.exports = Mask; /***/ }), -/* 253 */ +/* 256 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48181,6 +49195,7 @@ module.exports = Mask; */ var Class = __webpack_require__(0); +var GameEvents = __webpack_require__(18); /** * @classdesc @@ -48335,7 +49350,7 @@ var BitmapMask = new Class({ this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - renderer.onContextRestored(function (renderer) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) { var width = renderer.width; var height = renderer.height; @@ -48463,7 +49478,7 @@ module.exports = BitmapMask; /***/ }), -/* 254 */ +/* 257 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48778,7 +49793,7 @@ module.exports = GeometryMask; /***/ }), -/* 255 */ +/* 258 */ /***/ (function(module, exports) { /** @@ -48885,7 +49900,7 @@ module.exports = ScrollFactor; /***/ }), -/* 256 */ +/* 259 */ /***/ (function(module, exports) { /** @@ -48947,7 +49962,7 @@ module.exports = ToJSON; /***/ }), -/* 257 */ +/* 260 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48956,10 +49971,10 @@ module.exports = ToJSON; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); +var MATH_CONST = __webpack_require__(22); var TransformMatrix = __webpack_require__(32); -var WrapAngle = __webpack_require__(223); -var WrapAngleDegrees = __webpack_require__(224); +var WrapAngle = __webpack_require__(226); +var WrapAngleDegrees = __webpack_require__(227); // global bitmask flag for GameObject.renderMask (used by Scale) var _FLAG = 4; // 0100 @@ -49147,8 +50162,9 @@ var Transform = { /** * The angle of this Game Object as expressed in degrees. - * - * Where 0 is to the right, 90 is down, 180 is left. + * + * 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. * @@ -49173,6 +50189,9 @@ var Transform = { /** * The angle of this Game Object in radians. + * + * 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 degrees, see the `angle` property instead. * @@ -49477,7 +50496,7 @@ module.exports = Transform; /***/ }), -/* 258 */ +/* 261 */ /***/ (function(module, exports) { /** @@ -49566,7 +50585,7 @@ module.exports = Visible; /***/ }), -/* 259 */ +/* 262 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -49581,16 +50600,16 @@ module.exports = Visible; module.exports = { - CHANGE_DATA: __webpack_require__(532), - CHANGE_DATA_KEY: __webpack_require__(533), - REMOVE_DATA: __webpack_require__(534), - SET_DATA: __webpack_require__(535) + CHANGE_DATA: __webpack_require__(550), + CHANGE_DATA_KEY: __webpack_require__(551), + REMOVE_DATA: __webpack_require__(552), + SET_DATA: __webpack_require__(553) }; /***/ }), -/* 260 */ +/* 263 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -49599,14 +50618,13 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Perimeter = __webpack_require__(108); -var Point = __webpack_require__(3); +var Perimeter = __webpack_require__(109); +var Point = __webpack_require__(4); -// Return an array of points from the perimeter of the rectangle -// each spaced out based on the quantity or step required /** - * [description] + * 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.MarchingAnts * @since 3.0.0 @@ -49710,7 +50728,7 @@ module.exports = MarchingAnts; /***/ }), -/* 261 */ +/* 264 */ /***/ (function(module, exports) { /** @@ -49750,7 +50768,7 @@ module.exports = RotateLeft; /***/ }), -/* 262 */ +/* 265 */ /***/ (function(module, exports) { /** @@ -49790,7 +50808,7 @@ module.exports = RotateRight; /***/ }), -/* 263 */ +/* 266 */ /***/ (function(module, exports) { /** @@ -49864,7 +50882,7 @@ module.exports = BresenhamPoints; /***/ }), -/* 264 */ +/* 267 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -49873,14 +50891,14 @@ module.exports = BresenhamPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Animation = __webpack_require__(146); +var Animation = __webpack_require__(147); var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(157); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(107); -var GameEvents = __webpack_require__(28); -var GetValue = __webpack_require__(6); -var Pad = __webpack_require__(158); +var CustomMap = __webpack_require__(158); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(108); +var GameEvents = __webpack_require__(18); +var GetValue = __webpack_require__(5); +var Pad = __webpack_require__(159); /** * @classdesc @@ -50311,6 +51329,10 @@ var AnimationManager = new Class({ { anim.load(child, startFrame); } + else + { + console.warn('Missing animation: ' + key); + } return child; }, @@ -50509,7 +51531,7 @@ module.exports = AnimationManager; /***/ }), -/* 265 */ +/* 268 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50519,9 +51541,9 @@ module.exports = AnimationManager; */ var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(157); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(266); +var CustomMap = __webpack_require__(158); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(269); /** * @classdesc @@ -50695,7 +51717,7 @@ module.exports = BaseCache; /***/ }), -/* 266 */ +/* 269 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50710,14 +51732,14 @@ module.exports = BaseCache; module.exports = { - ADD: __webpack_require__(595), - REMOVE: __webpack_require__(596) + ADD: __webpack_require__(599), + REMOVE: __webpack_require__(600) }; /***/ }), -/* 267 */ +/* 270 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50726,9 +51748,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCache = __webpack_require__(265); +var BaseCache = __webpack_require__(268); var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(28); +var GameEvents = __webpack_require__(18); /** * @classdesc @@ -50941,7 +51963,7 @@ module.exports = CacheManager; /***/ }), -/* 268 */ +/* 271 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50950,16 +51972,16 @@ module.exports = CacheManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(112); -var CanvasPool = __webpack_require__(24); -var CenterOn = __webpack_require__(162); -var Clamp = __webpack_require__(22); +var BaseCamera = __webpack_require__(113); +var CanvasPool = __webpack_require__(25); +var CenterOn = __webpack_require__(163); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Effects = __webpack_require__(276); -var Linear = __webpack_require__(114); -var Rectangle = __webpack_require__(10); -var Vector2 = __webpack_require__(4); +var Effects = __webpack_require__(279); +var Linear = __webpack_require__(115); +var Rectangle = __webpack_require__(11); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -50988,7 +52010,7 @@ var Vector2 = __webpack_require__(4); * @memberof Phaser.Cameras.Scene2D * @constructor * @since 3.0.0 - * + * * @extends Phaser.Cameras.Scene2D.BaseCamera * @extends Phaser.GameObjects.Components.Flip * @extends Phaser.GameObjects.Components.Tint @@ -51140,11 +52162,11 @@ var Camera = new Class({ /** * Is this Camera rendering directly to the canvas or to a texture? - * + * * Enable rendering to texture with the method `setRenderToTexture` (just enabling this boolean won't be enough) - * + * * Once enabled you can toggle it by switching this property. - * + * * To properly remove a render texture you should call the `clearRenderToTexture()` method. * * @name Phaser.Cameras.Scene2D.Camera#renderToTexture @@ -51157,9 +52179,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the HTML Canvas Element that the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only populated if Phaser is running with the Canvas Renderer. * * @name Phaser.Cameras.Scene2D.Camera#canvas @@ -51171,9 +52193,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the Rendering Context belonging to the Canvas element the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only populated if Phaser is running with the Canvas Renderer. * * @name Phaser.Cameras.Scene2D.Camera#context @@ -51185,9 +52207,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the GL Texture belonging the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only set if Phaser is running with the WebGL Renderer. * * @name Phaser.Cameras.Scene2D.Camera#glTexture @@ -51199,9 +52221,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the GL Frame Buffer belonging the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only set if Phaser is running with the WebGL Renderer. * * @name Phaser.Cameras.Scene2D.Camera#framebuffer @@ -51213,9 +52235,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture and to use a custom pipeline, * then this holds a reference to the pipeline the Camera is drawing with. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only set if Phaser is running with the WebGL Renderer. * * @name Phaser.Cameras.Scene2D.Camera#pipeline @@ -51227,32 +52249,32 @@ var Camera = new Class({ /** * Sets the Camera to render to a texture instead of to the main canvas. - * + * * The Camera will redirect all Game Objects it's asked to render to this texture. - * + * * During the render sequence, the texture itself will then be rendered to the main canvas. - * + * * Doing this gives you the ability to modify the texture before this happens, * allowing for special effects such as Camera specific shaders, or post-processing * on the texture. - * + * * If running under Canvas the Camera will render to its `canvas` property. - * + * * If running under WebGL the Camera will create a frame buffer, which is stored in its `framebuffer` and `glTexture` properties. - * + * * If you set a camera to render to a texture then it will emit 2 events during the render loop: - * + * * First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture. - * + * * Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the * Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before * it appears in-game. - * + * * You should not enable this unless you plan on actually using the texture it creates * somehow, otherwise you're just doubling the work required to render your game. - * + * * To temporarily disable rendering to a texture, toggle the `renderToTexture` boolean. - * + * * If you no longer require the Camera to render to a texture, call the `clearRenderToTexture` method, * which will delete the respective textures and free-up resources. * @@ -51290,9 +52312,9 @@ var Camera = new Class({ /** * Sets the WebGL pipeline this Camera is using when rendering to a texture. - * + * * You can pass either the string-based name of the pipeline, or a reference to the pipeline itself. - * + * * Call this method with no arguments to clear any previously set pipeline. * * @method Phaser.Cameras.Scene2D.Camera#setPipeline @@ -51324,7 +52346,7 @@ var Camera = new Class({ /** * If this Camera was set to render to a texture, this will clear the resources it was using and * redirect it to render back to the primary Canvas again. - * + * * If you only wish to temporarily disable rendering to a texture then you can toggle the * property `renderToTexture` instead. * @@ -51342,6 +52364,11 @@ var Camera = new Class({ var renderer = this.scene.sys.game.renderer; + if (!renderer) + { + return; + } + if (renderer.gl) { if (this.framebuffer) @@ -51561,7 +52588,7 @@ var Camera = new Class({ * @since 3.0.0 * * @param {integer} [duration=100] - The duration of the effect in milliseconds. - * @param {number} [intensity=0.05] - The intensity of the shake. + * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -51834,7 +52861,7 @@ var Camera = new Class({ this.scrollX = fx - originX; this.scrollY = fy - originY; - + if (this.useBounds) { this.scrollX = this.clampX(this.scrollX); @@ -51929,7 +52956,7 @@ module.exports = Camera; /***/ }), -/* 269 */ +/* 272 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51982,7 +53009,7 @@ module.exports = HexStringToColor; /***/ }), -/* 270 */ +/* 273 */ /***/ (function(module, exports) { /** @@ -52013,7 +53040,7 @@ module.exports = GetColor32; /***/ }), -/* 271 */ +/* 274 */ /***/ (function(module, exports) { /** @@ -52093,7 +53120,7 @@ module.exports = RGBToHSV; /***/ }), -/* 272 */ +/* 275 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52103,7 +53130,7 @@ module.exports = RGBToHSV; */ var Color = __webpack_require__(33); -var IntegerToRGB = __webpack_require__(273); +var IntegerToRGB = __webpack_require__(276); /** * Converts the given color value into an instance of a Color object. @@ -52126,7 +53153,7 @@ module.exports = IntegerToColor; /***/ }), -/* 273 */ +/* 276 */ /***/ (function(module, exports) { /** @@ -52174,7 +53201,7 @@ module.exports = IntegerToRGB; /***/ }), -/* 274 */ +/* 277 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52204,7 +53231,7 @@ module.exports = ObjectToColor; /***/ }), -/* 275 */ +/* 278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52250,7 +53277,7 @@ module.exports = RGBStringToColor; /***/ }), -/* 276 */ +/* 279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52265,80 +53292,11 @@ module.exports = RGBStringToColor; module.exports = { - Fade: __webpack_require__(617), - Flash: __webpack_require__(618), - Pan: __webpack_require__(619), - Shake: __webpack_require__(652), - Zoom: __webpack_require__(653) - -}; - - -/***/ }), -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Back - */ - -module.exports = { - - In: __webpack_require__(620), - Out: __webpack_require__(621), - InOut: __webpack_require__(622) - -}; - - -/***/ }), -/* 278 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Bounce - */ - -module.exports = { - - In: __webpack_require__(623), - Out: __webpack_require__(624), - InOut: __webpack_require__(625) - -}; - - -/***/ }), -/* 279 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Circular - */ - -module.exports = { - - In: __webpack_require__(626), - Out: __webpack_require__(627), - InOut: __webpack_require__(628) + Fade: __webpack_require__(621), + Flash: __webpack_require__(622), + Pan: __webpack_require__(623), + Shake: __webpack_require__(656), + Zoom: __webpack_require__(657) }; @@ -52354,14 +53312,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Cubic + * @namespace Phaser.Math.Easing.Back */ module.exports = { - In: __webpack_require__(629), - Out: __webpack_require__(630), - InOut: __webpack_require__(631) + In: __webpack_require__(624), + Out: __webpack_require__(625), + InOut: __webpack_require__(626) }; @@ -52377,14 +53335,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Elastic + * @namespace Phaser.Math.Easing.Bounce */ module.exports = { - In: __webpack_require__(632), - Out: __webpack_require__(633), - InOut: __webpack_require__(634) + In: __webpack_require__(627), + Out: __webpack_require__(628), + InOut: __webpack_require__(629) }; @@ -52400,14 +53358,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Expo + * @namespace Phaser.Math.Easing.Circular */ module.exports = { - In: __webpack_require__(635), - Out: __webpack_require__(636), - InOut: __webpack_require__(637) + In: __webpack_require__(630), + Out: __webpack_require__(631), + InOut: __webpack_require__(632) }; @@ -52423,10 +53381,16 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Linear + * @namespace Phaser.Math.Easing.Cubic */ -module.exports = __webpack_require__(638); +module.exports = { + + In: __webpack_require__(633), + Out: __webpack_require__(634), + InOut: __webpack_require__(635) + +}; /***/ }), @@ -52440,14 +53404,14 @@ module.exports = __webpack_require__(638); */ /** - * @namespace Phaser.Math.Easing.Quadratic + * @namespace Phaser.Math.Easing.Elastic */ module.exports = { - In: __webpack_require__(639), - Out: __webpack_require__(640), - InOut: __webpack_require__(641) + In: __webpack_require__(636), + Out: __webpack_require__(637), + InOut: __webpack_require__(638) }; @@ -52463,14 +53427,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Quartic + * @namespace Phaser.Math.Easing.Expo */ module.exports = { - In: __webpack_require__(642), - Out: __webpack_require__(643), - InOut: __webpack_require__(644) + In: __webpack_require__(639), + Out: __webpack_require__(640), + InOut: __webpack_require__(641) }; @@ -52486,16 +53450,10 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Quintic + * @namespace Phaser.Math.Easing.Linear */ -module.exports = { - - In: __webpack_require__(645), - Out: __webpack_require__(646), - InOut: __webpack_require__(647) - -}; +module.exports = __webpack_require__(642); /***/ }), @@ -52509,14 +53467,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Sine + * @namespace Phaser.Math.Easing.Quadratic */ module.exports = { - In: __webpack_require__(648), - Out: __webpack_require__(649), - InOut: __webpack_require__(650) + In: __webpack_require__(643), + Out: __webpack_require__(644), + InOut: __webpack_require__(645) }; @@ -52532,16 +53490,85 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Stepped + * @namespace Phaser.Math.Easing.Quartic */ -module.exports = __webpack_require__(651); +module.exports = { + + In: __webpack_require__(646), + Out: __webpack_require__(647), + InOut: __webpack_require__(648) + +}; /***/ }), /* 289 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(649), + Out: __webpack_require__(650), + InOut: __webpack_require__(651) + +}; + + +/***/ }), +/* 290 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(652), + Out: __webpack_require__(653), + InOut: __webpack_require__(654) + +}; + + +/***/ }), +/* 291 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(655); + + +/***/ }), +/* 292 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -52549,15 +53576,15 @@ module.exports = __webpack_require__(651); */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(26); -var Device = __webpack_require__(290); +var CONST = __webpack_require__(31); +var Device = __webpack_require__(293); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); var IsPlainObject = __webpack_require__(7); -var PhaserMath = __webpack_require__(165); +var PhaserMath = __webpack_require__(166); var NOOP = __webpack_require__(1); -var DefaultPlugins = __webpack_require__(171); -var ValueToColor = __webpack_require__(159); +var DefaultPlugins = __webpack_require__(172); +var ValueToColor = __webpack_require__(160); /** * @classdesc @@ -53105,7 +54132,7 @@ module.exports = Config; /***/ }), -/* 290 */ +/* 293 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53139,20 +54166,20 @@ module.exports = Config; module.exports = { - os: __webpack_require__(115), - browser: __webpack_require__(116), - features: __webpack_require__(164), - input: __webpack_require__(682), - audio: __webpack_require__(683), - video: __webpack_require__(684), - fullscreen: __webpack_require__(685), - canvasFeatures: __webpack_require__(291) + os: __webpack_require__(116), + browser: __webpack_require__(117), + features: __webpack_require__(165), + input: __webpack_require__(686), + audio: __webpack_require__(687), + video: __webpack_require__(688), + fullscreen: __webpack_require__(689), + canvasFeatures: __webpack_require__(294) }; /***/ }), -/* 291 */ +/* 294 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53161,7 +54188,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); +var CanvasPool = __webpack_require__(25); /** * Determines the canvas features of the browser running this Phaser Game instance. @@ -53266,7 +54293,7 @@ module.exports = init(); /***/ }), -/* 292 */ +/* 295 */ /***/ (function(module, exports) { /** @@ -53297,7 +54324,7 @@ module.exports = Between; /***/ }), -/* 293 */ +/* 296 */ /***/ (function(module, exports) { /** @@ -53334,7 +54361,7 @@ module.exports = Normalize; /***/ }), -/* 294 */ +/* 297 */ /***/ (function(module, exports) { /** @@ -53368,7 +54395,7 @@ module.exports = DistanceSquared; /***/ }), -/* 295 */ +/* 298 */ /***/ (function(module, exports) { /** @@ -53402,7 +54429,7 @@ module.exports = GreaterThan; /***/ }), -/* 296 */ +/* 299 */ /***/ (function(module, exports) { /** @@ -53436,7 +54463,7 @@ module.exports = LessThan; /***/ }), -/* 297 */ +/* 300 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53445,7 +54472,7 @@ module.exports = LessThan; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Factorial = __webpack_require__(298); +var Factorial = __webpack_require__(301); /** * [description] @@ -53467,7 +54494,7 @@ module.exports = Bernstein; /***/ }), -/* 298 */ +/* 301 */ /***/ (function(module, exports) { /** @@ -53507,7 +54534,7 @@ module.exports = Factorial; /***/ }), -/* 299 */ +/* 302 */ /***/ (function(module, exports) { /** @@ -53577,7 +54604,7 @@ module.exports = CubicBezierInterpolation; /***/ }), -/* 300 */ +/* 303 */ /***/ (function(module, exports) { /** @@ -53636,7 +54663,7 @@ module.exports = QuadraticBezierInterpolation; /***/ }), -/* 301 */ +/* 304 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53645,7 +54672,7 @@ module.exports = QuadraticBezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmoothStep = __webpack_require__(156); +var SmoothStep = __webpack_require__(157); /** * A Smooth Step interpolation method. @@ -53669,7 +54696,7 @@ module.exports = SmoothStepInterpolation; /***/ }), -/* 302 */ +/* 305 */ /***/ (function(module, exports) { /** @@ -53699,7 +54726,7 @@ module.exports = GetPowerOfTwo; /***/ }), -/* 303 */ +/* 306 */ /***/ (function(module, exports) { /** @@ -53743,7 +54770,7 @@ module.exports = SnapCeil; /***/ }), -/* 304 */ +/* 307 */ /***/ (function(module, exports) { /** @@ -53772,7 +54799,7 @@ module.exports = FloatBetween; /***/ }), -/* 305 */ +/* 308 */ /***/ (function(module, exports) { /** @@ -53807,7 +54834,7 @@ module.exports = Rotate; /***/ }), -/* 306 */ +/* 309 */ /***/ (function(module, exports) { /** @@ -53836,7 +54863,7 @@ module.exports = RoundAwayFromZero; /***/ }), -/* 307 */ +/* 310 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53845,7 +54872,7 @@ module.exports = RoundAwayFromZero; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector2 = __webpack_require__(4); +var Vector2 = __webpack_require__(3); /** * Takes the `x` and `y` coordinates and transforms them into the same space as @@ -53891,7 +54918,7 @@ module.exports = TransformXY; /***/ }), -/* 308 */ +/* 311 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -54436,7 +55463,7 @@ module.exports = Vector4; /***/ }), -/* 309 */ +/* 312 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -55029,7 +56056,7 @@ module.exports = Matrix3; /***/ }), -/* 310 */ +/* 313 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56491,7 +57518,7 @@ module.exports = Matrix4; /***/ }), -/* 311 */ +/* 314 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56504,8 +57531,8 @@ module.exports = Matrix4; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(0); -var Vector3 = __webpack_require__(170); -var Matrix3 = __webpack_require__(309); +var Vector3 = __webpack_require__(171); +var Matrix3 = __webpack_require__(312); var EPSILON = 0.000001; @@ -57263,7 +58290,7 @@ module.exports = Quaternion; /***/ }), -/* 312 */ +/* 315 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57272,10 +58299,10 @@ module.exports = Quaternion; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasInterpolation = __webpack_require__(313); -var CanvasPool = __webpack_require__(24); -var CONST = __webpack_require__(26); -var Features = __webpack_require__(164); +var CanvasInterpolation = __webpack_require__(316); +var CanvasPool = __webpack_require__(25); +var CONST = __webpack_require__(31); +var Features = __webpack_require__(165); /** * Called automatically by Phaser.Game and responsible for creating the renderer it will use. @@ -57365,8 +58392,8 @@ var CreateRenderer = function (game) if (true) { - CanvasRenderer = __webpack_require__(480); - WebGLRenderer = __webpack_require__(483); + CanvasRenderer = __webpack_require__(482); + WebGLRenderer = __webpack_require__(485); // Let the config pick the renderer type, as both are included if (config.renderType === CONST.WEBGL) @@ -57391,7 +58418,7 @@ module.exports = CreateRenderer; /***/ }), -/* 313 */ +/* 316 */ /***/ (function(module, exports) { /** @@ -57454,7 +58481,7 @@ module.exports = CanvasInterpolation; /***/ }), -/* 314 */ +/* 317 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57463,7 +58490,7 @@ module.exports = CanvasInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(26); +var CONST = __webpack_require__(31); /** * Called automatically by Phaser.Game and responsible for creating the console.log debug header. @@ -57584,7 +58611,7 @@ module.exports = DebugHeader; /***/ }), -/* 315 */ +/* 318 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57594,9 +58621,9 @@ module.exports = DebugHeader; */ var Class = __webpack_require__(0); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); var NOOP = __webpack_require__(1); -var RequestAnimationFrame = __webpack_require__(316); +var RequestAnimationFrame = __webpack_require__(319); // Frame Rate config // fps: { @@ -58291,7 +59318,7 @@ module.exports = TimeStep; /***/ }), -/* 316 */ +/* 319 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58491,7 +59518,7 @@ module.exports = RequestAnimationFrame; /***/ }), -/* 317 */ +/* 320 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58500,7 +59527,7 @@ module.exports = RequestAnimationFrame; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Events = __webpack_require__(28); +var Events = __webpack_require__(18); /** * The Visibility Handler is responsible for listening out for document level visibility change events. @@ -58582,7 +59609,7 @@ module.exports = VisibilityHandler; /***/ }), -/* 318 */ +/* 321 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58591,9 +59618,9 @@ module.exports = VisibilityHandler; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Arne16 = __webpack_require__(319); -var CanvasPool = __webpack_require__(24); -var GetValue = __webpack_require__(6); +var Arne16 = __webpack_require__(322); +var CanvasPool = __webpack_require__(25); +var GetValue = __webpack_require__(5); /** * [description] @@ -58676,7 +59703,7 @@ module.exports = GenerateTexture; /***/ }), -/* 319 */ +/* 322 */ /***/ (function(module, exports) { /** @@ -58714,7 +59741,7 @@ module.exports = { /***/ }), -/* 320 */ +/* 323 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58726,9 +59753,9 @@ module.exports = { // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var CubicBezier = __webpack_require__(299); -var Curve = __webpack_require__(79); -var Vector2 = __webpack_require__(4); +var CubicBezier = __webpack_require__(302); +var Curve = __webpack_require__(80); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -58941,7 +59968,7 @@ module.exports = CubicBezierCurve; /***/ }), -/* 321 */ +/* 324 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58953,11 +59980,11 @@ module.exports = CubicBezierCurve; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var Curve = __webpack_require__(79); +var Curve = __webpack_require__(80); var DegToRad = __webpack_require__(35); -var GetValue = __webpack_require__(6); -var RadToDeg = __webpack_require__(169); -var Vector2 = __webpack_require__(4); +var GetValue = __webpack_require__(5); +var RadToDeg = __webpack_require__(170); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -58977,7 +60004,7 @@ var Vector2 = __webpack_require__(4); * @param {number} [yRadius=0] - The vertical radius of ellipse. * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. - * @param {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). * @param {integer} [rotation=0] - The rotation of the ellipse, in degrees. */ var EllipseCurve = new Class({ @@ -59565,7 +60592,7 @@ module.exports = EllipseCurve; /***/ }), -/* 322 */ +/* 325 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -59577,10 +60604,10 @@ module.exports = EllipseCurve; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var Curve = __webpack_require__(79); -var FromPoints = __webpack_require__(172); -var Rectangle = __webpack_require__(10); -var Vector2 = __webpack_require__(4); +var Curve = __webpack_require__(80); +var FromPoints = __webpack_require__(173); +var Rectangle = __webpack_require__(11); +var Vector2 = __webpack_require__(3); var tmpVec2 = new Vector2(); @@ -59822,7 +60849,7 @@ module.exports = LineCurve; /***/ }), -/* 323 */ +/* 326 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -59832,9 +60859,9 @@ module.exports = LineCurve; */ var Class = __webpack_require__(0); -var Curve = __webpack_require__(79); -var QuadraticBezierInterpolation = __webpack_require__(300); -var Vector2 = __webpack_require__(4); +var Curve = __webpack_require__(80); +var QuadraticBezierInterpolation = __webpack_require__(303); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -60036,7 +61063,7 @@ module.exports = QuadraticBezier; /***/ }), -/* 324 */ +/* 327 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60047,10 +61074,10 @@ module.exports = QuadraticBezier; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) -var CatmullRom = __webpack_require__(167); +var CatmullRom = __webpack_require__(168); var Class = __webpack_require__(0); -var Curve = __webpack_require__(79); -var Vector2 = __webpack_require__(4); +var Curve = __webpack_require__(80); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -60261,7 +61288,7 @@ module.exports = SplineCurve; /***/ }), -/* 325 */ +/* 328 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60385,7 +61412,7 @@ module.exports = BaseShader; /***/ }), -/* 326 */ +/* 329 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60396,30 +61423,30 @@ module.exports = BaseShader; var Color = __webpack_require__(33); -Color.ColorToRGBA = __webpack_require__(770); -Color.ComponentToHex = __webpack_require__(327); -Color.GetColor = __webpack_require__(160); -Color.GetColor32 = __webpack_require__(270); -Color.HexStringToColor = __webpack_require__(269); -Color.HSLToColor = __webpack_require__(771); -Color.HSVColorWheel = __webpack_require__(772); -Color.HSVToRGB = __webpack_require__(161); -Color.HueToComponent = __webpack_require__(328); -Color.IntegerToColor = __webpack_require__(272); -Color.IntegerToRGB = __webpack_require__(273); -Color.Interpolate = __webpack_require__(773); -Color.ObjectToColor = __webpack_require__(274); -Color.RandomRGB = __webpack_require__(774); -Color.RGBStringToColor = __webpack_require__(275); -Color.RGBToHSV = __webpack_require__(271); -Color.RGBToString = __webpack_require__(775); -Color.ValueToColor = __webpack_require__(159); +Color.ColorToRGBA = __webpack_require__(775); +Color.ComponentToHex = __webpack_require__(330); +Color.GetColor = __webpack_require__(161); +Color.GetColor32 = __webpack_require__(273); +Color.HexStringToColor = __webpack_require__(272); +Color.HSLToColor = __webpack_require__(776); +Color.HSVColorWheel = __webpack_require__(777); +Color.HSVToRGB = __webpack_require__(162); +Color.HueToComponent = __webpack_require__(331); +Color.IntegerToColor = __webpack_require__(275); +Color.IntegerToRGB = __webpack_require__(276); +Color.Interpolate = __webpack_require__(778); +Color.ObjectToColor = __webpack_require__(277); +Color.RandomRGB = __webpack_require__(779); +Color.RGBStringToColor = __webpack_require__(278); +Color.RGBToHSV = __webpack_require__(274); +Color.RGBToString = __webpack_require__(780); +Color.ValueToColor = __webpack_require__(160); module.exports = Color; /***/ }), -/* 327 */ +/* 330 */ /***/ (function(module, exports) { /** @@ -60449,7 +61476,7 @@ module.exports = ComponentToHex; /***/ }), -/* 328 */ +/* 331 */ /***/ (function(module, exports) { /** @@ -60505,7 +61532,7 @@ module.exports = HueToComponent; /***/ }), -/* 329 */ +/* 332 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60514,7 +61541,7 @@ module.exports = HueToComponent; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(115); +var OS = __webpack_require__(116); /** * @callback ContentLoadedCallback @@ -60568,7 +61595,7 @@ module.exports = DOMContentLoaded; /***/ }), -/* 330 */ +/* 333 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60577,7 +61604,7 @@ module.exports = DOMContentLoaded; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(173); +var CONST = __webpack_require__(174); /** * Attempts to determine the screen orientation using the Orientation API. @@ -60634,7 +61661,7 @@ module.exports = GetScreenOrientation; /***/ }), -/* 331 */ +/* 334 */ /***/ (function(module, exports) { /** @@ -60720,7 +61747,7 @@ module.exports = { /***/ }), -/* 332 */ +/* 335 */ /***/ (function(module, exports) { /** @@ -60773,7 +61800,7 @@ module.exports = { /***/ }), -/* 333 */ +/* 336 */ /***/ (function(module, exports) { /** @@ -60871,7 +61898,7 @@ module.exports = { /***/ }), -/* 334 */ +/* 337 */ /***/ (function(module, exports) { /** @@ -60945,7 +61972,7 @@ module.exports = { /***/ }), -/* 335 */ +/* 338 */ /***/ (function(module, exports) { /** @@ -60996,7 +62023,7 @@ module.exports = GetTarget; /***/ }), -/* 336 */ +/* 339 */ /***/ (function(module, exports) { /** @@ -61053,7 +62080,7 @@ module.exports = ParseXML; /***/ }), -/* 337 */ +/* 340 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61063,16 +62090,16 @@ module.exports = ParseXML; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(175); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(53); -var GameEvents = __webpack_require__(28); -var Keyboard = __webpack_require__(338); -var Mouse = __webpack_require__(339); -var Pointer = __webpack_require__(340); -var Touch = __webpack_require__(341); +var CONST = __webpack_require__(176); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(54); +var GameEvents = __webpack_require__(18); +var Keyboard = __webpack_require__(341); +var Mouse = __webpack_require__(342); +var Pointer = __webpack_require__(343); +var Touch = __webpack_require__(344); var TransformMatrix = __webpack_require__(32); -var TransformXY = __webpack_require__(307); +var TransformXY = __webpack_require__(310); /** * @classdesc @@ -61516,7 +62543,7 @@ var InputManager = new Class({ */ resetCursor: function (interactiveObject) { - if (interactiveObject.cursor) + if (interactiveObject.cursor && this.canvas) { this.canvas.style.cursor = this.defaultCursor; } @@ -61829,6 +62856,25 @@ var InputManager = new Class({ this.updateInputPlugins(CONST.MOUSE_WHEEL, this.mousePointerContainer); }, + /** + * Processes a pointer lock change event, as passed in by the MouseManager. + * + * @method Phaser.Input.InputManager#onPointerLockChange + * @fires Phaser.Input.Events#POINTERLOCK_CHANGE + * @private + * @since 3.19.0 + * + * @param {MouseEvent} event - The native DOM Mouse event. + */ + onPointerLockChange: function (event) + { + var isLocked = this.mouse.locked; + + this.mousePointer.locked = isLocked; + + this.events.emit(Events.POINTERLOCK_CHANGE, event, isLocked); + }, + /** * Checks if the given Game Object should be considered as a candidate for input or not. * @@ -62116,7 +63162,7 @@ module.exports = InputManager; /***/ }), -/* 338 */ +/* 341 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62125,11 +63171,11 @@ module.exports = InputManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayRemove = __webpack_require__(120); +var ArrayRemove = __webpack_require__(121); var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(28); -var InputEvents = __webpack_require__(53); -var KeyCodes = __webpack_require__(121); +var GameEvents = __webpack_require__(18); +var InputEvents = __webpack_require__(54); +var KeyCodes = __webpack_require__(122); var NOOP = __webpack_require__(0); /** @@ -62566,7 +63612,7 @@ module.exports = KeyboardManager; /***/ }), -/* 339 */ +/* 342 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62576,8 +63622,8 @@ module.exports = KeyboardManager; */ var Class = __webpack_require__(0); -var Features = __webpack_require__(164); -var InputEvents = __webpack_require__(53); +var Features = __webpack_require__(165); +var InputEvents = __webpack_require__(54); var NOOP = __webpack_require__(0); // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent @@ -62984,8 +64030,8 @@ var MouseManager = new Class({ var element = _this.target; _this.locked = (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element) ? true : false; - - _this.manager.queue.push(event); + + _this.manager.onPointerLockChange(event); }; document.addEventListener('pointerlockchange', this.pointerLockChange, true); @@ -63048,7 +64094,7 @@ module.exports = MouseManager; /***/ }), -/* 340 */ +/* 343 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -63057,12 +64103,12 @@ module.exports = MouseManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Angle = __webpack_require__(292); +var Angle = __webpack_require__(295); var Class = __webpack_require__(0); -var Distance = __webpack_require__(57); -var FuzzyEqual = __webpack_require__(166); -var SmoothStepInterpolation = __webpack_require__(301); -var Vector2 = __webpack_require__(4); +var Distance = __webpack_require__(58); +var FuzzyEqual = __webpack_require__(167); +var SmoothStepInterpolation = __webpack_require__(304); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -63312,6 +64358,9 @@ var Pointer = new Class({ /** * The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. * * @name Phaser.Input.Pointer#worldX * @type {number} @@ -63322,6 +64371,9 @@ var Pointer = new Class({ /** * The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. * * @name Phaser.Input.Pointer#worldY * @type {number} @@ -63492,13 +64544,20 @@ var Pointer = new Class({ this.active = (id === 0) ? true : false; /** - * Time when this Pointer was most recently updated by a DOM Event. + * Is this pointer Pointer Locked? + * + * Only a mouse pointer can be locked and it only becomes locked when requested via + * the browsers Pointer Lock API. + * + * You can request this by calling the `this.input.mouse.requestPointerLock()` method from + * a `pointerdown` or `pointerup` event handler. * - * @name Phaser.Input.Pointer#time - * @type {number} - * @since 3.16.0 + * @name Phaser.Input.Pointer#locked + * @readonly + * @type {boolean} + * @since 3.19.0 */ - this.time = 0; + this.locked = false; /** * The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. @@ -63532,6 +64591,40 @@ var Pointer = new Class({ this.deltaZ = 0; }, + /** + * Takes a Camera and updates this Pointer's `worldX` and `worldY` values so they are + * the result of a translation through the given Camera. + * + * Note that the values will be automatically replaced the moment the Pointer is + * updated by an input event, such as a mouse move, so should be used immediately. + * + * @method Phaser.Input.Pointer#updateWorldPoint + * @since 3.19.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera which is being tested against. + * + * @return {this} This Pointer object. + */ + updateWorldPoint: function (camera) + { + var x = this.x; + var y = this.y; + + if (camera.resolution !== 1) + { + x += camera._x; + y += camera._y; + } + + // Stores the world point inside of tempPoint + var temp = camera.getWorldPoint(x, y); + + this.worldX = temp.x; + this.worldY = temp.y; + + return this; + }, + /** * Takes a Camera and returns a Vector2 containing the translated position of this Pointer * within that Camera. This can be used to convert this Pointers position into camera space. @@ -63696,11 +64789,11 @@ var Pointer = new Class({ // Sets the local x/y properties this.manager.transformPointer(this, event.pageX, event.pageY, true); - if (this.manager.mouse.locked) + if (this.locked) { // Multiple DOM events may occur within one frame, but only one Phaser event will fire - this.movementX += event.movementX || event.mozMovementX || event.webkitMovementX || 0; - this.movementY += event.movementY || event.mozMovementY || event.webkitMovementY || 0; + this.movementX = event.movementX || event.mozMovementX || event.webkitMovementX || 0; + this.movementY = event.movementY || event.mozMovementY || event.webkitMovementY || 0; } this.moveTime = event.timeStamp; @@ -63769,7 +64862,7 @@ var Pointer = new Class({ this.primaryDown = true; this.downX = this.x; this.downY = this.y; - this.downTime = touch.timeStamp; + this.downTime = event.timeStamp; this.isDown = true; @@ -63796,7 +64889,7 @@ var Pointer = new Class({ // Sets the local x/y properties this.manager.transformPointer(this, touch.pageX, touch.pageY, true); - this.moveTime = touch.timeStamp; + this.moveTime = event.timeStamp; this.wasTouch = true; @@ -63827,7 +64920,7 @@ var Pointer = new Class({ this.primaryDown = false; this.upX = this.x; this.upY = this.y; - this.upTime = touch.timeStamp; + this.upTime = event.timeStamp; this.isDown = false; @@ -63863,7 +64956,7 @@ var Pointer = new Class({ this.primaryDown = false; this.upX = this.x; this.upY = this.y; - this.upTime = touch.timeStamp; + this.upTime = event.timeStamp; this.isDown = false; @@ -64107,7 +65200,7 @@ var Pointer = new Class({ { if (this.isDown) { - return (this.time - this.downTime); + return (this.manager.time - this.downTime); } else { @@ -64252,6 +65345,25 @@ var Pointer = new Class({ this.position.y = value; } + }, + + /** + * Time when this Pointer was most recently updated by a DOM Event. + * This comes directly from the `event.timeStamp` property. + * If no event has yet taken place, it will return zero. + * + * @name Phaser.Input.Pointer#time + * @type {number} + * @readonly + * @since 3.16.0 + */ + time: { + + get: function () + { + return (this.event) ? this.event.timeStamp : 0; + } + } }); @@ -64260,7 +65372,7 @@ module.exports = Pointer; /***/ }), -/* 341 */ +/* 344 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64270,7 +65382,7 @@ module.exports = Pointer; */ var Class = __webpack_require__(0); -var InputEvents = __webpack_require__(53); +var InputEvents = __webpack_require__(54); var NOOP = __webpack_require__(1); // https://developer.mozilla.org/en-US/docs/Web/API/Touch_events @@ -64645,7 +65757,7 @@ module.exports = TouchManager; /***/ }), -/* 342 */ +/* 345 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64655,14 +65767,14 @@ module.exports = TouchManager; */ var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(28); -var EventEmitter = __webpack_require__(11); +var GameEvents = __webpack_require__(18); +var EventEmitter = __webpack_require__(10); var FileTypesManager = __webpack_require__(8); -var GameObjectCreator = __webpack_require__(15); -var GameObjectFactory = __webpack_require__(5); +var GameObjectCreator = __webpack_require__(16); +var GameObjectFactory = __webpack_require__(6); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(18); -var Remove = __webpack_require__(120); +var PluginCache = __webpack_require__(19); +var Remove = __webpack_require__(121); /** * @classdesc @@ -65434,6 +66546,35 @@ var PluginManager = new Class({ return this; }, + /** + * Removes a previously registered Game Object from the global Game Object Factory and / or Creator. + * This is usually called from within your Plugin destruction code to help clean-up after your plugin has been removed. + * + * @method Phaser.Plugins.PluginManager#removeGameObject + * @since 3.19.0 + * + * @param {string} key - The key of the Game Object to be removed from the factories. + * @param {boolean} [removeFromFactory=true] - Should the Game Object be removed from the Game Object Factory? + * @param {boolean} [removeFromCreator=true] - Should the Game Object be removed from the Game Object Creator? + */ + removeGameObject: function (key, removeFromFactory, removeFromCreator) + { + if (removeFromFactory === undefined) { removeFromFactory = true; } + if (removeFromCreator === undefined) { removeFromCreator = true; } + + if (removeFromFactory) + { + GameObjectFactory.remove(key); + } + + if (removeFromCreator) + { + GameObjectCreator.remove(key); + } + + return this; + }, + /** * Registers a new file type with the global File Types Manager, making it available to all Loader * Plugins created after this. @@ -65518,7 +66659,7 @@ module.exports = PluginManager; /***/ }), -/* 343 */ +/* 346 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -65527,19 +66668,19 @@ module.exports = PluginManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(173); +var CONST = __webpack_require__(174); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(89); -var GameEvents = __webpack_require__(28); -var GetInnerHeight = __webpack_require__(828); -var GetTarget = __webpack_require__(335); -var GetScreenOrientation = __webpack_require__(330); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(90); +var GameEvents = __webpack_require__(18); +var GetInnerHeight = __webpack_require__(833); +var GetTarget = __webpack_require__(338); +var GetScreenOrientation = __webpack_require__(333); var NOOP = __webpack_require__(1); -var Rectangle = __webpack_require__(10); -var Size = __webpack_require__(344); -var SnapFloor = __webpack_require__(90); -var Vector2 = __webpack_require__(4); +var Rectangle = __webpack_require__(11); +var Size = __webpack_require__(347); +var SnapFloor = __webpack_require__(91); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -65783,6 +66924,16 @@ var ScaleManager = new Class({ */ this.zoom = 1; + /** + * Internal flag set when the game zoom factor is modified. + * + * @name Phaser.Scale.ScaleManager#_resetZoom + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this._resetZoom = false; + /** * The scale factor between the baseSize and the canvasBounds. * @@ -66077,6 +67228,11 @@ var ScaleManager = new Class({ this.zoom = zoom; + if (zoom !== 1) + { + this._resetZoom = true; + } + // The modified game size, which is the w/h * resolution this.baseSize.setSize(width * resolution, height * resolution); @@ -66391,6 +67547,7 @@ var ScaleManager = new Class({ setZoom: function (value) { this.zoom = value; + this._resetZoom = true; return this.refresh(); }, @@ -66407,6 +67564,7 @@ var ScaleManager = new Class({ setMaxZoom: function () { this.zoom = this.getMaxZoom(); + this._resetZoom = true; return this.refresh(); }, @@ -66519,10 +67677,12 @@ var ScaleManager = new Class({ styleHeight = Math.floor(styleHeight); } - if (zoom > 1) + if (this._resetZoom) { style.width = styleWidth + 'px'; style.height = styleHeight + 'px'; + + this._resetZoom = false; } } else if (this.scaleMode === CONST.SCALE_MODE.RESIZE) @@ -66749,14 +67909,14 @@ var ScaleManager = new Class({ if (fullscreen.keyboard) { fsTarget[fullscreen.request](Element.ALLOW_KEYBOARD_INPUT) - .then(this.fullscreenSuccessHandler) - .catch(this.fullscreenErrorHandler); + .then(this.fullscreenSuccessHandler.bind(this)) + .catch(this.fullscreenErrorHandler.bind(this)); } else { fsTarget[fullscreen.request](fullscreenOptions) - .then(this.fullscreenSuccessHandler) - .catch(this.fullscreenErrorHandler); + .then(this.fullscreenSuccessHandler.bind(this)) + .catch(this.fullscreenErrorHandler.bind(this)); } } else @@ -67100,11 +68260,12 @@ var ScaleManager = new Class({ this.canvas = null; this.canvasBounds = null; this.parent = null; + this.fullscreenTarget = null; + this.parentSize.destroy(); this.gameSize.destroy(); this.baseSize.destroy(); this.displaySize.destroy(); - this.fullscreenTarget = null; }, /** @@ -67242,7 +68403,7 @@ module.exports = ScaleManager; /***/ }), -/* 344 */ +/* 347 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67251,10 +68412,10 @@ module.exports = ScaleManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var SnapFloor = __webpack_require__(90); -var Vector2 = __webpack_require__(4); +var SnapFloor = __webpack_require__(91); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -68022,7 +69183,7 @@ module.exports = Size; /***/ }), -/* 345 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -68032,14 +69193,14 @@ module.exports = Size; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(122); -var Events = __webpack_require__(19); -var GameEvents = __webpack_require__(28); -var GetValue = __webpack_require__(6); -var LoaderEvents = __webpack_require__(80); +var CONST = __webpack_require__(123); +var Events = __webpack_require__(20); +var GameEvents = __webpack_require__(18); +var GetValue = __webpack_require__(5); +var LoaderEvents = __webpack_require__(81); var NOOP = __webpack_require__(1); -var Scene = __webpack_require__(346); -var Systems = __webpack_require__(176); +var Scene = __webpack_require__(349); +var Systems = __webpack_require__(177); /** * @classdesc @@ -69656,7 +70817,7 @@ module.exports = SceneManager; /***/ }), -/* 346 */ +/* 349 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -69666,12 +70827,14 @@ module.exports = SceneManager; */ var Class = __webpack_require__(0); -var Systems = __webpack_require__(176); +var Systems = __webpack_require__(177); /** * @classdesc * A base Phaser.Scene class which can be extended for your own use. * + * You can also define the optional methods {@link Phaser.Types.Scenes.SceneInitCallback init()}, {@link Phaser.Types.Scenes.ScenePreloadCallback preload()}, and {@link Phaser.Types.Scenes.SceneCreateCallback create()}. + * * @class Scene * @memberof Phaser * @constructor @@ -69944,80 +71107,13 @@ var Scene = new Class({ { } - /** - * Can be defined on your own Scenes. - * This method is called by the Scene Manager when the scene starts, before `preload()` and `create()`. - * - * @method Phaser.Scene#init - * @since 3.0.0 - * - * @param {object} data - Any data passed via `ScenePlugin.add()` or `ScenePlugin.start()`. Same as Scene.settings.data. - */ - - /** - * Can be defined on your own Scenes. Use it to load assets. - * This method is called by the Scene Manager, after `init()` and before `create()`, only if the Scene has a LoaderPlugin. - * After this method completes, if the LoaderPlugin's queue isn't empty, the LoaderPlugin will start automatically. - * - * @method Phaser.Scene#preload - * @since 3.0.0 - */ - - /** - * Can be defined on your own Scenes. Use it to create your game objects. - * This method is called by the Scene Manager when the scene starts, after `init()` and `preload()`. - * If the LoaderPlugin started after `preload()`, then this method is called only after loading is complete. - * - * @method Phaser.Scene#create - * @since 3.0.0 - * - * @param {object} data - Any data passed via `ScenePlugin.add()` or `ScenePlugin.start()`. Same as Scene.settings.data. - */ - }); module.exports = Scene; /***/ }), -/* 347 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Capitalizes the first letter of a string if there is one. - * @example - * UppercaseFirst('abc'); - * // returns 'Abc' - * @example - * UppercaseFirst('the happy family'); - * // returns 'The happy family' - * @example - * UppercaseFirst(''); - * // returns '' - * - * @function Phaser.Utils.String.UppercaseFirst - * @since 3.0.0 - * - * @param {string} str - The string to capitalize. - * - * @return {string} A new string, same as the first, but with the first letter capitalized. - */ -var UppercaseFirst = function (str) -{ - return str && str[0].toUpperCase() + str.slice(1); -}; - -module.exports = UppercaseFirst; - - -/***/ }), -/* 348 */ +/* 350 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -70026,10 +71122,10 @@ module.exports = UppercaseFirst; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(122); -var GetValue = __webpack_require__(6); -var Merge = __webpack_require__(85); -var InjectionMap = __webpack_require__(841); +var CONST = __webpack_require__(123); +var GetValue = __webpack_require__(5); +var Merge = __webpack_require__(105); +var InjectionMap = __webpack_require__(846); /** * @namespace Phaser.Scenes.Settings @@ -70113,7 +71209,7 @@ module.exports = Settings; /***/ }), -/* 349 */ +/* 351 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -70122,18 +71218,18 @@ module.exports = Settings; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); -var CanvasTexture = __webpack_require__(842); +var CanvasPool = __webpack_require__(25); +var CanvasTexture = __webpack_require__(352); var Class = __webpack_require__(0); var Color = __webpack_require__(33); -var CONST = __webpack_require__(26); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(118); -var GameEvents = __webpack_require__(28); -var GenerateTexture = __webpack_require__(318); -var GetValue = __webpack_require__(6); -var Parser = __webpack_require__(351); -var Texture = __webpack_require__(177); +var CONST = __webpack_require__(31); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(119); +var GameEvents = __webpack_require__(18); +var GenerateTexture = __webpack_require__(321); +var GetValue = __webpack_require__(5); +var Parser = __webpack_require__(354); +var Texture = __webpack_require__(179); /** * @callback EachTextureCallback @@ -70407,6 +71503,10 @@ var TextureManager = new Class({ * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data. * * You can also provide the image type and encoder options. + * + * This will only work with bitmap based texture frames, such as those created from Texture Atlases. + * It will not work with GL Texture objects, such as Shaders, or Render Textures. For those please + * see the WebGL Snapshot function instead. * * @method Phaser.Textures.TextureManager#getBase64 * @since 3.12.0 @@ -70427,7 +71527,11 @@ var TextureManager = new Class({ var textureFrame = this.getFrame(key, frame); - if (textureFrame) + if (textureFrame && (textureFrame.source.isRenderTexture || textureFrame.source.isGLTexture)) + { + console.warn('Cannot getBase64 from WebGL Texture'); + } + else if (textureFrame) { var cd = textureFrame.canvasData; @@ -70488,6 +71592,38 @@ var TextureManager = new Class({ return texture; }, + /** + * Takes a WebGL Texture and creates a Phaser Texture from it, which is added to the Texture Manager using the given key. + * + * This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites. + * + * This is a WebGL only feature. + * + * @method Phaser.Textures.TextureManager#addGLTexture + * @fires Phaser.Textures.Events#ADD + * @since 3.19.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {WebGLTexture} glTexture - The source Render Texture. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addGLTexture: function (key, glTexture, width, height) + { + var texture = null; + + if (this.checkKey(key)) + { + texture = this.create(key, glTexture, width, height); + + texture.add('__BASE', 0, 0, 0, width, height); + + this.emit(Events.ADD, key, texture); + } + + return texture; + }, + /** * Adds a Render Texture to the Texture Manager using the given key. * This allows you to then use the Render Texture as a normal texture for texture based Game Objects like Sprites. @@ -71235,7 +72371,7 @@ module.exports = TextureManager; /***/ }), -/* 350 */ +/* 352 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71244,9 +72380,640 @@ module.exports = TextureManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); var Class = __webpack_require__(0); -var IsSizePowerOfTwo = __webpack_require__(117); +var Clamp = __webpack_require__(24); +var Color = __webpack_require__(33); +var CONST = __webpack_require__(31); +var IsSizePowerOfTwo = __webpack_require__(118); +var Texture = __webpack_require__(179); + +/** + * @classdesc + * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source. + * + * You can use the properties of this texture to draw to the canvas element directly, using all of the standard + * canvas operations available in the browser. Any Game Object can be given this texture and will render with it. + * + * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to + * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this + * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep + * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading + * texture data to it. This restriction does not apply if using the Canvas Renderer. + * + * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify + * sections of the canvas using the `add` method. + * + * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying + * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause + * graphical errors. + * + * @class CanvasTexture + * @extends Phaser.Textures.Texture + * @memberof Phaser.Textures + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to. + * @param {string} key - The unique string-based key of this Texture. + * @param {HTMLCanvasElement} source - The canvas element that is used as the base of this texture. + * @param {integer} width - The width of the canvas. + * @param {integer} height - The height of the canvas. + */ +var CanvasTexture = new Class({ + + Extends: Texture, + + initialize: + + function CanvasTexture (manager, key, source, width, height) + { + Texture.call(this, manager, key, source, width, height); + + this.add('__BASE', 0, 0, 0, width, height); + + /** + * A reference to the Texture Source of this Canvas. + * + * @name Phaser.Textures.CanvasTexture#_source + * @type {Phaser.Textures.TextureSource} + * @private + * @since 3.7.0 + */ + this._source = this.frames['__BASE'].source; + + /** + * The source Canvas Element. + * + * @name Phaser.Textures.CanvasTexture#canvas + * @readonly + * @type {HTMLCanvasElement} + * @since 3.7.0 + */ + this.canvas = this._source.image; + + /** + * The 2D Canvas Rendering Context. + * + * @name Phaser.Textures.CanvasTexture#context + * @readonly + * @type {CanvasRenderingContext2D} + * @since 3.7.0 + */ + this.context = this.canvas.getContext('2d'); + + /** + * The width of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + * + * @name Phaser.Textures.CanvasTexture#width + * @readonly + * @type {integer} + * @since 3.7.0 + */ + this.width = width; + + /** + * The height of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + * + * @name Phaser.Textures.CanvasTexture#height + * @readonly + * @type {integer} + * @since 3.7.0 + */ + this.height = height; + + /** + * The context image data. + * Use the `update` method to populate this when the canvas changes. + * + * @name Phaser.Textures.CanvasTexture#imageData + * @type {ImageData} + * @since 3.13.0 + */ + this.imageData = this.context.getImageData(0, 0, width, height); + + /** + * A Uint8ClampedArray view into the `buffer`. + * Use the `update` method to populate this when the canvas changes. + * Note that this is unavailable in some browsers, such as Epic Browser, due to their security restrictions. + * + * @name Phaser.Textures.CanvasTexture#data + * @type {Uint8ClampedArray} + * @since 3.13.0 + */ + this.data = null; + + if (this.imageData) + { + this.data = this.imageData.data; + } + + /** + * An Uint32Array view into the `buffer`. + * + * @name Phaser.Textures.CanvasTexture#pixels + * @type {Uint32Array} + * @since 3.13.0 + */ + this.pixels = null; + + /** + * An ArrayBuffer the same size as the context ImageData. + * + * @name Phaser.Textures.CanvasTexture#buffer + * @type {ArrayBuffer} + * @since 3.13.0 + */ + this.buffer; + + if (this.data) + { + if (this.imageData.data.buffer) + { + this.buffer = this.imageData.data.buffer; + this.pixels = new Uint32Array(this.buffer); + } + else if (window.ArrayBuffer) + { + this.buffer = new ArrayBuffer(this.imageData.data.length); + this.pixels = new Uint32Array(this.buffer); + } + else + { + this.pixels = this.imageData.data; + } + } + }, + + /** + * This re-creates the `imageData` from the current context. + * It then re-builds the ArrayBuffer, the `data` Uint8ClampedArray reference and the `pixels` Int32Array. + * + * Warning: This is a very expensive operation, so use it sparingly. + * + * @method Phaser.Textures.CanvasTexture#update + * @since 3.13.0 + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + update: function () + { + this.imageData = this.context.getImageData(0, 0, this.width, this.height); + + this.data = this.imageData.data; + + if (this.imageData.data.buffer) + { + this.buffer = this.imageData.data.buffer; + this.pixels = new Uint32Array(this.buffer); + } + else if (window.ArrayBuffer) + { + this.buffer = new ArrayBuffer(this.imageData.data.length); + this.pixels = new Uint32Array(this.buffer); + } + else + { + this.pixels = this.imageData.data; + } + + if (this.manager.game.config.renderType === CONST.WEBGL) + { + this.refresh(); + } + + return this; + }, + + /** + * Draws the given Image or Canvas element to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * + * @method Phaser.Textures.CanvasTexture#draw + * @since 3.13.0 + * + * @param {integer} x - The x coordinate to draw the source at. + * @param {integer} y - The y coordinate to draw the source at. + * @param {(HTMLImageElement|HTMLCanvasElement)} source - The element to draw to this canvas. + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + draw: function (x, y, source) + { + this.context.drawImage(source, x, y); + + return this.update(); + }, + + /** + * Draws the given texture frame to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * + * @method Phaser.Textures.CanvasTexture#drawFrame + * @since 3.16.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {integer} [x=0] - The x coordinate to draw the source at. + * @param {integer} [y=0] - The y coordinate to draw the source at. + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + drawFrame: function (key, frame, x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + var textureFrame = this.manager.getFrame(key, frame); + + if (textureFrame) + { + var cd = textureFrame.canvasData; + + var width = textureFrame.cutWidth; + var height = textureFrame.cutHeight; + var res = textureFrame.source.resolution; + + this.context.drawImage( + textureFrame.source.image, + cd.x, cd.y, + width, + height, + x, y, + width / res, + height / res + ); + + return this.update(); + } + else + { + return this; + } + }, + + /** + * Sets a pixel in the CanvasTexture to the given color and alpha values. + * + * This is an expensive operation to run in large quantities, so use sparingly. + * + * @method Phaser.Textures.CanvasTexture#setPixel + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} red - The red color value. A number between 0 and 255. + * @param {integer} green - The green color value. A number between 0 and 255. + * @param {integer} blue - The blue color value. A number between 0 and 255. + * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + * + * @return {this} This CanvasTexture. + */ + setPixel: function (x, y, red, green, blue, alpha) + { + if (alpha === undefined) { alpha = 255; } + + x = Math.abs(Math.floor(x)); + y = Math.abs(Math.floor(y)); + + var index = this.getIndex(x, y); + + if (index > -1) + { + var imageData = this.context.getImageData(x, y, 1, 1); + + imageData.data[0] = red; + imageData.data[1] = green; + imageData.data[2] = blue; + imageData.data[3] = alpha; + + this.context.putImageData(imageData, x, y); + } + + return this; + }, + + /** + * Puts the ImageData into the context of this CanvasTexture at the given coordinates. + * + * @method Phaser.Textures.CanvasTexture#putData + * @since 3.16.0 + * + * @param {ImageData} imageData - The ImageData to put at the given location. + * @param {integer} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {integer} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {integer} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. + * @param {integer} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. + * + * @return {this} This CanvasTexture. + */ + putData: function (imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight) + { + if (dirtyX === undefined) { dirtyX = 0; } + if (dirtyY === undefined) { dirtyY = 0; } + if (dirtyWidth === undefined) { dirtyWidth = imageData.width; } + if (dirtyHeight === undefined) { dirtyHeight = imageData.height; } + + this.context.putImageData(imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight); + + return this; + }, + + /** + * Gets an ImageData region from this CanvasTexture from the position and size specified. + * You can write this back using `CanvasTexture.putData`, or manipulate it. + * + * @method Phaser.Textures.CanvasTexture#getData + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. + * @param {integer} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. + * + * @return {ImageData} The ImageData extracted from this CanvasTexture. + */ + getData: function (x, y, width, height) + { + x = Clamp(Math.floor(x), 0, this.width - 1); + y = Clamp(Math.floor(y), 0, this.height - 1); + width = Clamp(width, 1, this.width - x); + height = Clamp(height, 1, this.height - y); + + var imageData = this.context.getImageData(x, y, width, height); + + return imageData; + }, + + /** + * Get the color of a specific pixel from this texture and store it in a Color object. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * + * @method Phaser.Textures.CanvasTexture#getPixel + * @since 3.13.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {Phaser.Display.Color} [out] - A Color object to store the pixel values in. If not provided a new Color object will be created. + * + * @return {Phaser.Display.Color} An object with the red, green, blue and alpha values set in the r, g, b and a properties. + */ + getPixel: function (x, y, out) + { + if (!out) + { + out = new Color(); + } + + var index = this.getIndex(x, y); + + if (index > -1) + { + var data = this.data; + + var r = data[index + 0]; + var g = data[index + 1]; + var b = data[index + 2]; + var a = data[index + 3]; + + out.setTo(r, g, b, a); + } + + return out; + }, + + /** + * Returns an array containing all of the pixels in the given region. + * + * If the requested region extends outside the bounds of this CanvasTexture, + * the region is truncated to fit. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * + * @method Phaser.Textures.CanvasTexture#getPixels + * @since 3.16.0 + * + * @param {integer} [x=0] - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [y=0] - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [width] - The width of the region to get. Must be an integer. Defaults to the canvas width if not given. + * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. + * + * @return {Phaser.Types.Textures.PixelConfig[]} An array of Pixel objects. + */ + getPixels: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.width; } + if (height === undefined) { height = width; } + + x = Math.abs(Math.round(x)); + y = Math.abs(Math.round(y)); + + var left = Clamp(x, 0, this.width); + var right = Clamp(x + width, 0, this.width); + var top = Clamp(y, 0, this.height); + var bottom = Clamp(y + height, 0, this.height); + + var pixel = new Color(); + + var out = []; + + for (var py = top; py < bottom; py++) + { + var row = []; + + for (var px = left; px < right; px++) + { + pixel = this.getPixel(px, py, pixel); + + row.push({ x: px, y: py, color: pixel.color, alpha: pixel.alphaGL }); + } + + out.push(row); + } + + return out; + }, + + /** + * Returns the Image Data index for the given pixel in this CanvasTexture. + * + * The index can be used to read directly from the `this.data` array. + * + * The index points to the red value in the array. The subsequent 3 indexes + * point to green, blue and alpha respectively. + * + * @method Phaser.Textures.CanvasTexture#getIndex + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * + * @return {integer} + */ + getIndex: function (x, y) + { + x = Math.abs(Math.round(x)); + y = Math.abs(Math.round(y)); + + if (x < this.width && y < this.height) + { + return (x + y * this.width) * 4; + } + else + { + return -1; + } + }, + + /** + * This should be called manually if you are running under WebGL. + * It will refresh the WebGLTexture from the Canvas source. Only call this if you know that the + * canvas has changed, as there is a significant GPU texture allocation cost involved in doing so. + * + * @method Phaser.Textures.CanvasTexture#refresh + * @since 3.7.0 + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + refresh: function () + { + this._source.update(); + + return this; + }, + + /** + * Gets the Canvas Element. + * + * @method Phaser.Textures.CanvasTexture#getCanvas + * @since 3.7.0 + * + * @return {HTMLCanvasElement} The Canvas DOM element this texture is using. + */ + getCanvas: function () + { + return this.canvas; + }, + + /** + * Gets the 2D Canvas Rendering Context. + * + * @method Phaser.Textures.CanvasTexture#getContext + * @since 3.7.0 + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context this texture is using. + */ + getContext: function () + { + return this.context; + }, + + /** + * Clears the given region of this Canvas Texture, resetting it back to transparent. + * If no region is given, the whole Canvas Texture is cleared. + * + * @method Phaser.Textures.CanvasTexture#clear + * @since 3.7.0 + * + * @param {integer} [x=0] - The x coordinate of the top-left of the region to clear. + * @param {integer} [y=0] - The y coordinate of the top-left of the region to clear. + * @param {integer} [width] - The width of the region. + * @param {integer} [height] - The height of the region. + * + * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. + */ + clear: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.width; } + if (height === undefined) { height = this.height; } + + this.context.clearRect(x, y, width, height); + + return this.update(); + }, + + /** + * Changes the size of this Canvas Texture. + * + * @method Phaser.Textures.CanvasTexture#setSize + * @since 3.7.0 + * + * @param {integer} width - The new width of the Canvas. + * @param {integer} [height] - The new height of the Canvas. If not given it will use the width as the height. + * + * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + if (width !== this.width || height !== this.height) + { + // Update the Canvas + this.canvas.width = width; + this.canvas.height = height; + + // Update the Texture Source + this._source.width = width; + this._source.height = height; + this._source.isPowerOf2 = IsSizePowerOfTwo(width, height); + + // Update the Frame + this.frames['__BASE'].setSize(width, height, 0, 0); + + this.refresh(); + } + + return this; + }, + + /** + * Destroys this Texture and releases references to its sources and frames. + * + * @method Phaser.Textures.CanvasTexture#destroy + * @since 3.16.0 + */ + destroy: function () + { + Texture.prototype.destroy.call(this); + + this._source = null; + this.canvas = null; + this.context = null; + this.imageData = null; + this.data = null; + this.pixels = null; + this.buffer = null; + } + +}); + +module.exports = CanvasTexture; + + +/***/ }), +/* 353 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(25); +var Class = __webpack_require__(0); +var IsSizePowerOfTwo = __webpack_require__(118); var ScaleModes = __webpack_require__(104); /** @@ -71262,7 +73029,7 @@ var ScaleModes = __webpack_require__(104); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture this TextureSource belongs to. - * @param {(HTMLImageElement|HTMLCanvasElement)} source - The source image data. + * @param {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture|WebGLTexture)} source - The source image data. * @param {integer} [width] - Optional width of the source image. If not given it's derived from the source itself. * @param {integer} [height] - Optional height of the source image. If not given it's derived from the source itself. */ @@ -71294,10 +73061,10 @@ var TextureSource = new Class({ /** * The source of the image data. - * This is either an Image Element, a Canvas Element or a RenderTexture. + * This is either an Image Element, a Canvas Element, a RenderTexture or a WebGLTexture. * * @name Phaser.Textures.TextureSource#source - * @type {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture)} + * @type {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture|WebGLTexture)} * @since 3.12.0 */ this.source = source; @@ -71380,6 +73147,15 @@ var TextureSource = new Class({ */ this.isRenderTexture = (source.type === 'RenderTexture'); + /** + * Is the source image a WebGLTexture? + * + * @name Phaser.Textures.TextureSource#isGLTexture + * @type {boolean} + * @since 3.19.0 + */ + this.isGLTexture = (source instanceof WebGLTexture); + /** * Are the source image dimensions a power of two? * @@ -71390,7 +73166,8 @@ var TextureSource = new Class({ this.isPowerOf2 = IsSizePowerOfTwo(this.width, this.height); /** - * The WebGL Texture of the source image. + * The WebGL Texture of the source image. If this TextureSource is driven from a WebGLTexture + * already, then this is a reference to that WebGLTexture. * * @name Phaser.Textures.TextureSource#glTexture * @type {?WebGLTexture} @@ -71426,6 +73203,10 @@ var TextureSource = new Class({ this.glTexture = this.renderer.createTextureFromSource(null, this.width, this.height, this.scaleMode); } + else if (this.isGLTexture) + { + this.glTexture = this.source; + } else { this.glTexture = this.renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode); @@ -71475,19 +73256,6 @@ var TextureSource = new Class({ if (this.renderer.gl && this.isCanvas) { this.glTexture = this.renderer.canvasToTexture(this.image, this.glTexture); - - // Update all the Frames using this TextureSource - - /* - var index = this.texture.getTextureSourceIndex(this); - - var frames = this.texture.getFramesFromTextureSource(index, true); - - for (var i = 0; i < frames.length; i++) - { - frames[i].glTexture = this.glTexture; - } - */ } }, @@ -71522,7 +73290,7 @@ module.exports = TextureSource; /***/ }), -/* 351 */ +/* 354 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71537,20 +73305,20 @@ module.exports = TextureSource; module.exports = { - AtlasXML: __webpack_require__(843), - Canvas: __webpack_require__(844), - Image: __webpack_require__(845), - JSONArray: __webpack_require__(846), - JSONHash: __webpack_require__(847), - SpriteSheet: __webpack_require__(848), - SpriteSheetFromAtlas: __webpack_require__(849), - UnityYAML: __webpack_require__(850) + AtlasXML: __webpack_require__(847), + Canvas: __webpack_require__(848), + Image: __webpack_require__(849), + JSONArray: __webpack_require__(850), + JSONHash: __webpack_require__(851), + SpriteSheet: __webpack_require__(852), + SpriteSheetFromAtlas: __webpack_require__(853), + UnityYAML: __webpack_require__(854) }; /***/ }), -/* 352 */ +/* 355 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71560,9 +73328,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HTML5AudioSoundManager = __webpack_require__(353); -var NoAudioSoundManager = __webpack_require__(355); -var WebAudioSoundManager = __webpack_require__(357); +var HTML5AudioSoundManager = __webpack_require__(356); +var NoAudioSoundManager = __webpack_require__(358); +var WebAudioSoundManager = __webpack_require__(360); /** * Creates a Web Audio, HTML5 Audio or No Audio Sound Manager based on config and device settings. @@ -71600,7 +73368,7 @@ module.exports = SoundManagerCreator; /***/ }), -/* 353 */ +/* 356 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71610,10 +73378,10 @@ module.exports = SoundManagerCreator; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSoundManager = __webpack_require__(123); +var BaseSoundManager = __webpack_require__(124); var Class = __webpack_require__(0); -var Events = __webpack_require__(65); -var HTML5AudioSound = __webpack_require__(354); +var Events = __webpack_require__(66); +var HTML5AudioSound = __webpack_require__(357); /** * HTML5 Audio implementation of the Sound Manager. @@ -72056,7 +73824,7 @@ module.exports = HTML5AudioSoundManager; /***/ }), -/* 354 */ +/* 357 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72066,9 +73834,9 @@ module.exports = HTML5AudioSoundManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(124); +var BaseSound = __webpack_require__(125); var Class = __webpack_require__(0); -var Events = __webpack_require__(65); +var Events = __webpack_require__(66); /** * @classdesc @@ -72983,7 +74751,7 @@ module.exports = HTML5AudioSound; /***/ }), -/* 355 */ +/* 358 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72993,10 +74761,10 @@ module.exports = HTML5AudioSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSoundManager = __webpack_require__(123); +var BaseSoundManager = __webpack_require__(124); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var NoAudioSound = __webpack_require__(356); +var EventEmitter = __webpack_require__(10); +var NoAudioSound = __webpack_require__(359); var NOOP = __webpack_require__(1); /** @@ -73101,7 +74869,7 @@ module.exports = NoAudioSoundManager; /***/ }), -/* 356 */ +/* 359 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73111,10 +74879,10 @@ module.exports = NoAudioSoundManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(124); +var BaseSound = __webpack_require__(125); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Extend = __webpack_require__(17); +var EventEmitter = __webpack_require__(10); +var Extend = __webpack_require__(15); /** * @classdesc @@ -73228,7 +74996,7 @@ module.exports = NoAudioSound; /***/ }), -/* 357 */ +/* 360 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73238,11 +75006,11 @@ module.exports = NoAudioSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Base64ToArrayBuffer = __webpack_require__(358); -var BaseSoundManager = __webpack_require__(123); +var Base64ToArrayBuffer = __webpack_require__(361); +var BaseSoundManager = __webpack_require__(124); var Class = __webpack_require__(0); -var Events = __webpack_require__(65); -var WebAudioSound = __webpack_require__(359); +var Events = __webpack_require__(66); +var WebAudioSound = __webpack_require__(362); /** * @classdesc @@ -73471,6 +75239,11 @@ var WebAudioSoundManager = new Class({ document.body.removeEventListener('click', unlockHandler); _this.unlocked = true; + }, function () + { + document.body.removeEventListener('touchstart', unlockHandler); + document.body.removeEventListener('touchend', unlockHandler); + document.body.removeEventListener('click', unlockHandler); }); } }; @@ -73635,7 +75408,7 @@ module.exports = WebAudioSoundManager; /***/ }), -/* 358 */ +/* 361 */ /***/ (function(module, exports) { /** @@ -73710,7 +75483,7 @@ module.exports = Base64ToArrayBuffer; /***/ }), -/* 359 */ +/* 362 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73720,9 +75493,9 @@ module.exports = Base64ToArrayBuffer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(124); +var BaseSound = __webpack_require__(125); var Class = __webpack_require__(0); -var Events = __webpack_require__(65); +var Events = __webpack_require__(66); /** * @classdesc @@ -74618,7 +76391,7 @@ module.exports = WebAudioSound; /***/ }), -/* 360 */ +/* 363 */ /***/ (function(module, exports) { /** @@ -74666,7 +76439,7 @@ module.exports = TransposeMatrix; /***/ }), -/* 361 */ +/* 364 */ /***/ (function(module, exports) { /** @@ -74788,7 +76561,7 @@ module.exports = QuickSelect; /***/ }), -/* 362 */ +/* 365 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -74797,8 +76570,8 @@ module.exports = QuickSelect; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); -var Shuffle = __webpack_require__(111); +var GetValue = __webpack_require__(5); +var Shuffle = __webpack_require__(112); var BuildChunk = function (a, b, qty) { @@ -74926,7 +76699,7 @@ module.exports = Range; /***/ }), -/* 363 */ +/* 366 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75015,7 +76788,7 @@ module.exports = BuildGameObjectAnimation; /***/ }), -/* 364 */ +/* 367 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75024,7 +76797,7 @@ module.exports = BuildGameObjectAnimation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * 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. @@ -75057,7 +76830,7 @@ module.exports = Union; /***/ }), -/* 365 */ +/* 368 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75068,11 +76841,11 @@ module.exports = Union; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var DOMElementRender = __webpack_require__(916); +var DOMElementRender = __webpack_require__(920); var GameObject = __webpack_require__(13); var IsPlainObject = __webpack_require__(7); -var RemoveFromDOM = __webpack_require__(174); -var Vector4 = __webpack_require__(308); +var RemoveFromDOM = __webpack_require__(175); +var Vector4 = __webpack_require__(311); /** * @classdesc @@ -76004,7 +77777,7 @@ module.exports = DOMElement; /***/ }), -/* 366 */ +/* 369 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76013,7 +77786,7 @@ module.exports = DOMElement; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CSSBlendModes = __webpack_require__(917); +var CSSBlendModes = __webpack_require__(921); var GameObject = __webpack_require__(13); /** @@ -76125,7 +77898,7 @@ module.exports = DOMElementCSSRenderer; /***/ }), -/* 367 */ +/* 370 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76137,7 +77910,7 @@ module.exports = DOMElementCSSRenderer; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var ExternRender = __webpack_require__(921); +var ExternRender = __webpack_require__(925); /** * @classdesc @@ -76221,7 +77994,7 @@ module.exports = Extern; /***/ }), -/* 368 */ +/* 371 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76230,10 +78003,10 @@ module.exports = Extern; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircumferencePoint = __webpack_require__(187); -var FromPercent = __webpack_require__(86); -var MATH_CONST = __webpack_require__(23); -var Point = __webpack_require__(3); +var CircumferencePoint = __webpack_require__(189); +var FromPercent = __webpack_require__(87); +var MATH_CONST = __webpack_require__(22); +var Point = __webpack_require__(4); /** * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse @@ -76264,7 +78037,7 @@ module.exports = GetPoint; /***/ }), -/* 369 */ +/* 372 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76273,10 +78046,10 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circumference = __webpack_require__(370); -var CircumferencePoint = __webpack_require__(187); -var FromPercent = __webpack_require__(86); -var MATH_CONST = __webpack_require__(23); +var Circumference = __webpack_require__(373); +var CircumferencePoint = __webpack_require__(189); +var FromPercent = __webpack_require__(87); +var MATH_CONST = __webpack_require__(22); /** * Returns an array of Point objects containing the coordinates of the points around the circumference of the Ellipse, @@ -76318,7 +78091,7 @@ module.exports = GetPoints; /***/ }), -/* 370 */ +/* 373 */ /***/ (function(module, exports) { /** @@ -76350,7 +78123,7 @@ module.exports = Circumference; /***/ }), -/* 371 */ +/* 374 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76359,8 +78132,8 @@ module.exports = Circumference; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Commands = __webpack_require__(186); -var SetTransform = __webpack_require__(25); +var Commands = __webpack_require__(188); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -76600,7 +78373,7 @@ module.exports = GraphicsCanvasRenderer; /***/ }), -/* 372 */ +/* 375 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76819,7 +78592,7 @@ module.exports = GravityWell; /***/ }), -/* 373 */ +/* 376 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76830,7 +78603,7 @@ module.exports = GravityWell; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(35); -var DistanceBetween = __webpack_require__(57); +var DistanceBetween = __webpack_require__(58); /** * @classdesc @@ -77388,7 +79161,7 @@ module.exports = Particle; /***/ }), -/* 374 */ +/* 377 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -77397,22 +79170,22 @@ module.exports = Particle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(52); +var BlendModes = __webpack_require__(53); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var DeathZone = __webpack_require__(375); -var EdgeZone = __webpack_require__(376); -var EmitterOp = __webpack_require__(933); +var DeathZone = __webpack_require__(378); +var EdgeZone = __webpack_require__(379); +var EmitterOp = __webpack_require__(937); var GetFastValue = __webpack_require__(2); -var GetRandom = __webpack_require__(180); -var HasAny = __webpack_require__(377); +var GetRandom = __webpack_require__(182); +var HasAny = __webpack_require__(380); var HasValue = __webpack_require__(97); -var Particle = __webpack_require__(373); -var RandomZone = __webpack_require__(378); -var Rectangle = __webpack_require__(10); -var StableSort = __webpack_require__(127); -var Vector2 = __webpack_require__(4); -var Wrap = __webpack_require__(56); +var Particle = __webpack_require__(376); +var RandomZone = __webpack_require__(381); +var Rectangle = __webpack_require__(11); +var StableSort = __webpack_require__(128); +var Vector2 = __webpack_require__(3); +var Wrap = __webpack_require__(57); /** * @classdesc @@ -79427,7 +81200,7 @@ module.exports = ParticleEmitter; /***/ }), -/* 375 */ +/* 378 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -79505,7 +81278,7 @@ module.exports = DeathZone; /***/ }), -/* 376 */ +/* 379 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -79749,7 +81522,7 @@ module.exports = EdgeZone; /***/ }), -/* 377 */ +/* 380 */ /***/ (function(module, exports) { /** @@ -79786,7 +81559,7 @@ module.exports = HasAny; /***/ }), -/* 378 */ +/* 381 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -79796,7 +81569,7 @@ module.exports = HasAny; */ var Class = __webpack_require__(0); -var Vector2 = __webpack_require__(4); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -79859,7 +81632,7 @@ module.exports = RandomZone; /***/ }), -/* 379 */ +/* 382 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -79870,7 +81643,7 @@ module.exports = RandomZone; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Sprite = __webpack_require__(67); +var Sprite = __webpack_require__(68); /** * @classdesc @@ -79941,7 +81714,7 @@ module.exports = PathFollower; /***/ }), -/* 380 */ +/* 383 */ /***/ (function(module, exports) { /** @@ -79976,7 +81749,7 @@ module.exports = UUID; /***/ }), -/* 381 */ +/* 384 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -79985,13 +81758,13 @@ module.exports = UUID; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcRender = __webpack_require__(953); +var ArcRender = __webpack_require__(957); var Class = __webpack_require__(0); var DegToRad = __webpack_require__(35); -var Earcut = __webpack_require__(63); -var GeomCircle = __webpack_require__(77); -var MATH_CONST = __webpack_require__(23); -var Shape = __webpack_require__(30); +var Earcut = __webpack_require__(64); +var GeomCircle = __webpack_require__(78); +var MATH_CONST = __webpack_require__(22); +var Shape = __webpack_require__(29); /** * @classdesc @@ -80147,7 +81920,8 @@ var Arc = new Class({ { this.geom.radius = value; - this.setSize(value, value); + var diameter = value * 2; + this.setSize(diameter, diameter); this.updateDisplayOrigin(); this.updateData(); } @@ -80328,8 +82102,8 @@ var Arc = new Class({ var endAngle = DegToRad(this._endAngle); var anticlockwise = this._anticlockwise; - var x = radius / 2; - var y = radius / 2; + var x = radius; + var y = radius; endAngle -= startAngle; @@ -80384,7 +82158,7 @@ module.exports = Arc; /***/ }), -/* 382 */ +/* 385 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80394,10 +82168,10 @@ module.exports = Arc; */ var Class = __webpack_require__(0); -var CurveRender = __webpack_require__(956); -var Earcut = __webpack_require__(63); -var Rectangle = __webpack_require__(10); -var Shape = __webpack_require__(30); +var CurveRender = __webpack_require__(960); +var Earcut = __webpack_require__(64); +var Rectangle = __webpack_require__(11); +var Shape = __webpack_require__(29); /** * @classdesc @@ -80566,7 +82340,7 @@ module.exports = Curve; /***/ }), -/* 383 */ +/* 386 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80576,10 +82350,10 @@ module.exports = Curve; */ var Class = __webpack_require__(0); -var Earcut = __webpack_require__(63); -var EllipseRender = __webpack_require__(959); -var GeomEllipse = __webpack_require__(92); -var Shape = __webpack_require__(30); +var Earcut = __webpack_require__(64); +var EllipseRender = __webpack_require__(963); +var GeomEllipse = __webpack_require__(93); +var Shape = __webpack_require__(29); /** * @classdesc @@ -80753,7 +82527,7 @@ module.exports = Ellipse; /***/ }), -/* 384 */ +/* 387 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80763,8 +82537,8 @@ module.exports = Ellipse; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GridRender = __webpack_require__(962); +var Shape = __webpack_require__(29); +var GridRender = __webpack_require__(966); /** * @classdesc @@ -81035,7 +82809,7 @@ module.exports = Grid; /***/ }), -/* 385 */ +/* 388 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -81044,9 +82818,9 @@ module.exports = Grid; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var IsoBoxRender = __webpack_require__(965); +var IsoBoxRender = __webpack_require__(969); var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(29); /** * @classdesc @@ -81250,7 +83024,7 @@ module.exports = IsoBox; /***/ }), -/* 386 */ +/* 389 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -81260,8 +83034,8 @@ module.exports = IsoBox; */ var Class = __webpack_require__(0); -var IsoTriangleRender = __webpack_require__(968); -var Shape = __webpack_require__(30); +var IsoTriangleRender = __webpack_require__(972); +var Shape = __webpack_require__(29); /** * @classdesc @@ -81496,7 +83270,7 @@ module.exports = IsoTriangle; /***/ }), -/* 387 */ +/* 390 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -81506,9 +83280,9 @@ module.exports = IsoTriangle; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GeomLine = __webpack_require__(54); -var LineRender = __webpack_require__(971); +var Shape = __webpack_require__(29); +var GeomLine = __webpack_require__(55); +var LineRender = __webpack_require__(975); /** * @classdesc @@ -81663,7 +83437,7 @@ module.exports = Line; /***/ }), -/* 388 */ +/* 391 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -81672,13 +83446,13 @@ module.exports = Line; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PolygonRender = __webpack_require__(974); +var PolygonRender = __webpack_require__(978); var Class = __webpack_require__(0); -var Earcut = __webpack_require__(63); -var GetAABB = __webpack_require__(389); -var GeomPolygon = __webpack_require__(192); -var Shape = __webpack_require__(30); -var Smooth = __webpack_require__(392); +var Earcut = __webpack_require__(64); +var GetAABB = __webpack_require__(392); +var GeomPolygon = __webpack_require__(194); +var Shape = __webpack_require__(29); +var Smooth = __webpack_require__(395); /** * @classdesc @@ -81802,7 +83576,7 @@ module.exports = Polygon; /***/ }), -/* 389 */ +/* 392 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -81811,7 +83585,7 @@ module.exports = Polygon; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * Calculates the bounding AABB rectangle of a polygon. @@ -81858,7 +83632,7 @@ module.exports = GetAABB; /***/ }), -/* 390 */ +/* 393 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -81867,9 +83641,9 @@ module.exports = GetAABB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); -var Line = __webpack_require__(54); -var Perimeter = __webpack_require__(391); +var Length = __webpack_require__(56); +var Line = __webpack_require__(55); +var Perimeter = __webpack_require__(394); /** * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, @@ -81935,7 +83709,7 @@ module.exports = GetPoints; /***/ }), -/* 391 */ +/* 394 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -81944,8 +83718,8 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); -var Line = __webpack_require__(54); +var Length = __webpack_require__(56); +var Line = __webpack_require__(55); /** * Returns the perimeter of the given Polygon. @@ -81983,7 +83757,7 @@ module.exports = Perimeter; /***/ }), -/* 392 */ +/* 395 */ /***/ (function(module, exports) { /** @@ -82059,7 +83833,7 @@ module.exports = Smooth; /***/ }), -/* 393 */ +/* 396 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -82069,9 +83843,9 @@ module.exports = Smooth; */ var Class = __webpack_require__(0); -var GeomRectangle = __webpack_require__(10); -var Shape = __webpack_require__(30); -var RectangleRender = __webpack_require__(977); +var GeomRectangle = __webpack_require__(11); +var Shape = __webpack_require__(29); +var RectangleRender = __webpack_require__(981); /** * @classdesc @@ -82171,7 +83945,7 @@ module.exports = Rectangle; /***/ }), -/* 394 */ +/* 397 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -82180,10 +83954,10 @@ module.exports = Rectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StarRender = __webpack_require__(980); +var StarRender = __webpack_require__(984); var Class = __webpack_require__(0); -var Earcut = __webpack_require__(63); -var Shape = __webpack_require__(30); +var Earcut = __webpack_require__(64); +var Shape = __webpack_require__(29); /** * @classdesc @@ -82459,7 +84233,7 @@ module.exports = Star; /***/ }), -/* 395 */ +/* 398 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -82469,9 +84243,9 @@ module.exports = Star; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GeomTriangle = __webpack_require__(69); -var TriangleRender = __webpack_require__(983); +var Shape = __webpack_require__(29); +var GeomTriangle = __webpack_require__(70); +var TriangleRender = __webpack_require__(987); /** * @classdesc @@ -82602,7 +84376,7 @@ module.exports = Triangle; /***/ }), -/* 396 */ +/* 399 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -82611,8 +84385,8 @@ module.exports = Triangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var Length = __webpack_require__(55); +var Point = __webpack_require__(4); +var Length = __webpack_require__(56); /** * Returns a Point from around the perimeter of a Triangle. @@ -82689,7 +84463,7 @@ module.exports = GetPoint; /***/ }), -/* 397 */ +/* 400 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -82698,8 +84472,8 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); -var Point = __webpack_require__(3); +var Length = __webpack_require__(56); +var Point = __webpack_require__(4); /** * Returns an array of evenly spaced points on the perimeter of a Triangle. @@ -82782,7 +84556,7 @@ module.exports = GetPoints; /***/ }), -/* 398 */ +/* 401 */ /***/ (function(module, exports) { /** @@ -82865,7 +84639,7 @@ module.exports = SetValue; /***/ }), -/* 399 */ +/* 402 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83128,7 +84902,7 @@ module.exports = Light; /***/ }), -/* 400 */ +/* 403 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83138,7 +84912,7 @@ module.exports = Light; */ var Class = __webpack_require__(0); -var Light = __webpack_require__(399); +var Light = __webpack_require__(402); var Utils = __webpack_require__(9); /** @@ -83491,7 +85265,7 @@ module.exports = LightsManager; /***/ }), -/* 401 */ +/* 404 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83500,26 +85274,34 @@ module.exports = LightsManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var CONST = __webpack_require__(47); +var Extend = __webpack_require__(15); + /** * @namespace Phaser.Geom */ -module.exports = { +var Geom = { - Circle: __webpack_require__(1039), - Ellipse: __webpack_require__(1049), - Intersects: __webpack_require__(402), - Line: __webpack_require__(1068), - Point: __webpack_require__(1089), - Polygon: __webpack_require__(1103), - Rectangle: __webpack_require__(417), - Triangle: __webpack_require__(1133) + Circle: __webpack_require__(1043), + Ellipse: __webpack_require__(1053), + Intersects: __webpack_require__(405), + Line: __webpack_require__(1072), + Point: __webpack_require__(1093), + Polygon: __webpack_require__(1107), + Rectangle: __webpack_require__(420), + Triangle: __webpack_require__(1137) }; +// Merge in the consts +Geom = Extend(false, Geom, CONST); + +module.exports = Geom; + /***/ }), -/* 402 */ +/* 405 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83534,35 +85316,35 @@ module.exports = { module.exports = { - CircleToCircle: __webpack_require__(403), - CircleToRectangle: __webpack_require__(404), - GetCircleToCircle: __webpack_require__(1059), - GetCircleToRectangle: __webpack_require__(1060), - GetLineToCircle: __webpack_require__(196), - GetLineToRectangle: __webpack_require__(198), - GetRectangleIntersection: __webpack_require__(1061), - GetRectangleToRectangle: __webpack_require__(1062), - GetRectangleToTriangle: __webpack_require__(1063), - GetTriangleToCircle: __webpack_require__(1064), - GetTriangleToLine: __webpack_require__(409), - GetTriangleToTriangle: __webpack_require__(1065), - LineToCircle: __webpack_require__(197), - LineToLine: __webpack_require__(82), - LineToRectangle: __webpack_require__(405), - PointToLine: __webpack_require__(413), - PointToLineSegment: __webpack_require__(1066), - RectangleToRectangle: __webpack_require__(130), - RectangleToTriangle: __webpack_require__(406), - RectangleToValues: __webpack_require__(1067), - TriangleToCircle: __webpack_require__(408), - TriangleToLine: __webpack_require__(410), - TriangleToTriangle: __webpack_require__(411) + CircleToCircle: __webpack_require__(406), + CircleToRectangle: __webpack_require__(407), + GetCircleToCircle: __webpack_require__(1063), + GetCircleToRectangle: __webpack_require__(1064), + GetLineToCircle: __webpack_require__(198), + GetLineToRectangle: __webpack_require__(200), + GetRectangleIntersection: __webpack_require__(1065), + GetRectangleToRectangle: __webpack_require__(1066), + GetRectangleToTriangle: __webpack_require__(1067), + GetTriangleToCircle: __webpack_require__(1068), + GetTriangleToLine: __webpack_require__(412), + GetTriangleToTriangle: __webpack_require__(1069), + LineToCircle: __webpack_require__(199), + LineToLine: __webpack_require__(84), + LineToRectangle: __webpack_require__(408), + PointToLine: __webpack_require__(416), + PointToLineSegment: __webpack_require__(1070), + RectangleToRectangle: __webpack_require__(131), + RectangleToTriangle: __webpack_require__(409), + RectangleToValues: __webpack_require__(1071), + TriangleToCircle: __webpack_require__(411), + TriangleToLine: __webpack_require__(413), + TriangleToTriangle: __webpack_require__(414) }; /***/ }), -/* 403 */ +/* 406 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83571,7 +85353,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DistanceBetween = __webpack_require__(57); +var DistanceBetween = __webpack_require__(58); /** * Checks if two Circles intersect. @@ -83593,7 +85375,7 @@ module.exports = CircleToCircle; /***/ }), -/* 404 */ +/* 407 */ /***/ (function(module, exports) { /** @@ -83647,7 +85429,7 @@ module.exports = CircleToRectangle; /***/ }), -/* 405 */ +/* 408 */ /***/ (function(module, exports) { /** @@ -83748,7 +85530,7 @@ module.exports = LineToRectangle; /***/ }), -/* 406 */ +/* 409 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83757,10 +85539,10 @@ module.exports = LineToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineToLine = __webpack_require__(82); -var Contains = __webpack_require__(47); -var ContainsArray = __webpack_require__(199); -var Decompose = __webpack_require__(407); +var LineToLine = __webpack_require__(84); +var Contains = __webpack_require__(48); +var ContainsArray = __webpack_require__(201); +var Decompose = __webpack_require__(410); /** * Checks for intersection between Rectangle shape and Triangle shape. @@ -83841,7 +85623,7 @@ module.exports = RectangleToTriangle; /***/ }), -/* 407 */ +/* 410 */ /***/ (function(module, exports) { /** @@ -83878,7 +85660,7 @@ module.exports = Decompose; /***/ }), -/* 408 */ +/* 411 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83887,8 +85669,8 @@ module.exports = Decompose; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineToCircle = __webpack_require__(197); -var Contains = __webpack_require__(81); +var LineToCircle = __webpack_require__(199); +var Contains = __webpack_require__(83); /** * Checks if a Triangle and a Circle intersect. @@ -83943,7 +85725,7 @@ module.exports = TriangleToCircle; /***/ }), -/* 409 */ +/* 412 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83953,9 +85735,9 @@ module.exports = TriangleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var TriangleToLine = __webpack_require__(410); -var LineToLine = __webpack_require__(82); +var Point = __webpack_require__(4); +var TriangleToLine = __webpack_require__(413); +var LineToLine = __webpack_require__(84); /** * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array. @@ -84002,7 +85784,7 @@ module.exports = GetTriangleToLine; /***/ }), -/* 410 */ +/* 413 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84011,8 +85793,8 @@ module.exports = GetTriangleToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(81); -var LineToLine = __webpack_require__(82); +var Contains = __webpack_require__(83); +var LineToLine = __webpack_require__(84); /** * Checks if a Triangle and a Line intersect. @@ -84058,7 +85840,7 @@ module.exports = TriangleToLine; /***/ }), -/* 411 */ +/* 414 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84067,9 +85849,9 @@ module.exports = TriangleToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ContainsArray = __webpack_require__(199); -var Decompose = __webpack_require__(412); -var LineToLine = __webpack_require__(82); +var ContainsArray = __webpack_require__(201); +var Decompose = __webpack_require__(415); +var LineToLine = __webpack_require__(84); /** * Checks if two Triangles intersect. @@ -84148,7 +85930,7 @@ module.exports = TriangleToTriangle; /***/ }), -/* 412 */ +/* 415 */ /***/ (function(module, exports) { /** @@ -84183,7 +85965,7 @@ module.exports = Decompose; /***/ }), -/* 413 */ +/* 416 */ /***/ (function(module, exports) { /** @@ -84253,7 +86035,7 @@ module.exports = PointToLine; /***/ }), -/* 414 */ +/* 417 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84262,9 +86044,9 @@ module.exports = PointToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Wrap = __webpack_require__(56); -var Angle = __webpack_require__(83); +var MATH_CONST = __webpack_require__(22); +var Wrap = __webpack_require__(57); +var Angle = __webpack_require__(85); /** * Get the angle of the normal of the given line in radians. @@ -84287,7 +86069,7 @@ module.exports = NormalAngle; /***/ }), -/* 415 */ +/* 418 */ /***/ (function(module, exports) { /** @@ -84315,7 +86097,7 @@ module.exports = GetMagnitude; /***/ }), -/* 416 */ +/* 419 */ /***/ (function(module, exports) { /** @@ -84343,7 +86125,7 @@ module.exports = GetMagnitudeSq; /***/ }), -/* 417 */ +/* 420 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84352,51 +86134,51 @@ module.exports = GetMagnitudeSq; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); -Rectangle.Area = __webpack_require__(1108); -Rectangle.Ceil = __webpack_require__(1109); -Rectangle.CeilAll = __webpack_require__(1110); -Rectangle.CenterOn = __webpack_require__(162); -Rectangle.Clone = __webpack_require__(1111); -Rectangle.Contains = __webpack_require__(47); -Rectangle.ContainsPoint = __webpack_require__(1112); -Rectangle.ContainsRect = __webpack_require__(418); -Rectangle.CopyFrom = __webpack_require__(1113); -Rectangle.Decompose = __webpack_require__(407); -Rectangle.Equals = __webpack_require__(1114); -Rectangle.FitInside = __webpack_require__(1115); -Rectangle.FitOutside = __webpack_require__(1116); -Rectangle.Floor = __webpack_require__(1117); -Rectangle.FloorAll = __webpack_require__(1118); -Rectangle.FromPoints = __webpack_require__(172); -Rectangle.GetAspectRatio = __webpack_require__(201); -Rectangle.GetCenter = __webpack_require__(1119); -Rectangle.GetPoint = __webpack_require__(147); -Rectangle.GetPoints = __webpack_require__(249); -Rectangle.GetSize = __webpack_require__(1120); -Rectangle.Inflate = __webpack_require__(1121); -Rectangle.Intersection = __webpack_require__(1122); -Rectangle.MarchingAnts = __webpack_require__(260); -Rectangle.MergePoints = __webpack_require__(1123); -Rectangle.MergeRect = __webpack_require__(1124); -Rectangle.MergeXY = __webpack_require__(1125); -Rectangle.Offset = __webpack_require__(1126); -Rectangle.OffsetPoint = __webpack_require__(1127); -Rectangle.Overlaps = __webpack_require__(1128); -Rectangle.Perimeter = __webpack_require__(108); -Rectangle.PerimeterPoint = __webpack_require__(1129); -Rectangle.Random = __webpack_require__(150); -Rectangle.RandomOutside = __webpack_require__(1130); -Rectangle.SameDimensions = __webpack_require__(1131); -Rectangle.Scale = __webpack_require__(1132); -Rectangle.Union = __webpack_require__(364); +Rectangle.Area = __webpack_require__(1112); +Rectangle.Ceil = __webpack_require__(1113); +Rectangle.CeilAll = __webpack_require__(1114); +Rectangle.CenterOn = __webpack_require__(163); +Rectangle.Clone = __webpack_require__(1115); +Rectangle.Contains = __webpack_require__(48); +Rectangle.ContainsPoint = __webpack_require__(1116); +Rectangle.ContainsRect = __webpack_require__(421); +Rectangle.CopyFrom = __webpack_require__(1117); +Rectangle.Decompose = __webpack_require__(410); +Rectangle.Equals = __webpack_require__(1118); +Rectangle.FitInside = __webpack_require__(1119); +Rectangle.FitOutside = __webpack_require__(1120); +Rectangle.Floor = __webpack_require__(1121); +Rectangle.FloorAll = __webpack_require__(1122); +Rectangle.FromPoints = __webpack_require__(173); +Rectangle.GetAspectRatio = __webpack_require__(203); +Rectangle.GetCenter = __webpack_require__(1123); +Rectangle.GetPoint = __webpack_require__(148); +Rectangle.GetPoints = __webpack_require__(252); +Rectangle.GetSize = __webpack_require__(1124); +Rectangle.Inflate = __webpack_require__(1125); +Rectangle.Intersection = __webpack_require__(1126); +Rectangle.MarchingAnts = __webpack_require__(263); +Rectangle.MergePoints = __webpack_require__(1127); +Rectangle.MergeRect = __webpack_require__(1128); +Rectangle.MergeXY = __webpack_require__(1129); +Rectangle.Offset = __webpack_require__(1130); +Rectangle.OffsetPoint = __webpack_require__(1131); +Rectangle.Overlaps = __webpack_require__(1132); +Rectangle.Perimeter = __webpack_require__(109); +Rectangle.PerimeterPoint = __webpack_require__(1133); +Rectangle.Random = __webpack_require__(151); +Rectangle.RandomOutside = __webpack_require__(1134); +Rectangle.SameDimensions = __webpack_require__(1135); +Rectangle.Scale = __webpack_require__(1136); +Rectangle.Union = __webpack_require__(367); module.exports = Rectangle; /***/ }), -/* 418 */ +/* 421 */ /***/ (function(module, exports) { /** @@ -84436,7 +86218,7 @@ module.exports = ContainsRect; /***/ }), -/* 419 */ +/* 422 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84445,7 +86227,7 @@ module.exports = ContainsRect; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); // The three medians (the lines drawn from the vertices to the bisectors of the opposite sides) // meet in the centroid or center of mass (center of gravity). @@ -84480,7 +86262,7 @@ module.exports = Centroid; /***/ }), -/* 420 */ +/* 423 */ /***/ (function(module, exports) { /** @@ -84521,7 +86303,7 @@ module.exports = Offset; /***/ }), -/* 421 */ +/* 424 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84530,7 +86312,7 @@ module.exports = Offset; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); // The three angle bisectors of a triangle meet in one point called the incenter. // It is the center of the incircle, the circle inscribed in the triangle. @@ -84586,7 +86368,7 @@ module.exports = InCenter; /***/ }), -/* 422 */ +/* 425 */ /***/ (function(module, exports) { /** @@ -84628,6 +86410,7 @@ var CreateInteractiveObject = function (gameObject, hitArea, hitAreaCallback) hitArea: hitArea, hitAreaCallback: hitAreaCallback, + hitAreaDebug: null, // Has the dev specified their own shape, or is this bound to the texture size? customHitArea: false, @@ -84655,7 +86438,7 @@ module.exports = CreateInteractiveObject; /***/ }), -/* 423 */ +/* 426 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84780,7 +86563,7 @@ module.exports = Axis; /***/ }), -/* 424 */ +/* 427 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84790,7 +86573,7 @@ module.exports = Axis; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(203); +var Events = __webpack_require__(205); /** * @classdesc @@ -84926,7 +86709,7 @@ module.exports = Button; /***/ }), -/* 425 */ +/* 428 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84935,11 +86718,11 @@ module.exports = Button; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Axis = __webpack_require__(423); -var Button = __webpack_require__(424); +var Axis = __webpack_require__(426); +var Button = __webpack_require__(427); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Vector2 = __webpack_require__(4); +var EventEmitter = __webpack_require__(10); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -85684,7 +87467,7 @@ module.exports = Gamepad; /***/ }), -/* 426 */ +/* 429 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85694,8 +87477,8 @@ module.exports = Gamepad; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(132); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(133); /** * @classdesc @@ -86086,7 +87869,7 @@ module.exports = Key; /***/ }), -/* 427 */ +/* 430 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86096,10 +87879,10 @@ module.exports = Key; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(132); +var Events = __webpack_require__(133); var GetFastValue = __webpack_require__(2); -var ProcessKeyCombo = __webpack_require__(1172); -var ResetKeyCombo = __webpack_require__(1174); +var ProcessKeyCombo = __webpack_require__(1176); +var ResetKeyCombo = __webpack_require__(1178); /** * @classdesc @@ -86379,7 +88162,7 @@ module.exports = KeyCombo; /***/ }), -/* 428 */ +/* 431 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86388,7 +88171,7 @@ module.exports = KeyCombo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MergeXHRSettings = __webpack_require__(205); +var MergeXHRSettings = __webpack_require__(207); /** * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings @@ -86447,7 +88230,7 @@ module.exports = XHRLoader; /***/ }), -/* 429 */ +/* 432 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86457,11 +88240,11 @@ module.exports = XHRLoader; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(26); -var File = __webpack_require__(20); +var CONST = __webpack_require__(31); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var HTML5AudioFile = __webpack_require__(430); +var HTML5AudioFile = __webpack_require__(433); var IsPlainObject = __webpack_require__(7); /** @@ -86718,7 +88501,7 @@ module.exports = AudioFile; /***/ }), -/* 430 */ +/* 433 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86728,10 +88511,10 @@ module.exports = AudioFile; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(80); -var File = __webpack_require__(20); +var Events = __webpack_require__(81); +var File = __webpack_require__(21); var GetFastValue = __webpack_require__(2); -var GetURL = __webpack_require__(204); +var GetURL = __webpack_require__(206); var IsPlainObject = __webpack_require__(7); /** @@ -86916,7 +88699,7 @@ module.exports = HTML5AudioFile; /***/ }), -/* 431 */ +/* 434 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86926,8 +88709,8 @@ module.exports = HTML5AudioFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -87087,7 +88870,7 @@ module.exports = ScriptFile; /***/ }), -/* 432 */ +/* 435 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87097,8 +88880,8 @@ module.exports = ScriptFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -87262,7 +89045,7 @@ module.exports = TextFile; /***/ }), -/* 433 */ +/* 436 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87271,12 +89054,12 @@ module.exports = TextFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeImage = __webpack_require__(434); -var ArcadeSprite = __webpack_require__(134); +var ArcadeImage = __webpack_require__(437); +var ArcadeSprite = __webpack_require__(135); var Class = __webpack_require__(0); -var CONST = __webpack_require__(50); -var PhysicsGroup = __webpack_require__(435); -var StaticPhysicsGroup = __webpack_require__(436); +var CONST = __webpack_require__(51); +var PhysicsGroup = __webpack_require__(438); +var StaticPhysicsGroup = __webpack_require__(439); /** * @classdesc @@ -87533,7 +89316,7 @@ module.exports = Factory; /***/ }), -/* 434 */ +/* 437 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87543,8 +89326,8 @@ module.exports = Factory; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(207); -var Image = __webpack_require__(95); +var Components = __webpack_require__(209); +var Image = __webpack_require__(96); /** * @classdesc @@ -87633,7 +89416,7 @@ module.exports = ArcadeImage; /***/ }), -/* 435 */ +/* 438 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87642,11 +89425,11 @@ module.exports = ArcadeImage; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeSprite = __webpack_require__(134); +var ArcadeSprite = __webpack_require__(135); var Class = __webpack_require__(0); -var CONST = __webpack_require__(50); +var CONST = __webpack_require__(51); var GetFastValue = __webpack_require__(2); -var Group = __webpack_require__(94); +var Group = __webpack_require__(95); var IsPlainObject = __webpack_require__(7); /** @@ -87906,7 +89689,7 @@ module.exports = PhysicsGroup; /***/ }), -/* 436 */ +/* 439 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87915,11 +89698,11 @@ module.exports = PhysicsGroup; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeSprite = __webpack_require__(134); +var ArcadeSprite = __webpack_require__(135); var Class = __webpack_require__(0); -var CONST = __webpack_require__(50); +var CONST = __webpack_require__(51); var GetFastValue = __webpack_require__(2); -var Group = __webpack_require__(94); +var Group = __webpack_require__(95); var IsPlainObject = __webpack_require__(7); /** @@ -88086,7 +89869,7 @@ module.exports = StaticPhysicsGroup; /***/ }), -/* 437 */ +/* 440 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88095,33 +89878,33 @@ module.exports = StaticPhysicsGroup; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(438); -var Clamp = __webpack_require__(22); +var Body = __webpack_require__(441); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Collider = __webpack_require__(439); -var CONST = __webpack_require__(50); -var DistanceBetween = __webpack_require__(57); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(208); -var FuzzyEqual = __webpack_require__(166); -var FuzzyGreaterThan = __webpack_require__(295); -var FuzzyLessThan = __webpack_require__(296); -var GetOverlapX = __webpack_require__(440); -var GetOverlapY = __webpack_require__(441); -var GetValue = __webpack_require__(6); -var ProcessQueue = __webpack_require__(442); -var ProcessTileCallbacks = __webpack_require__(1230); -var Rectangle = __webpack_require__(10); -var RTree = __webpack_require__(443); -var SeparateTile = __webpack_require__(1231); -var SeparateX = __webpack_require__(1236); -var SeparateY = __webpack_require__(1237); -var Set = __webpack_require__(105); -var StaticBody = __webpack_require__(445); -var TileIntersectsBody = __webpack_require__(444); +var Collider = __webpack_require__(442); +var CONST = __webpack_require__(51); +var DistanceBetween = __webpack_require__(58); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(210); +var FuzzyEqual = __webpack_require__(167); +var FuzzyGreaterThan = __webpack_require__(298); +var FuzzyLessThan = __webpack_require__(299); +var GetOverlapX = __webpack_require__(443); +var GetOverlapY = __webpack_require__(444); +var GetValue = __webpack_require__(5); +var ProcessQueue = __webpack_require__(445); +var ProcessTileCallbacks = __webpack_require__(1234); +var Rectangle = __webpack_require__(11); +var RTree = __webpack_require__(446); +var SeparateTile = __webpack_require__(1235); +var SeparateX = __webpack_require__(1240); +var SeparateY = __webpack_require__(1241); +var Set = __webpack_require__(106); +var StaticBody = __webpack_require__(448); +var TileIntersectsBody = __webpack_require__(447); var TransformMatrix = __webpack_require__(32); -var Vector2 = __webpack_require__(4); -var Wrap = __webpack_require__(56); +var Vector2 = __webpack_require__(3); +var Wrap = __webpack_require__(57); /** * @classdesc @@ -90463,7 +92246,7 @@ module.exports = World; /***/ }), -/* 438 */ +/* 441 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -90474,12 +92257,12 @@ module.exports = World; var CircleContains = __webpack_require__(46); var Class = __webpack_require__(0); -var CONST = __webpack_require__(50); -var Events = __webpack_require__(208); -var RadToDeg = __webpack_require__(169); -var Rectangle = __webpack_require__(10); -var RectangleContains = __webpack_require__(47); -var Vector2 = __webpack_require__(4); +var CONST = __webpack_require__(51); +var Events = __webpack_require__(210); +var RadToDeg = __webpack_require__(170); +var Rectangle = __webpack_require__(11); +var RectangleContains = __webpack_require__(48); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -92651,7 +94434,7 @@ module.exports = Body; /***/ }), -/* 439 */ +/* 442 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92834,7 +94617,7 @@ module.exports = Collider; /***/ }), -/* 440 */ +/* 443 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92843,7 +94626,7 @@ module.exports = Collider; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(50); +var CONST = __webpack_require__(51); /** * Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties @@ -92942,7 +94725,7 @@ module.exports = GetOverlapX; /***/ }), -/* 441 */ +/* 444 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92951,7 +94734,7 @@ module.exports = GetOverlapX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(50); +var CONST = __webpack_require__(51); /** * Calculates and returns the vertical overlap between two arcade physics bodies and sets their properties @@ -93050,7 +94833,7 @@ module.exports = GetOverlapY; /***/ }), -/* 442 */ +/* 445 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -93282,7 +95065,7 @@ module.exports = ProcessQueue; /***/ }), -/* 443 */ +/* 446 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -93292,7 +95075,7 @@ module.exports = ProcessQueue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var quickselect = __webpack_require__(361); +var quickselect = __webpack_require__(364); /** * @classdesc @@ -93893,7 +95676,7 @@ function multiSelect (arr, left, right, n, compare) module.exports = rbush; /***/ }), -/* 444 */ +/* 447 */ /***/ (function(module, exports) { /** @@ -93929,7 +95712,7 @@ module.exports = TileIntersectsBody; /***/ }), -/* 445 */ +/* 448 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -93940,9 +95723,9 @@ module.exports = TileIntersectsBody; var CircleContains = __webpack_require__(46); var Class = __webpack_require__(0); -var CONST = __webpack_require__(50); -var RectangleContains = __webpack_require__(47); -var Vector2 = __webpack_require__(4); +var CONST = __webpack_require__(51); +var RectangleContains = __webpack_require__(48); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -94918,10 +96701,10 @@ module.exports = StaticBody; /***/ }), -/* 446 */, -/* 447 */, -/* 448 */, -/* 449 */ +/* 449 */, +/* 450 */, +/* 451 */, +/* 452 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95102,7 +96885,7 @@ module.exports = BasePlugin; /***/ }), -/* 450 */ +/* 453 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95111,7 +96894,7 @@ module.exports = BasePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -95147,7 +96930,7 @@ module.exports = ReplaceByIndex; /***/ }), -/* 451 */ +/* 454 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95190,7 +96973,7 @@ module.exports = HasTileAt; /***/ }), -/* 452 */ +/* 455 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95199,9 +96982,9 @@ module.exports = HasTileAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tile = __webpack_require__(72); +var Tile = __webpack_require__(73); var IsInLayerBounds = __webpack_require__(101); -var CalculateFacesAt = __webpack_require__(210); +var CalculateFacesAt = __webpack_require__(212); /** * Removes the tile at the given tile coordinates in the specified layer and updates the layer's @@ -95253,7 +97036,7 @@ module.exports = RemoveTileAt; /***/ }), -/* 453 */ +/* 456 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95262,11 +97045,11 @@ module.exports = RemoveTileAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); -var Parse2DArray = __webpack_require__(213); -var ParseCSV = __webpack_require__(454); -var ParseJSONTiled = __webpack_require__(455); -var ParseWeltmeister = __webpack_require__(466); +var Formats = __webpack_require__(30); +var Parse2DArray = __webpack_require__(215); +var ParseCSV = __webpack_require__(457); +var ParseJSONTiled = __webpack_require__(458); +var ParseWeltmeister = __webpack_require__(469); /** * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format @@ -95323,7 +97106,7 @@ module.exports = Parse; /***/ }), -/* 454 */ +/* 457 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95332,8 +97115,8 @@ module.exports = Parse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); -var Parse2DArray = __webpack_require__(213); +var Formats = __webpack_require__(30); +var Parse2DArray = __webpack_require__(215); /** * Parses a CSV string of tile indexes into a new MapData object with a single layer. @@ -95371,7 +97154,7 @@ module.exports = ParseCSV; /***/ }), -/* 455 */ +/* 458 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95380,14 +97163,14 @@ module.exports = ParseCSV; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); +var Formats = __webpack_require__(30); var MapData = __webpack_require__(103); -var ParseTileLayers = __webpack_require__(456); -var ParseImageLayers = __webpack_require__(458); -var ParseTilesets = __webpack_require__(459); -var ParseObjectLayers = __webpack_require__(462); -var BuildTilesetIndex = __webpack_require__(464); -var AssignTileProperties = __webpack_require__(465); +var ParseTileLayers = __webpack_require__(459); +var ParseImageLayers = __webpack_require__(461); +var ParseTilesets = __webpack_require__(462); +var ParseObjectLayers = __webpack_require__(465); +var BuildTilesetIndex = __webpack_require__(467); +var AssignTileProperties = __webpack_require__(468); /** * Parses a Tiled JSON object into a new MapData object. @@ -95449,7 +97232,7 @@ module.exports = ParseJSONTiled; /***/ }), -/* 456 */ +/* 459 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95458,11 +97241,11 @@ module.exports = ParseJSONTiled; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Base64Decode = __webpack_require__(457); +var Base64Decode = __webpack_require__(460); var GetFastValue = __webpack_require__(2); var LayerData = __webpack_require__(102); -var ParseGID = __webpack_require__(214); -var Tile = __webpack_require__(72); +var ParseGID = __webpack_require__(216); +var Tile = __webpack_require__(73); /** * [description] @@ -95659,7 +97442,7 @@ module.exports = ParseTileLayers; /***/ }), -/* 457 */ +/* 460 */ /***/ (function(module, exports) { /** @@ -95702,7 +97485,7 @@ module.exports = Base64Decode; /***/ }), -/* 458 */ +/* 461 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95754,7 +97537,7 @@ module.exports = ParseImageLayers; /***/ }), -/* 459 */ +/* 462 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95763,9 +97546,9 @@ module.exports = ParseImageLayers; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tileset = __webpack_require__(140); -var ImageCollection = __webpack_require__(460); -var ParseObject = __webpack_require__(215); +var Tileset = __webpack_require__(141); +var ImageCollection = __webpack_require__(463); +var ParseObject = __webpack_require__(217); /** * Tilesets and Image Collections @@ -95923,7 +97706,7 @@ module.exports = ParseTilesets; /***/ }), -/* 460 */ +/* 463 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96095,7 +97878,7 @@ module.exports = ImageCollection; /***/ }), -/* 461 */ +/* 464 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96139,7 +97922,7 @@ module.exports = Pick; /***/ }), -/* 462 */ +/* 465 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96149,8 +97932,8 @@ module.exports = Pick; */ var GetFastValue = __webpack_require__(2); -var ParseObject = __webpack_require__(215); -var ObjectLayer = __webpack_require__(463); +var ParseObject = __webpack_require__(217); +var ObjectLayer = __webpack_require__(466); /** * Parses a Tiled JSON object into an array of ObjectLayer objects. @@ -96198,7 +97981,7 @@ module.exports = ParseObjectLayers; /***/ }), -/* 463 */ +/* 466 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96320,7 +98103,7 @@ module.exports = ObjectLayer; /***/ }), -/* 464 */ +/* 467 */ /***/ (function(module, exports) { /** @@ -96393,7 +98176,7 @@ module.exports = BuildTilesetIndex; /***/ }), -/* 465 */ +/* 468 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96402,7 +98185,7 @@ module.exports = BuildTilesetIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(17); +var Extend = __webpack_require__(15); /** * Copy properties from tileset to tiles. @@ -96466,7 +98249,7 @@ module.exports = AssignTileProperties; /***/ }), -/* 466 */ +/* 469 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96475,10 +98258,10 @@ module.exports = AssignTileProperties; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); +var Formats = __webpack_require__(30); var MapData = __webpack_require__(103); -var ParseTileLayers = __webpack_require__(467); -var ParseTilesets = __webpack_require__(468); +var ParseTileLayers = __webpack_require__(470); +var ParseTilesets = __webpack_require__(471); /** * Parses a Weltmeister JSON object into a new MapData object. @@ -96533,7 +98316,7 @@ module.exports = ParseWeltmeister; /***/ }), -/* 467 */ +/* 470 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96543,7 +98326,7 @@ module.exports = ParseWeltmeister; */ var LayerData = __webpack_require__(102); -var Tile = __webpack_require__(72); +var Tile = __webpack_require__(73); /** * [description] @@ -96617,7 +98400,7 @@ module.exports = ParseTileLayers; /***/ }), -/* 468 */ +/* 471 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96626,7 +98409,7 @@ module.exports = ParseTileLayers; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tileset = __webpack_require__(140); +var Tileset = __webpack_require__(141); /** * [description] @@ -96668,7 +98451,7 @@ module.exports = ParseTilesets; /***/ }), -/* 469 */ +/* 472 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96679,16 +98462,16 @@ module.exports = ParseTilesets; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(35); -var DynamicTilemapLayer = __webpack_require__(470); -var Extend = __webpack_require__(17); -var Formats = __webpack_require__(31); +var DynamicTilemapLayer = __webpack_require__(473); +var Extend = __webpack_require__(15); +var Formats = __webpack_require__(30); var LayerData = __webpack_require__(102); -var Rotate = __webpack_require__(305); -var SpliceOne = __webpack_require__(78); -var StaticTilemapLayer = __webpack_require__(471); -var Tile = __webpack_require__(72); -var TilemapComponents = __webpack_require__(136); -var Tileset = __webpack_require__(140); +var Rotate = __webpack_require__(308); +var SpliceOne = __webpack_require__(79); +var StaticTilemapLayer = __webpack_require__(474); +var Tile = __webpack_require__(73); +var TilemapComponents = __webpack_require__(137); +var Tileset = __webpack_require__(141); /** * @callback TilemapFilterCallback @@ -97311,7 +99094,7 @@ var Tilemap = new Class({ config.x = obj.x; config.y = obj.y; - var sprite = this.scene.make.sprite(config); + var sprite = scene.make.sprite(config); sprite.name = obj.name; @@ -97848,7 +99631,7 @@ var Tilemap = new Class({ layer = this.getLayer(layer); if (layer === null) { return null; } - + return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, layer); }, @@ -98220,7 +100003,7 @@ var Tilemap = new Class({ /** * Removes the given TilemapLayer from this Tilemap without destroying it. - * + * * If no layer specified, the map's current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeLayer @@ -98253,7 +100036,7 @@ var Tilemap = new Class({ /** * Destroys the given TilemapLayer and removes it from this Tilemap. - * + * * If no layer specified, the map's current layer is used. * * @method Phaser.Tilemaps.Tilemap#destroyLayer @@ -98320,7 +100103,7 @@ var Tilemap = new Class({ /** * Removes the given Tile, or an array of Tiles, from the layer to which they belong, * and optionally recalculates the collision information. - * + * * This cannot be applied to Tiles that belong to Static Tilemap Layers. * * @method Phaser.Tilemaps.Tilemap#removeTile @@ -98448,7 +100231,7 @@ var Tilemap = new Class({ /** * Draws a debug representation of all layers within this Tilemap to the given Graphics object. - * + * * This is helpful when you want to get a quick idea of which of your tiles are colliding and which * have interesting faces. The tiles are drawn starting at (0, 0) in the Graphics, allowing you to * place the debug representation wherever you want on the screen. @@ -99125,7 +100908,7 @@ module.exports = Tilemap; /***/ }), -/* 470 */ +/* 473 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99136,9 +100919,9 @@ module.exports = Tilemap; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var DynamicTilemapLayerRender = __webpack_require__(1289); +var DynamicTilemapLayerRender = __webpack_require__(1293); var GameObject = __webpack_require__(13); -var TilemapComponents = __webpack_require__(136); +var TilemapComponents = __webpack_require__(137); /** * @classdesc @@ -99588,6 +101371,12 @@ var DynamicTilemapLayer = new Class({ { if (removeFromTilemap === undefined) { removeFromTilemap = true; } + if (!this.tilemap) + { + // Abort, we've already been destroyed + return; + } + // Uninstall this layer only if it is still installed on the LayerData object if (this.layer.tilemapLayer === this) { @@ -100436,7 +102225,7 @@ module.exports = DynamicTilemapLayer; /***/ }), -/* 471 */ +/* 474 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100447,10 +102236,10 @@ module.exports = DynamicTilemapLayer; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(26); +var GameEvents = __webpack_require__(18); var GameObject = __webpack_require__(13); -var StaticTilemapLayerRender = __webpack_require__(1292); -var TilemapComponents = __webpack_require__(136); +var StaticTilemapLayerRender = __webpack_require__(1296); +var TilemapComponents = __webpack_require__(137); var TransformMatrix = __webpack_require__(32); var Utils = __webpack_require__(9); @@ -100800,13 +102589,10 @@ var StaticTilemapLayer = new Class({ this.initPipeline('TextureTintPipeline'); - if (scene.sys.game.config.renderType === CONST.WEBGL) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function () { - scene.sys.game.renderer.onContextRestored(function () - { - this.updateVBOData(); - }, this); - } + this.updateVBOData(); + }, this); }, /** @@ -101887,7 +103673,13 @@ var StaticTilemapLayer = new Class({ { if (removeFromTilemap === undefined) { removeFromTilemap = true; } - // Uninstall this layer only if it is still installed on the LayerData object + if (!this.tilemap) + { + // Abort, we've already been destroyed + return; + } + + // Uninstall this layer only if it is still installed on the LayerData object if (this.layer.tilemapLayer === this) { this.layer.tilemapLayer = undefined; @@ -101925,7 +103717,7 @@ module.exports = StaticTilemapLayer; /***/ }), -/* 472 */ +/* 475 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102204,7 +103996,7 @@ var TimerEvent = new Class({ * @method Phaser.Time.TimerEvent#remove * @since 3.0.0 * - * @param {boolean} [dispatchCallback] - If `true` (by default `false`), the function of the Timer Event will be called before its removal from its Clock. + * @param {boolean} [dispatchCallback=false] - If `true`, the function of the Timer Event will be called before its removal. */ remove: function (dispatchCallback) { @@ -102238,7 +104030,7 @@ module.exports = TimerEvent; /***/ }), -/* 473 */ +/* 476 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102247,17 +104039,20 @@ module.exports = TimerEvent; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RESERVED = __webpack_require__(1301); +var RESERVED = __webpack_require__(1305); /** - * [description] + * Internal function used by the Tween Builder to return an array of properties + * that the Tween will be operating on. It takes a tween configuration object + * and then checks that none of the `props` entries start with an underscore, or that + * none of the direct properties are on the Reserved list. * * @function Phaser.Tweens.Builders.GetProps * @since 3.0.0 * - * @param {object} config - The configuration object of the tween to get the target(s) from. + * @param {Phaser.Types.Tweens.TweenBuilderConfig} config - The configuration object of the Tween to get the properties from. * - * @return {array} An array of all the targets the tween is operating on. + * @return {string[]} An array of all the properties the tween will operate on. */ var GetProps = function (config) { @@ -102296,7 +104091,7 @@ module.exports = GetProps; /***/ }), -/* 474 */ +/* 477 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102305,17 +104100,19 @@ module.exports = GetProps; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** - * Returns an array of all tweens in the given config + * Internal function used by the Timeline Builder. + * + * It returns an array of all tweens in the given timeline config. * * @function Phaser.Tweens.Builders.GetTweens * @since 3.0.0 * - * @param {object} config - [description] + * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline. * - * @return {array} [description] + * @return {Phaser.Tweens.Tween[]} An array of Tween instances that the Timeline will manage. */ var GetTweens = function (config) { @@ -102342,7 +104139,7 @@ module.exports = GetTweens; /***/ }), -/* 475 */ +/* 478 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102351,15 +104148,15 @@ module.exports = GetTweens; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Defaults = __webpack_require__(219); +var Defaults = __webpack_require__(221); var GetAdvancedValue = __webpack_require__(14); -var GetBoolean = __webpack_require__(87); -var GetEaseFunction = __webpack_require__(96); -var GetNewValue = __webpack_require__(141); -var GetValue = __webpack_require__(6); -var GetValueOp = __webpack_require__(218); -var Tween = __webpack_require__(220); -var TweenData = __webpack_require__(221); +var GetBoolean = __webpack_require__(88); +var GetEaseFunction = __webpack_require__(82); +var GetNewValue = __webpack_require__(142); +var GetValue = __webpack_require__(5); +var GetValueOp = __webpack_require__(220); +var Tween = __webpack_require__(222); +var TweenData = __webpack_require__(224); /** * Creates a new Number Tween. @@ -102410,9 +104207,11 @@ var NumberTweenBuilder = function (parent, config, defaults) var tweenData = TweenData( targets[0], + 0, 'value', ops.getEnd, ops.getStart, + ops.getActive, ease, delay, duration, @@ -102470,7 +104269,7 @@ module.exports = NumberTweenBuilder; /***/ }), -/* 476 */ +/* 479 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102479,17 +104278,17 @@ module.exports = NumberTweenBuilder; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(64); -var Defaults = __webpack_require__(219); +var Clone = __webpack_require__(65); +var Defaults = __webpack_require__(221); var GetAdvancedValue = __webpack_require__(14); -var GetBoolean = __webpack_require__(87); -var GetEaseFunction = __webpack_require__(96); -var GetNewValue = __webpack_require__(141); -var GetTargets = __webpack_require__(217); -var GetTweens = __webpack_require__(474); -var GetValue = __webpack_require__(6); -var Timeline = __webpack_require__(477); -var TweenBuilder = __webpack_require__(142); +var GetBoolean = __webpack_require__(88); +var GetEaseFunction = __webpack_require__(82); +var GetNewValue = __webpack_require__(142); +var GetTargets = __webpack_require__(219); +var GetTweens = __webpack_require__(477); +var GetValue = __webpack_require__(5); +var Timeline = __webpack_require__(480); +var TweenBuilder = __webpack_require__(143); /** * Builds a Timeline of Tweens based on a configuration object. @@ -102622,7 +104421,7 @@ module.exports = TimelineBuilder; /***/ }), -/* 477 */ +/* 480 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102632,10 +104431,10 @@ module.exports = TimelineBuilder; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(478); -var TweenBuilder = __webpack_require__(142); -var TWEEN_CONST = __webpack_require__(88); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(223); +var TweenBuilder = __webpack_require__(143); +var TWEEN_CONST = __webpack_require__(89); /** * @classdesc @@ -102862,6 +104661,21 @@ var Timeline = new Class({ */ this.totalProgress = 0; + /** + * An object containing the different Tween callback functions. + * + * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. + * + * `onComplete` When the Timeline finishes playback fully or `Timeline.stop` is called. Never invoked if timeline is set to repeat infinitely. + * `onLoop` When a Timeline loops. + * `onStart` When the Timeline starts playing. + * `onUpdate` When a Timeline updates a child Tween. + * `onYoyo` When a Timeline starts a yoyo. + * + * @name Phaser.Tweens.Timeline#callbacks + * @type {object} + * @since 3.0.0 + */ this.callbacks = { onComplete: null, onLoop: null, @@ -102870,9 +104684,37 @@ var Timeline = new Class({ onYoyo: null }; + /** + * The context in which all callbacks are invoked. + * + * @name Phaser.Tweens.Timeline#callbackScope + * @type {any} + * @since 3.0.0 + */ this.callbackScope; }, + /** + * Internal method that will emit a Timeline based Event and invoke the given callback. + * + * @method Phaser.Tweens.Timeline#dispatchTimelineEvent + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchTimelineEvent: function (event, callback) + { + this.emit(event, this, this.targets); + + if (callback) + { + callback.params[1] = this.targets; + + callback.func.apply(callback.scope, callback.params); + } + }, + /** * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. * A value of 0.5 runs 50% slower, and so on. @@ -103231,14 +105073,7 @@ var Timeline = new Class({ this.state = TWEEN_CONST.ACTIVE; } - var onStart = this.callbacks.onStart; - - if (onStart) - { - onStart.func.apply(onStart.scope, onStart.params); - } - - this.emit(Events.TIMELINE_START, this); + this.dispatchTimelineEvent(Events.TIMELINE_START, this.callbacks.onStart); }, /** @@ -103261,44 +105096,32 @@ var Timeline = new Class({ this.loopCounter--; - var onLoop = this.callbacks.onLoop; - - if (onLoop) - { - onLoop.func.apply(onLoop.scope, onLoop.params); - } - - this.emit(Events.TIMELINE_LOOP, this, this.loopCounter); - this.resetTweens(true); if (this.loopDelay > 0) { this.countdown = this.loopDelay; + this.state = TWEEN_CONST.LOOP_DELAY; } else { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); } } else if (this.completeDelay > 0) { - this.countdown = this.completeDelay; this.state = TWEEN_CONST.COMPLETE_DELAY; + + this.countdown = this.completeDelay; } else { this.state = TWEEN_CONST.PENDING_REMOVE; - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.func.apply(onComplete.scope, onComplete.params); - } - - this.emit(Events.TIMELINE_COMPLETE, this); + this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); } }, @@ -103352,14 +105175,7 @@ var Timeline = new Class({ } } - var onUpdate = this.callbacks.onUpdate; - - if (onUpdate) - { - onUpdate.func.apply(onUpdate.scope, onUpdate.params); - } - - this.emit(Events.TIMELINE_UPDATE, this); + this.dispatchTimelineEvent(Events.TIMELINE_UPDATE, this.callbacks.onUpdate); // Anything still running? If not, we're done if (stillRunning === 0) @@ -103376,6 +105192,8 @@ var Timeline = new Class({ if (this.countdown <= 0) { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); } break; @@ -103388,14 +105206,7 @@ var Timeline = new Class({ { this.state = TWEEN_CONST.PENDING_REMOVE; - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.func.apply(onComplete.scope, onComplete.params); - } - - this.emit(Events.TIMELINE_COMPLETE, this); + this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); } break; @@ -103517,7 +105328,7 @@ module.exports = Timeline; /***/ }), -/* 478 */ +/* 481 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103526,35 +105337,9 @@ module.exports = Timeline; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.Tweens.Events - */ - -module.exports = { - - TIMELINE_COMPLETE: __webpack_require__(1302), - TIMELINE_LOOP: __webpack_require__(1303), - TIMELINE_PAUSE: __webpack_require__(1304), - TIMELINE_RESUME: __webpack_require__(1305), - TIMELINE_START: __webpack_require__(1306), - TIMELINE_UPDATE: __webpack_require__(1307) - -}; - - -/***/ }), -/* 479 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BaseAnimation = __webpack_require__(146); +var BaseAnimation = __webpack_require__(147); var Class = __webpack_require__(0); -var Events = __webpack_require__(107); +var Events = __webpack_require__(108); /** * @classdesc @@ -104133,6 +105918,11 @@ var Animation = new Class({ var anim = this.currentAnim; var gameObject = this.parent; + if (!anim) + { + return gameObject; + } + // Should give us 9,007,199,254,740,991 safe repeats this.repeatCounter = (this._repeat === -1) ? Number.MAX_VALUE : this._repeat; @@ -104276,7 +106066,7 @@ var Animation = new Class({ { this._repeat = value; - this.repeatCounter = 0; + this.repeatCounter = (value === -1) ? Number.MAX_VALUE : value; return this.parent; }, @@ -104711,7 +106501,7 @@ module.exports = Animation; /***/ }), -/* 480 */ +/* 482 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -104721,14 +106511,14 @@ module.exports = Animation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasSnapshot = __webpack_require__(481); -var CameraEvents = __webpack_require__(48); +var CanvasSnapshot = __webpack_require__(483); +var CameraEvents = __webpack_require__(49); var Class = __webpack_require__(0); -var CONST = __webpack_require__(26); -var GetBlendModes = __webpack_require__(482); -var ScaleEvents = __webpack_require__(89); +var CONST = __webpack_require__(31); +var GetBlendModes = __webpack_require__(484); +var ScaleEvents = __webpack_require__(90); var ScaleModes = __webpack_require__(104); -var Smoothing = __webpack_require__(113); +var Smoothing = __webpack_require__(114); var TransformMatrix = __webpack_require__(32); /** @@ -104993,30 +106783,6 @@ var CanvasRenderer = new Class({ } }, - /** - * A NOOP method for handling lost context. Intentionally empty. - * - * @method Phaser.Renderer.Canvas.CanvasRenderer#onContextLost - * @since 3.0.0 - * - * @param {function} callback - Ignored parameter. - */ - onContextLost: function () - { - }, - - /** - * A NOOP method for handling restored context. Intentionally empty. - * - * @method Phaser.Renderer.Canvas.CanvasRenderer#onContextRestored - * @since 3.0.0 - * - * @param {function} callback - Ignored parameter. - */ - onContextRestored: function () - { - }, - /** * Resets the transformation matrix of the current context to the identity matrix, thus resetting any transformation. * @@ -105245,6 +107011,46 @@ var CanvasRenderer = new Class({ } }, + /** + * Takes a snapshot of the given area of the given canvas. + * + * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render. + * + * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets + * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotCanvas + * @since 3.19.0 + * + * @param {HTMLCanvasElement} canvas - The canvas to grab from. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? + * @param {integer} [x=0] - The x coordinate to grab from. + * @param {integer} [y=0] - The y coordinate to grab from. + * @param {integer} [width=canvas.width] - The width of the area to grab. + * @param {integer} [height=canvas.height] - The height of the area to grab. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This Canvas Renderer. + */ + snapshotCanvas: function (canvas, callback, getPixel, x, y, width, height, type, encoderOptions) + { + if (getPixel === undefined) { getPixel = false; } + + this.snapshotArea(x, y, width, height, callback, type, encoderOptions); + + var state = this.snapshotState; + + state.getPixel = getPixel; + + CanvasSnapshot(this.canvas, state); + + state.callback = null; + + return this; + }, + /** * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. * @@ -105373,14 +107179,16 @@ var CanvasRenderer = new Class({ var frameY = cd.y; var frameWidth = frame.cutWidth; var frameHeight = frame.cutHeight; + var customPivot = frame.customPivot; + var res = frame.source.resolution; - var x = -sprite.displayOriginX + frame.x; - var y = -sprite.displayOriginY + frame.y; + var displayOriginX = sprite.displayOriginX; + var displayOriginY = sprite.displayOriginY; + + var x = -displayOriginX + frame.x; + var y = -displayOriginY + frame.y; - var fx = (sprite.flipX) ? -1 : 1; - var fy = (sprite.flipY) ? -1 : 1; - if (sprite.isCropped) { var crop = sprite._crop; @@ -105396,10 +107204,10 @@ var CanvasRenderer = new Class({ frameX = crop.cx; frameY = crop.cy; - x = -sprite.displayOriginX + crop.x; - y = -sprite.displayOriginY + crop.y; + x = -displayOriginX + crop.x; + y = -displayOriginY + crop.y; - if (fx === -1) + if (sprite.flipX) { if (x >= 0) { @@ -105411,7 +107219,7 @@ var CanvasRenderer = new Class({ } } - if (fy === -1) + if (sprite.flipY) { if (y >= 0) { @@ -105424,7 +107232,31 @@ var CanvasRenderer = new Class({ } } - spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX, sprite.scaleY); + var flipX = 1; + var flipY = 1; + + if (sprite.flipX) + { + if (!customPivot) + { + x += (-frame.realWidth + (displayOriginX * 2)); + } + + flipX = -1; + } + + // Auto-invert the flipY if this is coming from a GLTexture + if (sprite.flipY) + { + if (!customPivot) + { + y += (-frame.realHeight + (displayOriginY * 2)); + } + + flipY = -1; + } + + spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX * flipX, sprite.scaleY * flipY); camMatrix.copyFrom(camera.matrix); @@ -105453,8 +107285,6 @@ var CanvasRenderer = new Class({ calcMatrix.setToContext(ctx); - ctx.scale(fx, fy); - ctx.globalCompositeOperation = this.blendModes[sprite.blendMode]; ctx.globalAlpha = alpha; @@ -105484,7 +107314,7 @@ module.exports = CanvasRenderer; /***/ }), -/* 481 */ +/* 483 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -105493,7 +107323,7 @@ module.exports = CanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); +var CanvasPool = __webpack_require__(25); var Color = __webpack_require__(33); var GetFastValue = __webpack_require__(2); @@ -105577,7 +107407,7 @@ module.exports = CanvasSnapshot; /***/ }), -/* 482 */ +/* 484 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -105586,8 +107416,8 @@ module.exports = CanvasSnapshot; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var modes = __webpack_require__(52); -var CanvasFeatures = __webpack_require__(291); +var modes = __webpack_require__(53); +var CanvasFeatures = __webpack_require__(294); /** * Returns an array which maps the default blend modes to supported Canvas blend modes. @@ -105641,7 +107471,7 @@ module.exports = GetBlendModes; /***/ }), -/* 483 */ +/* 485 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -105651,22 +107481,24 @@ module.exports = GetBlendModes; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(112); -var CameraEvents = __webpack_require__(48); +var BaseCamera = __webpack_require__(113); +var CameraEvents = __webpack_require__(49); var Class = __webpack_require__(0); -var CONST = __webpack_require__(26); -var IsSizePowerOfTwo = __webpack_require__(117); -var ScaleEvents = __webpack_require__(89); -var SpliceOne = __webpack_require__(78); -var TextureEvents = __webpack_require__(118); +var CONST = __webpack_require__(31); +var GameEvents = __webpack_require__(18); +var IsSizePowerOfTwo = __webpack_require__(118); +var NOOP = __webpack_require__(1); +var ScaleEvents = __webpack_require__(90); +var SpliceOne = __webpack_require__(79); +var TextureEvents = __webpack_require__(119); var TransformMatrix = __webpack_require__(32); var Utils = __webpack_require__(9); -var WebGLSnapshot = __webpack_require__(484); +var WebGLSnapshot = __webpack_require__(486); // Default Pipelines -var BitmapMaskPipeline = __webpack_require__(485); -var ForwardDiffuseLightPipeline = __webpack_require__(486); -var TextureTintPipeline = __webpack_require__(226); +var BitmapMaskPipeline = __webpack_require__(487); +var ForwardDiffuseLightPipeline = __webpack_require__(488); +var TextureTintPipeline = __webpack_require__(229); /** * @callback WebGLContextCallback @@ -105697,9 +107529,6 @@ var WebGLRenderer = new Class({ function WebGLRenderer (game) { - // eslint-disable-next-line consistent-this - var renderer = this; - var gameConfig = game.config; var contextCreationConfig = { @@ -105780,24 +107609,6 @@ var WebGLRenderer = new Class({ */ this.canvas = game.canvas; - /** - * An array of functions to invoke if the WebGL context is lost. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#lostContextCallbacks - * @type {WebGLContextCallback[]} - * @since 3.0.0 - */ - this.lostContextCallbacks = []; - - /** - * An array of functions to invoke if the WebGL context is restored. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#restoredContextCallbacks - * @type {WebGLContextCallback[]} - * @since 3.0.0 - */ - this.restoredContextCallbacks = []; - /** * An array of blend modes supported by the WebGL Renderer. * @@ -105821,7 +107632,7 @@ var WebGLRenderer = new Class({ this.nativeTextures = []; /** - * Set to `true` if the WebGL context of the renderer is lost. + * This property is set to `true` if the WebGL context of the renderer is lost. * * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLost * @type {boolean} @@ -105857,7 +107668,10 @@ var WebGLRenderer = new Class({ getPixel: false, callback: null, type: 'image/png', - encoder: 0.92 + encoder: 0.92, + isFramebuffer: false, + bufferWidth: 0, + bufferHeight: 0 }; // Internal Renderer State (Textures, Framebuffers, Pipelines, Buffers, etc) @@ -105956,7 +107770,6 @@ var WebGLRenderer = new Class({ * @type {Uint32Array} * @since 3.0.0 */ - // this.currentScissor = new Uint32Array([ 0, 0, this.width, this.height ]); this.currentScissor = null; /** @@ -105968,32 +107781,25 @@ var WebGLRenderer = new Class({ */ this.scissorStack = []; - // Setup context lost and restore event listeners + /** + * The handler to invoke when the context is lost. + * This should not be changed and is set in the boot method. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLostHandler + * @type {function} + * @since 3.19.0 + */ + this.contextLostHandler = NOOP; - this.canvas.addEventListener('webglcontextlost', function (event) - { - renderer.contextLost = true; - event.preventDefault(); - - for (var index = 0; index < renderer.lostContextCallbacks.length; ++index) - { - var callback = renderer.lostContextCallbacks[index]; - callback[0].call(callback[1], renderer); - } - }, false); - - this.canvas.addEventListener('webglcontextrestored', function () - { - renderer.contextLost = false; - renderer.init(renderer.config); - for (var index = 0; index < renderer.restoredContextCallbacks.length; ++index) - { - var callback = renderer.restoredContextCallbacks[index]; - callback[0].call(callback[1], renderer); - } - }, false); - - // These are initialized post context creation + /** + * The handler to invoke when the context is restored. + * This should not be changed and is set in the boot method. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#contextRestoredHandler + * @type {function} + * @since 3.19.0 + */ + this.contextRestoredHandler = NOOP; /** * The underlying WebGL context of the renderer. @@ -106164,6 +107970,36 @@ var WebGLRenderer = new Class({ */ this.glFuncMap = null; + /** + * The `type` of the Game Object being currently rendered. + * This can be used by advanced render functions for batching look-ahead. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentType + * @type {string} + * @since 3.19.0 + */ + this.currentType = ''; + + /** + * Is the `type` of the Game Object being currently rendered different than the + * type of the object before it in the display list? I.e. it's a 'new' type. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#newType + * @type {boolean} + * @since 3.19.0 + */ + this.newType = false; + + /** + * Does the `type` of the next Game Object in the display list match that + * of the object being currently rendered? + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#nextTypeMatch + * @type {boolean} + * @since 3.19.0 + */ + this.nextTypeMatch = false; + this.init(this.config); }, @@ -106203,6 +108039,29 @@ var WebGLRenderer = new Class({ this.gl = gl; + var _this = this; + + this.contextLostHandler = function (event) + { + _this.contextLost = true; + + _this.game.events.emit(GameEvents.CONTEXT_LOST, _this); + + event.preventDefault(); + }; + + this.contextRestoredHandler = function () + { + _this.contextLost = false; + + _this.init(_this.config); + + _this.game.events.emit(GameEvents.CONTEXT_RESTORED, _this); + }; + + canvas.addEventListener('webglcontextlost', this.contextLostHandler, false); + canvas.addEventListener('webglcontextrestored', this.contextRestoredHandler, false); + // Set it back into the Game, so developers can access it from there too game.context = gl; @@ -106401,42 +108260,6 @@ var WebGLRenderer = new Class({ return this; }, - /** - * Adds a callback to be invoked when the WebGL context has been restored by the browser. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextRestored - * @since 3.0.0 - * - * @param {WebGLContextCallback} callback - The callback to be invoked on context restoration. - * @param {object} target - The context of the callback. - * - * @return {this} This WebGLRenderer instance. - */ - onContextRestored: function (callback, target) - { - this.restoredContextCallbacks.push([ callback, target ]); - - return this; - }, - - /** - * Adds a callback to be invoked when the WebGL context has been lost by the browser. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextLost - * @since 3.0.0 - * - * @param {WebGLContextCallback} callback - The callback to be invoked on context loss. - * @param {object} target - The context of the callback. - * - * @return {this} This WebGLRenderer instance. - */ - onContextLost: function (callback, target) - { - this.lostContextCallbacks.push([ callback, target ]); - - return this; - }, - /** * Checks if a WebGL extension is supported * @@ -106609,6 +108432,8 @@ var WebGLRenderer = new Class({ */ setScissor: function (x, y, width, height, drawingBufferHeight) { + if (drawingBufferHeight === undefined) { drawingBufferHeight = this.drawingBufferHeight; } + var gl = this.gl; var current = this.currentScissor; @@ -106821,12 +108646,14 @@ var WebGLRenderer = new Class({ /** * Creates a new custom blend mode for the renderer. + * + * See https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Blending_modes * * @method Phaser.Renderer.WebGL.WebGLRenderer#addBlendMode * @since 3.0.0 * - * @param {function} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. - * @param {function} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. + * @param {GLenum[]} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. + * @param {GLenum} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. * * @return {integer} The index of the new blend mode, used for referencing it in the future. */ @@ -107663,6 +109490,20 @@ var WebGLRenderer = new Class({ // Apply scissor for cam region + render background color, if not transparent this.preRenderCamera(camera); + // Nothing to render, so bail out + if (childCount === 0) + { + this.setBlendMode(CONST.BlendModes.NORMAL); + + // Applies camera effects and pops the scissor, if set + this.postRenderCamera(camera); + + return; + } + + // Reset the current type + this.currentType = ''; + var current = this.currentMask; for (var i = 0; i < childCount; i++) @@ -107694,7 +109535,19 @@ var WebGLRenderer = new Class({ mask.preRenderWebGL(this, child, camera); } + var type = child.type; + + if (type !== this.currentType) + { + this.newType = true; + this.currentType = type; + } + + this.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === this.currentType) : false; + child.renderWebGL(this, child, interpolationPercentage, camera); + + this.newType = false; } current = this.currentMask; @@ -107841,6 +109694,65 @@ var WebGLRenderer = new Class({ return this; }, + /** + * Takes a snapshot of the given area of the given frame buffer. + * + * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotFramebuffer + * @since 3.19.0 + * + * @param {WebGLFramebuffer} framebuffer - The framebuffer to grab from. + * @param {integer} bufferWidth - The width of the framebuffer. + * @param {integer} bufferHeight - The height of the framebuffer. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? + * @param {integer} [x=0] - The x coordinate to grab from. + * @param {integer} [y=0] - The y coordinate to grab from. + * @param {integer} [width=bufferWidth] - The width of the area to grab. + * @param {integer} [height=bufferHeight] - The height of the area to grab. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This WebGL Renderer. + */ + snapshotFramebuffer: function (framebuffer, bufferWidth, bufferHeight, callback, getPixel, x, y, width, height, type, encoderOptions) + { + if (getPixel === undefined) { getPixel = false; } + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = bufferWidth; } + if (height === undefined) { height = bufferHeight; } + + var currentFramebuffer = this.currentFramebuffer; + + this.snapshotArea(x, y, width, height, callback, type, encoderOptions); + + var state = this.snapshotState; + + state.getPixel = getPixel; + + state.isFramebuffer = true; + state.bufferWidth = bufferWidth; + state.bufferHeight = bufferHeight; + + this.setFramebuffer(framebuffer); + + WebGLSnapshot(this.canvas, state); + + this.setFramebuffer(currentFramebuffer); + + state.callback = null; + state.isFramebuffer = false; + + return this; + }, + /** * Creates a WebGL Texture based on the given canvas element. * @@ -108281,6 +110193,14 @@ var WebGLRenderer = new Class({ destroy: function () { // Clear-up anything that should be cleared :) + + for (var i = 0; i < this.nativeTextures.length; i++) + { + this.gl.deleteTexture(this.nativeTextures[i]); + } + + this.nativeTextures = []; + for (var key in this.pipelines) { this.pipelines[key].destroy(); @@ -108288,21 +110208,23 @@ var WebGLRenderer = new Class({ delete this.pipelines[key]; } - for (var index = 0; index < this.nativeTextures.length; index++) - { - this.deleteTexture(this.nativeTextures[index]); + this.defaultCamera.destroy(); - delete this.nativeTextures[index]; - } + this.currentMask = null; + this.currentCameraMask = null; - delete this.gl; - delete this.game; + this.canvas.removeEventListener('webglcontextlost', this.contextLostHandler, false); + this.canvas.removeEventListener('webglcontextrestored', this.contextRestoredHandler, false); - this.maskStack.length = 0; + this.game = null; + this.gl = null; + this.canvas = null; + + this.maskStack = []; this.contextLost = true; + this.extensions = {}; - this.nativeTextures.length = 0; } }); @@ -108311,7 +110233,7 @@ module.exports = WebGLRenderer; /***/ }), -/* 484 */ +/* 486 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -108320,7 +110242,7 @@ module.exports = WebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); +var CanvasPool = __webpack_require__(25); var Color = __webpack_require__(33); var GetFastValue = __webpack_require__(2); @@ -108345,23 +110267,34 @@ var WebGLSnapshot = function (sourceCanvas, config) var encoderOptions = GetFastValue(config, 'encoder', 0.92); var x = GetFastValue(config, 'x', 0); var y = GetFastValue(config, 'y', 0); - var width = GetFastValue(config, 'width', gl.drawingBufferWidth); - var height = GetFastValue(config, 'height', gl.drawingBufferHeight); + var getPixel = GetFastValue(config, 'getPixel', false); + var isFramebuffer = GetFastValue(config, 'isFramebuffer', false); + + var bufferWidth = (isFramebuffer) ? GetFastValue(config, 'bufferWidth', 1) : gl.drawingBufferWidth; + var bufferHeight = (isFramebuffer) ? GetFastValue(config, 'bufferHeight', 1) : gl.drawingBufferHeight; + if (getPixel) { var pixel = new Uint8Array(4); - gl.readPixels(x, gl.drawingBufferHeight - y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); + var destY = (isFramebuffer) ? y : bufferHeight - y; + + gl.readPixels(x, destY, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3] / 255)); } else { - var pixels = new Uint8Array(width * height * 4); + var width = GetFastValue(config, 'width', bufferWidth); + var height = GetFastValue(config, 'height', bufferHeight); - gl.readPixels(x, gl.drawingBufferHeight - y - height, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + var total = width * height * 4; + + var pixels = new Uint8Array(total); + + gl.readPixels(x, bufferHeight - y - height, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); var canvas = CanvasPool.createWebGL(this, width, height); var ctx = canvas.getContext('2d'); @@ -108369,13 +110302,13 @@ var WebGLSnapshot = function (sourceCanvas, config) var imageData = ctx.getImageData(0, 0, width, height); var data = imageData.data; - + for (var py = 0; py < height; py++) { for (var px = 0; px < width; px++) { var sourceIndex = ((height - py) * width + px) * 4; - var destIndex = (py * width + px) * 4; + var destIndex = (isFramebuffer) ? total - ((py * width + (width - px)) * 4) : (py * width + px) * 4; data[destIndex + 0] = pixels[sourceIndex + 0]; data[destIndex + 1] = pixels[sourceIndex + 1]; @@ -108383,7 +110316,7 @@ var WebGLSnapshot = function (sourceCanvas, config) data[destIndex + 3] = pixels[sourceIndex + 3]; } } - + ctx.putImageData(imageData, 0, 0); var image = new Image(); @@ -108410,7 +110343,7 @@ module.exports = WebGLSnapshot; /***/ }), -/* 485 */ +/* 487 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -108421,9 +110354,9 @@ module.exports = WebGLSnapshot; */ var Class = __webpack_require__(0); -var ShaderSourceFS = __webpack_require__(732); -var ShaderSourceVS = __webpack_require__(733); -var WebGLPipeline = __webpack_require__(225); +var ShaderSourceFS = __webpack_require__(737); +var ShaderSourceVS = __webpack_require__(738); +var WebGLPipeline = __webpack_require__(228); /** * @classdesc @@ -108673,7 +110606,7 @@ module.exports = BitmapMaskPipeline; /***/ }), -/* 486 */ +/* 488 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -108684,8 +110617,8 @@ module.exports = BitmapMaskPipeline; */ var Class = __webpack_require__(0); -var ShaderSourceFS = __webpack_require__(734); -var TextureTintPipeline = __webpack_require__(226); +var ShaderSourceFS = __webpack_require__(739); +var TextureTintPipeline = __webpack_require__(229); var LIGHT_COUNT = 10; @@ -109175,7 +111108,7 @@ module.exports = ForwardDiffuseLightPipeline; /***/ }), -/* 487 */ +/* 489 */ /***/ (function(module, exports) { /** @@ -109925,23 +111858,23 @@ module.exports = ModelViewProjection; /***/ }), -/* 488 */, -/* 489 */, -/* 490 */ +/* 490 */, +/* 491 */, +/* 492 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(491); -__webpack_require__(492); __webpack_require__(493); __webpack_require__(494); __webpack_require__(495); __webpack_require__(496); __webpack_require__(497); __webpack_require__(498); +__webpack_require__(499); +__webpack_require__(500); /***/ }), -/* 491 */ +/* 493 */ /***/ (function(module, exports) { /** @@ -109981,7 +111914,7 @@ if (!Array.prototype.forEach) /***/ }), -/* 492 */ +/* 494 */ /***/ (function(module, exports) { /** @@ -109997,7 +111930,7 @@ if (!Array.isArray) /***/ }), -/* 493 */ +/* 495 */ /***/ (function(module, exports) { /* Copyright 2013 Chris Wilson @@ -110184,7 +112117,7 @@ BiquadFilterNode.type and OscillatorNode.type. /***/ }), -/* 494 */ +/* 496 */ /***/ (function(module, exports) { /** @@ -110199,7 +112132,7 @@ if (!window.console) /***/ }), -/* 495 */ +/* 497 */ /***/ (function(module, exports) { // ES6 Math.trunc - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc @@ -110211,7 +112144,7 @@ if (!Math.trunc) { /***/ }), -/* 496 */ +/* 498 */ /***/ (function(module, exports) { /** @@ -110248,7 +112181,7 @@ if (!Math.trunc) { /***/ }), -/* 497 */ +/* 499 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {// References: @@ -110318,10 +112251,10 @@ if (!global.cancelAnimationFrame) { }; } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(222))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(225))) /***/ }), -/* 498 */ +/* 500 */ /***/ (function(module, exports) { /** @@ -110374,7 +112307,7 @@ if (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'o /***/ }), -/* 499 */ +/* 501 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110415,7 +112348,7 @@ module.exports = Angle; /***/ }), -/* 500 */ +/* 502 */ /***/ (function(module, exports) { /** @@ -110454,7 +112387,7 @@ module.exports = Call; /***/ }), -/* 501 */ +/* 503 */ /***/ (function(module, exports) { /** @@ -110512,7 +112445,7 @@ module.exports = GetFirst; /***/ }), -/* 502 */ +/* 504 */ /***/ (function(module, exports) { /** @@ -110570,7 +112503,7 @@ module.exports = GetLast; /***/ }), -/* 503 */ +/* 505 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110579,11 +112512,11 @@ module.exports = GetLast; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AlignIn = __webpack_require__(230); -var CONST = __webpack_require__(143); +var AlignIn = __webpack_require__(233); +var CONST = __webpack_require__(144); var GetFastValue = __webpack_require__(2); var NOOP = __webpack_require__(1); -var Zone = __webpack_require__(106); +var Zone = __webpack_require__(107); var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1); @@ -110680,7 +112613,7 @@ module.exports = GridAlign; /***/ }), -/* 504 */ +/* 506 */ /***/ (function(module, exports) { /** @@ -110707,7 +112640,7 @@ module.exports = 'add'; /***/ }), -/* 505 */ +/* 507 */ /***/ (function(module, exports) { /** @@ -110735,7 +112668,7 @@ module.exports = 'complete'; /***/ }), -/* 506 */ +/* 508 */ /***/ (function(module, exports) { /** @@ -110762,7 +112695,7 @@ module.exports = 'repeat'; /***/ }), -/* 507 */ +/* 509 */ /***/ (function(module, exports) { /** @@ -110790,7 +112723,7 @@ module.exports = 'restart'; /***/ }), -/* 508 */ +/* 510 */ /***/ (function(module, exports) { /** @@ -110818,7 +112751,7 @@ module.exports = 'start'; /***/ }), -/* 509 */ +/* 511 */ /***/ (function(module, exports) { /** @@ -110842,7 +112775,7 @@ module.exports = 'pauseall'; /***/ }), -/* 510 */ +/* 512 */ /***/ (function(module, exports) { /** @@ -110866,7 +112799,7 @@ module.exports = 'remove'; /***/ }), -/* 511 */ +/* 513 */ /***/ (function(module, exports) { /** @@ -110889,7 +112822,7 @@ module.exports = 'resumeall'; /***/ }), -/* 512 */ +/* 514 */ /***/ (function(module, exports) { /** @@ -110918,7 +112851,7 @@ module.exports = 'animationcomplete'; /***/ }), -/* 513 */ +/* 515 */ /***/ (function(module, exports) { /** @@ -110946,7 +112879,7 @@ module.exports = 'animationcomplete-'; /***/ }), -/* 514 */ +/* 516 */ /***/ (function(module, exports) { /** @@ -110975,7 +112908,7 @@ module.exports = 'animationrepeat-'; /***/ }), -/* 515 */ +/* 517 */ /***/ (function(module, exports) { /** @@ -111003,7 +112936,7 @@ module.exports = 'animationrestart-'; /***/ }), -/* 516 */ +/* 518 */ /***/ (function(module, exports) { /** @@ -111031,7 +112964,7 @@ module.exports = 'animationstart-'; /***/ }), -/* 517 */ +/* 519 */ /***/ (function(module, exports) { /** @@ -111060,7 +112993,7 @@ module.exports = 'animationupdate-'; /***/ }), -/* 518 */ +/* 520 */ /***/ (function(module, exports) { /** @@ -111090,7 +113023,7 @@ module.exports = 'animationrepeat'; /***/ }), -/* 519 */ +/* 521 */ /***/ (function(module, exports) { /** @@ -111119,7 +113052,7 @@ module.exports = 'animationrestart'; /***/ }), -/* 520 */ +/* 522 */ /***/ (function(module, exports) { /** @@ -111148,7 +113081,7 @@ module.exports = 'animationstart'; /***/ }), -/* 521 */ +/* 523 */ /***/ (function(module, exports) { /** @@ -111178,7 +113111,7 @@ module.exports = 'animationupdate'; /***/ }), -/* 522 */ +/* 524 */ /***/ (function(module, exports) { /** @@ -111327,7 +113260,7 @@ module.exports = ComputedSize; /***/ }), -/* 523 */ +/* 525 */ /***/ (function(module, exports) { /** @@ -111452,7 +113385,7 @@ module.exports = Crop; /***/ }), -/* 524 */ +/* 526 */ /***/ (function(module, exports) { /** @@ -111616,7 +113549,7 @@ module.exports = Flip; /***/ }), -/* 525 */ +/* 527 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -111625,9 +113558,9 @@ module.exports = Flip; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); -var RotateAround = __webpack_require__(251); -var Vector2 = __webpack_require__(4); +var Rectangle = __webpack_require__(11); +var RotateAround = __webpack_require__(254); +var Vector2 = __webpack_require__(3); /** * Provides methods used for obtaining the bounds of a Game Object. @@ -111975,7 +113908,383 @@ module.exports = GetBounds; /***/ }), -/* 526 */ +/* 528 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Blur Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps + * tab, or if they simply remove focus from the browser to another app. + * + * @event Phaser.Core.Events#BLUR + * @since 3.0.0 + */ +module.exports = 'blur'; + + +/***/ }), +/* 529 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Boot Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. + * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. + * + * @event Phaser.Core.Events#BOOT + * @since 3.0.0 + */ +module.exports = 'boot'; + + +/***/ }), +/* 530 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Context Lost Event. + * + * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Lost event from the browser. + * + * The partner event is `CONTEXT_RESTORED`. + * + * @event Phaser.Core.Events#CONTEXT_LOST + * @since 3.19.0 + */ +module.exports = 'contextlost'; + + +/***/ }), +/* 531 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Context Restored Event. + * + * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Restored event from the browser. + * + * The partner event is `CONTEXT_LOST`. + * + * @event Phaser.Core.Events#CONTEXT_RESTORED + * @since 3.19.0 + */ +module.exports = 'contextrestored'; + + +/***/ }), +/* 532 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Destroy Event. + * + * This event is dispatched when the game instance has been told to destroy itself. + * Lots of internal systems listen to this event in order to clear themselves out. + * Custom plugins and game code should also do the same. + * + * @event Phaser.Core.Events#DESTROY + * @since 3.0.0 + */ +module.exports = 'destroy'; + + +/***/ }), +/* 533 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Focus Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. + * + * @event Phaser.Core.Events#FOCUS + * @since 3.0.0 + */ +module.exports = 'focus'; + + +/***/ }), +/* 534 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Hidden Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted. + * + * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which + * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something + * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) + * + * @event Phaser.Core.Events#HIDDEN + * @since 3.0.0 + */ +module.exports = 'hidden'; + + +/***/ }), +/* 535 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pause Event. + * + * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. + * + * @event Phaser.Core.Events#PAUSE + * @since 3.0.0 + */ +module.exports = 'pause'; + + +/***/ }), +/* 536 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Post-Render Event. + * + * This event is dispatched right at the end of the render process. + * + * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. + * Use it for any last minute post-processing before the next game step begins. + * + * @event Phaser.Core.Events#POST_RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. + */ +module.exports = 'postrender'; + + +/***/ }), +/* 537 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Post-Step Event. + * + * This event is dispatched after the Scene Manager has updated. + * Hook into it from plugins or systems that need to do things before the render starts. + * + * @event Phaser.Core.Events#POST_STEP + * @since 3.0.0 + * + * @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 = 'poststep'; + + +/***/ }), +/* 538 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pre-Render Event. + * + * This event is dispatched immediately before any of the Scenes have started to render. + * + * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. + * + * @event Phaser.Core.Events#PRE_RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. + */ +module.exports = 'prerender'; + + +/***/ }), +/* 539 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pre-Step Event. + * + * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. + * Hook into it from plugins or systems that need to update before the Scene Manager does. + * + * @event Phaser.Core.Events#PRE_STEP + * @since 3.0.0 + * + * @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 = 'prestep'; + + +/***/ }), +/* 540 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Ready Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, + * and all local systems are now able to start. + * + * @event Phaser.Core.Events#READY + * @since 3.0.0 + */ +module.exports = 'ready'; + + +/***/ }), +/* 541 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Resume Event. + * + * This event is dispatched when the game loop leaves a paused state and resumes running. + * + * @event Phaser.Core.Events#RESUME + * @since 3.0.0 + */ +module.exports = 'resume'; + + +/***/ }), +/* 542 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Step Event. + * + * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. + * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. + * + * @event Phaser.Core.Events#STEP + * @since 3.0.0 + * + * @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 = 'step'; + + +/***/ }), +/* 543 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Visible Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a visible state, previously having been hidden. + * + * Only browsers that support the Visibility API will cause this event to be emitted. + * + * @event Phaser.Core.Events#VISIBLE + * @since 3.0.0 + */ +module.exports = 'visible'; + + +/***/ }), +/* 544 */ /***/ (function(module, exports) { /** @@ -112166,8 +114475,8 @@ var Origin = { */ updateDisplayOrigin: function () { - this._displayOriginX = Math.round(this.originX * this.width); - this._displayOriginY = Math.round(this.originY * this.height); + this._displayOriginX = this.originX * this.width; + this._displayOriginY = this.originY * this.height; return this; } @@ -112178,7 +114487,7 @@ module.exports = Origin; /***/ }), -/* 527 */ +/* 545 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -112188,10 +114497,10 @@ module.exports = Origin; */ var DegToRad = __webpack_require__(35); -var GetBoolean = __webpack_require__(87); -var GetValue = __webpack_require__(6); -var TWEEN_CONST = __webpack_require__(88); -var Vector2 = __webpack_require__(4); +var GetBoolean = __webpack_require__(88); +var GetValue = __webpack_require__(5); +var TWEEN_CONST = __webpack_require__(89); +var Vector2 = __webpack_require__(3); /** * Provides methods used for managing a Game Object following a Path. @@ -112575,7 +114884,7 @@ module.exports = PathFollower; /***/ }), -/* 528 */ +/* 546 */ /***/ (function(module, exports) { /** @@ -112762,7 +115071,7 @@ module.exports = Size; /***/ }), -/* 529 */ +/* 547 */ /***/ (function(module, exports) { /** @@ -112892,7 +115201,7 @@ module.exports = Texture; /***/ }), -/* 530 */ +/* 548 */ /***/ (function(module, exports) { /** @@ -113100,7 +115409,7 @@ module.exports = TextureCrop; /***/ }), -/* 531 */ +/* 549 */ /***/ (function(module, exports) { /** @@ -113401,6 +115710,7 @@ var Tint = { /** * 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 {integer} @@ -113439,7 +115749,7 @@ module.exports = Tint; /***/ }), -/* 532 */ +/* 550 */ /***/ (function(module, exports) { /** @@ -113471,7 +115781,7 @@ module.exports = 'changedata'; /***/ }), -/* 533 */ +/* 551 */ /***/ (function(module, exports) { /** @@ -113502,7 +115812,7 @@ module.exports = 'changedata-'; /***/ }), -/* 534 */ +/* 552 */ /***/ (function(module, exports) { /** @@ -113530,7 +115840,7 @@ module.exports = 'removedata'; /***/ }), -/* 535 */ +/* 553 */ /***/ (function(module, exports) { /** @@ -113558,7 +115868,7 @@ module.exports = 'setdata'; /***/ }), -/* 536 */ +/* 554 */ /***/ (function(module, exports) { /** @@ -113583,7 +115893,7 @@ module.exports = 'destroy'; /***/ }), -/* 537 */ +/* 555 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113624,7 +115934,7 @@ module.exports = IncAlpha; /***/ }), -/* 538 */ +/* 556 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113665,7 +115975,7 @@ module.exports = IncX; /***/ }), -/* 539 */ +/* 557 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113712,7 +116022,7 @@ module.exports = IncXY; /***/ }), -/* 540 */ +/* 558 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113753,7 +116063,7 @@ module.exports = IncY; /***/ }), -/* 541 */ +/* 559 */ /***/ (function(module, exports) { /** @@ -113802,7 +116112,7 @@ module.exports = PlaceOnCircle; /***/ }), -/* 542 */ +/* 560 */ /***/ (function(module, exports) { /** @@ -113854,7 +116164,7 @@ module.exports = PlaceOnEllipse; /***/ }), -/* 543 */ +/* 561 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113863,7 +116173,7 @@ module.exports = PlaceOnEllipse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoints = __webpack_require__(148); +var GetPoints = __webpack_require__(149); /** * Positions an array of Game Objects on evenly spaced points of a Line. @@ -113898,7 +116208,7 @@ module.exports = PlaceOnLine; /***/ }), -/* 544 */ +/* 562 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113907,9 +116217,9 @@ module.exports = PlaceOnLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MarchingAnts = __webpack_require__(260); -var RotateLeft = __webpack_require__(261); -var RotateRight = __webpack_require__(262); +var MarchingAnts = __webpack_require__(263); +var RotateLeft = __webpack_require__(264); +var RotateRight = __webpack_require__(265); /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. @@ -113956,7 +116266,7 @@ module.exports = PlaceOnRectangle; /***/ }), -/* 545 */ +/* 563 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113965,7 +116275,7 @@ module.exports = PlaceOnRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BresenhamPoints = __webpack_require__(263); +var BresenhamPoints = __webpack_require__(266); /** * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. @@ -114017,7 +116327,7 @@ module.exports = PlaceOnTriangle; /***/ }), -/* 546 */ +/* 564 */ /***/ (function(module, exports) { /** @@ -114054,7 +116364,7 @@ module.exports = PlayAnimation; /***/ }), -/* 547 */ +/* 565 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114063,7 +116373,7 @@ module.exports = PlayAnimation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(145); +var Random = __webpack_require__(146); /** * Takes an array of Game Objects and positions them at random locations within the Circle. @@ -114094,7 +116404,7 @@ module.exports = RandomCircle; /***/ }), -/* 548 */ +/* 566 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114103,7 +116413,7 @@ module.exports = RandomCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(152); +var Random = __webpack_require__(153); /** * Takes an array of Game Objects and positions them at random locations within the Ellipse. @@ -114134,7 +116444,7 @@ module.exports = RandomEllipse; /***/ }), -/* 549 */ +/* 567 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114143,7 +116453,7 @@ module.exports = RandomEllipse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(149); +var Random = __webpack_require__(150); /** * Takes an array of Game Objects and positions them at random locations on the Line. @@ -114174,7 +116484,7 @@ module.exports = RandomLine; /***/ }), -/* 550 */ +/* 568 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114183,7 +116493,7 @@ module.exports = RandomLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(150); +var Random = __webpack_require__(151); /** * Takes an array of Game Objects and positions them at random locations within the Rectangle. @@ -114212,7 +116522,7 @@ module.exports = RandomRectangle; /***/ }), -/* 551 */ +/* 569 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114221,7 +116531,7 @@ module.exports = RandomRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(153); +var Random = __webpack_require__(154); /** * Takes an array of Game Objects and positions them at random locations within the Triangle. @@ -114252,7 +116562,7 @@ module.exports = RandomTriangle; /***/ }), -/* 552 */ +/* 570 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114293,7 +116603,7 @@ module.exports = Rotate; /***/ }), -/* 553 */ +/* 571 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114302,8 +116612,8 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundDistance = __webpack_require__(154); -var DistanceBetween = __webpack_require__(57); +var RotateAroundDistance = __webpack_require__(155); +var DistanceBetween = __webpack_require__(58); /** * Rotates each item around the given point by the given angle. @@ -114339,7 +116649,7 @@ module.exports = RotateAround; /***/ }), -/* 554 */ +/* 572 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114348,7 +116658,7 @@ module.exports = RotateAround; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathRotateAroundDistance = __webpack_require__(154); +var MathRotateAroundDistance = __webpack_require__(155); /** * Rotates an array of Game Objects around a point by the given angle and distance. @@ -114388,7 +116698,7 @@ module.exports = RotateAroundDistance; /***/ }), -/* 555 */ +/* 573 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114429,7 +116739,7 @@ module.exports = ScaleX; /***/ }), -/* 556 */ +/* 574 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114476,7 +116786,7 @@ module.exports = ScaleXY; /***/ }), -/* 557 */ +/* 575 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114517,7 +116827,7 @@ module.exports = ScaleY; /***/ }), -/* 558 */ +/* 576 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114558,7 +116868,7 @@ module.exports = SetAlpha; /***/ }), -/* 559 */ +/* 577 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114598,7 +116908,7 @@ module.exports = SetBlendMode; /***/ }), -/* 560 */ +/* 578 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114639,7 +116949,7 @@ module.exports = SetDepth; /***/ }), -/* 561 */ +/* 579 */ /***/ (function(module, exports) { /** @@ -114678,7 +116988,7 @@ module.exports = SetHitArea; /***/ }), -/* 562 */ +/* 580 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114725,7 +117035,7 @@ module.exports = SetOrigin; /***/ }), -/* 563 */ +/* 581 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114766,7 +117076,7 @@ module.exports = SetRotation; /***/ }), -/* 564 */ +/* 582 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114813,7 +117123,7 @@ module.exports = SetScale; /***/ }), -/* 565 */ +/* 583 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114854,7 +117164,7 @@ module.exports = SetScaleX; /***/ }), -/* 566 */ +/* 584 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114895,7 +117205,7 @@ module.exports = SetScaleY; /***/ }), -/* 567 */ +/* 585 */ /***/ (function(module, exports) { /** @@ -114934,7 +117244,7 @@ module.exports = SetTint; /***/ }), -/* 568 */ +/* 586 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114972,7 +117282,7 @@ module.exports = SetVisible; /***/ }), -/* 569 */ +/* 587 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115013,7 +117323,7 @@ module.exports = SetX; /***/ }), -/* 570 */ +/* 588 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115060,7 +117370,7 @@ module.exports = SetXY; /***/ }), -/* 571 */ +/* 589 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115101,7 +117411,7 @@ module.exports = SetY; /***/ }), -/* 572 */ +/* 590 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115110,7 +117420,7 @@ module.exports = SetY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector2 = __webpack_require__(4); +var Vector2 = __webpack_require__(3); /** * Iterate through the items array changing the position of each element to be that of the element that came before @@ -115231,7 +117541,7 @@ module.exports = ShiftPosition; /***/ }), -/* 573 */ +/* 591 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115240,7 +117550,7 @@ module.exports = ShiftPosition; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayShuffle = __webpack_require__(111); +var ArrayShuffle = __webpack_require__(112); /** * Shuffles the array in place. The shuffled array is both modified and returned. @@ -115264,7 +117574,7 @@ module.exports = Shuffle; /***/ }), -/* 574 */ +/* 592 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115273,7 +117583,7 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathSmootherStep = __webpack_require__(155); +var MathSmootherStep = __webpack_require__(156); /** * Smootherstep is a sigmoid-like interpolation and clamping function. @@ -115322,7 +117632,7 @@ module.exports = SmootherStep; /***/ }), -/* 575 */ +/* 593 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115331,7 +117641,7 @@ module.exports = SmootherStep; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathSmoothStep = __webpack_require__(156); +var MathSmoothStep = __webpack_require__(157); /** * Smoothstep is a sigmoid-like interpolation and clamping function. @@ -115380,7 +117690,7 @@ module.exports = SmoothStep; /***/ }), -/* 576 */ +/* 594 */ /***/ (function(module, exports) { /** @@ -115443,7 +117753,7 @@ module.exports = Spread; /***/ }), -/* 577 */ +/* 595 */ /***/ (function(module, exports) { /** @@ -115479,7 +117789,7 @@ module.exports = ToggleVisible; /***/ }), -/* 578 */ +/* 596 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115489,7 +117799,7 @@ module.exports = ToggleVisible; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Wrap = __webpack_require__(56); +var Wrap = __webpack_require__(57); /** * Wrap each item's coordinates within a rectangle's area. @@ -115528,7 +117838,7 @@ module.exports = WrapInRectangle; /***/ }), -/* 579 */ +/* 597 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115543,346 +117853,16 @@ module.exports = WrapInRectangle; module.exports = { - Animation: __webpack_require__(146), - AnimationFrame: __webpack_require__(246), - AnimationManager: __webpack_require__(264), - Events: __webpack_require__(107) + Animation: __webpack_require__(147), + AnimationFrame: __webpack_require__(249), + AnimationManager: __webpack_require__(267), + Events: __webpack_require__(108) }; /***/ }), -/* 580 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Blur Event. - * - * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded - * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps - * tab, or if they simply remove focus from the browser to another app. - * - * @event Phaser.Core.Events#BLUR - * @since 3.0.0 - */ -module.exports = 'blur'; - - -/***/ }), -/* 581 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Boot Event. - * - * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. - * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. - * - * @event Phaser.Core.Events#BOOT - * @since 3.0.0 - */ -module.exports = 'boot'; - - -/***/ }), -/* 582 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Destroy Event. - * - * This event is dispatched when the game instance has been told to destroy itself. - * Lots of internal systems listen to this event in order to clear themselves out. - * Custom plugins and game code should also do the same. - * - * @event Phaser.Core.Events#DESTROY - * @since 3.0.0 - */ -module.exports = 'destroy'; - - -/***/ }), -/* 583 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Focus Event. - * - * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded - * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. - * - * @event Phaser.Core.Events#FOCUS - * @since 3.0.0 - */ -module.exports = 'focus'; - - -/***/ }), -/* 584 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Hidden Event. - * - * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded - * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted. - * - * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which - * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something - * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) - * - * @event Phaser.Core.Events#HIDDEN - * @since 3.0.0 - */ -module.exports = 'hidden'; - - -/***/ }), -/* 585 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Pause Event. - * - * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. - * - * @event Phaser.Core.Events#PAUSE - * @since 3.0.0 - */ -module.exports = 'pause'; - - -/***/ }), -/* 586 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Post-Render Event. - * - * This event is dispatched right at the end of the render process. - * - * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. - * Use it for any last minute post-processing before the next game step begins. - * - * @event Phaser.Core.Events#POST_RENDER - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. - */ -module.exports = 'postrender'; - - -/***/ }), -/* 587 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Post-Step Event. - * - * This event is dispatched after the Scene Manager has updated. - * Hook into it from plugins or systems that need to do things before the render starts. - * - * @event Phaser.Core.Events#POST_STEP - * @since 3.0.0 - * - * @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 = 'poststep'; - - -/***/ }), -/* 588 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Pre-Render Event. - * - * This event is dispatched immediately before any of the Scenes have started to render. - * - * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. - * - * @event Phaser.Core.Events#PRE_RENDER - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. - */ -module.exports = 'prerender'; - - -/***/ }), -/* 589 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Pre-Step Event. - * - * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. - * Hook into it from plugins or systems that need to update before the Scene Manager does. - * - * @event Phaser.Core.Events#PRE_STEP - * @since 3.0.0 - * - * @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 = 'prestep'; - - -/***/ }), -/* 590 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Ready Event. - * - * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, - * and all local systems are now able to start. - * - * @event Phaser.Core.Events#READY - * @since 3.0.0 - */ -module.exports = 'ready'; - - -/***/ }), -/* 591 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Resume Event. - * - * This event is dispatched when the game loop leaves a paused state and resumes running. - * - * @event Phaser.Core.Events#RESUME - * @since 3.0.0 - */ -module.exports = 'resume'; - - -/***/ }), -/* 592 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Step Event. - * - * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. - * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. - * - * @event Phaser.Core.Events#STEP - * @since 3.0.0 - * - * @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 = 'step'; - - -/***/ }), -/* 593 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Visible Event. - * - * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded - * enters a visible state, previously having been hidden. - * - * Only browsers that support the Visibility API will cause this event to be emitted. - * - * @event Phaser.Core.Events#VISIBLE - * @since 3.0.0 - */ -module.exports = 'visible'; - - -/***/ }), -/* 594 */ +/* 598 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115897,15 +117877,15 @@ module.exports = 'visible'; module.exports = { - BaseCache: __webpack_require__(265), - CacheManager: __webpack_require__(267), - Events: __webpack_require__(266) + BaseCache: __webpack_require__(268), + CacheManager: __webpack_require__(270), + Events: __webpack_require__(269) }; /***/ }), -/* 595 */ +/* 599 */ /***/ (function(module, exports) { /** @@ -115930,7 +117910,7 @@ module.exports = 'add'; /***/ }), -/* 596 */ +/* 600 */ /***/ (function(module, exports) { /** @@ -115955,7 +117935,7 @@ module.exports = 'remove'; /***/ }), -/* 597 */ +/* 601 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115974,14 +117954,14 @@ module.exports = 'remove'; module.exports = { - Controls: __webpack_require__(598), - Scene2D: __webpack_require__(601) + Controls: __webpack_require__(602), + Scene2D: __webpack_require__(605) }; /***/ }), -/* 598 */ +/* 602 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115996,14 +117976,14 @@ module.exports = { module.exports = { - FixedKeyControl: __webpack_require__(599), - SmoothedKeyControl: __webpack_require__(600) + FixedKeyControl: __webpack_require__(603), + SmoothedKeyControl: __webpack_require__(604) }; /***/ }), -/* 599 */ +/* 603 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116013,7 +117993,7 @@ module.exports = { */ var Class = __webpack_require__(0); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** * @classdesc @@ -116309,7 +118289,7 @@ module.exports = FixedKeyControl; /***/ }), -/* 600 */ +/* 604 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116319,7 +118299,7 @@ module.exports = FixedKeyControl; */ var Class = __webpack_require__(0); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** * @classdesc @@ -116760,9 +118740,9 @@ var SmoothedKeyControl = new Class({ { cam.zoom += this._zoom; - if (cam.zoom < 0.1) + if (cam.zoom < 0.001) { - cam.zoom = 0.1; + cam.zoom = 0.001; } } }, @@ -116792,7 +118772,7 @@ module.exports = SmoothedKeyControl; /***/ }), -/* 601 */ +/* 605 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116807,16 +118787,16 @@ module.exports = SmoothedKeyControl; module.exports = { - Camera: __webpack_require__(268), - CameraManager: __webpack_require__(654), - Effects: __webpack_require__(276), - Events: __webpack_require__(48) + Camera: __webpack_require__(271), + CameraManager: __webpack_require__(658), + Effects: __webpack_require__(279), + Events: __webpack_require__(49) }; /***/ }), -/* 602 */ +/* 606 */ /***/ (function(module, exports) { /** @@ -116839,7 +118819,7 @@ module.exports = 'cameradestroy'; /***/ }), -/* 603 */ +/* 607 */ /***/ (function(module, exports) { /** @@ -116865,7 +118845,7 @@ module.exports = 'camerafadeincomplete'; /***/ }), -/* 604 */ +/* 608 */ /***/ (function(module, exports) { /** @@ -116895,7 +118875,7 @@ module.exports = 'camerafadeinstart'; /***/ }), -/* 605 */ +/* 609 */ /***/ (function(module, exports) { /** @@ -116921,7 +118901,7 @@ module.exports = 'camerafadeoutcomplete'; /***/ }), -/* 606 */ +/* 610 */ /***/ (function(module, exports) { /** @@ -116951,7 +118931,7 @@ module.exports = 'camerafadeoutstart'; /***/ }), -/* 607 */ +/* 611 */ /***/ (function(module, exports) { /** @@ -116975,7 +118955,7 @@ module.exports = 'cameraflashcomplete'; /***/ }), -/* 608 */ +/* 612 */ /***/ (function(module, exports) { /** @@ -117003,7 +118983,7 @@ module.exports = 'cameraflashstart'; /***/ }), -/* 609 */ +/* 613 */ /***/ (function(module, exports) { /** @@ -117027,7 +119007,7 @@ module.exports = 'camerapancomplete'; /***/ }), -/* 610 */ +/* 614 */ /***/ (function(module, exports) { /** @@ -117054,7 +119034,7 @@ module.exports = 'camerapanstart'; /***/ }), -/* 611 */ +/* 615 */ /***/ (function(module, exports) { /** @@ -117080,7 +119060,7 @@ module.exports = 'postrender'; /***/ }), -/* 612 */ +/* 616 */ /***/ (function(module, exports) { /** @@ -117106,7 +119086,7 @@ module.exports = 'prerender'; /***/ }), -/* 613 */ +/* 617 */ /***/ (function(module, exports) { /** @@ -117130,7 +119110,7 @@ module.exports = 'camerashakecomplete'; /***/ }), -/* 614 */ +/* 618 */ /***/ (function(module, exports) { /** @@ -117156,7 +119136,7 @@ module.exports = 'camerashakestart'; /***/ }), -/* 615 */ +/* 619 */ /***/ (function(module, exports) { /** @@ -117180,7 +119160,7 @@ module.exports = 'camerazoomcomplete'; /***/ }), -/* 616 */ +/* 620 */ /***/ (function(module, exports) { /** @@ -117206,7 +119186,7 @@ module.exports = 'camerazoomstart'; /***/ }), -/* 617 */ +/* 621 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117215,9 +119195,9 @@ module.exports = 'camerazoomstart'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(48); +var Events = __webpack_require__(49); /** * @classdesc @@ -117594,7 +119574,7 @@ module.exports = Fade; /***/ }), -/* 618 */ +/* 622 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117603,9 +119583,9 @@ module.exports = Fade; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(48); +var Events = __webpack_require__(49); /** * @classdesc @@ -117945,7 +119925,7 @@ module.exports = Flash; /***/ }), -/* 619 */ +/* 623 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117954,11 +119934,11 @@ module.exports = Flash; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var EaseMap = __webpack_require__(163); -var Events = __webpack_require__(48); -var Vector2 = __webpack_require__(4); +var EaseMap = __webpack_require__(164); +var Events = __webpack_require__(49); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -118270,7 +120250,7 @@ module.exports = Pan; /***/ }), -/* 620 */ +/* 624 */ /***/ (function(module, exports) { /** @@ -118301,7 +120281,7 @@ module.exports = In; /***/ }), -/* 621 */ +/* 625 */ /***/ (function(module, exports) { /** @@ -118332,7 +120312,7 @@ module.exports = Out; /***/ }), -/* 622 */ +/* 626 */ /***/ (function(module, exports) { /** @@ -118372,7 +120352,7 @@ module.exports = InOut; /***/ }), -/* 623 */ +/* 627 */ /***/ (function(module, exports) { /** @@ -118417,7 +120397,7 @@ module.exports = In; /***/ }), -/* 624 */ +/* 628 */ /***/ (function(module, exports) { /** @@ -118460,7 +120440,7 @@ module.exports = Out; /***/ }), -/* 625 */ +/* 629 */ /***/ (function(module, exports) { /** @@ -118524,7 +120504,7 @@ module.exports = InOut; /***/ }), -/* 626 */ +/* 630 */ /***/ (function(module, exports) { /** @@ -118552,7 +120532,7 @@ module.exports = In; /***/ }), -/* 627 */ +/* 631 */ /***/ (function(module, exports) { /** @@ -118580,7 +120560,7 @@ module.exports = Out; /***/ }), -/* 628 */ +/* 632 */ /***/ (function(module, exports) { /** @@ -118615,7 +120595,7 @@ module.exports = InOut; /***/ }), -/* 629 */ +/* 633 */ /***/ (function(module, exports) { /** @@ -118643,7 +120623,7 @@ module.exports = In; /***/ }), -/* 630 */ +/* 634 */ /***/ (function(module, exports) { /** @@ -118671,7 +120651,7 @@ module.exports = Out; /***/ }), -/* 631 */ +/* 635 */ /***/ (function(module, exports) { /** @@ -118706,7 +120686,7 @@ module.exports = InOut; /***/ }), -/* 632 */ +/* 636 */ /***/ (function(module, exports) { /** @@ -118761,7 +120741,7 @@ module.exports = In; /***/ }), -/* 633 */ +/* 637 */ /***/ (function(module, exports) { /** @@ -118816,7 +120796,7 @@ module.exports = Out; /***/ }), -/* 634 */ +/* 638 */ /***/ (function(module, exports) { /** @@ -118878,7 +120858,7 @@ module.exports = InOut; /***/ }), -/* 635 */ +/* 639 */ /***/ (function(module, exports) { /** @@ -118906,7 +120886,7 @@ module.exports = In; /***/ }), -/* 636 */ +/* 640 */ /***/ (function(module, exports) { /** @@ -118934,7 +120914,7 @@ module.exports = Out; /***/ }), -/* 637 */ +/* 641 */ /***/ (function(module, exports) { /** @@ -118969,7 +120949,7 @@ module.exports = InOut; /***/ }), -/* 638 */ +/* 642 */ /***/ (function(module, exports) { /** @@ -118997,7 +120977,7 @@ module.exports = Linear; /***/ }), -/* 639 */ +/* 643 */ /***/ (function(module, exports) { /** @@ -119025,7 +121005,7 @@ module.exports = In; /***/ }), -/* 640 */ +/* 644 */ /***/ (function(module, exports) { /** @@ -119053,7 +121033,7 @@ module.exports = Out; /***/ }), -/* 641 */ +/* 645 */ /***/ (function(module, exports) { /** @@ -119088,7 +121068,7 @@ module.exports = InOut; /***/ }), -/* 642 */ +/* 646 */ /***/ (function(module, exports) { /** @@ -119116,7 +121096,7 @@ module.exports = In; /***/ }), -/* 643 */ +/* 647 */ /***/ (function(module, exports) { /** @@ -119144,7 +121124,7 @@ module.exports = Out; /***/ }), -/* 644 */ +/* 648 */ /***/ (function(module, exports) { /** @@ -119179,7 +121159,7 @@ module.exports = InOut; /***/ }), -/* 645 */ +/* 649 */ /***/ (function(module, exports) { /** @@ -119207,7 +121187,7 @@ module.exports = In; /***/ }), -/* 646 */ +/* 650 */ /***/ (function(module, exports) { /** @@ -119235,7 +121215,7 @@ module.exports = Out; /***/ }), -/* 647 */ +/* 651 */ /***/ (function(module, exports) { /** @@ -119270,7 +121250,7 @@ module.exports = InOut; /***/ }), -/* 648 */ +/* 652 */ /***/ (function(module, exports) { /** @@ -119309,7 +121289,7 @@ module.exports = In; /***/ }), -/* 649 */ +/* 653 */ /***/ (function(module, exports) { /** @@ -119348,7 +121328,7 @@ module.exports = Out; /***/ }), -/* 650 */ +/* 654 */ /***/ (function(module, exports) { /** @@ -119387,7 +121367,7 @@ module.exports = InOut; /***/ }), -/* 651 */ +/* 655 */ /***/ (function(module, exports) { /** @@ -119429,7 +121409,7 @@ module.exports = Stepped; /***/ }), -/* 652 */ +/* 656 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119438,10 +121418,10 @@ module.exports = Stepped; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(48); -var Vector2 = __webpack_require__(4); +var Events = __webpack_require__(49); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -119583,7 +121563,7 @@ var Shake = new Class({ * @since 3.5.0 * * @param {integer} [duration=100] - The duration of the effect in milliseconds. - * @param {number} [intensity=0.05] - The intensity of the shake. + * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraShakeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -119748,7 +121728,7 @@ module.exports = Shake; /***/ }), -/* 653 */ +/* 657 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119757,10 +121737,10 @@ module.exports = Shake; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var EaseMap = __webpack_require__(163); -var Events = __webpack_require__(48); +var EaseMap = __webpack_require__(164); +var Events = __webpack_require__(49); /** * @classdesc @@ -120041,7 +122021,7 @@ module.exports = Zoom; /***/ }), -/* 654 */ +/* 658 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -120050,13 +122030,13 @@ module.exports = Zoom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Camera = __webpack_require__(268); +var Camera = __webpack_require__(271); var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(18); -var RectangleContains = __webpack_require__(47); -var ScaleEvents = __webpack_require__(89); -var SceneEvents = __webpack_require__(19); +var PluginCache = __webpack_require__(19); +var RectangleContains = __webpack_require__(48); +var ScaleEvents = __webpack_require__(90); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -120789,7 +122769,7 @@ module.exports = CameraManager; /***/ }), -/* 655 */ +/* 659 */ /***/ (function(module, exports) { /** @@ -120808,7 +122788,7 @@ module.exports = 'enterfullscreen'; /***/ }), -/* 656 */ +/* 660 */ /***/ (function(module, exports) { /** @@ -120827,7 +122807,7 @@ module.exports = 'fullscreenfailed'; /***/ }), -/* 657 */ +/* 661 */ /***/ (function(module, exports) { /** @@ -120846,7 +122826,7 @@ module.exports = 'fullscreenunsupported'; /***/ }), -/* 658 */ +/* 662 */ /***/ (function(module, exports) { /** @@ -120866,7 +122846,7 @@ module.exports = 'leavefullscreen'; /***/ }), -/* 659 */ +/* 663 */ /***/ (function(module, exports) { /** @@ -120887,7 +122867,7 @@ module.exports = 'orientationchange'; /***/ }), -/* 660 */ +/* 664 */ /***/ (function(module, exports) { /** @@ -120918,7 +122898,7 @@ module.exports = 'resize'; /***/ }), -/* 661 */ +/* 665 */ /***/ (function(module, exports) { /** @@ -120943,7 +122923,7 @@ module.exports = 'boot'; /***/ }), -/* 662 */ +/* 666 */ /***/ (function(module, exports) { /** @@ -120972,7 +122952,7 @@ module.exports = 'create'; /***/ }), -/* 663 */ +/* 667 */ /***/ (function(module, exports) { /** @@ -120999,7 +122979,7 @@ module.exports = 'destroy'; /***/ }), -/* 664 */ +/* 668 */ /***/ (function(module, exports) { /** @@ -121026,7 +123006,7 @@ module.exports = 'pause'; /***/ }), -/* 665 */ +/* 669 */ /***/ (function(module, exports) { /** @@ -121063,7 +123043,7 @@ module.exports = 'postupdate'; /***/ }), -/* 666 */ +/* 670 */ /***/ (function(module, exports) { /** @@ -121100,7 +123080,7 @@ module.exports = 'preupdate'; /***/ }), -/* 667 */ +/* 671 */ /***/ (function(module, exports) { /** @@ -121128,7 +123108,7 @@ module.exports = 'ready'; /***/ }), -/* 668 */ +/* 672 */ /***/ (function(module, exports) { /** @@ -121164,7 +123144,7 @@ module.exports = 'render'; /***/ }), -/* 669 */ +/* 673 */ /***/ (function(module, exports) { /** @@ -121191,7 +123171,7 @@ module.exports = 'resume'; /***/ }), -/* 670 */ +/* 674 */ /***/ (function(module, exports) { /** @@ -121221,7 +123201,7 @@ module.exports = 'shutdown'; /***/ }), -/* 671 */ +/* 675 */ /***/ (function(module, exports) { /** @@ -121248,7 +123228,7 @@ module.exports = 'sleep'; /***/ }), -/* 672 */ +/* 676 */ /***/ (function(module, exports) { /** @@ -121273,7 +123253,7 @@ module.exports = 'start'; /***/ }), -/* 673 */ +/* 677 */ /***/ (function(module, exports) { /** @@ -121309,7 +123289,7 @@ module.exports = 'transitioncomplete'; /***/ }), -/* 674 */ +/* 678 */ /***/ (function(module, exports) { /** @@ -121346,7 +123326,7 @@ module.exports = 'transitioninit'; /***/ }), -/* 675 */ +/* 679 */ /***/ (function(module, exports) { /** @@ -121380,7 +123360,7 @@ module.exports = 'transitionout'; /***/ }), -/* 676 */ +/* 680 */ /***/ (function(module, exports) { /** @@ -121420,7 +123400,7 @@ module.exports = 'transitionstart'; /***/ }), -/* 677 */ +/* 681 */ /***/ (function(module, exports) { /** @@ -121455,7 +123435,7 @@ module.exports = 'transitionwake'; /***/ }), -/* 678 */ +/* 682 */ /***/ (function(module, exports) { /** @@ -121492,7 +123472,7 @@ module.exports = 'update'; /***/ }), -/* 679 */ +/* 683 */ /***/ (function(module, exports) { /** @@ -121519,7 +123499,7 @@ module.exports = 'wake'; /***/ }), -/* 680 */ +/* 684 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -121534,18 +123514,18 @@ module.exports = 'wake'; module.exports = { - Config: __webpack_require__(289), - CreateRenderer: __webpack_require__(312), - DebugHeader: __webpack_require__(314), - Events: __webpack_require__(28), - TimeStep: __webpack_require__(315), - VisibilityHandler: __webpack_require__(317) + Config: __webpack_require__(292), + CreateRenderer: __webpack_require__(315), + DebugHeader: __webpack_require__(317), + Events: __webpack_require__(18), + TimeStep: __webpack_require__(318), + VisibilityHandler: __webpack_require__(320) }; /***/ }), -/* 681 */ +/* 685 */ /***/ (function(module, exports) { // shim for using process in browser @@ -121735,7 +123715,7 @@ process.umask = function() { return 0; }; /***/ }), -/* 682 */ +/* 686 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -121744,7 +123724,7 @@ process.umask = function() { return 0; }; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Browser = __webpack_require__(116); +var Browser = __webpack_require__(117); /** * Determines the input support of the browser running this Phaser Game instance. @@ -121810,7 +123790,7 @@ module.exports = init(); /***/ }), -/* 683 */ +/* 687 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -121819,7 +123799,7 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Browser = __webpack_require__(116); +var Browser = __webpack_require__(117); /** * Determines the audio playback capabilities of the device running this Phaser Game instance. @@ -121935,7 +123915,7 @@ module.exports = init(); /***/ }), -/* 684 */ +/* 688 */ /***/ (function(module, exports) { /** @@ -122020,7 +124000,7 @@ module.exports = init(); /***/ }), -/* 685 */ +/* 689 */ /***/ (function(module, exports) { /** @@ -122124,7 +124104,7 @@ module.exports = init(); /***/ }), -/* 686 */ +/* 690 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122139,23 +124119,23 @@ module.exports = init(); module.exports = { - Between: __webpack_require__(292), - BetweenPoints: __webpack_require__(687), - BetweenPointsY: __webpack_require__(688), - BetweenY: __webpack_require__(689), - CounterClockwise: __webpack_require__(690), - Normalize: __webpack_require__(293), - Reverse: __webpack_require__(691), - RotateTo: __webpack_require__(692), - ShortestBetween: __webpack_require__(693), - Wrap: __webpack_require__(223), - WrapDegrees: __webpack_require__(224) + Between: __webpack_require__(295), + BetweenPoints: __webpack_require__(691), + BetweenPointsY: __webpack_require__(692), + BetweenY: __webpack_require__(693), + CounterClockwise: __webpack_require__(694), + Normalize: __webpack_require__(296), + Reverse: __webpack_require__(695), + RotateTo: __webpack_require__(696), + ShortestBetween: __webpack_require__(697), + Wrap: __webpack_require__(226), + WrapDegrees: __webpack_require__(227) }; /***/ }), -/* 687 */ +/* 691 */ /***/ (function(module, exports) { /** @@ -122186,7 +124166,7 @@ module.exports = BetweenPoints; /***/ }), -/* 688 */ +/* 692 */ /***/ (function(module, exports) { /** @@ -122218,7 +124198,7 @@ module.exports = BetweenPointsY; /***/ }), -/* 689 */ +/* 693 */ /***/ (function(module, exports) { /** @@ -122252,7 +124232,7 @@ module.exports = BetweenY; /***/ }), -/* 690 */ +/* 694 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122261,7 +124241,7 @@ module.exports = BetweenY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); +var CONST = __webpack_require__(22); /** * Takes an angle in Phasers default clockwise format and converts it so that @@ -122285,6 +124265,11 @@ var CONST = __webpack_require__(23); */ var CounterClockwise = function (angle) { + if (angle > Math.PI) + { + angle -= CONST.PI2; + } + return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); }; @@ -122292,7 +124277,7 @@ module.exports = CounterClockwise; /***/ }), -/* 691 */ +/* 695 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122301,7 +124286,7 @@ module.exports = CounterClockwise; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Normalize = __webpack_require__(293); +var Normalize = __webpack_require__(296); /** * Reverse the given angle. @@ -122322,7 +124307,7 @@ module.exports = Reverse; /***/ }), -/* 692 */ +/* 696 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122331,7 +124316,7 @@ module.exports = Reverse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); +var MATH_CONST = __webpack_require__(22); /** * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. @@ -122389,7 +124374,7 @@ module.exports = RotateTo; /***/ }), -/* 693 */ +/* 697 */ /***/ (function(module, exports) { /** @@ -122438,7 +124423,7 @@ module.exports = ShortestBetween; /***/ }), -/* 694 */ +/* 698 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122453,15 +124438,15 @@ module.exports = ShortestBetween; module.exports = { - Between: __webpack_require__(57), - Power: __webpack_require__(695), - Squared: __webpack_require__(294) + Between: __webpack_require__(58), + Power: __webpack_require__(699), + Squared: __webpack_require__(297) }; /***/ }), -/* 695 */ +/* 699 */ /***/ (function(module, exports) { /** @@ -122495,7 +124480,7 @@ module.exports = DistancePower; /***/ }), -/* 696 */ +/* 700 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122510,24 +124495,24 @@ module.exports = DistancePower; module.exports = { - Back: __webpack_require__(277), - Bounce: __webpack_require__(278), - Circular: __webpack_require__(279), - Cubic: __webpack_require__(280), - Elastic: __webpack_require__(281), - Expo: __webpack_require__(282), - Linear: __webpack_require__(283), - Quadratic: __webpack_require__(284), - Quartic: __webpack_require__(285), - Quintic: __webpack_require__(286), - Sine: __webpack_require__(287), - Stepped: __webpack_require__(288) + Back: __webpack_require__(280), + Bounce: __webpack_require__(281), + Circular: __webpack_require__(282), + Cubic: __webpack_require__(283), + Elastic: __webpack_require__(284), + Expo: __webpack_require__(285), + Linear: __webpack_require__(286), + Quadratic: __webpack_require__(287), + Quartic: __webpack_require__(288), + Quintic: __webpack_require__(289), + Sine: __webpack_require__(290), + Stepped: __webpack_require__(291) }; /***/ }), -/* 697 */ +/* 701 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122542,17 +124527,17 @@ module.exports = { module.exports = { - Ceil: __webpack_require__(698), - Equal: __webpack_require__(166), - Floor: __webpack_require__(699), - GreaterThan: __webpack_require__(295), - LessThan: __webpack_require__(296) + Ceil: __webpack_require__(702), + Equal: __webpack_require__(167), + Floor: __webpack_require__(703), + GreaterThan: __webpack_require__(298), + LessThan: __webpack_require__(299) }; /***/ }), -/* 698 */ +/* 702 */ /***/ (function(module, exports) { /** @@ -122583,7 +124568,7 @@ module.exports = Ceil; /***/ }), -/* 699 */ +/* 703 */ /***/ (function(module, exports) { /** @@ -122614,7 +124599,7 @@ module.exports = Floor; /***/ }), -/* 700 */ +/* 704 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122629,19 +124614,19 @@ module.exports = Floor; module.exports = { - Bezier: __webpack_require__(701), - CatmullRom: __webpack_require__(702), - CubicBezier: __webpack_require__(299), - Linear: __webpack_require__(703), - QuadraticBezier: __webpack_require__(300), - SmoothStep: __webpack_require__(301), - SmootherStep: __webpack_require__(704) + Bezier: __webpack_require__(705), + CatmullRom: __webpack_require__(706), + CubicBezier: __webpack_require__(302), + Linear: __webpack_require__(707), + QuadraticBezier: __webpack_require__(303), + SmoothStep: __webpack_require__(304), + SmootherStep: __webpack_require__(708) }; /***/ }), -/* 701 */ +/* 705 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122650,7 +124635,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bernstein = __webpack_require__(297); +var Bernstein = __webpack_require__(300); /** * A bezier interpolation method. @@ -122680,7 +124665,7 @@ module.exports = BezierInterpolation; /***/ }), -/* 702 */ +/* 706 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122689,7 +124674,7 @@ module.exports = BezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CatmullRom = __webpack_require__(167); +var CatmullRom = __webpack_require__(168); /** * A Catmull-Rom interpolation method. @@ -122737,7 +124722,7 @@ module.exports = CatmullRomInterpolation; /***/ }), -/* 703 */ +/* 707 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122746,7 +124731,7 @@ module.exports = CatmullRomInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(114); +var Linear = __webpack_require__(115); /** * A linear interpolation method. @@ -122784,7 +124769,7 @@ module.exports = LinearInterpolation; /***/ }), -/* 704 */ +/* 708 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122793,7 +124778,7 @@ module.exports = LinearInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmootherStep = __webpack_require__(155); +var SmootherStep = __webpack_require__(156); /** * A Smoother Step interpolation method. @@ -122817,7 +124802,7 @@ module.exports = SmootherStepInterpolation; /***/ }), -/* 705 */ +/* 709 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122832,15 +124817,15 @@ module.exports = SmootherStepInterpolation; module.exports = { - GetNext: __webpack_require__(302), - IsSize: __webpack_require__(117), - IsValue: __webpack_require__(706) + GetNext: __webpack_require__(305), + IsSize: __webpack_require__(118), + IsValue: __webpack_require__(710) }; /***/ }), -/* 706 */ +/* 710 */ /***/ (function(module, exports) { /** @@ -122868,7 +124853,7 @@ module.exports = IsValuePowerOfTwo; /***/ }), -/* 707 */ +/* 711 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122883,15 +124868,15 @@ module.exports = IsValuePowerOfTwo; module.exports = { - Ceil: __webpack_require__(303), - Floor: __webpack_require__(90), - To: __webpack_require__(708) + Ceil: __webpack_require__(306), + Floor: __webpack_require__(91), + To: __webpack_require__(712) }; /***/ }), -/* 708 */ +/* 712 */ /***/ (function(module, exports) { /** @@ -122934,7 +124919,7 @@ module.exports = SnapTo; /***/ }), -/* 709 */ +/* 713 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -123433,7 +125418,7 @@ module.exports = RandomDataGenerator; /***/ }), -/* 710 */ +/* 714 */ /***/ (function(module, exports) { /** @@ -123468,7 +125453,7 @@ module.exports = Average; /***/ }), -/* 711 */ +/* 715 */ /***/ (function(module, exports) { /** @@ -123505,7 +125490,7 @@ module.exports = CeilTo; /***/ }), -/* 712 */ +/* 716 */ /***/ (function(module, exports) { /** @@ -123534,7 +125519,7 @@ module.exports = Difference; /***/ }), -/* 713 */ +/* 717 */ /***/ (function(module, exports) { /** @@ -123571,7 +125556,7 @@ module.exports = FloorTo; /***/ }), -/* 714 */ +/* 718 */ /***/ (function(module, exports) { /** @@ -123600,7 +125585,7 @@ module.exports = GetSpeed; /***/ }), -/* 715 */ +/* 719 */ /***/ (function(module, exports) { /** @@ -123631,7 +125616,7 @@ module.exports = IsEven; /***/ }), -/* 716 */ +/* 720 */ /***/ (function(module, exports) { /** @@ -123660,7 +125645,7 @@ module.exports = IsEvenStrict; /***/ }), -/* 717 */ +/* 721 */ /***/ (function(module, exports) { /** @@ -123690,7 +125675,7 @@ module.exports = MaxAdd; /***/ }), -/* 718 */ +/* 722 */ /***/ (function(module, exports) { /** @@ -123720,7 +125705,7 @@ module.exports = MinSub; /***/ }), -/* 719 */ +/* 723 */ /***/ (function(module, exports) { /** @@ -123779,7 +125764,7 @@ module.exports = Percent; /***/ }), -/* 720 */ +/* 724 */ /***/ (function(module, exports) { /** @@ -123819,7 +125804,7 @@ module.exports = RandomXY; /***/ }), -/* 721 */ +/* 725 */ /***/ (function(module, exports) { /** @@ -123858,7 +125843,7 @@ module.exports = RandomXYZ; /***/ }), -/* 722 */ +/* 726 */ /***/ (function(module, exports) { /** @@ -123895,7 +125880,7 @@ module.exports = RandomXYZW; /***/ }), -/* 723 */ +/* 727 */ /***/ (function(module, exports) { /** @@ -123947,7 +125932,7 @@ module.exports = RoundTo; /***/ }), -/* 724 */ +/* 728 */ /***/ (function(module, exports) { /** @@ -124000,7 +125985,65 @@ module.exports = SinCosTableGenerator; /***/ }), -/* 725 */ +/* 729 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Returns a Vec2 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 Vec2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {integer} index - The position within the grid to get the x/y value for. + * @param {integer} width - The width of the grid. + * @param {integer} 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; + } + + out.set(x, y); + } + + return out; +}; + +module.exports = ToXY; + + +/***/ }), +/* 730 */ /***/ (function(module, exports) { /** @@ -124030,7 +126073,7 @@ module.exports = Within; /***/ }), -/* 726 */ +/* 731 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124039,9 +126082,9 @@ module.exports = Within; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(170); -var Matrix4 = __webpack_require__(310); -var Quaternion = __webpack_require__(311); +var Vector3 = __webpack_require__(171); +var Matrix4 = __webpack_require__(313); +var Quaternion = __webpack_require__(314); var tmpMat4 = new Matrix4(); var tmpQuat = new Quaternion(); @@ -124078,7 +126121,7 @@ module.exports = RotateVec3; /***/ }), -/* 727 */ +/* 732 */ /***/ (function(module, exports) { /** @@ -124104,7 +126147,7 @@ module.exports = 'addtexture'; /***/ }), -/* 728 */ +/* 733 */ /***/ (function(module, exports) { /** @@ -124130,7 +126173,7 @@ module.exports = 'onerror'; /***/ }), -/* 729 */ +/* 734 */ /***/ (function(module, exports) { /** @@ -124159,7 +126202,7 @@ module.exports = 'onload'; /***/ }), -/* 730 */ +/* 735 */ /***/ (function(module, exports) { /** @@ -124182,7 +126225,7 @@ module.exports = 'ready'; /***/ }), -/* 731 */ +/* 736 */ /***/ (function(module, exports) { /** @@ -124210,7 +126253,7 @@ module.exports = 'removetexture'; /***/ }), -/* 732 */ +/* 737 */ /***/ (function(module, exports) { module.exports = [ @@ -124246,7 +126289,7 @@ module.exports = [ /***/ }), -/* 733 */ +/* 738 */ /***/ (function(module, exports) { module.exports = [ @@ -124265,7 +126308,7 @@ module.exports = [ /***/ }), -/* 734 */ +/* 739 */ /***/ (function(module, exports) { module.exports = [ @@ -124324,7 +126367,7 @@ module.exports = [ /***/ }), -/* 735 */ +/* 740 */ /***/ (function(module, exports) { module.exports = [ @@ -124368,7 +126411,7 @@ module.exports = [ /***/ }), -/* 736 */ +/* 741 */ /***/ (function(module, exports) { module.exports = [ @@ -124403,7 +126446,7 @@ module.exports = [ /***/ }), -/* 737 */ +/* 742 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124418,14 +126461,14 @@ module.exports = [ module.exports = { - GenerateTexture: __webpack_require__(318), - Palettes: __webpack_require__(738) + GenerateTexture: __webpack_require__(321), + Palettes: __webpack_require__(743) }; /***/ }), -/* 738 */ +/* 743 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124440,17 +126483,17 @@ module.exports = { module.exports = { - ARNE16: __webpack_require__(319), - C64: __webpack_require__(739), - CGA: __webpack_require__(740), - JMP: __webpack_require__(741), - MSX: __webpack_require__(742) + ARNE16: __webpack_require__(322), + C64: __webpack_require__(744), + CGA: __webpack_require__(745), + JMP: __webpack_require__(746), + MSX: __webpack_require__(747) }; /***/ }), -/* 739 */ +/* 744 */ /***/ (function(module, exports) { /** @@ -124488,7 +126531,7 @@ module.exports = { /***/ }), -/* 740 */ +/* 745 */ /***/ (function(module, exports) { /** @@ -124526,7 +126569,7 @@ module.exports = { /***/ }), -/* 741 */ +/* 746 */ /***/ (function(module, exports) { /** @@ -124564,7 +126607,7 @@ module.exports = { /***/ }), -/* 742 */ +/* 747 */ /***/ (function(module, exports) { /** @@ -124602,7 +126645,7 @@ module.exports = { /***/ }), -/* 743 */ +/* 748 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124616,19 +126659,19 @@ module.exports = { */ module.exports = { - Path: __webpack_require__(744), + Path: __webpack_require__(749), - CubicBezier: __webpack_require__(320), - Curve: __webpack_require__(79), - Ellipse: __webpack_require__(321), - Line: __webpack_require__(322), - QuadraticBezier: __webpack_require__(323), - Spline: __webpack_require__(324) + CubicBezier: __webpack_require__(323), + Curve: __webpack_require__(80), + Ellipse: __webpack_require__(324), + Line: __webpack_require__(325), + QuadraticBezier: __webpack_require__(326), + Spline: __webpack_require__(327) }; /***/ }), -/* 744 */ +/* 749 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124640,15 +126683,15 @@ module.exports = { // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var CubicBezierCurve = __webpack_require__(320); -var EllipseCurve = __webpack_require__(321); -var GameObjectFactory = __webpack_require__(5); -var LineCurve = __webpack_require__(322); -var MovePathTo = __webpack_require__(745); -var QuadraticBezierCurve = __webpack_require__(323); -var Rectangle = __webpack_require__(10); -var SplineCurve = __webpack_require__(324); -var Vector2 = __webpack_require__(4); +var CubicBezierCurve = __webpack_require__(323); +var EllipseCurve = __webpack_require__(324); +var GameObjectFactory = __webpack_require__(6); +var LineCurve = __webpack_require__(325); +var MovePathTo = __webpack_require__(750); +var QuadraticBezierCurve = __webpack_require__(326); +var Rectangle = __webpack_require__(11); +var SplineCurve = __webpack_require__(327); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -124935,12 +126978,12 @@ var Path = new Class({ * @method Phaser.Curves.Path#ellipseTo * @since 3.0.0 * - * @param {number} xRadius - The horizontal radius of the ellipse. - * @param {number} yRadius - The vertical radius of the ellipse. - * @param {number} startAngle - The start angle of the ellipse, in degrees. - * @param {number} endAngle - The end angle of the ellipse, in degrees. - * @param {boolean} clockwise - Whether the ellipse should be rotated clockwise (`true`) or counter-clockwise (`false`). - * @param {number} rotation - The rotation of the ellipse, in degrees. + * @param {number} [xRadius=0] - The horizontal radius of ellipse. + * @param {number} [yRadius=0] - The vertical radius of ellipse. + * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). + * @param {number} [rotation=0] - The rotation of the ellipse, in degrees. * * @return {Phaser.Curves.Path} This Path object. */ @@ -125323,10 +127366,8 @@ var Path = new Class({ return out.copy(this.startPoint); }, - // Creates a line curve from the previous end point to x/y - /** - * [description] + * Creates a line curve from the previous end point to x/y * * @method Phaser.Curves.Path#lineTo * @since 3.0.0 @@ -125413,10 +127454,8 @@ var Path = new Class({ }; }, - // cacheLengths must be recalculated. - /** - * [description] + * cacheLengths must be recalculated. * * @method Phaser.Curves.Path#updateArcLengths * @since 3.0.0 @@ -125471,7 +127510,7 @@ module.exports = Path; /***/ }), -/* 745 */ +/* 750 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125481,7 +127520,7 @@ module.exports = Path; */ var Class = __webpack_require__(0); -var Vector2 = __webpack_require__(4); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -125611,7 +127650,7 @@ module.exports = MoveTo; /***/ }), -/* 746 */ +/* 751 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125626,15 +127665,15 @@ module.exports = MoveTo; module.exports = { - DataManager: __webpack_require__(109), - DataManagerPlugin: __webpack_require__(747), - Events: __webpack_require__(259) + DataManager: __webpack_require__(110), + DataManagerPlugin: __webpack_require__(752), + Events: __webpack_require__(262) }; /***/ }), -/* 747 */ +/* 752 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125644,9 +127683,9 @@ module.exports = { */ var Class = __webpack_require__(0); -var DataManager = __webpack_require__(109); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); +var DataManager = __webpack_require__(110); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -125761,7 +127800,7 @@ module.exports = DataManagerPlugin; /***/ }), -/* 748 */ +/* 753 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125776,18 +127815,18 @@ module.exports = DataManagerPlugin; module.exports = { - Align: __webpack_require__(749), - BaseShader: __webpack_require__(325), - Bounds: __webpack_require__(764), - Canvas: __webpack_require__(767), - Color: __webpack_require__(326), - Masks: __webpack_require__(776) + Align: __webpack_require__(754), + BaseShader: __webpack_require__(328), + Bounds: __webpack_require__(769), + Canvas: __webpack_require__(772), + Color: __webpack_require__(329), + Masks: __webpack_require__(781) }; /***/ }), -/* 749 */ +/* 754 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125796,8 +127835,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(143); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(144); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Display.Align @@ -125805,8 +127844,8 @@ var Extend = __webpack_require__(17); var Align = { - In: __webpack_require__(750), - To: __webpack_require__(751) + In: __webpack_require__(755), + To: __webpack_require__(756) }; @@ -125817,7 +127856,7 @@ module.exports = Align; /***/ }), -/* 750 */ +/* 755 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125832,22 +127871,22 @@ module.exports = Align; module.exports = { - BottomCenter: __webpack_require__(231), - BottomLeft: __webpack_require__(232), - BottomRight: __webpack_require__(233), - Center: __webpack_require__(234), - LeftCenter: __webpack_require__(236), - QuickSet: __webpack_require__(230), - RightCenter: __webpack_require__(237), - TopCenter: __webpack_require__(238), - TopLeft: __webpack_require__(239), - TopRight: __webpack_require__(240) + BottomCenter: __webpack_require__(234), + BottomLeft: __webpack_require__(235), + BottomRight: __webpack_require__(236), + Center: __webpack_require__(237), + LeftCenter: __webpack_require__(239), + QuickSet: __webpack_require__(233), + RightCenter: __webpack_require__(240), + TopCenter: __webpack_require__(241), + TopLeft: __webpack_require__(242), + TopRight: __webpack_require__(243) }; /***/ }), -/* 751 */ +/* 756 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125862,24 +127901,24 @@ module.exports = { module.exports = { - BottomCenter: __webpack_require__(752), - BottomLeft: __webpack_require__(753), - BottomRight: __webpack_require__(754), - LeftBottom: __webpack_require__(755), - LeftCenter: __webpack_require__(756), - LeftTop: __webpack_require__(757), - RightBottom: __webpack_require__(758), - RightCenter: __webpack_require__(759), - RightTop: __webpack_require__(760), - TopCenter: __webpack_require__(761), - TopLeft: __webpack_require__(762), - TopRight: __webpack_require__(763) + BottomCenter: __webpack_require__(757), + BottomLeft: __webpack_require__(758), + BottomRight: __webpack_require__(759), + LeftBottom: __webpack_require__(760), + LeftCenter: __webpack_require__(761), + LeftTop: __webpack_require__(762), + RightBottom: __webpack_require__(763), + RightCenter: __webpack_require__(764), + RightTop: __webpack_require__(765), + TopCenter: __webpack_require__(766), + TopLeft: __webpack_require__(767), + TopRight: __webpack_require__(768) }; /***/ }), -/* 752 */ +/* 757 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125889,8 +127928,8 @@ module.exports = { */ var GetBottom = __webpack_require__(38); -var GetCenterX = __webpack_require__(73); -var SetCenterX = __webpack_require__(74); +var GetCenterX = __webpack_require__(74); +var SetCenterX = __webpack_require__(75); var SetTop = __webpack_require__(45); /** @@ -125923,7 +127962,7 @@ module.exports = BottomCenter; /***/ }), -/* 753 */ +/* 758 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125967,7 +128006,7 @@ module.exports = BottomLeft; /***/ }), -/* 754 */ +/* 759 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126011,7 +128050,7 @@ module.exports = BottomRight; /***/ }), -/* 755 */ +/* 760 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126055,7 +128094,7 @@ module.exports = LeftBottom; /***/ }), -/* 756 */ +/* 761 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126064,9 +128103,9 @@ module.exports = LeftBottom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(76); +var GetCenterY = __webpack_require__(77); var GetLeft = __webpack_require__(40); -var SetCenterY = __webpack_require__(75); +var SetCenterY = __webpack_require__(76); var SetRight = __webpack_require__(43); /** @@ -126099,7 +128138,7 @@ module.exports = LeftCenter; /***/ }), -/* 757 */ +/* 762 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126143,7 +128182,7 @@ module.exports = LeftTop; /***/ }), -/* 758 */ +/* 763 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126187,7 +128226,7 @@ module.exports = RightBottom; /***/ }), -/* 759 */ +/* 764 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126196,9 +128235,9 @@ module.exports = RightBottom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(76); +var GetCenterY = __webpack_require__(77); var GetRight = __webpack_require__(42); -var SetCenterY = __webpack_require__(75); +var SetCenterY = __webpack_require__(76); var SetLeft = __webpack_require__(41); /** @@ -126231,7 +128270,7 @@ module.exports = RightCenter; /***/ }), -/* 760 */ +/* 765 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126275,7 +128314,7 @@ module.exports = RightTop; /***/ }), -/* 761 */ +/* 766 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126284,10 +128323,10 @@ module.exports = RightTop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterX = __webpack_require__(73); +var GetCenterX = __webpack_require__(74); var GetTop = __webpack_require__(44); var SetBottom = __webpack_require__(39); -var SetCenterX = __webpack_require__(74); +var SetCenterX = __webpack_require__(75); /** * Takes given Game Object and aligns it so that it is positioned next to the top center position of the other. @@ -126319,7 +128358,7 @@ module.exports = TopCenter; /***/ }), -/* 762 */ +/* 767 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126363,7 +128402,7 @@ module.exports = TopLeft; /***/ }), -/* 763 */ +/* 768 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126407,7 +128446,7 @@ module.exports = TopRight; /***/ }), -/* 764 */ +/* 769 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126422,18 +128461,18 @@ module.exports = TopRight; module.exports = { - CenterOn: __webpack_require__(235), + CenterOn: __webpack_require__(238), GetBottom: __webpack_require__(38), - GetCenterX: __webpack_require__(73), - GetCenterY: __webpack_require__(76), + GetCenterX: __webpack_require__(74), + GetCenterY: __webpack_require__(77), GetLeft: __webpack_require__(40), - GetOffsetX: __webpack_require__(765), - GetOffsetY: __webpack_require__(766), + GetOffsetX: __webpack_require__(770), + GetOffsetY: __webpack_require__(771), GetRight: __webpack_require__(42), GetTop: __webpack_require__(44), SetBottom: __webpack_require__(39), - SetCenterX: __webpack_require__(74), - SetCenterY: __webpack_require__(75), + SetCenterX: __webpack_require__(75), + SetCenterY: __webpack_require__(76), SetLeft: __webpack_require__(41), SetRight: __webpack_require__(43), SetTop: __webpack_require__(45) @@ -126442,7 +128481,7 @@ module.exports = { /***/ }), -/* 765 */ +/* 770 */ /***/ (function(module, exports) { /** @@ -126472,7 +128511,7 @@ module.exports = GetOffsetX; /***/ }), -/* 766 */ +/* 771 */ /***/ (function(module, exports) { /** @@ -126502,7 +128541,7 @@ module.exports = GetOffsetY; /***/ }), -/* 767 */ +/* 772 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126517,17 +128556,17 @@ module.exports = GetOffsetY; module.exports = { - CanvasInterpolation: __webpack_require__(313), - CanvasPool: __webpack_require__(24), - Smoothing: __webpack_require__(113), - TouchAction: __webpack_require__(768), - UserSelect: __webpack_require__(769) + CanvasInterpolation: __webpack_require__(316), + CanvasPool: __webpack_require__(25), + Smoothing: __webpack_require__(114), + TouchAction: __webpack_require__(773), + UserSelect: __webpack_require__(774) }; /***/ }), -/* 768 */ +/* 773 */ /***/ (function(module, exports) { /** @@ -126562,7 +128601,7 @@ module.exports = TouchAction; /***/ }), -/* 769 */ +/* 774 */ /***/ (function(module, exports) { /** @@ -126609,7 +128648,7 @@ module.exports = UserSelect; /***/ }), -/* 770 */ +/* 775 */ /***/ (function(module, exports) { /** @@ -126649,7 +128688,7 @@ module.exports = ColorToRGBA; /***/ }), -/* 771 */ +/* 776 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126659,7 +128698,7 @@ module.exports = ColorToRGBA; */ var Color = __webpack_require__(33); -var HueToComponent = __webpack_require__(328); +var HueToComponent = __webpack_require__(331); /** * Converts HSL (hue, saturation and lightness) values to a Phaser Color object. @@ -126699,7 +128738,7 @@ module.exports = HSLToColor; /***/ }), -/* 772 */ +/* 777 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126708,7 +128747,7 @@ module.exports = HSLToColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HSVToRGB = __webpack_require__(161); +var HSVToRGB = __webpack_require__(162); /** * Get HSV color wheel values in an array which will be 360 elements in size. @@ -126740,7 +128779,7 @@ module.exports = HSVColorWheel; /***/ }), -/* 773 */ +/* 778 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126749,7 +128788,7 @@ module.exports = HSVColorWheel; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(114); +var Linear = __webpack_require__(115); /** * @namespace Phaser.Display.Color.Interpolate @@ -126848,7 +128887,7 @@ module.exports = { /***/ }), -/* 774 */ +/* 779 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126857,7 +128896,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Between = __webpack_require__(168); +var Between = __webpack_require__(169); var Color = __webpack_require__(33); /** @@ -126884,7 +128923,7 @@ module.exports = RandomRGB; /***/ }), -/* 775 */ +/* 780 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126893,7 +128932,7 @@ module.exports = RandomRGB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ComponentToHex = __webpack_require__(327); +var ComponentToHex = __webpack_require__(330); /** * Converts the color values into an HTML compatible color string, prefixed with either `#` or `0x`. @@ -126928,7 +128967,7 @@ module.exports = RGBToString; /***/ }), -/* 776 */ +/* 781 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126943,14 +128982,14 @@ module.exports = RGBToString; module.exports = { - BitmapMask: __webpack_require__(253), - GeometryMask: __webpack_require__(254) + BitmapMask: __webpack_require__(256), + GeometryMask: __webpack_require__(257) }; /***/ }), -/* 777 */ +/* 782 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126965,13 +129004,13 @@ module.exports = { var Dom = { - AddToDOM: __webpack_require__(119), - DOMContentLoaded: __webpack_require__(329), - GetScreenOrientation: __webpack_require__(330), - GetTarget: __webpack_require__(335), - ParseXML: __webpack_require__(336), - RemoveFromDOM: __webpack_require__(174), - RequestAnimationFrame: __webpack_require__(316) + AddToDOM: __webpack_require__(120), + DOMContentLoaded: __webpack_require__(332), + GetScreenOrientation: __webpack_require__(333), + GetTarget: __webpack_require__(338), + ParseXML: __webpack_require__(339), + RemoveFromDOM: __webpack_require__(175), + RequestAnimationFrame: __webpack_require__(319) }; @@ -126979,7 +129018,7 @@ module.exports = Dom; /***/ }), -/* 778 */ +/* 783 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126992,11 +129031,11 @@ module.exports = Dom; * @namespace Phaser.Events */ -module.exports = { EventEmitter: __webpack_require__(779) }; +module.exports = { EventEmitter: __webpack_require__(784) }; /***/ }), -/* 779 */ +/* 784 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127006,8 +129045,8 @@ module.exports = { EventEmitter: __webpack_require__(779) }; */ var Class = __webpack_require__(0); -var EE = __webpack_require__(11); -var PluginCache = __webpack_require__(18); +var EE = __webpack_require__(10); +var PluginCache = __webpack_require__(19); /** * @classdesc @@ -127180,7 +129219,7 @@ module.exports = EventEmitter; /***/ }), -/* 780 */ +/* 785 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127189,33 +129228,33 @@ module.exports = EventEmitter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(119); -var AnimationManager = __webpack_require__(264); -var CacheManager = __webpack_require__(267); -var CanvasPool = __webpack_require__(24); +var AddToDOM = __webpack_require__(120); +var AnimationManager = __webpack_require__(267); +var CacheManager = __webpack_require__(270); +var CanvasPool = __webpack_require__(25); var Class = __webpack_require__(0); -var Config = __webpack_require__(289); -var CreateDOMContainer = __webpack_require__(781); -var CreateRenderer = __webpack_require__(312); -var DataManager = __webpack_require__(109); -var DebugHeader = __webpack_require__(314); -var Device = __webpack_require__(290); -var DOMContentLoaded = __webpack_require__(329); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(28); -var InputManager = __webpack_require__(337); -var PluginCache = __webpack_require__(18); -var PluginManager = __webpack_require__(342); -var ScaleManager = __webpack_require__(343); -var SceneManager = __webpack_require__(345); -var TextureEvents = __webpack_require__(118); -var TextureManager = __webpack_require__(349); -var TimeStep = __webpack_require__(315); -var VisibilityHandler = __webpack_require__(317); +var Config = __webpack_require__(292); +var CreateDOMContainer = __webpack_require__(786); +var CreateRenderer = __webpack_require__(315); +var DataManager = __webpack_require__(110); +var DebugHeader = __webpack_require__(317); +var Device = __webpack_require__(293); +var DOMContentLoaded = __webpack_require__(332); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(18); +var InputManager = __webpack_require__(340); +var PluginCache = __webpack_require__(19); +var PluginManager = __webpack_require__(345); +var ScaleManager = __webpack_require__(346); +var SceneManager = __webpack_require__(348); +var TextureEvents = __webpack_require__(119); +var TextureManager = __webpack_require__(351); +var TimeStep = __webpack_require__(318); +var VisibilityHandler = __webpack_require__(320); if (true) { - var SoundManagerCreator = __webpack_require__(352); + var SoundManagerCreator = __webpack_require__(355); } if (false) @@ -127431,7 +129470,7 @@ var Game = new Class({ * You can disable the inclusion of the Sound Manager in your build by toggling the webpack `FEATURE_SOUND` flag. * * @name Phaser.Game#sound - * @type {Phaser.Sound.BaseSoundManager} + * @type {(Phaser.Sound.NoAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager)} * @since 3.0.0 */ this.sound = null; @@ -127878,7 +129917,7 @@ module.exports = Game; /***/ }), -/* 781 */ +/* 786 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127887,7 +129926,7 @@ module.exports = Game; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(119); +var AddToDOM = __webpack_require__(120); var CreateDOMContainer = function (game) { @@ -127901,7 +129940,7 @@ var CreateDOMContainer = function (game) // DOM Element Container var div = document.createElement('div'); - div.style = [ + div.style.cssText = [ 'display: block;', 'width: ' + game.scale.width + 'px;', 'height: ' + game.scale.height + 'px;', @@ -127922,7 +129961,7 @@ module.exports = CreateDOMContainer; /***/ }), -/* 782 */ +/* 787 */ /***/ (function(module, exports) { /** @@ -127943,7 +129982,7 @@ module.exports = 'boot'; /***/ }), -/* 783 */ +/* 788 */ /***/ (function(module, exports) { /** @@ -127964,7 +130003,7 @@ module.exports = 'destroy'; /***/ }), -/* 784 */ +/* 789 */ /***/ (function(module, exports) { /** @@ -127992,7 +130031,7 @@ module.exports = 'dragend'; /***/ }), -/* 785 */ +/* 790 */ /***/ (function(module, exports) { /** @@ -128023,7 +130062,7 @@ module.exports = 'dragenter'; /***/ }), -/* 786 */ +/* 791 */ /***/ (function(module, exports) { /** @@ -128055,7 +130094,7 @@ module.exports = 'drag'; /***/ }), -/* 787 */ +/* 792 */ /***/ (function(module, exports) { /** @@ -128086,7 +130125,7 @@ module.exports = 'dragleave'; /***/ }), -/* 788 */ +/* 793 */ /***/ (function(module, exports) { /** @@ -128120,7 +130159,7 @@ module.exports = 'dragover'; /***/ }), -/* 789 */ +/* 794 */ /***/ (function(module, exports) { /** @@ -128150,7 +130189,7 @@ module.exports = 'dragstart'; /***/ }), -/* 790 */ +/* 795 */ /***/ (function(module, exports) { /** @@ -128179,7 +130218,7 @@ module.exports = 'drop'; /***/ }), -/* 791 */ +/* 796 */ /***/ (function(module, exports) { /** @@ -128206,7 +130245,7 @@ module.exports = 'gameout'; /***/ }), -/* 792 */ +/* 797 */ /***/ (function(module, exports) { /** @@ -128233,7 +130272,7 @@ module.exports = 'gameover'; /***/ }), -/* 793 */ +/* 798 */ /***/ (function(module, exports) { /** @@ -128274,7 +130313,7 @@ module.exports = 'gameobjectdown'; /***/ }), -/* 794 */ +/* 799 */ /***/ (function(module, exports) { /** @@ -128305,7 +130344,7 @@ module.exports = 'dragend'; /***/ }), -/* 795 */ +/* 800 */ /***/ (function(module, exports) { /** @@ -128335,7 +130374,7 @@ module.exports = 'dragenter'; /***/ }), -/* 796 */ +/* 801 */ /***/ (function(module, exports) { /** @@ -128366,7 +130405,7 @@ module.exports = 'drag'; /***/ }), -/* 797 */ +/* 802 */ /***/ (function(module, exports) { /** @@ -128396,7 +130435,7 @@ module.exports = 'dragleave'; /***/ }), -/* 798 */ +/* 803 */ /***/ (function(module, exports) { /** @@ -128429,7 +130468,7 @@ module.exports = 'dragover'; /***/ }), -/* 799 */ +/* 804 */ /***/ (function(module, exports) { /** @@ -128463,7 +130502,7 @@ module.exports = 'dragstart'; /***/ }), -/* 800 */ +/* 805 */ /***/ (function(module, exports) { /** @@ -128493,7 +130532,7 @@ module.exports = 'drop'; /***/ }), -/* 801 */ +/* 806 */ /***/ (function(module, exports) { /** @@ -128534,7 +130573,7 @@ module.exports = 'gameobjectmove'; /***/ }), -/* 802 */ +/* 807 */ /***/ (function(module, exports) { /** @@ -128575,7 +130614,7 @@ module.exports = 'gameobjectout'; /***/ }), -/* 803 */ +/* 808 */ /***/ (function(module, exports) { /** @@ -128616,7 +130655,7 @@ module.exports = 'gameobjectover'; /***/ }), -/* 804 */ +/* 809 */ /***/ (function(module, exports) { /** @@ -128657,7 +130696,7 @@ module.exports = 'pointerdown'; /***/ }), -/* 805 */ +/* 810 */ /***/ (function(module, exports) { /** @@ -128698,7 +130737,7 @@ module.exports = 'pointermove'; /***/ }), -/* 806 */ +/* 811 */ /***/ (function(module, exports) { /** @@ -128737,7 +130776,7 @@ module.exports = 'pointerout'; /***/ }), -/* 807 */ +/* 812 */ /***/ (function(module, exports) { /** @@ -128778,7 +130817,7 @@ module.exports = 'pointerover'; /***/ }), -/* 808 */ +/* 813 */ /***/ (function(module, exports) { /** @@ -128819,7 +130858,7 @@ module.exports = 'pointerup'; /***/ }), -/* 809 */ +/* 814 */ /***/ (function(module, exports) { /** @@ -128861,7 +130900,7 @@ module.exports = 'wheel'; /***/ }), -/* 810 */ +/* 815 */ /***/ (function(module, exports) { /** @@ -128902,7 +130941,7 @@ module.exports = 'gameobjectup'; /***/ }), -/* 811 */ +/* 816 */ /***/ (function(module, exports) { /** @@ -128946,7 +130985,7 @@ module.exports = 'gameobjectwheel'; /***/ }), -/* 812 */ +/* 817 */ /***/ (function(module, exports) { /** @@ -128967,7 +131006,7 @@ module.exports = 'boot'; /***/ }), -/* 813 */ +/* 818 */ /***/ (function(module, exports) { /** @@ -128992,7 +131031,7 @@ module.exports = 'process'; /***/ }), -/* 814 */ +/* 819 */ /***/ (function(module, exports) { /** @@ -129013,7 +131052,7 @@ module.exports = 'update'; /***/ }), -/* 815 */ +/* 820 */ /***/ (function(module, exports) { /** @@ -129048,7 +131087,7 @@ module.exports = 'pointerdown'; /***/ }), -/* 816 */ +/* 821 */ /***/ (function(module, exports) { /** @@ -129082,7 +131121,7 @@ module.exports = 'pointerdownoutside'; /***/ }), -/* 817 */ +/* 822 */ /***/ (function(module, exports) { /** @@ -129117,7 +131156,7 @@ module.exports = 'pointermove'; /***/ }), -/* 818 */ +/* 823 */ /***/ (function(module, exports) { /** @@ -129152,7 +131191,7 @@ module.exports = 'pointerout'; /***/ }), -/* 819 */ +/* 824 */ /***/ (function(module, exports) { /** @@ -129187,7 +131226,7 @@ module.exports = 'pointerover'; /***/ }), -/* 820 */ +/* 825 */ /***/ (function(module, exports) { /** @@ -129222,7 +131261,7 @@ module.exports = 'pointerup'; /***/ }), -/* 821 */ +/* 826 */ /***/ (function(module, exports) { /** @@ -129256,7 +131295,7 @@ module.exports = 'pointerupoutside'; /***/ }), -/* 822 */ +/* 827 */ /***/ (function(module, exports) { /** @@ -129294,7 +131333,7 @@ module.exports = 'wheel'; /***/ }), -/* 823 */ +/* 828 */ /***/ (function(module, exports) { /** @@ -129318,7 +131357,7 @@ module.exports = 'pointerlockchange'; /***/ }), -/* 824 */ +/* 829 */ /***/ (function(module, exports) { /** @@ -129340,7 +131379,7 @@ module.exports = 'preupdate'; /***/ }), -/* 825 */ +/* 830 */ /***/ (function(module, exports) { /** @@ -129361,7 +131400,7 @@ module.exports = 'shutdown'; /***/ }), -/* 826 */ +/* 831 */ /***/ (function(module, exports) { /** @@ -129383,7 +131422,7 @@ module.exports = 'start'; /***/ }), -/* 827 */ +/* 832 */ /***/ (function(module, exports) { /** @@ -129408,7 +131447,7 @@ module.exports = 'update'; /***/ }), -/* 828 */ +/* 833 */ /***/ (function(module, exports) { /** @@ -129467,7 +131506,7 @@ module.exports = GetInnerHeight; /***/ }), -/* 829 */ +/* 834 */ /***/ (function(module, exports) { /** @@ -129497,7 +131536,7 @@ module.exports = 'addfile'; /***/ }), -/* 830 */ +/* 835 */ /***/ (function(module, exports) { /** @@ -129525,7 +131564,7 @@ module.exports = 'complete'; /***/ }), -/* 831 */ +/* 836 */ /***/ (function(module, exports) { /** @@ -129554,7 +131593,7 @@ module.exports = 'filecomplete'; /***/ }), -/* 832 */ +/* 837 */ /***/ (function(module, exports) { /** @@ -129608,7 +131647,7 @@ module.exports = 'filecomplete-'; /***/ }), -/* 833 */ +/* 838 */ /***/ (function(module, exports) { /** @@ -129633,7 +131672,7 @@ module.exports = 'loaderror'; /***/ }), -/* 834 */ +/* 839 */ /***/ (function(module, exports) { /** @@ -129659,7 +131698,7 @@ module.exports = 'load'; /***/ }), -/* 835 */ +/* 840 */ /***/ (function(module, exports) { /** @@ -129686,7 +131725,7 @@ module.exports = 'fileprogress'; /***/ }), -/* 836 */ +/* 841 */ /***/ (function(module, exports) { /** @@ -129715,7 +131754,7 @@ module.exports = 'postprocess'; /***/ }), -/* 837 */ +/* 842 */ /***/ (function(module, exports) { /** @@ -129740,7 +131779,7 @@ module.exports = 'progress'; /***/ }), -/* 838 */ +/* 843 */ /***/ (function(module, exports) { /** @@ -129767,7 +131806,7 @@ module.exports = 'start'; /***/ }), -/* 839 */ +/* 844 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129777,7 +131816,7 @@ module.exports = 'start'; */ var GetFastValue = __webpack_require__(2); -var UppercaseFirst = __webpack_require__(347); +var UppercaseFirst = __webpack_require__(178); /** * Builds an array of which physics plugins should be activated for the given Scene. @@ -129829,7 +131868,7 @@ module.exports = GetPhysicsPlugins; /***/ }), -/* 840 */ +/* 845 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129876,7 +131915,7 @@ module.exports = GetScenePlugins; /***/ }), -/* 841 */ +/* 846 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129937,629 +131976,7 @@ module.exports = InjectionMap; /***/ }), -/* 842 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Clamp = __webpack_require__(22); -var Color = __webpack_require__(33); -var IsSizePowerOfTwo = __webpack_require__(117); -var Texture = __webpack_require__(177); - -/** - * @classdesc - * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source. - * - * You can use the properties of this texture to draw to the canvas element directly, using all of the standard - * canvas operations available in the browser. Any Game Object can be given this texture and will render with it. - * - * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to - * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this - * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep - * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading - * texture data to it. This restriction does not apply if using the Canvas Renderer. - * - * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify - * sections of the canvas using the `add` method. - * - * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying - * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause - * graphical errors. - * - * @class CanvasTexture - * @extends Phaser.Textures.Texture - * @memberof Phaser.Textures - * @constructor - * @since 3.7.0 - * - * @param {Phaser.Textures.CanvasTexture} manager - A reference to the Texture Manager this Texture belongs to. - * @param {string} key - The unique string-based key of this Texture. - * @param {HTMLCanvasElement} source - The canvas element that is used as the base of this texture. - * @param {integer} width - The width of the canvas. - * @param {integer} height - The height of the canvas. - */ -var CanvasTexture = new Class({ - - Extends: Texture, - - initialize: - - function CanvasTexture (manager, key, source, width, height) - { - Texture.call(this, manager, key, source, width, height); - - this.add('__BASE', 0, 0, 0, width, height); - - /** - * A reference to the Texture Source of this Canvas. - * - * @name Phaser.Textures.CanvasTexture#_source - * @type {Phaser.Textures.TextureSource} - * @private - * @since 3.7.0 - */ - this._source = this.frames['__BASE'].source; - - /** - * The source Canvas Element. - * - * @name Phaser.Textures.CanvasTexture#canvas - * @readonly - * @type {HTMLCanvasElement} - * @since 3.7.0 - */ - this.canvas = this._source.image; - - /** - * The 2D Canvas Rendering Context. - * - * @name Phaser.Textures.CanvasTexture#context - * @readonly - * @type {CanvasRenderingContext2D} - * @since 3.7.0 - */ - this.context = this.canvas.getContext('2d'); - - /** - * The width of the Canvas. - * This property is read-only, if you wish to change it use the `setSize` method. - * - * @name Phaser.Textures.CanvasTexture#width - * @readonly - * @type {integer} - * @since 3.7.0 - */ - this.width = width; - - /** - * The height of the Canvas. - * This property is read-only, if you wish to change it use the `setSize` method. - * - * @name Phaser.Textures.CanvasTexture#height - * @readonly - * @type {integer} - * @since 3.7.0 - */ - this.height = height; - - /** - * The context image data. - * Use the `update` method to populate this when the canvas changes. - * - * @name Phaser.Textures.CanvasTexture#imageData - * @type {ImageData} - * @since 3.13.0 - */ - this.imageData = this.context.getImageData(0, 0, width, height); - - /** - * A Uint8ClampedArray view into the `buffer`. - * Use the `update` method to populate this when the canvas changes. - * Note that this is unavailable in some browsers, such as Epic Browser, due to their security restrictions. - * - * @name Phaser.Textures.CanvasTexture#data - * @type {Uint8ClampedArray} - * @since 3.13.0 - */ - this.data = null; - - if (this.imageData) - { - this.data = this.imageData.data; - } - - /** - * An Uint32Array view into the `buffer`. - * - * @name Phaser.Textures.CanvasTexture#pixels - * @type {Uint32Array} - * @since 3.13.0 - */ - this.pixels = null; - - /** - * An ArrayBuffer the same size as the context ImageData. - * - * @name Phaser.Textures.CanvasTexture#buffer - * @type {ArrayBuffer} - * @since 3.13.0 - */ - this.buffer; - - if (this.data) - { - if (this.imageData.data.buffer) - { - this.buffer = this.imageData.data.buffer; - this.pixels = new Uint32Array(this.buffer); - } - else if (window.ArrayBuffer) - { - this.buffer = new ArrayBuffer(this.imageData.data.length); - this.pixels = new Uint32Array(this.buffer); - } - else - { - this.pixels = this.imageData.data; - } - } - }, - - /** - * This re-creates the `imageData` from the current context. - * It then re-builds the ArrayBuffer, the `data` Uint8ClampedArray reference and the `pixels` Int32Array. - * - * Warning: This is a very expensive operation, so use it sparingly. - * - * @method Phaser.Textures.CanvasTexture#update - * @since 3.13.0 - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - update: function () - { - this.imageData = this.context.getImageData(0, 0, this.width, this.height); - - this.data = this.imageData.data; - - if (this.imageData.data.buffer) - { - this.buffer = this.imageData.data.buffer; - this.pixels = new Uint32Array(this.buffer); - } - else if (window.ArrayBuffer) - { - this.buffer = new ArrayBuffer(this.imageData.data.length); - this.pixels = new Uint32Array(this.buffer); - } - else - { - this.pixels = this.imageData.data; - } - - return this; - }, - - /** - * Draws the given Image or Canvas element to this CanvasTexture, then updates the internal - * ImageData buffer and arrays. - * - * @method Phaser.Textures.CanvasTexture#draw - * @since 3.13.0 - * - * @param {integer} x - The x coordinate to draw the source at. - * @param {integer} y - The y coordinate to draw the source at. - * @param {(HTMLImageElement|HTMLCanvasElement)} source - The element to draw to this canvas. - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - draw: function (x, y, source) - { - this.context.drawImage(source, x, y); - - return this.update(); - }, - - /** - * Draws the given texture frame to this CanvasTexture, then updates the internal - * ImageData buffer and arrays. - * - * @method Phaser.Textures.CanvasTexture#drawFrame - * @since 3.16.0 - * - * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. - * @param {integer} [x=0] - The x coordinate to draw the source at. - * @param {integer} [y=0] - The y coordinate to draw the source at. - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - drawFrame: function (key, frame, x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - - var textureFrame = this.manager.getFrame(key, frame); - - if (textureFrame) - { - var cd = textureFrame.canvasData; - - var width = textureFrame.cutWidth; - var height = textureFrame.cutHeight; - var res = textureFrame.source.resolution; - - this.context.drawImage( - textureFrame.source.image, - cd.x, cd.y, - width, - height, - x, y, - width / res, - height / res - ); - - return this.update(); - } - else - { - return this; - } - }, - - /** - * Sets a pixel in the CanvasTexture to the given color and alpha values. - * - * This is an expensive operation to run in large quantities, so use sparingly. - * - * @method Phaser.Textures.CanvasTexture#setPixel - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. - * - * @return {this} This CanvasTexture. - */ - setPixel: function (x, y, red, green, blue, alpha) - { - if (alpha === undefined) { alpha = 255; } - - x = Math.abs(Math.floor(x)); - y = Math.abs(Math.floor(y)); - - var index = this.getIndex(x, y); - - if (index > -1) - { - var imageData = this.context.getImageData(x, y, 1, 1); - - imageData.data[0] = red; - imageData.data[1] = green; - imageData.data[2] = blue; - imageData.data[3] = alpha; - - this.context.putImageData(imageData, x, y); - } - - return this; - }, - - /** - * Puts the ImageData into the context of this CanvasTexture at the given coordinates. - * - * @method Phaser.Textures.CanvasTexture#putData - * @since 3.16.0 - * - * @param {ImageData} imageData - The ImageData to put at the given location. - * @param {integer} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. - * @param {integer} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. - * - * @return {this} This CanvasTexture. - */ - putData: function (imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight) - { - if (dirtyX === undefined) { dirtyX = 0; } - if (dirtyY === undefined) { dirtyY = 0; } - if (dirtyWidth === undefined) { dirtyWidth = imageData.width; } - if (dirtyHeight === undefined) { dirtyHeight = imageData.height; } - - this.context.putImageData(imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight); - - return this; - }, - - /** - * Gets an ImageData region from this CanvasTexture from the position and size specified. - * You can write this back using `CanvasTexture.putData`, or manipulate it. - * - * @method Phaser.Textures.CanvasTexture#getData - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. - * @param {integer} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. - * - * @return {ImageData} The ImageData extracted from this CanvasTexture. - */ - getData: function (x, y, width, height) - { - x = Clamp(Math.floor(x), 0, this.width - 1); - y = Clamp(Math.floor(y), 0, this.height - 1); - width = Clamp(width, 1, this.width - x); - height = Clamp(height, 1, this.height - y); - - var imageData = this.context.getImageData(x, y, width, height); - - return imageData; - }, - - /** - * Get the color of a specific pixel from this texture and store it in a Color object. - * - * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, - * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. - * - * @method Phaser.Textures.CanvasTexture#getPixel - * @since 3.13.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {Phaser.Display.Color} [out] - A Color object to store the pixel values in. If not provided a new Color object will be created. - * - * @return {Phaser.Display.Color} An object with the red, green, blue and alpha values set in the r, g, b and a properties. - */ - getPixel: function (x, y, out) - { - if (!out) - { - out = new Color(); - } - - var index = this.getIndex(x, y); - - if (index > -1) - { - var data = this.data; - - var r = data[index + 0]; - var g = data[index + 1]; - var b = data[index + 2]; - var a = data[index + 3]; - - out.setTo(r, g, b, a); - } - - return out; - }, - - /** - * Returns an array containing all of the pixels in the given region. - * - * If the requested region extends outside the bounds of this CanvasTexture, - * the region is truncated to fit. - * - * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, - * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. - * - * @method Phaser.Textures.CanvasTexture#getPixels - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} width - The width of the region to get. Must be an integer. - * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. - * - * @return {Phaser.Types.Textures.PixelConfig[]} An array of Pixel objects. - */ - getPixels: function (x, y, width, height) - { - if (height === undefined) { height = width; } - - x = Math.abs(Math.round(x)); - y = Math.abs(Math.round(y)); - - var left = Clamp(x, 0, this.width); - var right = Clamp(x + width, 0, this.width); - var top = Clamp(y, 0, this.height); - var bottom = Clamp(y + height, 0, this.height); - - var pixel = new Color(); - - var out = []; - - for (var py = top; py < bottom; py++) - { - var row = []; - - for (var px = left; px < right; px++) - { - pixel = this.getPixel(px, py, pixel); - - row.push({ x: px, y: py, color: pixel.color, alpha: pixel.alphaGL }); - } - - out.push(row); - } - - return out; - }, - - /** - * Returns the Image Data index for the given pixel in this CanvasTexture. - * - * The index can be used to read directly from the `this.data` array. - * - * The index points to the red value in the array. The subsequent 3 indexes - * point to green, blue and alpha respectively. - * - * @method Phaser.Textures.CanvasTexture#getIndex - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * - * @return {integer} - */ - getIndex: function (x, y) - { - x = Math.abs(Math.round(x)); - y = Math.abs(Math.round(y)); - - if (x < this.width && y < this.height) - { - return (x + y * this.width) * 4; - } - else - { - return -1; - } - }, - - /** - * This should be called manually if you are running under WebGL. - * It will refresh the WebGLTexture from the Canvas source. Only call this if you know that the - * canvas has changed, as there is a significant GPU texture allocation cost involved in doing so. - * - * @method Phaser.Textures.CanvasTexture#refresh - * @since 3.7.0 - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - refresh: function () - { - this._source.update(); - - return this; - }, - - /** - * Gets the Canvas Element. - * - * @method Phaser.Textures.CanvasTexture#getCanvas - * @since 3.7.0 - * - * @return {HTMLCanvasElement} The Canvas DOM element this texture is using. - */ - getCanvas: function () - { - return this.canvas; - }, - - /** - * Gets the 2D Canvas Rendering Context. - * - * @method Phaser.Textures.CanvasTexture#getContext - * @since 3.7.0 - * - * @return {CanvasRenderingContext2D} The Canvas Rendering Context this texture is using. - */ - getContext: function () - { - return this.context; - }, - - /** - * Clears the given region of this Canvas Texture, resetting it back to transparent. - * If no region is given, the whole Canvas Texture is cleared. - * - * @method Phaser.Textures.CanvasTexture#clear - * @since 3.7.0 - * - * @param {integer} [x=0] - The x coordinate of the top-left of the region to clear. - * @param {integer} [y=0] - The y coordinate of the top-left of the region to clear. - * @param {integer} [width] - The width of the region. - * @param {integer} [height] - The height of the region. - * - * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. - */ - clear: function (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = this.width; } - if (height === undefined) { height = this.height; } - - this.context.clearRect(x, y, width, height); - - return this.update(); - }, - - /** - * Changes the size of this Canvas Texture. - * - * @method Phaser.Textures.CanvasTexture#setSize - * @since 3.7.0 - * - * @param {integer} width - The new width of the Canvas. - * @param {integer} [height] - The new height of the Canvas. If not given it will use the width as the height. - * - * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. - */ - setSize: function (width, height) - { - if (height === undefined) { height = width; } - - if (width !== this.width || height !== this.height) - { - // Update the Canvas - this.canvas.width = width; - this.canvas.height = height; - - // Update the Texture Source - this._source.width = width; - this._source.height = height; - this._source.isPowerOf2 = IsSizePowerOfTwo(width, height); - - // Update the Frame - this.frames['__BASE'].setSize(width, height, 0, 0); - - this.refresh(); - } - - return this; - }, - - /** - * Destroys this Texture and releases references to its sources and frames. - * - * @method Phaser.Textures.CanvasTexture#destroy - * @since 3.16.0 - */ - destroy: function () - { - Texture.prototype.destroy.call(this); - - this._source = null; - this.canvas = null; - this.context = null; - this.imageData = null; - this.data = null; - this.pixels = null; - this.buffer = null; - } - -}); - -module.exports = CanvasTexture; - - -/***/ }), -/* 843 */ +/* 847 */ /***/ (function(module, exports) { /** @@ -130640,7 +132057,7 @@ module.exports = AtlasXML; /***/ }), -/* 844 */ +/* 848 */ /***/ (function(module, exports) { /** @@ -130675,7 +132092,7 @@ module.exports = Canvas; /***/ }), -/* 845 */ +/* 849 */ /***/ (function(module, exports) { /** @@ -130710,7 +132127,7 @@ module.exports = Image; /***/ }), -/* 846 */ +/* 850 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130719,7 +132136,7 @@ module.exports = Image; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(64); +var Clone = __webpack_require__(65); /** * Parses a Texture Atlas JSON Array and adds the Frames to the Texture. @@ -130817,7 +132234,7 @@ module.exports = JSONArray; /***/ }), -/* 847 */ +/* 851 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130826,7 +132243,7 @@ module.exports = JSONArray; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(64); +var Clone = __webpack_require__(65); /** * Parses a Texture Atlas JSON Hash and adds the Frames to the Texture. @@ -130916,7 +132333,7 @@ module.exports = JSONHash; /***/ }), -/* 848 */ +/* 852 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131041,7 +132458,7 @@ module.exports = SpriteSheet; /***/ }), -/* 849 */ +/* 853 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131232,7 +132649,7 @@ module.exports = SpriteSheetFromAtlas; /***/ }), -/* 850 */ +/* 854 */ /***/ (function(module, exports) { /** @@ -131402,7 +132819,7 @@ TextureImporter: /***/ }), -/* 851 */ +/* 855 */ /***/ (function(module, exports) { /** @@ -131433,7 +132850,7 @@ module.exports = 'complete'; /***/ }), -/* 852 */ +/* 856 */ /***/ (function(module, exports) { /** @@ -131463,7 +132880,7 @@ module.exports = 'decoded'; /***/ }), -/* 853 */ +/* 857 */ /***/ (function(module, exports) { /** @@ -131495,7 +132912,7 @@ module.exports = 'decodedall'; /***/ }), -/* 854 */ +/* 858 */ /***/ (function(module, exports) { /** @@ -131527,7 +132944,7 @@ module.exports = 'destroy'; /***/ }), -/* 855 */ +/* 859 */ /***/ (function(module, exports) { /** @@ -131560,7 +132977,7 @@ module.exports = 'detune'; /***/ }), -/* 856 */ +/* 860 */ /***/ (function(module, exports) { /** @@ -131588,7 +133005,7 @@ module.exports = 'detune'; /***/ }), -/* 857 */ +/* 861 */ /***/ (function(module, exports) { /** @@ -131615,7 +133032,7 @@ module.exports = 'mute'; /***/ }), -/* 858 */ +/* 862 */ /***/ (function(module, exports) { /** @@ -131643,7 +133060,7 @@ module.exports = 'rate'; /***/ }), -/* 859 */ +/* 863 */ /***/ (function(module, exports) { /** @@ -131670,7 +133087,7 @@ module.exports = 'volume'; /***/ }), -/* 860 */ +/* 864 */ /***/ (function(module, exports) { /** @@ -131704,7 +133121,7 @@ module.exports = 'loop'; /***/ }), -/* 861 */ +/* 865 */ /***/ (function(module, exports) { /** @@ -131738,7 +133155,7 @@ module.exports = 'looped'; /***/ }), -/* 862 */ +/* 866 */ /***/ (function(module, exports) { /** @@ -131771,7 +133188,7 @@ module.exports = 'mute'; /***/ }), -/* 863 */ +/* 867 */ /***/ (function(module, exports) { /** @@ -131798,7 +133215,7 @@ module.exports = 'pauseall'; /***/ }), -/* 864 */ +/* 868 */ /***/ (function(module, exports) { /** @@ -131830,7 +133247,7 @@ module.exports = 'pause'; /***/ }), -/* 865 */ +/* 869 */ /***/ (function(module, exports) { /** @@ -131861,7 +133278,7 @@ module.exports = 'play'; /***/ }), -/* 866 */ +/* 870 */ /***/ (function(module, exports) { /** @@ -131894,7 +133311,7 @@ module.exports = 'rate'; /***/ }), -/* 867 */ +/* 871 */ /***/ (function(module, exports) { /** @@ -131921,7 +133338,7 @@ module.exports = 'resumeall'; /***/ }), -/* 868 */ +/* 872 */ /***/ (function(module, exports) { /** @@ -131954,7 +133371,7 @@ module.exports = 'resume'; /***/ }), -/* 869 */ +/* 873 */ /***/ (function(module, exports) { /** @@ -131987,7 +133404,7 @@ module.exports = 'seek'; /***/ }), -/* 870 */ +/* 874 */ /***/ (function(module, exports) { /** @@ -132014,7 +133431,7 @@ module.exports = 'stopall'; /***/ }), -/* 871 */ +/* 875 */ /***/ (function(module, exports) { /** @@ -132046,7 +133463,7 @@ module.exports = 'stop'; /***/ }), -/* 872 */ +/* 876 */ /***/ (function(module, exports) { /** @@ -132073,7 +133490,7 @@ module.exports = 'unlocked'; /***/ }), -/* 873 */ +/* 877 */ /***/ (function(module, exports) { /** @@ -132106,7 +133523,7 @@ module.exports = 'volume'; /***/ }), -/* 874 */ +/* 878 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132121,99 +133538,99 @@ module.exports = 'volume'; var GameObjects = { - Events: __webpack_require__(110), + Events: __webpack_require__(111), - DisplayList: __webpack_require__(875), - GameObjectCreator: __webpack_require__(15), - GameObjectFactory: __webpack_require__(5), - UpdateList: __webpack_require__(903), + DisplayList: __webpack_require__(879), + GameObjectCreator: __webpack_require__(16), + GameObjectFactory: __webpack_require__(6), + UpdateList: __webpack_require__(907), Components: __webpack_require__(12), - BuildGameObject: __webpack_require__(29), - BuildGameObjectAnimation: __webpack_require__(363), + BuildGameObject: __webpack_require__(28), + BuildGameObjectAnimation: __webpack_require__(366), GameObject: __webpack_require__(13), - BitmapText: __webpack_require__(128), - Blitter: __webpack_require__(182), - Container: __webpack_require__(183), - DOMElement: __webpack_require__(365), - DynamicBitmapText: __webpack_require__(184), - Extern: __webpack_require__(367), - Graphics: __webpack_require__(185), - Group: __webpack_require__(94), - Image: __webpack_require__(95), - Particles: __webpack_require__(932), - PathFollower: __webpack_require__(379), - RenderTexture: __webpack_require__(189), - RetroFont: __webpack_require__(941), - Sprite: __webpack_require__(67), - Text: __webpack_require__(190), - TileSprite: __webpack_require__(191), - Zone: __webpack_require__(106), + BitmapText: __webpack_require__(129), + Blitter: __webpack_require__(184), + Container: __webpack_require__(185), + DOMElement: __webpack_require__(368), + DynamicBitmapText: __webpack_require__(186), + Extern: __webpack_require__(370), + Graphics: __webpack_require__(187), + Group: __webpack_require__(95), + Image: __webpack_require__(96), + Particles: __webpack_require__(936), + PathFollower: __webpack_require__(382), + RenderTexture: __webpack_require__(191), + RetroFont: __webpack_require__(945), + Sprite: __webpack_require__(68), + Text: __webpack_require__(192), + TileSprite: __webpack_require__(193), + Zone: __webpack_require__(107), // Shapes - Shape: __webpack_require__(30), - Arc: __webpack_require__(381), - Curve: __webpack_require__(382), - Ellipse: __webpack_require__(383), - Grid: __webpack_require__(384), - IsoBox: __webpack_require__(385), - IsoTriangle: __webpack_require__(386), - Line: __webpack_require__(387), - Polygon: __webpack_require__(388), - Rectangle: __webpack_require__(393), - Star: __webpack_require__(394), - Triangle: __webpack_require__(395), + Shape: __webpack_require__(29), + Arc: __webpack_require__(384), + Curve: __webpack_require__(385), + Ellipse: __webpack_require__(386), + Grid: __webpack_require__(387), + IsoBox: __webpack_require__(388), + IsoTriangle: __webpack_require__(389), + Line: __webpack_require__(390), + Polygon: __webpack_require__(391), + Rectangle: __webpack_require__(396), + Star: __webpack_require__(397), + Triangle: __webpack_require__(398), // Game Object Factories Factories: { - Blitter: __webpack_require__(986), - Container: __webpack_require__(987), - DOMElement: __webpack_require__(988), - DynamicBitmapText: __webpack_require__(989), - Extern: __webpack_require__(990), - Graphics: __webpack_require__(991), - Group: __webpack_require__(992), - Image: __webpack_require__(993), - Particles: __webpack_require__(994), - PathFollower: __webpack_require__(995), - RenderTexture: __webpack_require__(996), - Sprite: __webpack_require__(997), - StaticBitmapText: __webpack_require__(998), - Text: __webpack_require__(999), - TileSprite: __webpack_require__(1000), - Zone: __webpack_require__(1001), + Blitter: __webpack_require__(990), + Container: __webpack_require__(991), + DOMElement: __webpack_require__(992), + DynamicBitmapText: __webpack_require__(993), + Extern: __webpack_require__(994), + Graphics: __webpack_require__(995), + Group: __webpack_require__(996), + Image: __webpack_require__(997), + Particles: __webpack_require__(998), + PathFollower: __webpack_require__(999), + RenderTexture: __webpack_require__(1000), + Sprite: __webpack_require__(1001), + StaticBitmapText: __webpack_require__(1002), + Text: __webpack_require__(1003), + TileSprite: __webpack_require__(1004), + Zone: __webpack_require__(1005), // Shapes - Arc: __webpack_require__(1002), - Curve: __webpack_require__(1003), - Ellipse: __webpack_require__(1004), - Grid: __webpack_require__(1005), - IsoBox: __webpack_require__(1006), - IsoTriangle: __webpack_require__(1007), - Line: __webpack_require__(1008), - Polygon: __webpack_require__(1009), - Rectangle: __webpack_require__(1010), - Star: __webpack_require__(1011), - Triangle: __webpack_require__(1012) + Arc: __webpack_require__(1006), + Curve: __webpack_require__(1007), + Ellipse: __webpack_require__(1008), + Grid: __webpack_require__(1009), + IsoBox: __webpack_require__(1010), + IsoTriangle: __webpack_require__(1011), + Line: __webpack_require__(1012), + Polygon: __webpack_require__(1013), + Rectangle: __webpack_require__(1014), + Star: __webpack_require__(1015), + Triangle: __webpack_require__(1016) }, Creators: { - Blitter: __webpack_require__(1013), - Container: __webpack_require__(1014), - DynamicBitmapText: __webpack_require__(1015), - Graphics: __webpack_require__(1016), - Group: __webpack_require__(1017), - Image: __webpack_require__(1018), - Particles: __webpack_require__(1019), - RenderTexture: __webpack_require__(1020), - Sprite: __webpack_require__(1021), - StaticBitmapText: __webpack_require__(1022), - Text: __webpack_require__(1023), - TileSprite: __webpack_require__(1024), - Zone: __webpack_require__(1025) + Blitter: __webpack_require__(1017), + Container: __webpack_require__(1018), + DynamicBitmapText: __webpack_require__(1019), + Graphics: __webpack_require__(1020), + Group: __webpack_require__(1021), + Image: __webpack_require__(1022), + Particles: __webpack_require__(1023), + RenderTexture: __webpack_require__(1024), + Sprite: __webpack_require__(1025), + StaticBitmapText: __webpack_require__(1026), + Text: __webpack_require__(1027), + TileSprite: __webpack_require__(1028), + Zone: __webpack_require__(1029) } }; @@ -132221,29 +133638,29 @@ var GameObjects = { if (true) { // WebGL only Game Objects - GameObjects.Mesh = __webpack_require__(129); - GameObjects.Quad = __webpack_require__(194); - GameObjects.Shader = __webpack_require__(195); + GameObjects.Mesh = __webpack_require__(130); + GameObjects.Quad = __webpack_require__(196); + GameObjects.Shader = __webpack_require__(197); - GameObjects.Factories.Mesh = __webpack_require__(1032); - GameObjects.Factories.Quad = __webpack_require__(1033); - GameObjects.Factories.Shader = __webpack_require__(1034); + GameObjects.Factories.Mesh = __webpack_require__(1036); + GameObjects.Factories.Quad = __webpack_require__(1037); + GameObjects.Factories.Shader = __webpack_require__(1038); - GameObjects.Creators.Mesh = __webpack_require__(1035); - GameObjects.Creators.Quad = __webpack_require__(1036); - GameObjects.Creators.Shader = __webpack_require__(1037); + GameObjects.Creators.Mesh = __webpack_require__(1039); + GameObjects.Creators.Quad = __webpack_require__(1040); + GameObjects.Creators.Shader = __webpack_require__(1041); - GameObjects.Light = __webpack_require__(399); + GameObjects.Light = __webpack_require__(402); - __webpack_require__(400); - __webpack_require__(1038); + __webpack_require__(403); + __webpack_require__(1042); } module.exports = GameObjects; /***/ }), -/* 875 */ +/* 879 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132253,10 +133670,10 @@ module.exports = GameObjects; */ var Class = __webpack_require__(0); -var List = __webpack_require__(125); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var StableSort = __webpack_require__(127); +var List = __webpack_require__(126); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var StableSort = __webpack_require__(128); /** * @classdesc @@ -132448,7 +133865,7 @@ module.exports = DisplayList; /***/ }), -/* 876 */ +/* 880 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132463,21 +133880,21 @@ module.exports = DisplayList; module.exports = { - CheckMatrix: __webpack_require__(179), - MatrixToString: __webpack_require__(877), - ReverseColumns: __webpack_require__(878), - ReverseRows: __webpack_require__(879), - Rotate180: __webpack_require__(880), - RotateLeft: __webpack_require__(881), - RotateMatrix: __webpack_require__(126), - RotateRight: __webpack_require__(882), - TransposeMatrix: __webpack_require__(360) + CheckMatrix: __webpack_require__(181), + MatrixToString: __webpack_require__(881), + ReverseColumns: __webpack_require__(882), + ReverseRows: __webpack_require__(883), + Rotate180: __webpack_require__(884), + RotateLeft: __webpack_require__(885), + RotateMatrix: __webpack_require__(127), + RotateRight: __webpack_require__(886), + TransposeMatrix: __webpack_require__(363) }; /***/ }), -/* 877 */ +/* 881 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132486,8 +133903,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pad = __webpack_require__(158); -var CheckMatrix = __webpack_require__(179); +var Pad = __webpack_require__(159); +var CheckMatrix = __webpack_require__(181); /** * Generates a string (which you can pass to console.log) from the given Array Matrix. @@ -132558,7 +133975,7 @@ module.exports = MatrixToString; /***/ }), -/* 878 */ +/* 882 */ /***/ (function(module, exports) { /** @@ -132589,7 +134006,7 @@ module.exports = ReverseColumns; /***/ }), -/* 879 */ +/* 883 */ /***/ (function(module, exports) { /** @@ -132625,7 +134042,7 @@ module.exports = ReverseRows; /***/ }), -/* 880 */ +/* 884 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132634,7 +134051,7 @@ module.exports = ReverseRows; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(126); +var RotateMatrix = __webpack_require__(127); /** * Rotates the array matrix 180 degrees. @@ -132658,7 +134075,7 @@ module.exports = Rotate180; /***/ }), -/* 881 */ +/* 885 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132667,7 +134084,7 @@ module.exports = Rotate180; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(126); +var RotateMatrix = __webpack_require__(127); /** * Rotates the array matrix to the left (or 90 degrees) @@ -132691,7 +134108,7 @@ module.exports = RotateLeft; /***/ }), -/* 882 */ +/* 886 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132700,7 +134117,7 @@ module.exports = RotateLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(126); +var RotateMatrix = __webpack_require__(127); /** * Rotates the array matrix to the left (or -90 degrees) @@ -132724,7 +134141,7 @@ module.exports = RotateRight; /***/ }), -/* 883 */ +/* 887 */ /***/ (function(module, exports) { /** @@ -132841,7 +134258,7 @@ module.exports = Add; /***/ }), -/* 884 */ +/* 888 */ /***/ (function(module, exports) { /** @@ -132963,7 +134380,7 @@ module.exports = AddAt; /***/ }), -/* 885 */ +/* 889 */ /***/ (function(module, exports) { /** @@ -133001,7 +134418,7 @@ module.exports = BringToTop; /***/ }), -/* 886 */ +/* 890 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133010,7 +134427,7 @@ module.exports = BringToTop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Returns the total number of elements in the array which have a property matching the given value. @@ -133053,7 +134470,7 @@ module.exports = CountAllMatching; /***/ }), -/* 887 */ +/* 891 */ /***/ (function(module, exports) { /** @@ -133099,7 +134516,7 @@ module.exports = Each; /***/ }), -/* 888 */ +/* 892 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133108,7 +134525,7 @@ module.exports = Each; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Passes each element in the array, between the start and end indexes, to the given callback. @@ -133155,7 +134572,7 @@ module.exports = EachInRange; /***/ }), -/* 889 */ +/* 893 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133164,7 +134581,7 @@ module.exports = EachInRange; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Returns all elements in the array. @@ -133217,7 +134634,7 @@ module.exports = GetAll; /***/ }), -/* 890 */ +/* 894 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133226,7 +134643,7 @@ module.exports = GetAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Returns the first element in the array. @@ -133276,7 +134693,7 @@ module.exports = GetFirst; /***/ }), -/* 891 */ +/* 895 */ /***/ (function(module, exports) { /** @@ -133318,7 +134735,7 @@ module.exports = MoveDown; /***/ }), -/* 892 */ +/* 896 */ /***/ (function(module, exports) { /** @@ -133365,7 +134782,7 @@ module.exports = MoveTo; /***/ }), -/* 893 */ +/* 897 */ /***/ (function(module, exports) { /** @@ -133407,7 +134824,7 @@ module.exports = MoveUp; /***/ }), -/* 894 */ +/* 898 */ /***/ (function(module, exports) { /** @@ -133471,7 +134888,7 @@ module.exports = NumberArray; /***/ }), -/* 895 */ +/* 899 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133480,7 +134897,7 @@ module.exports = NumberArray; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RoundAwayFromZero = __webpack_require__(306); +var RoundAwayFromZero = __webpack_require__(309); /** * Create an array of numbers (positive and/or negative) progressing from `start` @@ -133548,7 +134965,7 @@ module.exports = NumberArrayStep; /***/ }), -/* 896 */ +/* 900 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133557,7 +134974,7 @@ module.exports = NumberArrayStep; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(78); +var SpliceOne = __webpack_require__(79); /** * Removes the item from the given position in the array. @@ -133599,7 +135016,7 @@ module.exports = RemoveAt; /***/ }), -/* 897 */ +/* 901 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133608,7 +135025,7 @@ module.exports = RemoveAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Removes the item within the given range in the array. @@ -133662,7 +135079,7 @@ module.exports = RemoveBetween; /***/ }), -/* 898 */ +/* 902 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133671,7 +135088,7 @@ module.exports = RemoveBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(78); +var SpliceOne = __webpack_require__(79); /** * Removes a random object from the given array and returns it. @@ -133700,7 +135117,7 @@ module.exports = RemoveRandomElement; /***/ }), -/* 899 */ +/* 903 */ /***/ (function(module, exports) { /** @@ -133743,7 +135160,7 @@ module.exports = Replace; /***/ }), -/* 900 */ +/* 904 */ /***/ (function(module, exports) { /** @@ -133781,7 +135198,7 @@ module.exports = SendToBack; /***/ }), -/* 901 */ +/* 905 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133790,7 +135207,7 @@ module.exports = SendToBack; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Scans the array for elements with the given property. If found, the property is set to the `value`. @@ -133836,7 +135253,7 @@ module.exports = SetAll; /***/ }), -/* 902 */ +/* 906 */ /***/ (function(module, exports) { /** @@ -133884,7 +135301,7 @@ module.exports = Swap; /***/ }), -/* 903 */ +/* 907 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133894,8 +135311,8 @@ module.exports = Swap; */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -134082,9 +135499,12 @@ var UpdateList = new Class({ */ update: function (time, delta) { - for (var i = 0; i < this._list.length; i++) + var list = this._list; + var length = list.length; + + for (var i = 0; i < length; i++) { - var gameObject = this._list[i]; + var gameObject = list[i]; if (gameObject.active) { @@ -134105,9 +135525,7 @@ var UpdateList = new Class({ */ remove: function (child) { - var index = this._pendingRemoval.indexOf(child); - - if (index !== -1) + if (this._list.indexOf(child) !== -1 && this._pendingRemoval.indexOf(child) === -1) { this._pendingRemoval.push(child); } @@ -134218,7 +135636,7 @@ module.exports = UpdateList; /***/ }), -/* 904 */ +/* 908 */ /***/ (function(module, exports) { /** @@ -134431,7 +135849,7 @@ module.exports = GetBitmapTextSize; /***/ }), -/* 905 */ +/* 909 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134440,7 +135858,7 @@ module.exports = GetBitmapTextSize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ParseXMLBitmapFont = __webpack_require__(181); +var ParseXMLBitmapFont = __webpack_require__(183); /** * Parse an XML Bitmap Font from an Atlas. @@ -134484,7 +135902,7 @@ module.exports = ParseFromAtlas; /***/ }), -/* 906 */ +/* 910 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134498,12 +135916,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(907); + renderWebGL = __webpack_require__(911); } if (true) { - renderCanvas = __webpack_require__(908); + renderCanvas = __webpack_require__(912); } module.exports = { @@ -134515,7 +135933,7 @@ module.exports = { /***/ }), -/* 907 */ +/* 911 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134744,7 +136162,7 @@ module.exports = BitmapTextWebGLRenderer; /***/ }), -/* 908 */ +/* 912 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134753,7 +136171,7 @@ module.exports = BitmapTextWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTransform = __webpack_require__(25); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -134919,7 +136337,7 @@ module.exports = BitmapTextCanvasRenderer; /***/ }), -/* 909 */ +/* 913 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134933,12 +136351,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(910); + renderWebGL = __webpack_require__(914); } if (true) { - renderCanvas = __webpack_require__(911); + renderCanvas = __webpack_require__(915); } module.exports = { @@ -134950,7 +136368,7 @@ module.exports = { /***/ }), -/* 910 */ +/* 914 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135080,7 +136498,7 @@ module.exports = BlitterWebGLRenderer; /***/ }), -/* 911 */ +/* 915 */ /***/ (function(module, exports) { /** @@ -135208,7 +136626,7 @@ module.exports = BlitterCanvasRenderer; /***/ }), -/* 912 */ +/* 916 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135218,7 +136636,7 @@ module.exports = BlitterCanvasRenderer; */ var Class = __webpack_require__(0); -var Frame = __webpack_require__(91); +var Frame = __webpack_require__(92); /** * @classdesc @@ -135592,7 +137010,7 @@ module.exports = Bob; /***/ }), -/* 913 */ +/* 917 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135607,12 +137025,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(914); + renderWebGL = __webpack_require__(918); } if (true) { - renderCanvas = __webpack_require__(915); + renderCanvas = __webpack_require__(919); } module.exports = { @@ -135624,7 +137042,7 @@ module.exports = { /***/ }), -/* 914 */ +/* 918 */ /***/ (function(module, exports) { /** @@ -135694,7 +137112,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent continue; } - var childAlpha = child._alpha; + var childAlpha = child.alpha; var childScrollFactorX = child.scrollFactorX; var childScrollFactorY = child.scrollFactorY; @@ -135731,7 +137149,7 @@ module.exports = ContainerWebGLRenderer; /***/ }), -/* 915 */ +/* 919 */ /***/ (function(module, exports) { /** @@ -135801,7 +137219,7 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen continue; } - var childAlpha = child._alpha; + var childAlpha = child.alpha; var childBlendMode = child._blendMode; var childScrollFactorX = child.scrollFactorX; var childScrollFactorY = child.scrollFactorY; @@ -135829,7 +137247,7 @@ module.exports = ContainerCanvasRenderer; /***/ }), -/* 916 */ +/* 920 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135843,12 +137261,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(366); + renderWebGL = __webpack_require__(369); } if (true) { - renderCanvas = __webpack_require__(366); + renderCanvas = __webpack_require__(369); } module.exports = { @@ -135860,7 +137278,7 @@ module.exports = { /***/ }), -/* 917 */ +/* 921 */ /***/ (function(module, exports) { /** @@ -135901,7 +137319,7 @@ module.exports = [ /***/ }), -/* 918 */ +/* 922 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135915,12 +137333,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(919); + renderWebGL = __webpack_require__(923); } if (true) { - renderCanvas = __webpack_require__(920); + renderCanvas = __webpack_require__(924); } module.exports = { @@ -135932,7 +137350,7 @@ module.exports = { /***/ }), -/* 919 */ +/* 923 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136238,7 +137656,7 @@ module.exports = DynamicBitmapTextWebGLRenderer; /***/ }), -/* 920 */ +/* 924 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136247,7 +137665,7 @@ module.exports = DynamicBitmapTextWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTransform = __webpack_require__(25); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -136417,7 +137835,7 @@ module.exports = DynamicBitmapTextCanvasRenderer; /***/ }), -/* 921 */ +/* 925 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136431,12 +137849,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(922); + renderWebGL = __webpack_require__(926); } if (true) { - renderCanvas = __webpack_require__(923); + renderCanvas = __webpack_require__(927); } module.exports = { @@ -136448,7 +137866,7 @@ module.exports = { /***/ }), -/* 922 */ +/* 926 */ /***/ (function(module, exports) { /** @@ -136517,13 +137935,13 @@ module.exports = ExternWebGLRenderer; /***/ }), -/* 923 */ +/* 927 */ /***/ (function(module, exports) { /***/ }), -/* 924 */ +/* 928 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136537,15 +137955,15 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(925); + renderWebGL = __webpack_require__(929); // Needed for Graphics.generateTexture - renderCanvas = __webpack_require__(371); + renderCanvas = __webpack_require__(374); } if (true) { - renderCanvas = __webpack_require__(371); + renderCanvas = __webpack_require__(374); } module.exports = { @@ -136557,7 +137975,7 @@ module.exports = { /***/ }), -/* 925 */ +/* 929 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136566,7 +137984,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Commands = __webpack_require__(186); +var Commands = __webpack_require__(188); var Utils = __webpack_require__(9); // TODO: Remove the use of this @@ -136922,7 +138340,7 @@ module.exports = GraphicsWebGLRenderer; /***/ }), -/* 926 */ +/* 930 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136936,12 +138354,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(927); + renderWebGL = __webpack_require__(931); } if (true) { - renderCanvas = __webpack_require__(928); + renderCanvas = __webpack_require__(932); } module.exports = { @@ -136953,7 +138371,7 @@ module.exports = { /***/ }), -/* 927 */ +/* 931 */ /***/ (function(module, exports) { /** @@ -136986,7 +138404,7 @@ module.exports = SpriteWebGLRenderer; /***/ }), -/* 928 */ +/* 932 */ /***/ (function(module, exports) { /** @@ -137019,7 +138437,7 @@ module.exports = SpriteCanvasRenderer; /***/ }), -/* 929 */ +/* 933 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137033,12 +138451,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(930); + renderWebGL = __webpack_require__(934); } if (true) { - renderCanvas = __webpack_require__(931); + renderCanvas = __webpack_require__(935); } module.exports = { @@ -137050,7 +138468,7 @@ module.exports = { /***/ }), -/* 930 */ +/* 934 */ /***/ (function(module, exports) { /** @@ -137083,7 +138501,7 @@ module.exports = ImageWebGLRenderer; /***/ }), -/* 931 */ +/* 935 */ /***/ (function(module, exports) { /** @@ -137116,7 +138534,7 @@ module.exports = ImageCanvasRenderer; /***/ }), -/* 932 */ +/* 936 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137131,17 +138549,17 @@ module.exports = ImageCanvasRenderer; module.exports = { - GravityWell: __webpack_require__(372), - Particle: __webpack_require__(373), - ParticleEmitter: __webpack_require__(374), - ParticleEmitterManager: __webpack_require__(188), - Zones: __webpack_require__(937) + GravityWell: __webpack_require__(375), + Particle: __webpack_require__(376), + ParticleEmitter: __webpack_require__(377), + ParticleEmitterManager: __webpack_require__(190), + Zones: __webpack_require__(941) }; /***/ }), -/* 933 */ +/* 937 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137151,10 +138569,10 @@ module.exports = { */ var Class = __webpack_require__(0); -var FloatBetween = __webpack_require__(304); -var GetEaseFunction = __webpack_require__(96); +var FloatBetween = __webpack_require__(307); +var GetEaseFunction = __webpack_require__(82); var GetFastValue = __webpack_require__(2); -var Wrap = __webpack_require__(56); +var Wrap = __webpack_require__(57); /** * @classdesc @@ -137732,7 +139150,7 @@ module.exports = EmitterOp; /***/ }), -/* 934 */ +/* 938 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137746,12 +139164,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(935); + renderWebGL = __webpack_require__(939); } if (true) { - renderCanvas = __webpack_require__(936); + renderCanvas = __webpack_require__(940); } module.exports = { @@ -137763,7 +139181,7 @@ module.exports = { /***/ }), -/* 935 */ +/* 939 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137922,7 +139340,7 @@ module.exports = ParticleManagerWebGLRenderer; /***/ }), -/* 936 */ +/* 940 */ /***/ (function(module, exports) { /** @@ -138043,7 +139461,7 @@ module.exports = ParticleManagerCanvasRenderer; /***/ }), -/* 937 */ +/* 941 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138058,15 +139476,15 @@ module.exports = ParticleManagerCanvasRenderer; module.exports = { - DeathZone: __webpack_require__(375), - EdgeZone: __webpack_require__(376), - RandomZone: __webpack_require__(378) + DeathZone: __webpack_require__(378), + EdgeZone: __webpack_require__(379), + RandomZone: __webpack_require__(381) }; /***/ }), -/* 938 */ +/* 942 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138080,12 +139498,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(939); + renderWebGL = __webpack_require__(943); } if (true) { - renderCanvas = __webpack_require__(940); + renderCanvas = __webpack_require__(944); } module.exports = { @@ -138097,7 +139515,7 @@ module.exports = { /***/ }), -/* 939 */ +/* 943 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138160,7 +139578,7 @@ module.exports = RenderTextureWebGLRenderer; /***/ }), -/* 940 */ +/* 944 */ /***/ (function(module, exports) { /** @@ -138193,7 +139611,7 @@ module.exports = RenderTextureCanvasRenderer; /***/ }), -/* 941 */ +/* 945 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138202,15 +139620,15 @@ module.exports = RenderTextureCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RETRO_FONT_CONST = __webpack_require__(942); -var Extend = __webpack_require__(17); +var RETRO_FONT_CONST = __webpack_require__(946); +var Extend = __webpack_require__(15); /** * @namespace Phaser.GameObjects.RetroFont * @since 3.6.0 */ -var RetroFont = { Parse: __webpack_require__(943) }; +var RetroFont = { Parse: __webpack_require__(947) }; // Merge in the consts RetroFont = Extend(false, RetroFont, RETRO_FONT_CONST); @@ -138219,7 +139637,7 @@ module.exports = RetroFont; /***/ }), -/* 942 */ +/* 946 */ /***/ (function(module, exports) { /** @@ -138335,7 +139753,7 @@ module.exports = RETRO_FONT_CONST; /***/ }), -/* 943 */ +/* 947 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138344,7 +139762,7 @@ module.exports = RETRO_FONT_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** * Parses a Retro Font configuration object so you can pass it to the BitmapText constructor @@ -138451,7 +139869,7 @@ module.exports = ParseRetroFont; /***/ }), -/* 944 */ +/* 948 */ /***/ (function(module, exports) { /** @@ -138533,7 +139951,7 @@ module.exports = GetTextSize; /***/ }), -/* 945 */ +/* 949 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138547,12 +139965,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(946); + renderWebGL = __webpack_require__(950); } if (true) { - renderCanvas = __webpack_require__(947); + renderCanvas = __webpack_require__(951); } module.exports = { @@ -138564,7 +139982,7 @@ module.exports = { /***/ }), -/* 946 */ +/* 950 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138629,7 +140047,7 @@ module.exports = TextWebGLRenderer; /***/ }), -/* 947 */ +/* 951 */ /***/ (function(module, exports) { /** @@ -138667,7 +140085,7 @@ module.exports = TextCanvasRenderer; /***/ }), -/* 948 */ +/* 952 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138678,8 +140096,8 @@ module.exports = TextCanvasRenderer; var Class = __webpack_require__(0); var GetAdvancedValue = __webpack_require__(14); -var GetValue = __webpack_require__(6); -var MeasureText = __webpack_require__(949); +var GetValue = __webpack_require__(5); +var MeasureText = __webpack_require__(953); // Key: [ Object Key, Default Value ] @@ -138726,7 +140144,7 @@ var propertyMap = { * @since 3.0.0 * * @param {Phaser.GameObjects.Text} text - The Text object that this TextStyle is styling. - * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The style settings to set. + * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The style settings to set. */ var TextStyle = new Class({ @@ -139012,7 +140430,7 @@ var TextStyle = new Class({ * @method Phaser.GameObjects.TextStyle#setStyle * @since 3.0.0 * - * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The style settings to set. + * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The style settings to set. * @param {boolean} [updateText=true] - Whether to update the text immediately. * @param {boolean} [setDefaults=false] - Use the default values is not set, or the local values. * @@ -139720,7 +141138,7 @@ module.exports = TextStyle; /***/ }), -/* 949 */ +/* 953 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139729,7 +141147,7 @@ module.exports = TextStyle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); +var CanvasPool = __webpack_require__(25); /** * Calculates the ascent, descent and fontSize of a given font style. @@ -139855,7 +141273,7 @@ module.exports = MeasureText; /***/ }), -/* 950 */ +/* 954 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139869,12 +141287,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(951); + renderWebGL = __webpack_require__(955); } if (true) { - renderCanvas = __webpack_require__(952); + renderCanvas = __webpack_require__(956); } module.exports = { @@ -139886,7 +141304,7 @@ module.exports = { /***/ }), -/* 951 */ +/* 955 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139946,7 +141364,7 @@ module.exports = TileSpriteWebGLRenderer; /***/ }), -/* 952 */ +/* 956 */ /***/ (function(module, exports) { /** @@ -139981,7 +141399,7 @@ module.exports = TileSpriteCanvasRenderer; /***/ }), -/* 953 */ +/* 957 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139995,12 +141413,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(954); + renderWebGL = __webpack_require__(958); } if (true) { - renderCanvas = __webpack_require__(955); + renderCanvas = __webpack_require__(959); } module.exports = { @@ -140012,7 +141430,7 @@ module.exports = { /***/ }), -/* 954 */ +/* 958 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140022,7 +141440,7 @@ module.exports = { */ var FillPathWebGL = __webpack_require__(98); -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -140090,7 +141508,7 @@ module.exports = ArcWebGLRenderer; /***/ }), -/* 955 */ +/* 959 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140101,8 +141519,8 @@ module.exports = ArcWebGLRenderer; var DegToRad = __webpack_require__(35); var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -140166,7 +141584,7 @@ module.exports = ArcCanvasRenderer; /***/ }), -/* 956 */ +/* 960 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140180,12 +141598,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(957); + renderWebGL = __webpack_require__(961); } if (true) { - renderCanvas = __webpack_require__(958); + renderCanvas = __webpack_require__(962); } module.exports = { @@ -140197,7 +141615,7 @@ module.exports = { /***/ }), -/* 957 */ +/* 961 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140207,7 +141625,7 @@ module.exports = { */ var FillPathWebGL = __webpack_require__(98); -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -140275,7 +141693,7 @@ module.exports = CurveWebGLRenderer; /***/ }), -/* 958 */ +/* 962 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140285,8 +141703,8 @@ module.exports = CurveWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -140363,7 +141781,7 @@ module.exports = CurveCanvasRenderer; /***/ }), -/* 959 */ +/* 963 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140377,12 +141795,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(960); + renderWebGL = __webpack_require__(964); } if (true) { - renderCanvas = __webpack_require__(961); + renderCanvas = __webpack_require__(965); } module.exports = { @@ -140394,7 +141812,7 @@ module.exports = { /***/ }), -/* 960 */ +/* 964 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140404,7 +141822,7 @@ module.exports = { */ var FillPathWebGL = __webpack_require__(98); -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -140472,7 +141890,7 @@ module.exports = EllipseWebGLRenderer; /***/ }), -/* 961 */ +/* 965 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140482,8 +141900,8 @@ module.exports = EllipseWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -140557,7 +141975,7 @@ module.exports = EllipseCanvasRenderer; /***/ }), -/* 962 */ +/* 966 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140571,12 +141989,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(963); + renderWebGL = __webpack_require__(967); } if (true) { - renderCanvas = __webpack_require__(964); + renderCanvas = __webpack_require__(968); } module.exports = { @@ -140588,7 +142006,7 @@ module.exports = { /***/ }), -/* 963 */ +/* 967 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140814,7 +142232,7 @@ module.exports = GridWebGLRenderer; /***/ }), -/* 964 */ +/* 968 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140824,8 +142242,8 @@ module.exports = GridWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -141003,7 +142421,7 @@ module.exports = GridCanvasRenderer; /***/ }), -/* 965 */ +/* 969 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141017,12 +142435,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(966); + renderWebGL = __webpack_require__(970); } if (true) { - renderCanvas = __webpack_require__(967); + renderCanvas = __webpack_require__(971); } module.exports = { @@ -141034,7 +142452,7 @@ module.exports = { /***/ }), -/* 966 */ +/* 970 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141192,7 +142610,7 @@ module.exports = IsoBoxWebGLRenderer; /***/ }), -/* 967 */ +/* 971 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141202,7 +142620,7 @@ module.exports = IsoBoxWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var SetTransform = __webpack_require__(25); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -141293,7 +142711,7 @@ module.exports = IsoBoxCanvasRenderer; /***/ }), -/* 968 */ +/* 972 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141307,12 +142725,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(969); + renderWebGL = __webpack_require__(973); } if (true) { - renderCanvas = __webpack_require__(970); + renderCanvas = __webpack_require__(974); } module.exports = { @@ -141324,7 +142742,7 @@ module.exports = { /***/ }), -/* 969 */ +/* 973 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141501,7 +142919,7 @@ module.exports = IsoTriangleWebGLRenderer; /***/ }), -/* 970 */ +/* 974 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141511,7 +142929,7 @@ module.exports = IsoTriangleWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var SetTransform = __webpack_require__(25); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -141615,7 +143033,7 @@ module.exports = IsoTriangleCanvasRenderer; /***/ }), -/* 971 */ +/* 975 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141629,12 +143047,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(972); + renderWebGL = __webpack_require__(976); } if (true) { - renderCanvas = __webpack_require__(973); + renderCanvas = __webpack_require__(977); } module.exports = { @@ -141646,7 +143064,7 @@ module.exports = { /***/ }), -/* 972 */ +/* 976 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141739,7 +143157,7 @@ module.exports = LineWebGLRenderer; /***/ }), -/* 973 */ +/* 977 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141748,8 +143166,8 @@ module.exports = LineWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -141796,7 +143214,7 @@ module.exports = LineCanvasRenderer; /***/ }), -/* 974 */ +/* 978 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141810,12 +143228,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(975); + renderWebGL = __webpack_require__(979); } if (true) { - renderCanvas = __webpack_require__(976); + renderCanvas = __webpack_require__(980); } module.exports = { @@ -141827,7 +143245,7 @@ module.exports = { /***/ }), -/* 975 */ +/* 979 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141837,7 +143255,7 @@ module.exports = { */ var FillPathWebGL = __webpack_require__(98); -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -141905,7 +143323,7 @@ module.exports = PolygonWebGLRenderer; /***/ }), -/* 976 */ +/* 980 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141915,8 +143333,8 @@ module.exports = PolygonWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -141990,7 +143408,7 @@ module.exports = PolygonCanvasRenderer; /***/ }), -/* 977 */ +/* 981 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142004,12 +143422,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(978); + renderWebGL = __webpack_require__(982); } if (true) { - renderCanvas = __webpack_require__(979); + renderCanvas = __webpack_require__(983); } module.exports = { @@ -142021,7 +143439,7 @@ module.exports = { /***/ }), -/* 978 */ +/* 982 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142030,7 +143448,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); var Utils = __webpack_require__(9); /** @@ -142113,7 +143531,7 @@ module.exports = RectangleWebGLRenderer; /***/ }), -/* 979 */ +/* 983 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142123,8 +143541,8 @@ module.exports = RectangleWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -142187,7 +143605,7 @@ module.exports = RectangleCanvasRenderer; /***/ }), -/* 980 */ +/* 984 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142201,12 +143619,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(981); + renderWebGL = __webpack_require__(985); } if (true) { - renderCanvas = __webpack_require__(982); + renderCanvas = __webpack_require__(986); } module.exports = { @@ -142218,7 +143636,7 @@ module.exports = { /***/ }), -/* 981 */ +/* 985 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142228,7 +143646,7 @@ module.exports = { */ var FillPathWebGL = __webpack_require__(98); -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -142296,7 +143714,7 @@ module.exports = StarWebGLRenderer; /***/ }), -/* 982 */ +/* 986 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142306,8 +143724,8 @@ module.exports = StarWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -142381,7 +143799,7 @@ module.exports = StarCanvasRenderer; /***/ }), -/* 983 */ +/* 987 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142395,12 +143813,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(984); + renderWebGL = __webpack_require__(988); } if (true) { - renderCanvas = __webpack_require__(985); + renderCanvas = __webpack_require__(989); } module.exports = { @@ -142412,7 +143830,7 @@ module.exports = { /***/ }), -/* 984 */ +/* 988 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142421,7 +143839,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); var Utils = __webpack_require__(9); /** @@ -142515,7 +143933,7 @@ module.exports = TriangleWebGLRenderer; /***/ }), -/* 985 */ +/* 989 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142525,8 +143943,8 @@ module.exports = TriangleWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -142590,7 +144008,7 @@ module.exports = TriangleCanvasRenderer; /***/ }), -/* 986 */ +/* 990 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142599,8 +144017,8 @@ module.exports = TriangleCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Blitter = __webpack_require__(182); -var GameObjectFactory = __webpack_require__(5); +var Blitter = __webpack_require__(184); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Blitter Game Object and adds it to the Scene. @@ -142632,7 +144050,7 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) /***/ }), -/* 987 */ +/* 991 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142642,8 +144060,8 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Container = __webpack_require__(183); -var GameObjectFactory = __webpack_require__(5); +var Container = __webpack_require__(185); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Container Game Object and adds it to the Scene. @@ -142666,7 +144084,7 @@ GameObjectFactory.register('container', function (x, y, children) /***/ }), -/* 988 */ +/* 992 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142675,8 +144093,8 @@ GameObjectFactory.register('container', function (x, y, children) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DOMElement = __webpack_require__(365); -var GameObjectFactory = __webpack_require__(5); +var DOMElement = __webpack_require__(368); +var GameObjectFactory = __webpack_require__(6); /** * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. @@ -142756,7 +144174,7 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) /***/ }), -/* 989 */ +/* 993 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142765,8 +144183,8 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DynamicBitmapText = __webpack_require__(184); -var GameObjectFactory = __webpack_require__(5); +var DynamicBitmapText = __webpack_require__(186); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Dynamic Bitmap Text Game Object and adds it to the Scene. @@ -142825,7 +144243,7 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size /***/ }), -/* 990 */ +/* 994 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142834,8 +144252,8 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extern = __webpack_require__(367); -var GameObjectFactory = __webpack_require__(5); +var Extern = __webpack_require__(370); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Extern Game Object and adds it to the Scene. @@ -142867,7 +144285,7 @@ GameObjectFactory.register('extern', function () /***/ }), -/* 991 */ +/* 995 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142876,8 +144294,8 @@ GameObjectFactory.register('extern', function () * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Graphics = __webpack_require__(185); -var GameObjectFactory = __webpack_require__(5); +var Graphics = __webpack_require__(187); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Graphics Game Object and adds it to the Scene. @@ -142906,7 +144324,7 @@ GameObjectFactory.register('graphics', function (config) /***/ }), -/* 992 */ +/* 996 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142915,8 +144333,8 @@ GameObjectFactory.register('graphics', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Group = __webpack_require__(94); -var GameObjectFactory = __webpack_require__(5); +var Group = __webpack_require__(95); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Group Game Object and adds it to the Scene. @@ -142938,7 +144356,7 @@ GameObjectFactory.register('group', function (children, config) /***/ }), -/* 993 */ +/* 997 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142947,8 +144365,8 @@ GameObjectFactory.register('group', function (children, config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Image = __webpack_require__(95); -var GameObjectFactory = __webpack_require__(5); +var Image = __webpack_require__(96); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Image Game Object and adds it to the Scene. @@ -142980,7 +144398,7 @@ GameObjectFactory.register('image', function (x, y, key, frame) /***/ }), -/* 994 */ +/* 998 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142989,8 +144407,8 @@ GameObjectFactory.register('image', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var ParticleEmitterManager = __webpack_require__(188); +var GameObjectFactory = __webpack_require__(6); +var ParticleEmitterManager = __webpack_require__(190); /** * Creates a new Particle Emitter Manager Game Object and adds it to the Scene. @@ -143026,7 +144444,7 @@ GameObjectFactory.register('particles', function (key, frame, emitters) /***/ }), -/* 995 */ +/* 999 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143035,8 +144453,8 @@ GameObjectFactory.register('particles', function (key, frame, emitters) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var PathFollower = __webpack_require__(379); +var GameObjectFactory = __webpack_require__(6); +var PathFollower = __webpack_require__(382); /** * Creates a new PathFollower Game Object and adds it to the Scene. @@ -143074,7 +144492,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) /***/ }), -/* 996 */ +/* 1000 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143083,8 +144501,8 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var RenderTexture = __webpack_require__(189); +var GameObjectFactory = __webpack_require__(6); +var RenderTexture = __webpack_require__(191); /** * Creates a new Render Texture Game Object and adds it to the Scene. @@ -143114,7 +144532,7 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, /***/ }), -/* 997 */ +/* 1001 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143123,8 +144541,8 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Sprite = __webpack_require__(67); +var GameObjectFactory = __webpack_require__(6); +var Sprite = __webpack_require__(68); /** * Creates a new Sprite Game Object and adds it to the Scene. @@ -143161,7 +144579,7 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) /***/ }), -/* 998 */ +/* 1002 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143170,8 +144588,8 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(128); -var GameObjectFactory = __webpack_require__(5); +var BitmapText = __webpack_require__(129); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Bitmap Text Game Object and adds it to the Scene. @@ -143225,7 +144643,7 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align /***/ }), -/* 999 */ +/* 1003 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143234,8 +144652,8 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Text = __webpack_require__(190); -var GameObjectFactory = __webpack_require__(5); +var Text = __webpack_require__(192); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Text Game Object and adds it to the Scene. @@ -143290,7 +144708,7 @@ GameObjectFactory.register('text', function (x, y, text, style) /***/ }), -/* 1000 */ +/* 1004 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143299,8 +144717,8 @@ GameObjectFactory.register('text', function (x, y, text, style) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileSprite = __webpack_require__(191); -var GameObjectFactory = __webpack_require__(5); +var TileSprite = __webpack_require__(193); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new TileSprite Game Object and adds it to the Scene. @@ -143334,7 +144752,7 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra /***/ }), -/* 1001 */ +/* 1005 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143343,8 +144761,8 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Zone = __webpack_require__(106); -var GameObjectFactory = __webpack_require__(5); +var Zone = __webpack_require__(107); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Zone Game Object and adds it to the Scene. @@ -143376,7 +144794,7 @@ GameObjectFactory.register('zone', function (x, y, width, height) /***/ }), -/* 1002 */ +/* 1006 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143385,8 +144803,8 @@ GameObjectFactory.register('zone', function (x, y, width, height) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Arc = __webpack_require__(381); -var GameObjectFactory = __webpack_require__(5); +var Arc = __webpack_require__(384); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Arc Shape Game Object and adds it to the Scene. @@ -143449,7 +144867,7 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph /***/ }), -/* 1003 */ +/* 1007 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143458,8 +144876,8 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Curve = __webpack_require__(382); +var GameObjectFactory = __webpack_require__(6); +var Curve = __webpack_require__(385); /** * Creates a new Curve Shape Game Object and adds it to the Scene. @@ -143499,7 +144917,7 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) /***/ }), -/* 1004 */ +/* 1008 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143508,8 +144926,8 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(383); -var GameObjectFactory = __webpack_require__(5); +var Ellipse = __webpack_require__(386); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Ellipse Shape Game Object and adds it to the Scene. @@ -143551,7 +144969,7 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, /***/ }), -/* 1005 */ +/* 1009 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143560,8 +144978,8 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Grid = __webpack_require__(384); +var GameObjectFactory = __webpack_require__(6); +var Grid = __webpack_require__(387); /** * Creates a new Grid Shape Game Object and adds it to the Scene. @@ -143606,7 +145024,7 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel /***/ }), -/* 1006 */ +/* 1010 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143615,8 +145033,8 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var IsoBox = __webpack_require__(385); +var GameObjectFactory = __webpack_require__(6); +var IsoBox = __webpack_require__(388); /** * Creates a new IsoBox Shape Game Object and adds it to the Scene. @@ -143657,7 +145075,7 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill /***/ }), -/* 1007 */ +/* 1011 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143666,8 +145084,8 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var IsoTriangle = __webpack_require__(386); +var GameObjectFactory = __webpack_require__(6); +var IsoTriangle = __webpack_require__(389); /** * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. @@ -143710,7 +145128,7 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed /***/ }), -/* 1008 */ +/* 1012 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143719,8 +145137,8 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Line = __webpack_require__(387); +var GameObjectFactory = __webpack_require__(6); +var Line = __webpack_require__(390); /** * Creates a new Line Shape Game Object and adds it to the Scene. @@ -143761,7 +145179,7 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, /***/ }), -/* 1009 */ +/* 1013 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143770,8 +145188,8 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Polygon = __webpack_require__(388); +var GameObjectFactory = __webpack_require__(6); +var Polygon = __webpack_require__(391); /** * Creates a new Polygon Shape Game Object and adds it to the Scene. @@ -143814,7 +145232,7 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp /***/ }), -/* 1010 */ +/* 1014 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143823,8 +145241,8 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Rectangle = __webpack_require__(393); +var GameObjectFactory = __webpack_require__(6); +var Rectangle = __webpack_require__(396); /** * Creates a new Rectangle Shape Game Object and adds it to the Scene. @@ -143859,7 +145277,7 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor /***/ }), -/* 1011 */ +/* 1015 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143868,8 +145286,8 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Star = __webpack_require__(394); -var GameObjectFactory = __webpack_require__(5); +var Star = __webpack_require__(397); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Star Shape Game Object and adds it to the Scene. @@ -143911,7 +145329,7 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad /***/ }), -/* 1012 */ +/* 1016 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143920,8 +145338,8 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Triangle = __webpack_require__(395); +var GameObjectFactory = __webpack_require__(6); +var Triangle = __webpack_require__(398); /** * Creates a new Triangle Shape Game Object and adds it to the Scene. @@ -143962,7 +145380,7 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f /***/ }), -/* 1013 */ +/* 1017 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143971,9 +145389,9 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Blitter = __webpack_require__(182); -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var Blitter = __webpack_require__(184); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); /** @@ -144012,7 +145430,7 @@ GameObjectCreator.register('blitter', function (config, addToScene) /***/ }), -/* 1014 */ +/* 1018 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144022,9 +145440,9 @@ GameObjectCreator.register('blitter', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var Container = __webpack_require__(183); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var Container = __webpack_require__(185); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); /** @@ -144061,7 +145479,7 @@ GameObjectCreator.register('container', function (config, addToScene) /***/ }), -/* 1015 */ +/* 1019 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144070,9 +145488,9 @@ GameObjectCreator.register('container', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(184); -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BitmapText = __webpack_require__(186); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); /** @@ -144112,7 +145530,7 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) /***/ }), -/* 1016 */ +/* 1020 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144121,8 +145539,8 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); -var Graphics = __webpack_require__(185); +var GameObjectCreator = __webpack_require__(16); +var Graphics = __webpack_require__(187); /** * Creates a new Graphics Game Object and returns it. @@ -144160,7 +145578,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) /***/ }), -/* 1017 */ +/* 1021 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144169,8 +145587,8 @@ GameObjectCreator.register('graphics', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); -var Group = __webpack_require__(94); +var GameObjectCreator = __webpack_require__(16); +var Group = __webpack_require__(95); /** * Creates a new Group Game Object and returns it. @@ -144193,7 +145611,7 @@ GameObjectCreator.register('group', function (config) /***/ }), -/* 1018 */ +/* 1022 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144202,10 +145620,10 @@ GameObjectCreator.register('group', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Image = __webpack_require__(95); +var Image = __webpack_require__(96); /** * Creates a new Image Game Object and returns it. @@ -144243,7 +145661,7 @@ GameObjectCreator.register('image', function (config, addToScene) /***/ }), -/* 1019 */ +/* 1023 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144252,10 +145670,10 @@ GameObjectCreator.register('image', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); var GetFastValue = __webpack_require__(2); -var ParticleEmitterManager = __webpack_require__(188); +var ParticleEmitterManager = __webpack_require__(190); /** * Creates a new Particle Emitter Manager Game Object and returns it. @@ -144300,7 +145718,7 @@ GameObjectCreator.register('particles', function (config, addToScene) /***/ }), -/* 1020 */ +/* 1024 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144309,10 +145727,10 @@ GameObjectCreator.register('particles', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var RenderTexture = __webpack_require__(189); +var RenderTexture = __webpack_require__(191); /** * Creates a new Render Texture Game Object and returns it. @@ -144352,7 +145770,7 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) /***/ }), -/* 1021 */ +/* 1025 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144361,11 +145779,11 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var BuildGameObjectAnimation = __webpack_require__(363); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var BuildGameObjectAnimation = __webpack_require__(366); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Sprite = __webpack_require__(67); +var Sprite = __webpack_require__(68); /** * Creates a new Sprite Game Object and returns it. @@ -144405,7 +145823,7 @@ GameObjectCreator.register('sprite', function (config, addToScene) /***/ }), -/* 1022 */ +/* 1026 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144414,11 +145832,11 @@ GameObjectCreator.register('sprite', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(128); -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BitmapText = __webpack_require__(129); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** * Creates a new Bitmap Text Game Object and returns it. @@ -144458,7 +145876,7 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) /***/ }), -/* 1023 */ +/* 1027 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144467,10 +145885,10 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Text = __webpack_require__(190); +var Text = __webpack_require__(192); /** * Creates a new Text Game Object and returns it. @@ -144545,7 +145963,7 @@ GameObjectCreator.register('text', function (config, addToScene) /***/ }), -/* 1024 */ +/* 1028 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144554,10 +145972,10 @@ GameObjectCreator.register('text', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var TileSprite = __webpack_require__(191); +var TileSprite = __webpack_require__(193); /** * Creates a new TileSprite Game Object and returns it. @@ -144597,7 +146015,7 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) /***/ }), -/* 1025 */ +/* 1029 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144606,9 +146024,9 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Zone = __webpack_require__(106); +var Zone = __webpack_require__(107); /** * Creates a new Zone Game Object and returns it. @@ -144636,7 +146054,7 @@ GameObjectCreator.register('zone', function (config) /***/ }), -/* 1026 */ +/* 1030 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144650,12 +146068,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1027); + renderWebGL = __webpack_require__(1031); } if (true) { - renderCanvas = __webpack_require__(1028); + renderCanvas = __webpack_require__(1032); } module.exports = { @@ -144667,7 +146085,7 @@ module.exports = { /***/ }), -/* 1027 */ +/* 1031 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144785,7 +146203,7 @@ module.exports = MeshWebGLRenderer; /***/ }), -/* 1028 */ +/* 1032 */ /***/ (function(module, exports) { /** @@ -144814,7 +146232,7 @@ module.exports = MeshCanvasRenderer; /***/ }), -/* 1029 */ +/* 1033 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144828,12 +146246,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1030); + renderWebGL = __webpack_require__(1034); } if (true) { - renderCanvas = __webpack_require__(1031); + renderCanvas = __webpack_require__(1035); } module.exports = { @@ -144845,7 +146263,7 @@ module.exports = { /***/ }), -/* 1030 */ +/* 1034 */ /***/ (function(module, exports) { /** @@ -144880,40 +146298,48 @@ var ShaderWebGLRenderer = function (renderer, src, interpolationPercentage, came renderer.clearPipeline(); - var camMatrix = src._tempMatrix1; - var shapeMatrix = src._tempMatrix2; - var calcMatrix = src._tempMatrix3; - - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) + if (src.renderToTexture) { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; + src.load(); + src.flush(); } else { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + var camMatrix = src._tempMatrix1; + var shapeMatrix = src._tempMatrix2; + var calcMatrix = src._tempMatrix3; + + shapeMatrix.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 + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + // Renderer size changed? + if (renderer.width !== src._rendererWidth || renderer.height !== src._rendererHeight) + { + src.projOrtho(0, renderer.width, renderer.height, 0); + } + + src.load(calcMatrix.matrix); + src.flush(); } - camMatrix.multiply(shapeMatrix, calcMatrix); - - // Renderer size changed? - if (renderer.width !== src._rendererWidth || renderer.height !== src._rendererHeight) - { - src.projOrtho(0, renderer.width, renderer.height, 0); - } - - src.load(calcMatrix.matrix); - src.flush(); - renderer.rebindPipeline(pipeline); }; @@ -144921,7 +146347,7 @@ module.exports = ShaderWebGLRenderer; /***/ }), -/* 1031 */ +/* 1035 */ /***/ (function(module, exports) { /** @@ -144950,7 +146376,7 @@ module.exports = ShaderCanvasRenderer; /***/ }), -/* 1032 */ +/* 1036 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144959,8 +146385,8 @@ module.exports = ShaderCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Mesh = __webpack_require__(129); -var GameObjectFactory = __webpack_require__(5); +var Mesh = __webpack_require__(130); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Mesh Game Object and adds it to the Scene. @@ -145000,7 +146426,7 @@ if (true) /***/ }), -/* 1033 */ +/* 1037 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145009,8 +146435,8 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Quad = __webpack_require__(194); -var GameObjectFactory = __webpack_require__(5); +var Quad = __webpack_require__(196); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Quad Game Object and adds it to the Scene. @@ -145046,7 +146472,7 @@ if (true) /***/ }), -/* 1034 */ +/* 1038 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145055,8 +146481,8 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Shader = __webpack_require__(195); -var GameObjectFactory = __webpack_require__(5); +var Shader = __webpack_require__(197); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Shader Game Object and adds it to the Scene. @@ -145086,7 +146512,7 @@ if (true) /***/ }), -/* 1035 */ +/* 1039 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145095,11 +146521,11 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var GetValue = __webpack_require__(6); -var Mesh = __webpack_require__(129); +var GetValue = __webpack_require__(5); +var Mesh = __webpack_require__(130); /** * Creates a new Mesh Game Object and returns it. @@ -145141,7 +146567,7 @@ GameObjectCreator.register('mesh', function (config, addToScene) /***/ }), -/* 1036 */ +/* 1040 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145150,10 +146576,10 @@ GameObjectCreator.register('mesh', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Quad = __webpack_require__(194); +var Quad = __webpack_require__(196); /** * Creates a new Quad Game Object and returns it. @@ -145191,7 +146617,7 @@ GameObjectCreator.register('quad', function (config, addToScene) /***/ }), -/* 1037 */ +/* 1041 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145200,10 +146626,10 @@ GameObjectCreator.register('quad', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Shader = __webpack_require__(195); +var Shader = __webpack_require__(197); /** * Creates a new Shader Game Object and returns it. @@ -145244,7 +146670,7 @@ GameObjectCreator.register('shader', function (config, addToScene) /***/ }), -/* 1038 */ +/* 1042 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145254,9 +146680,9 @@ GameObjectCreator.register('shader', function (config, addToScene) */ var Class = __webpack_require__(0); -var LightsManager = __webpack_require__(400); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); +var LightsManager = __webpack_require__(403); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -145360,7 +146786,7 @@ module.exports = LightsPlugin; /***/ }), -/* 1039 */ +/* 1043 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145369,29 +146795,29 @@ module.exports = LightsPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(77); +var Circle = __webpack_require__(78); -Circle.Area = __webpack_require__(1040); -Circle.Circumference = __webpack_require__(243); -Circle.CircumferencePoint = __webpack_require__(144); -Circle.Clone = __webpack_require__(1041); +Circle.Area = __webpack_require__(1044); +Circle.Circumference = __webpack_require__(246); +Circle.CircumferencePoint = __webpack_require__(145); +Circle.Clone = __webpack_require__(1045); Circle.Contains = __webpack_require__(46); -Circle.ContainsPoint = __webpack_require__(1042); -Circle.ContainsRect = __webpack_require__(1043); -Circle.CopyFrom = __webpack_require__(1044); -Circle.Equals = __webpack_require__(1045); -Circle.GetBounds = __webpack_require__(1046); -Circle.GetPoint = __webpack_require__(241); -Circle.GetPoints = __webpack_require__(242); -Circle.Offset = __webpack_require__(1047); -Circle.OffsetPoint = __webpack_require__(1048); -Circle.Random = __webpack_require__(145); +Circle.ContainsPoint = __webpack_require__(1046); +Circle.ContainsRect = __webpack_require__(1047); +Circle.CopyFrom = __webpack_require__(1048); +Circle.Equals = __webpack_require__(1049); +Circle.GetBounds = __webpack_require__(1050); +Circle.GetPoint = __webpack_require__(244); +Circle.GetPoints = __webpack_require__(245); +Circle.Offset = __webpack_require__(1051); +Circle.OffsetPoint = __webpack_require__(1052); +Circle.Random = __webpack_require__(146); module.exports = Circle; /***/ }), -/* 1040 */ +/* 1044 */ /***/ (function(module, exports) { /** @@ -145419,7 +146845,7 @@ module.exports = Area; /***/ }), -/* 1041 */ +/* 1045 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145428,7 +146854,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(77); +var Circle = __webpack_require__(78); /** * Creates a new Circle instance based on the values contained in the given source. @@ -145449,7 +146875,7 @@ module.exports = Clone; /***/ }), -/* 1042 */ +/* 1046 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145480,7 +146906,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1043 */ +/* 1047 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145516,7 +146942,7 @@ module.exports = ContainsRect; /***/ }), -/* 1044 */ +/* 1048 */ /***/ (function(module, exports) { /** @@ -145548,7 +146974,7 @@ module.exports = CopyFrom; /***/ }), -/* 1045 */ +/* 1049 */ /***/ (function(module, exports) { /** @@ -145582,7 +147008,7 @@ module.exports = Equals; /***/ }), -/* 1046 */ +/* 1050 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145591,7 +147017,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * Returns the bounds of the Circle object. @@ -145622,7 +147048,7 @@ module.exports = GetBounds; /***/ }), -/* 1047 */ +/* 1051 */ /***/ (function(module, exports) { /** @@ -145657,7 +147083,7 @@ module.exports = Offset; /***/ }), -/* 1048 */ +/* 1052 */ /***/ (function(module, exports) { /** @@ -145691,7 +147117,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1049 */ +/* 1053 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145700,29 +147126,29 @@ module.exports = OffsetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(92); +var Ellipse = __webpack_require__(93); -Ellipse.Area = __webpack_require__(1050); -Ellipse.Circumference = __webpack_require__(370); -Ellipse.CircumferencePoint = __webpack_require__(187); -Ellipse.Clone = __webpack_require__(1051); -Ellipse.Contains = __webpack_require__(93); -Ellipse.ContainsPoint = __webpack_require__(1052); -Ellipse.ContainsRect = __webpack_require__(1053); -Ellipse.CopyFrom = __webpack_require__(1054); -Ellipse.Equals = __webpack_require__(1055); -Ellipse.GetBounds = __webpack_require__(1056); -Ellipse.GetPoint = __webpack_require__(368); -Ellipse.GetPoints = __webpack_require__(369); -Ellipse.Offset = __webpack_require__(1057); -Ellipse.OffsetPoint = __webpack_require__(1058); -Ellipse.Random = __webpack_require__(152); +Ellipse.Area = __webpack_require__(1054); +Ellipse.Circumference = __webpack_require__(373); +Ellipse.CircumferencePoint = __webpack_require__(189); +Ellipse.Clone = __webpack_require__(1055); +Ellipse.Contains = __webpack_require__(94); +Ellipse.ContainsPoint = __webpack_require__(1056); +Ellipse.ContainsRect = __webpack_require__(1057); +Ellipse.CopyFrom = __webpack_require__(1058); +Ellipse.Equals = __webpack_require__(1059); +Ellipse.GetBounds = __webpack_require__(1060); +Ellipse.GetPoint = __webpack_require__(371); +Ellipse.GetPoints = __webpack_require__(372); +Ellipse.Offset = __webpack_require__(1061); +Ellipse.OffsetPoint = __webpack_require__(1062); +Ellipse.Random = __webpack_require__(153); module.exports = Ellipse; /***/ }), -/* 1050 */ +/* 1054 */ /***/ (function(module, exports) { /** @@ -145756,7 +147182,7 @@ module.exports = Area; /***/ }), -/* 1051 */ +/* 1055 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145765,7 +147191,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(92); +var Ellipse = __webpack_require__(93); /** * Creates a new Ellipse instance based on the values contained in the given source. @@ -145786,7 +147212,7 @@ module.exports = Clone; /***/ }), -/* 1052 */ +/* 1056 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145795,7 +147221,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(93); +var Contains = __webpack_require__(94); /** * Check to see if the Ellipse contains the given Point object. @@ -145817,7 +147243,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1053 */ +/* 1057 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145826,7 +147252,7 @@ module.exports = ContainsPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(93); +var Contains = __webpack_require__(94); /** * Check to see if the Ellipse contains all four points of the given Rectangle object. @@ -145853,7 +147279,7 @@ module.exports = ContainsRect; /***/ }), -/* 1054 */ +/* 1058 */ /***/ (function(module, exports) { /** @@ -145885,7 +147311,7 @@ module.exports = CopyFrom; /***/ }), -/* 1055 */ +/* 1059 */ /***/ (function(module, exports) { /** @@ -145920,7 +147346,7 @@ module.exports = Equals; /***/ }), -/* 1056 */ +/* 1060 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145929,7 +147355,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * Returns the bounds of the Ellipse object. @@ -145960,7 +147386,7 @@ module.exports = GetBounds; /***/ }), -/* 1057 */ +/* 1061 */ /***/ (function(module, exports) { /** @@ -145995,7 +147421,7 @@ module.exports = Offset; /***/ }), -/* 1058 */ +/* 1062 */ /***/ (function(module, exports) { /** @@ -146029,7 +147455,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1059 */ +/* 1063 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146039,8 +147465,8 @@ module.exports = OffsetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var CircleToCircle = __webpack_require__(403); +var Point = __webpack_require__(4); +var CircleToCircle = __webpack_require__(406); /** * Checks if two Circles intersect and returns the intersection points as a Point object array. @@ -146123,7 +147549,7 @@ module.exports = GetCircleToCircle; /***/ }), -/* 1060 */ +/* 1064 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146133,8 +147559,8 @@ module.exports = GetCircleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToCircle = __webpack_require__(196); -var CircleToRectangle = __webpack_require__(404); +var GetLineToCircle = __webpack_require__(198); +var CircleToRectangle = __webpack_require__(407); /** * Checks for intersection between a circle and a rectangle, @@ -146173,7 +147599,7 @@ module.exports = GetCircleToRectangle; /***/ }), -/* 1061 */ +/* 1065 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146182,8 +147608,8 @@ module.exports = GetCircleToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); -var RectangleToRectangle = __webpack_require__(130); +var Rectangle = __webpack_require__(11); +var RectangleToRectangle = __webpack_require__(131); /** * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. @@ -146222,7 +147648,7 @@ module.exports = GetRectangleIntersection; /***/ }), -/* 1062 */ +/* 1066 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146232,8 +147658,8 @@ module.exports = GetRectangleIntersection; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToRectangle = __webpack_require__(198); -var RectangleToRectangle = __webpack_require__(130); +var GetLineToRectangle = __webpack_require__(200); +var RectangleToRectangle = __webpack_require__(131); /** * Checks if two Rectangles intersect and returns the intersection points as a Point object array. @@ -146273,7 +147699,7 @@ module.exports = GetRectangleToRectangle; /***/ }), -/* 1063 */ +/* 1067 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146283,8 +147709,8 @@ module.exports = GetRectangleToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RectangleToTriangle = __webpack_require__(406); -var GetLineToRectangle = __webpack_require__(198); +var RectangleToTriangle = __webpack_require__(409); +var GetLineToRectangle = __webpack_require__(200); /** * Checks for intersection between Rectangle shape and Triangle shape, @@ -146321,7 +147747,7 @@ module.exports = GetRectangleToTriangle; /***/ }), -/* 1064 */ +/* 1068 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146331,8 +147757,8 @@ module.exports = GetRectangleToTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToCircle = __webpack_require__(196); -var TriangleToCircle = __webpack_require__(408); +var GetLineToCircle = __webpack_require__(198); +var TriangleToCircle = __webpack_require__(411); /** * Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array. @@ -146370,7 +147796,7 @@ module.exports = GetTriangleToCircle; /***/ }), -/* 1065 */ +/* 1069 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146380,8 +147806,8 @@ module.exports = GetTriangleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TriangleToTriangle = __webpack_require__(411); -var GetTriangleToLine = __webpack_require__(409); +var TriangleToTriangle = __webpack_require__(414); +var GetTriangleToLine = __webpack_require__(412); /** * Checks if two Triangles intersect, and returns the intersection points as a Point object array. @@ -146419,7 +147845,7 @@ module.exports = GetTriangleToTriangle; /***/ }), -/* 1066 */ +/* 1070 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146428,7 +147854,7 @@ module.exports = GetTriangleToTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PointToLine = __webpack_require__(413); +var PointToLine = __webpack_require__(416); /** * Checks if a Point is located on the given line segment. @@ -146460,7 +147886,7 @@ module.exports = PointToLineSegment; /***/ }), -/* 1067 */ +/* 1071 */ /***/ (function(module, exports) { /** @@ -146500,7 +147926,7 @@ module.exports = RectangleToValues; /***/ }), -/* 1068 */ +/* 1072 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146509,42 +147935,42 @@ module.exports = RectangleToValues; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Line = __webpack_require__(54); +var Line = __webpack_require__(55); -Line.Angle = __webpack_require__(83); -Line.BresenhamPoints = __webpack_require__(263); -Line.CenterOn = __webpack_require__(1069); -Line.Clone = __webpack_require__(1070); -Line.CopyFrom = __webpack_require__(1071); -Line.Equals = __webpack_require__(1072); -Line.Extend = __webpack_require__(1073); -Line.GetMidPoint = __webpack_require__(1074); -Line.GetNearestPoint = __webpack_require__(1075); -Line.GetNormal = __webpack_require__(1076); -Line.GetPoint = __webpack_require__(250); -Line.GetPoints = __webpack_require__(148); -Line.GetShortestDistance = __webpack_require__(1077); -Line.Height = __webpack_require__(1078); -Line.Length = __webpack_require__(55); -Line.NormalAngle = __webpack_require__(414); -Line.NormalX = __webpack_require__(1079); -Line.NormalY = __webpack_require__(1080); -Line.Offset = __webpack_require__(1081); -Line.PerpSlope = __webpack_require__(1082); -Line.Random = __webpack_require__(149); -Line.ReflectAngle = __webpack_require__(1083); -Line.Rotate = __webpack_require__(1084); -Line.RotateAroundPoint = __webpack_require__(1085); -Line.RotateAroundXY = __webpack_require__(200); -Line.SetToAngle = __webpack_require__(1086); -Line.Slope = __webpack_require__(1087); -Line.Width = __webpack_require__(1088); +Line.Angle = __webpack_require__(85); +Line.BresenhamPoints = __webpack_require__(266); +Line.CenterOn = __webpack_require__(1073); +Line.Clone = __webpack_require__(1074); +Line.CopyFrom = __webpack_require__(1075); +Line.Equals = __webpack_require__(1076); +Line.Extend = __webpack_require__(1077); +Line.GetMidPoint = __webpack_require__(1078); +Line.GetNearestPoint = __webpack_require__(1079); +Line.GetNormal = __webpack_require__(1080); +Line.GetPoint = __webpack_require__(253); +Line.GetPoints = __webpack_require__(149); +Line.GetShortestDistance = __webpack_require__(1081); +Line.Height = __webpack_require__(1082); +Line.Length = __webpack_require__(56); +Line.NormalAngle = __webpack_require__(417); +Line.NormalX = __webpack_require__(1083); +Line.NormalY = __webpack_require__(1084); +Line.Offset = __webpack_require__(1085); +Line.PerpSlope = __webpack_require__(1086); +Line.Random = __webpack_require__(150); +Line.ReflectAngle = __webpack_require__(1087); +Line.Rotate = __webpack_require__(1088); +Line.RotateAroundPoint = __webpack_require__(1089); +Line.RotateAroundXY = __webpack_require__(202); +Line.SetToAngle = __webpack_require__(1090); +Line.Slope = __webpack_require__(1091); +Line.Width = __webpack_require__(1092); module.exports = Line; /***/ }), -/* 1069 */ +/* 1073 */ /***/ (function(module, exports) { /** @@ -146584,7 +148010,7 @@ module.exports = CenterOn; /***/ }), -/* 1070 */ +/* 1074 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146593,7 +148019,7 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Line = __webpack_require__(54); +var Line = __webpack_require__(55); /** * Clone the given line. @@ -146614,7 +148040,7 @@ module.exports = Clone; /***/ }), -/* 1071 */ +/* 1075 */ /***/ (function(module, exports) { /** @@ -146645,7 +148071,7 @@ module.exports = CopyFrom; /***/ }), -/* 1072 */ +/* 1076 */ /***/ (function(module, exports) { /** @@ -146679,7 +148105,7 @@ module.exports = Equals; /***/ }), -/* 1073 */ +/* 1077 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146688,7 +148114,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); +var Length = __webpack_require__(56); /** * Extends the start and end points of a Line by the given amounts. @@ -146737,7 +148163,7 @@ module.exports = Extend; /***/ }), -/* 1074 */ +/* 1078 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146746,7 +148172,7 @@ module.exports = Extend; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Get the midpoint of the given line. @@ -146775,7 +148201,7 @@ module.exports = GetMidPoint; /***/ }), -/* 1075 */ +/* 1079 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146785,7 +148211,7 @@ module.exports = GetMidPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Get the nearest point on a line perpendicular to the given point. @@ -146830,7 +148256,7 @@ module.exports = GetNearestPoint; /***/ }), -/* 1076 */ +/* 1080 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146839,9 +148265,9 @@ module.exports = GetNearestPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Angle = __webpack_require__(83); -var Point = __webpack_require__(3); +var MATH_CONST = __webpack_require__(22); +var Angle = __webpack_require__(85); +var Point = __webpack_require__(4); /** * Calculate the normal of the given line. @@ -146874,7 +148300,7 @@ module.exports = GetNormal; /***/ }), -/* 1077 */ +/* 1081 */ /***/ (function(module, exports) { /** @@ -146921,7 +148347,7 @@ module.exports = GetShortestDistance; /***/ }), -/* 1078 */ +/* 1082 */ /***/ (function(module, exports) { /** @@ -146949,7 +148375,7 @@ module.exports = Height; /***/ }), -/* 1079 */ +/* 1083 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146958,8 +148384,8 @@ module.exports = Height; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Angle = __webpack_require__(83); +var MATH_CONST = __webpack_require__(22); +var Angle = __webpack_require__(85); /** * [description] @@ -146980,7 +148406,7 @@ module.exports = NormalX; /***/ }), -/* 1080 */ +/* 1084 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146989,8 +148415,8 @@ module.exports = NormalX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Angle = __webpack_require__(83); +var MATH_CONST = __webpack_require__(22); +var Angle = __webpack_require__(85); /** * The Y value of the normal of the given line. @@ -147012,7 +148438,7 @@ module.exports = NormalY; /***/ }), -/* 1081 */ +/* 1085 */ /***/ (function(module, exports) { /** @@ -147050,7 +148476,7 @@ module.exports = Offset; /***/ }), -/* 1082 */ +/* 1086 */ /***/ (function(module, exports) { /** @@ -147078,7 +148504,7 @@ module.exports = PerpSlope; /***/ }), -/* 1083 */ +/* 1087 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147087,8 +148513,8 @@ module.exports = PerpSlope; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Angle = __webpack_require__(83); -var NormalAngle = __webpack_require__(414); +var Angle = __webpack_require__(85); +var NormalAngle = __webpack_require__(417); /** * Calculate the reflected angle between two lines. @@ -147112,7 +148538,7 @@ module.exports = ReflectAngle; /***/ }), -/* 1084 */ +/* 1088 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147121,7 +148547,7 @@ module.exports = ReflectAngle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(200); +var RotateAroundXY = __webpack_require__(202); /** * Rotate a line around its midpoint by the given angle in radians. @@ -147148,7 +148574,7 @@ module.exports = Rotate; /***/ }), -/* 1085 */ +/* 1089 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147157,7 +148583,7 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(200); +var RotateAroundXY = __webpack_require__(202); /** * Rotate a line around a point by the given angle in radians. @@ -147182,7 +148608,7 @@ module.exports = RotateAroundPoint; /***/ }), -/* 1086 */ +/* 1090 */ /***/ (function(module, exports) { /** @@ -147222,7 +148648,7 @@ module.exports = SetToAngle; /***/ }), -/* 1087 */ +/* 1091 */ /***/ (function(module, exports) { /** @@ -147250,7 +148676,7 @@ module.exports = Slope; /***/ }), -/* 1088 */ +/* 1092 */ /***/ (function(module, exports) { /** @@ -147278,7 +148704,7 @@ module.exports = Width; /***/ }), -/* 1089 */ +/* 1093 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147287,29 +148713,29 @@ module.exports = Width; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); -Point.Ceil = __webpack_require__(1090); -Point.Clone = __webpack_require__(1091); -Point.CopyFrom = __webpack_require__(1092); -Point.Equals = __webpack_require__(1093); -Point.Floor = __webpack_require__(1094); -Point.GetCentroid = __webpack_require__(1095); -Point.GetMagnitude = __webpack_require__(415); -Point.GetMagnitudeSq = __webpack_require__(416); -Point.GetRectangleFromPoints = __webpack_require__(1096); -Point.Interpolate = __webpack_require__(1097); -Point.Invert = __webpack_require__(1098); -Point.Negative = __webpack_require__(1099); -Point.Project = __webpack_require__(1100); -Point.ProjectUnit = __webpack_require__(1101); -Point.SetMagnitude = __webpack_require__(1102); +Point.Ceil = __webpack_require__(1094); +Point.Clone = __webpack_require__(1095); +Point.CopyFrom = __webpack_require__(1096); +Point.Equals = __webpack_require__(1097); +Point.Floor = __webpack_require__(1098); +Point.GetCentroid = __webpack_require__(1099); +Point.GetMagnitude = __webpack_require__(418); +Point.GetMagnitudeSq = __webpack_require__(419); +Point.GetRectangleFromPoints = __webpack_require__(1100); +Point.Interpolate = __webpack_require__(1101); +Point.Invert = __webpack_require__(1102); +Point.Negative = __webpack_require__(1103); +Point.Project = __webpack_require__(1104); +Point.ProjectUnit = __webpack_require__(1105); +Point.SetMagnitude = __webpack_require__(1106); module.exports = Point; /***/ }), -/* 1090 */ +/* 1094 */ /***/ (function(module, exports) { /** @@ -147339,7 +148765,7 @@ module.exports = Ceil; /***/ }), -/* 1091 */ +/* 1095 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147348,7 +148774,7 @@ module.exports = Ceil; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Clone the given Point. @@ -147369,7 +148795,7 @@ module.exports = Clone; /***/ }), -/* 1092 */ +/* 1096 */ /***/ (function(module, exports) { /** @@ -147400,7 +148826,7 @@ module.exports = CopyFrom; /***/ }), -/* 1093 */ +/* 1097 */ /***/ (function(module, exports) { /** @@ -147429,7 +148855,7 @@ module.exports = Equals; /***/ }), -/* 1094 */ +/* 1098 */ /***/ (function(module, exports) { /** @@ -147459,7 +148885,7 @@ module.exports = Floor; /***/ }), -/* 1095 */ +/* 1099 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147468,7 +148894,7 @@ module.exports = Floor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Get the centroid or geometric center of a plane figure (the arithmetic mean position of all the points in the figure). @@ -147523,7 +148949,7 @@ module.exports = GetCentroid; /***/ }), -/* 1096 */ +/* 1100 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147532,7 +148958,7 @@ module.exports = GetCentroid; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * Calculates the Axis Aligned Bounding Box (or aabb) from an array of points. @@ -147593,7 +149019,7 @@ module.exports = GetRectangleFromPoints; /***/ }), -/* 1097 */ +/* 1101 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147602,7 +149028,7 @@ module.exports = GetRectangleFromPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * [description] @@ -147634,7 +149060,7 @@ module.exports = Interpolate; /***/ }), -/* 1098 */ +/* 1102 */ /***/ (function(module, exports) { /** @@ -147664,7 +149090,7 @@ module.exports = Invert; /***/ }), -/* 1099 */ +/* 1103 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147673,7 +149099,7 @@ module.exports = Invert; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Inverts a Point's coordinates. @@ -147699,7 +149125,7 @@ module.exports = Negative; /***/ }), -/* 1100 */ +/* 1104 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147708,8 +149134,8 @@ module.exports = Negative; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var GetMagnitudeSq = __webpack_require__(416); +var Point = __webpack_require__(4); +var GetMagnitudeSq = __webpack_require__(419); /** * [description] @@ -147745,7 +149171,7 @@ module.exports = Project; /***/ }), -/* 1101 */ +/* 1105 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147754,7 +149180,7 @@ module.exports = Project; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * [description] @@ -147789,7 +149215,7 @@ module.exports = ProjectUnit; /***/ }), -/* 1102 */ +/* 1106 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147798,7 +149224,7 @@ module.exports = ProjectUnit; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetMagnitude = __webpack_require__(415); +var GetMagnitude = __webpack_require__(418); /** * Changes the magnitude (length) of a two-dimensional vector without changing its direction. @@ -147833,7 +149259,7 @@ module.exports = SetMagnitude; /***/ }), -/* 1103 */ +/* 1107 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147842,23 +149268,23 @@ module.exports = SetMagnitude; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Polygon = __webpack_require__(192); +var Polygon = __webpack_require__(194); -Polygon.Clone = __webpack_require__(1104); -Polygon.Contains = __webpack_require__(193); -Polygon.ContainsPoint = __webpack_require__(1105); -Polygon.GetAABB = __webpack_require__(389); -Polygon.GetNumberArray = __webpack_require__(1106); -Polygon.GetPoints = __webpack_require__(390); -Polygon.Perimeter = __webpack_require__(391); -Polygon.Reverse = __webpack_require__(1107); -Polygon.Smooth = __webpack_require__(392); +Polygon.Clone = __webpack_require__(1108); +Polygon.Contains = __webpack_require__(195); +Polygon.ContainsPoint = __webpack_require__(1109); +Polygon.GetAABB = __webpack_require__(392); +Polygon.GetNumberArray = __webpack_require__(1110); +Polygon.GetPoints = __webpack_require__(393); +Polygon.Perimeter = __webpack_require__(394); +Polygon.Reverse = __webpack_require__(1111); +Polygon.Smooth = __webpack_require__(395); module.exports = Polygon; /***/ }), -/* 1104 */ +/* 1108 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147867,7 +149293,7 @@ module.exports = Polygon; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Polygon = __webpack_require__(192); +var Polygon = __webpack_require__(194); /** * Create a new polygon which is a copy of the specified polygon @@ -147888,7 +149314,7 @@ module.exports = Clone; /***/ }), -/* 1105 */ +/* 1109 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147897,7 +149323,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(193); +var Contains = __webpack_require__(195); /** * [description] @@ -147919,7 +149345,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1106 */ +/* 1110 */ /***/ (function(module, exports) { /** @@ -147962,7 +149388,7 @@ module.exports = GetNumberArray; /***/ }), -/* 1107 */ +/* 1111 */ /***/ (function(module, exports) { /** @@ -147994,7 +149420,7 @@ module.exports = Reverse; /***/ }), -/* 1108 */ +/* 1112 */ /***/ (function(module, exports) { /** @@ -148022,7 +149448,7 @@ module.exports = Area; /***/ }), -/* 1109 */ +/* 1113 */ /***/ (function(module, exports) { /** @@ -148055,7 +149481,7 @@ module.exports = Ceil; /***/ }), -/* 1110 */ +/* 1114 */ /***/ (function(module, exports) { /** @@ -148090,7 +149516,7 @@ module.exports = CeilAll; /***/ }), -/* 1111 */ +/* 1115 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148099,7 +149525,7 @@ module.exports = CeilAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * Creates a new Rectangle which is identical to the given one. @@ -148120,7 +149546,7 @@ module.exports = Clone; /***/ }), -/* 1112 */ +/* 1116 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148129,7 +149555,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(47); +var Contains = __webpack_require__(48); /** * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. @@ -148151,7 +149577,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1113 */ +/* 1117 */ /***/ (function(module, exports) { /** @@ -148182,7 +149608,7 @@ module.exports = CopyFrom; /***/ }), -/* 1114 */ +/* 1118 */ /***/ (function(module, exports) { /** @@ -148216,7 +149642,7 @@ module.exports = Equals; /***/ }), -/* 1115 */ +/* 1119 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148225,7 +149651,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetAspectRatio = __webpack_require__(201); +var GetAspectRatio = __webpack_require__(203); /** * Adjusts the target rectangle, changing its width, height and position, @@ -148240,7 +149666,7 @@ var GetAspectRatio = __webpack_require__(201); * @generic {Phaser.Geom.Rectangle} O - [target,$return] * * @param {Phaser.Geom.Rectangle} target - The target rectangle to adjust. - * @param {Phaser.Geom.Rectangle} source - The source rectangle to envlope the target in. + * @param {Phaser.Geom.Rectangle} source - The source rectangle to envelop the target in. * * @return {Phaser.Geom.Rectangle} The modified target rectangle instance. */ @@ -148269,7 +149695,7 @@ module.exports = FitInside; /***/ }), -/* 1116 */ +/* 1120 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148278,7 +149704,7 @@ module.exports = FitInside; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetAspectRatio = __webpack_require__(201); +var GetAspectRatio = __webpack_require__(203); /** * Adjusts the target rectangle, changing its width, height and position, @@ -148322,7 +149748,7 @@ module.exports = FitOutside; /***/ }), -/* 1117 */ +/* 1121 */ /***/ (function(module, exports) { /** @@ -148355,7 +149781,7 @@ module.exports = Floor; /***/ }), -/* 1118 */ +/* 1122 */ /***/ (function(module, exports) { /** @@ -148390,7 +149816,7 @@ module.exports = FloorAll; /***/ }), -/* 1119 */ +/* 1123 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148399,7 +149825,7 @@ module.exports = FloorAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns the center of a Rectangle as a Point. @@ -148428,7 +149854,7 @@ module.exports = GetCenter; /***/ }), -/* 1120 */ +/* 1124 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148437,13 +149863,12 @@ module.exports = GetCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); -// The size of the Rectangle object, expressed as a Point object -// with the values of the width and height properties. /** - * [description] + * The size of the Rectangle object, expressed as a Point object + * with the values of the width and height properties. * * @function Phaser.Geom.Rectangle.GetSize * @since 3.0.0 @@ -148469,7 +149894,7 @@ module.exports = GetSize; /***/ }), -/* 1121 */ +/* 1125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148478,7 +149903,7 @@ module.exports = GetSize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CenterOn = __webpack_require__(162); +var CenterOn = __webpack_require__(163); /** @@ -148511,7 +149936,7 @@ module.exports = Inflate; /***/ }), -/* 1122 */ +/* 1126 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148520,8 +149945,8 @@ module.exports = Inflate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); -var Intersects = __webpack_require__(130); +var Rectangle = __webpack_require__(11); +var Intersects = __webpack_require__(131); /** * Takes two Rectangles and first checks to see if they intersect. @@ -148562,7 +149987,7 @@ module.exports = Intersection; /***/ }), -/* 1123 */ +/* 1127 */ /***/ (function(module, exports) { /** @@ -148611,7 +150036,7 @@ module.exports = MergePoints; /***/ }), -/* 1124 */ +/* 1128 */ /***/ (function(module, exports) { /** @@ -148658,7 +150083,7 @@ module.exports = MergeRect; /***/ }), -/* 1125 */ +/* 1129 */ /***/ (function(module, exports) { /** @@ -148702,7 +150127,7 @@ module.exports = MergeXY; /***/ }), -/* 1126 */ +/* 1130 */ /***/ (function(module, exports) { /** @@ -148737,7 +150162,7 @@ module.exports = Offset; /***/ }), -/* 1127 */ +/* 1131 */ /***/ (function(module, exports) { /** @@ -148771,7 +150196,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1128 */ +/* 1132 */ /***/ (function(module, exports) { /** @@ -148805,7 +150230,7 @@ module.exports = Overlaps; /***/ }), -/* 1129 */ +/* 1133 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148814,7 +150239,7 @@ module.exports = Overlaps; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); var DegToRad = __webpack_require__(35); /** @@ -148862,7 +150287,7 @@ module.exports = PerimeterPoint; /***/ }), -/* 1130 */ +/* 1134 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148871,9 +150296,9 @@ module.exports = PerimeterPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Between = __webpack_require__(168); -var ContainsRect = __webpack_require__(418); -var Point = __webpack_require__(3); +var Between = __webpack_require__(169); +var ContainsRect = __webpack_require__(421); +var Point = __webpack_require__(4); /** * Calculates a random point that lies within the `outer` Rectangle, but outside of the `inner` Rectangle. @@ -148933,7 +150358,7 @@ module.exports = RandomOutside; /***/ }), -/* 1131 */ +/* 1135 */ /***/ (function(module, exports) { /** @@ -148962,7 +150387,7 @@ module.exports = SameDimensions; /***/ }), -/* 1132 */ +/* 1136 */ /***/ (function(module, exports) { /** @@ -149001,7 +150426,7 @@ module.exports = Scale; /***/ }), -/* 1133 */ +/* 1137 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149010,38 +150435,38 @@ module.exports = Scale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(69); +var Triangle = __webpack_require__(70); -Triangle.Area = __webpack_require__(1134); -Triangle.BuildEquilateral = __webpack_require__(1135); -Triangle.BuildFromPolygon = __webpack_require__(1136); -Triangle.BuildRight = __webpack_require__(1137); -Triangle.CenterOn = __webpack_require__(1138); -Triangle.Centroid = __webpack_require__(419); -Triangle.CircumCenter = __webpack_require__(1139); -Triangle.CircumCircle = __webpack_require__(1140); -Triangle.Clone = __webpack_require__(1141); -Triangle.Contains = __webpack_require__(81); -Triangle.ContainsArray = __webpack_require__(199); -Triangle.ContainsPoint = __webpack_require__(1142); -Triangle.CopyFrom = __webpack_require__(1143); -Triangle.Decompose = __webpack_require__(412); -Triangle.Equals = __webpack_require__(1144); -Triangle.GetPoint = __webpack_require__(396); -Triangle.GetPoints = __webpack_require__(397); -Triangle.InCenter = __webpack_require__(421); -Triangle.Perimeter = __webpack_require__(1145); -Triangle.Offset = __webpack_require__(420); -Triangle.Random = __webpack_require__(153); -Triangle.Rotate = __webpack_require__(1146); -Triangle.RotateAroundPoint = __webpack_require__(1147); -Triangle.RotateAroundXY = __webpack_require__(202); +Triangle.Area = __webpack_require__(1138); +Triangle.BuildEquilateral = __webpack_require__(1139); +Triangle.BuildFromPolygon = __webpack_require__(1140); +Triangle.BuildRight = __webpack_require__(1141); +Triangle.CenterOn = __webpack_require__(1142); +Triangle.Centroid = __webpack_require__(422); +Triangle.CircumCenter = __webpack_require__(1143); +Triangle.CircumCircle = __webpack_require__(1144); +Triangle.Clone = __webpack_require__(1145); +Triangle.Contains = __webpack_require__(83); +Triangle.ContainsArray = __webpack_require__(201); +Triangle.ContainsPoint = __webpack_require__(1146); +Triangle.CopyFrom = __webpack_require__(1147); +Triangle.Decompose = __webpack_require__(415); +Triangle.Equals = __webpack_require__(1148); +Triangle.GetPoint = __webpack_require__(399); +Triangle.GetPoints = __webpack_require__(400); +Triangle.InCenter = __webpack_require__(424); +Triangle.Perimeter = __webpack_require__(1149); +Triangle.Offset = __webpack_require__(423); +Triangle.Random = __webpack_require__(154); +Triangle.Rotate = __webpack_require__(1150); +Triangle.RotateAroundPoint = __webpack_require__(1151); +Triangle.RotateAroundXY = __webpack_require__(204); module.exports = Triangle; /***/ }), -/* 1134 */ +/* 1138 */ /***/ (function(module, exports) { /** @@ -149080,7 +150505,7 @@ module.exports = Area; /***/ }), -/* 1135 */ +/* 1139 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149089,7 +150514,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(69); +var Triangle = __webpack_require__(70); /** * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). @@ -149124,7 +150549,7 @@ module.exports = BuildEquilateral; /***/ }), -/* 1136 */ +/* 1140 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149133,8 +150558,8 @@ module.exports = BuildEquilateral; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var EarCut = __webpack_require__(63); -var Triangle = __webpack_require__(69); +var EarCut = __webpack_require__(64); +var Triangle = __webpack_require__(70); /** * [description] @@ -149199,7 +150624,7 @@ module.exports = BuildFromPolygon; /***/ }), -/* 1137 */ +/* 1141 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149208,7 +150633,7 @@ module.exports = BuildFromPolygon; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(69); +var Triangle = __webpack_require__(70); // Builds a right triangle, with one 90 degree angle and two acute angles // The x/y is the coordinate of the 90 degree angle (and will map to x1/y1 in the resulting Triangle) @@ -149248,7 +150673,7 @@ module.exports = BuildRight; /***/ }), -/* 1138 */ +/* 1142 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149257,8 +150682,8 @@ module.exports = BuildRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Centroid = __webpack_require__(419); -var Offset = __webpack_require__(420); +var Centroid = __webpack_require__(422); +var Offset = __webpack_require__(423); /** * @callback CenterFunction @@ -149301,7 +150726,7 @@ module.exports = CenterOn; /***/ }), -/* 1139 */ +/* 1143 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149310,7 +150735,7 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector2 = __webpack_require__(4); +var Vector2 = __webpack_require__(3); // Adapted from http://bjornharrtell.github.io/jsts/doc/api/jsts_geom_Triangle.js.html @@ -149377,7 +150802,7 @@ module.exports = CircumCenter; /***/ }), -/* 1140 */ +/* 1144 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149386,7 +150811,7 @@ module.exports = CircumCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(77); +var Circle = __webpack_require__(78); // Adapted from https://gist.github.com/mutoo/5617691 @@ -149460,7 +150885,7 @@ module.exports = CircumCircle; /***/ }), -/* 1141 */ +/* 1145 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149469,7 +150894,7 @@ module.exports = CircumCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(69); +var Triangle = __webpack_require__(70); /** * Clones a Triangle object. @@ -149490,7 +150915,7 @@ module.exports = Clone; /***/ }), -/* 1142 */ +/* 1146 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149499,7 +150924,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(81); +var Contains = __webpack_require__(83); /** * Tests if a triangle contains a point. @@ -149521,7 +150946,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1143 */ +/* 1147 */ /***/ (function(module, exports) { /** @@ -149552,7 +150977,7 @@ module.exports = CopyFrom; /***/ }), -/* 1144 */ +/* 1148 */ /***/ (function(module, exports) { /** @@ -149588,7 +151013,7 @@ module.exports = Equals; /***/ }), -/* 1145 */ +/* 1149 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149597,7 +151022,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); +var Length = __webpack_require__(56); // The 2D area of a triangle. The area value is always non-negative. @@ -149624,7 +151049,7 @@ module.exports = Perimeter; /***/ }), -/* 1146 */ +/* 1150 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149633,8 +151058,8 @@ module.exports = Perimeter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(202); -var InCenter = __webpack_require__(421); +var RotateAroundXY = __webpack_require__(204); +var InCenter = __webpack_require__(424); /** * Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet. @@ -149660,7 +151085,7 @@ module.exports = Rotate; /***/ }), -/* 1147 */ +/* 1151 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149669,7 +151094,7 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(202); +var RotateAroundXY = __webpack_require__(204); /** * Rotates a Triangle at a certain angle about a given Point or object with public `x` and `y` properties. @@ -149694,7 +151119,7 @@ module.exports = RotateAroundPoint; /***/ }), -/* 1148 */ +/* 1152 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149703,8 +151128,8 @@ module.exports = RotateAroundPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(175); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(176); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Input @@ -149712,16 +151137,16 @@ var Extend = __webpack_require__(17); var Input = { - CreateInteractiveObject: __webpack_require__(422), - Events: __webpack_require__(53), - Gamepad: __webpack_require__(1149), - InputManager: __webpack_require__(337), - InputPlugin: __webpack_require__(1161), - InputPluginCache: __webpack_require__(131), - Keyboard: __webpack_require__(1163), - Mouse: __webpack_require__(1180), - Pointer: __webpack_require__(340), - Touch: __webpack_require__(1181) + CreateInteractiveObject: __webpack_require__(425), + Events: __webpack_require__(54), + Gamepad: __webpack_require__(1153), + InputManager: __webpack_require__(340), + InputPlugin: __webpack_require__(1165), + InputPluginCache: __webpack_require__(132), + Keyboard: __webpack_require__(1167), + Mouse: __webpack_require__(1184), + Pointer: __webpack_require__(343), + Touch: __webpack_require__(1185) }; @@ -149732,7 +151157,7 @@ module.exports = Input; /***/ }), -/* 1149 */ +/* 1153 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149747,18 +151172,18 @@ module.exports = Input; module.exports = { - Axis: __webpack_require__(423), - Button: __webpack_require__(424), - Events: __webpack_require__(203), - Gamepad: __webpack_require__(425), - GamepadPlugin: __webpack_require__(1156), + Axis: __webpack_require__(426), + Button: __webpack_require__(427), + Events: __webpack_require__(205), + Gamepad: __webpack_require__(428), + GamepadPlugin: __webpack_require__(1160), - Configs: __webpack_require__(1157) + Configs: __webpack_require__(1161) }; /***/ }), -/* 1150 */ +/* 1154 */ /***/ (function(module, exports) { /** @@ -149787,7 +151212,7 @@ module.exports = 'down'; /***/ }), -/* 1151 */ +/* 1155 */ /***/ (function(module, exports) { /** @@ -149816,7 +151241,7 @@ module.exports = 'up'; /***/ }), -/* 1152 */ +/* 1156 */ /***/ (function(module, exports) { /** @@ -149847,7 +151272,7 @@ module.exports = 'connected'; /***/ }), -/* 1153 */ +/* 1157 */ /***/ (function(module, exports) { /** @@ -149873,7 +151298,7 @@ module.exports = 'disconnected'; /***/ }), -/* 1154 */ +/* 1158 */ /***/ (function(module, exports) { /** @@ -149905,7 +151330,7 @@ module.exports = 'down'; /***/ }), -/* 1155 */ +/* 1159 */ /***/ (function(module, exports) { /** @@ -149937,7 +151362,7 @@ module.exports = 'up'; /***/ }), -/* 1156 */ +/* 1160 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149947,12 +151372,12 @@ module.exports = 'up'; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(203); -var Gamepad = __webpack_require__(425); -var GetValue = __webpack_require__(6); -var InputPluginCache = __webpack_require__(131); -var InputEvents = __webpack_require__(53); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(205); +var Gamepad = __webpack_require__(428); +var GetValue = __webpack_require__(5); +var InputPluginCache = __webpack_require__(132); +var InputEvents = __webpack_require__(54); /** * @classdesc @@ -150577,7 +152002,7 @@ module.exports = GamepadPlugin; /***/ }), -/* 1157 */ +/* 1161 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150592,15 +152017,15 @@ module.exports = GamepadPlugin; module.exports = { - DUALSHOCK_4: __webpack_require__(1158), - SNES_USB: __webpack_require__(1159), - XBOX_360: __webpack_require__(1160) + DUALSHOCK_4: __webpack_require__(1162), + SNES_USB: __webpack_require__(1163), + XBOX_360: __webpack_require__(1164) }; /***/ }), -/* 1158 */ +/* 1162 */ /***/ (function(module, exports) { /** @@ -150650,7 +152075,7 @@ module.exports = { /***/ }), -/* 1159 */ +/* 1163 */ /***/ (function(module, exports) { /** @@ -150689,7 +152114,7 @@ module.exports = { /***/ }), -/* 1160 */ +/* 1164 */ /***/ (function(module, exports) { /** @@ -150740,7 +152165,7 @@ module.exports = { /***/ }), -/* 1161 */ +/* 1165 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150749,26 +152174,27 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(77); +var Circle = __webpack_require__(78); var CircleContains = __webpack_require__(46); var Class = __webpack_require__(0); -var CONST = __webpack_require__(175); -var CreateInteractiveObject = __webpack_require__(422); -var CreatePixelPerfectHandler = __webpack_require__(1162); -var DistanceBetween = __webpack_require__(57); -var Ellipse = __webpack_require__(92); -var EllipseContains = __webpack_require__(93); -var Events = __webpack_require__(53); -var EventEmitter = __webpack_require__(11); +var CONST = __webpack_require__(176); +var CreateInteractiveObject = __webpack_require__(425); +var CreatePixelPerfectHandler = __webpack_require__(1166); +var DistanceBetween = __webpack_require__(58); +var Ellipse = __webpack_require__(93); +var EllipseContains = __webpack_require__(94); +var Events = __webpack_require__(54); +var EventEmitter = __webpack_require__(10); var GetFastValue = __webpack_require__(2); -var InputPluginCache = __webpack_require__(131); +var GEOM_CONST = __webpack_require__(47); +var InputPluginCache = __webpack_require__(132); var IsPlainObject = __webpack_require__(7); -var PluginCache = __webpack_require__(18); -var Rectangle = __webpack_require__(10); -var RectangleContains = __webpack_require__(47); -var SceneEvents = __webpack_require__(19); -var Triangle = __webpack_require__(69); -var TriangleContains = __webpack_require__(81); +var PluginCache = __webpack_require__(19); +var Rectangle = __webpack_require__(11); +var RectangleContains = __webpack_require__(48); +var SceneEvents = __webpack_require__(20); +var Triangle = __webpack_require__(70); +var TriangleContains = __webpack_require__(83); /** * @classdesc @@ -151289,17 +152715,35 @@ var InputPlugin = new Class({ return false; } - // So the Gamepad and Keyboard update, regardless + // The plugins should update every frame, regardless if there has been + // any DOM input events or not (such as the Gamepad and Keyboard) this.pluginEvents.emit(Events.UPDATE, time, delta); - // Nothing else? Let's leave - if (this._list.length === 0 || this._updatedThisFrame) + // We can leave now if we've already updated once this frame via the immediate DOM event handlers + if (this._updatedThisFrame) { this._updatedThisFrame = false; return false; } + var i; + var manager = this.manager; + + var pointers = manager.pointers; + var pointersTotal = manager.pointersTotal; + + for (i = 0; i < pointersTotal; i++) + { + pointers[i].updateMotion(); + } + + // No point going any further if there aren't any interactive objects + if (this._list.length === 0) + { + return false; + } + var rate = this.pollRate; if (rate === -1) @@ -151323,15 +152767,12 @@ var InputPlugin = new Class({ } // We got this far? Then we should poll for movement - var manager = this.manager; - - var pointers = manager.pointers; - var pointersTotal = manager.pointersTotal; var captured = false; - for (var i = 0; i < pointersTotal; i++) + for (i = 0; i < pointersTotal; i++) { var total = 0; + var pointer = pointers[i]; // Always reset this array @@ -151714,7 +153155,7 @@ var InputPlugin = new Class({ } // If they released outside the canvas, but pressed down inside it, we'll still dispatch the event. - if (!aborted) + if (!aborted && this.manager) { if (pointer.downElement === this.manager.game.canvas) { @@ -152666,7 +154107,7 @@ var InputPlugin = new Class({ } // If they released outside the canvas, but pressed down inside it, we'll still dispatch the event. - if (!aborted) + if (!aborted && this.manager) { if (pointer.upElement === this.manager.game.canvas) { @@ -152846,6 +154287,7 @@ var InputPlugin = new Class({ var cursor = false; var useHandCursor = false; var pixelPerfect = false; + var customHitArea = true; // Config object? if (IsPlainObject(shape)) @@ -152872,6 +154314,7 @@ var InputPlugin = new Class({ if (!shape || !callback) { this.setHitAreaFromTexture(gameObjects); + customHitArea = false; } } else if (typeof shape === 'function' && !callback) @@ -152892,7 +154335,7 @@ var InputPlugin = new Class({ var io = (!gameObject.input) ? CreateInteractiveObject(gameObject, shape, callback) : gameObject.input; - io.customHitArea = true; + io.customHitArea = customHitArea; io.dropZone = dropZone; io.cursor = (useHandCursor) ? 'pointer' : cursor; @@ -153068,6 +154511,145 @@ var InputPlugin = new Class({ return this.setHitArea(gameObjects, shape, callback); }, + /** + * Creates an Input Debug Shape for the given Game Object. + * + * The Game Object must have _already_ been enabled for input prior to calling this method. + * + * This is intended to assist you during development and debugging. + * + * Debug Shapes can only be created for Game Objects that are using standard Phaser Geometry for input, + * including: Circle, Ellipse, Line, Polygon, Rectangle and Triangle. + * + * Game Objects that are using their automatic hit areas are using Rectangles by default, so will also work. + * + * The Debug Shape is created and added to the display list and is then kept in sync with the Game Object + * it is connected with. Should you need to modify it yourself, such as to hide it, you can access it via + * the Game Object property: `GameObject.input.hitAreaDebug`. + * + * Calling this method on a Game Object that already has a Debug Shape will first destroy the old shape, + * before creating a new one. If you wish to remove the Debug Shape entirely, you should call the + * method `InputPlugin.removeDebug`. + * + * Note that the debug shape will only show the outline of the input area. If the input test is using a + * pixel perfect check, for example, then this is not displayed. If you are using a custom shape, that + * doesn't extend one of the base Phaser Geometry objects, as your hit area, then this method will not + * work. + * + * @method Phaser.Input.InputPlugin#enableDebug + * @since 3.19.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to create the input debug shape for. + * @param {number} [color=0x00ff00] - The outline color of the debug shape. + * + * @return {Phaser.Input.InputPlugin} This Input Plugin. + */ + enableDebug: function (gameObject, color) + { + if (color === undefined) { color = 0x00ff00; } + + var input = gameObject.input; + + if (!input || !input.hitArea) + { + return this; + } + + var shape = input.hitArea; + var shapeType = shape.type; + var debug = input.hitAreaDebug; + var factory = this.systems.add; + var updateList = this.systems.updateList; + + if (debug) + { + updateList.remove(debug); + + debug.destroy(); + + debug = null; + } + + switch (shapeType) + { + case GEOM_CONST.CIRCLE: + debug = factory.arc(0, 0, shape.radius); + break; + + case GEOM_CONST.ELLIPSE: + debug = factory.ellipse(0, 0, shape.width, shape.height); + break; + + case GEOM_CONST.LINE: + debug = factory.line(0, 0, shape.x1, shape.y1, shape.x2, shape.y2); + break; + + case GEOM_CONST.POLYGON: + debug = factory.polygon(0, 0, shape.points); + break; + + case GEOM_CONST.RECTANGLE: + debug = factory.rectangle(0, 0, shape.width, shape.height); + break; + + case GEOM_CONST.TRIANGLE: + debug = factory.triangle(0, 0, shape.x1, shape.y1, shape.x2, shape.y2, shape.x3, shape.y3); + break; + } + + if (debug) + { + debug.isFilled = false; + + debug.preUpdate = function () + { + debug.setStrokeStyle(1 / gameObject.scale, color); + + debug.setDisplayOrigin(gameObject.displayOriginX, gameObject.displayOriginY); + debug.setRotation(gameObject.rotation); + debug.setScale(gameObject.scaleX, gameObject.scaleY); + debug.setPosition(gameObject.x, gameObject.y); + debug.setScrollFactor(gameObject.scrollFactorX, gameObject.scrollFactorY); + }; + + updateList.add(debug); + + input.hitAreaDebug = debug; + } + + return this; + }, + + /** + * Removes an Input Debug Shape from the given Game Object. + * + * The shape is destroyed immediately and the `hitAreaDebug` property is set to `null`. + * + * @method Phaser.Input.InputPlugin#removeDebug + * @since 3.19.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to remove the input debug shape from. + * + * @return {Phaser.Input.InputPlugin} This Input Plugin. + */ + removeDebug: function (gameObject) + { + var input = gameObject.input; + + if (input && input.hitAreaDebug) + { + var debug = input.hitAreaDebug; + + this.systems.updateList.remove(debug); + + debug.destroy(); + + input.hitAreaDebug = null; + } + + return this; + }, + /** * Sets the Pointers to always poll. * @@ -153709,7 +155291,7 @@ module.exports = InputPlugin; /***/ }), -/* 1162 */ +/* 1166 */ /***/ (function(module, exports) { /** @@ -153745,7 +155327,7 @@ module.exports = CreatePixelPerfectHandler; /***/ }), -/* 1163 */ +/* 1167 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153760,26 +155342,26 @@ module.exports = CreatePixelPerfectHandler; module.exports = { - Events: __webpack_require__(132), + Events: __webpack_require__(133), - KeyboardManager: __webpack_require__(338), - KeyboardPlugin: __webpack_require__(1171), + KeyboardManager: __webpack_require__(341), + KeyboardPlugin: __webpack_require__(1175), - Key: __webpack_require__(426), - KeyCodes: __webpack_require__(121), + Key: __webpack_require__(429), + KeyCodes: __webpack_require__(122), - KeyCombo: __webpack_require__(427), + KeyCombo: __webpack_require__(430), - JustDown: __webpack_require__(1176), - JustUp: __webpack_require__(1177), - DownDuration: __webpack_require__(1178), - UpDuration: __webpack_require__(1179) + JustDown: __webpack_require__(1180), + JustUp: __webpack_require__(1181), + DownDuration: __webpack_require__(1182), + UpDuration: __webpack_require__(1183) }; /***/ }), -/* 1164 */ +/* 1168 */ /***/ (function(module, exports) { /** @@ -153815,7 +155397,7 @@ module.exports = 'keydown'; /***/ }), -/* 1165 */ +/* 1169 */ /***/ (function(module, exports) { /** @@ -153844,7 +155426,7 @@ module.exports = 'keyup'; /***/ }), -/* 1166 */ +/* 1170 */ /***/ (function(module, exports) { /** @@ -153878,7 +155460,7 @@ module.exports = 'keycombomatch'; /***/ }), -/* 1167 */ +/* 1171 */ /***/ (function(module, exports) { /** @@ -153912,7 +155494,7 @@ module.exports = 'down'; /***/ }), -/* 1168 */ +/* 1172 */ /***/ (function(module, exports) { /** @@ -153951,7 +155533,7 @@ module.exports = 'keydown-'; /***/ }), -/* 1169 */ +/* 1173 */ /***/ (function(module, exports) { /** @@ -153983,7 +155565,7 @@ module.exports = 'keyup-'; /***/ }), -/* 1170 */ +/* 1174 */ /***/ (function(module, exports) { /** @@ -154017,7 +155599,7 @@ module.exports = 'up'; /***/ }), -/* 1171 */ +/* 1175 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154027,17 +155609,17 @@ module.exports = 'up'; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(132); -var GameEvents = __webpack_require__(28); -var GetValue = __webpack_require__(6); -var InputEvents = __webpack_require__(53); -var InputPluginCache = __webpack_require__(131); -var Key = __webpack_require__(426); -var KeyCodes = __webpack_require__(121); -var KeyCombo = __webpack_require__(427); -var KeyMap = __webpack_require__(1175); -var SnapFloor = __webpack_require__(90); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(133); +var GameEvents = __webpack_require__(18); +var GetValue = __webpack_require__(5); +var InputEvents = __webpack_require__(54); +var InputPluginCache = __webpack_require__(132); +var Key = __webpack_require__(429); +var KeyCodes = __webpack_require__(122); +var KeyCombo = __webpack_require__(430); +var KeyMap = __webpack_require__(1179); +var SnapFloor = __webpack_require__(91); /** * @classdesc @@ -154903,7 +156485,7 @@ module.exports = KeyboardPlugin; /***/ }), -/* 1172 */ +/* 1176 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154912,7 +156494,7 @@ module.exports = KeyboardPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AdvanceKeyCombo = __webpack_require__(1173); +var AdvanceKeyCombo = __webpack_require__(1177); /** * Used internally by the KeyCombo class. @@ -154984,7 +156566,7 @@ module.exports = ProcessKeyCombo; /***/ }), -/* 1173 */ +/* 1177 */ /***/ (function(module, exports) { /** @@ -155026,7 +156608,7 @@ module.exports = AdvanceKeyCombo; /***/ }), -/* 1174 */ +/* 1178 */ /***/ (function(module, exports) { /** @@ -155061,7 +156643,7 @@ module.exports = ResetKeyCombo; /***/ }), -/* 1175 */ +/* 1179 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155070,7 +156652,7 @@ module.exports = ResetKeyCombo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var KeyCodes = __webpack_require__(121); +var KeyCodes = __webpack_require__(122); var KeyMap = {}; @@ -155083,7 +156665,7 @@ module.exports = KeyMap; /***/ }), -/* 1176 */ +/* 1180 */ /***/ (function(module, exports) { /** @@ -155125,7 +156707,7 @@ module.exports = JustDown; /***/ }), -/* 1177 */ +/* 1181 */ /***/ (function(module, exports) { /** @@ -155167,7 +156749,7 @@ module.exports = JustUp; /***/ }), -/* 1178 */ +/* 1182 */ /***/ (function(module, exports) { /** @@ -155201,7 +156783,7 @@ module.exports = DownDuration; /***/ }), -/* 1179 */ +/* 1183 */ /***/ (function(module, exports) { /** @@ -155235,7 +156817,7 @@ module.exports = UpDuration; /***/ }), -/* 1180 */ +/* 1184 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155251,14 +156833,14 @@ module.exports = UpDuration; /* eslint-disable */ module.exports = { - MouseManager: __webpack_require__(339) + MouseManager: __webpack_require__(342) }; /* eslint-enable */ /***/ }), -/* 1181 */ +/* 1185 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155274,14 +156856,14 @@ module.exports = { /* eslint-disable */ module.exports = { - TouchManager: __webpack_require__(341) + TouchManager: __webpack_require__(344) }; /* eslint-enable */ /***/ }), -/* 1182 */ +/* 1186 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155290,8 +156872,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(16); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(17); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Loader @@ -155299,18 +156881,18 @@ var Extend = __webpack_require__(17); var Loader = { - Events: __webpack_require__(80), + Events: __webpack_require__(81), - FileTypes: __webpack_require__(1183), + FileTypes: __webpack_require__(1187), - File: __webpack_require__(20), + File: __webpack_require__(21), FileTypesManager: __webpack_require__(8), - GetURL: __webpack_require__(204), - LoaderPlugin: __webpack_require__(1206), - MergeXHRSettings: __webpack_require__(205), - MultiFile: __webpack_require__(59), - XHRLoader: __webpack_require__(428), - XHRSettings: __webpack_require__(133) + GetURL: __webpack_require__(206), + LoaderPlugin: __webpack_require__(1210), + MergeXHRSettings: __webpack_require__(207), + MultiFile: __webpack_require__(60), + XHRLoader: __webpack_require__(431), + XHRSettings: __webpack_require__(134) }; @@ -155321,7 +156903,7 @@ module.exports = Loader; /***/ }), -/* 1183 */ +/* 1187 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155336,41 +156918,41 @@ module.exports = Loader; module.exports = { - AnimationJSONFile: __webpack_require__(1184), - AtlasJSONFile: __webpack_require__(1185), - AtlasXMLFile: __webpack_require__(1186), - AudioFile: __webpack_require__(429), - AudioSpriteFile: __webpack_require__(1187), - BinaryFile: __webpack_require__(1188), - BitmapFontFile: __webpack_require__(1189), - CSSFile: __webpack_require__(1190), - GLSLFile: __webpack_require__(1191), - HTML5AudioFile: __webpack_require__(430), - HTMLFile: __webpack_require__(1192), - HTMLTextureFile: __webpack_require__(1193), - ImageFile: __webpack_require__(70), - JSONFile: __webpack_require__(58), - MultiAtlasFile: __webpack_require__(1194), - MultiScriptFile: __webpack_require__(1195), - PackFile: __webpack_require__(1196), - PluginFile: __webpack_require__(1197), - SceneFile: __webpack_require__(1198), - ScenePluginFile: __webpack_require__(1199), - ScriptFile: __webpack_require__(431), - SpriteSheetFile: __webpack_require__(1200), - SVGFile: __webpack_require__(1201), - TextFile: __webpack_require__(432), - TilemapCSVFile: __webpack_require__(1202), - TilemapImpactFile: __webpack_require__(1203), - TilemapJSONFile: __webpack_require__(1204), - UnityAtlasFile: __webpack_require__(1205), - XMLFile: __webpack_require__(206) + AnimationJSONFile: __webpack_require__(1188), + AtlasJSONFile: __webpack_require__(1189), + AtlasXMLFile: __webpack_require__(1190), + AudioFile: __webpack_require__(432), + AudioSpriteFile: __webpack_require__(1191), + BinaryFile: __webpack_require__(1192), + BitmapFontFile: __webpack_require__(1193), + CSSFile: __webpack_require__(1194), + GLSLFile: __webpack_require__(1195), + HTML5AudioFile: __webpack_require__(433), + HTMLFile: __webpack_require__(1196), + HTMLTextureFile: __webpack_require__(1197), + ImageFile: __webpack_require__(71), + JSONFile: __webpack_require__(59), + MultiAtlasFile: __webpack_require__(1198), + MultiScriptFile: __webpack_require__(1199), + PackFile: __webpack_require__(1200), + PluginFile: __webpack_require__(1201), + SceneFile: __webpack_require__(1202), + ScenePluginFile: __webpack_require__(1203), + ScriptFile: __webpack_require__(434), + SpriteSheetFile: __webpack_require__(1204), + SVGFile: __webpack_require__(1205), + TextFile: __webpack_require__(435), + TilemapCSVFile: __webpack_require__(1206), + TilemapImpactFile: __webpack_require__(1207), + TilemapJSONFile: __webpack_require__(1208), + UnityAtlasFile: __webpack_require__(1209), + XMLFile: __webpack_require__(208) }; /***/ }), -/* 1184 */ +/* 1188 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155381,8 +156963,8 @@ module.exports = { var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(58); -var LoaderEvents = __webpack_require__(80); +var JSONFile = __webpack_require__(59); +var LoaderEvents = __webpack_require__(81); /** * @classdesc @@ -155573,7 +157155,7 @@ module.exports = AnimationJSONFile; /***/ }), -/* 1185 */ +/* 1189 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155585,10 +157167,10 @@ module.exports = AnimationJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(58); -var MultiFile = __webpack_require__(59); +var JSONFile = __webpack_require__(59); +var MultiFile = __webpack_require__(60); /** * @classdesc @@ -155822,7 +157404,7 @@ module.exports = AtlasJSONFile; /***/ }), -/* 1186 */ +/* 1190 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155834,10 +157416,10 @@ module.exports = AtlasJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(59); -var XMLFile = __webpack_require__(206); +var MultiFile = __webpack_require__(60); +var XMLFile = __webpack_require__(208); /** * @classdesc @@ -156065,7 +157647,7 @@ module.exports = AtlasXMLFile; /***/ }), -/* 1187 */ +/* 1191 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156074,13 +157656,13 @@ module.exports = AtlasXMLFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AudioFile = __webpack_require__(429); +var AudioFile = __webpack_require__(432); var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(58); -var MultiFile = __webpack_require__(59); +var JSONFile = __webpack_require__(59); +var MultiFile = __webpack_require__(60); /** * @classdesc @@ -156355,7 +157937,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio /***/ }), -/* 1188 */ +/* 1192 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156365,8 +157947,8 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -156537,7 +158119,7 @@ module.exports = BinaryFile; /***/ }), -/* 1189 */ +/* 1193 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156549,11 +158131,11 @@ module.exports = BinaryFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(59); -var ParseXMLBitmapFont = __webpack_require__(181); -var XMLFile = __webpack_require__(206); +var MultiFile = __webpack_require__(60); +var ParseXMLBitmapFont = __webpack_require__(183); +var XMLFile = __webpack_require__(208); /** * @classdesc @@ -156780,7 +158362,7 @@ module.exports = BitmapFontFile; /***/ }), -/* 1190 */ +/* 1194 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156790,8 +158372,8 @@ module.exports = BitmapFontFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -156948,7 +158530,7 @@ module.exports = CSSFile; /***/ }), -/* 1191 */ +/* 1195 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156958,12 +158540,12 @@ module.exports = CSSFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var Shader = __webpack_require__(325); +var Shader = __webpack_require__(328); /** * @classdesc @@ -157359,7 +158941,7 @@ module.exports = GLSLFile; /***/ }), -/* 1192 */ +/* 1196 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157369,8 +158951,8 @@ module.exports = GLSLFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -157534,7 +159116,7 @@ module.exports = HTMLFile; /***/ }), -/* 1193 */ +/* 1197 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157544,8 +159126,8 @@ module.exports = HTMLFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -157792,7 +159374,7 @@ module.exports = HTMLTextureFile; /***/ }), -/* 1194 */ +/* 1198 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157804,10 +159386,10 @@ module.exports = HTMLTextureFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(58); -var MultiFile = __webpack_require__(59); +var JSONFile = __webpack_require__(59); +var MultiFile = __webpack_require__(60); /** * @classdesc @@ -158116,7 +159698,7 @@ module.exports = MultiAtlasFile; /***/ }), -/* 1195 */ +/* 1199 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158129,8 +159711,8 @@ var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(59); -var ScriptFile = __webpack_require__(431); +var MultiFile = __webpack_require__(60); +var ScriptFile = __webpack_require__(434); /** * @classdesc @@ -158333,7 +159915,7 @@ module.exports = MultiScriptFile; /***/ }), -/* 1196 */ +/* 1200 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158343,9 +159925,9 @@ module.exports = MultiScriptFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); +var CONST = __webpack_require__(17); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(58); +var JSONFile = __webpack_require__(59); /** * @classdesc @@ -158551,7 +160133,7 @@ module.exports = PackFile; /***/ }), -/* 1197 */ +/* 1201 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158561,8 +160143,8 @@ module.exports = PackFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -158763,7 +160345,7 @@ module.exports = PluginFile; /***/ }), -/* 1198 */ +/* 1202 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158773,8 +160355,8 @@ module.exports = PluginFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -158981,7 +160563,7 @@ module.exports = SceneFile; /***/ }), -/* 1199 */ +/* 1203 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158991,8 +160573,8 @@ module.exports = SceneFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -159187,7 +160769,7 @@ module.exports = ScenePluginFile; /***/ }), -/* 1200 */ +/* 1204 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159198,7 +160780,7 @@ module.exports = ScenePluginFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); /** * @classdesc @@ -159378,7 +160960,7 @@ module.exports = SpriteSheetFile; /***/ }), -/* 1201 */ +/* 1205 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159388,8 +160970,8 @@ module.exports = SpriteSheetFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -159717,7 +161299,7 @@ module.exports = SVGFile; /***/ }), -/* 1202 */ +/* 1206 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159727,12 +161309,12 @@ module.exports = SVGFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var TILEMAP_FORMATS = __webpack_require__(31); +var TILEMAP_FORMATS = __webpack_require__(30); /** * @classdesc @@ -159912,7 +161494,7 @@ module.exports = TilemapCSVFile; /***/ }), -/* 1203 */ +/* 1207 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159923,8 +161505,8 @@ module.exports = TilemapCSVFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(58); -var TILEMAP_FORMATS = __webpack_require__(31); +var JSONFile = __webpack_require__(59); +var TILEMAP_FORMATS = __webpack_require__(30); /** * @classdesc @@ -160068,7 +161650,7 @@ module.exports = TilemapImpactFile; /***/ }), -/* 1204 */ +/* 1208 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160079,8 +161661,8 @@ module.exports = TilemapImpactFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(58); -var TILEMAP_FORMATS = __webpack_require__(31); +var JSONFile = __webpack_require__(59); +var TILEMAP_FORMATS = __webpack_require__(30); /** * @classdesc @@ -160224,7 +161806,7 @@ module.exports = TilemapJSONFile; /***/ }), -/* 1205 */ +/* 1209 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160236,10 +161818,10 @@ module.exports = TilemapJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(59); -var TextFile = __webpack_require__(432); +var MultiFile = __webpack_require__(60); +var TextFile = __webpack_require__(435); /** * @classdesc @@ -160466,7 +162048,7 @@ module.exports = UnityAtlasFile; /***/ }), -/* 1206 */ +/* 1210 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160476,15 +162058,15 @@ module.exports = UnityAtlasFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var CustomSet = __webpack_require__(105); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(80); +var CONST = __webpack_require__(17); +var CustomSet = __webpack_require__(106); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(81); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var XHRSettings = __webpack_require__(133); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var XHRSettings = __webpack_require__(134); /** * @classdesc @@ -161533,7 +163115,7 @@ module.exports = LoaderPlugin; /***/ }), -/* 1207 */ +/* 1211 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161542,8 +163124,8 @@ module.exports = LoaderPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(50); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(51); +var Extend = __webpack_require__(15); /** * @callback ArcadePhysicsCallback @@ -161558,18 +163140,18 @@ var Extend = __webpack_require__(17); var Arcade = { - ArcadePhysics: __webpack_require__(1208), - Body: __webpack_require__(438), - Collider: __webpack_require__(439), - Components: __webpack_require__(207), - Events: __webpack_require__(208), - Factory: __webpack_require__(433), - Group: __webpack_require__(435), - Image: __webpack_require__(434), - Sprite: __webpack_require__(134), - StaticBody: __webpack_require__(445), - StaticGroup: __webpack_require__(436), - World: __webpack_require__(437) + ArcadePhysics: __webpack_require__(1212), + Body: __webpack_require__(441), + Collider: __webpack_require__(442), + Components: __webpack_require__(209), + Events: __webpack_require__(210), + Factory: __webpack_require__(436), + Group: __webpack_require__(438), + Image: __webpack_require__(437), + Sprite: __webpack_require__(135), + StaticBody: __webpack_require__(448), + StaticGroup: __webpack_require__(439), + World: __webpack_require__(440) }; @@ -161580,7 +163162,7 @@ module.exports = Arcade; /***/ }), -/* 1208 */ +/* 1212 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161591,16 +163173,16 @@ module.exports = Arcade; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(35); -var DistanceBetween = __webpack_require__(57); -var DistanceSquared = __webpack_require__(294); -var Factory = __webpack_require__(433); +var DistanceBetween = __webpack_require__(58); +var DistanceSquared = __webpack_require__(297); +var Factory = __webpack_require__(436); var GetFastValue = __webpack_require__(2); -var Merge = __webpack_require__(85); -var OverlapRect = __webpack_require__(1221); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var Vector2 = __webpack_require__(4); -var World = __webpack_require__(437); +var Merge = __webpack_require__(105); +var OverlapRect = __webpack_require__(1225); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var Vector2 = __webpack_require__(3); +var World = __webpack_require__(440); /** * @classdesc @@ -162207,7 +163789,7 @@ module.exports = ArcadePhysics; /***/ }), -/* 1209 */ +/* 1213 */ /***/ (function(module, exports) { /** @@ -162282,7 +163864,7 @@ module.exports = Acceleration; /***/ }), -/* 1210 */ +/* 1214 */ /***/ (function(module, exports) { /** @@ -162364,7 +163946,7 @@ module.exports = Angular; /***/ }), -/* 1211 */ +/* 1215 */ /***/ (function(module, exports) { /** @@ -162463,7 +164045,7 @@ module.exports = Bounce; /***/ }), -/* 1212 */ +/* 1216 */ /***/ (function(module, exports) { /** @@ -162590,7 +164172,7 @@ module.exports = Debug; /***/ }), -/* 1213 */ +/* 1217 */ /***/ (function(module, exports) { /** @@ -162723,7 +164305,7 @@ module.exports = Drag; /***/ }), -/* 1214 */ +/* 1218 */ /***/ (function(module, exports) { /** @@ -162847,7 +164429,7 @@ module.exports = Enable; /***/ }), -/* 1215 */ +/* 1219 */ /***/ (function(module, exports) { /** @@ -162925,7 +164507,7 @@ module.exports = Friction; /***/ }), -/* 1216 */ +/* 1220 */ /***/ (function(module, exports) { /** @@ -163003,7 +164585,7 @@ module.exports = Gravity; /***/ }), -/* 1217 */ +/* 1221 */ /***/ (function(module, exports) { /** @@ -163045,7 +164627,7 @@ module.exports = Immovable; /***/ }), -/* 1218 */ +/* 1222 */ /***/ (function(module, exports) { /** @@ -163085,7 +164667,7 @@ module.exports = Mass; /***/ }), -/* 1219 */ +/* 1223 */ /***/ (function(module, exports) { /** @@ -163167,7 +164749,7 @@ module.exports = Size; /***/ }), -/* 1220 */ +/* 1224 */ /***/ (function(module, exports) { /** @@ -163266,7 +164848,7 @@ module.exports = Velocity; /***/ }), -/* 1221 */ +/* 1225 */ /***/ (function(module, exports) { /** @@ -163351,7 +164933,7 @@ module.exports = OverlapRect; /***/ }), -/* 1222 */ +/* 1226 */ /***/ (function(module, exports) { /** @@ -163384,7 +164966,7 @@ module.exports = 'collide'; /***/ }), -/* 1223 */ +/* 1227 */ /***/ (function(module, exports) { /** @@ -163417,7 +164999,7 @@ module.exports = 'overlap'; /***/ }), -/* 1224 */ +/* 1228 */ /***/ (function(module, exports) { /** @@ -163440,7 +165022,7 @@ module.exports = 'pause'; /***/ }), -/* 1225 */ +/* 1229 */ /***/ (function(module, exports) { /** @@ -163463,7 +165045,7 @@ module.exports = 'resume'; /***/ }), -/* 1226 */ +/* 1230 */ /***/ (function(module, exports) { /** @@ -163495,7 +165077,7 @@ module.exports = 'tilecollide'; /***/ }), -/* 1227 */ +/* 1231 */ /***/ (function(module, exports) { /** @@ -163527,7 +165109,7 @@ module.exports = 'tileoverlap'; /***/ }), -/* 1228 */ +/* 1232 */ /***/ (function(module, exports) { /** @@ -163559,7 +165141,7 @@ module.exports = 'worldbounds'; /***/ }), -/* 1229 */ +/* 1233 */ /***/ (function(module, exports) { /** @@ -163585,7 +165167,7 @@ module.exports = 'worldstep'; /***/ }), -/* 1230 */ +/* 1234 */ /***/ (function(module, exports) { /** @@ -163626,7 +165208,7 @@ module.exports = ProcessTileCallbacks; /***/ }), -/* 1231 */ +/* 1235 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163635,9 +165217,9 @@ module.exports = ProcessTileCallbacks; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileCheckX = __webpack_require__(1232); -var TileCheckY = __webpack_require__(1234); -var TileIntersectsBody = __webpack_require__(444); +var TileCheckX = __webpack_require__(1236); +var TileCheckY = __webpack_require__(1238); +var TileIntersectsBody = __webpack_require__(447); /** * The core separation function to separate a physics body and a tile. @@ -163746,7 +165328,7 @@ module.exports = SeparateTile; /***/ }), -/* 1232 */ +/* 1236 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163755,7 +165337,7 @@ module.exports = SeparateTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ProcessTileSeparationX = __webpack_require__(1233); +var ProcessTileSeparationX = __webpack_require__(1237); /** * Check the body against the given tile on the X axis. @@ -163836,7 +165418,7 @@ module.exports = TileCheckX; /***/ }), -/* 1233 */ +/* 1237 */ /***/ (function(module, exports) { /** @@ -163883,7 +165465,7 @@ module.exports = ProcessTileSeparationX; /***/ }), -/* 1234 */ +/* 1238 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163892,7 +165474,7 @@ module.exports = ProcessTileSeparationX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ProcessTileSeparationY = __webpack_require__(1235); +var ProcessTileSeparationY = __webpack_require__(1239); /** * Check the body against the given tile on the Y axis. @@ -163973,7 +165555,7 @@ module.exports = TileCheckY; /***/ }), -/* 1235 */ +/* 1239 */ /***/ (function(module, exports) { /** @@ -164020,7 +165602,7 @@ module.exports = ProcessTileSeparationY; /***/ }), -/* 1236 */ +/* 1240 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164029,7 +165611,7 @@ module.exports = ProcessTileSeparationY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetOverlapX = __webpack_require__(440); +var GetOverlapX = __webpack_require__(443); /** * Separates two overlapping bodies on the X-axis (horizontally). @@ -164111,7 +165693,7 @@ module.exports = SeparateX; /***/ }), -/* 1237 */ +/* 1241 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164120,7 +165702,7 @@ module.exports = SeparateX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetOverlapY = __webpack_require__(441); +var GetOverlapY = __webpack_require__(444); /** * Separates two overlapping bodies on the Y-axis (vertically). @@ -164202,17 +165784,17 @@ module.exports = SeparateY; /***/ }), -/* 1238 */, -/* 1239 */, -/* 1240 */, -/* 1241 */, /* 1242 */, /* 1243 */, /* 1244 */, /* 1245 */, /* 1246 */, /* 1247 */, -/* 1248 */ +/* 1248 */, +/* 1249 */, +/* 1250 */, +/* 1251 */, +/* 1252 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164227,17 +165809,17 @@ module.exports = SeparateY; module.exports = { - BasePlugin: __webpack_require__(449), - DefaultPlugins: __webpack_require__(171), - PluginCache: __webpack_require__(18), - PluginManager: __webpack_require__(342), - ScenePlugin: __webpack_require__(1249) + BasePlugin: __webpack_require__(452), + DefaultPlugins: __webpack_require__(172), + PluginCache: __webpack_require__(19), + PluginManager: __webpack_require__(345), + ScenePlugin: __webpack_require__(1253) }; /***/ }), -/* 1249 */ +/* 1253 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164246,9 +165828,9 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ -var BasePlugin = __webpack_require__(449); +var BasePlugin = __webpack_require__(452); var Class = __webpack_require__(0); -var SceneEvents = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -164326,7 +165908,7 @@ module.exports = ScenePlugin; /***/ }), -/* 1250 */ +/* 1254 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164335,8 +165917,8 @@ module.exports = ScenePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(17); -var CONST = __webpack_require__(173); +var Extend = __webpack_require__(15); +var CONST = __webpack_require__(174); /** * @namespace Phaser.Scale @@ -164364,12 +165946,12 @@ var CONST = __webpack_require__(173); var Scale = { - Center: __webpack_require__(331), - Events: __webpack_require__(89), - Orientation: __webpack_require__(332), - ScaleManager: __webpack_require__(343), - ScaleModes: __webpack_require__(333), - Zoom: __webpack_require__(334) + Center: __webpack_require__(334), + Events: __webpack_require__(90), + Orientation: __webpack_require__(335), + ScaleManager: __webpack_require__(346), + ScaleModes: __webpack_require__(336), + Zoom: __webpack_require__(337) }; @@ -164382,7 +165964,7 @@ module.exports = Scale; /***/ }), -/* 1251 */ +/* 1255 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164391,8 +165973,8 @@ module.exports = Scale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(122); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(123); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Scenes @@ -164400,11 +165982,11 @@ var Extend = __webpack_require__(17); var Scene = { - Events: __webpack_require__(19), - SceneManager: __webpack_require__(345), - ScenePlugin: __webpack_require__(1252), - Settings: __webpack_require__(348), - Systems: __webpack_require__(176) + Events: __webpack_require__(20), + SceneManager: __webpack_require__(348), + ScenePlugin: __webpack_require__(1256), + Settings: __webpack_require__(350), + Systems: __webpack_require__(177) }; @@ -164415,7 +165997,7 @@ module.exports = Scene; /***/ }), -/* 1252 */ +/* 1256 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164424,11 +166006,11 @@ module.exports = Scene; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(19); +var Events = __webpack_require__(20); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(18); +var PluginCache = __webpack_require__(19); /** * @classdesc @@ -165409,7 +166991,7 @@ module.exports = ScenePlugin; /***/ }), -/* 1253 */ +/* 1257 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165424,18 +167006,18 @@ module.exports = ScenePlugin; module.exports = { - List: __webpack_require__(125), - Map: __webpack_require__(157), - ProcessQueue: __webpack_require__(442), - RTree: __webpack_require__(443), - Set: __webpack_require__(105), - Size: __webpack_require__(344) + List: __webpack_require__(126), + Map: __webpack_require__(158), + ProcessQueue: __webpack_require__(445), + RTree: __webpack_require__(446), + Set: __webpack_require__(106), + Size: __webpack_require__(347) }; /***/ }), -/* 1254 */ +/* 1258 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165444,8 +167026,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(17); -var FilterMode = __webpack_require__(1255); +var Extend = __webpack_require__(15); +var FilterMode = __webpack_require__(1259); /** * @namespace Phaser.Textures @@ -165471,13 +167053,14 @@ var FilterMode = __webpack_require__(1255); var Textures = { - Events: __webpack_require__(118), + CanvasTexture: __webpack_require__(352), + Events: __webpack_require__(119), FilterMode: FilterMode, - Frame: __webpack_require__(91), - Parsers: __webpack_require__(351), - Texture: __webpack_require__(177), - TextureManager: __webpack_require__(349), - TextureSource: __webpack_require__(350) + Frame: __webpack_require__(92), + Parsers: __webpack_require__(354), + Texture: __webpack_require__(179), + TextureManager: __webpack_require__(351), + TextureSource: __webpack_require__(353) }; @@ -165487,7 +167070,7 @@ module.exports = Textures; /***/ }), -/* 1255 */ +/* 1259 */ /***/ (function(module, exports) { /** @@ -165531,7 +167114,7 @@ module.exports = CONST; /***/ }), -/* 1256 */ +/* 1260 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165546,30 +167129,30 @@ module.exports = CONST; module.exports = { - Components: __webpack_require__(136), - Parsers: __webpack_require__(1286), + Components: __webpack_require__(137), + Parsers: __webpack_require__(1290), - Formats: __webpack_require__(31), - ImageCollection: __webpack_require__(460), - ParseToTilemap: __webpack_require__(216), - Tile: __webpack_require__(72), - Tilemap: __webpack_require__(469), - TilemapCreator: __webpack_require__(1295), - TilemapFactory: __webpack_require__(1296), - Tileset: __webpack_require__(140), + Formats: __webpack_require__(30), + ImageCollection: __webpack_require__(463), + ParseToTilemap: __webpack_require__(218), + Tile: __webpack_require__(73), + Tilemap: __webpack_require__(472), + TilemapCreator: __webpack_require__(1299), + TilemapFactory: __webpack_require__(1300), + Tileset: __webpack_require__(141), LayerData: __webpack_require__(102), MapData: __webpack_require__(103), - ObjectLayer: __webpack_require__(463), + ObjectLayer: __webpack_require__(466), - DynamicTilemapLayer: __webpack_require__(470), - StaticTilemapLayer: __webpack_require__(471) + DynamicTilemapLayer: __webpack_require__(473), + StaticTilemapLayer: __webpack_require__(474) }; /***/ }), -/* 1257 */ +/* 1261 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165578,8 +167161,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var CalculateFacesWithin = __webpack_require__(51); +var GetTilesWithin = __webpack_require__(23); +var CalculateFacesWithin = __webpack_require__(52); /** * Copies the tiles in the source rectangular area to a new destination (all specified in tile @@ -165634,7 +167217,7 @@ module.exports = Copy; /***/ }), -/* 1258 */ +/* 1262 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165643,10 +167226,10 @@ module.exports = Copy; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileToWorldX = __webpack_require__(138); -var TileToWorldY = __webpack_require__(139); -var GetTilesWithin = __webpack_require__(21); -var ReplaceByIndex = __webpack_require__(450); +var TileToWorldX = __webpack_require__(139); +var TileToWorldY = __webpack_require__(140); +var GetTilesWithin = __webpack_require__(23); +var ReplaceByIndex = __webpack_require__(453); /** * Creates a Sprite for every object matching the given tile indexes in the layer. You can @@ -165719,7 +167302,7 @@ module.exports = CreateFromTiles; /***/ }), -/* 1259 */ +/* 1263 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165728,8 +167311,8 @@ module.exports = CreateFromTiles; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SnapFloor = __webpack_require__(90); -var SnapCeil = __webpack_require__(303); +var SnapFloor = __webpack_require__(91); +var SnapCeil = __webpack_require__(306); /** * Returns the tiles in the given layer that are within the camera's viewport. This is used internally. @@ -165876,7 +167459,7 @@ module.exports = CullTiles; /***/ }), -/* 1260 */ +/* 1264 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165885,9 +167468,9 @@ module.exports = CullTiles; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var CalculateFacesWithin = __webpack_require__(51); -var SetTileCollision = __webpack_require__(71); +var GetTilesWithin = __webpack_require__(23); +var CalculateFacesWithin = __webpack_require__(52); +var SetTileCollision = __webpack_require__(72); /** * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the @@ -165930,7 +167513,7 @@ module.exports = Fill; /***/ }), -/* 1261 */ +/* 1265 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165939,7 +167522,7 @@ module.exports = Fill; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given @@ -165978,7 +167561,7 @@ module.exports = FilterTiles; /***/ }), -/* 1262 */ +/* 1266 */ /***/ (function(module, exports) { /** @@ -166066,7 +167649,7 @@ module.exports = FindByIndex; /***/ }), -/* 1263 */ +/* 1267 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166075,7 +167658,7 @@ module.exports = FindByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * @callback FindTileCallback @@ -166120,7 +167703,7 @@ module.exports = FindTile; /***/ }), -/* 1264 */ +/* 1268 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166129,7 +167712,7 @@ module.exports = FindTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * @callback EachTileCallback @@ -166170,7 +167753,7 @@ module.exports = ForEachTile; /***/ }), -/* 1265 */ +/* 1269 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166179,9 +167762,9 @@ module.exports = ForEachTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(137); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var GetTileAt = __webpack_require__(138); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); /** * Gets a tile at the given world coordinates from the given layer. @@ -166211,7 +167794,7 @@ module.exports = GetTileAtWorldXY; /***/ }), -/* 1266 */ +/* 1270 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166220,14 +167803,14 @@ module.exports = GetTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Geom = __webpack_require__(401); -var GetTilesWithin = __webpack_require__(21); -var Intersects = __webpack_require__(402); +var Geom = __webpack_require__(404); +var GetTilesWithin = __webpack_require__(23); +var Intersects = __webpack_require__(405); var NOOP = __webpack_require__(1); -var TileToWorldX = __webpack_require__(138); -var TileToWorldY = __webpack_require__(139); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var TileToWorldX = __webpack_require__(139); +var TileToWorldY = __webpack_require__(140); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); var TriangleToRectangle = function (triangle, rect) { @@ -166308,7 +167891,7 @@ module.exports = GetTilesWithinShape; /***/ }), -/* 1267 */ +/* 1271 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166317,9 +167900,9 @@ module.exports = GetTilesWithinShape; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var GetTilesWithin = __webpack_require__(23); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. @@ -166358,7 +167941,7 @@ module.exports = GetTilesWithinWorldXY; /***/ }), -/* 1268 */ +/* 1272 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166367,9 +167950,9 @@ module.exports = GetTilesWithinWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HasTileAt = __webpack_require__(451); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var HasTileAt = __webpack_require__(454); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); /** * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns @@ -166398,7 +167981,7 @@ module.exports = HasTileAtWorldXY; /***/ }), -/* 1269 */ +/* 1273 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166407,9 +167990,9 @@ module.exports = HasTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PutTileAt = __webpack_require__(211); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var PutTileAt = __webpack_require__(213); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); /** * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either @@ -166441,7 +168024,7 @@ module.exports = PutTileAtWorldXY; /***/ }), -/* 1270 */ +/* 1274 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166450,8 +168033,8 @@ module.exports = PutTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CalculateFacesWithin = __webpack_require__(51); -var PutTileAt = __webpack_require__(211); +var CalculateFacesWithin = __webpack_require__(52); +var PutTileAt = __webpack_require__(213); /** * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified @@ -166505,7 +168088,7 @@ module.exports = PutTilesAt; /***/ }), -/* 1271 */ +/* 1275 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166514,8 +168097,8 @@ module.exports = PutTilesAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var GetRandom = __webpack_require__(180); +var GetTilesWithin = __webpack_require__(23); +var GetRandom = __webpack_require__(182); /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -166563,7 +168146,7 @@ module.exports = Randomize; /***/ }), -/* 1272 */ +/* 1276 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166572,9 +168155,9 @@ module.exports = Randomize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RemoveTileAt = __webpack_require__(452); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var RemoveTileAt = __webpack_require__(455); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); /** * Removes the tile at the given world coordinates in the specified layer and updates the layer's @@ -166604,7 +168187,7 @@ module.exports = RemoveTileAtWorldXY; /***/ }), -/* 1273 */ +/* 1277 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166613,8 +168196,8 @@ module.exports = RemoveTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var Color = __webpack_require__(326); +var GetTilesWithin = __webpack_require__(23); +var Color = __webpack_require__(329); var defaultTileColor = new Color(105, 210, 231, 150); var defaultCollidingTileColor = new Color(243, 134, 48, 200); @@ -166651,8 +168234,8 @@ var RenderDebug = function (graphics, styleConfig, layer) var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer); - graphics.translate(layer.tilemapLayer.x, layer.tilemapLayer.y); - graphics.scale(layer.tilemapLayer.scaleX, layer.tilemapLayer.scaleY); + graphics.translateCanvas(layer.tilemapLayer.x, layer.tilemapLayer.y); + graphics.scaleCanvas(layer.tilemapLayer.scaleX, layer.tilemapLayer.scaleY); for (var i = 0; i < tiles.length; i++) { @@ -166693,7 +168276,7 @@ module.exports = RenderDebug; /***/ }), -/* 1274 */ +/* 1278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166702,9 +168285,9 @@ module.exports = RenderDebug; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(71); -var CalculateFacesWithin = __webpack_require__(51); -var SetLayerCollisionIndex = __webpack_require__(212); +var SetTileCollision = __webpack_require__(72); +var CalculateFacesWithin = __webpack_require__(52); +var SetLayerCollisionIndex = __webpack_require__(214); /** * Sets collision on the given tile or tiles within a layer by index. You can pass in either a @@ -166756,7 +168339,7 @@ module.exports = SetCollision; /***/ }), -/* 1275 */ +/* 1279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166765,9 +168348,9 @@ module.exports = SetCollision; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(71); -var CalculateFacesWithin = __webpack_require__(51); -var SetLayerCollisionIndex = __webpack_require__(212); +var SetTileCollision = __webpack_require__(72); +var CalculateFacesWithin = __webpack_require__(52); +var SetLayerCollisionIndex = __webpack_require__(214); /** * Sets collision on a range of tiles in a layer whose index is between the specified `start` and @@ -166824,7 +168407,7 @@ module.exports = SetCollisionBetween; /***/ }), -/* 1276 */ +/* 1280 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166833,9 +168416,9 @@ module.exports = SetCollisionBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(71); -var CalculateFacesWithin = __webpack_require__(51); -var SetLayerCollisionIndex = __webpack_require__(212); +var SetTileCollision = __webpack_require__(72); +var CalculateFacesWithin = __webpack_require__(52); +var SetLayerCollisionIndex = __webpack_require__(214); /** * Sets collision on all tiles in the given layer, except for tiles that have an index specified in @@ -166881,7 +168464,7 @@ module.exports = SetCollisionByExclusion; /***/ }), -/* 1277 */ +/* 1281 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166890,8 +168473,8 @@ module.exports = SetCollisionByExclusion; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(71); -var CalculateFacesWithin = __webpack_require__(51); +var SetTileCollision = __webpack_require__(72); +var CalculateFacesWithin = __webpack_require__(52); var HasValue = __webpack_require__(97); /** @@ -166956,7 +168539,7 @@ module.exports = SetCollisionByProperty; /***/ }), -/* 1278 */ +/* 1282 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166965,8 +168548,8 @@ module.exports = SetCollisionByProperty; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(71); -var CalculateFacesWithin = __webpack_require__(51); +var SetTileCollision = __webpack_require__(72); +var CalculateFacesWithin = __webpack_require__(52); /** * Sets collision on the tiles within a layer by checking each tile's collision group data @@ -167016,7 +168599,7 @@ module.exports = SetCollisionFromCollisionGroup; /***/ }), -/* 1279 */ +/* 1283 */ /***/ (function(module, exports) { /** @@ -167063,7 +168646,7 @@ module.exports = SetTileIndexCallback; /***/ }), -/* 1280 */ +/* 1284 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167072,7 +168655,7 @@ module.exports = SetTileIndexCallback; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. @@ -167106,7 +168689,7 @@ module.exports = SetTileLocationCallback; /***/ }), -/* 1281 */ +/* 1285 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167115,8 +168698,8 @@ module.exports = SetTileLocationCallback; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var ShuffleArray = __webpack_require__(111); +var GetTilesWithin = __webpack_require__(23); +var ShuffleArray = __webpack_require__(112); /** * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given @@ -167151,7 +168734,7 @@ module.exports = Shuffle; /***/ }), -/* 1282 */ +/* 1286 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167160,7 +168743,7 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -167202,7 +168785,7 @@ module.exports = SwapByIndex; /***/ }), -/* 1283 */ +/* 1287 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167211,9 +168794,9 @@ module.exports = SwapByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileToWorldX = __webpack_require__(138); -var TileToWorldY = __webpack_require__(139); -var Vector2 = __webpack_require__(4); +var TileToWorldX = __webpack_require__(139); +var TileToWorldY = __webpack_require__(140); +var Vector2 = __webpack_require__(3); /** * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the @@ -167246,7 +168829,7 @@ module.exports = TileToWorldXY; /***/ }), -/* 1284 */ +/* 1288 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167255,7 +168838,7 @@ module.exports = TileToWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -167326,7 +168909,7 @@ module.exports = WeightedRandomize; /***/ }), -/* 1285 */ +/* 1289 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167335,9 +168918,9 @@ module.exports = WeightedRandomize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); -var Vector2 = __webpack_require__(4); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); +var Vector2 = __webpack_require__(3); /** * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the @@ -167371,7 +168954,7 @@ module.exports = WorldToTileXY; /***/ }), -/* 1286 */ +/* 1290 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167386,18 +168969,18 @@ module.exports = WorldToTileXY; module.exports = { - Parse: __webpack_require__(453), - Parse2DArray: __webpack_require__(213), - ParseCSV: __webpack_require__(454), + Parse: __webpack_require__(456), + Parse2DArray: __webpack_require__(215), + ParseCSV: __webpack_require__(457), - Impact: __webpack_require__(1287), - Tiled: __webpack_require__(1288) + Impact: __webpack_require__(1291), + Tiled: __webpack_require__(1292) }; /***/ }), -/* 1287 */ +/* 1291 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167412,15 +168995,15 @@ module.exports = { module.exports = { - ParseTileLayers: __webpack_require__(467), - ParseTilesets: __webpack_require__(468), - ParseWeltmeister: __webpack_require__(466) + ParseTileLayers: __webpack_require__(470), + ParseTilesets: __webpack_require__(471), + ParseWeltmeister: __webpack_require__(469) }; /***/ }), -/* 1288 */ +/* 1292 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167435,22 +169018,22 @@ module.exports = { module.exports = { - AssignTileProperties: __webpack_require__(465), - Base64Decode: __webpack_require__(457), - BuildTilesetIndex: __webpack_require__(464), - ParseGID: __webpack_require__(214), - ParseImageLayers: __webpack_require__(458), - ParseJSONTiled: __webpack_require__(455), - ParseObject: __webpack_require__(215), - ParseObjectLayers: __webpack_require__(462), - ParseTileLayers: __webpack_require__(456), - ParseTilesets: __webpack_require__(459) + AssignTileProperties: __webpack_require__(468), + Base64Decode: __webpack_require__(460), + BuildTilesetIndex: __webpack_require__(467), + ParseGID: __webpack_require__(216), + ParseImageLayers: __webpack_require__(461), + ParseJSONTiled: __webpack_require__(458), + ParseObject: __webpack_require__(217), + ParseObjectLayers: __webpack_require__(465), + ParseTileLayers: __webpack_require__(459), + ParseTilesets: __webpack_require__(462) }; /***/ }), -/* 1289 */ +/* 1293 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167464,12 +169047,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1290); + renderWebGL = __webpack_require__(1294); } if (true) { - renderCanvas = __webpack_require__(1291); + renderCanvas = __webpack_require__(1295); } module.exports = { @@ -167481,7 +169064,7 @@ module.exports = { /***/ }), -/* 1290 */ +/* 1294 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167598,7 +169181,7 @@ module.exports = DynamicTilemapLayerWebGLRenderer; /***/ }), -/* 1291 */ +/* 1295 */ /***/ (function(module, exports) { /** @@ -167725,7 +169308,7 @@ module.exports = DynamicTilemapLayerCanvasRenderer; /***/ }), -/* 1292 */ +/* 1296 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167739,12 +169322,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1293); + renderWebGL = __webpack_require__(1297); } if (true) { - renderCanvas = __webpack_require__(1294); + renderCanvas = __webpack_require__(1298); } module.exports = { @@ -167756,7 +169339,7 @@ module.exports = { /***/ }), -/* 1293 */ +/* 1297 */ /***/ (function(module, exports) { /** @@ -167828,7 +169411,7 @@ module.exports = StaticTilemapLayerWebGLRenderer; /***/ }), -/* 1294 */ +/* 1298 */ /***/ (function(module, exports) { /** @@ -167959,7 +169542,7 @@ module.exports = StaticTilemapLayerCanvasRenderer; /***/ }), -/* 1295 */ +/* 1299 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167968,8 +169551,8 @@ module.exports = StaticTilemapLayerCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); -var ParseToTilemap = __webpack_require__(216); +var GameObjectCreator = __webpack_require__(16); +var ParseToTilemap = __webpack_require__(218); /** * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. @@ -168003,7 +169586,7 @@ GameObjectCreator.register('tilemap', function (config) /***/ }), -/* 1296 */ +/* 1300 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168012,8 +169595,8 @@ GameObjectCreator.register('tilemap', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var ParseToTilemap = __webpack_require__(216); +var GameObjectFactory = __webpack_require__(6); +var ParseToTilemap = __webpack_require__(218); /** * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. @@ -168069,7 +169652,7 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt /***/ }), -/* 1297 */ +/* 1301 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168084,14 +169667,14 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt module.exports = { - Clock: __webpack_require__(1298), - TimerEvent: __webpack_require__(472) + Clock: __webpack_require__(1302), + TimerEvent: __webpack_require__(475) }; /***/ }), -/* 1298 */ +/* 1302 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168101,9 +169684,9 @@ module.exports = { */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var TimerEvent = __webpack_require__(472); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var TimerEvent = __webpack_require__(475); /** * @classdesc @@ -168497,7 +170080,7 @@ module.exports = Clock; /***/ }), -/* 1299 */ +/* 1303 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168506,8 +170089,8 @@ module.exports = Clock; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(88); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(89); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Tweens @@ -168515,13 +170098,13 @@ var Extend = __webpack_require__(17); var Tweens = { - Builders: __webpack_require__(1300), - Events: __webpack_require__(478), + Builders: __webpack_require__(1304), + Events: __webpack_require__(223), - TweenManager: __webpack_require__(1308), - Tween: __webpack_require__(220), - TweenData: __webpack_require__(221), - Timeline: __webpack_require__(477) + TweenManager: __webpack_require__(1319), + Tween: __webpack_require__(222), + TweenData: __webpack_require__(224), + Timeline: __webpack_require__(480) }; @@ -168532,7 +170115,7 @@ module.exports = Tweens; /***/ }), -/* 1300 */ +/* 1304 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168547,22 +170130,22 @@ module.exports = Tweens; module.exports = { - GetBoolean: __webpack_require__(87), - GetEaseFunction: __webpack_require__(96), - GetNewValue: __webpack_require__(141), - GetProps: __webpack_require__(473), - GetTargets: __webpack_require__(217), - GetTweens: __webpack_require__(474), - GetValueOp: __webpack_require__(218), - NumberTweenBuilder: __webpack_require__(475), - TimelineBuilder: __webpack_require__(476), - TweenBuilder: __webpack_require__(142) + GetBoolean: __webpack_require__(88), + GetEaseFunction: __webpack_require__(82), + GetNewValue: __webpack_require__(142), + GetProps: __webpack_require__(476), + GetTargets: __webpack_require__(219), + GetTweens: __webpack_require__(477), + GetValueOp: __webpack_require__(220), + NumberTweenBuilder: __webpack_require__(478), + TimelineBuilder: __webpack_require__(479), + TweenBuilder: __webpack_require__(143) }; /***/ }), -/* 1301 */ +/* 1305 */ /***/ (function(module, exports) { /** @@ -168605,6 +170188,9 @@ module.exports = [ 'loop', 'loopDelay', 'offset', + 'onActive', + 'onActiveParams', + 'onActiveScope', 'onComplete', 'onCompleteParams', 'onCompleteScope', @@ -168634,7 +170220,7 @@ module.exports = [ /***/ }), -/* 1302 */ +/* 1306 */ /***/ (function(module, exports) { /** @@ -168670,7 +170256,7 @@ module.exports = 'complete'; /***/ }), -/* 1303 */ +/* 1307 */ /***/ (function(module, exports) { /** @@ -168702,13 +170288,12 @@ module.exports = 'complete'; * @since 3.0.0 * * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - * @param {integer} loopCount - The number of loops left before this Timeline completes. */ module.exports = 'loop'; /***/ }), -/* 1304 */ +/* 1308 */ /***/ (function(module, exports) { /** @@ -168745,7 +170330,7 @@ module.exports = 'pause'; /***/ }), -/* 1305 */ +/* 1309 */ /***/ (function(module, exports) { /** @@ -168782,7 +170367,7 @@ module.exports = 'resume'; /***/ }), -/* 1306 */ +/* 1310 */ /***/ (function(module, exports) { /** @@ -168818,7 +170403,7 @@ module.exports = 'start'; /***/ }), -/* 1307 */ +/* 1311 */ /***/ (function(module, exports) { /** @@ -168855,7 +170440,304 @@ module.exports = 'update'; /***/ }), -/* 1308 */ +/* 1312 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Active Event. + * + * This event is dispatched by a Tween when it becomes active within the Tween Manager. + * + * An 'active' Tween is one that is now progressing, although it may not yet be updating + * any target properties, due to settings such as `delay`. If you need an event for when + * the Tween starts actually updating its first property, see `TWEEN_START`. + * + * Listen to it from a Tween instance using `Tween.on('active', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('active', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'active'; + + +/***/ }), +/* 1313 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Complete Event. + * + * This event is dispatched by a Tween when it completes playback entirely, factoring in repeats and loops. + * + * If the Tween has been set to loop or repeat infinitely, this event will not be dispatched + * unless the `Tween.stop` method is called. + * + * If a Tween has a `completeDelay` set, this event will fire after that delay expires. + * + * Listen to it from a Tween instance using `Tween.on('complete', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('complete', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_COMPLETE + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'complete'; + + +/***/ }), +/* 1314 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Loop Event. + * + * This event is dispatched by a Tween when it loops. + * + * This event will only be dispatched if the Tween has a loop count set. + * + * If a Tween has a `loopDelay` set, this event will fire after that delay expires. + * + * The difference between `loop` and `repeat` is that `repeat` is a property setting, + * where-as `loop` applies to the entire Tween. + * + * Listen to it from a Tween instance using `Tween.on('loop', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * loop: 6 + * }); + * tween.on('loop', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_LOOP + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'loop'; + + +/***/ }), +/* 1315 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Repeat Event. + * + * This event is dispatched by a Tween when one of the properties it is tweening repeats. + * + * This event will only be dispatched if the Tween has a property with a repeat count set. + * + * If a Tween has a `repeatDelay` set, this event will fire after that delay expires. + * + * The difference between `loop` and `repeat` is that `repeat` is a property setting, + * where-as `loop` applies to the entire Tween. + * + * Listen to it from a Tween instance using `Tween.on('repeat', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * repeat: 4 + * }); + * tween.on('repeat', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {string} key - The key of the property that just repeated. + * @param {any} target - The target that the property just repated on. + */ +module.exports = 'repeat'; + + +/***/ }), +/* 1316 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Start Event. + * + * This event is dispatched by a Tween when it starts tweening its first property. + * + * A Tween will only emit this event once, as it can only start once. + * + * If a Tween has a `delay` set, this event will fire after that delay expires. + * + * Listen to it from a Tween instance using `Tween.on('start', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('start', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_START + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'start'; + + +/***/ }), +/* 1317 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Update Event. + * + * This event is dispatched by a Tween every time it updates _any_ of the properties it is tweening. + * + * A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property. + * + * **Note:** This is a very high frequency event and may be dispatched multiple times, every single frame. + * + * Listen to it from a Tween instance using `Tween.on('update', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * }); + * tween.on('update', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_UPDATE + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {string} key - The property that was updated, i.e. `x` or `scale`. + * @param {any} target - The target object that was updated. Usually a Game Object, but can be of any type. + */ +module.exports = 'update'; + + +/***/ }), +/* 1318 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Yoyo Event. + * + * This event is dispatched by a Tween whenever a property it is tweening yoyos. + * + * This event will only be dispatched if the Tween has a property with `yoyo` set. + * + * If the Tween has a `hold` value, this event is dispatched when the hold expires. + * + * This event is dispatched for every property, and for every target, that yoyos. + * For example, if a Tween was updating 2 properties and had 10 targets, this event + * would be dispatched 20 times (twice per target). So be careful how you use it! + * + * Listen to it from a Tween instance using `Tween.on('yoyo', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * yoyo: true + * }); + * tween.on('yoyo', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {string} key - The property that yoyo'd, i.e. `x` or `scale`. + * @param {any} target - The target object that was yoyo'd. Usually a Game Object, but can be of any type. + */ +module.exports = 'yoyo'; + + +/***/ }), +/* 1319 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168864,14 +170746,15 @@ module.exports = 'update'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayRemove = __webpack_require__(120); +var ArrayRemove = __webpack_require__(121); var Class = __webpack_require__(0); -var NumberTweenBuilder = __webpack_require__(475); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var TimelineBuilder = __webpack_require__(476); -var TWEEN_CONST = __webpack_require__(88); -var TweenBuilder = __webpack_require__(142); +var NumberTweenBuilder = __webpack_require__(478); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var StaggerBuilder = __webpack_require__(1320); +var TimelineBuilder = __webpack_require__(479); +var TWEEN_CONST = __webpack_require__(89); +var TweenBuilder = __webpack_require__(143); /** * @classdesc @@ -169123,6 +171006,51 @@ var TweenManager = new Class({ return tween; }, + /** + * Creates a Stagger function to be used by a Tween property. + * + * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. + * + * This is only worth using if the tween has multiple targets. + * + * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 + * over the duration specified: + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(100) + * }); + * ``` + * + * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering + * from the center out, using a cubic ease. + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' }) + * }); + * ``` + * + * @method Phaser.Tweens.TweenManager#stagger + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.StaggerConfig} config - The configuration object for the Stagger function. + * + * @return {function} The stagger function. + */ + stagger: function (value, options) + { + return StaggerBuilder(value, options); + }, + /** * Updates the Tween Manager's internal lists at the start of the frame. * @@ -169580,7 +171508,252 @@ module.exports = TweenManager; /***/ }), -/* 1309 */ +/* 1320 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetEaseFunction = __webpack_require__(82); +var GetValue = __webpack_require__(5); + +/** + * Creates a Stagger function to be used by a Tween property. + * + * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. + * + * This is only worth using if the tween has multiple targets. + * + * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 + * over the duration specified: + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(100) + * }); + * ``` + * + * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering + * from the center out, using a cubic ease. + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' }) + * }); + * ``` + * + * @function Phaser.Tweens.Builders.StaggerBuilder + * @since 3.19.0 + * + * @param {(number|number[])} value - The amount to stagger by, or an array containing two elements representing the min and max values to stagger between. + * @param {Phaser.Types.Tweens.StaggerConfig} [config] - A Stagger Configuration object. + * + * @return {function} The stagger function. + */ +var StaggerBuilder = function (value, options) +{ + if (options === undefined) { options = {}; } + + var result; + + var start = GetValue(options, 'start', 0); + var ease = GetValue(options, 'ease', null); + var grid = GetValue(options, 'grid', null); + + var from = GetValue(options, 'from', 0); + + var fromFirst = (from === 'first'); + var fromCenter = (from === 'center'); + var fromLast = (from === 'last'); + var fromValue = (typeof(from) === 'number'); + + var isRange = (Array.isArray(value)); + var value1 = (isRange) ? parseFloat(value[0]) : parseFloat(value); + var value2 = (isRange) ? parseFloat(value[1]) : 0; + var maxValue = Math.max(value1, value2); + + if (isRange) + { + start += value1; + } + + if (grid) + { + // Pre-calc the grid to save doing it for ever tweendata update + var gridWidth = grid[0]; + var gridHeight = grid[1]; + + var fromX = 0; + var fromY = 0; + + var distanceX = 0; + var distanceY = 0; + + var gridValues = []; + + if (fromLast) + { + fromX = gridWidth - 1; + fromY = gridHeight - 1; + } + else if (fromValue) + { + fromX = from % gridWidth; + fromY = Math.floor(from / gridWidth); + } + else if (fromCenter) + { + fromX = (gridWidth - 1) / 2; + fromY = (gridHeight - 1) / 2; + } + + var gridMax = Number.MIN_SAFE_INTEGER; + + for (var toY = 0; toY < gridHeight; toY++) + { + gridValues[toY] = []; + + for (var toX = 0; toX < gridWidth; toX++) + { + distanceX = fromX - toX; + distanceY = fromY - toY; + + var dist = Math.sqrt(distanceX * distanceX + distanceY * distanceY); + + if (dist > gridMax) + { + gridMax = dist; + } + + gridValues[toY][toX] = dist; + } + } + } + + var easeFunction = (ease) ? GetEaseFunction(ease) : null; + + if (grid) + { + result = function (target, key, value, index) + { + var gridSpace = 0; + var toX = index % gridWidth; + var toY = Math.floor(index / gridWidth); + + if (toX >= 0 && toX < gridWidth && toY >= 0 && toY < gridHeight) + { + gridSpace = gridValues[toY][toX]; + } + + var output; + + if (isRange) + { + var diff = (value2 - value1); + + if (easeFunction) + { + output = ((gridSpace / gridMax) * diff) * easeFunction(gridSpace / gridMax); + } + else + { + output = (gridSpace / gridMax) * diff; + } + } + else if (easeFunction) + { + output = (gridSpace * value1) * easeFunction(gridSpace / gridMax); + } + else + { + output = gridSpace * value1; + } + + return output + start; + }; + } + else + { + result = function (target, key, value, index, total) + { + // zero offset + total--; + + var fromIndex; + + if (fromFirst) + { + fromIndex = index; + } + else if (fromCenter) + { + fromIndex = Math.abs((total / 2) - index); + } + else if (fromLast) + { + fromIndex = total - index; + } + else if (fromValue) + { + fromIndex = Math.abs(from - index); + } + + var output; + + if (isRange) + { + var spacing; + + if (fromCenter) + { + spacing = ((value2 - value1) / total) * (fromIndex * 2); + } + else + { + spacing = ((value2 - value1) / total) * fromIndex; + } + + if (easeFunction) + { + output = spacing * easeFunction(fromIndex / total); + } + else + { + output = spacing; + } + } + else if (easeFunction) + { + output = (total * maxValue) * easeFunction(fromIndex / total); + } + else + { + output = fromIndex * value1; + } + + return output + start; + }; + } + + return result; +}; + +module.exports = StaggerBuilder; + + +/***/ }), +/* 1321 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169595,16 +171768,16 @@ module.exports = TweenManager; module.exports = { - Array: __webpack_require__(178), - Base64: __webpack_require__(1310), - Objects: __webpack_require__(1312), - String: __webpack_require__(1316) + Array: __webpack_require__(180), + Base64: __webpack_require__(1322), + Objects: __webpack_require__(1324), + String: __webpack_require__(1328) }; /***/ }), -/* 1310 */ +/* 1322 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169619,14 +171792,14 @@ module.exports = { module.exports = { - ArrayBufferToBase64: __webpack_require__(1311), - Base64ToArrayBuffer: __webpack_require__(358) + ArrayBufferToBase64: __webpack_require__(1323), + Base64ToArrayBuffer: __webpack_require__(361) }; /***/ }), -/* 1311 */ +/* 1323 */ /***/ (function(module, exports) { /** @@ -169684,7 +171857,7 @@ module.exports = ArrayBufferToBase64; /***/ }), -/* 1312 */ +/* 1324 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169699,26 +171872,26 @@ module.exports = ArrayBufferToBase64; module.exports = { - Clone: __webpack_require__(64), - Extend: __webpack_require__(17), + Clone: __webpack_require__(65), + Extend: __webpack_require__(15), GetAdvancedValue: __webpack_require__(14), GetFastValue: __webpack_require__(2), - GetMinMaxValue: __webpack_require__(1313), - GetValue: __webpack_require__(6), - HasAll: __webpack_require__(1314), - HasAny: __webpack_require__(377), + GetMinMaxValue: __webpack_require__(1325), + GetValue: __webpack_require__(5), + HasAll: __webpack_require__(1326), + HasAny: __webpack_require__(380), HasValue: __webpack_require__(97), IsPlainObject: __webpack_require__(7), - Merge: __webpack_require__(85), - MergeRight: __webpack_require__(1315), - Pick: __webpack_require__(461), - SetValue: __webpack_require__(398) + Merge: __webpack_require__(105), + MergeRight: __webpack_require__(1327), + Pick: __webpack_require__(464), + SetValue: __webpack_require__(401) }; /***/ }), -/* 1313 */ +/* 1325 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169727,8 +171900,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); -var Clamp = __webpack_require__(22); +var GetValue = __webpack_require__(5); +var Clamp = __webpack_require__(24); /** * Retrieves and clamps a numerical value from an object. @@ -169757,7 +171930,7 @@ module.exports = GetMinMaxValue; /***/ }), -/* 1314 */ +/* 1326 */ /***/ (function(module, exports) { /** @@ -169794,7 +171967,7 @@ module.exports = HasAll; /***/ }), -/* 1315 */ +/* 1327 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169803,7 +171976,7 @@ module.exports = HasAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(64); +var Clone = __webpack_require__(65); /** * Creates a new Object using all values from obj1. @@ -169837,7 +172010,7 @@ module.exports = MergeRight; /***/ }), -/* 1316 */ +/* 1328 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169852,17 +172025,17 @@ module.exports = MergeRight; module.exports = { - Format: __webpack_require__(1317), - Pad: __webpack_require__(158), - Reverse: __webpack_require__(1318), - UppercaseFirst: __webpack_require__(347), - UUID: __webpack_require__(380) + Format: __webpack_require__(1329), + Pad: __webpack_require__(159), + Reverse: __webpack_require__(1330), + UppercaseFirst: __webpack_require__(178), + UUID: __webpack_require__(383) }; /***/ }), -/* 1317 */ +/* 1329 */ /***/ (function(module, exports) { /** @@ -169897,7 +172070,7 @@ module.exports = Format; /***/ }), -/* 1318 */ +/* 1330 */ /***/ (function(module, exports) { /** @@ -169926,7 +172099,7 @@ module.exports = Reverse; /***/ }), -/* 1319 */ +/* 1331 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169942,38 +172115,26 @@ module.exports = Reverse; module.exports = { - SoundManagerCreator: __webpack_require__(352), + SoundManagerCreator: __webpack_require__(355), - Events: __webpack_require__(65), + Events: __webpack_require__(66), - BaseSound: __webpack_require__(124), - BaseSoundManager: __webpack_require__(123), + BaseSound: __webpack_require__(125), + BaseSoundManager: __webpack_require__(124), - WebAudioSound: __webpack_require__(359), - WebAudioSoundManager: __webpack_require__(357), + WebAudioSound: __webpack_require__(362), + WebAudioSoundManager: __webpack_require__(360), - HTML5AudioSound: __webpack_require__(354), - HTML5AudioSoundManager: __webpack_require__(353), + HTML5AudioSound: __webpack_require__(357), + HTML5AudioSoundManager: __webpack_require__(356), - NoAudioSound: __webpack_require__(356), - NoAudioSoundManager: __webpack_require__(355) + NoAudioSound: __webpack_require__(359), + NoAudioSoundManager: __webpack_require__(358) }; /***/ }), -/* 1320 */, -/* 1321 */, -/* 1322 */, -/* 1323 */, -/* 1324 */, -/* 1325 */, -/* 1326 */, -/* 1327 */, -/* 1328 */, -/* 1329 */, -/* 1330 */, -/* 1331 */, /* 1332 */, /* 1333 */, /* 1334 */, @@ -170044,7 +172205,19 @@ module.exports = { /* 1399 */, /* 1400 */, /* 1401 */, -/* 1402 */ +/* 1402 */, +/* 1403 */, +/* 1404 */, +/* 1405 */, +/* 1406 */, +/* 1407 */, +/* 1408 */, +/* 1409 */, +/* 1410 */, +/* 1411 */, +/* 1412 */, +/* 1413 */, +/* 1414 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** @@ -170053,10 +172226,10 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -__webpack_require__(490); +__webpack_require__(492); -var CONST = __webpack_require__(26); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(31); +var Extend = __webpack_require__(15); /** * @namespace Phaser @@ -170071,37 +172244,37 @@ var Extend = __webpack_require__(17); var Phaser = { - Actions: __webpack_require__(229), - Animations: __webpack_require__(579), - Cache: __webpack_require__(594), - Cameras: __webpack_require__(597), - Core: __webpack_require__(680), + Actions: __webpack_require__(232), + Animations: __webpack_require__(597), + Cache: __webpack_require__(598), + Cameras: __webpack_require__(601), + Core: __webpack_require__(684), Class: __webpack_require__(0), - Create: __webpack_require__(737), - Curves: __webpack_require__(743), - Data: __webpack_require__(746), - Display: __webpack_require__(748), - DOM: __webpack_require__(777), - Events: __webpack_require__(778), - Game: __webpack_require__(780), - GameObjects: __webpack_require__(874), - Geom: __webpack_require__(401), - Input: __webpack_require__(1148), - Loader: __webpack_require__(1182), - Math: __webpack_require__(165), + Create: __webpack_require__(742), + Curves: __webpack_require__(748), + Data: __webpack_require__(751), + Display: __webpack_require__(753), + DOM: __webpack_require__(782), + Events: __webpack_require__(783), + Game: __webpack_require__(785), + GameObjects: __webpack_require__(878), + Geom: __webpack_require__(404), + Input: __webpack_require__(1152), + Loader: __webpack_require__(1186), + Math: __webpack_require__(166), Physics: { - Arcade: __webpack_require__(1207) + Arcade: __webpack_require__(1211) }, - Plugins: __webpack_require__(1248), - Scale: __webpack_require__(1250), - Scene: __webpack_require__(346), - Scenes: __webpack_require__(1251), - Structs: __webpack_require__(1253), - Textures: __webpack_require__(1254), - Tilemaps: __webpack_require__(1256), - Time: __webpack_require__(1297), - Tweens: __webpack_require__(1299), - Utils: __webpack_require__(1309) + Plugins: __webpack_require__(1252), + Scale: __webpack_require__(1254), + Scene: __webpack_require__(349), + Scenes: __webpack_require__(1255), + Structs: __webpack_require__(1257), + Textures: __webpack_require__(1258), + Tilemaps: __webpack_require__(1260), + Time: __webpack_require__(1301), + Tweens: __webpack_require__(1303), + Utils: __webpack_require__(1321) }; @@ -170111,7 +172284,7 @@ Phaser = Extend(false, Phaser, CONST); if (true) { - Phaser.Sound = __webpack_require__(1319); + Phaser.Sound = __webpack_require__(1331); } // Export it @@ -170126,7 +172299,7 @@ global.Phaser = Phaser; * -- Dick Brandon */ -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(222))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(225))) /***/ }) /******/ ]); diff --git a/dist/phaser-arcade-physics.min.js b/dist/phaser-arcade-physics.min.js index ed56c74e9..0726e1255 100644 --- a/dist/phaser-arcade-physics.min.js +++ b/dist/phaser-arcade-physics.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(window,function(){return 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=1402)}([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||!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 a in e)if(e.hasOwnProperty(a)){var h=i(e,a,s);if(!1!==h){if(n((r||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0&&(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},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}});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},function(t,e,i){var n=i(0),s=i(18),r=i(19),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.systems.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.systems.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},s.register("GameObjectFactory",o,"add"),t.exports=o},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n=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=l},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,s="~";function r(){}function o(t,e,i,n,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new function(t,e,i){this.fn=t,this.context=e,this.once=i||!1}(i,n||t,r),a=s?s+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function h(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),h.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},h.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,o=new Array(r);n=400&&t.status<=599&&(n=!1),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(){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.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){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)},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,i){var n=i(2);t.exports=function(t,e,i,s,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===s&&(s=o.height);var a=n(r,"isNotEmpty",!1),h=n(r,"isColliding",!1),l=n(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(s+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){t.exports={BLUR:i(580),BOOT:i(581),DESTROY:i(582),FOCUS:i(583),HIDDEN:i(584),PAUSE:i(585),POST_RENDER:i(586),POST_STEP:i(587),PRE_RENDER:i(588),PRE_STEP:i(589),READY:i(590),RESUME:i(591),STEP:i(592),VISIBLE:i(593)}},function(t,e,i){var n=i(52),s=i(14),r=i(104);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 o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"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 h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),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){var n=i(0),s=i(12),r=i(13),o=i(54),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e,i){var n=i(0),s=i(4),r=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}},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)}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},scaleY:{get:function(){return Math.sqrt(this.b*this.b+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],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[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],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,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 o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(t.translateX=e[4],t.translateY=e[5],i||n){var a=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}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=o/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,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=r*c*e+-o*c*t+(-u*r+l*o)*c,i},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},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.decomposedMatrix=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(160),r=i(270),o=i(161),a=i(271),h=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=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=i(23);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.fillColor,r=n||e.fillAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},,function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},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){t.exports={DESTROY:i(602),FADE_IN_COMPLETE:i(603),FADE_IN_START:i(604),FADE_OUT_COMPLETE:i(605),FADE_OUT_START:i(606),FLASH_COMPLETE:i(607),FLASH_START:i(608),PAN_COMPLETE:i(609),PAN_START:i(610),POST_RENDER:i(611),PRE_RENDER:i(612),SHAKE_COMPLETE:i(613),SHAKE_START:i(614),ZOOM_COMPLETE:i(615),ZOOM_START:i(616)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e,i){var n=i(137),s=i(21);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;dthis.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=h},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},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,i){var n=i(0),s=i(16),r=i(20),o=i(8),a=i(2),h=i(6),l=i(7),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s80*i){n=h=t[0],a=l=t[1];for(var T=i;Th&&(h=u),f>l&&(l=f);g=0!==(g=Math.max(h-n,l-a))?1/g:0}return o(y,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===S(t,e,i,n)>0)for(r=e;r=e;r-=n)o=E(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(_(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(_(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),_(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(m(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&m(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(m(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.prevZ,v=t.nextZ;p&&p.z>=c&&v&&v.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!y(s,r)&&x(s,n,n.next,r)&&T(s,r)&&T(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),_(n),_(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=w(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&T(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=w(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&T(t,e)&&T(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(y(t,e)&&y(i,n)||y(t,n)&&y(i,e))||m(t,e,i)>0!=m(t,e,n)>0&&m(i,n,t)>0!=m(i,n,e)>0}function T(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function w(t,e){var i=new b(t.i,t.x,t.y),n=new b(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function E(t,e,i,n){var s=new b(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function _(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function b(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){t.exports={COMPLETE:i(851),DECODED:i(852),DECODED_ALL:i(853),DESTROY:i(854),DETUNE:i(855),GLOBAL_DETUNE:i(856),GLOBAL_MUTE:i(857),GLOBAL_RATE:i(858),GLOBAL_VOLUME:i(859),LOOP:i(860),LOOPED:i(861),MUTE:i(862),PAUSE_ALL:i(863),PAUSE:i(864),PLAY:i(865),RATE:i(866),RESUME_ALL:i(867),RESUME:i(868),SEEK:i(869),STOP_ALL:i(870),STOP:i(871),UNLOCKED:i(872),VOLUME:i(873)}},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||e>s||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(926),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,o){r.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s.Animation(this),this.setTexture(n,o),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e,i){return this.anims.play(t,e,i),this},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=a},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(0),s=i(16),r=i(20),o=i(8),a=i(2),h=i(7),l=new n({Extends:r,initialize:function t(e,i,n,s,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),n=a(c,"url"),l=a(c,"normalMap"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(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:o};if(r.call(this,e,d),l){var f=new t(e,this.key,l,s,o);f.type="normalMap",this.setLink(f),e.addFile(f)}},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")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;nthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight,this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e,i){var n=i(0),s=i(46),r=i(241),o=i(242),a=i(145),h=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=h},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;si&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){t.exports={ADD:i(829),COMPLETE:i(830),FILE_COMPLETE:i(831),FILE_KEY_COMPLETE:i(832),FILE_LOAD_ERROR:i(833),FILE_LOAD:i(834),FILE_PROGRESS:i(835),POST_PROCESS:i(836),PROGRESS:i(837),START:i(838)}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},function(t,e,i){var n=i(3);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(u-h)*(r-l)-(c-l)*(s-h),f=(o-s)*(r-l)-(a-r)*(s-h),p=(c-l)*(o-s)-(u-h)*(a-r);if(0===p)return!1;var g=d/p,v=f/p;return g>=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},,function(t,e,i){var n=i(64);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i}},function(t,e,i){var n=i(22);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e,i){t.exports={ENTER_FULLSCREEN:i(655),FULLSCREEN_FAILED:i(656),FULLSCREEN_UNSUPPORTED:i(657),LEAVE_FULLSCREEN:i(658),ORIENTATION_CHANGE:i(659),RESIZE:i(660)}},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,i){var n=i(0),s=i(22),r=i(17),o=new n({initialize:function(t,e,i,n,s,r,o){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,o,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 o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.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,o,a){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)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),m=r=s(r,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(n=s(n,0,u-e)),w=i+(r=s(r,0,c-i));if(!(x.rT||x.y>w)){var E=Math.max(x.x,e),_=Math.max(x.y,i),b=Math.min(x.r,T)-E,S=Math.min(x.b,w)-_;v=b,m=S,p=o?h+(u-(E-x.x)-b):h+(E-x.x),g=a?l+(c-(_-x.y)-S):l+(_-x.y),e=E,i=_,n=b,r=S}else p=0,g=0,v=0,m=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var A=this.source.width,C=this.source.height;return t.u0=Math.max(0,p/A),t.v0=Math.max(0,g/C),t.u1=Math.min(1,(p+v)/A),t.v1=Math.min(1,(g+m)/C),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=m,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},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,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,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 o(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.texture=null,this.source=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=o},function(t,e,i){var n=i(0),s=i(93),r=i(368),o=i(369),a=i(152),h=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.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 o(this,t,e,i)},getRandomPoint:function(t){return a(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.width=0,this.height=0,this},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},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=h},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var n=i(229),s=i(0),r=i(110),o=i(2),a=i(6),h=i(7),l=i(362),u=i(105),c=i(67),d=new s({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?h(e[0])&&(i=e,e=null):h(e)&&(i=e,e=null),this.scene=t,this.children=new u(e),this.isParent=!0,this.classType=o(i,"classType",c),this.name=o(i,"name",""),this.active=o(i,"active",!0),this.maxSize=o(i,"maxSize",-1),this.defaultKey=o(i,"defaultKey",null),this.defaultFrame=o(i,"defaultFrame",null),this.runChildUpdate=o(i,"runChildUpdate",!1),this.createCallback=o(i,"createCallback",null),this.removeCallback=o(i,"removeCallback",null),this.createMultipleCallback=o(i,"createMultipleCallback",null),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i=0&&t=0&&e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return t0;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){var n=i(0),s=i(12),r=i(35),o=i(11),a=i(48),h=i(10),l=i(32),u=i(159),c=i(4),d=new n({Extends:o,Mixins:[s.Alpha,s.Visible],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),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;gC&&wS&&Es&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras;var i=this.scaleManager.resolution;return this.resolution=i,this._cx=this._x*i,this._cy=this._y*i,this._cw=this._width*i,this._ch=this._height*i,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=d},function(t,e){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;i0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){t.exports={ADD:i(727),ERROR:i(728),LOAD:i(729),READY:i(730),REMOVE:i(731)}},function(t,e){t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement)return t;return i||(i=document.body),i.appendChild(t),t}},function(t,e,i){var n=i(78);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 o=e.length-1;o>=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e,i){var n=i(0),s=i(64),r=i(11),o=i(65),a=i(28),h=i(1),l=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on(a.FOCUS,function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once(o.COMPLETE,n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(o.STOP_ALL,this)},unlock:h,onBlur:h,onFocus:h,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=l},function(t,e,i){var n=i(0),s=i(11),r=i(65),o=i(17),a=i(1),h=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},function(t,e,i){var n=i(178),s=i(0),r=i(1),o=i(127),a=new s({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?n.Add(this.list,t):n.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?n.AddAt(this.list,t,e):n.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o.inplace(this.list,e),this):this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return n.GetFirst(this.list,t,e,i,s)},getAll:function(t,e,i,s){return n.GetAll(this.list,t,e,i,s)},count:function(t,e){return n.CountAllMatching(this.list,t,e)},swap:function(t,e){n.Swap(this.list,t,e)},moveTo:function(t,e){return n.MoveTo(this.list,t,e)},remove:function(t,e){return e?n.Remove(this.list,t):n.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?n.RemoveAt(this.list,t):n.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?n.RemoveBetween(this.list,t,e):n.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return n.BringToTop(this.list,t)},sendToBack:function(t){return n.SendToBack(this.list,t)},moveUp:function(t){return n.MoveUp(this.list,t),t},moveDown:function(t){return n.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e){return n.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?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}}});t.exports=a},function(t,e,i){var n=i(179),s=i(360);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;il&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a0&&o.length0&&a.lengthe.right||t.y>e.bottom)}},function(t,e,i){var n=i(6),s={},r={register:function(t,e,i,n,r){s[t]={plugin:e,mapping:i,settingsKey:n,configKey:r}},getPlugin:function(t){return s[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in s){var a=s[o].plugin,h=s[o].mapping,l=s[o].settingsKey,u=s[o].configKey;n(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){s.hasOwnProperty(t)&&delete s[t]}};t.exports=r},function(t,e,i){t.exports={ANY_KEY_DOWN:i(1164),ANY_KEY_UP:i(1165),COMBO_MATCH:i(1166),DOWN:i(1167),KEY_DOWN:i(1168),KEY_UP:i(1169),UP:i(1170)}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),{responseType:t,async:e,user:i,password:n,timeout:s,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e,i){var n=i(0),s=i(207),r=i(67),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},,function(t,e,i){t.exports={CalculateFacesAt:i(210),CalculateFacesWithin:i(51),Copy:i(1257),CreateFromTiles:i(1258),CullTiles:i(1259),Fill:i(1260),FilterTiles:i(1261),FindByIndex:i(1262),FindTile:i(1263),ForEachTile:i(1264),GetTileAt:i(137),GetTileAtWorldXY:i(1265),GetTilesWithin:i(21),GetTilesWithinShape:i(1266),GetTilesWithinWorldXY:i(1267),HasTileAt:i(451),HasTileAtWorldXY:i(1268),IsInLayerBounds:i(101),PutTileAt:i(211),PutTileAtWorldXY:i(1269),PutTilesAt:i(1270),Randomize:i(1271),RemoveTileAt:i(452),RemoveTileAtWorldXY:i(1272),RenderDebug:i(1273),ReplaceByIndex:i(450),SetCollision:i(1274),SetCollisionBetween:i(1275),SetCollisionByExclusion:i(1276),SetCollisionByProperty:i(1277),SetCollisionFromCollisionGroup:i(1278),SetTileIndexCallback:i(1279),SetTileLocationCallback:i(1280),Shuffle:i(1281),SwapByIndex:i(1282),TileToWorldX:i(138),TileToWorldXY:i(1283),TileToWorldY:i(139),WeightedRandomize:i(1284),WorldToTileX:i(61),WorldToTileXY:i(1285),WorldToTileY:i(62)}},function(t,e,i){var n=i(101);t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),n(t,e,s)){var r=s.data[e][t]||null;return null===r?null:-1===r.index?i?r:null:r}return null}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.x+e.scrollX*(1-s.scrollFactorX),n*=s.scaleX),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.y+e.scrollY*(1-s.scrollFactorY),n*=s.scaleY),r+t*n}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o,a){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o={}),void 0===a&&(a={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=n,this.tileMargin=s,this.tileSpacing=r,this.tileProperties=o,this.tileData=a,this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(22),s=i(0),r=i(11),o=i(107),a=i(245),h=i(246),l=i(6),u=new s({Extends:r,initialize:function(t,e,i){r.call(this),this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,l(i,"frames",[]),l(i,"defaultTextureKey",null)),this.frameRate=l(i,"frameRate",null),this.duration=l(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=l(i,"skipMissedFrames",!0),this.delay=l(i,"delay",0),this.repeat=l(i,"repeat",0),this.repeatDelay=l(i,"repeatDelay",0),this.yoyo=l(i,"yoyo",!1),this.showOnStart=l(i,"showOnStart",!1),this.hideOnComplete=l(i,"hideOnComplete",!1),this.paused=!1,this.manager.on(o.PAUSE_ALL,this.pause,this),this.manager.on(o.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=a[0],a[0].prevFrame=s;var v=1/(a.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),a(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);if(t._repeatDelay>0&&!1===t.pendingRepeat)t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay;else if(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying){this.getNextTick(t),t.pendingRepeat=!1;var e=t.currentFrame,i=t.parent;this.emit(o.ANIMATION_REPEAT,this,e),i.emit(o.SPRITE_ANIMATION_KEY_REPEAT+this.key,this,e,t.repeatCounter,i),i.emit(o.SPRITE_ANIMATION_REPEAT,this,e,t.repeatCounter,i)}},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i1&&(n.prevFrame=this.frames[i-1],n.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.removeAllListeners(),this.manager.off(o.PAUSE_ALL,this.pause,this),this.manager.off(o.RESUME_ALL,this.resume,this),this.manager.remove(this.key);for(var t=0;t=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,i){var n=i(55),s=i(3);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},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){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){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=(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,i){var n=i(269),s=i(272),r=i(274),o=i(275);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var n=i(160);t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1);var r=Math.floor(6*t),o=6*t-r,a=Math.floor(i*(1-e)*255),h=Math.floor(i*(1-o*e)*255),l=Math.floor(i*(1-(1-o)*e)*255),u=i=Math.floor(i*=255),c=i,d=i,f=r%6;return 0===f?(c=l,d=a):1===f?(u=h,d=a):2===f?(u=a,d=l):3===f?(u=a,c=h):4===f?(u=l,c=a):5===f&&(c=a,d=h),s?s.setTo?s.setTo(u,c,d,s.alpha,!1):(s.r=u,s.g=c,s.b=d,s.color=n(u,c,d),s):{r:u,g:c,b:d,color:n(u,c,d)}}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var n=i(277),s=i(278),r=i(279),o=i(280),a=i(281),h=i(282),l=i(283),u=i(284),c=i(285),d=i(286),f=i(287),p=i(288);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:n.Out,Bounce:s.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":n.In,"Bounce.easeIn":s.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":n.Out,"Bounce.easeOut":s.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":s.InOut}},function(t,e,i){var n=i(115),s=i(116),r=i(24),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.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").createImageData(1,1);return a=n.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.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,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(o.getUserMedia=!1),!n.iOS&&(s.ie||s.firefox||s.chrome)&&(o.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.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)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},function(t,e,i){var n=i(23),s=i(17),r={Angle:i(686),Distance:i(694),Easing:i(696),Fuzzy:i(697),Interpolation:i(700),Pow2:i(705),Snap:i(707),RandomDataGenerator:i(709),Average:i(710),Bernstein:i(297),Between:i(168),CatmullRom:i(167),CeilTo:i(711),Clamp:i(22),DegToRad:i(35),Difference:i(712),Factorial:i(298),FloatBetween:i(304),FloorTo:i(713),FromPercent:i(86),GetSpeed:i(714),IsEven:i(715),IsEvenStrict:i(716),Linear:i(114),MaxAdd:i(717),MinSub:i(718),Percent:i(719),RadToDeg:i(169),RandomXY:i(720),RandomXYZ:i(721),RandomXYZW:i(722),Rotate:i(305),RotateAround:i(251),RotateAroundDistance:i(154),RoundAwayFromZero:i(306),RoundTo:i(723),SinCosTableGenerator:i(724),SmootherStep:i(155),SmoothStep:i(156),TransformXY:i(307),Within:i(725),Wrap:i(56),Vector2:i(4),Vector3:i(170),Vector4:i(308),Matrix3:i(309),Matrix4:i(310),Quaternion:i(311),RotateVec3:i(726)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)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,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,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},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],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=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=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],m=s[12],y=s[13],x=s[14],T=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+m)*T,this.y=(e*o+i*u+n*p+y)*T,this.z=(e*a+i*c+n*g+x)*T,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/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){t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},function(t,e,i){var n=i(10);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,r,o=Number.MAX_VALUE,a=Number.MAX_VALUE,h=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,u=0;u0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit(o.START,this),this.events.emit(o.READY,this,t)},shutdown:function(t){this.events.off(o.TRANSITION_INIT),this.events.off(o.TRANSITION_START),this.events.off(o.TRANSITION_COMPLETE),this.events.off(o.TRANSITION_OUT),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.SHUTDOWN,this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.DESTROY,this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e,i){var n=i(178),s=i(52),r=i(0),o=i(12),a=i(110),h=i(13),l=i(10),u=i(913),c=i(364),d=i(4),f=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Transform,o.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 o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,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.list.length>0)for(var e=this.list,i=new l,n=0;n-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=[],this._displayList=null}});t.exports=f},function(t,e,i){var n=i(128),s=i(0),r=i(918),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(112),s=i(0),r=i(186),o=i(244),a=i(247),h=i(248),l=i(252),u=i(151),c=i(257),d=i(258),f=i(255),p=i(32),g=i(92),v=i(13),m=i(2),y=i(6),x=i(23),T=i(924),w=new s({Extends:v,Mixins:[o,a,h,l,u,c,d,f,T],initialize:function(t,e){var i=y(e,"x",0),n=y(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this.setDefaultStyles(e)},setDefaultStyles:function(t){return y(t,"lineStyle",null)&&(this.defaultStrokeWidth=y(t,"lineStyle.width",1),this.defaultStrokeColor=y(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=y(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),y(t,"fillStyle",null)&&(this.defaultFillColor=y(t,"fillStyle.color",16777215),this.defaultFillAlpha=y(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,s){return void 0===s&&(s=1),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,s,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,s,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,n,s),this},setTexture:function(t,e,i){if(void 0===i&&(i=0),void 0===t)this.commandBuffer.push(r.CLEAR_TEXTURE);else{var n=this.scene.sys.textures.getFrame(t,e);n&&(2===i&&(i=3),this.commandBuffer.push(r.SET_TEXTURE,n,i))}return this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(r.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var s=this._lineWidth/2,r=t-s,o=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+n),this.lineTo(o+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,n,s,o),this},strokeTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,n,s,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,SET_TEXTURE:19,CLEAR_TEXTURE:20,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e,i){var n=i(3);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.width/2,r=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(372),a=i(125),h=i(374),l=i(934),u=new n({Extends:r,Mixins:[s.Depth,s.Mask,s.Pipeline,s.Transform,s.Visible,l],initialize:function(t,e,i,n){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var s=0;s0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;sn.width&&(t=n.width-this.frame.cutX),this.frame.cutY+e>n.height&&(e=n.height-this.frame.cutY),this.frame.setSize(t,e,this.frame.cutX,this.frame.cutY)}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.frame.cutWidth),void 0===r&&(r=this.frame.cutHeight);var o=255&(t>>16|0),a=255&(t>>8|0),h=255&(0|t),l=this.gl,u=this.frame;if(l){var c=this.renderer,f=this.getBounds();c.setFramebuffer(this.framebuffer,!0),s===u.source.width&&r===u.source.height||l.scissor(i+u.cutX,n+u.cutY,s,r),this.pipeline.drawFillRect(f.x,f.y,f.right,f.bottom,d.getTintFromFloats(o/255,a/255,h/255,1),e),s===u.source.width&&r===u.source.height||l.scissor(0,0,u.source.width,u.source.height),this.renderer.setFramebuffer(null,!0)}else this.context.fillStyle="rgba("+o+","+a+","+h+","+e+")",this.context.fillRect(i+u.cutX,n+u.cutY,s,r);return this},clear:function(){if(this.dirty){var t=this.gl;if(t){var e=this.renderer;e.setFramebuffer(this.framebuffer,!0),this.frame.cutWidth===this.canvas.width&&this.frame.cutHeight===this.canvas.height||t.scissor(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),e.setFramebuffer(null,!0)}else{var i=this.context;i.save(),i.setTransform(1,0,0,1,0,0),i.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),i.restore()}this.dirty=!1}return this},erase:function(t,e,i){this._eraseMode=!0;var s=this.renderer.currentBlendMode;return this.renderer.setBlendMode(n.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(s),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1),r){var o=this.camera._cx,a=this.camera._cy,h=this.camera._cw,l=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(o,a,h,l,l);var u=this.pipeline;u.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),this.batchList(t,e,i,n,s),u.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),u.projOrtho(0,u.width,u.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1),o){var h=this.camera._cx,l=this.camera._cy,u=this.camera._cw,c=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(h,l,u,c,c);var d=this.pipeline;d.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),d.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,r,s,this.camera.matrix,null),d.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),d.projOrtho(0,d.width,d.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;rl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=y+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=l,n+=a[h],h0&&(d+=h.lineSpacing*g),i.rtl)c=f-c;else if("right"===i.align)c+=o-h.lineWidths[g];else if("center"===i.align)c+=(o-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var v=h.width-h.lineWidths[g],m=e.measureText(" ").width,y=a[g].trim(),x=y.split(" ");v+=(a[g].length-y.length)*m;for(var T=Math.floor(v/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[g]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[g],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[g],c,d))}e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var E=this.input;return E&&!E.customHitArea&&(E.hitArea.width=this.width,E.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(24),s=i(0),r=i(12),o=i(26),a=i(13),h=i(302),l=i(113),u=i(950),c=i(4),d=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,s,r,l,u){var d=t.sys.game.renderer;a.call(this,t,"TileSprite");var f=t.sys.textures.get(l),p=f.get(u);s&&r?(s=Math.floor(s),r=Math.floor(r)):(s=p.width,r=p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=n.create(this,s,r),this.context=this.canvas.getContext("2d"),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(p.width),this.potHeight=h(p.height),this.fillCanvas=n.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(s,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.config.renderType===o.WEBGL&&t.sys.game.renderer.onContextRestored(function(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)},this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){return this.displayFrame=this.displayTexture.get(t),this.displayFrame.cutWidth&&this.displayFrame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame,e=this.fillContext,i=this.fillCanvas,n=this.potWidth,s=this.potHeight;this.renderer.gl||(n=t.cutWidth,s=t.cutHeight),e.clearRect(0,0,n,s),i.width=n,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,s),this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,n=this._tileScale.y,s=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,n),e.translate(-s,-r),e.fillStyle=this.fillPattern,e.fillRect(s,r,this.width/i,this.height/n),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),n.remove(this.canvas),n.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},function(t,e,i){var n=i(0),s=i(193),r=i(390),o=new n({initialize:function(t){this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return s(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n=0&&w<=1&&i.push(new n(r,o))}else if(T>0){var E=(-x-Math.sqrt(T))/(2*y);r=a+E*p,o=h+E*g,E>=0&&E<=1&&i.push(new n(r,o));var _=(-x+Math.sqrt(T))/(2*y);r=a+_*p,o=h+_*g,_>=0&&_<=1&&i.push(new n(r,o))}}return i}},function(t,e,i){var n=i(46),s=new(i(3));t.exports=function(t,e,i){if(void 0===i&&(i=s),n(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(n(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){var n=i(3),s=i(82),r=i(405);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new n,new n,new n,new n],c=[s(o,t,u[0]),s(a,t,u[1]),s(h,t,u[2]),s(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var s,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,m=p*v-g*g,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&s+r<1&&(n.push({x:e[w].x,y:e[w].y}),i)));w++);return n}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,t}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,o=t.x3-e,a=t.y3-i,t.x3=o*s-a*r+e,t.y3=o*r+a*s+i,t}},function(t,e,i){t.exports={BUTTON_DOWN:i(1150),BUTTON_UP:i(1151),CONNECTED:i(1152),DISCONNECTED:i(1153),GAMEPAD_BUTTON_DOWN:i(1154),GAMEPAD_BUTTON_UP:i(1155)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,i){var n=i(17),s=i(133);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,i){var n=i(0),s=i(16),r=i(20),o=i(8),a=i(2),h=i(7),l=i(336),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=Math.max(t,.001),this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},pause:function(){return this.state===o.PAUSED?this:(this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this)},play:function(t){if(void 0===t&&(t=!1),this.state===o.ACTIVE||this.state===o.PENDING_ADD&&this._pausedState===o.PENDING_ADD)return this;if(!this.parentIsTimeline&&(this.state===o.PENDING_REMOVE||this.state===o.REMOVED))return this.seek(0),this.parent.makeActive(this),this;var e=this.callbacks.onStart;return this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.ACTIVE):(this.countdown=this.calculatedOffset,this.state=o.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=o.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.parent.makeActive(this)),this},resetTweenData:function(t){for(var e=this.data,i=0;i0&&(n.elapsed=n.delay,n.state=o.DELAY)}},resume:function(){return this.state===o.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&ns.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}return this},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}return this},remove:function(){return this.parent.remove(this),this},stop:function(t){return this.state===o.ACTIVE&&void 0!==t&&this.seek(t),this.state!==o.REMOVED&&(this.state!==o.PAUSED&&this.state!==o.PENDING_ADD||(this.parentIsTimeline?(this.parent.manager._destroy.push(this),this.parent.manager._toProcess++):(this.parent._destroy.push(this),this.parent._toProcess++)),this.state=o.PENDING_REMOVE),this},update:function(t,e){if(this.state===o.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=!1,n=0;n0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},setStateFromStart:function(t,e,i){if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case o.PLAYING_FORWARD:case o.PLAYING_BACKWARD:if(!e.target){e.state=o.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;(n+=i)>s&&(r=n-s,n=s);var a,h=e.state===o.PLAYING_FORWARD,l=n/s;a=h?e.ease(l):e.ease(1-l),e.current=e.start+(e.end-e.start)*a,e.target[e.key]=e.current,e.elapsed=n,e.progress=l;var u=t.callbacks.onUpdate;u&&(u.params[1]=e.target,u.func.apply(u.scope,u.params)),1===l&&(h?e.hold>0?(e.elapsed=e.hold-r,e.state=o.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case o.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PENDING_RENDER);break;case o.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PLAYING_FORWARD);break;case o.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case o.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=o.PLAYING_FORWARD):e.state=o.COMPLETE}return e.state!==o.COMPLETE}});a.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=a},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d){return{target:t,key:e,getEndValue:i,getStartValue:n,ease:s,duration:0,totalDuration:0,delay:0,yoyo:a,hold:0,repeat:0,repeatDelay:0,flipX:c,flipY:d,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:r,duration:o,hold:h,repeat:l,repeatDelay:u},state:0}}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(56);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){var n=i(56);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(0),s=i(9),r=new n({initialize:function(t){this.name="WebGLPipeline",this.game=t.game,this.view=t.game.canvas,this.resolution=1,this.width=0,this.height=0,this.gl=t.gl,this.vertexCount=0,this.vertexCapacity=t.vertexCapacity,this.renderer=t.renderer,this.vertexData=t.vertices?t.vertices:new ArrayBuffer(t.vertexCapacity*t.vertexSize),this.vertexBuffer=this.renderer.createVertexBuffer(t.vertices?t.vertices:this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=this.renderer.createProgram(t.vertShader,t.fragShader),this.attributes=t.attributes,this.vertexSize=t.vertexSize,this.topology=t.topology,this.bytes=new Uint8Array(this.vertexData),this.vertexComponentCount=s.getComponentCount(t.attributes,this.gl),this.flushLocked=!1,this.active=!1},boot:function(){},addAttribute:function(t,e,i,n,s){return this.attributes.push({name:t,size:e,type:this.renderer.glFormats[i],normalized:n,offset:s}),this},shouldFlush:function(){return this.vertexCount>=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this.resolution=i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):-1!==h&&t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(0),s=i(63),r=i(2),o=i(487),a=i(735),h=i(736),l=i(32),u=i(9),c=i(225),d=new n({Extends:c,Mixins:[o],initialize:function(t){var e=t.renderer.config;c.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:r(t,"topology",t.renderer.gl.TRIANGLES),vertShader:r(t,"vertShader",h),fragShader:r(t,"fragShader",a),vertexCapacity:r(t,"vertexCapacity",6*e.batchSize),vertexSize:r(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this.batches=[],this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return c.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return c.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){return void 0===t&&(t=this.renderer.blankTexture.glTexture),void 0===e&&(e=0),this.requireTextureBatch(t,e)&&this.pushBatch(t,e),this},requireTextureBatch:function(t,e){var i=this.batches,n=i.length;return!(n>0)||!((e>0?i[n-1].textures[e-1]:i[n-1].texture)===t)},pushBatch:function(t,e){if(0===e)this.batches.push({first:this.vertexCount,texture:t,textures:[]});else{var i=[];i[e-1]=t,this.batches.push({first:this.vertexCount,texture:null,textures:i})}},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,n=this.gl,s=this.vertexCount,r=this.topology,o=this.vertexSize,a=this.renderer,h=this.batches,l=h.length,u=0,c=null;if(0===l||0===s)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,s*o));for(var d=0;d0){for(e=0;e0){for(e=0;e0&&(a.setTexture2D(c.texture,0,!1),n.drawArrays(r,c.first,u)),this.vertexCount=0,h.length=0,this.flushLocked=!1,this},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,l=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.cutWidth,v=o.cutHeight,m=-t.displayOriginX+f,y=-t.displayOriginY+p;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||o.updateCropUVs(x,t.flipX,t.flipY),h=x.u0,l=x.v0,c=x.u1,d=x.v1,g=x.width,v=x.height,f=x.x,p=x.y,m=-t.displayOriginX+f,y=-t.displayOriginY+p}t.flipX&&(m+=g,g*=-1),t.flipY&&(y+=v,v*=-1);var T=m+g,w=y+v;s.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),s.e=t.x,s.f=t.y,n.multiply(s,r)):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY,n.multiply(s,r));var E=r.getX(m,y),_=r.getY(m,y),b=r.getX(m,w),S=r.getY(m,w),A=r.getX(T,w),C=r.getY(T,w),M=r.getX(T,y),O=r.getY(T,y),P=u.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),R=u.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),L=u.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),D=u.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(E=Math.round(E),_=Math.round(_),b=Math.round(b),S=Math.round(S),A=Math.round(A),C=Math.round(C),M=Math.round(M),O=Math.round(O)),this.setTexture2D(a,0);var F=t._isTinted&&t.tintFill;this.batchQuad(E,_,b,S,A,C,M,O,h,l,c,d,P,R,L,D,F,a,0)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y){var x=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),x=!0,this.setTexture2D(m,y));var T=this.vertexViewF32,w=this.vertexViewU32,E=this.vertexCount*this.vertexComponentCount-1;return T[++E]=t,T[++E]=e,T[++E]=h,T[++E]=l,T[++E]=v,w[++E]=d,T[++E]=i,T[++E]=n,T[++E]=h,T[++E]=c,T[++E]=v,w[++E]=p,T[++E]=s,T[++E]=r,T[++E]=u,T[++E]=c,T[++E]=v,w[++E]=g,T[++E]=t,T[++E]=e,T[++E]=h,T[++E]=l,T[++E]=v,w[++E]=d,T[++E]=s,T[++E]=r,T[++E]=u,T[++E]=c,T[++E]=v,w[++E]=g,T[++E]=o,T[++E]=a,T[++E]=u,T[++E]=l,T[++E]=v,w[++E]=f,this.vertexCount+=6,x},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g){var v=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),this.setTexture2D(p,g),v=!0);var m=this.vertexViewF32,y=this.vertexViewU32,x=this.vertexCount*this.vertexComponentCount-1;return m[++x]=t,m[++x]=e,m[++x]=o,m[++x]=a,m[++x]=f,y[++x]=u,m[++x]=i,m[++x]=n,m[++x]=o,m[++x]=l,m[++x]=f,y[++x]=c,m[++x]=s,m[++x]=r,m[++x]=h,m[++x]=l,m[++x]=f,y[++x]=d,this.vertexCount+=3,v},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,E,_,b,S,A,C,M,O,P){this.renderer.setPipeline(this,t);var R=this._tempMatrix1,L=this._tempMatrix2,D=this._tempMatrix3,F=m/i+A,k=y/n+C,I=(m+x)/i+A,B=(y+T)/n+C,Y=o,N=a,X=-g,z=-v;if(t.isCropped){var U=t._crop;Y=U.width,N=U.height,o=U.width,a=U.height;var G=m=U.x,W=y=U.y;c&&(G=x-U.x-U.width),d&&!e.isRenderTexture&&(W=T-U.y-U.height),F=G/i+A,k=W/n+C,I=(G+U.width)/i+A,B=(W+U.height)/n+C,X=-g+m,z=-v+y}d^=!P&&e.isRenderTexture?1:0,c&&(Y*=-1,X+=o),d&&(N*=-1,z+=a);var H=X+Y,V=z+N;L.applyITRS(s,r,u,h,l),R.copyFrom(M.matrix),O?(R.multiplyWithOffset(O,-M.scrollX*f,-M.scrollY*p),L.e=s,L.f=r,R.multiply(L,D)):(L.e-=M.scrollX*f,L.f-=M.scrollY*p,R.multiply(L,D));var j=D.getX(X,z),q=D.getY(X,z),K=D.getX(X,V),J=D.getY(X,V),Z=D.getX(H,V),Q=D.getY(H,V),$=D.getX(H,z),tt=D.getY(H,z);M.roundPixels&&(j=Math.round(j),q=Math.round(q),K=Math.round(K),J=Math.round(J),Z=Math.round(Z),Q=Math.round(Q),$=Math.round($),tt=Math.round(tt)),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,F,k,I,B,w,E,_,b,S,e,0)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),m=h.getY(l,c),y=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,m,y,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n;this.setTexture2D();var h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),m=this.currentFrame,y=m.u0,x=m.v0,T=m.u1,w=m.v1;this.batchQuad(l,u,c,d,f,p,g,v,y,x,T,w,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,m=g.v0,y=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,m,y,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&V[4]?this.batchQuad(D,F,O,P,V[0],V[1],V[2],V[3],U,G,W,H,B,Y,N,X,I):(j[0]=D,j[1]=F,j[2]=O,j[3]=P,j[4]=1),h&&j[4]?this.batchQuad(C,M,R,L,j[0],j[1],j[2],j[3],U,G,W,H,B,Y,N,X,I):(V[0]=C,V[1]=M,V[2]=R,V[3]=L,V[4]=1)}}});t.exports=d},,,function(t,e,i){t.exports={Angle:i(499),Call:i(500),GetFirst:i(501),GetLast:i(502),GridAlign:i(503),IncAlpha:i(537),IncX:i(538),IncXY:i(539),IncY:i(540),PlaceOnCircle:i(541),PlaceOnEllipse:i(542),PlaceOnLine:i(543),PlaceOnRectangle:i(544),PlaceOnTriangle:i(545),PlayAnimation:i(546),PropertyValueInc:i(34),PropertyValueSet:i(27),RandomCircle:i(547),RandomEllipse:i(548),RandomLine:i(549),RandomRectangle:i(550),RandomTriangle:i(551),Rotate:i(552),RotateAround:i(553),RotateAroundDistance:i(554),ScaleX:i(555),ScaleXY:i(556),ScaleY:i(557),SetAlpha:i(558),SetBlendMode:i(559),SetDepth:i(560),SetHitArea:i(561),SetOrigin:i(562),SetRotation:i(563),SetScale:i(564),SetScaleX:i(565),SetScaleY:i(566),SetTint:i(567),SetVisible:i(568),SetX:i(569),SetXY:i(570),SetY:i(571),ShiftPosition:i(572),Shuffle:i(573),SmootherStep:i(574),SmoothStep:i(575),Spread:i(576),ToggleVisible:i(577),WrapInRectangle:i(578)}},function(t,e,i){var n=i(143),s=[];s[n.BOTTOM_CENTER]=i(231),s[n.BOTTOM_LEFT]=i(232),s[n.BOTTOM_RIGHT]=i(233),s[n.CENTER]=i(234),s[n.LEFT_CENTER]=i(236),s[n.RIGHT_CENTER]=i(237),s[n.TOP_CENTER]=i(238),s[n.TOP_LEFT]=i(239),s[n.TOP_RIGHT]=i(240);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){var n=i(38),s=i(73),r=i(39),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(38),s=i(40),r=i(39),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(38),s=i(42),r=i(39),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(235),s=i(73),r=i(76);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(74),s=i(75);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(76),s=i(40),r=i(75),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(76),s=i(42),r=i(75),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(73),s=i(44),r=i(74),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(40),s=i(44),r=i(41),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(42),s=i(44),r=i(43),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(144),s=i(86),r=i(23),o=i(3);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(243),s=i(144),r=i(86),o=i(23);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;he.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,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e,i){var n=i(52),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){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e,i){var n=i(147),s=i(108);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n-h&&(c-=h,n+=l),fd.right&&(f=u(f,f+(g-d.right),this.lerp.x)),vd.bottom&&(p=u(p,p+(v-d.bottom),this.lerp.y))):(f=u(f,g-h,this.lerp.x),p=u(p,v-l,this.lerp.y))}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.roundPixels&&(h=Math.round(h),l=Math.round(l)),this.scrollX=f,this.scrollY=p;var m=f+n,y=p+s;this.midPoint.set(m,y);var x=e/o,T=i/o;this.worldView.setTo(m-x/2,y-T/2,x,T),a.applyITRS(this.x+h,this.y+l,this.rotation,o,o),a.translate(-h,-l),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(33);t.exports=function(t){var e=new n;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(s,r,o)}return e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(e16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(33);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){var n=i(33);t.exports=function(t){var e=new n,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var s=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(s,r,o,255*a)}return e}},function(t,e,i){t.exports={Fade:i(617),Flash:i(618),Pan:i(619),Shake:i(652),Zoom:i(653)}},function(t,e,i){t.exports={In:i(620),Out:i(621),InOut:i(622)}},function(t,e,i){t.exports={In:i(623),Out:i(624),InOut:i(625)}},function(t,e,i){t.exports={In:i(626),Out:i(627),InOut:i(628)}},function(t,e,i){t.exports={In:i(629),Out:i(630),InOut:i(631)}},function(t,e,i){t.exports={In:i(632),Out:i(633),InOut:i(634)}},function(t,e,i){t.exports={In:i(635),Out:i(636),InOut:i(637)}},function(t,e,i){t.exports=i(638)},function(t,e,i){t.exports={In:i(639),Out:i(640),InOut:i(641)}},function(t,e,i){t.exports={In:i(642),Out:i(643),InOut:i(644)}},function(t,e,i){t.exports={In:i(645),Out:i(646),InOut:i(647)}},function(t,e,i){t.exports={In:i(648),Out:i(649),InOut:i(650)}},function(t,e,i){t.exports=i(651)},function(t,e,i){var n=i(0),s=i(26),r=i(290),o=i(2),a=i(6),h=i(7),l=i(165),u=i(1),c=i(171),d=i(159),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",void 0),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!0),this.autoRound=a(t,"autoRound",!1),this.autoCenter=a(t,"autoCenter",0),this.resizeInterval=a(t,"resizeInterval",500),this.fullscreenTarget=a(t,"fullscreenTarget",null),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"expandParent",this.expandParent),this.autoRound=a(e,"autoRound",this.autoRound),this.autoCenter=a(e,"autoCenter",this.autoCenter),this.resizeInterval=a(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=a(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.antialias=a(i,"antialias",!0),this.desynchronized=a(i,"desynchronized",!1),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3),this.maxLights=a(i,"maxLights",10);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){t.exports={os:i(115),browser:i(116),features:i(164),input:i(682),audio:i(683),video:i(684),fullscreen:i(685),canvasFeatures:i(291)}},function(t,e,i){var n,s,r,o=i(24),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");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;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");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);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},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){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},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),t0?Math.ceil(t):Math.floor(t)}},function(t,e,i){var n=i(4);t.exports=function(t,e,i,s,r,o,a,h){void 0===h&&(h=new n);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,f=-l*a,p=u*a,g=1/(c*p+f*-d);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=c*g*e+-d*g*t+(-s*c+i*d)*g,h}},function(t,e,i){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,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+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){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],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,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]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*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],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-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],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+m*h,e[4]=g*n+v*o+m*l,e[5]=g*s+v*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*n+x*o+T*l,e[8]=y*s+x*a+T*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],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-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,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,m=this.val;return m[0]=1-(c+f),m[3]=l+v,m[6]=u-g,m[1]=l-v,m[4]=1-(h+f),m[7]=d+p,m[2]=u+g,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=n*h-s*a,T=n*l-r*a,w=n*u-o*a,E=s*l-r*h,_=s*u-o*h,b=r*u-o*l,S=c*v-d*g,A=c*m-f*g,C=c*y-p*g,M=d*m-f*v,O=d*y-p*v,P=f*y-p*m,R=x*P-T*O+w*M+E*C-_*A+b*S;return R?(R=1/R,i[0]=(h*P-l*O+u*M)*R,i[1]=(l*C-a*P-u*A)*R,i[2]=(a*O-h*C+u*S)*R,i[3]=(r*O-s*P-o*M)*R,i[4]=(n*P-r*C+o*A)*R,i[5]=(s*C-n*O-o*S)*R,i[6]=(v*b-m*_+y*E)*R,i[7]=(m*w-g*b-y*T)*R,i[8]=(g*_-v*w+y*x)*R,this):null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),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],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},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(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=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]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],m=e*o-i*r,y=e*a-n*r,x=e*h-s*r,T=i*a-n*o,w=i*h-s*o,E=n*h-s*a,_=l*p-u*f,b=l*g-c*f,S=l*v-d*f,A=u*g-c*p,C=u*v-d*p,M=c*v-d*g,O=m*M-y*C+x*A+T*S-w*b+E*_;return O?(O=1/O,t[0]=(o*M-a*C+h*A)*O,t[1]=(n*C-i*M-s*A)*O,t[2]=(p*E-g*w+v*T)*O,t[3]=(c*w-u*E-d*T)*O,t[4]=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*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],E=y[3];return e[0]=x*i+T*o+w*u+E*p,e[1]=x*n+T*a+w*c+E*g,e[2]=x*s+T*h+w*d+E*v,e[3]=x*r+T*l+w*f+E*m,x=y[4],T=y[5],w=y[6],E=y[7],e[4]=x*i+T*o+w*u+E*p,e[5]=x*n+T*a+w*c+E*g,e[6]=x*s+T*h+w*d+E*v,e[7]=x*r+T*l+w*f+E*m,x=y[8],T=y[9],w=y[10],E=y[11],e[8]=x*i+T*o+w*u+E*p,e[9]=x*n+T*a+w*c+E*g,e[10]=x*s+T*h+w*d+E*v,e[11]=x*r+T*l+w*f+E*m,x=y[12],T=y[13],w=y[14],E=y[15],e[12]=x*i+T*o+w*u+E*p,e[13]=x*n+T*a+w*c+E*g,e[14]=x*s+T*h+w*d+E*v,e[15]=x*r+T*l+w*f+E*m,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},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){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},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,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=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],g=i[5],v=i[6],m=i[7],y=i[8],x=i[9],T=i[10],w=i[11],E=n*n*l+h,_=s*n*l+r*a,b=r*n*l-s*a,S=n*s*l-r*a,A=s*s*l+h,C=r*s*l+n*a,M=n*r*l+s*a,O=s*r*l-n*a,P=r*r*l+h;return i[0]=u*E+p*_+y*b,i[1]=c*E+g*_+x*b,i[2]=d*E+v*_+T*b,i[3]=f*E+m*_+w*b,i[4]=u*S+p*A+y*C,i[5]=c*S+g*A+x*C,i[6]=d*S+v*A+T*C,i[7]=f*S+m*A+w*C,i[8]=u*M+p*O+y*P,i[9]=c*M+g*O+x*P,i[10]=d*M+v*O+T*P,i[11]=f*M+m*O+w*P,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=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]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=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]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*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],o=e[2],a=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]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,m=o*h,y=o*l;return i[0]=1-(f+g),i[1]=c+y,i[2]=d-m,i[3]=0,i[4]=c-y,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+m,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,m=r*h;return e[0]=1-(d+p),e[1]=u+m,e[2]=c-v,e[3]=0,e[4]=u-m,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),m=h*(g*=v)-l*(p*=v),y=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(m*m+y*y+x*x))?(m*=v=1/v,y*=v,x*=v):(m=0,y=0,x=0);var T=p*x-g*y,w=g*m-f*x,E=f*y-p*m;return(v=Math.sqrt(T*T+w*w+E*E))?(T*=v=1/v,w*=v,E*=v):(T=0,w=0,E=0),n[0]=m,n[1]=T,n[2]=f,n[3]=0,n[4]=y,n[5]=w,n[6]=p,n[7]=0,n[8]=x,n[9]=E,n[10]=g,n[11]=0,n[12]=-(m*s+y*r+x*o),n[13]=-(T*s+w*r+E*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.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),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=i(0),s=i(170),r=i(309),o=new Int8Array([1,2,0]),a=new Float32Array([0,0,0]),h=new s(1,0,0),l=new s(0,1,0),u=new s,c=new r,d=new n({initialize:function(t,e,i,n){"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)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},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,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,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},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(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 n=c.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(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,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.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},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.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},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},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],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=i(313),s=i(24),r=i(26),o=i(164);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.CANVAS||e.renderType!==r.CANVAS&&!o.webGL){if(!o.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=r.CANVAS}else e.renderType=r.WEBGL;e.antialias||s.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=s.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||n.setCrisp(t.canvas),e.renderType!==r.HEADLESS&&(a=i(480),h=i(483),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(26);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===n.CANVAS?i="Canvas":e.renderType===n.HEADLESS&&(i="Headless");var s,r=e.audio,o=t.device.audio;if(s=!o.webAudio||r&&r.disableWebAudio?r&&r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio":"Web Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+n.VERSION+" / https://phaser.io");else{var a,h="",l=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach(function(t){h=h.concat("%c "),l.push("background: "+t),a=t}),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a):(h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),l.push("background: #fff"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+n.VERSION+" ("+i+" | "+s+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},function(t,e,i){var n=i(0),s=i(6),r=i(1),o=i(316),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step()},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.max(16+t.lastTime-i,0);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(28);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)},!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var n=i(319),s=i(24),r=i(6);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",n),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*a)),p=Math.floor(Math.abs(e.length*h));i||(i=s.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var g=i.getContext("2d");u&&g.clearRect(0,0,f,p),c&&c(i,g);for(var v=0;vi;)n-=i;ni.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e,i){var n=i(115);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e,i){var n=i(173);t.exports=function(t,e){var i=window.screen,s=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);if(s&&"string"==typeof s.type)return s.type;if("string"==typeof s)return s;if(i)return i.height>i.width?n.PORTRAIT:n.LANDSCAPE;if("number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?n.PORTRAIT:n.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return n.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return n.LANDSCAPE}return e>t?n.PORTRAIT:n.LANDSCAPE}},function(t,e){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},function(t,e){t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},function(t,e){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},function(t,e){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},function(t,e){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(0),s=i(175),r=i(11),o=i(53),a=i(28),h=i(338),l=i(339),u=i(340),c=i(341),d=i(32),f=i(307),p=new n({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var n=new u(this,i);n.smoothFactor=e.inputSmoothFactor,this.pointers.push(n)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(o.MANAGER_BOOT),this.game.events.on(a.PRE_RENDER,this.preRender,this),this.game.events.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var n=0;n10&&(t=10-this.pointersTotal);for(var i=0;i-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.useQueue||t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},function(t,e,i){var n=i(0),s=i(164),r=i(53),o=i(0),a=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.capture=t.inputMouseCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},requestPointerLock:function(){if(s.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){s.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onMouseMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseMove(e),t.capture&&e.preventDefault())},this.onMouseDown=function(n){i&&window.focus(),!n.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseDown(n),t.capture&&n.target===e&&n.preventDefault())},this.onMouseDownWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseDown(i)},this.onMouseUp=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseUp(i),t.capture&&i.target===e&&i.preventDefault())},this.onMouseUpWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseUp(i)},this.onMouseOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onMouseOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)},this.onMouseWheel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onMouseWheel(e)};var n=this.target;if(n){var r={passive:!0},o={passive:!1};n.addEventListener("mousemove",this.onMouseMove,this.capture?o:r),n.addEventListener("mousedown",this.onMouseDown,this.capture?o:r),n.addEventListener("mouseup",this.onMouseUp,this.capture?o:r),n.addEventListener("mouseover",this.onMouseOver,this.capture?o:r),n.addEventListener("mouseout",this.onMouseOut,this.capture?o:r),n.addEventListener("wheel",this.onMouseWheel,this.capture?o:r),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o)),s.pointerLock&&(this.pointerLockChange=function(e){var i=t.target;t.locked=document.pointerLockElement===i||document.mozPointerLockElement===i||document.webkitPointerLockElement===i,t.manager.queue.push(e)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&(window.removeEventListener("mousedown",this.onMouseDownWindow),window.removeEventListener("mouseup",this.onMouseUpWindow)),s.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},function(t,e,i){var n=i(292),s=i(0),r=i(57),o=i(166),a=i(301),h=i(4),l=new s({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.time=0,this.deltaX=0,this.deltaY=0,this.deltaZ=0},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,s=this.midPoint.y;if(t!==i||e!==s){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,s,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=n(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp),this.isDown=!1,this.wasTouch=!1},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp),this.isDown=!0,this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.manager.mouse.locked&&(this.movementX+=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY+=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=t.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,s=this.position.x,r=this.position.y,o=0;o0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,r=t.resolution,o=t.zoom,a=t.autoRound;if("string"==typeof e){var h=this.parentSize.width;0===h&&(h=window.innerWidth);var l=parseInt(e,10)/100;e=Math.floor(h*l)}if("string"==typeof i){var c=this.parentSize.height;0===c&&(c=window.innerHeight);var d=parseInt(i,10)/100;i=Math.floor(c*d)}this.resolution=1,this.scaleMode=s,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),o===n.ZOOM.MAX_ZOOM&&(o=this.getMaxZoom()),this.zoom=o,this.baseSize.setSize(e*r,i*r),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*o,t.minHeight*o),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*o,t.maxHeight*o),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==n.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=this.resolution,n=e.width*i,s=e.height*i;return(t.width!==n||t.height!==s)&&(t.setSize(n,s),!0)},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e(t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound,n=this.resolution;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t,e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,n=this.resolution,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,o=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i*n,e*i*n),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,h=t*i,l=e*i;return s&&(h=Math.floor(h),l=Math.floor(l)),h===t&&l===e||(a.width=h+"px",a.height=l+"px"),this.refresh(r,o)},setZoom:function(t){return this.zoom=t,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var n=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=n.marginLeft,s.marginTop=n.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,this.resolution,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===n.SCALE_MODE.NONE?(this.displaySize.setSize(s*o*1,r*o*1),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),o>1&&(i.width=t+"px",i.height=e+"px")):this.scaleMode===n.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(1*this.displaySize.width,1*this.displaySize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=p(this.parentSize.width,this.gameSize.width,0,!0),e=p(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==n.CENTER.NO_CENTER){var e=this.canvas,i=e.style,s=e.getBoundingClientRect(),r=s.width,o=s.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===n.CENTER.CENTER_HORIZONTALLY?h=0:t===n.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();this._requestedFullscreenChange=!0,"undefined"!=typeof Promise?e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT).then(this.fullscreenSuccessHandler).catch(this.fullscreenErrorHandler):i[e.request](t).then(this.fullscreenSuccessHandler).catch(this.fullscreenErrorHandler):(e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t),e.active?this.fullscreenSuccessHandler():this.fullscreenErrorHandler())}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&(this._requestedFullscreenChange=!0,document[t.cancel]()),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach(function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){this._requestedFullscreenChange||this.stopFullscreen(),this._requestedFullscreenChange=!1},onFullScreenError:function(){this.removeFullscreenTarget()},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy(),this.fullscreenTarget=null},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===n.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===n.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=v},function(t,e,i){var n=i(22),s=i(0),r=i(90),o=i(4),a=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio0&&(t=(e=r(e,n.y))*this.aspectRatio)):(i&&this.aspectRatios)&&(t=(e=r(e,n.y))*this.aspectRatio,n.x>0&&(e=(t=r(t,n.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},function(t,e,i){var n=i(0),s=i(122),r=i(19),o=i(28),a=i(6),h=i(80),l=i(1),u=i(346),c=i(176),d=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit(r.TRANSITION_INIT,n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=r.x&&t=r.y&&e=r.x&&t=r.y&&e0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=o},function(t,e,i){var n=i(123),s=i(0),r=i(11),o=i(356),a=i(1),h=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){var n=i(124),s=i(0),r=i(11),o=i(17),a=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!1},updateMarker:function(t){return!1},removeMarker:function(t){return null},play:function(t,e){return!1},pause:function(){return!1},resume:function(){return!1},stop:function(){return!1},destroy:function(){this.manager.remove(this),n.prototype.destroy.call(this)}});t.exports=a},function(t,e,i){var n=i(358),s=i(123),r=i(0),o=i(65),a=i(359),h=new r({Extends:s,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),s.call(this,t),this.locked&&this.unlock()},createAudioContext:function(t){var e=t.config.audio;return e&&e.context?(e.context.resume(),e.context):new AudioContext},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var s=this.game.cache.audio,r=i.length,a=0;a>4,u[h++]=(15&i)<<4|s>>2,u[h++]=(3&s)<<6|63&r;return l}},function(t,e,i){var n=i(124),s=i(0),r=i(65),o=new s({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),this.audioBuffer?(this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime-1;r--)n[s][r]=t[r][s]}return n}},function(t,e){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,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=n);o>r;){if(o-r>600){var h=o-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(o,Math.floor(e+(h-l)*c/h+d));s(t,e,f,p,a)}var g=t[e],v=r,m=o;for(i(t,r,e),a(t[o],g)>0&&i(t,r,o);v0;)m--}0===a(t[r],g)?i(t,r,m):i(t,++m,o),m<=e&&(r=m+1),e<=m&&(o=m-1)}};t.exports=s},function(t,e,i){var n=i(6),s=i(111),r=function(t,e,i){for(var n=[],s=0;s0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(10);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),o=Math.max(t.right,e.right)-s,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(s,r,o,a)}},function(t,e,i){var n=i(0),s=i(12),r=i(916),o=i(13),a=i(7),h=i(174),l=i(308),u=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Origin,s.ScrollFactor,s.Transform,s.Visible,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new l,this.rotate3dAngle="deg",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof n?"#"===n[0]?this.setElement(n.substr(1),s,r):this.createElement(n,s,r):n&&this.setElement(n,s,r)},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e>>16,y=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+m+","+y+","+x+","+d+")",c.lineWidth=v,T+=3;break;case n.FILL_STYLE:g=l[T+1],f=l[T+2],m=(16711680&g)>>>16,y=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+m+","+y+","+x+","+f+")",T+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[T+1],l[T+2],l[T+3],l[T+4]):c.fillRect(l[T+1],l[T+2],l[T+3],l[T+4]),T+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.fill(),T+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.stroke(),T+=6;break;case n.LINE_TO:c.lineTo(l[T+1],l[T+2]),T+=2;break;case n.MOVE_TO:c.moveTo(l[T+1],l[T+2]),T+=2;break;case n.LINE_FX_TO:c.lineTo(l[T+1],l[T+2]),T+=5;break;case n.MOVE_FX_TO:c.moveTo(l[T+1],l[T+2]),T+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[T+1],l[T+2]),T+=2;break;case n.SCALE:c.scale(l[T+1],l[T+2]),T+=2;break;case n.ROTATE:c.rotate(l[T+1]),T+=1;break;case n.GRADIENT_FILL_STYLE:T+=5;break;case n.GRADIENT_LINE_STYLE:T+=6;break;case n.SET_TEXTURE:T+=2}c.restore()}}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(52),s=i(0),r=i(12),o=i(375),a=i(376),h=i(933),l=i(2),u=i(180),c=i(377),d=i(97),f=i(373),p=i(378),g=i(10),v=i(127),m=i(4),y=i(56),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];s.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===n&&(n=!1),void 0===s&&(s=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=s,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;i0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e,i){var n=i(0),s=i(956),r=i(63),o=i(10),a=i(30),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;sc+v)){var m=g.getPoint((u-c)/v);o.push(m);break}c+=v}return o}},function(t,e,i){var n=i(55),s=i(54);t.exports=function(t){for(var e=t.points,i=0,r=0;r0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(0),s=i(10),r=i(30),o=i(977),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new s(0,0,n,o)),this.setPosition(e,i),this.setSize(n,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(980),s=i(0),r=i(63),o=i(30),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(55),s=i(3);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e){t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=t,o=0;o0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],o):h=new s(t,e,i,a[0],a[1],a[2],o),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=o},function(t,e,i){t.exports={Circle:i(1039),Ellipse:i(1049),Intersects:i(402),Line:i(1068),Point:i(1089),Polygon:i(1103),Rectangle:i(417),Triangle:i(1133)}},function(t,e,i){t.exports={CircleToCircle:i(403),CircleToRectangle:i(404),GetCircleToCircle:i(1059),GetCircleToRectangle:i(1060),GetLineToCircle:i(196),GetLineToRectangle:i(198),GetRectangleIntersection:i(1061),GetRectangleToRectangle:i(1062),GetRectangleToTriangle:i(1063),GetTriangleToCircle:i(1064),GetTriangleToLine:i(409),GetTriangleToTriangle:i(1065),LineToCircle:i(197),LineToLine:i(82),LineToRectangle:i(405),PointToLine:i(413),PointToLineSegment:i(1066),RectangleToRectangle:i(130),RectangleToTriangle:i(406),RectangleToValues:i(1067),TriangleToCircle:i(408),TriangleToLine:i(410),TriangleToTriangle:i(411)}},function(t,e,i){var n=i(57);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(82),s=i(47),r=i(199),o=i(407);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e,i){var n=i(197),s=i(81);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=1);var n=e.x1,s=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-n)*(r-n)+(o-s)*(o-s);if(0===l)return!1;var u=((a-n)*(r-n)+(h-s)*(o-s))/l;if(u<0)return Math.sqrt((n-a)*(n-a)+(s-h)*(s-h))<=i;if(u>=0&&u<=1){var c=((s-h)*(r-n)-(n-a)*(o-s))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},function(t,e,i){var n=i(23),s=i(56),r=i(83);t.exports=function(t){var e=r(t)-n.TAU;return s(e,-Math.PI,Math.PI)}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e,i){var n=i(10);n.Area=i(1108),n.Ceil=i(1109),n.CeilAll=i(1110),n.CenterOn=i(162),n.Clone=i(1111),n.Contains=i(47),n.ContainsPoint=i(1112),n.ContainsRect=i(418),n.CopyFrom=i(1113),n.Decompose=i(407),n.Equals=i(1114),n.FitInside=i(1115),n.FitOutside=i(1116),n.Floor=i(1117),n.FloorAll=i(1118),n.FromPoints=i(172),n.GetAspectRatio=i(201),n.GetCenter=i(1119),n.GetPoint=i(147),n.GetPoints=i(249),n.GetSize=i(1120),n.Inflate=i(1121),n.Intersection=i(1122),n.MarchingAnts=i(260),n.MergePoints=i(1123),n.MergeRect=i(1124),n.MergeXY=i(1125),n.Offset=i(1126),n.OffsetPoint=i(1127),n.Overlaps=i(1128),n.Perimeter=i(108),n.PerimeterPoint=i(1129),n.Random=i(150),n.RandomOutside=i(1130),n.SameDimensions=i(1131),n.Scale=i(1132),n.Union=i(364),t.exports=n},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var n=i(423),s=i(424),r=i(0),o=i(11),a=i(4),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=r;for(i=0;i=r;)this._elapsed-=r,this.step(s)}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(n=(i=h.entries).length,t=0;t-1&&p>g&&(t.velocity.normalize().scale(g),p=g),t.speed=p},separate:function(t,e,i,n,s){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,s);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.ya.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,c=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)r.right&&(s=h(o.x,o.y,r.right,r.y)-o.radius):o.y>r.bottom&&(o.xr.right&&(s=h(o.x,o.y,r.right,r.bottom)-o.radius)),s*=-1}else s=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s&&(t.onOverlap||e.onOverlap)&&this.emit(u.OVERLAP,t.gameObject,e.gameObject,t,e),0!==s;var a=t.position.x-e.position.x,l=t.position.y-e.position.y,c=Math.sqrt(Math.pow(a,2)+Math.pow(l,2)),d=(e.position.x-t.position.x)/c||0,f=(e.position.y-t.position.y)/c||0,v=2*(t.velocity.x*d+t.velocity.y*f-e.velocity.x*d-e.velocity.y*f)/(t.mass+e.mass);t.immovable||(t.velocity.x=(t.velocity.x-v*t.mass*d)*t.bounce.x,t.velocity.y=(t.velocity.y-v*t.mass*f)*t.bounce.y),e.immovable||(e.velocity.x=(e.velocity.x+v*e.mass*d)*e.bounce.x,e.velocity.y=(e.velocity.y+v*e.mass*f)*e.bounce.y);var m=e.velocity.x-t.velocity.x,y=e.velocity.y-t.velocity.y,x=Math.atan2(y,m),T=this._frameTime;return t.immovable||(t.x+=t.velocity.x*T-s*Math.cos(x),t.y+=t.velocity.y*T-s*Math.sin(x)),e.immovable||(e.x+=e.velocity.x*T+s*Math.cos(x),e.y+=e.velocity.y*T+s*Math.sin(x)),(t.onCollide||e.onCollide)&&this.emit(u.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o,a;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f=e.getTilesWithinWorldXY(a,h,l,u);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,n,s,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,s,r,o){for(var a,h,l=t.body,c={left:0,right:0,top:0,bottom:0},d=!1,f=0;f0&&t>i&&(t=i)),0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),this.gameObject.x+=t,this.gameObject.y+=e,this._reset=!0}t<0?this.facing=r.FACING_LEFT:t>0&&(this.facing=r.FACING_RIGHT),e<0?this.facing=r.FACING_UP:e>0&&(this.facing=r.FACING_DOWN),this._dx=t,this._dy=e,this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,s=void 0!==i;return(n||s)&&(this.worldBounce||(this.worldBounce=new u),n&&(this.worldBounce.x=e),s&&(this.worldBounce.y=i)),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(50);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=i(50);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,m,y;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,m-g)*Math.max(0,y-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(46),s=i(0),r=i(50),o=i(47),a=i(4),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},,,,function(t,e,i){var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game,this.scene,this.systems},init:function(){},start:function(){},stop:function(){},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e,i){var n=i(21);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l-1}return!1}},function(t,e,i){var n=i(72),s=i(101),r=i(210);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!1),void 0===o&&(o=!0),!s(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new n(a,-1,t,e,h.width,h.height),o&&h&&h.collides&&r(t,e,a),h):null}},function(t,e,i){var n=i(31),s=i(213),r=i(454),o=i(455),a=i(466);t.exports=function(t,e,i,h,l,u){var c;switch(e){case n.ARRAY_2D:c=s(t,i,h,l,u);break;case n.CSV:c=r(t,i,h,l,u);break;case n.TILED_JSON:c=o(t,i,u);break;case n.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},function(t,e,i){var n=i(31),s=i(213);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map(function(t){return t.split(",")}),h=s(t,a,i,r,o);return h.format=n.CSV,h}},function(t,e,i){var n=i(31),s=i(103),r=i(456),o=i(458),a=i(459),h=i(462),l=i(464),u=i(465);t.exports=function(t,e,i){if("orthogonal"!==e.orientation)return console.warn("Only orthogonal map types are supported in this version of Phaser"),null;var c=new s({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:e.orientation,format:n.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});c.layers=r(e,i),c.images=o(e);var d=a(e);return c.tilesets=d.tilesets,c.imageCollections=d.imageCollections,c.objects=h(e),c.tiles=l(c),u(c),c}},function(t,e,i){var n=i(457),s=i(2),r=i(102),o=i(214),a=i(72);t.exports=function(t,e){for(var i=s(t,"infinite",!1),h=[],l=0;l0?((f=new a(c,d.gid,C,M,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,g[M][C]=f):(p=e?null:new a(c,-1,C,M,t.tilewidth,t.tileheight),g[M][C]=p),++v===w.width&&(b++,v=0)}}else{c=new r({name:u.name,x:s(u,"offsetx",0)+u.x,y:s(u,"offsety",0)+u.y,width:u.width,height:u.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:u.opacity,visible:u.visible,properties:s(u,"properties",{})});for(var O=[],P=0,R=u.data.length;P0?((f=new a(c,d.gid,v,g.length,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,O.push(f)):(p=e?null:new a(c,-1,v,g.length,t.tilewidth,t.tileheight),O.push(p)),++v===u.width&&(g.push(O),v=0,O=[])}c.data=g,h.push(c)}}return h}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),s=0;s>>0;return n}},function(t,e,i){var n=i(2);t.exports=function(t){for(var e=[],i=0;i1){if(Array.isArray(l.tiles)){for(var c={},d={},f=0;f=this.firstgid&&ta&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(102),s=i(72);t.exports=function(t,e){for(var i=[],r=0;r-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(140);t.exports=function(t){for(var e=[],i=[],s=0;s-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(s,r),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(u=new p(t,o,i,n,s,r)).setImage(h),this.tilesets.push(u),u)},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new c(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:null!==a?(f.Copy(t,e,i,n,s,r,o,a),this):null},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===a&&(a=this.tileWidth),void 0===l&&(l=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var u,c=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;f-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return n},removeTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"removeTileAt")?null:null===s?null:f.RemoveTileAt(t,e,i,n,s)},removeTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"removeTileAtWorldXY")?null:null===r?null:f.RemoveTileAtWorldXY(t,e,i,n,s,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(f.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(t){void 0===t&&(t=!0),this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(12),r=i(26),o=i(13),a=i(1292),h=i(136),l=i(32),u=i(9),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===r.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;sv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;o>=0;o--)for(a=0;av||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;o>=0;o--)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===m?(m=i.createVertexBuffer(y,n.STATIC_DRAW),this.vertexBuffer[e]=m):(i.setVertexBuffer(m),n.bufferSubData(n.ARRAY_BUFFER,0,y))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=i.tileWidth,l=i.tileHeight,c=h/2,d=l/2,f=a.x/n,p=a.y/s,g=(a.x+h)/n,v=(a.y+l)/s,m=this._tempMatrix,y=-c,x=-d;e.flipX&&(h*=-1,y+=i.tileWidth),e.flipY&&(l*=-1,x+=i.tileHeight);var T=y+h,w=x+l;m.applyITRS(c+e.pixelX,d+e.pixelY,e.rotation,1,1);var E=u.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),_=m.getX(y,x),b=m.getY(y,x),S=m.getX(y,w),A=m.getY(y,w),C=m.getX(T,w),M=m.getY(T,w),O=m.getX(T,x),P=m.getY(T,x);r.roundPixels&&(_=Math.round(_),b=Math.round(b),S=Math.round(S),A=Math.round(A),C=Math.round(C),M=Math.round(M),O=Math.round(O),P=Math.round(P));var R=this.vertexViewF32[o],L=this.vertexViewU32[o];return R[++t]=_,R[++t]=b,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=E,R[++t]=S,R[++t]=A,R[++t]=f,R[++t]=v,R[++t]=0,L[++t]=E,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=E,R[++t]=_,R[++t]=b,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=E,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=E,R[++t]=O,R[++t]=P,R[++t]=g,R[++t]=p,R[++t]=0,L[++t]=E,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4){this._renderOrder=t;for(var e=0;e0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(1301);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){var n=i(6);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(219),s=i(14),r=i(87),o=i(96),a=i(141),h=i(6),l=i(218),u=i(220),c=i(221);t.exports=function(t,e,i){void 0===i&&(i=n);var d=h(e,"from",0),f=h(e,"to",1),p=[{value:d}],g=a(e,"delay",i.delay),v=a(e,"duration",i.duration),m=h(e,"easeParams",i.easeParams),y=o(h(e,"ease",i.ease),m),x=a(e,"hold",i.hold),T=a(e,"repeat",i.repeat),w=a(e,"repeatDelay",i.repeatDelay),E=r(e,"yoyo",i.yoyo),_=[],b=l("value",f),S=c(p[0],"value",b.getEnd,b.getStart,y,g,v,E,x,T,w,!1,!1);S.start=d,S.current=d,S.to=f,_.push(S);var A=new u(t,_,p);A.offset=s(e,"offset",null),A.completeDelay=s(e,"completeDelay",0),A.loop=Math.round(s(e,"loop",0)),A.loopDelay=Math.round(s(e,"loopDelay",0)),A.paused=r(e,"paused",!1),A.useFrames=r(e,"useFrames",!1);for(var C=h(e,"callbackScope",A),M=[A,null],O=u.TYPES,P=0;P0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var m=0;m0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit(r.TIMELINE_LOOP,this,this.loopCounter),this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):this.state=a.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=a.COMPLETE_DELAY;else{this.state=a.PENDING_REMOVE;var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit(r.TIMELINE_COMPLETE,this)}},update:function(t,e){if(this.state!==a.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var i=this.totalData,n=0;n=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit(r.SPRITE_ANIMATION_KEY_UPDATE+i.key,i,t,e),e.emit(r.SPRITE_ANIMATION_UPDATE,i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=o},function(t,e,i){var n=i(481),s=i(48),r=i(0),o=i(26),a=i(482),h=i(89),l=i(104),u=i(113),c=i(32),d=new r({initialize:function(t){this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.config={clearBeforeRender:t.config.clearBeforeRender,backgroundColor:t.config.backgroundColor,resolution:t.config.resolution,antialias:t.config.antialias,roundPixels:t.config.roundPixels},this.scaleMode=t.config.antialias?l.LINEAR:l.NEAREST,this.gameCanvas=t.canvas;var e={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d",e),this.currentContext=this.gameContext,this.blendModes=a(),this.currentScaleMode=0,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new c,this._tempMatrix2=new c,this._tempMatrix3=new c,this._tempMatrix4=new c,this.init()},init:function(){this.game.scale.on(h.RESIZE,this.onResize,this);var t=this.game.scale.baseSize;this.resize(t.width,t.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.scaleMode===l.NEAREST&&u.disable(this.gameContext)},onContextLost:function(){},onContextRestored:function(){},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),t.save(),this.drawCount=0},render:function(t,e,i,n){var r=e.list,o=r.length,a=n._cx,h=n._cy,l=n._cw,u=n._ch,c=n.renderToTexture?n.context:t.sys.context;c.save(),this.game.scene.customViewports&&(c.beginPath(),c.rect(a,h,l,u),c.clip()),this.currentContext=c;var d=n.mask;d&&d.preRenderCanvas(this,null,n._maskCamera),n.transparent||(c.fillStyle=n.backgroundColor.rgba,c.fillRect(a,h,l,u)),c.globalAlpha=n.alpha,c.globalCompositeOperation="source-over",this.drawCount+=r.length,n.renderToTexture&&n.emit(s.PRE_RENDER,n),n.matrix.copyToContext(c);for(var f=0;f=0?g=-(g+d):g<0&&(g=Math.abs(g)-d)),-1===y&&(v>=0?v=-(v+f):v<0&&(v=Math.abs(v)-f))}a.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.scale(m,y),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,g,v,d/p,f/p),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=d},function(t,e,i){var n=i(24),s=i(33),r=i(2);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=r(e,"width",t.width),c=r(e,"height",t.height);if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new s(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=n.createWebGL(this,u,c);f.getContext("2d").drawImage(t,h,l,u,c,0,0,u,c);var p=new Image;p.onerror=function(){i.call(null),n.remove(f)},p.onload=function(){i.call(null,p),n.remove(f)},p.src=f.toDataURL(o,a)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(o,a)}}},function(t,e,i){var n=i(52),s=i(291);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t[n.ERASE]="destination-out",t[n.SOURCE_IN]="source-in",t[n.SOURCE_OUT]="source-out",t[n.SOURCE_ATOP]="source-atop",t[n.DESTINATION_OVER]="destination-over",t[n.DESTINATION_IN]="destination-in",t[n.DESTINATION_OUT]="destination-out",t[n.DESTINATION_ATOP]="destination-atop",t[n.LIGHTER]="lighter",t[n.COPY]="copy",t[n.XOR]="xor",t}},function(t,e,i){var n=i(112),s=i(48),r=i(0),o=i(26),a=i(117),h=i(89),l=i(78),u=i(118),c=i(32),d=i(9),f=i(484),p=i(485),g=i(486),v=i(226),m=new r({initialize:function(t){var e=this,i=t.config,s={alpha:i.transparent,desynchronized:i.desynchronized,depth:!1,antialias:i.antialias,premultipliedAlpha:i.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:i.failIfMajorPerformanceCaveat,powerPreference:i.powerPreference};this.config={clearBeforeRender:i.clearBeforeRender,antialias:i.antialias,backgroundColor:i.backgroundColor,contextCreation:s,resolution:i.resolution,roundPixels:i.roundPixels,maxTextures:i.maxTextures,maxTextureSize:i.maxTextureSize,batchSize:i.batchSize,maxLights:i.maxLights},this.game=t,this.type=o.WEBGL,this.width=0,this.height=0,this.canvas=t.canvas,this.lostContextCallbacks=[],this.restoredContextCallbacks=[],this.blendModes=[],this.nativeTextures=[],this.contextLost=!1,this.pipelines=null,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this.currentActiveTextureUnit=0,this.currentTextures=new Array(16),this.currentFramebuffer=null,this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.canvas.addEventListener("webglcontextlost",function(t){e.contextLost=!0,t.preventDefault();for(var i=0;i0&&n>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==n}a&&(this.flush(),r.scissor(t,s-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},rebindPipeline:function(t){var e=this.gl;e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),this.hasActiveStencilMask()?e.clear(e.DEPTH_BUFFER_BIT):(e.disable(e.STENCIL_TEST),e.clear(e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)),e.viewport(0,0,this.width,this.height),this.setBlendMode(0,!0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.blankTexture.glTexture),this.currentActiveTextureUnit=0,this.currentTextures[0]=this.blankTexture.glTexture,this.currentPipeline=t,this.currentPipeline.bind(),this.currentPipeline.onBind()},clearPipeline:function(){this.flush(),this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.setBlendMode(0,!0)},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(n.equation),n.func.length>2?i.blendFuncSeparate(n.func[0],n.func[1],n.func[2],n.func[3]):i.blendFunc(n.func[0],n.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e,i){void 0===i&&(i=!0);var n=this.gl;return t!==this.currentTextures[e]&&(i&&this.flush(),this.currentActiveTextureUnit!==e&&(n.activeTexture(n.TEXTURE0+e),this.currentActiveTextureUnit=e),n.bindTexture(n.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.width,s=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(n=t.renderTexture.width,s=t.renderTexture.height):this.flush(),i.bindFramebuffer(i.FRAMEBUFFER,t),i.viewport(0,0,n,s),e&&(t?(this.drawingBufferHeight=s,this.pushScissor(0,0,n,s)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,r=s.NEAREST,h=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,a(e,i)&&(h=s.REPEAT),n===o.ScaleModes.LINEAR&&this.config.antialias&&(r=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,r,r,h,h,s.RGBA,t):this.createTexture2D(0,r,r,h,h,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&l(this.nativeTextures,e),this.gl.deleteTexture(t),this.currentTextures[0]!==t||this.game.pendingDestroy||this.setBlankTexture(!0),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,r=t._ch,o=this.pipelines.TextureTintPipeline,a=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-r),this.setFramebuffer(t.framebuffer);var h=this.gl;h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT),o.projOrtho(e,n+e,i,r+i,-1e3,1e3),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n+e,r+i,d.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL),t.emit(s.PRE_RENDER,t)}else this.pushScissor(e,i,n,r),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n,r,d.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,d.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,d.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit(s.POST_RENDER,t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=d.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera))},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.pipelines;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var i=this.config.backgroundColor;t.clearColor(i.redGL,i.greenGL,i.blueGL,i.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}for(var n in t.enable(t.SCISSOR_TEST),e)e[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,r=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);this.preRenderCamera(n);for(var l=this.currentMask,u=0;u>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){t.exports="changedata"},function(t,e){t.exports="changedata-"},function(t,e){t.exports="removedata"},function(t,e){t.exports="setdata"},function(t,e){t.exports="destroy"},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"alpha",e,i,s,r)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"x",e,i,s,r)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"x",e,s,o,a),n(t,"y",i,r,o,a)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"y",e,i,s,r)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=0;o0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={Camera:i(268),CameraManager:i(654),Effects:i(276),Events:i(48)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(22),s=i(0),r=i(48),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed=1?1:1/e*(1+(e*t|0))}},function(t,e,i){var n=i(22),s=i(0),r=i(48),o=i(4),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=s,this.camera.emit(r.SHAKE_START,this.camera,this,t,e),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed0&&(o.preRender(1),t.render(n,e,i,o))}},resetAll:function(){for(var t=0;t1)for(var i=1;i=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){var n=i(116),s={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(s.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(s.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(s.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(s.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(s.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(s.webm=!0),""!==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 i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e){var i={h264Video:!1,hlsVideo:!1,mp4Video:!1,oggVideo:!1,vp9Video:!1,webmVideo:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.oggVideo=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264Video=!0,i.mp4Video=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webmVideo=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9Video=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hlsVideo=!0))}catch(t){}return i}()},function(t,e){var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){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=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e1?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[i1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(155);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){t.exports={GetNext:i(302),IsSize:i(117),IsValue:i(706)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){t.exports={Ceil:i(303),Floor:i(90),To:i(708)}},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){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;i1?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,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=[],o=0;o0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e,i){var n=i(33),s=i(328);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=s(l,h,t+1/3),o=s(l,h,t),a=s(l,h,t-1/3)}return(new n).setGLTo(r,o,a,1)}},function(t,e,i){var n=i(161);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(n(s/359,t,e));return i}},function(t,e,i){var n=i(114),s=function(t,e,i,s,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:n(t,s,l),g:n(e,r,l),b:n(i,o,l)}};t.exports={RGBWithRGB:s,ColorWithRGB:function(t,e,i,n,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),s(t.r,t.g,t.b,e,i,n,r,o)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),s(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(168),s=i(33);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var n=i(327);t.exports=function(t,e,i,s,r){return void 0===s&&(s=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+n(s)+n(t)+n(e)+n(i)}},function(t,e,i){t.exports={BitmapMask:i(253),GeometryMask:i(254)}},function(t,e,i){var n={AddToDOM:i(119),DOMContentLoaded:i(329),GetScreenOrientation:i(330),GetTarget:i(335),ParseXML:i(336),RemoveFromDOM:i(174),RequestAnimationFrame:i(316)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(779)}},function(t,e,i){var n=i(0),s=i(11),r=i(18),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){var n=i(119),s=i(264),r=i(267),o=i(24),a=i(0),h=i(289),l=i(781),u=i(312),c=i(109),d=i(314),f=i(290),p=i(329),g=i(11),v=i(28),m=i(337),y=i(18),x=i(342),T=i(343),w=i(345),E=i(118),_=i(349),b=i(315),S=i(317),A=i(352),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new _(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new b(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(E.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),S(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(v.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(v.POST_RENDER,n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),i.emit(v.PRE_RENDER),i.emit(v.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},function(t,e,i){var n=i(119);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,n(i,e.parent)}}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},n=document.createElement("div");return n.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(n),i.w=90===e?n.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:n.offsetHeight,document.documentElement.removeChild(n),n=null,90!==Math.abs(window.orientation)?i.h:i.w}},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){var n=i(2),s=i(347);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=n(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(s(e+"Physics")),i)for(var o in i)o=s(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},function(t,e,i){var n=i(2);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){t.exports={game:"game",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e,i){var n=i(0),s=i(22),r=i(33),o=i(117),a=i(177),h=new n({Extends:a,initialize:function(t,e,i,n,s){a.call(this,t,e,i,n,s),this.add("__BASE",0,0,0,n,s),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=n,this.height=s,this.imageData=this.context.getImageData(0,0,n,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0);var s=this.manager.getFrame(t,e);if(s){var r=s.canvasData,o=s.cutWidth,a=s.cutHeight,h=s.source.resolution;return this.context.drawImage(s.source.image,r.x,r.y,o,a,i,n,o/h,a/h),this.update()}return this},setPixel:function(t,e,i,n,s,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=n,o.data[2]=s,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,n,s,r,o){return void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,n,s,r,o),this},getData:function(t,e,i,n){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),n=s(n,1,this.height-e),this.context.getImageData(t,e,i,n)},getPixel:function(t,e,i){i||(i=new r);var n=this.getIndex(t,e);if(n>-1){var s=this.data,o=s[n+0],a=s[n+1],h=s[n+2],l=s[n+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,n){void 0===n&&(n=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=s(t,0,this.width),a=s(t+i,0,this.width),h=s(e,0,this.height),l=s(e+n,0,this.height),u=new r,c=[],d=h;dg||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,m=f,y=0,x=0,T=0;Tr&&(y=w-r),E>o&&(x=E-o),t.add(T,e,i+v,s+m,h-y,l-x),(v+=h+p)+h>r&&(v=f,m+=l+p)}return t}},function(t,e,i){var n=i(2);t.exports=function(t,e,i){var s=n(i,"frameWidth",null),r=n(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=n(i,"startFrame",0),l=n(i,"endFrame",-1),u=n(i,"margin",0),c=n(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,v=e.realWidth,m=e.realHeight,y=Math.floor((v-u+c)/(s+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,E=s-w,_=s-(v-p-w),b=e.y,S=r-b,A=r-(m-g-b);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,M=u,O=0,P=e.sourceIndex,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 o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0){var o=n-t.length;if(o<=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 a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-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&&i0){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&&it.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){var n=i(66);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 o=i-e,a=t.splice(e,o);if(s)for(var h=0;h0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){var n=i(66);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 o=s;o-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;iv&&(r=v),o>m&&(o=m);var P=v+g.xAdvance,R=m+u;aS&&(S=C),CS&&(S=C),C0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,m=p.cutY,y=g.width,x=g.height,T=e._isTinted&&e.tintFill,w=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),E=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),_=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),b=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var S,A,C=0,M=0,O=0,P=0,R=e.letterSpacing,L=0,D=0,F=0,k=0,I=e.scrollX,B=e.scrollY,Y=e.fontData,N=Y.chars,X=Y.lineHeight,z=e.fontSize/Y.size,U=0,G=e._align,W=0,H=0;e.getTextBounds(!1);var V=e._bounds.lines;1===G?H=(V.longest-V.lengths[0])/2:2===G&&(H=V.longest-V.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;J0&&e.cropHeight>0&&(h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var F=0;F0&&(N=N%E-E):N>E?N=E:N<0&&(N=E+N%E),null===A&&(A=new o(k+Math.cos(Y)*B,I+Math.sin(Y)*B,v),_.push(A),F+=.01);F<1+z;)w=N*F+Y,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,A.points.push(new r(x,T,v)),F+=.01;w=N+Y,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,A.points.push(new r(x,T,v));break;case n.FILL_RECT:u.setTexture2D(M),u.batchFillRect(p[++O],p[++O],p[++O],p[++O],f,c);break;case n.FILL_TRIANGLE:u.setTexture2D(M),u.batchFillTriangle(p[++O],p[++O],p[++O],p[++O],p[++O],p[++O],f,c);break;case n.STROKE_TRIANGLE:u.setTexture2D(M),u.batchStrokeTriangle(p[++O],p[++O],p[++O],p[++O],p[++O],p[++O],v,f,c);break;case n.LINE_TO:null!==A?A.points.push(new r(p[++O],p[++O],v)):(A=new o(p[++O],p[++O],v),_.push(A));break;case n.MOVE_TO:A=new o(p[++O],p[++O],v),_.push(A);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:k=p[++O],I=p[++O],f.translate(k,I);break;case n.SCALE:k=p[++O],I=p[++O],f.scale(k,I);break;case n.ROTATE:f.rotate(p[++O]);break;case n.SET_TEXTURE:var U=p[++O],G=p[++O];u.currentFrame=U,u.setTexture2D(U.glTexture,0),u.tintEffect=G,M=U.glTexture;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,u.tintEffect=2,M=t.blankTexture.glTexture}}}},function(t,e,i){var n=i(1),s=i(1);n=i(927),s=i(928),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(1),s=i(1);n=i(930),s=i(931),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){t.exports={GravityWell:i(372),Particle:i(373),ParticleEmitter:i(374),ParticleEmitterManager:i(188),Zones:i(937)}},function(t,e,i){var n=i(0),s=i(304),r=i(96),o=i(2),a=i(56),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&(this.has(t,"random")||this.hasBoth(t,"start","end")||this.hasBoth(t,"min","max"))){this.start=this.has(t,"start")?t.start:t.min,this.end=this.has(t,"end")?t.end:t.max;var i=this.hasBoth(t,"min","max")||!!t.random;if(i){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}if(this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){var n=i(1),s=i(1);n=i(935),s=i(936),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=e.emitters.list,a=o.length;if(0!==a){var h=this.pipeline,l=h._tempMatrix1.copyFrom(s.matrix),u=h._tempMatrix2,c=h._tempMatrix3,d=h._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);l.multiply(d),t.setPipeline(h);var f=s.roundPixels,p=e.defaultFrame.glTexture,g=n.getTintAppendFloatAlphaAndSwap;h.setTexture2D(p,0);for(var v=0;v?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(6);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,m={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},y=0,x=0;x0&&r.maxLines1&&(d+=f*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(1),s=i(1);n=i(946),s=i(947),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){if(0!==e.width&&0!==e.height){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a/e.style.resolution,h/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r)}}},function(t,e){t.exports=function(t,e,i,n,s){0!==e.width&&0!==e.height&&t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(0),s=i(14),r=i(6),o=i(949),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this._font,this.setStyle(e,!1,!0);var i=r(e,"metrics",!1);this.metrics=i?{ascent:r(i,"ascent",0),descent:r(i,"descent",0),fontSize:r(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?r(t,a[n][0],o):s(t,a[n][0],o)}var h=r(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=r(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,n="",s="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),n=r(t,"fontSize","16px"),s=r(t,"fontStyle","");else{var o=t.split(" "),a=0;s=o.length>2?o[a++]:"",n=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&n===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=n,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e,i){var n=i(24);t.exports=function(t){var e=n.create(this),i=e.getContext("2d");t.syncFont(e,i);var s=Math.ceil(i.measureText(t.testString).width*t.baselineX),r=s,o=2*r;r=r*t.baselineY|0,e.width=s,e.height=o,i.fillStyle="#f00",i.fillRect(0,0,s,o),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,r);var a={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,s,o))return a.ascent=r,a.descent=r+6,a.fontSize=a.ascent+a.descent,n.remove(e),a;var h,l,u=i.getImageData(0,0,s,o).data,c=u.length,d=4*s,f=0,p=!1;for(h=0;hr;h--){for(l=0;l0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0){var R=o.strokeTint,L=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(R.TL=L,R.TR=L,R.BL=L,R.BR=L,A=1;A0)for(n(h,e),A=0;A0)for(n(h,e,e.altFillColor,e.altFillAlpha*c),A=0;A0){for(s(h,e,e.outlineFillColor,e.outlineFillAlpha*c),S=1;So.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var m=o.vertexViewF32,y=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,T=0,w=e.tintFill,E=0;E0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(77);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e,i){var n=i(46);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(46);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e,i){var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(92);n.Area=i(1050),n.Circumference=i(370),n.CircumferencePoint=i(187),n.Clone=i(1051),n.Contains=i(93),n.ContainsPoint=i(1052),n.ContainsRect=i(1053),n.CopyFrom=i(1054),n.Equals=i(1055),n.GetBounds=i(1056),n.GetPoint=i(368),n.GetPoints=i(369),n.Offset=i(1057),n.OffsetPoint=i(1058),n.Random=i(152),t.exports=n},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(92);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(93);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(93);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e,i){var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(3),s=i(403);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0==(a=(o=-2*f)*o-4*(r=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new n(h,-o/(2*r))):a>0&&(i.push(new n(h,(-o+Math.sqrt(a))/(2*r))),i.push(new n(h,(-o-Math.sqrt(a))/(2*r))));else{var g=(l-d)/(u-f),v=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0==(a=(o=2*u*g-2*v*g-2*l)*o-4*(r=g*g+1)*(l*l+u*u+v*v-c*c-2*u*v))?(h=-o/(2*r),i.push(new n(h,v-h*g))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)),h=(-o-Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)))}}return i}},function(t,e,i){var n=i(196),s=i(404);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();n(r,t,i),n(o,t,i),n(a,t,i),n(h,t,i)}return i}},function(t,e,i){var n=i(10),s=i(130);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e,i){var n=i(198),s=i(130);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();n(r,e,i),n(o,e,i),n(a,e,i),n(h,e,i)}return i}},function(t,e,i){var n=i(406),s=i(198);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(r,t,i),s(o,t,i),s(a,t,i)}return i}},function(t,e,i){var n=i(196),s=i(408);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();n(r,e,i),n(o,e,i),n(a,e,i)}return i}},function(t,e,i){var n=i(411),s=i(409);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(t,r,i),s(t,o,i),s(t,a,i)}return i}},function(t,e,i){var n=i(413);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||si&&(i=h.x),h.xr&&(r=h.y),h.yn(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){var n=i(3);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){var n=i(3);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var n=i(162);t.exports=function(t,e,i){var s=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),n(t,s,r)}},function(t,e,i){var n=i(10),s=i(130);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){var n=i(3),s=i(35);t.exports=function(t,e,i){void 0===i&&(i=new n),e=s(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)-1&&(s.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),0===this._list.length||this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i=this.pollRate;if(-1===i)return!1;if(i>0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}for(var n=this.manager,s=n.pointers,r=n.pointersTotal,o=!1,a=0;a0&&(o=!0)}return o},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,n=!1,s=0;s0&&(n=!0)}return this._updatedThisFrame=!0,n},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,this.manager.resetCursor(i),t.input=null;var n=this._draggable.indexOf(t);return n>-1&&this._draggable.splice(n,1),(n=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(n,1),(n=this._over[0].indexOf(t))>-1&&this._over[0].splice(n,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=s?i=!0:n>0&&e>=t.downTime+n&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold||0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],n=0;n0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.x-a.dragStartXGlobal,c=t.y-a.dragStartYGlobal,f=o.getParentRotation(),p=u*Math.cos(f)+c*Math.sin(f),g=c*Math.cos(f)-u*Math.sin(f);s=p+a.dragStartX,r=g+a.dragStartY}else s=t.x-a.dragX,r=t.y-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,s,r),this.emit(d.DRAG,t,o,s,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var s=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e);for(var h=0;h0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,o=!1,h=!1;if(v(e)){var l=e;e=p(l,"hitArea",null),i=p(l,"hitAreaCallback",null),n=p(l,"draggable",!1),s=p(l,"dropZone",!1),r=p(l,"cursor",!1),o=p(l,"useHandCursor",!1),h=p(l,"pixelPerfect",!1);var u=p(l,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(u)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c=e}}},function(t,e,i){t.exports={Events:i(132),KeyboardManager:i(338),KeyboardPlugin:i(1171),Key:i(426),KeyCodes:i(121),KeyCombo:i(427),JustDown:i(1176),JustUp:i(1177),DownDuration:i(1178),UpDuration:i(1179)}},function(t,e){t.exports="keydown"},function(t,e){t.exports="keyup"},function(t,e){t.exports="keycombomatch"},function(t,e){t.exports="down"},function(t,e){t.exports="keydown-"},function(t,e){t.exports="keyup-"},function(t,e){t.exports="up"},function(t,e,i){var n=i(0),s=i(11),r=i(132),o=i(28),a=i(6),h=i(53),l=i(131),u=i(426),c=i(121),d=i(427),f=i(1175),p=i(90),g=new n({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.useQueue?this.sceneInputPlugin.pluginEvents.on(h.UPDATE,this.update,this):this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n={};if("string"==typeof t){t=t.split(",");for(var s=0;s-1?n[s]=t:n[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),n[t]||(n[t]=new u(this,t),e&&this.addCapture(t),n[t].setEmitOnRepeat(i)),n[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,n=this.keys;if(t instanceof u){var s=n.indexOf(t);s>-1&&(i=this.keys[s],this.keys[s]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(i=n[t],n[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},createCombo:function(t,e){return new d(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=p(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e,i){var n=i(121),s={};for(var r in n)s[n[r]]=r;t.exports=s},function(t,e){t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},function(t,e){t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.sizei&&(n=t,i=e)}),n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,n,s,r){return u(this.world,t,e,i,n,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(d.UPDATE,this.world.update,this.world),t.off(d.POST_UPDATE,this.world.postUpdate,this.world),t.off(d.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(d.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){var i={enableBody:function(t,e,i,n,s){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),s&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=i},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){var i={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=i},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){t.exports=function(t,e,i,n,s,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+n,l.maxY=i+s,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+n,bottom:i+s,isCircle:!1},d=t.intersects;u.iterate(function(t){d(t,c)&&a.push(t)})}return h.concat(a)}},function(t,e){t.exports="collide"},function(t,e){t.exports="overlap"},function(t,e){t.exports="pause"},function(t,e){t.exports="resume"},function(t,e){t.exports="tilecollide"},function(t,e){t.exports="tileoverlap"},function(t,e){t.exports="worldbounds"},function(t,e){t.exports="worldstep"},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e,i){var n=i(1232),s=i(1234),r=i(444);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,f=o.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var v=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&!t.blocked.right&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(1235);t.exports=function(t,e,i,s,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&!t.blocked.up&&c&&t.checkCollision.up?l&&t.y0&&!t.blocked.down&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(440);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e,i){var n=i(441);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},,,,,,,,,,,function(t,e,i){t.exports={BasePlugin:i(449),DefaultPlugins:i(171),PluginCache:i(18),PluginManager:i(342),ScenePlugin:i(1249)}},function(t,e,i){var n=i(449),s=i(0),r=i(19),o=new s({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){}});t.exports=o},function(t,e,i){var n=i(17),s=i(173),r={Center:i(331),Events:i(89),Orientation:i(332),ScaleManager:i(343),ScaleModes:i(333),Zoom:i(334)};r=n(!1,r=n(!1,r=n(!1,r=n(!1,r,s.CENTER),s.ORIENTATION),s.SCALE_MODE),s.ZOOM),t.exports=r},function(t,e,i){var n=i(122),s=i(17),r={Events:i(19),SceneManager:i(345),ScenePlugin:i(1252),Settings:i(348),Systems:i(176)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(22),s=i(0),r=i(19),o=i(2),a=i(18),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var s=o(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=n,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake():this.manager.start(e,o(t,"data")),this.systems.events.emit(r.TRANSITION_OUT,i,n),this.systems.events.on(r.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},function(t,e,i){t.exports={List:i(125),Map:i(157),ProcessQueue:i(442),RTree:i(443),Set:i(105),Size:i(344)}},function(t,e,i){var n=i(17),s=i(1255),r={Events:i(118),FilterMode:s,Frame:i(91),Parsers:i(351),Texture:i(177),TextureManager:i(349),TextureSource:i(350)};r=n(!1,r,s),t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){t.exports={Components:i(136),Parsers:i(1286),Formats:i(31),ImageCollection:i(460),ParseToTilemap:i(216),Tile:i(72),Tilemap:i(469),TilemapCreator:i(1295),TilemapFactory:i(1296),Tileset:i(140),LayerData:i(102),MapData:i(103),ObjectLayer:i(463),DynamicTilemapLayer:i(470),StaticTilemapLayer:i(471)}},function(t,e,i){var n=i(21),s=i(51);t.exports=function(t,e,i,r,o,a,h,l){t<0&&(t=0),e<0&&(e=0),void 0===h&&(h=!0);for(var u=n(t,e,i,r,null,l),c=o-t,d=a-e,f=0;f=0&&p=0&&g=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=y;a--)for(o=v;c[a]&&o=y;a--)for(o=m;c[a]&&o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(21),s=i(51),r=i(71);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=n(e,i,o,a,null,l),d=0;d=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;re)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(71),s=i(51),r=i(212);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,r=t.length;s0&&(t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix);var u=t.currentContext,c=e.gidMap;u.save(),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l),l.copyToContext(u)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,h.copyToContext(u));var d=n.alpha*e.alpha;u.globalAlpha=n.alpha*e.alpha;for(var f=0;f-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t-1&&(e.state=l.REMOVED,s.splice(r,1)):(e.state=l.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t>2],r+=i[(3&n[o])<<4|n[o+1]>>4],r+=i[(15&n[o+1])<<2|n[o+2]>>6],r+=i[63&n[o+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},function(t,e,i){t.exports={Clone:i(64),Extend:i(17),GetAdvancedValue:i(14),GetFastValue:i(2),GetMinMaxValue:i(1313),GetValue:i(6),HasAll:i(1314),HasAny:i(377),HasValue:i(97),IsPlainObject:i(7),Merge:i(85),MergeRight:i(1315),Pick:i(461),SetValue:i(398)}},function(t,e,i){var n=i(6),s=i(22);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=n(t,e,o);return s(a,i,r)}},function(t,e){t.exports=function(t,e){for(var i=0;i0&&(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},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}});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},function(t,e,i){var n=i(0),s=i(47),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){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n=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,i){t.exports={Alpha:i(247),Animation:i(481),BlendMode:i(250),ComputedSize:i(524),Crop:i(525),Depth:i(251),Flip:i(526),GetBounds:i(527),Mask:i(255),Origin:i(544),PathFollower:i(545),Pipeline:i(152),ScrollFactor:i(258),Size:i(546),Texture:i(547),TextureCrop:i(548),Tint:i(549),ToJSON:i(259),Transform:i(260),TransformMatrix:i(32),Visible:i(261)}},function(t,e,i){var n=i(0),s=i(259),r=i(110),o=i(10),a=i(111),h=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,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,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},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.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return s(this)},willRender:function(t){return!(h.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 i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.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),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});h.RENDER_MASK=15,t.exports=h},function(t,e,i){var n=i(166),s=i(5);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){var n=i(7),s=function(){var t,e,i,r,o,a,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=400&&t.status<=599&&(n=!1),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(){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.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){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)},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){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};t.exports=i},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===s&&(s=o.height);var a=n(r,"isNotEmpty",!1),h=n(r,"isColliding",!1),l=n(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(s+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n=i(53),s=i(14),r=i(104);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 o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"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 h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),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){var n=i(0),s=i(12),r=i(13),o=i(55),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e,i){var n={VERSION:"3.19.0",BlendModes:i(53),ScaleModes:i(104),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,i){var n=i(0),s=i(22),r=i(3),o=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}},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],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[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],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,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 o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(t.translateX=e[4],t.translateY=e[5],i||n){var a=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}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=o/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,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var n=this.matrix,s=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(s*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=s*c*e+-o*c*t+(-u*s+l*o)*c,i},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},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.decomposedMatrix=null}});t.exports=o},function(t,e,i){var n=i(0),s=i(161),r=i(273),o=i(162),a=i(274),h=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=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=i(22);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.fillColor,r=n||e.fillAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},,function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},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){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){t.exports={DESTROY:i(606),FADE_IN_COMPLETE:i(607),FADE_IN_START:i(608),FADE_OUT_COMPLETE:i(609),FADE_OUT_START:i(610),FLASH_COMPLETE:i(611),FLASH_START:i(612),PAN_COMPLETE:i(613),PAN_START:i(614),POST_RENDER:i(615),PRE_RENDER:i(616),SHAKE_COMPLETE:i(617),SHAKE_START:i(618),ZOOM_COMPLETE:i(619),ZOOM_START:i(620)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e,i){var n=i(138),s=i(23);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;dthis.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){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},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,i){var n=i(0),s=i(17),r=i(21),o=i(8),a=i(2),h=i(5),l=i(7),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s80*i){n=h=t[0],a=l=t[1];for(var T=i;Th&&(h=u),f>l&&(l=f);g=0!==(g=Math.max(h-n,l-a))?1/g:0}return o(y,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===A(t,e,i,n)>0)for(r=e;r=e;r-=n)o=E(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(_(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(_(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),_(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(m(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&m(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(m(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.prevZ,v=t.nextZ;p&&p.z>=c&&v&&v.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!y(s,r)&&x(s,n,n.next,r)&&T(s,r)&&T(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),_(n),_(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=w(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&T(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=w(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&T(t,e)&&T(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(y(t,e)&&y(i,n)||y(t,n)&&y(i,e))||m(t,e,i)>0!=m(t,e,n)>0&&m(i,n,t)>0!=m(i,n,e)>0}function T(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function w(t,e){var i=new b(t.i,t.x,t.y),n=new b(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function E(t,e,i,n){var s=new b(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function _(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function b(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){t.exports={COMPLETE:i(855),DECODED:i(856),DECODED_ALL:i(857),DESTROY:i(858),DETUNE:i(859),GLOBAL_DETUNE:i(860),GLOBAL_MUTE:i(861),GLOBAL_RATE:i(862),GLOBAL_VOLUME:i(863),LOOP:i(864),LOOPED:i(865),MUTE:i(866),PAUSE_ALL:i(867),PAUSE:i(868),PLAY:i(869),RATE:i(870),RESUME_ALL:i(871),RESUME:i(872),SEEK:i(873),STOP_ALL:i(874),STOP:i(875),UNLOCKED:i(876),VOLUME:i(877)}},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||e>s||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(930),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,o){r.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s.Animation(this),this.setTexture(n,o),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e,i){return this.anims.play(t,e,i),this},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=a},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},function(t,e,i){var n=i(0),s=i(17),r=i(21),o=i(8),a=i(2),h=i(7),l=new n({Extends:r,initialize:function t(e,i,n,s,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),n=a(c,"url"),l=a(c,"normalMap"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(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:o};if(r.call(this,e,d),l){var f=new t(e,this.key,l,s,o);f.type="normalMap",this.setLink(f),e.addFile(f)}},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")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;nthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight,this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e,i){var n=i(0),s=i(46),r=i(244),o=i(245),a=i(47),h=i(146),l=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;si&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){t.exports={ADD:i(834),COMPLETE:i(835),FILE_COMPLETE:i(836),FILE_KEY_COMPLETE:i(837),FILE_LOAD_ERROR:i(838),FILE_LOAD:i(839),FILE_PROGRESS:i(840),POST_PROCESS:i(841),PROGRESS:i(842),START:i(843)}},function(t,e,i){var n=i(164),s=i(178);t.exports=function(t,e){var i=n.Power0;if("string"==typeof t)if(n.hasOwnProperty(t))i=n[t];else{var r="";t.indexOf(".")&&("in"===(r=t.substr(t.indexOf(".")+1)).toLowerCase()?r="easeIn":"out"===r.toLowerCase()?r="easeOut":"inout"===r.toLowerCase()&&(r="easeInOut")),t=s(t.substr(0,t.indexOf(".")+1)+r),n.hasOwnProperty(t)&&(i=n[t])}else"function"==typeof t?i=t:Array.isArray(t)&&t.length;if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(u-h)*(r-l)-(c-l)*(s-h),f=(o-s)*(r-l)-(a-r)*(s-h),p=(c-l)*(o-s)-(u-h)*(a-r);if(0===p)return!1;var g=d/p,v=f/p;return g>=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},,function(t,e,i){var n=i(24);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e,i){t.exports={ENTER_FULLSCREEN:i(659),FULLSCREEN_FAILED:i(660),FULLSCREEN_UNSUPPORTED:i(661),LEAVE_FULLSCREEN:i(662),ORIENTATION_CHANGE:i(663),RESIZE:i(664)}},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,i){var n=i(0),s=i(24),r=i(15),o=new n({initialize:function(t,e,i,n,s,r,o){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,o,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 o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.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,o,a){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)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),m=r=s(r,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(n=s(n,0,u-e)),w=i+(r=s(r,0,c-i));if(!(x.rT||x.y>w)){var E=Math.max(x.x,e),_=Math.max(x.y,i),b=Math.min(x.r,T)-E,A=Math.min(x.b,w)-_;v=b,m=A,p=o?h+(u-(E-x.x)-b):h+(E-x.x),g=a?l+(c-(_-x.y)-A):l+(_-x.y),e=E,i=_,n=b,r=A}else p=0,g=0,v=0,m=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var S=this.source.width,C=this.source.height;return t.u0=Math.max(0,p/S),t.v0=Math.max(0,g/C),t.u1=Math.min(1,(p+v)/S),t.v1=Math.min(1,(g+m)/C),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=m,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},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,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,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 o(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=o},function(t,e,i){var n=i(0),s=i(94),r=i(371),o=i(372),a=i(47),h=i(153),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.ELLIPSE,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 o(this,t,e,i)},getRandomPoint:function(t){return h(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.width=0,this.height=0,this},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},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var n=i(232),s=i(0),r=i(111),o=i(2),a=i(5),h=i(7),l=i(365),u=i(106),c=i(68),d=new s({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?h(e[0])&&(i=e,e=null):h(e)&&(i=e,e=null),this.scene=t,this.children=new u(e),this.isParent=!0,this.classType=o(i,"classType",c),this.name=o(i,"name",""),this.active=o(i,"active",!0),this.maxSize=o(i,"maxSize",-1),this.defaultKey=o(i,"defaultKey",null),this.defaultFrame=o(i,"defaultFrame",null),this.runChildUpdate=o(i,"runChildUpdate",!1),this.createCallback=o(i,"createCallback",null),this.removeCallback=o(i,"removeCallback",null),this.createMultipleCallback=o(i,"createMultipleCallback",null),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i=0&&t=0&&e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return t0;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){var n=i(0),s=i(12),r=i(35),o=i(10),a=i(49),h=i(11),l=i(32),u=i(160),c=i(3),d=new n({Extends:o,Mixins:[s.Alpha,s.Visible],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),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;gC&&wA&&Es&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras;var i=this.scaleManager.resolution;return this.resolution=i,this._cx=this._x*i,this._cy=this._y*i,this._cw=this._width*i,this._ch=this._height*i,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=d},function(t,e){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;i0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){t.exports={ADD:i(732),ERROR:i(733),LOAD:i(734),READY:i(735),REMOVE:i(736)}},function(t,e){t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement)return t;return i||(i=document.body),i.appendChild(t),t}},function(t,e,i){var n=i(79);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 o=e.length-1;o>=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e,i){var n=i(0),s=i(65),r=i(10),o=i(66),a=i(18),h=i(1),l=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on(a.FOCUS,function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once(o.COMPLETE,n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(o.STOP_ALL,this)},unlock:h,onBlur:h,onFocus:h,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=l},function(t,e,i){var n=i(0),s=i(10),r=i(66),o=i(15),a=i(1),h=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},function(t,e,i){var n=i(180),s=i(0),r=i(1),o=i(128),a=new s({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?n.Add(this.list,t):n.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?n.AddAt(this.list,t,e):n.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o.inplace(this.list,e),this):this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return n.GetFirst(this.list,t,e,i,s)},getAll:function(t,e,i,s){return n.GetAll(this.list,t,e,i,s)},count:function(t,e){return n.CountAllMatching(this.list,t,e)},swap:function(t,e){n.Swap(this.list,t,e)},moveTo:function(t,e){return n.MoveTo(this.list,t,e)},remove:function(t,e){return e?n.Remove(this.list,t):n.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?n.RemoveAt(this.list,t):n.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?n.RemoveBetween(this.list,t,e):n.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return n.BringToTop(this.list,t)},sendToBack:function(t){return n.SendToBack(this.list,t)},moveUp:function(t){return n.MoveUp(this.list,t),t},moveDown:function(t){return n.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e){return n.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?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}}});t.exports=a},function(t,e,i){var n=i(181),s=i(363);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;il&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a0&&o.length0&&a.lengthe.right||t.y>e.bottom)}},function(t,e,i){var n=i(5),s={},r={register:function(t,e,i,n,r){s[t]={plugin:e,mapping:i,settingsKey:n,configKey:r}},getPlugin:function(t){return s[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in s){var a=s[o].plugin,h=s[o].mapping,l=s[o].settingsKey,u=s[o].configKey;n(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){s.hasOwnProperty(t)&&delete s[t]}};t.exports=r},function(t,e,i){t.exports={ANY_KEY_DOWN:i(1168),ANY_KEY_UP:i(1169),COMBO_MATCH:i(1170),DOWN:i(1171),KEY_DOWN:i(1172),KEY_UP:i(1173),UP:i(1174)}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),{responseType:t,async:e,user:i,password:n,timeout:s,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e,i){var n=i(0),s=i(209),r=i(68),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},,function(t,e,i){t.exports={CalculateFacesAt:i(212),CalculateFacesWithin:i(52),Copy:i(1261),CreateFromTiles:i(1262),CullTiles:i(1263),Fill:i(1264),FilterTiles:i(1265),FindByIndex:i(1266),FindTile:i(1267),ForEachTile:i(1268),GetTileAt:i(138),GetTileAtWorldXY:i(1269),GetTilesWithin:i(23),GetTilesWithinShape:i(1270),GetTilesWithinWorldXY:i(1271),HasTileAt:i(454),HasTileAtWorldXY:i(1272),IsInLayerBounds:i(101),PutTileAt:i(213),PutTileAtWorldXY:i(1273),PutTilesAt:i(1274),Randomize:i(1275),RemoveTileAt:i(455),RemoveTileAtWorldXY:i(1276),RenderDebug:i(1277),ReplaceByIndex:i(453),SetCollision:i(1278),SetCollisionBetween:i(1279),SetCollisionByExclusion:i(1280),SetCollisionByProperty:i(1281),SetCollisionFromCollisionGroup:i(1282),SetTileIndexCallback:i(1283),SetTileLocationCallback:i(1284),Shuffle:i(1285),SwapByIndex:i(1286),TileToWorldX:i(139),TileToWorldXY:i(1287),TileToWorldY:i(140),WeightedRandomize:i(1288),WorldToTileX:i(62),WorldToTileXY:i(1289),WorldToTileY:i(63)}},function(t,e,i){var n=i(101);t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),n(t,e,s)){var r=s.data[e][t]||null;return null===r?null:-1===r.index?i?r:null:r}return null}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.x+e.scrollX*(1-s.scrollFactorX),n*=s.scaleX),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.y+e.scrollY*(1-s.scrollFactorY),n*=s.scaleY),r+t*n}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o,a){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o={}),void 0===a&&(a={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=n,this.tileMargin=s,this.tileSpacing=r,this.tileProperties=o,this.tileData=a,this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(24),s=i(0),r=i(10),o=i(108),a=i(248),h=i(249),l=i(5),u=new s({Extends:r,initialize:function(t,e,i){r.call(this),this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,l(i,"frames",[]),l(i,"defaultTextureKey",null)),this.frameRate=l(i,"frameRate",null),this.duration=l(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=l(i,"skipMissedFrames",!0),this.delay=l(i,"delay",0),this.repeat=l(i,"repeat",0),this.repeatDelay=l(i,"repeatDelay",0),this.yoyo=l(i,"yoyo",!1),this.showOnStart=l(i,"showOnStart",!1),this.hideOnComplete=l(i,"hideOnComplete",!1),this.paused=!1,this.manager.on(o.PAUSE_ALL,this.pause,this),this.manager.on(o.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=a[0],a[0].prevFrame=s;var v=1/(a.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),a(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);if(t._repeatDelay>0&&!1===t.pendingRepeat)t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay;else if(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying){this.getNextTick(t),t.pendingRepeat=!1;var e=t.currentFrame,i=t.parent;this.emit(o.ANIMATION_REPEAT,this,e),i.emit(o.SPRITE_ANIMATION_KEY_REPEAT+this.key,this,e,t.repeatCounter,i),i.emit(o.SPRITE_ANIMATION_REPEAT,this,e,t.repeatCounter,i)}},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),n=0;n1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[n-1],t.nextFrame=this.frames[n+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.removeAllListeners(),this.manager.off(o.PAUSE_ALL,this.pause,this),this.manager.off(o.RESUME_ALL,this.resume,this),this.manager.remove(this.key);for(var t=0;t=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,i){var n=i(56),s=i(4);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},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){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){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=(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,i){var n=i(272),s=i(275),r=i(277),o=i(278);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var n=i(161);t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1);var r=Math.floor(6*t),o=6*t-r,a=Math.floor(i*(1-e)*255),h=Math.floor(i*(1-o*e)*255),l=Math.floor(i*(1-(1-o)*e)*255),u=i=Math.floor(i*=255),c=i,d=i,f=r%6;return 0===f?(c=l,d=a):1===f?(u=h,d=a):2===f?(u=a,d=l):3===f?(u=a,c=h):4===f?(u=l,c=a):5===f&&(c=a,d=h),s?s.setTo?s.setTo(u,c,d,s.alpha,!1):(s.r=u,s.g=c,s.b=d,s.color=n(u,c,d),s):{r:u,g:c,b:d,color:n(u,c,d)}}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var n=i(280),s=i(281),r=i(282),o=i(283),a=i(284),h=i(285),l=i(286),u=i(287),c=i(288),d=i(289),f=i(290),p=i(291);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:n.Out,Bounce:s.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":n.In,"Bounce.easeIn":s.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":n.Out,"Bounce.easeOut":s.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":s.InOut}},function(t,e,i){var n=i(116),s=i(117),r=i(25),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.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").createImageData(1,1);return a=n.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.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,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(o.getUserMedia=!1),!n.iOS&&(s.ie||s.firefox||s.chrome)&&(o.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.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)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},function(t,e,i){var n=i(22),s=i(15),r={Angle:i(690),Distance:i(698),Easing:i(700),Fuzzy:i(701),Interpolation:i(704),Pow2:i(709),Snap:i(711),RandomDataGenerator:i(713),Average:i(714),Bernstein:i(300),Between:i(169),CatmullRom:i(168),CeilTo:i(715),Clamp:i(24),DegToRad:i(35),Difference:i(716),Factorial:i(301),FloatBetween:i(307),FloorTo:i(717),FromPercent:i(87),GetSpeed:i(718),IsEven:i(719),IsEvenStrict:i(720),Linear:i(115),MaxAdd:i(721),MinSub:i(722),Percent:i(723),RadToDeg:i(170),RandomXY:i(724),RandomXYZ:i(725),RandomXYZW:i(726),Rotate:i(308),RotateAround:i(254),RotateAroundDistance:i(155),RoundAwayFromZero:i(309),RoundTo:i(727),SinCosTableGenerator:i(728),SmootherStep:i(156),SmoothStep:i(157),ToXY:i(729),TransformXY:i(310),Within:i(730),Wrap:i(57),Vector2:i(3),Vector3:i(171),Vector4:i(311),Matrix3:i(312),Matrix4:i(313),Quaternion:i(314),RotateVec3:i(731)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)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,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,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},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],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=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=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],m=s[12],y=s[13],x=s[14],T=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+m)*T,this.y=(e*o+i*u+n*p+y)*T,this.z=(e*a+i*c+n*g+x)*T,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/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){t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},function(t,e,i){var n=i(11);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,r,o=Number.MAX_VALUE,a=Number.MAX_VALUE,h=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,u=0;u0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit(o.START,this),this.events.emit(o.READY,this,t)},shutdown:function(t){this.events.off(o.TRANSITION_INIT),this.events.off(o.TRANSITION_START),this.events.off(o.TRANSITION_COMPLETE),this.events.off(o.TRANSITION_OUT),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.SHUTDOWN,this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.DESTROY,this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e,i){var n=i(180),s=i(53),r=i(0),o=i(12),a=i(111),h=i(13),l=i(11),u=i(917),c=i(367),d=i(3),f=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Transform,o.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 o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,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.list.length>0)for(var e=this.list,i=new l,n=0;n-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=[],this._displayList=null}});t.exports=f},function(t,e,i){var n=i(129),s=i(0),r=i(922),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(113),s=i(0),r=i(188),o=i(247),a=i(250),h=i(251),l=i(255),u=i(152),c=i(260),d=i(261),f=i(258),p=i(32),g=i(93),v=i(13),m=i(2),y=i(5),x=i(22),T=i(928),w=new s({Extends:v,Mixins:[o,a,h,l,u,c,d,f,T],initialize:function(t,e){var i=y(e,"x",0),n=y(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this.setDefaultStyles(e)},setDefaultStyles:function(t){return y(t,"lineStyle",null)&&(this.defaultStrokeWidth=y(t,"lineStyle.width",1),this.defaultStrokeColor=y(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=y(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),y(t,"fillStyle",null)&&(this.defaultFillColor=y(t,"fillStyle.color",16777215),this.defaultFillAlpha=y(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,s){return void 0===s&&(s=1),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,s,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,s,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,n,s),this},setTexture:function(t,e,i){if(void 0===i&&(i=0),void 0===t)this.commandBuffer.push(r.CLEAR_TEXTURE);else{var n=this.scene.sys.textures.getFrame(t,e);n&&(2===i&&(i=3),this.commandBuffer.push(r.SET_TEXTURE,n,i))}return this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(r.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var s=this._lineWidth/2,r=t-s,o=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+n),this.lineTo(o+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,n,s,o),this},strokeTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,n,s,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,SET_TEXTURE:19,CLEAR_TEXTURE:20,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.width/2,r=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(375),a=i(126),h=i(377),l=i(938),u=new n({Extends:r,Mixins:[s.Depth,s.Mask,s.Pipeline,s.Transform,s.Visible,l],initialize:function(t,e,i,n){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var s=0;s0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;ss.width&&(t=s.width-this.frame.cutX),this.frame.cutY+e>s.height&&(e=s.height-this.frame.cutY),this.frame.setSize(t,e,this.frame.cutX,this.frame.cutY)}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.frame.cutWidth),void 0===r&&(r=this.frame.cutHeight);var o=255&(t>>16|0),a=255&(t>>8|0),h=255&(0|t),l=this.gl,u=this.frame;if(l){var c=this.renderer,f=this.getBounds();c.setFramebuffer(this.framebuffer,!0),s===u.source.width&&r===u.source.height||l.scissor(i+u.cutX,n+u.cutY,s,r),this.pipeline.drawFillRect(f.x,f.y,f.right,f.bottom,d.getTintFromFloats(o/255,a/255,h/255,1),e),s===u.source.width&&r===u.source.height||l.scissor(0,0,u.source.width,u.source.height),this.renderer.setFramebuffer(null,!0)}else this.context.fillStyle="rgba("+o+","+a+","+h+","+e+")",this.context.fillRect(i+u.cutX,n+u.cutY,s,r);return this},clear:function(){if(this.dirty){var t=this.gl;if(t){var e=this.renderer;e.setFramebuffer(this.framebuffer,!0),this.frame.cutWidth===this.canvas.width&&this.frame.cutHeight===this.canvas.height||t.scissor(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),e.setFramebuffer(null,!0)}else{var i=this.context;i.save(),i.setTransform(1,0,0,1,0,0),i.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),i.restore()}this.dirty=!1}return this},erase:function(t,e,i){this._eraseMode=!0;var s=this.renderer.currentBlendMode;return this.renderer.setBlendMode(n.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(s),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1),r){var o=this.camera._cx,a=this.camera._cy,h=this.camera._cw,l=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(o,a,h,l,l);var u=this.pipeline;u.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),this.batchList(t,e,i,n,s),u.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),u.projOrtho(0,u.width,u.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1),o){var h=this.camera._cx,l=this.camera._cy,u=this.camera._cw,c=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(h,l,u,c,c);var d=this.pipeline;d.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),d.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,r,s,this.camera.matrix,null),d.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),d.projOrtho(0,d.width,d.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;rl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=y+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=l,n+=a[h],h0&&(d+=h.lineSpacing*g),i.rtl)c=f-c;else if("right"===i.align)c+=o-h.lineWidths[g];else if("center"===i.align)c+=(o-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var v=h.width-h.lineWidths[g],m=e.measureText(" ").width,y=a[g].trim(),x=y.split(" ");v+=(a[g].length-y.length)*m;for(var T=Math.floor(v/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[g]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[g],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[g],c,d))}e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var E=this.input;return E&&!E.customHitArea&&(E.hitArea.width=this.width,E.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(25),s=i(0),r=i(12),o=i(18),a=i(13),h=i(305),l=i(114),u=i(954),c=i(3),d=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,s,r,l,u){var d=t.sys.game.renderer;a.call(this,t,"TileSprite");var f=t.sys.textures.get(l),p=f.get(u);s&&r?(s=Math.floor(s),r=Math.floor(r)):(s=p.width,r=p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=n.create(this,s,r),this.context=this.canvas.getContext("2d"),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(p.width),this.potHeight=h(p.height),this.fillCanvas=n.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(s,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(o.CONTEXT_RESTORED,function(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)},this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){return this.displayFrame=this.displayTexture.get(t),this.displayFrame.cutWidth&&this.displayFrame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame,e=this.fillContext,i=this.fillCanvas,n=this.potWidth,s=this.potHeight;this.renderer.gl||(n=t.cutWidth,s=t.cutHeight),e.clearRect(0,0,n,s),i.width=n,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,s),this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,n=this._tileScale.y,s=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,n),e.translate(-s,-r),e.fillStyle=this.fillPattern,e.fillRect(s,r,this.width/i,this.height/n),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),n.remove(this.canvas),n.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},function(t,e,i){var n=i(0),s=i(195),r=i(393),o=i(47),a=new n({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return s(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n=0&&w<=1&&i.push(new n(r,o))}else if(T>0){var E=(-x-Math.sqrt(T))/(2*y);r=a+E*p,o=h+E*g,E>=0&&E<=1&&i.push(new n(r,o));var _=(-x+Math.sqrt(T))/(2*y);r=a+_*p,o=h+_*g,_>=0&&_<=1&&i.push(new n(r,o))}}return i}},function(t,e,i){var n=i(46),s=new(i(4));t.exports=function(t,e,i){if(void 0===i&&(i=s),n(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(n(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){var n=i(4),s=i(84),r=i(408);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new n,new n,new n,new n],c=[s(o,t,u[0]),s(a,t,u[1]),s(h,t,u[2]),s(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var s,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,m=p*v-g*g,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&s+r<1&&(n.push({x:e[w].x,y:e[w].y}),i)));w++);return n}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,t}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,o=t.x3-e,a=t.y3-i,t.x3=o*s-a*r+e,t.y3=o*r+a*s+i,t}},function(t,e,i){t.exports={BUTTON_DOWN:i(1154),BUTTON_UP:i(1155),CONNECTED:i(1156),DISCONNECTED:i(1157),GAMEPAD_BUTTON_DOWN:i(1158),GAMEPAD_BUTTON_UP:i(1159)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,i){var n=i(15),s=i(134);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,i){var n=i(0),s=i(17),r=i(21),o=i(8),a=i(2),h=i(7),l=i(339),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n0&&(s.totalDuration+=s.t2*s.repeat),s.totalDuration>t&&(t=s.totalDuration),s.delay0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay,this.startDelay=e},init:function(){if(this.paused&&!this.parentIsTimeline)return this.state=h.PENDING_ADD,this._pausedState=h.INIT,!1;for(var t=this.data,e=this.totalTargets,i=0;i0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=h.LOOP_DELAY):(this.state=h.ACTIVE,this.dispatchTweenEvent(r.TWEEN_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=h.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(r.TWEEN_COMPLETE,this.callbacks.onComplete))},pause:function(){return this.state===h.PAUSED?this:(this.paused=!0,this._pausedState=this.state,this.state=h.PAUSED,this)},play:function(t){void 0===t&&(t=!1);var e=this.state;return e!==h.INIT||this.parentIsTimeline?e===h.ACTIVE||e===h.PENDING_ADD&&this._pausedState===h.PENDING_ADD?this:this.parentIsTimeline||e!==h.PENDING_REMOVE&&e!==h.REMOVED?(this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?this.state=h.ACTIVE:(this.countdown=this.calculatedOffset,this.state=h.OFFSET_DELAY)):this.paused?(this.paused=!1,this.makeActive()):(this.resetTweenData(t),this.state=h.ACTIVE,this.makeActive()),this):(this.seek(0),this.parent.makeActive(this),this):(this.resetTweenData(!1),this.state=h.ACTIVE,this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,n=this.totalTargets,s=0;s0&&(r.elapsed=r.delay,r.state=h.DELAY),r.getActiveValue&&(o[a]=r.getActiveValue(r.target,r.key,r.start))}},resume:function(){return this.state===h.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t,e){if(void 0===e&&(e=16.6),this.totalDuration>=36e5)return console.warn("Tween.seek duration too long"),this;this.state===h.REMOVED&&this.makeActive(),this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0;for(var i=this.data,n=this.totalTargets,s=0;s0&&(r.elapsed=r.delay,r.state=h.DELAY)}this.calcDuration();var c=!1;this.state===h.PAUSED&&(c=!0,this.state=h.ACTIVE),this.isSeeking=!0;do{this.update(0,e)}while(this.totalProgress0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},setStateFromStart:function(t,e,i){return e.repeatCounter>0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},updateTweenData:function(t,e,i){var n=e.target;switch(e.state){case h.PLAYING_FORWARD:case h.PLAYING_BACKWARD:if(!n){e.state=h.COMPLETE;break}var s=e.elapsed,o=e.duration,a=0;(s+=i)>o&&(a=s-o,s=o);var l=e.state===h.PLAYING_FORWARD,u=s/o;if(e.elapsed=s,e.progress=u,1===u)l?(e.current=e.end,n[e.key]=e.end,e.hold>0?(e.elapsed=e.hold-a,e.state=h.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,a)):(e.current=e.start,n[e.key]=e.start,e.state=this.setStateFromStart(t,e,a));else{var c=l?e.ease(u):e.ease(1-u);e.current=e.start+(e.end-e.start)*c,n[e.key]=e.current}this.dispatchTweenDataEvent(r.TWEEN_UPDATE,t.callbacks.onUpdate,e);break;case h.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PENDING_RENDER);break;case h.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PLAYING_FORWARD,this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e));break;case h.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case h.PENDING_RENDER:n?(e.start=e.getStartValue(n,e.key,n[e.key],e.index,t.totalTargets,t),e.end=e.getEndValue(n,e.key,e.start,e.index,t.totalTargets,t),e.current=e.start,n[e.key]=e.start,e.state=h.PLAYING_FORWARD):e.state=h.COMPLETE}return e.state!==h.COMPLETE}});l.TYPES=["onActive","onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],a.register("tween",function(t){return this.scene.sys.tweens.add(t)}),o.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=l},function(t,e,i){t.exports={TIMELINE_COMPLETE:i(1306),TIMELINE_LOOP:i(1307),TIMELINE_PAUSE:i(1308),TIMELINE_RESUME:i(1309),TIMELINE_START:i(1310),TIMELINE_UPDATE:i(1311),TWEEN_ACTIVE:i(1312),TWEEN_COMPLETE:i(1313),TWEEN_LOOP:i(1314),TWEEN_REPEAT:i(1315),TWEEN_START:i(1316),TWEEN_UPDATE:i(1317),TWEEN_YOYO:i(1318)}},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p){return{target:t,index:e,key:i,getActiveValue:r,getEndValue:n,getStartValue:s,ease:o,duration:0,totalDuration:0,delay:0,yoyo:l,hold:0,repeat:0,repeatDelay:0,flipX:f,flipY:p,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:a,duration:h,hold:u,repeat:c,repeatDelay:d},state:0}}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(57);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){var n=i(57);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(0),s=i(9),r=new n({initialize:function(t){this.name="WebGLPipeline",this.game=t.game,this.view=t.game.canvas,this.resolution=1,this.width=0,this.height=0,this.gl=t.gl,this.vertexCount=0,this.vertexCapacity=t.vertexCapacity,this.renderer=t.renderer,this.vertexData=t.vertices?t.vertices:new ArrayBuffer(t.vertexCapacity*t.vertexSize),this.vertexBuffer=this.renderer.createVertexBuffer(t.vertices?t.vertices:this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=this.renderer.createProgram(t.vertShader,t.fragShader),this.attributes=t.attributes,this.vertexSize=t.vertexSize,this.topology=t.topology,this.bytes=new Uint8Array(this.vertexData),this.vertexComponentCount=s.getComponentCount(t.attributes,this.gl),this.flushLocked=!1,this.active=!1},boot:function(){},addAttribute:function(t,e,i,n,s){return this.attributes.push({name:t,size:e,type:this.renderer.glFormats[i],normalized:n,offset:s}),this},shouldFlush:function(){return this.vertexCount>=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this.resolution=i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):-1!==h&&t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(0),s=i(64),r=i(2),o=i(489),a=i(740),h=i(741),l=i(32),u=i(9),c=i(228),d=new n({Extends:c,Mixins:[o],initialize:function(t){var e=t.renderer.config;c.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:r(t,"topology",t.renderer.gl.TRIANGLES),vertShader:r(t,"vertShader",h),fragShader:r(t,"fragShader",a),vertexCapacity:r(t,"vertexCapacity",6*e.batchSize),vertexSize:r(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this.batches=[],this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return c.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return c.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){return void 0===t&&(t=this.renderer.blankTexture.glTexture),void 0===e&&(e=0),this.requireTextureBatch(t,e)&&this.pushBatch(t,e),this},requireTextureBatch:function(t,e){var i=this.batches,n=i.length;return!(n>0)||!((e>0?i[n-1].textures[e-1]:i[n-1].texture)===t)},pushBatch:function(t,e){if(0===e)this.batches.push({first:this.vertexCount,texture:t,textures:[]});else{var i=[];i[e-1]=t,this.batches.push({first:this.vertexCount,texture:null,textures:i})}},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,n=this.gl,s=this.vertexCount,r=this.topology,o=this.vertexSize,a=this.renderer,h=this.batches,l=h.length,u=0,c=null;if(0===l||0===s)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,s*o));for(var d=0;d0){for(e=0;e0){for(e=0;e0&&(a.setTexture2D(c.texture,0,!1),n.drawArrays(r,c.first,u)),this.vertexCount=0,h.length=0,this.flushLocked=!1,this},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,l=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.cutWidth,v=o.cutHeight,m=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+f,w=-x+p;if(t.isCropped){var E=t._crop;E.flipX===t.flipX&&E.flipY===t.flipY||o.updateCropUVs(E,t.flipX,t.flipY),h=E.u0,l=E.v0,c=E.u1,d=E.v1,g=E.width,v=E.height,T=-y+(f=E.x),w=-x+(p=E.y)}var _=1,b=1;t.flipX&&(m||(T+=-o.realWidth+2*y),_=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(m||(w+=-o.realHeight+2*x),b=-1),s.applyITRS(t.x,t.y,t.rotation,t.scaleX*_,t.scaleY*b),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),s.e=t.x,s.f=t.y,n.multiply(s,r)):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY,n.multiply(s,r));var A=T+g,S=w+v,C=r.getX(T,w),M=r.getY(T,w),O=r.getX(T,S),P=r.getY(T,S),R=r.getX(A,S),L=r.getY(A,S),D=r.getX(A,w),F=r.getY(A,w),k=u.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),I=u.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),B=u.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),Y=u.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(C=Math.round(C),M=Math.round(M),O=Math.round(O),P=Math.round(P),R=Math.round(R),L=Math.round(L),D=Math.round(D),F=Math.round(F)),this.setTexture2D(a,0);var N=t._isTinted&&t.tintFill;this.batchQuad(C,M,O,P,R,L,D,F,h,l,c,d,k,I,B,Y,N,a,0)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y){var x=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),x=!0,this.setTexture2D(m,y));var T=this.vertexViewF32,w=this.vertexViewU32,E=this.vertexCount*this.vertexComponentCount-1;return T[++E]=t,T[++E]=e,T[++E]=h,T[++E]=l,T[++E]=v,w[++E]=d,T[++E]=i,T[++E]=n,T[++E]=h,T[++E]=c,T[++E]=v,w[++E]=p,T[++E]=s,T[++E]=r,T[++E]=u,T[++E]=c,T[++E]=v,w[++E]=g,T[++E]=t,T[++E]=e,T[++E]=h,T[++E]=l,T[++E]=v,w[++E]=d,T[++E]=s,T[++E]=r,T[++E]=u,T[++E]=c,T[++E]=v,w[++E]=g,T[++E]=o,T[++E]=a,T[++E]=u,T[++E]=l,T[++E]=v,w[++E]=f,this.vertexCount+=6,x},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g){var v=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),this.setTexture2D(p,g),v=!0);var m=this.vertexViewF32,y=this.vertexViewU32,x=this.vertexCount*this.vertexComponentCount-1;return m[++x]=t,m[++x]=e,m[++x]=o,m[++x]=a,m[++x]=f,y[++x]=u,m[++x]=i,m[++x]=n,m[++x]=o,m[++x]=l,m[++x]=f,y[++x]=c,m[++x]=s,m[++x]=r,m[++x]=h,m[++x]=l,m[++x]=f,y[++x]=d,this.vertexCount+=3,v},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,E,_,b,A,S,C,M,O,P){this.renderer.setPipeline(this,t);var R=this._tempMatrix1,L=this._tempMatrix2,D=this._tempMatrix3,F=m/i+S,k=y/n+C,I=(m+x)/i+S,B=(y+T)/n+C,Y=o,N=a,X=-g,z=-v;if(t.isCropped){var U=t._crop;Y=U.width,N=U.height,o=U.width,a=U.height;var G=m=U.x,W=y=U.y;c&&(G=x-U.x-U.width),d&&!e.isRenderTexture&&(W=T-U.y-U.height),F=G/i+S,k=W/n+C,I=(G+U.width)/i+S,B=(W+U.height)/n+C,X=-g+m,z=-v+y}d^=!P&&e.isRenderTexture?1:0,c&&(Y*=-1,X+=o),d&&(N*=-1,z+=a);var H=X+Y,V=z+N;L.applyITRS(s,r,u,h,l),R.copyFrom(M.matrix),O?(R.multiplyWithOffset(O,-M.scrollX*f,-M.scrollY*p),L.e=s,L.f=r,R.multiply(L,D)):(L.e-=M.scrollX*f,L.f-=M.scrollY*p,R.multiply(L,D));var j=D.getX(X,z),q=D.getY(X,z),K=D.getX(X,V),Z=D.getY(X,V),J=D.getX(H,V),Q=D.getY(H,V),$=D.getX(H,z),tt=D.getY(H,z);M.roundPixels&&(j=Math.round(j),q=Math.round(q),K=Math.round(K),Z=Math.round(Z),J=Math.round(J),Q=Math.round(Q),$=Math.round($),tt=Math.round(tt)),this.setTexture2D(e,0),this.batchQuad(j,q,K,Z,J,Q,$,tt,F,k,I,B,w,E,_,b,A,e,0)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),m=h.getY(l,c),y=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,m,y,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n;this.setTexture2D();var h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),m=this.currentFrame,y=m.u0,x=m.v0,T=m.u1,w=m.v1;this.batchQuad(l,u,c,d,f,p,g,v,y,x,T,w,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,m=g.v0,y=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,m,y,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&V[4]?this.batchQuad(D,F,O,P,V[0],V[1],V[2],V[3],U,G,W,H,B,Y,N,X,I):(j[0]=D,j[1]=F,j[2]=O,j[3]=P,j[4]=1),h&&j[4]?this.batchQuad(C,M,R,L,j[0],j[1],j[2],j[3],U,G,W,H,B,Y,N,X,I):(V[0]=C,V[1]=M,V[2]=R,V[3]=L,V[4]=1)}}});t.exports=d},,,function(t,e,i){t.exports={Angle:i(501),Call:i(502),GetFirst:i(503),GetLast:i(504),GridAlign:i(505),IncAlpha:i(555),IncX:i(556),IncXY:i(557),IncY:i(558),PlaceOnCircle:i(559),PlaceOnEllipse:i(560),PlaceOnLine:i(561),PlaceOnRectangle:i(562),PlaceOnTriangle:i(563),PlayAnimation:i(564),PropertyValueInc:i(34),PropertyValueSet:i(27),RandomCircle:i(565),RandomEllipse:i(566),RandomLine:i(567),RandomRectangle:i(568),RandomTriangle:i(569),Rotate:i(570),RotateAround:i(571),RotateAroundDistance:i(572),ScaleX:i(573),ScaleXY:i(574),ScaleY:i(575),SetAlpha:i(576),SetBlendMode:i(577),SetDepth:i(578),SetHitArea:i(579),SetOrigin:i(580),SetRotation:i(581),SetScale:i(582),SetScaleX:i(583),SetScaleY:i(584),SetTint:i(585),SetVisible:i(586),SetX:i(587),SetXY:i(588),SetY:i(589),ShiftPosition:i(590),Shuffle:i(591),SmootherStep:i(592),SmoothStep:i(593),Spread:i(594),ToggleVisible:i(595),WrapInRectangle:i(596)}},function(t,e,i){var n=i(144),s=[];s[n.BOTTOM_CENTER]=i(234),s[n.BOTTOM_LEFT]=i(235),s[n.BOTTOM_RIGHT]=i(236),s[n.CENTER]=i(237),s[n.LEFT_CENTER]=i(239),s[n.RIGHT_CENTER]=i(240),s[n.TOP_CENTER]=i(241),s[n.TOP_LEFT]=i(242),s[n.TOP_RIGHT]=i(243);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){var n=i(38),s=i(74),r=i(39),o=i(75);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(38),s=i(40),r=i(39),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(38),s=i(42),r=i(39),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(238),s=i(74),r=i(77);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(75),s=i(76);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(77),s=i(40),r=i(76),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(77),s=i(42),r=i(76),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(74),s=i(44),r=i(75),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(40),s=i(44),r=i(41),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(42),s=i(44),r=i(43),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(145),s=i(87),r=i(22),o=i(4);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(246),s=i(145),r=i(87),o=i(22);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;he.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,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e,i){var n=i(53),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){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e,i){var n=i(148),s=i(109);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n-h&&(c-=h,n+=l),fd.right&&(f=u(f,f+(g-d.right),this.lerp.x)),vd.bottom&&(p=u(p,p+(v-d.bottom),this.lerp.y))):(f=u(f,g-h,this.lerp.x),p=u(p,v-l,this.lerp.y))}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.roundPixels&&(h=Math.round(h),l=Math.round(l)),this.scrollX=f,this.scrollY=p;var m=f+n,y=p+s;this.midPoint.set(m,y);var x=e/o,T=i/o;this.worldView.setTo(m-x/2,y-T/2,x,T),a.applyITRS(this.x+h,this.y+l,this.rotation,o,o),a.translate(-h,-l),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(33);t.exports=function(t){var e=new n;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(s,r,o)}return e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(e16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(33);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){var n=i(33);t.exports=function(t){var e=new n,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var s=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(s,r,o,255*a)}return e}},function(t,e,i){t.exports={Fade:i(621),Flash:i(622),Pan:i(623),Shake:i(656),Zoom:i(657)}},function(t,e,i){t.exports={In:i(624),Out:i(625),InOut:i(626)}},function(t,e,i){t.exports={In:i(627),Out:i(628),InOut:i(629)}},function(t,e,i){t.exports={In:i(630),Out:i(631),InOut:i(632)}},function(t,e,i){t.exports={In:i(633),Out:i(634),InOut:i(635)}},function(t,e,i){t.exports={In:i(636),Out:i(637),InOut:i(638)}},function(t,e,i){t.exports={In:i(639),Out:i(640),InOut:i(641)}},function(t,e,i){t.exports=i(642)},function(t,e,i){t.exports={In:i(643),Out:i(644),InOut:i(645)}},function(t,e,i){t.exports={In:i(646),Out:i(647),InOut:i(648)}},function(t,e,i){t.exports={In:i(649),Out:i(650),InOut:i(651)}},function(t,e,i){t.exports={In:i(652),Out:i(653),InOut:i(654)}},function(t,e,i){t.exports=i(655)},function(t,e,i){var n=i(0),s=i(31),r=i(293),o=i(2),a=i(5),h=i(7),l=i(166),u=i(1),c=i(172),d=i(160),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",void 0),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!0),this.autoRound=a(t,"autoRound",!1),this.autoCenter=a(t,"autoCenter",0),this.resizeInterval=a(t,"resizeInterval",500),this.fullscreenTarget=a(t,"fullscreenTarget",null),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"expandParent",this.expandParent),this.autoRound=a(e,"autoRound",this.autoRound),this.autoCenter=a(e,"autoCenter",this.autoCenter),this.resizeInterval=a(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=a(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.antialias=a(i,"antialias",!0),this.desynchronized=a(i,"desynchronized",!1),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3),this.maxLights=a(i,"maxLights",10);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){t.exports={os:i(116),browser:i(117),features:i(165),input:i(686),audio:i(687),video:i(688),fullscreen:i(689),canvasFeatures:i(294)}},function(t,e,i){var n,s,r,o=i(25),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");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;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");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);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},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){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},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),t0?Math.ceil(t):Math.floor(t)}},function(t,e,i){var n=i(3);t.exports=function(t,e,i,s,r,o,a,h){void 0===h&&(h=new n);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,f=-l*a,p=u*a,g=1/(c*p+f*-d);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=c*g*e+-d*g*t+(-s*c+i*d)*g,h}},function(t,e,i){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,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+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){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],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,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]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*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],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-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],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+m*h,e[4]=g*n+v*o+m*l,e[5]=g*s+v*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*n+x*o+T*l,e[8]=y*s+x*a+T*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],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-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,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,m=this.val;return m[0]=1-(c+f),m[3]=l+v,m[6]=u-g,m[1]=l-v,m[4]=1-(h+f),m[7]=d+p,m[2]=u+g,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=n*h-s*a,T=n*l-r*a,w=n*u-o*a,E=s*l-r*h,_=s*u-o*h,b=r*u-o*l,A=c*v-d*g,S=c*m-f*g,C=c*y-p*g,M=d*m-f*v,O=d*y-p*v,P=f*y-p*m,R=x*P-T*O+w*M+E*C-_*S+b*A;return R?(R=1/R,i[0]=(h*P-l*O+u*M)*R,i[1]=(l*C-a*P-u*S)*R,i[2]=(a*O-h*C+u*A)*R,i[3]=(r*O-s*P-o*M)*R,i[4]=(n*P-r*C+o*S)*R,i[5]=(s*C-n*O-o*A)*R,i[6]=(v*b-m*_+y*E)*R,i[7]=(m*w-g*b-y*T)*R,i[8]=(g*_-v*w+y*x)*R,this):null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),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],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},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(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=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]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],m=e*o-i*r,y=e*a-n*r,x=e*h-s*r,T=i*a-n*o,w=i*h-s*o,E=n*h-s*a,_=l*p-u*f,b=l*g-c*f,A=l*v-d*f,S=u*g-c*p,C=u*v-d*p,M=c*v-d*g,O=m*M-y*C+x*S+T*A-w*b+E*_;return O?(O=1/O,t[0]=(o*M-a*C+h*S)*O,t[1]=(n*C-i*M-s*S)*O,t[2]=(p*E-g*w+v*T)*O,t[3]=(c*w-u*E-d*T)*O,t[4]=(a*A-r*M-h*b)*O,t[5]=(e*M-n*A+s*b)*O,t[6]=(g*x-f*E-v*y)*O,t[7]=(l*E-c*x+d*y)*O,t[8]=(r*C-o*A+h*_)*O,t[9]=(i*A-e*C-s*_)*O,t[10]=(f*w-p*x+v*m)*O,t[11]=(u*x-l*w-d*m)*O,t[12]=(o*b-r*S-a*_)*O,t[13]=(e*S-i*b+n*_)*O,t[14]=(p*y-f*T-g*m)*O,t[15]=(l*T-u*y+c*m)*O,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],E=y[3];return e[0]=x*i+T*o+w*u+E*p,e[1]=x*n+T*a+w*c+E*g,e[2]=x*s+T*h+w*d+E*v,e[3]=x*r+T*l+w*f+E*m,x=y[4],T=y[5],w=y[6],E=y[7],e[4]=x*i+T*o+w*u+E*p,e[5]=x*n+T*a+w*c+E*g,e[6]=x*s+T*h+w*d+E*v,e[7]=x*r+T*l+w*f+E*m,x=y[8],T=y[9],w=y[10],E=y[11],e[8]=x*i+T*o+w*u+E*p,e[9]=x*n+T*a+w*c+E*g,e[10]=x*s+T*h+w*d+E*v,e[11]=x*r+T*l+w*f+E*m,x=y[12],T=y[13],w=y[14],E=y[15],e[12]=x*i+T*o+w*u+E*p,e[13]=x*n+T*a+w*c+E*g,e[14]=x*s+T*h+w*d+E*v,e[15]=x*r+T*l+w*f+E*m,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},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){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},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,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=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],g=i[5],v=i[6],m=i[7],y=i[8],x=i[9],T=i[10],w=i[11],E=n*n*l+h,_=s*n*l+r*a,b=r*n*l-s*a,A=n*s*l-r*a,S=s*s*l+h,C=r*s*l+n*a,M=n*r*l+s*a,O=s*r*l-n*a,P=r*r*l+h;return i[0]=u*E+p*_+y*b,i[1]=c*E+g*_+x*b,i[2]=d*E+v*_+T*b,i[3]=f*E+m*_+w*b,i[4]=u*A+p*S+y*C,i[5]=c*A+g*S+x*C,i[6]=d*A+v*S+T*C,i[7]=f*A+m*S+w*C,i[8]=u*M+p*O+y*P,i[9]=c*M+g*O+x*P,i[10]=d*M+v*O+T*P,i[11]=f*M+m*O+w*P,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=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]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=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]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*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],o=e[2],a=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]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,m=o*h,y=o*l;return i[0]=1-(f+g),i[1]=c+y,i[2]=d-m,i[3]=0,i[4]=c-y,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+m,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,m=r*h;return e[0]=1-(d+p),e[1]=u+m,e[2]=c-v,e[3]=0,e[4]=u-m,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),m=h*(g*=v)-l*(p*=v),y=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(m*m+y*y+x*x))?(m*=v=1/v,y*=v,x*=v):(m=0,y=0,x=0);var T=p*x-g*y,w=g*m-f*x,E=f*y-p*m;return(v=Math.sqrt(T*T+w*w+E*E))?(T*=v=1/v,w*=v,E*=v):(T=0,w=0,E=0),n[0]=m,n[1]=T,n[2]=f,n[3]=0,n[4]=y,n[5]=w,n[6]=p,n[7]=0,n[8]=x,n[9]=E,n[10]=g,n[11]=0,n[12]=-(m*s+y*r+x*o),n[13]=-(T*s+w*r+E*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.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),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=i(0),s=i(171),r=i(312),o=new Int8Array([1,2,0]),a=new Float32Array([0,0,0]),h=new s(1,0,0),l=new s(0,1,0),u=new s,c=new r,d=new n({initialize:function(t,e,i,n){"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)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},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,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,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},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(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 n=c.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(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,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.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},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.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},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},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],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=i(316),s=i(25),r=i(31),o=i(165);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.CANVAS||e.renderType!==r.CANVAS&&!o.webGL){if(!o.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=r.CANVAS}else e.renderType=r.WEBGL;e.antialias||s.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=s.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||n.setCrisp(t.canvas),e.renderType!==r.HEADLESS&&(a=i(482),h=i(485),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(31);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===n.CANVAS?i="Canvas":e.renderType===n.HEADLESS&&(i="Headless");var s,r=e.audio,o=t.device.audio;if(s=!o.webAudio||r&&r.disableWebAudio?r&&r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio":"Web Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+n.VERSION+" / https://phaser.io");else{var a,h="",l=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach(function(t){h=h.concat("%c "),l.push("background: "+t),a=t}),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a):(h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),l.push("background: #fff"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+n.VERSION+" ("+i+" | "+s+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},function(t,e,i){var n=i(0),s=i(5),r=i(1),o=i(319),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step()},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.max(16+t.lastTime-i,0);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(18);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)},!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var n=i(322),s=i(25),r=i(5);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",n),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*a)),p=Math.floor(Math.abs(e.length*h));i||(i=s.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var g=i.getContext("2d");u&&g.clearRect(0,0,f,p),c&&c(i,g);for(var v=0;vi;)n-=i;ni.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e,i){var n=i(116);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e,i){var n=i(174);t.exports=function(t,e){var i=window.screen,s=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);if(s&&"string"==typeof s.type)return s.type;if("string"==typeof s)return s;if(i)return i.height>i.width?n.PORTRAIT:n.LANDSCAPE;if("number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?n.PORTRAIT:n.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return n.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return n.LANDSCAPE}return e>t?n.PORTRAIT:n.LANDSCAPE}},function(t,e){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},function(t,e){t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},function(t,e){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},function(t,e){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},function(t,e){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(0),s=i(176),r=i(10),o=i(54),a=i(18),h=i(341),l=i(342),u=i(343),c=i(344),d=i(32),f=i(310),p=new n({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var n=new u(this,i);n.smoothFactor=e.inputSmoothFactor,this.pointers.push(n)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(o.MANAGER_BOOT),this.game.events.on(a.PRE_RENDER,this.preRender,this),this.game.events.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var n=0;n10&&(t=10-this.pointersTotal);for(var i=0;i-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.useQueue||t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},function(t,e,i){var n=i(0),s=i(165),r=i(54),o=i(0),a=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.capture=t.inputMouseCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},requestPointerLock:function(){if(s.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){s.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onMouseMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseMove(e),t.capture&&e.preventDefault())},this.onMouseDown=function(n){i&&window.focus(),!n.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseDown(n),t.capture&&n.target===e&&n.preventDefault())},this.onMouseDownWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseDown(i)},this.onMouseUp=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseUp(i),t.capture&&i.target===e&&i.preventDefault())},this.onMouseUpWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseUp(i)},this.onMouseOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onMouseOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)},this.onMouseWheel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onMouseWheel(e)};var n=this.target;if(n){var r={passive:!0},o={passive:!1};n.addEventListener("mousemove",this.onMouseMove,this.capture?o:r),n.addEventListener("mousedown",this.onMouseDown,this.capture?o:r),n.addEventListener("mouseup",this.onMouseUp,this.capture?o:r),n.addEventListener("mouseover",this.onMouseOver,this.capture?o:r),n.addEventListener("mouseout",this.onMouseOut,this.capture?o:r),n.addEventListener("wheel",this.onMouseWheel,this.capture?o:r),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o)),s.pointerLock&&(this.pointerLockChange=function(e){var i=t.target;t.locked=document.pointerLockElement===i||document.mozPointerLockElement===i||document.webkitPointerLockElement===i,t.manager.onPointerLockChange(e)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&(window.removeEventListener("mousedown",this.onMouseDownWindow),window.removeEventListener("mouseup",this.onMouseUpWindow)),s.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},function(t,e,i){var n=i(295),s=i(0),r=i(58),o=i(167),a=i(304),h=i(3),l=new s({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=this.x,i=this.y;1!==t.resolution&&(e+=t._x,i+=t._y);var n=t.getWorldPoint(e,i);return this.worldX=n.x,this.worldY=n.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,s=this.midPoint.y;if(t!==i||e!==s){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,s,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=n(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp),this.isDown=!1,this.wasTouch=!1},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp),this.isDown=!0,this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,s=this.position.x,r=this.position.y,o=0;o0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,r=t.resolution,o=t.zoom,a=t.autoRound;if("string"==typeof e){var h=this.parentSize.width;0===h&&(h=window.innerWidth);var l=parseInt(e,10)/100;e=Math.floor(h*l)}if("string"==typeof i){var c=this.parentSize.height;0===c&&(c=window.innerHeight);var d=parseInt(i,10)/100;i=Math.floor(c*d)}this.resolution=1,this.scaleMode=s,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),o===n.ZOOM.MAX_ZOOM&&(o=this.getMaxZoom()),this.zoom=o,1!==o&&(this._resetZoom=!0),this.baseSize.setSize(e*r,i*r),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*o,t.minHeight*o),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*o,t.maxHeight*o),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==n.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=this.resolution,n=e.width*i,s=e.height*i;return(t.width!==n||t.height!==s)&&(t.setSize(n,s),!0)},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e(t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound,n=this.resolution;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t,e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,n=this.resolution,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,o=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i*n,e*i*n),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,h=t*i,l=e*i;return s&&(h=Math.floor(h),l=Math.floor(l)),h===t&&l===e||(a.width=h+"px",a.height=l+"px"),this.refresh(r,o)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var n=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=n.marginLeft,s.marginTop=n.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,this.resolution,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===n.SCALE_MODE.NONE?(this.displaySize.setSize(s*o*1,r*o*1),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===n.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(1*this.displaySize.width,1*this.displaySize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=p(this.parentSize.width,this.gameSize.width,0,!0),e=p(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==n.CENTER.NO_CENTER){var e=this.canvas,i=e.style,s=e.getBoundingClientRect(),r=s.width,o=s.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===n.CENTER.CENTER_HORIZONTALLY?h=0:t===n.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();this._requestedFullscreenChange=!0,"undefined"!=typeof Promise?e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT).then(this.fullscreenSuccessHandler.bind(this)).catch(this.fullscreenErrorHandler.bind(this)):i[e.request](t).then(this.fullscreenSuccessHandler.bind(this)).catch(this.fullscreenErrorHandler.bind(this)):(e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t),e.active?this.fullscreenSuccessHandler():this.fullscreenErrorHandler())}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&(this._requestedFullscreenChange=!0,document[t.cancel]()),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach(function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){this._requestedFullscreenChange||this.stopFullscreen(),this._requestedFullscreenChange=!1},onFullScreenError:function(){this.removeFullscreenTarget()},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===n.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===n.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=v},function(t,e,i){var n=i(24),s=i(0),r=i(91),o=i(3),a=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio0&&(t=(e=r(e,n.y))*this.aspectRatio)):(i&&this.aspectRatios)&&(t=(e=r(e,n.y))*this.aspectRatio,n.x>0&&(e=(t=r(t,n.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},function(t,e,i){var n=i(0),s=i(123),r=i(20),o=i(18),a=i(5),h=i(81),l=i(1),u=i(349),c=i(177),d=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit(r.TRANSITION_INIT,n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=r.x&&t=r.y&&e=r.x&&t=r.y&&e-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=n,o.data[2]=s,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,n,s,r,o){return void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,n,s,r,o),this},getData:function(t,e,i,n){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),n=s(n,1,this.height-e),this.context.getImageData(t,e,i,n)},getPixel:function(t,e,i){i||(i=new r);var n=this.getIndex(t,e);if(n>-1){var s=this.data,o=s[n+0],a=s[n+1],h=s[n+2],l=s[n+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=s(t,0,this.width),a=s(t+i,0,this.width),h=s(e,0,this.height),l=s(e+n,0,this.height),u=new r,c=[],d=h;d0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=o},function(t,e,i){var n=i(124),s=i(0),r=i(10),o=i(359),a=i(1),h=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){var n=i(125),s=i(0),r=i(10),o=i(15),a=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!1},updateMarker:function(t){return!1},removeMarker:function(t){return null},play:function(t,e){return!1},pause:function(){return!1},resume:function(){return!1},stop:function(){return!1},destroy:function(){this.manager.remove(this),n.prototype.destroy.call(this)}});t.exports=a},function(t,e,i){var n=i(361),s=i(124),r=i(0),o=i(66),a=i(362),h=new r({Extends:s,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),s.call(this,t),this.locked&&this.unlock()},createAudioContext:function(t){var e=t.config.audio;return e&&e.context?(e.context.resume(),e.context):new AudioContext},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var s=this.game.cache.audio,r=i.length,a=0;a>4,u[h++]=(15&i)<<4|s>>2,u[h++]=(3&s)<<6|63&r;return l}},function(t,e,i){var n=i(125),s=i(0),r=i(66),o=new s({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),this.audioBuffer?(this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime-1;r--)n[s][r]=t[r][s]}return n}},function(t,e){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,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=n);o>r;){if(o-r>600){var h=o-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(o,Math.floor(e+(h-l)*c/h+d));s(t,e,f,p,a)}var g=t[e],v=r,m=o;for(i(t,r,e),a(t[o],g)>0&&i(t,r,o);v0;)m--}0===a(t[r],g)?i(t,r,m):i(t,++m,o),m<=e&&(r=m+1),e<=m&&(o=m-1)}};t.exports=s},function(t,e,i){var n=i(5),s=i(112),r=function(t,e,i){for(var n=[],s=0;s0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(11);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),o=Math.max(t.right,e.right)-s,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(s,r,o,a)}},function(t,e,i){var n=i(0),s=i(12),r=i(920),o=i(13),a=i(7),h=i(175),l=i(311),u=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Origin,s.ScrollFactor,s.Transform,s.Visible,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new l,this.rotate3dAngle="deg",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof n?"#"===n[0]?this.setElement(n.substr(1),s,r):this.createElement(n,s,r):n&&this.setElement(n,s,r)},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e>>16,y=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+m+","+y+","+x+","+d+")",c.lineWidth=v,T+=3;break;case n.FILL_STYLE:g=l[T+1],f=l[T+2],m=(16711680&g)>>>16,y=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+m+","+y+","+x+","+f+")",T+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[T+1],l[T+2],l[T+3],l[T+4]):c.fillRect(l[T+1],l[T+2],l[T+3],l[T+4]),T+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.fill(),T+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.stroke(),T+=6;break;case n.LINE_TO:c.lineTo(l[T+1],l[T+2]),T+=2;break;case n.MOVE_TO:c.moveTo(l[T+1],l[T+2]),T+=2;break;case n.LINE_FX_TO:c.lineTo(l[T+1],l[T+2]),T+=5;break;case n.MOVE_FX_TO:c.moveTo(l[T+1],l[T+2]),T+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[T+1],l[T+2]),T+=2;break;case n.SCALE:c.scale(l[T+1],l[T+2]),T+=2;break;case n.ROTATE:c.rotate(l[T+1]),T+=1;break;case n.GRADIENT_FILL_STYLE:T+=5;break;case n.GRADIENT_LINE_STYLE:T+=6;break;case n.SET_TEXTURE:T+=2}c.restore()}}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(53),s=i(0),r=i(12),o=i(378),a=i(379),h=i(937),l=i(2),u=i(182),c=i(380),d=i(97),f=i(376),p=i(381),g=i(11),v=i(128),m=i(3),y=i(57),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];s.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===n&&(n=!1),void 0===s&&(s=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=s,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;i0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e,i){var n=i(0),s=i(960),r=i(64),o=i(11),a=i(29),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;sc+v)){var m=g.getPoint((u-c)/v);o.push(m);break}c+=v}return o}},function(t,e,i){var n=i(56),s=i(55);t.exports=function(t){for(var e=t.points,i=0,r=0;r0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(0),s=i(11),r=i(29),o=i(981),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new s(0,0,n,o)),this.setPosition(e,i),this.setSize(n,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(984),s=i(0),r=i(64),o=i(29),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(56),s=i(4);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e){t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=t,o=0;o0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],o):h=new s(t,e,i,a[0],a[1],a[2],o),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=o},function(t,e,i){var n=i(47),s=i(15),r={Circle:i(1043),Ellipse:i(1053),Intersects:i(405),Line:i(1072),Point:i(1093),Polygon:i(1107),Rectangle:i(420),Triangle:i(1137)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={CircleToCircle:i(406),CircleToRectangle:i(407),GetCircleToCircle:i(1063),GetCircleToRectangle:i(1064),GetLineToCircle:i(198),GetLineToRectangle:i(200),GetRectangleIntersection:i(1065),GetRectangleToRectangle:i(1066),GetRectangleToTriangle:i(1067),GetTriangleToCircle:i(1068),GetTriangleToLine:i(412),GetTriangleToTriangle:i(1069),LineToCircle:i(199),LineToLine:i(84),LineToRectangle:i(408),PointToLine:i(416),PointToLineSegment:i(1070),RectangleToRectangle:i(131),RectangleToTriangle:i(409),RectangleToValues:i(1071),TriangleToCircle:i(411),TriangleToLine:i(413),TriangleToTriangle:i(414)}},function(t,e,i){var n=i(58);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(84),s=i(48),r=i(201),o=i(410);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e,i){var n=i(199),s=i(83);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=1);var n=e.x1,s=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-n)*(r-n)+(o-s)*(o-s);if(0===l)return!1;var u=((a-n)*(r-n)+(h-s)*(o-s))/l;if(u<0)return Math.sqrt((n-a)*(n-a)+(s-h)*(s-h))<=i;if(u>=0&&u<=1){var c=((s-h)*(r-n)-(n-a)*(o-s))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},function(t,e,i){var n=i(22),s=i(57),r=i(85);t.exports=function(t){var e=r(t)-n.TAU;return s(e,-Math.PI,Math.PI)}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e,i){var n=i(11);n.Area=i(1112),n.Ceil=i(1113),n.CeilAll=i(1114),n.CenterOn=i(163),n.Clone=i(1115),n.Contains=i(48),n.ContainsPoint=i(1116),n.ContainsRect=i(421),n.CopyFrom=i(1117),n.Decompose=i(410),n.Equals=i(1118),n.FitInside=i(1119),n.FitOutside=i(1120),n.Floor=i(1121),n.FloorAll=i(1122),n.FromPoints=i(173),n.GetAspectRatio=i(203),n.GetCenter=i(1123),n.GetPoint=i(148),n.GetPoints=i(252),n.GetSize=i(1124),n.Inflate=i(1125),n.Intersection=i(1126),n.MarchingAnts=i(263),n.MergePoints=i(1127),n.MergeRect=i(1128),n.MergeXY=i(1129),n.Offset=i(1130),n.OffsetPoint=i(1131),n.Overlaps=i(1132),n.Perimeter=i(109),n.PerimeterPoint=i(1133),n.Random=i(151),n.RandomOutside=i(1134),n.SameDimensions=i(1135),n.Scale=i(1136),n.Union=i(367),t.exports=n},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var n=i(426),s=i(427),r=i(0),o=i(10),a=i(3),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=r;for(i=0;i=r;)this._elapsed-=r,this.step(s)}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(n=(i=h.entries).length,t=0;t-1&&p>g&&(t.velocity.normalize().scale(g),p=g),t.speed=p},separate:function(t,e,i,n,s){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,s);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.ya.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,c=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)r.right&&(s=h(o.x,o.y,r.right,r.y)-o.radius):o.y>r.bottom&&(o.xr.right&&(s=h(o.x,o.y,r.right,r.bottom)-o.radius)),s*=-1}else s=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s&&(t.onOverlap||e.onOverlap)&&this.emit(u.OVERLAP,t.gameObject,e.gameObject,t,e),0!==s;var a=t.position.x-e.position.x,l=t.position.y-e.position.y,c=Math.sqrt(Math.pow(a,2)+Math.pow(l,2)),d=(e.position.x-t.position.x)/c||0,f=(e.position.y-t.position.y)/c||0,v=2*(t.velocity.x*d+t.velocity.y*f-e.velocity.x*d-e.velocity.y*f)/(t.mass+e.mass);t.immovable||(t.velocity.x=(t.velocity.x-v*t.mass*d)*t.bounce.x,t.velocity.y=(t.velocity.y-v*t.mass*f)*t.bounce.y),e.immovable||(e.velocity.x=(e.velocity.x+v*e.mass*d)*e.bounce.x,e.velocity.y=(e.velocity.y+v*e.mass*f)*e.bounce.y);var m=e.velocity.x-t.velocity.x,y=e.velocity.y-t.velocity.y,x=Math.atan2(y,m),T=this._frameTime;return t.immovable||(t.x+=t.velocity.x*T-s*Math.cos(x),t.y+=t.velocity.y*T-s*Math.sin(x)),e.immovable||(e.x+=e.velocity.x*T+s*Math.cos(x),e.y+=e.velocity.y*T+s*Math.sin(x)),(t.onCollide||e.onCollide)&&this.emit(u.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o,a;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f=e.getTilesWithinWorldXY(a,h,l,u);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,n,s,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,s,r,o){for(var a,h,l=t.body,c={left:0,right:0,top:0,bottom:0},d=!1,f=0;f0&&t>i&&(t=i)),0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),this.gameObject.x+=t,this.gameObject.y+=e,this._reset=!0}t<0?this.facing=r.FACING_LEFT:t>0&&(this.facing=r.FACING_RIGHT),e<0?this.facing=r.FACING_UP:e>0&&(this.facing=r.FACING_DOWN),this._dx=t,this._dy=e,this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,s=void 0!==i;return(n||s)&&(this.worldBounce||(this.worldBounce=new u),n&&(this.worldBounce.x=e),s&&(this.worldBounce.y=i)),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(51);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=i(51);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,m,y;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,m-g)*Math.max(0,y-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(46),s=i(0),r=i(51),o=i(48),a=i(3),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},,,,function(t,e,i){var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game,this.scene,this.systems},init:function(){},start:function(){},stop:function(){},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e,i){var n=i(23);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l-1}return!1}},function(t,e,i){var n=i(73),s=i(101),r=i(212);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!1),void 0===o&&(o=!0),!s(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new n(a,-1,t,e,h.width,h.height),o&&h&&h.collides&&r(t,e,a),h):null}},function(t,e,i){var n=i(30),s=i(215),r=i(457),o=i(458),a=i(469);t.exports=function(t,e,i,h,l,u){var c;switch(e){case n.ARRAY_2D:c=s(t,i,h,l,u);break;case n.CSV:c=r(t,i,h,l,u);break;case n.TILED_JSON:c=o(t,i,u);break;case n.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},function(t,e,i){var n=i(30),s=i(215);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map(function(t){return t.split(",")}),h=s(t,a,i,r,o);return h.format=n.CSV,h}},function(t,e,i){var n=i(30),s=i(103),r=i(459),o=i(461),a=i(462),h=i(465),l=i(467),u=i(468);t.exports=function(t,e,i){if("orthogonal"!==e.orientation)return console.warn("Only orthogonal map types are supported in this version of Phaser"),null;var c=new s({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:e.orientation,format:n.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});c.layers=r(e,i),c.images=o(e);var d=a(e);return c.tilesets=d.tilesets,c.imageCollections=d.imageCollections,c.objects=h(e),c.tiles=l(c),u(c),c}},function(t,e,i){var n=i(460),s=i(2),r=i(102),o=i(216),a=i(73);t.exports=function(t,e){for(var i=s(t,"infinite",!1),h=[],l=0;l0?((f=new a(c,d.gid,C,M,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,g[M][C]=f):(p=e?null:new a(c,-1,C,M,t.tilewidth,t.tileheight),g[M][C]=p),++v===w.width&&(b++,v=0)}}else{c=new r({name:u.name,x:s(u,"offsetx",0)+u.x,y:s(u,"offsety",0)+u.y,width:u.width,height:u.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:u.opacity,visible:u.visible,properties:s(u,"properties",{})});for(var O=[],P=0,R=u.data.length;P0?((f=new a(c,d.gid,v,g.length,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,O.push(f)):(p=e?null:new a(c,-1,v,g.length,t.tilewidth,t.tileheight),O.push(p)),++v===u.width&&(g.push(O),v=0,O=[])}c.data=g,h.push(c)}}return h}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),s=0;s>>0;return n}},function(t,e,i){var n=i(2);t.exports=function(t){for(var e=[],i=0;i1){if(Array.isArray(l.tiles)){for(var c={},d={},f=0;f=this.firstgid&&ta&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(102),s=i(73);t.exports=function(t,e){for(var i=[],r=0;r-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(141);t.exports=function(t){for(var e=[],i=[],s=0;s-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(s,r),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(u=new p(t,o,i,n,s,r)).setImage(h),this.tilesets.push(u),u)},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new c(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:null!==a?(f.Copy(t,e,i,n,s,r,o,a),this):null},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===a&&(a=this.tileWidth),void 0===l&&(l=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var u,c=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;f-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return n},removeTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"removeTileAt")?null:null===s?null:f.RemoveTileAt(t,e,i,n,s)},removeTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"removeTileAtWorldXY")?null:null===r?null:f.RemoveTileAtWorldXY(t,e,i,n,s,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(f.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this))},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(12),r=i(18),o=i(13),a=i(1296),h=i(137),l=i(32),u=i(9),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.events.on(r.CONTEXT_RESTORED,function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;sv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;o>=0;o--)for(a=0;av||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;o>=0;o--)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===m?(m=i.createVertexBuffer(y,n.STATIC_DRAW),this.vertexBuffer[e]=m):(i.setVertexBuffer(m),n.bufferSubData(n.ARRAY_BUFFER,0,y))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=i.tileWidth,l=i.tileHeight,c=h/2,d=l/2,f=a.x/n,p=a.y/s,g=(a.x+h)/n,v=(a.y+l)/s,m=this._tempMatrix,y=-c,x=-d;e.flipX&&(h*=-1,y+=i.tileWidth),e.flipY&&(l*=-1,x+=i.tileHeight);var T=y+h,w=x+l;m.applyITRS(c+e.pixelX,d+e.pixelY,e.rotation,1,1);var E=u.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),_=m.getX(y,x),b=m.getY(y,x),A=m.getX(y,w),S=m.getY(y,w),C=m.getX(T,w),M=m.getY(T,w),O=m.getX(T,x),P=m.getY(T,x);r.roundPixels&&(_=Math.round(_),b=Math.round(b),A=Math.round(A),S=Math.round(S),C=Math.round(C),M=Math.round(M),O=Math.round(O),P=Math.round(P));var R=this.vertexViewF32[o],L=this.vertexViewU32[o];return R[++t]=_,R[++t]=b,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=E,R[++t]=A,R[++t]=S,R[++t]=f,R[++t]=v,R[++t]=0,L[++t]=E,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=E,R[++t]=_,R[++t]=b,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=E,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=E,R[++t]=O,R[++t]=P,R[++t]=g,R[++t]=p,R[++t]=0,L[++t]=E,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4){this._renderOrder=t;for(var e=0;e0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(1305);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){var n=i(5);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(221),s=i(14),r=i(88),o=i(82),a=i(142),h=i(5),l=i(220),u=i(222),c=i(224);t.exports=function(t,e,i){void 0===i&&(i=n);var d=h(e,"from",0),f=h(e,"to",1),p=[{value:d}],g=a(e,"delay",i.delay),v=a(e,"duration",i.duration),m=h(e,"easeParams",i.easeParams),y=o(h(e,"ease",i.ease),m),x=a(e,"hold",i.hold),T=a(e,"repeat",i.repeat),w=a(e,"repeatDelay",i.repeatDelay),E=r(e,"yoyo",i.yoyo),_=[],b=l("value",f),A=c(p[0],0,"value",b.getEnd,b.getStart,b.getActive,y,g,v,E,x,T,w,!1,!1);A.start=d,A.current=d,A.to=f,_.push(A);var S=new u(t,_,p);S.offset=s(e,"offset",null),S.completeDelay=s(e,"completeDelay",0),S.loop=Math.round(s(e,"loop",0)),S.loopDelay=Math.round(s(e,"loopDelay",0)),S.paused=r(e,"paused",!1),S.useFrames=r(e,"useFrames",!1);for(var C=h(e,"callbackScope",S),M=[S,null],O=u.TYPES,P=0;P0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var m=0;m0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):(this.state=a.ACTIVE,this.dispatchTimelineEvent(r.TIMELINE_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=a.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=a.PENDING_REMOVE,this.dispatchTimelineEvent(r.TIMELINE_COMPLETE,this.callbacks.onComplete))},update:function(t,e){if(this.state!==a.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var i=this.totalData,n=0;n=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit(r.SPRITE_ANIMATION_KEY_UPDATE+i.key,i,t,e),e.emit(r.SPRITE_ANIMATION_UPDATE,i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=o},function(t,e,i){var n=i(483),s=i(49),r=i(0),o=i(31),a=i(484),h=i(90),l=i(104),u=i(114),c=i(32),d=new r({initialize:function(t){this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.config={clearBeforeRender:t.config.clearBeforeRender,backgroundColor:t.config.backgroundColor,resolution:t.config.resolution,antialias:t.config.antialias,roundPixels:t.config.roundPixels},this.scaleMode=t.config.antialias?l.LINEAR:l.NEAREST,this.gameCanvas=t.canvas;var e={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d",e),this.currentContext=this.gameContext,this.blendModes=a(),this.currentScaleMode=0,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new c,this._tempMatrix2=new c,this._tempMatrix3=new c,this._tempMatrix4=new c,this.init()},init:function(){this.game.scale.on(h.RESIZE,this.onResize,this);var t=this.game.scale.baseSize;this.resize(t.width,t.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.scaleMode===l.NEAREST&&u.disable(this.gameContext)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),t.save(),this.drawCount=0},render:function(t,e,i,n){var r=e.list,o=r.length,a=n._cx,h=n._cy,l=n._cw,u=n._ch,c=n.renderToTexture?n.context:t.sys.context;c.save(),this.game.scene.customViewports&&(c.beginPath(),c.rect(a,h,l,u),c.clip()),this.currentContext=c;var d=n.mask;d&&d.preRenderCanvas(this,null,n._maskCamera),n.transparent||(c.fillStyle=n.backgroundColor.rgba,c.fillRect(a,h,l,u)),c.globalAlpha=n.alpha,c.globalCompositeOperation="source-over",this.drawCount+=r.length,n.renderToTexture&&n.emit(s.PRE_RENDER,n),n.matrix.copyToContext(c);for(var f=0;f=0?y=-(y+d):y<0&&(y=Math.abs(y)-d)),t.flipY&&(x>=0?x=-(x+f):x<0&&(x=Math.abs(x)-f))}var w=1,E=1;t.flipX&&(p||(y+=-e.realWidth+2*v),w=-1),t.flipY&&(p||(x+=-e.realHeight+2*m),E=-1),a.applyITRS(t.x,t.y,t.rotation,t.scaleX*w,t.scaleY*E),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,y,x,d/g,f/g),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=d},function(t,e,i){var n=i(25),s=i(33),r=i(2);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=r(e,"width",t.width),c=r(e,"height",t.height);if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new s(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=n.createWebGL(this,u,c);f.getContext("2d").drawImage(t,h,l,u,c,0,0,u,c);var p=new Image;p.onerror=function(){i.call(null),n.remove(f)},p.onload=function(){i.call(null,p),n.remove(f)},p.src=f.toDataURL(o,a)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(o,a)}}},function(t,e,i){var n=i(53),s=i(294);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t[n.ERASE]="destination-out",t[n.SOURCE_IN]="source-in",t[n.SOURCE_OUT]="source-out",t[n.SOURCE_ATOP]="source-atop",t[n.DESTINATION_OVER]="destination-over",t[n.DESTINATION_IN]="destination-in",t[n.DESTINATION_OUT]="destination-out",t[n.DESTINATION_ATOP]="destination-atop",t[n.LIGHTER]="lighter",t[n.COPY]="copy",t[n.XOR]="xor",t}},function(t,e,i){var n=i(113),s=i(49),r=i(0),o=i(31),a=i(18),h=i(118),l=i(1),u=i(90),c=i(79),d=i(119),f=i(32),p=i(9),g=i(486),v=i(487),m=i(488),y=i(229),x=new r({initialize:function(t){var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialias,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,resolution:e.resolution,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights},this.game=t,this.type=o.WEBGL,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.nativeTextures=[],this.contextLost=!1,this.pipelines=null,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTextureUnit=0,this.currentTextures=new Array(16),this.currentFramebuffer=null,this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=l,this.contextRestoredHandler=l,this.gl=null,this.supportedExtensions=null,this.extensions={},this.glFormats=[],this.compression={ETC1:!1,PVRTC:!1,S3TC:!1},this.drawingBufferHeight=0,this.blankTexture=null,this.defaultCamera=new n(0,0,0,0),this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this._tempMatrix4=new f,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.init(this.config)},init:function(t){var e,i=this.game,n=this.canvas,s=t.backgroundColor;if(!(e=i.config.context?i.config.context:n.getContext("webgl",t.contextCreation)||n.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var r=this;this.contextLostHandler=function(t){r.contextLost=!0,r.game.events.emit(a.CONTEXT_LOST,r),t.preventDefault()},this.contextRestoredHandler=function(){r.contextLost=!1,r.init(r.config),r.game.events.emit(a.CONTEXT_RESTORED,r)},n.addEventListener("webglcontextlost",this.contextLostHandler,!1),n.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var h=0;h<=27;h++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var l=e.getSupportedExtensions();t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE));var u="WEBGL_compressed_texture_",c="WEBKIT_"+u;this.compression.ETC1=e.getExtension(u+"etc1")||e.getExtension(c+"etc1"),this.compression.PVRTC=e.getExtension(u+"pvrtc")||e.getExtension(c+"pvrtc"),this.compression.S3TC=e.getExtension(u+"s3tc")||e.getExtension(c+"s3tc"),this.supportedExtensions=l,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(s.redGL,s.greenGL,s.blueGL,s.alphaGL);for(var f=0;f0&&n>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==n}a&&(this.flush(),r.scissor(t,s-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},rebindPipeline:function(t){var e=this.gl;e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),this.hasActiveStencilMask()?e.clear(e.DEPTH_BUFFER_BIT):(e.disable(e.STENCIL_TEST),e.clear(e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)),e.viewport(0,0,this.width,this.height),this.setBlendMode(0,!0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.blankTexture.glTexture),this.currentActiveTextureUnit=0,this.currentTextures[0]=this.blankTexture.glTexture,this.currentPipeline=t,this.currentPipeline.bind(),this.currentPipeline.onBind()},clearPipeline:function(){this.flush(),this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.setBlendMode(0,!0)},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(n.equation),n.func.length>2?i.blendFuncSeparate(n.func[0],n.func[1],n.func[2],n.func[3]):i.blendFunc(n.func[0],n.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e,i){void 0===i&&(i=!0);var n=this.gl;return t!==this.currentTextures[e]&&(i&&this.flush(),this.currentActiveTextureUnit!==e&&(n.activeTexture(n.TEXTURE0+e),this.currentActiveTextureUnit=e),n.bindTexture(n.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.width,s=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(n=t.renderTexture.width,s=t.renderTexture.height):this.flush(),i.bindFramebuffer(i.FRAMEBUFFER,t),i.viewport(0,0,n,s),e&&(t?(this.drawingBufferHeight=s,this.pushScissor(0,0,n,s)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,r=s.NEAREST,a=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,h(e,i)&&(a=s.REPEAT),n===o.ScaleModes.LINEAR&&this.config.antialias&&(r=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,r,r,a,a,s.RGBA,t):this.createTexture2D(0,r,r,a,a,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&c(this.nativeTextures,e),this.gl.deleteTexture(t),this.currentTextures[0]!==t||this.game.pendingDestroy||this.setBlankTexture(!0),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,r=t._ch,o=this.pipelines.TextureTintPipeline,a=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-r),this.setFramebuffer(t.framebuffer);var h=this.gl;h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT),o.projOrtho(e,n+e,i,r+i,-1e3,1e3),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n+e,r+i,p.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL),t.emit(s.PRE_RENDER,t)}else this.pushScissor(e,i,n,r),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n,r,p.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,p.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,p.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit(s.POST_RENDER,t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=p.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera))},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.pipelines;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var i=this.config.backgroundColor;t.clearColor(i.redGL,i.greenGL,i.blueGL,i.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}for(var n in t.enable(t.SCISSOR_TEST),e)e[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,r=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);if(this.preRenderCamera(n),0===r)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(n);this.currentType="";for(var l=this.currentMask,u=0;u>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){t.exports="changedata"},function(t,e){t.exports="changedata-"},function(t,e){t.exports="removedata"},function(t,e){t.exports="setdata"},function(t,e){t.exports="destroy"},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"alpha",e,i,s,r)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"x",e,i,s,r)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"x",e,s,o,a),n(t,"y",i,r,o,a)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"y",e,i,s,r)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=0;o0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.001&&(e.zoom=.001))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={Camera:i(271),CameraManager:i(658),Effects:i(279),Events:i(49)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(24),s=i(0),r=i(49),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed=1?1:1/e*(1+(e*t|0))}},function(t,e,i){var n=i(24),s=i(0),r=i(49),o=i(3),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=s,this.camera.emit(r.SHAKE_START,this.camera,this,t,e),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed0&&(o.preRender(1),t.render(n,e,i,o))}},resetAll:function(){for(var t=0;t1)for(var i=1;i=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){var n=i(117),s={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(s.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(s.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(s.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(s.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(s.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(s.webm=!0),""!==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 i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e){var i={h264Video:!1,hlsVideo:!1,mp4Video:!1,oggVideo:!1,vp9Video:!1,webmVideo:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.oggVideo=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264Video=!0,i.mp4Video=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webmVideo=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9Video=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hlsVideo=!0))}catch(t){}return i}()},function(t,e){var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){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;tMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=i(296);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){var n=i(22);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e?t:(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e1?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[i1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(156);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){t.exports={GetNext:i(305),IsSize:i(118),IsValue:i(710)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){t.exports={Ceil:i(306),Floor:i(91),To:i(712)}},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){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;i1?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,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=[],o=0;o0&&t<=e*i&&(r=t>e-1?t-(o=Math.floor(t/e))*e:t,s.set(r,o)),s}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){var n=i(171),s=i(313),r=i(314),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e){t.exports="addtexture"},function(t,e){t.exports="onerror"},function(t,e){t.exports="onload"},function(t,e){t.exports="ready"},function(t,e){t.exports="removetexture"},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," float alpha = mainColor.a;",""," if (!uInvertMaskAlpha)"," {"," alpha *= (maskColor.a);"," }"," else"," {"," alpha *= (1.0 - maskColor.a);"," }",""," gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_FORWARD_DIFFUSE_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);"," vec4 color = texture;",""," if (outTintEffect == 0.0)"," {"," // Multiply texture tint"," color = texture * texel;"," }"," else if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);"," color.a = texture.a * texel.a;"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform mat4 uModelMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}","",""].join("\n")},function(t,e,i){t.exports={GenerateTexture:i(321),Palettes:i(743)}},function(t,e,i){t.exports={ARNE16:i(322),C64:i(744),CGA:i(745),JMP:i(746),MSX:i(747)}},function(t,e){t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},function(t,e){t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},function(t,e,i){t.exports={Path:i(749),CubicBezier:i(323),Curve:i(80),Ellipse:i(324),Line:i(325),QuadraticBezier:i(326),Spline:i(327)}},function(t,e,i){var n=i(0),s=i(323),r=i(324),o=i(6),a=i(325),h=i(750),l=i(326),u=i(11),c=i(327),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(r,o),l=new d(t,e)),this.add(new s(u,a,h,l))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new l(o,s,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e,i){var n=i(33),s=i(331);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=s(l,h,t+1/3),o=s(l,h,t),a=s(l,h,t-1/3)}return(new n).setGLTo(r,o,a,1)}},function(t,e,i){var n=i(162);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(n(s/359,t,e));return i}},function(t,e,i){var n=i(115),s=function(t,e,i,s,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:n(t,s,l),g:n(e,r,l),b:n(i,o,l)}};t.exports={RGBWithRGB:s,ColorWithRGB:function(t,e,i,n,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),s(t.r,t.g,t.b,e,i,n,r,o)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),s(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(169),s=i(33);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var n=i(330);t.exports=function(t,e,i,s,r){return void 0===s&&(s=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+n(s)+n(t)+n(e)+n(i)}},function(t,e,i){t.exports={BitmapMask:i(256),GeometryMask:i(257)}},function(t,e,i){var n={AddToDOM:i(120),DOMContentLoaded:i(332),GetScreenOrientation:i(333),GetTarget:i(338),ParseXML:i(339),RemoveFromDOM:i(175),RequestAnimationFrame:i(319)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(784)}},function(t,e,i){var n=i(0),s=i(10),r=i(19),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){var n=i(120),s=i(267),r=i(270),o=i(25),a=i(0),h=i(292),l=i(786),u=i(315),c=i(110),d=i(317),f=i(293),p=i(332),g=i(10),v=i(18),m=i(340),y=i(19),x=i(345),T=i(346),w=i(348),E=i(119),_=i(351),b=i(318),A=i(320),S=i(355),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new _(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=S.create(this),this.loop=new b(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(E.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(v.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(v.POST_RENDER,n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),i.emit(v.PRE_RENDER),i.emit(v.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},function(t,e,i){var n=i(120);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,n(i,e.parent)}}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},n=document.createElement("div");return n.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(n),i.w=90===e?n.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:n.offsetHeight,document.documentElement.removeChild(n),n=null,90!==Math.abs(window.orientation)?i.h:i.w}},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){var n=i(2),s=i(178);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=n(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(s(e+"Physics")),i)for(var o in i)o=s(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},function(t,e,i){var n=i(2);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){t.exports={game:"game",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s,r=i.getElementsByTagName("SubTexture"),o=0;og||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,m=f,y=0,x=0,T=0;Tr&&(y=w-r),E>o&&(x=E-o),t.add(T,e,i+v,s+m,h-y,l-x),(v+=h+p)+h>r&&(v=f,m+=l+p)}return t}},function(t,e,i){var n=i(2);t.exports=function(t,e,i){var s=n(i,"frameWidth",null),r=n(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=n(i,"startFrame",0),l=n(i,"endFrame",-1),u=n(i,"margin",0),c=n(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,v=e.realWidth,m=e.realHeight,y=Math.floor((v-u+c)/(s+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,E=s-w,_=s-(v-p-w),b=e.y,A=r-b,S=r-(m-g-b);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,M=u,O=0,P=e.sourceIndex,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 o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0){var o=n-t.length;if(o<=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 a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-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&&i0){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&&it.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){var n=i(67);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 o=i-e,a=t.splice(e,o);if(s)for(var h=0;h0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){var n=i(67);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 o=s;o-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=this._list,n=i.length,s=0;sv&&(r=v),o>m&&(o=m);var P=v+g.xAdvance,R=m+u;aA&&(A=C),CA&&(A=C),C0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,m=p.cutY,y=g.width,x=g.height,T=e._isTinted&&e.tintFill,w=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),E=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),_=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),b=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var A,S,C=0,M=0,O=0,P=0,R=e.letterSpacing,L=0,D=0,F=0,k=0,I=e.scrollX,B=e.scrollY,Y=e.fontData,N=Y.chars,X=Y.lineHeight,z=e.fontSize/Y.size,U=0,G=e._align,W=0,H=0;e.getTextBounds(!1);var V=e._bounds.lines;1===G?H=(V.longest-V.lengths[0])/2:2===G&&(H=V.longest-V.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,Z=0;Z0&&e.cropHeight>0&&(h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var F=0;F0&&(N=N%E-E):N>E?N=E:N<0&&(N=E+N%E),null===S&&(S=new o(k+Math.cos(Y)*B,I+Math.sin(Y)*B,v),_.push(S),F+=.01);F<1+z;)w=N*F+Y,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,S.points.push(new r(x,T,v)),F+=.01;w=N+Y,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,S.points.push(new r(x,T,v));break;case n.FILL_RECT:u.setTexture2D(M),u.batchFillRect(p[++O],p[++O],p[++O],p[++O],f,c);break;case n.FILL_TRIANGLE:u.setTexture2D(M),u.batchFillTriangle(p[++O],p[++O],p[++O],p[++O],p[++O],p[++O],f,c);break;case n.STROKE_TRIANGLE:u.setTexture2D(M),u.batchStrokeTriangle(p[++O],p[++O],p[++O],p[++O],p[++O],p[++O],v,f,c);break;case n.LINE_TO:null!==S?S.points.push(new r(p[++O],p[++O],v)):(S=new o(p[++O],p[++O],v),_.push(S));break;case n.MOVE_TO:S=new o(p[++O],p[++O],v),_.push(S);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:k=p[++O],I=p[++O],f.translate(k,I);break;case n.SCALE:k=p[++O],I=p[++O],f.scale(k,I);break;case n.ROTATE:f.rotate(p[++O]);break;case n.SET_TEXTURE:var U=p[++O],G=p[++O];u.currentFrame=U,u.setTexture2D(U.glTexture,0),u.tintEffect=G,M=U.glTexture;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,u.tintEffect=2,M=t.blankTexture.glTexture}}}},function(t,e,i){var n=i(1),s=i(1);n=i(931),s=i(932),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(1),s=i(1);n=i(934),s=i(935),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){t.exports={GravityWell:i(375),Particle:i(376),ParticleEmitter:i(377),ParticleEmitterManager:i(190),Zones:i(941)}},function(t,e,i){var n=i(0),s=i(307),r=i(82),o=i(2),a=i(57),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&(this.has(t,"random")||this.hasBoth(t,"start","end")||this.hasBoth(t,"min","max"))){this.start=this.has(t,"start")?t.start:t.min,this.end=this.has(t,"end")?t.end:t.max;var i=this.hasBoth(t,"min","max")||!!t.random;if(i){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}if(this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){var n=i(1),s=i(1);n=i(939),s=i(940),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=e.emitters.list,a=o.length;if(0!==a){var h=this.pipeline,l=h._tempMatrix1.copyFrom(s.matrix),u=h._tempMatrix2,c=h._tempMatrix3,d=h._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);l.multiply(d),t.setPipeline(h);var f=s.roundPixels,p=e.defaultFrame.glTexture,g=n.getTintAppendFloatAlphaAndSwap;h.setTexture2D(p,0);for(var v=0;v?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(5);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,m={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},y=0,x=0;x0&&r.maxLines1&&(d+=f*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(1),s=i(1);n=i(950),s=i(951),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){if(0!==e.width&&0!==e.height){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a/e.style.resolution,h/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r)}}},function(t,e){t.exports=function(t,e,i,n,s){0!==e.width&&0!==e.height&&t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(0),s=i(14),r=i(5),o=i(953),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this._font,this.setStyle(e,!1,!0);var i=r(e,"metrics",!1);this.metrics=i?{ascent:r(i,"ascent",0),descent:r(i,"descent",0),fontSize:r(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?r(t,a[n][0],o):s(t,a[n][0],o)}var h=r(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=r(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,n="",s="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),n=r(t,"fontSize","16px"),s=r(t,"fontStyle","");else{var o=t.split(" "),a=0;s=o.length>2?o[a++]:"",n=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&n===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=n,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e,i){var n=i(25);t.exports=function(t){var e=n.create(this),i=e.getContext("2d");t.syncFont(e,i);var s=Math.ceil(i.measureText(t.testString).width*t.baselineX),r=s,o=2*r;r=r*t.baselineY|0,e.width=s,e.height=o,i.fillStyle="#f00",i.fillRect(0,0,s,o),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,r);var a={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,s,o))return a.ascent=r,a.descent=r+6,a.fontSize=a.ascent+a.descent,n.remove(e),a;var h,l,u=i.getImageData(0,0,s,o).data,c=u.length,d=4*s,f=0,p=!1;for(h=0;hr;h--){for(l=0;l0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0){var R=o.strokeTint,L=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(R.TL=L,R.TR=L,R.BL=L,R.BR=L,S=1;S0)for(n(h,e),S=0;S0)for(n(h,e,e.altFillColor,e.altFillAlpha*c),S=0;S0){for(s(h,e,e.outlineFillColor,e.outlineFillAlpha*c),A=1;Ao.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var m=o.vertexViewF32,y=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,T=0,w=e.tintFill,E=0;E0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(78);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e,i){var n=i(46);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(46);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e,i){var n=i(11);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(93);n.Area=i(1054),n.Circumference=i(373),n.CircumferencePoint=i(189),n.Clone=i(1055),n.Contains=i(94),n.ContainsPoint=i(1056),n.ContainsRect=i(1057),n.CopyFrom=i(1058),n.Equals=i(1059),n.GetBounds=i(1060),n.GetPoint=i(371),n.GetPoints=i(372),n.Offset=i(1061),n.OffsetPoint=i(1062),n.Random=i(153),t.exports=n},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(93);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(94);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(94);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e,i){var n=i(11);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(4),s=i(406);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0==(a=(o=-2*f)*o-4*(r=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new n(h,-o/(2*r))):a>0&&(i.push(new n(h,(-o+Math.sqrt(a))/(2*r))),i.push(new n(h,(-o-Math.sqrt(a))/(2*r))));else{var g=(l-d)/(u-f),v=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0==(a=(o=2*u*g-2*v*g-2*l)*o-4*(r=g*g+1)*(l*l+u*u+v*v-c*c-2*u*v))?(h=-o/(2*r),i.push(new n(h,v-h*g))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)),h=(-o-Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)))}}return i}},function(t,e,i){var n=i(198),s=i(407);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();n(r,t,i),n(o,t,i),n(a,t,i),n(h,t,i)}return i}},function(t,e,i){var n=i(11),s=i(131);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e,i){var n=i(200),s=i(131);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();n(r,e,i),n(o,e,i),n(a,e,i),n(h,e,i)}return i}},function(t,e,i){var n=i(409),s=i(200);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(r,t,i),s(o,t,i),s(a,t,i)}return i}},function(t,e,i){var n=i(198),s=i(411);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();n(r,e,i),n(o,e,i),n(a,e,i)}return i}},function(t,e,i){var n=i(414),s=i(412);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(t,r,i),s(t,o,i),s(t,a,i)}return i}},function(t,e,i){var n=i(416);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||si&&(i=h.x),h.xr&&(r=h.y),h.yn(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var n=i(163);t.exports=function(t,e,i){var s=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),n(t,s,r)}},function(t,e,i){var n=i(11),s=i(131);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){var n=i(4),s=i(35);t.exports=function(t,e,i){void 0===i&&(i=new n),e=s(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)-1&&(s.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,n=this.manager,s=n.pointers,r=n.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,n=!1,s=0;s0&&(n=!0)}return this._updatedThisFrame=!0,n},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,this.manager.resetCursor(i),t.input=null;var n=this._draggable.indexOf(t);return n>-1&&this._draggable.splice(n,1),(n=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(n,1),(n=this._over[0].indexOf(t))>-1&&this._over[0].splice(n,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=s?i=!0:n>0&&e>=t.downTime+n&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold||0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],n=0;n0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.x-a.dragStartXGlobal,c=t.y-a.dragStartYGlobal,f=o.getParentRotation(),p=u*Math.cos(f)+c*Math.sin(f),g=c*Math.cos(f)-u*Math.sin(f);s=p+a.dragStartX,r=g+a.dragStartY}else s=t.x-a.dragX,r=t.y-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,s,r),this.emit(d.DRAG,t,o,s,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var s=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e);for(var h=0;h0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,o=!1,h=!1,l=!0;if(m(e)){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),n=p(u,"draggable",!1),s=p(u,"dropZone",!1),r=p(u,"cursor",!1),o=p(u,"useHandCursor",!1),h=p(u,"pixelPerfect",!1);var c=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d=e}}},function(t,e,i){t.exports={Events:i(133),KeyboardManager:i(341),KeyboardPlugin:i(1175),Key:i(429),KeyCodes:i(122),KeyCombo:i(430),JustDown:i(1180),JustUp:i(1181),DownDuration:i(1182),UpDuration:i(1183)}},function(t,e){t.exports="keydown"},function(t,e){t.exports="keyup"},function(t,e){t.exports="keycombomatch"},function(t,e){t.exports="down"},function(t,e){t.exports="keydown-"},function(t,e){t.exports="keyup-"},function(t,e){t.exports="up"},function(t,e,i){var n=i(0),s=i(10),r=i(133),o=i(18),a=i(5),h=i(54),l=i(132),u=i(429),c=i(122),d=i(430),f=i(1179),p=i(91),g=new n({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.useQueue?this.sceneInputPlugin.pluginEvents.on(h.UPDATE,this.update,this):this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n={};if("string"==typeof t){t=t.split(",");for(var s=0;s-1?n[s]=t:n[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),n[t]||(n[t]=new u(this,t),e&&this.addCapture(t),n[t].setEmitOnRepeat(i)),n[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,n=this.keys;if(t instanceof u){var s=n.indexOf(t);s>-1&&(i=this.keys[s],this.keys[s]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(i=n[t],n[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},createCombo:function(t,e){return new d(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=p(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e,i){var n=i(122),s={};for(var r in n)s[n[r]]=r;t.exports=s},function(t,e){t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},function(t,e){t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.sizei&&(n=t,i=e)}),n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,n,s,r){return u(this.world,t,e,i,n,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(d.UPDATE,this.world.update,this.world),t.off(d.POST_UPDATE,this.world.postUpdate,this.world),t.off(d.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(d.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){var i={enableBody:function(t,e,i,n,s){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),s&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=i},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){var i={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=i},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){t.exports=function(t,e,i,n,s,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+n,l.maxY=i+s,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+n,bottom:i+s,isCircle:!1},d=t.intersects;u.iterate(function(t){d(t,c)&&a.push(t)})}return h.concat(a)}},function(t,e){t.exports="collide"},function(t,e){t.exports="overlap"},function(t,e){t.exports="pause"},function(t,e){t.exports="resume"},function(t,e){t.exports="tilecollide"},function(t,e){t.exports="tileoverlap"},function(t,e){t.exports="worldbounds"},function(t,e){t.exports="worldstep"},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e,i){var n=i(1236),s=i(1238),r=i(447);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,f=o.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var v=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&!t.blocked.right&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(1239);t.exports=function(t,e,i,s,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&!t.blocked.up&&c&&t.checkCollision.up?l&&t.y0&&!t.blocked.down&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(443);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e,i){var n=i(444);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},,,,,,,,,,,function(t,e,i){t.exports={BasePlugin:i(452),DefaultPlugins:i(172),PluginCache:i(19),PluginManager:i(345),ScenePlugin:i(1253)}},function(t,e,i){var n=i(452),s=i(0),r=i(20),o=new s({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){}});t.exports=o},function(t,e,i){var n=i(15),s=i(174),r={Center:i(334),Events:i(90),Orientation:i(335),ScaleManager:i(346),ScaleModes:i(336),Zoom:i(337)};r=n(!1,r=n(!1,r=n(!1,r=n(!1,r,s.CENTER),s.ORIENTATION),s.SCALE_MODE),s.ZOOM),t.exports=r},function(t,e,i){var n=i(123),s=i(15),r={Events:i(20),SceneManager:i(348),ScenePlugin:i(1256),Settings:i(350),Systems:i(177)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(24),s=i(0),r=i(20),o=i(2),a=i(19),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var s=o(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=n,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake():this.manager.start(e,o(t,"data")),this.systems.events.emit(r.TRANSITION_OUT,i,n),this.systems.events.on(r.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},function(t,e,i){t.exports={List:i(126),Map:i(158),ProcessQueue:i(445),RTree:i(446),Set:i(106),Size:i(347)}},function(t,e,i){var n=i(15),s=i(1259),r={CanvasTexture:i(352),Events:i(119),FilterMode:s,Frame:i(92),Parsers:i(354),Texture:i(179),TextureManager:i(351),TextureSource:i(353)};r=n(!1,r,s),t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){t.exports={Components:i(137),Parsers:i(1290),Formats:i(30),ImageCollection:i(463),ParseToTilemap:i(218),Tile:i(73),Tilemap:i(472),TilemapCreator:i(1299),TilemapFactory:i(1300),Tileset:i(141),LayerData:i(102),MapData:i(103),ObjectLayer:i(466),DynamicTilemapLayer:i(473),StaticTilemapLayer:i(474)}},function(t,e,i){var n=i(23),s=i(52);t.exports=function(t,e,i,r,o,a,h,l){t<0&&(t=0),e<0&&(e=0),void 0===h&&(h=!0);for(var u=n(t,e,i,r,null,l),c=o-t,d=a-e,f=0;f=0&&p=0&&g=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=y;a--)for(o=v;c[a]&&o=y;a--)for(o=m;c[a]&&o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(23),s=i(52),r=i(72);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=n(e,i,o,a,null,l),d=0;d=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;re)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(72),s=i(52),r=i(214);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,r=t.length;s0&&(t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix);var u=t.currentContext,c=e.gidMap;u.save(),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l),l.copyToContext(u)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,h.copyToContext(u));var d=n.alpha*e.alpha;u.globalAlpha=n.alpha*e.alpha;for(var f=0;f-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t-1&&(e.state=u.REMOVED,s.splice(r,1)):(e.state=u.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t_&&(_=S),E[b][A]=S}}}var C=r?n(r):null;return o?function(t,e,n,s){var r,o=0,a=s%v,h=Math.floor(s/v);if(a>=0&&a=0&&h>2],r+=i[(3&n[o])<<4|n[o+1]>>4],r+=i[(15&n[o+1])<<2|n[o+2]>>6],r+=i[63&n[o+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},function(t,e,i){t.exports={Clone:i(65),Extend:i(15),GetAdvancedValue:i(14),GetFastValue:i(2),GetMinMaxValue:i(1325),GetValue:i(5),HasAll:i(1326),HasAny:i(380),HasValue:i(97),IsPlainObject:i(7),Merge:i(105),MergeRight:i(1327),Pick:i(464),SetValue:i(401)}},function(t,e,i){var n=i(5),s=i(24);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=n(t,e,o);return s(a,i,r)}},function(t,e){t.exports=function(t,e){for(var i=0;i + * @copyright 2019 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 + * + * @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; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -3279,8 +3410,8 @@ module.exports = GetAdvancedValue; */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(17); -var SceneEvents = __webpack_require__(18); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); /** * @classdesc @@ -3423,13 +3554,21 @@ GameObjectCreator.register = function (factoryType, factoryFunction) } }; +GameObjectCreator.remove = function (factoryType) +{ + if (GameObjectCreator.prototype.hasOwnProperty(factoryType)) + { + delete GameObjectCreator.prototype[factoryType]; + } +}; + PluginCache.register('GameObjectCreator', GameObjectCreator, 'make'); module.exports = GameObjectCreator; /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** @@ -3990,10 +4129,10 @@ module.exports = Common; }; })(); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(152))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(153))) /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports) { /** @@ -4202,7 +4341,7 @@ module.exports = PluginCache; /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4217,31 +4356,31 @@ module.exports = PluginCache; module.exports = { - BOOT: __webpack_require__(691), - CREATE: __webpack_require__(692), - DESTROY: __webpack_require__(693), - PAUSE: __webpack_require__(694), - POST_UPDATE: __webpack_require__(695), - PRE_UPDATE: __webpack_require__(696), - READY: __webpack_require__(697), - RENDER: __webpack_require__(698), - RESUME: __webpack_require__(699), - SHUTDOWN: __webpack_require__(700), - SLEEP: __webpack_require__(701), - START: __webpack_require__(702), - TRANSITION_COMPLETE: __webpack_require__(703), - TRANSITION_INIT: __webpack_require__(704), - TRANSITION_OUT: __webpack_require__(705), - TRANSITION_START: __webpack_require__(706), - TRANSITION_WAKE: __webpack_require__(707), - UPDATE: __webpack_require__(708), - WAKE: __webpack_require__(709) + BOOT: __webpack_require__(696), + CREATE: __webpack_require__(697), + DESTROY: __webpack_require__(698), + PAUSE: __webpack_require__(699), + POST_UPDATE: __webpack_require__(700), + PRE_UPDATE: __webpack_require__(701), + READY: __webpack_require__(702), + RENDER: __webpack_require__(703), + RESUME: __webpack_require__(704), + SHUTDOWN: __webpack_require__(705), + SLEEP: __webpack_require__(706), + START: __webpack_require__(707), + TRANSITION_COMPLETE: __webpack_require__(708), + TRANSITION_INIT: __webpack_require__(709), + TRANSITION_OUT: __webpack_require__(710), + TRANSITION_START: __webpack_require__(711), + TRANSITION_WAKE: __webpack_require__(712), + UPDATE: __webpack_require__(713), + WAKE: __webpack_require__(714) }; /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, exports) { /** @@ -4393,7 +4532,79 @@ module.exports = FILE_CONST; /***/ }), -/* 20 */ +/* 21 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + +}; + +module.exports = MATH_CONST; + + +/***/ }), +/* 22 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4402,97 +4613,34 @@ module.exports = FILE_CONST; * @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 - * - * @return {object} The extended object. + * @namespace Phaser.Core.Events */ -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] || {}; +module.exports = { - // skip the boolean and the target - i = 2; - } + BLUR: __webpack_require__(559), + BOOT: __webpack_require__(560), + CONTEXT_LOST: __webpack_require__(561), + CONTEXT_RESTORED: __webpack_require__(562), + DESTROY: __webpack_require__(563), + FOCUS: __webpack_require__(564), + HIDDEN: __webpack_require__(565), + PAUSE: __webpack_require__(566), + POST_RENDER: __webpack_require__(567), + POST_STEP: __webpack_require__(568), + PRE_RENDER: __webpack_require__(569), + PRE_STEP: __webpack_require__(570), + READY: __webpack_require__(571), + RESUME: __webpack_require__(572), + STEP: __webpack_require__(573), + VISIBLE: __webpack_require__(574) - // 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; - /***/ }), -/* 21 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4502,13 +4650,13 @@ module.exports = Extend; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); +var CONST = __webpack_require__(20); var Events = __webpack_require__(86); var GetFastValue = __webpack_require__(1); -var GetURL = __webpack_require__(217); -var MergeXHRSettings = __webpack_require__(218); -var XHRLoader = __webpack_require__(453); -var XHRSettings = __webpack_require__(141); +var GetURL = __webpack_require__(219); +var MergeXHRSettings = __webpack_require__(220); +var XHRLoader = __webpack_require__(456); +var XHRSettings = __webpack_require__(142); /** * @classdesc @@ -5033,7 +5181,7 @@ module.exports = File; /***/ }), -/* 22 */ +/* 24 */ /***/ (function(module, exports) { /** @@ -5063,79 +5211,7 @@ module.exports = Clamp; /***/ }), -/* 23 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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 - -}; - -module.exports = MATH_CONST; - - -/***/ }), -/* 24 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5152,12 +5228,12 @@ var Body = {}; module.exports = Body; -var Vertices = __webpack_require__(32); +var Vertices = __webpack_require__(31); var Vector = __webpack_require__(37); -var Sleeping = __webpack_require__(110); -var Common = __webpack_require__(16); +var Sleeping = __webpack_require__(111); +var Common = __webpack_require__(17); var Bounds = __webpack_require__(38); -var Axes = __webpack_require__(224); +var Axes = __webpack_require__(226); (function() { @@ -6351,7 +6427,7 @@ var Axes = __webpack_require__(224); /***/ }), -/* 25 */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -6435,7 +6511,7 @@ module.exports = GetTilesWithin; /***/ }), -/* 26 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -6444,8 +6520,8 @@ module.exports = GetTilesWithin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(28); -var Smoothing = __webpack_require__(121); +var CONST = __webpack_require__(34); +var Smoothing = __webpack_require__(122); // The pool into which the canvas elements are placed. var pool = []; @@ -6696,7 +6772,7 @@ module.exports = CanvasPool(); /***/ }), -/* 27 */ +/* 28 */ /***/ (function(module, exports) { /** @@ -6780,144 +6856,6 @@ var SetTransform = function (renderer, ctx, src, camera, parentMatrix) module.exports = SetTransform; -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 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.18.1', - - BlendModes: __webpack_require__(42), - - ScaleModes: __webpack_require__(94), - - /** - * AUTO Detect Renderer. - * - * @name Phaser.AUTO - * @const - * @type {integer} - * @since 3.0.0 - */ - AUTO: 0, - - /** - * Canvas Renderer. - * - * @name Phaser.CANVAS - * @const - * @type {integer} - * @since 3.0.0 - */ - CANVAS: 1, - - /** - * WebGL Renderer. - * - * @name Phaser.WEBGL - * @const - * @type {integer} - * @since 3.0.0 - */ - WEBGL: 2, - - /** - * Headless Renderer. - * - * @name Phaser.HEADLESS - * @const - * @type {integer} - * @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 {integer} - * @since 3.0.0 - */ - FOREVER: -1, - - /** - * Direction constant. - * - * @name Phaser.NONE - * @const - * @type {integer} - * @since 3.0.0 - */ - NONE: 4, - - /** - * Direction constant. - * - * @name Phaser.UP - * @const - * @type {integer} - * @since 3.0.0 - */ - UP: 5, - - /** - * Direction constant. - * - * @name Phaser.DOWN - * @const - * @type {integer} - * @since 3.0.0 - */ - DOWN: 6, - - /** - * Direction constant. - * - * @name Phaser.LEFT - * @const - * @type {integer} - * @since 3.0.0 - */ - LEFT: 7, - - /** - * Direction constant. - * - * @name Phaser.RIGHT - * @const - * @type {integer} - * @since 3.0.0 - */ - RIGHT: 8 - -}; - -module.exports = CONST; - - /***/ }), /* 29 */ /***/ (function(module, exports) { @@ -6989,40 +6927,6 @@ module.exports = PropertyValueSet; /* 30 */ /***/ (function(module, exports, __webpack_require__) { -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Core.Events - */ - -module.exports = { - - BLUR: __webpack_require__(610), - BOOT: __webpack_require__(611), - DESTROY: __webpack_require__(612), - FOCUS: __webpack_require__(613), - HIDDEN: __webpack_require__(614), - PAUSE: __webpack_require__(615), - POST_RENDER: __webpack_require__(616), - POST_STEP: __webpack_require__(617), - PRE_RENDER: __webpack_require__(618), - PRE_STEP: __webpack_require__(619), - READY: __webpack_require__(620), - RESUME: __webpack_require__(621), - STEP: __webpack_require__(622), - VISIBLE: __webpack_require__(623) - -}; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -7031,7 +6935,7 @@ module.exports = { var BlendModes = __webpack_require__(42); var GetAdvancedValue = __webpack_require__(14); -var ScaleModes = __webpack_require__(94); +var ScaleModes = __webpack_require__(96); /** * Builds a Game Object using the provided configuration object. @@ -7153,7 +7057,7 @@ module.exports = BuildGameObject; /***/ }), -/* 32 */ +/* 31 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -7171,7 +7075,7 @@ var Vertices = {}; module.exports = Vertices; var Vector = __webpack_require__(37); -var Common = __webpack_require__(16); +var Common = __webpack_require__(17); (function() { @@ -7613,7 +7517,7 @@ var Common = __webpack_require__(16); /***/ }), -/* 33 */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -7625,7 +7529,7 @@ var Common = __webpack_require__(16); var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var Line = __webpack_require__(59); +var Line = __webpack_require__(60); /** * @classdesc @@ -7913,7 +7817,7 @@ module.exports = Shape; /***/ }), -/* 34 */ +/* 33 */ /***/ (function(module, exports) { /** @@ -7967,6 +7871,144 @@ module.exports = { }; +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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.19.0', + + BlendModes: __webpack_require__(42), + + ScaleModes: __webpack_require__(96), + + /** + * AUTO Detect Renderer. + * + * @name Phaser.AUTO + * @const + * @type {integer} + * @since 3.0.0 + */ + AUTO: 0, + + /** + * Canvas Renderer. + * + * @name Phaser.CANVAS + * @const + * @type {integer} + * @since 3.0.0 + */ + CANVAS: 1, + + /** + * WebGL Renderer. + * + * @name Phaser.WEBGL + * @const + * @type {integer} + * @since 3.0.0 + */ + WEBGL: 2, + + /** + * Headless Renderer. + * + * @name Phaser.HEADLESS + * @const + * @type {integer} + * @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 {integer} + * @since 3.0.0 + */ + FOREVER: -1, + + /** + * Direction constant. + * + * @name Phaser.NONE + * @const + * @type {integer} + * @since 3.0.0 + */ + NONE: 4, + + /** + * Direction constant. + * + * @name Phaser.UP + * @const + * @type {integer} + * @since 3.0.0 + */ + UP: 5, + + /** + * Direction constant. + * + * @name Phaser.DOWN + * @const + * @type {integer} + * @since 3.0.0 + */ + DOWN: 6, + + /** + * Direction constant. + * + * @name Phaser.LEFT + * @const + * @type {integer} + * @since 3.0.0 + */ + LEFT: 7, + + /** + * Direction constant. + * + * @name Phaser.RIGHT + * @const + * @type {integer} + * @since 3.0.0 + */ + RIGHT: 8 + +}; + +module.exports = CONST; + + /***/ }), /* 35 */ /***/ (function(module, exports, __webpack_require__) { @@ -7978,6 +8020,7 @@ module.exports = { */ var Class = __webpack_require__(0); +var MATH_CONST = __webpack_require__(21); var Vector2 = __webpack_require__(3); /** @@ -7998,8 +8041,8 @@ var Vector2 = __webpack_require__(3); * @since 3.0.0 * * @param {number} [a=1] - The Scale X value. - * @param {number} [b=0] - The Shear Y value. - * @param {number} [c=0] - The Shear 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. @@ -8064,7 +8107,7 @@ var TransformMatrix = new Class({ }, /** - * The Shear Y value. + * The Skew Y value. * * @name Phaser.GameObjects.Components.TransformMatrix#b * @type {number} @@ -8085,7 +8128,7 @@ var TransformMatrix = new Class({ }, /** - * The Shear X value. + * The Skew X value. * * @name Phaser.GameObjects.Components.TransformMatrix#c * @type {number} @@ -8211,7 +8254,7 @@ var TransformMatrix = new Class({ }, /** - * The rotation of the Matrix. + * The rotation of the Matrix. Value is in radians. * * @name Phaser.GameObjects.Components.TransformMatrix#rotation * @type {number} @@ -8222,13 +8265,53 @@ var TransformMatrix = new Class({ get: function () { - return Math.acos(this.a / this.scaleX) * (Math.atan(-this.c / this.a) < 0 ? -1 : 1); + return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1); } }, /** - * The horizontal scale of the Matrix. + * 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} @@ -8239,13 +8322,13 @@ var TransformMatrix = new Class({ get: function () { - return Math.sqrt((this.a * this.a) + (this.c * this.c)); + return Math.sqrt((this.a * this.a) + (this.b * this.b)); } }, /** - * The vertical scale of the Matrix. + * The decomposed vertical scale of the Matrix. This value is always positive. * * @name Phaser.GameObjects.Components.TransformMatrix#scaleY * @type {number} @@ -8256,7 +8339,7 @@ var TransformMatrix = new Class({ get: function () { - return Math.sqrt((this.b * this.b) + (this.d * this.d)); + return Math.sqrt((this.c * this.c) + (this.d * this.d)); } }, @@ -8905,10 +8988,10 @@ module.exports = TransformMatrix; */ var Class = __webpack_require__(0); -var GetColor = __webpack_require__(171); -var GetColor32 = __webpack_require__(286); -var HSVToRGB = __webpack_require__(172); -var RGBToHSV = __webpack_require__(287); +var GetColor = __webpack_require__(172); +var GetColor32 = __webpack_require__(289); +var HSVToRGB = __webpack_require__(173); +var RGBToHSV = __webpack_require__(290); /** * @namespace Phaser.Display.Color @@ -10204,7 +10287,7 @@ module.exports = PropertyValueInc; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); +var CONST = __webpack_require__(21); /** * Convert the given angle from degrees, to the equivalent angle in radians. @@ -10889,6 +10972,86 @@ module.exports = Contains; /* 52 */ /***/ (function(module, exports) { +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @since 3.19.0 + */ + CIRCLE: 0, + + /** + * An Ellipse Geometry object type. + * + * @name Phaser.Geom.ELLIPSE + * @type {integer} + * @since 3.19.0 + */ + ELLIPSE: 1, + + /** + * A Line Geometry object type. + * + * @name Phaser.Geom.LINE + * @type {integer} + * @since 3.19.0 + */ + LINE: 2, + + /** + * A Point Geometry object type. + * + * @name Phaser.Geom.POINT + * @type {integer} + * @since 3.19.0 + */ + POINT: 3, + + /** + * A Polygon Geometry object type. + * + * @name Phaser.Geom.POLYGON + * @type {integer} + * @since 3.19.0 + */ + POLYGON: 4, + + /** + * A Rectangle Geometry object type. + * + * @name Phaser.Geom.RECTANGLE + * @type {integer} + * @since 3.19.0 + */ + RECTANGLE: 5, + + /** + * A Triangle Geometry object type. + * + * @name Phaser.Geom.TRIANGLE + * @type {integer} + * @since 3.19.0 + */ + TRIANGLE: 6 + +}; + +module.exports = GEOM_CONST; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -10921,7 +11084,7 @@ module.exports = Contains; /***/ }), -/* 53 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10936,27 +11099,27 @@ module.exports = Contains; module.exports = { - DESTROY: __webpack_require__(632), - FADE_IN_COMPLETE: __webpack_require__(633), - FADE_IN_START: __webpack_require__(634), - FADE_OUT_COMPLETE: __webpack_require__(635), - FADE_OUT_START: __webpack_require__(636), - FLASH_COMPLETE: __webpack_require__(637), - FLASH_START: __webpack_require__(638), - PAN_COMPLETE: __webpack_require__(639), - PAN_START: __webpack_require__(640), - POST_RENDER: __webpack_require__(641), - PRE_RENDER: __webpack_require__(642), - SHAKE_COMPLETE: __webpack_require__(643), - SHAKE_START: __webpack_require__(644), - ZOOM_COMPLETE: __webpack_require__(645), - ZOOM_START: __webpack_require__(646) + DESTROY: __webpack_require__(637), + FADE_IN_COMPLETE: __webpack_require__(638), + FADE_IN_START: __webpack_require__(639), + FADE_OUT_COMPLETE: __webpack_require__(640), + FADE_OUT_START: __webpack_require__(641), + FLASH_COMPLETE: __webpack_require__(642), + FLASH_START: __webpack_require__(643), + PAN_COMPLETE: __webpack_require__(644), + PAN_START: __webpack_require__(645), + POST_RENDER: __webpack_require__(646), + PRE_RENDER: __webpack_require__(647), + SHAKE_COMPLETE: __webpack_require__(648), + SHAKE_START: __webpack_require__(649), + ZOOM_COMPLETE: __webpack_require__(650), + ZOOM_START: __webpack_require__(651) }; /***/ }), -/* 54 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10971,58 +11134,58 @@ module.exports = { module.exports = { - BOOT: __webpack_require__(812), - DESTROY: __webpack_require__(813), - DRAG_END: __webpack_require__(814), - DRAG_ENTER: __webpack_require__(815), - DRAG: __webpack_require__(816), - DRAG_LEAVE: __webpack_require__(817), - DRAG_OVER: __webpack_require__(818), - DRAG_START: __webpack_require__(819), - DROP: __webpack_require__(820), - GAME_OUT: __webpack_require__(821), - GAME_OVER: __webpack_require__(822), - GAMEOBJECT_DOWN: __webpack_require__(823), - GAMEOBJECT_DRAG_END: __webpack_require__(824), - GAMEOBJECT_DRAG_ENTER: __webpack_require__(825), - GAMEOBJECT_DRAG: __webpack_require__(826), - GAMEOBJECT_DRAG_LEAVE: __webpack_require__(827), - GAMEOBJECT_DRAG_OVER: __webpack_require__(828), - GAMEOBJECT_DRAG_START: __webpack_require__(829), - GAMEOBJECT_DROP: __webpack_require__(830), - GAMEOBJECT_MOVE: __webpack_require__(831), - GAMEOBJECT_OUT: __webpack_require__(832), - GAMEOBJECT_OVER: __webpack_require__(833), - GAMEOBJECT_POINTER_DOWN: __webpack_require__(834), - GAMEOBJECT_POINTER_MOVE: __webpack_require__(835), - GAMEOBJECT_POINTER_OUT: __webpack_require__(836), - GAMEOBJECT_POINTER_OVER: __webpack_require__(837), - GAMEOBJECT_POINTER_UP: __webpack_require__(838), - GAMEOBJECT_POINTER_WHEEL: __webpack_require__(839), - GAMEOBJECT_UP: __webpack_require__(840), - GAMEOBJECT_WHEEL: __webpack_require__(841), - MANAGER_BOOT: __webpack_require__(842), - MANAGER_PROCESS: __webpack_require__(843), - MANAGER_UPDATE: __webpack_require__(844), - POINTER_DOWN: __webpack_require__(845), - POINTER_DOWN_OUTSIDE: __webpack_require__(846), - POINTER_MOVE: __webpack_require__(847), - POINTER_OUT: __webpack_require__(848), - POINTER_OVER: __webpack_require__(849), - POINTER_UP: __webpack_require__(850), - POINTER_UP_OUTSIDE: __webpack_require__(851), - POINTER_WHEEL: __webpack_require__(852), - POINTERLOCK_CHANGE: __webpack_require__(853), - PRE_UPDATE: __webpack_require__(854), - SHUTDOWN: __webpack_require__(855), - START: __webpack_require__(856), - UPDATE: __webpack_require__(857) + BOOT: __webpack_require__(818), + DESTROY: __webpack_require__(819), + DRAG_END: __webpack_require__(820), + DRAG_ENTER: __webpack_require__(821), + DRAG: __webpack_require__(822), + DRAG_LEAVE: __webpack_require__(823), + DRAG_OVER: __webpack_require__(824), + DRAG_START: __webpack_require__(825), + DROP: __webpack_require__(826), + GAME_OUT: __webpack_require__(827), + GAME_OVER: __webpack_require__(828), + GAMEOBJECT_DOWN: __webpack_require__(829), + GAMEOBJECT_DRAG_END: __webpack_require__(830), + GAMEOBJECT_DRAG_ENTER: __webpack_require__(831), + GAMEOBJECT_DRAG: __webpack_require__(832), + GAMEOBJECT_DRAG_LEAVE: __webpack_require__(833), + GAMEOBJECT_DRAG_OVER: __webpack_require__(834), + GAMEOBJECT_DRAG_START: __webpack_require__(835), + GAMEOBJECT_DROP: __webpack_require__(836), + GAMEOBJECT_MOVE: __webpack_require__(837), + GAMEOBJECT_OUT: __webpack_require__(838), + GAMEOBJECT_OVER: __webpack_require__(839), + GAMEOBJECT_POINTER_DOWN: __webpack_require__(840), + GAMEOBJECT_POINTER_MOVE: __webpack_require__(841), + GAMEOBJECT_POINTER_OUT: __webpack_require__(842), + GAMEOBJECT_POINTER_OVER: __webpack_require__(843), + GAMEOBJECT_POINTER_UP: __webpack_require__(844), + GAMEOBJECT_POINTER_WHEEL: __webpack_require__(845), + GAMEOBJECT_UP: __webpack_require__(846), + GAMEOBJECT_WHEEL: __webpack_require__(847), + MANAGER_BOOT: __webpack_require__(848), + MANAGER_PROCESS: __webpack_require__(849), + MANAGER_UPDATE: __webpack_require__(850), + POINTER_DOWN: __webpack_require__(851), + POINTER_DOWN_OUTSIDE: __webpack_require__(852), + POINTER_MOVE: __webpack_require__(853), + POINTER_OUT: __webpack_require__(854), + POINTER_OVER: __webpack_require__(855), + POINTER_UP: __webpack_require__(856), + POINTER_UP_OUTSIDE: __webpack_require__(857), + POINTER_WHEEL: __webpack_require__(858), + POINTERLOCK_CHANGE: __webpack_require__(859), + PRE_UPDATE: __webpack_require__(860), + SHUTDOWN: __webpack_require__(861), + START: __webpack_require__(862), + UPDATE: __webpack_require__(863) }; /***/ }), -/* 55 */ +/* 56 */ /***/ (function(module, exports) { /** @@ -11060,7 +11223,7 @@ module.exports = LineStyleCanvas; /***/ }), -/* 56 */ +/* 57 */ /***/ (function(module, exports) { /** @@ -11189,7 +11352,7 @@ module.exports = CONST; /***/ }), -/* 57 */ +/* 58 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11207,12 +11370,12 @@ var Bodies = {}; module.exports = Bodies; -var Vertices = __webpack_require__(32); -var Common = __webpack_require__(16); -var Body = __webpack_require__(24); +var Vertices = __webpack_require__(31); +var Common = __webpack_require__(17); +var Body = __webpack_require__(25); var Bounds = __webpack_require__(38); var Vector = __webpack_require__(37); -var decomp = __webpack_require__(479); +var decomp = __webpack_require__(482); (function() { @@ -11526,7 +11689,7 @@ var decomp = __webpack_require__(479); /***/ }), -/* 58 */ +/* 59 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11535,8 +11698,8 @@ var decomp = __webpack_require__(479); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(146); -var GetTilesWithin = __webpack_require__(25); +var GetTileAt = __webpack_require__(147); +var GetTilesWithin = __webpack_require__(26); /** * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the @@ -11592,7 +11755,7 @@ module.exports = CalculateFacesWithin; /***/ }), -/* 59 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11602,9 +11765,10 @@ module.exports = CalculateFacesWithin; */ var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(266); -var GetPoints = __webpack_require__(158); -var Random = __webpack_require__(159); +var GetPoint = __webpack_require__(269); +var GetPoints = __webpack_require__(159); +var GEOM_CONST = __webpack_require__(52); +var Random = __webpack_require__(160); var Vector2 = __webpack_require__(3); /** @@ -11632,6 +11796,17 @@ var Line = new Class({ if (x2 === undefined) { x2 = 0; } if (y2 === undefined) { y2 = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.LINE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Line#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.LINE; + /** * The x coordinate of the lines starting point. * @@ -11917,7 +12092,7 @@ module.exports = Line; /***/ }), -/* 60 */ +/* 61 */ /***/ (function(module, exports) { /** @@ -11945,7 +12120,7 @@ module.exports = Length; /***/ }), -/* 61 */ +/* 62 */ /***/ (function(module, exports) { /** @@ -11977,7 +12152,7 @@ module.exports = Wrap; /***/ }), -/* 62 */ +/* 63 */ /***/ (function(module, exports) { /** @@ -12011,7 +12186,7 @@ module.exports = DistanceBetween; /***/ }), -/* 63 */ +/* 64 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12023,7 +12198,7 @@ module.exports = DistanceBetween; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var SpriteRender = __webpack_require__(961); +var SpriteRender = __webpack_require__(966); /** * @classdesc @@ -12189,7 +12364,7 @@ module.exports = Sprite; /***/ }), -/* 64 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12199,8 +12374,8 @@ module.exports = Sprite; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var GetValue = __webpack_require__(5); @@ -12419,7 +12594,7 @@ module.exports = JSONFile; /***/ }), -/* 65 */ +/* 66 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12613,7 +12788,7 @@ module.exports = MultiFile; /***/ }), -/* 66 */ +/* 67 */ /***/ (function(module, exports) { /** @@ -12664,7 +12839,7 @@ module.exports = WorldToTileX; /***/ }), -/* 67 */ +/* 68 */ /***/ (function(module, exports) { /** @@ -12715,7 +12890,7 @@ module.exports = WorldToTileY; /***/ }), -/* 68 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13396,48 +13571,6 @@ earcut.flatten = function (data) { }; -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clone = __webpack_require__(70); - -/** - * Creates a new Object using all values from obj1 and obj2. - * If a value exists in both obj1 and obj2, the value in obj1 is used. - * - * @function Phaser.Utils.Objects.Merge - * @since 3.0.0 - * - * @param {object} obj1 - The first object. - * @param {object} obj2 - The second object. - * - * @return {object} A new object containing the union of obj1's and obj2's properties. - */ -var Merge = function (obj1, obj2) -{ - var clone = Clone(obj1); - - for (var key in obj2) - { - if (!clone.hasOwnProperty(key)) - { - clone[key] = obj2[key]; - } - } - - return clone; -}; - -module.exports = Merge; - - /***/ }), /* 70 */ /***/ (function(module, exports) { @@ -13496,29 +13629,29 @@ module.exports = Clone; module.exports = { - COMPLETE: __webpack_require__(881), - DECODED: __webpack_require__(882), - DECODED_ALL: __webpack_require__(883), - DESTROY: __webpack_require__(884), - DETUNE: __webpack_require__(885), - GLOBAL_DETUNE: __webpack_require__(886), - GLOBAL_MUTE: __webpack_require__(887), - GLOBAL_RATE: __webpack_require__(888), - GLOBAL_VOLUME: __webpack_require__(889), - LOOP: __webpack_require__(890), - LOOPED: __webpack_require__(891), - MUTE: __webpack_require__(892), - PAUSE_ALL: __webpack_require__(893), - PAUSE: __webpack_require__(894), - PLAY: __webpack_require__(895), - RATE: __webpack_require__(896), - RESUME_ALL: __webpack_require__(897), - RESUME: __webpack_require__(898), - SEEK: __webpack_require__(899), - STOP_ALL: __webpack_require__(900), - STOP: __webpack_require__(901), - UNLOCKED: __webpack_require__(902), - VOLUME: __webpack_require__(903) + COMPLETE: __webpack_require__(886), + DECODED: __webpack_require__(887), + DECODED_ALL: __webpack_require__(888), + DESTROY: __webpack_require__(889), + DETUNE: __webpack_require__(890), + GLOBAL_DETUNE: __webpack_require__(891), + GLOBAL_MUTE: __webpack_require__(892), + GLOBAL_RATE: __webpack_require__(893), + GLOBAL_VOLUME: __webpack_require__(894), + LOOP: __webpack_require__(895), + LOOPED: __webpack_require__(896), + MUTE: __webpack_require__(897), + PAUSE_ALL: __webpack_require__(898), + PAUSE: __webpack_require__(899), + PLAY: __webpack_require__(900), + RATE: __webpack_require__(901), + RESUME_ALL: __webpack_require__(902), + RESUME: __webpack_require__(903), + SEEK: __webpack_require__(904), + STOP_ALL: __webpack_require__(905), + STOP: __webpack_require__(906), + UNLOCKED: __webpack_require__(907), + VOLUME: __webpack_require__(908) }; @@ -13658,11 +13791,12 @@ module.exports = StrokePathWebGL; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(89); -var GetPoint = __webpack_require__(421); -var GetPoints = __webpack_require__(422); -var Line = __webpack_require__(59); -var Random = __webpack_require__(164); +var Contains = __webpack_require__(91); +var GetPoint = __webpack_require__(424); +var GetPoints = __webpack_require__(425); +var GEOM_CONST = __webpack_require__(52); +var Line = __webpack_require__(60); +var Random = __webpack_require__(165); /** * @classdesc @@ -13695,6 +13829,17 @@ var Triangle = new Class({ if (x3 === undefined) { x3 = 0; } if (y3 === undefined) { y3 = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.TRIANGLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Triangle#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.TRIANGLE; + /** * `x` coordinate of the first point. * @@ -14093,8 +14238,8 @@ module.exports = Triangle; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); @@ -14375,10 +14520,10 @@ var Composite = {}; module.exports = Composite; -var Events = __webpack_require__(92); -var Common = __webpack_require__(16); +var Events = __webpack_require__(94); +var Common = __webpack_require__(17); var Bounds = __webpack_require__(38); -var Body = __webpack_require__(24); +var Body = __webpack_require__(25); (function() { @@ -15095,7 +15240,7 @@ module.exports = SetTileCollision; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Rectangle = __webpack_require__(442); +var Rectangle = __webpack_require__(445); /** * @classdesc @@ -16059,9 +16204,10 @@ module.exports = GetCenterY; var Class = __webpack_require__(0); var Contains = __webpack_require__(51); -var GetPoint = __webpack_require__(256); -var GetPoints = __webpack_require__(257); -var Random = __webpack_require__(155); +var GetPoint = __webpack_require__(259); +var GetPoints = __webpack_require__(260); +var GEOM_CONST = __webpack_require__(52); +var Random = __webpack_require__(156); /** * @classdesc @@ -16090,6 +16236,17 @@ var Circle = new Class({ if (y === undefined) { y = 0; } if (radius === undefined) { radius = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.CIRCLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Circle#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.CIRCLE; + /** * The x position of the center of the circle. * @@ -16467,7 +16624,7 @@ module.exports = SpliceOne; */ var Class = __webpack_require__(0); -var FromPoints = __webpack_require__(185); +var FromPoints = __webpack_require__(186); var Rectangle = __webpack_require__(11); var Vector2 = __webpack_require__(3); @@ -16665,10 +16822,8 @@ var Curve = new Class({ return this.getPointAt(1, out); }, - // Get total curve arc length - /** - * [description] + * Get total curve arc length * * @method Phaser.Curves.Curve#getLength * @since 3.0.0 @@ -16682,10 +16837,9 @@ var Curve = new Class({ return lengths[lengths.length - 1]; }, - // Get list of cumulative segment lengths /** - * [description] + * Get list of cumulative segment lengths * * @method Phaser.Curves.Curve#getLengths * @since 3.0.0 @@ -16844,13 +16998,11 @@ var Curve = new Class({ return this.getPointAt(0, out); }, - // Returns a unit vector tangent at t - // In case any sub curve does not implement its tangent derivation, - // 2 points a small delta apart will be used to find its gradient - // which seems to give a reasonable approximation - /** - * [description] + * Returns a unit vector tangent at t + * In case any sub curve does not implement its tangent derivation, + * 2 points a small delta apart will be used to find its gradient + * which seems to give a reasonable approximation * * @method Phaser.Curves.Curve#getTangent * @since 3.0.0 @@ -17047,16 +17199,16 @@ module.exports = Curve; module.exports = { - ADD: __webpack_require__(859), - COMPLETE: __webpack_require__(860), - FILE_COMPLETE: __webpack_require__(861), - FILE_KEY_COMPLETE: __webpack_require__(862), - FILE_LOAD_ERROR: __webpack_require__(863), - FILE_LOAD: __webpack_require__(864), - FILE_PROGRESS: __webpack_require__(865), - POST_PROCESS: __webpack_require__(866), - PROGRESS: __webpack_require__(867), - START: __webpack_require__(868) + ADD: __webpack_require__(865), + COMPLETE: __webpack_require__(866), + FILE_COMPLETE: __webpack_require__(867), + FILE_KEY_COMPLETE: __webpack_require__(868), + FILE_LOAD_ERROR: __webpack_require__(869), + FILE_LOAD: __webpack_require__(870), + FILE_PROGRESS: __webpack_require__(871), + POST_PROCESS: __webpack_require__(872), + PROGRESS: __webpack_require__(873), + START: __webpack_require__(874) }; @@ -17065,6 +17217,51 @@ module.exports = { /* 87 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clone = __webpack_require__(70); + +/** + * Creates a new Object using all values from obj1 and obj2. + * If a value exists in both obj1 and obj2, the value in obj1 is used. + * + * This is only a shallow copy. Deeply nested objects are not cloned, so be sure to only use this + * function on shallow objects. + * + * @function Phaser.Utils.Objects.Merge + * @since 3.0.0 + * + * @param {object} obj1 - The first object. + * @param {object} obj2 - The second object. + * + * @return {object} A new object containing the union of obj1's and obj2's properties. + */ +var Merge = function (obj1, obj2) +{ + var clone = Clone(obj1); + + for (var key in obj2) + { + if (!clone.hasOwnProperty(key)) + { + clone[key] = obj2[key]; + } + } + + return clone; +}; + +module.exports = Merge; + + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -17074,7 +17271,7 @@ module.exports = { var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var ImageRender = __webpack_require__(964); +var ImageRender = __webpack_require__(969); /** * @classdesc @@ -17163,7 +17360,116 @@ module.exports = Image; /***/ }), -/* 88 */ +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var EaseMap = __webpack_require__(175); +var UppercaseFirst = __webpack_require__(191); + +/** + * This internal function is used to return the correct ease function for a Tween. + * + * It can take a variety of input, including an EaseMap based string, or a custom function. + * + * @function Phaser.Tweens.Builders.GetEaseFunction + * @since 3.0.0 + * + * @param {(string|function)} ease - The ease to find. This can be either a string from the EaseMap, or a custom function. + * @param {number[]} [easeParams] - An optional array of ease parameters to go with the ease. + * + * @return {function} The ease function. + */ +var GetEaseFunction = function (ease, easeParams) +{ + // Default ease function + var easeFunction = EaseMap.Power0; + + // Prepare ease function + if (typeof ease === 'string') + { + // String based look-up + + // 1) They specified it correctly + if (EaseMap.hasOwnProperty(ease)) + { + easeFunction = EaseMap[ease]; + } + else + { + // Do some string manipulation to try and find it + var direction = ''; + + if (ease.indexOf('.')) + { + // quad.in = Quad.easeIn + // quad.out = Quad.easeOut + // quad.inout =Quad.easeInOut + + direction = ease.substr(ease.indexOf('.') + 1); + + if (direction.toLowerCase() === 'in') + { + direction = 'easeIn'; + } + else if (direction.toLowerCase() === 'out') + { + direction = 'easeOut'; + } + else if (direction.toLowerCase() === 'inout') + { + direction = 'easeInOut'; + } + } + + ease = UppercaseFirst(ease.substr(0, ease.indexOf('.') + 1) + direction); + + if (EaseMap.hasOwnProperty(ease)) + { + easeFunction = EaseMap[ease]; + } + } + } + else if (typeof ease === 'function') + { + // Custom function + easeFunction = ease; + } + else if (Array.isArray(ease) && ease.length === 4) + { + // Bezier function (TODO) + } + + // No custom ease parameters? + if (!easeParams) + { + // Return ease function + return easeFunction; + } + + var cloneParams = easeParams.slice(0); + + cloneParams.unshift(0); + + // Return ease function with custom ease parameters + return function (v) + { + cloneParams[0] = v; + + return easeFunction.apply(this, cloneParams); + }; +}; + +module.exports = GetEaseFunction; + + +/***/ }), +/* 90 */ /***/ (function(module, exports) { /** @@ -17192,7 +17498,7 @@ module.exports = HasValue; /***/ }), -/* 89 */ +/* 91 */ /***/ (function(module, exports) { /** @@ -17245,7 +17551,7 @@ module.exports = Contains; /***/ }), -/* 90 */ +/* 92 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17321,7 +17627,7 @@ module.exports = LineToLine; /***/ }), -/* 91 */ +/* 93 */ /***/ (function(module, exports) { /** @@ -17349,7 +17655,7 @@ module.exports = Angle; /***/ }), -/* 92 */ +/* 94 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17364,7 +17670,7 @@ var Events = {}; module.exports = Events; -var Common = __webpack_require__(16); +var Common = __webpack_require__(17); (function() { @@ -17467,7 +17773,7 @@ var Common = __webpack_require__(16); /***/ }), -/* 93 */ +/* 95 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17484,12 +17790,12 @@ var Constraint = {}; module.exports = Constraint; -var Vertices = __webpack_require__(32); +var Vertices = __webpack_require__(31); var Vector = __webpack_require__(37); -var Sleeping = __webpack_require__(110); +var Sleeping = __webpack_require__(111); var Bounds = __webpack_require__(38); -var Axes = __webpack_require__(224); -var Common = __webpack_require__(16); +var Axes = __webpack_require__(226); +var Common = __webpack_require__(17); (function() { @@ -17926,7 +18232,7 @@ var Common = __webpack_require__(16); /***/ }), -/* 94 */ +/* 96 */ /***/ (function(module, exports) { /** @@ -17980,7 +18286,7 @@ module.exports = ScaleModes; /***/ }), -/* 95 */ +/* 97 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17989,7 +18295,7 @@ module.exports = ScaleModes; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); /** * Return a value based on the range between `min` and `max` and the percentage given. @@ -18014,7 +18320,7 @@ module.exports = FromPercent; /***/ }), -/* 96 */ +/* 98 */ /***/ (function(module, exports) { /** @@ -18055,7 +18361,7 @@ module.exports = GetBoolean; /***/ }), -/* 97 */ +/* 99 */ /***/ (function(module, exports) { /** @@ -18227,7 +18533,7 @@ module.exports = TWEEN_CONST; /***/ }), -/* 98 */ +/* 100 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -18237,7 +18543,7 @@ module.exports = TWEEN_CONST; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(275); +var Events = __webpack_require__(278); /** * @callback DataEachCallback @@ -18868,7 +19174,7 @@ module.exports = DataManager; /***/ }), -/* 99 */ +/* 101 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -18883,18 +19189,18 @@ module.exports = DataManager; module.exports = { - ENTER_FULLSCREEN: __webpack_require__(685), - FULLSCREEN_FAILED: __webpack_require__(686), - FULLSCREEN_UNSUPPORTED: __webpack_require__(687), - LEAVE_FULLSCREEN: __webpack_require__(688), - ORIENTATION_CHANGE: __webpack_require__(689), - RESIZE: __webpack_require__(690) + ENTER_FULLSCREEN: __webpack_require__(690), + FULLSCREEN_FAILED: __webpack_require__(691), + FULLSCREEN_UNSUPPORTED: __webpack_require__(692), + LEAVE_FULLSCREEN: __webpack_require__(693), + ORIENTATION_CHANGE: __webpack_require__(694), + RESIZE: __webpack_require__(695) }; /***/ }), -/* 100 */ +/* 102 */ /***/ (function(module, exports) { /** @@ -18938,7 +19244,7 @@ module.exports = SnapFloor; /***/ }), -/* 101 */ +/* 103 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -18948,8 +19254,8 @@ module.exports = SnapFloor; */ var Class = __webpack_require__(0); -var Clamp = __webpack_require__(22); -var Extend = __webpack_require__(20); +var Clamp = __webpack_require__(24); +var Extend = __webpack_require__(15); /** * @classdesc @@ -19650,16 +19956,18 @@ var Frame = new Class({ }, /** - * Destroys this Frames references. + * 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.texture = null; - this.source = null; + this.texture = null; + this.glTexture = null; + this.customData = null; + this.data = null; }, /** @@ -19755,7 +20063,7 @@ module.exports = Frame; /***/ }), -/* 102 */ +/* 104 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -19765,10 +20073,11 @@ module.exports = Frame; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(103); -var GetPoint = __webpack_require__(393); -var GetPoints = __webpack_require__(394); -var Random = __webpack_require__(163); +var Contains = __webpack_require__(105); +var GetPoint = __webpack_require__(396); +var GetPoints = __webpack_require__(397); +var GEOM_CONST = __webpack_require__(52); +var Random = __webpack_require__(164); /** * @classdesc @@ -19799,6 +20108,17 @@ var Ellipse = new Class({ if (width === undefined) { width = 0; } if (height === undefined) { height = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.ELLIPSE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Ellipse#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.ELLIPSE; + /** * The x position of the center of the ellipse. * @@ -20123,7 +20443,7 @@ module.exports = Ellipse; /***/ }), -/* 103 */ +/* 105 */ /***/ (function(module, exports) { /** @@ -20165,7 +20485,7 @@ module.exports = Contains; /***/ }), -/* 104 */ +/* 106 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -20174,15 +20494,15 @@ module.exports = Contains; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Actions = __webpack_require__(244); +var Actions = __webpack_require__(247); var Class = __webpack_require__(0); -var Events = __webpack_require__(118); +var Events = __webpack_require__(119); var GetFastValue = __webpack_require__(1); var GetValue = __webpack_require__(5); var IsPlainObject = __webpack_require__(7); -var Range = __webpack_require__(387); -var Set = __webpack_require__(105); -var Sprite = __webpack_require__(63); +var Range = __webpack_require__(390); +var Set = __webpack_require__(107); +var Sprite = __webpack_require__(64); /** * @classdesc @@ -20519,14 +20839,15 @@ var Group = new Class({ var randomKey = GetFastValue(options, 'randomKey', false); var randomFrame = GetFastValue(options, 'randomFrame', false); var yoyo = GetFastValue(options, 'yoyo', false); - var quantity = GetFastValue(options, 'frameQuantity', 1); + var quantity = GetFastValue(options, 'quantity', false); + var frameQuantity = GetFastValue(options, 'frameQuantity', 1); var max = GetFastValue(options, 'max', 0); - // If a grid is set we use that to override the quantity? + // If a quantity value is set we use that to override the frameQuantity var range = Range(key, frame, { max: max, - qty: quantity, + qty: (quantity) ? quantity : frameQuantity, random: randomKey, randomB: randomFrame, repeat: repeat, @@ -21303,22 +21624,7 @@ var Group = new Class({ return; } - if (destroyChildren) - { - var children = this.children; - - for (var i = 0; i < children.size; i++) - { - var gameObject = children.entries[i]; - - // Remove the event hook first or it'll go all recursive hell on us - gameObject.off(Events.DESTROY, this.remove, this); - - gameObject.destroy(); - } - } - - this.children.clear(); + this.clear(false, destroyChildren); this.scene = undefined; this.children = undefined; @@ -21330,7 +21636,7 @@ module.exports = Group; /***/ }), -/* 105 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21779,69 +22085,7 @@ module.exports = Set; /***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var EaseMap = __webpack_require__(174); - -/** - * [description] - * - * @function Phaser.Tweens.Builders.GetEaseFunction - * @since 3.0.0 - * - * @param {(string|function)} ease - [description] - * @param {array} easeParams - [description] - * - * @return {function} [description] - */ -var GetEaseFunction = function (ease, easeParams) -{ - if (typeof ease === 'string' && EaseMap.hasOwnProperty(ease)) - { - if (easeParams) - { - var cloneParams = easeParams.slice(0); - - cloneParams.unshift(0); - - return function (v) - { - cloneParams[0] = v; - - return EaseMap[ease].apply(this, cloneParams); - }; - } - else - { - // String based look-up - return EaseMap[ease]; - } - } - else if (typeof ease === 'function') - { - // Custom function - return ease; - } - else if (Array.isArray(ease) && ease.length === 4) - { - // Bezier function (TODO) - } - - return EaseMap.Power0; -}; - -module.exports = GetEaseFunction; - - -/***/ }), -/* 107 */ +/* 108 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21905,7 +22149,7 @@ module.exports = FillPathWebGL; /***/ }), -/* 108 */ +/* 109 */ /***/ (function(module, exports) { /** @@ -21984,7 +22228,7 @@ module.exports = { /***/ }), -/* 109 */ +/* 110 */ /***/ (function(module, exports) { /** @@ -22052,7 +22296,7 @@ module.exports = { /***/ }), -/* 110 */ +/* 111 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22065,7 +22309,7 @@ var Sleeping = {}; module.exports = Sleeping; -var Events = __webpack_require__(92); +var Events = __webpack_require__(94); (function() { @@ -22187,7 +22431,7 @@ var Events = __webpack_require__(92); /***/ }), -/* 111 */ +/* 112 */ /***/ (function(module, exports) { /** @@ -22218,7 +22462,7 @@ module.exports = IsInLayerBounds; /***/ }), -/* 112 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22438,7 +22682,7 @@ module.exports = LayerData; /***/ }), -/* 113 */ +/* 114 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22663,7 +22907,7 @@ module.exports = MapData; /***/ }), -/* 114 */ +/* 115 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22679,7 +22923,7 @@ var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); var Rectangle = __webpack_require__(11); -var RectangleContains = __webpack_require__(52); +var RectangleContains = __webpack_require__(53); /** * @classdesc @@ -22976,7 +23220,7 @@ module.exports = Zone; /***/ }), -/* 115 */ +/* 116 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22991,30 +23235,30 @@ module.exports = Zone; module.exports = { - ADD_ANIMATION: __webpack_require__(534), - ANIMATION_COMPLETE: __webpack_require__(535), - ANIMATION_REPEAT: __webpack_require__(536), - ANIMATION_RESTART: __webpack_require__(537), - ANIMATION_START: __webpack_require__(538), - PAUSE_ALL: __webpack_require__(539), - REMOVE_ANIMATION: __webpack_require__(540), - RESUME_ALL: __webpack_require__(541), - SPRITE_ANIMATION_COMPLETE: __webpack_require__(542), - SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(543), - SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(544), - SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(545), - SPRITE_ANIMATION_KEY_START: __webpack_require__(546), - SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(547), - SPRITE_ANIMATION_REPEAT: __webpack_require__(548), - SPRITE_ANIMATION_RESTART: __webpack_require__(549), - SPRITE_ANIMATION_START: __webpack_require__(550), - SPRITE_ANIMATION_UPDATE: __webpack_require__(551) + ADD_ANIMATION: __webpack_require__(537), + ANIMATION_COMPLETE: __webpack_require__(538), + ANIMATION_REPEAT: __webpack_require__(539), + ANIMATION_RESTART: __webpack_require__(540), + ANIMATION_START: __webpack_require__(541), + PAUSE_ALL: __webpack_require__(542), + REMOVE_ANIMATION: __webpack_require__(543), + RESUME_ALL: __webpack_require__(544), + SPRITE_ANIMATION_COMPLETE: __webpack_require__(545), + SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(546), + SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(547), + SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(548), + SPRITE_ANIMATION_KEY_START: __webpack_require__(549), + SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(550), + SPRITE_ANIMATION_REPEAT: __webpack_require__(551), + SPRITE_ANIMATION_RESTART: __webpack_require__(552), + SPRITE_ANIMATION_START: __webpack_require__(553), + SPRITE_ANIMATION_UPDATE: __webpack_require__(554) }; /***/ }), -/* 116 */ +/* 117 */ /***/ (function(module, exports) { /** @@ -23042,7 +23286,7 @@ module.exports = Perimeter; /***/ }), -/* 117 */ +/* 118 */ /***/ (function(module, exports) { /** @@ -23171,7 +23415,7 @@ module.exports = Pipeline; /***/ }), -/* 118 */ +/* 119 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23184,11 +23428,11 @@ module.exports = Pipeline; * @namespace Phaser.GameObjects.Events */ -module.exports = { DESTROY: __webpack_require__(566) }; +module.exports = { DESTROY: __webpack_require__(585) }; /***/ }), -/* 119 */ +/* 120 */ /***/ (function(module, exports) { /** @@ -23226,7 +23470,7 @@ module.exports = Shuffle; /***/ }), -/* 120 */ +/* 121 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23239,10 +23483,10 @@ var Class = __webpack_require__(0); var Components = __webpack_require__(12); var DegToRad = __webpack_require__(40); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(53); +var Events = __webpack_require__(54); var Rectangle = __webpack_require__(11); var TransformMatrix = __webpack_require__(35); -var ValueToColor = __webpack_require__(170); +var ValueToColor = __webpack_require__(171); var Vector2 = __webpack_require__(3); /** @@ -25147,7 +25391,7 @@ module.exports = BaseCamera; /***/ }), -/* 121 */ +/* 122 */ /***/ (function(module, exports) { /** @@ -25279,7 +25523,7 @@ module.exports = Smoothing(); /***/ }), -/* 122 */ +/* 123 */ /***/ (function(module, exports) { /** @@ -25309,7 +25553,7 @@ module.exports = Linear; /***/ }), -/* 123 */ +/* 124 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -25478,10 +25722,10 @@ function init () module.exports = init(); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(711))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(716))) /***/ }), -/* 124 */ +/* 125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25490,7 +25734,7 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(123); +var OS = __webpack_require__(124); /** * Determines the browser type and version running this Phaser Game instance. @@ -25591,7 +25835,7 @@ module.exports = init(); /***/ }), -/* 125 */ +/* 126 */ /***/ (function(module, exports) { /** @@ -25621,7 +25865,7 @@ module.exports = IsSizePowerOfTwo; /***/ }), -/* 126 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25636,17 +25880,17 @@ module.exports = IsSizePowerOfTwo; module.exports = { - ADD: __webpack_require__(757), - ERROR: __webpack_require__(758), - LOAD: __webpack_require__(759), - READY: __webpack_require__(760), - REMOVE: __webpack_require__(761) + ADD: __webpack_require__(763), + ERROR: __webpack_require__(764), + LOAD: __webpack_require__(765), + READY: __webpack_require__(766), + REMOVE: __webpack_require__(767) }; /***/ }), -/* 127 */ +/* 128 */ /***/ (function(module, exports) { /** @@ -25704,7 +25948,7 @@ module.exports = AddToDOM; /***/ }), -/* 128 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25795,7 +26039,7 @@ module.exports = Remove; /***/ }), -/* 129 */ +/* 130 */ /***/ (function(module, exports) { /** @@ -26683,7 +26927,7 @@ module.exports = KeyCodes; /***/ }), -/* 130 */ +/* 131 */ /***/ (function(module, exports) { /** @@ -26806,7 +27050,7 @@ module.exports = CONST; /***/ }), -/* 131 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26820,7 +27064,7 @@ var Class = __webpack_require__(0); var Clone = __webpack_require__(70); var EventEmitter = __webpack_require__(9); var Events = __webpack_require__(71); -var GameEvents = __webpack_require__(30); +var GameEvents = __webpack_require__(22); var NOOP = __webpack_require__(2); /** @@ -27430,7 +27674,7 @@ module.exports = BaseSoundManager; /***/ }), -/* 132 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27443,7 +27687,7 @@ module.exports = BaseSoundManager; var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(9); var Events = __webpack_require__(71); -var Extend = __webpack_require__(20); +var Extend = __webpack_require__(15); var NOOP = __webpack_require__(2); /** @@ -27930,7 +28174,7 @@ module.exports = BaseSound; /***/ }), -/* 133 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27939,10 +28183,10 @@ module.exports = BaseSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(191); +var ArrayUtils = __webpack_require__(193); var Class = __webpack_require__(0); var NOOP = __webpack_require__(2); -var StableSort = __webpack_require__(135); +var StableSort = __webpack_require__(136); /** * @callback EachListCallback @@ -28746,7 +28990,7 @@ module.exports = List; /***/ }), -/* 134 */ +/* 135 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28755,8 +28999,8 @@ module.exports = List; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CheckMatrix = __webpack_require__(192); -var TransposeMatrix = __webpack_require__(385); +var CheckMatrix = __webpack_require__(194); +var TransposeMatrix = __webpack_require__(388); /** * Rotates the array matrix based on the given rotation value. @@ -28818,7 +29062,7 @@ module.exports = RotateMatrix; /***/ }), -/* 135 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28963,7 +29207,7 @@ else {} })(); /***/ }), -/* 136 */ +/* 137 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28975,10 +29219,10 @@ else {} var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var GetBitmapTextSize = __webpack_require__(939); -var ParseFromAtlas = __webpack_require__(940); -var ParseXMLBitmapFont = __webpack_require__(194); -var Render = __webpack_require__(941); +var GetBitmapTextSize = __webpack_require__(944); +var ParseFromAtlas = __webpack_require__(945); +var ParseXMLBitmapFont = __webpack_require__(196); +var Render = __webpack_require__(946); /** * @classdesc @@ -29605,7 +29849,7 @@ module.exports = BitmapText; /***/ }), -/* 137 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29617,7 +29861,7 @@ module.exports = BitmapText; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var MeshRender = __webpack_require__(1061); +var MeshRender = __webpack_require__(1066); var NOOP = __webpack_require__(2); /** @@ -29778,7 +30022,7 @@ module.exports = Mesh; /***/ }), -/* 138 */ +/* 139 */ /***/ (function(module, exports) { /** @@ -29814,7 +30058,7 @@ module.exports = RectangleToRectangle; /***/ }), -/* 139 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29926,7 +30170,7 @@ module.exports = InputPluginCache; /***/ }), -/* 140 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29941,19 +30185,19 @@ module.exports = InputPluginCache; module.exports = { - ANY_KEY_DOWN: __webpack_require__(1199), - ANY_KEY_UP: __webpack_require__(1200), - COMBO_MATCH: __webpack_require__(1201), - DOWN: __webpack_require__(1202), - KEY_DOWN: __webpack_require__(1203), - KEY_UP: __webpack_require__(1204), - UP: __webpack_require__(1205) + ANY_KEY_DOWN: __webpack_require__(1204), + ANY_KEY_UP: __webpack_require__(1205), + COMBO_MATCH: __webpack_require__(1206), + DOWN: __webpack_require__(1207), + KEY_DOWN: __webpack_require__(1208), + KEY_UP: __webpack_require__(1209), + UP: __webpack_require__(1210) }; /***/ }), -/* 141 */ +/* 142 */ /***/ (function(module, exports) { /** @@ -30017,7 +30261,7 @@ module.exports = XHRSettings; /***/ }), -/* 142 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30027,8 +30271,8 @@ module.exports = XHRSettings; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(220); -var Sprite = __webpack_require__(63); +var Components = __webpack_require__(222); +var Sprite = __webpack_require__(64); /** * @classdesc @@ -30118,7 +30362,7 @@ module.exports = ArcadeSprite; /***/ }), -/* 143 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30133,24 +30377,24 @@ module.exports = ArcadeSprite; module.exports = { - Bounce: __webpack_require__(1299), - Collision: __webpack_require__(1300), - Force: __webpack_require__(1301), - Friction: __webpack_require__(1302), - Gravity: __webpack_require__(1303), - Mass: __webpack_require__(1304), - Static: __webpack_require__(1305), - Sensor: __webpack_require__(1306), - SetBody: __webpack_require__(1307), - Sleep: __webpack_require__(1309), - Transform: __webpack_require__(1322), - Velocity: __webpack_require__(1323) + Bounce: __webpack_require__(1304), + Collision: __webpack_require__(1305), + Force: __webpack_require__(1306), + Friction: __webpack_require__(1307), + Gravity: __webpack_require__(1308), + Mass: __webpack_require__(1309), + Static: __webpack_require__(1310), + Sensor: __webpack_require__(1311), + SetBody: __webpack_require__(1312), + Sleep: __webpack_require__(1313), + Transform: __webpack_require__(1326), + Velocity: __webpack_require__(1327) }; /***/ }), -/* 144 */ +/* 145 */ /***/ (function(module, exports) { /** @@ -30276,7 +30520,7 @@ module.exports = Pair; /***/ }), -/* 145 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30291,54 +30535,54 @@ module.exports = Pair; module.exports = { - CalculateFacesAt: __webpack_require__(232), - CalculateFacesWithin: __webpack_require__(58), - Copy: __webpack_require__(1345), - CreateFromTiles: __webpack_require__(1346), - CullTiles: __webpack_require__(1347), - Fill: __webpack_require__(1348), - FilterTiles: __webpack_require__(1349), - FindByIndex: __webpack_require__(1350), - FindTile: __webpack_require__(1351), - ForEachTile: __webpack_require__(1352), - GetTileAt: __webpack_require__(146), - GetTileAtWorldXY: __webpack_require__(1353), - GetTilesWithin: __webpack_require__(25), - GetTilesWithinShape: __webpack_require__(1354), - GetTilesWithinWorldXY: __webpack_require__(1355), - HasTileAt: __webpack_require__(491), - HasTileAtWorldXY: __webpack_require__(1356), - IsInLayerBounds: __webpack_require__(111), - PutTileAt: __webpack_require__(233), - PutTileAtWorldXY: __webpack_require__(1357), - PutTilesAt: __webpack_require__(1358), - Randomize: __webpack_require__(1359), - RemoveTileAt: __webpack_require__(492), - RemoveTileAtWorldXY: __webpack_require__(1360), - RenderDebug: __webpack_require__(1361), - ReplaceByIndex: __webpack_require__(490), - SetCollision: __webpack_require__(1362), - SetCollisionBetween: __webpack_require__(1363), - SetCollisionByExclusion: __webpack_require__(1364), - SetCollisionByProperty: __webpack_require__(1365), - SetCollisionFromCollisionGroup: __webpack_require__(1366), - SetTileIndexCallback: __webpack_require__(1367), - SetTileLocationCallback: __webpack_require__(1368), - Shuffle: __webpack_require__(1369), - SwapByIndex: __webpack_require__(1370), - TileToWorldX: __webpack_require__(147), - TileToWorldXY: __webpack_require__(1371), - TileToWorldY: __webpack_require__(148), - WeightedRandomize: __webpack_require__(1372), - WorldToTileX: __webpack_require__(66), - WorldToTileXY: __webpack_require__(1373), - WorldToTileY: __webpack_require__(67) + CalculateFacesAt: __webpack_require__(234), + CalculateFacesWithin: __webpack_require__(59), + Copy: __webpack_require__(1349), + CreateFromTiles: __webpack_require__(1350), + CullTiles: __webpack_require__(1351), + Fill: __webpack_require__(1352), + FilterTiles: __webpack_require__(1353), + FindByIndex: __webpack_require__(1354), + FindTile: __webpack_require__(1355), + ForEachTile: __webpack_require__(1356), + GetTileAt: __webpack_require__(147), + GetTileAtWorldXY: __webpack_require__(1357), + GetTilesWithin: __webpack_require__(26), + GetTilesWithinShape: __webpack_require__(1358), + GetTilesWithinWorldXY: __webpack_require__(1359), + HasTileAt: __webpack_require__(495), + HasTileAtWorldXY: __webpack_require__(1360), + IsInLayerBounds: __webpack_require__(112), + PutTileAt: __webpack_require__(235), + PutTileAtWorldXY: __webpack_require__(1361), + PutTilesAt: __webpack_require__(1362), + Randomize: __webpack_require__(1363), + RemoveTileAt: __webpack_require__(496), + RemoveTileAtWorldXY: __webpack_require__(1364), + RenderDebug: __webpack_require__(1365), + ReplaceByIndex: __webpack_require__(494), + SetCollision: __webpack_require__(1366), + SetCollisionBetween: __webpack_require__(1367), + SetCollisionByExclusion: __webpack_require__(1368), + SetCollisionByProperty: __webpack_require__(1369), + SetCollisionFromCollisionGroup: __webpack_require__(1370), + SetTileIndexCallback: __webpack_require__(1371), + SetTileLocationCallback: __webpack_require__(1372), + Shuffle: __webpack_require__(1373), + SwapByIndex: __webpack_require__(1374), + TileToWorldX: __webpack_require__(148), + TileToWorldXY: __webpack_require__(1375), + TileToWorldY: __webpack_require__(149), + WeightedRandomize: __webpack_require__(1376), + WorldToTileX: __webpack_require__(67), + WorldToTileXY: __webpack_require__(1377), + WorldToTileY: __webpack_require__(68) }; /***/ }), -/* 146 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30347,7 +30591,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var IsInLayerBounds = __webpack_require__(111); +var IsInLayerBounds = __webpack_require__(112); /** * Gets a tile at the given tile coordinates from the given layer. @@ -30394,7 +30638,7 @@ module.exports = GetTileAt; /***/ }), -/* 147 */ +/* 148 */ /***/ (function(module, exports) { /** @@ -30439,7 +30683,7 @@ module.exports = TileToWorldX; /***/ }), -/* 148 */ +/* 149 */ /***/ (function(module, exports) { /** @@ -30484,7 +30728,7 @@ module.exports = TileToWorldY; /***/ }), -/* 149 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30888,7 +31132,7 @@ module.exports = Tileset; /***/ }), -/* 150 */ +/* 151 */ /***/ (function(module, exports) { /** @@ -30898,16 +31142,17 @@ module.exports = Tileset; */ /** - * [description] + * Internal function used by the Tween Builder to create a function that will return + * the given value from the source. * * @function Phaser.Tweens.Builders.GetNewValue * @since 3.0.0 * - * @param {object} source - [description] - * @param {string} key - [description] - * @param {*} defaultValue - [description] + * @param {any} source - The source object to get the value from. + * @param {string} key - The property to get from the source. + * @param {any} defaultValue - A default value to return should the source not have the property set. * - * @return {function} [description] + * @return {function} A function which when called will return the property value from the source. */ var GetNewValue = function (source, key, defaultValue) { @@ -30919,9 +31164,9 @@ var GetNewValue = function (source, key, defaultValue) if (t === 'function') { - valueCallback = function (index, totalTargets, target) + valueCallback = function (target, targetKey, value, targetIndex, totalTargets, tween) { - return source[key](index, totalTargets, target); + return source[key](target, targetKey, value, targetIndex, totalTargets, tween); }; } else @@ -30951,7 +31196,7 @@ module.exports = GetNewValue; /***/ }), -/* 151 */ +/* 152 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30960,17 +31205,17 @@ module.exports = GetNewValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Defaults = __webpack_require__(241); +var Defaults = __webpack_require__(243); var GetAdvancedValue = __webpack_require__(14); -var GetBoolean = __webpack_require__(96); -var GetEaseFunction = __webpack_require__(106); -var GetNewValue = __webpack_require__(150); -var GetProps = __webpack_require__(513); -var GetTargets = __webpack_require__(239); +var GetBoolean = __webpack_require__(98); +var GetEaseFunction = __webpack_require__(89); +var GetNewValue = __webpack_require__(151); +var GetProps = __webpack_require__(517); +var GetTargets = __webpack_require__(241); var GetValue = __webpack_require__(5); -var GetValueOp = __webpack_require__(240); -var Tween = __webpack_require__(242); -var TweenData = __webpack_require__(243); +var GetValueOp = __webpack_require__(242); +var Tween = __webpack_require__(244); +var TweenData = __webpack_require__(246); /** * Creates a new Tween. @@ -31024,9 +31269,11 @@ var TweenBuilder = function (parent, config, defaults) var tweenData = TweenData( targets[t], + t, key, ops.getEnd, ops.getStart, + ops.getActive, GetEaseFunction(GetValue(value, 'ease', ease), easeParams), GetNewValue(value, 'delay', delay), GetNewValue(value, 'duration', duration), @@ -31082,7 +31329,7 @@ module.exports = TweenBuilder; /***/ }), -/* 152 */ +/* 153 */ /***/ (function(module, exports) { var g; @@ -31108,7 +31355,7 @@ module.exports = g; /***/ }), -/* 153 */ +/* 154 */ /***/ (function(module, exports) { /** @@ -31242,7 +31489,7 @@ module.exports = ALIGN_CONST; /***/ }), -/* 154 */ +/* 155 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31281,7 +31528,7 @@ module.exports = CircumferencePoint; /***/ }), -/* 155 */ +/* 156 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31325,7 +31572,7 @@ module.exports = Random; /***/ }), -/* 156 */ +/* 157 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31334,12 +31581,12 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(115); -var FindClosestInSorted = __webpack_require__(261); -var Frame = __webpack_require__(262); +var Events = __webpack_require__(116); +var FindClosestInSorted = __webpack_require__(264); +var Frame = __webpack_require__(265); var GetValue = __webpack_require__(5); /** @@ -32173,9 +32420,11 @@ var Animation = new Class({ var len = this.frames.length; var slice = 1 / (len - 1); + var frame; + for (var i = 0; i < len; i++) { - var frame = this.frames[i]; + frame = this.frames[i]; frame.index = i + 1; frame.isFirst = false; @@ -32185,11 +32434,21 @@ var Animation = new Class({ if (i === 0) { frame.isFirst = true; - frame.isLast = (len === 1); - frame.prevFrame = this.frames[len - 1]; - frame.nextFrame = this.frames[i + 1]; + + if (len === 1) + { + frame.isLast = true; + frame.nextFrame = frame; + frame.prevFrame = frame; + } + else + { + frame.isLast = false; + frame.prevFrame = this.frames[len - 1]; + frame.nextFrame = this.frames[i + 1]; + } } - else if (i === len - 1) + else if (i === len - 1 && len > 1) { frame.isLast = true; frame.prevFrame = this.frames[len - 2]; @@ -32266,7 +32525,7 @@ module.exports = Animation; /***/ }), -/* 157 */ +/* 158 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32275,7 +32534,7 @@ module.exports = Animation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Perimeter = __webpack_require__(116); +var Perimeter = __webpack_require__(117); var Point = __webpack_require__(4); /** @@ -32343,7 +32602,7 @@ module.exports = GetPoint; /***/ }), -/* 158 */ +/* 159 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32352,7 +32611,7 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(60); +var Length = __webpack_require__(61); var Point = __webpack_require__(4); /** @@ -32408,7 +32667,7 @@ module.exports = GetPoints; /***/ }), -/* 159 */ +/* 160 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32448,7 +32707,7 @@ module.exports = Random; /***/ }), -/* 160 */ +/* 161 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32486,7 +32745,7 @@ module.exports = Random; /***/ }), -/* 161 */ +/* 162 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32495,7 +32754,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathWrap = __webpack_require__(61); +var MathWrap = __webpack_require__(62); /** * Wrap an angle. @@ -32518,7 +32777,7 @@ module.exports = Wrap; /***/ }), -/* 162 */ +/* 163 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32527,7 +32786,7 @@ module.exports = Wrap; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Wrap = __webpack_require__(61); +var Wrap = __webpack_require__(62); /** * Wrap an angle in degrees. @@ -32550,7 +32809,7 @@ module.exports = WrapDegrees; /***/ }), -/* 163 */ +/* 164 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32591,7 +32850,7 @@ module.exports = Random; /***/ }), -/* 164 */ +/* 165 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32647,7 +32906,7 @@ module.exports = Random; /***/ }), -/* 165 */ +/* 166 */ /***/ (function(module, exports) { /** @@ -32684,7 +32943,7 @@ module.exports = RotateAroundDistance; /***/ }), -/* 166 */ +/* 167 */ /***/ (function(module, exports) { /** @@ -32723,7 +32982,7 @@ module.exports = SmootherStep; /***/ }), -/* 167 */ +/* 168 */ /***/ (function(module, exports) { /** @@ -32770,7 +33029,7 @@ module.exports = SmoothStep; /***/ }), -/* 168 */ +/* 169 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33143,7 +33402,7 @@ module.exports = Map; /***/ }), -/* 169 */ +/* 170 */ /***/ (function(module, exports) { /** @@ -33219,7 +33478,7 @@ module.exports = Pad; /***/ }), -/* 170 */ +/* 171 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33228,10 +33487,10 @@ module.exports = Pad; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HexStringToColor = __webpack_require__(285); -var IntegerToColor = __webpack_require__(288); -var ObjectToColor = __webpack_require__(290); -var RGBStringToColor = __webpack_require__(291); +var HexStringToColor = __webpack_require__(288); +var IntegerToColor = __webpack_require__(291); +var ObjectToColor = __webpack_require__(293); +var RGBStringToColor = __webpack_require__(294); /** * Converts the given source color value into an instance of a Color class. @@ -33275,7 +33534,7 @@ module.exports = ValueToColor; /***/ }), -/* 171 */ +/* 172 */ /***/ (function(module, exports) { /** @@ -33305,7 +33564,7 @@ module.exports = GetColor; /***/ }), -/* 172 */ +/* 173 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33314,7 +33573,7 @@ module.exports = GetColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColor = __webpack_require__(171); +var GetColor = __webpack_require__(172); /** * Converts an HSV (hue, saturation and value) color value to RGB. @@ -33406,7 +33665,7 @@ module.exports = HSVToRGB; /***/ }), -/* 173 */ +/* 174 */ /***/ (function(module, exports) { /** @@ -33443,7 +33702,7 @@ module.exports = CenterOn; /***/ }), -/* 174 */ +/* 175 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33452,18 +33711,18 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Back = __webpack_require__(293); -var Bounce = __webpack_require__(294); -var Circular = __webpack_require__(295); -var Cubic = __webpack_require__(296); -var Elastic = __webpack_require__(297); -var Expo = __webpack_require__(298); -var Linear = __webpack_require__(299); -var Quadratic = __webpack_require__(300); -var Quartic = __webpack_require__(301); -var Quintic = __webpack_require__(302); -var Sine = __webpack_require__(303); -var Stepped = __webpack_require__(304); +var Back = __webpack_require__(296); +var Bounce = __webpack_require__(297); +var Circular = __webpack_require__(298); +var Cubic = __webpack_require__(299); +var Elastic = __webpack_require__(300); +var Expo = __webpack_require__(301); +var Linear = __webpack_require__(302); +var Quadratic = __webpack_require__(303); +var Quartic = __webpack_require__(304); +var Quintic = __webpack_require__(305); +var Sine = __webpack_require__(306); +var Stepped = __webpack_require__(307); // EaseMap module.exports = { @@ -33524,7 +33783,7 @@ module.exports = { /***/ }), -/* 175 */ +/* 176 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33533,9 +33792,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(123); -var Browser = __webpack_require__(124); -var CanvasPool = __webpack_require__(26); +var OS = __webpack_require__(124); +var Browser = __webpack_require__(125); +var CanvasPool = __webpack_require__(27); /** * Determines the features of the browser running this Phaser Game instance. @@ -33716,7 +33975,7 @@ module.exports = init(); /***/ }), -/* 176 */ +/* 177 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33725,8 +33984,8 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); -var Extend = __webpack_require__(20); +var CONST = __webpack_require__(21); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Math @@ -33735,61 +33994,62 @@ var Extend = __webpack_require__(20); var PhaserMath = { // Collections of functions - Angle: __webpack_require__(716), - Distance: __webpack_require__(724), - Easing: __webpack_require__(726), - Fuzzy: __webpack_require__(727), - Interpolation: __webpack_require__(730), - Pow2: __webpack_require__(735), - Snap: __webpack_require__(737), + Angle: __webpack_require__(721), + Distance: __webpack_require__(729), + Easing: __webpack_require__(731), + Fuzzy: __webpack_require__(732), + Interpolation: __webpack_require__(735), + Pow2: __webpack_require__(740), + Snap: __webpack_require__(742), // Expose the RNG Class - RandomDataGenerator: __webpack_require__(739), + RandomDataGenerator: __webpack_require__(744), // Single functions - Average: __webpack_require__(740), - Bernstein: __webpack_require__(313), - Between: __webpack_require__(179), - CatmullRom: __webpack_require__(178), - CeilTo: __webpack_require__(741), - Clamp: __webpack_require__(22), + Average: __webpack_require__(745), + Bernstein: __webpack_require__(316), + Between: __webpack_require__(180), + CatmullRom: __webpack_require__(179), + CeilTo: __webpack_require__(746), + Clamp: __webpack_require__(24), DegToRad: __webpack_require__(40), - Difference: __webpack_require__(742), - Factorial: __webpack_require__(314), - FloatBetween: __webpack_require__(320), - FloorTo: __webpack_require__(743), - FromPercent: __webpack_require__(95), - GetSpeed: __webpack_require__(744), - IsEven: __webpack_require__(745), - IsEvenStrict: __webpack_require__(746), - Linear: __webpack_require__(122), - MaxAdd: __webpack_require__(747), - MinSub: __webpack_require__(748), - Percent: __webpack_require__(749), - RadToDeg: __webpack_require__(180), - RandomXY: __webpack_require__(750), - RandomXYZ: __webpack_require__(751), - RandomXYZW: __webpack_require__(752), - Rotate: __webpack_require__(321), - RotateAround: __webpack_require__(267), - RotateAroundDistance: __webpack_require__(165), - RoundAwayFromZero: __webpack_require__(322), - RoundTo: __webpack_require__(753), - SinCosTableGenerator: __webpack_require__(754), - SmootherStep: __webpack_require__(166), - SmoothStep: __webpack_require__(167), - TransformXY: __webpack_require__(323), - Within: __webpack_require__(755), - Wrap: __webpack_require__(61), + Difference: __webpack_require__(747), + Factorial: __webpack_require__(317), + FloatBetween: __webpack_require__(323), + FloorTo: __webpack_require__(748), + FromPercent: __webpack_require__(97), + GetSpeed: __webpack_require__(749), + IsEven: __webpack_require__(750), + IsEvenStrict: __webpack_require__(751), + Linear: __webpack_require__(123), + MaxAdd: __webpack_require__(752), + MinSub: __webpack_require__(753), + Percent: __webpack_require__(754), + RadToDeg: __webpack_require__(181), + RandomXY: __webpack_require__(755), + RandomXYZ: __webpack_require__(756), + RandomXYZW: __webpack_require__(757), + Rotate: __webpack_require__(324), + RotateAround: __webpack_require__(270), + RotateAroundDistance: __webpack_require__(166), + RoundAwayFromZero: __webpack_require__(325), + RoundTo: __webpack_require__(758), + SinCosTableGenerator: __webpack_require__(759), + SmootherStep: __webpack_require__(167), + SmoothStep: __webpack_require__(168), + ToXY: __webpack_require__(760), + TransformXY: __webpack_require__(326), + Within: __webpack_require__(761), + Wrap: __webpack_require__(62), // Vector classes Vector2: __webpack_require__(3), - Vector3: __webpack_require__(181), - Vector4: __webpack_require__(324), - Matrix3: __webpack_require__(325), - Matrix4: __webpack_require__(326), - Quaternion: __webpack_require__(327), - RotateVec3: __webpack_require__(756) + Vector3: __webpack_require__(182), + Vector4: __webpack_require__(327), + Matrix3: __webpack_require__(328), + Matrix4: __webpack_require__(329), + Quaternion: __webpack_require__(330), + RotateVec3: __webpack_require__(762) }; @@ -33803,7 +34063,7 @@ module.exports = PhaserMath; /***/ }), -/* 177 */ +/* 178 */ /***/ (function(module, exports) { /** @@ -33837,7 +34097,7 @@ module.exports = Equal; /***/ }), -/* 178 */ +/* 179 */ /***/ (function(module, exports) { /** @@ -33874,7 +34134,7 @@ module.exports = CatmullRom; /***/ }), -/* 179 */ +/* 180 */ /***/ (function(module, exports) { /** @@ -33903,7 +34163,7 @@ module.exports = Between; /***/ }), -/* 180 */ +/* 181 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33912,7 +34172,7 @@ module.exports = Between; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); +var CONST = __webpack_require__(21); /** * Convert the given angle in radians, to the equivalent angle in degrees. @@ -33933,7 +34193,7 @@ module.exports = RadToDeg; /***/ }), -/* 181 */ +/* 182 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34743,7 +35003,7 @@ module.exports = Vector3; /***/ }), -/* 182 */ +/* 183 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34846,7 +35106,7 @@ module.exports = DefaultPlugins; /***/ }), -/* 183 */ +/* 184 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35611,7 +35871,7 @@ module.exports = WebGLPipeline; /***/ }), -/* 184 */ +/* 185 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35622,14 +35882,14 @@ module.exports = WebGLPipeline; */ var Class = __webpack_require__(0); -var Earcut = __webpack_require__(68); +var Earcut = __webpack_require__(69); var GetFastValue = __webpack_require__(1); -var ModelViewProjection = __webpack_require__(337); -var ShaderSourceFS = __webpack_require__(765); -var ShaderSourceVS = __webpack_require__(766); +var ModelViewProjection = __webpack_require__(340); +var ShaderSourceFS = __webpack_require__(771); +var ShaderSourceVS = __webpack_require__(772); var TransformMatrix = __webpack_require__(35); var Utils = __webpack_require__(10); -var WebGLPipeline = __webpack_require__(183); +var WebGLPipeline = __webpack_require__(184); /** * @classdesc @@ -36149,9 +36409,13 @@ var TextureTintPipeline = new Class({ var frameY = frame.y; var frameWidth = frame.cutWidth; var frameHeight = frame.cutHeight; + var customPivot = frame.customPivot; - var x = -sprite.displayOriginX + frameX; - var y = -sprite.displayOriginY + frameY; + var displayOriginX = sprite.displayOriginX; + var displayOriginY = sprite.displayOriginY; + + var x = -displayOriginX + frameX; + var y = -displayOriginY + frameY; if (sprite.isCropped) { @@ -36173,26 +36437,35 @@ var TextureTintPipeline = new Class({ frameX = crop.x; frameY = crop.y; - x = -sprite.displayOriginX + frameX; - y = -sprite.displayOriginY + frameY; + x = -displayOriginX + frameX; + y = -displayOriginY + frameY; } + var flipX = 1; + var flipY = 1; + if (sprite.flipX) { - x += frameWidth; - frameWidth *= -1; + if (!customPivot) + { + x += (-frame.realWidth + (displayOriginX * 2)); + } + + flipX = -1; } - if (sprite.flipY) + // Auto-invert the flipY if this is coming from a GLTexture + if (sprite.flipY || (frame.source.isGLTexture && !texture.flipY)) { - y += frameHeight; - frameHeight *= -1; + if (!customPivot) + { + y += (-frame.realHeight + (displayOriginY * 2)); + } + + flipY = -1; } - var xw = x + frameWidth; - var yh = y + frameHeight; - - spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX, sprite.scaleY); + spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX * flipX, sprite.scaleY * flipY); camMatrix.copyFrom(camera.matrix); @@ -36217,6 +36490,9 @@ var TextureTintPipeline = new Class({ camMatrix.multiply(spriteMatrix, calcMatrix); } + var xw = x + frameWidth; + var yh = y + frameHeight; + var tx0 = calcMatrix.getX(x, y); var ty0 = calcMatrix.getY(x, y); @@ -37103,7 +37379,7 @@ module.exports = TextureTintPipeline; /***/ }), -/* 185 */ +/* 186 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37188,7 +37464,7 @@ module.exports = FromPoints; /***/ }), -/* 186 */ +/* 187 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37199,10 +37475,10 @@ module.exports = FromPoints; var CONST = { - CENTER: __webpack_require__(355), - ORIENTATION: __webpack_require__(356), - SCALE_MODE: __webpack_require__(357), - ZOOM: __webpack_require__(358) + CENTER: __webpack_require__(358), + ORIENTATION: __webpack_require__(359), + SCALE_MODE: __webpack_require__(360), + ZOOM: __webpack_require__(361) }; @@ -37210,7 +37486,7 @@ module.exports = CONST; /***/ }), -/* 187 */ +/* 188 */ /***/ (function(module, exports) { /** @@ -37239,7 +37515,7 @@ module.exports = RemoveFromDOM; /***/ }), -/* 188 */ +/* 189 */ /***/ (function(module, exports) { /** @@ -37337,7 +37613,7 @@ module.exports = INPUT_CONST; /***/ }), -/* 189 */ +/* 190 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37347,13 +37623,13 @@ module.exports = INPUT_CONST; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(130); -var DefaultPlugins = __webpack_require__(182); -var Events = __webpack_require__(18); -var GetPhysicsPlugins = __webpack_require__(869); -var GetScenePlugins = __webpack_require__(870); +var CONST = __webpack_require__(131); +var DefaultPlugins = __webpack_require__(183); +var Events = __webpack_require__(19); +var GetPhysicsPlugins = __webpack_require__(875); +var GetScenePlugins = __webpack_require__(876); var NOOP = __webpack_require__(2); -var Settings = __webpack_require__(372); +var Settings = __webpack_require__(374); /** * @classdesc @@ -37517,7 +37793,7 @@ var Systems = new Class({ * In the default set-up you can access this from within a Scene via the `this.sound` property. * * @name Phaser.Scenes.Systems#sound - * @type {Phaser.Sound.BaseSoundManager} + * @type {(Phaser.Sound.NoAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager)} * @since 3.0.0 */ this.sound; @@ -38104,7 +38380,44 @@ module.exports = Systems; /***/ }), -/* 190 */ +/* 191 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Capitalizes the first letter of a string if there is one. + * @example + * UppercaseFirst('abc'); + * // returns 'Abc' + * @example + * UppercaseFirst('the happy family'); + * // returns 'The happy family' + * @example + * UppercaseFirst(''); + * // returns '' + * + * @function Phaser.Utils.String.UppercaseFirst + * @since 3.0.0 + * + * @param {string} str - The string to capitalize. + * + * @return {string} A new string, same as the first, but with the first letter capitalized. + */ +var UppercaseFirst = function (str) +{ + return str && str[0].toUpperCase() + str.slice(1); +}; + +module.exports = UppercaseFirst; + + +/***/ }), +/* 192 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38114,8 +38427,8 @@ module.exports = Systems; */ var Class = __webpack_require__(0); -var Frame = __webpack_require__(101); -var TextureSource = __webpack_require__(374); +var Frame = __webpack_require__(103); +var TextureSource = __webpack_require__(377); var TEXTURE_MISSING_ERROR = 'Texture.frame missing: '; @@ -38286,6 +38599,35 @@ var Texture = new Class({ return frame; }, + /** + * Removes the given Frame from this Texture. The Frame is destroyed immediately. + * + * Any Game Objects using this Frame should stop using it _before_ you remove it, + * as it does not happen automatically. + * + * @method Phaser.Textures.Texture#remove + * @since 3.19.0 + * + * @param {string} name - The key of the Frame to remove. + * + * @return {boolean} True if a Frame with the matching key was removed from this Texture. + */ + remove: function (name) + { + if (this.has(name)) + { + var frame = this.get(name); + + frame.destroy(); + + delete this.frames[name]; + + return true; + } + + return false; + }, + /** * Checks to see if a Frame matching the given key exists within this Texture. * @@ -38595,7 +38937,7 @@ module.exports = Texture; /***/ }), -/* 191 */ +/* 193 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38610,45 +38952,45 @@ module.exports = Texture; module.exports = { - Matrix: __webpack_require__(911), + Matrix: __webpack_require__(916), - Add: __webpack_require__(918), - AddAt: __webpack_require__(919), - BringToTop: __webpack_require__(920), - CountAllMatching: __webpack_require__(921), - Each: __webpack_require__(922), - EachInRange: __webpack_require__(923), - FindClosestInSorted: __webpack_require__(261), - GetAll: __webpack_require__(924), - GetFirst: __webpack_require__(925), - GetRandom: __webpack_require__(193), - MoveDown: __webpack_require__(926), - MoveTo: __webpack_require__(927), - MoveUp: __webpack_require__(928), - NumberArray: __webpack_require__(929), - NumberArrayStep: __webpack_require__(930), - QuickSelect: __webpack_require__(386), - Range: __webpack_require__(387), - Remove: __webpack_require__(128), - RemoveAt: __webpack_require__(931), - RemoveBetween: __webpack_require__(932), - RemoveRandomElement: __webpack_require__(933), - Replace: __webpack_require__(934), - RotateLeft: __webpack_require__(277), - RotateRight: __webpack_require__(278), + Add: __webpack_require__(923), + AddAt: __webpack_require__(924), + BringToTop: __webpack_require__(925), + CountAllMatching: __webpack_require__(926), + Each: __webpack_require__(927), + EachInRange: __webpack_require__(928), + FindClosestInSorted: __webpack_require__(264), + GetAll: __webpack_require__(929), + GetFirst: __webpack_require__(930), + GetRandom: __webpack_require__(195), + MoveDown: __webpack_require__(931), + MoveTo: __webpack_require__(932), + MoveUp: __webpack_require__(933), + NumberArray: __webpack_require__(934), + NumberArrayStep: __webpack_require__(935), + QuickSelect: __webpack_require__(389), + Range: __webpack_require__(390), + Remove: __webpack_require__(129), + RemoveAt: __webpack_require__(936), + RemoveBetween: __webpack_require__(937), + RemoveRandomElement: __webpack_require__(938), + Replace: __webpack_require__(939), + RotateLeft: __webpack_require__(280), + RotateRight: __webpack_require__(281), SafeRange: __webpack_require__(72), - SendToBack: __webpack_require__(935), - SetAll: __webpack_require__(936), - Shuffle: __webpack_require__(119), + SendToBack: __webpack_require__(940), + SetAll: __webpack_require__(941), + Shuffle: __webpack_require__(120), SpliceOne: __webpack_require__(84), - StableSort: __webpack_require__(135), - Swap: __webpack_require__(937) + StableSort: __webpack_require__(136), + Swap: __webpack_require__(942) }; /***/ }), -/* 192 */ +/* 194 */ /***/ (function(module, exports) { /** @@ -38709,7 +39051,7 @@ module.exports = CheckMatrix; /***/ }), -/* 193 */ +/* 195 */ /***/ (function(module, exports) { /** @@ -38744,7 +39086,7 @@ module.exports = GetRandom; /***/ }), -/* 194 */ +/* 196 */ /***/ (function(module, exports) { /** @@ -38885,7 +39227,7 @@ module.exports = ParseXMLBitmapFont; /***/ }), -/* 195 */ +/* 197 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38894,13 +39236,13 @@ module.exports = ParseXMLBitmapFont; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlitterRender = __webpack_require__(944); -var Bob = __webpack_require__(947); +var BlitterRender = __webpack_require__(949); +var Bob = __webpack_require__(952); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Frame = __webpack_require__(101); +var Frame = __webpack_require__(103); var GameObject = __webpack_require__(13); -var List = __webpack_require__(133); +var List = __webpack_require__(134); /** * @callback CreateCallback @@ -39184,7 +39526,7 @@ module.exports = Blitter; /***/ }), -/* 196 */ +/* 198 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39194,15 +39536,15 @@ module.exports = Blitter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(191); +var ArrayUtils = __webpack_require__(193); var BlendModes = __webpack_require__(42); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Events = __webpack_require__(118); +var Events = __webpack_require__(119); var GameObject = __webpack_require__(13); var Rectangle = __webpack_require__(11); -var Render = __webpack_require__(948); -var Union = __webpack_require__(389); +var Render = __webpack_require__(953); +var Union = __webpack_require__(392); var Vector2 = __webpack_require__(3); /** @@ -40509,7 +40851,7 @@ module.exports = Container; /***/ }), -/* 197 */ +/* 199 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40518,9 +40860,9 @@ module.exports = Container; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(136); +var BitmapText = __webpack_require__(137); var Class = __webpack_require__(0); -var Render = __webpack_require__(953); +var Render = __webpack_require__(958); /** * @classdesc @@ -40742,7 +41084,7 @@ module.exports = DynamicBitmapText; /***/ }), -/* 198 */ +/* 200 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40751,26 +41093,26 @@ module.exports = DynamicBitmapText; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(120); +var BaseCamera = __webpack_require__(121); var Class = __webpack_require__(0); -var Commands = __webpack_require__(199); -var ComponentsAlpha = __webpack_require__(259); -var ComponentsBlendMode = __webpack_require__(263); -var ComponentsDepth = __webpack_require__(264); -var ComponentsMask = __webpack_require__(268); -var ComponentsPipeline = __webpack_require__(117); -var ComponentsTransform = __webpack_require__(273); -var ComponentsVisible = __webpack_require__(274); -var ComponentsScrollFactor = __webpack_require__(271); +var Commands = __webpack_require__(201); +var ComponentsAlpha = __webpack_require__(262); +var ComponentsBlendMode = __webpack_require__(266); +var ComponentsDepth = __webpack_require__(267); +var ComponentsMask = __webpack_require__(271); +var ComponentsPipeline = __webpack_require__(118); +var ComponentsTransform = __webpack_require__(276); +var ComponentsVisible = __webpack_require__(277); +var ComponentsScrollFactor = __webpack_require__(274); var TransformMatrix = __webpack_require__(35); -var Ellipse = __webpack_require__(102); +var Ellipse = __webpack_require__(104); var GameObject = __webpack_require__(13); var GetFastValue = __webpack_require__(1); var GetValue = __webpack_require__(5); -var MATH_CONST = __webpack_require__(23); -var Render = __webpack_require__(959); +var MATH_CONST = __webpack_require__(21); +var Render = __webpack_require__(964); /** * @classdesc @@ -42292,7 +42634,7 @@ module.exports = Graphics; /***/ }), -/* 199 */ +/* 201 */ /***/ (function(module, exports) { /** @@ -42329,7 +42671,7 @@ module.exports = { /***/ }), -/* 200 */ +/* 202 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42371,7 +42713,7 @@ module.exports = CircumferencePoint; /***/ }), -/* 201 */ +/* 203 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42383,10 +42725,10 @@ module.exports = CircumferencePoint; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var GravityWell = __webpack_require__(397); -var List = __webpack_require__(133); -var ParticleEmitter = __webpack_require__(399); -var Render = __webpack_require__(969); +var GravityWell = __webpack_require__(400); +var List = __webpack_require__(134); +var ParticleEmitter = __webpack_require__(402); +var Render = __webpack_require__(974); /** * @classdesc @@ -42845,7 +43187,7 @@ module.exports = ParticleEmitterManager; /***/ }), -/* 202 */ +/* 204 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42855,16 +43197,16 @@ module.exports = ParticleEmitterManager; */ var BlendModes = __webpack_require__(42); -var Camera = __webpack_require__(120); -var CanvasPool = __webpack_require__(26); +var Camera = __webpack_require__(121); +var CanvasPool = __webpack_require__(27); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(28); -var Frame = __webpack_require__(101); +var CONST = __webpack_require__(34); +var Frame = __webpack_require__(103); var GameObject = __webpack_require__(13); -var Render = __webpack_require__(973); +var Render = __webpack_require__(978); var Utils = __webpack_require__(10); -var UUID = __webpack_require__(405); +var UUID = __webpack_require__(408); /** * @classdesc @@ -43110,6 +43452,17 @@ var RenderTexture = new Class({ */ this.gl = null; + /** + * A reference to the WebGLTexture that is being rendered to in a WebGL Context. + * + * @name Phaser.GameObjects.RenderTexture#glTexture + * @type {WebGLTexture} + * @default null + * @readonly + * @since 3.19.0 + */ + this.glTexture = null; + var renderer = this.renderer; if (renderer.type === CONST.WEBGL) @@ -43117,8 +43470,9 @@ var RenderTexture = new Class({ var gl = renderer.gl; this.gl = gl; + this.glTexture = this.frame.source.glTexture; this.drawGameObject = this.batchGameObjectWebGL; - this.framebuffer = renderer.createFramebuffer(width, height, this.frame.source.glTexture, false); + this.framebuffer = renderer.createFramebuffer(width, height, this.glTexture, false); } else if (renderer.type === CONST.CANVAS) { @@ -43183,7 +43537,8 @@ var RenderTexture = new Class({ { if (this.frame.name === '__BASE') { - // Tesize the texture + // Resize the texture + this.canvas.width = width; this.canvas.height = height; @@ -43194,10 +43549,14 @@ var RenderTexture = new Class({ this.renderer.deleteTexture(this.frame.source.glTexture); this.renderer.deleteFramebuffer(this.framebuffer); - this.frame.source.glTexture = this.renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false); - this.framebuffer = this.renderer.createFramebuffer(width, height, this.frame.source.glTexture, false); + var glTexture = this.renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false); - this.frame.glTexture = this.frame.source.glTexture; + this.framebuffer = this.renderer.createFramebuffer(width, height, glTexture, false); + + this.frame.source.isRenderTexture = true; + + this.frame.glTexture = glTexture; + this.glTexture = glTexture; } this.frame.source.width = width; @@ -43850,8 +44209,6 @@ var RenderTexture = new Class({ * @param {number} [y=0] - The y position to offset the Game Object by. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. * @param {number} [tint] - The tint color to use. If not specified it uses the `globalTint` property. - * - * @return {boolean} `true` if the frame was found and drawn, otherwise `false`. */ batchTextureFrameKey: function (key, frame, x, y, alpha, tint) { @@ -43903,6 +44260,114 @@ var RenderTexture = new Class({ } }, + /** + * Takes a snapshot of the given area of this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture the whole Render Texture see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.GameObjects.RenderTexture#snapshotArea + * @since 3.19.0 + * + * @param {integer} x - The x coordinate to grab from. + * @param {integer} y - The y coordinate to grab from. + * @param {integer} width - The width of the area to grab. + * @param {integer} height - The height of the area to grab. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This Render Texture instance. + */ + snapshotArea: function (x, y, width, height, callback, type, encoderOptions) + { + if (this.gl) + { + this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, x, y, width, height, type, encoderOptions); + } + else + { + this.renderer.snapshotCanvas(this.canvas, callback, false, x, y, width, height, type, encoderOptions); + } + + return this; + }, + + /** + * Takes a snapshot of the whole of this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture just a portion of the Render Texture see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.GameObjects.RenderTexture#snapshot + * @since 3.19.0 + * + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This Render Texture instance. + */ + snapshot: function (callback, type, encoderOptions) + { + if (this.gl) + { + this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, 0, 0, this.width, this.height, type, encoderOptions); + } + else + { + this.renderer.snapshotCanvas(this.canvas, callback, false, 0, 0, this.width, this.height, type, encoderOptions); + } + + return this; + }, + + /** + * Takes a snapshot of the given pixel from this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture the whole Render Texture see the `snapshot` method. To capture a specific portion, see `snapshotArea`. + * + * Unlike the other two snapshot methods, this one will send your callback a `Color` object containing the color data for + * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, + * using less memory, than the other snapshot methods. + * + * @method Phaser.GameObjects.RenderTexture#snapshotPixel + * @since 3.19.0 + * + * @param {integer} x - The x coordinate of the pixel to get. + * @param {integer} y - The y coordinate of the pixel to get. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. + * + * @return {this} This Render Texture instance. + */ + snapshotPixel: function (x, y, callback) + { + if (this.gl) + { + this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, true, x, y); + } + else + { + this.renderer.snapshotCanvas(this.canvas, callback, true, x, y); + } + + return this; + }, + /** * Internal destroy handler, called as part of the destroy process. * @@ -43928,6 +44393,7 @@ var RenderTexture = new Class({ this.context = null; this.framebuffer = null; this.texture = null; + this.glTexture = null; } } @@ -43937,7 +44403,7 @@ module.exports = RenderTexture; /***/ }), -/* 203 */ +/* 205 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43946,17 +44412,17 @@ module.exports = RenderTexture; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(127); -var CanvasPool = __webpack_require__(26); +var AddToDOM = __webpack_require__(128); +var CanvasPool = __webpack_require__(27); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(28); +var GameEvents = __webpack_require__(22); var GameObject = __webpack_require__(13); -var GetTextSize = __webpack_require__(979); +var GetTextSize = __webpack_require__(984); var GetValue = __webpack_require__(5); -var RemoveFromDOM = __webpack_require__(187); -var TextRender = __webpack_require__(980); -var TextStyle = __webpack_require__(983); +var RemoveFromDOM = __webpack_require__(188); +var TextRender = __webpack_require__(985); +var TextStyle = __webpack_require__(988); /** * @classdesc @@ -44023,7 +44489,7 @@ var TextStyle = __webpack_require__(983); * @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|string[])} text - The text this Text object will display. - * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The text style configuration object. + * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The text style configuration object. */ var Text = new Class({ @@ -44230,13 +44696,10 @@ var Text = new Class({ this.lineSpacing = style.lineSpacing; } - if (scene.sys.game.config.renderType === CONST.WEBGL) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function () { - scene.sys.game.renderer.onContextRestored(function () - { - this.dirty = true; - }, this); - } + this.dirty = true; + }, this); }, /** @@ -45345,7 +45808,7 @@ module.exports = Text; /***/ }), -/* 204 */ +/* 206 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45354,14 +45817,14 @@ module.exports = Text; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(27); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(28); +var GameEvents = __webpack_require__(22); var GameObject = __webpack_require__(13); -var GetPowerOfTwo = __webpack_require__(318); -var Smoothing = __webpack_require__(121); -var TileSpriteRender = __webpack_require__(985); +var GetPowerOfTwo = __webpack_require__(321); +var Smoothing = __webpack_require__(122); +var TileSpriteRender = __webpack_require__(990); var Vector2 = __webpack_require__(3); // bitmask flag for GameObject.renderMask @@ -45625,17 +46088,15 @@ var TileSprite = new Class({ this.setOriginFromFrame(); this.initPipeline(); - if (scene.sys.game.config.renderType === CONST.WEBGL) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) { - scene.sys.game.renderer.onContextRestored(function (renderer) - { - var gl = renderer.gl; + var gl = renderer.gl; - this.dirty = true; - this.fillPattern = null; - this.fillPattern = renderer.createTexture2D(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.fillCanvas, this.potWidth, this.potHeight); - }, this); - } + this.dirty = true; + this.fillPattern = null; + this.fillPattern = renderer.createTexture2D(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.fillCanvas, this.potWidth, this.potHeight); + + }, this); }, /** @@ -45982,7 +46443,7 @@ module.exports = TileSprite; /***/ }), -/* 205 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45992,8 +46453,9 @@ module.exports = TileSprite; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(206); -var GetPoints = __webpack_require__(415); +var Contains = __webpack_require__(208); +var GetPoints = __webpack_require__(418); +var GEOM_CONST = __webpack_require__(52); /** * @classdesc @@ -46024,6 +46486,17 @@ var Polygon = new Class({ function Polygon (points) { + /** + * The geometry constant type of this object: `GEOM_CONST.POLYGON`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Polygon#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.POLYGON; + /** * The area of this Polygon. * @@ -46203,7 +46676,7 @@ module.exports = Polygon; /***/ }), -/* 206 */ +/* 208 */ /***/ (function(module, exports) { /** @@ -46252,7 +46725,7 @@ module.exports = Contains; /***/ }), -/* 207 */ +/* 209 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46262,7 +46735,7 @@ module.exports = Contains; */ var Class = __webpack_require__(0); -var Mesh = __webpack_require__(137); +var Mesh = __webpack_require__(138); /** * @classdesc @@ -46913,7 +47386,7 @@ module.exports = Quad; /***/ }), -/* 208 */ +/* 210 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46926,9 +47399,9 @@ var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); var GetFastValue = __webpack_require__(1); -var Merge = __webpack_require__(69); -var SetValue = __webpack_require__(423); -var ShaderRender = __webpack_require__(1064); +var Extend = __webpack_require__(15); +var SetValue = __webpack_require__(426); +var ShaderRender = __webpack_require__(1069); var TransformMatrix = __webpack_require__(35); /** @@ -47218,12 +47691,163 @@ var Shader = new Class({ */ this._textureCount = 0; + /** + * A reference to the GL Frame Buffer this Shader is drawing to. + * This property is only set if you have called `Shader.setRenderToTexture`. + * + * @name Phaser.GameObjects.Shader#framebuffer + * @type {?WebGLFramebuffer} + * @since 3.19.0 + */ + this.framebuffer = null; + + /** + * A reference to the WebGLTexture this Shader is rendering to. + * This property is only set if you have called `Shader.setRenderToTexture`. + * + * @name Phaser.GameObjects.Shader#glTexture + * @type {?WebGLTexture} + * @since 3.19.0 + */ + this.glTexture = null; + + /** + * A flag that indicates if this Shader has been set to render to a texture instead of the display list. + * + * This property is `true` if you have called `Shader.setRenderToTexture`, otherwise it's `false`. + * + * A Shader that is rendering to a texture _does not_ appear on the display list. + * + * @name Phaser.GameObjects.Shader#renderToTexture + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this.renderToTexture = false; + + /** + * A reference to the Phaser.Textures.Texture that has been stored in the Texture Manager for this Shader. + * + * This property is only set if you have called `Shader.setRenderToTexture`, otherwise it is `null`. + * + * @name Phaser.GameObjects.Shader#texture + * @type {Phaser.Textures.Texture} + * @since 3.19.0 + */ + this.texture = null; + + /** + * Internal saved texture key. + * + * @name Phaser.GameObjects.Shader#_savedKey + * @type {boolean} + * @private + * @since 3.19.0 + */ + this._savedKey = ''; + this.setPosition(x, y); this.setSize(width, height); this.setOrigin(0.5, 0.5); this.setShader(key, textures); }, + /** + * 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.Shader#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) + { + if (this.renderToTexture) + { + return true; + } + else + { + return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + } + }, + + /** + * Changes this Shader so instead of rendering to the display list it renders to a + * WebGL Framebuffer and WebGL Texture instead. This allows you to use the output + * of this shader as an input for another shader, by mapping a sampler2D uniform + * to it. + * + * After calling this method the `Shader.framebuffer` and `Shader.glTexture` properties + * are populated. + * + * Additionally, you can provide a key to this method. Doing so will create a Phaser Texture + * from this Shader and save it into the Texture Manager, allowing you to then use it for + * any texture-based Game Object, such as a Sprite or Image: + * + * ```javascript + * var shader = this.add.shader('myShader', x, y, width, height); + * + * shader.setRenderToTexture('doodle'); + * + * this.add.image(400, 300, 'doodle'); + * ``` + * + * Note that it stores an active reference to this Shader. That means as this shader updates, + * so does the texture and any object using it to render with. Also, if you destroy this + * shader, be sure to clear any objects that may have been using it as a texture too. + * + * You can access the Phaser Texture that is created via the `Shader.texture` property. + * + * By default it will create a single base texture. You can add frames to the texture + * by using the `Texture.add` method. After doing this, you can then allow Game Objects + * to use a specific frame from a Render Texture. + * + * @method Phaser.GameObjects.Shader#setRenderToTexture + * @since 3.19.0 + * + * @param {string} [key] - The unique key to store the texture as within the global Texture Manager. + * @param {boolean} [flipY=false] - Does this texture need vertically flipping before rendering? This should usually be set to `true` if being fed from a buffer. + * + * @return {this} This Shader instance. + */ + setRenderToTexture: function (key, flipY) + { + if (flipY === undefined) { flipY = false; } + + if (!this.renderToTexture) + { + var width = this.width; + var height = this.height; + var renderer = this.renderer; + + this.glTexture = renderer.createTextureFromSource(null, width, height, 0); + + this.glTexture.flipY = flipY; + + this.framebuffer = renderer.createFramebuffer(width, height, this.glTexture, false); + + this._rendererWidth = width; + this._rendererHeight = height; + + this.renderToTexture = true; + + this.projOrtho(0, this.width, this.height, 0); + + if (key) + { + this._savedKey = key; + + this.texture = this.scene.sys.textures.addGLTexture(key, this.glTexture, width, height); + } + } + + return this; + }, + /** * Sets the fragment and, optionally, the vertex shader source code that this Shader will use. * This will immediately delete the active shader program, if set, and then create a new one @@ -47279,7 +47903,7 @@ var Shader = new Class({ // The default uniforms available within the fragment shader var defaultUniforms = { - resolution: { type: '2f', value: { x: this.width, y: this.height }}, + resolution: { type: '2f', value: { x: this.width, y: this.height } }, time: { type: '1f', value: 0 }, mouse: { type: '2f', value: { x: this.width / 2, y: this.height / 2 } }, date: { type: '4fv', value: [ d.getFullYear(), d.getMonth(), d.getDate(), d.getHours() * 60 * 60 + d.getMinutes() * 60 + d.getSeconds() ] }, @@ -47289,10 +47913,10 @@ var Shader = new Class({ iChannel2: { type: 'sampler2D', value: null, textureData: { repeat: true } }, iChannel3: { type: 'sampler2D', value: null, textureData: { repeat: true } } }; - + if (this.shader.uniforms) { - this.uniforms = Merge(this.shader.uniforms, defaultUniforms); + this.uniforms = Extend(true, {}, this.shader.uniforms, defaultUniforms); } else { @@ -47309,7 +47933,7 @@ var Shader = new Class({ this.initUniforms(); - this.projOrtho(0, renderer.width, renderer.height, 0); + this.projOrtho(0, this._rendererWidth, this._rendererHeight, 0); return this; }, @@ -47409,12 +48033,66 @@ var Shader = new Class({ } }, + /** + * Sets a sampler2D uniform on this shader where the source texture is a WebGLTexture. + * + * This allows you to feed the output from one Shader into another: + * + * ```javascript + * let shader1 = this.add.shader(baseShader1, 0, 0, 512, 512).setRenderToTexture(); + * let shader2 = this.add.shader(baseShader2, 0, 0, 512, 512).setRenderToTexture('output'); + * + * shader1.setSampler2DBuffer('iChannel0', shader2.glTexture, 512, 512); + * shader2.setSampler2DBuffer('iChannel0', shader1.glTexture, 512, 512); + * ``` + * + * In the above code, the result of baseShader1 is fed into Shader2 as the `iChannel0` sampler2D uniform. + * The result of baseShader2 is then fed back into shader1 again, creating a feedback loop. + * + * If you wish to use an image from the Texture Manager as a sampler2D input for this shader, + * see the `Shader.setSampler2D` method. + * + * @method Phaser.GameObjects.Shader#setSampler2DBuffer + * @since 3.19.0 + * + * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`. + * @param {WebGLTexture} texture - A WebGLTexture reference. + * @param {integer} width - The width of the texture. + * @param {integer} height - The height of the texture. + * @param {integer} [textureIndex=0] - The texture index. + * @param {any} [textureData] - Additional texture data. + * + * @return {this} This Shader instance. + */ + setSampler2DBuffer: function (uniformKey, texture, width, height, textureIndex, textureData) + { + if (textureIndex === undefined) { textureIndex = 0; } + if (textureData === undefined) { textureData = {}; } + + var uniform = this.uniforms[uniformKey]; + + uniform.value = texture; + + textureData.width = width; + textureData.height = height; + + uniform.textureData = textureData; + + this._textureCount = textureIndex; + + this.initSampler2D(uniform); + + return this; + }, + /** * Sets a sampler2D uniform on this shader. * * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. * + * If you wish to use another Shader as a sampler2D input for this shader, see the `Shader.setSampler2DBuffer` method. + * * @method Phaser.GameObjects.Shader#setSampler2D * @since 3.17.0 * @@ -47435,11 +48113,23 @@ var Shader = new Class({ { var frame = textureManager.getFrame(textureKey); var uniform = this.uniforms[uniformKey]; + var source = frame.source; uniform.textureKey = textureKey; - uniform.source = frame.source.image; + uniform.source = source.image; uniform.value = frame.glTexture; + if (source.isGLTexture) + { + if (!textureData) + { + textureData = {}; + } + + textureData.width = source.width; + textureData.height = source.height; + } + if (textureData) { uniform.textureData = textureData; @@ -47681,6 +48371,11 @@ var Shader = new Class({ location = uniform.uniformLocation; value = uniform.value; + if (value === null) + { + continue; + } + if (length === 1) { if (uniform.glMatrix) @@ -47727,35 +48422,40 @@ var Shader = new Class({ * @method Phaser.GameObjects.Shader#load * @since 3.17.0 * - * @param {Phaser.GameObjects.Components.TransformMatrix} matrix2D - The transform matrix to use during rendering. + * @param {Phaser.GameObjects.Components.TransformMatrix} [matrix2D] - The transform matrix to use during rendering. */ load: function (matrix2D) { // ITRS + var gl = this.gl; var width = this.width; var height = this.height; var renderer = this.renderer; var program = this.program; - - var x = -this._displayOriginX; - var y = -this._displayOriginY; - var vm = this.viewMatrix; - vm[0] = matrix2D[0]; - vm[1] = matrix2D[1]; - vm[4] = matrix2D[2]; - vm[5] = matrix2D[3]; - vm[8] = matrix2D[4]; - vm[9] = matrix2D[5]; - vm[12] = vm[0] * x + vm[4] * y; - vm[13] = vm[1] * x + vm[5] * y; + if (!this.renderToTexture) + { + var x = -this._displayOriginX; + var y = -this._displayOriginY; + + vm[0] = matrix2D[0]; + vm[1] = matrix2D[1]; + vm[4] = matrix2D[2]; + vm[5] = matrix2D[3]; + vm[8] = matrix2D[4]; + vm[9] = matrix2D[5]; + vm[12] = vm[0] * x + vm[4] * y; + vm[13] = vm[1] * x + vm[5] * y; + } // Update vertex shader uniforms - this.renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); - this.renderer.setFloat2(program, 'uResolution', this.width, this.height); + gl.useProgram(program); + + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uViewMatrix'), false, vm); + gl.uniform2f(gl.getUniformLocation(program, 'uResolution'), this.width, this.height); // Update fragment shader uniforms @@ -47804,8 +48504,16 @@ var Shader = new Class({ var renderer = this.renderer; var vertexSize = Float32Array.BYTES_PER_ELEMENT * 2; - renderer.setProgram(program); - renderer.setVertexBuffer(vertexBuffer); + if (this.renderToTexture) + { + renderer.setFramebuffer(this.framebuffer); + + gl.clearColor(0, 0, 0, 0); + + gl.clear(gl.COLOR_BUFFER_BIT); + } + + gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); var location = gl.getAttribLocation(program, 'inPosition'); @@ -47834,6 +48542,11 @@ var Shader = new Class({ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); gl.drawArrays(gl.TRIANGLES, 0, vertexCount); + + if (this.renderToTexture) + { + renderer.setFramebuffer(null, false); + } }, /** @@ -47873,6 +48586,17 @@ var Shader = new Class({ gl.deleteProgram(this.program); gl.deleteBuffer(this.vertexBuffer); + + if (this.renderToTexture) + { + this.renderer.deleteFramebuffer(this.framebuffer); + + this.texture.destroy(); + + this.framebuffer = null; + this.glTexture = null; + this.texture = null; + } } }); @@ -47881,7 +48605,7 @@ module.exports = Shader; /***/ }), -/* 209 */ +/* 211 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47892,7 +48616,7 @@ module.exports = Shader; */ var Point = __webpack_require__(4); -var LineToCircle = __webpack_require__(210); +var LineToCircle = __webpack_require__(212); /** * Checks for intersection between the line segment and circle, @@ -47973,7 +48697,7 @@ module.exports = GetLineToCircle; /***/ }), -/* 210 */ +/* 212 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48057,7 +48781,7 @@ module.exports = LineToCircle; /***/ }), -/* 211 */ +/* 213 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48068,8 +48792,8 @@ module.exports = LineToCircle; */ var Point = __webpack_require__(4); -var LineToLine = __webpack_require__(90); -var LineToRectangle = __webpack_require__(430); +var LineToLine = __webpack_require__(92); +var LineToRectangle = __webpack_require__(433); /** * Checks for intersection between the Line and a Rectangle shape, @@ -48117,7 +48841,7 @@ module.exports = GetLineToRectangle; /***/ }), -/* 212 */ +/* 214 */ /***/ (function(module, exports) { /** @@ -48204,7 +48928,7 @@ module.exports = ContainsArray; /***/ }), -/* 213 */ +/* 215 */ /***/ (function(module, exports) { /** @@ -48252,7 +48976,7 @@ module.exports = RotateAroundXY; /***/ }), -/* 214 */ +/* 216 */ /***/ (function(module, exports) { /** @@ -48280,7 +49004,7 @@ module.exports = GetAspectRatio; /***/ }), -/* 215 */ +/* 217 */ /***/ (function(module, exports) { /** @@ -48334,7 +49058,7 @@ module.exports = RotateAroundXY; /***/ }), -/* 216 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48349,18 +49073,18 @@ module.exports = RotateAroundXY; module.exports = { - BUTTON_DOWN: __webpack_require__(1185), - BUTTON_UP: __webpack_require__(1186), - CONNECTED: __webpack_require__(1187), - DISCONNECTED: __webpack_require__(1188), - GAMEPAD_BUTTON_DOWN: __webpack_require__(1189), - GAMEPAD_BUTTON_UP: __webpack_require__(1190) + BUTTON_DOWN: __webpack_require__(1190), + BUTTON_UP: __webpack_require__(1191), + CONNECTED: __webpack_require__(1192), + DISCONNECTED: __webpack_require__(1193), + GAMEPAD_BUTTON_DOWN: __webpack_require__(1194), + GAMEPAD_BUTTON_UP: __webpack_require__(1195) }; /***/ }), -/* 217 */ +/* 219 */ /***/ (function(module, exports) { /** @@ -48401,7 +49125,7 @@ module.exports = GetURL; /***/ }), -/* 218 */ +/* 220 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48410,8 +49134,8 @@ module.exports = GetURL; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(20); -var XHRSettings = __webpack_require__(141); +var Extend = __webpack_require__(15); +var XHRSettings = __webpack_require__(142); /** * Takes two XHRSettings Objects and creates a new XHRSettings object from them. @@ -48449,7 +49173,7 @@ module.exports = MergeXHRSettings; /***/ }), -/* 219 */ +/* 221 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48459,12 +49183,12 @@ module.exports = MergeXHRSettings; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); -var ParseXML = __webpack_require__(360); +var ParseXML = __webpack_require__(363); /** * @classdesc @@ -48634,7 +49358,7 @@ module.exports = XMLFile; /***/ }), -/* 220 */ +/* 222 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48649,69 +49373,18 @@ module.exports = XMLFile; module.exports = { - Acceleration: __webpack_require__(1245), - Angular: __webpack_require__(1246), - Bounce: __webpack_require__(1247), - Debug: __webpack_require__(1248), - Drag: __webpack_require__(1249), - Enable: __webpack_require__(1250), - Friction: __webpack_require__(1251), - Gravity: __webpack_require__(1252), - Immovable: __webpack_require__(1253), - Mass: __webpack_require__(1254), - Size: __webpack_require__(1255), - Velocity: __webpack_require__(1256) - -}; - - -/***/ }), -/* 221 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Physics.Arcade.Events - */ - -module.exports = { - - COLLIDE: __webpack_require__(1258), - OVERLAP: __webpack_require__(1259), - PAUSE: __webpack_require__(1260), - RESUME: __webpack_require__(1261), - TILE_COLLIDE: __webpack_require__(1262), - TILE_OVERLAP: __webpack_require__(1263), - WORLD_BOUNDS: __webpack_require__(1264), - WORLD_STEP: __webpack_require__(1265) - -}; - - -/***/ }), -/* 222 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Physics.Impact.Events - */ - -module.exports = { - - COLLIDE: __webpack_require__(1277), - PAUSE: __webpack_require__(1278), - RESUME: __webpack_require__(1279) + Acceleration: __webpack_require__(1250), + Angular: __webpack_require__(1251), + Bounce: __webpack_require__(1252), + Debug: __webpack_require__(1253), + Drag: __webpack_require__(1254), + Enable: __webpack_require__(1255), + Friction: __webpack_require__(1256), + Gravity: __webpack_require__(1257), + Immovable: __webpack_require__(1258), + Mass: __webpack_require__(1259), + Size: __webpack_require__(1260), + Velocity: __webpack_require__(1261) }; @@ -48727,23 +49400,19 @@ module.exports = { */ /** - * @namespace Phaser.Physics.Impact.Components + * @namespace Phaser.Physics.Arcade.Events */ module.exports = { - Acceleration: __webpack_require__(1281), - BodyScale: __webpack_require__(1282), - BodyType: __webpack_require__(1283), - Bounce: __webpack_require__(1284), - CheckAgainst: __webpack_require__(1285), - Collides: __webpack_require__(1286), - Debug: __webpack_require__(1287), - Friction: __webpack_require__(1288), - Gravity: __webpack_require__(1289), - Offset: __webpack_require__(1290), - SetGameObject: __webpack_require__(1291), - Velocity: __webpack_require__(1292) + COLLIDE: __webpack_require__(1263), + OVERLAP: __webpack_require__(1264), + PAUSE: __webpack_require__(1265), + RESUME: __webpack_require__(1266), + TILE_COLLIDE: __webpack_require__(1267), + TILE_OVERLAP: __webpack_require__(1268), + WORLD_BOUNDS: __webpack_require__(1269), + WORLD_STEP: __webpack_require__(1270) }; @@ -48752,6 +49421,61 @@ module.exports = { /* 224 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Physics.Impact.Events + */ + +module.exports = { + + COLLIDE: __webpack_require__(1282), + PAUSE: __webpack_require__(1283), + RESUME: __webpack_require__(1284) + +}; + + +/***/ }), +/* 225 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Physics.Impact.Components + */ + +module.exports = { + + Acceleration: __webpack_require__(1286), + BodyScale: __webpack_require__(1287), + BodyType: __webpack_require__(1288), + Bounce: __webpack_require__(1289), + CheckAgainst: __webpack_require__(1290), + Collides: __webpack_require__(1291), + Debug: __webpack_require__(1292), + Friction: __webpack_require__(1293), + Gravity: __webpack_require__(1294), + Offset: __webpack_require__(1295), + SetGameObject: __webpack_require__(1296), + Velocity: __webpack_require__(1297) + +}; + + +/***/ }), +/* 226 */ +/***/ (function(module, exports, __webpack_require__) { + /** * The `Matter.Axes` module contains methods for creating and manipulating sets of axes. * @@ -48763,7 +49487,7 @@ var Axes = {}; module.exports = Axes; var Vector = __webpack_require__(37); -var Common = __webpack_require__(16); +var Common = __webpack_require__(17); (function() { @@ -48819,7 +49543,7 @@ var Common = __webpack_require__(16); /***/ }), -/* 225 */ +/* 227 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48834,24 +49558,24 @@ var Common = __webpack_require__(16); module.exports = { - AFTER_UPDATE: __webpack_require__(1310), - BEFORE_UPDATE: __webpack_require__(1311), - COLLISION_ACTIVE: __webpack_require__(1312), - COLLISION_END: __webpack_require__(1313), - COLLISION_START: __webpack_require__(1314), - DRAG_END: __webpack_require__(1315), - DRAG: __webpack_require__(1316), - DRAG_START: __webpack_require__(1317), - PAUSE: __webpack_require__(1318), - RESUME: __webpack_require__(1319), - SLEEP_END: __webpack_require__(1320), - SLEEP_START: __webpack_require__(1321) + AFTER_UPDATE: __webpack_require__(1314), + BEFORE_UPDATE: __webpack_require__(1315), + COLLISION_ACTIVE: __webpack_require__(1316), + COLLISION_END: __webpack_require__(1317), + COLLISION_START: __webpack_require__(1318), + DRAG_END: __webpack_require__(1319), + DRAG: __webpack_require__(1320), + DRAG_START: __webpack_require__(1321), + PAUSE: __webpack_require__(1322), + RESUME: __webpack_require__(1323), + SLEEP_END: __webpack_require__(1324), + SLEEP_START: __webpack_require__(1325) }; /***/ }), -/* 226 */ +/* 228 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48860,13 +49584,13 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(57); -var Body = __webpack_require__(24); +var Bodies = __webpack_require__(58); +var Body = __webpack_require__(25); var Class = __webpack_require__(0); -var Components = __webpack_require__(143); +var Components = __webpack_require__(144); var GetFastValue = __webpack_require__(1); -var HasValue = __webpack_require__(88); -var Vertices = __webpack_require__(32); +var HasValue = __webpack_require__(90); +var Vertices = __webpack_require__(31); /** * @classdesc @@ -49164,7 +49888,7 @@ module.exports = MatterTileBody; /***/ }), -/* 227 */ +/* 229 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -49179,8 +49903,8 @@ var Detector = {}; module.exports = Detector; -var SAT = __webpack_require__(228); -var Pair = __webpack_require__(144); +var SAT = __webpack_require__(230); +var Pair = __webpack_require__(145); var Bounds = __webpack_require__(38); (function() { @@ -49277,7 +50001,7 @@ var Bounds = __webpack_require__(38); /***/ }), -/* 228 */ +/* 230 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -49292,7 +50016,7 @@ var SAT = {}; module.exports = SAT; -var Vertices = __webpack_require__(32); +var Vertices = __webpack_require__(31); var Vector = __webpack_require__(37); (function() { @@ -49553,7 +50277,7 @@ var Vector = __webpack_require__(37); /***/ }), -/* 229 */ +/* 231 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -49562,36 +50286,40 @@ var Vector = __webpack_require__(37); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Matter = __webpack_require__(483); +/** + * @namespace Phaser.Physics.Matter.Matter + */ -Matter.Body = __webpack_require__(24); +var Matter = __webpack_require__(487); + +Matter.Body = __webpack_require__(25); Matter.Composite = __webpack_require__(76); -Matter.World = __webpack_require__(231); +Matter.World = __webpack_require__(233); -Matter.Detector = __webpack_require__(227); -Matter.Grid = __webpack_require__(484); -Matter.Pairs = __webpack_require__(485); -Matter.Pair = __webpack_require__(144); -Matter.Query = __webpack_require__(1325); -Matter.Resolver = __webpack_require__(486); -Matter.SAT = __webpack_require__(228); +Matter.Detector = __webpack_require__(229); +Matter.Grid = __webpack_require__(488); +Matter.Pairs = __webpack_require__(489); +Matter.Pair = __webpack_require__(145); +Matter.Query = __webpack_require__(1329); +Matter.Resolver = __webpack_require__(490); +Matter.SAT = __webpack_require__(230); -Matter.Constraint = __webpack_require__(93); +Matter.Constraint = __webpack_require__(95); -Matter.Common = __webpack_require__(16); -Matter.Engine = __webpack_require__(487); -Matter.Events = __webpack_require__(92); -Matter.Sleeping = __webpack_require__(110); -Matter.Plugin = __webpack_require__(230); +Matter.Common = __webpack_require__(17); +Matter.Engine = __webpack_require__(491); +Matter.Events = __webpack_require__(94); +Matter.Sleeping = __webpack_require__(111); +Matter.Plugin = __webpack_require__(232); -Matter.Bodies = __webpack_require__(57); -Matter.Composites = __webpack_require__(480); +Matter.Bodies = __webpack_require__(58); +Matter.Composites = __webpack_require__(483); -Matter.Axes = __webpack_require__(224); +Matter.Axes = __webpack_require__(226); Matter.Bounds = __webpack_require__(38); -Matter.Svg = __webpack_require__(1327); +Matter.Svg = __webpack_require__(1331); Matter.Vector = __webpack_require__(37); -Matter.Vertices = __webpack_require__(32); +Matter.Vertices = __webpack_require__(31); // aliases @@ -49606,7 +50334,7 @@ module.exports = Matter; /***/ }), -/* 230 */ +/* 232 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -49619,7 +50347,7 @@ var Plugin = {}; module.exports = Plugin; -var Common = __webpack_require__(16); +var Common = __webpack_require__(17); (function() { @@ -49956,7 +50684,7 @@ var Common = __webpack_require__(16); /***/ }), -/* 231 */ +/* 233 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -49977,8 +50705,8 @@ var World = {}; module.exports = World; var Composite = __webpack_require__(76); -var Constraint = __webpack_require__(93); -var Common = __webpack_require__(16); +var Constraint = __webpack_require__(95); +var Common = __webpack_require__(17); (function() { @@ -50109,7 +50837,7 @@ var Common = __webpack_require__(16); /***/ }), -/* 232 */ +/* 234 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50118,7 +50846,7 @@ var Common = __webpack_require__(16); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(146); +var GetTileAt = __webpack_require__(147); /** * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting @@ -50185,7 +50913,7 @@ module.exports = CalculateFacesAt; /***/ }), -/* 233 */ +/* 235 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50195,8 +50923,8 @@ module.exports = CalculateFacesAt; */ var Tile = __webpack_require__(78); -var IsInLayerBounds = __webpack_require__(111); -var CalculateFacesAt = __webpack_require__(232); +var IsInLayerBounds = __webpack_require__(112); +var CalculateFacesAt = __webpack_require__(234); var SetTileCollision = __webpack_require__(77); /** @@ -50265,7 +50993,7 @@ module.exports = PutTileAt; /***/ }), -/* 234 */ +/* 236 */ /***/ (function(module, exports) { /** @@ -50304,7 +51032,7 @@ module.exports = SetLayerCollisionIndex; /***/ }), -/* 235 */ +/* 237 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50313,9 +51041,9 @@ module.exports = SetLayerCollisionIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(34); -var LayerData = __webpack_require__(112); -var MapData = __webpack_require__(113); +var Formats = __webpack_require__(33); +var LayerData = __webpack_require__(113); +var MapData = __webpack_require__(114); var Tile = __webpack_require__(78); /** @@ -50396,7 +51124,7 @@ module.exports = Parse2DArray; /***/ }), -/* 236 */ +/* 238 */ /***/ (function(module, exports) { /** @@ -50486,7 +51214,7 @@ module.exports = ParseGID; /***/ }), -/* 237 */ +/* 239 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50495,8 +51223,8 @@ module.exports = ParseGID; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pick = __webpack_require__(501); -var ParseGID = __webpack_require__(236); +var Pick = __webpack_require__(505); +var ParseGID = __webpack_require__(238); var copyPoints = function (p) { return { x: p.x, y: p.y }; }; @@ -50568,7 +51296,7 @@ module.exports = ParseObject; /***/ }), -/* 238 */ +/* 240 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50577,10 +51305,10 @@ module.exports = ParseObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(34); -var MapData = __webpack_require__(113); -var Parse = __webpack_require__(493); -var Tilemap = __webpack_require__(509); +var Formats = __webpack_require__(33); +var MapData = __webpack_require__(114); +var Parse = __webpack_require__(497); +var Tilemap = __webpack_require__(513); /** * Create a Tilemap from the given key or data. If neither is given, make a blank Tilemap. When @@ -50654,7 +51382,7 @@ module.exports = ParseToTilemap; /***/ }), -/* 239 */ +/* 241 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50703,7 +51431,7 @@ module.exports = GetTargets; /***/ }), -/* 240 */ +/* 242 */ /***/ (function(module, exports) { /** @@ -50712,6 +51440,14 @@ module.exports = GetTargets; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +/** + * @ignore + */ +function hasGetActive (def) +{ + return (!!def.getActive && typeof def.getActive === 'function'); +} + /** * @ignore */ @@ -50733,13 +51469,28 @@ function hasGetEnd (def) */ function hasGetters (def) { - return hasGetStart(def) || hasGetEnd(def); + return hasGetStart(def) || hasGetEnd(def) || hasGetActive(def); } /** - * Returns `getStart` and `getEnd` functions for a Tween's Data based on a target property and end value. + * Returns `getActive`, `getStart` and `getEnd` functions for a TweenData based on a target property and end value. + * + * `getActive` if not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * `getEnd` is invoked once any start delays have expired and returns what the value should tween to. + * `getStart` is invoked when the tween reaches the end and needs to either repeat or yoyo, it returns the value to go back to. * - * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. A string can be provided to specify a relative end value which consists of an operation (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current value, or `/=` to divide the current value) followed by its operand. A function can be provided to allow greater control over the end value; it will receive the target object being tweened, the name of the property being tweened, and the current value of the property as its arguments. If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` property is provided, the property will be used as the effective value under the same rules described here. + * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. + * A string can be provided to specify a relative end value which consists of an operation + * (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current + * value, or `/=` to divide the current value) followed by its operand. + * + * A function can be provided to allow greater control over the end value; it will receive the target + * object being tweened, the name of the property being tweened, and the current value of the property + * as its arguments. + * + * If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` + * callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` + * property is provided, the property will be used as the effective value under the same rules described here. * * @function Phaser.Tweens.Builders.GetValueOp * @since 3.0.0 @@ -50747,7 +51498,7 @@ function hasGetters (def) * @param {string} key - The name of the property to modify. * @param {*} propertyValue - The ending value of the property, as described above. * - * @return {function} An array of two functions, `getStart` and `getEnd`, which return the starting and the ending value of the property based on the provided value. + * @return {function} An array of functions, `getActive`, `getStart` and `getEnd`, which return the starting and the ending value of the property based on the provided value. */ var GetValueOp = function (key, propertyValue) { @@ -50759,6 +51510,9 @@ var GetValueOp = function (key, propertyValue) // The returned value sets what the property will be at the START of the Tween (usually called at the end of the Tween) var getStart = function (target, key, value) { return value; }; + // What to set the property to the moment the TweenData is invoked + var getActive = null; + var t = typeof(propertyValue); if (t === 'number') @@ -50827,54 +51581,112 @@ var GetValueOp = function (key, propertyValue) // The same as setting just the getEnd function and no getStart // props: { - // x: function (target, key, value) { return value + 50); }, + // x: function (target, key, value, targetIndex, totalTargets, tween) { return value + 50); }, // } getEnd = propertyValue; } - else if (t === 'object' && hasGetters(propertyValue)) + else if (t === 'object') { - /* - x: { - // Called at the start of the Tween. The returned value sets what the property will be at the END of the Tween. - getEnd: function (target, key, value) - { - return value; - }, + if (hasGetters(propertyValue)) + { + /* + x: { + // Called the moment Tween is active. The returned value sets the property on the target immediately. + getActive: function (target, key, value, targetIndex, totalTargets, tween) + { + return value; + }, - // Called at the end of the Tween. The returned value sets what the property will be at the START of the Tween. - getStart: function (target, key, value) + // Called at the start of the Tween. The returned value sets what the property will be at the END of the Tween. + getEnd: function (target, key, value, targetIndex, totalTargets, tween) + { + return value; + }, + + // Called at the end of the Tween. The returned value sets what the property will be at the START of the Tween. + getStart: function (target, key, value, targetIndex, totalTargets, tween) + { + return value; + } + } + */ + + if (hasGetActive(propertyValue)) { - return value; + getActive = propertyValue.getActive; + } + + if (hasGetEnd(propertyValue)) + { + getEnd = propertyValue.getEnd; + } + + if (hasGetStart(propertyValue)) + { + getStart = propertyValue.getStart; } } - */ - - if (hasGetEnd(propertyValue)) + else if (propertyValue.hasOwnProperty('value')) { - getEnd = propertyValue.getEnd; - } + // 'value' may still be a string, function or a number + // props: { + // x: { value: 400, ... }, + // y: { value: 300, ... } + // } - if (hasGetStart(propertyValue)) + callbacks = GetValueOp(key, propertyValue.value); + } + else { - getStart = propertyValue.getStart; - } - } - else if (propertyValue.hasOwnProperty('value')) - { - // Value may still be a string, function or a number - // props: { - // x: { value: 400, ... }, - // y: { value: 300, ... } - // } + // 'from' and 'to' may still be a string, function or a number + // props: { + // x: { from: 400, to: 600 }, + // y: { from: 300, to: 500 } + // } - callbacks = GetValueOp(key, propertyValue.value); + // Same as above, but the 'start' value is set immediately on the target + // props: { + // x: { start: 400, to: 600 }, + // y: { start: 300, to: 500 } + // } + + // 'start' value is set immediately, then it goes 'from' to 'to' during the tween + // props: { + // x: { start: 200, from: 400, to: 600 }, + // y: { start: 300, from: 300, to: 500 } + // } + + var hasTo = propertyValue.hasOwnProperty('to'); + var hasFrom = propertyValue.hasOwnProperty('from'); + var hasStart = propertyValue.hasOwnProperty('start'); + + if (hasTo && (hasFrom || hasStart)) + { + callbacks = GetValueOp(key, propertyValue.to); + + if (hasStart) + { + var startCallbacks = GetValueOp(key, propertyValue.start); + + callbacks.getActive = startCallbacks.getEnd; + } + + if (hasFrom) + { + var fromCallbacks = GetValueOp(key, propertyValue.from); + + callbacks.getStart = fromCallbacks.getEnd; + } + } + } } // If callback not set by the else if block above then set it here and return it if (!callbacks) { callbacks = { + getActive: getActive, getEnd: getEnd, getStart: getStart }; @@ -50887,7 +51699,7 @@ module.exports = GetValueOp; /***/ }), -/* 241 */ +/* 243 */ /***/ (function(module, exports) { /** @@ -50931,7 +51743,7 @@ module.exports = TWEEN_DEFAULTS; /***/ }), -/* 242 */ +/* 244 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50941,9 +51753,11 @@ module.exports = TWEEN_DEFAULTS; */ var Class = __webpack_require__(0); -var GameObjectCreator = __webpack_require__(15); +var EventEmitter = __webpack_require__(9); +var Events = __webpack_require__(245); +var GameObjectCreator = __webpack_require__(16); var GameObjectFactory = __webpack_require__(6); -var TWEEN_CONST = __webpack_require__(97); +var TWEEN_CONST = __webpack_require__(99); /** * @classdesc @@ -50953,6 +51767,7 @@ var TWEEN_CONST = __webpack_require__(97); * * @class Tween * @memberof Phaser.Tweens + * @extends Phaser.Events.EventEmitter * @constructor * @since 3.0.0 * @@ -50962,10 +51777,14 @@ var TWEEN_CONST = __webpack_require__(97); */ var Tween = new Class({ + Extends: EventEmitter, + initialize: function Tween (parent, data, targets) { + EventEmitter.call(this); + /** * A reference to the parent of this Tween. * Either the Tween Manager or a Tween Timeline instance. @@ -51073,6 +51892,40 @@ var Tween = new Class({ */ this.loopCounter = 0; + /** + * Time in ms/frames before the 'onStart' event fires. + * This is the shortest `delay` value across all of the TweenDatas of this Tween. + * + * @name Phaser.Tweens.Tween#startDelay + * @type {number} + * @default 0 + * @since 3.19.0 + */ + this.startDelay = 0; + + /** + * Has this Tween started playback yet? + * This boolean is toggled when the Tween leaves the 'delayed' state and starts running. + * + * @name Phaser.Tweens.Tween#hasStarted + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this.hasStarted = false; + + /** + * Is this Tween currently seeking? + * This boolean is toggled in the `Tween.seek` method. + * When a tween is seeking it will not dispatch any events or callbacks. + * + * @name Phaser.Tweens.Tween#isSeeking + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this.isSeeking = false; + /** * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = -1 (as it never completes) * @@ -51130,7 +51983,7 @@ var Tween = new Class({ * @private * @since 3.0.0 */ - this._pausedState = TWEEN_CONST.PENDING_ADD; + this._pausedState = TWEEN_CONST.INIT; /** * Does the Tween start off paused? (if so it needs to be started with Tween.play) @@ -51203,14 +52056,24 @@ var Tween = new Class({ this.totalProgress = 0; /** - * An object containing the various Tween callback references. + * An object containing the different Tween callback functions. + * + * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. + * + * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. + * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. + * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely. + * `onUpdate` When a TweenData updates a property on a source target during playback. + * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. * * @name Phaser.Tweens.Tween#callbacks * @type {object} - * @default 0 * @since 3.0.0 */ this.callbacks = { + onActive: null, onComplete: null, onLoop: null, onRepeat: null, @@ -51219,6 +52082,13 @@ var Tween = new Class({ onYoyo: null }; + /** + * The context in which all callbacks are invoked. + * + * @name Phaser.Tweens.Tween#callbackScope + * @type {any} + * @since 3.0.0 + */ this.callbackScope; }, @@ -51390,7 +52260,8 @@ var Tween = new Class({ */ calcDuration: function () { - var max = 0; + var maxDuration = 0; + var minDelay = Number.MAX_SAFE_INTEGER; var data = this.data; @@ -51421,10 +52292,15 @@ var Tween = new Class({ tweenData.totalDuration += (tweenData.t2 * tweenData.repeat); } - if (tweenData.totalDuration > max) + if (tweenData.totalDuration > maxDuration) { // Get the longest TweenData from the Tween, used to calculate the Tween TD - max = tweenData.totalDuration; + maxDuration = tweenData.totalDuration; + } + + if (tweenData.delay < minDelay) + { + minDelay = tweenData.delay; } } @@ -51432,7 +52308,7 @@ var Tween = new Class({ // If duration has been set to 0 then we give it a super-low value so that it always // renders at least 1 frame, but no more, without causing divided by zero errors elsewhere. - this.duration = Math.max(max, 0.001); + this.duration = Math.max(maxDuration, 0.001); this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; @@ -51444,6 +52320,9 @@ var Tween = new Class({ { this.totalDuration = this.duration + this.completeDelay; } + + // How long before this Tween starts playback? + this.startDelay = minDelay; }, /** @@ -51457,6 +52336,15 @@ var Tween = new Class({ */ init: function () { + // You can't have a paused Tween if it's part of a Timeline + if (this.paused && !this.parentIsTimeline) + { + this.state = TWEEN_CONST.PENDING_ADD; + this._pausedState = TWEEN_CONST.INIT; + + return false; + } + var data = this.data; var totalTargets = this.totalTargets; @@ -51465,12 +52353,17 @@ var Tween = new Class({ var tweenData = data[i]; var target = tweenData.target; var gen = tweenData.gen; + var key = tweenData.key; + var targetIndex = tweenData.index; - tweenData.delay = gen.delay(i, totalTargets, target); - tweenData.duration = Math.max(gen.duration(i, totalTargets, target), 0.001); - tweenData.hold = gen.hold(i, totalTargets, target); - tweenData.repeat = gen.repeat(i, totalTargets, target); - tweenData.repeatDelay = gen.repeatDelay(i, totalTargets, target); + // Old function signature: i, totalTargets, target + // New function signature: target, key, value, index, total, tween + + tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); + tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); + tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); } this.calcDuration(); @@ -51480,26 +52373,32 @@ var Tween = new Class({ this.elapsed = 0; this.totalElapsed = 0; - // You can't have a paused Tween if it's part of a Timeline - if (this.paused && !this.parentIsTimeline) - { - this.state = TWEEN_CONST.PENDING_ADD; - this._pausedState = TWEEN_CONST.INIT; + this.state = TWEEN_CONST.INIT; - return false; - } - else - { - this.state = TWEEN_CONST.INIT; + return true; + }, - return true; - } + /** + * Internal method that makes this Tween active within the TweenManager + * and emits the onActive event and callback. + * + * @method Phaser.Tweens.Tween#makeActive + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.19.0 + */ + makeActive: function () + { + this.parent.makeActive(this); + + this.dispatchTweenEvent(Events.TWEEN_ACTIVE, this.callbacks.onActive); }, /** * Internal method that advances to the next state of the Tween during playback. * * @method Phaser.Tweens.Tween#nextState + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP * @since 3.0.0 */ nextState: function () @@ -51510,15 +52409,6 @@ var Tween = new Class({ this.progress = 0; this.loopCounter--; - var onLoop = this.callbacks.onLoop; - - if (onLoop) - { - onLoop.params[1] = this.targets; - - onLoop.func.apply(onLoop.scope, onLoop.params); - } - this.resetTweenData(true); if (this.loopDelay > 0) @@ -51529,25 +52419,21 @@ var Tween = new Class({ else { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); } } else if (this.completeDelay > 0) { - this.countdown = this.completeDelay; this.state = TWEEN_CONST.COMPLETE_DELAY; + + this.countdown = this.completeDelay; } else { - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.params[1] = this.targets; - - onComplete.func.apply(onComplete.scope, onComplete.params); - } - this.state = TWEEN_CONST.PENDING_REMOVE; + + this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); } }, @@ -51597,11 +52483,21 @@ var Tween = new Class({ { if (resetFromTimeline === undefined) { resetFromTimeline = false; } - if (this.state === TWEEN_CONST.ACTIVE || (this.state === TWEEN_CONST.PENDING_ADD && this._pausedState === TWEEN_CONST.PENDING_ADD)) + var state = this.state; + + if (state === TWEEN_CONST.INIT && !this.parentIsTimeline) + { + this.resetTweenData(false); + + this.state = TWEEN_CONST.ACTIVE; + + return this; + } + else if (state === TWEEN_CONST.ACTIVE || (state === TWEEN_CONST.PENDING_ADD && this._pausedState === TWEEN_CONST.PENDING_ADD)) { return this; } - else if (!this.parentIsTimeline && (this.state === TWEEN_CONST.PENDING_REMOVE || this.state === TWEEN_CONST.REMOVED)) + else if (!this.parentIsTimeline && (state === TWEEN_CONST.PENDING_REMOVE || state === TWEEN_CONST.REMOVED)) { this.seek(0); this.parent.makeActive(this); @@ -51609,21 +52505,12 @@ var Tween = new Class({ return this; } - var onStart = this.callbacks.onStart; - if (this.parentIsTimeline) { this.resetTweenData(resetFromTimeline); if (this.calculatedOffset === 0) { - if (onStart) - { - onStart.params[1] = this.targets; - - onStart.func.apply(onStart.scope, onStart.params); - } - this.state = TWEEN_CONST.ACTIVE; } else @@ -51637,7 +52524,7 @@ var Tween = new Class({ { this.paused = false; - this.parent.makeActive(this); + this.makeActive(); } else { @@ -51645,14 +52532,7 @@ var Tween = new Class({ this.state = TWEEN_CONST.ACTIVE; - if (onStart) - { - onStart.params[1] = this.targets; - - onStart.func.apply(onStart.scope, onStart.params); - } - - this.parent.makeActive(this); + this.makeActive(); } return this; @@ -51669,11 +52549,17 @@ var Tween = new Class({ resetTweenData: function (resetFromLoop) { var data = this.data; + var total = this.totalData; + var totalTargets = this.totalTargets; - for (var i = 0; i < this.totalData; i++) + for (var i = 0; i < total; i++) { var tweenData = data[i]; + var target = tweenData.target; + var key = tweenData.key; + var targetIndex = tweenData.index; + tweenData.progress = 0; tweenData.elapsed = 0; @@ -51681,9 +52567,9 @@ var Tween = new Class({ if (resetFromLoop) { - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.start = tweenData.getStartValue(target, key, tweenData.start, targetIndex, totalTargets, this); - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.end); + tweenData.end = tweenData.getEndValue(target, key, tweenData.end, targetIndex, totalTargets, this); tweenData.current = tweenData.start; @@ -51697,8 +52583,14 @@ var Tween = new Class({ if (tweenData.delay > 0) { tweenData.elapsed = tweenData.delay; + tweenData.state = TWEEN_CONST.DELAY; } + + if (tweenData.getActiveValue) + { + target[key] = tweenData.getActiveValue(tweenData.target, tweenData.key, tweenData.start); + } } }, @@ -51727,73 +52619,110 @@ var Tween = new Class({ }, /** - * Attempts to seek to a specific position in a Tween. + * Seeks to a specific point in the Tween. + * + * **Note:** You cannot seek a Tween that repeats or loops forever, or that has an unusually long total duration. + * + * The given position is a value between 0 and 1 which represents how far through the Tween to seek to. + * A value of 0.5 would seek to half-way through the Tween, where-as a value of zero would seek to the start. + * + * Note that the seek takes the entire duration of the Tween into account, including delays, loops and repeats. + * For example, a Tween that lasts for 2 seconds, but that loops 3 times, would have a total duration of 6 seconds, + * so seeking to 0.5 would seek to 3 seconds into the Tween, as that's half-way through its _entire_ duration. + * + * Seeking works by resetting the Tween to its initial values and then iterating through the Tween at `delta` + * jumps per step. The longer the Tween, the longer this can take. * * @method Phaser.Tweens.Tween#seek * @since 3.0.0 * * @param {number} toPosition - A value between 0 and 1 which represents the progress point to seek to. + * @param {number} [delta=16.6] - The size of each step when seeking through the Tween. A higher value completes faster but at a cost of less precision. * * @return {this} This Tween instance. */ - seek: function (toPosition) + seek: function (toPosition, delta) { + if (delta === undefined) { delta = 16.6; } + + if (this.totalDuration >= 3600000) + { + console.warn('Tween.seek duration too long'); + + return this; + } + + if (this.state === TWEEN_CONST.REMOVED) + { + this.makeActive(); + } + + this.elapsed = 0; + this.progress = 0; + this.totalElapsed = 0; + this.totalProgress = 0; + var data = this.data; + var totalTargets = this.totalTargets; for (var i = 0; i < this.totalData; i++) { - // This won't work with loop > 0 yet - var ms = this.totalDuration * toPosition; - var tweenData = data[i]; - var progress = 0; - var elapsed = 0; + var target = tweenData.target; + var gen = tweenData.gen; + var key = tweenData.key; + var targetIndex = tweenData.index; - if (ms <= tweenData.delay) + tweenData.progress = 0; + tweenData.elapsed = 0; + + tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat; + + // Old function signature: i, totalTargets, target + // New function signature: target, key, value, index, total, tween + + tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); + tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); + tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); + + tweenData.current = tweenData.start; + tweenData.state = TWEEN_CONST.PLAYING_FORWARD; + + this.updateTweenData(this, tweenData, 0, targetIndex, totalTargets); + + if (tweenData.delay > 0) { - progress = 0; - elapsed = 0; + tweenData.elapsed = tweenData.delay; + tweenData.state = TWEEN_CONST.DELAY; } - else if (ms >= tweenData.totalDuration) - { - progress = 1; - elapsed = tweenData.duration; - } - else if (ms > tweenData.delay && ms <= tweenData.t1) - { - // Keep it zero bound - ms = Math.max(0, ms - tweenData.delay); + } - // Somewhere in the first playthru range - progress = ms / tweenData.t1; - elapsed = tweenData.duration * progress; - } - else if (ms > tweenData.t1 && ms < tweenData.totalDuration) - { - // Somewhere in repeat land - ms -= tweenData.delay; - ms -= tweenData.t1; + this.calcDuration(); - // var repeats = Math.floor(ms / tweenData.t2); + var wasPaused = false; - // remainder - ms = ((ms / tweenData.t2) % 1) * tweenData.t2; + if (this.state === TWEEN_CONST.PAUSED) + { + wasPaused = true; - if (ms > tweenData.repeatDelay) - { - progress = ms / tweenData.t1; - elapsed = tweenData.duration * progress; - } - } + this.state = TWEEN_CONST.ACTIVE; + } - tweenData.progress = progress; - tweenData.elapsed = elapsed; + this.isSeeking = true; - var v = tweenData.ease(tweenData.progress); + do + { + this.update(0, delta); - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + } while (this.totalProgress < toPosition); - tweenData.target[tweenData.key] = tweenData.current; + this.isSeeking = false; + + if (wasPaused) + { + this.state = TWEEN_CONST.PAUSED; } return this; @@ -51801,14 +52730,26 @@ var Tween = new Class({ /** * Sets an event based callback to be invoked during playback. + * + * Calling this method will replace a previously set callback for the given type, if any exists. + * + * The types available are: + * + * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. + * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. + * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely. + * `onUpdate` When a TweenData updates a property on a source target during playback. + * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. * * @method Phaser.Tweens.Tween#setCallback * @since 3.0.0 * - * @param {string} type - Type of the callback. - * @param {function} callback - Callback function. + * @param {string} type - Type of the callback to set. + * @param {function} callback - The function to invoke when this callback happens. * @param {array} [params] - An array of parameters for specified callbacks types. - * @param {object} [scope] - The context the callback will be invoked in. + * @param {any} [scope] - The context the callback will be invoked in. * * @return {this} This Tween instance. */ @@ -51828,6 +52769,7 @@ var Tween = new Class({ * If you don't need a delay, or have an onComplete callback, then call `Tween.stop` instead. * * @method Phaser.Tweens.Tween#complete + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE * @since 3.2.0 * * @param {number} [delay=0] - The time to wait before invoking the complete callback. If zero it will fire immediately. @@ -51840,21 +52782,15 @@ var Tween = new Class({ if (delay) { - this.countdown = delay; this.state = TWEEN_CONST.COMPLETE_DELAY; + + this.countdown = delay; } else { - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.params[1] = this.targets; - - onComplete.func.apply(onComplete.scope, onComplete.params); - } - this.state = TWEEN_CONST.PENDING_REMOVE; + + this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); } return this; @@ -51915,6 +52851,8 @@ var Tween = new Class({ } } + this.removeAllListeners(); + this.state = TWEEN_CONST.PENDING_REMOVE; } @@ -51925,6 +52863,9 @@ var Tween = new Class({ * Internal method that advances the Tween based on the time values. * * @method Phaser.Tweens.Tween#update + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP + * @fires Phaser.Tweens.Events#TWEEN_START * @since 3.0.0 * * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. @@ -51956,11 +52897,25 @@ var Tween = new Class({ { case TWEEN_CONST.ACTIVE: + if (!this.hasStarted && !this.isSeeking) + { + this.startDelay -= delta; + + if (this.startDelay <= 0) + { + this.hasStarted = true; + + this.dispatchTweenEvent(Events.TWEEN_START, this.callbacks.onStart); + } + } + var stillRunning = false; for (var i = 0; i < this.totalData; i++) { - if (this.updateTweenData(this, this.data[i], delta)) + var tweenData = this.data[i]; + + if (this.updateTweenData(this, tweenData, delta)) { stillRunning = true; } @@ -51981,6 +52936,8 @@ var Tween = new Class({ if (this.countdown <= 0) { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); } break; @@ -51991,15 +52948,6 @@ var Tween = new Class({ if (this.countdown <= 0) { - var onStart = this.callbacks.onStart; - - if (onStart) - { - onStart.params[1] = this.targets; - - onStart.func.apply(onStart.scope, onStart.params); - } - this.state = TWEEN_CONST.ACTIVE; } @@ -52011,14 +52959,9 @@ var Tween = new Class({ if (this.countdown <= 0) { - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.func.apply(onComplete.scope, onComplete.params); - } - this.state = TWEEN_CONST.PENDING_REMOVE; + + this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); } break; @@ -52027,10 +52970,61 @@ var Tween = new Class({ return (this.state === TWEEN_CONST.PENDING_REMOVE); }, + /** + * Internal method that will emit a TweenData based Event and invoke the given callback. + * + * @method Phaser.Tweens.Tween#dispatchTweenDataEvent + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData object that caused this event. + */ + dispatchTweenDataEvent: function (event, callback, tweenData) + { + if (!this.isSeeking) + { + this.emit(event, this, tweenData.key, tweenData.target); + + if (callback) + { + callback.params[1] = tweenData.target; + + callback.func.apply(callback.scope, callback.params); + } + } + }, + + /** + * Internal method that will emit a Tween based Event and invoke the given callback. + * + * @method Phaser.Tweens.Tween#dispatchTweenEvent + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchTweenEvent: function (event, callback) + { + if (!this.isSeeking) + { + this.emit(event, this, this.targets); + + if (callback) + { + callback.params[1] = this.targets; + + callback.func.apply(callback.scope, callback.params); + } + } + }, + /** * Internal method used as part of the playback process that sets a tween to play in reverse. * * @method Phaser.Tweens.Tween#setStateFromEnd + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to update. @@ -52054,25 +53048,14 @@ var Tween = new Class({ tweenData.target.toggleFlipX(); } - // Problem: The flip and callback and so on gets called for every TweenData that triggers it at the same time. - // If you're tweening several properties it can fire for all of them, at once. - if (tweenData.flipY) { tweenData.target.toggleFlipY(); } - var onYoyo = tween.callbacks.onYoyo; + this.dispatchTweenDataEvent(Events.TWEEN_YOYO, tween.callbacks.onYoyo, tweenData); - if (onYoyo) - { - // Element 1 is reserved for the target of the yoyo (and needs setting here) - onYoyo.params[1] = tweenData.target; - - onYoyo.func.apply(onYoyo.scope, onYoyo.params); - } - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); return TWEEN_CONST.PLAYING_BACKWARD; } @@ -52097,19 +53080,9 @@ var Tween = new Class({ tweenData.target.toggleFlipY(); } - var onRepeat = tween.callbacks.onRepeat; + tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - if (onRepeat) - { - // Element 1 is reserved for the target of the repeat (and needs setting here) - onRepeat.params[1] = tweenData.target; - - onRepeat.func.apply(onRepeat.scope, onRepeat.params); - } - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); // Delay? if (tweenData.repeatDelay > 0) @@ -52124,6 +53097,8 @@ var Tween = new Class({ } else { + this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); + return TWEEN_CONST.PLAYING_FORWARD; } } @@ -52135,6 +53110,7 @@ var Tween = new Class({ * Internal method used as part of the playback process that sets a tween to play from the start. * * @method Phaser.Tweens.Tween#setStateFromStart + * @fires Phaser.Tweens.Events#TWEEN_REPEAT * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to update. @@ -52163,17 +53139,7 @@ var Tween = new Class({ tweenData.target.toggleFlipY(); } - var onRepeat = tween.callbacks.onRepeat; - - if (onRepeat) - { - // Element 1 is reserved for the target of the repeat (and needs setting here) - onRepeat.params[1] = tweenData.target; - - onRepeat.func.apply(onRepeat.scope, onRepeat.params); - } - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); // Delay? if (tweenData.repeatDelay > 0) @@ -52188,6 +53154,8 @@ var Tween = new Class({ } else { + this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); + return TWEEN_CONST.PLAYING_FORWARD; } } @@ -52199,22 +53167,26 @@ var Tween = new Class({ * Internal method that advances the TweenData based on the time value given. * * @method Phaser.Tweens.Tween#updateTweenData + * @fires Phaser.Tweens.Events#TWEEN_UPDATE + * @fires Phaser.Tweens.Events#TWEEN_REPEAT * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to update. * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true + * @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true. * * @return {boolean} True if the tween is not complete (e.g., playing), or false if the tween is complete. */ updateTweenData: function (tween, tweenData, delta) { + var target = tweenData.target; + switch (tweenData.state) { case TWEEN_CONST.PLAYING_FORWARD: case TWEEN_CONST.PLAYING_BACKWARD: - if (!tweenData.target) + if (!target) { tweenData.state = TWEEN_CONST.COMPLETE; break; @@ -52235,37 +53207,16 @@ var Tween = new Class({ var forward = (tweenData.state === TWEEN_CONST.PLAYING_FORWARD); var progress = elapsed / duration; - var v; - - if (forward) - { - v = tweenData.ease(progress); - } - else - { - v = tweenData.ease(1 - progress); - } - - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); - - tweenData.target[tweenData.key] = tweenData.current; - tweenData.elapsed = elapsed; tweenData.progress = progress; - var onUpdate = tween.callbacks.onUpdate; - - if (onUpdate) - { - onUpdate.params[1] = tweenData.target; - - onUpdate.func.apply(onUpdate.scope, onUpdate.params); - } - if (progress === 1) { if (forward) { + tweenData.current = tweenData.end; + target[tweenData.key] = tweenData.end; + if (tweenData.hold > 0) { tweenData.elapsed = tweenData.hold - diff; @@ -52279,9 +53230,22 @@ var Tween = new Class({ } else { + tweenData.current = tweenData.start; + target[tweenData.key] = tweenData.start; + tweenData.state = this.setStateFromStart(tween, tweenData, diff); } } + else + { + var v = (forward) ? tweenData.ease(progress) : tweenData.ease(1 - progress); + + tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + + target[tweenData.key] = tweenData.current; + } + + this.dispatchTweenDataEvent(Events.TWEEN_UPDATE, tween.callbacks.onUpdate, tweenData); break; @@ -52307,6 +53271,8 @@ var Tween = new Class({ tweenData.elapsed = Math.abs(tweenData.elapsed); tweenData.state = TWEEN_CONST.PLAYING_FORWARD; + + this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); } break; @@ -52324,15 +53290,15 @@ var Tween = new Class({ case TWEEN_CONST.PENDING_RENDER: - if (tweenData.target) + if (target) { - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.target[tweenData.key]); + tweenData.start = tweenData.getStartValue(target, tweenData.key, target[tweenData.key], tweenData.index, tween.totalTargets, tween); - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.end = tweenData.getEndValue(target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); tweenData.current = tweenData.start; - tweenData.target[tweenData.key] = tweenData.start; + target[tweenData.key] = tweenData.start; tweenData.state = TWEEN_CONST.PLAYING_FORWARD; } @@ -52350,7 +53316,16 @@ var Tween = new Class({ }); +// onActive = 'active' event = When the Tween is moved from the pending to the active list in the manager, even if playback delayed +// onStart = 'start' event = When the Tween starts playing from a delayed state (will happen same time as onActive if no delay) +// onYoyo = 'yoyo' event = When the Tween starts a yoyo +// onRepeat = 'repeat' event = When a TweenData repeats playback (if any) +// onComplete = 'complete' event = When the Tween finishes all playback (can sometimes never happen if repeat -1), also when 'stop' called +// onUpdate = 'update' event = When the Tween updates a TweenData during playback (expensive!) +// onLoop = 'loop' event = Used to loop ALL TweenDatas in a Tween + Tween.TYPES = [ + 'onActive', 'onComplete', 'onLoop', 'onRepeat', @@ -52362,7 +53337,7 @@ Tween.TYPES = [ /** * Creates a new Tween object. * - * Note: This method will only be available Tweens have been built into Phaser. + * Note: This method will only be available if Tweens have been built into Phaser. * * @method Phaser.GameObjects.GameObjectFactory#tween * @since 3.0.0 @@ -52407,7 +53382,40 @@ module.exports = Tween; /***/ }), -/* 243 */ +/* 245 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tweens.Events + */ + +module.exports = { + + TIMELINE_COMPLETE: __webpack_require__(1394), + TIMELINE_LOOP: __webpack_require__(1395), + TIMELINE_PAUSE: __webpack_require__(1396), + TIMELINE_RESUME: __webpack_require__(1397), + TIMELINE_START: __webpack_require__(1398), + TIMELINE_UPDATE: __webpack_require__(1399), + TWEEN_ACTIVE: __webpack_require__(1400), + TWEEN_COMPLETE: __webpack_require__(1401), + TWEEN_LOOP: __webpack_require__(1402), + TWEEN_REPEAT: __webpack_require__(1403), + TWEEN_START: __webpack_require__(1404), + TWEEN_UPDATE: __webpack_require__(1405), + TWEEN_YOYO: __webpack_require__(1406) + +}; + + +/***/ }), +/* 246 */ /***/ (function(module, exports) { /** @@ -52417,17 +53425,21 @@ module.exports = Tween; */ /** - * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. + * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. + * A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. * - * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, Tweens should be created using the GameObjectFactory or GameObjectCreator. + * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, + * Tweens should be created using the GameObjectFactory or GameObjectCreator. * * @function Phaser.Tweens.TweenData * @since 3.0.0 * - * @param {object} target - The target to tween. + * @param {any} target - The target to tween. + * @param {integer} index - The target index within the Tween targets array. * @param {string} key - The property of the target to tween. * @param {function} getEnd - What the property will be at the END of the Tween. * @param {function} getStart - What the property will be at the START of the Tween. + * @param {?function} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * @param {function} ease - The ease function this tween uses. * @param {number} delay - Time in ms/frames before tween will start. * @param {number} duration - Duration of the tween in ms/frames. @@ -52440,16 +53452,22 @@ module.exports = Tween; * * @return {Phaser.Types.Tweens.TweenDataConfig} The config object describing this TweenData. */ -var TweenData = function (target, key, getEnd, getStart, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) +var TweenData = function (target, index, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) { return { // The target to tween target: target, + // The index of the target within the tween targets array + index: index, + // The property of the target to tween key: key, + // What to set the property to the moment the TweenData is invoked. + getActiveValue: getActive, + // The returned value sets what the property will be at the END of the Tween. getEndValue: getEnd, @@ -52523,7 +53541,7 @@ module.exports = TweenData; /***/ }), -/* 244 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52538,61 +53556,61 @@ module.exports = TweenData; module.exports = { - Angle: __webpack_require__(529), - Call: __webpack_require__(530), - GetFirst: __webpack_require__(531), - GetLast: __webpack_require__(532), - GridAlign: __webpack_require__(533), - IncAlpha: __webpack_require__(567), - IncX: __webpack_require__(568), - IncXY: __webpack_require__(569), - IncY: __webpack_require__(570), - PlaceOnCircle: __webpack_require__(571), - PlaceOnEllipse: __webpack_require__(572), - PlaceOnLine: __webpack_require__(573), - PlaceOnRectangle: __webpack_require__(574), - PlaceOnTriangle: __webpack_require__(575), - PlayAnimation: __webpack_require__(576), + Angle: __webpack_require__(532), + Call: __webpack_require__(533), + GetFirst: __webpack_require__(534), + GetLast: __webpack_require__(535), + GridAlign: __webpack_require__(536), + IncAlpha: __webpack_require__(586), + IncX: __webpack_require__(587), + IncXY: __webpack_require__(588), + IncY: __webpack_require__(589), + PlaceOnCircle: __webpack_require__(590), + PlaceOnEllipse: __webpack_require__(591), + PlaceOnLine: __webpack_require__(592), + PlaceOnRectangle: __webpack_require__(593), + PlaceOnTriangle: __webpack_require__(594), + PlayAnimation: __webpack_require__(595), PropertyValueInc: __webpack_require__(39), PropertyValueSet: __webpack_require__(29), - RandomCircle: __webpack_require__(577), - RandomEllipse: __webpack_require__(578), - RandomLine: __webpack_require__(579), - RandomRectangle: __webpack_require__(580), - RandomTriangle: __webpack_require__(581), - Rotate: __webpack_require__(582), - RotateAround: __webpack_require__(583), - RotateAroundDistance: __webpack_require__(584), - ScaleX: __webpack_require__(585), - ScaleXY: __webpack_require__(586), - ScaleY: __webpack_require__(587), - SetAlpha: __webpack_require__(588), - SetBlendMode: __webpack_require__(589), - SetDepth: __webpack_require__(590), - SetHitArea: __webpack_require__(591), - SetOrigin: __webpack_require__(592), - SetRotation: __webpack_require__(593), - SetScale: __webpack_require__(594), - SetScaleX: __webpack_require__(595), - SetScaleY: __webpack_require__(596), - SetTint: __webpack_require__(597), - SetVisible: __webpack_require__(598), - SetX: __webpack_require__(599), - SetXY: __webpack_require__(600), - SetY: __webpack_require__(601), - ShiftPosition: __webpack_require__(602), - Shuffle: __webpack_require__(603), - SmootherStep: __webpack_require__(604), - SmoothStep: __webpack_require__(605), - Spread: __webpack_require__(606), - ToggleVisible: __webpack_require__(607), - WrapInRectangle: __webpack_require__(608) + RandomCircle: __webpack_require__(596), + RandomEllipse: __webpack_require__(597), + RandomLine: __webpack_require__(598), + RandomRectangle: __webpack_require__(599), + RandomTriangle: __webpack_require__(600), + Rotate: __webpack_require__(601), + RotateAround: __webpack_require__(602), + RotateAroundDistance: __webpack_require__(603), + ScaleX: __webpack_require__(604), + ScaleXY: __webpack_require__(605), + ScaleY: __webpack_require__(606), + SetAlpha: __webpack_require__(607), + SetBlendMode: __webpack_require__(608), + SetDepth: __webpack_require__(609), + SetHitArea: __webpack_require__(610), + SetOrigin: __webpack_require__(611), + SetRotation: __webpack_require__(612), + SetScale: __webpack_require__(613), + SetScaleX: __webpack_require__(614), + SetScaleY: __webpack_require__(615), + SetTint: __webpack_require__(616), + SetVisible: __webpack_require__(617), + SetX: __webpack_require__(618), + SetXY: __webpack_require__(619), + SetY: __webpack_require__(620), + ShiftPosition: __webpack_require__(621), + Shuffle: __webpack_require__(622), + SmootherStep: __webpack_require__(623), + SmoothStep: __webpack_require__(624), + Spread: __webpack_require__(625), + ToggleVisible: __webpack_require__(626), + WrapInRectangle: __webpack_require__(627) }; /***/ }), -/* 245 */ +/* 248 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52601,19 +53619,19 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ALIGN_CONST = __webpack_require__(153); +var ALIGN_CONST = __webpack_require__(154); var AlignInMap = []; -AlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(246); -AlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(247); -AlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(248); -AlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(249); -AlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(251); -AlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(252); -AlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(253); -AlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(254); -AlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(255); +AlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(249); +AlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(250); +AlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(251); +AlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(252); +AlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(254); +AlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(255); +AlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(256); +AlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(257); +AlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(258); /** * Takes given Game Object and aligns it so that it is positioned relative to the other. @@ -52641,7 +53659,7 @@ module.exports = QuickSet; /***/ }), -/* 246 */ +/* 249 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52685,7 +53703,7 @@ module.exports = BottomCenter; /***/ }), -/* 247 */ +/* 250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52729,7 +53747,7 @@ module.exports = BottomLeft; /***/ }), -/* 248 */ +/* 251 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52773,7 +53791,7 @@ module.exports = BottomRight; /***/ }), -/* 249 */ +/* 252 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52782,7 +53800,7 @@ module.exports = BottomRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CenterOn = __webpack_require__(250); +var CenterOn = __webpack_require__(253); var GetCenterX = __webpack_require__(79); var GetCenterY = __webpack_require__(82); @@ -52815,7 +53833,7 @@ module.exports = Center; /***/ }), -/* 250 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52852,7 +53870,7 @@ module.exports = CenterOn; /***/ }), -/* 251 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52896,7 +53914,7 @@ module.exports = LeftCenter; /***/ }), -/* 252 */ +/* 255 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52940,7 +53958,7 @@ module.exports = RightCenter; /***/ }), -/* 253 */ +/* 256 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52984,7 +54002,7 @@ module.exports = TopCenter; /***/ }), -/* 254 */ +/* 257 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53028,7 +54046,7 @@ module.exports = TopLeft; /***/ }), -/* 255 */ +/* 258 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53072,7 +54090,7 @@ module.exports = TopRight; /***/ }), -/* 256 */ +/* 259 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53081,9 +54099,9 @@ module.exports = TopRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircumferencePoint = __webpack_require__(154); -var FromPercent = __webpack_require__(95); -var MATH_CONST = __webpack_require__(23); +var CircumferencePoint = __webpack_require__(155); +var FromPercent = __webpack_require__(97); +var MATH_CONST = __webpack_require__(21); var Point = __webpack_require__(4); /** @@ -53115,7 +54133,7 @@ module.exports = GetPoint; /***/ }), -/* 257 */ +/* 260 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53124,10 +54142,10 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circumference = __webpack_require__(258); -var CircumferencePoint = __webpack_require__(154); -var FromPercent = __webpack_require__(95); -var MATH_CONST = __webpack_require__(23); +var Circumference = __webpack_require__(261); +var CircumferencePoint = __webpack_require__(155); +var FromPercent = __webpack_require__(97); +var MATH_CONST = __webpack_require__(21); /** * Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle, @@ -53167,7 +54185,7 @@ module.exports = GetPoints; /***/ }), -/* 258 */ +/* 261 */ /***/ (function(module, exports) { /** @@ -53195,7 +54213,7 @@ module.exports = Circumference; /***/ }), -/* 259 */ +/* 262 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53204,7 +54222,7 @@ module.exports = Circumference; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); // bitmask flag for GameObject.renderMask var _FLAG = 2; // 0010 @@ -53490,7 +54508,7 @@ module.exports = Alpha; /***/ }), -/* 260 */ +/* 263 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53499,9 +54517,9 @@ module.exports = Alpha; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseAnimation = __webpack_require__(156); +var BaseAnimation = __webpack_require__(157); var Class = __webpack_require__(0); -var Events = __webpack_require__(115); +var Events = __webpack_require__(116); /** * @classdesc @@ -54080,6 +55098,11 @@ var Animation = new Class({ var anim = this.currentAnim; var gameObject = this.parent; + if (!anim) + { + return gameObject; + } + // Should give us 9,007,199,254,740,991 safe repeats this.repeatCounter = (this._repeat === -1) ? Number.MAX_VALUE : this._repeat; @@ -54223,7 +55246,7 @@ var Animation = new Class({ { this._repeat = value; - this.repeatCounter = 0; + this.repeatCounter = (value === -1) ? Number.MAX_VALUE : value; return this.parent; }, @@ -54658,7 +55681,7 @@ module.exports = Animation; /***/ }), -/* 261 */ +/* 264 */ /***/ (function(module, exports) { /** @@ -54742,7 +55765,7 @@ module.exports = FindClosestInSorted; /***/ }), -/* 262 */ +/* 265 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -54916,7 +55939,7 @@ module.exports = AnimationFrame; /***/ }), -/* 263 */ +/* 266 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -55038,7 +56061,7 @@ module.exports = BlendMode; /***/ }), -/* 264 */ +/* 267 */ /***/ (function(module, exports) { /** @@ -55131,7 +56154,7 @@ module.exports = Depth; /***/ }), -/* 265 */ +/* 268 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -55140,8 +56163,8 @@ module.exports = Depth; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoint = __webpack_require__(157); -var Perimeter = __webpack_require__(116); +var GetPoint = __webpack_require__(158); +var Perimeter = __webpack_require__(117); // Return an array of points from the perimeter of the rectangle // each spaced out based on the quantity or step required @@ -55185,7 +56208,7 @@ module.exports = GetPoints; /***/ }), -/* 266 */ +/* 269 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -55224,7 +56247,7 @@ module.exports = GetPoint; /***/ }), -/* 267 */ +/* 270 */ /***/ (function(module, exports) { /** @@ -55264,7 +56287,7 @@ module.exports = RotateAround; /***/ }), -/* 268 */ +/* 271 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -55273,8 +56296,8 @@ module.exports = RotateAround; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(269); -var GeometryMask = __webpack_require__(270); +var BitmapMask = __webpack_require__(272); +var GeometryMask = __webpack_require__(273); /** * Provides methods used for getting and setting the mask of a Game Object. @@ -55411,7 +56434,7 @@ module.exports = Mask; /***/ }), -/* 269 */ +/* 272 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -55421,6 +56444,7 @@ module.exports = Mask; */ var Class = __webpack_require__(0); +var GameEvents = __webpack_require__(22); /** * @classdesc @@ -55575,7 +56599,7 @@ var BitmapMask = new Class({ this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - renderer.onContextRestored(function (renderer) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) { var width = renderer.width; var height = renderer.height; @@ -55703,7 +56727,7 @@ module.exports = BitmapMask; /***/ }), -/* 270 */ +/* 273 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56018,7 +57042,7 @@ module.exports = GeometryMask; /***/ }), -/* 271 */ +/* 274 */ /***/ (function(module, exports) { /** @@ -56125,7 +57149,7 @@ module.exports = ScrollFactor; /***/ }), -/* 272 */ +/* 275 */ /***/ (function(module, exports) { /** @@ -56187,7 +57211,7 @@ module.exports = ToJSON; /***/ }), -/* 273 */ +/* 276 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56196,10 +57220,10 @@ module.exports = ToJSON; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); +var MATH_CONST = __webpack_require__(21); var TransformMatrix = __webpack_require__(35); -var WrapAngle = __webpack_require__(161); -var WrapAngleDegrees = __webpack_require__(162); +var WrapAngle = __webpack_require__(162); +var WrapAngleDegrees = __webpack_require__(163); // global bitmask flag for GameObject.renderMask (used by Scale) var _FLAG = 4; // 0100 @@ -56387,8 +57411,9 @@ var Transform = { /** * The angle of this Game Object as expressed in degrees. - * - * Where 0 is to the right, 90 is down, 180 is left. + * + * 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. * @@ -56413,6 +57438,9 @@ var Transform = { /** * The angle of this Game Object in radians. + * + * 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 degrees, see the `angle` property instead. * @@ -56717,7 +57745,7 @@ module.exports = Transform; /***/ }), -/* 274 */ +/* 277 */ /***/ (function(module, exports) { /** @@ -56806,7 +57834,7 @@ module.exports = Visible; /***/ }), -/* 275 */ +/* 278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56821,16 +57849,16 @@ module.exports = Visible; module.exports = { - CHANGE_DATA: __webpack_require__(562), - CHANGE_DATA_KEY: __webpack_require__(563), - REMOVE_DATA: __webpack_require__(564), - SET_DATA: __webpack_require__(565) + CHANGE_DATA: __webpack_require__(581), + CHANGE_DATA_KEY: __webpack_require__(582), + REMOVE_DATA: __webpack_require__(583), + SET_DATA: __webpack_require__(584) }; /***/ }), -/* 276 */ +/* 279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56839,14 +57867,13 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Perimeter = __webpack_require__(116); +var Perimeter = __webpack_require__(117); var Point = __webpack_require__(4); -// Return an array of points from the perimeter of the rectangle -// each spaced out based on the quantity or step required /** - * [description] + * 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.MarchingAnts * @since 3.0.0 @@ -56950,7 +57977,7 @@ module.exports = MarchingAnts; /***/ }), -/* 277 */ +/* 280 */ /***/ (function(module, exports) { /** @@ -56990,7 +58017,7 @@ module.exports = RotateLeft; /***/ }), -/* 278 */ +/* 281 */ /***/ (function(module, exports) { /** @@ -57030,7 +58057,7 @@ module.exports = RotateRight; /***/ }), -/* 279 */ +/* 282 */ /***/ (function(module, exports) { /** @@ -57104,7 +58131,7 @@ module.exports = BresenhamPoints; /***/ }), -/* 280 */ +/* 283 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57113,14 +58140,14 @@ module.exports = BresenhamPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Animation = __webpack_require__(156); +var Animation = __webpack_require__(157); var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(168); +var CustomMap = __webpack_require__(169); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(115); -var GameEvents = __webpack_require__(30); +var Events = __webpack_require__(116); +var GameEvents = __webpack_require__(22); var GetValue = __webpack_require__(5); -var Pad = __webpack_require__(169); +var Pad = __webpack_require__(170); /** * @classdesc @@ -57551,6 +58578,10 @@ var AnimationManager = new Class({ { anim.load(child, startFrame); } + else + { + console.warn('Missing animation: ' + key); + } return child; }, @@ -57749,7 +58780,7 @@ module.exports = AnimationManager; /***/ }), -/* 281 */ +/* 284 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57759,9 +58790,9 @@ module.exports = AnimationManager; */ var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(168); +var CustomMap = __webpack_require__(169); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(282); +var Events = __webpack_require__(285); /** * @classdesc @@ -57935,7 +58966,7 @@ module.exports = BaseCache; /***/ }), -/* 282 */ +/* 285 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57950,14 +58981,14 @@ module.exports = BaseCache; module.exports = { - ADD: __webpack_require__(625), - REMOVE: __webpack_require__(626) + ADD: __webpack_require__(630), + REMOVE: __webpack_require__(631) }; /***/ }), -/* 283 */ +/* 286 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57966,9 +58997,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCache = __webpack_require__(281); +var BaseCache = __webpack_require__(284); var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(30); +var GameEvents = __webpack_require__(22); /** * @classdesc @@ -58181,7 +59212,7 @@ module.exports = CacheManager; /***/ }), -/* 284 */ +/* 287 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58190,14 +59221,14 @@ module.exports = CacheManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(120); -var CanvasPool = __webpack_require__(26); -var CenterOn = __webpack_require__(173); -var Clamp = __webpack_require__(22); +var BaseCamera = __webpack_require__(121); +var CanvasPool = __webpack_require__(27); +var CenterOn = __webpack_require__(174); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Effects = __webpack_require__(292); -var Linear = __webpack_require__(122); +var Effects = __webpack_require__(295); +var Linear = __webpack_require__(123); var Rectangle = __webpack_require__(11); var Vector2 = __webpack_require__(3); @@ -58228,7 +59259,7 @@ var Vector2 = __webpack_require__(3); * @memberof Phaser.Cameras.Scene2D * @constructor * @since 3.0.0 - * + * * @extends Phaser.Cameras.Scene2D.BaseCamera * @extends Phaser.GameObjects.Components.Flip * @extends Phaser.GameObjects.Components.Tint @@ -58380,11 +59411,11 @@ var Camera = new Class({ /** * Is this Camera rendering directly to the canvas or to a texture? - * + * * Enable rendering to texture with the method `setRenderToTexture` (just enabling this boolean won't be enough) - * + * * Once enabled you can toggle it by switching this property. - * + * * To properly remove a render texture you should call the `clearRenderToTexture()` method. * * @name Phaser.Cameras.Scene2D.Camera#renderToTexture @@ -58397,9 +59428,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the HTML Canvas Element that the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only populated if Phaser is running with the Canvas Renderer. * * @name Phaser.Cameras.Scene2D.Camera#canvas @@ -58411,9 +59442,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the Rendering Context belonging to the Canvas element the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only populated if Phaser is running with the Canvas Renderer. * * @name Phaser.Cameras.Scene2D.Camera#context @@ -58425,9 +59456,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the GL Texture belonging the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only set if Phaser is running with the WebGL Renderer. * * @name Phaser.Cameras.Scene2D.Camera#glTexture @@ -58439,9 +59470,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the GL Frame Buffer belonging the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only set if Phaser is running with the WebGL Renderer. * * @name Phaser.Cameras.Scene2D.Camera#framebuffer @@ -58453,9 +59484,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture and to use a custom pipeline, * then this holds a reference to the pipeline the Camera is drawing with. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only set if Phaser is running with the WebGL Renderer. * * @name Phaser.Cameras.Scene2D.Camera#pipeline @@ -58467,32 +59498,32 @@ var Camera = new Class({ /** * Sets the Camera to render to a texture instead of to the main canvas. - * + * * The Camera will redirect all Game Objects it's asked to render to this texture. - * + * * During the render sequence, the texture itself will then be rendered to the main canvas. - * + * * Doing this gives you the ability to modify the texture before this happens, * allowing for special effects such as Camera specific shaders, or post-processing * on the texture. - * + * * If running under Canvas the Camera will render to its `canvas` property. - * + * * If running under WebGL the Camera will create a frame buffer, which is stored in its `framebuffer` and `glTexture` properties. - * + * * If you set a camera to render to a texture then it will emit 2 events during the render loop: - * + * * First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture. - * + * * Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the * Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before * it appears in-game. - * + * * You should not enable this unless you plan on actually using the texture it creates * somehow, otherwise you're just doubling the work required to render your game. - * + * * To temporarily disable rendering to a texture, toggle the `renderToTexture` boolean. - * + * * If you no longer require the Camera to render to a texture, call the `clearRenderToTexture` method, * which will delete the respective textures and free-up resources. * @@ -58530,9 +59561,9 @@ var Camera = new Class({ /** * Sets the WebGL pipeline this Camera is using when rendering to a texture. - * + * * You can pass either the string-based name of the pipeline, or a reference to the pipeline itself. - * + * * Call this method with no arguments to clear any previously set pipeline. * * @method Phaser.Cameras.Scene2D.Camera#setPipeline @@ -58564,7 +59595,7 @@ var Camera = new Class({ /** * If this Camera was set to render to a texture, this will clear the resources it was using and * redirect it to render back to the primary Canvas again. - * + * * If you only wish to temporarily disable rendering to a texture then you can toggle the * property `renderToTexture` instead. * @@ -58582,6 +59613,11 @@ var Camera = new Class({ var renderer = this.scene.sys.game.renderer; + if (!renderer) + { + return; + } + if (renderer.gl) { if (this.framebuffer) @@ -58801,7 +59837,7 @@ var Camera = new Class({ * @since 3.0.0 * * @param {integer} [duration=100] - The duration of the effect in milliseconds. - * @param {number} [intensity=0.05] - The intensity of the shake. + * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -59074,7 +60110,7 @@ var Camera = new Class({ this.scrollX = fx - originX; this.scrollY = fy - originY; - + if (this.useBounds) { this.scrollX = this.clampX(this.scrollX); @@ -59169,7 +60205,7 @@ module.exports = Camera; /***/ }), -/* 285 */ +/* 288 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -59222,7 +60258,7 @@ module.exports = HexStringToColor; /***/ }), -/* 286 */ +/* 289 */ /***/ (function(module, exports) { /** @@ -59253,7 +60289,7 @@ module.exports = GetColor32; /***/ }), -/* 287 */ +/* 290 */ /***/ (function(module, exports) { /** @@ -59333,7 +60369,7 @@ module.exports = RGBToHSV; /***/ }), -/* 288 */ +/* 291 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -59343,7 +60379,7 @@ module.exports = RGBToHSV; */ var Color = __webpack_require__(36); -var IntegerToRGB = __webpack_require__(289); +var IntegerToRGB = __webpack_require__(292); /** * Converts the given color value into an instance of a Color object. @@ -59366,7 +60402,7 @@ module.exports = IntegerToColor; /***/ }), -/* 289 */ +/* 292 */ /***/ (function(module, exports) { /** @@ -59414,7 +60450,7 @@ module.exports = IntegerToRGB; /***/ }), -/* 290 */ +/* 293 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -59444,7 +60480,7 @@ module.exports = ObjectToColor; /***/ }), -/* 291 */ +/* 294 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -59490,7 +60526,7 @@ module.exports = RGBStringToColor; /***/ }), -/* 292 */ +/* 295 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -59505,80 +60541,11 @@ module.exports = RGBStringToColor; module.exports = { - Fade: __webpack_require__(647), - Flash: __webpack_require__(648), - Pan: __webpack_require__(649), - Shake: __webpack_require__(682), - Zoom: __webpack_require__(683) - -}; - - -/***/ }), -/* 293 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Back - */ - -module.exports = { - - In: __webpack_require__(650), - Out: __webpack_require__(651), - InOut: __webpack_require__(652) - -}; - - -/***/ }), -/* 294 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Bounce - */ - -module.exports = { - - In: __webpack_require__(653), - Out: __webpack_require__(654), - InOut: __webpack_require__(655) - -}; - - -/***/ }), -/* 295 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Circular - */ - -module.exports = { - - In: __webpack_require__(656), - Out: __webpack_require__(657), - InOut: __webpack_require__(658) + Fade: __webpack_require__(652), + Flash: __webpack_require__(653), + Pan: __webpack_require__(654), + Shake: __webpack_require__(687), + Zoom: __webpack_require__(688) }; @@ -59594,14 +60561,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Cubic + * @namespace Phaser.Math.Easing.Back */ module.exports = { - In: __webpack_require__(659), - Out: __webpack_require__(660), - InOut: __webpack_require__(661) + In: __webpack_require__(655), + Out: __webpack_require__(656), + InOut: __webpack_require__(657) }; @@ -59617,14 +60584,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Elastic + * @namespace Phaser.Math.Easing.Bounce */ module.exports = { - In: __webpack_require__(662), - Out: __webpack_require__(663), - InOut: __webpack_require__(664) + In: __webpack_require__(658), + Out: __webpack_require__(659), + InOut: __webpack_require__(660) }; @@ -59640,14 +60607,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Expo + * @namespace Phaser.Math.Easing.Circular */ module.exports = { - In: __webpack_require__(665), - Out: __webpack_require__(666), - InOut: __webpack_require__(667) + In: __webpack_require__(661), + Out: __webpack_require__(662), + InOut: __webpack_require__(663) }; @@ -59663,10 +60630,16 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Linear + * @namespace Phaser.Math.Easing.Cubic */ -module.exports = __webpack_require__(668); +module.exports = { + + In: __webpack_require__(664), + Out: __webpack_require__(665), + InOut: __webpack_require__(666) + +}; /***/ }), @@ -59680,14 +60653,14 @@ module.exports = __webpack_require__(668); */ /** - * @namespace Phaser.Math.Easing.Quadratic + * @namespace Phaser.Math.Easing.Elastic */ module.exports = { - In: __webpack_require__(669), - Out: __webpack_require__(670), - InOut: __webpack_require__(671) + In: __webpack_require__(667), + Out: __webpack_require__(668), + InOut: __webpack_require__(669) }; @@ -59703,14 +60676,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Quartic + * @namespace Phaser.Math.Easing.Expo */ module.exports = { - In: __webpack_require__(672), - Out: __webpack_require__(673), - InOut: __webpack_require__(674) + In: __webpack_require__(670), + Out: __webpack_require__(671), + InOut: __webpack_require__(672) }; @@ -59726,16 +60699,10 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Quintic + * @namespace Phaser.Math.Easing.Linear */ -module.exports = { - - In: __webpack_require__(675), - Out: __webpack_require__(676), - InOut: __webpack_require__(677) - -}; +module.exports = __webpack_require__(673); /***/ }), @@ -59749,14 +60716,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Sine + * @namespace Phaser.Math.Easing.Quadratic */ module.exports = { - In: __webpack_require__(678), - Out: __webpack_require__(679), - InOut: __webpack_require__(680) + In: __webpack_require__(674), + Out: __webpack_require__(675), + InOut: __webpack_require__(676) }; @@ -59772,16 +60739,85 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Stepped + * @namespace Phaser.Math.Easing.Quartic */ -module.exports = __webpack_require__(681); +module.exports = { + + In: __webpack_require__(677), + Out: __webpack_require__(678), + InOut: __webpack_require__(679) + +}; /***/ }), /* 305 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(680), + Out: __webpack_require__(681), + InOut: __webpack_require__(682) + +}; + + +/***/ }), +/* 306 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(683), + Out: __webpack_require__(684), + InOut: __webpack_require__(685) + +}; + + +/***/ }), +/* 307 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(686); + + +/***/ }), +/* 308 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -59789,15 +60825,15 @@ module.exports = __webpack_require__(681); */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(28); -var Device = __webpack_require__(306); +var CONST = __webpack_require__(34); +var Device = __webpack_require__(309); var GetFastValue = __webpack_require__(1); var GetValue = __webpack_require__(5); var IsPlainObject = __webpack_require__(7); -var PhaserMath = __webpack_require__(176); +var PhaserMath = __webpack_require__(177); var NOOP = __webpack_require__(2); -var DefaultPlugins = __webpack_require__(182); -var ValueToColor = __webpack_require__(170); +var DefaultPlugins = __webpack_require__(183); +var ValueToColor = __webpack_require__(171); /** * @classdesc @@ -60345,7 +61381,7 @@ module.exports = Config; /***/ }), -/* 306 */ +/* 309 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60379,20 +61415,20 @@ module.exports = Config; module.exports = { - os: __webpack_require__(123), - browser: __webpack_require__(124), - features: __webpack_require__(175), - input: __webpack_require__(712), - audio: __webpack_require__(713), - video: __webpack_require__(714), - fullscreen: __webpack_require__(715), - canvasFeatures: __webpack_require__(307) + os: __webpack_require__(124), + browser: __webpack_require__(125), + features: __webpack_require__(176), + input: __webpack_require__(717), + audio: __webpack_require__(718), + video: __webpack_require__(719), + fullscreen: __webpack_require__(720), + canvasFeatures: __webpack_require__(310) }; /***/ }), -/* 307 */ +/* 310 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60401,7 +61437,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(27); /** * Determines the canvas features of the browser running this Phaser Game instance. @@ -60506,7 +61542,7 @@ module.exports = init(); /***/ }), -/* 308 */ +/* 311 */ /***/ (function(module, exports) { /** @@ -60537,7 +61573,7 @@ module.exports = Between; /***/ }), -/* 309 */ +/* 312 */ /***/ (function(module, exports) { /** @@ -60574,7 +61610,7 @@ module.exports = Normalize; /***/ }), -/* 310 */ +/* 313 */ /***/ (function(module, exports) { /** @@ -60608,7 +61644,7 @@ module.exports = DistanceSquared; /***/ }), -/* 311 */ +/* 314 */ /***/ (function(module, exports) { /** @@ -60642,7 +61678,7 @@ module.exports = GreaterThan; /***/ }), -/* 312 */ +/* 315 */ /***/ (function(module, exports) { /** @@ -60676,7 +61712,7 @@ module.exports = LessThan; /***/ }), -/* 313 */ +/* 316 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60685,7 +61721,7 @@ module.exports = LessThan; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Factorial = __webpack_require__(314); +var Factorial = __webpack_require__(317); /** * [description] @@ -60707,7 +61743,7 @@ module.exports = Bernstein; /***/ }), -/* 314 */ +/* 317 */ /***/ (function(module, exports) { /** @@ -60747,7 +61783,7 @@ module.exports = Factorial; /***/ }), -/* 315 */ +/* 318 */ /***/ (function(module, exports) { /** @@ -60817,7 +61853,7 @@ module.exports = CubicBezierInterpolation; /***/ }), -/* 316 */ +/* 319 */ /***/ (function(module, exports) { /** @@ -60876,7 +61912,7 @@ module.exports = QuadraticBezierInterpolation; /***/ }), -/* 317 */ +/* 320 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60885,7 +61921,7 @@ module.exports = QuadraticBezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmoothStep = __webpack_require__(167); +var SmoothStep = __webpack_require__(168); /** * A Smooth Step interpolation method. @@ -60909,7 +61945,7 @@ module.exports = SmoothStepInterpolation; /***/ }), -/* 318 */ +/* 321 */ /***/ (function(module, exports) { /** @@ -60939,7 +61975,7 @@ module.exports = GetPowerOfTwo; /***/ }), -/* 319 */ +/* 322 */ /***/ (function(module, exports) { /** @@ -60983,7 +62019,7 @@ module.exports = SnapCeil; /***/ }), -/* 320 */ +/* 323 */ /***/ (function(module, exports) { /** @@ -61012,7 +62048,7 @@ module.exports = FloatBetween; /***/ }), -/* 321 */ +/* 324 */ /***/ (function(module, exports) { /** @@ -61047,7 +62083,7 @@ module.exports = Rotate; /***/ }), -/* 322 */ +/* 325 */ /***/ (function(module, exports) { /** @@ -61076,7 +62112,7 @@ module.exports = RoundAwayFromZero; /***/ }), -/* 323 */ +/* 326 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61131,7 +62167,7 @@ module.exports = TransformXY; /***/ }), -/* 324 */ +/* 327 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61676,7 +62712,7 @@ module.exports = Vector4; /***/ }), -/* 325 */ +/* 328 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62269,7 +63305,7 @@ module.exports = Matrix3; /***/ }), -/* 326 */ +/* 329 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -63731,7 +64767,7 @@ module.exports = Matrix4; /***/ }), -/* 327 */ +/* 330 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -63744,8 +64780,8 @@ module.exports = Matrix4; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(0); -var Vector3 = __webpack_require__(181); -var Matrix3 = __webpack_require__(325); +var Vector3 = __webpack_require__(182); +var Matrix3 = __webpack_require__(328); var EPSILON = 0.000001; @@ -64503,7 +65539,7 @@ module.exports = Quaternion; /***/ }), -/* 328 */ +/* 331 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64512,10 +65548,10 @@ module.exports = Quaternion; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasInterpolation = __webpack_require__(329); -var CanvasPool = __webpack_require__(26); -var CONST = __webpack_require__(28); -var Features = __webpack_require__(175); +var CanvasInterpolation = __webpack_require__(332); +var CanvasPool = __webpack_require__(27); +var CONST = __webpack_require__(34); +var Features = __webpack_require__(176); /** * Called automatically by Phaser.Game and responsible for creating the renderer it will use. @@ -64605,8 +65641,8 @@ var CreateRenderer = function (game) if (true) { - CanvasRenderer = __webpack_require__(330); - WebGLRenderer = __webpack_require__(333); + CanvasRenderer = __webpack_require__(333); + WebGLRenderer = __webpack_require__(336); // Let the config pick the renderer type, as both are included if (config.renderType === CONST.WEBGL) @@ -64631,7 +65667,7 @@ module.exports = CreateRenderer; /***/ }), -/* 329 */ +/* 332 */ /***/ (function(module, exports) { /** @@ -64694,7 +65730,7 @@ module.exports = CanvasInterpolation; /***/ }), -/* 330 */ +/* 333 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64704,14 +65740,14 @@ module.exports = CanvasInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasSnapshot = __webpack_require__(331); -var CameraEvents = __webpack_require__(53); +var CanvasSnapshot = __webpack_require__(334); +var CameraEvents = __webpack_require__(54); var Class = __webpack_require__(0); -var CONST = __webpack_require__(28); -var GetBlendModes = __webpack_require__(332); -var ScaleEvents = __webpack_require__(99); -var ScaleModes = __webpack_require__(94); -var Smoothing = __webpack_require__(121); +var CONST = __webpack_require__(34); +var GetBlendModes = __webpack_require__(335); +var ScaleEvents = __webpack_require__(101); +var ScaleModes = __webpack_require__(96); +var Smoothing = __webpack_require__(122); var TransformMatrix = __webpack_require__(35); /** @@ -64976,30 +66012,6 @@ var CanvasRenderer = new Class({ } }, - /** - * A NOOP method for handling lost context. Intentionally empty. - * - * @method Phaser.Renderer.Canvas.CanvasRenderer#onContextLost - * @since 3.0.0 - * - * @param {function} callback - Ignored parameter. - */ - onContextLost: function () - { - }, - - /** - * A NOOP method for handling restored context. Intentionally empty. - * - * @method Phaser.Renderer.Canvas.CanvasRenderer#onContextRestored - * @since 3.0.0 - * - * @param {function} callback - Ignored parameter. - */ - onContextRestored: function () - { - }, - /** * Resets the transformation matrix of the current context to the identity matrix, thus resetting any transformation. * @@ -65228,6 +66240,46 @@ var CanvasRenderer = new Class({ } }, + /** + * Takes a snapshot of the given area of the given canvas. + * + * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render. + * + * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets + * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotCanvas + * @since 3.19.0 + * + * @param {HTMLCanvasElement} canvas - The canvas to grab from. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? + * @param {integer} [x=0] - The x coordinate to grab from. + * @param {integer} [y=0] - The y coordinate to grab from. + * @param {integer} [width=canvas.width] - The width of the area to grab. + * @param {integer} [height=canvas.height] - The height of the area to grab. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This Canvas Renderer. + */ + snapshotCanvas: function (canvas, callback, getPixel, x, y, width, height, type, encoderOptions) + { + if (getPixel === undefined) { getPixel = false; } + + this.snapshotArea(x, y, width, height, callback, type, encoderOptions); + + var state = this.snapshotState; + + state.getPixel = getPixel; + + CanvasSnapshot(this.canvas, state); + + state.callback = null; + + return this; + }, + /** * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. * @@ -65356,14 +66408,16 @@ var CanvasRenderer = new Class({ var frameY = cd.y; var frameWidth = frame.cutWidth; var frameHeight = frame.cutHeight; + var customPivot = frame.customPivot; + var res = frame.source.resolution; - var x = -sprite.displayOriginX + frame.x; - var y = -sprite.displayOriginY + frame.y; + var displayOriginX = sprite.displayOriginX; + var displayOriginY = sprite.displayOriginY; + + var x = -displayOriginX + frame.x; + var y = -displayOriginY + frame.y; - var fx = (sprite.flipX) ? -1 : 1; - var fy = (sprite.flipY) ? -1 : 1; - if (sprite.isCropped) { var crop = sprite._crop; @@ -65379,10 +66433,10 @@ var CanvasRenderer = new Class({ frameX = crop.cx; frameY = crop.cy; - x = -sprite.displayOriginX + crop.x; - y = -sprite.displayOriginY + crop.y; + x = -displayOriginX + crop.x; + y = -displayOriginY + crop.y; - if (fx === -1) + if (sprite.flipX) { if (x >= 0) { @@ -65394,7 +66448,7 @@ var CanvasRenderer = new Class({ } } - if (fy === -1) + if (sprite.flipY) { if (y >= 0) { @@ -65407,7 +66461,31 @@ var CanvasRenderer = new Class({ } } - spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX, sprite.scaleY); + var flipX = 1; + var flipY = 1; + + if (sprite.flipX) + { + if (!customPivot) + { + x += (-frame.realWidth + (displayOriginX * 2)); + } + + flipX = -1; + } + + // Auto-invert the flipY if this is coming from a GLTexture + if (sprite.flipY) + { + if (!customPivot) + { + y += (-frame.realHeight + (displayOriginY * 2)); + } + + flipY = -1; + } + + spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX * flipX, sprite.scaleY * flipY); camMatrix.copyFrom(camera.matrix); @@ -65436,8 +66514,6 @@ var CanvasRenderer = new Class({ calcMatrix.setToContext(ctx); - ctx.scale(fx, fy); - ctx.globalCompositeOperation = this.blendModes[sprite.blendMode]; ctx.globalAlpha = alpha; @@ -65467,7 +66543,7 @@ module.exports = CanvasRenderer; /***/ }), -/* 331 */ +/* 334 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -65476,7 +66552,7 @@ module.exports = CanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(27); var Color = __webpack_require__(36); var GetFastValue = __webpack_require__(1); @@ -65560,7 +66636,7 @@ module.exports = CanvasSnapshot; /***/ }), -/* 332 */ +/* 335 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -65570,7 +66646,7 @@ module.exports = CanvasSnapshot; */ var modes = __webpack_require__(42); -var CanvasFeatures = __webpack_require__(307); +var CanvasFeatures = __webpack_require__(310); /** * Returns an array which maps the default blend modes to supported Canvas blend modes. @@ -65624,7 +66700,7 @@ module.exports = GetBlendModes; /***/ }), -/* 333 */ +/* 336 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -65634,22 +66710,24 @@ module.exports = GetBlendModes; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(120); -var CameraEvents = __webpack_require__(53); +var BaseCamera = __webpack_require__(121); +var CameraEvents = __webpack_require__(54); var Class = __webpack_require__(0); -var CONST = __webpack_require__(28); -var IsSizePowerOfTwo = __webpack_require__(125); -var ScaleEvents = __webpack_require__(99); +var CONST = __webpack_require__(34); +var GameEvents = __webpack_require__(22); +var IsSizePowerOfTwo = __webpack_require__(126); +var NOOP = __webpack_require__(2); +var ScaleEvents = __webpack_require__(101); var SpliceOne = __webpack_require__(84); -var TextureEvents = __webpack_require__(126); +var TextureEvents = __webpack_require__(127); var TransformMatrix = __webpack_require__(35); var Utils = __webpack_require__(10); -var WebGLSnapshot = __webpack_require__(334); +var WebGLSnapshot = __webpack_require__(337); // Default Pipelines -var BitmapMaskPipeline = __webpack_require__(335); -var ForwardDiffuseLightPipeline = __webpack_require__(336); -var TextureTintPipeline = __webpack_require__(184); +var BitmapMaskPipeline = __webpack_require__(338); +var ForwardDiffuseLightPipeline = __webpack_require__(339); +var TextureTintPipeline = __webpack_require__(185); /** * @callback WebGLContextCallback @@ -65680,9 +66758,6 @@ var WebGLRenderer = new Class({ function WebGLRenderer (game) { - // eslint-disable-next-line consistent-this - var renderer = this; - var gameConfig = game.config; var contextCreationConfig = { @@ -65763,24 +66838,6 @@ var WebGLRenderer = new Class({ */ this.canvas = game.canvas; - /** - * An array of functions to invoke if the WebGL context is lost. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#lostContextCallbacks - * @type {WebGLContextCallback[]} - * @since 3.0.0 - */ - this.lostContextCallbacks = []; - - /** - * An array of functions to invoke if the WebGL context is restored. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#restoredContextCallbacks - * @type {WebGLContextCallback[]} - * @since 3.0.0 - */ - this.restoredContextCallbacks = []; - /** * An array of blend modes supported by the WebGL Renderer. * @@ -65804,7 +66861,7 @@ var WebGLRenderer = new Class({ this.nativeTextures = []; /** - * Set to `true` if the WebGL context of the renderer is lost. + * This property is set to `true` if the WebGL context of the renderer is lost. * * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLost * @type {boolean} @@ -65840,7 +66897,10 @@ var WebGLRenderer = new Class({ getPixel: false, callback: null, type: 'image/png', - encoder: 0.92 + encoder: 0.92, + isFramebuffer: false, + bufferWidth: 0, + bufferHeight: 0 }; // Internal Renderer State (Textures, Framebuffers, Pipelines, Buffers, etc) @@ -65939,7 +66999,6 @@ var WebGLRenderer = new Class({ * @type {Uint32Array} * @since 3.0.0 */ - // this.currentScissor = new Uint32Array([ 0, 0, this.width, this.height ]); this.currentScissor = null; /** @@ -65951,32 +67010,25 @@ var WebGLRenderer = new Class({ */ this.scissorStack = []; - // Setup context lost and restore event listeners + /** + * The handler to invoke when the context is lost. + * This should not be changed and is set in the boot method. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLostHandler + * @type {function} + * @since 3.19.0 + */ + this.contextLostHandler = NOOP; - this.canvas.addEventListener('webglcontextlost', function (event) - { - renderer.contextLost = true; - event.preventDefault(); - - for (var index = 0; index < renderer.lostContextCallbacks.length; ++index) - { - var callback = renderer.lostContextCallbacks[index]; - callback[0].call(callback[1], renderer); - } - }, false); - - this.canvas.addEventListener('webglcontextrestored', function () - { - renderer.contextLost = false; - renderer.init(renderer.config); - for (var index = 0; index < renderer.restoredContextCallbacks.length; ++index) - { - var callback = renderer.restoredContextCallbacks[index]; - callback[0].call(callback[1], renderer); - } - }, false); - - // These are initialized post context creation + /** + * The handler to invoke when the context is restored. + * This should not be changed and is set in the boot method. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#contextRestoredHandler + * @type {function} + * @since 3.19.0 + */ + this.contextRestoredHandler = NOOP; /** * The underlying WebGL context of the renderer. @@ -66147,6 +67199,36 @@ var WebGLRenderer = new Class({ */ this.glFuncMap = null; + /** + * The `type` of the Game Object being currently rendered. + * This can be used by advanced render functions for batching look-ahead. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentType + * @type {string} + * @since 3.19.0 + */ + this.currentType = ''; + + /** + * Is the `type` of the Game Object being currently rendered different than the + * type of the object before it in the display list? I.e. it's a 'new' type. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#newType + * @type {boolean} + * @since 3.19.0 + */ + this.newType = false; + + /** + * Does the `type` of the next Game Object in the display list match that + * of the object being currently rendered? + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#nextTypeMatch + * @type {boolean} + * @since 3.19.0 + */ + this.nextTypeMatch = false; + this.init(this.config); }, @@ -66186,6 +67268,29 @@ var WebGLRenderer = new Class({ this.gl = gl; + var _this = this; + + this.contextLostHandler = function (event) + { + _this.contextLost = true; + + _this.game.events.emit(GameEvents.CONTEXT_LOST, _this); + + event.preventDefault(); + }; + + this.contextRestoredHandler = function () + { + _this.contextLost = false; + + _this.init(_this.config); + + _this.game.events.emit(GameEvents.CONTEXT_RESTORED, _this); + }; + + canvas.addEventListener('webglcontextlost', this.contextLostHandler, false); + canvas.addEventListener('webglcontextrestored', this.contextRestoredHandler, false); + // Set it back into the Game, so developers can access it from there too game.context = gl; @@ -66384,42 +67489,6 @@ var WebGLRenderer = new Class({ return this; }, - /** - * Adds a callback to be invoked when the WebGL context has been restored by the browser. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextRestored - * @since 3.0.0 - * - * @param {WebGLContextCallback} callback - The callback to be invoked on context restoration. - * @param {object} target - The context of the callback. - * - * @return {this} This WebGLRenderer instance. - */ - onContextRestored: function (callback, target) - { - this.restoredContextCallbacks.push([ callback, target ]); - - return this; - }, - - /** - * Adds a callback to be invoked when the WebGL context has been lost by the browser. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextLost - * @since 3.0.0 - * - * @param {WebGLContextCallback} callback - The callback to be invoked on context loss. - * @param {object} target - The context of the callback. - * - * @return {this} This WebGLRenderer instance. - */ - onContextLost: function (callback, target) - { - this.lostContextCallbacks.push([ callback, target ]); - - return this; - }, - /** * Checks if a WebGL extension is supported * @@ -66592,6 +67661,8 @@ var WebGLRenderer = new Class({ */ setScissor: function (x, y, width, height, drawingBufferHeight) { + if (drawingBufferHeight === undefined) { drawingBufferHeight = this.drawingBufferHeight; } + var gl = this.gl; var current = this.currentScissor; @@ -66804,12 +67875,14 @@ var WebGLRenderer = new Class({ /** * Creates a new custom blend mode for the renderer. + * + * See https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Blending_modes * * @method Phaser.Renderer.WebGL.WebGLRenderer#addBlendMode * @since 3.0.0 * - * @param {function} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. - * @param {function} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. + * @param {GLenum[]} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. + * @param {GLenum} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. * * @return {integer} The index of the new blend mode, used for referencing it in the future. */ @@ -67646,6 +68719,20 @@ var WebGLRenderer = new Class({ // Apply scissor for cam region + render background color, if not transparent this.preRenderCamera(camera); + // Nothing to render, so bail out + if (childCount === 0) + { + this.setBlendMode(CONST.BlendModes.NORMAL); + + // Applies camera effects and pops the scissor, if set + this.postRenderCamera(camera); + + return; + } + + // Reset the current type + this.currentType = ''; + var current = this.currentMask; for (var i = 0; i < childCount; i++) @@ -67677,7 +68764,19 @@ var WebGLRenderer = new Class({ mask.preRenderWebGL(this, child, camera); } + var type = child.type; + + if (type !== this.currentType) + { + this.newType = true; + this.currentType = type; + } + + this.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === this.currentType) : false; + child.renderWebGL(this, child, interpolationPercentage, camera); + + this.newType = false; } current = this.currentMask; @@ -67824,6 +68923,65 @@ var WebGLRenderer = new Class({ return this; }, + /** + * Takes a snapshot of the given area of the given frame buffer. + * + * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotFramebuffer + * @since 3.19.0 + * + * @param {WebGLFramebuffer} framebuffer - The framebuffer to grab from. + * @param {integer} bufferWidth - The width of the framebuffer. + * @param {integer} bufferHeight - The height of the framebuffer. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? + * @param {integer} [x=0] - The x coordinate to grab from. + * @param {integer} [y=0] - The y coordinate to grab from. + * @param {integer} [width=bufferWidth] - The width of the area to grab. + * @param {integer} [height=bufferHeight] - The height of the area to grab. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This WebGL Renderer. + */ + snapshotFramebuffer: function (framebuffer, bufferWidth, bufferHeight, callback, getPixel, x, y, width, height, type, encoderOptions) + { + if (getPixel === undefined) { getPixel = false; } + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = bufferWidth; } + if (height === undefined) { height = bufferHeight; } + + var currentFramebuffer = this.currentFramebuffer; + + this.snapshotArea(x, y, width, height, callback, type, encoderOptions); + + var state = this.snapshotState; + + state.getPixel = getPixel; + + state.isFramebuffer = true; + state.bufferWidth = bufferWidth; + state.bufferHeight = bufferHeight; + + this.setFramebuffer(framebuffer); + + WebGLSnapshot(this.canvas, state); + + this.setFramebuffer(currentFramebuffer); + + state.callback = null; + state.isFramebuffer = false; + + return this; + }, + /** * Creates a WebGL Texture based on the given canvas element. * @@ -68264,6 +69422,14 @@ var WebGLRenderer = new Class({ destroy: function () { // Clear-up anything that should be cleared :) + + for (var i = 0; i < this.nativeTextures.length; i++) + { + this.gl.deleteTexture(this.nativeTextures[i]); + } + + this.nativeTextures = []; + for (var key in this.pipelines) { this.pipelines[key].destroy(); @@ -68271,21 +69437,23 @@ var WebGLRenderer = new Class({ delete this.pipelines[key]; } - for (var index = 0; index < this.nativeTextures.length; index++) - { - this.deleteTexture(this.nativeTextures[index]); + this.defaultCamera.destroy(); - delete this.nativeTextures[index]; - } + this.currentMask = null; + this.currentCameraMask = null; - delete this.gl; - delete this.game; + this.canvas.removeEventListener('webglcontextlost', this.contextLostHandler, false); + this.canvas.removeEventListener('webglcontextrestored', this.contextRestoredHandler, false); - this.maskStack.length = 0; + this.game = null; + this.gl = null; + this.canvas = null; + + this.maskStack = []; this.contextLost = true; + this.extensions = {}; - this.nativeTextures.length = 0; } }); @@ -68294,7 +69462,7 @@ module.exports = WebGLRenderer; /***/ }), -/* 334 */ +/* 337 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -68303,7 +69471,7 @@ module.exports = WebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(27); var Color = __webpack_require__(36); var GetFastValue = __webpack_require__(1); @@ -68328,23 +69496,34 @@ var WebGLSnapshot = function (sourceCanvas, config) var encoderOptions = GetFastValue(config, 'encoder', 0.92); var x = GetFastValue(config, 'x', 0); var y = GetFastValue(config, 'y', 0); - var width = GetFastValue(config, 'width', gl.drawingBufferWidth); - var height = GetFastValue(config, 'height', gl.drawingBufferHeight); + var getPixel = GetFastValue(config, 'getPixel', false); + var isFramebuffer = GetFastValue(config, 'isFramebuffer', false); + + var bufferWidth = (isFramebuffer) ? GetFastValue(config, 'bufferWidth', 1) : gl.drawingBufferWidth; + var bufferHeight = (isFramebuffer) ? GetFastValue(config, 'bufferHeight', 1) : gl.drawingBufferHeight; + if (getPixel) { var pixel = new Uint8Array(4); - gl.readPixels(x, gl.drawingBufferHeight - y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); + var destY = (isFramebuffer) ? y : bufferHeight - y; + + gl.readPixels(x, destY, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3] / 255)); } else { - var pixels = new Uint8Array(width * height * 4); + var width = GetFastValue(config, 'width', bufferWidth); + var height = GetFastValue(config, 'height', bufferHeight); - gl.readPixels(x, gl.drawingBufferHeight - y - height, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + var total = width * height * 4; + + var pixels = new Uint8Array(total); + + gl.readPixels(x, bufferHeight - y - height, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); var canvas = CanvasPool.createWebGL(this, width, height); var ctx = canvas.getContext('2d'); @@ -68352,13 +69531,13 @@ var WebGLSnapshot = function (sourceCanvas, config) var imageData = ctx.getImageData(0, 0, width, height); var data = imageData.data; - + for (var py = 0; py < height; py++) { for (var px = 0; px < width; px++) { var sourceIndex = ((height - py) * width + px) * 4; - var destIndex = (py * width + px) * 4; + var destIndex = (isFramebuffer) ? total - ((py * width + (width - px)) * 4) : (py * width + px) * 4; data[destIndex + 0] = pixels[sourceIndex + 0]; data[destIndex + 1] = pixels[sourceIndex + 1]; @@ -68366,7 +69545,7 @@ var WebGLSnapshot = function (sourceCanvas, config) data[destIndex + 3] = pixels[sourceIndex + 3]; } } - + ctx.putImageData(imageData, 0, 0); var image = new Image(); @@ -68393,7 +69572,7 @@ module.exports = WebGLSnapshot; /***/ }), -/* 335 */ +/* 338 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -68404,9 +69583,9 @@ module.exports = WebGLSnapshot; */ var Class = __webpack_require__(0); -var ShaderSourceFS = __webpack_require__(762); -var ShaderSourceVS = __webpack_require__(763); -var WebGLPipeline = __webpack_require__(183); +var ShaderSourceFS = __webpack_require__(768); +var ShaderSourceVS = __webpack_require__(769); +var WebGLPipeline = __webpack_require__(184); /** * @classdesc @@ -68656,7 +69835,7 @@ module.exports = BitmapMaskPipeline; /***/ }), -/* 336 */ +/* 339 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -68667,8 +69846,8 @@ module.exports = BitmapMaskPipeline; */ var Class = __webpack_require__(0); -var ShaderSourceFS = __webpack_require__(764); -var TextureTintPipeline = __webpack_require__(184); +var ShaderSourceFS = __webpack_require__(770); +var TextureTintPipeline = __webpack_require__(185); var LIGHT_COUNT = 10; @@ -69158,7 +70337,7 @@ module.exports = ForwardDiffuseLightPipeline; /***/ }), -/* 337 */ +/* 340 */ /***/ (function(module, exports) { /** @@ -69908,7 +71087,7 @@ module.exports = ModelViewProjection; /***/ }), -/* 338 */ +/* 341 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -69917,7 +71096,7 @@ module.exports = ModelViewProjection; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(28); +var CONST = __webpack_require__(34); /** * Called automatically by Phaser.Game and responsible for creating the console.log debug header. @@ -70038,7 +71217,7 @@ module.exports = DebugHeader; /***/ }), -/* 339 */ +/* 342 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -70050,7 +71229,7 @@ module.exports = DebugHeader; var Class = __webpack_require__(0); var GetValue = __webpack_require__(5); var NOOP = __webpack_require__(2); -var RequestAnimationFrame = __webpack_require__(340); +var RequestAnimationFrame = __webpack_require__(343); // Frame Rate config // fps: { @@ -70745,7 +71924,7 @@ module.exports = TimeStep; /***/ }), -/* 340 */ +/* 343 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -70945,7 +72124,7 @@ module.exports = RequestAnimationFrame; /***/ }), -/* 341 */ +/* 344 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -70954,7 +72133,7 @@ module.exports = RequestAnimationFrame; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Events = __webpack_require__(30); +var Events = __webpack_require__(22); /** * The Visibility Handler is responsible for listening out for document level visibility change events. @@ -71036,7 +72215,7 @@ module.exports = VisibilityHandler; /***/ }), -/* 342 */ +/* 345 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71045,8 +72224,8 @@ module.exports = VisibilityHandler; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Arne16 = __webpack_require__(343); -var CanvasPool = __webpack_require__(26); +var Arne16 = __webpack_require__(346); +var CanvasPool = __webpack_require__(27); var GetValue = __webpack_require__(5); /** @@ -71130,7 +72309,7 @@ module.exports = GenerateTexture; /***/ }), -/* 343 */ +/* 346 */ /***/ (function(module, exports) { /** @@ -71168,7 +72347,7 @@ module.exports = { /***/ }), -/* 344 */ +/* 347 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71180,7 +72359,7 @@ module.exports = { // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var CubicBezier = __webpack_require__(315); +var CubicBezier = __webpack_require__(318); var Curve = __webpack_require__(85); var Vector2 = __webpack_require__(3); @@ -71395,7 +72574,7 @@ module.exports = CubicBezierCurve; /***/ }), -/* 345 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71410,7 +72589,7 @@ var Class = __webpack_require__(0); var Curve = __webpack_require__(85); var DegToRad = __webpack_require__(40); var GetValue = __webpack_require__(5); -var RadToDeg = __webpack_require__(180); +var RadToDeg = __webpack_require__(181); var Vector2 = __webpack_require__(3); /** @@ -71431,7 +72610,7 @@ var Vector2 = __webpack_require__(3); * @param {number} [yRadius=0] - The vertical radius of ellipse. * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. - * @param {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). * @param {integer} [rotation=0] - The rotation of the ellipse, in degrees. */ var EllipseCurve = new Class({ @@ -72019,7 +73198,7 @@ module.exports = EllipseCurve; /***/ }), -/* 346 */ +/* 349 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72032,7 +73211,7 @@ module.exports = EllipseCurve; var Class = __webpack_require__(0); var Curve = __webpack_require__(85); -var FromPoints = __webpack_require__(185); +var FromPoints = __webpack_require__(186); var Rectangle = __webpack_require__(11); var Vector2 = __webpack_require__(3); @@ -72276,7 +73455,7 @@ module.exports = LineCurve; /***/ }), -/* 347 */ +/* 350 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72287,7 +73466,7 @@ module.exports = LineCurve; var Class = __webpack_require__(0); var Curve = __webpack_require__(85); -var QuadraticBezierInterpolation = __webpack_require__(316); +var QuadraticBezierInterpolation = __webpack_require__(319); var Vector2 = __webpack_require__(3); /** @@ -72490,7 +73669,7 @@ module.exports = QuadraticBezier; /***/ }), -/* 348 */ +/* 351 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72501,7 +73680,7 @@ module.exports = QuadraticBezier; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) -var CatmullRom = __webpack_require__(178); +var CatmullRom = __webpack_require__(179); var Class = __webpack_require__(0); var Curve = __webpack_require__(85); var Vector2 = __webpack_require__(3); @@ -72715,7 +73894,7 @@ module.exports = SplineCurve; /***/ }), -/* 349 */ +/* 352 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72839,7 +74018,7 @@ module.exports = BaseShader; /***/ }), -/* 350 */ +/* 353 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72850,30 +74029,30 @@ module.exports = BaseShader; var Color = __webpack_require__(36); -Color.ColorToRGBA = __webpack_require__(800); -Color.ComponentToHex = __webpack_require__(351); -Color.GetColor = __webpack_require__(171); -Color.GetColor32 = __webpack_require__(286); -Color.HexStringToColor = __webpack_require__(285); -Color.HSLToColor = __webpack_require__(801); -Color.HSVColorWheel = __webpack_require__(802); -Color.HSVToRGB = __webpack_require__(172); -Color.HueToComponent = __webpack_require__(352); -Color.IntegerToColor = __webpack_require__(288); -Color.IntegerToRGB = __webpack_require__(289); -Color.Interpolate = __webpack_require__(803); -Color.ObjectToColor = __webpack_require__(290); -Color.RandomRGB = __webpack_require__(804); -Color.RGBStringToColor = __webpack_require__(291); -Color.RGBToHSV = __webpack_require__(287); -Color.RGBToString = __webpack_require__(805); -Color.ValueToColor = __webpack_require__(170); +Color.ColorToRGBA = __webpack_require__(806); +Color.ComponentToHex = __webpack_require__(354); +Color.GetColor = __webpack_require__(172); +Color.GetColor32 = __webpack_require__(289); +Color.HexStringToColor = __webpack_require__(288); +Color.HSLToColor = __webpack_require__(807); +Color.HSVColorWheel = __webpack_require__(808); +Color.HSVToRGB = __webpack_require__(173); +Color.HueToComponent = __webpack_require__(355); +Color.IntegerToColor = __webpack_require__(291); +Color.IntegerToRGB = __webpack_require__(292); +Color.Interpolate = __webpack_require__(809); +Color.ObjectToColor = __webpack_require__(293); +Color.RandomRGB = __webpack_require__(810); +Color.RGBStringToColor = __webpack_require__(294); +Color.RGBToHSV = __webpack_require__(290); +Color.RGBToString = __webpack_require__(811); +Color.ValueToColor = __webpack_require__(171); module.exports = Color; /***/ }), -/* 351 */ +/* 354 */ /***/ (function(module, exports) { /** @@ -72903,7 +74082,7 @@ module.exports = ComponentToHex; /***/ }), -/* 352 */ +/* 355 */ /***/ (function(module, exports) { /** @@ -72959,7 +74138,7 @@ module.exports = HueToComponent; /***/ }), -/* 353 */ +/* 356 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72968,7 +74147,7 @@ module.exports = HueToComponent; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(123); +var OS = __webpack_require__(124); /** * @callback ContentLoadedCallback @@ -73022,7 +74201,7 @@ module.exports = DOMContentLoaded; /***/ }), -/* 354 */ +/* 357 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73031,7 +74210,7 @@ module.exports = DOMContentLoaded; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(186); +var CONST = __webpack_require__(187); /** * Attempts to determine the screen orientation using the Orientation API. @@ -73088,7 +74267,7 @@ module.exports = GetScreenOrientation; /***/ }), -/* 355 */ +/* 358 */ /***/ (function(module, exports) { /** @@ -73174,7 +74353,7 @@ module.exports = { /***/ }), -/* 356 */ +/* 359 */ /***/ (function(module, exports) { /** @@ -73227,7 +74406,7 @@ module.exports = { /***/ }), -/* 357 */ +/* 360 */ /***/ (function(module, exports) { /** @@ -73325,7 +74504,7 @@ module.exports = { /***/ }), -/* 358 */ +/* 361 */ /***/ (function(module, exports) { /** @@ -73399,7 +74578,7 @@ module.exports = { /***/ }), -/* 359 */ +/* 362 */ /***/ (function(module, exports) { /** @@ -73450,7 +74629,7 @@ module.exports = GetTarget; /***/ }), -/* 360 */ +/* 363 */ /***/ (function(module, exports) { /** @@ -73507,7 +74686,7 @@ module.exports = ParseXML; /***/ }), -/* 361 */ +/* 364 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73517,16 +74696,16 @@ module.exports = ParseXML; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(188); +var CONST = __webpack_require__(189); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(54); -var GameEvents = __webpack_require__(30); -var Keyboard = __webpack_require__(362); -var Mouse = __webpack_require__(363); -var Pointer = __webpack_require__(364); -var Touch = __webpack_require__(365); +var Events = __webpack_require__(55); +var GameEvents = __webpack_require__(22); +var Keyboard = __webpack_require__(365); +var Mouse = __webpack_require__(366); +var Pointer = __webpack_require__(367); +var Touch = __webpack_require__(368); var TransformMatrix = __webpack_require__(35); -var TransformXY = __webpack_require__(323); +var TransformXY = __webpack_require__(326); /** * @classdesc @@ -73970,7 +75149,7 @@ var InputManager = new Class({ */ resetCursor: function (interactiveObject) { - if (interactiveObject.cursor) + if (interactiveObject.cursor && this.canvas) { this.canvas.style.cursor = this.defaultCursor; } @@ -74283,6 +75462,25 @@ var InputManager = new Class({ this.updateInputPlugins(CONST.MOUSE_WHEEL, this.mousePointerContainer); }, + /** + * Processes a pointer lock change event, as passed in by the MouseManager. + * + * @method Phaser.Input.InputManager#onPointerLockChange + * @fires Phaser.Input.Events#POINTERLOCK_CHANGE + * @private + * @since 3.19.0 + * + * @param {MouseEvent} event - The native DOM Mouse event. + */ + onPointerLockChange: function (event) + { + var isLocked = this.mouse.locked; + + this.mousePointer.locked = isLocked; + + this.events.emit(Events.POINTERLOCK_CHANGE, event, isLocked); + }, + /** * Checks if the given Game Object should be considered as a candidate for input or not. * @@ -74570,7 +75768,7 @@ module.exports = InputManager; /***/ }), -/* 362 */ +/* 365 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -74579,11 +75777,11 @@ module.exports = InputManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayRemove = __webpack_require__(128); +var ArrayRemove = __webpack_require__(129); var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(30); -var InputEvents = __webpack_require__(54); -var KeyCodes = __webpack_require__(129); +var GameEvents = __webpack_require__(22); +var InputEvents = __webpack_require__(55); +var KeyCodes = __webpack_require__(130); var NOOP = __webpack_require__(0); /** @@ -75020,7 +76218,7 @@ module.exports = KeyboardManager; /***/ }), -/* 363 */ +/* 366 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75030,8 +76228,8 @@ module.exports = KeyboardManager; */ var Class = __webpack_require__(0); -var Features = __webpack_require__(175); -var InputEvents = __webpack_require__(54); +var Features = __webpack_require__(176); +var InputEvents = __webpack_require__(55); var NOOP = __webpack_require__(0); // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent @@ -75438,8 +76636,8 @@ var MouseManager = new Class({ var element = _this.target; _this.locked = (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element) ? true : false; - - _this.manager.queue.push(event); + + _this.manager.onPointerLockChange(event); }; document.addEventListener('pointerlockchange', this.pointerLockChange, true); @@ -75502,7 +76700,7 @@ module.exports = MouseManager; /***/ }), -/* 364 */ +/* 367 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75511,11 +76709,11 @@ module.exports = MouseManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Angle = __webpack_require__(308); +var Angle = __webpack_require__(311); var Class = __webpack_require__(0); -var Distance = __webpack_require__(62); -var FuzzyEqual = __webpack_require__(177); -var SmoothStepInterpolation = __webpack_require__(317); +var Distance = __webpack_require__(63); +var FuzzyEqual = __webpack_require__(178); +var SmoothStepInterpolation = __webpack_require__(320); var Vector2 = __webpack_require__(3); /** @@ -75766,6 +76964,9 @@ var Pointer = new Class({ /** * The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. * * @name Phaser.Input.Pointer#worldX * @type {number} @@ -75776,6 +76977,9 @@ var Pointer = new Class({ /** * The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. * * @name Phaser.Input.Pointer#worldY * @type {number} @@ -75946,13 +77150,20 @@ var Pointer = new Class({ this.active = (id === 0) ? true : false; /** - * Time when this Pointer was most recently updated by a DOM Event. + * Is this pointer Pointer Locked? + * + * Only a mouse pointer can be locked and it only becomes locked when requested via + * the browsers Pointer Lock API. + * + * You can request this by calling the `this.input.mouse.requestPointerLock()` method from + * a `pointerdown` or `pointerup` event handler. * - * @name Phaser.Input.Pointer#time - * @type {number} - * @since 3.16.0 + * @name Phaser.Input.Pointer#locked + * @readonly + * @type {boolean} + * @since 3.19.0 */ - this.time = 0; + this.locked = false; /** * The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. @@ -75986,6 +77197,40 @@ var Pointer = new Class({ this.deltaZ = 0; }, + /** + * Takes a Camera and updates this Pointer's `worldX` and `worldY` values so they are + * the result of a translation through the given Camera. + * + * Note that the values will be automatically replaced the moment the Pointer is + * updated by an input event, such as a mouse move, so should be used immediately. + * + * @method Phaser.Input.Pointer#updateWorldPoint + * @since 3.19.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera which is being tested against. + * + * @return {this} This Pointer object. + */ + updateWorldPoint: function (camera) + { + var x = this.x; + var y = this.y; + + if (camera.resolution !== 1) + { + x += camera._x; + y += camera._y; + } + + // Stores the world point inside of tempPoint + var temp = camera.getWorldPoint(x, y); + + this.worldX = temp.x; + this.worldY = temp.y; + + return this; + }, + /** * Takes a Camera and returns a Vector2 containing the translated position of this Pointer * within that Camera. This can be used to convert this Pointers position into camera space. @@ -76150,11 +77395,11 @@ var Pointer = new Class({ // Sets the local x/y properties this.manager.transformPointer(this, event.pageX, event.pageY, true); - if (this.manager.mouse.locked) + if (this.locked) { // Multiple DOM events may occur within one frame, but only one Phaser event will fire - this.movementX += event.movementX || event.mozMovementX || event.webkitMovementX || 0; - this.movementY += event.movementY || event.mozMovementY || event.webkitMovementY || 0; + this.movementX = event.movementX || event.mozMovementX || event.webkitMovementX || 0; + this.movementY = event.movementY || event.mozMovementY || event.webkitMovementY || 0; } this.moveTime = event.timeStamp; @@ -76223,7 +77468,7 @@ var Pointer = new Class({ this.primaryDown = true; this.downX = this.x; this.downY = this.y; - this.downTime = touch.timeStamp; + this.downTime = event.timeStamp; this.isDown = true; @@ -76250,7 +77495,7 @@ var Pointer = new Class({ // Sets the local x/y properties this.manager.transformPointer(this, touch.pageX, touch.pageY, true); - this.moveTime = touch.timeStamp; + this.moveTime = event.timeStamp; this.wasTouch = true; @@ -76281,7 +77526,7 @@ var Pointer = new Class({ this.primaryDown = false; this.upX = this.x; this.upY = this.y; - this.upTime = touch.timeStamp; + this.upTime = event.timeStamp; this.isDown = false; @@ -76317,7 +77562,7 @@ var Pointer = new Class({ this.primaryDown = false; this.upX = this.x; this.upY = this.y; - this.upTime = touch.timeStamp; + this.upTime = event.timeStamp; this.isDown = false; @@ -76561,7 +77806,7 @@ var Pointer = new Class({ { if (this.isDown) { - return (this.time - this.downTime); + return (this.manager.time - this.downTime); } else { @@ -76706,6 +77951,25 @@ var Pointer = new Class({ this.position.y = value; } + }, + + /** + * Time when this Pointer was most recently updated by a DOM Event. + * This comes directly from the `event.timeStamp` property. + * If no event has yet taken place, it will return zero. + * + * @name Phaser.Input.Pointer#time + * @type {number} + * @readonly + * @since 3.16.0 + */ + time: { + + get: function () + { + return (this.event) ? this.event.timeStamp : 0; + } + } }); @@ -76714,7 +77978,7 @@ module.exports = Pointer; /***/ }), -/* 365 */ +/* 368 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76724,7 +77988,7 @@ module.exports = Pointer; */ var Class = __webpack_require__(0); -var InputEvents = __webpack_require__(54); +var InputEvents = __webpack_require__(55); var NOOP = __webpack_require__(2); // https://developer.mozilla.org/en-US/docs/Web/API/Touch_events @@ -77099,7 +78363,7 @@ module.exports = TouchManager; /***/ }), -/* 366 */ +/* 369 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -77109,14 +78373,14 @@ module.exports = TouchManager; */ var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(30); +var GameEvents = __webpack_require__(22); var EventEmitter = __webpack_require__(9); var FileTypesManager = __webpack_require__(8); -var GameObjectCreator = __webpack_require__(15); +var GameObjectCreator = __webpack_require__(16); var GameObjectFactory = __webpack_require__(6); var GetFastValue = __webpack_require__(1); -var PluginCache = __webpack_require__(17); -var Remove = __webpack_require__(128); +var PluginCache = __webpack_require__(18); +var Remove = __webpack_require__(129); /** * @classdesc @@ -77888,6 +79152,35 @@ var PluginManager = new Class({ return this; }, + /** + * Removes a previously registered Game Object from the global Game Object Factory and / or Creator. + * This is usually called from within your Plugin destruction code to help clean-up after your plugin has been removed. + * + * @method Phaser.Plugins.PluginManager#removeGameObject + * @since 3.19.0 + * + * @param {string} key - The key of the Game Object to be removed from the factories. + * @param {boolean} [removeFromFactory=true] - Should the Game Object be removed from the Game Object Factory? + * @param {boolean} [removeFromCreator=true] - Should the Game Object be removed from the Game Object Creator? + */ + removeGameObject: function (key, removeFromFactory, removeFromCreator) + { + if (removeFromFactory === undefined) { removeFromFactory = true; } + if (removeFromCreator === undefined) { removeFromCreator = true; } + + if (removeFromFactory) + { + GameObjectFactory.remove(key); + } + + if (removeFromCreator) + { + GameObjectCreator.remove(key); + } + + return this; + }, + /** * Registers a new file type with the global File Types Manager, making it available to all Loader * Plugins created after this. @@ -77972,7 +79265,7 @@ module.exports = PluginManager; /***/ }), -/* 367 */ +/* 370 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -77981,18 +79274,18 @@ module.exports = PluginManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(186); +var CONST = __webpack_require__(187); var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(99); -var GameEvents = __webpack_require__(30); -var GetInnerHeight = __webpack_require__(858); -var GetTarget = __webpack_require__(359); -var GetScreenOrientation = __webpack_require__(354); +var Events = __webpack_require__(101); +var GameEvents = __webpack_require__(22); +var GetInnerHeight = __webpack_require__(864); +var GetTarget = __webpack_require__(362); +var GetScreenOrientation = __webpack_require__(357); var NOOP = __webpack_require__(2); var Rectangle = __webpack_require__(11); -var Size = __webpack_require__(368); -var SnapFloor = __webpack_require__(100); +var Size = __webpack_require__(371); +var SnapFloor = __webpack_require__(102); var Vector2 = __webpack_require__(3); /** @@ -78237,6 +79530,16 @@ var ScaleManager = new Class({ */ this.zoom = 1; + /** + * Internal flag set when the game zoom factor is modified. + * + * @name Phaser.Scale.ScaleManager#_resetZoom + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this._resetZoom = false; + /** * The scale factor between the baseSize and the canvasBounds. * @@ -78531,6 +79834,11 @@ var ScaleManager = new Class({ this.zoom = zoom; + if (zoom !== 1) + { + this._resetZoom = true; + } + // The modified game size, which is the w/h * resolution this.baseSize.setSize(width * resolution, height * resolution); @@ -78845,6 +80153,7 @@ var ScaleManager = new Class({ setZoom: function (value) { this.zoom = value; + this._resetZoom = true; return this.refresh(); }, @@ -78861,6 +80170,7 @@ var ScaleManager = new Class({ setMaxZoom: function () { this.zoom = this.getMaxZoom(); + this._resetZoom = true; return this.refresh(); }, @@ -78973,10 +80283,12 @@ var ScaleManager = new Class({ styleHeight = Math.floor(styleHeight); } - if (zoom > 1) + if (this._resetZoom) { style.width = styleWidth + 'px'; style.height = styleHeight + 'px'; + + this._resetZoom = false; } } else if (this.scaleMode === CONST.SCALE_MODE.RESIZE) @@ -79203,14 +80515,14 @@ var ScaleManager = new Class({ if (fullscreen.keyboard) { fsTarget[fullscreen.request](Element.ALLOW_KEYBOARD_INPUT) - .then(this.fullscreenSuccessHandler) - .catch(this.fullscreenErrorHandler); + .then(this.fullscreenSuccessHandler.bind(this)) + .catch(this.fullscreenErrorHandler.bind(this)); } else { fsTarget[fullscreen.request](fullscreenOptions) - .then(this.fullscreenSuccessHandler) - .catch(this.fullscreenErrorHandler); + .then(this.fullscreenSuccessHandler.bind(this)) + .catch(this.fullscreenErrorHandler.bind(this)); } } else @@ -79554,11 +80866,12 @@ var ScaleManager = new Class({ this.canvas = null; this.canvasBounds = null; this.parent = null; + this.fullscreenTarget = null; + this.parentSize.destroy(); this.gameSize.destroy(); this.baseSize.destroy(); this.displaySize.destroy(); - this.fullscreenTarget = null; }, /** @@ -79696,7 +81009,7 @@ module.exports = ScaleManager; /***/ }), -/* 368 */ +/* 371 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -79705,9 +81018,9 @@ module.exports = ScaleManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var SnapFloor = __webpack_require__(100); +var SnapFloor = __webpack_require__(102); var Vector2 = __webpack_require__(3); /** @@ -80476,7 +81789,7 @@ module.exports = Size; /***/ }), -/* 369 */ +/* 372 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80486,14 +81799,14 @@ module.exports = Size; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(130); -var Events = __webpack_require__(18); -var GameEvents = __webpack_require__(30); +var CONST = __webpack_require__(131); +var Events = __webpack_require__(19); +var GameEvents = __webpack_require__(22); var GetValue = __webpack_require__(5); var LoaderEvents = __webpack_require__(86); var NOOP = __webpack_require__(2); -var Scene = __webpack_require__(370); -var Systems = __webpack_require__(189); +var Scene = __webpack_require__(373); +var Systems = __webpack_require__(190); /** * @classdesc @@ -82110,7 +83423,7 @@ module.exports = SceneManager; /***/ }), -/* 370 */ +/* 373 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -82120,12 +83433,14 @@ module.exports = SceneManager; */ var Class = __webpack_require__(0); -var Systems = __webpack_require__(189); +var Systems = __webpack_require__(190); /** * @classdesc * A base Phaser.Scene class which can be extended for your own use. * + * You can also define the optional methods {@link Phaser.Types.Scenes.SceneInitCallback init()}, {@link Phaser.Types.Scenes.ScenePreloadCallback preload()}, and {@link Phaser.Types.Scenes.SceneCreateCallback create()}. + * * @class Scene * @memberof Phaser * @constructor @@ -82408,80 +83723,13 @@ var Scene = new Class({ { } - /** - * Can be defined on your own Scenes. - * This method is called by the Scene Manager when the scene starts, before `preload()` and `create()`. - * - * @method Phaser.Scene#init - * @since 3.0.0 - * - * @param {object} data - Any data passed via `ScenePlugin.add()` or `ScenePlugin.start()`. Same as Scene.settings.data. - */ - - /** - * Can be defined on your own Scenes. Use it to load assets. - * This method is called by the Scene Manager, after `init()` and before `create()`, only if the Scene has a LoaderPlugin. - * After this method completes, if the LoaderPlugin's queue isn't empty, the LoaderPlugin will start automatically. - * - * @method Phaser.Scene#preload - * @since 3.0.0 - */ - - /** - * Can be defined on your own Scenes. Use it to create your game objects. - * This method is called by the Scene Manager when the scene starts, after `init()` and `preload()`. - * If the LoaderPlugin started after `preload()`, then this method is called only after loading is complete. - * - * @method Phaser.Scene#create - * @since 3.0.0 - * - * @param {object} data - Any data passed via `ScenePlugin.add()` or `ScenePlugin.start()`. Same as Scene.settings.data. - */ - }); module.exports = Scene; /***/ }), -/* 371 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Capitalizes the first letter of a string if there is one. - * @example - * UppercaseFirst('abc'); - * // returns 'Abc' - * @example - * UppercaseFirst('the happy family'); - * // returns 'The happy family' - * @example - * UppercaseFirst(''); - * // returns '' - * - * @function Phaser.Utils.String.UppercaseFirst - * @since 3.0.0 - * - * @param {string} str - The string to capitalize. - * - * @return {string} A new string, same as the first, but with the first letter capitalized. - */ -var UppercaseFirst = function (str) -{ - return str && str[0].toUpperCase() + str.slice(1); -}; - -module.exports = UppercaseFirst; - - -/***/ }), -/* 372 */ +/* 374 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -82490,10 +83738,10 @@ module.exports = UppercaseFirst; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(130); +var CONST = __webpack_require__(131); var GetValue = __webpack_require__(5); -var Merge = __webpack_require__(69); -var InjectionMap = __webpack_require__(871); +var Merge = __webpack_require__(87); +var InjectionMap = __webpack_require__(877); /** * @namespace Phaser.Scenes.Settings @@ -82577,7 +83825,7 @@ module.exports = Settings; /***/ }), -/* 373 */ +/* 375 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -82586,18 +83834,18 @@ module.exports = Settings; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); -var CanvasTexture = __webpack_require__(872); +var CanvasPool = __webpack_require__(27); +var CanvasTexture = __webpack_require__(376); var Class = __webpack_require__(0); var Color = __webpack_require__(36); -var CONST = __webpack_require__(28); +var CONST = __webpack_require__(34); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(126); -var GameEvents = __webpack_require__(30); -var GenerateTexture = __webpack_require__(342); +var Events = __webpack_require__(127); +var GameEvents = __webpack_require__(22); +var GenerateTexture = __webpack_require__(345); var GetValue = __webpack_require__(5); -var Parser = __webpack_require__(375); -var Texture = __webpack_require__(190); +var Parser = __webpack_require__(378); +var Texture = __webpack_require__(192); /** * @callback EachTextureCallback @@ -82871,6 +84119,10 @@ var TextureManager = new Class({ * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data. * * You can also provide the image type and encoder options. + * + * This will only work with bitmap based texture frames, such as those created from Texture Atlases. + * It will not work with GL Texture objects, such as Shaders, or Render Textures. For those please + * see the WebGL Snapshot function instead. * * @method Phaser.Textures.TextureManager#getBase64 * @since 3.12.0 @@ -82891,7 +84143,11 @@ var TextureManager = new Class({ var textureFrame = this.getFrame(key, frame); - if (textureFrame) + if (textureFrame && (textureFrame.source.isRenderTexture || textureFrame.source.isGLTexture)) + { + console.warn('Cannot getBase64 from WebGL Texture'); + } + else if (textureFrame) { var cd = textureFrame.canvasData; @@ -82952,6 +84208,38 @@ var TextureManager = new Class({ return texture; }, + /** + * Takes a WebGL Texture and creates a Phaser Texture from it, which is added to the Texture Manager using the given key. + * + * This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites. + * + * This is a WebGL only feature. + * + * @method Phaser.Textures.TextureManager#addGLTexture + * @fires Phaser.Textures.Events#ADD + * @since 3.19.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {WebGLTexture} glTexture - The source Render Texture. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addGLTexture: function (key, glTexture, width, height) + { + var texture = null; + + if (this.checkKey(key)) + { + texture = this.create(key, glTexture, width, height); + + texture.add('__BASE', 0, 0, 0, width, height); + + this.emit(Events.ADD, key, texture); + } + + return texture; + }, + /** * Adds a Render Texture to the Texture Manager using the given key. * This allows you to then use the Render Texture as a normal texture for texture based Game Objects like Sprites. @@ -83699,7 +84987,7 @@ module.exports = TextureManager; /***/ }), -/* 374 */ +/* 376 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83708,10 +84996,641 @@ module.exports = TextureManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); var Class = __webpack_require__(0); -var IsSizePowerOfTwo = __webpack_require__(125); -var ScaleModes = __webpack_require__(94); +var Clamp = __webpack_require__(24); +var Color = __webpack_require__(36); +var CONST = __webpack_require__(34); +var IsSizePowerOfTwo = __webpack_require__(126); +var Texture = __webpack_require__(192); + +/** + * @classdesc + * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source. + * + * You can use the properties of this texture to draw to the canvas element directly, using all of the standard + * canvas operations available in the browser. Any Game Object can be given this texture and will render with it. + * + * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to + * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this + * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep + * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading + * texture data to it. This restriction does not apply if using the Canvas Renderer. + * + * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify + * sections of the canvas using the `add` method. + * + * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying + * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause + * graphical errors. + * + * @class CanvasTexture + * @extends Phaser.Textures.Texture + * @memberof Phaser.Textures + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to. + * @param {string} key - The unique string-based key of this Texture. + * @param {HTMLCanvasElement} source - The canvas element that is used as the base of this texture. + * @param {integer} width - The width of the canvas. + * @param {integer} height - The height of the canvas. + */ +var CanvasTexture = new Class({ + + Extends: Texture, + + initialize: + + function CanvasTexture (manager, key, source, width, height) + { + Texture.call(this, manager, key, source, width, height); + + this.add('__BASE', 0, 0, 0, width, height); + + /** + * A reference to the Texture Source of this Canvas. + * + * @name Phaser.Textures.CanvasTexture#_source + * @type {Phaser.Textures.TextureSource} + * @private + * @since 3.7.0 + */ + this._source = this.frames['__BASE'].source; + + /** + * The source Canvas Element. + * + * @name Phaser.Textures.CanvasTexture#canvas + * @readonly + * @type {HTMLCanvasElement} + * @since 3.7.0 + */ + this.canvas = this._source.image; + + /** + * The 2D Canvas Rendering Context. + * + * @name Phaser.Textures.CanvasTexture#context + * @readonly + * @type {CanvasRenderingContext2D} + * @since 3.7.0 + */ + this.context = this.canvas.getContext('2d'); + + /** + * The width of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + * + * @name Phaser.Textures.CanvasTexture#width + * @readonly + * @type {integer} + * @since 3.7.0 + */ + this.width = width; + + /** + * The height of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + * + * @name Phaser.Textures.CanvasTexture#height + * @readonly + * @type {integer} + * @since 3.7.0 + */ + this.height = height; + + /** + * The context image data. + * Use the `update` method to populate this when the canvas changes. + * + * @name Phaser.Textures.CanvasTexture#imageData + * @type {ImageData} + * @since 3.13.0 + */ + this.imageData = this.context.getImageData(0, 0, width, height); + + /** + * A Uint8ClampedArray view into the `buffer`. + * Use the `update` method to populate this when the canvas changes. + * Note that this is unavailable in some browsers, such as Epic Browser, due to their security restrictions. + * + * @name Phaser.Textures.CanvasTexture#data + * @type {Uint8ClampedArray} + * @since 3.13.0 + */ + this.data = null; + + if (this.imageData) + { + this.data = this.imageData.data; + } + + /** + * An Uint32Array view into the `buffer`. + * + * @name Phaser.Textures.CanvasTexture#pixels + * @type {Uint32Array} + * @since 3.13.0 + */ + this.pixels = null; + + /** + * An ArrayBuffer the same size as the context ImageData. + * + * @name Phaser.Textures.CanvasTexture#buffer + * @type {ArrayBuffer} + * @since 3.13.0 + */ + this.buffer; + + if (this.data) + { + if (this.imageData.data.buffer) + { + this.buffer = this.imageData.data.buffer; + this.pixels = new Uint32Array(this.buffer); + } + else if (window.ArrayBuffer) + { + this.buffer = new ArrayBuffer(this.imageData.data.length); + this.pixels = new Uint32Array(this.buffer); + } + else + { + this.pixels = this.imageData.data; + } + } + }, + + /** + * This re-creates the `imageData` from the current context. + * It then re-builds the ArrayBuffer, the `data` Uint8ClampedArray reference and the `pixels` Int32Array. + * + * Warning: This is a very expensive operation, so use it sparingly. + * + * @method Phaser.Textures.CanvasTexture#update + * @since 3.13.0 + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + update: function () + { + this.imageData = this.context.getImageData(0, 0, this.width, this.height); + + this.data = this.imageData.data; + + if (this.imageData.data.buffer) + { + this.buffer = this.imageData.data.buffer; + this.pixels = new Uint32Array(this.buffer); + } + else if (window.ArrayBuffer) + { + this.buffer = new ArrayBuffer(this.imageData.data.length); + this.pixels = new Uint32Array(this.buffer); + } + else + { + this.pixels = this.imageData.data; + } + + if (this.manager.game.config.renderType === CONST.WEBGL) + { + this.refresh(); + } + + return this; + }, + + /** + * Draws the given Image or Canvas element to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * + * @method Phaser.Textures.CanvasTexture#draw + * @since 3.13.0 + * + * @param {integer} x - The x coordinate to draw the source at. + * @param {integer} y - The y coordinate to draw the source at. + * @param {(HTMLImageElement|HTMLCanvasElement)} source - The element to draw to this canvas. + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + draw: function (x, y, source) + { + this.context.drawImage(source, x, y); + + return this.update(); + }, + + /** + * Draws the given texture frame to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * + * @method Phaser.Textures.CanvasTexture#drawFrame + * @since 3.16.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {integer} [x=0] - The x coordinate to draw the source at. + * @param {integer} [y=0] - The y coordinate to draw the source at. + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + drawFrame: function (key, frame, x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + var textureFrame = this.manager.getFrame(key, frame); + + if (textureFrame) + { + var cd = textureFrame.canvasData; + + var width = textureFrame.cutWidth; + var height = textureFrame.cutHeight; + var res = textureFrame.source.resolution; + + this.context.drawImage( + textureFrame.source.image, + cd.x, cd.y, + width, + height, + x, y, + width / res, + height / res + ); + + return this.update(); + } + else + { + return this; + } + }, + + /** + * Sets a pixel in the CanvasTexture to the given color and alpha values. + * + * This is an expensive operation to run in large quantities, so use sparingly. + * + * @method Phaser.Textures.CanvasTexture#setPixel + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} red - The red color value. A number between 0 and 255. + * @param {integer} green - The green color value. A number between 0 and 255. + * @param {integer} blue - The blue color value. A number between 0 and 255. + * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + * + * @return {this} This CanvasTexture. + */ + setPixel: function (x, y, red, green, blue, alpha) + { + if (alpha === undefined) { alpha = 255; } + + x = Math.abs(Math.floor(x)); + y = Math.abs(Math.floor(y)); + + var index = this.getIndex(x, y); + + if (index > -1) + { + var imageData = this.context.getImageData(x, y, 1, 1); + + imageData.data[0] = red; + imageData.data[1] = green; + imageData.data[2] = blue; + imageData.data[3] = alpha; + + this.context.putImageData(imageData, x, y); + } + + return this; + }, + + /** + * Puts the ImageData into the context of this CanvasTexture at the given coordinates. + * + * @method Phaser.Textures.CanvasTexture#putData + * @since 3.16.0 + * + * @param {ImageData} imageData - The ImageData to put at the given location. + * @param {integer} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {integer} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {integer} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. + * @param {integer} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. + * + * @return {this} This CanvasTexture. + */ + putData: function (imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight) + { + if (dirtyX === undefined) { dirtyX = 0; } + if (dirtyY === undefined) { dirtyY = 0; } + if (dirtyWidth === undefined) { dirtyWidth = imageData.width; } + if (dirtyHeight === undefined) { dirtyHeight = imageData.height; } + + this.context.putImageData(imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight); + + return this; + }, + + /** + * Gets an ImageData region from this CanvasTexture from the position and size specified. + * You can write this back using `CanvasTexture.putData`, or manipulate it. + * + * @method Phaser.Textures.CanvasTexture#getData + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. + * @param {integer} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. + * + * @return {ImageData} The ImageData extracted from this CanvasTexture. + */ + getData: function (x, y, width, height) + { + x = Clamp(Math.floor(x), 0, this.width - 1); + y = Clamp(Math.floor(y), 0, this.height - 1); + width = Clamp(width, 1, this.width - x); + height = Clamp(height, 1, this.height - y); + + var imageData = this.context.getImageData(x, y, width, height); + + return imageData; + }, + + /** + * Get the color of a specific pixel from this texture and store it in a Color object. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * + * @method Phaser.Textures.CanvasTexture#getPixel + * @since 3.13.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {Phaser.Display.Color} [out] - A Color object to store the pixel values in. If not provided a new Color object will be created. + * + * @return {Phaser.Display.Color} An object with the red, green, blue and alpha values set in the r, g, b and a properties. + */ + getPixel: function (x, y, out) + { + if (!out) + { + out = new Color(); + } + + var index = this.getIndex(x, y); + + if (index > -1) + { + var data = this.data; + + var r = data[index + 0]; + var g = data[index + 1]; + var b = data[index + 2]; + var a = data[index + 3]; + + out.setTo(r, g, b, a); + } + + return out; + }, + + /** + * Returns an array containing all of the pixels in the given region. + * + * If the requested region extends outside the bounds of this CanvasTexture, + * the region is truncated to fit. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * + * @method Phaser.Textures.CanvasTexture#getPixels + * @since 3.16.0 + * + * @param {integer} [x=0] - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [y=0] - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [width] - The width of the region to get. Must be an integer. Defaults to the canvas width if not given. + * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. + * + * @return {Phaser.Types.Textures.PixelConfig[]} An array of Pixel objects. + */ + getPixels: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.width; } + if (height === undefined) { height = width; } + + x = Math.abs(Math.round(x)); + y = Math.abs(Math.round(y)); + + var left = Clamp(x, 0, this.width); + var right = Clamp(x + width, 0, this.width); + var top = Clamp(y, 0, this.height); + var bottom = Clamp(y + height, 0, this.height); + + var pixel = new Color(); + + var out = []; + + for (var py = top; py < bottom; py++) + { + var row = []; + + for (var px = left; px < right; px++) + { + pixel = this.getPixel(px, py, pixel); + + row.push({ x: px, y: py, color: pixel.color, alpha: pixel.alphaGL }); + } + + out.push(row); + } + + return out; + }, + + /** + * Returns the Image Data index for the given pixel in this CanvasTexture. + * + * The index can be used to read directly from the `this.data` array. + * + * The index points to the red value in the array. The subsequent 3 indexes + * point to green, blue and alpha respectively. + * + * @method Phaser.Textures.CanvasTexture#getIndex + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * + * @return {integer} + */ + getIndex: function (x, y) + { + x = Math.abs(Math.round(x)); + y = Math.abs(Math.round(y)); + + if (x < this.width && y < this.height) + { + return (x + y * this.width) * 4; + } + else + { + return -1; + } + }, + + /** + * This should be called manually if you are running under WebGL. + * It will refresh the WebGLTexture from the Canvas source. Only call this if you know that the + * canvas has changed, as there is a significant GPU texture allocation cost involved in doing so. + * + * @method Phaser.Textures.CanvasTexture#refresh + * @since 3.7.0 + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + refresh: function () + { + this._source.update(); + + return this; + }, + + /** + * Gets the Canvas Element. + * + * @method Phaser.Textures.CanvasTexture#getCanvas + * @since 3.7.0 + * + * @return {HTMLCanvasElement} The Canvas DOM element this texture is using. + */ + getCanvas: function () + { + return this.canvas; + }, + + /** + * Gets the 2D Canvas Rendering Context. + * + * @method Phaser.Textures.CanvasTexture#getContext + * @since 3.7.0 + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context this texture is using. + */ + getContext: function () + { + return this.context; + }, + + /** + * Clears the given region of this Canvas Texture, resetting it back to transparent. + * If no region is given, the whole Canvas Texture is cleared. + * + * @method Phaser.Textures.CanvasTexture#clear + * @since 3.7.0 + * + * @param {integer} [x=0] - The x coordinate of the top-left of the region to clear. + * @param {integer} [y=0] - The y coordinate of the top-left of the region to clear. + * @param {integer} [width] - The width of the region. + * @param {integer} [height] - The height of the region. + * + * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. + */ + clear: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.width; } + if (height === undefined) { height = this.height; } + + this.context.clearRect(x, y, width, height); + + return this.update(); + }, + + /** + * Changes the size of this Canvas Texture. + * + * @method Phaser.Textures.CanvasTexture#setSize + * @since 3.7.0 + * + * @param {integer} width - The new width of the Canvas. + * @param {integer} [height] - The new height of the Canvas. If not given it will use the width as the height. + * + * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + if (width !== this.width || height !== this.height) + { + // Update the Canvas + this.canvas.width = width; + this.canvas.height = height; + + // Update the Texture Source + this._source.width = width; + this._source.height = height; + this._source.isPowerOf2 = IsSizePowerOfTwo(width, height); + + // Update the Frame + this.frames['__BASE'].setSize(width, height, 0, 0); + + this.refresh(); + } + + return this; + }, + + /** + * Destroys this Texture and releases references to its sources and frames. + * + * @method Phaser.Textures.CanvasTexture#destroy + * @since 3.16.0 + */ + destroy: function () + { + Texture.prototype.destroy.call(this); + + this._source = null; + this.canvas = null; + this.context = null; + this.imageData = null; + this.data = null; + this.pixels = null; + this.buffer = null; + } + +}); + +module.exports = CanvasTexture; + + +/***/ }), +/* 377 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(27); +var Class = __webpack_require__(0); +var IsSizePowerOfTwo = __webpack_require__(126); +var ScaleModes = __webpack_require__(96); /** * @classdesc @@ -83726,7 +85645,7 @@ var ScaleModes = __webpack_require__(94); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture this TextureSource belongs to. - * @param {(HTMLImageElement|HTMLCanvasElement)} source - The source image data. + * @param {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture|WebGLTexture)} source - The source image data. * @param {integer} [width] - Optional width of the source image. If not given it's derived from the source itself. * @param {integer} [height] - Optional height of the source image. If not given it's derived from the source itself. */ @@ -83758,10 +85677,10 @@ var TextureSource = new Class({ /** * The source of the image data. - * This is either an Image Element, a Canvas Element or a RenderTexture. + * This is either an Image Element, a Canvas Element, a RenderTexture or a WebGLTexture. * * @name Phaser.Textures.TextureSource#source - * @type {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture)} + * @type {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture|WebGLTexture)} * @since 3.12.0 */ this.source = source; @@ -83844,6 +85763,15 @@ var TextureSource = new Class({ */ this.isRenderTexture = (source.type === 'RenderTexture'); + /** + * Is the source image a WebGLTexture? + * + * @name Phaser.Textures.TextureSource#isGLTexture + * @type {boolean} + * @since 3.19.0 + */ + this.isGLTexture = (source instanceof WebGLTexture); + /** * Are the source image dimensions a power of two? * @@ -83854,7 +85782,8 @@ var TextureSource = new Class({ this.isPowerOf2 = IsSizePowerOfTwo(this.width, this.height); /** - * The WebGL Texture of the source image. + * The WebGL Texture of the source image. If this TextureSource is driven from a WebGLTexture + * already, then this is a reference to that WebGLTexture. * * @name Phaser.Textures.TextureSource#glTexture * @type {?WebGLTexture} @@ -83890,6 +85819,10 @@ var TextureSource = new Class({ this.glTexture = this.renderer.createTextureFromSource(null, this.width, this.height, this.scaleMode); } + else if (this.isGLTexture) + { + this.glTexture = this.source; + } else { this.glTexture = this.renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode); @@ -83939,19 +85872,6 @@ var TextureSource = new Class({ if (this.renderer.gl && this.isCanvas) { this.glTexture = this.renderer.canvasToTexture(this.image, this.glTexture); - - // Update all the Frames using this TextureSource - - /* - var index = this.texture.getTextureSourceIndex(this); - - var frames = this.texture.getFramesFromTextureSource(index, true); - - for (var i = 0; i < frames.length; i++) - { - frames[i].glTexture = this.glTexture; - } - */ } }, @@ -83986,7 +85906,7 @@ module.exports = TextureSource; /***/ }), -/* 375 */ +/* 378 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84001,20 +85921,20 @@ module.exports = TextureSource; module.exports = { - AtlasXML: __webpack_require__(873), - Canvas: __webpack_require__(874), - Image: __webpack_require__(875), - JSONArray: __webpack_require__(876), - JSONHash: __webpack_require__(877), - SpriteSheet: __webpack_require__(878), - SpriteSheetFromAtlas: __webpack_require__(879), - UnityYAML: __webpack_require__(880) + AtlasXML: __webpack_require__(878), + Canvas: __webpack_require__(879), + Image: __webpack_require__(880), + JSONArray: __webpack_require__(881), + JSONHash: __webpack_require__(882), + SpriteSheet: __webpack_require__(883), + SpriteSheetFromAtlas: __webpack_require__(884), + UnityYAML: __webpack_require__(885) }; /***/ }), -/* 376 */ +/* 379 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84024,9 +85944,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HTML5AudioSoundManager = __webpack_require__(377); -var NoAudioSoundManager = __webpack_require__(379); -var WebAudioSoundManager = __webpack_require__(381); +var HTML5AudioSoundManager = __webpack_require__(380); +var NoAudioSoundManager = __webpack_require__(382); +var WebAudioSoundManager = __webpack_require__(384); /** * Creates a Web Audio, HTML5 Audio or No Audio Sound Manager based on config and device settings. @@ -84064,7 +85984,7 @@ module.exports = SoundManagerCreator; /***/ }), -/* 377 */ +/* 380 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84074,10 +85994,10 @@ module.exports = SoundManagerCreator; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSoundManager = __webpack_require__(131); +var BaseSoundManager = __webpack_require__(132); var Class = __webpack_require__(0); var Events = __webpack_require__(71); -var HTML5AudioSound = __webpack_require__(378); +var HTML5AudioSound = __webpack_require__(381); /** * HTML5 Audio implementation of the Sound Manager. @@ -84520,7 +86440,7 @@ module.exports = HTML5AudioSoundManager; /***/ }), -/* 378 */ +/* 381 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84530,7 +86450,7 @@ module.exports = HTML5AudioSoundManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(132); +var BaseSound = __webpack_require__(133); var Class = __webpack_require__(0); var Events = __webpack_require__(71); @@ -85447,7 +87367,7 @@ module.exports = HTML5AudioSound; /***/ }), -/* 379 */ +/* 382 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85457,10 +87377,10 @@ module.exports = HTML5AudioSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSoundManager = __webpack_require__(131); +var BaseSoundManager = __webpack_require__(132); var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(9); -var NoAudioSound = __webpack_require__(380); +var NoAudioSound = __webpack_require__(383); var NOOP = __webpack_require__(2); /** @@ -85565,7 +87485,7 @@ module.exports = NoAudioSoundManager; /***/ }), -/* 380 */ +/* 383 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85575,10 +87495,10 @@ module.exports = NoAudioSoundManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(132); +var BaseSound = __webpack_require__(133); var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(9); -var Extend = __webpack_require__(20); +var Extend = __webpack_require__(15); /** * @classdesc @@ -85692,7 +87612,7 @@ module.exports = NoAudioSound; /***/ }), -/* 381 */ +/* 384 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85702,11 +87622,11 @@ module.exports = NoAudioSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Base64ToArrayBuffer = __webpack_require__(382); -var BaseSoundManager = __webpack_require__(131); +var Base64ToArrayBuffer = __webpack_require__(385); +var BaseSoundManager = __webpack_require__(132); var Class = __webpack_require__(0); var Events = __webpack_require__(71); -var WebAudioSound = __webpack_require__(383); +var WebAudioSound = __webpack_require__(386); /** * @classdesc @@ -85935,6 +87855,11 @@ var WebAudioSoundManager = new Class({ document.body.removeEventListener('click', unlockHandler); _this.unlocked = true; + }, function () + { + document.body.removeEventListener('touchstart', unlockHandler); + document.body.removeEventListener('touchend', unlockHandler); + document.body.removeEventListener('click', unlockHandler); }); } }; @@ -86099,7 +88024,7 @@ module.exports = WebAudioSoundManager; /***/ }), -/* 382 */ +/* 385 */ /***/ (function(module, exports) { /** @@ -86174,7 +88099,7 @@ module.exports = Base64ToArrayBuffer; /***/ }), -/* 383 */ +/* 386 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86184,7 +88109,7 @@ module.exports = Base64ToArrayBuffer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(132); +var BaseSound = __webpack_require__(133); var Class = __webpack_require__(0); var Events = __webpack_require__(71); @@ -87082,7 +89007,7 @@ module.exports = WebAudioSound; /***/ }), -/* 384 */ +/* 387 */ /***/ (function(module, exports, __webpack_require__) { /* eslint no-console: 0 */ @@ -87093,13 +89018,13 @@ module.exports = WebAudioSound; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var AdInstance = __webpack_require__(904); +var AdInstance = __webpack_require__(909); var Class = __webpack_require__(0); -var DataManager = __webpack_require__(98); +var DataManager = __webpack_require__(100); var EventEmitter = __webpack_require__(9); -var Leaderboard = __webpack_require__(905); -var Product = __webpack_require__(907); -var Purchase = __webpack_require__(908); +var Leaderboard = __webpack_require__(910); +var Product = __webpack_require__(912); +var Purchase = __webpack_require__(913); /** * @classdesc @@ -89358,7 +91283,7 @@ module.exports = FacebookInstantGamesPlugin; /***/ }), -/* 385 */ +/* 388 */ /***/ (function(module, exports) { /** @@ -89406,7 +91331,7 @@ module.exports = TransposeMatrix; /***/ }), -/* 386 */ +/* 389 */ /***/ (function(module, exports) { /** @@ -89528,7 +91453,7 @@ module.exports = QuickSelect; /***/ }), -/* 387 */ +/* 390 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89538,7 +91463,7 @@ module.exports = QuickSelect; */ var GetValue = __webpack_require__(5); -var Shuffle = __webpack_require__(119); +var Shuffle = __webpack_require__(120); var BuildChunk = function (a, b, qty) { @@ -89666,7 +91591,7 @@ module.exports = Range; /***/ }), -/* 388 */ +/* 391 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89755,7 +91680,7 @@ module.exports = BuildGameObjectAnimation; /***/ }), -/* 389 */ +/* 392 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89797,7 +91722,7 @@ module.exports = Union; /***/ }), -/* 390 */ +/* 393 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89808,11 +91733,11 @@ module.exports = Union; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var DOMElementRender = __webpack_require__(951); +var DOMElementRender = __webpack_require__(956); var GameObject = __webpack_require__(13); var IsPlainObject = __webpack_require__(7); -var RemoveFromDOM = __webpack_require__(187); -var Vector4 = __webpack_require__(324); +var RemoveFromDOM = __webpack_require__(188); +var Vector4 = __webpack_require__(327); /** * @classdesc @@ -90744,7 +92669,7 @@ module.exports = DOMElement; /***/ }), -/* 391 */ +/* 394 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -90753,7 +92678,7 @@ module.exports = DOMElement; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CSSBlendModes = __webpack_require__(952); +var CSSBlendModes = __webpack_require__(957); var GameObject = __webpack_require__(13); /** @@ -90865,7 +92790,7 @@ module.exports = DOMElementCSSRenderer; /***/ }), -/* 392 */ +/* 395 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -90877,7 +92802,7 @@ module.exports = DOMElementCSSRenderer; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var ExternRender = __webpack_require__(956); +var ExternRender = __webpack_require__(961); /** * @classdesc @@ -90961,7 +92886,7 @@ module.exports = Extern; /***/ }), -/* 393 */ +/* 396 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -90970,9 +92895,9 @@ module.exports = Extern; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircumferencePoint = __webpack_require__(200); -var FromPercent = __webpack_require__(95); -var MATH_CONST = __webpack_require__(23); +var CircumferencePoint = __webpack_require__(202); +var FromPercent = __webpack_require__(97); +var MATH_CONST = __webpack_require__(21); var Point = __webpack_require__(4); /** @@ -91004,7 +92929,7 @@ module.exports = GetPoint; /***/ }), -/* 394 */ +/* 397 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91013,10 +92938,10 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circumference = __webpack_require__(395); -var CircumferencePoint = __webpack_require__(200); -var FromPercent = __webpack_require__(95); -var MATH_CONST = __webpack_require__(23); +var Circumference = __webpack_require__(398); +var CircumferencePoint = __webpack_require__(202); +var FromPercent = __webpack_require__(97); +var MATH_CONST = __webpack_require__(21); /** * Returns an array of Point objects containing the coordinates of the points around the circumference of the Ellipse, @@ -91058,7 +92983,7 @@ module.exports = GetPoints; /***/ }), -/* 395 */ +/* 398 */ /***/ (function(module, exports) { /** @@ -91090,7 +93015,7 @@ module.exports = Circumference; /***/ }), -/* 396 */ +/* 399 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91099,8 +93024,8 @@ module.exports = Circumference; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Commands = __webpack_require__(199); -var SetTransform = __webpack_require__(27); +var Commands = __webpack_require__(201); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -91340,7 +93265,7 @@ module.exports = GraphicsCanvasRenderer; /***/ }), -/* 397 */ +/* 400 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91559,7 +93484,7 @@ module.exports = GravityWell; /***/ }), -/* 398 */ +/* 401 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91570,7 +93495,7 @@ module.exports = GravityWell; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(40); -var DistanceBetween = __webpack_require__(62); +var DistanceBetween = __webpack_require__(63); /** * @classdesc @@ -92128,7 +94053,7 @@ module.exports = Particle; /***/ }), -/* 399 */ +/* 402 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92140,19 +94065,19 @@ module.exports = Particle; var BlendModes = __webpack_require__(42); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var DeathZone = __webpack_require__(400); -var EdgeZone = __webpack_require__(401); -var EmitterOp = __webpack_require__(968); +var DeathZone = __webpack_require__(403); +var EdgeZone = __webpack_require__(404); +var EmitterOp = __webpack_require__(973); var GetFastValue = __webpack_require__(1); -var GetRandom = __webpack_require__(193); -var HasAny = __webpack_require__(402); -var HasValue = __webpack_require__(88); -var Particle = __webpack_require__(398); -var RandomZone = __webpack_require__(403); +var GetRandom = __webpack_require__(195); +var HasAny = __webpack_require__(405); +var HasValue = __webpack_require__(90); +var Particle = __webpack_require__(401); +var RandomZone = __webpack_require__(406); var Rectangle = __webpack_require__(11); -var StableSort = __webpack_require__(135); +var StableSort = __webpack_require__(136); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(61); +var Wrap = __webpack_require__(62); /** * @classdesc @@ -94167,7 +96092,7 @@ module.exports = ParticleEmitter; /***/ }), -/* 400 */ +/* 403 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94245,7 +96170,7 @@ module.exports = DeathZone; /***/ }), -/* 401 */ +/* 404 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94489,7 +96414,7 @@ module.exports = EdgeZone; /***/ }), -/* 402 */ +/* 405 */ /***/ (function(module, exports) { /** @@ -94526,7 +96451,7 @@ module.exports = HasAny; /***/ }), -/* 403 */ +/* 406 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94599,7 +96524,7 @@ module.exports = RandomZone; /***/ }), -/* 404 */ +/* 407 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94610,7 +96535,7 @@ module.exports = RandomZone; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Sprite = __webpack_require__(63); +var Sprite = __webpack_require__(64); /** * @classdesc @@ -94681,7 +96606,7 @@ module.exports = PathFollower; /***/ }), -/* 405 */ +/* 408 */ /***/ (function(module, exports) { /** @@ -94716,7 +96641,7 @@ module.exports = UUID; /***/ }), -/* 406 */ +/* 409 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94725,13 +96650,13 @@ module.exports = UUID; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcRender = __webpack_require__(988); +var ArcRender = __webpack_require__(993); var Class = __webpack_require__(0); var DegToRad = __webpack_require__(40); -var Earcut = __webpack_require__(68); +var Earcut = __webpack_require__(69); var GeomCircle = __webpack_require__(83); -var MATH_CONST = __webpack_require__(23); -var Shape = __webpack_require__(33); +var MATH_CONST = __webpack_require__(21); +var Shape = __webpack_require__(32); /** * @classdesc @@ -94887,7 +96812,8 @@ var Arc = new Class({ { this.geom.radius = value; - this.setSize(value, value); + var diameter = value * 2; + this.setSize(diameter, diameter); this.updateDisplayOrigin(); this.updateData(); } @@ -95068,8 +96994,8 @@ var Arc = new Class({ var endAngle = DegToRad(this._endAngle); var anticlockwise = this._anticlockwise; - var x = radius / 2; - var y = radius / 2; + var x = radius; + var y = radius; endAngle -= startAngle; @@ -95124,7 +97050,7 @@ module.exports = Arc; /***/ }), -/* 407 */ +/* 410 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95134,10 +97060,10 @@ module.exports = Arc; */ var Class = __webpack_require__(0); -var CurveRender = __webpack_require__(991); -var Earcut = __webpack_require__(68); +var CurveRender = __webpack_require__(996); +var Earcut = __webpack_require__(69); var Rectangle = __webpack_require__(11); -var Shape = __webpack_require__(33); +var Shape = __webpack_require__(32); /** * @classdesc @@ -95306,7 +97232,7 @@ module.exports = Curve; /***/ }), -/* 408 */ +/* 411 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95316,10 +97242,10 @@ module.exports = Curve; */ var Class = __webpack_require__(0); -var Earcut = __webpack_require__(68); -var EllipseRender = __webpack_require__(994); -var GeomEllipse = __webpack_require__(102); -var Shape = __webpack_require__(33); +var Earcut = __webpack_require__(69); +var EllipseRender = __webpack_require__(999); +var GeomEllipse = __webpack_require__(104); +var Shape = __webpack_require__(32); /** * @classdesc @@ -95493,7 +97419,7 @@ module.exports = Ellipse; /***/ }), -/* 409 */ +/* 412 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95503,8 +97429,8 @@ module.exports = Ellipse; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(33); -var GridRender = __webpack_require__(997); +var Shape = __webpack_require__(32); +var GridRender = __webpack_require__(1002); /** * @classdesc @@ -95775,7 +97701,7 @@ module.exports = Grid; /***/ }), -/* 410 */ +/* 413 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95784,9 +97710,9 @@ module.exports = Grid; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var IsoBoxRender = __webpack_require__(1000); +var IsoBoxRender = __webpack_require__(1005); var Class = __webpack_require__(0); -var Shape = __webpack_require__(33); +var Shape = __webpack_require__(32); /** * @classdesc @@ -95990,7 +97916,7 @@ module.exports = IsoBox; /***/ }), -/* 411 */ +/* 414 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96000,8 +97926,8 @@ module.exports = IsoBox; */ var Class = __webpack_require__(0); -var IsoTriangleRender = __webpack_require__(1003); -var Shape = __webpack_require__(33); +var IsoTriangleRender = __webpack_require__(1008); +var Shape = __webpack_require__(32); /** * @classdesc @@ -96236,7 +98162,7 @@ module.exports = IsoTriangle; /***/ }), -/* 412 */ +/* 415 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96246,9 +98172,9 @@ module.exports = IsoTriangle; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(33); -var GeomLine = __webpack_require__(59); -var LineRender = __webpack_require__(1006); +var Shape = __webpack_require__(32); +var GeomLine = __webpack_require__(60); +var LineRender = __webpack_require__(1011); /** * @classdesc @@ -96403,7 +98329,7 @@ module.exports = Line; /***/ }), -/* 413 */ +/* 416 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96412,13 +98338,13 @@ module.exports = Line; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PolygonRender = __webpack_require__(1009); +var PolygonRender = __webpack_require__(1014); var Class = __webpack_require__(0); -var Earcut = __webpack_require__(68); -var GetAABB = __webpack_require__(414); -var GeomPolygon = __webpack_require__(205); -var Shape = __webpack_require__(33); -var Smooth = __webpack_require__(417); +var Earcut = __webpack_require__(69); +var GetAABB = __webpack_require__(417); +var GeomPolygon = __webpack_require__(207); +var Shape = __webpack_require__(32); +var Smooth = __webpack_require__(420); /** * @classdesc @@ -96542,7 +98468,7 @@ module.exports = Polygon; /***/ }), -/* 414 */ +/* 417 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96598,7 +98524,7 @@ module.exports = GetAABB; /***/ }), -/* 415 */ +/* 418 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96607,9 +98533,9 @@ module.exports = GetAABB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(60); -var Line = __webpack_require__(59); -var Perimeter = __webpack_require__(416); +var Length = __webpack_require__(61); +var Line = __webpack_require__(60); +var Perimeter = __webpack_require__(419); /** * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, @@ -96675,7 +98601,7 @@ module.exports = GetPoints; /***/ }), -/* 416 */ +/* 419 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96684,8 +98610,8 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(60); -var Line = __webpack_require__(59); +var Length = __webpack_require__(61); +var Line = __webpack_require__(60); /** * Returns the perimeter of the given Polygon. @@ -96723,7 +98649,7 @@ module.exports = Perimeter; /***/ }), -/* 417 */ +/* 420 */ /***/ (function(module, exports) { /** @@ -96799,7 +98725,7 @@ module.exports = Smooth; /***/ }), -/* 418 */ +/* 421 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96810,8 +98736,8 @@ module.exports = Smooth; var Class = __webpack_require__(0); var GeomRectangle = __webpack_require__(11); -var Shape = __webpack_require__(33); -var RectangleRender = __webpack_require__(1012); +var Shape = __webpack_require__(32); +var RectangleRender = __webpack_require__(1017); /** * @classdesc @@ -96911,7 +98837,7 @@ module.exports = Rectangle; /***/ }), -/* 419 */ +/* 422 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96920,10 +98846,10 @@ module.exports = Rectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StarRender = __webpack_require__(1015); +var StarRender = __webpack_require__(1020); var Class = __webpack_require__(0); -var Earcut = __webpack_require__(68); -var Shape = __webpack_require__(33); +var Earcut = __webpack_require__(69); +var Shape = __webpack_require__(32); /** * @classdesc @@ -97199,7 +99125,7 @@ module.exports = Star; /***/ }), -/* 420 */ +/* 423 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97209,9 +99135,9 @@ module.exports = Star; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(33); +var Shape = __webpack_require__(32); var GeomTriangle = __webpack_require__(74); -var TriangleRender = __webpack_require__(1018); +var TriangleRender = __webpack_require__(1023); /** * @classdesc @@ -97342,7 +99268,7 @@ module.exports = Triangle; /***/ }), -/* 421 */ +/* 424 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97352,7 +99278,7 @@ module.exports = Triangle; */ var Point = __webpack_require__(4); -var Length = __webpack_require__(60); +var Length = __webpack_require__(61); /** * Returns a Point from around the perimeter of a Triangle. @@ -97429,7 +99355,7 @@ module.exports = GetPoint; /***/ }), -/* 422 */ +/* 425 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97438,7 +99364,7 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(60); +var Length = __webpack_require__(61); var Point = __webpack_require__(4); /** @@ -97522,7 +99448,7 @@ module.exports = GetPoints; /***/ }), -/* 423 */ +/* 426 */ /***/ (function(module, exports) { /** @@ -97605,7 +99531,7 @@ module.exports = SetValue; /***/ }), -/* 424 */ +/* 427 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97868,7 +99794,7 @@ module.exports = Light; /***/ }), -/* 425 */ +/* 428 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97878,7 +99804,7 @@ module.exports = Light; */ var Class = __webpack_require__(0); -var Light = __webpack_require__(424); +var Light = __webpack_require__(427); var Utils = __webpack_require__(10); /** @@ -98231,7 +100157,7 @@ module.exports = LightsManager; /***/ }), -/* 426 */ +/* 429 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98240,26 +100166,34 @@ module.exports = LightsManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var CONST = __webpack_require__(52); +var Extend = __webpack_require__(15); + /** * @namespace Phaser.Geom */ -module.exports = { +var Geom = { - Circle: __webpack_require__(1074), - Ellipse: __webpack_require__(1084), - Intersects: __webpack_require__(427), - Line: __webpack_require__(1103), - Point: __webpack_require__(1124), - Polygon: __webpack_require__(1138), - Rectangle: __webpack_require__(442), - Triangle: __webpack_require__(1168) + Circle: __webpack_require__(1079), + Ellipse: __webpack_require__(1089), + Intersects: __webpack_require__(430), + Line: __webpack_require__(1108), + Point: __webpack_require__(1129), + Polygon: __webpack_require__(1143), + Rectangle: __webpack_require__(445), + Triangle: __webpack_require__(1173) }; +// Merge in the consts +Geom = Extend(false, Geom, CONST); + +module.exports = Geom; + /***/ }), -/* 427 */ +/* 430 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98274,35 +100208,35 @@ module.exports = { module.exports = { - CircleToCircle: __webpack_require__(428), - CircleToRectangle: __webpack_require__(429), - GetCircleToCircle: __webpack_require__(1094), - GetCircleToRectangle: __webpack_require__(1095), - GetLineToCircle: __webpack_require__(209), - GetLineToRectangle: __webpack_require__(211), - GetRectangleIntersection: __webpack_require__(1096), - GetRectangleToRectangle: __webpack_require__(1097), - GetRectangleToTriangle: __webpack_require__(1098), - GetTriangleToCircle: __webpack_require__(1099), - GetTriangleToLine: __webpack_require__(434), - GetTriangleToTriangle: __webpack_require__(1100), - LineToCircle: __webpack_require__(210), - LineToLine: __webpack_require__(90), - LineToRectangle: __webpack_require__(430), - PointToLine: __webpack_require__(438), - PointToLineSegment: __webpack_require__(1101), - RectangleToRectangle: __webpack_require__(138), - RectangleToTriangle: __webpack_require__(431), - RectangleToValues: __webpack_require__(1102), - TriangleToCircle: __webpack_require__(433), - TriangleToLine: __webpack_require__(435), - TriangleToTriangle: __webpack_require__(436) + CircleToCircle: __webpack_require__(431), + CircleToRectangle: __webpack_require__(432), + GetCircleToCircle: __webpack_require__(1099), + GetCircleToRectangle: __webpack_require__(1100), + GetLineToCircle: __webpack_require__(211), + GetLineToRectangle: __webpack_require__(213), + GetRectangleIntersection: __webpack_require__(1101), + GetRectangleToRectangle: __webpack_require__(1102), + GetRectangleToTriangle: __webpack_require__(1103), + GetTriangleToCircle: __webpack_require__(1104), + GetTriangleToLine: __webpack_require__(437), + GetTriangleToTriangle: __webpack_require__(1105), + LineToCircle: __webpack_require__(212), + LineToLine: __webpack_require__(92), + LineToRectangle: __webpack_require__(433), + PointToLine: __webpack_require__(441), + PointToLineSegment: __webpack_require__(1106), + RectangleToRectangle: __webpack_require__(139), + RectangleToTriangle: __webpack_require__(434), + RectangleToValues: __webpack_require__(1107), + TriangleToCircle: __webpack_require__(436), + TriangleToLine: __webpack_require__(438), + TriangleToTriangle: __webpack_require__(439) }; /***/ }), -/* 428 */ +/* 431 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98311,7 +100245,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DistanceBetween = __webpack_require__(62); +var DistanceBetween = __webpack_require__(63); /** * Checks if two Circles intersect. @@ -98333,7 +100267,7 @@ module.exports = CircleToCircle; /***/ }), -/* 429 */ +/* 432 */ /***/ (function(module, exports) { /** @@ -98387,7 +100321,7 @@ module.exports = CircleToRectangle; /***/ }), -/* 430 */ +/* 433 */ /***/ (function(module, exports) { /** @@ -98488,7 +100422,7 @@ module.exports = LineToRectangle; /***/ }), -/* 431 */ +/* 434 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98497,10 +100431,10 @@ module.exports = LineToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineToLine = __webpack_require__(90); -var Contains = __webpack_require__(52); -var ContainsArray = __webpack_require__(212); -var Decompose = __webpack_require__(432); +var LineToLine = __webpack_require__(92); +var Contains = __webpack_require__(53); +var ContainsArray = __webpack_require__(214); +var Decompose = __webpack_require__(435); /** * Checks for intersection between Rectangle shape and Triangle shape. @@ -98581,7 +100515,7 @@ module.exports = RectangleToTriangle; /***/ }), -/* 432 */ +/* 435 */ /***/ (function(module, exports) { /** @@ -98618,7 +100552,7 @@ module.exports = Decompose; /***/ }), -/* 433 */ +/* 436 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98627,8 +100561,8 @@ module.exports = Decompose; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineToCircle = __webpack_require__(210); -var Contains = __webpack_require__(89); +var LineToCircle = __webpack_require__(212); +var Contains = __webpack_require__(91); /** * Checks if a Triangle and a Circle intersect. @@ -98683,7 +100617,7 @@ module.exports = TriangleToCircle; /***/ }), -/* 434 */ +/* 437 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98694,8 +100628,8 @@ module.exports = TriangleToCircle; */ var Point = __webpack_require__(4); -var TriangleToLine = __webpack_require__(435); -var LineToLine = __webpack_require__(90); +var TriangleToLine = __webpack_require__(438); +var LineToLine = __webpack_require__(92); /** * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array. @@ -98742,7 +100676,7 @@ module.exports = GetTriangleToLine; /***/ }), -/* 435 */ +/* 438 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98751,8 +100685,8 @@ module.exports = GetTriangleToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(89); -var LineToLine = __webpack_require__(90); +var Contains = __webpack_require__(91); +var LineToLine = __webpack_require__(92); /** * Checks if a Triangle and a Line intersect. @@ -98798,7 +100732,7 @@ module.exports = TriangleToLine; /***/ }), -/* 436 */ +/* 439 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98807,9 +100741,9 @@ module.exports = TriangleToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ContainsArray = __webpack_require__(212); -var Decompose = __webpack_require__(437); -var LineToLine = __webpack_require__(90); +var ContainsArray = __webpack_require__(214); +var Decompose = __webpack_require__(440); +var LineToLine = __webpack_require__(92); /** * Checks if two Triangles intersect. @@ -98888,7 +100822,7 @@ module.exports = TriangleToTriangle; /***/ }), -/* 437 */ +/* 440 */ /***/ (function(module, exports) { /** @@ -98923,7 +100857,7 @@ module.exports = Decompose; /***/ }), -/* 438 */ +/* 441 */ /***/ (function(module, exports) { /** @@ -98993,7 +100927,7 @@ module.exports = PointToLine; /***/ }), -/* 439 */ +/* 442 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99002,9 +100936,9 @@ module.exports = PointToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Wrap = __webpack_require__(61); -var Angle = __webpack_require__(91); +var MATH_CONST = __webpack_require__(21); +var Wrap = __webpack_require__(62); +var Angle = __webpack_require__(93); /** * Get the angle of the normal of the given line in radians. @@ -99027,7 +100961,7 @@ module.exports = NormalAngle; /***/ }), -/* 440 */ +/* 443 */ /***/ (function(module, exports) { /** @@ -99055,7 +100989,7 @@ module.exports = GetMagnitude; /***/ }), -/* 441 */ +/* 444 */ /***/ (function(module, exports) { /** @@ -99083,7 +101017,7 @@ module.exports = GetMagnitudeSq; /***/ }), -/* 442 */ +/* 445 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99094,49 +101028,49 @@ module.exports = GetMagnitudeSq; var Rectangle = __webpack_require__(11); -Rectangle.Area = __webpack_require__(1143); -Rectangle.Ceil = __webpack_require__(1144); -Rectangle.CeilAll = __webpack_require__(1145); -Rectangle.CenterOn = __webpack_require__(173); -Rectangle.Clone = __webpack_require__(1146); -Rectangle.Contains = __webpack_require__(52); -Rectangle.ContainsPoint = __webpack_require__(1147); -Rectangle.ContainsRect = __webpack_require__(443); -Rectangle.CopyFrom = __webpack_require__(1148); -Rectangle.Decompose = __webpack_require__(432); -Rectangle.Equals = __webpack_require__(1149); -Rectangle.FitInside = __webpack_require__(1150); -Rectangle.FitOutside = __webpack_require__(1151); -Rectangle.Floor = __webpack_require__(1152); -Rectangle.FloorAll = __webpack_require__(1153); -Rectangle.FromPoints = __webpack_require__(185); -Rectangle.GetAspectRatio = __webpack_require__(214); -Rectangle.GetCenter = __webpack_require__(1154); -Rectangle.GetPoint = __webpack_require__(157); -Rectangle.GetPoints = __webpack_require__(265); -Rectangle.GetSize = __webpack_require__(1155); -Rectangle.Inflate = __webpack_require__(1156); -Rectangle.Intersection = __webpack_require__(1157); -Rectangle.MarchingAnts = __webpack_require__(276); -Rectangle.MergePoints = __webpack_require__(1158); -Rectangle.MergeRect = __webpack_require__(1159); -Rectangle.MergeXY = __webpack_require__(1160); -Rectangle.Offset = __webpack_require__(1161); -Rectangle.OffsetPoint = __webpack_require__(1162); -Rectangle.Overlaps = __webpack_require__(1163); -Rectangle.Perimeter = __webpack_require__(116); -Rectangle.PerimeterPoint = __webpack_require__(1164); -Rectangle.Random = __webpack_require__(160); -Rectangle.RandomOutside = __webpack_require__(1165); -Rectangle.SameDimensions = __webpack_require__(1166); -Rectangle.Scale = __webpack_require__(1167); -Rectangle.Union = __webpack_require__(389); +Rectangle.Area = __webpack_require__(1148); +Rectangle.Ceil = __webpack_require__(1149); +Rectangle.CeilAll = __webpack_require__(1150); +Rectangle.CenterOn = __webpack_require__(174); +Rectangle.Clone = __webpack_require__(1151); +Rectangle.Contains = __webpack_require__(53); +Rectangle.ContainsPoint = __webpack_require__(1152); +Rectangle.ContainsRect = __webpack_require__(446); +Rectangle.CopyFrom = __webpack_require__(1153); +Rectangle.Decompose = __webpack_require__(435); +Rectangle.Equals = __webpack_require__(1154); +Rectangle.FitInside = __webpack_require__(1155); +Rectangle.FitOutside = __webpack_require__(1156); +Rectangle.Floor = __webpack_require__(1157); +Rectangle.FloorAll = __webpack_require__(1158); +Rectangle.FromPoints = __webpack_require__(186); +Rectangle.GetAspectRatio = __webpack_require__(216); +Rectangle.GetCenter = __webpack_require__(1159); +Rectangle.GetPoint = __webpack_require__(158); +Rectangle.GetPoints = __webpack_require__(268); +Rectangle.GetSize = __webpack_require__(1160); +Rectangle.Inflate = __webpack_require__(1161); +Rectangle.Intersection = __webpack_require__(1162); +Rectangle.MarchingAnts = __webpack_require__(279); +Rectangle.MergePoints = __webpack_require__(1163); +Rectangle.MergeRect = __webpack_require__(1164); +Rectangle.MergeXY = __webpack_require__(1165); +Rectangle.Offset = __webpack_require__(1166); +Rectangle.OffsetPoint = __webpack_require__(1167); +Rectangle.Overlaps = __webpack_require__(1168); +Rectangle.Perimeter = __webpack_require__(117); +Rectangle.PerimeterPoint = __webpack_require__(1169); +Rectangle.Random = __webpack_require__(161); +Rectangle.RandomOutside = __webpack_require__(1170); +Rectangle.SameDimensions = __webpack_require__(1171); +Rectangle.Scale = __webpack_require__(1172); +Rectangle.Union = __webpack_require__(392); module.exports = Rectangle; /***/ }), -/* 443 */ +/* 446 */ /***/ (function(module, exports) { /** @@ -99176,7 +101110,7 @@ module.exports = ContainsRect; /***/ }), -/* 444 */ +/* 447 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99220,7 +101154,7 @@ module.exports = Centroid; /***/ }), -/* 445 */ +/* 448 */ /***/ (function(module, exports) { /** @@ -99261,7 +101195,7 @@ module.exports = Offset; /***/ }), -/* 446 */ +/* 449 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99326,7 +101260,7 @@ module.exports = InCenter; /***/ }), -/* 447 */ +/* 450 */ /***/ (function(module, exports) { /** @@ -99368,6 +101302,7 @@ var CreateInteractiveObject = function (gameObject, hitArea, hitAreaCallback) hitArea: hitArea, hitAreaCallback: hitAreaCallback, + hitAreaDebug: null, // Has the dev specified their own shape, or is this bound to the texture size? customHitArea: false, @@ -99395,7 +101330,7 @@ module.exports = CreateInteractiveObject; /***/ }), -/* 448 */ +/* 451 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99520,7 +101455,7 @@ module.exports = Axis; /***/ }), -/* 449 */ +/* 452 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99530,7 +101465,7 @@ module.exports = Axis; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(216); +var Events = __webpack_require__(218); /** * @classdesc @@ -99666,7 +101601,7 @@ module.exports = Button; /***/ }), -/* 450 */ +/* 453 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99675,8 +101610,8 @@ module.exports = Button; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Axis = __webpack_require__(448); -var Button = __webpack_require__(449); +var Axis = __webpack_require__(451); +var Button = __webpack_require__(452); var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(9); var Vector2 = __webpack_require__(3); @@ -100424,7 +102359,7 @@ module.exports = Gamepad; /***/ }), -/* 451 */ +/* 454 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100435,7 +102370,7 @@ module.exports = Gamepad; var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(140); +var Events = __webpack_require__(141); /** * @classdesc @@ -100826,7 +102761,7 @@ module.exports = Key; /***/ }), -/* 452 */ +/* 455 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100836,10 +102771,10 @@ module.exports = Key; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(140); +var Events = __webpack_require__(141); var GetFastValue = __webpack_require__(1); -var ProcessKeyCombo = __webpack_require__(1207); -var ResetKeyCombo = __webpack_require__(1209); +var ProcessKeyCombo = __webpack_require__(1212); +var ResetKeyCombo = __webpack_require__(1214); /** * @classdesc @@ -101119,7 +103054,7 @@ module.exports = KeyCombo; /***/ }), -/* 453 */ +/* 456 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101128,7 +103063,7 @@ module.exports = KeyCombo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MergeXHRSettings = __webpack_require__(218); +var MergeXHRSettings = __webpack_require__(220); /** * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings @@ -101187,7 +103122,7 @@ module.exports = XHRLoader; /***/ }), -/* 454 */ +/* 457 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101197,11 +103132,11 @@ module.exports = XHRLoader; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(28); -var File = __webpack_require__(21); +var CONST = __webpack_require__(34); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); -var HTML5AudioFile = __webpack_require__(455); +var HTML5AudioFile = __webpack_require__(458); var IsPlainObject = __webpack_require__(7); /** @@ -101458,7 +103393,7 @@ module.exports = AudioFile; /***/ }), -/* 455 */ +/* 458 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101469,9 +103404,9 @@ module.exports = AudioFile; var Class = __webpack_require__(0); var Events = __webpack_require__(86); -var File = __webpack_require__(21); +var File = __webpack_require__(23); var GetFastValue = __webpack_require__(1); -var GetURL = __webpack_require__(217); +var GetURL = __webpack_require__(219); var IsPlainObject = __webpack_require__(7); /** @@ -101656,7 +103591,7 @@ module.exports = HTML5AudioFile; /***/ }), -/* 456 */ +/* 459 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101666,8 +103601,8 @@ module.exports = HTML5AudioFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); @@ -101827,7 +103762,7 @@ module.exports = ScriptFile; /***/ }), -/* 457 */ +/* 460 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101837,8 +103772,8 @@ module.exports = ScriptFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); @@ -102002,7 +103937,7 @@ module.exports = TextFile; /***/ }), -/* 458 */ +/* 461 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102011,12 +103946,12 @@ module.exports = TextFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeImage = __webpack_require__(459); -var ArcadeSprite = __webpack_require__(142); +var ArcadeImage = __webpack_require__(462); +var ArcadeSprite = __webpack_require__(143); var Class = __webpack_require__(0); -var CONST = __webpack_require__(56); -var PhysicsGroup = __webpack_require__(460); -var StaticPhysicsGroup = __webpack_require__(461); +var CONST = __webpack_require__(57); +var PhysicsGroup = __webpack_require__(463); +var StaticPhysicsGroup = __webpack_require__(464); /** * @classdesc @@ -102273,7 +104208,7 @@ module.exports = Factory; /***/ }), -/* 459 */ +/* 462 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102283,8 +104218,8 @@ module.exports = Factory; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(220); -var Image = __webpack_require__(87); +var Components = __webpack_require__(222); +var Image = __webpack_require__(88); /** * @classdesc @@ -102373,7 +104308,7 @@ module.exports = ArcadeImage; /***/ }), -/* 460 */ +/* 463 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102382,11 +104317,11 @@ module.exports = ArcadeImage; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeSprite = __webpack_require__(142); +var ArcadeSprite = __webpack_require__(143); var Class = __webpack_require__(0); -var CONST = __webpack_require__(56); +var CONST = __webpack_require__(57); var GetFastValue = __webpack_require__(1); -var Group = __webpack_require__(104); +var Group = __webpack_require__(106); var IsPlainObject = __webpack_require__(7); /** @@ -102646,7 +104581,7 @@ module.exports = PhysicsGroup; /***/ }), -/* 461 */ +/* 464 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102655,11 +104590,11 @@ module.exports = PhysicsGroup; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeSprite = __webpack_require__(142); +var ArcadeSprite = __webpack_require__(143); var Class = __webpack_require__(0); -var CONST = __webpack_require__(56); +var CONST = __webpack_require__(57); var GetFastValue = __webpack_require__(1); -var Group = __webpack_require__(104); +var Group = __webpack_require__(106); var IsPlainObject = __webpack_require__(7); /** @@ -102826,7 +104761,7 @@ module.exports = StaticPhysicsGroup; /***/ }), -/* 462 */ +/* 465 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102835,33 +104770,33 @@ module.exports = StaticPhysicsGroup; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(463); -var Clamp = __webpack_require__(22); +var Body = __webpack_require__(466); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Collider = __webpack_require__(464); -var CONST = __webpack_require__(56); -var DistanceBetween = __webpack_require__(62); +var Collider = __webpack_require__(467); +var CONST = __webpack_require__(57); +var DistanceBetween = __webpack_require__(63); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(221); -var FuzzyEqual = __webpack_require__(177); -var FuzzyGreaterThan = __webpack_require__(311); -var FuzzyLessThan = __webpack_require__(312); -var GetOverlapX = __webpack_require__(465); -var GetOverlapY = __webpack_require__(466); +var Events = __webpack_require__(223); +var FuzzyEqual = __webpack_require__(178); +var FuzzyGreaterThan = __webpack_require__(314); +var FuzzyLessThan = __webpack_require__(315); +var GetOverlapX = __webpack_require__(468); +var GetOverlapY = __webpack_require__(469); var GetValue = __webpack_require__(5); -var ProcessQueue = __webpack_require__(467); -var ProcessTileCallbacks = __webpack_require__(1266); +var ProcessQueue = __webpack_require__(470); +var ProcessTileCallbacks = __webpack_require__(1271); var Rectangle = __webpack_require__(11); -var RTree = __webpack_require__(468); -var SeparateTile = __webpack_require__(1267); -var SeparateX = __webpack_require__(1272); -var SeparateY = __webpack_require__(1273); -var Set = __webpack_require__(105); -var StaticBody = __webpack_require__(470); -var TileIntersectsBody = __webpack_require__(469); +var RTree = __webpack_require__(471); +var SeparateTile = __webpack_require__(1272); +var SeparateX = __webpack_require__(1277); +var SeparateY = __webpack_require__(1278); +var Set = __webpack_require__(107); +var StaticBody = __webpack_require__(473); +var TileIntersectsBody = __webpack_require__(472); var TransformMatrix = __webpack_require__(35); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(61); +var Wrap = __webpack_require__(62); /** * @classdesc @@ -105203,7 +107138,7 @@ module.exports = World; /***/ }), -/* 463 */ +/* 466 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -105214,11 +107149,11 @@ module.exports = World; var CircleContains = __webpack_require__(51); var Class = __webpack_require__(0); -var CONST = __webpack_require__(56); -var Events = __webpack_require__(221); -var RadToDeg = __webpack_require__(180); +var CONST = __webpack_require__(57); +var Events = __webpack_require__(223); +var RadToDeg = __webpack_require__(181); var Rectangle = __webpack_require__(11); -var RectangleContains = __webpack_require__(52); +var RectangleContains = __webpack_require__(53); var Vector2 = __webpack_require__(3); /** @@ -107391,7 +109326,7 @@ module.exports = Body; /***/ }), -/* 464 */ +/* 467 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -107574,7 +109509,7 @@ module.exports = Collider; /***/ }), -/* 465 */ +/* 468 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -107583,7 +109518,7 @@ module.exports = Collider; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(56); +var CONST = __webpack_require__(57); /** * Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties @@ -107682,7 +109617,7 @@ module.exports = GetOverlapX; /***/ }), -/* 466 */ +/* 469 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -107691,7 +109626,7 @@ module.exports = GetOverlapX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(56); +var CONST = __webpack_require__(57); /** * Calculates and returns the vertical overlap between two arcade physics bodies and sets their properties @@ -107790,7 +109725,7 @@ module.exports = GetOverlapY; /***/ }), -/* 467 */ +/* 470 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -108022,7 +109957,7 @@ module.exports = ProcessQueue; /***/ }), -/* 468 */ +/* 471 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -108032,7 +109967,7 @@ module.exports = ProcessQueue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var quickselect = __webpack_require__(386); +var quickselect = __webpack_require__(389); /** * @classdesc @@ -108633,7 +110568,7 @@ function multiSelect (arr, left, right, n, compare) module.exports = rbush; /***/ }), -/* 469 */ +/* 472 */ /***/ (function(module, exports) { /** @@ -108669,7 +110604,7 @@ module.exports = TileIntersectsBody; /***/ }), -/* 470 */ +/* 473 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -108680,8 +110615,8 @@ module.exports = TileIntersectsBody; var CircleContains = __webpack_require__(51); var Class = __webpack_require__(0); -var CONST = __webpack_require__(56); -var RectangleContains = __webpack_require__(52); +var CONST = __webpack_require__(57); +var RectangleContains = __webpack_require__(53); var Vector2 = __webpack_require__(3); /** @@ -109658,7 +111593,7 @@ module.exports = StaticBody; /***/ }), -/* 471 */ +/* 474 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -109668,10 +111603,10 @@ module.exports = StaticBody; */ var Class = __webpack_require__(0); -var COLLIDES = __webpack_require__(108); -var GetVelocity = __webpack_require__(1275); -var TYPE = __webpack_require__(109); -var UpdateMotion = __webpack_require__(1276); +var COLLIDES = __webpack_require__(109); +var GetVelocity = __webpack_require__(1280); +var TYPE = __webpack_require__(110); +var UpdateMotion = __webpack_require__(1281); /** * @callback Phaser.Types.Physics.Impact.BodyUpdateCallback @@ -110259,7 +112194,7 @@ module.exports = Body; /***/ }), -/* 472 */ +/* 475 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110269,7 +112204,7 @@ module.exports = Body; */ var Class = __webpack_require__(0); -var DefaultDefs = __webpack_require__(1280); +var DefaultDefs = __webpack_require__(1285); /** * @classdesc @@ -110623,7 +112558,7 @@ module.exports = CollisionMap; /***/ }), -/* 473 */ +/* 476 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110633,9 +112568,9 @@ module.exports = CollisionMap; */ var Class = __webpack_require__(0); -var ImpactBody = __webpack_require__(474); -var ImpactImage = __webpack_require__(475); -var ImpactSprite = __webpack_require__(476); +var ImpactBody = __webpack_require__(477); +var ImpactImage = __webpack_require__(478); +var ImpactSprite = __webpack_require__(479); /** * @classdesc @@ -110780,7 +112715,7 @@ module.exports = Factory; /***/ }), -/* 474 */ +/* 477 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110790,7 +112725,7 @@ module.exports = Factory; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(223); +var Components = __webpack_require__(225); /** * @classdesc @@ -110913,7 +112848,7 @@ module.exports = ImpactBody; /***/ }), -/* 475 */ +/* 478 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110923,8 +112858,8 @@ module.exports = ImpactBody; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(223); -var Image = __webpack_require__(87); +var Components = __webpack_require__(225); +var Image = __webpack_require__(88); /** * @classdesc @@ -111071,7 +113006,7 @@ module.exports = ImpactImage; /***/ }), -/* 476 */ +/* 479 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -111081,8 +113016,8 @@ module.exports = ImpactImage; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(223); -var Sprite = __webpack_require__(63); +var Components = __webpack_require__(225); +var Sprite = __webpack_require__(64); /** * @classdesc @@ -111232,7 +113167,7 @@ module.exports = ImpactSprite; /***/ }), -/* 477 */ +/* 480 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -111241,18 +113176,18 @@ module.exports = ImpactSprite; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(471); +var Body = __webpack_require__(474); var Class = __webpack_require__(0); -var COLLIDES = __webpack_require__(108); -var CollisionMap = __webpack_require__(472); +var COLLIDES = __webpack_require__(109); +var CollisionMap = __webpack_require__(475); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(222); +var Events = __webpack_require__(224); var GetFastValue = __webpack_require__(1); -var HasValue = __webpack_require__(88); -var Set = __webpack_require__(105); -var Solver = __webpack_require__(1294); -var TILEMAP_FORMATS = __webpack_require__(34); -var TYPE = __webpack_require__(109); +var HasValue = __webpack_require__(90); +var Set = __webpack_require__(107); +var Solver = __webpack_require__(1299); +var TILEMAP_FORMATS = __webpack_require__(33); +var TYPE = __webpack_require__(110); /** * @classdesc @@ -112217,7 +114152,7 @@ module.exports = World; /***/ }), -/* 478 */ +/* 481 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -112226,17 +114161,17 @@ module.exports = World; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(57); -var Body = __webpack_require__(24); +var Bodies = __webpack_require__(58); +var Body = __webpack_require__(25); var Class = __webpack_require__(0); -var Composites = __webpack_require__(480); -var Constraint = __webpack_require__(93); -var MatterGameObject = __webpack_require__(1298); -var MatterImage = __webpack_require__(481); -var MatterSprite = __webpack_require__(482); -var MatterTileBody = __webpack_require__(226); -var PointerConstraint = __webpack_require__(1324); -var Vertices = __webpack_require__(32); +var Composites = __webpack_require__(483); +var Constraint = __webpack_require__(95); +var MatterGameObject = __webpack_require__(1303); +var MatterImage = __webpack_require__(485); +var MatterSprite = __webpack_require__(486); +var MatterTileBody = __webpack_require__(228); +var PointerConstraint = __webpack_require__(1328); +var Vertices = __webpack_require__(31); /** * @classdesc @@ -112622,10 +114557,10 @@ var Factory = new Class({ * @method Phaser.Physics.Matter.Factory#joint * @since 3.0.0 * - * @param {MatterJS.Body} bodyA - [description] - * @param {MatterJS.Body} bodyB - [description] - * @param {number} length - [description] - * @param {number} [stiffness=1] - [description] + * @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to. + * @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to. + * @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. * @param {object} [options={}] - [description] * * @return {MatterJS.Constraint} A Matter JS Constraint. @@ -112643,7 +114578,7 @@ var Factory = new Class({ * * @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to. * @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to. - * @param {number} length - A Number that specifies the target resting length of the constraint. It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB` + * @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. * @param {object} [options={}] - [description] * @@ -112660,10 +114595,10 @@ var Factory = new Class({ * @method Phaser.Physics.Matter.Factory#constraint * @since 3.0.0 * - * @param {MatterJS.Body} bodyA - [description] - * @param {MatterJS.Body} bodyB - [description] - * @param {number} [length] - [description] - * @param {number} [stiffness=1] - [description] + * @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to. + * @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to. + * @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. * @param {object} [options={}] - [description] * * @return {MatterJS.Constraint} A Matter JS Constraint. @@ -112676,7 +114611,7 @@ var Factory = new Class({ options.bodyA = (bodyA.type === 'body') ? bodyA : bodyA.body; options.bodyB = (bodyB.type === 'body') ? bodyB : bodyB.body; - if (length) + if (!isNaN(length)) { options.length = length; } @@ -112696,9 +114631,9 @@ var Factory = new Class({ * @method Phaser.Physics.Matter.Factory#worldConstraint * @since 3.0.0 * - * @param {MatterJS.Body} bodyB - [description] - * @param {number} length - [description] - * @param {number} [stiffness=1] - [description] + * @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to. + * @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. * @param {object} [options={}] - [description] * * @return {MatterJS.Constraint} A Matter JS Constraint. @@ -112709,7 +114644,12 @@ var Factory = new Class({ if (options === undefined) { options = {}; } options.bodyB = (bodyB.type === 'body') ? bodyB : bodyB.body; - options.length = length; + + if (!isNaN(length)) + { + options.length = length; + } + options.stiffness = stiffness; var constraint = Constraint.create(options); @@ -112919,7 +114859,7 @@ module.exports = Factory; /***/ }), -/* 479 */ +/* 482 */ /***/ (function(module, exports) { /** @@ -113589,7 +115529,7 @@ function points_eq(a,b,precision){ /***/ }), -/* 480 */ +/* 483 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113606,10 +115546,10 @@ var Composites = {}; module.exports = Composites; var Composite = __webpack_require__(76); -var Constraint = __webpack_require__(93); -var Common = __webpack_require__(16); -var Body = __webpack_require__(24); -var Bodies = __webpack_require__(57); +var Constraint = __webpack_require__(95); +var Common = __webpack_require__(17); +var Body = __webpack_require__(25); +var Bodies = __webpack_require__(58); (function() { @@ -113922,7 +115862,184 @@ var Bodies = __webpack_require__(57); /***/ }), -/* 481 */ +/* 484 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Joachim Grill + * @copyright 2018 CodeAndWeb GmbH + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bodies = __webpack_require__(58); +var Body = __webpack_require__(25); +var Bounds = __webpack_require__(38); +var Common = __webpack_require__(17); +var GetFastValue = __webpack_require__(1); +var Vector = __webpack_require__(37); +var Vertices = __webpack_require__(31); + +/** + * Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file + * created and exported with PhysicsEditor (https://www.codeandweb.com/physicseditor). + * + * @namespace Phaser.Physics.Matter.PhysicsEditorParser + * @since 3.10.0 + */ +var PhysicsEditorParser = { + + /** + * Parses a body element exported by PhysicsEditor. + * + * @function Phaser.Physics.Matter.PhysicsEditorParser.parseBody + * @since 3.10.0 + * + * @param {number} x - x position. + * @param {number} y - y position. + * @param {number} w - width. + * @param {number} h - height. + * @param {object} config - body configuration and fixture (child body) definitions. + * + * @return {object} A matter body, consisting of several parts (child bodies) + */ + parseBody: function (x, y, w, h, config) + { + var fixtureConfigs = GetFastValue(config, 'fixtures', []); + var fixtures = []; + + for (var fc = 0; fc < fixtureConfigs.length; fc++) + { + var fixtureParts = this.parseFixture(fixtureConfigs[fc]); + + for (var i = 0; i < fixtureParts.length; i++) + { + fixtures.push(fixtureParts[i]); + } + } + + var matterConfig = Common.extend({}, false, config); + + delete matterConfig.fixtures; + delete matterConfig.type; + + var body = Body.create(matterConfig); + + Body.setParts(body, fixtures); + body.render.sprite.xOffset = body.position.x / w; + body.render.sprite.yOffset = body.position.y / h; + Body.setPosition(body, { x: x, y: y }); + + return body; + }, + + + /** + * Parses an element of the "fixtures" list exported by PhysicsEditor + * + * @function Phaser.Physics.Matter.PhysicsEditorParser.parseFixture + * @since 3.10.0 + * + * @param {object} fixtureConfig - the fixture object to parse + * + * @return {object[]} - A list of matter bodies + */ + parseFixture: function (fixtureConfig) + { + var matterConfig = Common.extend({}, false, fixtureConfig); + + delete matterConfig.circle; + delete matterConfig.vertices; + + var fixtures; + + if (fixtureConfig.circle) + { + var x = GetFastValue(fixtureConfig.circle, 'x'); + var y = GetFastValue(fixtureConfig.circle, 'y'); + var r = GetFastValue(fixtureConfig.circle, 'radius'); + fixtures = [ Bodies.circle(x, y, r, matterConfig) ]; + } + else if (fixtureConfig.vertices) + { + fixtures = this.parseVertices(fixtureConfig.vertices, matterConfig); + } + + return fixtures; + }, + + /** + * Parses the "vertices" lists exported by PhysicsEditor. + * + * @function Phaser.Physics.Matter.PhysicsEditorParser.parseVertices + * @since 3.10.0 + * + * @param {object} vertexSets - The vertex lists to parse. + * @param {object} options - Matter body options. + * + * @return {object[]} - A list of matter bodies. + */ + parseVertices: function (vertexSets, options) + { + var i, j, k, v, z; + var parts = []; + + options = options || {}; + + for (v = 0; v < vertexSets.length; v += 1) + { + parts.push(Body.create(Common.extend({ + position: Vertices.centre(vertexSets[v]), + vertices: vertexSets[v] + }, options))); + } + + // flag coincident part edges + var coincidentMaxDist = 5; + + for (i = 0; i < parts.length; i++) + { + var partA = parts[i]; + + for (j = i + 1; j < parts.length; j++) + { + var partB = parts[j]; + + if (Bounds.overlaps(partA.bounds, partB.bounds)) + { + var pav = partA.vertices, + pbv = partB.vertices; + + // iterate vertices of both parts + for (k = 0; k < partA.vertices.length; k++) + { + for (z = 0; z < partB.vertices.length; z++) + { + // find distances between the vertices + var da = Vector.magnitudeSquared(Vector.sub(pav[(k + 1) % pav.length], pbv[z])), + db = Vector.magnitudeSquared(Vector.sub(pav[k], pbv[(z + 1) % pbv.length])); + + // if both vertices are very close, consider the edge concident (internal) + if (da < coincidentMaxDist && db < coincidentMaxDist) + { + pav[k].isInternal = true; + pbv[z].isInternal = true; + } + } + } + + } + } + } + + return parts; + } +}; + +module.exports = PhysicsEditorParser; + + +/***/ }), +/* 485 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113932,11 +116049,11 @@ var Bodies = __webpack_require__(57); */ var Class = __webpack_require__(0); -var Components = __webpack_require__(143); +var Components = __webpack_require__(144); var GameObject = __webpack_require__(13); var GetFastValue = __webpack_require__(1); -var Image = __webpack_require__(87); -var Pipeline = __webpack_require__(117); +var Image = __webpack_require__(88); +var Pipeline = __webpack_require__(118); var Vector2 = __webpack_require__(3); /** @@ -114058,7 +116175,7 @@ module.exports = MatterImage; /***/ }), -/* 482 */ +/* 486 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114067,13 +116184,13 @@ module.exports = MatterImage; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AnimationComponent = __webpack_require__(260); +var AnimationComponent = __webpack_require__(263); var Class = __webpack_require__(0); -var Components = __webpack_require__(143); +var Components = __webpack_require__(144); var GameObject = __webpack_require__(13); var GetFastValue = __webpack_require__(1); -var Pipeline = __webpack_require__(117); -var Sprite = __webpack_require__(63); +var Pipeline = __webpack_require__(118); +var Sprite = __webpack_require__(64); var Vector2 = __webpack_require__(3); /** @@ -114200,7 +116317,7 @@ module.exports = MatterSprite; /***/ }), -/* 483 */ +/* 487 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114213,8 +116330,8 @@ var Matter = {}; module.exports = Matter; -var Plugin = __webpack_require__(230); -var Common = __webpack_require__(16); +var Plugin = __webpack_require__(232); +var Common = __webpack_require__(17); (function() { @@ -114292,7 +116409,7 @@ var Common = __webpack_require__(16); /***/ }), -/* 484 */ +/* 488 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114305,9 +116422,9 @@ var Grid = {}; module.exports = Grid; -var Pair = __webpack_require__(144); -var Detector = __webpack_require__(227); -var Common = __webpack_require__(16); +var Pair = __webpack_require__(145); +var Detector = __webpack_require__(229); +var Common = __webpack_require__(17); (function() { @@ -114619,7 +116736,7 @@ var Common = __webpack_require__(16); /***/ }), -/* 485 */ +/* 489 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114632,8 +116749,8 @@ var Pairs = {}; module.exports = Pairs; -var Pair = __webpack_require__(144); -var Common = __webpack_require__(16); +var Pair = __webpack_require__(145); +var Common = __webpack_require__(17); (function() { @@ -114784,7 +116901,7 @@ var Common = __webpack_require__(16); /***/ }), -/* 486 */ +/* 490 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114797,9 +116914,9 @@ var Resolver = {}; module.exports = Resolver; -var Vertices = __webpack_require__(32); +var Vertices = __webpack_require__(31); var Vector = __webpack_require__(37); -var Common = __webpack_require__(16); +var Common = __webpack_require__(17); var Bounds = __webpack_require__(38); (function() { @@ -115140,7 +117257,7 @@ var Bounds = __webpack_require__(38); /***/ }), -/* 487 */ +/* 491 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115157,17 +117274,17 @@ var Engine = {}; module.exports = Engine; -var World = __webpack_require__(231); -var Sleeping = __webpack_require__(110); -var Resolver = __webpack_require__(486); -var Pairs = __webpack_require__(485); -var Metrics = __webpack_require__(1326); -var Grid = __webpack_require__(484); -var Events = __webpack_require__(92); +var World = __webpack_require__(233); +var Sleeping = __webpack_require__(111); +var Resolver = __webpack_require__(490); +var Pairs = __webpack_require__(489); +var Metrics = __webpack_require__(1330); +var Grid = __webpack_require__(488); +var Events = __webpack_require__(94); var Composite = __webpack_require__(76); -var Constraint = __webpack_require__(93); -var Common = __webpack_require__(16); -var Body = __webpack_require__(24); +var Constraint = __webpack_require__(95); +var Common = __webpack_require__(17); +var Body = __webpack_require__(25); (function() { @@ -115653,7 +117770,7 @@ var Body = __webpack_require__(24); /***/ }), -/* 488 */ +/* 492 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115662,20 +117779,20 @@ var Body = __webpack_require__(24); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(57); -var Body = __webpack_require__(24); +var Bodies = __webpack_require__(58); +var Body = __webpack_require__(25); var Class = __webpack_require__(0); -var Common = __webpack_require__(16); +var Common = __webpack_require__(17); var Composite = __webpack_require__(76); -var Engine = __webpack_require__(487); +var Engine = __webpack_require__(491); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(225); +var Events = __webpack_require__(227); var GetFastValue = __webpack_require__(1); var GetValue = __webpack_require__(5); -var MatterBody = __webpack_require__(24); -var MatterEvents = __webpack_require__(92); -var MatterTileBody = __webpack_require__(226); -var MatterWorld = __webpack_require__(231); +var MatterBody = __webpack_require__(25); +var MatterEvents = __webpack_require__(94); +var MatterTileBody = __webpack_require__(228); +var MatterWorld = __webpack_require__(233); var Vector = __webpack_require__(37); /** @@ -116798,7 +118915,7 @@ module.exports = World; /***/ }), -/* 489 */ +/* 493 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116979,7 +119096,7 @@ module.exports = BasePlugin; /***/ }), -/* 490 */ +/* 494 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116988,7 +119105,7 @@ module.exports = BasePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); +var GetTilesWithin = __webpack_require__(26); /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -117024,7 +119141,7 @@ module.exports = ReplaceByIndex; /***/ }), -/* 491 */ +/* 495 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117033,7 +119150,7 @@ module.exports = ReplaceByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var IsInLayerBounds = __webpack_require__(111); +var IsInLayerBounds = __webpack_require__(112); /** * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns @@ -117067,7 +119184,7 @@ module.exports = HasTileAt; /***/ }), -/* 492 */ +/* 496 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117077,8 +119194,8 @@ module.exports = HasTileAt; */ var Tile = __webpack_require__(78); -var IsInLayerBounds = __webpack_require__(111); -var CalculateFacesAt = __webpack_require__(232); +var IsInLayerBounds = __webpack_require__(112); +var CalculateFacesAt = __webpack_require__(234); /** * Removes the tile at the given tile coordinates in the specified layer and updates the layer's @@ -117130,7 +119247,7 @@ module.exports = RemoveTileAt; /***/ }), -/* 493 */ +/* 497 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117139,11 +119256,11 @@ module.exports = RemoveTileAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(34); -var Parse2DArray = __webpack_require__(235); -var ParseCSV = __webpack_require__(494); -var ParseJSONTiled = __webpack_require__(495); -var ParseWeltmeister = __webpack_require__(506); +var Formats = __webpack_require__(33); +var Parse2DArray = __webpack_require__(237); +var ParseCSV = __webpack_require__(498); +var ParseJSONTiled = __webpack_require__(499); +var ParseWeltmeister = __webpack_require__(510); /** * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format @@ -117200,7 +119317,7 @@ module.exports = Parse; /***/ }), -/* 494 */ +/* 498 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117209,8 +119326,8 @@ module.exports = Parse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(34); -var Parse2DArray = __webpack_require__(235); +var Formats = __webpack_require__(33); +var Parse2DArray = __webpack_require__(237); /** * Parses a CSV string of tile indexes into a new MapData object with a single layer. @@ -117248,7 +119365,7 @@ module.exports = ParseCSV; /***/ }), -/* 495 */ +/* 499 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117257,14 +119374,14 @@ module.exports = ParseCSV; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(34); -var MapData = __webpack_require__(113); -var ParseTileLayers = __webpack_require__(496); -var ParseImageLayers = __webpack_require__(498); -var ParseTilesets = __webpack_require__(499); -var ParseObjectLayers = __webpack_require__(502); -var BuildTilesetIndex = __webpack_require__(504); -var AssignTileProperties = __webpack_require__(505); +var Formats = __webpack_require__(33); +var MapData = __webpack_require__(114); +var ParseTileLayers = __webpack_require__(500); +var ParseImageLayers = __webpack_require__(502); +var ParseTilesets = __webpack_require__(503); +var ParseObjectLayers = __webpack_require__(506); +var BuildTilesetIndex = __webpack_require__(508); +var AssignTileProperties = __webpack_require__(509); /** * Parses a Tiled JSON object into a new MapData object. @@ -117326,7 +119443,7 @@ module.exports = ParseJSONTiled; /***/ }), -/* 496 */ +/* 500 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117335,10 +119452,10 @@ module.exports = ParseJSONTiled; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Base64Decode = __webpack_require__(497); +var Base64Decode = __webpack_require__(501); var GetFastValue = __webpack_require__(1); -var LayerData = __webpack_require__(112); -var ParseGID = __webpack_require__(236); +var LayerData = __webpack_require__(113); +var ParseGID = __webpack_require__(238); var Tile = __webpack_require__(78); /** @@ -117536,7 +119653,7 @@ module.exports = ParseTileLayers; /***/ }), -/* 497 */ +/* 501 */ /***/ (function(module, exports) { /** @@ -117579,7 +119696,7 @@ module.exports = Base64Decode; /***/ }), -/* 498 */ +/* 502 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117631,7 +119748,7 @@ module.exports = ParseImageLayers; /***/ }), -/* 499 */ +/* 503 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117640,9 +119757,9 @@ module.exports = ParseImageLayers; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tileset = __webpack_require__(149); -var ImageCollection = __webpack_require__(500); -var ParseObject = __webpack_require__(237); +var Tileset = __webpack_require__(150); +var ImageCollection = __webpack_require__(504); +var ParseObject = __webpack_require__(239); /** * Tilesets and Image Collections @@ -117800,7 +119917,7 @@ module.exports = ParseTilesets; /***/ }), -/* 500 */ +/* 504 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117972,7 +120089,7 @@ module.exports = ImageCollection; /***/ }), -/* 501 */ +/* 505 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117981,7 +120098,7 @@ module.exports = ImageCollection; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HasValue = __webpack_require__(88); +var HasValue = __webpack_require__(90); /** * Returns a new object that only contains the `keys` that were found on the object provided. @@ -118016,7 +120133,7 @@ module.exports = Pick; /***/ }), -/* 502 */ +/* 506 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118026,8 +120143,8 @@ module.exports = Pick; */ var GetFastValue = __webpack_require__(1); -var ParseObject = __webpack_require__(237); -var ObjectLayer = __webpack_require__(503); +var ParseObject = __webpack_require__(239); +var ObjectLayer = __webpack_require__(507); /** * Parses a Tiled JSON object into an array of ObjectLayer objects. @@ -118075,7 +120192,7 @@ module.exports = ParseObjectLayers; /***/ }), -/* 503 */ +/* 507 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118197,7 +120314,7 @@ module.exports = ObjectLayer; /***/ }), -/* 504 */ +/* 508 */ /***/ (function(module, exports) { /** @@ -118270,7 +120387,7 @@ module.exports = BuildTilesetIndex; /***/ }), -/* 505 */ +/* 509 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118279,7 +120396,7 @@ module.exports = BuildTilesetIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(20); +var Extend = __webpack_require__(15); /** * Copy properties from tileset to tiles. @@ -118343,7 +120460,7 @@ module.exports = AssignTileProperties; /***/ }), -/* 506 */ +/* 510 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118352,10 +120469,10 @@ module.exports = AssignTileProperties; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(34); -var MapData = __webpack_require__(113); -var ParseTileLayers = __webpack_require__(507); -var ParseTilesets = __webpack_require__(508); +var Formats = __webpack_require__(33); +var MapData = __webpack_require__(114); +var ParseTileLayers = __webpack_require__(511); +var ParseTilesets = __webpack_require__(512); /** * Parses a Weltmeister JSON object into a new MapData object. @@ -118410,7 +120527,7 @@ module.exports = ParseWeltmeister; /***/ }), -/* 507 */ +/* 511 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118419,7 +120536,7 @@ module.exports = ParseWeltmeister; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LayerData = __webpack_require__(112); +var LayerData = __webpack_require__(113); var Tile = __webpack_require__(78); /** @@ -118494,7 +120611,7 @@ module.exports = ParseTileLayers; /***/ }), -/* 508 */ +/* 512 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118503,7 +120620,7 @@ module.exports = ParseTileLayers; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tileset = __webpack_require__(149); +var Tileset = __webpack_require__(150); /** * [description] @@ -118545,7 +120662,7 @@ module.exports = ParseTilesets; /***/ }), -/* 509 */ +/* 513 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118556,16 +120673,16 @@ module.exports = ParseTilesets; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(40); -var DynamicTilemapLayer = __webpack_require__(510); -var Extend = __webpack_require__(20); -var Formats = __webpack_require__(34); -var LayerData = __webpack_require__(112); -var Rotate = __webpack_require__(321); +var DynamicTilemapLayer = __webpack_require__(514); +var Extend = __webpack_require__(15); +var Formats = __webpack_require__(33); +var LayerData = __webpack_require__(113); +var Rotate = __webpack_require__(324); var SpliceOne = __webpack_require__(84); -var StaticTilemapLayer = __webpack_require__(511); +var StaticTilemapLayer = __webpack_require__(515); var Tile = __webpack_require__(78); -var TilemapComponents = __webpack_require__(145); -var Tileset = __webpack_require__(149); +var TilemapComponents = __webpack_require__(146); +var Tileset = __webpack_require__(150); /** * @callback TilemapFilterCallback @@ -119188,7 +121305,7 @@ var Tilemap = new Class({ config.x = obj.x; config.y = obj.y; - var sprite = this.scene.make.sprite(config); + var sprite = scene.make.sprite(config); sprite.name = obj.name; @@ -119725,7 +121842,7 @@ var Tilemap = new Class({ layer = this.getLayer(layer); if (layer === null) { return null; } - + return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, layer); }, @@ -120097,7 +122214,7 @@ var Tilemap = new Class({ /** * Removes the given TilemapLayer from this Tilemap without destroying it. - * + * * If no layer specified, the map's current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeLayer @@ -120130,7 +122247,7 @@ var Tilemap = new Class({ /** * Destroys the given TilemapLayer and removes it from this Tilemap. - * + * * If no layer specified, the map's current layer is used. * * @method Phaser.Tilemaps.Tilemap#destroyLayer @@ -120197,7 +122314,7 @@ var Tilemap = new Class({ /** * Removes the given Tile, or an array of Tiles, from the layer to which they belong, * and optionally recalculates the collision information. - * + * * This cannot be applied to Tiles that belong to Static Tilemap Layers. * * @method Phaser.Tilemaps.Tilemap#removeTile @@ -120325,7 +122442,7 @@ var Tilemap = new Class({ /** * Draws a debug representation of all layers within this Tilemap to the given Graphics object. - * + * * This is helpful when you want to get a quick idea of which of your tiles are colliding and which * have interesting faces. The tiles are drawn starting at (0, 0) in the Graphics, allowing you to * place the debug representation wherever you want on the screen. @@ -121002,7 +123119,7 @@ module.exports = Tilemap; /***/ }), -/* 510 */ +/* 514 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -121013,9 +123130,9 @@ module.exports = Tilemap; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var DynamicTilemapLayerRender = __webpack_require__(1377); +var DynamicTilemapLayerRender = __webpack_require__(1381); var GameObject = __webpack_require__(13); -var TilemapComponents = __webpack_require__(145); +var TilemapComponents = __webpack_require__(146); /** * @classdesc @@ -121465,6 +123582,12 @@ var DynamicTilemapLayer = new Class({ { if (removeFromTilemap === undefined) { removeFromTilemap = true; } + if (!this.tilemap) + { + // Abort, we've already been destroyed + return; + } + // Uninstall this layer only if it is still installed on the LayerData object if (this.layer.tilemapLayer === this) { @@ -122313,7 +124436,7 @@ module.exports = DynamicTilemapLayer; /***/ }), -/* 511 */ +/* 515 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122324,10 +124447,10 @@ module.exports = DynamicTilemapLayer; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(28); +var GameEvents = __webpack_require__(22); var GameObject = __webpack_require__(13); -var StaticTilemapLayerRender = __webpack_require__(1380); -var TilemapComponents = __webpack_require__(145); +var StaticTilemapLayerRender = __webpack_require__(1384); +var TilemapComponents = __webpack_require__(146); var TransformMatrix = __webpack_require__(35); var Utils = __webpack_require__(10); @@ -122677,13 +124800,10 @@ var StaticTilemapLayer = new Class({ this.initPipeline('TextureTintPipeline'); - if (scene.sys.game.config.renderType === CONST.WEBGL) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function () { - scene.sys.game.renderer.onContextRestored(function () - { - this.updateVBOData(); - }, this); - } + this.updateVBOData(); + }, this); }, /** @@ -123764,7 +125884,13 @@ var StaticTilemapLayer = new Class({ { if (removeFromTilemap === undefined) { removeFromTilemap = true; } - // Uninstall this layer only if it is still installed on the LayerData object + if (!this.tilemap) + { + // Abort, we've already been destroyed + return; + } + + // Uninstall this layer only if it is still installed on the LayerData object if (this.layer.tilemapLayer === this) { this.layer.tilemapLayer = undefined; @@ -123802,7 +125928,7 @@ module.exports = StaticTilemapLayer; /***/ }), -/* 512 */ +/* 516 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124081,7 +126207,7 @@ var TimerEvent = new Class({ * @method Phaser.Time.TimerEvent#remove * @since 3.0.0 * - * @param {boolean} [dispatchCallback] - If `true` (by default `false`), the function of the Timer Event will be called before its removal from its Clock. + * @param {boolean} [dispatchCallback=false] - If `true`, the function of the Timer Event will be called before its removal. */ remove: function (dispatchCallback) { @@ -124115,7 +126241,7 @@ module.exports = TimerEvent; /***/ }), -/* 513 */ +/* 517 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124124,17 +126250,20 @@ module.exports = TimerEvent; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RESERVED = __webpack_require__(1389); +var RESERVED = __webpack_require__(1393); /** - * [description] + * Internal function used by the Tween Builder to return an array of properties + * that the Tween will be operating on. It takes a tween configuration object + * and then checks that none of the `props` entries start with an underscore, or that + * none of the direct properties are on the Reserved list. * * @function Phaser.Tweens.Builders.GetProps * @since 3.0.0 * - * @param {object} config - The configuration object of the tween to get the target(s) from. + * @param {Phaser.Types.Tweens.TweenBuilderConfig} config - The configuration object of the Tween to get the properties from. * - * @return {array} An array of all the targets the tween is operating on. + * @return {string[]} An array of all the properties the tween will operate on. */ var GetProps = function (config) { @@ -124173,7 +126302,7 @@ module.exports = GetProps; /***/ }), -/* 514 */ +/* 518 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124185,14 +126314,16 @@ module.exports = GetProps; var GetValue = __webpack_require__(5); /** - * Returns an array of all tweens in the given config + * Internal function used by the Timeline Builder. + * + * It returns an array of all tweens in the given timeline config. * * @function Phaser.Tweens.Builders.GetTweens * @since 3.0.0 * - * @param {object} config - [description] + * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline. * - * @return {array} [description] + * @return {Phaser.Tweens.Tween[]} An array of Tween instances that the Timeline will manage. */ var GetTweens = function (config) { @@ -124219,7 +126350,7 @@ module.exports = GetTweens; /***/ }), -/* 515 */ +/* 519 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124228,15 +126359,15 @@ module.exports = GetTweens; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Defaults = __webpack_require__(241); +var Defaults = __webpack_require__(243); var GetAdvancedValue = __webpack_require__(14); -var GetBoolean = __webpack_require__(96); -var GetEaseFunction = __webpack_require__(106); -var GetNewValue = __webpack_require__(150); +var GetBoolean = __webpack_require__(98); +var GetEaseFunction = __webpack_require__(89); +var GetNewValue = __webpack_require__(151); var GetValue = __webpack_require__(5); -var GetValueOp = __webpack_require__(240); -var Tween = __webpack_require__(242); -var TweenData = __webpack_require__(243); +var GetValueOp = __webpack_require__(242); +var Tween = __webpack_require__(244); +var TweenData = __webpack_require__(246); /** * Creates a new Number Tween. @@ -124287,9 +126418,11 @@ var NumberTweenBuilder = function (parent, config, defaults) var tweenData = TweenData( targets[0], + 0, 'value', ops.getEnd, ops.getStart, + ops.getActive, ease, delay, duration, @@ -124347,7 +126480,7 @@ module.exports = NumberTweenBuilder; /***/ }), -/* 516 */ +/* 520 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124357,16 +126490,16 @@ module.exports = NumberTweenBuilder; */ var Clone = __webpack_require__(70); -var Defaults = __webpack_require__(241); +var Defaults = __webpack_require__(243); var GetAdvancedValue = __webpack_require__(14); -var GetBoolean = __webpack_require__(96); -var GetEaseFunction = __webpack_require__(106); -var GetNewValue = __webpack_require__(150); -var GetTargets = __webpack_require__(239); -var GetTweens = __webpack_require__(514); +var GetBoolean = __webpack_require__(98); +var GetEaseFunction = __webpack_require__(89); +var GetNewValue = __webpack_require__(151); +var GetTargets = __webpack_require__(241); +var GetTweens = __webpack_require__(518); var GetValue = __webpack_require__(5); -var Timeline = __webpack_require__(517); -var TweenBuilder = __webpack_require__(151); +var Timeline = __webpack_require__(521); +var TweenBuilder = __webpack_require__(152); /** * Builds a Timeline of Tweens based on a configuration object. @@ -124499,7 +126632,7 @@ module.exports = TimelineBuilder; /***/ }), -/* 517 */ +/* 521 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124510,9 +126643,9 @@ module.exports = TimelineBuilder; var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(518); -var TweenBuilder = __webpack_require__(151); -var TWEEN_CONST = __webpack_require__(97); +var Events = __webpack_require__(245); +var TweenBuilder = __webpack_require__(152); +var TWEEN_CONST = __webpack_require__(99); /** * @classdesc @@ -124739,6 +126872,21 @@ var Timeline = new Class({ */ this.totalProgress = 0; + /** + * An object containing the different Tween callback functions. + * + * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. + * + * `onComplete` When the Timeline finishes playback fully or `Timeline.stop` is called. Never invoked if timeline is set to repeat infinitely. + * `onLoop` When a Timeline loops. + * `onStart` When the Timeline starts playing. + * `onUpdate` When a Timeline updates a child Tween. + * `onYoyo` When a Timeline starts a yoyo. + * + * @name Phaser.Tweens.Timeline#callbacks + * @type {object} + * @since 3.0.0 + */ this.callbacks = { onComplete: null, onLoop: null, @@ -124747,9 +126895,37 @@ var Timeline = new Class({ onYoyo: null }; + /** + * The context in which all callbacks are invoked. + * + * @name Phaser.Tweens.Timeline#callbackScope + * @type {any} + * @since 3.0.0 + */ this.callbackScope; }, + /** + * Internal method that will emit a Timeline based Event and invoke the given callback. + * + * @method Phaser.Tweens.Timeline#dispatchTimelineEvent + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchTimelineEvent: function (event, callback) + { + this.emit(event, this, this.targets); + + if (callback) + { + callback.params[1] = this.targets; + + callback.func.apply(callback.scope, callback.params); + } + }, + /** * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. * A value of 0.5 runs 50% slower, and so on. @@ -125108,14 +127284,7 @@ var Timeline = new Class({ this.state = TWEEN_CONST.ACTIVE; } - var onStart = this.callbacks.onStart; - - if (onStart) - { - onStart.func.apply(onStart.scope, onStart.params); - } - - this.emit(Events.TIMELINE_START, this); + this.dispatchTimelineEvent(Events.TIMELINE_START, this.callbacks.onStart); }, /** @@ -125138,44 +127307,32 @@ var Timeline = new Class({ this.loopCounter--; - var onLoop = this.callbacks.onLoop; - - if (onLoop) - { - onLoop.func.apply(onLoop.scope, onLoop.params); - } - - this.emit(Events.TIMELINE_LOOP, this, this.loopCounter); - this.resetTweens(true); if (this.loopDelay > 0) { this.countdown = this.loopDelay; + this.state = TWEEN_CONST.LOOP_DELAY; } else { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); } } else if (this.completeDelay > 0) { - this.countdown = this.completeDelay; this.state = TWEEN_CONST.COMPLETE_DELAY; + + this.countdown = this.completeDelay; } else { this.state = TWEEN_CONST.PENDING_REMOVE; - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.func.apply(onComplete.scope, onComplete.params); - } - - this.emit(Events.TIMELINE_COMPLETE, this); + this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); } }, @@ -125229,14 +127386,7 @@ var Timeline = new Class({ } } - var onUpdate = this.callbacks.onUpdate; - - if (onUpdate) - { - onUpdate.func.apply(onUpdate.scope, onUpdate.params); - } - - this.emit(Events.TIMELINE_UPDATE, this); + this.dispatchTimelineEvent(Events.TIMELINE_UPDATE, this.callbacks.onUpdate); // Anything still running? If not, we're done if (stillRunning === 0) @@ -125253,6 +127403,8 @@ var Timeline = new Class({ if (this.countdown <= 0) { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); } break; @@ -125265,14 +127417,7 @@ var Timeline = new Class({ { this.state = TWEEN_CONST.PENDING_REMOVE; - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.func.apply(onComplete.scope, onComplete.params); - } - - this.emit(Events.TIMELINE_COMPLETE, this); + this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); } break; @@ -125394,33 +127539,7 @@ module.exports = Timeline; /***/ }), -/* 518 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Tweens.Events - */ - -module.exports = { - - TIMELINE_COMPLETE: __webpack_require__(1390), - TIMELINE_LOOP: __webpack_require__(1391), - TIMELINE_PAUSE: __webpack_require__(1392), - TIMELINE_RESUME: __webpack_require__(1393), - TIMELINE_START: __webpack_require__(1394), - TIMELINE_UPDATE: __webpack_require__(1395) - -}; - - -/***/ }), -/* 519 */ +/* 522 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** @@ -125429,10 +127548,10 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -__webpack_require__(520); +__webpack_require__(523); -var CONST = __webpack_require__(28); -var Extend = __webpack_require__(20); +var CONST = __webpack_require__(34); +var Extend = __webpack_require__(15); /** * @namespace Phaser @@ -125440,38 +127559,38 @@ var Extend = __webpack_require__(20); var Phaser = { - Actions: __webpack_require__(244), - Animations: __webpack_require__(609), + Actions: __webpack_require__(247), + Animations: __webpack_require__(628), BlendModes: __webpack_require__(42), - Cache: __webpack_require__(624), - Cameras: __webpack_require__(627), - Core: __webpack_require__(710), + Cache: __webpack_require__(629), + Cameras: __webpack_require__(632), + Core: __webpack_require__(715), Class: __webpack_require__(0), - Create: __webpack_require__(767), - Curves: __webpack_require__(773), - Data: __webpack_require__(776), - Display: __webpack_require__(778), - DOM: __webpack_require__(807), - Events: __webpack_require__(808), - Game: __webpack_require__(810), - GameObjects: __webpack_require__(909), - Geom: __webpack_require__(426), - Input: __webpack_require__(1183), - Loader: __webpack_require__(1217), - Math: __webpack_require__(176), - Physics: __webpack_require__(1242), - Plugins: __webpack_require__(1331), - Renderer: __webpack_require__(1333), - Scale: __webpack_require__(1338), - ScaleModes: __webpack_require__(94), - Scene: __webpack_require__(370), - Scenes: __webpack_require__(1339), - Structs: __webpack_require__(1341), - Textures: __webpack_require__(1342), - Tilemaps: __webpack_require__(1344), - Time: __webpack_require__(1385), - Tweens: __webpack_require__(1387), - Utils: __webpack_require__(1397) + Create: __webpack_require__(773), + Curves: __webpack_require__(779), + Data: __webpack_require__(782), + Display: __webpack_require__(784), + DOM: __webpack_require__(813), + Events: __webpack_require__(814), + Game: __webpack_require__(816), + GameObjects: __webpack_require__(914), + Geom: __webpack_require__(429), + Input: __webpack_require__(1188), + Loader: __webpack_require__(1222), + Math: __webpack_require__(177), + Physics: __webpack_require__(1247), + Plugins: __webpack_require__(1335), + Renderer: __webpack_require__(1337), + Scale: __webpack_require__(1342), + ScaleModes: __webpack_require__(96), + Scene: __webpack_require__(373), + Scenes: __webpack_require__(1343), + Structs: __webpack_require__(1345), + Textures: __webpack_require__(1346), + Tilemaps: __webpack_require__(1348), + Time: __webpack_require__(1389), + Tweens: __webpack_require__(1391), + Utils: __webpack_require__(1409) }; @@ -125479,7 +127598,7 @@ var Phaser = { if (true) { - Phaser.Sound = __webpack_require__(1407); + Phaser.Sound = __webpack_require__(1419); } if (false) @@ -125487,7 +127606,7 @@ if (false) if (true) { - Phaser.FacebookInstantGamesPlugin = __webpack_require__(384); + Phaser.FacebookInstantGamesPlugin = __webpack_require__(387); } // Merge in the consts @@ -125513,24 +127632,24 @@ global.Phaser = Phaser; * -- Dick Brandon */ -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(152))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(153))) /***/ }), -/* 520 */ +/* 523 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(521); -__webpack_require__(522); -__webpack_require__(523); __webpack_require__(524); __webpack_require__(525); __webpack_require__(526); __webpack_require__(527); __webpack_require__(528); +__webpack_require__(529); +__webpack_require__(530); +__webpack_require__(531); /***/ }), -/* 521 */ +/* 524 */ /***/ (function(module, exports) { /** @@ -125570,7 +127689,7 @@ if (!Array.prototype.forEach) /***/ }), -/* 522 */ +/* 525 */ /***/ (function(module, exports) { /** @@ -125586,7 +127705,7 @@ if (!Array.isArray) /***/ }), -/* 523 */ +/* 526 */ /***/ (function(module, exports) { /* Copyright 2013 Chris Wilson @@ -125773,7 +127892,7 @@ BiquadFilterNode.type and OscillatorNode.type. /***/ }), -/* 524 */ +/* 527 */ /***/ (function(module, exports) { /** @@ -125788,7 +127907,7 @@ if (!window.console) /***/ }), -/* 525 */ +/* 528 */ /***/ (function(module, exports) { // ES6 Math.trunc - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc @@ -125800,7 +127919,7 @@ if (!Math.trunc) { /***/ }), -/* 526 */ +/* 529 */ /***/ (function(module, exports) { /** @@ -125837,7 +127956,7 @@ if (!Math.trunc) { /***/ }), -/* 527 */ +/* 530 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {// References: @@ -125907,10 +128026,10 @@ if (!global.cancelAnimationFrame) { }; } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(152))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(153))) /***/ }), -/* 528 */ +/* 531 */ /***/ (function(module, exports) { /** @@ -125963,7 +128082,7 @@ if (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'o /***/ }), -/* 529 */ +/* 532 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126004,7 +128123,7 @@ module.exports = Angle; /***/ }), -/* 530 */ +/* 533 */ /***/ (function(module, exports) { /** @@ -126043,7 +128162,7 @@ module.exports = Call; /***/ }), -/* 531 */ +/* 534 */ /***/ (function(module, exports) { /** @@ -126101,7 +128220,7 @@ module.exports = GetFirst; /***/ }), -/* 532 */ +/* 535 */ /***/ (function(module, exports) { /** @@ -126159,7 +128278,7 @@ module.exports = GetLast; /***/ }), -/* 533 */ +/* 536 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126168,11 +128287,11 @@ module.exports = GetLast; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AlignIn = __webpack_require__(245); -var CONST = __webpack_require__(153); +var AlignIn = __webpack_require__(248); +var CONST = __webpack_require__(154); var GetFastValue = __webpack_require__(1); var NOOP = __webpack_require__(2); -var Zone = __webpack_require__(114); +var Zone = __webpack_require__(115); var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1); @@ -126269,7 +128388,7 @@ module.exports = GridAlign; /***/ }), -/* 534 */ +/* 537 */ /***/ (function(module, exports) { /** @@ -126296,7 +128415,7 @@ module.exports = 'add'; /***/ }), -/* 535 */ +/* 538 */ /***/ (function(module, exports) { /** @@ -126324,7 +128443,7 @@ module.exports = 'complete'; /***/ }), -/* 536 */ +/* 539 */ /***/ (function(module, exports) { /** @@ -126351,7 +128470,7 @@ module.exports = 'repeat'; /***/ }), -/* 537 */ +/* 540 */ /***/ (function(module, exports) { /** @@ -126379,7 +128498,7 @@ module.exports = 'restart'; /***/ }), -/* 538 */ +/* 541 */ /***/ (function(module, exports) { /** @@ -126407,7 +128526,7 @@ module.exports = 'start'; /***/ }), -/* 539 */ +/* 542 */ /***/ (function(module, exports) { /** @@ -126431,7 +128550,7 @@ module.exports = 'pauseall'; /***/ }), -/* 540 */ +/* 543 */ /***/ (function(module, exports) { /** @@ -126455,7 +128574,7 @@ module.exports = 'remove'; /***/ }), -/* 541 */ +/* 544 */ /***/ (function(module, exports) { /** @@ -126478,7 +128597,7 @@ module.exports = 'resumeall'; /***/ }), -/* 542 */ +/* 545 */ /***/ (function(module, exports) { /** @@ -126507,7 +128626,7 @@ module.exports = 'animationcomplete'; /***/ }), -/* 543 */ +/* 546 */ /***/ (function(module, exports) { /** @@ -126535,7 +128654,7 @@ module.exports = 'animationcomplete-'; /***/ }), -/* 544 */ +/* 547 */ /***/ (function(module, exports) { /** @@ -126564,7 +128683,7 @@ module.exports = 'animationrepeat-'; /***/ }), -/* 545 */ +/* 548 */ /***/ (function(module, exports) { /** @@ -126592,7 +128711,7 @@ module.exports = 'animationrestart-'; /***/ }), -/* 546 */ +/* 549 */ /***/ (function(module, exports) { /** @@ -126620,7 +128739,7 @@ module.exports = 'animationstart-'; /***/ }), -/* 547 */ +/* 550 */ /***/ (function(module, exports) { /** @@ -126649,7 +128768,7 @@ module.exports = 'animationupdate-'; /***/ }), -/* 548 */ +/* 551 */ /***/ (function(module, exports) { /** @@ -126679,7 +128798,7 @@ module.exports = 'animationrepeat'; /***/ }), -/* 549 */ +/* 552 */ /***/ (function(module, exports) { /** @@ -126708,7 +128827,7 @@ module.exports = 'animationrestart'; /***/ }), -/* 550 */ +/* 553 */ /***/ (function(module, exports) { /** @@ -126737,7 +128856,7 @@ module.exports = 'animationstart'; /***/ }), -/* 551 */ +/* 554 */ /***/ (function(module, exports) { /** @@ -126767,7 +128886,7 @@ module.exports = 'animationupdate'; /***/ }), -/* 552 */ +/* 555 */ /***/ (function(module, exports) { /** @@ -126916,7 +129035,7 @@ module.exports = ComputedSize; /***/ }), -/* 553 */ +/* 556 */ /***/ (function(module, exports) { /** @@ -127041,7 +129160,7 @@ module.exports = Crop; /***/ }), -/* 554 */ +/* 557 */ /***/ (function(module, exports) { /** @@ -127205,7 +129324,7 @@ module.exports = Flip; /***/ }), -/* 555 */ +/* 558 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127215,7 +129334,7 @@ module.exports = Flip; */ var Rectangle = __webpack_require__(11); -var RotateAround = __webpack_require__(267); +var RotateAround = __webpack_require__(270); var Vector2 = __webpack_require__(3); /** @@ -127564,7 +129683,383 @@ module.exports = GetBounds; /***/ }), -/* 556 */ +/* 559 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Blur Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps + * tab, or if they simply remove focus from the browser to another app. + * + * @event Phaser.Core.Events#BLUR + * @since 3.0.0 + */ +module.exports = 'blur'; + + +/***/ }), +/* 560 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Boot Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. + * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. + * + * @event Phaser.Core.Events#BOOT + * @since 3.0.0 + */ +module.exports = 'boot'; + + +/***/ }), +/* 561 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Context Lost Event. + * + * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Lost event from the browser. + * + * The partner event is `CONTEXT_RESTORED`. + * + * @event Phaser.Core.Events#CONTEXT_LOST + * @since 3.19.0 + */ +module.exports = 'contextlost'; + + +/***/ }), +/* 562 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Context Restored Event. + * + * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Restored event from the browser. + * + * The partner event is `CONTEXT_LOST`. + * + * @event Phaser.Core.Events#CONTEXT_RESTORED + * @since 3.19.0 + */ +module.exports = 'contextrestored'; + + +/***/ }), +/* 563 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Destroy Event. + * + * This event is dispatched when the game instance has been told to destroy itself. + * Lots of internal systems listen to this event in order to clear themselves out. + * Custom plugins and game code should also do the same. + * + * @event Phaser.Core.Events#DESTROY + * @since 3.0.0 + */ +module.exports = 'destroy'; + + +/***/ }), +/* 564 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Focus Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. + * + * @event Phaser.Core.Events#FOCUS + * @since 3.0.0 + */ +module.exports = 'focus'; + + +/***/ }), +/* 565 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Hidden Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted. + * + * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which + * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something + * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) + * + * @event Phaser.Core.Events#HIDDEN + * @since 3.0.0 + */ +module.exports = 'hidden'; + + +/***/ }), +/* 566 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pause Event. + * + * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. + * + * @event Phaser.Core.Events#PAUSE + * @since 3.0.0 + */ +module.exports = 'pause'; + + +/***/ }), +/* 567 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Post-Render Event. + * + * This event is dispatched right at the end of the render process. + * + * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. + * Use it for any last minute post-processing before the next game step begins. + * + * @event Phaser.Core.Events#POST_RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. + */ +module.exports = 'postrender'; + + +/***/ }), +/* 568 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Post-Step Event. + * + * This event is dispatched after the Scene Manager has updated. + * Hook into it from plugins or systems that need to do things before the render starts. + * + * @event Phaser.Core.Events#POST_STEP + * @since 3.0.0 + * + * @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 = 'poststep'; + + +/***/ }), +/* 569 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pre-Render Event. + * + * This event is dispatched immediately before any of the Scenes have started to render. + * + * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. + * + * @event Phaser.Core.Events#PRE_RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. + */ +module.exports = 'prerender'; + + +/***/ }), +/* 570 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pre-Step Event. + * + * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. + * Hook into it from plugins or systems that need to update before the Scene Manager does. + * + * @event Phaser.Core.Events#PRE_STEP + * @since 3.0.0 + * + * @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 = 'prestep'; + + +/***/ }), +/* 571 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Ready Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, + * and all local systems are now able to start. + * + * @event Phaser.Core.Events#READY + * @since 3.0.0 + */ +module.exports = 'ready'; + + +/***/ }), +/* 572 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Resume Event. + * + * This event is dispatched when the game loop leaves a paused state and resumes running. + * + * @event Phaser.Core.Events#RESUME + * @since 3.0.0 + */ +module.exports = 'resume'; + + +/***/ }), +/* 573 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Step Event. + * + * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. + * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. + * + * @event Phaser.Core.Events#STEP + * @since 3.0.0 + * + * @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 = 'step'; + + +/***/ }), +/* 574 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Visible Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a visible state, previously having been hidden. + * + * Only browsers that support the Visibility API will cause this event to be emitted. + * + * @event Phaser.Core.Events#VISIBLE + * @since 3.0.0 + */ +module.exports = 'visible'; + + +/***/ }), +/* 575 */ /***/ (function(module, exports) { /** @@ -127755,8 +130250,8 @@ var Origin = { */ updateDisplayOrigin: function () { - this._displayOriginX = Math.round(this.originX * this.width); - this._displayOriginY = Math.round(this.originY * this.height); + this._displayOriginX = this.originX * this.width; + this._displayOriginY = this.originY * this.height; return this; } @@ -127767,7 +130262,7 @@ module.exports = Origin; /***/ }), -/* 557 */ +/* 576 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127777,9 +130272,9 @@ module.exports = Origin; */ var DegToRad = __webpack_require__(40); -var GetBoolean = __webpack_require__(96); +var GetBoolean = __webpack_require__(98); var GetValue = __webpack_require__(5); -var TWEEN_CONST = __webpack_require__(97); +var TWEEN_CONST = __webpack_require__(99); var Vector2 = __webpack_require__(3); /** @@ -128164,7 +130659,7 @@ module.exports = PathFollower; /***/ }), -/* 558 */ +/* 577 */ /***/ (function(module, exports) { /** @@ -128351,7 +130846,7 @@ module.exports = Size; /***/ }), -/* 559 */ +/* 578 */ /***/ (function(module, exports) { /** @@ -128481,7 +130976,7 @@ module.exports = Texture; /***/ }), -/* 560 */ +/* 579 */ /***/ (function(module, exports) { /** @@ -128689,7 +131184,7 @@ module.exports = TextureCrop; /***/ }), -/* 561 */ +/* 580 */ /***/ (function(module, exports) { /** @@ -128990,6 +131485,7 @@ var Tint = { /** * 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 {integer} @@ -129028,7 +131524,7 @@ module.exports = Tint; /***/ }), -/* 562 */ +/* 581 */ /***/ (function(module, exports) { /** @@ -129060,7 +131556,7 @@ module.exports = 'changedata'; /***/ }), -/* 563 */ +/* 582 */ /***/ (function(module, exports) { /** @@ -129091,7 +131587,7 @@ module.exports = 'changedata-'; /***/ }), -/* 564 */ +/* 583 */ /***/ (function(module, exports) { /** @@ -129119,7 +131615,7 @@ module.exports = 'removedata'; /***/ }), -/* 565 */ +/* 584 */ /***/ (function(module, exports) { /** @@ -129147,7 +131643,7 @@ module.exports = 'setdata'; /***/ }), -/* 566 */ +/* 585 */ /***/ (function(module, exports) { /** @@ -129172,7 +131668,7 @@ module.exports = 'destroy'; /***/ }), -/* 567 */ +/* 586 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129213,7 +131709,7 @@ module.exports = IncAlpha; /***/ }), -/* 568 */ +/* 587 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129254,7 +131750,7 @@ module.exports = IncX; /***/ }), -/* 569 */ +/* 588 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129301,7 +131797,7 @@ module.exports = IncXY; /***/ }), -/* 570 */ +/* 589 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129342,7 +131838,7 @@ module.exports = IncY; /***/ }), -/* 571 */ +/* 590 */ /***/ (function(module, exports) { /** @@ -129391,7 +131887,7 @@ module.exports = PlaceOnCircle; /***/ }), -/* 572 */ +/* 591 */ /***/ (function(module, exports) { /** @@ -129443,7 +131939,7 @@ module.exports = PlaceOnEllipse; /***/ }), -/* 573 */ +/* 592 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129452,7 +131948,7 @@ module.exports = PlaceOnEllipse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoints = __webpack_require__(158); +var GetPoints = __webpack_require__(159); /** * Positions an array of Game Objects on evenly spaced points of a Line. @@ -129487,7 +131983,7 @@ module.exports = PlaceOnLine; /***/ }), -/* 574 */ +/* 593 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129496,9 +131992,9 @@ module.exports = PlaceOnLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MarchingAnts = __webpack_require__(276); -var RotateLeft = __webpack_require__(277); -var RotateRight = __webpack_require__(278); +var MarchingAnts = __webpack_require__(279); +var RotateLeft = __webpack_require__(280); +var RotateRight = __webpack_require__(281); /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. @@ -129545,7 +132041,7 @@ module.exports = PlaceOnRectangle; /***/ }), -/* 575 */ +/* 594 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129554,7 +132050,7 @@ module.exports = PlaceOnRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BresenhamPoints = __webpack_require__(279); +var BresenhamPoints = __webpack_require__(282); /** * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. @@ -129606,7 +132102,7 @@ module.exports = PlaceOnTriangle; /***/ }), -/* 576 */ +/* 595 */ /***/ (function(module, exports) { /** @@ -129643,7 +132139,7 @@ module.exports = PlayAnimation; /***/ }), -/* 577 */ +/* 596 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129652,7 +132148,7 @@ module.exports = PlayAnimation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(155); +var Random = __webpack_require__(156); /** * Takes an array of Game Objects and positions them at random locations within the Circle. @@ -129683,7 +132179,7 @@ module.exports = RandomCircle; /***/ }), -/* 578 */ +/* 597 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129692,7 +132188,7 @@ module.exports = RandomCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(163); +var Random = __webpack_require__(164); /** * Takes an array of Game Objects and positions them at random locations within the Ellipse. @@ -129723,7 +132219,7 @@ module.exports = RandomEllipse; /***/ }), -/* 579 */ +/* 598 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129732,7 +132228,7 @@ module.exports = RandomEllipse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(159); +var Random = __webpack_require__(160); /** * Takes an array of Game Objects and positions them at random locations on the Line. @@ -129763,7 +132259,7 @@ module.exports = RandomLine; /***/ }), -/* 580 */ +/* 599 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129772,7 +132268,7 @@ module.exports = RandomLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(160); +var Random = __webpack_require__(161); /** * Takes an array of Game Objects and positions them at random locations within the Rectangle. @@ -129801,7 +132297,7 @@ module.exports = RandomRectangle; /***/ }), -/* 581 */ +/* 600 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129810,7 +132306,7 @@ module.exports = RandomRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(164); +var Random = __webpack_require__(165); /** * Takes an array of Game Objects and positions them at random locations within the Triangle. @@ -129841,7 +132337,7 @@ module.exports = RandomTriangle; /***/ }), -/* 582 */ +/* 601 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129882,7 +132378,7 @@ module.exports = Rotate; /***/ }), -/* 583 */ +/* 602 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129891,8 +132387,8 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundDistance = __webpack_require__(165); -var DistanceBetween = __webpack_require__(62); +var RotateAroundDistance = __webpack_require__(166); +var DistanceBetween = __webpack_require__(63); /** * Rotates each item around the given point by the given angle. @@ -129928,7 +132424,7 @@ module.exports = RotateAround; /***/ }), -/* 584 */ +/* 603 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129937,7 +132433,7 @@ module.exports = RotateAround; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathRotateAroundDistance = __webpack_require__(165); +var MathRotateAroundDistance = __webpack_require__(166); /** * Rotates an array of Game Objects around a point by the given angle and distance. @@ -129977,7 +132473,7 @@ module.exports = RotateAroundDistance; /***/ }), -/* 585 */ +/* 604 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130018,7 +132514,7 @@ module.exports = ScaleX; /***/ }), -/* 586 */ +/* 605 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130065,7 +132561,7 @@ module.exports = ScaleXY; /***/ }), -/* 587 */ +/* 606 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130106,7 +132602,7 @@ module.exports = ScaleY; /***/ }), -/* 588 */ +/* 607 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130147,7 +132643,7 @@ module.exports = SetAlpha; /***/ }), -/* 589 */ +/* 608 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130187,7 +132683,7 @@ module.exports = SetBlendMode; /***/ }), -/* 590 */ +/* 609 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130228,7 +132724,7 @@ module.exports = SetDepth; /***/ }), -/* 591 */ +/* 610 */ /***/ (function(module, exports) { /** @@ -130267,7 +132763,7 @@ module.exports = SetHitArea; /***/ }), -/* 592 */ +/* 611 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130314,7 +132810,7 @@ module.exports = SetOrigin; /***/ }), -/* 593 */ +/* 612 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130355,7 +132851,7 @@ module.exports = SetRotation; /***/ }), -/* 594 */ +/* 613 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130402,7 +132898,7 @@ module.exports = SetScale; /***/ }), -/* 595 */ +/* 614 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130443,7 +132939,7 @@ module.exports = SetScaleX; /***/ }), -/* 596 */ +/* 615 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130484,7 +132980,7 @@ module.exports = SetScaleY; /***/ }), -/* 597 */ +/* 616 */ /***/ (function(module, exports) { /** @@ -130523,7 +133019,7 @@ module.exports = SetTint; /***/ }), -/* 598 */ +/* 617 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130561,7 +133057,7 @@ module.exports = SetVisible; /***/ }), -/* 599 */ +/* 618 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130602,7 +133098,7 @@ module.exports = SetX; /***/ }), -/* 600 */ +/* 619 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130649,7 +133145,7 @@ module.exports = SetXY; /***/ }), -/* 601 */ +/* 620 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130690,7 +133186,7 @@ module.exports = SetY; /***/ }), -/* 602 */ +/* 621 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130820,7 +133316,7 @@ module.exports = ShiftPosition; /***/ }), -/* 603 */ +/* 622 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130829,7 +133325,7 @@ module.exports = ShiftPosition; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayShuffle = __webpack_require__(119); +var ArrayShuffle = __webpack_require__(120); /** * Shuffles the array in place. The shuffled array is both modified and returned. @@ -130853,7 +133349,7 @@ module.exports = Shuffle; /***/ }), -/* 604 */ +/* 623 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130862,7 +133358,7 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathSmootherStep = __webpack_require__(166); +var MathSmootherStep = __webpack_require__(167); /** * Smootherstep is a sigmoid-like interpolation and clamping function. @@ -130911,7 +133407,7 @@ module.exports = SmootherStep; /***/ }), -/* 605 */ +/* 624 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130920,7 +133416,7 @@ module.exports = SmootherStep; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathSmoothStep = __webpack_require__(167); +var MathSmoothStep = __webpack_require__(168); /** * Smoothstep is a sigmoid-like interpolation and clamping function. @@ -130969,7 +133465,7 @@ module.exports = SmoothStep; /***/ }), -/* 606 */ +/* 625 */ /***/ (function(module, exports) { /** @@ -131032,7 +133528,7 @@ module.exports = Spread; /***/ }), -/* 607 */ +/* 626 */ /***/ (function(module, exports) { /** @@ -131068,7 +133564,7 @@ module.exports = ToggleVisible; /***/ }), -/* 608 */ +/* 627 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131078,7 +133574,7 @@ module.exports = ToggleVisible; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Wrap = __webpack_require__(61); +var Wrap = __webpack_require__(62); /** * Wrap each item's coordinates within a rectangle's area. @@ -131117,7 +133613,7 @@ module.exports = WrapInRectangle; /***/ }), -/* 609 */ +/* 628 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131132,346 +133628,16 @@ module.exports = WrapInRectangle; module.exports = { - Animation: __webpack_require__(156), - AnimationFrame: __webpack_require__(262), - AnimationManager: __webpack_require__(280), - Events: __webpack_require__(115) + Animation: __webpack_require__(157), + AnimationFrame: __webpack_require__(265), + AnimationManager: __webpack_require__(283), + Events: __webpack_require__(116) }; /***/ }), -/* 610 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Blur Event. - * - * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded - * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps - * tab, or if they simply remove focus from the browser to another app. - * - * @event Phaser.Core.Events#BLUR - * @since 3.0.0 - */ -module.exports = 'blur'; - - -/***/ }), -/* 611 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Boot Event. - * - * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. - * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. - * - * @event Phaser.Core.Events#BOOT - * @since 3.0.0 - */ -module.exports = 'boot'; - - -/***/ }), -/* 612 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Destroy Event. - * - * This event is dispatched when the game instance has been told to destroy itself. - * Lots of internal systems listen to this event in order to clear themselves out. - * Custom plugins and game code should also do the same. - * - * @event Phaser.Core.Events#DESTROY - * @since 3.0.0 - */ -module.exports = 'destroy'; - - -/***/ }), -/* 613 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Focus Event. - * - * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded - * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. - * - * @event Phaser.Core.Events#FOCUS - * @since 3.0.0 - */ -module.exports = 'focus'; - - -/***/ }), -/* 614 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Hidden Event. - * - * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded - * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted. - * - * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which - * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something - * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) - * - * @event Phaser.Core.Events#HIDDEN - * @since 3.0.0 - */ -module.exports = 'hidden'; - - -/***/ }), -/* 615 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Pause Event. - * - * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. - * - * @event Phaser.Core.Events#PAUSE - * @since 3.0.0 - */ -module.exports = 'pause'; - - -/***/ }), -/* 616 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Post-Render Event. - * - * This event is dispatched right at the end of the render process. - * - * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. - * Use it for any last minute post-processing before the next game step begins. - * - * @event Phaser.Core.Events#POST_RENDER - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. - */ -module.exports = 'postrender'; - - -/***/ }), -/* 617 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Post-Step Event. - * - * This event is dispatched after the Scene Manager has updated. - * Hook into it from plugins or systems that need to do things before the render starts. - * - * @event Phaser.Core.Events#POST_STEP - * @since 3.0.0 - * - * @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 = 'poststep'; - - -/***/ }), -/* 618 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Pre-Render Event. - * - * This event is dispatched immediately before any of the Scenes have started to render. - * - * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. - * - * @event Phaser.Core.Events#PRE_RENDER - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. - */ -module.exports = 'prerender'; - - -/***/ }), -/* 619 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Pre-Step Event. - * - * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. - * Hook into it from plugins or systems that need to update before the Scene Manager does. - * - * @event Phaser.Core.Events#PRE_STEP - * @since 3.0.0 - * - * @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 = 'prestep'; - - -/***/ }), -/* 620 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Ready Event. - * - * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, - * and all local systems are now able to start. - * - * @event Phaser.Core.Events#READY - * @since 3.0.0 - */ -module.exports = 'ready'; - - -/***/ }), -/* 621 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Resume Event. - * - * This event is dispatched when the game loop leaves a paused state and resumes running. - * - * @event Phaser.Core.Events#RESUME - * @since 3.0.0 - */ -module.exports = 'resume'; - - -/***/ }), -/* 622 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Step Event. - * - * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. - * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. - * - * @event Phaser.Core.Events#STEP - * @since 3.0.0 - * - * @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 = 'step'; - - -/***/ }), -/* 623 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Visible Event. - * - * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded - * enters a visible state, previously having been hidden. - * - * Only browsers that support the Visibility API will cause this event to be emitted. - * - * @event Phaser.Core.Events#VISIBLE - * @since 3.0.0 - */ -module.exports = 'visible'; - - -/***/ }), -/* 624 */ +/* 629 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131486,15 +133652,15 @@ module.exports = 'visible'; module.exports = { - BaseCache: __webpack_require__(281), - CacheManager: __webpack_require__(283), - Events: __webpack_require__(282) + BaseCache: __webpack_require__(284), + CacheManager: __webpack_require__(286), + Events: __webpack_require__(285) }; /***/ }), -/* 625 */ +/* 630 */ /***/ (function(module, exports) { /** @@ -131519,7 +133685,7 @@ module.exports = 'add'; /***/ }), -/* 626 */ +/* 631 */ /***/ (function(module, exports) { /** @@ -131544,7 +133710,7 @@ module.exports = 'remove'; /***/ }), -/* 627 */ +/* 632 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131563,14 +133729,14 @@ module.exports = 'remove'; module.exports = { - Controls: __webpack_require__(628), - Scene2D: __webpack_require__(631) + Controls: __webpack_require__(633), + Scene2D: __webpack_require__(636) }; /***/ }), -/* 628 */ +/* 633 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131585,14 +133751,14 @@ module.exports = { module.exports = { - FixedKeyControl: __webpack_require__(629), - SmoothedKeyControl: __webpack_require__(630) + FixedKeyControl: __webpack_require__(634), + SmoothedKeyControl: __webpack_require__(635) }; /***/ }), -/* 629 */ +/* 634 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131898,7 +134064,7 @@ module.exports = FixedKeyControl; /***/ }), -/* 630 */ +/* 635 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132349,9 +134515,9 @@ var SmoothedKeyControl = new Class({ { cam.zoom += this._zoom; - if (cam.zoom < 0.1) + if (cam.zoom < 0.001) { - cam.zoom = 0.1; + cam.zoom = 0.001; } } }, @@ -132381,7 +134547,7 @@ module.exports = SmoothedKeyControl; /***/ }), -/* 631 */ +/* 636 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132396,16 +134562,16 @@ module.exports = SmoothedKeyControl; module.exports = { - Camera: __webpack_require__(284), - CameraManager: __webpack_require__(684), - Effects: __webpack_require__(292), - Events: __webpack_require__(53) + Camera: __webpack_require__(287), + CameraManager: __webpack_require__(689), + Effects: __webpack_require__(295), + Events: __webpack_require__(54) }; /***/ }), -/* 632 */ +/* 637 */ /***/ (function(module, exports) { /** @@ -132428,7 +134594,7 @@ module.exports = 'cameradestroy'; /***/ }), -/* 633 */ +/* 638 */ /***/ (function(module, exports) { /** @@ -132454,7 +134620,7 @@ module.exports = 'camerafadeincomplete'; /***/ }), -/* 634 */ +/* 639 */ /***/ (function(module, exports) { /** @@ -132484,7 +134650,7 @@ module.exports = 'camerafadeinstart'; /***/ }), -/* 635 */ +/* 640 */ /***/ (function(module, exports) { /** @@ -132510,7 +134676,7 @@ module.exports = 'camerafadeoutcomplete'; /***/ }), -/* 636 */ +/* 641 */ /***/ (function(module, exports) { /** @@ -132540,7 +134706,7 @@ module.exports = 'camerafadeoutstart'; /***/ }), -/* 637 */ +/* 642 */ /***/ (function(module, exports) { /** @@ -132564,7 +134730,7 @@ module.exports = 'cameraflashcomplete'; /***/ }), -/* 638 */ +/* 643 */ /***/ (function(module, exports) { /** @@ -132592,7 +134758,7 @@ module.exports = 'cameraflashstart'; /***/ }), -/* 639 */ +/* 644 */ /***/ (function(module, exports) { /** @@ -132616,7 +134782,7 @@ module.exports = 'camerapancomplete'; /***/ }), -/* 640 */ +/* 645 */ /***/ (function(module, exports) { /** @@ -132643,7 +134809,7 @@ module.exports = 'camerapanstart'; /***/ }), -/* 641 */ +/* 646 */ /***/ (function(module, exports) { /** @@ -132669,7 +134835,7 @@ module.exports = 'postrender'; /***/ }), -/* 642 */ +/* 647 */ /***/ (function(module, exports) { /** @@ -132695,7 +134861,7 @@ module.exports = 'prerender'; /***/ }), -/* 643 */ +/* 648 */ /***/ (function(module, exports) { /** @@ -132719,7 +134885,7 @@ module.exports = 'camerashakecomplete'; /***/ }), -/* 644 */ +/* 649 */ /***/ (function(module, exports) { /** @@ -132745,7 +134911,7 @@ module.exports = 'camerashakestart'; /***/ }), -/* 645 */ +/* 650 */ /***/ (function(module, exports) { /** @@ -132769,7 +134935,7 @@ module.exports = 'camerazoomcomplete'; /***/ }), -/* 646 */ +/* 651 */ /***/ (function(module, exports) { /** @@ -132795,7 +134961,7 @@ module.exports = 'camerazoomstart'; /***/ }), -/* 647 */ +/* 652 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132804,9 +134970,9 @@ module.exports = 'camerazoomstart'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(53); +var Events = __webpack_require__(54); /** * @classdesc @@ -133183,7 +135349,7 @@ module.exports = Fade; /***/ }), -/* 648 */ +/* 653 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133192,9 +135358,9 @@ module.exports = Fade; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(53); +var Events = __webpack_require__(54); /** * @classdesc @@ -133534,7 +135700,7 @@ module.exports = Flash; /***/ }), -/* 649 */ +/* 654 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133543,10 +135709,10 @@ module.exports = Flash; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var EaseMap = __webpack_require__(174); -var Events = __webpack_require__(53); +var EaseMap = __webpack_require__(175); +var Events = __webpack_require__(54); var Vector2 = __webpack_require__(3); /** @@ -133859,7 +136025,7 @@ module.exports = Pan; /***/ }), -/* 650 */ +/* 655 */ /***/ (function(module, exports) { /** @@ -133890,7 +136056,7 @@ module.exports = In; /***/ }), -/* 651 */ +/* 656 */ /***/ (function(module, exports) { /** @@ -133921,7 +136087,7 @@ module.exports = Out; /***/ }), -/* 652 */ +/* 657 */ /***/ (function(module, exports) { /** @@ -133961,7 +136127,7 @@ module.exports = InOut; /***/ }), -/* 653 */ +/* 658 */ /***/ (function(module, exports) { /** @@ -134006,7 +136172,7 @@ module.exports = In; /***/ }), -/* 654 */ +/* 659 */ /***/ (function(module, exports) { /** @@ -134049,7 +136215,7 @@ module.exports = Out; /***/ }), -/* 655 */ +/* 660 */ /***/ (function(module, exports) { /** @@ -134113,7 +136279,7 @@ module.exports = InOut; /***/ }), -/* 656 */ +/* 661 */ /***/ (function(module, exports) { /** @@ -134141,7 +136307,7 @@ module.exports = In; /***/ }), -/* 657 */ +/* 662 */ /***/ (function(module, exports) { /** @@ -134169,7 +136335,7 @@ module.exports = Out; /***/ }), -/* 658 */ +/* 663 */ /***/ (function(module, exports) { /** @@ -134204,7 +136370,7 @@ module.exports = InOut; /***/ }), -/* 659 */ +/* 664 */ /***/ (function(module, exports) { /** @@ -134232,7 +136398,7 @@ module.exports = In; /***/ }), -/* 660 */ +/* 665 */ /***/ (function(module, exports) { /** @@ -134260,7 +136426,7 @@ module.exports = Out; /***/ }), -/* 661 */ +/* 666 */ /***/ (function(module, exports) { /** @@ -134295,7 +136461,7 @@ module.exports = InOut; /***/ }), -/* 662 */ +/* 667 */ /***/ (function(module, exports) { /** @@ -134350,7 +136516,7 @@ module.exports = In; /***/ }), -/* 663 */ +/* 668 */ /***/ (function(module, exports) { /** @@ -134405,7 +136571,7 @@ module.exports = Out; /***/ }), -/* 664 */ +/* 669 */ /***/ (function(module, exports) { /** @@ -134467,7 +136633,7 @@ module.exports = InOut; /***/ }), -/* 665 */ +/* 670 */ /***/ (function(module, exports) { /** @@ -134495,7 +136661,7 @@ module.exports = In; /***/ }), -/* 666 */ +/* 671 */ /***/ (function(module, exports) { /** @@ -134523,7 +136689,7 @@ module.exports = Out; /***/ }), -/* 667 */ +/* 672 */ /***/ (function(module, exports) { /** @@ -134558,7 +136724,7 @@ module.exports = InOut; /***/ }), -/* 668 */ +/* 673 */ /***/ (function(module, exports) { /** @@ -134586,7 +136752,7 @@ module.exports = Linear; /***/ }), -/* 669 */ +/* 674 */ /***/ (function(module, exports) { /** @@ -134614,7 +136780,7 @@ module.exports = In; /***/ }), -/* 670 */ +/* 675 */ /***/ (function(module, exports) { /** @@ -134642,7 +136808,7 @@ module.exports = Out; /***/ }), -/* 671 */ +/* 676 */ /***/ (function(module, exports) { /** @@ -134677,7 +136843,7 @@ module.exports = InOut; /***/ }), -/* 672 */ +/* 677 */ /***/ (function(module, exports) { /** @@ -134705,7 +136871,7 @@ module.exports = In; /***/ }), -/* 673 */ +/* 678 */ /***/ (function(module, exports) { /** @@ -134733,7 +136899,7 @@ module.exports = Out; /***/ }), -/* 674 */ +/* 679 */ /***/ (function(module, exports) { /** @@ -134768,7 +136934,7 @@ module.exports = InOut; /***/ }), -/* 675 */ +/* 680 */ /***/ (function(module, exports) { /** @@ -134796,7 +136962,7 @@ module.exports = In; /***/ }), -/* 676 */ +/* 681 */ /***/ (function(module, exports) { /** @@ -134824,7 +136990,7 @@ module.exports = Out; /***/ }), -/* 677 */ +/* 682 */ /***/ (function(module, exports) { /** @@ -134859,7 +137025,7 @@ module.exports = InOut; /***/ }), -/* 678 */ +/* 683 */ /***/ (function(module, exports) { /** @@ -134898,7 +137064,7 @@ module.exports = In; /***/ }), -/* 679 */ +/* 684 */ /***/ (function(module, exports) { /** @@ -134937,7 +137103,7 @@ module.exports = Out; /***/ }), -/* 680 */ +/* 685 */ /***/ (function(module, exports) { /** @@ -134976,7 +137142,7 @@ module.exports = InOut; /***/ }), -/* 681 */ +/* 686 */ /***/ (function(module, exports) { /** @@ -135018,7 +137184,7 @@ module.exports = Stepped; /***/ }), -/* 682 */ +/* 687 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135027,9 +137193,9 @@ module.exports = Stepped; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(53); +var Events = __webpack_require__(54); var Vector2 = __webpack_require__(3); /** @@ -135172,7 +137338,7 @@ var Shake = new Class({ * @since 3.5.0 * * @param {integer} [duration=100] - The duration of the effect in milliseconds. - * @param {number} [intensity=0.05] - The intensity of the shake. + * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraShakeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -135337,7 +137503,7 @@ module.exports = Shake; /***/ }), -/* 683 */ +/* 688 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135346,10 +137512,10 @@ module.exports = Shake; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var EaseMap = __webpack_require__(174); -var Events = __webpack_require__(53); +var EaseMap = __webpack_require__(175); +var Events = __webpack_require__(54); /** * @classdesc @@ -135630,7 +137796,7 @@ module.exports = Zoom; /***/ }), -/* 684 */ +/* 689 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135639,13 +137805,13 @@ module.exports = Zoom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Camera = __webpack_require__(284); +var Camera = __webpack_require__(287); var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(1); -var PluginCache = __webpack_require__(17); -var RectangleContains = __webpack_require__(52); -var ScaleEvents = __webpack_require__(99); -var SceneEvents = __webpack_require__(18); +var PluginCache = __webpack_require__(18); +var RectangleContains = __webpack_require__(53); +var ScaleEvents = __webpack_require__(101); +var SceneEvents = __webpack_require__(19); /** * @classdesc @@ -136378,7 +138544,7 @@ module.exports = CameraManager; /***/ }), -/* 685 */ +/* 690 */ /***/ (function(module, exports) { /** @@ -136397,7 +138563,7 @@ module.exports = 'enterfullscreen'; /***/ }), -/* 686 */ +/* 691 */ /***/ (function(module, exports) { /** @@ -136416,7 +138582,7 @@ module.exports = 'fullscreenfailed'; /***/ }), -/* 687 */ +/* 692 */ /***/ (function(module, exports) { /** @@ -136435,7 +138601,7 @@ module.exports = 'fullscreenunsupported'; /***/ }), -/* 688 */ +/* 693 */ /***/ (function(module, exports) { /** @@ -136455,7 +138621,7 @@ module.exports = 'leavefullscreen'; /***/ }), -/* 689 */ +/* 694 */ /***/ (function(module, exports) { /** @@ -136476,7 +138642,7 @@ module.exports = 'orientationchange'; /***/ }), -/* 690 */ +/* 695 */ /***/ (function(module, exports) { /** @@ -136507,7 +138673,7 @@ module.exports = 'resize'; /***/ }), -/* 691 */ +/* 696 */ /***/ (function(module, exports) { /** @@ -136532,7 +138698,7 @@ module.exports = 'boot'; /***/ }), -/* 692 */ +/* 697 */ /***/ (function(module, exports) { /** @@ -136561,7 +138727,7 @@ module.exports = 'create'; /***/ }), -/* 693 */ +/* 698 */ /***/ (function(module, exports) { /** @@ -136588,7 +138754,7 @@ module.exports = 'destroy'; /***/ }), -/* 694 */ +/* 699 */ /***/ (function(module, exports) { /** @@ -136615,7 +138781,7 @@ module.exports = 'pause'; /***/ }), -/* 695 */ +/* 700 */ /***/ (function(module, exports) { /** @@ -136652,7 +138818,7 @@ module.exports = 'postupdate'; /***/ }), -/* 696 */ +/* 701 */ /***/ (function(module, exports) { /** @@ -136689,7 +138855,7 @@ module.exports = 'preupdate'; /***/ }), -/* 697 */ +/* 702 */ /***/ (function(module, exports) { /** @@ -136717,7 +138883,7 @@ module.exports = 'ready'; /***/ }), -/* 698 */ +/* 703 */ /***/ (function(module, exports) { /** @@ -136753,7 +138919,7 @@ module.exports = 'render'; /***/ }), -/* 699 */ +/* 704 */ /***/ (function(module, exports) { /** @@ -136780,7 +138946,7 @@ module.exports = 'resume'; /***/ }), -/* 700 */ +/* 705 */ /***/ (function(module, exports) { /** @@ -136810,7 +138976,7 @@ module.exports = 'shutdown'; /***/ }), -/* 701 */ +/* 706 */ /***/ (function(module, exports) { /** @@ -136837,7 +139003,7 @@ module.exports = 'sleep'; /***/ }), -/* 702 */ +/* 707 */ /***/ (function(module, exports) { /** @@ -136862,7 +139028,7 @@ module.exports = 'start'; /***/ }), -/* 703 */ +/* 708 */ /***/ (function(module, exports) { /** @@ -136898,7 +139064,7 @@ module.exports = 'transitioncomplete'; /***/ }), -/* 704 */ +/* 709 */ /***/ (function(module, exports) { /** @@ -136935,7 +139101,7 @@ module.exports = 'transitioninit'; /***/ }), -/* 705 */ +/* 710 */ /***/ (function(module, exports) { /** @@ -136969,7 +139135,7 @@ module.exports = 'transitionout'; /***/ }), -/* 706 */ +/* 711 */ /***/ (function(module, exports) { /** @@ -137009,7 +139175,7 @@ module.exports = 'transitionstart'; /***/ }), -/* 707 */ +/* 712 */ /***/ (function(module, exports) { /** @@ -137044,7 +139210,7 @@ module.exports = 'transitionwake'; /***/ }), -/* 708 */ +/* 713 */ /***/ (function(module, exports) { /** @@ -137081,7 +139247,7 @@ module.exports = 'update'; /***/ }), -/* 709 */ +/* 714 */ /***/ (function(module, exports) { /** @@ -137108,7 +139274,7 @@ module.exports = 'wake'; /***/ }), -/* 710 */ +/* 715 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137123,18 +139289,18 @@ module.exports = 'wake'; module.exports = { - Config: __webpack_require__(305), - CreateRenderer: __webpack_require__(328), - DebugHeader: __webpack_require__(338), - Events: __webpack_require__(30), - TimeStep: __webpack_require__(339), - VisibilityHandler: __webpack_require__(341) + Config: __webpack_require__(308), + CreateRenderer: __webpack_require__(331), + DebugHeader: __webpack_require__(341), + Events: __webpack_require__(22), + TimeStep: __webpack_require__(342), + VisibilityHandler: __webpack_require__(344) }; /***/ }), -/* 711 */ +/* 716 */ /***/ (function(module, exports) { // shim for using process in browser @@ -137324,7 +139490,7 @@ process.umask = function() { return 0; }; /***/ }), -/* 712 */ +/* 717 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137333,7 +139499,7 @@ process.umask = function() { return 0; }; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Browser = __webpack_require__(124); +var Browser = __webpack_require__(125); /** * Determines the input support of the browser running this Phaser Game instance. @@ -137399,7 +139565,7 @@ module.exports = init(); /***/ }), -/* 713 */ +/* 718 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137408,7 +139574,7 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Browser = __webpack_require__(124); +var Browser = __webpack_require__(125); /** * Determines the audio playback capabilities of the device running this Phaser Game instance. @@ -137524,7 +139690,7 @@ module.exports = init(); /***/ }), -/* 714 */ +/* 719 */ /***/ (function(module, exports) { /** @@ -137609,7 +139775,7 @@ module.exports = init(); /***/ }), -/* 715 */ +/* 720 */ /***/ (function(module, exports) { /** @@ -137713,7 +139879,7 @@ module.exports = init(); /***/ }), -/* 716 */ +/* 721 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137728,23 +139894,23 @@ module.exports = init(); module.exports = { - Between: __webpack_require__(308), - BetweenPoints: __webpack_require__(717), - BetweenPointsY: __webpack_require__(718), - BetweenY: __webpack_require__(719), - CounterClockwise: __webpack_require__(720), - Normalize: __webpack_require__(309), - Reverse: __webpack_require__(721), - RotateTo: __webpack_require__(722), - ShortestBetween: __webpack_require__(723), - Wrap: __webpack_require__(161), - WrapDegrees: __webpack_require__(162) + Between: __webpack_require__(311), + BetweenPoints: __webpack_require__(722), + BetweenPointsY: __webpack_require__(723), + BetweenY: __webpack_require__(724), + CounterClockwise: __webpack_require__(725), + Normalize: __webpack_require__(312), + Reverse: __webpack_require__(726), + RotateTo: __webpack_require__(727), + ShortestBetween: __webpack_require__(728), + Wrap: __webpack_require__(162), + WrapDegrees: __webpack_require__(163) }; /***/ }), -/* 717 */ +/* 722 */ /***/ (function(module, exports) { /** @@ -137775,7 +139941,7 @@ module.exports = BetweenPoints; /***/ }), -/* 718 */ +/* 723 */ /***/ (function(module, exports) { /** @@ -137807,7 +139973,7 @@ module.exports = BetweenPointsY; /***/ }), -/* 719 */ +/* 724 */ /***/ (function(module, exports) { /** @@ -137841,7 +140007,7 @@ module.exports = BetweenY; /***/ }), -/* 720 */ +/* 725 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137850,7 +140016,7 @@ module.exports = BetweenY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); +var CONST = __webpack_require__(21); /** * Takes an angle in Phasers default clockwise format and converts it so that @@ -137874,6 +140040,11 @@ var CONST = __webpack_require__(23); */ var CounterClockwise = function (angle) { + if (angle > Math.PI) + { + angle -= CONST.PI2; + } + return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); }; @@ -137881,7 +140052,7 @@ module.exports = CounterClockwise; /***/ }), -/* 721 */ +/* 726 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137890,7 +140061,7 @@ module.exports = CounterClockwise; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Normalize = __webpack_require__(309); +var Normalize = __webpack_require__(312); /** * Reverse the given angle. @@ -137911,7 +140082,7 @@ module.exports = Reverse; /***/ }), -/* 722 */ +/* 727 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137920,7 +140091,7 @@ module.exports = Reverse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); +var MATH_CONST = __webpack_require__(21); /** * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. @@ -137978,7 +140149,7 @@ module.exports = RotateTo; /***/ }), -/* 723 */ +/* 728 */ /***/ (function(module, exports) { /** @@ -138027,7 +140198,7 @@ module.exports = ShortestBetween; /***/ }), -/* 724 */ +/* 729 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138042,15 +140213,15 @@ module.exports = ShortestBetween; module.exports = { - Between: __webpack_require__(62), - Power: __webpack_require__(725), - Squared: __webpack_require__(310) + Between: __webpack_require__(63), + Power: __webpack_require__(730), + Squared: __webpack_require__(313) }; /***/ }), -/* 725 */ +/* 730 */ /***/ (function(module, exports) { /** @@ -138084,7 +140255,7 @@ module.exports = DistancePower; /***/ }), -/* 726 */ +/* 731 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138099,24 +140270,24 @@ module.exports = DistancePower; module.exports = { - Back: __webpack_require__(293), - Bounce: __webpack_require__(294), - Circular: __webpack_require__(295), - Cubic: __webpack_require__(296), - Elastic: __webpack_require__(297), - Expo: __webpack_require__(298), - Linear: __webpack_require__(299), - Quadratic: __webpack_require__(300), - Quartic: __webpack_require__(301), - Quintic: __webpack_require__(302), - Sine: __webpack_require__(303), - Stepped: __webpack_require__(304) + Back: __webpack_require__(296), + Bounce: __webpack_require__(297), + Circular: __webpack_require__(298), + Cubic: __webpack_require__(299), + Elastic: __webpack_require__(300), + Expo: __webpack_require__(301), + Linear: __webpack_require__(302), + Quadratic: __webpack_require__(303), + Quartic: __webpack_require__(304), + Quintic: __webpack_require__(305), + Sine: __webpack_require__(306), + Stepped: __webpack_require__(307) }; /***/ }), -/* 727 */ +/* 732 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138131,17 +140302,17 @@ module.exports = { module.exports = { - Ceil: __webpack_require__(728), - Equal: __webpack_require__(177), - Floor: __webpack_require__(729), - GreaterThan: __webpack_require__(311), - LessThan: __webpack_require__(312) + Ceil: __webpack_require__(733), + Equal: __webpack_require__(178), + Floor: __webpack_require__(734), + GreaterThan: __webpack_require__(314), + LessThan: __webpack_require__(315) }; /***/ }), -/* 728 */ +/* 733 */ /***/ (function(module, exports) { /** @@ -138172,7 +140343,7 @@ module.exports = Ceil; /***/ }), -/* 729 */ +/* 734 */ /***/ (function(module, exports) { /** @@ -138203,7 +140374,7 @@ module.exports = Floor; /***/ }), -/* 730 */ +/* 735 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138218,19 +140389,19 @@ module.exports = Floor; module.exports = { - Bezier: __webpack_require__(731), - CatmullRom: __webpack_require__(732), - CubicBezier: __webpack_require__(315), - Linear: __webpack_require__(733), - QuadraticBezier: __webpack_require__(316), - SmoothStep: __webpack_require__(317), - SmootherStep: __webpack_require__(734) + Bezier: __webpack_require__(736), + CatmullRom: __webpack_require__(737), + CubicBezier: __webpack_require__(318), + Linear: __webpack_require__(738), + QuadraticBezier: __webpack_require__(319), + SmoothStep: __webpack_require__(320), + SmootherStep: __webpack_require__(739) }; /***/ }), -/* 731 */ +/* 736 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138239,7 +140410,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bernstein = __webpack_require__(313); +var Bernstein = __webpack_require__(316); /** * A bezier interpolation method. @@ -138269,7 +140440,7 @@ module.exports = BezierInterpolation; /***/ }), -/* 732 */ +/* 737 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138278,7 +140449,7 @@ module.exports = BezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CatmullRom = __webpack_require__(178); +var CatmullRom = __webpack_require__(179); /** * A Catmull-Rom interpolation method. @@ -138326,7 +140497,7 @@ module.exports = CatmullRomInterpolation; /***/ }), -/* 733 */ +/* 738 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138335,7 +140506,7 @@ module.exports = CatmullRomInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(122); +var Linear = __webpack_require__(123); /** * A linear interpolation method. @@ -138373,7 +140544,7 @@ module.exports = LinearInterpolation; /***/ }), -/* 734 */ +/* 739 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138382,7 +140553,7 @@ module.exports = LinearInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmootherStep = __webpack_require__(166); +var SmootherStep = __webpack_require__(167); /** * A Smoother Step interpolation method. @@ -138406,7 +140577,7 @@ module.exports = SmootherStepInterpolation; /***/ }), -/* 735 */ +/* 740 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138421,15 +140592,15 @@ module.exports = SmootherStepInterpolation; module.exports = { - GetNext: __webpack_require__(318), - IsSize: __webpack_require__(125), - IsValue: __webpack_require__(736) + GetNext: __webpack_require__(321), + IsSize: __webpack_require__(126), + IsValue: __webpack_require__(741) }; /***/ }), -/* 736 */ +/* 741 */ /***/ (function(module, exports) { /** @@ -138457,7 +140628,7 @@ module.exports = IsValuePowerOfTwo; /***/ }), -/* 737 */ +/* 742 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138472,15 +140643,15 @@ module.exports = IsValuePowerOfTwo; module.exports = { - Ceil: __webpack_require__(319), - Floor: __webpack_require__(100), - To: __webpack_require__(738) + Ceil: __webpack_require__(322), + Floor: __webpack_require__(102), + To: __webpack_require__(743) }; /***/ }), -/* 738 */ +/* 743 */ /***/ (function(module, exports) { /** @@ -138523,7 +140694,7 @@ module.exports = SnapTo; /***/ }), -/* 739 */ +/* 744 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139022,7 +141193,7 @@ module.exports = RandomDataGenerator; /***/ }), -/* 740 */ +/* 745 */ /***/ (function(module, exports) { /** @@ -139057,7 +141228,7 @@ module.exports = Average; /***/ }), -/* 741 */ +/* 746 */ /***/ (function(module, exports) { /** @@ -139094,7 +141265,7 @@ module.exports = CeilTo; /***/ }), -/* 742 */ +/* 747 */ /***/ (function(module, exports) { /** @@ -139123,7 +141294,7 @@ module.exports = Difference; /***/ }), -/* 743 */ +/* 748 */ /***/ (function(module, exports) { /** @@ -139160,7 +141331,7 @@ module.exports = FloorTo; /***/ }), -/* 744 */ +/* 749 */ /***/ (function(module, exports) { /** @@ -139189,7 +141360,7 @@ module.exports = GetSpeed; /***/ }), -/* 745 */ +/* 750 */ /***/ (function(module, exports) { /** @@ -139220,7 +141391,7 @@ module.exports = IsEven; /***/ }), -/* 746 */ +/* 751 */ /***/ (function(module, exports) { /** @@ -139249,7 +141420,7 @@ module.exports = IsEvenStrict; /***/ }), -/* 747 */ +/* 752 */ /***/ (function(module, exports) { /** @@ -139279,7 +141450,7 @@ module.exports = MaxAdd; /***/ }), -/* 748 */ +/* 753 */ /***/ (function(module, exports) { /** @@ -139309,7 +141480,7 @@ module.exports = MinSub; /***/ }), -/* 749 */ +/* 754 */ /***/ (function(module, exports) { /** @@ -139368,7 +141539,7 @@ module.exports = Percent; /***/ }), -/* 750 */ +/* 755 */ /***/ (function(module, exports) { /** @@ -139408,7 +141579,7 @@ module.exports = RandomXY; /***/ }), -/* 751 */ +/* 756 */ /***/ (function(module, exports) { /** @@ -139447,7 +141618,7 @@ module.exports = RandomXYZ; /***/ }), -/* 752 */ +/* 757 */ /***/ (function(module, exports) { /** @@ -139484,7 +141655,7 @@ module.exports = RandomXYZW; /***/ }), -/* 753 */ +/* 758 */ /***/ (function(module, exports) { /** @@ -139536,7 +141707,7 @@ module.exports = RoundTo; /***/ }), -/* 754 */ +/* 759 */ /***/ (function(module, exports) { /** @@ -139589,7 +141760,65 @@ module.exports = SinCosTableGenerator; /***/ }), -/* 755 */ +/* 760 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Returns a Vec2 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 Vec2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {integer} index - The position within the grid to get the x/y value for. + * @param {integer} width - The width of the grid. + * @param {integer} 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; + } + + out.set(x, y); + } + + return out; +}; + +module.exports = ToXY; + + +/***/ }), +/* 761 */ /***/ (function(module, exports) { /** @@ -139619,7 +141848,7 @@ module.exports = Within; /***/ }), -/* 756 */ +/* 762 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139628,9 +141857,9 @@ module.exports = Within; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(181); -var Matrix4 = __webpack_require__(326); -var Quaternion = __webpack_require__(327); +var Vector3 = __webpack_require__(182); +var Matrix4 = __webpack_require__(329); +var Quaternion = __webpack_require__(330); var tmpMat4 = new Matrix4(); var tmpQuat = new Quaternion(); @@ -139667,7 +141896,7 @@ module.exports = RotateVec3; /***/ }), -/* 757 */ +/* 763 */ /***/ (function(module, exports) { /** @@ -139693,7 +141922,7 @@ module.exports = 'addtexture'; /***/ }), -/* 758 */ +/* 764 */ /***/ (function(module, exports) { /** @@ -139719,7 +141948,7 @@ module.exports = 'onerror'; /***/ }), -/* 759 */ +/* 765 */ /***/ (function(module, exports) { /** @@ -139748,7 +141977,7 @@ module.exports = 'onload'; /***/ }), -/* 760 */ +/* 766 */ /***/ (function(module, exports) { /** @@ -139771,7 +142000,7 @@ module.exports = 'ready'; /***/ }), -/* 761 */ +/* 767 */ /***/ (function(module, exports) { /** @@ -139799,7 +142028,7 @@ module.exports = 'removetexture'; /***/ }), -/* 762 */ +/* 768 */ /***/ (function(module, exports) { module.exports = [ @@ -139835,7 +142064,7 @@ module.exports = [ /***/ }), -/* 763 */ +/* 769 */ /***/ (function(module, exports) { module.exports = [ @@ -139854,7 +142083,7 @@ module.exports = [ /***/ }), -/* 764 */ +/* 770 */ /***/ (function(module, exports) { module.exports = [ @@ -139913,7 +142142,7 @@ module.exports = [ /***/ }), -/* 765 */ +/* 771 */ /***/ (function(module, exports) { module.exports = [ @@ -139957,7 +142186,7 @@ module.exports = [ /***/ }), -/* 766 */ +/* 772 */ /***/ (function(module, exports) { module.exports = [ @@ -139992,7 +142221,7 @@ module.exports = [ /***/ }), -/* 767 */ +/* 773 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140007,14 +142236,14 @@ module.exports = [ module.exports = { - GenerateTexture: __webpack_require__(342), - Palettes: __webpack_require__(768) + GenerateTexture: __webpack_require__(345), + Palettes: __webpack_require__(774) }; /***/ }), -/* 768 */ +/* 774 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140029,17 +142258,17 @@ module.exports = { module.exports = { - ARNE16: __webpack_require__(343), - C64: __webpack_require__(769), - CGA: __webpack_require__(770), - JMP: __webpack_require__(771), - MSX: __webpack_require__(772) + ARNE16: __webpack_require__(346), + C64: __webpack_require__(775), + CGA: __webpack_require__(776), + JMP: __webpack_require__(777), + MSX: __webpack_require__(778) }; /***/ }), -/* 769 */ +/* 775 */ /***/ (function(module, exports) { /** @@ -140077,7 +142306,7 @@ module.exports = { /***/ }), -/* 770 */ +/* 776 */ /***/ (function(module, exports) { /** @@ -140115,7 +142344,7 @@ module.exports = { /***/ }), -/* 771 */ +/* 777 */ /***/ (function(module, exports) { /** @@ -140153,7 +142382,7 @@ module.exports = { /***/ }), -/* 772 */ +/* 778 */ /***/ (function(module, exports) { /** @@ -140191,7 +142420,7 @@ module.exports = { /***/ }), -/* 773 */ +/* 779 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140205,19 +142434,19 @@ module.exports = { */ module.exports = { - Path: __webpack_require__(774), + Path: __webpack_require__(780), - CubicBezier: __webpack_require__(344), + CubicBezier: __webpack_require__(347), Curve: __webpack_require__(85), - Ellipse: __webpack_require__(345), - Line: __webpack_require__(346), - QuadraticBezier: __webpack_require__(347), - Spline: __webpack_require__(348) + Ellipse: __webpack_require__(348), + Line: __webpack_require__(349), + QuadraticBezier: __webpack_require__(350), + Spline: __webpack_require__(351) }; /***/ }), -/* 774 */ +/* 780 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140229,14 +142458,14 @@ module.exports = { // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var CubicBezierCurve = __webpack_require__(344); -var EllipseCurve = __webpack_require__(345); +var CubicBezierCurve = __webpack_require__(347); +var EllipseCurve = __webpack_require__(348); var GameObjectFactory = __webpack_require__(6); -var LineCurve = __webpack_require__(346); -var MovePathTo = __webpack_require__(775); -var QuadraticBezierCurve = __webpack_require__(347); +var LineCurve = __webpack_require__(349); +var MovePathTo = __webpack_require__(781); +var QuadraticBezierCurve = __webpack_require__(350); var Rectangle = __webpack_require__(11); -var SplineCurve = __webpack_require__(348); +var SplineCurve = __webpack_require__(351); var Vector2 = __webpack_require__(3); /** @@ -140524,12 +142753,12 @@ var Path = new Class({ * @method Phaser.Curves.Path#ellipseTo * @since 3.0.0 * - * @param {number} xRadius - The horizontal radius of the ellipse. - * @param {number} yRadius - The vertical radius of the ellipse. - * @param {number} startAngle - The start angle of the ellipse, in degrees. - * @param {number} endAngle - The end angle of the ellipse, in degrees. - * @param {boolean} clockwise - Whether the ellipse should be rotated clockwise (`true`) or counter-clockwise (`false`). - * @param {number} rotation - The rotation of the ellipse, in degrees. + * @param {number} [xRadius=0] - The horizontal radius of ellipse. + * @param {number} [yRadius=0] - The vertical radius of ellipse. + * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). + * @param {number} [rotation=0] - The rotation of the ellipse, in degrees. * * @return {Phaser.Curves.Path} This Path object. */ @@ -140912,10 +143141,8 @@ var Path = new Class({ return out.copy(this.startPoint); }, - // Creates a line curve from the previous end point to x/y - /** - * [description] + * Creates a line curve from the previous end point to x/y * * @method Phaser.Curves.Path#lineTo * @since 3.0.0 @@ -141002,10 +143229,8 @@ var Path = new Class({ }; }, - // cacheLengths must be recalculated. - /** - * [description] + * cacheLengths must be recalculated. * * @method Phaser.Curves.Path#updateArcLengths * @since 3.0.0 @@ -141060,7 +143285,7 @@ module.exports = Path; /***/ }), -/* 775 */ +/* 781 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141200,7 +143425,7 @@ module.exports = MoveTo; /***/ }), -/* 776 */ +/* 782 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141215,15 +143440,15 @@ module.exports = MoveTo; module.exports = { - DataManager: __webpack_require__(98), - DataManagerPlugin: __webpack_require__(777), - Events: __webpack_require__(275) + DataManager: __webpack_require__(100), + DataManagerPlugin: __webpack_require__(783), + Events: __webpack_require__(278) }; /***/ }), -/* 777 */ +/* 783 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141233,9 +143458,9 @@ module.exports = { */ var Class = __webpack_require__(0); -var DataManager = __webpack_require__(98); -var PluginCache = __webpack_require__(17); -var SceneEvents = __webpack_require__(18); +var DataManager = __webpack_require__(100); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); /** * @classdesc @@ -141350,7 +143575,7 @@ module.exports = DataManagerPlugin; /***/ }), -/* 778 */ +/* 784 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141365,18 +143590,18 @@ module.exports = DataManagerPlugin; module.exports = { - Align: __webpack_require__(779), - BaseShader: __webpack_require__(349), - Bounds: __webpack_require__(794), - Canvas: __webpack_require__(797), - Color: __webpack_require__(350), - Masks: __webpack_require__(806) + Align: __webpack_require__(785), + BaseShader: __webpack_require__(352), + Bounds: __webpack_require__(800), + Canvas: __webpack_require__(803), + Color: __webpack_require__(353), + Masks: __webpack_require__(812) }; /***/ }), -/* 779 */ +/* 785 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141385,8 +143610,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(153); -var Extend = __webpack_require__(20); +var CONST = __webpack_require__(154); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Display.Align @@ -141394,8 +143619,8 @@ var Extend = __webpack_require__(20); var Align = { - In: __webpack_require__(780), - To: __webpack_require__(781) + In: __webpack_require__(786), + To: __webpack_require__(787) }; @@ -141406,7 +143631,7 @@ module.exports = Align; /***/ }), -/* 780 */ +/* 786 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141421,22 +143646,22 @@ module.exports = Align; module.exports = { - BottomCenter: __webpack_require__(246), - BottomLeft: __webpack_require__(247), - BottomRight: __webpack_require__(248), - Center: __webpack_require__(249), - LeftCenter: __webpack_require__(251), - QuickSet: __webpack_require__(245), - RightCenter: __webpack_require__(252), - TopCenter: __webpack_require__(253), - TopLeft: __webpack_require__(254), - TopRight: __webpack_require__(255) + BottomCenter: __webpack_require__(249), + BottomLeft: __webpack_require__(250), + BottomRight: __webpack_require__(251), + Center: __webpack_require__(252), + LeftCenter: __webpack_require__(254), + QuickSet: __webpack_require__(248), + RightCenter: __webpack_require__(255), + TopCenter: __webpack_require__(256), + TopLeft: __webpack_require__(257), + TopRight: __webpack_require__(258) }; /***/ }), -/* 781 */ +/* 787 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141451,24 +143676,24 @@ module.exports = { module.exports = { - BottomCenter: __webpack_require__(782), - BottomLeft: __webpack_require__(783), - BottomRight: __webpack_require__(784), - LeftBottom: __webpack_require__(785), - LeftCenter: __webpack_require__(786), - LeftTop: __webpack_require__(787), - RightBottom: __webpack_require__(788), - RightCenter: __webpack_require__(789), - RightTop: __webpack_require__(790), - TopCenter: __webpack_require__(791), - TopLeft: __webpack_require__(792), - TopRight: __webpack_require__(793) + BottomCenter: __webpack_require__(788), + BottomLeft: __webpack_require__(789), + BottomRight: __webpack_require__(790), + LeftBottom: __webpack_require__(791), + LeftCenter: __webpack_require__(792), + LeftTop: __webpack_require__(793), + RightBottom: __webpack_require__(794), + RightCenter: __webpack_require__(795), + RightTop: __webpack_require__(796), + TopCenter: __webpack_require__(797), + TopLeft: __webpack_require__(798), + TopRight: __webpack_require__(799) }; /***/ }), -/* 782 */ +/* 788 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141512,7 +143737,7 @@ module.exports = BottomCenter; /***/ }), -/* 783 */ +/* 789 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141556,7 +143781,7 @@ module.exports = BottomLeft; /***/ }), -/* 784 */ +/* 790 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141600,7 +143825,7 @@ module.exports = BottomRight; /***/ }), -/* 785 */ +/* 791 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141644,7 +143869,7 @@ module.exports = LeftBottom; /***/ }), -/* 786 */ +/* 792 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141688,7 +143913,7 @@ module.exports = LeftCenter; /***/ }), -/* 787 */ +/* 793 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141732,7 +143957,7 @@ module.exports = LeftTop; /***/ }), -/* 788 */ +/* 794 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141776,7 +144001,7 @@ module.exports = RightBottom; /***/ }), -/* 789 */ +/* 795 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141820,7 +144045,7 @@ module.exports = RightCenter; /***/ }), -/* 790 */ +/* 796 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141864,7 +144089,7 @@ module.exports = RightTop; /***/ }), -/* 791 */ +/* 797 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141908,7 +144133,7 @@ module.exports = TopCenter; /***/ }), -/* 792 */ +/* 798 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141952,7 +144177,7 @@ module.exports = TopLeft; /***/ }), -/* 793 */ +/* 799 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141996,7 +144221,7 @@ module.exports = TopRight; /***/ }), -/* 794 */ +/* 800 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142011,13 +144236,13 @@ module.exports = TopRight; module.exports = { - CenterOn: __webpack_require__(250), + CenterOn: __webpack_require__(253), GetBottom: __webpack_require__(43), GetCenterX: __webpack_require__(79), GetCenterY: __webpack_require__(82), GetLeft: __webpack_require__(45), - GetOffsetX: __webpack_require__(795), - GetOffsetY: __webpack_require__(796), + GetOffsetX: __webpack_require__(801), + GetOffsetY: __webpack_require__(802), GetRight: __webpack_require__(47), GetTop: __webpack_require__(49), SetBottom: __webpack_require__(44), @@ -142031,7 +144256,7 @@ module.exports = { /***/ }), -/* 795 */ +/* 801 */ /***/ (function(module, exports) { /** @@ -142061,7 +144286,7 @@ module.exports = GetOffsetX; /***/ }), -/* 796 */ +/* 802 */ /***/ (function(module, exports) { /** @@ -142091,7 +144316,7 @@ module.exports = GetOffsetY; /***/ }), -/* 797 */ +/* 803 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142106,17 +144331,17 @@ module.exports = GetOffsetY; module.exports = { - CanvasInterpolation: __webpack_require__(329), - CanvasPool: __webpack_require__(26), - Smoothing: __webpack_require__(121), - TouchAction: __webpack_require__(798), - UserSelect: __webpack_require__(799) + CanvasInterpolation: __webpack_require__(332), + CanvasPool: __webpack_require__(27), + Smoothing: __webpack_require__(122), + TouchAction: __webpack_require__(804), + UserSelect: __webpack_require__(805) }; /***/ }), -/* 798 */ +/* 804 */ /***/ (function(module, exports) { /** @@ -142151,7 +144376,7 @@ module.exports = TouchAction; /***/ }), -/* 799 */ +/* 805 */ /***/ (function(module, exports) { /** @@ -142198,7 +144423,7 @@ module.exports = UserSelect; /***/ }), -/* 800 */ +/* 806 */ /***/ (function(module, exports) { /** @@ -142238,7 +144463,7 @@ module.exports = ColorToRGBA; /***/ }), -/* 801 */ +/* 807 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142248,7 +144473,7 @@ module.exports = ColorToRGBA; */ var Color = __webpack_require__(36); -var HueToComponent = __webpack_require__(352); +var HueToComponent = __webpack_require__(355); /** * Converts HSL (hue, saturation and lightness) values to a Phaser Color object. @@ -142288,7 +144513,7 @@ module.exports = HSLToColor; /***/ }), -/* 802 */ +/* 808 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142297,7 +144522,7 @@ module.exports = HSLToColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HSVToRGB = __webpack_require__(172); +var HSVToRGB = __webpack_require__(173); /** * Get HSV color wheel values in an array which will be 360 elements in size. @@ -142329,7 +144554,7 @@ module.exports = HSVColorWheel; /***/ }), -/* 803 */ +/* 809 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142338,7 +144563,7 @@ module.exports = HSVColorWheel; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(122); +var Linear = __webpack_require__(123); /** * @namespace Phaser.Display.Color.Interpolate @@ -142437,7 +144662,7 @@ module.exports = { /***/ }), -/* 804 */ +/* 810 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142446,7 +144671,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Between = __webpack_require__(179); +var Between = __webpack_require__(180); var Color = __webpack_require__(36); /** @@ -142473,7 +144698,7 @@ module.exports = RandomRGB; /***/ }), -/* 805 */ +/* 811 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142482,7 +144707,7 @@ module.exports = RandomRGB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ComponentToHex = __webpack_require__(351); +var ComponentToHex = __webpack_require__(354); /** * Converts the color values into an HTML compatible color string, prefixed with either `#` or `0x`. @@ -142517,7 +144742,7 @@ module.exports = RGBToString; /***/ }), -/* 806 */ +/* 812 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142532,14 +144757,14 @@ module.exports = RGBToString; module.exports = { - BitmapMask: __webpack_require__(269), - GeometryMask: __webpack_require__(270) + BitmapMask: __webpack_require__(272), + GeometryMask: __webpack_require__(273) }; /***/ }), -/* 807 */ +/* 813 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142554,13 +144779,13 @@ module.exports = { var Dom = { - AddToDOM: __webpack_require__(127), - DOMContentLoaded: __webpack_require__(353), - GetScreenOrientation: __webpack_require__(354), - GetTarget: __webpack_require__(359), - ParseXML: __webpack_require__(360), - RemoveFromDOM: __webpack_require__(187), - RequestAnimationFrame: __webpack_require__(340) + AddToDOM: __webpack_require__(128), + DOMContentLoaded: __webpack_require__(356), + GetScreenOrientation: __webpack_require__(357), + GetTarget: __webpack_require__(362), + ParseXML: __webpack_require__(363), + RemoveFromDOM: __webpack_require__(188), + RequestAnimationFrame: __webpack_require__(343) }; @@ -142568,7 +144793,7 @@ module.exports = Dom; /***/ }), -/* 808 */ +/* 814 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142581,11 +144806,11 @@ module.exports = Dom; * @namespace Phaser.Events */ -module.exports = { EventEmitter: __webpack_require__(809) }; +module.exports = { EventEmitter: __webpack_require__(815) }; /***/ }), -/* 809 */ +/* 815 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142596,7 +144821,7 @@ module.exports = { EventEmitter: __webpack_require__(809) }; var Class = __webpack_require__(0); var EE = __webpack_require__(9); -var PluginCache = __webpack_require__(17); +var PluginCache = __webpack_require__(18); /** * @classdesc @@ -142769,7 +144994,7 @@ module.exports = EventEmitter; /***/ }), -/* 810 */ +/* 816 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142778,38 +145003,38 @@ module.exports = EventEmitter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(127); -var AnimationManager = __webpack_require__(280); -var CacheManager = __webpack_require__(283); -var CanvasPool = __webpack_require__(26); +var AddToDOM = __webpack_require__(128); +var AnimationManager = __webpack_require__(283); +var CacheManager = __webpack_require__(286); +var CanvasPool = __webpack_require__(27); var Class = __webpack_require__(0); -var Config = __webpack_require__(305); -var CreateDOMContainer = __webpack_require__(811); -var CreateRenderer = __webpack_require__(328); -var DataManager = __webpack_require__(98); -var DebugHeader = __webpack_require__(338); -var Device = __webpack_require__(306); -var DOMContentLoaded = __webpack_require__(353); +var Config = __webpack_require__(308); +var CreateDOMContainer = __webpack_require__(817); +var CreateRenderer = __webpack_require__(331); +var DataManager = __webpack_require__(100); +var DebugHeader = __webpack_require__(341); +var Device = __webpack_require__(309); +var DOMContentLoaded = __webpack_require__(356); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(30); -var InputManager = __webpack_require__(361); -var PluginCache = __webpack_require__(17); -var PluginManager = __webpack_require__(366); -var ScaleManager = __webpack_require__(367); -var SceneManager = __webpack_require__(369); -var TextureEvents = __webpack_require__(126); -var TextureManager = __webpack_require__(373); -var TimeStep = __webpack_require__(339); -var VisibilityHandler = __webpack_require__(341); +var Events = __webpack_require__(22); +var InputManager = __webpack_require__(364); +var PluginCache = __webpack_require__(18); +var PluginManager = __webpack_require__(369); +var ScaleManager = __webpack_require__(370); +var SceneManager = __webpack_require__(372); +var TextureEvents = __webpack_require__(127); +var TextureManager = __webpack_require__(375); +var TimeStep = __webpack_require__(342); +var VisibilityHandler = __webpack_require__(344); if (true) { - var SoundManagerCreator = __webpack_require__(376); + var SoundManagerCreator = __webpack_require__(379); } if (true) { - var FacebookInstantGamesPlugin = __webpack_require__(384); + var FacebookInstantGamesPlugin = __webpack_require__(387); } /** @@ -143022,7 +145247,7 @@ var Game = new Class({ * You can disable the inclusion of the Sound Manager in your build by toggling the webpack `FEATURE_SOUND` flag. * * @name Phaser.Game#sound - * @type {Phaser.Sound.BaseSoundManager} + * @type {(Phaser.Sound.NoAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager)} * @since 3.0.0 */ this.sound = null; @@ -143481,7 +145706,7 @@ module.exports = Game; /***/ }), -/* 811 */ +/* 817 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143490,7 +145715,7 @@ module.exports = Game; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(127); +var AddToDOM = __webpack_require__(128); var CreateDOMContainer = function (game) { @@ -143504,7 +145729,7 @@ var CreateDOMContainer = function (game) // DOM Element Container var div = document.createElement('div'); - div.style = [ + div.style.cssText = [ 'display: block;', 'width: ' + game.scale.width + 'px;', 'height: ' + game.scale.height + 'px;', @@ -143525,7 +145750,7 @@ module.exports = CreateDOMContainer; /***/ }), -/* 812 */ +/* 818 */ /***/ (function(module, exports) { /** @@ -143546,7 +145771,7 @@ module.exports = 'boot'; /***/ }), -/* 813 */ +/* 819 */ /***/ (function(module, exports) { /** @@ -143567,7 +145792,7 @@ module.exports = 'destroy'; /***/ }), -/* 814 */ +/* 820 */ /***/ (function(module, exports) { /** @@ -143595,7 +145820,7 @@ module.exports = 'dragend'; /***/ }), -/* 815 */ +/* 821 */ /***/ (function(module, exports) { /** @@ -143626,7 +145851,7 @@ module.exports = 'dragenter'; /***/ }), -/* 816 */ +/* 822 */ /***/ (function(module, exports) { /** @@ -143658,7 +145883,7 @@ module.exports = 'drag'; /***/ }), -/* 817 */ +/* 823 */ /***/ (function(module, exports) { /** @@ -143689,7 +145914,7 @@ module.exports = 'dragleave'; /***/ }), -/* 818 */ +/* 824 */ /***/ (function(module, exports) { /** @@ -143723,7 +145948,7 @@ module.exports = 'dragover'; /***/ }), -/* 819 */ +/* 825 */ /***/ (function(module, exports) { /** @@ -143753,7 +145978,7 @@ module.exports = 'dragstart'; /***/ }), -/* 820 */ +/* 826 */ /***/ (function(module, exports) { /** @@ -143782,7 +146007,7 @@ module.exports = 'drop'; /***/ }), -/* 821 */ +/* 827 */ /***/ (function(module, exports) { /** @@ -143809,7 +146034,7 @@ module.exports = 'gameout'; /***/ }), -/* 822 */ +/* 828 */ /***/ (function(module, exports) { /** @@ -143836,7 +146061,7 @@ module.exports = 'gameover'; /***/ }), -/* 823 */ +/* 829 */ /***/ (function(module, exports) { /** @@ -143877,7 +146102,7 @@ module.exports = 'gameobjectdown'; /***/ }), -/* 824 */ +/* 830 */ /***/ (function(module, exports) { /** @@ -143908,7 +146133,7 @@ module.exports = 'dragend'; /***/ }), -/* 825 */ +/* 831 */ /***/ (function(module, exports) { /** @@ -143938,7 +146163,7 @@ module.exports = 'dragenter'; /***/ }), -/* 826 */ +/* 832 */ /***/ (function(module, exports) { /** @@ -143969,7 +146194,7 @@ module.exports = 'drag'; /***/ }), -/* 827 */ +/* 833 */ /***/ (function(module, exports) { /** @@ -143999,7 +146224,7 @@ module.exports = 'dragleave'; /***/ }), -/* 828 */ +/* 834 */ /***/ (function(module, exports) { /** @@ -144032,7 +146257,7 @@ module.exports = 'dragover'; /***/ }), -/* 829 */ +/* 835 */ /***/ (function(module, exports) { /** @@ -144066,7 +146291,7 @@ module.exports = 'dragstart'; /***/ }), -/* 830 */ +/* 836 */ /***/ (function(module, exports) { /** @@ -144096,7 +146321,7 @@ module.exports = 'drop'; /***/ }), -/* 831 */ +/* 837 */ /***/ (function(module, exports) { /** @@ -144137,7 +146362,7 @@ module.exports = 'gameobjectmove'; /***/ }), -/* 832 */ +/* 838 */ /***/ (function(module, exports) { /** @@ -144178,7 +146403,7 @@ module.exports = 'gameobjectout'; /***/ }), -/* 833 */ +/* 839 */ /***/ (function(module, exports) { /** @@ -144219,7 +146444,7 @@ module.exports = 'gameobjectover'; /***/ }), -/* 834 */ +/* 840 */ /***/ (function(module, exports) { /** @@ -144260,7 +146485,7 @@ module.exports = 'pointerdown'; /***/ }), -/* 835 */ +/* 841 */ /***/ (function(module, exports) { /** @@ -144301,7 +146526,7 @@ module.exports = 'pointermove'; /***/ }), -/* 836 */ +/* 842 */ /***/ (function(module, exports) { /** @@ -144340,7 +146565,7 @@ module.exports = 'pointerout'; /***/ }), -/* 837 */ +/* 843 */ /***/ (function(module, exports) { /** @@ -144381,7 +146606,7 @@ module.exports = 'pointerover'; /***/ }), -/* 838 */ +/* 844 */ /***/ (function(module, exports) { /** @@ -144422,7 +146647,7 @@ module.exports = 'pointerup'; /***/ }), -/* 839 */ +/* 845 */ /***/ (function(module, exports) { /** @@ -144464,7 +146689,7 @@ module.exports = 'wheel'; /***/ }), -/* 840 */ +/* 846 */ /***/ (function(module, exports) { /** @@ -144505,7 +146730,7 @@ module.exports = 'gameobjectup'; /***/ }), -/* 841 */ +/* 847 */ /***/ (function(module, exports) { /** @@ -144549,7 +146774,7 @@ module.exports = 'gameobjectwheel'; /***/ }), -/* 842 */ +/* 848 */ /***/ (function(module, exports) { /** @@ -144570,7 +146795,7 @@ module.exports = 'boot'; /***/ }), -/* 843 */ +/* 849 */ /***/ (function(module, exports) { /** @@ -144595,7 +146820,7 @@ module.exports = 'process'; /***/ }), -/* 844 */ +/* 850 */ /***/ (function(module, exports) { /** @@ -144616,7 +146841,7 @@ module.exports = 'update'; /***/ }), -/* 845 */ +/* 851 */ /***/ (function(module, exports) { /** @@ -144651,7 +146876,7 @@ module.exports = 'pointerdown'; /***/ }), -/* 846 */ +/* 852 */ /***/ (function(module, exports) { /** @@ -144685,7 +146910,7 @@ module.exports = 'pointerdownoutside'; /***/ }), -/* 847 */ +/* 853 */ /***/ (function(module, exports) { /** @@ -144720,7 +146945,7 @@ module.exports = 'pointermove'; /***/ }), -/* 848 */ +/* 854 */ /***/ (function(module, exports) { /** @@ -144755,7 +146980,7 @@ module.exports = 'pointerout'; /***/ }), -/* 849 */ +/* 855 */ /***/ (function(module, exports) { /** @@ -144790,7 +147015,7 @@ module.exports = 'pointerover'; /***/ }), -/* 850 */ +/* 856 */ /***/ (function(module, exports) { /** @@ -144825,7 +147050,7 @@ module.exports = 'pointerup'; /***/ }), -/* 851 */ +/* 857 */ /***/ (function(module, exports) { /** @@ -144859,7 +147084,7 @@ module.exports = 'pointerupoutside'; /***/ }), -/* 852 */ +/* 858 */ /***/ (function(module, exports) { /** @@ -144897,7 +147122,7 @@ module.exports = 'wheel'; /***/ }), -/* 853 */ +/* 859 */ /***/ (function(module, exports) { /** @@ -144921,7 +147146,7 @@ module.exports = 'pointerlockchange'; /***/ }), -/* 854 */ +/* 860 */ /***/ (function(module, exports) { /** @@ -144943,7 +147168,7 @@ module.exports = 'preupdate'; /***/ }), -/* 855 */ +/* 861 */ /***/ (function(module, exports) { /** @@ -144964,7 +147189,7 @@ module.exports = 'shutdown'; /***/ }), -/* 856 */ +/* 862 */ /***/ (function(module, exports) { /** @@ -144986,7 +147211,7 @@ module.exports = 'start'; /***/ }), -/* 857 */ +/* 863 */ /***/ (function(module, exports) { /** @@ -145011,7 +147236,7 @@ module.exports = 'update'; /***/ }), -/* 858 */ +/* 864 */ /***/ (function(module, exports) { /** @@ -145070,7 +147295,7 @@ module.exports = GetInnerHeight; /***/ }), -/* 859 */ +/* 865 */ /***/ (function(module, exports) { /** @@ -145100,7 +147325,7 @@ module.exports = 'addfile'; /***/ }), -/* 860 */ +/* 866 */ /***/ (function(module, exports) { /** @@ -145128,7 +147353,7 @@ module.exports = 'complete'; /***/ }), -/* 861 */ +/* 867 */ /***/ (function(module, exports) { /** @@ -145157,7 +147382,7 @@ module.exports = 'filecomplete'; /***/ }), -/* 862 */ +/* 868 */ /***/ (function(module, exports) { /** @@ -145211,7 +147436,7 @@ module.exports = 'filecomplete-'; /***/ }), -/* 863 */ +/* 869 */ /***/ (function(module, exports) { /** @@ -145236,7 +147461,7 @@ module.exports = 'loaderror'; /***/ }), -/* 864 */ +/* 870 */ /***/ (function(module, exports) { /** @@ -145262,7 +147487,7 @@ module.exports = 'load'; /***/ }), -/* 865 */ +/* 871 */ /***/ (function(module, exports) { /** @@ -145289,7 +147514,7 @@ module.exports = 'fileprogress'; /***/ }), -/* 866 */ +/* 872 */ /***/ (function(module, exports) { /** @@ -145318,7 +147543,7 @@ module.exports = 'postprocess'; /***/ }), -/* 867 */ +/* 873 */ /***/ (function(module, exports) { /** @@ -145343,7 +147568,7 @@ module.exports = 'progress'; /***/ }), -/* 868 */ +/* 874 */ /***/ (function(module, exports) { /** @@ -145370,7 +147595,7 @@ module.exports = 'start'; /***/ }), -/* 869 */ +/* 875 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145380,7 +147605,7 @@ module.exports = 'start'; */ var GetFastValue = __webpack_require__(1); -var UppercaseFirst = __webpack_require__(371); +var UppercaseFirst = __webpack_require__(191); /** * Builds an array of which physics plugins should be activated for the given Scene. @@ -145432,7 +147657,7 @@ module.exports = GetPhysicsPlugins; /***/ }), -/* 870 */ +/* 876 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145479,7 +147704,7 @@ module.exports = GetScenePlugins; /***/ }), -/* 871 */ +/* 877 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145542,629 +147767,7 @@ module.exports = InjectionMap; /***/ }), -/* 872 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Clamp = __webpack_require__(22); -var Color = __webpack_require__(36); -var IsSizePowerOfTwo = __webpack_require__(125); -var Texture = __webpack_require__(190); - -/** - * @classdesc - * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source. - * - * You can use the properties of this texture to draw to the canvas element directly, using all of the standard - * canvas operations available in the browser. Any Game Object can be given this texture and will render with it. - * - * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to - * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this - * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep - * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading - * texture data to it. This restriction does not apply if using the Canvas Renderer. - * - * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify - * sections of the canvas using the `add` method. - * - * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying - * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause - * graphical errors. - * - * @class CanvasTexture - * @extends Phaser.Textures.Texture - * @memberof Phaser.Textures - * @constructor - * @since 3.7.0 - * - * @param {Phaser.Textures.CanvasTexture} manager - A reference to the Texture Manager this Texture belongs to. - * @param {string} key - The unique string-based key of this Texture. - * @param {HTMLCanvasElement} source - The canvas element that is used as the base of this texture. - * @param {integer} width - The width of the canvas. - * @param {integer} height - The height of the canvas. - */ -var CanvasTexture = new Class({ - - Extends: Texture, - - initialize: - - function CanvasTexture (manager, key, source, width, height) - { - Texture.call(this, manager, key, source, width, height); - - this.add('__BASE', 0, 0, 0, width, height); - - /** - * A reference to the Texture Source of this Canvas. - * - * @name Phaser.Textures.CanvasTexture#_source - * @type {Phaser.Textures.TextureSource} - * @private - * @since 3.7.0 - */ - this._source = this.frames['__BASE'].source; - - /** - * The source Canvas Element. - * - * @name Phaser.Textures.CanvasTexture#canvas - * @readonly - * @type {HTMLCanvasElement} - * @since 3.7.0 - */ - this.canvas = this._source.image; - - /** - * The 2D Canvas Rendering Context. - * - * @name Phaser.Textures.CanvasTexture#context - * @readonly - * @type {CanvasRenderingContext2D} - * @since 3.7.0 - */ - this.context = this.canvas.getContext('2d'); - - /** - * The width of the Canvas. - * This property is read-only, if you wish to change it use the `setSize` method. - * - * @name Phaser.Textures.CanvasTexture#width - * @readonly - * @type {integer} - * @since 3.7.0 - */ - this.width = width; - - /** - * The height of the Canvas. - * This property is read-only, if you wish to change it use the `setSize` method. - * - * @name Phaser.Textures.CanvasTexture#height - * @readonly - * @type {integer} - * @since 3.7.0 - */ - this.height = height; - - /** - * The context image data. - * Use the `update` method to populate this when the canvas changes. - * - * @name Phaser.Textures.CanvasTexture#imageData - * @type {ImageData} - * @since 3.13.0 - */ - this.imageData = this.context.getImageData(0, 0, width, height); - - /** - * A Uint8ClampedArray view into the `buffer`. - * Use the `update` method to populate this when the canvas changes. - * Note that this is unavailable in some browsers, such as Epic Browser, due to their security restrictions. - * - * @name Phaser.Textures.CanvasTexture#data - * @type {Uint8ClampedArray} - * @since 3.13.0 - */ - this.data = null; - - if (this.imageData) - { - this.data = this.imageData.data; - } - - /** - * An Uint32Array view into the `buffer`. - * - * @name Phaser.Textures.CanvasTexture#pixels - * @type {Uint32Array} - * @since 3.13.0 - */ - this.pixels = null; - - /** - * An ArrayBuffer the same size as the context ImageData. - * - * @name Phaser.Textures.CanvasTexture#buffer - * @type {ArrayBuffer} - * @since 3.13.0 - */ - this.buffer; - - if (this.data) - { - if (this.imageData.data.buffer) - { - this.buffer = this.imageData.data.buffer; - this.pixels = new Uint32Array(this.buffer); - } - else if (window.ArrayBuffer) - { - this.buffer = new ArrayBuffer(this.imageData.data.length); - this.pixels = new Uint32Array(this.buffer); - } - else - { - this.pixels = this.imageData.data; - } - } - }, - - /** - * This re-creates the `imageData` from the current context. - * It then re-builds the ArrayBuffer, the `data` Uint8ClampedArray reference and the `pixels` Int32Array. - * - * Warning: This is a very expensive operation, so use it sparingly. - * - * @method Phaser.Textures.CanvasTexture#update - * @since 3.13.0 - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - update: function () - { - this.imageData = this.context.getImageData(0, 0, this.width, this.height); - - this.data = this.imageData.data; - - if (this.imageData.data.buffer) - { - this.buffer = this.imageData.data.buffer; - this.pixels = new Uint32Array(this.buffer); - } - else if (window.ArrayBuffer) - { - this.buffer = new ArrayBuffer(this.imageData.data.length); - this.pixels = new Uint32Array(this.buffer); - } - else - { - this.pixels = this.imageData.data; - } - - return this; - }, - - /** - * Draws the given Image or Canvas element to this CanvasTexture, then updates the internal - * ImageData buffer and arrays. - * - * @method Phaser.Textures.CanvasTexture#draw - * @since 3.13.0 - * - * @param {integer} x - The x coordinate to draw the source at. - * @param {integer} y - The y coordinate to draw the source at. - * @param {(HTMLImageElement|HTMLCanvasElement)} source - The element to draw to this canvas. - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - draw: function (x, y, source) - { - this.context.drawImage(source, x, y); - - return this.update(); - }, - - /** - * Draws the given texture frame to this CanvasTexture, then updates the internal - * ImageData buffer and arrays. - * - * @method Phaser.Textures.CanvasTexture#drawFrame - * @since 3.16.0 - * - * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. - * @param {integer} [x=0] - The x coordinate to draw the source at. - * @param {integer} [y=0] - The y coordinate to draw the source at. - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - drawFrame: function (key, frame, x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - - var textureFrame = this.manager.getFrame(key, frame); - - if (textureFrame) - { - var cd = textureFrame.canvasData; - - var width = textureFrame.cutWidth; - var height = textureFrame.cutHeight; - var res = textureFrame.source.resolution; - - this.context.drawImage( - textureFrame.source.image, - cd.x, cd.y, - width, - height, - x, y, - width / res, - height / res - ); - - return this.update(); - } - else - { - return this; - } - }, - - /** - * Sets a pixel in the CanvasTexture to the given color and alpha values. - * - * This is an expensive operation to run in large quantities, so use sparingly. - * - * @method Phaser.Textures.CanvasTexture#setPixel - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. - * - * @return {this} This CanvasTexture. - */ - setPixel: function (x, y, red, green, blue, alpha) - { - if (alpha === undefined) { alpha = 255; } - - x = Math.abs(Math.floor(x)); - y = Math.abs(Math.floor(y)); - - var index = this.getIndex(x, y); - - if (index > -1) - { - var imageData = this.context.getImageData(x, y, 1, 1); - - imageData.data[0] = red; - imageData.data[1] = green; - imageData.data[2] = blue; - imageData.data[3] = alpha; - - this.context.putImageData(imageData, x, y); - } - - return this; - }, - - /** - * Puts the ImageData into the context of this CanvasTexture at the given coordinates. - * - * @method Phaser.Textures.CanvasTexture#putData - * @since 3.16.0 - * - * @param {ImageData} imageData - The ImageData to put at the given location. - * @param {integer} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. - * @param {integer} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. - * - * @return {this} This CanvasTexture. - */ - putData: function (imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight) - { - if (dirtyX === undefined) { dirtyX = 0; } - if (dirtyY === undefined) { dirtyY = 0; } - if (dirtyWidth === undefined) { dirtyWidth = imageData.width; } - if (dirtyHeight === undefined) { dirtyHeight = imageData.height; } - - this.context.putImageData(imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight); - - return this; - }, - - /** - * Gets an ImageData region from this CanvasTexture from the position and size specified. - * You can write this back using `CanvasTexture.putData`, or manipulate it. - * - * @method Phaser.Textures.CanvasTexture#getData - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. - * @param {integer} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. - * - * @return {ImageData} The ImageData extracted from this CanvasTexture. - */ - getData: function (x, y, width, height) - { - x = Clamp(Math.floor(x), 0, this.width - 1); - y = Clamp(Math.floor(y), 0, this.height - 1); - width = Clamp(width, 1, this.width - x); - height = Clamp(height, 1, this.height - y); - - var imageData = this.context.getImageData(x, y, width, height); - - return imageData; - }, - - /** - * Get the color of a specific pixel from this texture and store it in a Color object. - * - * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, - * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. - * - * @method Phaser.Textures.CanvasTexture#getPixel - * @since 3.13.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {Phaser.Display.Color} [out] - A Color object to store the pixel values in. If not provided a new Color object will be created. - * - * @return {Phaser.Display.Color} An object with the red, green, blue and alpha values set in the r, g, b and a properties. - */ - getPixel: function (x, y, out) - { - if (!out) - { - out = new Color(); - } - - var index = this.getIndex(x, y); - - if (index > -1) - { - var data = this.data; - - var r = data[index + 0]; - var g = data[index + 1]; - var b = data[index + 2]; - var a = data[index + 3]; - - out.setTo(r, g, b, a); - } - - return out; - }, - - /** - * Returns an array containing all of the pixels in the given region. - * - * If the requested region extends outside the bounds of this CanvasTexture, - * the region is truncated to fit. - * - * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, - * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. - * - * @method Phaser.Textures.CanvasTexture#getPixels - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} width - The width of the region to get. Must be an integer. - * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. - * - * @return {Phaser.Types.Textures.PixelConfig[]} An array of Pixel objects. - */ - getPixels: function (x, y, width, height) - { - if (height === undefined) { height = width; } - - x = Math.abs(Math.round(x)); - y = Math.abs(Math.round(y)); - - var left = Clamp(x, 0, this.width); - var right = Clamp(x + width, 0, this.width); - var top = Clamp(y, 0, this.height); - var bottom = Clamp(y + height, 0, this.height); - - var pixel = new Color(); - - var out = []; - - for (var py = top; py < bottom; py++) - { - var row = []; - - for (var px = left; px < right; px++) - { - pixel = this.getPixel(px, py, pixel); - - row.push({ x: px, y: py, color: pixel.color, alpha: pixel.alphaGL }); - } - - out.push(row); - } - - return out; - }, - - /** - * Returns the Image Data index for the given pixel in this CanvasTexture. - * - * The index can be used to read directly from the `this.data` array. - * - * The index points to the red value in the array. The subsequent 3 indexes - * point to green, blue and alpha respectively. - * - * @method Phaser.Textures.CanvasTexture#getIndex - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * - * @return {integer} - */ - getIndex: function (x, y) - { - x = Math.abs(Math.round(x)); - y = Math.abs(Math.round(y)); - - if (x < this.width && y < this.height) - { - return (x + y * this.width) * 4; - } - else - { - return -1; - } - }, - - /** - * This should be called manually if you are running under WebGL. - * It will refresh the WebGLTexture from the Canvas source. Only call this if you know that the - * canvas has changed, as there is a significant GPU texture allocation cost involved in doing so. - * - * @method Phaser.Textures.CanvasTexture#refresh - * @since 3.7.0 - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - refresh: function () - { - this._source.update(); - - return this; - }, - - /** - * Gets the Canvas Element. - * - * @method Phaser.Textures.CanvasTexture#getCanvas - * @since 3.7.0 - * - * @return {HTMLCanvasElement} The Canvas DOM element this texture is using. - */ - getCanvas: function () - { - return this.canvas; - }, - - /** - * Gets the 2D Canvas Rendering Context. - * - * @method Phaser.Textures.CanvasTexture#getContext - * @since 3.7.0 - * - * @return {CanvasRenderingContext2D} The Canvas Rendering Context this texture is using. - */ - getContext: function () - { - return this.context; - }, - - /** - * Clears the given region of this Canvas Texture, resetting it back to transparent. - * If no region is given, the whole Canvas Texture is cleared. - * - * @method Phaser.Textures.CanvasTexture#clear - * @since 3.7.0 - * - * @param {integer} [x=0] - The x coordinate of the top-left of the region to clear. - * @param {integer} [y=0] - The y coordinate of the top-left of the region to clear. - * @param {integer} [width] - The width of the region. - * @param {integer} [height] - The height of the region. - * - * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. - */ - clear: function (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = this.width; } - if (height === undefined) { height = this.height; } - - this.context.clearRect(x, y, width, height); - - return this.update(); - }, - - /** - * Changes the size of this Canvas Texture. - * - * @method Phaser.Textures.CanvasTexture#setSize - * @since 3.7.0 - * - * @param {integer} width - The new width of the Canvas. - * @param {integer} [height] - The new height of the Canvas. If not given it will use the width as the height. - * - * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. - */ - setSize: function (width, height) - { - if (height === undefined) { height = width; } - - if (width !== this.width || height !== this.height) - { - // Update the Canvas - this.canvas.width = width; - this.canvas.height = height; - - // Update the Texture Source - this._source.width = width; - this._source.height = height; - this._source.isPowerOf2 = IsSizePowerOfTwo(width, height); - - // Update the Frame - this.frames['__BASE'].setSize(width, height, 0, 0); - - this.refresh(); - } - - return this; - }, - - /** - * Destroys this Texture and releases references to its sources and frames. - * - * @method Phaser.Textures.CanvasTexture#destroy - * @since 3.16.0 - */ - destroy: function () - { - Texture.prototype.destroy.call(this); - - this._source = null; - this.canvas = null; - this.context = null; - this.imageData = null; - this.data = null; - this.pixels = null; - this.buffer = null; - } - -}); - -module.exports = CanvasTexture; - - -/***/ }), -/* 873 */ +/* 878 */ /***/ (function(module, exports) { /** @@ -146245,7 +147848,7 @@ module.exports = AtlasXML; /***/ }), -/* 874 */ +/* 879 */ /***/ (function(module, exports) { /** @@ -146280,7 +147883,7 @@ module.exports = Canvas; /***/ }), -/* 875 */ +/* 880 */ /***/ (function(module, exports) { /** @@ -146315,7 +147918,7 @@ module.exports = Image; /***/ }), -/* 876 */ +/* 881 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146422,7 +148025,7 @@ module.exports = JSONArray; /***/ }), -/* 877 */ +/* 882 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146521,7 +148124,7 @@ module.exports = JSONHash; /***/ }), -/* 878 */ +/* 883 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146646,7 +148249,7 @@ module.exports = SpriteSheet; /***/ }), -/* 879 */ +/* 884 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146837,7 +148440,7 @@ module.exports = SpriteSheetFromAtlas; /***/ }), -/* 880 */ +/* 885 */ /***/ (function(module, exports) { /** @@ -147007,7 +148610,7 @@ TextureImporter: /***/ }), -/* 881 */ +/* 886 */ /***/ (function(module, exports) { /** @@ -147038,7 +148641,7 @@ module.exports = 'complete'; /***/ }), -/* 882 */ +/* 887 */ /***/ (function(module, exports) { /** @@ -147068,7 +148671,7 @@ module.exports = 'decoded'; /***/ }), -/* 883 */ +/* 888 */ /***/ (function(module, exports) { /** @@ -147100,7 +148703,7 @@ module.exports = 'decodedall'; /***/ }), -/* 884 */ +/* 889 */ /***/ (function(module, exports) { /** @@ -147132,7 +148735,7 @@ module.exports = 'destroy'; /***/ }), -/* 885 */ +/* 890 */ /***/ (function(module, exports) { /** @@ -147165,7 +148768,7 @@ module.exports = 'detune'; /***/ }), -/* 886 */ +/* 891 */ /***/ (function(module, exports) { /** @@ -147193,7 +148796,7 @@ module.exports = 'detune'; /***/ }), -/* 887 */ +/* 892 */ /***/ (function(module, exports) { /** @@ -147220,7 +148823,7 @@ module.exports = 'mute'; /***/ }), -/* 888 */ +/* 893 */ /***/ (function(module, exports) { /** @@ -147248,7 +148851,7 @@ module.exports = 'rate'; /***/ }), -/* 889 */ +/* 894 */ /***/ (function(module, exports) { /** @@ -147275,7 +148878,7 @@ module.exports = 'volume'; /***/ }), -/* 890 */ +/* 895 */ /***/ (function(module, exports) { /** @@ -147309,7 +148912,7 @@ module.exports = 'loop'; /***/ }), -/* 891 */ +/* 896 */ /***/ (function(module, exports) { /** @@ -147343,7 +148946,7 @@ module.exports = 'looped'; /***/ }), -/* 892 */ +/* 897 */ /***/ (function(module, exports) { /** @@ -147376,7 +148979,7 @@ module.exports = 'mute'; /***/ }), -/* 893 */ +/* 898 */ /***/ (function(module, exports) { /** @@ -147403,7 +149006,7 @@ module.exports = 'pauseall'; /***/ }), -/* 894 */ +/* 899 */ /***/ (function(module, exports) { /** @@ -147435,7 +149038,7 @@ module.exports = 'pause'; /***/ }), -/* 895 */ +/* 900 */ /***/ (function(module, exports) { /** @@ -147466,7 +149069,7 @@ module.exports = 'play'; /***/ }), -/* 896 */ +/* 901 */ /***/ (function(module, exports) { /** @@ -147499,7 +149102,7 @@ module.exports = 'rate'; /***/ }), -/* 897 */ +/* 902 */ /***/ (function(module, exports) { /** @@ -147526,7 +149129,7 @@ module.exports = 'resumeall'; /***/ }), -/* 898 */ +/* 903 */ /***/ (function(module, exports) { /** @@ -147559,7 +149162,7 @@ module.exports = 'resume'; /***/ }), -/* 899 */ +/* 904 */ /***/ (function(module, exports) { /** @@ -147592,7 +149195,7 @@ module.exports = 'seek'; /***/ }), -/* 900 */ +/* 905 */ /***/ (function(module, exports) { /** @@ -147619,7 +149222,7 @@ module.exports = 'stopall'; /***/ }), -/* 901 */ +/* 906 */ /***/ (function(module, exports) { /** @@ -147651,7 +149254,7 @@ module.exports = 'stop'; /***/ }), -/* 902 */ +/* 907 */ /***/ (function(module, exports) { /** @@ -147678,7 +149281,7 @@ module.exports = 'unlocked'; /***/ }), -/* 903 */ +/* 908 */ /***/ (function(module, exports) { /** @@ -147711,7 +149314,7 @@ module.exports = 'volume'; /***/ }), -/* 904 */ +/* 909 */ /***/ (function(module, exports) { /** @@ -147743,7 +149346,7 @@ module.exports = AdInstance; /***/ }), -/* 905 */ +/* 910 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147754,7 +149357,7 @@ module.exports = AdInstance; var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(9); -var LeaderboardScore = __webpack_require__(906); +var LeaderboardScore = __webpack_require__(911); /** * @classdesc @@ -148062,7 +149665,7 @@ module.exports = Leaderboard; /***/ }), -/* 906 */ +/* 911 */ /***/ (function(module, exports) { /** @@ -148102,7 +149705,7 @@ module.exports = LeaderboardScore; /***/ }), -/* 907 */ +/* 912 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148140,7 +149743,7 @@ module.exports = Product; /***/ }), -/* 908 */ +/* 913 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148178,7 +149781,7 @@ module.exports = Purchase; /***/ }), -/* 909 */ +/* 914 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148193,99 +149796,99 @@ module.exports = Purchase; var GameObjects = { - Events: __webpack_require__(118), + Events: __webpack_require__(119), - DisplayList: __webpack_require__(910), - GameObjectCreator: __webpack_require__(15), + DisplayList: __webpack_require__(915), + GameObjectCreator: __webpack_require__(16), GameObjectFactory: __webpack_require__(6), - UpdateList: __webpack_require__(938), + UpdateList: __webpack_require__(943), Components: __webpack_require__(12), - BuildGameObject: __webpack_require__(31), - BuildGameObjectAnimation: __webpack_require__(388), + BuildGameObject: __webpack_require__(30), + BuildGameObjectAnimation: __webpack_require__(391), GameObject: __webpack_require__(13), - BitmapText: __webpack_require__(136), - Blitter: __webpack_require__(195), - Container: __webpack_require__(196), - DOMElement: __webpack_require__(390), - DynamicBitmapText: __webpack_require__(197), - Extern: __webpack_require__(392), - Graphics: __webpack_require__(198), - Group: __webpack_require__(104), - Image: __webpack_require__(87), - Particles: __webpack_require__(967), - PathFollower: __webpack_require__(404), - RenderTexture: __webpack_require__(202), - RetroFont: __webpack_require__(976), - Sprite: __webpack_require__(63), - Text: __webpack_require__(203), - TileSprite: __webpack_require__(204), - Zone: __webpack_require__(114), + BitmapText: __webpack_require__(137), + Blitter: __webpack_require__(197), + Container: __webpack_require__(198), + DOMElement: __webpack_require__(393), + DynamicBitmapText: __webpack_require__(199), + Extern: __webpack_require__(395), + Graphics: __webpack_require__(200), + Group: __webpack_require__(106), + Image: __webpack_require__(88), + Particles: __webpack_require__(972), + PathFollower: __webpack_require__(407), + RenderTexture: __webpack_require__(204), + RetroFont: __webpack_require__(981), + Sprite: __webpack_require__(64), + Text: __webpack_require__(205), + TileSprite: __webpack_require__(206), + Zone: __webpack_require__(115), // Shapes - Shape: __webpack_require__(33), - Arc: __webpack_require__(406), - Curve: __webpack_require__(407), - Ellipse: __webpack_require__(408), - Grid: __webpack_require__(409), - IsoBox: __webpack_require__(410), - IsoTriangle: __webpack_require__(411), - Line: __webpack_require__(412), - Polygon: __webpack_require__(413), - Rectangle: __webpack_require__(418), - Star: __webpack_require__(419), - Triangle: __webpack_require__(420), + Shape: __webpack_require__(32), + Arc: __webpack_require__(409), + Curve: __webpack_require__(410), + Ellipse: __webpack_require__(411), + Grid: __webpack_require__(412), + IsoBox: __webpack_require__(413), + IsoTriangle: __webpack_require__(414), + Line: __webpack_require__(415), + Polygon: __webpack_require__(416), + Rectangle: __webpack_require__(421), + Star: __webpack_require__(422), + Triangle: __webpack_require__(423), // Game Object Factories Factories: { - Blitter: __webpack_require__(1021), - Container: __webpack_require__(1022), - DOMElement: __webpack_require__(1023), - DynamicBitmapText: __webpack_require__(1024), - Extern: __webpack_require__(1025), - Graphics: __webpack_require__(1026), - Group: __webpack_require__(1027), - Image: __webpack_require__(1028), - Particles: __webpack_require__(1029), - PathFollower: __webpack_require__(1030), - RenderTexture: __webpack_require__(1031), - Sprite: __webpack_require__(1032), - StaticBitmapText: __webpack_require__(1033), - Text: __webpack_require__(1034), - TileSprite: __webpack_require__(1035), - Zone: __webpack_require__(1036), + Blitter: __webpack_require__(1026), + Container: __webpack_require__(1027), + DOMElement: __webpack_require__(1028), + DynamicBitmapText: __webpack_require__(1029), + Extern: __webpack_require__(1030), + Graphics: __webpack_require__(1031), + Group: __webpack_require__(1032), + Image: __webpack_require__(1033), + Particles: __webpack_require__(1034), + PathFollower: __webpack_require__(1035), + RenderTexture: __webpack_require__(1036), + Sprite: __webpack_require__(1037), + StaticBitmapText: __webpack_require__(1038), + Text: __webpack_require__(1039), + TileSprite: __webpack_require__(1040), + Zone: __webpack_require__(1041), // Shapes - Arc: __webpack_require__(1037), - Curve: __webpack_require__(1038), - Ellipse: __webpack_require__(1039), - Grid: __webpack_require__(1040), - IsoBox: __webpack_require__(1041), - IsoTriangle: __webpack_require__(1042), - Line: __webpack_require__(1043), - Polygon: __webpack_require__(1044), - Rectangle: __webpack_require__(1045), - Star: __webpack_require__(1046), - Triangle: __webpack_require__(1047) + Arc: __webpack_require__(1042), + Curve: __webpack_require__(1043), + Ellipse: __webpack_require__(1044), + Grid: __webpack_require__(1045), + IsoBox: __webpack_require__(1046), + IsoTriangle: __webpack_require__(1047), + Line: __webpack_require__(1048), + Polygon: __webpack_require__(1049), + Rectangle: __webpack_require__(1050), + Star: __webpack_require__(1051), + Triangle: __webpack_require__(1052) }, Creators: { - Blitter: __webpack_require__(1048), - Container: __webpack_require__(1049), - DynamicBitmapText: __webpack_require__(1050), - Graphics: __webpack_require__(1051), - Group: __webpack_require__(1052), - Image: __webpack_require__(1053), - Particles: __webpack_require__(1054), - RenderTexture: __webpack_require__(1055), - Sprite: __webpack_require__(1056), - StaticBitmapText: __webpack_require__(1057), - Text: __webpack_require__(1058), - TileSprite: __webpack_require__(1059), - Zone: __webpack_require__(1060) + Blitter: __webpack_require__(1053), + Container: __webpack_require__(1054), + DynamicBitmapText: __webpack_require__(1055), + Graphics: __webpack_require__(1056), + Group: __webpack_require__(1057), + Image: __webpack_require__(1058), + Particles: __webpack_require__(1059), + RenderTexture: __webpack_require__(1060), + Sprite: __webpack_require__(1061), + StaticBitmapText: __webpack_require__(1062), + Text: __webpack_require__(1063), + TileSprite: __webpack_require__(1064), + Zone: __webpack_require__(1065) } }; @@ -148293,29 +149896,29 @@ var GameObjects = { if (true) { // WebGL only Game Objects - GameObjects.Mesh = __webpack_require__(137); - GameObjects.Quad = __webpack_require__(207); - GameObjects.Shader = __webpack_require__(208); + GameObjects.Mesh = __webpack_require__(138); + GameObjects.Quad = __webpack_require__(209); + GameObjects.Shader = __webpack_require__(210); - GameObjects.Factories.Mesh = __webpack_require__(1067); - GameObjects.Factories.Quad = __webpack_require__(1068); - GameObjects.Factories.Shader = __webpack_require__(1069); + GameObjects.Factories.Mesh = __webpack_require__(1072); + GameObjects.Factories.Quad = __webpack_require__(1073); + GameObjects.Factories.Shader = __webpack_require__(1074); - GameObjects.Creators.Mesh = __webpack_require__(1070); - GameObjects.Creators.Quad = __webpack_require__(1071); - GameObjects.Creators.Shader = __webpack_require__(1072); + GameObjects.Creators.Mesh = __webpack_require__(1075); + GameObjects.Creators.Quad = __webpack_require__(1076); + GameObjects.Creators.Shader = __webpack_require__(1077); - GameObjects.Light = __webpack_require__(424); + GameObjects.Light = __webpack_require__(427); - __webpack_require__(425); - __webpack_require__(1073); + __webpack_require__(428); + __webpack_require__(1078); } module.exports = GameObjects; /***/ }), -/* 910 */ +/* 915 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148325,10 +149928,10 @@ module.exports = GameObjects; */ var Class = __webpack_require__(0); -var List = __webpack_require__(133); -var PluginCache = __webpack_require__(17); -var SceneEvents = __webpack_require__(18); -var StableSort = __webpack_require__(135); +var List = __webpack_require__(134); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var StableSort = __webpack_require__(136); /** * @classdesc @@ -148520,7 +150123,7 @@ module.exports = DisplayList; /***/ }), -/* 911 */ +/* 916 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148535,21 +150138,21 @@ module.exports = DisplayList; module.exports = { - CheckMatrix: __webpack_require__(192), - MatrixToString: __webpack_require__(912), - ReverseColumns: __webpack_require__(913), - ReverseRows: __webpack_require__(914), - Rotate180: __webpack_require__(915), - RotateLeft: __webpack_require__(916), - RotateMatrix: __webpack_require__(134), - RotateRight: __webpack_require__(917), - TransposeMatrix: __webpack_require__(385) + CheckMatrix: __webpack_require__(194), + MatrixToString: __webpack_require__(917), + ReverseColumns: __webpack_require__(918), + ReverseRows: __webpack_require__(919), + Rotate180: __webpack_require__(920), + RotateLeft: __webpack_require__(921), + RotateMatrix: __webpack_require__(135), + RotateRight: __webpack_require__(922), + TransposeMatrix: __webpack_require__(388) }; /***/ }), -/* 912 */ +/* 917 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148558,8 +150161,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pad = __webpack_require__(169); -var CheckMatrix = __webpack_require__(192); +var Pad = __webpack_require__(170); +var CheckMatrix = __webpack_require__(194); /** * Generates a string (which you can pass to console.log) from the given Array Matrix. @@ -148630,7 +150233,7 @@ module.exports = MatrixToString; /***/ }), -/* 913 */ +/* 918 */ /***/ (function(module, exports) { /** @@ -148661,7 +150264,7 @@ module.exports = ReverseColumns; /***/ }), -/* 914 */ +/* 919 */ /***/ (function(module, exports) { /** @@ -148697,7 +150300,7 @@ module.exports = ReverseRows; /***/ }), -/* 915 */ +/* 920 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148706,7 +150309,7 @@ module.exports = ReverseRows; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(134); +var RotateMatrix = __webpack_require__(135); /** * Rotates the array matrix 180 degrees. @@ -148730,7 +150333,7 @@ module.exports = Rotate180; /***/ }), -/* 916 */ +/* 921 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148739,7 +150342,7 @@ module.exports = Rotate180; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(134); +var RotateMatrix = __webpack_require__(135); /** * Rotates the array matrix to the left (or 90 degrees) @@ -148763,7 +150366,7 @@ module.exports = RotateLeft; /***/ }), -/* 917 */ +/* 922 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148772,7 +150375,7 @@ module.exports = RotateLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(134); +var RotateMatrix = __webpack_require__(135); /** * Rotates the array matrix to the left (or -90 degrees) @@ -148796,7 +150399,7 @@ module.exports = RotateRight; /***/ }), -/* 918 */ +/* 923 */ /***/ (function(module, exports) { /** @@ -148913,7 +150516,7 @@ module.exports = Add; /***/ }), -/* 919 */ +/* 924 */ /***/ (function(module, exports) { /** @@ -149035,7 +150638,7 @@ module.exports = AddAt; /***/ }), -/* 920 */ +/* 925 */ /***/ (function(module, exports) { /** @@ -149073,7 +150676,7 @@ module.exports = BringToTop; /***/ }), -/* 921 */ +/* 926 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149125,7 +150728,7 @@ module.exports = CountAllMatching; /***/ }), -/* 922 */ +/* 927 */ /***/ (function(module, exports) { /** @@ -149171,7 +150774,7 @@ module.exports = Each; /***/ }), -/* 923 */ +/* 928 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149227,7 +150830,7 @@ module.exports = EachInRange; /***/ }), -/* 924 */ +/* 929 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149289,7 +150892,7 @@ module.exports = GetAll; /***/ }), -/* 925 */ +/* 930 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149348,7 +150951,7 @@ module.exports = GetFirst; /***/ }), -/* 926 */ +/* 931 */ /***/ (function(module, exports) { /** @@ -149390,7 +150993,7 @@ module.exports = MoveDown; /***/ }), -/* 927 */ +/* 932 */ /***/ (function(module, exports) { /** @@ -149437,7 +151040,7 @@ module.exports = MoveTo; /***/ }), -/* 928 */ +/* 933 */ /***/ (function(module, exports) { /** @@ -149479,7 +151082,7 @@ module.exports = MoveUp; /***/ }), -/* 929 */ +/* 934 */ /***/ (function(module, exports) { /** @@ -149543,7 +151146,7 @@ module.exports = NumberArray; /***/ }), -/* 930 */ +/* 935 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149552,7 +151155,7 @@ module.exports = NumberArray; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RoundAwayFromZero = __webpack_require__(322); +var RoundAwayFromZero = __webpack_require__(325); /** * Create an array of numbers (positive and/or negative) progressing from `start` @@ -149620,7 +151223,7 @@ module.exports = NumberArrayStep; /***/ }), -/* 931 */ +/* 936 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149671,7 +151274,7 @@ module.exports = RemoveAt; /***/ }), -/* 932 */ +/* 937 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149734,7 +151337,7 @@ module.exports = RemoveBetween; /***/ }), -/* 933 */ +/* 938 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149772,7 +151375,7 @@ module.exports = RemoveRandomElement; /***/ }), -/* 934 */ +/* 939 */ /***/ (function(module, exports) { /** @@ -149815,7 +151418,7 @@ module.exports = Replace; /***/ }), -/* 935 */ +/* 940 */ /***/ (function(module, exports) { /** @@ -149853,7 +151456,7 @@ module.exports = SendToBack; /***/ }), -/* 936 */ +/* 941 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149908,7 +151511,7 @@ module.exports = SetAll; /***/ }), -/* 937 */ +/* 942 */ /***/ (function(module, exports) { /** @@ -149956,7 +151559,7 @@ module.exports = Swap; /***/ }), -/* 938 */ +/* 943 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149966,8 +151569,8 @@ module.exports = Swap; */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(17); -var SceneEvents = __webpack_require__(18); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); /** * @classdesc @@ -150154,9 +151757,12 @@ var UpdateList = new Class({ */ update: function (time, delta) { - for (var i = 0; i < this._list.length; i++) + var list = this._list; + var length = list.length; + + for (var i = 0; i < length; i++) { - var gameObject = this._list[i]; + var gameObject = list[i]; if (gameObject.active) { @@ -150177,9 +151783,7 @@ var UpdateList = new Class({ */ remove: function (child) { - var index = this._pendingRemoval.indexOf(child); - - if (index !== -1) + if (this._list.indexOf(child) !== -1 && this._pendingRemoval.indexOf(child) === -1) { this._pendingRemoval.push(child); } @@ -150290,7 +151894,7 @@ module.exports = UpdateList; /***/ }), -/* 939 */ +/* 944 */ /***/ (function(module, exports) { /** @@ -150503,7 +152107,7 @@ module.exports = GetBitmapTextSize; /***/ }), -/* 940 */ +/* 945 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150512,7 +152116,7 @@ module.exports = GetBitmapTextSize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ParseXMLBitmapFont = __webpack_require__(194); +var ParseXMLBitmapFont = __webpack_require__(196); /** * Parse an XML Bitmap Font from an Atlas. @@ -150556,7 +152160,7 @@ module.exports = ParseFromAtlas; /***/ }), -/* 941 */ +/* 946 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150570,12 +152174,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(942); + renderWebGL = __webpack_require__(947); } if (true) { - renderCanvas = __webpack_require__(943); + renderCanvas = __webpack_require__(948); } module.exports = { @@ -150587,7 +152191,7 @@ module.exports = { /***/ }), -/* 942 */ +/* 947 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150816,7 +152420,7 @@ module.exports = BitmapTextWebGLRenderer; /***/ }), -/* 943 */ +/* 948 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150825,7 +152429,7 @@ module.exports = BitmapTextWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTransform = __webpack_require__(27); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -150991,7 +152595,7 @@ module.exports = BitmapTextCanvasRenderer; /***/ }), -/* 944 */ +/* 949 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151005,12 +152609,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(945); + renderWebGL = __webpack_require__(950); } if (true) { - renderCanvas = __webpack_require__(946); + renderCanvas = __webpack_require__(951); } module.exports = { @@ -151022,7 +152626,7 @@ module.exports = { /***/ }), -/* 945 */ +/* 950 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151152,7 +152756,7 @@ module.exports = BlitterWebGLRenderer; /***/ }), -/* 946 */ +/* 951 */ /***/ (function(module, exports) { /** @@ -151280,7 +152884,7 @@ module.exports = BlitterCanvasRenderer; /***/ }), -/* 947 */ +/* 952 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151290,7 +152894,7 @@ module.exports = BlitterCanvasRenderer; */ var Class = __webpack_require__(0); -var Frame = __webpack_require__(101); +var Frame = __webpack_require__(103); /** * @classdesc @@ -151664,7 +153268,7 @@ module.exports = Bob; /***/ }), -/* 948 */ +/* 953 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151679,12 +153283,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(949); + renderWebGL = __webpack_require__(954); } if (true) { - renderCanvas = __webpack_require__(950); + renderCanvas = __webpack_require__(955); } module.exports = { @@ -151696,7 +153300,7 @@ module.exports = { /***/ }), -/* 949 */ +/* 954 */ /***/ (function(module, exports) { /** @@ -151766,7 +153370,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent continue; } - var childAlpha = child._alpha; + var childAlpha = child.alpha; var childScrollFactorX = child.scrollFactorX; var childScrollFactorY = child.scrollFactorY; @@ -151803,7 +153407,7 @@ module.exports = ContainerWebGLRenderer; /***/ }), -/* 950 */ +/* 955 */ /***/ (function(module, exports) { /** @@ -151873,7 +153477,7 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen continue; } - var childAlpha = child._alpha; + var childAlpha = child.alpha; var childBlendMode = child._blendMode; var childScrollFactorX = child.scrollFactorX; var childScrollFactorY = child.scrollFactorY; @@ -151901,7 +153505,7 @@ module.exports = ContainerCanvasRenderer; /***/ }), -/* 951 */ +/* 956 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151915,12 +153519,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(391); + renderWebGL = __webpack_require__(394); } if (true) { - renderCanvas = __webpack_require__(391); + renderCanvas = __webpack_require__(394); } module.exports = { @@ -151932,7 +153536,7 @@ module.exports = { /***/ }), -/* 952 */ +/* 957 */ /***/ (function(module, exports) { /** @@ -151973,7 +153577,7 @@ module.exports = [ /***/ }), -/* 953 */ +/* 958 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151987,12 +153591,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(954); + renderWebGL = __webpack_require__(959); } if (true) { - renderCanvas = __webpack_require__(955); + renderCanvas = __webpack_require__(960); } module.exports = { @@ -152004,7 +153608,7 @@ module.exports = { /***/ }), -/* 954 */ +/* 959 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152310,7 +153914,7 @@ module.exports = DynamicBitmapTextWebGLRenderer; /***/ }), -/* 955 */ +/* 960 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152319,7 +153923,7 @@ module.exports = DynamicBitmapTextWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTransform = __webpack_require__(27); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -152489,7 +154093,7 @@ module.exports = DynamicBitmapTextCanvasRenderer; /***/ }), -/* 956 */ +/* 961 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152503,12 +154107,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(957); + renderWebGL = __webpack_require__(962); } if (true) { - renderCanvas = __webpack_require__(958); + renderCanvas = __webpack_require__(963); } module.exports = { @@ -152520,7 +154124,7 @@ module.exports = { /***/ }), -/* 957 */ +/* 962 */ /***/ (function(module, exports) { /** @@ -152589,13 +154193,13 @@ module.exports = ExternWebGLRenderer; /***/ }), -/* 958 */ +/* 963 */ /***/ (function(module, exports) { /***/ }), -/* 959 */ +/* 964 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152609,15 +154213,15 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(960); + renderWebGL = __webpack_require__(965); // Needed for Graphics.generateTexture - renderCanvas = __webpack_require__(396); + renderCanvas = __webpack_require__(399); } if (true) { - renderCanvas = __webpack_require__(396); + renderCanvas = __webpack_require__(399); } module.exports = { @@ -152629,7 +154233,7 @@ module.exports = { /***/ }), -/* 960 */ +/* 965 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152638,7 +154242,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Commands = __webpack_require__(199); +var Commands = __webpack_require__(201); var Utils = __webpack_require__(10); // TODO: Remove the use of this @@ -152994,7 +154598,7 @@ module.exports = GraphicsWebGLRenderer; /***/ }), -/* 961 */ +/* 966 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153008,12 +154612,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(962); + renderWebGL = __webpack_require__(967); } if (true) { - renderCanvas = __webpack_require__(963); + renderCanvas = __webpack_require__(968); } module.exports = { @@ -153025,7 +154629,7 @@ module.exports = { /***/ }), -/* 962 */ +/* 967 */ /***/ (function(module, exports) { /** @@ -153058,7 +154662,7 @@ module.exports = SpriteWebGLRenderer; /***/ }), -/* 963 */ +/* 968 */ /***/ (function(module, exports) { /** @@ -153091,7 +154695,7 @@ module.exports = SpriteCanvasRenderer; /***/ }), -/* 964 */ +/* 969 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153105,12 +154709,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(965); + renderWebGL = __webpack_require__(970); } if (true) { - renderCanvas = __webpack_require__(966); + renderCanvas = __webpack_require__(971); } module.exports = { @@ -153122,7 +154726,7 @@ module.exports = { /***/ }), -/* 965 */ +/* 970 */ /***/ (function(module, exports) { /** @@ -153155,7 +154759,7 @@ module.exports = ImageWebGLRenderer; /***/ }), -/* 966 */ +/* 971 */ /***/ (function(module, exports) { /** @@ -153188,7 +154792,7 @@ module.exports = ImageCanvasRenderer; /***/ }), -/* 967 */ +/* 972 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153203,17 +154807,17 @@ module.exports = ImageCanvasRenderer; module.exports = { - GravityWell: __webpack_require__(397), - Particle: __webpack_require__(398), - ParticleEmitter: __webpack_require__(399), - ParticleEmitterManager: __webpack_require__(201), - Zones: __webpack_require__(972) + GravityWell: __webpack_require__(400), + Particle: __webpack_require__(401), + ParticleEmitter: __webpack_require__(402), + ParticleEmitterManager: __webpack_require__(203), + Zones: __webpack_require__(977) }; /***/ }), -/* 968 */ +/* 973 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153223,10 +154827,10 @@ module.exports = { */ var Class = __webpack_require__(0); -var FloatBetween = __webpack_require__(320); -var GetEaseFunction = __webpack_require__(106); +var FloatBetween = __webpack_require__(323); +var GetEaseFunction = __webpack_require__(89); var GetFastValue = __webpack_require__(1); -var Wrap = __webpack_require__(61); +var Wrap = __webpack_require__(62); /** * @classdesc @@ -153804,7 +155408,7 @@ module.exports = EmitterOp; /***/ }), -/* 969 */ +/* 974 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153818,12 +155422,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(970); + renderWebGL = __webpack_require__(975); } if (true) { - renderCanvas = __webpack_require__(971); + renderCanvas = __webpack_require__(976); } module.exports = { @@ -153835,7 +155439,7 @@ module.exports = { /***/ }), -/* 970 */ +/* 975 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153994,7 +155598,7 @@ module.exports = ParticleManagerWebGLRenderer; /***/ }), -/* 971 */ +/* 976 */ /***/ (function(module, exports) { /** @@ -154115,7 +155719,7 @@ module.exports = ParticleManagerCanvasRenderer; /***/ }), -/* 972 */ +/* 977 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154130,15 +155734,15 @@ module.exports = ParticleManagerCanvasRenderer; module.exports = { - DeathZone: __webpack_require__(400), - EdgeZone: __webpack_require__(401), - RandomZone: __webpack_require__(403) + DeathZone: __webpack_require__(403), + EdgeZone: __webpack_require__(404), + RandomZone: __webpack_require__(406) }; /***/ }), -/* 973 */ +/* 978 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154152,12 +155756,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(974); + renderWebGL = __webpack_require__(979); } if (true) { - renderCanvas = __webpack_require__(975); + renderCanvas = __webpack_require__(980); } module.exports = { @@ -154169,7 +155773,7 @@ module.exports = { /***/ }), -/* 974 */ +/* 979 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154232,7 +155836,7 @@ module.exports = RenderTextureWebGLRenderer; /***/ }), -/* 975 */ +/* 980 */ /***/ (function(module, exports) { /** @@ -154265,7 +155869,7 @@ module.exports = RenderTextureCanvasRenderer; /***/ }), -/* 976 */ +/* 981 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154274,15 +155878,15 @@ module.exports = RenderTextureCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RETRO_FONT_CONST = __webpack_require__(977); -var Extend = __webpack_require__(20); +var RETRO_FONT_CONST = __webpack_require__(982); +var Extend = __webpack_require__(15); /** * @namespace Phaser.GameObjects.RetroFont * @since 3.6.0 */ -var RetroFont = { Parse: __webpack_require__(978) }; +var RetroFont = { Parse: __webpack_require__(983) }; // Merge in the consts RetroFont = Extend(false, RetroFont, RETRO_FONT_CONST); @@ -154291,7 +155895,7 @@ module.exports = RetroFont; /***/ }), -/* 977 */ +/* 982 */ /***/ (function(module, exports) { /** @@ -154407,7 +156011,7 @@ module.exports = RETRO_FONT_CONST; /***/ }), -/* 978 */ +/* 983 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154523,7 +156127,7 @@ module.exports = ParseRetroFont; /***/ }), -/* 979 */ +/* 984 */ /***/ (function(module, exports) { /** @@ -154605,7 +156209,7 @@ module.exports = GetTextSize; /***/ }), -/* 980 */ +/* 985 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154619,12 +156223,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(981); + renderWebGL = __webpack_require__(986); } if (true) { - renderCanvas = __webpack_require__(982); + renderCanvas = __webpack_require__(987); } module.exports = { @@ -154636,7 +156240,7 @@ module.exports = { /***/ }), -/* 981 */ +/* 986 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154701,7 +156305,7 @@ module.exports = TextWebGLRenderer; /***/ }), -/* 982 */ +/* 987 */ /***/ (function(module, exports) { /** @@ -154739,7 +156343,7 @@ module.exports = TextCanvasRenderer; /***/ }), -/* 983 */ +/* 988 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154751,7 +156355,7 @@ module.exports = TextCanvasRenderer; var Class = __webpack_require__(0); var GetAdvancedValue = __webpack_require__(14); var GetValue = __webpack_require__(5); -var MeasureText = __webpack_require__(984); +var MeasureText = __webpack_require__(989); // Key: [ Object Key, Default Value ] @@ -154798,7 +156402,7 @@ var propertyMap = { * @since 3.0.0 * * @param {Phaser.GameObjects.Text} text - The Text object that this TextStyle is styling. - * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The style settings to set. + * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The style settings to set. */ var TextStyle = new Class({ @@ -155084,7 +156688,7 @@ var TextStyle = new Class({ * @method Phaser.GameObjects.TextStyle#setStyle * @since 3.0.0 * - * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The style settings to set. + * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The style settings to set. * @param {boolean} [updateText=true] - Whether to update the text immediately. * @param {boolean} [setDefaults=false] - Use the default values is not set, or the local values. * @@ -155792,7 +157396,7 @@ module.exports = TextStyle; /***/ }), -/* 984 */ +/* 989 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155801,7 +157405,7 @@ module.exports = TextStyle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(27); /** * Calculates the ascent, descent and fontSize of a given font style. @@ -155927,7 +157531,7 @@ module.exports = MeasureText; /***/ }), -/* 985 */ +/* 990 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155941,12 +157545,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(986); + renderWebGL = __webpack_require__(991); } if (true) { - renderCanvas = __webpack_require__(987); + renderCanvas = __webpack_require__(992); } module.exports = { @@ -155958,7 +157562,7 @@ module.exports = { /***/ }), -/* 986 */ +/* 991 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156018,7 +157622,7 @@ module.exports = TileSpriteWebGLRenderer; /***/ }), -/* 987 */ +/* 992 */ /***/ (function(module, exports) { /** @@ -156053,7 +157657,7 @@ module.exports = TileSpriteCanvasRenderer; /***/ }), -/* 988 */ +/* 993 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156067,12 +157671,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(989); + renderWebGL = __webpack_require__(994); } if (true) { - renderCanvas = __webpack_require__(990); + renderCanvas = __webpack_require__(995); } module.exports = { @@ -156084,7 +157688,7 @@ module.exports = { /***/ }), -/* 989 */ +/* 994 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156093,7 +157697,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(107); +var FillPathWebGL = __webpack_require__(108); var StrokePathWebGL = __webpack_require__(73); /** @@ -156162,7 +157766,7 @@ module.exports = ArcWebGLRenderer; /***/ }), -/* 990 */ +/* 995 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156173,8 +157777,8 @@ module.exports = ArcWebGLRenderer; var DegToRad = __webpack_require__(40); var FillStyleCanvas = __webpack_require__(41); -var LineStyleCanvas = __webpack_require__(55); -var SetTransform = __webpack_require__(27); +var LineStyleCanvas = __webpack_require__(56); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -156238,7 +157842,7 @@ module.exports = ArcCanvasRenderer; /***/ }), -/* 991 */ +/* 996 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156252,12 +157856,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(992); + renderWebGL = __webpack_require__(997); } if (true) { - renderCanvas = __webpack_require__(993); + renderCanvas = __webpack_require__(998); } module.exports = { @@ -156269,7 +157873,7 @@ module.exports = { /***/ }), -/* 992 */ +/* 997 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156278,7 +157882,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(107); +var FillPathWebGL = __webpack_require__(108); var StrokePathWebGL = __webpack_require__(73); /** @@ -156347,7 +157951,7 @@ module.exports = CurveWebGLRenderer; /***/ }), -/* 993 */ +/* 998 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156357,8 +157961,8 @@ module.exports = CurveWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(41); -var LineStyleCanvas = __webpack_require__(55); -var SetTransform = __webpack_require__(27); +var LineStyleCanvas = __webpack_require__(56); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -156435,7 +158039,7 @@ module.exports = CurveCanvasRenderer; /***/ }), -/* 994 */ +/* 999 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156449,12 +158053,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(995); + renderWebGL = __webpack_require__(1000); } if (true) { - renderCanvas = __webpack_require__(996); + renderCanvas = __webpack_require__(1001); } module.exports = { @@ -156466,7 +158070,7 @@ module.exports = { /***/ }), -/* 995 */ +/* 1000 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156475,7 +158079,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(107); +var FillPathWebGL = __webpack_require__(108); var StrokePathWebGL = __webpack_require__(73); /** @@ -156544,7 +158148,7 @@ module.exports = EllipseWebGLRenderer; /***/ }), -/* 996 */ +/* 1001 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156554,8 +158158,8 @@ module.exports = EllipseWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(41); -var LineStyleCanvas = __webpack_require__(55); -var SetTransform = __webpack_require__(27); +var LineStyleCanvas = __webpack_require__(56); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -156629,7 +158233,7 @@ module.exports = EllipseCanvasRenderer; /***/ }), -/* 997 */ +/* 1002 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156643,12 +158247,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(998); + renderWebGL = __webpack_require__(1003); } if (true) { - renderCanvas = __webpack_require__(999); + renderCanvas = __webpack_require__(1004); } module.exports = { @@ -156660,7 +158264,7 @@ module.exports = { /***/ }), -/* 998 */ +/* 1003 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156886,7 +158490,7 @@ module.exports = GridWebGLRenderer; /***/ }), -/* 999 */ +/* 1004 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156896,8 +158500,8 @@ module.exports = GridWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(41); -var LineStyleCanvas = __webpack_require__(55); -var SetTransform = __webpack_require__(27); +var LineStyleCanvas = __webpack_require__(56); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -157075,7 +158679,7 @@ module.exports = GridCanvasRenderer; /***/ }), -/* 1000 */ +/* 1005 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157089,12 +158693,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(1001); + renderWebGL = __webpack_require__(1006); } if (true) { - renderCanvas = __webpack_require__(1002); + renderCanvas = __webpack_require__(1007); } module.exports = { @@ -157106,7 +158710,7 @@ module.exports = { /***/ }), -/* 1001 */ +/* 1006 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157264,7 +158868,7 @@ module.exports = IsoBoxWebGLRenderer; /***/ }), -/* 1002 */ +/* 1007 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157274,7 +158878,7 @@ module.exports = IsoBoxWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(41); -var SetTransform = __webpack_require__(27); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -157365,7 +158969,7 @@ module.exports = IsoBoxCanvasRenderer; /***/ }), -/* 1003 */ +/* 1008 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157379,12 +158983,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(1004); + renderWebGL = __webpack_require__(1009); } if (true) { - renderCanvas = __webpack_require__(1005); + renderCanvas = __webpack_require__(1010); } module.exports = { @@ -157396,7 +159000,7 @@ module.exports = { /***/ }), -/* 1004 */ +/* 1009 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157573,7 +159177,7 @@ module.exports = IsoTriangleWebGLRenderer; /***/ }), -/* 1005 */ +/* 1010 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157583,7 +159187,7 @@ module.exports = IsoTriangleWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(41); -var SetTransform = __webpack_require__(27); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -157687,7 +159291,7 @@ module.exports = IsoTriangleCanvasRenderer; /***/ }), -/* 1006 */ +/* 1011 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157701,12 +159305,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(1007); + renderWebGL = __webpack_require__(1012); } if (true) { - renderCanvas = __webpack_require__(1008); + renderCanvas = __webpack_require__(1013); } module.exports = { @@ -157718,7 +159322,7 @@ module.exports = { /***/ }), -/* 1007 */ +/* 1012 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157811,7 +159415,7 @@ module.exports = LineWebGLRenderer; /***/ }), -/* 1008 */ +/* 1013 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157820,8 +159424,8 @@ module.exports = LineWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineStyleCanvas = __webpack_require__(55); -var SetTransform = __webpack_require__(27); +var LineStyleCanvas = __webpack_require__(56); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -157868,7 +159472,7 @@ module.exports = LineCanvasRenderer; /***/ }), -/* 1009 */ +/* 1014 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157882,12 +159486,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(1010); + renderWebGL = __webpack_require__(1015); } if (true) { - renderCanvas = __webpack_require__(1011); + renderCanvas = __webpack_require__(1016); } module.exports = { @@ -157899,7 +159503,7 @@ module.exports = { /***/ }), -/* 1010 */ +/* 1015 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157908,7 +159512,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(107); +var FillPathWebGL = __webpack_require__(108); var StrokePathWebGL = __webpack_require__(73); /** @@ -157977,7 +159581,7 @@ module.exports = PolygonWebGLRenderer; /***/ }), -/* 1011 */ +/* 1016 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157987,8 +159591,8 @@ module.exports = PolygonWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(41); -var LineStyleCanvas = __webpack_require__(55); -var SetTransform = __webpack_require__(27); +var LineStyleCanvas = __webpack_require__(56); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -158062,7 +159666,7 @@ module.exports = PolygonCanvasRenderer; /***/ }), -/* 1012 */ +/* 1017 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158076,12 +159680,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(1013); + renderWebGL = __webpack_require__(1018); } if (true) { - renderCanvas = __webpack_require__(1014); + renderCanvas = __webpack_require__(1019); } module.exports = { @@ -158093,7 +159697,7 @@ module.exports = { /***/ }), -/* 1013 */ +/* 1018 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158185,7 +159789,7 @@ module.exports = RectangleWebGLRenderer; /***/ }), -/* 1014 */ +/* 1019 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158195,8 +159799,8 @@ module.exports = RectangleWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(41); -var LineStyleCanvas = __webpack_require__(55); -var SetTransform = __webpack_require__(27); +var LineStyleCanvas = __webpack_require__(56); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -158259,7 +159863,7 @@ module.exports = RectangleCanvasRenderer; /***/ }), -/* 1015 */ +/* 1020 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158273,12 +159877,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(1016); + renderWebGL = __webpack_require__(1021); } if (true) { - renderCanvas = __webpack_require__(1017); + renderCanvas = __webpack_require__(1022); } module.exports = { @@ -158290,7 +159894,7 @@ module.exports = { /***/ }), -/* 1016 */ +/* 1021 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158299,7 +159903,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(107); +var FillPathWebGL = __webpack_require__(108); var StrokePathWebGL = __webpack_require__(73); /** @@ -158368,7 +159972,7 @@ module.exports = StarWebGLRenderer; /***/ }), -/* 1017 */ +/* 1022 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158378,8 +159982,8 @@ module.exports = StarWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(41); -var LineStyleCanvas = __webpack_require__(55); -var SetTransform = __webpack_require__(27); +var LineStyleCanvas = __webpack_require__(56); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -158453,7 +160057,7 @@ module.exports = StarCanvasRenderer; /***/ }), -/* 1018 */ +/* 1023 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158467,12 +160071,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(1019); + renderWebGL = __webpack_require__(1024); } if (true) { - renderCanvas = __webpack_require__(1020); + renderCanvas = __webpack_require__(1025); } module.exports = { @@ -158484,7 +160088,7 @@ module.exports = { /***/ }), -/* 1019 */ +/* 1024 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158587,7 +160191,7 @@ module.exports = TriangleWebGLRenderer; /***/ }), -/* 1020 */ +/* 1025 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158597,8 +160201,8 @@ module.exports = TriangleWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(41); -var LineStyleCanvas = __webpack_require__(55); -var SetTransform = __webpack_require__(27); +var LineStyleCanvas = __webpack_require__(56); +var SetTransform = __webpack_require__(28); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -158662,7 +160266,7 @@ module.exports = TriangleCanvasRenderer; /***/ }), -/* 1021 */ +/* 1026 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158671,7 +160275,7 @@ module.exports = TriangleCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Blitter = __webpack_require__(195); +var Blitter = __webpack_require__(197); var GameObjectFactory = __webpack_require__(6); /** @@ -158704,7 +160308,7 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) /***/ }), -/* 1022 */ +/* 1027 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158714,7 +160318,7 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Container = __webpack_require__(196); +var Container = __webpack_require__(198); var GameObjectFactory = __webpack_require__(6); /** @@ -158738,7 +160342,7 @@ GameObjectFactory.register('container', function (x, y, children) /***/ }), -/* 1023 */ +/* 1028 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158747,7 +160351,7 @@ GameObjectFactory.register('container', function (x, y, children) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DOMElement = __webpack_require__(390); +var DOMElement = __webpack_require__(393); var GameObjectFactory = __webpack_require__(6); /** @@ -158828,7 +160432,7 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) /***/ }), -/* 1024 */ +/* 1029 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158837,7 +160441,7 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DynamicBitmapText = __webpack_require__(197); +var DynamicBitmapText = __webpack_require__(199); var GameObjectFactory = __webpack_require__(6); /** @@ -158897,7 +160501,7 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size /***/ }), -/* 1025 */ +/* 1030 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158906,7 +160510,7 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extern = __webpack_require__(392); +var Extern = __webpack_require__(395); var GameObjectFactory = __webpack_require__(6); /** @@ -158939,7 +160543,7 @@ GameObjectFactory.register('extern', function () /***/ }), -/* 1026 */ +/* 1031 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158948,7 +160552,7 @@ GameObjectFactory.register('extern', function () * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Graphics = __webpack_require__(198); +var Graphics = __webpack_require__(200); var GameObjectFactory = __webpack_require__(6); /** @@ -158978,7 +160582,7 @@ GameObjectFactory.register('graphics', function (config) /***/ }), -/* 1027 */ +/* 1032 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158987,7 +160591,7 @@ GameObjectFactory.register('graphics', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Group = __webpack_require__(104); +var Group = __webpack_require__(106); var GameObjectFactory = __webpack_require__(6); /** @@ -159010,7 +160614,7 @@ GameObjectFactory.register('group', function (children, config) /***/ }), -/* 1028 */ +/* 1033 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159019,7 +160623,7 @@ GameObjectFactory.register('group', function (children, config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Image = __webpack_require__(87); +var Image = __webpack_require__(88); var GameObjectFactory = __webpack_require__(6); /** @@ -159052,7 +160656,7 @@ GameObjectFactory.register('image', function (x, y, key, frame) /***/ }), -/* 1029 */ +/* 1034 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159062,7 +160666,7 @@ GameObjectFactory.register('image', function (x, y, key, frame) */ var GameObjectFactory = __webpack_require__(6); -var ParticleEmitterManager = __webpack_require__(201); +var ParticleEmitterManager = __webpack_require__(203); /** * Creates a new Particle Emitter Manager Game Object and adds it to the Scene. @@ -159098,7 +160702,7 @@ GameObjectFactory.register('particles', function (key, frame, emitters) /***/ }), -/* 1030 */ +/* 1035 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159108,7 +160712,7 @@ GameObjectFactory.register('particles', function (key, frame, emitters) */ var GameObjectFactory = __webpack_require__(6); -var PathFollower = __webpack_require__(404); +var PathFollower = __webpack_require__(407); /** * Creates a new PathFollower Game Object and adds it to the Scene. @@ -159146,7 +160750,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) /***/ }), -/* 1031 */ +/* 1036 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159156,7 +160760,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) */ var GameObjectFactory = __webpack_require__(6); -var RenderTexture = __webpack_require__(202); +var RenderTexture = __webpack_require__(204); /** * Creates a new Render Texture Game Object and adds it to the Scene. @@ -159186,7 +160790,7 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, /***/ }), -/* 1032 */ +/* 1037 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159196,7 +160800,7 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, */ var GameObjectFactory = __webpack_require__(6); -var Sprite = __webpack_require__(63); +var Sprite = __webpack_require__(64); /** * Creates a new Sprite Game Object and adds it to the Scene. @@ -159233,7 +160837,7 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) /***/ }), -/* 1033 */ +/* 1038 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159242,7 +160846,7 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(136); +var BitmapText = __webpack_require__(137); var GameObjectFactory = __webpack_require__(6); /** @@ -159297,7 +160901,7 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align /***/ }), -/* 1034 */ +/* 1039 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159306,7 +160910,7 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Text = __webpack_require__(203); +var Text = __webpack_require__(205); var GameObjectFactory = __webpack_require__(6); /** @@ -159362,7 +160966,7 @@ GameObjectFactory.register('text', function (x, y, text, style) /***/ }), -/* 1035 */ +/* 1040 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159371,7 +160975,7 @@ GameObjectFactory.register('text', function (x, y, text, style) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileSprite = __webpack_require__(204); +var TileSprite = __webpack_require__(206); var GameObjectFactory = __webpack_require__(6); /** @@ -159406,7 +161010,7 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra /***/ }), -/* 1036 */ +/* 1041 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159415,7 +161019,7 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Zone = __webpack_require__(114); +var Zone = __webpack_require__(115); var GameObjectFactory = __webpack_require__(6); /** @@ -159448,7 +161052,7 @@ GameObjectFactory.register('zone', function (x, y, width, height) /***/ }), -/* 1037 */ +/* 1042 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159457,7 +161061,7 @@ GameObjectFactory.register('zone', function (x, y, width, height) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Arc = __webpack_require__(406); +var Arc = __webpack_require__(409); var GameObjectFactory = __webpack_require__(6); /** @@ -159521,7 +161125,7 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph /***/ }), -/* 1038 */ +/* 1043 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159531,7 +161135,7 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph */ var GameObjectFactory = __webpack_require__(6); -var Curve = __webpack_require__(407); +var Curve = __webpack_require__(410); /** * Creates a new Curve Shape Game Object and adds it to the Scene. @@ -159571,7 +161175,7 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) /***/ }), -/* 1039 */ +/* 1044 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159580,7 +161184,7 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(408); +var Ellipse = __webpack_require__(411); var GameObjectFactory = __webpack_require__(6); /** @@ -159623,7 +161227,7 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, /***/ }), -/* 1040 */ +/* 1045 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159633,7 +161237,7 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, */ var GameObjectFactory = __webpack_require__(6); -var Grid = __webpack_require__(409); +var Grid = __webpack_require__(412); /** * Creates a new Grid Shape Game Object and adds it to the Scene. @@ -159678,7 +161282,7 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel /***/ }), -/* 1041 */ +/* 1046 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159688,7 +161292,7 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel */ var GameObjectFactory = __webpack_require__(6); -var IsoBox = __webpack_require__(410); +var IsoBox = __webpack_require__(413); /** * Creates a new IsoBox Shape Game Object and adds it to the Scene. @@ -159729,7 +161333,7 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill /***/ }), -/* 1042 */ +/* 1047 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159739,7 +161343,7 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill */ var GameObjectFactory = __webpack_require__(6); -var IsoTriangle = __webpack_require__(411); +var IsoTriangle = __webpack_require__(414); /** * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. @@ -159782,7 +161386,7 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed /***/ }), -/* 1043 */ +/* 1048 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159792,7 +161396,7 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed */ var GameObjectFactory = __webpack_require__(6); -var Line = __webpack_require__(412); +var Line = __webpack_require__(415); /** * Creates a new Line Shape Game Object and adds it to the Scene. @@ -159833,7 +161437,7 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, /***/ }), -/* 1044 */ +/* 1049 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159843,7 +161447,7 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, */ var GameObjectFactory = __webpack_require__(6); -var Polygon = __webpack_require__(413); +var Polygon = __webpack_require__(416); /** * Creates a new Polygon Shape Game Object and adds it to the Scene. @@ -159886,7 +161490,7 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp /***/ }), -/* 1045 */ +/* 1050 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159896,7 +161500,7 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp */ var GameObjectFactory = __webpack_require__(6); -var Rectangle = __webpack_require__(418); +var Rectangle = __webpack_require__(421); /** * Creates a new Rectangle Shape Game Object and adds it to the Scene. @@ -159931,7 +161535,7 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor /***/ }), -/* 1046 */ +/* 1051 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159940,7 +161544,7 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Star = __webpack_require__(419); +var Star = __webpack_require__(422); var GameObjectFactory = __webpack_require__(6); /** @@ -159983,7 +161587,7 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad /***/ }), -/* 1047 */ +/* 1052 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159993,7 +161597,7 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad */ var GameObjectFactory = __webpack_require__(6); -var Triangle = __webpack_require__(420); +var Triangle = __webpack_require__(423); /** * Creates a new Triangle Shape Game Object and adds it to the Scene. @@ -160034,7 +161638,7 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f /***/ }), -/* 1048 */ +/* 1053 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160043,9 +161647,9 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Blitter = __webpack_require__(195); -var BuildGameObject = __webpack_require__(31); -var GameObjectCreator = __webpack_require__(15); +var Blitter = __webpack_require__(197); +var BuildGameObject = __webpack_require__(30); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); /** @@ -160084,7 +161688,7 @@ GameObjectCreator.register('blitter', function (config, addToScene) /***/ }), -/* 1049 */ +/* 1054 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160094,9 +161698,9 @@ GameObjectCreator.register('blitter', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(31); -var Container = __webpack_require__(196); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(30); +var Container = __webpack_require__(198); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); /** @@ -160133,7 +161737,7 @@ GameObjectCreator.register('container', function (config, addToScene) /***/ }), -/* 1050 */ +/* 1055 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160142,9 +161746,9 @@ GameObjectCreator.register('container', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(197); -var BuildGameObject = __webpack_require__(31); -var GameObjectCreator = __webpack_require__(15); +var BitmapText = __webpack_require__(199); +var BuildGameObject = __webpack_require__(30); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); /** @@ -160184,7 +161788,7 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) /***/ }), -/* 1051 */ +/* 1056 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160193,8 +161797,8 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); -var Graphics = __webpack_require__(198); +var GameObjectCreator = __webpack_require__(16); +var Graphics = __webpack_require__(200); /** * Creates a new Graphics Game Object and returns it. @@ -160232,7 +161836,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) /***/ }), -/* 1052 */ +/* 1057 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160241,8 +161845,8 @@ GameObjectCreator.register('graphics', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); -var Group = __webpack_require__(104); +var GameObjectCreator = __webpack_require__(16); +var Group = __webpack_require__(106); /** * Creates a new Group Game Object and returns it. @@ -160265,7 +161869,7 @@ GameObjectCreator.register('group', function (config) /***/ }), -/* 1053 */ +/* 1058 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160274,10 +161878,10 @@ GameObjectCreator.register('group', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(31); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(30); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Image = __webpack_require__(87); +var Image = __webpack_require__(88); /** * Creates a new Image Game Object and returns it. @@ -160315,7 +161919,7 @@ GameObjectCreator.register('image', function (config, addToScene) /***/ }), -/* 1054 */ +/* 1059 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160324,10 +161928,10 @@ GameObjectCreator.register('image', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); var GetFastValue = __webpack_require__(1); -var ParticleEmitterManager = __webpack_require__(201); +var ParticleEmitterManager = __webpack_require__(203); /** * Creates a new Particle Emitter Manager Game Object and returns it. @@ -160372,7 +161976,7 @@ GameObjectCreator.register('particles', function (config, addToScene) /***/ }), -/* 1055 */ +/* 1060 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160381,10 +161985,10 @@ GameObjectCreator.register('particles', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(31); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(30); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var RenderTexture = __webpack_require__(202); +var RenderTexture = __webpack_require__(204); /** * Creates a new Render Texture Game Object and returns it. @@ -160424,7 +162028,7 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) /***/ }), -/* 1056 */ +/* 1061 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160433,11 +162037,11 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(31); -var BuildGameObjectAnimation = __webpack_require__(388); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(30); +var BuildGameObjectAnimation = __webpack_require__(391); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Sprite = __webpack_require__(63); +var Sprite = __webpack_require__(64); /** * Creates a new Sprite Game Object and returns it. @@ -160477,7 +162081,7 @@ GameObjectCreator.register('sprite', function (config, addToScene) /***/ }), -/* 1057 */ +/* 1062 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160486,9 +162090,9 @@ GameObjectCreator.register('sprite', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(136); -var BuildGameObject = __webpack_require__(31); -var GameObjectCreator = __webpack_require__(15); +var BitmapText = __webpack_require__(137); +var BuildGameObject = __webpack_require__(30); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); var GetValue = __webpack_require__(5); @@ -160530,7 +162134,7 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) /***/ }), -/* 1058 */ +/* 1063 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160539,10 +162143,10 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(31); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(30); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Text = __webpack_require__(203); +var Text = __webpack_require__(205); /** * Creates a new Text Game Object and returns it. @@ -160617,7 +162221,7 @@ GameObjectCreator.register('text', function (config, addToScene) /***/ }), -/* 1059 */ +/* 1064 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160626,10 +162230,10 @@ GameObjectCreator.register('text', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(31); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(30); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var TileSprite = __webpack_require__(204); +var TileSprite = __webpack_require__(206); /** * Creates a new TileSprite Game Object and returns it. @@ -160669,7 +162273,7 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) /***/ }), -/* 1060 */ +/* 1065 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160678,9 +162282,9 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Zone = __webpack_require__(114); +var Zone = __webpack_require__(115); /** * Creates a new Zone Game Object and returns it. @@ -160708,7 +162312,7 @@ GameObjectCreator.register('zone', function (config) /***/ }), -/* 1061 */ +/* 1066 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160722,12 +162326,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(1062); + renderWebGL = __webpack_require__(1067); } if (true) { - renderCanvas = __webpack_require__(1063); + renderCanvas = __webpack_require__(1068); } module.exports = { @@ -160739,7 +162343,7 @@ module.exports = { /***/ }), -/* 1062 */ +/* 1067 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160857,7 +162461,7 @@ module.exports = MeshWebGLRenderer; /***/ }), -/* 1063 */ +/* 1068 */ /***/ (function(module, exports) { /** @@ -160886,7 +162490,7 @@ module.exports = MeshCanvasRenderer; /***/ }), -/* 1064 */ +/* 1069 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160900,12 +162504,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(1065); + renderWebGL = __webpack_require__(1070); } if (true) { - renderCanvas = __webpack_require__(1066); + renderCanvas = __webpack_require__(1071); } module.exports = { @@ -160917,7 +162521,7 @@ module.exports = { /***/ }), -/* 1065 */ +/* 1070 */ /***/ (function(module, exports) { /** @@ -160952,40 +162556,48 @@ var ShaderWebGLRenderer = function (renderer, src, interpolationPercentage, came renderer.clearPipeline(); - var camMatrix = src._tempMatrix1; - var shapeMatrix = src._tempMatrix2; - var calcMatrix = src._tempMatrix3; - - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) + if (src.renderToTexture) { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; + src.load(); + src.flush(); } else { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + var camMatrix = src._tempMatrix1; + var shapeMatrix = src._tempMatrix2; + var calcMatrix = src._tempMatrix3; + + shapeMatrix.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 + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + // Renderer size changed? + if (renderer.width !== src._rendererWidth || renderer.height !== src._rendererHeight) + { + src.projOrtho(0, renderer.width, renderer.height, 0); + } + + src.load(calcMatrix.matrix); + src.flush(); } - camMatrix.multiply(shapeMatrix, calcMatrix); - - // Renderer size changed? - if (renderer.width !== src._rendererWidth || renderer.height !== src._rendererHeight) - { - src.projOrtho(0, renderer.width, renderer.height, 0); - } - - src.load(calcMatrix.matrix); - src.flush(); - renderer.rebindPipeline(pipeline); }; @@ -160993,7 +162605,7 @@ module.exports = ShaderWebGLRenderer; /***/ }), -/* 1066 */ +/* 1071 */ /***/ (function(module, exports) { /** @@ -161022,7 +162634,7 @@ module.exports = ShaderCanvasRenderer; /***/ }), -/* 1067 */ +/* 1072 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161031,7 +162643,7 @@ module.exports = ShaderCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Mesh = __webpack_require__(137); +var Mesh = __webpack_require__(138); var GameObjectFactory = __webpack_require__(6); /** @@ -161072,7 +162684,7 @@ if (true) /***/ }), -/* 1068 */ +/* 1073 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161081,7 +162693,7 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Quad = __webpack_require__(207); +var Quad = __webpack_require__(209); var GameObjectFactory = __webpack_require__(6); /** @@ -161118,7 +162730,7 @@ if (true) /***/ }), -/* 1069 */ +/* 1074 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161127,7 +162739,7 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Shader = __webpack_require__(208); +var Shader = __webpack_require__(210); var GameObjectFactory = __webpack_require__(6); /** @@ -161158,7 +162770,7 @@ if (true) /***/ }), -/* 1070 */ +/* 1075 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161167,11 +162779,11 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(31); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(30); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); var GetValue = __webpack_require__(5); -var Mesh = __webpack_require__(137); +var Mesh = __webpack_require__(138); /** * Creates a new Mesh Game Object and returns it. @@ -161213,7 +162825,7 @@ GameObjectCreator.register('mesh', function (config, addToScene) /***/ }), -/* 1071 */ +/* 1076 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161222,10 +162834,10 @@ GameObjectCreator.register('mesh', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(31); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(30); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Quad = __webpack_require__(207); +var Quad = __webpack_require__(209); /** * Creates a new Quad Game Object and returns it. @@ -161263,7 +162875,7 @@ GameObjectCreator.register('quad', function (config, addToScene) /***/ }), -/* 1072 */ +/* 1077 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161272,10 +162884,10 @@ GameObjectCreator.register('quad', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(31); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(30); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Shader = __webpack_require__(208); +var Shader = __webpack_require__(210); /** * Creates a new Shader Game Object and returns it. @@ -161316,7 +162928,7 @@ GameObjectCreator.register('shader', function (config, addToScene) /***/ }), -/* 1073 */ +/* 1078 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161326,9 +162938,9 @@ GameObjectCreator.register('shader', function (config, addToScene) */ var Class = __webpack_require__(0); -var LightsManager = __webpack_require__(425); -var PluginCache = __webpack_require__(17); -var SceneEvents = __webpack_require__(18); +var LightsManager = __webpack_require__(428); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); /** * @classdesc @@ -161432,7 +163044,7 @@ module.exports = LightsPlugin; /***/ }), -/* 1074 */ +/* 1079 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161443,27 +163055,27 @@ module.exports = LightsPlugin; var Circle = __webpack_require__(83); -Circle.Area = __webpack_require__(1075); -Circle.Circumference = __webpack_require__(258); -Circle.CircumferencePoint = __webpack_require__(154); -Circle.Clone = __webpack_require__(1076); +Circle.Area = __webpack_require__(1080); +Circle.Circumference = __webpack_require__(261); +Circle.CircumferencePoint = __webpack_require__(155); +Circle.Clone = __webpack_require__(1081); Circle.Contains = __webpack_require__(51); -Circle.ContainsPoint = __webpack_require__(1077); -Circle.ContainsRect = __webpack_require__(1078); -Circle.CopyFrom = __webpack_require__(1079); -Circle.Equals = __webpack_require__(1080); -Circle.GetBounds = __webpack_require__(1081); -Circle.GetPoint = __webpack_require__(256); -Circle.GetPoints = __webpack_require__(257); -Circle.Offset = __webpack_require__(1082); -Circle.OffsetPoint = __webpack_require__(1083); -Circle.Random = __webpack_require__(155); +Circle.ContainsPoint = __webpack_require__(1082); +Circle.ContainsRect = __webpack_require__(1083); +Circle.CopyFrom = __webpack_require__(1084); +Circle.Equals = __webpack_require__(1085); +Circle.GetBounds = __webpack_require__(1086); +Circle.GetPoint = __webpack_require__(259); +Circle.GetPoints = __webpack_require__(260); +Circle.Offset = __webpack_require__(1087); +Circle.OffsetPoint = __webpack_require__(1088); +Circle.Random = __webpack_require__(156); module.exports = Circle; /***/ }), -/* 1075 */ +/* 1080 */ /***/ (function(module, exports) { /** @@ -161491,7 +163103,7 @@ module.exports = Area; /***/ }), -/* 1076 */ +/* 1081 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161521,7 +163133,7 @@ module.exports = Clone; /***/ }), -/* 1077 */ +/* 1082 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161552,7 +163164,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1078 */ +/* 1083 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161588,7 +163200,7 @@ module.exports = ContainsRect; /***/ }), -/* 1079 */ +/* 1084 */ /***/ (function(module, exports) { /** @@ -161620,7 +163232,7 @@ module.exports = CopyFrom; /***/ }), -/* 1080 */ +/* 1085 */ /***/ (function(module, exports) { /** @@ -161654,7 +163266,7 @@ module.exports = Equals; /***/ }), -/* 1081 */ +/* 1086 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161694,7 +163306,7 @@ module.exports = GetBounds; /***/ }), -/* 1082 */ +/* 1087 */ /***/ (function(module, exports) { /** @@ -161729,7 +163341,7 @@ module.exports = Offset; /***/ }), -/* 1083 */ +/* 1088 */ /***/ (function(module, exports) { /** @@ -161763,7 +163375,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1084 */ +/* 1089 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161772,29 +163384,29 @@ module.exports = OffsetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(102); +var Ellipse = __webpack_require__(104); -Ellipse.Area = __webpack_require__(1085); -Ellipse.Circumference = __webpack_require__(395); -Ellipse.CircumferencePoint = __webpack_require__(200); -Ellipse.Clone = __webpack_require__(1086); -Ellipse.Contains = __webpack_require__(103); -Ellipse.ContainsPoint = __webpack_require__(1087); -Ellipse.ContainsRect = __webpack_require__(1088); -Ellipse.CopyFrom = __webpack_require__(1089); -Ellipse.Equals = __webpack_require__(1090); -Ellipse.GetBounds = __webpack_require__(1091); -Ellipse.GetPoint = __webpack_require__(393); -Ellipse.GetPoints = __webpack_require__(394); -Ellipse.Offset = __webpack_require__(1092); -Ellipse.OffsetPoint = __webpack_require__(1093); -Ellipse.Random = __webpack_require__(163); +Ellipse.Area = __webpack_require__(1090); +Ellipse.Circumference = __webpack_require__(398); +Ellipse.CircumferencePoint = __webpack_require__(202); +Ellipse.Clone = __webpack_require__(1091); +Ellipse.Contains = __webpack_require__(105); +Ellipse.ContainsPoint = __webpack_require__(1092); +Ellipse.ContainsRect = __webpack_require__(1093); +Ellipse.CopyFrom = __webpack_require__(1094); +Ellipse.Equals = __webpack_require__(1095); +Ellipse.GetBounds = __webpack_require__(1096); +Ellipse.GetPoint = __webpack_require__(396); +Ellipse.GetPoints = __webpack_require__(397); +Ellipse.Offset = __webpack_require__(1097); +Ellipse.OffsetPoint = __webpack_require__(1098); +Ellipse.Random = __webpack_require__(164); module.exports = Ellipse; /***/ }), -/* 1085 */ +/* 1090 */ /***/ (function(module, exports) { /** @@ -161828,7 +163440,7 @@ module.exports = Area; /***/ }), -/* 1086 */ +/* 1091 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161837,7 +163449,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(102); +var Ellipse = __webpack_require__(104); /** * Creates a new Ellipse instance based on the values contained in the given source. @@ -161858,7 +163470,7 @@ module.exports = Clone; /***/ }), -/* 1087 */ +/* 1092 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161867,7 +163479,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(103); +var Contains = __webpack_require__(105); /** * Check to see if the Ellipse contains the given Point object. @@ -161889,7 +163501,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1088 */ +/* 1093 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161898,7 +163510,7 @@ module.exports = ContainsPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(103); +var Contains = __webpack_require__(105); /** * Check to see if the Ellipse contains all four points of the given Rectangle object. @@ -161925,7 +163537,7 @@ module.exports = ContainsRect; /***/ }), -/* 1089 */ +/* 1094 */ /***/ (function(module, exports) { /** @@ -161957,7 +163569,7 @@ module.exports = CopyFrom; /***/ }), -/* 1090 */ +/* 1095 */ /***/ (function(module, exports) { /** @@ -161992,7 +163604,7 @@ module.exports = Equals; /***/ }), -/* 1091 */ +/* 1096 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162032,7 +163644,7 @@ module.exports = GetBounds; /***/ }), -/* 1092 */ +/* 1097 */ /***/ (function(module, exports) { /** @@ -162067,7 +163679,7 @@ module.exports = Offset; /***/ }), -/* 1093 */ +/* 1098 */ /***/ (function(module, exports) { /** @@ -162101,7 +163713,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1094 */ +/* 1099 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162112,7 +163724,7 @@ module.exports = OffsetPoint; */ var Point = __webpack_require__(4); -var CircleToCircle = __webpack_require__(428); +var CircleToCircle = __webpack_require__(431); /** * Checks if two Circles intersect and returns the intersection points as a Point object array. @@ -162195,7 +163807,7 @@ module.exports = GetCircleToCircle; /***/ }), -/* 1095 */ +/* 1100 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162205,8 +163817,8 @@ module.exports = GetCircleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToCircle = __webpack_require__(209); -var CircleToRectangle = __webpack_require__(429); +var GetLineToCircle = __webpack_require__(211); +var CircleToRectangle = __webpack_require__(432); /** * Checks for intersection between a circle and a rectangle, @@ -162245,7 +163857,7 @@ module.exports = GetCircleToRectangle; /***/ }), -/* 1096 */ +/* 1101 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162255,7 +163867,7 @@ module.exports = GetCircleToRectangle; */ var Rectangle = __webpack_require__(11); -var RectangleToRectangle = __webpack_require__(138); +var RectangleToRectangle = __webpack_require__(139); /** * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. @@ -162294,7 +163906,7 @@ module.exports = GetRectangleIntersection; /***/ }), -/* 1097 */ +/* 1102 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162304,8 +163916,8 @@ module.exports = GetRectangleIntersection; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToRectangle = __webpack_require__(211); -var RectangleToRectangle = __webpack_require__(138); +var GetLineToRectangle = __webpack_require__(213); +var RectangleToRectangle = __webpack_require__(139); /** * Checks if two Rectangles intersect and returns the intersection points as a Point object array. @@ -162345,7 +163957,7 @@ module.exports = GetRectangleToRectangle; /***/ }), -/* 1098 */ +/* 1103 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162355,8 +163967,8 @@ module.exports = GetRectangleToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RectangleToTriangle = __webpack_require__(431); -var GetLineToRectangle = __webpack_require__(211); +var RectangleToTriangle = __webpack_require__(434); +var GetLineToRectangle = __webpack_require__(213); /** * Checks for intersection between Rectangle shape and Triangle shape, @@ -162393,7 +164005,7 @@ module.exports = GetRectangleToTriangle; /***/ }), -/* 1099 */ +/* 1104 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162403,8 +164015,8 @@ module.exports = GetRectangleToTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToCircle = __webpack_require__(209); -var TriangleToCircle = __webpack_require__(433); +var GetLineToCircle = __webpack_require__(211); +var TriangleToCircle = __webpack_require__(436); /** * Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array. @@ -162442,7 +164054,7 @@ module.exports = GetTriangleToCircle; /***/ }), -/* 1100 */ +/* 1105 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162452,8 +164064,8 @@ module.exports = GetTriangleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TriangleToTriangle = __webpack_require__(436); -var GetTriangleToLine = __webpack_require__(434); +var TriangleToTriangle = __webpack_require__(439); +var GetTriangleToLine = __webpack_require__(437); /** * Checks if two Triangles intersect, and returns the intersection points as a Point object array. @@ -162491,7 +164103,7 @@ module.exports = GetTriangleToTriangle; /***/ }), -/* 1101 */ +/* 1106 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162500,7 +164112,7 @@ module.exports = GetTriangleToTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PointToLine = __webpack_require__(438); +var PointToLine = __webpack_require__(441); /** * Checks if a Point is located on the given line segment. @@ -162532,7 +164144,7 @@ module.exports = PointToLineSegment; /***/ }), -/* 1102 */ +/* 1107 */ /***/ (function(module, exports) { /** @@ -162572,7 +164184,7 @@ module.exports = RectangleToValues; /***/ }), -/* 1103 */ +/* 1108 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162581,42 +164193,42 @@ module.exports = RectangleToValues; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Line = __webpack_require__(59); +var Line = __webpack_require__(60); -Line.Angle = __webpack_require__(91); -Line.BresenhamPoints = __webpack_require__(279); -Line.CenterOn = __webpack_require__(1104); -Line.Clone = __webpack_require__(1105); -Line.CopyFrom = __webpack_require__(1106); -Line.Equals = __webpack_require__(1107); -Line.Extend = __webpack_require__(1108); -Line.GetMidPoint = __webpack_require__(1109); -Line.GetNearestPoint = __webpack_require__(1110); -Line.GetNormal = __webpack_require__(1111); -Line.GetPoint = __webpack_require__(266); -Line.GetPoints = __webpack_require__(158); -Line.GetShortestDistance = __webpack_require__(1112); -Line.Height = __webpack_require__(1113); -Line.Length = __webpack_require__(60); -Line.NormalAngle = __webpack_require__(439); -Line.NormalX = __webpack_require__(1114); -Line.NormalY = __webpack_require__(1115); -Line.Offset = __webpack_require__(1116); -Line.PerpSlope = __webpack_require__(1117); -Line.Random = __webpack_require__(159); -Line.ReflectAngle = __webpack_require__(1118); -Line.Rotate = __webpack_require__(1119); -Line.RotateAroundPoint = __webpack_require__(1120); -Line.RotateAroundXY = __webpack_require__(213); -Line.SetToAngle = __webpack_require__(1121); -Line.Slope = __webpack_require__(1122); -Line.Width = __webpack_require__(1123); +Line.Angle = __webpack_require__(93); +Line.BresenhamPoints = __webpack_require__(282); +Line.CenterOn = __webpack_require__(1109); +Line.Clone = __webpack_require__(1110); +Line.CopyFrom = __webpack_require__(1111); +Line.Equals = __webpack_require__(1112); +Line.Extend = __webpack_require__(1113); +Line.GetMidPoint = __webpack_require__(1114); +Line.GetNearestPoint = __webpack_require__(1115); +Line.GetNormal = __webpack_require__(1116); +Line.GetPoint = __webpack_require__(269); +Line.GetPoints = __webpack_require__(159); +Line.GetShortestDistance = __webpack_require__(1117); +Line.Height = __webpack_require__(1118); +Line.Length = __webpack_require__(61); +Line.NormalAngle = __webpack_require__(442); +Line.NormalX = __webpack_require__(1119); +Line.NormalY = __webpack_require__(1120); +Line.Offset = __webpack_require__(1121); +Line.PerpSlope = __webpack_require__(1122); +Line.Random = __webpack_require__(160); +Line.ReflectAngle = __webpack_require__(1123); +Line.Rotate = __webpack_require__(1124); +Line.RotateAroundPoint = __webpack_require__(1125); +Line.RotateAroundXY = __webpack_require__(215); +Line.SetToAngle = __webpack_require__(1126); +Line.Slope = __webpack_require__(1127); +Line.Width = __webpack_require__(1128); module.exports = Line; /***/ }), -/* 1104 */ +/* 1109 */ /***/ (function(module, exports) { /** @@ -162656,7 +164268,7 @@ module.exports = CenterOn; /***/ }), -/* 1105 */ +/* 1110 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162665,7 +164277,7 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Line = __webpack_require__(59); +var Line = __webpack_require__(60); /** * Clone the given line. @@ -162686,7 +164298,7 @@ module.exports = Clone; /***/ }), -/* 1106 */ +/* 1111 */ /***/ (function(module, exports) { /** @@ -162717,7 +164329,7 @@ module.exports = CopyFrom; /***/ }), -/* 1107 */ +/* 1112 */ /***/ (function(module, exports) { /** @@ -162751,7 +164363,7 @@ module.exports = Equals; /***/ }), -/* 1108 */ +/* 1113 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162760,7 +164372,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(60); +var Length = __webpack_require__(61); /** * Extends the start and end points of a Line by the given amounts. @@ -162809,7 +164421,7 @@ module.exports = Extend; /***/ }), -/* 1109 */ +/* 1114 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162847,7 +164459,7 @@ module.exports = GetMidPoint; /***/ }), -/* 1110 */ +/* 1115 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162902,7 +164514,7 @@ module.exports = GetNearestPoint; /***/ }), -/* 1111 */ +/* 1116 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162911,8 +164523,8 @@ module.exports = GetNearestPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Angle = __webpack_require__(91); +var MATH_CONST = __webpack_require__(21); +var Angle = __webpack_require__(93); var Point = __webpack_require__(4); /** @@ -162946,7 +164558,7 @@ module.exports = GetNormal; /***/ }), -/* 1112 */ +/* 1117 */ /***/ (function(module, exports) { /** @@ -162993,7 +164605,7 @@ module.exports = GetShortestDistance; /***/ }), -/* 1113 */ +/* 1118 */ /***/ (function(module, exports) { /** @@ -163021,7 +164633,7 @@ module.exports = Height; /***/ }), -/* 1114 */ +/* 1119 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163030,8 +164642,8 @@ module.exports = Height; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Angle = __webpack_require__(91); +var MATH_CONST = __webpack_require__(21); +var Angle = __webpack_require__(93); /** * [description] @@ -163052,7 +164664,7 @@ module.exports = NormalX; /***/ }), -/* 1115 */ +/* 1120 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163061,8 +164673,8 @@ module.exports = NormalX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Angle = __webpack_require__(91); +var MATH_CONST = __webpack_require__(21); +var Angle = __webpack_require__(93); /** * The Y value of the normal of the given line. @@ -163084,7 +164696,7 @@ module.exports = NormalY; /***/ }), -/* 1116 */ +/* 1121 */ /***/ (function(module, exports) { /** @@ -163122,7 +164734,7 @@ module.exports = Offset; /***/ }), -/* 1117 */ +/* 1122 */ /***/ (function(module, exports) { /** @@ -163150,7 +164762,7 @@ module.exports = PerpSlope; /***/ }), -/* 1118 */ +/* 1123 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163159,8 +164771,8 @@ module.exports = PerpSlope; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Angle = __webpack_require__(91); -var NormalAngle = __webpack_require__(439); +var Angle = __webpack_require__(93); +var NormalAngle = __webpack_require__(442); /** * Calculate the reflected angle between two lines. @@ -163184,7 +164796,7 @@ module.exports = ReflectAngle; /***/ }), -/* 1119 */ +/* 1124 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163193,7 +164805,7 @@ module.exports = ReflectAngle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(213); +var RotateAroundXY = __webpack_require__(215); /** * Rotate a line around its midpoint by the given angle in radians. @@ -163220,7 +164832,7 @@ module.exports = Rotate; /***/ }), -/* 1120 */ +/* 1125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163229,7 +164841,7 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(213); +var RotateAroundXY = __webpack_require__(215); /** * Rotate a line around a point by the given angle in radians. @@ -163254,7 +164866,7 @@ module.exports = RotateAroundPoint; /***/ }), -/* 1121 */ +/* 1126 */ /***/ (function(module, exports) { /** @@ -163294,7 +164906,7 @@ module.exports = SetToAngle; /***/ }), -/* 1122 */ +/* 1127 */ /***/ (function(module, exports) { /** @@ -163322,7 +164934,7 @@ module.exports = Slope; /***/ }), -/* 1123 */ +/* 1128 */ /***/ (function(module, exports) { /** @@ -163350,7 +164962,7 @@ module.exports = Width; /***/ }), -/* 1124 */ +/* 1129 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163361,27 +164973,27 @@ module.exports = Width; var Point = __webpack_require__(4); -Point.Ceil = __webpack_require__(1125); -Point.Clone = __webpack_require__(1126); -Point.CopyFrom = __webpack_require__(1127); -Point.Equals = __webpack_require__(1128); -Point.Floor = __webpack_require__(1129); -Point.GetCentroid = __webpack_require__(1130); -Point.GetMagnitude = __webpack_require__(440); -Point.GetMagnitudeSq = __webpack_require__(441); -Point.GetRectangleFromPoints = __webpack_require__(1131); -Point.Interpolate = __webpack_require__(1132); -Point.Invert = __webpack_require__(1133); -Point.Negative = __webpack_require__(1134); -Point.Project = __webpack_require__(1135); -Point.ProjectUnit = __webpack_require__(1136); -Point.SetMagnitude = __webpack_require__(1137); +Point.Ceil = __webpack_require__(1130); +Point.Clone = __webpack_require__(1131); +Point.CopyFrom = __webpack_require__(1132); +Point.Equals = __webpack_require__(1133); +Point.Floor = __webpack_require__(1134); +Point.GetCentroid = __webpack_require__(1135); +Point.GetMagnitude = __webpack_require__(443); +Point.GetMagnitudeSq = __webpack_require__(444); +Point.GetRectangleFromPoints = __webpack_require__(1136); +Point.Interpolate = __webpack_require__(1137); +Point.Invert = __webpack_require__(1138); +Point.Negative = __webpack_require__(1139); +Point.Project = __webpack_require__(1140); +Point.ProjectUnit = __webpack_require__(1141); +Point.SetMagnitude = __webpack_require__(1142); module.exports = Point; /***/ }), -/* 1125 */ +/* 1130 */ /***/ (function(module, exports) { /** @@ -163411,7 +165023,7 @@ module.exports = Ceil; /***/ }), -/* 1126 */ +/* 1131 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163441,7 +165053,7 @@ module.exports = Clone; /***/ }), -/* 1127 */ +/* 1132 */ /***/ (function(module, exports) { /** @@ -163472,7 +165084,7 @@ module.exports = CopyFrom; /***/ }), -/* 1128 */ +/* 1133 */ /***/ (function(module, exports) { /** @@ -163501,7 +165113,7 @@ module.exports = Equals; /***/ }), -/* 1129 */ +/* 1134 */ /***/ (function(module, exports) { /** @@ -163531,7 +165143,7 @@ module.exports = Floor; /***/ }), -/* 1130 */ +/* 1135 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163595,7 +165207,7 @@ module.exports = GetCentroid; /***/ }), -/* 1131 */ +/* 1136 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163665,7 +165277,7 @@ module.exports = GetRectangleFromPoints; /***/ }), -/* 1132 */ +/* 1137 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163706,7 +165318,7 @@ module.exports = Interpolate; /***/ }), -/* 1133 */ +/* 1138 */ /***/ (function(module, exports) { /** @@ -163736,7 +165348,7 @@ module.exports = Invert; /***/ }), -/* 1134 */ +/* 1139 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163771,7 +165383,7 @@ module.exports = Negative; /***/ }), -/* 1135 */ +/* 1140 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163781,7 +165393,7 @@ module.exports = Negative; */ var Point = __webpack_require__(4); -var GetMagnitudeSq = __webpack_require__(441); +var GetMagnitudeSq = __webpack_require__(444); /** * [description] @@ -163817,7 +165429,7 @@ module.exports = Project; /***/ }), -/* 1136 */ +/* 1141 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163861,7 +165473,7 @@ module.exports = ProjectUnit; /***/ }), -/* 1137 */ +/* 1142 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163870,7 +165482,7 @@ module.exports = ProjectUnit; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetMagnitude = __webpack_require__(440); +var GetMagnitude = __webpack_require__(443); /** * Changes the magnitude (length) of a two-dimensional vector without changing its direction. @@ -163905,7 +165517,7 @@ module.exports = SetMagnitude; /***/ }), -/* 1138 */ +/* 1143 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163914,23 +165526,23 @@ module.exports = SetMagnitude; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Polygon = __webpack_require__(205); +var Polygon = __webpack_require__(207); -Polygon.Clone = __webpack_require__(1139); -Polygon.Contains = __webpack_require__(206); -Polygon.ContainsPoint = __webpack_require__(1140); -Polygon.GetAABB = __webpack_require__(414); -Polygon.GetNumberArray = __webpack_require__(1141); -Polygon.GetPoints = __webpack_require__(415); -Polygon.Perimeter = __webpack_require__(416); -Polygon.Reverse = __webpack_require__(1142); -Polygon.Smooth = __webpack_require__(417); +Polygon.Clone = __webpack_require__(1144); +Polygon.Contains = __webpack_require__(208); +Polygon.ContainsPoint = __webpack_require__(1145); +Polygon.GetAABB = __webpack_require__(417); +Polygon.GetNumberArray = __webpack_require__(1146); +Polygon.GetPoints = __webpack_require__(418); +Polygon.Perimeter = __webpack_require__(419); +Polygon.Reverse = __webpack_require__(1147); +Polygon.Smooth = __webpack_require__(420); module.exports = Polygon; /***/ }), -/* 1139 */ +/* 1144 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163939,7 +165551,7 @@ module.exports = Polygon; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Polygon = __webpack_require__(205); +var Polygon = __webpack_require__(207); /** * Create a new polygon which is a copy of the specified polygon @@ -163960,7 +165572,7 @@ module.exports = Clone; /***/ }), -/* 1140 */ +/* 1145 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163969,7 +165581,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(206); +var Contains = __webpack_require__(208); /** * [description] @@ -163991,7 +165603,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1141 */ +/* 1146 */ /***/ (function(module, exports) { /** @@ -164034,7 +165646,7 @@ module.exports = GetNumberArray; /***/ }), -/* 1142 */ +/* 1147 */ /***/ (function(module, exports) { /** @@ -164066,7 +165678,7 @@ module.exports = Reverse; /***/ }), -/* 1143 */ +/* 1148 */ /***/ (function(module, exports) { /** @@ -164094,7 +165706,7 @@ module.exports = Area; /***/ }), -/* 1144 */ +/* 1149 */ /***/ (function(module, exports) { /** @@ -164127,7 +165739,7 @@ module.exports = Ceil; /***/ }), -/* 1145 */ +/* 1150 */ /***/ (function(module, exports) { /** @@ -164162,7 +165774,7 @@ module.exports = CeilAll; /***/ }), -/* 1146 */ +/* 1151 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164192,7 +165804,7 @@ module.exports = Clone; /***/ }), -/* 1147 */ +/* 1152 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164201,7 +165813,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(52); +var Contains = __webpack_require__(53); /** * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. @@ -164223,7 +165835,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1148 */ +/* 1153 */ /***/ (function(module, exports) { /** @@ -164254,7 +165866,7 @@ module.exports = CopyFrom; /***/ }), -/* 1149 */ +/* 1154 */ /***/ (function(module, exports) { /** @@ -164288,7 +165900,7 @@ module.exports = Equals; /***/ }), -/* 1150 */ +/* 1155 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164297,7 +165909,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetAspectRatio = __webpack_require__(214); +var GetAspectRatio = __webpack_require__(216); /** * Adjusts the target rectangle, changing its width, height and position, @@ -164312,7 +165924,7 @@ var GetAspectRatio = __webpack_require__(214); * @generic {Phaser.Geom.Rectangle} O - [target,$return] * * @param {Phaser.Geom.Rectangle} target - The target rectangle to adjust. - * @param {Phaser.Geom.Rectangle} source - The source rectangle to envlope the target in. + * @param {Phaser.Geom.Rectangle} source - The source rectangle to envelop the target in. * * @return {Phaser.Geom.Rectangle} The modified target rectangle instance. */ @@ -164341,7 +165953,7 @@ module.exports = FitInside; /***/ }), -/* 1151 */ +/* 1156 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164350,7 +165962,7 @@ module.exports = FitInside; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetAspectRatio = __webpack_require__(214); +var GetAspectRatio = __webpack_require__(216); /** * Adjusts the target rectangle, changing its width, height and position, @@ -164394,7 +166006,7 @@ module.exports = FitOutside; /***/ }), -/* 1152 */ +/* 1157 */ /***/ (function(module, exports) { /** @@ -164427,7 +166039,7 @@ module.exports = Floor; /***/ }), -/* 1153 */ +/* 1158 */ /***/ (function(module, exports) { /** @@ -164462,7 +166074,7 @@ module.exports = FloorAll; /***/ }), -/* 1154 */ +/* 1159 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164500,7 +166112,7 @@ module.exports = GetCenter; /***/ }), -/* 1155 */ +/* 1160 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164511,11 +166123,10 @@ module.exports = GetCenter; var Point = __webpack_require__(4); -// The size of the Rectangle object, expressed as a Point object -// with the values of the width and height properties. /** - * [description] + * The size of the Rectangle object, expressed as a Point object + * with the values of the width and height properties. * * @function Phaser.Geom.Rectangle.GetSize * @since 3.0.0 @@ -164541,7 +166152,7 @@ module.exports = GetSize; /***/ }), -/* 1156 */ +/* 1161 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164550,7 +166161,7 @@ module.exports = GetSize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CenterOn = __webpack_require__(173); +var CenterOn = __webpack_require__(174); /** @@ -164583,7 +166194,7 @@ module.exports = Inflate; /***/ }), -/* 1157 */ +/* 1162 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164593,7 +166204,7 @@ module.exports = Inflate; */ var Rectangle = __webpack_require__(11); -var Intersects = __webpack_require__(138); +var Intersects = __webpack_require__(139); /** * Takes two Rectangles and first checks to see if they intersect. @@ -164634,7 +166245,7 @@ module.exports = Intersection; /***/ }), -/* 1158 */ +/* 1163 */ /***/ (function(module, exports) { /** @@ -164683,7 +166294,7 @@ module.exports = MergePoints; /***/ }), -/* 1159 */ +/* 1164 */ /***/ (function(module, exports) { /** @@ -164730,7 +166341,7 @@ module.exports = MergeRect; /***/ }), -/* 1160 */ +/* 1165 */ /***/ (function(module, exports) { /** @@ -164774,7 +166385,7 @@ module.exports = MergeXY; /***/ }), -/* 1161 */ +/* 1166 */ /***/ (function(module, exports) { /** @@ -164809,7 +166420,7 @@ module.exports = Offset; /***/ }), -/* 1162 */ +/* 1167 */ /***/ (function(module, exports) { /** @@ -164843,7 +166454,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1163 */ +/* 1168 */ /***/ (function(module, exports) { /** @@ -164877,7 +166488,7 @@ module.exports = Overlaps; /***/ }), -/* 1164 */ +/* 1169 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164934,7 +166545,7 @@ module.exports = PerimeterPoint; /***/ }), -/* 1165 */ +/* 1170 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164943,8 +166554,8 @@ module.exports = PerimeterPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Between = __webpack_require__(179); -var ContainsRect = __webpack_require__(443); +var Between = __webpack_require__(180); +var ContainsRect = __webpack_require__(446); var Point = __webpack_require__(4); /** @@ -165005,7 +166616,7 @@ module.exports = RandomOutside; /***/ }), -/* 1166 */ +/* 1171 */ /***/ (function(module, exports) { /** @@ -165034,7 +166645,7 @@ module.exports = SameDimensions; /***/ }), -/* 1167 */ +/* 1172 */ /***/ (function(module, exports) { /** @@ -165073,7 +166684,7 @@ module.exports = Scale; /***/ }), -/* 1168 */ +/* 1173 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165084,36 +166695,36 @@ module.exports = Scale; var Triangle = __webpack_require__(74); -Triangle.Area = __webpack_require__(1169); -Triangle.BuildEquilateral = __webpack_require__(1170); -Triangle.BuildFromPolygon = __webpack_require__(1171); -Triangle.BuildRight = __webpack_require__(1172); -Triangle.CenterOn = __webpack_require__(1173); -Triangle.Centroid = __webpack_require__(444); -Triangle.CircumCenter = __webpack_require__(1174); -Triangle.CircumCircle = __webpack_require__(1175); -Triangle.Clone = __webpack_require__(1176); -Triangle.Contains = __webpack_require__(89); -Triangle.ContainsArray = __webpack_require__(212); -Triangle.ContainsPoint = __webpack_require__(1177); -Triangle.CopyFrom = __webpack_require__(1178); -Triangle.Decompose = __webpack_require__(437); -Triangle.Equals = __webpack_require__(1179); -Triangle.GetPoint = __webpack_require__(421); -Triangle.GetPoints = __webpack_require__(422); -Triangle.InCenter = __webpack_require__(446); -Triangle.Perimeter = __webpack_require__(1180); -Triangle.Offset = __webpack_require__(445); -Triangle.Random = __webpack_require__(164); -Triangle.Rotate = __webpack_require__(1181); -Triangle.RotateAroundPoint = __webpack_require__(1182); -Triangle.RotateAroundXY = __webpack_require__(215); +Triangle.Area = __webpack_require__(1174); +Triangle.BuildEquilateral = __webpack_require__(1175); +Triangle.BuildFromPolygon = __webpack_require__(1176); +Triangle.BuildRight = __webpack_require__(1177); +Triangle.CenterOn = __webpack_require__(1178); +Triangle.Centroid = __webpack_require__(447); +Triangle.CircumCenter = __webpack_require__(1179); +Triangle.CircumCircle = __webpack_require__(1180); +Triangle.Clone = __webpack_require__(1181); +Triangle.Contains = __webpack_require__(91); +Triangle.ContainsArray = __webpack_require__(214); +Triangle.ContainsPoint = __webpack_require__(1182); +Triangle.CopyFrom = __webpack_require__(1183); +Triangle.Decompose = __webpack_require__(440); +Triangle.Equals = __webpack_require__(1184); +Triangle.GetPoint = __webpack_require__(424); +Triangle.GetPoints = __webpack_require__(425); +Triangle.InCenter = __webpack_require__(449); +Triangle.Perimeter = __webpack_require__(1185); +Triangle.Offset = __webpack_require__(448); +Triangle.Random = __webpack_require__(165); +Triangle.Rotate = __webpack_require__(1186); +Triangle.RotateAroundPoint = __webpack_require__(1187); +Triangle.RotateAroundXY = __webpack_require__(217); module.exports = Triangle; /***/ }), -/* 1169 */ +/* 1174 */ /***/ (function(module, exports) { /** @@ -165152,7 +166763,7 @@ module.exports = Area; /***/ }), -/* 1170 */ +/* 1175 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165196,7 +166807,7 @@ module.exports = BuildEquilateral; /***/ }), -/* 1171 */ +/* 1176 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165205,7 +166816,7 @@ module.exports = BuildEquilateral; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var EarCut = __webpack_require__(68); +var EarCut = __webpack_require__(69); var Triangle = __webpack_require__(74); /** @@ -165271,7 +166882,7 @@ module.exports = BuildFromPolygon; /***/ }), -/* 1172 */ +/* 1177 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165320,7 +166931,7 @@ module.exports = BuildRight; /***/ }), -/* 1173 */ +/* 1178 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165329,8 +166940,8 @@ module.exports = BuildRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Centroid = __webpack_require__(444); -var Offset = __webpack_require__(445); +var Centroid = __webpack_require__(447); +var Offset = __webpack_require__(448); /** * @callback CenterFunction @@ -165373,7 +166984,7 @@ module.exports = CenterOn; /***/ }), -/* 1174 */ +/* 1179 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165449,7 +167060,7 @@ module.exports = CircumCenter; /***/ }), -/* 1175 */ +/* 1180 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165532,7 +167143,7 @@ module.exports = CircumCircle; /***/ }), -/* 1176 */ +/* 1181 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165562,7 +167173,7 @@ module.exports = Clone; /***/ }), -/* 1177 */ +/* 1182 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165571,7 +167182,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(89); +var Contains = __webpack_require__(91); /** * Tests if a triangle contains a point. @@ -165593,7 +167204,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1178 */ +/* 1183 */ /***/ (function(module, exports) { /** @@ -165624,7 +167235,7 @@ module.exports = CopyFrom; /***/ }), -/* 1179 */ +/* 1184 */ /***/ (function(module, exports) { /** @@ -165660,7 +167271,7 @@ module.exports = Equals; /***/ }), -/* 1180 */ +/* 1185 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165669,7 +167280,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(60); +var Length = __webpack_require__(61); // The 2D area of a triangle. The area value is always non-negative. @@ -165696,7 +167307,7 @@ module.exports = Perimeter; /***/ }), -/* 1181 */ +/* 1186 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165705,8 +167316,8 @@ module.exports = Perimeter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(215); -var InCenter = __webpack_require__(446); +var RotateAroundXY = __webpack_require__(217); +var InCenter = __webpack_require__(449); /** * Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet. @@ -165732,7 +167343,7 @@ module.exports = Rotate; /***/ }), -/* 1182 */ +/* 1187 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165741,7 +167352,7 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(215); +var RotateAroundXY = __webpack_require__(217); /** * Rotates a Triangle at a certain angle about a given Point or object with public `x` and `y` properties. @@ -165766,7 +167377,7 @@ module.exports = RotateAroundPoint; /***/ }), -/* 1183 */ +/* 1188 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165775,8 +167386,8 @@ module.exports = RotateAroundPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(188); -var Extend = __webpack_require__(20); +var CONST = __webpack_require__(189); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Input @@ -165784,16 +167395,16 @@ var Extend = __webpack_require__(20); var Input = { - CreateInteractiveObject: __webpack_require__(447), - Events: __webpack_require__(54), - Gamepad: __webpack_require__(1184), - InputManager: __webpack_require__(361), - InputPlugin: __webpack_require__(1196), - InputPluginCache: __webpack_require__(139), - Keyboard: __webpack_require__(1198), - Mouse: __webpack_require__(1215), - Pointer: __webpack_require__(364), - Touch: __webpack_require__(1216) + CreateInteractiveObject: __webpack_require__(450), + Events: __webpack_require__(55), + Gamepad: __webpack_require__(1189), + InputManager: __webpack_require__(364), + InputPlugin: __webpack_require__(1201), + InputPluginCache: __webpack_require__(140), + Keyboard: __webpack_require__(1203), + Mouse: __webpack_require__(1220), + Pointer: __webpack_require__(367), + Touch: __webpack_require__(1221) }; @@ -165804,7 +167415,7 @@ module.exports = Input; /***/ }), -/* 1184 */ +/* 1189 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165819,18 +167430,18 @@ module.exports = Input; module.exports = { - Axis: __webpack_require__(448), - Button: __webpack_require__(449), - Events: __webpack_require__(216), - Gamepad: __webpack_require__(450), - GamepadPlugin: __webpack_require__(1191), + Axis: __webpack_require__(451), + Button: __webpack_require__(452), + Events: __webpack_require__(218), + Gamepad: __webpack_require__(453), + GamepadPlugin: __webpack_require__(1196), - Configs: __webpack_require__(1192) + Configs: __webpack_require__(1197) }; /***/ }), -/* 1185 */ +/* 1190 */ /***/ (function(module, exports) { /** @@ -165859,7 +167470,7 @@ module.exports = 'down'; /***/ }), -/* 1186 */ +/* 1191 */ /***/ (function(module, exports) { /** @@ -165888,7 +167499,7 @@ module.exports = 'up'; /***/ }), -/* 1187 */ +/* 1192 */ /***/ (function(module, exports) { /** @@ -165919,7 +167530,7 @@ module.exports = 'connected'; /***/ }), -/* 1188 */ +/* 1193 */ /***/ (function(module, exports) { /** @@ -165945,7 +167556,7 @@ module.exports = 'disconnected'; /***/ }), -/* 1189 */ +/* 1194 */ /***/ (function(module, exports) { /** @@ -165977,7 +167588,7 @@ module.exports = 'down'; /***/ }), -/* 1190 */ +/* 1195 */ /***/ (function(module, exports) { /** @@ -166009,7 +167620,7 @@ module.exports = 'up'; /***/ }), -/* 1191 */ +/* 1196 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166020,11 +167631,11 @@ module.exports = 'up'; var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(216); -var Gamepad = __webpack_require__(450); +var Events = __webpack_require__(218); +var Gamepad = __webpack_require__(453); var GetValue = __webpack_require__(5); -var InputPluginCache = __webpack_require__(139); -var InputEvents = __webpack_require__(54); +var InputPluginCache = __webpack_require__(140); +var InputEvents = __webpack_require__(55); /** * @classdesc @@ -166649,7 +168260,7 @@ module.exports = GamepadPlugin; /***/ }), -/* 1192 */ +/* 1197 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166664,15 +168275,15 @@ module.exports = GamepadPlugin; module.exports = { - DUALSHOCK_4: __webpack_require__(1193), - SNES_USB: __webpack_require__(1194), - XBOX_360: __webpack_require__(1195) + DUALSHOCK_4: __webpack_require__(1198), + SNES_USB: __webpack_require__(1199), + XBOX_360: __webpack_require__(1200) }; /***/ }), -/* 1193 */ +/* 1198 */ /***/ (function(module, exports) { /** @@ -166722,7 +168333,7 @@ module.exports = { /***/ }), -/* 1194 */ +/* 1199 */ /***/ (function(module, exports) { /** @@ -166761,7 +168372,7 @@ module.exports = { /***/ }), -/* 1195 */ +/* 1200 */ /***/ (function(module, exports) { /** @@ -166812,7 +168423,7 @@ module.exports = { /***/ }), -/* 1196 */ +/* 1201 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166824,23 +168435,24 @@ module.exports = { var Circle = __webpack_require__(83); var CircleContains = __webpack_require__(51); var Class = __webpack_require__(0); -var CONST = __webpack_require__(188); -var CreateInteractiveObject = __webpack_require__(447); -var CreatePixelPerfectHandler = __webpack_require__(1197); -var DistanceBetween = __webpack_require__(62); -var Ellipse = __webpack_require__(102); -var EllipseContains = __webpack_require__(103); -var Events = __webpack_require__(54); +var CONST = __webpack_require__(189); +var CreateInteractiveObject = __webpack_require__(450); +var CreatePixelPerfectHandler = __webpack_require__(1202); +var DistanceBetween = __webpack_require__(63); +var Ellipse = __webpack_require__(104); +var EllipseContains = __webpack_require__(105); +var Events = __webpack_require__(55); var EventEmitter = __webpack_require__(9); var GetFastValue = __webpack_require__(1); -var InputPluginCache = __webpack_require__(139); +var GEOM_CONST = __webpack_require__(52); +var InputPluginCache = __webpack_require__(140); var IsPlainObject = __webpack_require__(7); -var PluginCache = __webpack_require__(17); +var PluginCache = __webpack_require__(18); var Rectangle = __webpack_require__(11); -var RectangleContains = __webpack_require__(52); -var SceneEvents = __webpack_require__(18); +var RectangleContains = __webpack_require__(53); +var SceneEvents = __webpack_require__(19); var Triangle = __webpack_require__(74); -var TriangleContains = __webpack_require__(89); +var TriangleContains = __webpack_require__(91); /** * @classdesc @@ -167361,17 +168973,35 @@ var InputPlugin = new Class({ return false; } - // So the Gamepad and Keyboard update, regardless + // The plugins should update every frame, regardless if there has been + // any DOM input events or not (such as the Gamepad and Keyboard) this.pluginEvents.emit(Events.UPDATE, time, delta); - // Nothing else? Let's leave - if (this._list.length === 0 || this._updatedThisFrame) + // We can leave now if we've already updated once this frame via the immediate DOM event handlers + if (this._updatedThisFrame) { this._updatedThisFrame = false; return false; } + var i; + var manager = this.manager; + + var pointers = manager.pointers; + var pointersTotal = manager.pointersTotal; + + for (i = 0; i < pointersTotal; i++) + { + pointers[i].updateMotion(); + } + + // No point going any further if there aren't any interactive objects + if (this._list.length === 0) + { + return false; + } + var rate = this.pollRate; if (rate === -1) @@ -167395,15 +169025,12 @@ var InputPlugin = new Class({ } // We got this far? Then we should poll for movement - var manager = this.manager; - - var pointers = manager.pointers; - var pointersTotal = manager.pointersTotal; var captured = false; - for (var i = 0; i < pointersTotal; i++) + for (i = 0; i < pointersTotal; i++) { var total = 0; + var pointer = pointers[i]; // Always reset this array @@ -167786,7 +169413,7 @@ var InputPlugin = new Class({ } // If they released outside the canvas, but pressed down inside it, we'll still dispatch the event. - if (!aborted) + if (!aborted && this.manager) { if (pointer.downElement === this.manager.game.canvas) { @@ -168738,7 +170365,7 @@ var InputPlugin = new Class({ } // If they released outside the canvas, but pressed down inside it, we'll still dispatch the event. - if (!aborted) + if (!aborted && this.manager) { if (pointer.upElement === this.manager.game.canvas) { @@ -168918,6 +170545,7 @@ var InputPlugin = new Class({ var cursor = false; var useHandCursor = false; var pixelPerfect = false; + var customHitArea = true; // Config object? if (IsPlainObject(shape)) @@ -168944,6 +170572,7 @@ var InputPlugin = new Class({ if (!shape || !callback) { this.setHitAreaFromTexture(gameObjects); + customHitArea = false; } } else if (typeof shape === 'function' && !callback) @@ -168964,7 +170593,7 @@ var InputPlugin = new Class({ var io = (!gameObject.input) ? CreateInteractiveObject(gameObject, shape, callback) : gameObject.input; - io.customHitArea = true; + io.customHitArea = customHitArea; io.dropZone = dropZone; io.cursor = (useHandCursor) ? 'pointer' : cursor; @@ -169140,6 +170769,145 @@ var InputPlugin = new Class({ return this.setHitArea(gameObjects, shape, callback); }, + /** + * Creates an Input Debug Shape for the given Game Object. + * + * The Game Object must have _already_ been enabled for input prior to calling this method. + * + * This is intended to assist you during development and debugging. + * + * Debug Shapes can only be created for Game Objects that are using standard Phaser Geometry for input, + * including: Circle, Ellipse, Line, Polygon, Rectangle and Triangle. + * + * Game Objects that are using their automatic hit areas are using Rectangles by default, so will also work. + * + * The Debug Shape is created and added to the display list and is then kept in sync with the Game Object + * it is connected with. Should you need to modify it yourself, such as to hide it, you can access it via + * the Game Object property: `GameObject.input.hitAreaDebug`. + * + * Calling this method on a Game Object that already has a Debug Shape will first destroy the old shape, + * before creating a new one. If you wish to remove the Debug Shape entirely, you should call the + * method `InputPlugin.removeDebug`. + * + * Note that the debug shape will only show the outline of the input area. If the input test is using a + * pixel perfect check, for example, then this is not displayed. If you are using a custom shape, that + * doesn't extend one of the base Phaser Geometry objects, as your hit area, then this method will not + * work. + * + * @method Phaser.Input.InputPlugin#enableDebug + * @since 3.19.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to create the input debug shape for. + * @param {number} [color=0x00ff00] - The outline color of the debug shape. + * + * @return {Phaser.Input.InputPlugin} This Input Plugin. + */ + enableDebug: function (gameObject, color) + { + if (color === undefined) { color = 0x00ff00; } + + var input = gameObject.input; + + if (!input || !input.hitArea) + { + return this; + } + + var shape = input.hitArea; + var shapeType = shape.type; + var debug = input.hitAreaDebug; + var factory = this.systems.add; + var updateList = this.systems.updateList; + + if (debug) + { + updateList.remove(debug); + + debug.destroy(); + + debug = null; + } + + switch (shapeType) + { + case GEOM_CONST.CIRCLE: + debug = factory.arc(0, 0, shape.radius); + break; + + case GEOM_CONST.ELLIPSE: + debug = factory.ellipse(0, 0, shape.width, shape.height); + break; + + case GEOM_CONST.LINE: + debug = factory.line(0, 0, shape.x1, shape.y1, shape.x2, shape.y2); + break; + + case GEOM_CONST.POLYGON: + debug = factory.polygon(0, 0, shape.points); + break; + + case GEOM_CONST.RECTANGLE: + debug = factory.rectangle(0, 0, shape.width, shape.height); + break; + + case GEOM_CONST.TRIANGLE: + debug = factory.triangle(0, 0, shape.x1, shape.y1, shape.x2, shape.y2, shape.x3, shape.y3); + break; + } + + if (debug) + { + debug.isFilled = false; + + debug.preUpdate = function () + { + debug.setStrokeStyle(1 / gameObject.scale, color); + + debug.setDisplayOrigin(gameObject.displayOriginX, gameObject.displayOriginY); + debug.setRotation(gameObject.rotation); + debug.setScale(gameObject.scaleX, gameObject.scaleY); + debug.setPosition(gameObject.x, gameObject.y); + debug.setScrollFactor(gameObject.scrollFactorX, gameObject.scrollFactorY); + }; + + updateList.add(debug); + + input.hitAreaDebug = debug; + } + + return this; + }, + + /** + * Removes an Input Debug Shape from the given Game Object. + * + * The shape is destroyed immediately and the `hitAreaDebug` property is set to `null`. + * + * @method Phaser.Input.InputPlugin#removeDebug + * @since 3.19.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to remove the input debug shape from. + * + * @return {Phaser.Input.InputPlugin} This Input Plugin. + */ + removeDebug: function (gameObject) + { + var input = gameObject.input; + + if (input && input.hitAreaDebug) + { + var debug = input.hitAreaDebug; + + this.systems.updateList.remove(debug); + + debug.destroy(); + + input.hitAreaDebug = null; + } + + return this; + }, + /** * Sets the Pointers to always poll. * @@ -169781,7 +171549,7 @@ module.exports = InputPlugin; /***/ }), -/* 1197 */ +/* 1202 */ /***/ (function(module, exports) { /** @@ -169817,7 +171585,7 @@ module.exports = CreatePixelPerfectHandler; /***/ }), -/* 1198 */ +/* 1203 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169832,26 +171600,26 @@ module.exports = CreatePixelPerfectHandler; module.exports = { - Events: __webpack_require__(140), + Events: __webpack_require__(141), - KeyboardManager: __webpack_require__(362), - KeyboardPlugin: __webpack_require__(1206), + KeyboardManager: __webpack_require__(365), + KeyboardPlugin: __webpack_require__(1211), - Key: __webpack_require__(451), - KeyCodes: __webpack_require__(129), + Key: __webpack_require__(454), + KeyCodes: __webpack_require__(130), - KeyCombo: __webpack_require__(452), + KeyCombo: __webpack_require__(455), - JustDown: __webpack_require__(1211), - JustUp: __webpack_require__(1212), - DownDuration: __webpack_require__(1213), - UpDuration: __webpack_require__(1214) + JustDown: __webpack_require__(1216), + JustUp: __webpack_require__(1217), + DownDuration: __webpack_require__(1218), + UpDuration: __webpack_require__(1219) }; /***/ }), -/* 1199 */ +/* 1204 */ /***/ (function(module, exports) { /** @@ -169887,7 +171655,7 @@ module.exports = 'keydown'; /***/ }), -/* 1200 */ +/* 1205 */ /***/ (function(module, exports) { /** @@ -169916,7 +171684,7 @@ module.exports = 'keyup'; /***/ }), -/* 1201 */ +/* 1206 */ /***/ (function(module, exports) { /** @@ -169950,7 +171718,7 @@ module.exports = 'keycombomatch'; /***/ }), -/* 1202 */ +/* 1207 */ /***/ (function(module, exports) { /** @@ -169984,7 +171752,7 @@ module.exports = 'down'; /***/ }), -/* 1203 */ +/* 1208 */ /***/ (function(module, exports) { /** @@ -170023,7 +171791,7 @@ module.exports = 'keydown-'; /***/ }), -/* 1204 */ +/* 1209 */ /***/ (function(module, exports) { /** @@ -170055,7 +171823,7 @@ module.exports = 'keyup-'; /***/ }), -/* 1205 */ +/* 1210 */ /***/ (function(module, exports) { /** @@ -170089,7 +171857,7 @@ module.exports = 'up'; /***/ }), -/* 1206 */ +/* 1211 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170100,16 +171868,16 @@ module.exports = 'up'; var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(9); -var Events = __webpack_require__(140); -var GameEvents = __webpack_require__(30); +var Events = __webpack_require__(141); +var GameEvents = __webpack_require__(22); var GetValue = __webpack_require__(5); -var InputEvents = __webpack_require__(54); -var InputPluginCache = __webpack_require__(139); -var Key = __webpack_require__(451); -var KeyCodes = __webpack_require__(129); -var KeyCombo = __webpack_require__(452); -var KeyMap = __webpack_require__(1210); -var SnapFloor = __webpack_require__(100); +var InputEvents = __webpack_require__(55); +var InputPluginCache = __webpack_require__(140); +var Key = __webpack_require__(454); +var KeyCodes = __webpack_require__(130); +var KeyCombo = __webpack_require__(455); +var KeyMap = __webpack_require__(1215); +var SnapFloor = __webpack_require__(102); /** * @classdesc @@ -170975,7 +172743,7 @@ module.exports = KeyboardPlugin; /***/ }), -/* 1207 */ +/* 1212 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170984,7 +172752,7 @@ module.exports = KeyboardPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AdvanceKeyCombo = __webpack_require__(1208); +var AdvanceKeyCombo = __webpack_require__(1213); /** * Used internally by the KeyCombo class. @@ -171056,7 +172824,7 @@ module.exports = ProcessKeyCombo; /***/ }), -/* 1208 */ +/* 1213 */ /***/ (function(module, exports) { /** @@ -171098,7 +172866,7 @@ module.exports = AdvanceKeyCombo; /***/ }), -/* 1209 */ +/* 1214 */ /***/ (function(module, exports) { /** @@ -171133,7 +172901,7 @@ module.exports = ResetKeyCombo; /***/ }), -/* 1210 */ +/* 1215 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171142,7 +172910,7 @@ module.exports = ResetKeyCombo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var KeyCodes = __webpack_require__(129); +var KeyCodes = __webpack_require__(130); var KeyMap = {}; @@ -171155,7 +172923,7 @@ module.exports = KeyMap; /***/ }), -/* 1211 */ +/* 1216 */ /***/ (function(module, exports) { /** @@ -171197,7 +172965,7 @@ module.exports = JustDown; /***/ }), -/* 1212 */ +/* 1217 */ /***/ (function(module, exports) { /** @@ -171239,7 +173007,7 @@ module.exports = JustUp; /***/ }), -/* 1213 */ +/* 1218 */ /***/ (function(module, exports) { /** @@ -171273,7 +173041,7 @@ module.exports = DownDuration; /***/ }), -/* 1214 */ +/* 1219 */ /***/ (function(module, exports) { /** @@ -171307,7 +173075,7 @@ module.exports = UpDuration; /***/ }), -/* 1215 */ +/* 1220 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171323,14 +173091,14 @@ module.exports = UpDuration; /* eslint-disable */ module.exports = { - MouseManager: __webpack_require__(363) + MouseManager: __webpack_require__(366) }; /* eslint-enable */ /***/ }), -/* 1216 */ +/* 1221 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171346,14 +173114,14 @@ module.exports = { /* eslint-disable */ module.exports = { - TouchManager: __webpack_require__(365) + TouchManager: __webpack_require__(368) }; /* eslint-enable */ /***/ }), -/* 1217 */ +/* 1222 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171362,8 +173130,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(19); -var Extend = __webpack_require__(20); +var CONST = __webpack_require__(20); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Loader @@ -171373,16 +173141,16 @@ var Loader = { Events: __webpack_require__(86), - FileTypes: __webpack_require__(1218), + FileTypes: __webpack_require__(1223), - File: __webpack_require__(21), + File: __webpack_require__(23), FileTypesManager: __webpack_require__(8), - GetURL: __webpack_require__(217), - LoaderPlugin: __webpack_require__(1241), - MergeXHRSettings: __webpack_require__(218), - MultiFile: __webpack_require__(65), - XHRLoader: __webpack_require__(453), - XHRSettings: __webpack_require__(141) + GetURL: __webpack_require__(219), + LoaderPlugin: __webpack_require__(1246), + MergeXHRSettings: __webpack_require__(220), + MultiFile: __webpack_require__(66), + XHRLoader: __webpack_require__(456), + XHRSettings: __webpack_require__(142) }; @@ -171393,7 +173161,7 @@ module.exports = Loader; /***/ }), -/* 1218 */ +/* 1223 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171408,41 +173176,41 @@ module.exports = Loader; module.exports = { - AnimationJSONFile: __webpack_require__(1219), - AtlasJSONFile: __webpack_require__(1220), - AtlasXMLFile: __webpack_require__(1221), - AudioFile: __webpack_require__(454), - AudioSpriteFile: __webpack_require__(1222), - BinaryFile: __webpack_require__(1223), - BitmapFontFile: __webpack_require__(1224), - CSSFile: __webpack_require__(1225), - GLSLFile: __webpack_require__(1226), - HTML5AudioFile: __webpack_require__(455), - HTMLFile: __webpack_require__(1227), - HTMLTextureFile: __webpack_require__(1228), + AnimationJSONFile: __webpack_require__(1224), + AtlasJSONFile: __webpack_require__(1225), + AtlasXMLFile: __webpack_require__(1226), + AudioFile: __webpack_require__(457), + AudioSpriteFile: __webpack_require__(1227), + BinaryFile: __webpack_require__(1228), + BitmapFontFile: __webpack_require__(1229), + CSSFile: __webpack_require__(1230), + GLSLFile: __webpack_require__(1231), + HTML5AudioFile: __webpack_require__(458), + HTMLFile: __webpack_require__(1232), + HTMLTextureFile: __webpack_require__(1233), ImageFile: __webpack_require__(75), - JSONFile: __webpack_require__(64), - MultiAtlasFile: __webpack_require__(1229), - MultiScriptFile: __webpack_require__(1230), - PackFile: __webpack_require__(1231), - PluginFile: __webpack_require__(1232), - SceneFile: __webpack_require__(1233), - ScenePluginFile: __webpack_require__(1234), - ScriptFile: __webpack_require__(456), - SpriteSheetFile: __webpack_require__(1235), - SVGFile: __webpack_require__(1236), - TextFile: __webpack_require__(457), - TilemapCSVFile: __webpack_require__(1237), - TilemapImpactFile: __webpack_require__(1238), - TilemapJSONFile: __webpack_require__(1239), - UnityAtlasFile: __webpack_require__(1240), - XMLFile: __webpack_require__(219) + JSONFile: __webpack_require__(65), + MultiAtlasFile: __webpack_require__(1234), + MultiScriptFile: __webpack_require__(1235), + PackFile: __webpack_require__(1236), + PluginFile: __webpack_require__(1237), + SceneFile: __webpack_require__(1238), + ScenePluginFile: __webpack_require__(1239), + ScriptFile: __webpack_require__(459), + SpriteSheetFile: __webpack_require__(1240), + SVGFile: __webpack_require__(1241), + TextFile: __webpack_require__(460), + TilemapCSVFile: __webpack_require__(1242), + TilemapImpactFile: __webpack_require__(1243), + TilemapJSONFile: __webpack_require__(1244), + UnityAtlasFile: __webpack_require__(1245), + XMLFile: __webpack_require__(221) }; /***/ }), -/* 1219 */ +/* 1224 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171453,7 +173221,7 @@ module.exports = { var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(64); +var JSONFile = __webpack_require__(65); var LoaderEvents = __webpack_require__(86); /** @@ -171645,7 +173413,7 @@ module.exports = AnimationJSONFile; /***/ }), -/* 1220 */ +/* 1225 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171659,8 +173427,8 @@ var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var ImageFile = __webpack_require__(75); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(64); -var MultiFile = __webpack_require__(65); +var JSONFile = __webpack_require__(65); +var MultiFile = __webpack_require__(66); /** * @classdesc @@ -171894,7 +173662,7 @@ module.exports = AtlasJSONFile; /***/ }), -/* 1221 */ +/* 1226 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171908,8 +173676,8 @@ var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var ImageFile = __webpack_require__(75); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(65); -var XMLFile = __webpack_require__(219); +var MultiFile = __webpack_require__(66); +var XMLFile = __webpack_require__(221); /** * @classdesc @@ -172137,7 +173905,7 @@ module.exports = AtlasXMLFile; /***/ }), -/* 1222 */ +/* 1227 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172146,13 +173914,13 @@ module.exports = AtlasXMLFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AudioFile = __webpack_require__(454); +var AudioFile = __webpack_require__(457); var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(64); -var MultiFile = __webpack_require__(65); +var JSONFile = __webpack_require__(65); +var MultiFile = __webpack_require__(66); /** * @classdesc @@ -172427,7 +174195,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio /***/ }), -/* 1223 */ +/* 1228 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172437,8 +174205,8 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); @@ -172609,7 +174377,7 @@ module.exports = BinaryFile; /***/ }), -/* 1224 */ +/* 1229 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172623,9 +174391,9 @@ var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var ImageFile = __webpack_require__(75); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(65); -var ParseXMLBitmapFont = __webpack_require__(194); -var XMLFile = __webpack_require__(219); +var MultiFile = __webpack_require__(66); +var ParseXMLBitmapFont = __webpack_require__(196); +var XMLFile = __webpack_require__(221); /** * @classdesc @@ -172852,7 +174620,7 @@ module.exports = BitmapFontFile; /***/ }), -/* 1225 */ +/* 1230 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172862,8 +174630,8 @@ module.exports = BitmapFontFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); @@ -173020,7 +174788,7 @@ module.exports = CSSFile; /***/ }), -/* 1226 */ +/* 1231 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173030,12 +174798,12 @@ module.exports = CSSFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); -var Shader = __webpack_require__(349); +var Shader = __webpack_require__(352); /** * @classdesc @@ -173431,7 +175199,7 @@ module.exports = GLSLFile; /***/ }), -/* 1227 */ +/* 1232 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173441,8 +175209,8 @@ module.exports = GLSLFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); @@ -173606,7 +175374,7 @@ module.exports = HTMLFile; /***/ }), -/* 1228 */ +/* 1233 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173616,8 +175384,8 @@ module.exports = HTMLFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); @@ -173864,7 +175632,7 @@ module.exports = HTMLTextureFile; /***/ }), -/* 1229 */ +/* 1234 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173878,8 +175646,8 @@ var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var ImageFile = __webpack_require__(75); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(64); -var MultiFile = __webpack_require__(65); +var JSONFile = __webpack_require__(65); +var MultiFile = __webpack_require__(66); /** * @classdesc @@ -174188,7 +175956,7 @@ module.exports = MultiAtlasFile; /***/ }), -/* 1230 */ +/* 1235 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174201,8 +175969,8 @@ var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(65); -var ScriptFile = __webpack_require__(456); +var MultiFile = __webpack_require__(66); +var ScriptFile = __webpack_require__(459); /** * @classdesc @@ -174405,7 +176173,7 @@ module.exports = MultiScriptFile; /***/ }), -/* 1231 */ +/* 1236 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174415,9 +176183,9 @@ module.exports = MultiScriptFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); +var CONST = __webpack_require__(20); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(64); +var JSONFile = __webpack_require__(65); /** * @classdesc @@ -174623,7 +176391,7 @@ module.exports = PackFile; /***/ }), -/* 1232 */ +/* 1237 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174633,8 +176401,8 @@ module.exports = PackFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); @@ -174835,7 +176603,7 @@ module.exports = PluginFile; /***/ }), -/* 1233 */ +/* 1238 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174845,8 +176613,8 @@ module.exports = PluginFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); @@ -175053,7 +176821,7 @@ module.exports = SceneFile; /***/ }), -/* 1234 */ +/* 1239 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175063,8 +176831,8 @@ module.exports = SceneFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); @@ -175259,7 +177027,7 @@ module.exports = ScenePluginFile; /***/ }), -/* 1235 */ +/* 1240 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175450,7 +177218,7 @@ module.exports = SpriteSheetFile; /***/ }), -/* 1236 */ +/* 1241 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175460,8 +177228,8 @@ module.exports = SpriteSheetFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); @@ -175789,7 +177557,7 @@ module.exports = SVGFile; /***/ }), -/* 1237 */ +/* 1242 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175799,12 +177567,12 @@ module.exports = SVGFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var File = __webpack_require__(21); +var CONST = __webpack_require__(20); +var File = __webpack_require__(23); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(7); -var TILEMAP_FORMATS = __webpack_require__(34); +var TILEMAP_FORMATS = __webpack_require__(33); /** * @classdesc @@ -175984,7 +177752,7 @@ module.exports = TilemapCSVFile; /***/ }), -/* 1238 */ +/* 1243 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175995,8 +177763,8 @@ module.exports = TilemapCSVFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(64); -var TILEMAP_FORMATS = __webpack_require__(34); +var JSONFile = __webpack_require__(65); +var TILEMAP_FORMATS = __webpack_require__(33); /** * @classdesc @@ -176140,7 +177908,7 @@ module.exports = TilemapImpactFile; /***/ }), -/* 1239 */ +/* 1244 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176151,8 +177919,8 @@ module.exports = TilemapImpactFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(64); -var TILEMAP_FORMATS = __webpack_require__(34); +var JSONFile = __webpack_require__(65); +var TILEMAP_FORMATS = __webpack_require__(33); /** * @classdesc @@ -176296,7 +178064,7 @@ module.exports = TilemapJSONFile; /***/ }), -/* 1240 */ +/* 1245 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176310,8 +178078,8 @@ var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); var ImageFile = __webpack_require__(75); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(65); -var TextFile = __webpack_require__(457); +var MultiFile = __webpack_require__(66); +var TextFile = __webpack_require__(460); /** * @classdesc @@ -176538,7 +178306,7 @@ module.exports = UnityAtlasFile; /***/ }), -/* 1241 */ +/* 1246 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176548,15 +178316,15 @@ module.exports = UnityAtlasFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(19); -var CustomSet = __webpack_require__(105); +var CONST = __webpack_require__(20); +var CustomSet = __webpack_require__(107); var EventEmitter = __webpack_require__(9); var Events = __webpack_require__(86); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(1); -var PluginCache = __webpack_require__(17); -var SceneEvents = __webpack_require__(18); -var XHRSettings = __webpack_require__(141); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var XHRSettings = __webpack_require__(142); /** * @classdesc @@ -177605,7 +179373,7 @@ module.exports = LoaderPlugin; /***/ }), -/* 1242 */ +/* 1247 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -177624,15 +179392,15 @@ module.exports = LoaderPlugin; module.exports = { - Arcade: __webpack_require__(1243), - Impact: __webpack_require__(1274), - Matter: __webpack_require__(1297) + Arcade: __webpack_require__(1248), + Impact: __webpack_require__(1279), + Matter: __webpack_require__(1302) }; /***/ }), -/* 1243 */ +/* 1248 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -177641,8 +179409,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(56); -var Extend = __webpack_require__(20); +var CONST = __webpack_require__(57); +var Extend = __webpack_require__(15); /** * @callback ArcadePhysicsCallback @@ -177657,18 +179425,18 @@ var Extend = __webpack_require__(20); var Arcade = { - ArcadePhysics: __webpack_require__(1244), - Body: __webpack_require__(463), - Collider: __webpack_require__(464), - Components: __webpack_require__(220), - Events: __webpack_require__(221), - Factory: __webpack_require__(458), - Group: __webpack_require__(460), - Image: __webpack_require__(459), - Sprite: __webpack_require__(142), - StaticBody: __webpack_require__(470), - StaticGroup: __webpack_require__(461), - World: __webpack_require__(462) + ArcadePhysics: __webpack_require__(1249), + Body: __webpack_require__(466), + Collider: __webpack_require__(467), + Components: __webpack_require__(222), + Events: __webpack_require__(223), + Factory: __webpack_require__(461), + Group: __webpack_require__(463), + Image: __webpack_require__(462), + Sprite: __webpack_require__(143), + StaticBody: __webpack_require__(473), + StaticGroup: __webpack_require__(464), + World: __webpack_require__(465) }; @@ -177679,7 +179447,7 @@ module.exports = Arcade; /***/ }), -/* 1244 */ +/* 1249 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -177690,16 +179458,16 @@ module.exports = Arcade; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(40); -var DistanceBetween = __webpack_require__(62); -var DistanceSquared = __webpack_require__(310); -var Factory = __webpack_require__(458); +var DistanceBetween = __webpack_require__(63); +var DistanceSquared = __webpack_require__(313); +var Factory = __webpack_require__(461); var GetFastValue = __webpack_require__(1); -var Merge = __webpack_require__(69); -var OverlapRect = __webpack_require__(1257); -var PluginCache = __webpack_require__(17); -var SceneEvents = __webpack_require__(18); +var Merge = __webpack_require__(87); +var OverlapRect = __webpack_require__(1262); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); var Vector2 = __webpack_require__(3); -var World = __webpack_require__(462); +var World = __webpack_require__(465); /** * @classdesc @@ -178306,7 +180074,7 @@ module.exports = ArcadePhysics; /***/ }), -/* 1245 */ +/* 1250 */ /***/ (function(module, exports) { /** @@ -178381,7 +180149,7 @@ module.exports = Acceleration; /***/ }), -/* 1246 */ +/* 1251 */ /***/ (function(module, exports) { /** @@ -178463,7 +180231,7 @@ module.exports = Angular; /***/ }), -/* 1247 */ +/* 1252 */ /***/ (function(module, exports) { /** @@ -178562,7 +180330,7 @@ module.exports = Bounce; /***/ }), -/* 1248 */ +/* 1253 */ /***/ (function(module, exports) { /** @@ -178689,7 +180457,7 @@ module.exports = Debug; /***/ }), -/* 1249 */ +/* 1254 */ /***/ (function(module, exports) { /** @@ -178822,7 +180590,7 @@ module.exports = Drag; /***/ }), -/* 1250 */ +/* 1255 */ /***/ (function(module, exports) { /** @@ -178946,7 +180714,7 @@ module.exports = Enable; /***/ }), -/* 1251 */ +/* 1256 */ /***/ (function(module, exports) { /** @@ -179024,7 +180792,7 @@ module.exports = Friction; /***/ }), -/* 1252 */ +/* 1257 */ /***/ (function(module, exports) { /** @@ -179102,7 +180870,7 @@ module.exports = Gravity; /***/ }), -/* 1253 */ +/* 1258 */ /***/ (function(module, exports) { /** @@ -179144,7 +180912,7 @@ module.exports = Immovable; /***/ }), -/* 1254 */ +/* 1259 */ /***/ (function(module, exports) { /** @@ -179184,7 +180952,7 @@ module.exports = Mass; /***/ }), -/* 1255 */ +/* 1260 */ /***/ (function(module, exports) { /** @@ -179266,7 +181034,7 @@ module.exports = Size; /***/ }), -/* 1256 */ +/* 1261 */ /***/ (function(module, exports) { /** @@ -179365,7 +181133,7 @@ module.exports = Velocity; /***/ }), -/* 1257 */ +/* 1262 */ /***/ (function(module, exports) { /** @@ -179450,7 +181218,7 @@ module.exports = OverlapRect; /***/ }), -/* 1258 */ +/* 1263 */ /***/ (function(module, exports) { /** @@ -179483,7 +181251,7 @@ module.exports = 'collide'; /***/ }), -/* 1259 */ +/* 1264 */ /***/ (function(module, exports) { /** @@ -179516,7 +181284,7 @@ module.exports = 'overlap'; /***/ }), -/* 1260 */ +/* 1265 */ /***/ (function(module, exports) { /** @@ -179539,7 +181307,7 @@ module.exports = 'pause'; /***/ }), -/* 1261 */ +/* 1266 */ /***/ (function(module, exports) { /** @@ -179562,7 +181330,7 @@ module.exports = 'resume'; /***/ }), -/* 1262 */ +/* 1267 */ /***/ (function(module, exports) { /** @@ -179594,7 +181362,7 @@ module.exports = 'tilecollide'; /***/ }), -/* 1263 */ +/* 1268 */ /***/ (function(module, exports) { /** @@ -179626,7 +181394,7 @@ module.exports = 'tileoverlap'; /***/ }), -/* 1264 */ +/* 1269 */ /***/ (function(module, exports) { /** @@ -179658,7 +181426,7 @@ module.exports = 'worldbounds'; /***/ }), -/* 1265 */ +/* 1270 */ /***/ (function(module, exports) { /** @@ -179684,7 +181452,7 @@ module.exports = 'worldstep'; /***/ }), -/* 1266 */ +/* 1271 */ /***/ (function(module, exports) { /** @@ -179725,7 +181493,7 @@ module.exports = ProcessTileCallbacks; /***/ }), -/* 1267 */ +/* 1272 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -179734,9 +181502,9 @@ module.exports = ProcessTileCallbacks; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileCheckX = __webpack_require__(1268); -var TileCheckY = __webpack_require__(1270); -var TileIntersectsBody = __webpack_require__(469); +var TileCheckX = __webpack_require__(1273); +var TileCheckY = __webpack_require__(1275); +var TileIntersectsBody = __webpack_require__(472); /** * The core separation function to separate a physics body and a tile. @@ -179845,7 +181613,7 @@ module.exports = SeparateTile; /***/ }), -/* 1268 */ +/* 1273 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -179854,7 +181622,7 @@ module.exports = SeparateTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ProcessTileSeparationX = __webpack_require__(1269); +var ProcessTileSeparationX = __webpack_require__(1274); /** * Check the body against the given tile on the X axis. @@ -179935,7 +181703,7 @@ module.exports = TileCheckX; /***/ }), -/* 1269 */ +/* 1274 */ /***/ (function(module, exports) { /** @@ -179982,7 +181750,7 @@ module.exports = ProcessTileSeparationX; /***/ }), -/* 1270 */ +/* 1275 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -179991,7 +181759,7 @@ module.exports = ProcessTileSeparationX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ProcessTileSeparationY = __webpack_require__(1271); +var ProcessTileSeparationY = __webpack_require__(1276); /** * Check the body against the given tile on the Y axis. @@ -180072,7 +181840,7 @@ module.exports = TileCheckY; /***/ }), -/* 1271 */ +/* 1276 */ /***/ (function(module, exports) { /** @@ -180119,7 +181887,7 @@ module.exports = ProcessTileSeparationY; /***/ }), -/* 1272 */ +/* 1277 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180128,7 +181896,7 @@ module.exports = ProcessTileSeparationY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetOverlapX = __webpack_require__(465); +var GetOverlapX = __webpack_require__(468); /** * Separates two overlapping bodies on the X-axis (horizontally). @@ -180210,7 +181978,7 @@ module.exports = SeparateX; /***/ }), -/* 1273 */ +/* 1278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180219,7 +181987,7 @@ module.exports = SeparateX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetOverlapY = __webpack_require__(466); +var GetOverlapY = __webpack_require__(469); /** * Separates two overlapping bodies on the Y-axis (vertically). @@ -180301,7 +182069,7 @@ module.exports = SeparateY; /***/ }), -/* 1274 */ +/* 1279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180327,23 +182095,23 @@ module.exports = SeparateY; */ module.exports = { - Body: __webpack_require__(471), - Events: __webpack_require__(222), - COLLIDES: __webpack_require__(108), - CollisionMap: __webpack_require__(472), - Factory: __webpack_require__(473), - Image: __webpack_require__(475), - ImpactBody: __webpack_require__(474), - ImpactPhysics: __webpack_require__(1293), - Sprite: __webpack_require__(476), - TYPE: __webpack_require__(109), - World: __webpack_require__(477) + Body: __webpack_require__(474), + Events: __webpack_require__(224), + COLLIDES: __webpack_require__(109), + CollisionMap: __webpack_require__(475), + Factory: __webpack_require__(476), + Image: __webpack_require__(478), + ImpactBody: __webpack_require__(477), + ImpactPhysics: __webpack_require__(1298), + Sprite: __webpack_require__(479), + TYPE: __webpack_require__(110), + World: __webpack_require__(480) }; /***/ }), -/* 1275 */ +/* 1280 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180352,7 +182120,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); /** * [description] @@ -180399,7 +182167,7 @@ module.exports = GetVelocity; /***/ }), -/* 1276 */ +/* 1281 */ /***/ (function(module, exports) { /** @@ -180494,7 +182262,7 @@ module.exports = UpdateMotion; /***/ }), -/* 1277 */ +/* 1282 */ /***/ (function(module, exports) { /** @@ -180521,7 +182289,7 @@ module.exports = 'collide'; /***/ }), -/* 1278 */ +/* 1283 */ /***/ (function(module, exports) { /** @@ -180544,7 +182312,7 @@ module.exports = 'pause'; /***/ }), -/* 1279 */ +/* 1284 */ /***/ (function(module, exports) { /** @@ -180567,7 +182335,7 @@ module.exports = 'resume'; /***/ }), -/* 1280 */ +/* 1285 */ /***/ (function(module, exports) { /** @@ -180638,7 +182406,7 @@ module.exports = { /***/ }), -/* 1281 */ +/* 1286 */ /***/ (function(module, exports) { /** @@ -180715,7 +182483,7 @@ module.exports = Acceleration; /***/ }), -/* 1282 */ +/* 1287 */ /***/ (function(module, exports) { /** @@ -180789,7 +182557,7 @@ module.exports = BodyScale; /***/ }), -/* 1283 */ +/* 1288 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180798,7 +182566,7 @@ module.exports = BodyScale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TYPE = __webpack_require__(109); +var TYPE = __webpack_require__(110); /** * The Impact Body Type component. @@ -180873,7 +182641,7 @@ module.exports = BodyType; /***/ }), -/* 1284 */ +/* 1289 */ /***/ (function(module, exports) { /** @@ -180953,7 +182721,7 @@ module.exports = Bounce; /***/ }), -/* 1285 */ +/* 1290 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180962,7 +182730,7 @@ module.exports = Bounce; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TYPE = __webpack_require__(109); +var TYPE = __webpack_require__(110); /** * The Impact Check Against component. @@ -181075,7 +182843,7 @@ module.exports = CheckAgainst; /***/ }), -/* 1286 */ +/* 1291 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181084,7 +182852,7 @@ module.exports = CheckAgainst; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var COLLIDES = __webpack_require__(108); +var COLLIDES = __webpack_require__(109); /** * @callback CollideCallback @@ -181231,7 +182999,7 @@ module.exports = Collides; /***/ }), -/* 1287 */ +/* 1292 */ /***/ (function(module, exports) { /** @@ -181356,7 +183124,7 @@ module.exports = Debug; /***/ }), -/* 1288 */ +/* 1293 */ /***/ (function(module, exports) { /** @@ -181433,7 +183201,7 @@ module.exports = Friction; /***/ }), -/* 1289 */ +/* 1294 */ /***/ (function(module, exports) { /** @@ -181495,7 +183263,7 @@ module.exports = Gravity; /***/ }), -/* 1290 */ +/* 1295 */ /***/ (function(module, exports) { /** @@ -181545,7 +183313,7 @@ module.exports = Offset; /***/ }), -/* 1291 */ +/* 1296 */ /***/ (function(module, exports) { /** @@ -181621,7 +183389,7 @@ module.exports = SetGameObject; /***/ }), -/* 1292 */ +/* 1297 */ /***/ (function(module, exports) { /** @@ -181721,7 +183489,7 @@ module.exports = Velocity; /***/ }), -/* 1293 */ +/* 1298 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181731,12 +183499,12 @@ module.exports = Velocity; */ var Class = __webpack_require__(0); -var Factory = __webpack_require__(473); +var Factory = __webpack_require__(476); var GetFastValue = __webpack_require__(1); -var Merge = __webpack_require__(69); -var PluginCache = __webpack_require__(17); -var SceneEvents = __webpack_require__(18); -var World = __webpack_require__(477); +var Merge = __webpack_require__(87); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var World = __webpack_require__(480); /** * @classdesc @@ -181938,7 +183706,7 @@ module.exports = ImpactPhysics; /***/ }), -/* 1294 */ +/* 1299 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181947,10 +183715,10 @@ module.exports = ImpactPhysics; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var COLLIDES = __webpack_require__(108); -var Events = __webpack_require__(222); -var SeparateX = __webpack_require__(1295); -var SeparateY = __webpack_require__(1296); +var COLLIDES = __webpack_require__(109); +var Events = __webpack_require__(224); +var SeparateX = __webpack_require__(1300); +var SeparateY = __webpack_require__(1301); /** * Impact Physics Solver @@ -182014,7 +183782,7 @@ module.exports = Solver; /***/ }), -/* 1295 */ +/* 1300 */ /***/ (function(module, exports) { /** @@ -182070,7 +183838,7 @@ module.exports = SeparateX; /***/ }), -/* 1296 */ +/* 1301 */ /***/ (function(module, exports) { /** @@ -182155,7 +183923,7 @@ module.exports = SeparateY; /***/ }), -/* 1297 */ +/* 1302 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182170,14 +183938,15 @@ module.exports = SeparateY; module.exports = { - Factory: __webpack_require__(478), - Image: __webpack_require__(481), - Matter: __webpack_require__(229), - MatterPhysics: __webpack_require__(1328), - PolyDecomp: __webpack_require__(479), - Sprite: __webpack_require__(482), - TileBody: __webpack_require__(226), - World: __webpack_require__(488) + Factory: __webpack_require__(481), + Image: __webpack_require__(485), + Matter: __webpack_require__(231), + MatterPhysics: __webpack_require__(1332), + PolyDecomp: __webpack_require__(482), + Sprite: __webpack_require__(486), + TileBody: __webpack_require__(228), + PhysicsEditorParser: __webpack_require__(484), + World: __webpack_require__(492) }; @@ -182259,7 +184028,7 @@ module.exports = { /***/ }), -/* 1298 */ +/* 1303 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182268,7 +184037,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Components = __webpack_require__(143); +var Components = __webpack_require__(144); var GetFastValue = __webpack_require__(1); var Vector2 = __webpack_require__(3); @@ -182377,7 +184146,7 @@ module.exports = MatterGameObject; /***/ }), -/* 1299 */ +/* 1304 */ /***/ (function(module, exports) { /** @@ -182417,7 +184186,7 @@ module.exports = Bounce; /***/ }), -/* 1300 */ +/* 1305 */ /***/ (function(module, exports) { /** @@ -182505,7 +184274,7 @@ module.exports = Collision; /***/ }), -/* 1301 */ +/* 1306 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182514,7 +184283,7 @@ module.exports = Collision; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(24); +var Body = __webpack_require__(25); /** * A component to apply force to Matter.js bodies. @@ -182653,7 +184422,7 @@ module.exports = Force; /***/ }), -/* 1302 */ +/* 1307 */ /***/ (function(module, exports) { /** @@ -182739,7 +184508,7 @@ module.exports = Friction; /***/ }), -/* 1303 */ +/* 1308 */ /***/ (function(module, exports) { /** @@ -182779,7 +184548,7 @@ module.exports = Gravity; /***/ }), -/* 1304 */ +/* 1309 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182788,7 +184557,7 @@ module.exports = Gravity; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(24); +var Body = __webpack_require__(25); var Vector2 = __webpack_require__(3); /** @@ -182857,7 +184626,7 @@ module.exports = Mass; /***/ }), -/* 1305 */ +/* 1310 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182866,7 +184635,7 @@ module.exports = Mass; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(24); +var Body = __webpack_require__(25); /** * [description] @@ -182912,7 +184681,7 @@ module.exports = Static; /***/ }), -/* 1306 */ +/* 1311 */ /***/ (function(module, exports) { /** @@ -182965,7 +184734,7 @@ module.exports = Sensor; /***/ }), -/* 1307 */ +/* 1312 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182974,11 +184743,11 @@ module.exports = Sensor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(57); -var Body = __webpack_require__(24); +var Bodies = __webpack_require__(58); +var Body = __webpack_require__(25); var GetFastValue = __webpack_require__(1); -var PhysicsEditorParser = __webpack_require__(1308); -var Vertices = __webpack_require__(32); +var PhysicsEditorParser = __webpack_require__(484); +var Vertices = __webpack_require__(31); /** * [description] @@ -183215,184 +184984,7 @@ module.exports = SetBody; /***/ }), -/* 1308 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Joachim Grill - * @copyright 2018 CodeAndWeb GmbH - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Bodies = __webpack_require__(57); -var Body = __webpack_require__(24); -var Bounds = __webpack_require__(38); -var Common = __webpack_require__(16); -var GetFastValue = __webpack_require__(1); -var Vector = __webpack_require__(37); -var Vertices = __webpack_require__(32); - -/** - * Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file - * created and exported with PhysicsEditor (https://www.codeandweb.com/physicseditor). - * - * @namespace Phaser.Physics.Matter.PhysicsEditorParser - * @since 3.10.0 - */ -var PhysicsEditorParser = { - - /** - * Parses a body element exported by PhysicsEditor. - * - * @function Phaser.Physics.Matter.PhysicsEditorParser.parseBody - * @since 3.10.0 - * - * @param {number} x - x position. - * @param {number} y - y position. - * @param {number} w - width. - * @param {number} h - height. - * @param {object} config - body configuration and fixture (child body) definitions. - * - * @return {object} A matter body, consisting of several parts (child bodies) - */ - parseBody: function (x, y, w, h, config) - { - var fixtureConfigs = GetFastValue(config, 'fixtures', []); - var fixtures = []; - - for (var fc = 0; fc < fixtureConfigs.length; fc++) - { - var fixtureParts = this.parseFixture(fixtureConfigs[fc]); - - for (var i = 0; i < fixtureParts.length; i++) - { - fixtures.push(fixtureParts[i]); - } - } - - var matterConfig = Common.extend({}, false, config); - - delete matterConfig.fixtures; - delete matterConfig.type; - - var body = Body.create(matterConfig); - - Body.setParts(body, fixtures); - body.render.sprite.xOffset = body.position.x / w; - body.render.sprite.yOffset = body.position.y / h; - Body.setPosition(body, { x: x, y: y }); - - return body; - }, - - - /** - * Parses an element of the "fixtures" list exported by PhysicsEditor - * - * @function Phaser.Physics.Matter.PhysicsEditorParser.parseFixture - * @since 3.10.0 - * - * @param {object} fixtureConfig - the fixture object to parse - * - * @return {object[]} - A list of matter bodies - */ - parseFixture: function (fixtureConfig) - { - var matterConfig = Common.extend({}, false, fixtureConfig); - - delete matterConfig.circle; - delete matterConfig.vertices; - - var fixtures; - - if (fixtureConfig.circle) - { - var x = GetFastValue(fixtureConfig.circle, 'x'); - var y = GetFastValue(fixtureConfig.circle, 'y'); - var r = GetFastValue(fixtureConfig.circle, 'radius'); - fixtures = [ Bodies.circle(x, y, r, matterConfig) ]; - } - else if (fixtureConfig.vertices) - { - fixtures = this.parseVertices(fixtureConfig.vertices, matterConfig); - } - - return fixtures; - }, - - /** - * Parses the "vertices" lists exported by PhysicsEditor. - * - * @function Phaser.Physics.Matter.PhysicsEditorParser.parseVertices - * @since 3.10.0 - * - * @param {object} vertexSets - The vertex lists to parse. - * @param {object} options - Matter body options. - * - * @return {object[]} - A list of matter bodies. - */ - parseVertices: function (vertexSets, options) - { - var i, j, k, v, z; - var parts = []; - - options = options || {}; - - for (v = 0; v < vertexSets.length; v += 1) - { - parts.push(Body.create(Common.extend({ - position: Vertices.centre(vertexSets[v]), - vertices: vertexSets[v] - }, options))); - } - - // flag coincident part edges - var coincidentMaxDist = 5; - - for (i = 0; i < parts.length; i++) - { - var partA = parts[i]; - - for (j = i + 1; j < parts.length; j++) - { - var partB = parts[j]; - - if (Bounds.overlaps(partA.bounds, partB.bounds)) - { - var pav = partA.vertices, - pbv = partB.vertices; - - // iterate vertices of both parts - for (k = 0; k < partA.vertices.length; k++) - { - for (z = 0; z < partB.vertices.length; z++) - { - // find distances between the vertices - var da = Vector.magnitudeSquared(Vector.sub(pav[(k + 1) % pav.length], pbv[z])), - db = Vector.magnitudeSquared(Vector.sub(pav[k], pbv[(z + 1) % pbv.length])); - - // if both vertices are very close, consider the edge concident (internal) - if (da < coincidentMaxDist && db < coincidentMaxDist) - { - pav[k].isInternal = true; - pbv[z].isInternal = true; - } - } - } - - } - } - } - - return parts; - } -}; - -module.exports = PhysicsEditorParser; - - -/***/ }), -/* 1309 */ +/* 1313 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183401,8 +184993,8 @@ module.exports = PhysicsEditorParser; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Events = __webpack_require__(225); -var MatterEvents = __webpack_require__(92); +var Events = __webpack_require__(227); +var MatterEvents = __webpack_require__(94); /** * [description] @@ -183514,7 +185106,7 @@ module.exports = Sleep; /***/ }), -/* 1310 */ +/* 1314 */ /***/ (function(module, exports) { /** @@ -183547,7 +185139,7 @@ module.exports = 'afterupdate'; /***/ }), -/* 1311 */ +/* 1315 */ /***/ (function(module, exports) { /** @@ -183580,7 +185172,7 @@ module.exports = 'beforeupdate'; /***/ }), -/* 1312 */ +/* 1316 */ /***/ (function(module, exports) { /** @@ -183617,7 +185209,7 @@ module.exports = 'collisionactive'; /***/ }), -/* 1313 */ +/* 1317 */ /***/ (function(module, exports) { /** @@ -183654,7 +185246,7 @@ module.exports = 'collisionend'; /***/ }), -/* 1314 */ +/* 1318 */ /***/ (function(module, exports) { /** @@ -183691,7 +185283,7 @@ module.exports = 'collisionstart'; /***/ }), -/* 1315 */ +/* 1319 */ /***/ (function(module, exports) { /** @@ -183718,7 +185310,7 @@ module.exports = 'dragend'; /***/ }), -/* 1316 */ +/* 1320 */ /***/ (function(module, exports) { /** @@ -183745,7 +185337,7 @@ module.exports = 'drag'; /***/ }), -/* 1317 */ +/* 1321 */ /***/ (function(module, exports) { /** @@ -183773,7 +185365,7 @@ module.exports = 'dragstart'; /***/ }), -/* 1318 */ +/* 1322 */ /***/ (function(module, exports) { /** @@ -183796,7 +185388,7 @@ module.exports = 'pause'; /***/ }), -/* 1319 */ +/* 1323 */ /***/ (function(module, exports) { /** @@ -183819,7 +185411,7 @@ module.exports = 'resume'; /***/ }), -/* 1320 */ +/* 1324 */ /***/ (function(module, exports) { /** @@ -183852,7 +185444,7 @@ module.exports = 'sleepend'; /***/ }), -/* 1321 */ +/* 1325 */ /***/ (function(module, exports) { /** @@ -183885,7 +185477,7 @@ module.exports = 'sleepstart'; /***/ }), -/* 1322 */ +/* 1326 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183894,10 +185486,10 @@ module.exports = 'sleepstart'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(24); -var MATH_CONST = __webpack_require__(23); -var WrapAngle = __webpack_require__(161); -var WrapAngleDegrees = __webpack_require__(162); +var Body = __webpack_require__(25); +var MATH_CONST = __webpack_require__(21); +var WrapAngle = __webpack_require__(162); +var WrapAngleDegrees = __webpack_require__(163); // global bitmask flag for GameObject.renderMask (used by Scale) var _FLAG = 4; // 0100 @@ -184193,7 +185785,7 @@ module.exports = Transform; /***/ }), -/* 1323 */ +/* 1327 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184202,7 +185794,7 @@ module.exports = Transform; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(24); +var Body = __webpack_require__(25); /** * [description] @@ -184293,7 +185885,7 @@ module.exports = Velocity; /***/ }), -/* 1324 */ +/* 1328 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184305,14 +185897,14 @@ module.exports = Velocity; var Bounds = __webpack_require__(38); var Class = __webpack_require__(0); var Composite = __webpack_require__(76); -var Constraint = __webpack_require__(93); -var Detector = __webpack_require__(227); -var Events = __webpack_require__(225); -var InputEvents = __webpack_require__(54); -var Merge = __webpack_require__(69); -var Sleeping = __webpack_require__(110); +var Constraint = __webpack_require__(95); +var Detector = __webpack_require__(229); +var Events = __webpack_require__(227); +var InputEvents = __webpack_require__(55); +var Merge = __webpack_require__(87); +var Sleeping = __webpack_require__(111); var Vector2 = __webpack_require__(3); -var Vertices = __webpack_require__(32); +var Vertices = __webpack_require__(31); /** * @classdesc @@ -184656,7 +186248,7 @@ module.exports = PointerConstraint; /***/ }), -/* 1325 */ +/* 1329 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184672,10 +186264,10 @@ var Query = {}; module.exports = Query; var Vector = __webpack_require__(37); -var SAT = __webpack_require__(228); +var SAT = __webpack_require__(230); var Bounds = __webpack_require__(38); -var Bodies = __webpack_require__(57); -var Vertices = __webpack_require__(32); +var Bodies = __webpack_require__(58); +var Vertices = __webpack_require__(31); (function() { @@ -184792,7 +186384,7 @@ var Vertices = __webpack_require__(32); /***/ }), -/* 1326 */ +/* 1330 */ /***/ (function(module, exports, __webpack_require__) { // @if DEBUG @@ -184806,7 +186398,7 @@ var Metrics = {}; module.exports = Metrics; var Composite = __webpack_require__(76); -var Common = __webpack_require__(16); +var Common = __webpack_require__(17); (function() { @@ -184891,7 +186483,7 @@ var Common = __webpack_require__(16); /***/ }), -/* 1327 */ +/* 1331 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184909,7 +186501,7 @@ var Svg = {}; module.exports = Svg; var Bounds = __webpack_require__(38); -var Common = __webpack_require__(16); +var Common = __webpack_require__(17); (function() { @@ -185122,7 +186714,7 @@ var Common = __webpack_require__(16); })(); /***/ }), -/* 1328 */ +/* 1332 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185131,21 +186723,21 @@ var Common = __webpack_require__(16); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(24); -var Bodies = __webpack_require__(57); +var Body = __webpack_require__(25); +var Bodies = __webpack_require__(58); var Class = __webpack_require__(0); -var Factory = __webpack_require__(478); +var Factory = __webpack_require__(481); var GetFastValue = __webpack_require__(1); var GetValue = __webpack_require__(5); -var MatterAttractors = __webpack_require__(1329); -var MatterLib = __webpack_require__(483); -var MatterWrap = __webpack_require__(1330); -var Merge = __webpack_require__(69); -var Plugin = __webpack_require__(230); -var PluginCache = __webpack_require__(17); -var SceneEvents = __webpack_require__(18); -var World = __webpack_require__(488); -var Vertices = __webpack_require__(32); +var MatterAttractors = __webpack_require__(1333); +var MatterLib = __webpack_require__(487); +var MatterWrap = __webpack_require__(1334); +var Merge = __webpack_require__(87); +var Plugin = __webpack_require__(232); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var World = __webpack_require__(492); +var Vertices = __webpack_require__(31); /** * @classdesc @@ -185490,10 +187082,10 @@ module.exports = MatterPhysics; /***/ }), -/* 1329 */ +/* 1333 */ /***/ (function(module, exports, __webpack_require__) { -var Matter = __webpack_require__(229); +var Matter = __webpack_require__(231); /** * An attractors plugin for matter.js. @@ -185632,10 +187224,10 @@ module.exports = MatterAttractors; /***/ }), -/* 1330 */ +/* 1334 */ /***/ (function(module, exports, __webpack_require__) { -var Matter = __webpack_require__(229); +var Matter = __webpack_require__(231); /** * A coordinate wrapping plugin for matter.js. @@ -185814,7 +187406,7 @@ module.exports = MatterWrap; */ /***/ }), -/* 1331 */ +/* 1335 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185829,17 +187421,17 @@ module.exports = MatterWrap; module.exports = { - BasePlugin: __webpack_require__(489), - DefaultPlugins: __webpack_require__(182), - PluginCache: __webpack_require__(17), - PluginManager: __webpack_require__(366), - ScenePlugin: __webpack_require__(1332) + BasePlugin: __webpack_require__(493), + DefaultPlugins: __webpack_require__(183), + PluginCache: __webpack_require__(18), + PluginManager: __webpack_require__(369), + ScenePlugin: __webpack_require__(1336) }; /***/ }), -/* 1332 */ +/* 1336 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185848,9 +187440,9 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ -var BasePlugin = __webpack_require__(489); +var BasePlugin = __webpack_require__(493); var Class = __webpack_require__(0); -var SceneEvents = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); /** * @classdesc @@ -185928,7 +187520,7 @@ module.exports = ScenePlugin; /***/ }), -/* 1333 */ +/* 1337 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185947,15 +187539,15 @@ module.exports = ScenePlugin; module.exports = { - Canvas: __webpack_require__(1334), - Snapshot: __webpack_require__(1335), - WebGL: __webpack_require__(1336) + Canvas: __webpack_require__(1338), + Snapshot: __webpack_require__(1339), + WebGL: __webpack_require__(1340) }; /***/ }), -/* 1334 */ +/* 1338 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185970,15 +187562,15 @@ module.exports = { module.exports = { - CanvasRenderer: __webpack_require__(330), - GetBlendModes: __webpack_require__(332), - SetTransform: __webpack_require__(27) + CanvasRenderer: __webpack_require__(333), + GetBlendModes: __webpack_require__(335), + SetTransform: __webpack_require__(28) }; /***/ }), -/* 1335 */ +/* 1339 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185993,14 +187585,14 @@ module.exports = { module.exports = { - Canvas: __webpack_require__(331), - WebGL: __webpack_require__(334) + Canvas: __webpack_require__(334), + WebGL: __webpack_require__(337) }; /***/ }), -/* 1336 */ +/* 1340 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186016,9 +187608,9 @@ module.exports = { module.exports = { Utils: __webpack_require__(10), - WebGLPipeline: __webpack_require__(183), - WebGLRenderer: __webpack_require__(333), - Pipelines: __webpack_require__(1337), + WebGLPipeline: __webpack_require__(184), + WebGLRenderer: __webpack_require__(336), + Pipelines: __webpack_require__(1341), // Constants BYTE: 0, @@ -186031,7 +187623,7 @@ module.exports = { /***/ }), -/* 1337 */ +/* 1341 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186046,16 +187638,16 @@ module.exports = { module.exports = { - BitmapMaskPipeline: __webpack_require__(335), - ForwardDiffuseLightPipeline: __webpack_require__(336), - TextureTintPipeline: __webpack_require__(184), - ModelViewProjection: __webpack_require__(337) + BitmapMaskPipeline: __webpack_require__(338), + ForwardDiffuseLightPipeline: __webpack_require__(339), + TextureTintPipeline: __webpack_require__(185), + ModelViewProjection: __webpack_require__(340) }; /***/ }), -/* 1338 */ +/* 1342 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186064,8 +187656,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(20); -var CONST = __webpack_require__(186); +var Extend = __webpack_require__(15); +var CONST = __webpack_require__(187); /** * @namespace Phaser.Scale @@ -186093,12 +187685,12 @@ var CONST = __webpack_require__(186); var Scale = { - Center: __webpack_require__(355), - Events: __webpack_require__(99), - Orientation: __webpack_require__(356), - ScaleManager: __webpack_require__(367), - ScaleModes: __webpack_require__(357), - Zoom: __webpack_require__(358) + Center: __webpack_require__(358), + Events: __webpack_require__(101), + Orientation: __webpack_require__(359), + ScaleManager: __webpack_require__(370), + ScaleModes: __webpack_require__(360), + Zoom: __webpack_require__(361) }; @@ -186111,7 +187703,7 @@ module.exports = Scale; /***/ }), -/* 1339 */ +/* 1343 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186120,8 +187712,8 @@ module.exports = Scale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(130); -var Extend = __webpack_require__(20); +var CONST = __webpack_require__(131); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Scenes @@ -186129,11 +187721,11 @@ var Extend = __webpack_require__(20); var Scene = { - Events: __webpack_require__(18), - SceneManager: __webpack_require__(369), - ScenePlugin: __webpack_require__(1340), - Settings: __webpack_require__(372), - Systems: __webpack_require__(189) + Events: __webpack_require__(19), + SceneManager: __webpack_require__(372), + ScenePlugin: __webpack_require__(1344), + Settings: __webpack_require__(374), + Systems: __webpack_require__(190) }; @@ -186144,7 +187736,7 @@ module.exports = Scene; /***/ }), -/* 1340 */ +/* 1344 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186153,11 +187745,11 @@ module.exports = Scene; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(18); +var Events = __webpack_require__(19); var GetFastValue = __webpack_require__(1); -var PluginCache = __webpack_require__(17); +var PluginCache = __webpack_require__(18); /** * @classdesc @@ -187138,7 +188730,7 @@ module.exports = ScenePlugin; /***/ }), -/* 1341 */ +/* 1345 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187153,18 +188745,18 @@ module.exports = ScenePlugin; module.exports = { - List: __webpack_require__(133), - Map: __webpack_require__(168), - ProcessQueue: __webpack_require__(467), - RTree: __webpack_require__(468), - Set: __webpack_require__(105), - Size: __webpack_require__(368) + List: __webpack_require__(134), + Map: __webpack_require__(169), + ProcessQueue: __webpack_require__(470), + RTree: __webpack_require__(471), + Set: __webpack_require__(107), + Size: __webpack_require__(371) }; /***/ }), -/* 1342 */ +/* 1346 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187173,8 +188765,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(20); -var FilterMode = __webpack_require__(1343); +var Extend = __webpack_require__(15); +var FilterMode = __webpack_require__(1347); /** * @namespace Phaser.Textures @@ -187200,13 +188792,14 @@ var FilterMode = __webpack_require__(1343); var Textures = { - Events: __webpack_require__(126), + CanvasTexture: __webpack_require__(376), + Events: __webpack_require__(127), FilterMode: FilterMode, - Frame: __webpack_require__(101), - Parsers: __webpack_require__(375), - Texture: __webpack_require__(190), - TextureManager: __webpack_require__(373), - TextureSource: __webpack_require__(374) + Frame: __webpack_require__(103), + Parsers: __webpack_require__(378), + Texture: __webpack_require__(192), + TextureManager: __webpack_require__(375), + TextureSource: __webpack_require__(377) }; @@ -187216,7 +188809,7 @@ module.exports = Textures; /***/ }), -/* 1343 */ +/* 1347 */ /***/ (function(module, exports) { /** @@ -187260,7 +188853,7 @@ module.exports = CONST; /***/ }), -/* 1344 */ +/* 1348 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187275,30 +188868,30 @@ module.exports = CONST; module.exports = { - Components: __webpack_require__(145), - Parsers: __webpack_require__(1374), + Components: __webpack_require__(146), + Parsers: __webpack_require__(1378), - Formats: __webpack_require__(34), - ImageCollection: __webpack_require__(500), - ParseToTilemap: __webpack_require__(238), + Formats: __webpack_require__(33), + ImageCollection: __webpack_require__(504), + ParseToTilemap: __webpack_require__(240), Tile: __webpack_require__(78), - Tilemap: __webpack_require__(509), - TilemapCreator: __webpack_require__(1383), - TilemapFactory: __webpack_require__(1384), - Tileset: __webpack_require__(149), + Tilemap: __webpack_require__(513), + TilemapCreator: __webpack_require__(1387), + TilemapFactory: __webpack_require__(1388), + Tileset: __webpack_require__(150), - LayerData: __webpack_require__(112), - MapData: __webpack_require__(113), - ObjectLayer: __webpack_require__(503), + LayerData: __webpack_require__(113), + MapData: __webpack_require__(114), + ObjectLayer: __webpack_require__(507), - DynamicTilemapLayer: __webpack_require__(510), - StaticTilemapLayer: __webpack_require__(511) + DynamicTilemapLayer: __webpack_require__(514), + StaticTilemapLayer: __webpack_require__(515) }; /***/ }), -/* 1345 */ +/* 1349 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187307,8 +188900,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); -var CalculateFacesWithin = __webpack_require__(58); +var GetTilesWithin = __webpack_require__(26); +var CalculateFacesWithin = __webpack_require__(59); /** * Copies the tiles in the source rectangular area to a new destination (all specified in tile @@ -187363,7 +188956,7 @@ module.exports = Copy; /***/ }), -/* 1346 */ +/* 1350 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187372,10 +188965,10 @@ module.exports = Copy; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileToWorldX = __webpack_require__(147); -var TileToWorldY = __webpack_require__(148); -var GetTilesWithin = __webpack_require__(25); -var ReplaceByIndex = __webpack_require__(490); +var TileToWorldX = __webpack_require__(148); +var TileToWorldY = __webpack_require__(149); +var GetTilesWithin = __webpack_require__(26); +var ReplaceByIndex = __webpack_require__(494); /** * Creates a Sprite for every object matching the given tile indexes in the layer. You can @@ -187448,7 +189041,7 @@ module.exports = CreateFromTiles; /***/ }), -/* 1347 */ +/* 1351 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187457,8 +189050,8 @@ module.exports = CreateFromTiles; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SnapFloor = __webpack_require__(100); -var SnapCeil = __webpack_require__(319); +var SnapFloor = __webpack_require__(102); +var SnapCeil = __webpack_require__(322); /** * Returns the tiles in the given layer that are within the camera's viewport. This is used internally. @@ -187605,7 +189198,7 @@ module.exports = CullTiles; /***/ }), -/* 1348 */ +/* 1352 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187614,8 +189207,8 @@ module.exports = CullTiles; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); -var CalculateFacesWithin = __webpack_require__(58); +var GetTilesWithin = __webpack_require__(26); +var CalculateFacesWithin = __webpack_require__(59); var SetTileCollision = __webpack_require__(77); /** @@ -187659,7 +189252,7 @@ module.exports = Fill; /***/ }), -/* 1349 */ +/* 1353 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187668,7 +189261,7 @@ module.exports = Fill; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); +var GetTilesWithin = __webpack_require__(26); /** * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given @@ -187707,7 +189300,7 @@ module.exports = FilterTiles; /***/ }), -/* 1350 */ +/* 1354 */ /***/ (function(module, exports) { /** @@ -187795,7 +189388,7 @@ module.exports = FindByIndex; /***/ }), -/* 1351 */ +/* 1355 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187804,7 +189397,7 @@ module.exports = FindByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); +var GetTilesWithin = __webpack_require__(26); /** * @callback FindTileCallback @@ -187849,7 +189442,7 @@ module.exports = FindTile; /***/ }), -/* 1352 */ +/* 1356 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187858,7 +189451,7 @@ module.exports = FindTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); +var GetTilesWithin = __webpack_require__(26); /** * @callback EachTileCallback @@ -187899,7 +189492,7 @@ module.exports = ForEachTile; /***/ }), -/* 1353 */ +/* 1357 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187908,9 +189501,9 @@ module.exports = ForEachTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(146); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var GetTileAt = __webpack_require__(147); +var WorldToTileX = __webpack_require__(67); +var WorldToTileY = __webpack_require__(68); /** * Gets a tile at the given world coordinates from the given layer. @@ -187940,7 +189533,7 @@ module.exports = GetTileAtWorldXY; /***/ }), -/* 1354 */ +/* 1358 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187949,14 +189542,14 @@ module.exports = GetTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Geom = __webpack_require__(426); -var GetTilesWithin = __webpack_require__(25); -var Intersects = __webpack_require__(427); +var Geom = __webpack_require__(429); +var GetTilesWithin = __webpack_require__(26); +var Intersects = __webpack_require__(430); var NOOP = __webpack_require__(2); -var TileToWorldX = __webpack_require__(147); -var TileToWorldY = __webpack_require__(148); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var TileToWorldX = __webpack_require__(148); +var TileToWorldY = __webpack_require__(149); +var WorldToTileX = __webpack_require__(67); +var WorldToTileY = __webpack_require__(68); var TriangleToRectangle = function (triangle, rect) { @@ -188037,7 +189630,7 @@ module.exports = GetTilesWithinShape; /***/ }), -/* 1355 */ +/* 1359 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188046,9 +189639,9 @@ module.exports = GetTilesWithinShape; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var GetTilesWithin = __webpack_require__(26); +var WorldToTileX = __webpack_require__(67); +var WorldToTileY = __webpack_require__(68); /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. @@ -188087,7 +189680,7 @@ module.exports = GetTilesWithinWorldXY; /***/ }), -/* 1356 */ +/* 1360 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188096,9 +189689,9 @@ module.exports = GetTilesWithinWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HasTileAt = __webpack_require__(491); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var HasTileAt = __webpack_require__(495); +var WorldToTileX = __webpack_require__(67); +var WorldToTileY = __webpack_require__(68); /** * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns @@ -188127,7 +189720,7 @@ module.exports = HasTileAtWorldXY; /***/ }), -/* 1357 */ +/* 1361 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188136,9 +189729,9 @@ module.exports = HasTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PutTileAt = __webpack_require__(233); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var PutTileAt = __webpack_require__(235); +var WorldToTileX = __webpack_require__(67); +var WorldToTileY = __webpack_require__(68); /** * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either @@ -188170,7 +189763,7 @@ module.exports = PutTileAtWorldXY; /***/ }), -/* 1358 */ +/* 1362 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188179,8 +189772,8 @@ module.exports = PutTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CalculateFacesWithin = __webpack_require__(58); -var PutTileAt = __webpack_require__(233); +var CalculateFacesWithin = __webpack_require__(59); +var PutTileAt = __webpack_require__(235); /** * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified @@ -188234,7 +189827,7 @@ module.exports = PutTilesAt; /***/ }), -/* 1359 */ +/* 1363 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188243,8 +189836,8 @@ module.exports = PutTilesAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); -var GetRandom = __webpack_require__(193); +var GetTilesWithin = __webpack_require__(26); +var GetRandom = __webpack_require__(195); /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -188292,7 +189885,7 @@ module.exports = Randomize; /***/ }), -/* 1360 */ +/* 1364 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188301,9 +189894,9 @@ module.exports = Randomize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RemoveTileAt = __webpack_require__(492); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var RemoveTileAt = __webpack_require__(496); +var WorldToTileX = __webpack_require__(67); +var WorldToTileY = __webpack_require__(68); /** * Removes the tile at the given world coordinates in the specified layer and updates the layer's @@ -188333,7 +189926,7 @@ module.exports = RemoveTileAtWorldXY; /***/ }), -/* 1361 */ +/* 1365 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188342,8 +189935,8 @@ module.exports = RemoveTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); -var Color = __webpack_require__(350); +var GetTilesWithin = __webpack_require__(26); +var Color = __webpack_require__(353); var defaultTileColor = new Color(105, 210, 231, 150); var defaultCollidingTileColor = new Color(243, 134, 48, 200); @@ -188380,8 +189973,8 @@ var RenderDebug = function (graphics, styleConfig, layer) var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer); - graphics.translate(layer.tilemapLayer.x, layer.tilemapLayer.y); - graphics.scale(layer.tilemapLayer.scaleX, layer.tilemapLayer.scaleY); + graphics.translateCanvas(layer.tilemapLayer.x, layer.tilemapLayer.y); + graphics.scaleCanvas(layer.tilemapLayer.scaleX, layer.tilemapLayer.scaleY); for (var i = 0; i < tiles.length; i++) { @@ -188422,7 +190015,7 @@ module.exports = RenderDebug; /***/ }), -/* 1362 */ +/* 1366 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188432,8 +190025,8 @@ module.exports = RenderDebug; */ var SetTileCollision = __webpack_require__(77); -var CalculateFacesWithin = __webpack_require__(58); -var SetLayerCollisionIndex = __webpack_require__(234); +var CalculateFacesWithin = __webpack_require__(59); +var SetLayerCollisionIndex = __webpack_require__(236); /** * Sets collision on the given tile or tiles within a layer by index. You can pass in either a @@ -188485,7 +190078,7 @@ module.exports = SetCollision; /***/ }), -/* 1363 */ +/* 1367 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188495,8 +190088,8 @@ module.exports = SetCollision; */ var SetTileCollision = __webpack_require__(77); -var CalculateFacesWithin = __webpack_require__(58); -var SetLayerCollisionIndex = __webpack_require__(234); +var CalculateFacesWithin = __webpack_require__(59); +var SetLayerCollisionIndex = __webpack_require__(236); /** * Sets collision on a range of tiles in a layer whose index is between the specified `start` and @@ -188553,7 +190146,7 @@ module.exports = SetCollisionBetween; /***/ }), -/* 1364 */ +/* 1368 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188563,8 +190156,8 @@ module.exports = SetCollisionBetween; */ var SetTileCollision = __webpack_require__(77); -var CalculateFacesWithin = __webpack_require__(58); -var SetLayerCollisionIndex = __webpack_require__(234); +var CalculateFacesWithin = __webpack_require__(59); +var SetLayerCollisionIndex = __webpack_require__(236); /** * Sets collision on all tiles in the given layer, except for tiles that have an index specified in @@ -188610,7 +190203,7 @@ module.exports = SetCollisionByExclusion; /***/ }), -/* 1365 */ +/* 1369 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188620,8 +190213,8 @@ module.exports = SetCollisionByExclusion; */ var SetTileCollision = __webpack_require__(77); -var CalculateFacesWithin = __webpack_require__(58); -var HasValue = __webpack_require__(88); +var CalculateFacesWithin = __webpack_require__(59); +var HasValue = __webpack_require__(90); /** * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property @@ -188685,7 +190278,7 @@ module.exports = SetCollisionByProperty; /***/ }), -/* 1366 */ +/* 1370 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188695,7 +190288,7 @@ module.exports = SetCollisionByProperty; */ var SetTileCollision = __webpack_require__(77); -var CalculateFacesWithin = __webpack_require__(58); +var CalculateFacesWithin = __webpack_require__(59); /** * Sets collision on the tiles within a layer by checking each tile's collision group data @@ -188745,7 +190338,7 @@ module.exports = SetCollisionFromCollisionGroup; /***/ }), -/* 1367 */ +/* 1371 */ /***/ (function(module, exports) { /** @@ -188792,7 +190385,7 @@ module.exports = SetTileIndexCallback; /***/ }), -/* 1368 */ +/* 1372 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188801,7 +190394,7 @@ module.exports = SetTileIndexCallback; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); +var GetTilesWithin = __webpack_require__(26); /** * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. @@ -188835,7 +190428,7 @@ module.exports = SetTileLocationCallback; /***/ }), -/* 1369 */ +/* 1373 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188844,8 +190437,8 @@ module.exports = SetTileLocationCallback; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); -var ShuffleArray = __webpack_require__(119); +var GetTilesWithin = __webpack_require__(26); +var ShuffleArray = __webpack_require__(120); /** * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given @@ -188880,7 +190473,7 @@ module.exports = Shuffle; /***/ }), -/* 1370 */ +/* 1374 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188889,7 +190482,7 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); +var GetTilesWithin = __webpack_require__(26); /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -188931,7 +190524,7 @@ module.exports = SwapByIndex; /***/ }), -/* 1371 */ +/* 1375 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188940,8 +190533,8 @@ module.exports = SwapByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileToWorldX = __webpack_require__(147); -var TileToWorldY = __webpack_require__(148); +var TileToWorldX = __webpack_require__(148); +var TileToWorldY = __webpack_require__(149); var Vector2 = __webpack_require__(3); /** @@ -188975,7 +190568,7 @@ module.exports = TileToWorldXY; /***/ }), -/* 1372 */ +/* 1376 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188984,7 +190577,7 @@ module.exports = TileToWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(25); +var GetTilesWithin = __webpack_require__(26); /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -189055,7 +190648,7 @@ module.exports = WeightedRandomize; /***/ }), -/* 1373 */ +/* 1377 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189064,8 +190657,8 @@ module.exports = WeightedRandomize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var WorldToTileX = __webpack_require__(67); +var WorldToTileY = __webpack_require__(68); var Vector2 = __webpack_require__(3); /** @@ -189100,7 +190693,7 @@ module.exports = WorldToTileXY; /***/ }), -/* 1374 */ +/* 1378 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189115,18 +190708,18 @@ module.exports = WorldToTileXY; module.exports = { - Parse: __webpack_require__(493), - Parse2DArray: __webpack_require__(235), - ParseCSV: __webpack_require__(494), + Parse: __webpack_require__(497), + Parse2DArray: __webpack_require__(237), + ParseCSV: __webpack_require__(498), - Impact: __webpack_require__(1375), - Tiled: __webpack_require__(1376) + Impact: __webpack_require__(1379), + Tiled: __webpack_require__(1380) }; /***/ }), -/* 1375 */ +/* 1379 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189141,15 +190734,15 @@ module.exports = { module.exports = { - ParseTileLayers: __webpack_require__(507), - ParseTilesets: __webpack_require__(508), - ParseWeltmeister: __webpack_require__(506) + ParseTileLayers: __webpack_require__(511), + ParseTilesets: __webpack_require__(512), + ParseWeltmeister: __webpack_require__(510) }; /***/ }), -/* 1376 */ +/* 1380 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189164,22 +190757,22 @@ module.exports = { module.exports = { - AssignTileProperties: __webpack_require__(505), - Base64Decode: __webpack_require__(497), - BuildTilesetIndex: __webpack_require__(504), - ParseGID: __webpack_require__(236), - ParseImageLayers: __webpack_require__(498), - ParseJSONTiled: __webpack_require__(495), - ParseObject: __webpack_require__(237), - ParseObjectLayers: __webpack_require__(502), - ParseTileLayers: __webpack_require__(496), - ParseTilesets: __webpack_require__(499) + AssignTileProperties: __webpack_require__(509), + Base64Decode: __webpack_require__(501), + BuildTilesetIndex: __webpack_require__(508), + ParseGID: __webpack_require__(238), + ParseImageLayers: __webpack_require__(502), + ParseJSONTiled: __webpack_require__(499), + ParseObject: __webpack_require__(239), + ParseObjectLayers: __webpack_require__(506), + ParseTileLayers: __webpack_require__(500), + ParseTilesets: __webpack_require__(503) }; /***/ }), -/* 1377 */ +/* 1381 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189193,12 +190786,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(1378); + renderWebGL = __webpack_require__(1382); } if (true) { - renderCanvas = __webpack_require__(1379); + renderCanvas = __webpack_require__(1383); } module.exports = { @@ -189210,7 +190803,7 @@ module.exports = { /***/ }), -/* 1378 */ +/* 1382 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189327,7 +190920,7 @@ module.exports = DynamicTilemapLayerWebGLRenderer; /***/ }), -/* 1379 */ +/* 1383 */ /***/ (function(module, exports) { /** @@ -189454,7 +191047,7 @@ module.exports = DynamicTilemapLayerCanvasRenderer; /***/ }), -/* 1380 */ +/* 1384 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189468,12 +191061,12 @@ var renderCanvas = __webpack_require__(2); if (true) { - renderWebGL = __webpack_require__(1381); + renderWebGL = __webpack_require__(1385); } if (true) { - renderCanvas = __webpack_require__(1382); + renderCanvas = __webpack_require__(1386); } module.exports = { @@ -189485,7 +191078,7 @@ module.exports = { /***/ }), -/* 1381 */ +/* 1385 */ /***/ (function(module, exports) { /** @@ -189557,7 +191150,7 @@ module.exports = StaticTilemapLayerWebGLRenderer; /***/ }), -/* 1382 */ +/* 1386 */ /***/ (function(module, exports) { /** @@ -189688,7 +191281,7 @@ module.exports = StaticTilemapLayerCanvasRenderer; /***/ }), -/* 1383 */ +/* 1387 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189697,8 +191290,8 @@ module.exports = StaticTilemapLayerCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); -var ParseToTilemap = __webpack_require__(238); +var GameObjectCreator = __webpack_require__(16); +var ParseToTilemap = __webpack_require__(240); /** * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. @@ -189732,7 +191325,7 @@ GameObjectCreator.register('tilemap', function (config) /***/ }), -/* 1384 */ +/* 1388 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189742,7 +191335,7 @@ GameObjectCreator.register('tilemap', function (config) */ var GameObjectFactory = __webpack_require__(6); -var ParseToTilemap = __webpack_require__(238); +var ParseToTilemap = __webpack_require__(240); /** * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. @@ -189798,7 +191391,7 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt /***/ }), -/* 1385 */ +/* 1389 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189813,14 +191406,14 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt module.exports = { - Clock: __webpack_require__(1386), - TimerEvent: __webpack_require__(512) + Clock: __webpack_require__(1390), + TimerEvent: __webpack_require__(516) }; /***/ }), -/* 1386 */ +/* 1390 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189830,9 +191423,9 @@ module.exports = { */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(17); -var SceneEvents = __webpack_require__(18); -var TimerEvent = __webpack_require__(512); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var TimerEvent = __webpack_require__(516); /** * @classdesc @@ -190226,7 +191819,7 @@ module.exports = Clock; /***/ }), -/* 1387 */ +/* 1391 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -190235,8 +191828,8 @@ module.exports = Clock; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(97); -var Extend = __webpack_require__(20); +var CONST = __webpack_require__(99); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Tweens @@ -190244,13 +191837,13 @@ var Extend = __webpack_require__(20); var Tweens = { - Builders: __webpack_require__(1388), - Events: __webpack_require__(518), + Builders: __webpack_require__(1392), + Events: __webpack_require__(245), - TweenManager: __webpack_require__(1396), - Tween: __webpack_require__(242), - TweenData: __webpack_require__(243), - Timeline: __webpack_require__(517) + TweenManager: __webpack_require__(1407), + Tween: __webpack_require__(244), + TweenData: __webpack_require__(246), + Timeline: __webpack_require__(521) }; @@ -190261,7 +191854,7 @@ module.exports = Tweens; /***/ }), -/* 1388 */ +/* 1392 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -190276,22 +191869,22 @@ module.exports = Tweens; module.exports = { - GetBoolean: __webpack_require__(96), - GetEaseFunction: __webpack_require__(106), - GetNewValue: __webpack_require__(150), - GetProps: __webpack_require__(513), - GetTargets: __webpack_require__(239), - GetTweens: __webpack_require__(514), - GetValueOp: __webpack_require__(240), - NumberTweenBuilder: __webpack_require__(515), - TimelineBuilder: __webpack_require__(516), - TweenBuilder: __webpack_require__(151) + GetBoolean: __webpack_require__(98), + GetEaseFunction: __webpack_require__(89), + GetNewValue: __webpack_require__(151), + GetProps: __webpack_require__(517), + GetTargets: __webpack_require__(241), + GetTweens: __webpack_require__(518), + GetValueOp: __webpack_require__(242), + NumberTweenBuilder: __webpack_require__(519), + TimelineBuilder: __webpack_require__(520), + TweenBuilder: __webpack_require__(152) }; /***/ }), -/* 1389 */ +/* 1393 */ /***/ (function(module, exports) { /** @@ -190334,6 +191927,9 @@ module.exports = [ 'loop', 'loopDelay', 'offset', + 'onActive', + 'onActiveParams', + 'onActiveScope', 'onComplete', 'onCompleteParams', 'onCompleteScope', @@ -190363,7 +191959,7 @@ module.exports = [ /***/ }), -/* 1390 */ +/* 1394 */ /***/ (function(module, exports) { /** @@ -190399,7 +191995,7 @@ module.exports = 'complete'; /***/ }), -/* 1391 */ +/* 1395 */ /***/ (function(module, exports) { /** @@ -190431,13 +192027,12 @@ module.exports = 'complete'; * @since 3.0.0 * * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - * @param {integer} loopCount - The number of loops left before this Timeline completes. */ module.exports = 'loop'; /***/ }), -/* 1392 */ +/* 1396 */ /***/ (function(module, exports) { /** @@ -190474,7 +192069,7 @@ module.exports = 'pause'; /***/ }), -/* 1393 */ +/* 1397 */ /***/ (function(module, exports) { /** @@ -190511,7 +192106,7 @@ module.exports = 'resume'; /***/ }), -/* 1394 */ +/* 1398 */ /***/ (function(module, exports) { /** @@ -190547,7 +192142,7 @@ module.exports = 'start'; /***/ }), -/* 1395 */ +/* 1399 */ /***/ (function(module, exports) { /** @@ -190584,7 +192179,304 @@ module.exports = 'update'; /***/ }), -/* 1396 */ +/* 1400 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Active Event. + * + * This event is dispatched by a Tween when it becomes active within the Tween Manager. + * + * An 'active' Tween is one that is now progressing, although it may not yet be updating + * any target properties, due to settings such as `delay`. If you need an event for when + * the Tween starts actually updating its first property, see `TWEEN_START`. + * + * Listen to it from a Tween instance using `Tween.on('active', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('active', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'active'; + + +/***/ }), +/* 1401 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Complete Event. + * + * This event is dispatched by a Tween when it completes playback entirely, factoring in repeats and loops. + * + * If the Tween has been set to loop or repeat infinitely, this event will not be dispatched + * unless the `Tween.stop` method is called. + * + * If a Tween has a `completeDelay` set, this event will fire after that delay expires. + * + * Listen to it from a Tween instance using `Tween.on('complete', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('complete', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_COMPLETE + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'complete'; + + +/***/ }), +/* 1402 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Loop Event. + * + * This event is dispatched by a Tween when it loops. + * + * This event will only be dispatched if the Tween has a loop count set. + * + * If a Tween has a `loopDelay` set, this event will fire after that delay expires. + * + * The difference between `loop` and `repeat` is that `repeat` is a property setting, + * where-as `loop` applies to the entire Tween. + * + * Listen to it from a Tween instance using `Tween.on('loop', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * loop: 6 + * }); + * tween.on('loop', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_LOOP + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'loop'; + + +/***/ }), +/* 1403 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Repeat Event. + * + * This event is dispatched by a Tween when one of the properties it is tweening repeats. + * + * This event will only be dispatched if the Tween has a property with a repeat count set. + * + * If a Tween has a `repeatDelay` set, this event will fire after that delay expires. + * + * The difference between `loop` and `repeat` is that `repeat` is a property setting, + * where-as `loop` applies to the entire Tween. + * + * Listen to it from a Tween instance using `Tween.on('repeat', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * repeat: 4 + * }); + * tween.on('repeat', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {string} key - The key of the property that just repeated. + * @param {any} target - The target that the property just repated on. + */ +module.exports = 'repeat'; + + +/***/ }), +/* 1404 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Start Event. + * + * This event is dispatched by a Tween when it starts tweening its first property. + * + * A Tween will only emit this event once, as it can only start once. + * + * If a Tween has a `delay` set, this event will fire after that delay expires. + * + * Listen to it from a Tween instance using `Tween.on('start', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('start', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_START + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'start'; + + +/***/ }), +/* 1405 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Update Event. + * + * This event is dispatched by a Tween every time it updates _any_ of the properties it is tweening. + * + * A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property. + * + * **Note:** This is a very high frequency event and may be dispatched multiple times, every single frame. + * + * Listen to it from a Tween instance using `Tween.on('update', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * }); + * tween.on('update', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_UPDATE + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {string} key - The property that was updated, i.e. `x` or `scale`. + * @param {any} target - The target object that was updated. Usually a Game Object, but can be of any type. + */ +module.exports = 'update'; + + +/***/ }), +/* 1406 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Yoyo Event. + * + * This event is dispatched by a Tween whenever a property it is tweening yoyos. + * + * This event will only be dispatched if the Tween has a property with `yoyo` set. + * + * If the Tween has a `hold` value, this event is dispatched when the hold expires. + * + * This event is dispatched for every property, and for every target, that yoyos. + * For example, if a Tween was updating 2 properties and had 10 targets, this event + * would be dispatched 20 times (twice per target). So be careful how you use it! + * + * Listen to it from a Tween instance using `Tween.on('yoyo', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * yoyo: true + * }); + * tween.on('yoyo', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {string} key - The property that yoyo'd, i.e. `x` or `scale`. + * @param {any} target - The target object that was yoyo'd. Usually a Game Object, but can be of any type. + */ +module.exports = 'yoyo'; + + +/***/ }), +/* 1407 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -190593,14 +192485,15 @@ module.exports = 'update'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayRemove = __webpack_require__(128); +var ArrayRemove = __webpack_require__(129); var Class = __webpack_require__(0); -var NumberTweenBuilder = __webpack_require__(515); -var PluginCache = __webpack_require__(17); -var SceneEvents = __webpack_require__(18); -var TimelineBuilder = __webpack_require__(516); -var TWEEN_CONST = __webpack_require__(97); -var TweenBuilder = __webpack_require__(151); +var NumberTweenBuilder = __webpack_require__(519); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var StaggerBuilder = __webpack_require__(1408); +var TimelineBuilder = __webpack_require__(520); +var TWEEN_CONST = __webpack_require__(99); +var TweenBuilder = __webpack_require__(152); /** * @classdesc @@ -190852,6 +192745,51 @@ var TweenManager = new Class({ return tween; }, + /** + * Creates a Stagger function to be used by a Tween property. + * + * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. + * + * This is only worth using if the tween has multiple targets. + * + * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 + * over the duration specified: + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(100) + * }); + * ``` + * + * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering + * from the center out, using a cubic ease. + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' }) + * }); + * ``` + * + * @method Phaser.Tweens.TweenManager#stagger + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.StaggerConfig} config - The configuration object for the Stagger function. + * + * @return {function} The stagger function. + */ + stagger: function (value, options) + { + return StaggerBuilder(value, options); + }, + /** * Updates the Tween Manager's internal lists at the start of the frame. * @@ -191309,7 +193247,252 @@ module.exports = TweenManager; /***/ }), -/* 1397 */ +/* 1408 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetEaseFunction = __webpack_require__(89); +var GetValue = __webpack_require__(5); + +/** + * Creates a Stagger function to be used by a Tween property. + * + * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. + * + * This is only worth using if the tween has multiple targets. + * + * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 + * over the duration specified: + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(100) + * }); + * ``` + * + * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering + * from the center out, using a cubic ease. + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' }) + * }); + * ``` + * + * @function Phaser.Tweens.Builders.StaggerBuilder + * @since 3.19.0 + * + * @param {(number|number[])} value - The amount to stagger by, or an array containing two elements representing the min and max values to stagger between. + * @param {Phaser.Types.Tweens.StaggerConfig} [config] - A Stagger Configuration object. + * + * @return {function} The stagger function. + */ +var StaggerBuilder = function (value, options) +{ + if (options === undefined) { options = {}; } + + var result; + + var start = GetValue(options, 'start', 0); + var ease = GetValue(options, 'ease', null); + var grid = GetValue(options, 'grid', null); + + var from = GetValue(options, 'from', 0); + + var fromFirst = (from === 'first'); + var fromCenter = (from === 'center'); + var fromLast = (from === 'last'); + var fromValue = (typeof(from) === 'number'); + + var isRange = (Array.isArray(value)); + var value1 = (isRange) ? parseFloat(value[0]) : parseFloat(value); + var value2 = (isRange) ? parseFloat(value[1]) : 0; + var maxValue = Math.max(value1, value2); + + if (isRange) + { + start += value1; + } + + if (grid) + { + // Pre-calc the grid to save doing it for ever tweendata update + var gridWidth = grid[0]; + var gridHeight = grid[1]; + + var fromX = 0; + var fromY = 0; + + var distanceX = 0; + var distanceY = 0; + + var gridValues = []; + + if (fromLast) + { + fromX = gridWidth - 1; + fromY = gridHeight - 1; + } + else if (fromValue) + { + fromX = from % gridWidth; + fromY = Math.floor(from / gridWidth); + } + else if (fromCenter) + { + fromX = (gridWidth - 1) / 2; + fromY = (gridHeight - 1) / 2; + } + + var gridMax = Number.MIN_SAFE_INTEGER; + + for (var toY = 0; toY < gridHeight; toY++) + { + gridValues[toY] = []; + + for (var toX = 0; toX < gridWidth; toX++) + { + distanceX = fromX - toX; + distanceY = fromY - toY; + + var dist = Math.sqrt(distanceX * distanceX + distanceY * distanceY); + + if (dist > gridMax) + { + gridMax = dist; + } + + gridValues[toY][toX] = dist; + } + } + } + + var easeFunction = (ease) ? GetEaseFunction(ease) : null; + + if (grid) + { + result = function (target, key, value, index) + { + var gridSpace = 0; + var toX = index % gridWidth; + var toY = Math.floor(index / gridWidth); + + if (toX >= 0 && toX < gridWidth && toY >= 0 && toY < gridHeight) + { + gridSpace = gridValues[toY][toX]; + } + + var output; + + if (isRange) + { + var diff = (value2 - value1); + + if (easeFunction) + { + output = ((gridSpace / gridMax) * diff) * easeFunction(gridSpace / gridMax); + } + else + { + output = (gridSpace / gridMax) * diff; + } + } + else if (easeFunction) + { + output = (gridSpace * value1) * easeFunction(gridSpace / gridMax); + } + else + { + output = gridSpace * value1; + } + + return output + start; + }; + } + else + { + result = function (target, key, value, index, total) + { + // zero offset + total--; + + var fromIndex; + + if (fromFirst) + { + fromIndex = index; + } + else if (fromCenter) + { + fromIndex = Math.abs((total / 2) - index); + } + else if (fromLast) + { + fromIndex = total - index; + } + else if (fromValue) + { + fromIndex = Math.abs(from - index); + } + + var output; + + if (isRange) + { + var spacing; + + if (fromCenter) + { + spacing = ((value2 - value1) / total) * (fromIndex * 2); + } + else + { + spacing = ((value2 - value1) / total) * fromIndex; + } + + if (easeFunction) + { + output = spacing * easeFunction(fromIndex / total); + } + else + { + output = spacing; + } + } + else if (easeFunction) + { + output = (total * maxValue) * easeFunction(fromIndex / total); + } + else + { + output = fromIndex * value1; + } + + return output + start; + }; + } + + return result; +}; + +module.exports = StaggerBuilder; + + +/***/ }), +/* 1409 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -191324,16 +193507,16 @@ module.exports = TweenManager; module.exports = { - Array: __webpack_require__(191), - Base64: __webpack_require__(1398), - Objects: __webpack_require__(1400), - String: __webpack_require__(1404) + Array: __webpack_require__(193), + Base64: __webpack_require__(1410), + Objects: __webpack_require__(1412), + String: __webpack_require__(1416) }; /***/ }), -/* 1398 */ +/* 1410 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -191348,14 +193531,14 @@ module.exports = { module.exports = { - ArrayBufferToBase64: __webpack_require__(1399), - Base64ToArrayBuffer: __webpack_require__(382) + ArrayBufferToBase64: __webpack_require__(1411), + Base64ToArrayBuffer: __webpack_require__(385) }; /***/ }), -/* 1399 */ +/* 1411 */ /***/ (function(module, exports) { /** @@ -191413,7 +193596,7 @@ module.exports = ArrayBufferToBase64; /***/ }), -/* 1400 */ +/* 1412 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -191429,25 +193612,25 @@ module.exports = ArrayBufferToBase64; module.exports = { Clone: __webpack_require__(70), - Extend: __webpack_require__(20), + Extend: __webpack_require__(15), GetAdvancedValue: __webpack_require__(14), GetFastValue: __webpack_require__(1), - GetMinMaxValue: __webpack_require__(1401), + GetMinMaxValue: __webpack_require__(1413), GetValue: __webpack_require__(5), - HasAll: __webpack_require__(1402), - HasAny: __webpack_require__(402), - HasValue: __webpack_require__(88), + HasAll: __webpack_require__(1414), + HasAny: __webpack_require__(405), + HasValue: __webpack_require__(90), IsPlainObject: __webpack_require__(7), - Merge: __webpack_require__(69), - MergeRight: __webpack_require__(1403), - Pick: __webpack_require__(501), - SetValue: __webpack_require__(423) + Merge: __webpack_require__(87), + MergeRight: __webpack_require__(1415), + Pick: __webpack_require__(505), + SetValue: __webpack_require__(426) }; /***/ }), -/* 1401 */ +/* 1413 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -191457,7 +193640,7 @@ module.exports = { */ var GetValue = __webpack_require__(5); -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); /** * Retrieves and clamps a numerical value from an object. @@ -191486,7 +193669,7 @@ module.exports = GetMinMaxValue; /***/ }), -/* 1402 */ +/* 1414 */ /***/ (function(module, exports) { /** @@ -191523,7 +193706,7 @@ module.exports = HasAll; /***/ }), -/* 1403 */ +/* 1415 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -191566,7 +193749,7 @@ module.exports = MergeRight; /***/ }), -/* 1404 */ +/* 1416 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -191581,17 +193764,17 @@ module.exports = MergeRight; module.exports = { - Format: __webpack_require__(1405), - Pad: __webpack_require__(169), - Reverse: __webpack_require__(1406), - UppercaseFirst: __webpack_require__(371), - UUID: __webpack_require__(405) + Format: __webpack_require__(1417), + Pad: __webpack_require__(170), + Reverse: __webpack_require__(1418), + UppercaseFirst: __webpack_require__(191), + UUID: __webpack_require__(408) }; /***/ }), -/* 1405 */ +/* 1417 */ /***/ (function(module, exports) { /** @@ -191626,7 +193809,7 @@ module.exports = Format; /***/ }), -/* 1406 */ +/* 1418 */ /***/ (function(module, exports) { /** @@ -191655,7 +193838,7 @@ module.exports = Reverse; /***/ }), -/* 1407 */ +/* 1419 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -191671,21 +193854,21 @@ module.exports = Reverse; module.exports = { - SoundManagerCreator: __webpack_require__(376), + SoundManagerCreator: __webpack_require__(379), Events: __webpack_require__(71), - BaseSound: __webpack_require__(132), - BaseSoundManager: __webpack_require__(131), + BaseSound: __webpack_require__(133), + BaseSoundManager: __webpack_require__(132), - WebAudioSound: __webpack_require__(383), - WebAudioSoundManager: __webpack_require__(381), + WebAudioSound: __webpack_require__(386), + WebAudioSoundManager: __webpack_require__(384), - HTML5AudioSound: __webpack_require__(378), - HTML5AudioSoundManager: __webpack_require__(377), + HTML5AudioSound: __webpack_require__(381), + HTML5AudioSoundManager: __webpack_require__(380), - NoAudioSound: __webpack_require__(380), - NoAudioSoundManager: __webpack_require__(379) + NoAudioSound: __webpack_require__(383), + NoAudioSoundManager: __webpack_require__(382) }; diff --git a/dist/phaser-facebook-instant-games.min.js b/dist/phaser-facebook-instant-games.min.js index fe5bdae45..1bdc3f879 100644 --- a/dist/phaser-facebook-instant-games.min.js +++ b/dist/phaser-facebook-instant-games.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(window,function(){return 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=519)}([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||!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 a in e)if(e.hasOwnProperty(a)){var h=i(e,a,s);if(!1!==h){if(n((r||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0&&(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},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}});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},function(t,e,i){var n=new(i(0))({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),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},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n=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=l},function(t,e,i){t.exports={Alpha:i(259),Animation:i(260),BlendMode:i(263),ComputedSize:i(552),Crop:i(553),Depth:i(264),Flip:i(554),GetBounds:i(555),Mask:i(268),Origin:i(556),PathFollower:i(557),Pipeline:i(117),ScrollFactor:i(271),Size:i(558),Texture:i(559),TextureCrop:i(560),Tint:i(561),ToJSON:i(272),Transform:i(273),TransformMatrix:i(35),Visible:i(274)}},function(t,e,i){var n=i(0),s=i(272),r=i(98),o=i(9),a=i(118),h=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,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,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},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.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return s(this)},willRender:function(t){return!(h.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 i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.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),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});h.RENDER_MASK=15,t.exports=h},function(t,e,i){var n=i(176),s=i(5);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){var n=i(0),s=i(17),r=i(18),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},s.register("GameObjectCreator",o,"make"),t.exports=o},function(t,e,i){(function(e){var i={};t.exports=i,function(){i._nextId=0,i._seed=0,i._nowStartTime=+new Date,i.extend=function(t,e){var n,s;"boolean"==typeof e?(n=2,s=e):(n=1,s=!0);for(var r=n;r0;e--){var n=Math.floor(i.random()*(e+1)),s=t[e];t[e]=t[n],t[n]=s}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===toString.call(t)},i.clamp=function(t,e,i){return ti?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return e=void 0!==e?e:0,i=void 0!==i?i:1,e+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i=400&&t.status<=599&&(n=!1),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(){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.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){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)},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){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e){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};t.exports=i},function(t,e,i){var n={};t.exports=n;var s=i(32),r=i(37),o=i(110),a=i(16),h=i(38),l=i(224);!function(){n._inertiaScale=4,n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,n.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",gameObject:null,parts:[],plugin:{},angle:0,vertices:s.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,ignoreGravity:!1,ignorePointer:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0},lineWidth:0},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,_original:null},n=a.extend(i,e);return t(n,e),n},n.nextGroup=function(t){return t?n._nextNonCollidingGroupId--:n._nextCollidingGroupId++},n.nextCategory=function(){return n._nextCategory=n._nextCategory<<1,n._nextCategory};var t=function(t,e){e=e||{},n.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),s.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(t.bounds,t.vertices,t.velocity),n.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia});var i=t.isStatic?"#2e2b44":a.choose(["#006BA6","#0496FF","#FFBC42","#D81159","#8F2D56"]);t.render.fillStyle=t.render.fillStyle||i,t.render.strokeStyle=t.render.strokeStyle||"#000",t.render.sprite.xOffset+=-(t.bounds.min.x-t.position.x)/(t.bounds.max.x-t.bounds.min.x),t.render.sprite.yOffset+=-(t.bounds.min.y-t.position.y)/(t.bounds.max.y-t.bounds.min.y)};n.set=function(t,e,i){var s;for(s in"string"==typeof e&&(s=e,(e={})[s]=i),e)if(e.hasOwnProperty(s))switch(i=e[s],s){case"isStatic":n.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":n.setMass(t,i);break;case"density":n.setDensity(t,i);break;case"inertia":n.setInertia(t,i);break;case"vertices":n.setVertices(t,i);break;case"position":n.setPosition(t,i);break;case"angle":n.setAngle(t,i);break;case"velocity":n.setVelocity(t,i);break;case"angularVelocity":n.setAngularVelocity(t,i);break;case"parts":n.setParts(t,i);break;default:t[s]=i}},n.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(o.position,i,t.position,o.position)}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,r.add(t.position,e))},n.rotate=function(t,e,i){if(i){var s=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*s-a*r),y:i.y+(o*r+a*s)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*n+t.force.x/t.mass*o,t.velocity.y=c*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(f.vertices,t.angularVelocity,t.position),l.rotate(f.axes,t.angularVelocity),d>0&&r.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),h.update(f.bounds,f.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;io.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){t.exports={BLUR:i(610),BOOT:i(611),DESTROY:i(612),FOCUS:i(613),HIDDEN:i(614),PAUSE:i(615),POST_RENDER:i(616),POST_STEP:i(617),PRE_RENDER:i(618),PRE_STEP:i(619),READY:i(620),RESUME:i(621),STEP:i(622),VISIBLE:i(623)}},function(t,e,i){var n=i(42),s=i(14),r=i(94);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 o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"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 h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),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){var n={};t.exports=n;var s=i(37),r=i(16);n.create=function(t,e){for(var i=[],n=0;n0)return!1}return!0},n.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||n.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},n.hull=function(t){var e,i,n=[],r=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),r.pop(),n.concat(r)}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(59),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e,i){var n=i(0),s=i(3),r=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}},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)}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},scaleY:{get:function(){return Math.sqrt(this.b*this.b+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],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[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],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,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 o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(t.translateX=e[4],t.translateY=e[5],i||n){var a=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}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=o/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,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=r*c*e+-o*c*t+(-u*r+l*o)*c,i},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},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.decomposedMatrix=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(171),r=i(286),o=i(172),a=i(287),h=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=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e){var i={};t.exports=i,i.create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),s=Math.sin(e);i||(i={});var r=t.x*n-t.y*s;return i.y=t.x*s+t.y*n,i.x=r,i},i.rotateAbout=function(t,e,i,n){var s=Math.cos(e),r=Math.sin(e);n||(n={});var o=i.x+((t.x-i.x)*s-(t.y-i.y)*r);return n.y=i.y+((t.x-i.x)*r+(t.y-i.y)*s),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e){var i={};t.exports=i,i.create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&i.update(e,t),e},i.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var n=0;nt.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=i(23);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.fillColor,r=n||e.fillAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},function(t,e){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){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},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){t.exports={DESTROY:i(632),FADE_IN_COMPLETE:i(633),FADE_IN_START:i(634),FADE_OUT_COMPLETE:i(635),FADE_OUT_START:i(636),FLASH_COMPLETE:i(637),FLASH_START:i(638),PAN_COMPLETE:i(639),PAN_START:i(640),POST_RENDER:i(641),PRE_RENDER:i(642),SHAKE_COMPLETE:i(643),SHAKE_START:i(644),ZOOM_COMPLETE:i(645),ZOOM_START:i(646)}},function(t,e,i){t.exports={BOOT:i(812),DESTROY:i(813),DRAG_END:i(814),DRAG_ENTER:i(815),DRAG:i(816),DRAG_LEAVE:i(817),DRAG_OVER:i(818),DRAG_START:i(819),DROP:i(820),GAME_OUT:i(821),GAME_OVER:i(822),GAMEOBJECT_DOWN:i(823),GAMEOBJECT_DRAG_END:i(824),GAMEOBJECT_DRAG_ENTER:i(825),GAMEOBJECT_DRAG:i(826),GAMEOBJECT_DRAG_LEAVE:i(827),GAMEOBJECT_DRAG_OVER:i(828),GAMEOBJECT_DRAG_START:i(829),GAMEOBJECT_DROP:i(830),GAMEOBJECT_MOVE:i(831),GAMEOBJECT_OUT:i(832),GAMEOBJECT_OVER:i(833),GAMEOBJECT_POINTER_DOWN:i(834),GAMEOBJECT_POINTER_MOVE:i(835),GAMEOBJECT_POINTER_OUT:i(836),GAMEOBJECT_POINTER_OVER:i(837),GAMEOBJECT_POINTER_UP:i(838),GAMEOBJECT_POINTER_WHEEL:i(839),GAMEOBJECT_UP:i(840),GAMEOBJECT_WHEEL:i(841),MANAGER_BOOT:i(842),MANAGER_PROCESS:i(843),MANAGER_UPDATE:i(844),POINTER_DOWN:i(845),POINTER_DOWN_OUTSIDE:i(846),POINTER_MOVE:i(847),POINTER_OUT:i(848),POINTER_OVER:i(849),POINTER_UP:i(850),POINTER_UP_OUTSIDE:i(851),POINTER_WHEEL:i(852),POINTERLOCK_CHANGE:i(853),PRE_UPDATE:i(854),SHUTDOWN:i(855),START:i(856),UPDATE:i(857)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e,i){var n={};t.exports=n;var s=i(32),r=i(16),o=i(24),a=i(38),h=i(37),l=i(479);n.rectangle=function(t,e,i,n,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(a.chamfer){var l=a.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},n.trapezoid=function(t,e,i,n,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-n+" L "+c+" "+-n+" L "+d+" 0":"L 0 0 L "+c+" "+-n+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return o.create(r.extend({},f,h))},n.circle=function(t,e,i,s,o){s=s||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),n.polygon(t,e,h,i,r.extend({},a,s))},n.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return n.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&s.area(A)1?(f=o.create(r.extend({parts:p.slice(0)},n)),o.setPosition(f,{x:t,y:e}),f):p[0]}},function(t,e,i){var n=i(146),s=i(25);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;dthis.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=h},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},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,i){var n=i(0),s=i(12),r=i(13),o=i(961),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,o){r.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s.Animation(this),this.setTexture(n,o),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e,i){return this.anims.play(t,e,i),this},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=a},function(t,e,i){var n=i(0),s=i(19),r=i(21),o=i(8),a=i(1),h=i(5),l=i(7),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s80*i){n=h=t[0],a=l=t[1];for(var T=i;Th&&(h=u),f>l&&(l=f);g=0!==(g=Math.max(h-n,l-a))?1/g:0}return o(y,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===_(t,e,i,n)>0)for(r=e;r=e;r-=n)o=b(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(S(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(S(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),S(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(m(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&m(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(m(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.prevZ,v=t.nextZ;p&&p.z>=c&&v&&v.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!y(s,r)&&x(s,n,n.next,r)&&T(s,r)&&T(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),S(n),S(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=w(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&T(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=w(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&T(t,e)&&T(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(y(t,e)&&y(i,n)||y(t,n)&&y(i,e))||m(t,e,i)>0!=m(t,e,n)>0&&m(i,n,t)>0!=m(i,n,e)>0}function T(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function w(t,e){var i=new A(t.i,t.x,t.y),n=new A(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function b(t,e,i,n){var s=new A(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e,i){var n=i(70);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){t.exports={COMPLETE:i(881),DECODED:i(882),DECODED_ALL:i(883),DESTROY:i(884),DETUNE:i(885),GLOBAL_DETUNE:i(886),GLOBAL_MUTE:i(887),GLOBAL_RATE:i(888),GLOBAL_VOLUME:i(889),LOOP:i(890),LOOPED:i(891),MUTE:i(892),PAUSE_ALL:i(893),PAUSE:i(894),PLAY:i(895),RATE:i(896),RESUME_ALL:i(897),RESUME:i(898),SEEK:i(899),STOP_ALL:i(900),STOP:i(901),UNLOCKED:i(902),VOLUME:i(903)}},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||e>s||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(0),s=i(19),r=i(21),o=i(8),a=i(1),h=i(7),l=new n({Extends:r,initialize:function t(e,i,n,s,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),n=a(c,"url"),l=a(c,"normalMap"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(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:o};if(r.call(this,e,d),l){var f=new t(e,this.key,l,s,o);f.type="normalMap",this.setLink(f),e.addFile(f)}},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")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;nthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight,this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e,i){var n=i(0),s=i(51),r=i(256),o=i(257),a=i(155),h=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=h},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;si&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){t.exports={ADD:i(859),COMPLETE:i(860),FILE_COMPLETE:i(861),FILE_KEY_COMPLETE:i(862),FILE_LOAD_ERROR:i(863),FILE_LOAD:i(864),FILE_PROGRESS:i(865),POST_PROCESS:i(866),PROGRESS:i(867),START:i(868)}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(964),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,s){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(u-h)*(r-l)-(c-l)*(s-h),f=(o-s)*(r-l)-(a-r)*(s-h),p=(c-l)*(o-s)-(u-h)*(a-r);if(0===p)return!1;var g=d/p,v=f/p;return g>=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(t,e,i){var n={};t.exports=n;var s=i(16);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r0){i||(i={}),n=e.split(" ");for(var l=0;l0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(s.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}}},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e,i){var n=i(22);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e,i){var n=i(0),s=i(275),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("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;nT||x.y>w)){var b=Math.max(x.x,e),S=Math.max(x.y,i),A=Math.min(x.r,T)-b,_=Math.min(x.b,w)-S;v=A,m=_,p=o?h+(u-(b-x.x)-A):h+(b-x.x),g=a?l+(c-(S-x.y)-_):l+(S-x.y),e=b,i=S,n=A,r=_}else p=0,g=0,v=0,m=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var E=this.source.width,C=this.source.height;return t.u0=Math.max(0,p/E),t.v0=Math.max(0,g/C),t.u1=Math.min(1,(p+v)/E),t.v1=Math.min(1,(g+m)/C),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=m,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},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,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,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 o(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.texture=null,this.source=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=o},function(t,e,i){var n=i(0),s=i(103),r=i(393),o=i(394),a=i(163),h=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.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 o(this,t,e,i)},getRandomPoint:function(t){return a(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.width=0,this.height=0,this},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},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=h},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var n=i(244),s=i(0),r=i(118),o=i(1),a=i(5),h=i(7),l=i(387),u=i(105),c=i(63),d=new s({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?h(e[0])&&(i=e,e=null):h(e)&&(i=e,e=null),this.scene=t,this.children=new u(e),this.isParent=!0,this.classType=o(i,"classType",c),this.name=o(i,"name",""),this.active=o(i,"active",!0),this.maxSize=o(i,"maxSize",-1),this.defaultKey=o(i,"defaultKey",null),this.defaultFrame=o(i,"defaultFrame",null),this.runChildUpdate=o(i,"runChildUpdate",!1),this.createCallback=o(i,"createCallback",null),this.removeCallback=o(i,"removeCallback",null),this.createMultipleCallback=o(i,"createMultipleCallback",null),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return t0&&r.motion=r.sleepThreshold&&n.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else n.set(r,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,s=0;sn._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||s.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&s.trigger(t,"sleepEnd"))}},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&e0;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){var n=i(0),s=i(12),r=i(40),o=i(9),a=i(53),h=i(11),l=i(35),u=i(170),c=i(3),d=new n({Extends:o,Mixins:[s.Alpha,s.Visible],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),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;gC&&w_&&bs&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras;var i=this.scaleManager.resolution;return this.resolution=i,this._cx=this._x*i,this._cy=this._y*i,this._cw=this._width*i,this._ch=this._height*i,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=d},function(t,e){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;i0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){t.exports={ADD:i(757),ERROR:i(758),LOAD:i(759),READY:i(760),REMOVE:i(761)}},function(t,e){t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement)return t;return i||(i=document.body),i.appendChild(t),t}},function(t,e,i){var n=i(84);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 o=e.length-1;o>=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e,i){var n=i(0),s=i(70),r=i(9),o=i(71),a=i(30),h=i(2),l=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on(a.FOCUS,function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once(o.COMPLETE,n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(o.STOP_ALL,this)},unlock:h,onBlur:h,onFocus:h,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=l},function(t,e,i){var n=i(0),s=i(9),r=i(71),o=i(20),a=i(2),h=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},function(t,e,i){var n=i(191),s=i(0),r=i(2),o=i(135),a=new s({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?n.Add(this.list,t):n.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?n.AddAt(this.list,t,e):n.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o.inplace(this.list,e),this):this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return n.GetFirst(this.list,t,e,i,s)},getAll:function(t,e,i,s){return n.GetAll(this.list,t,e,i,s)},count:function(t,e){return n.CountAllMatching(this.list,t,e)},swap:function(t,e){n.Swap(this.list,t,e)},moveTo:function(t,e){return n.MoveTo(this.list,t,e)},remove:function(t,e){return e?n.Remove(this.list,t):n.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?n.RemoveAt(this.list,t):n.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?n.RemoveBetween(this.list,t,e):n.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return n.BringToTop(this.list,t)},sendToBack:function(t){return n.SendToBack(this.list,t)},moveUp:function(t){return n.MoveUp(this.list,t),t},moveDown:function(t){return n.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e){return n.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?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}}});t.exports=a},function(t,e,i){var n=i(192),s=i(385);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;il&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a0&&o.length0&&a.lengthe.right||t.y>e.bottom)}},function(t,e,i){var n=i(5),s={},r={register:function(t,e,i,n,r){s[t]={plugin:e,mapping:i,settingsKey:n,configKey:r}},getPlugin:function(t){return s[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in s){var a=s[o].plugin,h=s[o].mapping,l=s[o].settingsKey,u=s[o].configKey;n(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){s.hasOwnProperty(t)&&delete s[t]}};t.exports=r},function(t,e,i){t.exports={ANY_KEY_DOWN:i(1199),ANY_KEY_UP:i(1200),COMBO_MATCH:i(1201),DOWN:i(1202),KEY_DOWN:i(1203),KEY_UP:i(1204),UP:i(1205)}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),{responseType:t,async:e,user:i,password:n,timeout:s,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e,i){var n=i(0),s=i(220),r=i(63),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e,i){t.exports={Bounce:i(1299),Collision:i(1300),Force:i(1301),Friction:i(1302),Gravity:i(1303),Mass:i(1304),Static:i(1305),Sensor:i(1306),SetBody:i(1307),Sleep:i(1309),Transform:i(1322),Velocity:i(1323)}},function(t,e){var i={};t.exports=i,i.create=function(t,e){var n=t.bodyA,s=t.bodyB,r={id:i.id(n,s),bodyA:n,bodyB:s,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||s.isSensor,timeCreated:e,timeUpdated:e,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return i.update(r,t,e),r},i.update=function(t,e,n){if(t.collision=e,e.collided){var s=e.supports,r=t.activeContacts,o=e.parentA,a=e.parentB;t.inverseMass=o.inverseMass+a.inverseMass,t.friction=Math.min(o.friction,a.friction),t.frictionStatic=Math.max(o.frictionStatic,a.frictionStatic),t.restitution=Math.max(o.restitution,a.restitution),t.slop=Math.max(o.slop,a.slop);for(var h=0;h=this.firstgid&&t1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(22),s=i(0),r=i(9),o=i(115),a=i(261),h=i(262),l=i(5),u=new s({Extends:r,initialize:function(t,e,i){r.call(this),this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,l(i,"frames",[]),l(i,"defaultTextureKey",null)),this.frameRate=l(i,"frameRate",null),this.duration=l(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=l(i,"skipMissedFrames",!0),this.delay=l(i,"delay",0),this.repeat=l(i,"repeat",0),this.repeatDelay=l(i,"repeatDelay",0),this.yoyo=l(i,"yoyo",!1),this.showOnStart=l(i,"showOnStart",!1),this.hideOnComplete=l(i,"hideOnComplete",!1),this.paused=!1,this.manager.on(o.PAUSE_ALL,this.pause,this),this.manager.on(o.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=a[0],a[0].prevFrame=s;var v=1/(a.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),a(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);if(t._repeatDelay>0&&!1===t.pendingRepeat)t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay;else if(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying){this.getNextTick(t),t.pendingRepeat=!1;var e=t.currentFrame,i=t.parent;this.emit(o.ANIMATION_REPEAT,this,e),i.emit(o.SPRITE_ANIMATION_KEY_REPEAT+this.key,this,e,t.repeatCounter,i),i.emit(o.SPRITE_ANIMATION_REPEAT,this,e,t.repeatCounter,i)}},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i1&&(n.prevFrame=this.frames[i-1],n.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.removeAllListeners(),this.manager.off(o.PAUSE_ALL,this.pause,this),this.manager.off(o.RESUME_ALL,this.resume,this),this.manager.remove(this.key);for(var t=0;t=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,i){var n=i(60),s=i(4);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},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){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){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=(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,i){var n=i(285),s=i(288),r=i(290),o=i(291);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var n=i(171);t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1);var r=Math.floor(6*t),o=6*t-r,a=Math.floor(i*(1-e)*255),h=Math.floor(i*(1-o*e)*255),l=Math.floor(i*(1-(1-o)*e)*255),u=i=Math.floor(i*=255),c=i,d=i,f=r%6;return 0===f?(c=l,d=a):1===f?(u=h,d=a):2===f?(u=a,d=l):3===f?(u=a,c=h):4===f?(u=l,c=a):5===f&&(c=a,d=h),s?s.setTo?s.setTo(u,c,d,s.alpha,!1):(s.r=u,s.g=c,s.b=d,s.color=n(u,c,d),s):{r:u,g:c,b:d,color:n(u,c,d)}}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var n=i(293),s=i(294),r=i(295),o=i(296),a=i(297),h=i(298),l=i(299),u=i(300),c=i(301),d=i(302),f=i(303),p=i(304);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:n.Out,Bounce:s.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":n.In,"Bounce.easeIn":s.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":n.Out,"Bounce.easeOut":s.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":s.InOut}},function(t,e,i){var n=i(123),s=i(124),r=i(26),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.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").createImageData(1,1);return a=n.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.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,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(o.getUserMedia=!1),!n.iOS&&(s.ie||s.firefox||s.chrome)&&(o.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.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)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},function(t,e,i){var n=i(23),s=i(20),r={Angle:i(716),Distance:i(724),Easing:i(726),Fuzzy:i(727),Interpolation:i(730),Pow2:i(735),Snap:i(737),RandomDataGenerator:i(739),Average:i(740),Bernstein:i(313),Between:i(179),CatmullRom:i(178),CeilTo:i(741),Clamp:i(22),DegToRad:i(40),Difference:i(742),Factorial:i(314),FloatBetween:i(320),FloorTo:i(743),FromPercent:i(95),GetSpeed:i(744),IsEven:i(745),IsEvenStrict:i(746),Linear:i(122),MaxAdd:i(747),MinSub:i(748),Percent:i(749),RadToDeg:i(180),RandomXY:i(750),RandomXYZ:i(751),RandomXYZW:i(752),Rotate:i(321),RotateAround:i(267),RotateAroundDistance:i(165),RoundAwayFromZero:i(322),RoundTo:i(753),SinCosTableGenerator:i(754),SmootherStep:i(166),SmoothStep:i(167),TransformXY:i(323),Within:i(755),Wrap:i(61),Vector2:i(3),Vector3:i(181),Vector4:i(324),Matrix3:i(325),Matrix4:i(326),Quaternion:i(327),RotateVec3:i(756)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)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,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,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},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],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=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=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],m=s[12],y=s[13],x=s[14],T=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+m)*T,this.y=(e*o+i*u+n*p+y)*T,this.z=(e*a+i*c+n*g+x)*T,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/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){var n={Global:["game","anims","cache","plugins","registry","scale","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]};n.Global.push("facebook"),t.exports=n},function(t,e,i){var n=i(0),s=i(10),r=new n({initialize:function(t){this.name="WebGLPipeline",this.game=t.game,this.view=t.game.canvas,this.resolution=1,this.width=0,this.height=0,this.gl=t.gl,this.vertexCount=0,this.vertexCapacity=t.vertexCapacity,this.renderer=t.renderer,this.vertexData=t.vertices?t.vertices:new ArrayBuffer(t.vertexCapacity*t.vertexSize),this.vertexBuffer=this.renderer.createVertexBuffer(t.vertices?t.vertices:this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=this.renderer.createProgram(t.vertShader,t.fragShader),this.attributes=t.attributes,this.vertexSize=t.vertexSize,this.topology=t.topology,this.bytes=new Uint8Array(this.vertexData),this.vertexComponentCount=s.getComponentCount(t.attributes,this.gl),this.flushLocked=!1,this.active=!1},boot:function(){},addAttribute:function(t,e,i,n,s){return this.attributes.push({name:t,size:e,type:this.renderer.glFormats[i],normalized:n,offset:s}),this},shouldFlush:function(){return this.vertexCount>=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this.resolution=i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):-1!==h&&t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(0),s=i(68),r=i(1),o=i(337),a=i(765),h=i(766),l=i(35),u=i(10),c=i(183),d=new n({Extends:c,Mixins:[o],initialize:function(t){var e=t.renderer.config;c.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:r(t,"topology",t.renderer.gl.TRIANGLES),vertShader:r(t,"vertShader",h),fragShader:r(t,"fragShader",a),vertexCapacity:r(t,"vertexCapacity",6*e.batchSize),vertexSize:r(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this.batches=[],this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return c.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return c.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){return void 0===t&&(t=this.renderer.blankTexture.glTexture),void 0===e&&(e=0),this.requireTextureBatch(t,e)&&this.pushBatch(t,e),this},requireTextureBatch:function(t,e){var i=this.batches,n=i.length;return!(n>0)||!((e>0?i[n-1].textures[e-1]:i[n-1].texture)===t)},pushBatch:function(t,e){if(0===e)this.batches.push({first:this.vertexCount,texture:t,textures:[]});else{var i=[];i[e-1]=t,this.batches.push({first:this.vertexCount,texture:null,textures:i})}},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,n=this.gl,s=this.vertexCount,r=this.topology,o=this.vertexSize,a=this.renderer,h=this.batches,l=h.length,u=0,c=null;if(0===l||0===s)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,s*o));for(var d=0;d0){for(e=0;e0){for(e=0;e0&&(a.setTexture2D(c.texture,0,!1),n.drawArrays(r,c.first,u)),this.vertexCount=0,h.length=0,this.flushLocked=!1,this},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,l=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.cutWidth,v=o.cutHeight,m=-t.displayOriginX+f,y=-t.displayOriginY+p;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||o.updateCropUVs(x,t.flipX,t.flipY),h=x.u0,l=x.v0,c=x.u1,d=x.v1,g=x.width,v=x.height,f=x.x,p=x.y,m=-t.displayOriginX+f,y=-t.displayOriginY+p}t.flipX&&(m+=g,g*=-1),t.flipY&&(y+=v,v*=-1);var T=m+g,w=y+v;s.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),s.e=t.x,s.f=t.y,n.multiply(s,r)):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY,n.multiply(s,r));var b=r.getX(m,y),S=r.getY(m,y),A=r.getX(m,w),_=r.getY(m,w),E=r.getX(T,w),C=r.getY(T,w),M=r.getX(T,y),P=r.getY(T,y),O=u.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),R=u.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),L=u.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),D=u.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(b=Math.round(b),S=Math.round(S),A=Math.round(A),_=Math.round(_),E=Math.round(E),C=Math.round(C),M=Math.round(M),P=Math.round(P)),this.setTexture2D(a,0);var F=t._isTinted&&t.tintFill;this.batchQuad(b,S,A,_,E,C,M,P,h,l,c,d,O,R,L,D,F,a,0)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y){var x=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),x=!0,this.setTexture2D(m,y));var T=this.vertexViewF32,w=this.vertexViewU32,b=this.vertexCount*this.vertexComponentCount-1;return T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=i,T[++b]=n,T[++b]=h,T[++b]=c,T[++b]=v,w[++b]=p,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=o,T[++b]=a,T[++b]=u,T[++b]=l,T[++b]=v,w[++b]=f,this.vertexCount+=6,x},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g){var v=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),this.setTexture2D(p,g),v=!0);var m=this.vertexViewF32,y=this.vertexViewU32,x=this.vertexCount*this.vertexComponentCount-1;return m[++x]=t,m[++x]=e,m[++x]=o,m[++x]=a,m[++x]=f,y[++x]=u,m[++x]=i,m[++x]=n,m[++x]=o,m[++x]=l,m[++x]=f,y[++x]=c,m[++x]=s,m[++x]=r,m[++x]=h,m[++x]=l,m[++x]=f,y[++x]=d,this.vertexCount+=3,v},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,S,A,_,E,C,M,P,O){this.renderer.setPipeline(this,t);var R=this._tempMatrix1,L=this._tempMatrix2,D=this._tempMatrix3,F=m/i+E,k=y/n+C,I=(m+x)/i+E,B=(y+T)/n+C,Y=o,N=a,X=-g,z=-v;if(t.isCropped){var U=t._crop;Y=U.width,N=U.height,o=U.width,a=U.height;var G=m=U.x,W=y=U.y;c&&(G=x-U.x-U.width),d&&!e.isRenderTexture&&(W=T-U.y-U.height),F=G/i+E,k=W/n+C,I=(G+U.width)/i+E,B=(W+U.height)/n+C,X=-g+m,z=-v+y}d^=!O&&e.isRenderTexture?1:0,c&&(Y*=-1,X+=o),d&&(N*=-1,z+=a);var V=X+Y,H=z+N;L.applyITRS(s,r,u,h,l),R.copyFrom(M.matrix),P?(R.multiplyWithOffset(P,-M.scrollX*f,-M.scrollY*p),L.e=s,L.f=r,R.multiply(L,D)):(L.e-=M.scrollX*f,L.f-=M.scrollY*p,R.multiply(L,D));var j=D.getX(X,z),q=D.getY(X,z),K=D.getX(X,H),J=D.getY(X,H),Z=D.getX(V,H),Q=D.getY(V,H),$=D.getX(V,z),tt=D.getY(V,z);M.roundPixels&&(j=Math.round(j),q=Math.round(q),K=Math.round(K),J=Math.round(J),Z=Math.round(Z),Q=Math.round(Q),$=Math.round($),tt=Math.round(tt)),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,F,k,I,B,w,b,S,A,_,e,0)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),m=h.getY(l,c),y=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,m,y,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n;this.setTexture2D();var h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),m=this.currentFrame,y=m.u0,x=m.v0,T=m.u1,w=m.v1;this.batchQuad(l,u,c,d,f,p,g,v,y,x,T,w,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,m=g.v0,y=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,m,y,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&H[4]?this.batchQuad(D,F,P,O,H[0],H[1],H[2],H[3],U,G,W,V,B,Y,N,X,I):(j[0]=D,j[1]=F,j[2]=P,j[3]=O,j[4]=1),h&&j[4]?this.batchQuad(C,M,R,L,j[0],j[1],j[2],j[3],U,G,W,V,B,Y,N,X,I):(H[0]=C,H[1]=M,H[2]=R,H[3]=L,H[4]=1)}}});t.exports=d},function(t,e,i){var n=i(11);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,r,o=Number.MAX_VALUE,a=Number.MAX_VALUE,h=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,u=0;u0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit(o.START,this),this.events.emit(o.READY,this,t)},shutdown:function(t){this.events.off(o.TRANSITION_INIT),this.events.off(o.TRANSITION_START),this.events.off(o.TRANSITION_COMPLETE),this.events.off(o.TRANSITION_OUT),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.SHUTDOWN,this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.DESTROY,this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e,i){var n=i(191),s=i(42),r=i(0),o=i(12),a=i(118),h=i(13),l=i(11),u=i(948),c=i(389),d=i(3),f=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Transform,o.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 o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,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.list.length>0)for(var e=this.list,i=new l,n=0;n-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=[],this._displayList=null}});t.exports=f},function(t,e,i){var n=i(136),s=i(0),r=i(953),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(120),s=i(0),r=i(199),o=i(259),a=i(263),h=i(264),l=i(268),u=i(117),c=i(273),d=i(274),f=i(271),p=i(35),g=i(102),v=i(13),m=i(1),y=i(5),x=i(23),T=i(959),w=new s({Extends:v,Mixins:[o,a,h,l,u,c,d,f,T],initialize:function(t,e){var i=y(e,"x",0),n=y(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this.setDefaultStyles(e)},setDefaultStyles:function(t){return y(t,"lineStyle",null)&&(this.defaultStrokeWidth=y(t,"lineStyle.width",1),this.defaultStrokeColor=y(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=y(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),y(t,"fillStyle",null)&&(this.defaultFillColor=y(t,"fillStyle.color",16777215),this.defaultFillAlpha=y(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,s){return void 0===s&&(s=1),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,s,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,s,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,n,s),this},setTexture:function(t,e,i){if(void 0===i&&(i=0),void 0===t)this.commandBuffer.push(r.CLEAR_TEXTURE);else{var n=this.scene.sys.textures.getFrame(t,e);n&&(2===i&&(i=3),this.commandBuffer.push(r.SET_TEXTURE,n,i))}return this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(r.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var s=this._lineWidth/2,r=t-s,o=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+n),this.lineTo(o+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,n,s,o),this},strokeTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,n,s,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,SET_TEXTURE:19,CLEAR_TEXTURE:20,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.width/2,r=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(397),a=i(133),h=i(399),l=i(969),u=new n({Extends:r,Mixins:[s.Depth,s.Mask,s.Pipeline,s.Transform,s.Visible,l],initialize:function(t,e,i,n){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var s=0;s0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;sn.width&&(t=n.width-this.frame.cutX),this.frame.cutY+e>n.height&&(e=n.height-this.frame.cutY),this.frame.setSize(t,e,this.frame.cutX,this.frame.cutY)}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.frame.cutWidth),void 0===r&&(r=this.frame.cutHeight);var o=255&(t>>16|0),a=255&(t>>8|0),h=255&(0|t),l=this.gl,u=this.frame;if(l){var c=this.renderer,f=this.getBounds();c.setFramebuffer(this.framebuffer,!0),s===u.source.width&&r===u.source.height||l.scissor(i+u.cutX,n+u.cutY,s,r),this.pipeline.drawFillRect(f.x,f.y,f.right,f.bottom,d.getTintFromFloats(o/255,a/255,h/255,1),e),s===u.source.width&&r===u.source.height||l.scissor(0,0,u.source.width,u.source.height),this.renderer.setFramebuffer(null,!0)}else this.context.fillStyle="rgba("+o+","+a+","+h+","+e+")",this.context.fillRect(i+u.cutX,n+u.cutY,s,r);return this},clear:function(){if(this.dirty){var t=this.gl;if(t){var e=this.renderer;e.setFramebuffer(this.framebuffer,!0),this.frame.cutWidth===this.canvas.width&&this.frame.cutHeight===this.canvas.height||t.scissor(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),e.setFramebuffer(null,!0)}else{var i=this.context;i.save(),i.setTransform(1,0,0,1,0,0),i.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),i.restore()}this.dirty=!1}return this},erase:function(t,e,i){this._eraseMode=!0;var s=this.renderer.currentBlendMode;return this.renderer.setBlendMode(n.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(s),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1),r){var o=this.camera._cx,a=this.camera._cy,h=this.camera._cw,l=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(o,a,h,l,l);var u=this.pipeline;u.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),this.batchList(t,e,i,n,s),u.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),u.projOrtho(0,u.width,u.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1),o){var h=this.camera._cx,l=this.camera._cy,u=this.camera._cw,c=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(h,l,u,c,c);var d=this.pipeline;d.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),d.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,r,s,this.camera.matrix,null),d.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),d.projOrtho(0,d.width,d.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;rl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=y+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=l,n+=a[h],h0&&(d+=h.lineSpacing*g),i.rtl)c=f-c;else if("right"===i.align)c+=o-h.lineWidths[g];else if("center"===i.align)c+=(o-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var v=h.width-h.lineWidths[g],m=e.measureText(" ").width,y=a[g].trim(),x=y.split(" ");v+=(a[g].length-y.length)*m;for(var T=Math.floor(v/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[g]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[g],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[g],c,d))}e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var b=this.input;return b&&!b.customHitArea&&(b.hitArea.width=this.width,b.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(26),s=i(0),r=i(12),o=i(28),a=i(13),h=i(318),l=i(121),u=i(985),c=i(3),d=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,s,r,l,u){var d=t.sys.game.renderer;a.call(this,t,"TileSprite");var f=t.sys.textures.get(l),p=f.get(u);s&&r?(s=Math.floor(s),r=Math.floor(r)):(s=p.width,r=p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=n.create(this,s,r),this.context=this.canvas.getContext("2d"),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(p.width),this.potHeight=h(p.height),this.fillCanvas=n.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(s,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.config.renderType===o.WEBGL&&t.sys.game.renderer.onContextRestored(function(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)},this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){return this.displayFrame=this.displayTexture.get(t),this.displayFrame.cutWidth&&this.displayFrame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame,e=this.fillContext,i=this.fillCanvas,n=this.potWidth,s=this.potHeight;this.renderer.gl||(n=t.cutWidth,s=t.cutHeight),e.clearRect(0,0,n,s),i.width=n,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,s),this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,n=this._tileScale.y,s=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,n),e.translate(-s,-r),e.fillStyle=this.fillPattern,e.fillRect(s,r,this.width/i,this.height/n),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),n.remove(this.canvas),n.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},function(t,e,i){var n=i(0),s=i(206),r=i(415),o=new n({initialize:function(t){this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return s(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n=0&&w<=1&&i.push(new n(r,o))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);r=a+b*p,o=h+b*g,b>=0&&b<=1&&i.push(new n(r,o));var S=(-x+Math.sqrt(T))/(2*y);r=a+S*p,o=h+S*g,S>=0&&S<=1&&i.push(new n(r,o))}}return i}},function(t,e,i){var n=i(51),s=new(i(4));t.exports=function(t,e,i){if(void 0===i&&(i=s),n(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(n(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){var n=i(4),s=i(90),r=i(430);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new n,new n,new n,new n],c=[s(o,t,u[0]),s(a,t,u[1]),s(h,t,u[2]),s(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var s,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,m=p*v-g*g,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&s+r<1&&(n.push({x:e[w].x,y:e[w].y}),i)));w++);return n}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,t}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,o=t.x3-e,a=t.y3-i,t.x3=o*s-a*r+e,t.y3=o*r+a*s+i,t}},function(t,e,i){t.exports={BUTTON_DOWN:i(1185),BUTTON_UP:i(1186),CONNECTED:i(1187),DISCONNECTED:i(1188),GAMEPAD_BUTTON_DOWN:i(1189),GAMEPAD_BUTTON_UP:i(1190)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,i){var n=i(20),s=i(141);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,i){var n=i(0),s=i(19),r=i(21),o=i(8),a=i(1),h=i(7),l=i(360),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,r=n.rectangle(i,s,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),u=this.tile.getCollisionGroup(),c=a(u,"objects",[]),d=[],f=0;f1&&(t.parts=d,this.setBody(s.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(228),r=i(144),o=i(38);n.collisions=function(t,e){for(var i=[],a=e.pairs.table,h=e.metrics,l=0;l1?1:0;d1?1:0;p0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n={};t.exports=n;var s=i(32),r=i(37);n.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,f=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&f<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var p=l.axisBody,g=p===t?e:t,v=[p.axes[i.axisNumber]];if(h=n._overlapAxes(p.vertices,g.vertices,v),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlaps?s=a:a=0?o.index-1:u.length-1],l.x=s.x-c.x,l.y=s.y-c.y,h=-r.dot(i,l),a=s,s=u[(o.index+1)%u.length],l.x=s.x-c.x,l.y=s.y-c.y,(n=-r.dot(i,l))r?(s.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),r=s.topologicalSort(i),o=[],a=0;a0&&!h.silent&&s.info(o.join(" "))}else s.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=n.resolve(t)||t,e[r]=s.map(t.uses||[],function(e){n.isPlugin(e)&&n.register(e);var r=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,r.range)?(s.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(r),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(s.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),r.name});for(var o=0;o=s[2];if("^"===i.operator)return s[0]>0?o[0]===s[0]&&r.number>=i.number:s[1]>0?o[1]===s[1]&&o[2]>=s[2]:o[2]===s[2]}return t===e||"*"===t}},function(t,e,i){var n={};t.exports=n;var s=i(76),r=(i(93),i(16));n.create=function(t){var e=s.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},function(t,e,i){var n=i(146);t.exports=function(t,e,i){var s=n(t,e,!0,i),r=n(t,e-1,!0,i),o=n(t,e+1,!0,i),a=n(t-1,e,!0,i),h=n(t+1,e,!0,i),l=s&&s.collides;return l&&(s.faceTop=!0,s.faceBottom=!0,s.faceLeft=!0,s.faceRight=!0),r&&r.collides&&(l&&(s.faceTop=!1),r.faceBottom=!l),o&&o.collides&&(l&&(s.faceBottom=!1),o.faceTop=!l),a&&a.collides&&(l&&(s.faceLeft=!1),a.faceRight=!l),h&&h.collides&&(l&&(s.faceRight=!1),h.faceLeft=!l),s&&!s.collides&&s.resetFaces(),s}},function(t,e,i){var n=i(78),s=i(111),r=i(232),o=i(77);t.exports=function(t,e,i,a,h){if(!s(e,i,h))return null;void 0===a&&(a=!0);var l=h.data[i][e],u=l&&l.collides;if(t instanceof n)null===h.data[i][e]&&(h.data[i][e]=new n(h,t.index,e,i,t.width,t.height)),h.data[i][e].copy(t);else{var c=t;null===h.data[i][e]?h.data[i][e]=new n(h,c,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=c}var d=h.data[i][e],f=-1!==h.collideIndexes.indexOf(d.index);return o(d,f),a&&u!==d.collides&&r(e,i,h),d}},function(t,e){t.exports=function(t,e,i){var n=i.collideIndexes.indexOf(t);e&&-1===n?i.collideIndexes.push(t):e||-1===n||i.collideIndexes.splice(n,1)}},function(t,e,i){var n=i(34),s=i(112),r=i(113),o=i(78);t.exports=function(t,e,i,a,h){for(var l=new s({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=Math.max(t,.001),this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},pause:function(){return this.state===o.PAUSED?this:(this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this)},play:function(t){if(void 0===t&&(t=!1),this.state===o.ACTIVE||this.state===o.PENDING_ADD&&this._pausedState===o.PENDING_ADD)return this;if(!this.parentIsTimeline&&(this.state===o.PENDING_REMOVE||this.state===o.REMOVED))return this.seek(0),this.parent.makeActive(this),this;var e=this.callbacks.onStart;return this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.ACTIVE):(this.countdown=this.calculatedOffset,this.state=o.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=o.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.parent.makeActive(this)),this},resetTweenData:function(t){for(var e=this.data,i=0;i0&&(n.elapsed=n.delay,n.state=o.DELAY)}},resume:function(){return this.state===o.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&ns.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}return this},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}return this},remove:function(){return this.parent.remove(this),this},stop:function(t){return this.state===o.ACTIVE&&void 0!==t&&this.seek(t),this.state!==o.REMOVED&&(this.state!==o.PAUSED&&this.state!==o.PENDING_ADD||(this.parentIsTimeline?(this.parent.manager._destroy.push(this),this.parent.manager._toProcess++):(this.parent._destroy.push(this),this.parent._toProcess++)),this.state=o.PENDING_REMOVE),this},update:function(t,e){if(this.state===o.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=!1,n=0;n0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},setStateFromStart:function(t,e,i){if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case o.PLAYING_FORWARD:case o.PLAYING_BACKWARD:if(!e.target){e.state=o.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;(n+=i)>s&&(r=n-s,n=s);var a,h=e.state===o.PLAYING_FORWARD,l=n/s;a=h?e.ease(l):e.ease(1-l),e.current=e.start+(e.end-e.start)*a,e.target[e.key]=e.current,e.elapsed=n,e.progress=l;var u=t.callbacks.onUpdate;u&&(u.params[1]=e.target,u.func.apply(u.scope,u.params)),1===l&&(h?e.hold>0?(e.elapsed=e.hold-r,e.state=o.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case o.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PENDING_RENDER);break;case o.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PLAYING_FORWARD);break;case o.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case o.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=o.PLAYING_FORWARD):e.state=o.COMPLETE}return e.state!==o.COMPLETE}});a.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=a},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d){return{target:t,key:e,getEndValue:i,getStartValue:n,ease:s,duration:0,totalDuration:0,delay:0,yoyo:a,hold:0,repeat:0,repeatDelay:0,flipX:c,flipY:d,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:r,duration:o,hold:h,repeat:l,repeatDelay:u},state:0}}},function(t,e,i){t.exports={Angle:i(529),Call:i(530),GetFirst:i(531),GetLast:i(532),GridAlign:i(533),IncAlpha:i(567),IncX:i(568),IncXY:i(569),IncY:i(570),PlaceOnCircle:i(571),PlaceOnEllipse:i(572),PlaceOnLine:i(573),PlaceOnRectangle:i(574),PlaceOnTriangle:i(575),PlayAnimation:i(576),PropertyValueInc:i(39),PropertyValueSet:i(29),RandomCircle:i(577),RandomEllipse:i(578),RandomLine:i(579),RandomRectangle:i(580),RandomTriangle:i(581),Rotate:i(582),RotateAround:i(583),RotateAroundDistance:i(584),ScaleX:i(585),ScaleXY:i(586),ScaleY:i(587),SetAlpha:i(588),SetBlendMode:i(589),SetDepth:i(590),SetHitArea:i(591),SetOrigin:i(592),SetRotation:i(593),SetScale:i(594),SetScaleX:i(595),SetScaleY:i(596),SetTint:i(597),SetVisible:i(598),SetX:i(599),SetXY:i(600),SetY:i(601),ShiftPosition:i(602),Shuffle:i(603),SmootherStep:i(604),SmoothStep:i(605),Spread:i(606),ToggleVisible:i(607),WrapInRectangle:i(608)}},function(t,e,i){var n=i(153),s=[];s[n.BOTTOM_CENTER]=i(246),s[n.BOTTOM_LEFT]=i(247),s[n.BOTTOM_RIGHT]=i(248),s[n.CENTER]=i(249),s[n.LEFT_CENTER]=i(251),s[n.RIGHT_CENTER]=i(252),s[n.TOP_CENTER]=i(253),s[n.TOP_LEFT]=i(254),s[n.TOP_RIGHT]=i(255);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){var n=i(43),s=i(79),r=i(44),o=i(80);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(43),s=i(45),r=i(44),o=i(46);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(43),s=i(47),r=i(44),o=i(48);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(250),s=i(79),r=i(82);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(80),s=i(81);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(82),s=i(45),r=i(81),o=i(46);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(82),s=i(47),r=i(81),o=i(48);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(79),s=i(49),r=i(80),o=i(50);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(45),s=i(49),r=i(46),o=i(50);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(47),s=i(49),r=i(48),o=i(50);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(154),s=i(95),r=i(23),o=i(4);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(258),s=i(154),r=i(95),o=i(23);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit(r.SPRITE_ANIMATION_KEY_UPDATE+i.key,i,t,e),e.emit(r.SPRITE_ANIMATION_UPDATE,i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=o},function(t,e){t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,s,r=1;if(i){if(te.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,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e,i){var n=i(42),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){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e,i){var n=i(157),s=i(116);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n-h&&(c-=h,n+=l),fd.right&&(f=u(f,f+(g-d.right),this.lerp.x)),vd.bottom&&(p=u(p,p+(v-d.bottom),this.lerp.y))):(f=u(f,g-h,this.lerp.x),p=u(p,v-l,this.lerp.y))}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.roundPixels&&(h=Math.round(h),l=Math.round(l)),this.scrollX=f,this.scrollY=p;var m=f+n,y=p+s;this.midPoint.set(m,y);var x=e/o,T=i/o;this.worldView.setTo(m-x/2,y-T/2,x,T),a.applyITRS(this.x+h,this.y+l,this.rotation,o,o),a.translate(-h,-l),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(36);t.exports=function(t){var e=new n;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(s,r,o)}return e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(e16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(36);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){var n=i(36);t.exports=function(t){var e=new n,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var s=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(s,r,o,255*a)}return e}},function(t,e,i){t.exports={Fade:i(647),Flash:i(648),Pan:i(649),Shake:i(682),Zoom:i(683)}},function(t,e,i){t.exports={In:i(650),Out:i(651),InOut:i(652)}},function(t,e,i){t.exports={In:i(653),Out:i(654),InOut:i(655)}},function(t,e,i){t.exports={In:i(656),Out:i(657),InOut:i(658)}},function(t,e,i){t.exports={In:i(659),Out:i(660),InOut:i(661)}},function(t,e,i){t.exports={In:i(662),Out:i(663),InOut:i(664)}},function(t,e,i){t.exports={In:i(665),Out:i(666),InOut:i(667)}},function(t,e,i){t.exports=i(668)},function(t,e,i){t.exports={In:i(669),Out:i(670),InOut:i(671)}},function(t,e,i){t.exports={In:i(672),Out:i(673),InOut:i(674)}},function(t,e,i){t.exports={In:i(675),Out:i(676),InOut:i(677)}},function(t,e,i){t.exports={In:i(678),Out:i(679),InOut:i(680)}},function(t,e,i){t.exports=i(681)},function(t,e,i){var n=i(0),s=i(28),r=i(306),o=i(1),a=i(5),h=i(7),l=i(176),u=i(2),c=i(182),d=i(170),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",void 0),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!0),this.autoRound=a(t,"autoRound",!1),this.autoCenter=a(t,"autoCenter",0),this.resizeInterval=a(t,"resizeInterval",500),this.fullscreenTarget=a(t,"fullscreenTarget",null),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"expandParent",this.expandParent),this.autoRound=a(e,"autoRound",this.autoRound),this.autoCenter=a(e,"autoCenter",this.autoCenter),this.resizeInterval=a(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=a(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.antialias=a(i,"antialias",!0),this.desynchronized=a(i,"desynchronized",!1),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3),this.maxLights=a(i,"maxLights",10);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){t.exports={os:i(123),browser:i(124),features:i(175),input:i(712),audio:i(713),video:i(714),fullscreen:i(715),canvasFeatures:i(307)}},function(t,e,i){var n,s,r,o=i(26),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");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;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");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);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},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){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},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),t0?Math.ceil(t):Math.floor(t)}},function(t,e,i){var n=i(3);t.exports=function(t,e,i,s,r,o,a,h){void 0===h&&(h=new n);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,f=-l*a,p=u*a,g=1/(c*p+f*-d);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=c*g*e+-d*g*t+(-s*c+i*d)*g,h}},function(t,e,i){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,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+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){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],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,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]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*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],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-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],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+m*h,e[4]=g*n+v*o+m*l,e[5]=g*s+v*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*n+x*o+T*l,e[8]=y*s+x*a+T*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],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-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,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,m=this.val;return m[0]=1-(c+f),m[3]=l+v,m[6]=u-g,m[1]=l-v,m[4]=1-(h+f),m[7]=d+p,m[2]=u+g,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=n*h-s*a,T=n*l-r*a,w=n*u-o*a,b=s*l-r*h,S=s*u-o*h,A=r*u-o*l,_=c*v-d*g,E=c*m-f*g,C=c*y-p*g,M=d*m-f*v,P=d*y-p*v,O=f*y-p*m,R=x*O-T*P+w*M+b*C-S*E+A*_;return R?(R=1/R,i[0]=(h*O-l*P+u*M)*R,i[1]=(l*C-a*O-u*E)*R,i[2]=(a*P-h*C+u*_)*R,i[3]=(r*P-s*O-o*M)*R,i[4]=(n*O-r*C+o*E)*R,i[5]=(s*C-n*P-o*_)*R,i[6]=(v*A-m*S+y*b)*R,i[7]=(m*w-g*A-y*T)*R,i[8]=(g*S-v*w+y*x)*R,this):null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),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],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},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(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=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]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],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*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*o+w*u+b*p,e[1]=x*n+T*a+w*c+b*g,e[2]=x*s+T*h+w*d+b*v,e[3]=x*r+T*l+w*f+b*m,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*o+w*u+b*p,e[5]=x*n+T*a+w*c+b*g,e[6]=x*s+T*h+w*d+b*v,e[7]=x*r+T*l+w*f+b*m,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*o+w*u+b*p,e[9]=x*n+T*a+w*c+b*g,e[10]=x*s+T*h+w*d+b*v,e[11]=x*r+T*l+w*f+b*m,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*o+w*u+b*p,e[13]=x*n+T*a+w*c+b*g,e[14]=x*s+T*h+w*d+b*v,e[15]=x*r+T*l+w*f+b*m,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},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){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},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,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=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],g=i[5],v=i[6],m=i[7],y=i[8],x=i[9],T=i[10],w=i[11],b=n*n*l+h,S=s*n*l+r*a,A=r*n*l-s*a,_=n*s*l-r*a,E=s*s*l+h,C=r*s*l+n*a,M=n*r*l+s*a,P=s*r*l-n*a,O=r*r*l+h;return i[0]=u*b+p*S+y*A,i[1]=c*b+g*S+x*A,i[2]=d*b+v*S+T*A,i[3]=f*b+m*S+w*A,i[4]=u*_+p*E+y*C,i[5]=c*_+g*E+x*C,i[6]=d*_+v*E+T*C,i[7]=f*_+m*E+w*C,i[8]=u*M+p*P+y*O,i[9]=c*M+g*P+x*O,i[10]=d*M+v*P+T*O,i[11]=f*M+m*P+w*O,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=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]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=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]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*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],o=e[2],a=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]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,m=o*h,y=o*l;return i[0]=1-(f+g),i[1]=c+y,i[2]=d-m,i[3]=0,i[4]=c-y,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+m,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,m=r*h;return e[0]=1-(d+p),e[1]=u+m,e[2]=c-v,e[3]=0,e[4]=u-m,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),m=h*(g*=v)-l*(p*=v),y=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(m*m+y*y+x*x))?(m*=v=1/v,y*=v,x*=v):(m=0,y=0,x=0);var T=p*x-g*y,w=g*m-f*x,b=f*y-p*m;return(v=Math.sqrt(T*T+w*w+b*b))?(T*=v=1/v,w*=v,b*=v):(T=0,w=0,b=0),n[0]=m,n[1]=T,n[2]=f,n[3]=0,n[4]=y,n[5]=w,n[6]=p,n[7]=0,n[8]=x,n[9]=b,n[10]=g,n[11]=0,n[12]=-(m*s+y*r+x*o),n[13]=-(T*s+w*r+b*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.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),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=i(0),s=i(181),r=i(325),o=new Int8Array([1,2,0]),a=new Float32Array([0,0,0]),h=new s(1,0,0),l=new s(0,1,0),u=new s,c=new r,d=new n({initialize:function(t,e,i,n){"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)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},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,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,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},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(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 n=c.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(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,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.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},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.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},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},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],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=i(329),s=i(26),r=i(28),o=i(175);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.CANVAS||e.renderType!==r.CANVAS&&!o.webGL){if(!o.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=r.CANVAS}else e.renderType=r.WEBGL;e.antialias||s.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=s.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||n.setCrisp(t.canvas),e.renderType!==r.HEADLESS&&(a=i(330),h=i(333),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(331),s=i(53),r=i(0),o=i(28),a=i(332),h=i(99),l=i(94),u=i(121),c=i(35),d=new r({initialize:function(t){this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.config={clearBeforeRender:t.config.clearBeforeRender,backgroundColor:t.config.backgroundColor,resolution:t.config.resolution,antialias:t.config.antialias,roundPixels:t.config.roundPixels},this.scaleMode=t.config.antialias?l.LINEAR:l.NEAREST,this.gameCanvas=t.canvas;var e={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d",e),this.currentContext=this.gameContext,this.blendModes=a(),this.currentScaleMode=0,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new c,this._tempMatrix2=new c,this._tempMatrix3=new c,this._tempMatrix4=new c,this.init()},init:function(){this.game.scale.on(h.RESIZE,this.onResize,this);var t=this.game.scale.baseSize;this.resize(t.width,t.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.scaleMode===l.NEAREST&&u.disable(this.gameContext)},onContextLost:function(){},onContextRestored:function(){},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),t.save(),this.drawCount=0},render:function(t,e,i,n){var r=e.list,o=r.length,a=n._cx,h=n._cy,l=n._cw,u=n._ch,c=n.renderToTexture?n.context:t.sys.context;c.save(),this.game.scene.customViewports&&(c.beginPath(),c.rect(a,h,l,u),c.clip()),this.currentContext=c;var d=n.mask;d&&d.preRenderCanvas(this,null,n._maskCamera),n.transparent||(c.fillStyle=n.backgroundColor.rgba,c.fillRect(a,h,l,u)),c.globalAlpha=n.alpha,c.globalCompositeOperation="source-over",this.drawCount+=r.length,n.renderToTexture&&n.emit(s.PRE_RENDER,n),n.matrix.copyToContext(c);for(var f=0;f=0?g=-(g+d):g<0&&(g=Math.abs(g)-d)),-1===y&&(v>=0?v=-(v+f):v<0&&(v=Math.abs(v)-f))}a.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.scale(m,y),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,g,v,d/p,f/p),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=d},function(t,e,i){var n=i(26),s=i(36),r=i(1);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=r(e,"width",t.width),c=r(e,"height",t.height);if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new s(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=n.createWebGL(this,u,c);f.getContext("2d").drawImage(t,h,l,u,c,0,0,u,c);var p=new Image;p.onerror=function(){i.call(null),n.remove(f)},p.onload=function(){i.call(null,p),n.remove(f)},p.src=f.toDataURL(o,a)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(o,a)}}},function(t,e,i){var n=i(42),s=i(307);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t[n.ERASE]="destination-out",t[n.SOURCE_IN]="source-in",t[n.SOURCE_OUT]="source-out",t[n.SOURCE_ATOP]="source-atop",t[n.DESTINATION_OVER]="destination-over",t[n.DESTINATION_IN]="destination-in",t[n.DESTINATION_OUT]="destination-out",t[n.DESTINATION_ATOP]="destination-atop",t[n.LIGHTER]="lighter",t[n.COPY]="copy",t[n.XOR]="xor",t}},function(t,e,i){var n=i(120),s=i(53),r=i(0),o=i(28),a=i(125),h=i(99),l=i(84),u=i(126),c=i(35),d=i(10),f=i(334),p=i(335),g=i(336),v=i(184),m=new r({initialize:function(t){var e=this,i=t.config,s={alpha:i.transparent,desynchronized:i.desynchronized,depth:!1,antialias:i.antialias,premultipliedAlpha:i.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:i.failIfMajorPerformanceCaveat,powerPreference:i.powerPreference};this.config={clearBeforeRender:i.clearBeforeRender,antialias:i.antialias,backgroundColor:i.backgroundColor,contextCreation:s,resolution:i.resolution,roundPixels:i.roundPixels,maxTextures:i.maxTextures,maxTextureSize:i.maxTextureSize,batchSize:i.batchSize,maxLights:i.maxLights},this.game=t,this.type=o.WEBGL,this.width=0,this.height=0,this.canvas=t.canvas,this.lostContextCallbacks=[],this.restoredContextCallbacks=[],this.blendModes=[],this.nativeTextures=[],this.contextLost=!1,this.pipelines=null,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this.currentActiveTextureUnit=0,this.currentTextures=new Array(16),this.currentFramebuffer=null,this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.canvas.addEventListener("webglcontextlost",function(t){e.contextLost=!0,t.preventDefault();for(var i=0;i0&&n>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==n}a&&(this.flush(),r.scissor(t,s-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},rebindPipeline:function(t){var e=this.gl;e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),this.hasActiveStencilMask()?e.clear(e.DEPTH_BUFFER_BIT):(e.disable(e.STENCIL_TEST),e.clear(e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)),e.viewport(0,0,this.width,this.height),this.setBlendMode(0,!0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.blankTexture.glTexture),this.currentActiveTextureUnit=0,this.currentTextures[0]=this.blankTexture.glTexture,this.currentPipeline=t,this.currentPipeline.bind(),this.currentPipeline.onBind()},clearPipeline:function(){this.flush(),this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.setBlendMode(0,!0)},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(n.equation),n.func.length>2?i.blendFuncSeparate(n.func[0],n.func[1],n.func[2],n.func[3]):i.blendFunc(n.func[0],n.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e,i){void 0===i&&(i=!0);var n=this.gl;return t!==this.currentTextures[e]&&(i&&this.flush(),this.currentActiveTextureUnit!==e&&(n.activeTexture(n.TEXTURE0+e),this.currentActiveTextureUnit=e),n.bindTexture(n.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.width,s=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(n=t.renderTexture.width,s=t.renderTexture.height):this.flush(),i.bindFramebuffer(i.FRAMEBUFFER,t),i.viewport(0,0,n,s),e&&(t?(this.drawingBufferHeight=s,this.pushScissor(0,0,n,s)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,r=s.NEAREST,h=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,a(e,i)&&(h=s.REPEAT),n===o.ScaleModes.LINEAR&&this.config.antialias&&(r=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,r,r,h,h,s.RGBA,t):this.createTexture2D(0,r,r,h,h,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&l(this.nativeTextures,e),this.gl.deleteTexture(t),this.currentTextures[0]!==t||this.game.pendingDestroy||this.setBlankTexture(!0),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,r=t._ch,o=this.pipelines.TextureTintPipeline,a=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-r),this.setFramebuffer(t.framebuffer);var h=this.gl;h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT),o.projOrtho(e,n+e,i,r+i,-1e3,1e3),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n+e,r+i,d.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL),t.emit(s.PRE_RENDER,t)}else this.pushScissor(e,i,n,r),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n,r,d.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,d.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,d.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit(s.POST_RENDER,t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=d.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera))},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.pipelines;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var i=this.config.backgroundColor;t.clearColor(i.redGL,i.greenGL,i.blueGL,i.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}for(var n in t.enable(t.SCISSOR_TEST),e)e[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,r=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);this.preRenderCamera(n);for(var l=this.currentMask,u=0;u0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step()},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.max(16+t.lastTime-i,0);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(30);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)},!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var n=i(343),s=i(26),r=i(5);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",n),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*a)),p=Math.floor(Math.abs(e.length*h));i||(i=s.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var g=i.getContext("2d");u&&g.clearRect(0,0,f,p),c&&c(i,g);for(var v=0;vi;)n-=i;ni.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e,i){var n=i(123);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e,i){var n=i(186);t.exports=function(t,e){var i=window.screen,s=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);if(s&&"string"==typeof s.type)return s.type;if("string"==typeof s)return s;if(i)return i.height>i.width?n.PORTRAIT:n.LANDSCAPE;if("number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?n.PORTRAIT:n.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return n.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return n.LANDSCAPE}return e>t?n.PORTRAIT:n.LANDSCAPE}},function(t,e){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},function(t,e){t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},function(t,e){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},function(t,e){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},function(t,e){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(0),s=i(188),r=i(9),o=i(54),a=i(30),h=i(362),l=i(363),u=i(364),c=i(365),d=i(35),f=i(323),p=new n({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var n=new u(this,i);n.smoothFactor=e.inputSmoothFactor,this.pointers.push(n)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(o.MANAGER_BOOT),this.game.events.on(a.PRE_RENDER,this.preRender,this),this.game.events.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var n=0;n10&&(t=10-this.pointersTotal);for(var i=0;i-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.useQueue||t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},function(t,e,i){var n=i(0),s=i(175),r=i(54),o=i(0),a=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.capture=t.inputMouseCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},requestPointerLock:function(){if(s.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){s.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onMouseMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseMove(e),t.capture&&e.preventDefault())},this.onMouseDown=function(n){i&&window.focus(),!n.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseDown(n),t.capture&&n.target===e&&n.preventDefault())},this.onMouseDownWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseDown(i)},this.onMouseUp=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseUp(i),t.capture&&i.target===e&&i.preventDefault())},this.onMouseUpWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseUp(i)},this.onMouseOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onMouseOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)},this.onMouseWheel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onMouseWheel(e)};var n=this.target;if(n){var r={passive:!0},o={passive:!1};n.addEventListener("mousemove",this.onMouseMove,this.capture?o:r),n.addEventListener("mousedown",this.onMouseDown,this.capture?o:r),n.addEventListener("mouseup",this.onMouseUp,this.capture?o:r),n.addEventListener("mouseover",this.onMouseOver,this.capture?o:r),n.addEventListener("mouseout",this.onMouseOut,this.capture?o:r),n.addEventListener("wheel",this.onMouseWheel,this.capture?o:r),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o)),s.pointerLock&&(this.pointerLockChange=function(e){var i=t.target;t.locked=document.pointerLockElement===i||document.mozPointerLockElement===i||document.webkitPointerLockElement===i,t.manager.queue.push(e)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&(window.removeEventListener("mousedown",this.onMouseDownWindow),window.removeEventListener("mouseup",this.onMouseUpWindow)),s.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},function(t,e,i){var n=i(308),s=i(0),r=i(62),o=i(177),a=i(317),h=i(3),l=new s({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.time=0,this.deltaX=0,this.deltaY=0,this.deltaZ=0},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,s=this.midPoint.y;if(t!==i||e!==s){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,s,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=n(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp),this.isDown=!1,this.wasTouch=!1},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp),this.isDown=!0,this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.manager.mouse.locked&&(this.movementX+=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY+=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=t.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,s=this.position.x,r=this.position.y,o=0;o0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,r=t.resolution,o=t.zoom,a=t.autoRound;if("string"==typeof e){var h=this.parentSize.width;0===h&&(h=window.innerWidth);var l=parseInt(e,10)/100;e=Math.floor(h*l)}if("string"==typeof i){var c=this.parentSize.height;0===c&&(c=window.innerHeight);var d=parseInt(i,10)/100;i=Math.floor(c*d)}this.resolution=1,this.scaleMode=s,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),o===n.ZOOM.MAX_ZOOM&&(o=this.getMaxZoom()),this.zoom=o,this.baseSize.setSize(e*r,i*r),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*o,t.minHeight*o),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*o,t.maxHeight*o),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==n.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=this.resolution,n=e.width*i,s=e.height*i;return(t.width!==n||t.height!==s)&&(t.setSize(n,s),!0)},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e(t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound,n=this.resolution;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t,e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,n=this.resolution,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,o=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i*n,e*i*n),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,h=t*i,l=e*i;return s&&(h=Math.floor(h),l=Math.floor(l)),h===t&&l===e||(a.width=h+"px",a.height=l+"px"),this.refresh(r,o)},setZoom:function(t){return this.zoom=t,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var n=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=n.marginLeft,s.marginTop=n.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,this.resolution,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===n.SCALE_MODE.NONE?(this.displaySize.setSize(s*o*1,r*o*1),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),o>1&&(i.width=t+"px",i.height=e+"px")):this.scaleMode===n.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(1*this.displaySize.width,1*this.displaySize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=p(this.parentSize.width,this.gameSize.width,0,!0),e=p(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==n.CENTER.NO_CENTER){var e=this.canvas,i=e.style,s=e.getBoundingClientRect(),r=s.width,o=s.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===n.CENTER.CENTER_HORIZONTALLY?h=0:t===n.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();this._requestedFullscreenChange=!0,"undefined"!=typeof Promise?e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT).then(this.fullscreenSuccessHandler).catch(this.fullscreenErrorHandler):i[e.request](t).then(this.fullscreenSuccessHandler).catch(this.fullscreenErrorHandler):(e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t),e.active?this.fullscreenSuccessHandler():this.fullscreenErrorHandler())}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&(this._requestedFullscreenChange=!0,document[t.cancel]()),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach(function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){this._requestedFullscreenChange||this.stopFullscreen(),this._requestedFullscreenChange=!1},onFullScreenError:function(){this.removeFullscreenTarget()},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy(),this.fullscreenTarget=null},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===n.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===n.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=v},function(t,e,i){var n=i(22),s=i(0),r=i(100),o=i(3),a=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio0&&(t=(e=r(e,n.y))*this.aspectRatio)):(i&&this.aspectRatios)&&(t=(e=r(e,n.y))*this.aspectRatio,n.x>0&&(e=(t=r(t,n.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},function(t,e,i){var n=i(0),s=i(130),r=i(18),o=i(30),a=i(5),h=i(86),l=i(2),u=i(370),c=i(189),d=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit(r.TRANSITION_INIT,n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=r.x&&t=r.y&&e=r.x&&t=r.y&&e0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=o},function(t,e,i){var n=i(131),s=i(0),r=i(9),o=i(380),a=i(2),h=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){var n=i(132),s=i(0),r=i(9),o=i(20),a=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!1},updateMarker:function(t){return!1},removeMarker:function(t){return null},play:function(t,e){return!1},pause:function(){return!1},resume:function(){return!1},stop:function(){return!1},destroy:function(){this.manager.remove(this),n.prototype.destroy.call(this)}});t.exports=a},function(t,e,i){var n=i(382),s=i(131),r=i(0),o=i(71),a=i(383),h=new r({Extends:s,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),s.call(this,t),this.locked&&this.unlock()},createAudioContext:function(t){var e=t.config.audio;return e&&e.context?(e.context.resume(),e.context):new AudioContext},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var s=this.game.cache.audio,r=i.length,a=0;a>4,u[h++]=(15&i)<<4|s>>2,u[h++]=(3&s)<<6|63&r;return l}},function(t,e,i){var n=i(132),s=i(0),r=i(71),o=new s({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),this.audioBuffer?(this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime1e3)return console.warn("Switch Game data too long. Max 1000 chars."),this;var i=this;return FBInstant.switchGameAsync(t,e).then(function(){i.emit("switchgame",t)}).catch(function(t){i.emit("switchgamefail",t)}),this},createShortcut:function(){var t=this;return FBInstant.canCreateShortcutAsync().then(function(e){e&&FBInstant.createShortcutAsync().then(function(){t.emit("shortcutcreated")}).catch(function(e){t.emit("shortcutfailed",e)})}),this},quit:function(){FBInstant.quit()},log:function(t,e,i){return this.checkAPI("logEvent")?(void 0===i&&(i={}),t.length>=2&&t.length<=40&&FBInstant.logEvent(t,parseFloat(e),i),this):this},preloadAds:function(t){if(!this.checkAPI("getInterstitialAdAsync"))return this;var e;Array.isArray(t)||(t=[t]);var i=this,s=0;for(e=0;e=3)return console.warn("Too many AdInstances. Show an ad before loading more"),this;for(e=0;e=3)return console.warn("Too many AdInstances. Show an ad before loading more"),this;for(e=0;e-1;r--)n[s][r]=t[r][s]}return n}},function(t,e){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,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=n);o>r;){if(o-r>600){var h=o-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(o,Math.floor(e+(h-l)*c/h+d));s(t,e,f,p,a)}var g=t[e],v=r,m=o;for(i(t,r,e),a(t[o],g)>0&&i(t,r,o);v0;)m--}0===a(t[r],g)?i(t,r,m):i(t,++m,o),m<=e&&(r=m+1),e<=m&&(o=m-1)}};t.exports=s},function(t,e,i){var n=i(5),s=i(119),r=function(t,e,i){for(var n=[],s=0;s0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(11);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),o=Math.max(t.right,e.right)-s,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(s,r,o,a)}},function(t,e,i){var n=i(0),s=i(12),r=i(951),o=i(13),a=i(7),h=i(187),l=i(324),u=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Origin,s.ScrollFactor,s.Transform,s.Visible,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new l,this.rotate3dAngle="deg",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof n?"#"===n[0]?this.setElement(n.substr(1),s,r):this.createElement(n,s,r):n&&this.setElement(n,s,r)},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e>>16,y=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+m+","+y+","+x+","+d+")",c.lineWidth=v,T+=3;break;case n.FILL_STYLE:g=l[T+1],f=l[T+2],m=(16711680&g)>>>16,y=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+m+","+y+","+x+","+f+")",T+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[T+1],l[T+2],l[T+3],l[T+4]):c.fillRect(l[T+1],l[T+2],l[T+3],l[T+4]),T+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.fill(),T+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.stroke(),T+=6;break;case n.LINE_TO:c.lineTo(l[T+1],l[T+2]),T+=2;break;case n.MOVE_TO:c.moveTo(l[T+1],l[T+2]),T+=2;break;case n.LINE_FX_TO:c.lineTo(l[T+1],l[T+2]),T+=5;break;case n.MOVE_FX_TO:c.moveTo(l[T+1],l[T+2]),T+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[T+1],l[T+2]),T+=2;break;case n.SCALE:c.scale(l[T+1],l[T+2]),T+=2;break;case n.ROTATE:c.rotate(l[T+1]),T+=1;break;case n.GRADIENT_FILL_STYLE:T+=5;break;case n.GRADIENT_LINE_STYLE:T+=6;break;case n.SET_TEXTURE:T+=2}c.restore()}}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(42),s=i(0),r=i(12),o=i(400),a=i(401),h=i(968),l=i(1),u=i(193),c=i(402),d=i(88),f=i(398),p=i(403),g=i(11),v=i(135),m=i(3),y=i(61),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];s.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===n&&(n=!1),void 0===s&&(s=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=s,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;i0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e,i){var n=i(0),s=i(991),r=i(68),o=i(11),a=i(33),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;sc+v)){var m=g.getPoint((u-c)/v);o.push(m);break}c+=v}return o}},function(t,e,i){var n=i(60),s=i(59);t.exports=function(t){for(var e=t.points,i=0,r=0;r0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(0),s=i(11),r=i(33),o=i(1012),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new s(0,0,n,o)),this.setPosition(e,i),this.setSize(n,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(1015),s=i(0),r=i(68),o=i(33),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(60),s=i(4);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e){t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=t,o=0;o0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],o):h=new s(t,e,i,a[0],a[1],a[2],o),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=o},function(t,e,i){t.exports={Circle:i(1074),Ellipse:i(1084),Intersects:i(427),Line:i(1103),Point:i(1124),Polygon:i(1138),Rectangle:i(442),Triangle:i(1168)}},function(t,e,i){t.exports={CircleToCircle:i(428),CircleToRectangle:i(429),GetCircleToCircle:i(1094),GetCircleToRectangle:i(1095),GetLineToCircle:i(209),GetLineToRectangle:i(211),GetRectangleIntersection:i(1096),GetRectangleToRectangle:i(1097),GetRectangleToTriangle:i(1098),GetTriangleToCircle:i(1099),GetTriangleToLine:i(434),GetTriangleToTriangle:i(1100),LineToCircle:i(210),LineToLine:i(90),LineToRectangle:i(430),PointToLine:i(438),PointToLineSegment:i(1101),RectangleToRectangle:i(138),RectangleToTriangle:i(431),RectangleToValues:i(1102),TriangleToCircle:i(433),TriangleToLine:i(435),TriangleToTriangle:i(436)}},function(t,e,i){var n=i(62);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(90),s=i(52),r=i(212),o=i(432);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e,i){var n=i(210),s=i(89);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=1);var n=e.x1,s=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-n)*(r-n)+(o-s)*(o-s);if(0===l)return!1;var u=((a-n)*(r-n)+(h-s)*(o-s))/l;if(u<0)return Math.sqrt((n-a)*(n-a)+(s-h)*(s-h))<=i;if(u>=0&&u<=1){var c=((s-h)*(r-n)-(n-a)*(o-s))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},function(t,e,i){var n=i(23),s=i(61),r=i(91);t.exports=function(t){var e=r(t)-n.TAU;return s(e,-Math.PI,Math.PI)}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e,i){var n=i(11);n.Area=i(1143),n.Ceil=i(1144),n.CeilAll=i(1145),n.CenterOn=i(173),n.Clone=i(1146),n.Contains=i(52),n.ContainsPoint=i(1147),n.ContainsRect=i(443),n.CopyFrom=i(1148),n.Decompose=i(432),n.Equals=i(1149),n.FitInside=i(1150),n.FitOutside=i(1151),n.Floor=i(1152),n.FloorAll=i(1153),n.FromPoints=i(185),n.GetAspectRatio=i(214),n.GetCenter=i(1154),n.GetPoint=i(157),n.GetPoints=i(265),n.GetSize=i(1155),n.Inflate=i(1156),n.Intersection=i(1157),n.MarchingAnts=i(276),n.MergePoints=i(1158),n.MergeRect=i(1159),n.MergeXY=i(1160),n.Offset=i(1161),n.OffsetPoint=i(1162),n.Overlaps=i(1163),n.Perimeter=i(116),n.PerimeterPoint=i(1164),n.Random=i(160),n.RandomOutside=i(1165),n.SameDimensions=i(1166),n.Scale=i(1167),n.Union=i(389),t.exports=n},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var n=i(448),s=i(449),r=i(0),o=i(9),a=i(3),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=r;for(i=0;i=r;)this._elapsed-=r,this.step(s)}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(n=(i=h.entries).length,t=0;t-1&&p>g&&(t.velocity.normalize().scale(g),p=g),t.speed=p},separate:function(t,e,i,n,s){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,s);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.ya.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,c=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)r.right&&(s=h(o.x,o.y,r.right,r.y)-o.radius):o.y>r.bottom&&(o.xr.right&&(s=h(o.x,o.y,r.right,r.bottom)-o.radius)),s*=-1}else s=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s&&(t.onOverlap||e.onOverlap)&&this.emit(u.OVERLAP,t.gameObject,e.gameObject,t,e),0!==s;var a=t.position.x-e.position.x,l=t.position.y-e.position.y,c=Math.sqrt(Math.pow(a,2)+Math.pow(l,2)),d=(e.position.x-t.position.x)/c||0,f=(e.position.y-t.position.y)/c||0,v=2*(t.velocity.x*d+t.velocity.y*f-e.velocity.x*d-e.velocity.y*f)/(t.mass+e.mass);t.immovable||(t.velocity.x=(t.velocity.x-v*t.mass*d)*t.bounce.x,t.velocity.y=(t.velocity.y-v*t.mass*f)*t.bounce.y),e.immovable||(e.velocity.x=(e.velocity.x+v*e.mass*d)*e.bounce.x,e.velocity.y=(e.velocity.y+v*e.mass*f)*e.bounce.y);var m=e.velocity.x-t.velocity.x,y=e.velocity.y-t.velocity.y,x=Math.atan2(y,m),T=this._frameTime;return t.immovable||(t.x+=t.velocity.x*T-s*Math.cos(x),t.y+=t.velocity.y*T-s*Math.sin(x)),e.immovable||(e.x+=e.velocity.x*T+s*Math.cos(x),e.y+=e.velocity.y*T+s*Math.sin(x)),(t.onCollide||e.onCollide)&&this.emit(u.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o,a;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f=e.getTilesWithinWorldXY(a,h,l,u);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,n,s,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,s,r,o){for(var a,h,l=t.body,c={left:0,right:0,top:0,bottom:0},d=!1,f=0;f0&&t>i&&(t=i)),0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),this.gameObject.x+=t,this.gameObject.y+=e,this._reset=!0}t<0?this.facing=r.FACING_LEFT:t>0&&(this.facing=r.FACING_RIGHT),e<0?this.facing=r.FACING_UP:e>0&&(this.facing=r.FACING_DOWN),this._dx=t,this._dy=e,this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,s=void 0!==i;return(n||s)&&(this.worldBounce||(this.worldBounce=new u),n&&(this.worldBounce.x=e),s&&(this.worldBounce.y=i)),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(56);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=i(56);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,m,y;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,m-g)*Math.max(0,y-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(51),s=i(0),r=i(56),o=i(52),a=i(3),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e,i){var n=i(0),s=i(108),r=i(1275),o=i(109),a=i(1276),h=new n({initialize:function(t,e,i,n,r){void 0===n&&(n=16),void 0===r&&(r=n),this.world=t,this.gameObject=null,this.enabled=!0,this.parent,this.id=t.getNextID(),this.name="",this.size={x:n,y:r},this.offset={x:0,y:0},this.pos={x:e,y:i},this.last={x:e,y:i},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:t.defaults.maxVelocityX,y:t.defaults.maxVelocityY},this.standing=!1,this.gravityFactor=t.defaults.gravityFactor,this.bounciness=t.defaults.bounciness,this.minBounceVelocity=t.defaults.minBounceVelocity,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER,this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.updateCallback,this.slopeStanding={min:.767944870877505,max:2.3736477827122884}},reset:function(t,e){this.pos={x:t,y:e},this.last={x:t,y:e},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:100,y:100},this.standing=!1,this.gravityFactor=1,this.bounciness=0,this.minBounceVelocity=40,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER},update:function(t){var e=this.pos;this.last.x=e.x,this.last.y=e.y,this.vel.y+=this.world.gravity*t*this.gravityFactor,this.vel.x=r(t,this.vel.x,this.accel.x,this.friction.x,this.maxVel.x),this.vel.y=r(t,this.vel.y,this.accel.y,this.friction.y,this.maxVel.y);var i=this.vel.x*t,n=this.vel.y*t,s=this.world.collisionMap.trace(e.x,e.y,i,n,this.size.x,this.size.y);this.handleMovementTrace(s)&&a(this,s);var o=this.gameObject;o&&(o.x=e.x-this.offset.x+o.displayOriginX*o.scaleX,o.y=e.y-this.offset.y+o.displayOriginY*o.scaleY),this.updateCallback&&this.updateCallback(this)},drawDebug:function(t){var e=this.pos;if(this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.size.x,this.size.y)),this.debugShowVelocity){var i=e.x+this.size.x/2,n=e.y+this.size.y/2;t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.vel.x,n+this.vel.y)}},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},skipHash:function(){return!this.enabled||0===this.type&&0===this.checkAgainst&&0===this.collides},touches:function(t){return!(this.pos.x>=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=h},function(t,e,i){var n=i(0),s=i(1280),r=new n({initialize:function(t,e){void 0===t&&(t=32),this.tilesize=t,this.data=Array.isArray(e)?e:[],this.width=Array.isArray(e)?e[0].length:0,this.height=Array.isArray(e)?e.length:0,this.lastSlope=55,this.tiledef=s},trace:function(t,e,i,n,s,r){var o={collision:{x:!1,y:!1,slope:!1},pos:{x:t+i,y:e+n},tile:{x:0,y:0}};if(!this.data)return o;var a=Math.ceil(Math.max(Math.abs(i),Math.abs(n))/this.tilesize);if(a>1)for(var h=i/a,l=n/a,u=0;u0?r:0,m=n<0?f:0,y=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var T=Math.floor((e+v)/f);if((l>0||u===T||T<0||T>=p)&&(T=-1),u>=0&&u1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,T,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+m,e=t.pos.x,a=0;break}}if(s){var w=s>0?o:0,b=s<0?f:0,S=Math.max(Math.floor(t.pos.x/f),0),A=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+w)/f);var _=Math.floor((i+w)/f);if((l>0||c===_||_<0||_>=g)&&(_=-1),c>=0&&c1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,_));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-w+b;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],m=i+s+(g<0?o:0)-d,y=n+r+(p>0?a:0)-f;if(p*y-g*m>0){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),T=g/x,w=-p/x,b=m*T+y*w,S=T*b,A=w*b;return S*S+A*A>=s*s+r*r?v||p*(y-r)-g*(m-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-A,t.collision.slope={x:p,y:g,nx:T,ny:w},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),s=i(474),r=i(475),o=i(476),a=new n({initialize:function(t){this.world=t,this.sys=t.scene.sys},body:function(t,e,i,n){return new s(this.world,t,e,i,n)},existing:function(t){var e=t.x-t.frame.centerX,i=t.y-t.frame.centerY,n=t.width,s=t.height;return t.body=this.world.create(e,i,n,s),t.body.parent=t,t.body.gameObject=t,t},image:function(t,e,i,n){var s=new r(this.world,t,e,i,n);return this.sys.displayList.add(s),s},sprite:function(t,e,i,n){var s=new o(this.world,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),s},destroy:function(){this.world=null,this.sys=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(223),r=new n({Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){this.body=t.create(e,i,n,s),this.body.parent=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=r},function(t,e,i){var n=i(0),s=i(223),r=i(87),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(0),s=i(223),r=i(63),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(471),s=i(0),r=i(108),o=i(472),a=i(9),h=i(222),l=i(1),u=i(88),c=i(105),d=i(1294),f=i(34),p=i(109),g=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.bodies=new c,this.gravity=l(e,"gravity",0),this.cellSize=l(e,"cellSize",64),this.collisionMap=new o,this.timeScale=l(e,"timeScale",1),this.maxStep=l(e,"maxStep",.05),this.enabled=!0,this.drawDebug=l(e,"debug",!1),this.debugGraphic;var i=l(e,"maxVelocity",100);if(this.defaults={debugShowBody:l(e,"debugShowBody",!0),debugShowVelocity:l(e,"debugShowVelocity",!0),bodyDebugColor:l(e,"debugBodyColor",16711935),velocityDebugColor:l(e,"debugVelocityColor",65280),maxVelocityX:l(e,"maxVelocityX",i),maxVelocityY:l(e,"maxVelocityY",i),minBounceVelocity:l(e,"minBounceVelocity",40),gravityFactor:l(e,"gravityFactor",1),bounciness:l(e,"bounciness",0)},this.walls={left:null,right:null,top:null,bottom:null},this.delta=0,this._lastId=0,l(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var s=l(n,"x",0),r=l(n,"y",0),h=l(n,"width",t.sys.scale.width),u=l(n,"height",t.sys.scale.height),d=l(n,"thickness",64),f=l(n,"left",!0),p=l(n,"right",!0),g=l(n,"top",!0),v=l(n,"bottom",!0);this.setBounds(s,r,h,u,d,f,p,g,v)}}this.drawDebug&&this.createDebugGraphic()},setCollisionMap:function(t,e){if("string"==typeof t){var i=this.scene.cache.tilemap.get(t);if(!i||i.format!==f.WELTMEISTER)return console.warn("The specified key does not correspond to a Weltmeister tilemap: "+t),null;for(var n,s=i.data.layer,r=0;rr.ACTIVE&&d(this,t,e))},setCollidesNever:function(t){for(var e=0;e=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function r(t,e,i){return s(t,e,i)>0}function o(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function h(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){var i=[],n=[],s=[],r=[];var o=Number.MAX_VALUE;for(var a=0;a0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;su)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;L_&&(_+=e.length),A=Number.MAX_VALUE,_3&&n>=0;--n)c(f(t,n-1),f(t,n),f(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var n=t[i],s=i-1;s>=0;--s)S(n,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,n=1;ni[e][0])&&(e=n);return!r(f(t,e-1),f(t,e),f(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var l=[],u=[];function c(t,e,i,n){if(n){var r=l,o=u;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*c))g&&(g=y),a.translate(m,{x:.5*x,y:.5*y}),c=m.bounds.max.x+r,s.addBody(u,m),l=m,f+=1}else c+=r}d+=g+o,c=t}return u},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),n&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,n,o,l,u,c)})},n.newtonsCradle=function(t,e,i,n,o){for(var a=s.create({label:"Newtons Cradle"}),l=0;lu.bounds.max.x||p.bounds.max.yu.bounds.max.y)){var g=n._getRegion(t,p);if(!p.region||g.id!==p.region.id||s){f.broadphaseTests+=1,p.region&&!s||(p.region=g);var v=n._regionUnion(g,p.region);for(o=v.startCol;o<=v.endCol;o++)for(a=v.startRow;a<=v.endRow;a++){h=c[l=n._getBucketId(o,a)];var m=o>=g.startCol&&o<=g.endCol&&a>=g.startRow&&a<=g.endRow,y=o>=p.region.startCol&&o<=p.region.endCol&&a>=p.region.startRow&&a<=p.region.endRow;!m&&y&&y&&h&&n._bucketRemoveBody(t,h,p),(p.region===g||m&&!y||s)&&(h||(h=n._createBucket(c,l)),n._bucketAddBody(t,h,p))}p.region=g,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),s=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,s,r,o)},n._getRegion=function(t,e){var i=e.bounds,s=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(s,r,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n0?n.push(i):delete t.pairs[e[s]];return n}},function(t,e,i){var n={};t.exports=n;var s=i(144),r=i(16);n._pairMaxIdleLife=1e3,n.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;an._pairMaxIdleLife&&l.push(o);for(o=0;of.friction*f.frictionStatic*F*i&&(I=R,k=o.clamp(f.friction*L*i,-I,I));var B=r.cross(A,m),Y=r.cross(_,m),N=T/(g.inverseMass+v.inverseMass+g.inverseInertia*B*B+v.inverseInertia*Y*Y);if(D*=N,k*=N,P<0&&P*P>n._restingThresh*i)b.normalImpulse=0;else{var X=b.normalImpulse;b.normalImpulse=Math.min(b.normalImpulse+D,0),D=b.normalImpulse-X}if(O*O>n._restingThreshTangent*i)b.tangentImpulse=0;else{var z=b.tangentImpulse;b.tangentImpulse=o.clamp(b.tangentImpulse+k,-I,I),k=b.tangentImpulse-z}s.x=m.x*D+y.x*k,s.y=m.y*D+y.y*k,g.isStatic||g.isSleeping||(g.positionPrev.x+=s.x*g.inverseMass,g.positionPrev.y+=s.y*g.inverseMass,g.anglePrev+=r.cross(A,s)*g.inverseInertia),v.isStatic||v.isSleeping||(v.positionPrev.x-=s.x*v.inverseMass,v.positionPrev.y-=s.y*v.inverseMass,v.anglePrev-=r.cross(_,s)*v.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var s=i(231),r=i(110),o=i(486),a=i(485),h=i(1326),l=i(484),u=i(92),c=i(76),d=i(93),f=i(16),p=i(24);n.create=function(t,e){e=f.isElement(t)?e:t,t=f.isElement(t)?t:null,e=e||{},(t||e.render)&&f.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:l}},n=f.extend(i,e);if(t||n.render){var r={element:t,controller:Render};n.render=f.extend(r,n.render)}return n.render&&n.render.controller&&(n.render=n.render.controller.create(n.render)),n.render&&(n.render.engine=n),n.world=e.world||s.create(n.world),n.pairs=a.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n.metrics=h.create(n.metrics),n},n.update=function(t,e,i){e=e||1e3/60,i=i||1;var s,l=t.world,f=t.timing,p=t.broadphase,g=[];f.timestamp+=e*f.timeScale;var v={timestamp:f.timestamp};u.trigger(t,"beforeUpdate",v);var m=c.allBodies(l),y=c.allConstraints(l);for(h.reset(t.metrics),t.enableSleeping&&r.update(m,f.timeScale),n._bodiesApplyGravity(m,l.gravity),n._bodiesUpdate(m,e,f.timeScale,i,l.bounds),d.preSolveAll(m),s=0;s0&&u.trigger(t,"collisionStart",{pairs:T.collisionStart}),o.preSolvePosition(T.list),s=0;s0&&u.trigger(t,"collisionActive",{pairs:T.collisionActive}),T.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:T.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(m),u.trigger(t,"afterUpdate",v),t},n.merge=function(t,e){if(f.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=c.allBodies(t.world),s=0;s0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_START,e,i,n)}),p.on(e,"collisionActive",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_ACTIVE,e,i,n)}),p.on(e,"collisionEnd",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_END,e,i,n)})},setBounds:function(t,e,i,n,s,r,o,a,h){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),void 0===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e-s,s,n+2*s),this.updateWall(o,"right",t+i,e-s,s,n+2*s),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?(o&&v.remove(this.localWorld,o),i+=s/2,n+=r/2,this.walls[e]=this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&v.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,s,r){var o=n.rectangle(t,e,i,s,r);return v.add(this.localWorld,o),o},add:function(t){return v.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return a.remove(this.localWorld,i,e),this},removeConstraint:function(t,e){return a.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i1?1:0;r1?1:0;s-1}return!1}},function(t,e,i){var n=i(78),s=i(111),r=i(232);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!1),void 0===o&&(o=!0),!s(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new n(a,-1,t,e,h.width,h.height),o&&h&&h.collides&&r(t,e,a),h):null}},function(t,e,i){var n=i(34),s=i(235),r=i(494),o=i(495),a=i(506);t.exports=function(t,e,i,h,l,u){var c;switch(e){case n.ARRAY_2D:c=s(t,i,h,l,u);break;case n.CSV:c=r(t,i,h,l,u);break;case n.TILED_JSON:c=o(t,i,u);break;case n.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},function(t,e,i){var n=i(34),s=i(235);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map(function(t){return t.split(",")}),h=s(t,a,i,r,o);return h.format=n.CSV,h}},function(t,e,i){var n=i(34),s=i(113),r=i(496),o=i(498),a=i(499),h=i(502),l=i(504),u=i(505);t.exports=function(t,e,i){if("orthogonal"!==e.orientation)return console.warn("Only orthogonal map types are supported in this version of Phaser"),null;var c=new s({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:e.orientation,format:n.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});c.layers=r(e,i),c.images=o(e);var d=a(e);return c.tilesets=d.tilesets,c.imageCollections=d.imageCollections,c.objects=h(e),c.tiles=l(c),u(c),c}},function(t,e,i){var n=i(497),s=i(1),r=i(112),o=i(236),a=i(78);t.exports=function(t,e){for(var i=s(t,"infinite",!1),h=[],l=0;l0?((f=new a(c,d.gid,C,M,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,g[M][C]=f):(p=e?null:new a(c,-1,C,M,t.tilewidth,t.tileheight),g[M][C]=p),++v===w.width&&(A++,v=0)}}else{c=new r({name:u.name,x:s(u,"offsetx",0)+u.x,y:s(u,"offsety",0)+u.y,width:u.width,height:u.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:u.opacity,visible:u.visible,properties:s(u,"properties",{})});for(var P=[],O=0,R=u.data.length;O0?((f=new a(c,d.gid,v,g.length,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,P.push(f)):(p=e?null:new a(c,-1,v,g.length,t.tilewidth,t.tileheight),P.push(p)),++v===u.width&&(g.push(P),v=0,P=[])}c.data=g,h.push(c)}}return h}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),s=0;s>>0;return n}},function(t,e,i){var n=i(1);t.exports=function(t){for(var e=[],i=0;i1){if(Array.isArray(l.tiles)){for(var c={},d={},f=0;f=this.firstgid&&ta&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(112),s=i(78);t.exports=function(t,e){for(var i=[],r=0;r-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(149);t.exports=function(t){for(var e=[],i=[],s=0;s-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(s,r),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(u=new p(t,o,i,n,s,r)).setImage(h),this.tilesets.push(u),u)},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new c(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:null!==a?(f.Copy(t,e,i,n,s,r,o,a),this):null},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===a&&(a=this.tileWidth),void 0===l&&(l=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var u,c=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;f-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return n},removeTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"removeTileAt")?null:null===s?null:f.RemoveTileAt(t,e,i,n,s)},removeTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"removeTileAtWorldXY")?null:null===r?null:f.RemoveTileAtWorldXY(t,e,i,n,s,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(f.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(t){void 0===t&&(t=!0),this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(12),r=i(28),o=i(13),a=i(1380),h=i(145),l=i(35),u=i(10),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===r.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;sv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;o>=0;o--)for(a=0;av||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;o>=0;o--)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===m?(m=i.createVertexBuffer(y,n.STATIC_DRAW),this.vertexBuffer[e]=m):(i.setVertexBuffer(m),n.bufferSubData(n.ARRAY_BUFFER,0,y))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=i.tileWidth,l=i.tileHeight,c=h/2,d=l/2,f=a.x/n,p=a.y/s,g=(a.x+h)/n,v=(a.y+l)/s,m=this._tempMatrix,y=-c,x=-d;e.flipX&&(h*=-1,y+=i.tileWidth),e.flipY&&(l*=-1,x+=i.tileHeight);var T=y+h,w=x+l;m.applyITRS(c+e.pixelX,d+e.pixelY,e.rotation,1,1);var b=u.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),S=m.getX(y,x),A=m.getY(y,x),_=m.getX(y,w),E=m.getY(y,w),C=m.getX(T,w),M=m.getY(T,w),P=m.getX(T,x),O=m.getY(T,x);r.roundPixels&&(S=Math.round(S),A=Math.round(A),_=Math.round(_),E=Math.round(E),C=Math.round(C),M=Math.round(M),P=Math.round(P),O=Math.round(O));var R=this.vertexViewF32[o],L=this.vertexViewU32[o];return R[++t]=S,R[++t]=A,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=b,R[++t]=_,R[++t]=E,R[++t]=f,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=S,R[++t]=A,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=b,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=P,R[++t]=O,R[++t]=g,R[++t]=p,R[++t]=0,L[++t]=b,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4){this._renderOrder=t;for(var e=0;e0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(1389);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){var n=i(5);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(241),s=i(14),r=i(96),o=i(106),a=i(150),h=i(5),l=i(240),u=i(242),c=i(243);t.exports=function(t,e,i){void 0===i&&(i=n);var d=h(e,"from",0),f=h(e,"to",1),p=[{value:d}],g=a(e,"delay",i.delay),v=a(e,"duration",i.duration),m=h(e,"easeParams",i.easeParams),y=o(h(e,"ease",i.ease),m),x=a(e,"hold",i.hold),T=a(e,"repeat",i.repeat),w=a(e,"repeatDelay",i.repeatDelay),b=r(e,"yoyo",i.yoyo),S=[],A=l("value",f),_=c(p[0],"value",A.getEnd,A.getStart,y,g,v,b,x,T,w,!1,!1);_.start=d,_.current=d,_.to=f,S.push(_);var E=new u(t,S,p);E.offset=s(e,"offset",null),E.completeDelay=s(e,"completeDelay",0),E.loop=Math.round(s(e,"loop",0)),E.loopDelay=Math.round(s(e,"loopDelay",0)),E.paused=r(e,"paused",!1),E.useFrames=r(e,"useFrames",!1);for(var C=h(e,"callbackScope",E),M=[E,null],P=u.TYPES,O=0;O0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var m=0;m0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit(r.TIMELINE_LOOP,this,this.loopCounter),this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):this.state=a.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=a.COMPLETE_DELAY;else{this.state=a.PENDING_REMOVE;var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit(r.TIMELINE_COMPLETE,this)}},update:function(t,e){if(this.state!==a.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var i=this.totalData,n=0;n>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){t.exports="changedata"},function(t,e){t.exports="changedata-"},function(t,e){t.exports="removedata"},function(t,e){t.exports="setdata"},function(t,e){t.exports="destroy"},function(t,e,i){var n=i(39);t.exports=function(t,e,i,s,r){return n(t,"alpha",e,i,s,r)}},function(t,e,i){var n=i(39);t.exports=function(t,e,i,s,r){return n(t,"x",e,i,s,r)}},function(t,e,i){var n=i(39);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"x",e,s,o,a),n(t,"y",i,r,o,a)}},function(t,e,i){var n=i(39);t.exports=function(t,e,i,s,r){return n(t,"y",e,i,s,r)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=0;o0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={Camera:i(284),CameraManager:i(684),Effects:i(292),Events:i(53)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(22),s=i(0),r=i(53),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed=1?1:1/e*(1+(e*t|0))}},function(t,e,i){var n=i(22),s=i(0),r=i(53),o=i(3),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=s,this.camera.emit(r.SHAKE_START,this.camera,this,t,e),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed0&&(o.preRender(1),t.render(n,e,i,o))}},resetAll:function(){for(var t=0;t1)for(var i=1;i=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){var n=i(124),s={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(s.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(s.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(s.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(s.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(s.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(s.webm=!0),""!==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 i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e){var i={h264Video:!1,hlsVideo:!1,mp4Video:!1,oggVideo:!1,vp9Video:!1,webmVideo:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.oggVideo=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264Video=!0,i.mp4Video=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webmVideo=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9Video=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hlsVideo=!0))}catch(t){}return i}()},function(t,e){var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){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=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e1?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[i1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(166);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){t.exports={GetNext:i(318),IsSize:i(125),IsValue:i(736)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){t.exports={Ceil:i(319),Floor:i(100),To:i(738)}},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){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;i1?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,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=[],o=0;o0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e,i){var n=i(36),s=i(352);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=s(l,h,t+1/3),o=s(l,h,t),a=s(l,h,t-1/3)}return(new n).setGLTo(r,o,a,1)}},function(t,e,i){var n=i(172);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(n(s/359,t,e));return i}},function(t,e,i){var n=i(122),s=function(t,e,i,s,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:n(t,s,l),g:n(e,r,l),b:n(i,o,l)}};t.exports={RGBWithRGB:s,ColorWithRGB:function(t,e,i,n,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),s(t.r,t.g,t.b,e,i,n,r,o)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),s(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(179),s=i(36);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var n=i(351);t.exports=function(t,e,i,s,r){return void 0===s&&(s=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+n(s)+n(t)+n(e)+n(i)}},function(t,e,i){t.exports={BitmapMask:i(269),GeometryMask:i(270)}},function(t,e,i){var n={AddToDOM:i(127),DOMContentLoaded:i(353),GetScreenOrientation:i(354),GetTarget:i(359),ParseXML:i(360),RemoveFromDOM:i(187),RequestAnimationFrame:i(340)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(809)}},function(t,e,i){var n=i(0),s=i(9),r=i(17),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){var n=i(127),s=i(280),r=i(283),o=i(26),a=i(0),h=i(305),l=i(811),u=i(328),c=i(98),d=i(338),f=i(306),p=i(353),g=i(9),v=i(30),m=i(361),y=i(17),x=i(366),T=i(367),w=i(369),b=i(126),S=i(373),A=i(339),_=i(341),E=i(376),C=i(384),M=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new S(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=E.create(this),this.loop=new A(this,this.config.fps),this.plugins=new x(this,this.config),this.facebook=new C(this),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),_(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(v.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(v.POST_RENDER,n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),i.emit(v.PRE_RENDER),i.emit(v.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=M},function(t,e,i){var n=i(127);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,n(i,e.parent)}}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},n=document.createElement("div");return n.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(n),i.w=90===e?n.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:n.offsetHeight,document.documentElement.removeChild(n),n=null,90!==Math.abs(window.orientation)?i.h:i.w}},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){var n=i(1),s=i(371);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=n(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(s(e+"Physics")),i)for(var o in i)o=s(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},function(t,e,i){var n=i(1);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){var n={game:"game",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"};n.facebook="facebook",t.exports=n},function(t,e,i){var n=i(0),s=i(22),r=i(36),o=i(125),a=i(190),h=new n({Extends:a,initialize:function(t,e,i,n,s){a.call(this,t,e,i,n,s),this.add("__BASE",0,0,0,n,s),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=n,this.height=s,this.imageData=this.context.getImageData(0,0,n,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0);var s=this.manager.getFrame(t,e);if(s){var r=s.canvasData,o=s.cutWidth,a=s.cutHeight,h=s.source.resolution;return this.context.drawImage(s.source.image,r.x,r.y,o,a,i,n,o/h,a/h),this.update()}return this},setPixel:function(t,e,i,n,s,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=n,o.data[2]=s,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,n,s,r,o){return void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,n,s,r,o),this},getData:function(t,e,i,n){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),n=s(n,1,this.height-e),this.context.getImageData(t,e,i,n)},getPixel:function(t,e,i){i||(i=new r);var n=this.getIndex(t,e);if(n>-1){var s=this.data,o=s[n+0],a=s[n+1],h=s[n+2],l=s[n+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,n){void 0===n&&(n=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=s(t,0,this.width),a=s(t+i,0,this.width),h=s(e,0,this.height),l=s(e+n,0,this.height),u=new r,c=[],d=h;dg||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,m=f,y=0,x=0,T=0;Tr&&(y=w-r),b>o&&(x=b-o),t.add(T,e,i+v,s+m,h-y,l-x),(v+=h+p)+h>r&&(v=f,m+=l+p)}return t}},function(t,e,i){var n=i(1);t.exports=function(t,e,i){var s=n(i,"frameWidth",null),r=n(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=n(i,"startFrame",0),l=n(i,"endFrame",-1),u=n(i,"margin",0),c=n(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,v=e.realWidth,m=e.realHeight,y=Math.floor((v-u+c)/(s+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,b=s-w,S=s-(v-p-w),A=e.y,_=r-A,E=r-(m-g-A);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,M=u,P=0,O=e.sourceIndex,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 o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0){var o=n-t.length;if(o<=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 a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-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&&i0){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&&it.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){var n=i(72);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 o=i-e,a=t.splice(e,o);if(s)for(var h=0;h0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){var n=i(72);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 o=s;o-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;iv&&(r=v),o>m&&(o=m);var O=v+g.xAdvance,R=m+u;a_&&(_=C),C_&&(_=C),C0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,m=p.cutY,y=g.width,x=g.height,T=e._isTinted&&e.tintFill,w=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),b=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),S=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),A=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var _,E,C=0,M=0,P=0,O=0,R=e.letterSpacing,L=0,D=0,F=0,k=0,I=e.scrollX,B=e.scrollY,Y=e.fontData,N=Y.chars,X=Y.lineHeight,z=e.fontSize/Y.size,U=0,G=e._align,W=0,V=0;e.getTextBounds(!1);var H=e._bounds.lines;1===G?V=(H.longest-H.lengths[0])/2:2===G&&(V=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;J0&&e.cropHeight>0&&(h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var F=0;F0&&(N=N%b-b):N>b?N=b:N<0&&(N=b+N%b),null===E&&(E=new o(k+Math.cos(Y)*B,I+Math.sin(Y)*B,v),S.push(E),F+=.01);F<1+z;)w=N*F+Y,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,E.points.push(new r(x,T,v)),F+=.01;w=N+Y,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,E.points.push(new r(x,T,v));break;case n.FILL_RECT:u.setTexture2D(M),u.batchFillRect(p[++P],p[++P],p[++P],p[++P],f,c);break;case n.FILL_TRIANGLE:u.setTexture2D(M),u.batchFillTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],f,c);break;case n.STROKE_TRIANGLE:u.setTexture2D(M),u.batchStrokeTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],v,f,c);break;case n.LINE_TO:null!==E?E.points.push(new r(p[++P],p[++P],v)):(E=new o(p[++P],p[++P],v),S.push(E));break;case n.MOVE_TO:E=new o(p[++P],p[++P],v),S.push(E);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:k=p[++P],I=p[++P],f.translate(k,I);break;case n.SCALE:k=p[++P],I=p[++P],f.scale(k,I);break;case n.ROTATE:f.rotate(p[++P]);break;case n.SET_TEXTURE:var U=p[++P],G=p[++P];u.currentFrame=U,u.setTexture2D(U.glTexture,0),u.tintEffect=G,M=U.glTexture;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,u.tintEffect=2,M=t.blankTexture.glTexture}}}},function(t,e,i){var n=i(2),s=i(2);n=i(962),s=i(963),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(2),s=i(2);n=i(965),s=i(966),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){t.exports={GravityWell:i(397),Particle:i(398),ParticleEmitter:i(399),ParticleEmitterManager:i(201),Zones:i(972)}},function(t,e,i){var n=i(0),s=i(320),r=i(106),o=i(1),a=i(61),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&(this.has(t,"random")||this.hasBoth(t,"start","end")||this.hasBoth(t,"min","max"))){this.start=this.has(t,"start")?t.start:t.min,this.end=this.has(t,"end")?t.end:t.max;var i=this.hasBoth(t,"min","max")||!!t.random;if(i){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}if(this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){var n=i(2),s=i(2);n=i(970),s=i(971),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.emitters.list,a=o.length;if(0!==a){var h=this.pipeline,l=h._tempMatrix1.copyFrom(s.matrix),u=h._tempMatrix2,c=h._tempMatrix3,d=h._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);l.multiply(d),t.setPipeline(h);var f=s.roundPixels,p=e.defaultFrame.glTexture,g=n.getTintAppendFloatAlphaAndSwap;h.setTexture2D(p,0);for(var v=0;v?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(5);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,m={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},y=0,x=0;x0&&r.maxLines1&&(d+=f*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(2),s=i(2);n=i(981),s=i(982),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){if(0!==e.width&&0!==e.height){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a/e.style.resolution,h/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r)}}},function(t,e){t.exports=function(t,e,i,n,s){0!==e.width&&0!==e.height&&t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(0),s=i(14),r=i(5),o=i(984),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this._font,this.setStyle(e,!1,!0);var i=r(e,"metrics",!1);this.metrics=i?{ascent:r(i,"ascent",0),descent:r(i,"descent",0),fontSize:r(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?r(t,a[n][0],o):s(t,a[n][0],o)}var h=r(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=r(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,n="",s="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),n=r(t,"fontSize","16px"),s=r(t,"fontStyle","");else{var o=t.split(" "),a=0;s=o.length>2?o[a++]:"",n=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&n===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=n,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e,i){var n=i(26);t.exports=function(t){var e=n.create(this),i=e.getContext("2d");t.syncFont(e,i);var s=Math.ceil(i.measureText(t.testString).width*t.baselineX),r=s,o=2*r;r=r*t.baselineY|0,e.width=s,e.height=o,i.fillStyle="#f00",i.fillRect(0,0,s,o),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,r);var a={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,s,o))return a.ascent=r,a.descent=r+6,a.fontSize=a.ascent+a.descent,n.remove(e),a;var h,l,u=i.getImageData(0,0,s,o).data,c=u.length,d=4*s,f=0,p=!1;for(h=0;hr;h--){for(l=0;l0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0){var R=o.strokeTint,L=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(R.TL=L,R.TR=L,R.BL=L,R.BR=L,E=1;E0)for(n(h,e),E=0;E0)for(n(h,e,e.altFillColor,e.altFillAlpha*c),E=0;E0){for(s(h,e,e.outlineFillColor,e.outlineFillAlpha*c),_=1;_o.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var m=o.vertexViewF32,y=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,T=0,w=e.tintFill,b=0;b0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(83);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e,i){var n=i(51);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(51);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e,i){var n=i(11);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(102);n.Area=i(1085),n.Circumference=i(395),n.CircumferencePoint=i(200),n.Clone=i(1086),n.Contains=i(103),n.ContainsPoint=i(1087),n.ContainsRect=i(1088),n.CopyFrom=i(1089),n.Equals=i(1090),n.GetBounds=i(1091),n.GetPoint=i(393),n.GetPoints=i(394),n.Offset=i(1092),n.OffsetPoint=i(1093),n.Random=i(163),t.exports=n},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(102);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(103);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(103);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e,i){var n=i(11);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(4),s=i(428);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0==(a=(o=-2*f)*o-4*(r=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new n(h,-o/(2*r))):a>0&&(i.push(new n(h,(-o+Math.sqrt(a))/(2*r))),i.push(new n(h,(-o-Math.sqrt(a))/(2*r))));else{var g=(l-d)/(u-f),v=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0==(a=(o=2*u*g-2*v*g-2*l)*o-4*(r=g*g+1)*(l*l+u*u+v*v-c*c-2*u*v))?(h=-o/(2*r),i.push(new n(h,v-h*g))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)),h=(-o-Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)))}}return i}},function(t,e,i){var n=i(209),s=i(429);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();n(r,t,i),n(o,t,i),n(a,t,i),n(h,t,i)}return i}},function(t,e,i){var n=i(11),s=i(138);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e,i){var n=i(211),s=i(138);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();n(r,e,i),n(o,e,i),n(a,e,i),n(h,e,i)}return i}},function(t,e,i){var n=i(431),s=i(211);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(r,t,i),s(o,t,i),s(a,t,i)}return i}},function(t,e,i){var n=i(209),s=i(433);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();n(r,e,i),n(o,e,i),n(a,e,i)}return i}},function(t,e,i){var n=i(436),s=i(434);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(t,r,i),s(t,o,i),s(t,a,i)}return i}},function(t,e,i){var n=i(438);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||si&&(i=h.x),h.xr&&(r=h.y),h.yn(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var n=i(173);t.exports=function(t,e,i){var s=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),n(t,s,r)}},function(t,e,i){var n=i(11),s=i(138);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){var n=i(4),s=i(40);t.exports=function(t,e,i){void 0===i&&(i=new n),e=s(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)-1&&(s.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),0===this._list.length||this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i=this.pollRate;if(-1===i)return!1;if(i>0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}for(var n=this.manager,s=n.pointers,r=n.pointersTotal,o=!1,a=0;a0&&(o=!0)}return o},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,n=!1,s=0;s0&&(n=!0)}return this._updatedThisFrame=!0,n},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,this.manager.resetCursor(i),t.input=null;var n=this._draggable.indexOf(t);return n>-1&&this._draggable.splice(n,1),(n=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(n,1),(n=this._over[0].indexOf(t))>-1&&this._over[0].splice(n,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=s?i=!0:n>0&&e>=t.downTime+n&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold||0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],n=0;n0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.x-a.dragStartXGlobal,c=t.y-a.dragStartYGlobal,f=o.getParentRotation(),p=u*Math.cos(f)+c*Math.sin(f),g=c*Math.cos(f)-u*Math.sin(f);s=p+a.dragStartX,r=g+a.dragStartY}else s=t.x-a.dragX,r=t.y-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,s,r),this.emit(d.DRAG,t,o,s,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var s=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e);for(var h=0;h0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,o=!1,h=!1;if(v(e)){var l=e;e=p(l,"hitArea",null),i=p(l,"hitAreaCallback",null),n=p(l,"draggable",!1),s=p(l,"dropZone",!1),r=p(l,"cursor",!1),o=p(l,"useHandCursor",!1),h=p(l,"pixelPerfect",!1);var u=p(l,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(u)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c=e}}},function(t,e,i){t.exports={Events:i(140),KeyboardManager:i(362),KeyboardPlugin:i(1206),Key:i(451),KeyCodes:i(129),KeyCombo:i(452),JustDown:i(1211),JustUp:i(1212),DownDuration:i(1213),UpDuration:i(1214)}},function(t,e){t.exports="keydown"},function(t,e){t.exports="keyup"},function(t,e){t.exports="keycombomatch"},function(t,e){t.exports="down"},function(t,e){t.exports="keydown-"},function(t,e){t.exports="keyup-"},function(t,e){t.exports="up"},function(t,e,i){var n=i(0),s=i(9),r=i(140),o=i(30),a=i(5),h=i(54),l=i(139),u=i(451),c=i(129),d=i(452),f=i(1210),p=i(100),g=new n({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.useQueue?this.sceneInputPlugin.pluginEvents.on(h.UPDATE,this.update,this):this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n={};if("string"==typeof t){t=t.split(",");for(var s=0;s-1?n[s]=t:n[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),n[t]||(n[t]=new u(this,t),e&&this.addCapture(t),n[t].setEmitOnRepeat(i)),n[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,n=this.keys;if(t instanceof u){var s=n.indexOf(t);s>-1&&(i=this.keys[s],this.keys[s]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(i=n[t],n[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},createCombo:function(t,e){return new d(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=p(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e,i){var n=i(129),s={};for(var r in n)s[n[r]]=r;t.exports=s},function(t,e){t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},function(t,e){t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.sizei&&(n=t,i=e)}),n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,n,s,r){return u(this.world,t,e,i,n,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(d.UPDATE,this.world.update,this.world),t.off(d.POST_UPDATE,this.world.postUpdate,this.world),t.off(d.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(d.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){var i={enableBody:function(t,e,i,n,s){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),s&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=i},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){var i={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=i},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){t.exports=function(t,e,i,n,s,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+n,l.maxY=i+s,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+n,bottom:i+s,isCircle:!1},d=t.intersects;u.iterate(function(t){d(t,c)&&a.push(t)})}return h.concat(a)}},function(t,e){t.exports="collide"},function(t,e){t.exports="overlap"},function(t,e){t.exports="pause"},function(t,e){t.exports="resume"},function(t,e){t.exports="tilecollide"},function(t,e){t.exports="tileoverlap"},function(t,e){t.exports="worldbounds"},function(t,e){t.exports="worldstep"},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e,i){var n=i(1268),s=i(1270),r=i(469);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,f=o.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var v=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&!t.blocked.right&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(1271);t.exports=function(t,e,i,s,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&!t.blocked.up&&c&&t.checkCollision.up?l&&t.y0&&!t.blocked.down&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(465);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e,i){var n=i(466);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){t.exports={Body:i(471),Events:i(222),COLLIDES:i(108),CollisionMap:i(472),Factory:i(473),Image:i(475),ImpactBody:i(474),ImpactPhysics:i(1293),Sprite:i(476),TYPE:i(109),World:i(477)}},function(t,e,i){var n=i(22);t.exports=function(t,e,i,s,r){if(i)return n(e+i*t,-r,r);if(s){var o=s*t;return e-o>0?e-o:e+o<0?e+o:0}return n(e,-r,r)}},function(t,e){t.exports=function(t,e){if(t.standing=!1,e.collision.y&&(t.bounciness>0&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(t.vel.y>0&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(t.bounciness>0&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(t.bounciness>0){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&oi.last.x&&e.last.xi.last.y&&e.last.y0))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,e.bounciness>0&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e,i){t.exports={Factory:i(478),Image:i(481),Matter:i(229),MatterPhysics:i(1328),PolyDecomp:i(479),Sprite:i(482),TileBody:i(226),World:i(488)}},function(t,e,i){var n=i(143),s=i(1),r=i(3);t.exports=function(t,e,i){void 0===i&&(i={});var o=e.x,a=e.y;if(e.body={temp:!0,position:{x:o,y:a}},[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity].forEach(function(t){for(var i in t)(n=t[i]).get&&"function"==typeof n.get||n.set&&"function"==typeof n.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var n}),e.world=t,e._tempVec2=new r(o,a),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,!0);else{var h=s(i,"shape",null);h||(h="rectangle"),e.setBody(h,i)}return e}},function(t,e){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},function(t,e){var i={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i1?1:0;n1;if(!d||t!=d.x||e!=d.y){d&&n?(f=d.x,p=d.y):(f=0,p=0);var s={x:f+t,y:p+e};!n&&d||(d=s),g.push(s),m=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":m=t.x,y=t.y;break;case"H":m=t.x;break;case"V":y=t.y}x(m,y,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i0)for(var a=s+1;ae.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},function(t,e,i){t.exports={List:i(133),Map:i(168),ProcessQueue:i(467),RTree:i(468),Set:i(105),Size:i(368)}},function(t,e,i){var n=i(20),s=i(1343),r={Events:i(126),FilterMode:s,Frame:i(101),Parsers:i(375),Texture:i(190),TextureManager:i(373),TextureSource:i(374)};r=n(!1,r,s),t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){t.exports={Components:i(145),Parsers:i(1374),Formats:i(34),ImageCollection:i(500),ParseToTilemap:i(238),Tile:i(78),Tilemap:i(509),TilemapCreator:i(1383),TilemapFactory:i(1384),Tileset:i(149),LayerData:i(112),MapData:i(113),ObjectLayer:i(503),DynamicTilemapLayer:i(510),StaticTilemapLayer:i(511)}},function(t,e,i){var n=i(25),s=i(58);t.exports=function(t,e,i,r,o,a,h,l){t<0&&(t=0),e<0&&(e=0),void 0===h&&(h=!0);for(var u=n(t,e,i,r,null,l),c=o-t,d=a-e,f=0;f=0&&p=0&&g=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=y;a--)for(o=v;c[a]&&o=y;a--)for(o=m;c[a]&&o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(25),s=i(58),r=i(77);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=n(e,i,o,a,null,l),d=0;d=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;re)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(77),s=i(58),r=i(234);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,r=t.length;s0&&(t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix);var u=t.currentContext,c=e.gidMap;u.save(),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l),l.copyToContext(u)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,h.copyToContext(u));var d=n.alpha*e.alpha;u.globalAlpha=n.alpha*e.alpha;for(var f=0;f-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t-1&&(e.state=l.REMOVED,s.splice(r,1)):(e.state=l.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t>2],r+=i[(3&n[o])<<4|n[o+1]>>4],r+=i[(15&n[o+1])<<2|n[o+2]>>6],r+=i[63&n[o+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},function(t,e,i){t.exports={Clone:i(70),Extend:i(20),GetAdvancedValue:i(14),GetFastValue:i(1),GetMinMaxValue:i(1401),GetValue:i(5),HasAll:i(1402),HasAny:i(402),HasValue:i(88),IsPlainObject:i(7),Merge:i(69),MergeRight:i(1403),Pick:i(501),SetValue:i(423)}},function(t,e,i){var n=i(5),s=i(22);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=n(t,e,o);return s(a,i,r)}},function(t,e){t.exports=function(t,e){for(var i=0;i0&&(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},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}});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},function(t,e,i){var n=i(0),s=i(52),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){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n=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,i){t.exports={Alpha:i(262),Animation:i(263),BlendMode:i(266),ComputedSize:i(555),Crop:i(556),Depth:i(267),Flip:i(557),GetBounds:i(558),Mask:i(271),Origin:i(575),PathFollower:i(576),Pipeline:i(118),ScrollFactor:i(274),Size:i(577),Texture:i(578),TextureCrop:i(579),Tint:i(580),ToJSON:i(275),Transform:i(276),TransformMatrix:i(35),Visible:i(277)}},function(t,e,i){var n=i(0),s=i(275),r=i(100),o=i(9),a=i(119),h=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,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,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},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.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return s(this)},willRender:function(t){return!(h.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 i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.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),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});h.RENDER_MASK=15,t.exports=h},function(t,e,i){var n=i(177),s=i(5);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){var n=i(7),s=function(){var t,e,i,r,o,a,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);l0;e--){var n=Math.floor(i.random()*(e+1)),s=t[e];t[e]=t[n],t[n]=s}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===toString.call(t)},i.clamp=function(t,e,i){return ti?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return e=void 0!==e?e:0,i=void 0!==i?i:1,e+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i=400&&t.status<=599&&(n=!1),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(){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.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){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)},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){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){var n={};t.exports=n;var s=i(31),r=i(37),o=i(111),a=i(17),h=i(38),l=i(226);!function(){n._inertiaScale=4,n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,n.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",gameObject:null,parts:[],plugin:{},angle:0,vertices:s.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,ignoreGravity:!1,ignorePointer:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0},lineWidth:0},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,_original:null},n=a.extend(i,e);return t(n,e),n},n.nextGroup=function(t){return t?n._nextNonCollidingGroupId--:n._nextCollidingGroupId++},n.nextCategory=function(){return n._nextCategory=n._nextCategory<<1,n._nextCategory};var t=function(t,e){e=e||{},n.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),s.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(t.bounds,t.vertices,t.velocity),n.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia});var i=t.isStatic?"#2e2b44":a.choose(["#006BA6","#0496FF","#FFBC42","#D81159","#8F2D56"]);t.render.fillStyle=t.render.fillStyle||i,t.render.strokeStyle=t.render.strokeStyle||"#000",t.render.sprite.xOffset+=-(t.bounds.min.x-t.position.x)/(t.bounds.max.x-t.bounds.min.x),t.render.sprite.yOffset+=-(t.bounds.min.y-t.position.y)/(t.bounds.max.y-t.bounds.min.y)};n.set=function(t,e,i){var s;for(s in"string"==typeof e&&(s=e,(e={})[s]=i),e)if(e.hasOwnProperty(s))switch(i=e[s],s){case"isStatic":n.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":n.setMass(t,i);break;case"density":n.setDensity(t,i);break;case"inertia":n.setInertia(t,i);break;case"vertices":n.setVertices(t,i);break;case"position":n.setPosition(t,i);break;case"angle":n.setAngle(t,i);break;case"velocity":n.setVelocity(t,i);break;case"angularVelocity":n.setAngularVelocity(t,i);break;case"parts":n.setParts(t,i);break;default:t[s]=i}},n.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(o.position,i,t.position,o.position)}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,r.add(t.position,e))},n.rotate=function(t,e,i){if(i){var s=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*s-a*r),y:i.y+(o*r+a*s)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*n+t.force.x/t.mass*o,t.velocity.y=c*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(f.vertices,t.angularVelocity,t.position),l.rotate(f.axes,t.angularVelocity),d>0&&r.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),h.update(f.bounds,f.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;io.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n=i(42),s=i(14),r=i(96);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 o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"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 h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),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){var n={};t.exports=n;var s=i(37),r=i(17);n.create=function(t,e){for(var i=[],n=0;n0)return!1}return!0},n.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||n.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},n.hull=function(t){var e,i,n=[],r=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),r.pop(),n.concat(r)}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(60),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e,i){var n={VERSION:"3.19.0",BlendModes:i(42),ScaleModes:i(96),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,i){var n=i(0),s=i(21),r=i(3),o=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}},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],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[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],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,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 o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(t.translateX=e[4],t.translateY=e[5],i||n){var a=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}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=o/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,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var n=this.matrix,s=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(s*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=s*c*e+-o*c*t+(-u*s+l*o)*c,i},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},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.decomposedMatrix=null}});t.exports=o},function(t,e,i){var n=i(0),s=i(172),r=i(289),o=i(173),a=i(290),h=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=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e){var i={};t.exports=i,i.create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),s=Math.sin(e);i||(i={});var r=t.x*n-t.y*s;return i.y=t.x*s+t.y*n,i.x=r,i},i.rotateAbout=function(t,e,i,n){var s=Math.cos(e),r=Math.sin(e);n||(n={});var o=i.x+((t.x-i.x)*s-(t.y-i.y)*r);return n.y=i.y+((t.x-i.x)*r+(t.y-i.y)*s),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e){var i={};t.exports=i,i.create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&i.update(e,t),e},i.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var n=0;nt.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=i(21);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.fillColor,r=n||e.fillAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},function(t,e){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){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},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){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){t.exports={DESTROY:i(637),FADE_IN_COMPLETE:i(638),FADE_IN_START:i(639),FADE_OUT_COMPLETE:i(640),FADE_OUT_START:i(641),FLASH_COMPLETE:i(642),FLASH_START:i(643),PAN_COMPLETE:i(644),PAN_START:i(645),POST_RENDER:i(646),PRE_RENDER:i(647),SHAKE_COMPLETE:i(648),SHAKE_START:i(649),ZOOM_COMPLETE:i(650),ZOOM_START:i(651)}},function(t,e,i){t.exports={BOOT:i(818),DESTROY:i(819),DRAG_END:i(820),DRAG_ENTER:i(821),DRAG:i(822),DRAG_LEAVE:i(823),DRAG_OVER:i(824),DRAG_START:i(825),DROP:i(826),GAME_OUT:i(827),GAME_OVER:i(828),GAMEOBJECT_DOWN:i(829),GAMEOBJECT_DRAG_END:i(830),GAMEOBJECT_DRAG_ENTER:i(831),GAMEOBJECT_DRAG:i(832),GAMEOBJECT_DRAG_LEAVE:i(833),GAMEOBJECT_DRAG_OVER:i(834),GAMEOBJECT_DRAG_START:i(835),GAMEOBJECT_DROP:i(836),GAMEOBJECT_MOVE:i(837),GAMEOBJECT_OUT:i(838),GAMEOBJECT_OVER:i(839),GAMEOBJECT_POINTER_DOWN:i(840),GAMEOBJECT_POINTER_MOVE:i(841),GAMEOBJECT_POINTER_OUT:i(842),GAMEOBJECT_POINTER_OVER:i(843),GAMEOBJECT_POINTER_UP:i(844),GAMEOBJECT_POINTER_WHEEL:i(845),GAMEOBJECT_UP:i(846),GAMEOBJECT_WHEEL:i(847),MANAGER_BOOT:i(848),MANAGER_PROCESS:i(849),MANAGER_UPDATE:i(850),POINTER_DOWN:i(851),POINTER_DOWN_OUTSIDE:i(852),POINTER_MOVE:i(853),POINTER_OUT:i(854),POINTER_OVER:i(855),POINTER_UP:i(856),POINTER_UP_OUTSIDE:i(857),POINTER_WHEEL:i(858),POINTERLOCK_CHANGE:i(859),PRE_UPDATE:i(860),SHUTDOWN:i(861),START:i(862),UPDATE:i(863)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e,i){var n={};t.exports=n;var s=i(31),r=i(17),o=i(25),a=i(38),h=i(37),l=i(482);n.rectangle=function(t,e,i,n,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(a.chamfer){var l=a.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},n.trapezoid=function(t,e,i,n,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-n+" L "+c+" "+-n+" L "+d+" 0":"L 0 0 L "+c+" "+-n+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return o.create(r.extend({},f,h))},n.circle=function(t,e,i,s,o){s=s||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),n.polygon(t,e,h,i,r.extend({},a,s))},n.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return n.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&s.area(A)1?(f=o.create(r.extend({parts:p.slice(0)},n)),o.setPosition(f,{x:t,y:e}),f):p[0]}},function(t,e,i){var n=i(147),s=i(26);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;dthis.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){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},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,i){var n=i(0),s=i(12),r=i(13),o=i(966),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,o){r.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s.Animation(this),this.setTexture(n,o),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e,i){return this.anims.play(t,e,i),this},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=a},function(t,e,i){var n=i(0),s=i(20),r=i(23),o=i(8),a=i(1),h=i(5),l=i(7),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s80*i){n=h=t[0],a=l=t[1];for(var T=i;Th&&(h=u),f>l&&(l=f);g=0!==(g=Math.max(h-n,l-a))?1/g:0}return o(y,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===E(t,e,i,n)>0)for(r=e;r=e;r-=n)o=b(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(S(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(S(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),S(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(m(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&m(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(m(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.prevZ,v=t.nextZ;p&&p.z>=c&&v&&v.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!y(s,r)&&x(s,n,n.next,r)&&T(s,r)&&T(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),S(n),S(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=w(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&T(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=w(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&T(t,e)&&T(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(y(t,e)&&y(i,n)||y(t,n)&&y(i,e))||m(t,e,i)>0!=m(t,e,n)>0&&m(i,n,t)>0!=m(i,n,e)>0}function T(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function w(t,e){var i=new A(t.i,t.x,t.y),n=new A(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function b(t,e,i,n){var s=new A(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function E(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){t.exports={COMPLETE:i(886),DECODED:i(887),DECODED_ALL:i(888),DESTROY:i(889),DETUNE:i(890),GLOBAL_DETUNE:i(891),GLOBAL_MUTE:i(892),GLOBAL_RATE:i(893),GLOBAL_VOLUME:i(894),LOOP:i(895),LOOPED:i(896),MUTE:i(897),PAUSE_ALL:i(898),PAUSE:i(899),PLAY:i(900),RATE:i(901),RESUME_ALL:i(902),RESUME:i(903),SEEK:i(904),STOP_ALL:i(905),STOP:i(906),UNLOCKED:i(907),VOLUME:i(908)}},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||e>s||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},function(t,e,i){var n=i(0),s=i(20),r=i(23),o=i(8),a=i(1),h=i(7),l=new n({Extends:r,initialize:function t(e,i,n,s,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),n=a(c,"url"),l=a(c,"normalMap"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(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:o};if(r.call(this,e,d),l){var f=new t(e,this.key,l,s,o);f.type="normalMap",this.setLink(f),e.addFile(f)}},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")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;nthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight,this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e,i){var n=i(0),s=i(51),r=i(259),o=i(260),a=i(52),h=i(156),l=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;si&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){t.exports={ADD:i(865),COMPLETE:i(866),FILE_COMPLETE:i(867),FILE_KEY_COMPLETE:i(868),FILE_LOAD_ERROR:i(869),FILE_LOAD:i(870),FILE_PROGRESS:i(871),POST_PROCESS:i(872),PROGRESS:i(873),START:i(874)}},function(t,e,i){var n=i(70);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(969),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,s){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},function(t,e,i){var n=i(175),s=i(191);t.exports=function(t,e){var i=n.Power0;if("string"==typeof t)if(n.hasOwnProperty(t))i=n[t];else{var r="";t.indexOf(".")&&("in"===(r=t.substr(t.indexOf(".")+1)).toLowerCase()?r="easeIn":"out"===r.toLowerCase()?r="easeOut":"inout"===r.toLowerCase()&&(r="easeInOut")),t=s(t.substr(0,t.indexOf(".")+1)+r),n.hasOwnProperty(t)&&(i=n[t])}else"function"==typeof t?i=t:Array.isArray(t)&&t.length;if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(u-h)*(r-l)-(c-l)*(s-h),f=(o-s)*(r-l)-(a-r)*(s-h),p=(c-l)*(o-s)-(u-h)*(a-r);if(0===p)return!1;var g=d/p,v=f/p;return g>=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(t,e,i){var n={};t.exports=n;var s=i(17);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r0){i||(i={}),n=e.split(" ");for(var l=0;l0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(s.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}}},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e,i){var n=i(24);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e,i){var n=i(0),s=i(278),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("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;nT||x.y>w)){var b=Math.max(x.x,e),S=Math.max(x.y,i),A=Math.min(x.r,T)-b,E=Math.min(x.b,w)-S;v=A,m=E,p=o?h+(u-(b-x.x)-A):h+(b-x.x),g=a?l+(c-(S-x.y)-E):l+(S-x.y),e=b,i=S,n=A,r=E}else p=0,g=0,v=0,m=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var _=this.source.width,C=this.source.height;return t.u0=Math.max(0,p/_),t.v0=Math.max(0,g/C),t.u1=Math.min(1,(p+v)/_),t.v1=Math.min(1,(g+m)/C),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=m,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},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,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,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 o(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=o},function(t,e,i){var n=i(0),s=i(105),r=i(396),o=i(397),a=i(52),h=i(164),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.ELLIPSE,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 o(this,t,e,i)},getRandomPoint:function(t){return h(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.width=0,this.height=0,this},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},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var n=i(247),s=i(0),r=i(119),o=i(1),a=i(5),h=i(7),l=i(390),u=i(107),c=i(64),d=new s({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?h(e[0])&&(i=e,e=null):h(e)&&(i=e,e=null),this.scene=t,this.children=new u(e),this.isParent=!0,this.classType=o(i,"classType",c),this.name=o(i,"name",""),this.active=o(i,"active",!0),this.maxSize=o(i,"maxSize",-1),this.defaultKey=o(i,"defaultKey",null),this.defaultFrame=o(i,"defaultFrame",null),this.runChildUpdate=o(i,"runChildUpdate",!1),this.createCallback=o(i,"createCallback",null),this.removeCallback=o(i,"removeCallback",null),this.createMultipleCallback=o(i,"createMultipleCallback",null),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return t0&&r.motion=r.sleepThreshold&&n.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else n.set(r,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,s=0;sn._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||s.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&s.trigger(t,"sleepEnd"))}},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&e0;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){var n=i(0),s=i(12),r=i(40),o=i(9),a=i(54),h=i(11),l=i(35),u=i(171),c=i(3),d=new n({Extends:o,Mixins:[s.Alpha,s.Visible],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),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;gC&&wE&&b<_&&f.push(v)}else f.push(v)}return f},getWorldPoint:function(t,e,i){void 0===i&&(i=new c);var n=this.matrix.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5],u=s*a-r*o;if(!u)return i.x=t,i.y=e,i;var d=a*(u=1/u),f=-r*u,p=-o*u,g=s*u,v=(o*l-a*h)*u,m=(r*h-s*l)*u,y=Math.cos(this.rotation),x=Math.sin(this.rotation),T=this.zoom,w=this.resolution,b=this.scrollX,S=this.scrollY,A=t+(b*y-S*x)*T,E=e+(b*x+S*y)*T;return i.x=(A*d+E*p)*w+v,i.y=(A*f+E*g)*w+m,i},ignore:function(t){var e=this.id;Array.isArray(t)||(t=[t]);for(var i=0;is&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras;var i=this.scaleManager.resolution;return this.resolution=i,this._cx=this._x*i,this._cy=this._y*i,this._cw=this._width*i,this._ch=this._height*i,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=d},function(t,e){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;i0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){t.exports={ADD:i(763),ERROR:i(764),LOAD:i(765),READY:i(766),REMOVE:i(767)}},function(t,e){t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement)return t;return i||(i=document.body),i.appendChild(t),t}},function(t,e,i){var n=i(84);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 o=e.length-1;o>=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e,i){var n=i(0),s=i(70),r=i(9),o=i(71),a=i(22),h=i(2),l=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on(a.FOCUS,function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once(o.COMPLETE,n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(o.STOP_ALL,this)},unlock:h,onBlur:h,onFocus:h,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=l},function(t,e,i){var n=i(0),s=i(9),r=i(71),o=i(15),a=i(2),h=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},function(t,e,i){var n=i(193),s=i(0),r=i(2),o=i(136),a=new s({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?n.Add(this.list,t):n.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?n.AddAt(this.list,t,e):n.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o.inplace(this.list,e),this):this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return n.GetFirst(this.list,t,e,i,s)},getAll:function(t,e,i,s){return n.GetAll(this.list,t,e,i,s)},count:function(t,e){return n.CountAllMatching(this.list,t,e)},swap:function(t,e){n.Swap(this.list,t,e)},moveTo:function(t,e){return n.MoveTo(this.list,t,e)},remove:function(t,e){return e?n.Remove(this.list,t):n.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?n.RemoveAt(this.list,t):n.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?n.RemoveBetween(this.list,t,e):n.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return n.BringToTop(this.list,t)},sendToBack:function(t){return n.SendToBack(this.list,t)},moveUp:function(t){return n.MoveUp(this.list,t),t},moveDown:function(t){return n.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e){return n.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?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}}});t.exports=a},function(t,e,i){var n=i(194),s=i(388);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;il&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a0&&o.length0&&a.lengthe.right||t.y>e.bottom)}},function(t,e,i){var n=i(5),s={},r={register:function(t,e,i,n,r){s[t]={plugin:e,mapping:i,settingsKey:n,configKey:r}},getPlugin:function(t){return s[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in s){var a=s[o].plugin,h=s[o].mapping,l=s[o].settingsKey,u=s[o].configKey;n(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){s.hasOwnProperty(t)&&delete s[t]}};t.exports=r},function(t,e,i){t.exports={ANY_KEY_DOWN:i(1204),ANY_KEY_UP:i(1205),COMBO_MATCH:i(1206),DOWN:i(1207),KEY_DOWN:i(1208),KEY_UP:i(1209),UP:i(1210)}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),{responseType:t,async:e,user:i,password:n,timeout:s,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e,i){var n=i(0),s=i(222),r=i(64),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e,i){t.exports={Bounce:i(1304),Collision:i(1305),Force:i(1306),Friction:i(1307),Gravity:i(1308),Mass:i(1309),Static:i(1310),Sensor:i(1311),SetBody:i(1312),Sleep:i(1313),Transform:i(1326),Velocity:i(1327)}},function(t,e){var i={};t.exports=i,i.create=function(t,e){var n=t.bodyA,s=t.bodyB,r={id:i.id(n,s),bodyA:n,bodyB:s,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||s.isSensor,timeCreated:e,timeUpdated:e,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return i.update(r,t,e),r},i.update=function(t,e,n){if(t.collision=e,e.collided){var s=e.supports,r=t.activeContacts,o=e.parentA,a=e.parentB;t.inverseMass=o.inverseMass+a.inverseMass,t.friction=Math.min(o.friction,a.friction),t.frictionStatic=Math.max(o.frictionStatic,a.frictionStatic),t.restitution=Math.max(o.restitution,a.restitution),t.slop=Math.max(o.slop,a.slop);for(var h=0;h=this.firstgid&&t1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(24),s=i(0),r=i(9),o=i(116),a=i(264),h=i(265),l=i(5),u=new s({Extends:r,initialize:function(t,e,i){r.call(this),this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,l(i,"frames",[]),l(i,"defaultTextureKey",null)),this.frameRate=l(i,"frameRate",null),this.duration=l(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=l(i,"skipMissedFrames",!0),this.delay=l(i,"delay",0),this.repeat=l(i,"repeat",0),this.repeatDelay=l(i,"repeatDelay",0),this.yoyo=l(i,"yoyo",!1),this.showOnStart=l(i,"showOnStart",!1),this.hideOnComplete=l(i,"hideOnComplete",!1),this.paused=!1,this.manager.on(o.PAUSE_ALL,this.pause,this),this.manager.on(o.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=a[0],a[0].prevFrame=s;var v=1/(a.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),a(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);if(t._repeatDelay>0&&!1===t.pendingRepeat)t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay;else if(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying){this.getNextTick(t),t.pendingRepeat=!1;var e=t.currentFrame,i=t.parent;this.emit(o.ANIMATION_REPEAT,this,e),i.emit(o.SPRITE_ANIMATION_KEY_REPEAT+this.key,this,e,t.repeatCounter,i),i.emit(o.SPRITE_ANIMATION_REPEAT,this,e,t.repeatCounter,i)}},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),n=0;n1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[n-1],t.nextFrame=this.frames[n+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.removeAllListeners(),this.manager.off(o.PAUSE_ALL,this.pause,this),this.manager.off(o.RESUME_ALL,this.resume,this),this.manager.remove(this.key);for(var t=0;t=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,i){var n=i(61),s=i(4);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},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){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){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=(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,i){var n=i(288),s=i(291),r=i(293),o=i(294);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var n=i(172);t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1);var r=Math.floor(6*t),o=6*t-r,a=Math.floor(i*(1-e)*255),h=Math.floor(i*(1-o*e)*255),l=Math.floor(i*(1-(1-o)*e)*255),u=i=Math.floor(i*=255),c=i,d=i,f=r%6;return 0===f?(c=l,d=a):1===f?(u=h,d=a):2===f?(u=a,d=l):3===f?(u=a,c=h):4===f?(u=l,c=a):5===f&&(c=a,d=h),s?s.setTo?s.setTo(u,c,d,s.alpha,!1):(s.r=u,s.g=c,s.b=d,s.color=n(u,c,d),s):{r:u,g:c,b:d,color:n(u,c,d)}}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var n=i(296),s=i(297),r=i(298),o=i(299),a=i(300),h=i(301),l=i(302),u=i(303),c=i(304),d=i(305),f=i(306),p=i(307);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:n.Out,Bounce:s.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":n.In,"Bounce.easeIn":s.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":n.Out,"Bounce.easeOut":s.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":s.InOut}},function(t,e,i){var n=i(124),s=i(125),r=i(27),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.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").createImageData(1,1);return a=n.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.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,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(o.getUserMedia=!1),!n.iOS&&(s.ie||s.firefox||s.chrome)&&(o.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.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)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},function(t,e,i){var n=i(21),s=i(15),r={Angle:i(721),Distance:i(729),Easing:i(731),Fuzzy:i(732),Interpolation:i(735),Pow2:i(740),Snap:i(742),RandomDataGenerator:i(744),Average:i(745),Bernstein:i(316),Between:i(180),CatmullRom:i(179),CeilTo:i(746),Clamp:i(24),DegToRad:i(40),Difference:i(747),Factorial:i(317),FloatBetween:i(323),FloorTo:i(748),FromPercent:i(97),GetSpeed:i(749),IsEven:i(750),IsEvenStrict:i(751),Linear:i(123),MaxAdd:i(752),MinSub:i(753),Percent:i(754),RadToDeg:i(181),RandomXY:i(755),RandomXYZ:i(756),RandomXYZW:i(757),Rotate:i(324),RotateAround:i(270),RotateAroundDistance:i(166),RoundAwayFromZero:i(325),RoundTo:i(758),SinCosTableGenerator:i(759),SmootherStep:i(167),SmoothStep:i(168),ToXY:i(760),TransformXY:i(326),Within:i(761),Wrap:i(62),Vector2:i(3),Vector3:i(182),Vector4:i(327),Matrix3:i(328),Matrix4:i(329),Quaternion:i(330),RotateVec3:i(762)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)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,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,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},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],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=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=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],m=s[12],y=s[13],x=s[14],T=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+m)*T,this.y=(e*o+i*u+n*p+y)*T,this.z=(e*a+i*c+n*g+x)*T,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/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){var n={Global:["game","anims","cache","plugins","registry","scale","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]};n.Global.push("facebook"),t.exports=n},function(t,e,i){var n=i(0),s=i(10),r=new n({initialize:function(t){this.name="WebGLPipeline",this.game=t.game,this.view=t.game.canvas,this.resolution=1,this.width=0,this.height=0,this.gl=t.gl,this.vertexCount=0,this.vertexCapacity=t.vertexCapacity,this.renderer=t.renderer,this.vertexData=t.vertices?t.vertices:new ArrayBuffer(t.vertexCapacity*t.vertexSize),this.vertexBuffer=this.renderer.createVertexBuffer(t.vertices?t.vertices:this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=this.renderer.createProgram(t.vertShader,t.fragShader),this.attributes=t.attributes,this.vertexSize=t.vertexSize,this.topology=t.topology,this.bytes=new Uint8Array(this.vertexData),this.vertexComponentCount=s.getComponentCount(t.attributes,this.gl),this.flushLocked=!1,this.active=!1},boot:function(){},addAttribute:function(t,e,i,n,s){return this.attributes.push({name:t,size:e,type:this.renderer.glFormats[i],normalized:n,offset:s}),this},shouldFlush:function(){return this.vertexCount>=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this.resolution=i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):-1!==h&&t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(0),s=i(69),r=i(1),o=i(340),a=i(771),h=i(772),l=i(35),u=i(10),c=i(184),d=new n({Extends:c,Mixins:[o],initialize:function(t){var e=t.renderer.config;c.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:r(t,"topology",t.renderer.gl.TRIANGLES),vertShader:r(t,"vertShader",h),fragShader:r(t,"fragShader",a),vertexCapacity:r(t,"vertexCapacity",6*e.batchSize),vertexSize:r(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this.batches=[],this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return c.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return c.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){return void 0===t&&(t=this.renderer.blankTexture.glTexture),void 0===e&&(e=0),this.requireTextureBatch(t,e)&&this.pushBatch(t,e),this},requireTextureBatch:function(t,e){var i=this.batches,n=i.length;return!(n>0)||!((e>0?i[n-1].textures[e-1]:i[n-1].texture)===t)},pushBatch:function(t,e){if(0===e)this.batches.push({first:this.vertexCount,texture:t,textures:[]});else{var i=[];i[e-1]=t,this.batches.push({first:this.vertexCount,texture:null,textures:i})}},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,n=this.gl,s=this.vertexCount,r=this.topology,o=this.vertexSize,a=this.renderer,h=this.batches,l=h.length,u=0,c=null;if(0===l||0===s)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,s*o));for(var d=0;d0){for(e=0;e0){for(e=0;e0&&(a.setTexture2D(c.texture,0,!1),n.drawArrays(r,c.first,u)),this.vertexCount=0,h.length=0,this.flushLocked=!1,this},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,l=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.cutWidth,v=o.cutHeight,m=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+f,w=-x+p;if(t.isCropped){var b=t._crop;b.flipX===t.flipX&&b.flipY===t.flipY||o.updateCropUVs(b,t.flipX,t.flipY),h=b.u0,l=b.v0,c=b.u1,d=b.v1,g=b.width,v=b.height,T=-y+(f=b.x),w=-x+(p=b.y)}var S=1,A=1;t.flipX&&(m||(T+=-o.realWidth+2*y),S=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(m||(w+=-o.realHeight+2*x),A=-1),s.applyITRS(t.x,t.y,t.rotation,t.scaleX*S,t.scaleY*A),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),s.e=t.x,s.f=t.y,n.multiply(s,r)):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY,n.multiply(s,r));var E=T+g,_=w+v,C=r.getX(T,w),M=r.getY(T,w),P=r.getX(T,_),O=r.getY(T,_),R=r.getX(E,_),L=r.getY(E,_),D=r.getX(E,w),F=r.getY(E,w),k=u.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),I=u.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),B=u.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),N=u.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(C=Math.round(C),M=Math.round(M),P=Math.round(P),O=Math.round(O),R=Math.round(R),L=Math.round(L),D=Math.round(D),F=Math.round(F)),this.setTexture2D(a,0);var Y=t._isTinted&&t.tintFill;this.batchQuad(C,M,P,O,R,L,D,F,h,l,c,d,k,I,B,N,Y,a,0)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y){var x=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),x=!0,this.setTexture2D(m,y));var T=this.vertexViewF32,w=this.vertexViewU32,b=this.vertexCount*this.vertexComponentCount-1;return T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=i,T[++b]=n,T[++b]=h,T[++b]=c,T[++b]=v,w[++b]=p,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=o,T[++b]=a,T[++b]=u,T[++b]=l,T[++b]=v,w[++b]=f,this.vertexCount+=6,x},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g){var v=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),this.setTexture2D(p,g),v=!0);var m=this.vertexViewF32,y=this.vertexViewU32,x=this.vertexCount*this.vertexComponentCount-1;return m[++x]=t,m[++x]=e,m[++x]=o,m[++x]=a,m[++x]=f,y[++x]=u,m[++x]=i,m[++x]=n,m[++x]=o,m[++x]=l,m[++x]=f,y[++x]=c,m[++x]=s,m[++x]=r,m[++x]=h,m[++x]=l,m[++x]=f,y[++x]=d,this.vertexCount+=3,v},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,S,A,E,_,C,M,P,O){this.renderer.setPipeline(this,t);var R=this._tempMatrix1,L=this._tempMatrix2,D=this._tempMatrix3,F=m/i+_,k=y/n+C,I=(m+x)/i+_,B=(y+T)/n+C,N=o,Y=a,X=-g,z=-v;if(t.isCropped){var U=t._crop;N=U.width,Y=U.height,o=U.width,a=U.height;var G=m=U.x,W=y=U.y;c&&(G=x-U.x-U.width),d&&!e.isRenderTexture&&(W=T-U.y-U.height),F=G/i+_,k=W/n+C,I=(G+U.width)/i+_,B=(W+U.height)/n+C,X=-g+m,z=-v+y}d^=!O&&e.isRenderTexture?1:0,c&&(N*=-1,X+=o),d&&(Y*=-1,z+=a);var V=X+N,H=z+Y;L.applyITRS(s,r,u,h,l),R.copyFrom(M.matrix),P?(R.multiplyWithOffset(P,-M.scrollX*f,-M.scrollY*p),L.e=s,L.f=r,R.multiply(L,D)):(L.e-=M.scrollX*f,L.f-=M.scrollY*p,R.multiply(L,D));var j=D.getX(X,z),q=D.getY(X,z),K=D.getX(X,H),J=D.getY(X,H),Z=D.getX(V,H),Q=D.getY(V,H),$=D.getX(V,z),tt=D.getY(V,z);M.roundPixels&&(j=Math.round(j),q=Math.round(q),K=Math.round(K),J=Math.round(J),Z=Math.round(Z),Q=Math.round(Q),$=Math.round($),tt=Math.round(tt)),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,F,k,I,B,w,b,S,A,E,e,0)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),m=h.getY(l,c),y=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,m,y,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n;this.setTexture2D();var h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),m=this.currentFrame,y=m.u0,x=m.v0,T=m.u1,w=m.v1;this.batchQuad(l,u,c,d,f,p,g,v,y,x,T,w,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,m=g.v0,y=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,m,y,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&H[4]?this.batchQuad(D,F,P,O,H[0],H[1],H[2],H[3],U,G,W,V,B,N,Y,X,I):(j[0]=D,j[1]=F,j[2]=P,j[3]=O,j[4]=1),h&&j[4]?this.batchQuad(C,M,R,L,j[0],j[1],j[2],j[3],U,G,W,V,B,N,Y,X,I):(H[0]=C,H[1]=M,H[2]=R,H[3]=L,H[4]=1)}}});t.exports=d},function(t,e,i){var n=i(11);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,r,o=Number.MAX_VALUE,a=Number.MAX_VALUE,h=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,u=0;u0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit(o.START,this),this.events.emit(o.READY,this,t)},shutdown:function(t){this.events.off(o.TRANSITION_INIT),this.events.off(o.TRANSITION_START),this.events.off(o.TRANSITION_COMPLETE),this.events.off(o.TRANSITION_OUT),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.SHUTDOWN,this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.DESTROY,this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e,i){var n=i(193),s=i(42),r=i(0),o=i(12),a=i(119),h=i(13),l=i(11),u=i(953),c=i(392),d=i(3),f=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Transform,o.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 o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,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.list.length>0)for(var e=this.list,i=new l,n=0;n-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=[],this._displayList=null}});t.exports=f},function(t,e,i){var n=i(137),s=i(0),r=i(958),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(121),s=i(0),r=i(201),o=i(262),a=i(266),h=i(267),l=i(271),u=i(118),c=i(276),d=i(277),f=i(274),p=i(35),g=i(104),v=i(13),m=i(1),y=i(5),x=i(21),T=i(964),w=new s({Extends:v,Mixins:[o,a,h,l,u,c,d,f,T],initialize:function(t,e){var i=y(e,"x",0),n=y(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this.setDefaultStyles(e)},setDefaultStyles:function(t){return y(t,"lineStyle",null)&&(this.defaultStrokeWidth=y(t,"lineStyle.width",1),this.defaultStrokeColor=y(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=y(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),y(t,"fillStyle",null)&&(this.defaultFillColor=y(t,"fillStyle.color",16777215),this.defaultFillAlpha=y(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,s){return void 0===s&&(s=1),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,s,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,s,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,n,s),this},setTexture:function(t,e,i){if(void 0===i&&(i=0),void 0===t)this.commandBuffer.push(r.CLEAR_TEXTURE);else{var n=this.scene.sys.textures.getFrame(t,e);n&&(2===i&&(i=3),this.commandBuffer.push(r.SET_TEXTURE,n,i))}return this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(r.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var s=this._lineWidth/2,r=t-s,o=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+n),this.lineTo(o+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,n,s,o),this},strokeTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,n,s,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,SET_TEXTURE:19,CLEAR_TEXTURE:20,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.width/2,r=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(400),a=i(134),h=i(402),l=i(974),u=new n({Extends:r,Mixins:[s.Depth,s.Mask,s.Pipeline,s.Transform,s.Visible,l],initialize:function(t,e,i,n){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var s=0;s0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;ss.width&&(t=s.width-this.frame.cutX),this.frame.cutY+e>s.height&&(e=s.height-this.frame.cutY),this.frame.setSize(t,e,this.frame.cutX,this.frame.cutY)}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.frame.cutWidth),void 0===r&&(r=this.frame.cutHeight);var o=255&(t>>16|0),a=255&(t>>8|0),h=255&(0|t),l=this.gl,u=this.frame;if(l){var c=this.renderer,f=this.getBounds();c.setFramebuffer(this.framebuffer,!0),s===u.source.width&&r===u.source.height||l.scissor(i+u.cutX,n+u.cutY,s,r),this.pipeline.drawFillRect(f.x,f.y,f.right,f.bottom,d.getTintFromFloats(o/255,a/255,h/255,1),e),s===u.source.width&&r===u.source.height||l.scissor(0,0,u.source.width,u.source.height),this.renderer.setFramebuffer(null,!0)}else this.context.fillStyle="rgba("+o+","+a+","+h+","+e+")",this.context.fillRect(i+u.cutX,n+u.cutY,s,r);return this},clear:function(){if(this.dirty){var t=this.gl;if(t){var e=this.renderer;e.setFramebuffer(this.framebuffer,!0),this.frame.cutWidth===this.canvas.width&&this.frame.cutHeight===this.canvas.height||t.scissor(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),e.setFramebuffer(null,!0)}else{var i=this.context;i.save(),i.setTransform(1,0,0,1,0,0),i.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),i.restore()}this.dirty=!1}return this},erase:function(t,e,i){this._eraseMode=!0;var s=this.renderer.currentBlendMode;return this.renderer.setBlendMode(n.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(s),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1),r){var o=this.camera._cx,a=this.camera._cy,h=this.camera._cw,l=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(o,a,h,l,l);var u=this.pipeline;u.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),this.batchList(t,e,i,n,s),u.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),u.projOrtho(0,u.width,u.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1),o){var h=this.camera._cx,l=this.camera._cy,u=this.camera._cw,c=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(h,l,u,c,c);var d=this.pipeline;d.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),d.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,r,s,this.camera.matrix,null),d.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),d.projOrtho(0,d.width,d.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;rl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=y+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=l,n+=a[h],h0&&(d+=h.lineSpacing*g),i.rtl)c=f-c;else if("right"===i.align)c+=o-h.lineWidths[g];else if("center"===i.align)c+=(o-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var v=h.width-h.lineWidths[g],m=e.measureText(" ").width,y=a[g].trim(),x=y.split(" ");v+=(a[g].length-y.length)*m;for(var T=Math.floor(v/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[g]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[g],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[g],c,d))}e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var b=this.input;return b&&!b.customHitArea&&(b.hitArea.width=this.width,b.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(27),s=i(0),r=i(12),o=i(22),a=i(13),h=i(321),l=i(122),u=i(990),c=i(3),d=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,s,r,l,u){var d=t.sys.game.renderer;a.call(this,t,"TileSprite");var f=t.sys.textures.get(l),p=f.get(u);s&&r?(s=Math.floor(s),r=Math.floor(r)):(s=p.width,r=p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=n.create(this,s,r),this.context=this.canvas.getContext("2d"),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(p.width),this.potHeight=h(p.height),this.fillCanvas=n.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(s,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(o.CONTEXT_RESTORED,function(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)},this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){return this.displayFrame=this.displayTexture.get(t),this.displayFrame.cutWidth&&this.displayFrame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame,e=this.fillContext,i=this.fillCanvas,n=this.potWidth,s=this.potHeight;this.renderer.gl||(n=t.cutWidth,s=t.cutHeight),e.clearRect(0,0,n,s),i.width=n,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,s),this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,n=this._tileScale.y,s=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,n),e.translate(-s,-r),e.fillStyle=this.fillPattern,e.fillRect(s,r,this.width/i,this.height/n),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),n.remove(this.canvas),n.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},function(t,e,i){var n=i(0),s=i(208),r=i(418),o=i(52),a=new n({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return s(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n=0&&w<=1&&i.push(new n(r,o))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);r=a+b*p,o=h+b*g,b>=0&&b<=1&&i.push(new n(r,o));var S=(-x+Math.sqrt(T))/(2*y);r=a+S*p,o=h+S*g,S>=0&&S<=1&&i.push(new n(r,o))}}return i}},function(t,e,i){var n=i(51),s=new(i(4));t.exports=function(t,e,i){if(void 0===i&&(i=s),n(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(n(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){var n=i(4),s=i(92),r=i(433);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new n,new n,new n,new n],c=[s(o,t,u[0]),s(a,t,u[1]),s(h,t,u[2]),s(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var s,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,m=p*v-g*g,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&s+r<1&&(n.push({x:e[w].x,y:e[w].y}),i)));w++);return n}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,t}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,o=t.x3-e,a=t.y3-i,t.x3=o*s-a*r+e,t.y3=o*r+a*s+i,t}},function(t,e,i){t.exports={BUTTON_DOWN:i(1190),BUTTON_UP:i(1191),CONNECTED:i(1192),DISCONNECTED:i(1193),GAMEPAD_BUTTON_DOWN:i(1194),GAMEPAD_BUTTON_UP:i(1195)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,i){var n=i(15),s=i(142);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,i){var n=i(0),s=i(20),r=i(23),o=i(8),a=i(1),h=i(7),l=i(363),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,r=n.rectangle(i,s,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),u=this.tile.getCollisionGroup(),c=a(u,"objects",[]),d=[],f=0;f1&&(t.parts=d,this.setBody(s.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(230),r=i(145),o=i(38);n.collisions=function(t,e){for(var i=[],a=e.pairs.table,h=e.metrics,l=0;l1?1:0;d1?1:0;p0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n={};t.exports=n;var s=i(31),r=i(37);n.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,f=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&f<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var p=l.axisBody,g=p===t?e:t,v=[p.axes[i.axisNumber]];if(h=n._overlapAxes(p.vertices,g.vertices,v),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlaps?s=a:a=0?o.index-1:u.length-1],l.x=s.x-c.x,l.y=s.y-c.y,h=-r.dot(i,l),a=s,s=u[(o.index+1)%u.length],l.x=s.x-c.x,l.y=s.y-c.y,(n=-r.dot(i,l))r?(s.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),r=s.topologicalSort(i),o=[],a=0;a0&&!h.silent&&s.info(o.join(" "))}else s.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=n.resolve(t)||t,e[r]=s.map(t.uses||[],function(e){n.isPlugin(e)&&n.register(e);var r=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,r.range)?(s.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(r),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(s.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),r.name});for(var o=0;o=s[2];if("^"===i.operator)return s[0]>0?o[0]===s[0]&&r.number>=i.number:s[1]>0?o[1]===s[1]&&o[2]>=s[2]:o[2]===s[2]}return t===e||"*"===t}},function(t,e,i){var n={};t.exports=n;var s=i(76),r=(i(95),i(17));n.create=function(t){var e=s.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},function(t,e,i){var n=i(147);t.exports=function(t,e,i){var s=n(t,e,!0,i),r=n(t,e-1,!0,i),o=n(t,e+1,!0,i),a=n(t-1,e,!0,i),h=n(t+1,e,!0,i),l=s&&s.collides;return l&&(s.faceTop=!0,s.faceBottom=!0,s.faceLeft=!0,s.faceRight=!0),r&&r.collides&&(l&&(s.faceTop=!1),r.faceBottom=!l),o&&o.collides&&(l&&(s.faceBottom=!1),o.faceTop=!l),a&&a.collides&&(l&&(s.faceLeft=!1),a.faceRight=!l),h&&h.collides&&(l&&(s.faceRight=!1),h.faceLeft=!l),s&&!s.collides&&s.resetFaces(),s}},function(t,e,i){var n=i(78),s=i(112),r=i(234),o=i(77);t.exports=function(t,e,i,a,h){if(!s(e,i,h))return null;void 0===a&&(a=!0);var l=h.data[i][e],u=l&&l.collides;if(t instanceof n)null===h.data[i][e]&&(h.data[i][e]=new n(h,t.index,e,i,t.width,t.height)),h.data[i][e].copy(t);else{var c=t;null===h.data[i][e]?h.data[i][e]=new n(h,c,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=c}var d=h.data[i][e],f=-1!==h.collideIndexes.indexOf(d.index);return o(d,f),a&&u!==d.collides&&r(e,i,h),d}},function(t,e){t.exports=function(t,e,i){var n=i.collideIndexes.indexOf(t);e&&-1===n?i.collideIndexes.push(t):e||-1===n||i.collideIndexes.splice(n,1)}},function(t,e,i){var n=i(33),s=i(113),r=i(114),o=i(78);t.exports=function(t,e,i,a,h){for(var l=new s({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p0&&(s.totalDuration+=s.t2*s.repeat),s.totalDuration>t&&(t=s.totalDuration),s.delay0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay,this.startDelay=e},init:function(){if(this.paused&&!this.parentIsTimeline)return this.state=h.PENDING_ADD,this._pausedState=h.INIT,!1;for(var t=this.data,e=this.totalTargets,i=0;i0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=h.LOOP_DELAY):(this.state=h.ACTIVE,this.dispatchTweenEvent(r.TWEEN_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=h.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(r.TWEEN_COMPLETE,this.callbacks.onComplete))},pause:function(){return this.state===h.PAUSED?this:(this.paused=!0,this._pausedState=this.state,this.state=h.PAUSED,this)},play:function(t){void 0===t&&(t=!1);var e=this.state;return e!==h.INIT||this.parentIsTimeline?e===h.ACTIVE||e===h.PENDING_ADD&&this._pausedState===h.PENDING_ADD?this:this.parentIsTimeline||e!==h.PENDING_REMOVE&&e!==h.REMOVED?(this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?this.state=h.ACTIVE:(this.countdown=this.calculatedOffset,this.state=h.OFFSET_DELAY)):this.paused?(this.paused=!1,this.makeActive()):(this.resetTweenData(t),this.state=h.ACTIVE,this.makeActive()),this):(this.seek(0),this.parent.makeActive(this),this):(this.resetTweenData(!1),this.state=h.ACTIVE,this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,n=this.totalTargets,s=0;s0&&(r.elapsed=r.delay,r.state=h.DELAY),r.getActiveValue&&(o[a]=r.getActiveValue(r.target,r.key,r.start))}},resume:function(){return this.state===h.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t,e){if(void 0===e&&(e=16.6),this.totalDuration>=36e5)return console.warn("Tween.seek duration too long"),this;this.state===h.REMOVED&&this.makeActive(),this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0;for(var i=this.data,n=this.totalTargets,s=0;s0&&(r.elapsed=r.delay,r.state=h.DELAY)}this.calcDuration();var c=!1;this.state===h.PAUSED&&(c=!0,this.state=h.ACTIVE),this.isSeeking=!0;do{this.update(0,e)}while(this.totalProgress0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},setStateFromStart:function(t,e,i){return e.repeatCounter>0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},updateTweenData:function(t,e,i){var n=e.target;switch(e.state){case h.PLAYING_FORWARD:case h.PLAYING_BACKWARD:if(!n){e.state=h.COMPLETE;break}var s=e.elapsed,o=e.duration,a=0;(s+=i)>o&&(a=s-o,s=o);var l=e.state===h.PLAYING_FORWARD,u=s/o;if(e.elapsed=s,e.progress=u,1===u)l?(e.current=e.end,n[e.key]=e.end,e.hold>0?(e.elapsed=e.hold-a,e.state=h.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,a)):(e.current=e.start,n[e.key]=e.start,e.state=this.setStateFromStart(t,e,a));else{var c=l?e.ease(u):e.ease(1-u);e.current=e.start+(e.end-e.start)*c,n[e.key]=e.current}this.dispatchTweenDataEvent(r.TWEEN_UPDATE,t.callbacks.onUpdate,e);break;case h.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PENDING_RENDER);break;case h.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PLAYING_FORWARD,this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e));break;case h.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case h.PENDING_RENDER:n?(e.start=e.getStartValue(n,e.key,n[e.key],e.index,t.totalTargets,t),e.end=e.getEndValue(n,e.key,e.start,e.index,t.totalTargets,t),e.current=e.start,n[e.key]=e.start,e.state=h.PLAYING_FORWARD):e.state=h.COMPLETE}return e.state!==h.COMPLETE}});l.TYPES=["onActive","onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],a.register("tween",function(t){return this.scene.sys.tweens.add(t)}),o.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=l},function(t,e,i){t.exports={TIMELINE_COMPLETE:i(1394),TIMELINE_LOOP:i(1395),TIMELINE_PAUSE:i(1396),TIMELINE_RESUME:i(1397),TIMELINE_START:i(1398),TIMELINE_UPDATE:i(1399),TWEEN_ACTIVE:i(1400),TWEEN_COMPLETE:i(1401),TWEEN_LOOP:i(1402),TWEEN_REPEAT:i(1403),TWEEN_START:i(1404),TWEEN_UPDATE:i(1405),TWEEN_YOYO:i(1406)}},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p){return{target:t,index:e,key:i,getActiveValue:r,getEndValue:n,getStartValue:s,ease:o,duration:0,totalDuration:0,delay:0,yoyo:l,hold:0,repeat:0,repeatDelay:0,flipX:f,flipY:p,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:a,duration:h,hold:u,repeat:c,repeatDelay:d},state:0}}},function(t,e,i){t.exports={Angle:i(532),Call:i(533),GetFirst:i(534),GetLast:i(535),GridAlign:i(536),IncAlpha:i(586),IncX:i(587),IncXY:i(588),IncY:i(589),PlaceOnCircle:i(590),PlaceOnEllipse:i(591),PlaceOnLine:i(592),PlaceOnRectangle:i(593),PlaceOnTriangle:i(594),PlayAnimation:i(595),PropertyValueInc:i(39),PropertyValueSet:i(29),RandomCircle:i(596),RandomEllipse:i(597),RandomLine:i(598),RandomRectangle:i(599),RandomTriangle:i(600),Rotate:i(601),RotateAround:i(602),RotateAroundDistance:i(603),ScaleX:i(604),ScaleXY:i(605),ScaleY:i(606),SetAlpha:i(607),SetBlendMode:i(608),SetDepth:i(609),SetHitArea:i(610),SetOrigin:i(611),SetRotation:i(612),SetScale:i(613),SetScaleX:i(614),SetScaleY:i(615),SetTint:i(616),SetVisible:i(617),SetX:i(618),SetXY:i(619),SetY:i(620),ShiftPosition:i(621),Shuffle:i(622),SmootherStep:i(623),SmoothStep:i(624),Spread:i(625),ToggleVisible:i(626),WrapInRectangle:i(627)}},function(t,e,i){var n=i(154),s=[];s[n.BOTTOM_CENTER]=i(249),s[n.BOTTOM_LEFT]=i(250),s[n.BOTTOM_RIGHT]=i(251),s[n.CENTER]=i(252),s[n.LEFT_CENTER]=i(254),s[n.RIGHT_CENTER]=i(255),s[n.TOP_CENTER]=i(256),s[n.TOP_LEFT]=i(257),s[n.TOP_RIGHT]=i(258);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){var n=i(43),s=i(79),r=i(44),o=i(80);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(43),s=i(45),r=i(44),o=i(46);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(43),s=i(47),r=i(44),o=i(48);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(253),s=i(79),r=i(82);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(80),s=i(81);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(82),s=i(45),r=i(81),o=i(46);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(82),s=i(47),r=i(81),o=i(48);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(79),s=i(49),r=i(80),o=i(50);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(45),s=i(49),r=i(46),o=i(50);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(47),s=i(49),r=i(48),o=i(50);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(155),s=i(97),r=i(21),o=i(4);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(261),s=i(155),r=i(97),o=i(21);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit(r.SPRITE_ANIMATION_KEY_UPDATE+i.key,i,t,e),e.emit(r.SPRITE_ANIMATION_UPDATE,i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=o},function(t,e){t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,s,r=1;if(i){if(te.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,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e,i){var n=i(42),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){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e,i){var n=i(158),s=i(117);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n-h&&(c-=h,n+=l),fd.right&&(f=u(f,f+(g-d.right),this.lerp.x)),vd.bottom&&(p=u(p,p+(v-d.bottom),this.lerp.y))):(f=u(f,g-h,this.lerp.x),p=u(p,v-l,this.lerp.y))}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.roundPixels&&(h=Math.round(h),l=Math.round(l)),this.scrollX=f,this.scrollY=p;var m=f+n,y=p+s;this.midPoint.set(m,y);var x=e/o,T=i/o;this.worldView.setTo(m-x/2,y-T/2,x,T),a.applyITRS(this.x+h,this.y+l,this.rotation,o,o),a.translate(-h,-l),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(36);t.exports=function(t){var e=new n;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(s,r,o)}return e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(e16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(36);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){var n=i(36);t.exports=function(t){var e=new n,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var s=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(s,r,o,255*a)}return e}},function(t,e,i){t.exports={Fade:i(652),Flash:i(653),Pan:i(654),Shake:i(687),Zoom:i(688)}},function(t,e,i){t.exports={In:i(655),Out:i(656),InOut:i(657)}},function(t,e,i){t.exports={In:i(658),Out:i(659),InOut:i(660)}},function(t,e,i){t.exports={In:i(661),Out:i(662),InOut:i(663)}},function(t,e,i){t.exports={In:i(664),Out:i(665),InOut:i(666)}},function(t,e,i){t.exports={In:i(667),Out:i(668),InOut:i(669)}},function(t,e,i){t.exports={In:i(670),Out:i(671),InOut:i(672)}},function(t,e,i){t.exports=i(673)},function(t,e,i){t.exports={In:i(674),Out:i(675),InOut:i(676)}},function(t,e,i){t.exports={In:i(677),Out:i(678),InOut:i(679)}},function(t,e,i){t.exports={In:i(680),Out:i(681),InOut:i(682)}},function(t,e,i){t.exports={In:i(683),Out:i(684),InOut:i(685)}},function(t,e,i){t.exports=i(686)},function(t,e,i){var n=i(0),s=i(34),r=i(309),o=i(1),a=i(5),h=i(7),l=i(177),u=i(2),c=i(183),d=i(171),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",void 0),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!0),this.autoRound=a(t,"autoRound",!1),this.autoCenter=a(t,"autoCenter",0),this.resizeInterval=a(t,"resizeInterval",500),this.fullscreenTarget=a(t,"fullscreenTarget",null),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"expandParent",this.expandParent),this.autoRound=a(e,"autoRound",this.autoRound),this.autoCenter=a(e,"autoCenter",this.autoCenter),this.resizeInterval=a(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=a(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.antialias=a(i,"antialias",!0),this.desynchronized=a(i,"desynchronized",!1),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3),this.maxLights=a(i,"maxLights",10);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){t.exports={os:i(124),browser:i(125),features:i(176),input:i(717),audio:i(718),video:i(719),fullscreen:i(720),canvasFeatures:i(310)}},function(t,e,i){var n,s,r,o=i(27),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");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;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");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);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},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){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},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),t0?Math.ceil(t):Math.floor(t)}},function(t,e,i){var n=i(3);t.exports=function(t,e,i,s,r,o,a,h){void 0===h&&(h=new n);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,f=-l*a,p=u*a,g=1/(c*p+f*-d);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=c*g*e+-d*g*t+(-s*c+i*d)*g,h}},function(t,e,i){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,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+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){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],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,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]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*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],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-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],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+m*h,e[4]=g*n+v*o+m*l,e[5]=g*s+v*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*n+x*o+T*l,e[8]=y*s+x*a+T*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],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-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,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,m=this.val;return m[0]=1-(c+f),m[3]=l+v,m[6]=u-g,m[1]=l-v,m[4]=1-(h+f),m[7]=d+p,m[2]=u+g,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=n*h-s*a,T=n*l-r*a,w=n*u-o*a,b=s*l-r*h,S=s*u-o*h,A=r*u-o*l,E=c*v-d*g,_=c*m-f*g,C=c*y-p*g,M=d*m-f*v,P=d*y-p*v,O=f*y-p*m,R=x*O-T*P+w*M+b*C-S*_+A*E;return R?(R=1/R,i[0]=(h*O-l*P+u*M)*R,i[1]=(l*C-a*O-u*_)*R,i[2]=(a*P-h*C+u*E)*R,i[3]=(r*P-s*O-o*M)*R,i[4]=(n*O-r*C+o*_)*R,i[5]=(s*C-n*P-o*E)*R,i[6]=(v*A-m*S+y*b)*R,i[7]=(m*w-g*A-y*T)*R,i[8]=(g*S-v*w+y*x)*R,this):null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),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],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},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(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=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]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],m=e*o-i*r,y=e*a-n*r,x=e*h-s*r,T=i*a-n*o,w=i*h-s*o,b=n*h-s*a,S=l*p-u*f,A=l*g-c*f,E=l*v-d*f,_=u*g-c*p,C=u*v-d*p,M=c*v-d*g,P=m*M-y*C+x*_+T*E-w*A+b*S;return P?(P=1/P,t[0]=(o*M-a*C+h*_)*P,t[1]=(n*C-i*M-s*_)*P,t[2]=(p*b-g*w+v*T)*P,t[3]=(c*w-u*b-d*T)*P,t[4]=(a*E-r*M-h*A)*P,t[5]=(e*M-n*E+s*A)*P,t[6]=(g*x-f*b-v*y)*P,t[7]=(l*b-c*x+d*y)*P,t[8]=(r*C-o*E+h*S)*P,t[9]=(i*E-e*C-s*S)*P,t[10]=(f*w-p*x+v*m)*P,t[11]=(u*x-l*w-d*m)*P,t[12]=(o*A-r*_-a*S)*P,t[13]=(e*_-i*A+n*S)*P,t[14]=(p*y-f*T-g*m)*P,t[15]=(l*T-u*y+c*m)*P,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*o+w*u+b*p,e[1]=x*n+T*a+w*c+b*g,e[2]=x*s+T*h+w*d+b*v,e[3]=x*r+T*l+w*f+b*m,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*o+w*u+b*p,e[5]=x*n+T*a+w*c+b*g,e[6]=x*s+T*h+w*d+b*v,e[7]=x*r+T*l+w*f+b*m,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*o+w*u+b*p,e[9]=x*n+T*a+w*c+b*g,e[10]=x*s+T*h+w*d+b*v,e[11]=x*r+T*l+w*f+b*m,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*o+w*u+b*p,e[13]=x*n+T*a+w*c+b*g,e[14]=x*s+T*h+w*d+b*v,e[15]=x*r+T*l+w*f+b*m,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},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){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},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,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=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],g=i[5],v=i[6],m=i[7],y=i[8],x=i[9],T=i[10],w=i[11],b=n*n*l+h,S=s*n*l+r*a,A=r*n*l-s*a,E=n*s*l-r*a,_=s*s*l+h,C=r*s*l+n*a,M=n*r*l+s*a,P=s*r*l-n*a,O=r*r*l+h;return i[0]=u*b+p*S+y*A,i[1]=c*b+g*S+x*A,i[2]=d*b+v*S+T*A,i[3]=f*b+m*S+w*A,i[4]=u*E+p*_+y*C,i[5]=c*E+g*_+x*C,i[6]=d*E+v*_+T*C,i[7]=f*E+m*_+w*C,i[8]=u*M+p*P+y*O,i[9]=c*M+g*P+x*O,i[10]=d*M+v*P+T*O,i[11]=f*M+m*P+w*O,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=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]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=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]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*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],o=e[2],a=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]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,m=o*h,y=o*l;return i[0]=1-(f+g),i[1]=c+y,i[2]=d-m,i[3]=0,i[4]=c-y,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+m,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,m=r*h;return e[0]=1-(d+p),e[1]=u+m,e[2]=c-v,e[3]=0,e[4]=u-m,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),m=h*(g*=v)-l*(p*=v),y=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(m*m+y*y+x*x))?(m*=v=1/v,y*=v,x*=v):(m=0,y=0,x=0);var T=p*x-g*y,w=g*m-f*x,b=f*y-p*m;return(v=Math.sqrt(T*T+w*w+b*b))?(T*=v=1/v,w*=v,b*=v):(T=0,w=0,b=0),n[0]=m,n[1]=T,n[2]=f,n[3]=0,n[4]=y,n[5]=w,n[6]=p,n[7]=0,n[8]=x,n[9]=b,n[10]=g,n[11]=0,n[12]=-(m*s+y*r+x*o),n[13]=-(T*s+w*r+b*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.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),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=i(0),s=i(182),r=i(328),o=new Int8Array([1,2,0]),a=new Float32Array([0,0,0]),h=new s(1,0,0),l=new s(0,1,0),u=new s,c=new r,d=new n({initialize:function(t,e,i,n){"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)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},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,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,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},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(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 n=c.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(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,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.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},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.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},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},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],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=i(332),s=i(27),r=i(34),o=i(176);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.CANVAS||e.renderType!==r.CANVAS&&!o.webGL){if(!o.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=r.CANVAS}else e.renderType=r.WEBGL;e.antialias||s.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=s.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||n.setCrisp(t.canvas),e.renderType!==r.HEADLESS&&(a=i(333),h=i(336),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(334),s=i(54),r=i(0),o=i(34),a=i(335),h=i(101),l=i(96),u=i(122),c=i(35),d=new r({initialize:function(t){this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.config={clearBeforeRender:t.config.clearBeforeRender,backgroundColor:t.config.backgroundColor,resolution:t.config.resolution,antialias:t.config.antialias,roundPixels:t.config.roundPixels},this.scaleMode=t.config.antialias?l.LINEAR:l.NEAREST,this.gameCanvas=t.canvas;var e={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d",e),this.currentContext=this.gameContext,this.blendModes=a(),this.currentScaleMode=0,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new c,this._tempMatrix2=new c,this._tempMatrix3=new c,this._tempMatrix4=new c,this.init()},init:function(){this.game.scale.on(h.RESIZE,this.onResize,this);var t=this.game.scale.baseSize;this.resize(t.width,t.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.scaleMode===l.NEAREST&&u.disable(this.gameContext)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),t.save(),this.drawCount=0},render:function(t,e,i,n){var r=e.list,o=r.length,a=n._cx,h=n._cy,l=n._cw,u=n._ch,c=n.renderToTexture?n.context:t.sys.context;c.save(),this.game.scene.customViewports&&(c.beginPath(),c.rect(a,h,l,u),c.clip()),this.currentContext=c;var d=n.mask;d&&d.preRenderCanvas(this,null,n._maskCamera),n.transparent||(c.fillStyle=n.backgroundColor.rgba,c.fillRect(a,h,l,u)),c.globalAlpha=n.alpha,c.globalCompositeOperation="source-over",this.drawCount+=r.length,n.renderToTexture&&n.emit(s.PRE_RENDER,n),n.matrix.copyToContext(c);for(var f=0;f=0?y=-(y+d):y<0&&(y=Math.abs(y)-d)),t.flipY&&(x>=0?x=-(x+f):x<0&&(x=Math.abs(x)-f))}var w=1,b=1;t.flipX&&(p||(y+=-e.realWidth+2*v),w=-1),t.flipY&&(p||(x+=-e.realHeight+2*m),b=-1),a.applyITRS(t.x,t.y,t.rotation,t.scaleX*w,t.scaleY*b),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,y,x,d/g,f/g),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=d},function(t,e,i){var n=i(27),s=i(36),r=i(1);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=r(e,"width",t.width),c=r(e,"height",t.height);if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new s(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=n.createWebGL(this,u,c);f.getContext("2d").drawImage(t,h,l,u,c,0,0,u,c);var p=new Image;p.onerror=function(){i.call(null),n.remove(f)},p.onload=function(){i.call(null,p),n.remove(f)},p.src=f.toDataURL(o,a)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(o,a)}}},function(t,e,i){var n=i(42),s=i(310);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t[n.ERASE]="destination-out",t[n.SOURCE_IN]="source-in",t[n.SOURCE_OUT]="source-out",t[n.SOURCE_ATOP]="source-atop",t[n.DESTINATION_OVER]="destination-over",t[n.DESTINATION_IN]="destination-in",t[n.DESTINATION_OUT]="destination-out",t[n.DESTINATION_ATOP]="destination-atop",t[n.LIGHTER]="lighter",t[n.COPY]="copy",t[n.XOR]="xor",t}},function(t,e,i){var n=i(121),s=i(54),r=i(0),o=i(34),a=i(22),h=i(126),l=i(2),u=i(101),c=i(84),d=i(127),f=i(35),p=i(10),g=i(337),v=i(338),m=i(339),y=i(185),x=new r({initialize:function(t){var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialias,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,resolution:e.resolution,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights},this.game=t,this.type=o.WEBGL,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.nativeTextures=[],this.contextLost=!1,this.pipelines=null,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTextureUnit=0,this.currentTextures=new Array(16),this.currentFramebuffer=null,this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=l,this.contextRestoredHandler=l,this.gl=null,this.supportedExtensions=null,this.extensions={},this.glFormats=[],this.compression={ETC1:!1,PVRTC:!1,S3TC:!1},this.drawingBufferHeight=0,this.blankTexture=null,this.defaultCamera=new n(0,0,0,0),this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this._tempMatrix4=new f,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.init(this.config)},init:function(t){var e,i=this.game,n=this.canvas,s=t.backgroundColor;if(!(e=i.config.context?i.config.context:n.getContext("webgl",t.contextCreation)||n.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var r=this;this.contextLostHandler=function(t){r.contextLost=!0,r.game.events.emit(a.CONTEXT_LOST,r),t.preventDefault()},this.contextRestoredHandler=function(){r.contextLost=!1,r.init(r.config),r.game.events.emit(a.CONTEXT_RESTORED,r)},n.addEventListener("webglcontextlost",this.contextLostHandler,!1),n.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var h=0;h<=27;h++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var l=e.getSupportedExtensions();t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE));var u="WEBGL_compressed_texture_",c="WEBKIT_"+u;this.compression.ETC1=e.getExtension(u+"etc1")||e.getExtension(c+"etc1"),this.compression.PVRTC=e.getExtension(u+"pvrtc")||e.getExtension(c+"pvrtc"),this.compression.S3TC=e.getExtension(u+"s3tc")||e.getExtension(c+"s3tc"),this.supportedExtensions=l,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(s.redGL,s.greenGL,s.blueGL,s.alphaGL);for(var f=0;f0&&n>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==n}a&&(this.flush(),r.scissor(t,s-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},rebindPipeline:function(t){var e=this.gl;e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),this.hasActiveStencilMask()?e.clear(e.DEPTH_BUFFER_BIT):(e.disable(e.STENCIL_TEST),e.clear(e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)),e.viewport(0,0,this.width,this.height),this.setBlendMode(0,!0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.blankTexture.glTexture),this.currentActiveTextureUnit=0,this.currentTextures[0]=this.blankTexture.glTexture,this.currentPipeline=t,this.currentPipeline.bind(),this.currentPipeline.onBind()},clearPipeline:function(){this.flush(),this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.setBlendMode(0,!0)},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(n.equation),n.func.length>2?i.blendFuncSeparate(n.func[0],n.func[1],n.func[2],n.func[3]):i.blendFunc(n.func[0],n.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e,i){void 0===i&&(i=!0);var n=this.gl;return t!==this.currentTextures[e]&&(i&&this.flush(),this.currentActiveTextureUnit!==e&&(n.activeTexture(n.TEXTURE0+e),this.currentActiveTextureUnit=e),n.bindTexture(n.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.width,s=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(n=t.renderTexture.width,s=t.renderTexture.height):this.flush(),i.bindFramebuffer(i.FRAMEBUFFER,t),i.viewport(0,0,n,s),e&&(t?(this.drawingBufferHeight=s,this.pushScissor(0,0,n,s)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,r=s.NEAREST,a=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,h(e,i)&&(a=s.REPEAT),n===o.ScaleModes.LINEAR&&this.config.antialias&&(r=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,r,r,a,a,s.RGBA,t):this.createTexture2D(0,r,r,a,a,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&c(this.nativeTextures,e),this.gl.deleteTexture(t),this.currentTextures[0]!==t||this.game.pendingDestroy||this.setBlankTexture(!0),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,r=t._ch,o=this.pipelines.TextureTintPipeline,a=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-r),this.setFramebuffer(t.framebuffer);var h=this.gl;h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT),o.projOrtho(e,n+e,i,r+i,-1e3,1e3),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n+e,r+i,p.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL),t.emit(s.PRE_RENDER,t)}else this.pushScissor(e,i,n,r),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n,r,p.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,p.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,p.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit(s.POST_RENDER,t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=p.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera))},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.pipelines;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var i=this.config.backgroundColor;t.clearColor(i.redGL,i.greenGL,i.blueGL,i.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}for(var n in t.enable(t.SCISSOR_TEST),e)e[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,r=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);if(this.preRenderCamera(n),0===r)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(n);this.currentType="";for(var l=this.currentMask,u=0;u0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step()},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.max(16+t.lastTime-i,0);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(22);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)},!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var n=i(346),s=i(27),r=i(5);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",n),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*a)),p=Math.floor(Math.abs(e.length*h));i||(i=s.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var g=i.getContext("2d");u&&g.clearRect(0,0,f,p),c&&c(i,g);for(var v=0;vi;)n-=i;ni.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e,i){var n=i(124);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e,i){var n=i(187);t.exports=function(t,e){var i=window.screen,s=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);if(s&&"string"==typeof s.type)return s.type;if("string"==typeof s)return s;if(i)return i.height>i.width?n.PORTRAIT:n.LANDSCAPE;if("number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?n.PORTRAIT:n.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return n.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return n.LANDSCAPE}return e>t?n.PORTRAIT:n.LANDSCAPE}},function(t,e){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},function(t,e){t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},function(t,e){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},function(t,e){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},function(t,e){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(0),s=i(189),r=i(9),o=i(55),a=i(22),h=i(365),l=i(366),u=i(367),c=i(368),d=i(35),f=i(326),p=new n({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var n=new u(this,i);n.smoothFactor=e.inputSmoothFactor,this.pointers.push(n)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(o.MANAGER_BOOT),this.game.events.on(a.PRE_RENDER,this.preRender,this),this.game.events.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var n=0;n10&&(t=10-this.pointersTotal);for(var i=0;i-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.useQueue||t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},function(t,e,i){var n=i(0),s=i(176),r=i(55),o=i(0),a=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.capture=t.inputMouseCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},requestPointerLock:function(){if(s.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){s.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onMouseMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseMove(e),t.capture&&e.preventDefault())},this.onMouseDown=function(n){i&&window.focus(),!n.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseDown(n),t.capture&&n.target===e&&n.preventDefault())},this.onMouseDownWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseDown(i)},this.onMouseUp=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseUp(i),t.capture&&i.target===e&&i.preventDefault())},this.onMouseUpWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseUp(i)},this.onMouseOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onMouseOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)},this.onMouseWheel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onMouseWheel(e)};var n=this.target;if(n){var r={passive:!0},o={passive:!1};n.addEventListener("mousemove",this.onMouseMove,this.capture?o:r),n.addEventListener("mousedown",this.onMouseDown,this.capture?o:r),n.addEventListener("mouseup",this.onMouseUp,this.capture?o:r),n.addEventListener("mouseover",this.onMouseOver,this.capture?o:r),n.addEventListener("mouseout",this.onMouseOut,this.capture?o:r),n.addEventListener("wheel",this.onMouseWheel,this.capture?o:r),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o)),s.pointerLock&&(this.pointerLockChange=function(e){var i=t.target;t.locked=document.pointerLockElement===i||document.mozPointerLockElement===i||document.webkitPointerLockElement===i,t.manager.onPointerLockChange(e)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&(window.removeEventListener("mousedown",this.onMouseDownWindow),window.removeEventListener("mouseup",this.onMouseUpWindow)),s.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},function(t,e,i){var n=i(311),s=i(0),r=i(63),o=i(178),a=i(320),h=i(3),l=new s({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=this.x,i=this.y;1!==t.resolution&&(e+=t._x,i+=t._y);var n=t.getWorldPoint(e,i);return this.worldX=n.x,this.worldY=n.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,s=this.midPoint.y;if(t!==i||e!==s){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,s,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=n(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp),this.isDown=!1,this.wasTouch=!1},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp),this.isDown=!0,this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,s=this.position.x,r=this.position.y,o=0;o0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,r=t.resolution,o=t.zoom,a=t.autoRound;if("string"==typeof e){var h=this.parentSize.width;0===h&&(h=window.innerWidth);var l=parseInt(e,10)/100;e=Math.floor(h*l)}if("string"==typeof i){var c=this.parentSize.height;0===c&&(c=window.innerHeight);var d=parseInt(i,10)/100;i=Math.floor(c*d)}this.resolution=1,this.scaleMode=s,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),o===n.ZOOM.MAX_ZOOM&&(o=this.getMaxZoom()),this.zoom=o,1!==o&&(this._resetZoom=!0),this.baseSize.setSize(e*r,i*r),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*o,t.minHeight*o),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*o,t.maxHeight*o),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==n.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=this.resolution,n=e.width*i,s=e.height*i;return(t.width!==n||t.height!==s)&&(t.setSize(n,s),!0)},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e(t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound,n=this.resolution;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t,e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,n=this.resolution,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,o=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i*n,e*i*n),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,h=t*i,l=e*i;return s&&(h=Math.floor(h),l=Math.floor(l)),h===t&&l===e||(a.width=h+"px",a.height=l+"px"),this.refresh(r,o)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var n=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=n.marginLeft,s.marginTop=n.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,this.resolution,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===n.SCALE_MODE.NONE?(this.displaySize.setSize(s*o*1,r*o*1),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===n.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(1*this.displaySize.width,1*this.displaySize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=p(this.parentSize.width,this.gameSize.width,0,!0),e=p(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==n.CENTER.NO_CENTER){var e=this.canvas,i=e.style,s=e.getBoundingClientRect(),r=s.width,o=s.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===n.CENTER.CENTER_HORIZONTALLY?h=0:t===n.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();this._requestedFullscreenChange=!0,"undefined"!=typeof Promise?e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT).then(this.fullscreenSuccessHandler.bind(this)).catch(this.fullscreenErrorHandler.bind(this)):i[e.request](t).then(this.fullscreenSuccessHandler.bind(this)).catch(this.fullscreenErrorHandler.bind(this)):(e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t),e.active?this.fullscreenSuccessHandler():this.fullscreenErrorHandler())}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&(this._requestedFullscreenChange=!0,document[t.cancel]()),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach(function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){this._requestedFullscreenChange||this.stopFullscreen(),this._requestedFullscreenChange=!1},onFullScreenError:function(){this.removeFullscreenTarget()},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===n.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===n.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=v},function(t,e,i){var n=i(24),s=i(0),r=i(102),o=i(3),a=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio0&&(t=(e=r(e,n.y))*this.aspectRatio)):(i&&this.aspectRatios)&&(t=(e=r(e,n.y))*this.aspectRatio,n.x>0&&(e=(t=r(t,n.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},function(t,e,i){var n=i(0),s=i(131),r=i(19),o=i(22),a=i(5),h=i(86),l=i(2),u=i(373),c=i(190),d=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit(r.TRANSITION_INIT,n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=r.x&&t=r.y&&e=r.x&&t=r.y&&e-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=n,o.data[2]=s,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,n,s,r,o){return void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,n,s,r,o),this},getData:function(t,e,i,n){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),n=s(n,1,this.height-e),this.context.getImageData(t,e,i,n)},getPixel:function(t,e,i){i||(i=new r);var n=this.getIndex(t,e);if(n>-1){var s=this.data,o=s[n+0],a=s[n+1],h=s[n+2],l=s[n+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=s(t,0,this.width),a=s(t+i,0,this.width),h=s(e,0,this.height),l=s(e+n,0,this.height),u=new r,c=[],d=h;d0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=o},function(t,e,i){var n=i(132),s=i(0),r=i(9),o=i(383),a=i(2),h=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){var n=i(133),s=i(0),r=i(9),o=i(15),a=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!1},updateMarker:function(t){return!1},removeMarker:function(t){return null},play:function(t,e){return!1},pause:function(){return!1},resume:function(){return!1},stop:function(){return!1},destroy:function(){this.manager.remove(this),n.prototype.destroy.call(this)}});t.exports=a},function(t,e,i){var n=i(385),s=i(132),r=i(0),o=i(71),a=i(386),h=new r({Extends:s,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),s.call(this,t),this.locked&&this.unlock()},createAudioContext:function(t){var e=t.config.audio;return e&&e.context?(e.context.resume(),e.context):new AudioContext},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var s=this.game.cache.audio,r=i.length,a=0;a>4,u[h++]=(15&i)<<4|s>>2,u[h++]=(3&s)<<6|63&r;return l}},function(t,e,i){var n=i(133),s=i(0),r=i(71),o=new s({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),this.audioBuffer?(this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime1e3)return console.warn("Switch Game data too long. Max 1000 chars."),this;var i=this;return FBInstant.switchGameAsync(t,e).then(function(){i.emit("switchgame",t)}).catch(function(t){i.emit("switchgamefail",t)}),this},createShortcut:function(){var t=this;return FBInstant.canCreateShortcutAsync().then(function(e){e&&FBInstant.createShortcutAsync().then(function(){t.emit("shortcutcreated")}).catch(function(e){t.emit("shortcutfailed",e)})}),this},quit:function(){FBInstant.quit()},log:function(t,e,i){return this.checkAPI("logEvent")?(void 0===i&&(i={}),t.length>=2&&t.length<=40&&FBInstant.logEvent(t,parseFloat(e),i),this):this},preloadAds:function(t){if(!this.checkAPI("getInterstitialAdAsync"))return this;var e;Array.isArray(t)||(t=[t]);var i=this,s=0;for(e=0;e=3)return console.warn("Too many AdInstances. Show an ad before loading more"),this;for(e=0;e=3)return console.warn("Too many AdInstances. Show an ad before loading more"),this;for(e=0;e-1;r--)n[s][r]=t[r][s]}return n}},function(t,e){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,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=n);o>r;){if(o-r>600){var h=o-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(o,Math.floor(e+(h-l)*c/h+d));s(t,e,f,p,a)}var g=t[e],v=r,m=o;for(i(t,r,e),a(t[o],g)>0&&i(t,r,o);v0;)m--}0===a(t[r],g)?i(t,r,m):i(t,++m,o),m<=e&&(r=m+1),e<=m&&(o=m-1)}};t.exports=s},function(t,e,i){var n=i(5),s=i(120),r=function(t,e,i){for(var n=[],s=0;s0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(11);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),o=Math.max(t.right,e.right)-s,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(s,r,o,a)}},function(t,e,i){var n=i(0),s=i(12),r=i(956),o=i(13),a=i(7),h=i(188),l=i(327),u=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Origin,s.ScrollFactor,s.Transform,s.Visible,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new l,this.rotate3dAngle="deg",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof n?"#"===n[0]?this.setElement(n.substr(1),s,r):this.createElement(n,s,r):n&&this.setElement(n,s,r)},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e>>16,y=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+m+","+y+","+x+","+d+")",c.lineWidth=v,T+=3;break;case n.FILL_STYLE:g=l[T+1],f=l[T+2],m=(16711680&g)>>>16,y=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+m+","+y+","+x+","+f+")",T+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[T+1],l[T+2],l[T+3],l[T+4]):c.fillRect(l[T+1],l[T+2],l[T+3],l[T+4]),T+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.fill(),T+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.stroke(),T+=6;break;case n.LINE_TO:c.lineTo(l[T+1],l[T+2]),T+=2;break;case n.MOVE_TO:c.moveTo(l[T+1],l[T+2]),T+=2;break;case n.LINE_FX_TO:c.lineTo(l[T+1],l[T+2]),T+=5;break;case n.MOVE_FX_TO:c.moveTo(l[T+1],l[T+2]),T+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[T+1],l[T+2]),T+=2;break;case n.SCALE:c.scale(l[T+1],l[T+2]),T+=2;break;case n.ROTATE:c.rotate(l[T+1]),T+=1;break;case n.GRADIENT_FILL_STYLE:T+=5;break;case n.GRADIENT_LINE_STYLE:T+=6;break;case n.SET_TEXTURE:T+=2}c.restore()}}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(42),s=i(0),r=i(12),o=i(403),a=i(404),h=i(973),l=i(1),u=i(195),c=i(405),d=i(90),f=i(401),p=i(406),g=i(11),v=i(136),m=i(3),y=i(62),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];s.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===n&&(n=!1),void 0===s&&(s=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=s,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;i0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e,i){var n=i(0),s=i(996),r=i(69),o=i(11),a=i(32),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;sc+v)){var m=g.getPoint((u-c)/v);o.push(m);break}c+=v}return o}},function(t,e,i){var n=i(61),s=i(60);t.exports=function(t){for(var e=t.points,i=0,r=0;r0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(0),s=i(11),r=i(32),o=i(1017),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new s(0,0,n,o)),this.setPosition(e,i),this.setSize(n,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(1020),s=i(0),r=i(69),o=i(32),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(61),s=i(4);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e){t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=t,o=0;o0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],o):h=new s(t,e,i,a[0],a[1],a[2],o),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=o},function(t,e,i){var n=i(52),s=i(15),r={Circle:i(1079),Ellipse:i(1089),Intersects:i(430),Line:i(1108),Point:i(1129),Polygon:i(1143),Rectangle:i(445),Triangle:i(1173)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={CircleToCircle:i(431),CircleToRectangle:i(432),GetCircleToCircle:i(1099),GetCircleToRectangle:i(1100),GetLineToCircle:i(211),GetLineToRectangle:i(213),GetRectangleIntersection:i(1101),GetRectangleToRectangle:i(1102),GetRectangleToTriangle:i(1103),GetTriangleToCircle:i(1104),GetTriangleToLine:i(437),GetTriangleToTriangle:i(1105),LineToCircle:i(212),LineToLine:i(92),LineToRectangle:i(433),PointToLine:i(441),PointToLineSegment:i(1106),RectangleToRectangle:i(139),RectangleToTriangle:i(434),RectangleToValues:i(1107),TriangleToCircle:i(436),TriangleToLine:i(438),TriangleToTriangle:i(439)}},function(t,e,i){var n=i(63);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(92),s=i(53),r=i(214),o=i(435);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e,i){var n=i(212),s=i(91);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=1);var n=e.x1,s=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-n)*(r-n)+(o-s)*(o-s);if(0===l)return!1;var u=((a-n)*(r-n)+(h-s)*(o-s))/l;if(u<0)return Math.sqrt((n-a)*(n-a)+(s-h)*(s-h))<=i;if(u>=0&&u<=1){var c=((s-h)*(r-n)-(n-a)*(o-s))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},function(t,e,i){var n=i(21),s=i(62),r=i(93);t.exports=function(t){var e=r(t)-n.TAU;return s(e,-Math.PI,Math.PI)}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e,i){var n=i(11);n.Area=i(1148),n.Ceil=i(1149),n.CeilAll=i(1150),n.CenterOn=i(174),n.Clone=i(1151),n.Contains=i(53),n.ContainsPoint=i(1152),n.ContainsRect=i(446),n.CopyFrom=i(1153),n.Decompose=i(435),n.Equals=i(1154),n.FitInside=i(1155),n.FitOutside=i(1156),n.Floor=i(1157),n.FloorAll=i(1158),n.FromPoints=i(186),n.GetAspectRatio=i(216),n.GetCenter=i(1159),n.GetPoint=i(158),n.GetPoints=i(268),n.GetSize=i(1160),n.Inflate=i(1161),n.Intersection=i(1162),n.MarchingAnts=i(279),n.MergePoints=i(1163),n.MergeRect=i(1164),n.MergeXY=i(1165),n.Offset=i(1166),n.OffsetPoint=i(1167),n.Overlaps=i(1168),n.Perimeter=i(117),n.PerimeterPoint=i(1169),n.Random=i(161),n.RandomOutside=i(1170),n.SameDimensions=i(1171),n.Scale=i(1172),n.Union=i(392),t.exports=n},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var n=i(451),s=i(452),r=i(0),o=i(9),a=i(3),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=r;for(i=0;i=r;)this._elapsed-=r,this.step(s)}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(n=(i=h.entries).length,t=0;t-1&&p>g&&(t.velocity.normalize().scale(g),p=g),t.speed=p},separate:function(t,e,i,n,s){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,s);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.ya.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,c=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)r.right&&(s=h(o.x,o.y,r.right,r.y)-o.radius):o.y>r.bottom&&(o.xr.right&&(s=h(o.x,o.y,r.right,r.bottom)-o.radius)),s*=-1}else s=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s&&(t.onOverlap||e.onOverlap)&&this.emit(u.OVERLAP,t.gameObject,e.gameObject,t,e),0!==s;var a=t.position.x-e.position.x,l=t.position.y-e.position.y,c=Math.sqrt(Math.pow(a,2)+Math.pow(l,2)),d=(e.position.x-t.position.x)/c||0,f=(e.position.y-t.position.y)/c||0,v=2*(t.velocity.x*d+t.velocity.y*f-e.velocity.x*d-e.velocity.y*f)/(t.mass+e.mass);t.immovable||(t.velocity.x=(t.velocity.x-v*t.mass*d)*t.bounce.x,t.velocity.y=(t.velocity.y-v*t.mass*f)*t.bounce.y),e.immovable||(e.velocity.x=(e.velocity.x+v*e.mass*d)*e.bounce.x,e.velocity.y=(e.velocity.y+v*e.mass*f)*e.bounce.y);var m=e.velocity.x-t.velocity.x,y=e.velocity.y-t.velocity.y,x=Math.atan2(y,m),T=this._frameTime;return t.immovable||(t.x+=t.velocity.x*T-s*Math.cos(x),t.y+=t.velocity.y*T-s*Math.sin(x)),e.immovable||(e.x+=e.velocity.x*T+s*Math.cos(x),e.y+=e.velocity.y*T+s*Math.sin(x)),(t.onCollide||e.onCollide)&&this.emit(u.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o,a;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f=e.getTilesWithinWorldXY(a,h,l,u);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,n,s,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,s,r,o){for(var a,h,l=t.body,c={left:0,right:0,top:0,bottom:0},d=!1,f=0;f0&&t>i&&(t=i)),0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),this.gameObject.x+=t,this.gameObject.y+=e,this._reset=!0}t<0?this.facing=r.FACING_LEFT:t>0&&(this.facing=r.FACING_RIGHT),e<0?this.facing=r.FACING_UP:e>0&&(this.facing=r.FACING_DOWN),this._dx=t,this._dy=e,this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,s=void 0!==i;return(n||s)&&(this.worldBounce||(this.worldBounce=new u),n&&(this.worldBounce.x=e),s&&(this.worldBounce.y=i)),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(57);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=i(57);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,m,y;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,m-g)*Math.max(0,y-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(51),s=i(0),r=i(57),o=i(53),a=i(3),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e,i){var n=i(0),s=i(109),r=i(1280),o=i(110),a=i(1281),h=new n({initialize:function(t,e,i,n,r){void 0===n&&(n=16),void 0===r&&(r=n),this.world=t,this.gameObject=null,this.enabled=!0,this.parent,this.id=t.getNextID(),this.name="",this.size={x:n,y:r},this.offset={x:0,y:0},this.pos={x:e,y:i},this.last={x:e,y:i},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:t.defaults.maxVelocityX,y:t.defaults.maxVelocityY},this.standing=!1,this.gravityFactor=t.defaults.gravityFactor,this.bounciness=t.defaults.bounciness,this.minBounceVelocity=t.defaults.minBounceVelocity,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER,this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.updateCallback,this.slopeStanding={min:.767944870877505,max:2.3736477827122884}},reset:function(t,e){this.pos={x:t,y:e},this.last={x:t,y:e},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:100,y:100},this.standing=!1,this.gravityFactor=1,this.bounciness=0,this.minBounceVelocity=40,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER},update:function(t){var e=this.pos;this.last.x=e.x,this.last.y=e.y,this.vel.y+=this.world.gravity*t*this.gravityFactor,this.vel.x=r(t,this.vel.x,this.accel.x,this.friction.x,this.maxVel.x),this.vel.y=r(t,this.vel.y,this.accel.y,this.friction.y,this.maxVel.y);var i=this.vel.x*t,n=this.vel.y*t,s=this.world.collisionMap.trace(e.x,e.y,i,n,this.size.x,this.size.y);this.handleMovementTrace(s)&&a(this,s);var o=this.gameObject;o&&(o.x=e.x-this.offset.x+o.displayOriginX*o.scaleX,o.y=e.y-this.offset.y+o.displayOriginY*o.scaleY),this.updateCallback&&this.updateCallback(this)},drawDebug:function(t){var e=this.pos;if(this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.size.x,this.size.y)),this.debugShowVelocity){var i=e.x+this.size.x/2,n=e.y+this.size.y/2;t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.vel.x,n+this.vel.y)}},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},skipHash:function(){return!this.enabled||0===this.type&&0===this.checkAgainst&&0===this.collides},touches:function(t){return!(this.pos.x>=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=h},function(t,e,i){var n=i(0),s=i(1285),r=new n({initialize:function(t,e){void 0===t&&(t=32),this.tilesize=t,this.data=Array.isArray(e)?e:[],this.width=Array.isArray(e)?e[0].length:0,this.height=Array.isArray(e)?e.length:0,this.lastSlope=55,this.tiledef=s},trace:function(t,e,i,n,s,r){var o={collision:{x:!1,y:!1,slope:!1},pos:{x:t+i,y:e+n},tile:{x:0,y:0}};if(!this.data)return o;var a=Math.ceil(Math.max(Math.abs(i),Math.abs(n))/this.tilesize);if(a>1)for(var h=i/a,l=n/a,u=0;u0?r:0,m=n<0?f:0,y=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var T=Math.floor((e+v)/f);if((l>0||u===T||T<0||T>=p)&&(T=-1),u>=0&&u1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,T,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+m,e=t.pos.x,a=0;break}}if(s){var w=s>0?o:0,b=s<0?f:0,S=Math.max(Math.floor(t.pos.x/f),0),A=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+w)/f);var E=Math.floor((i+w)/f);if((l>0||c===E||E<0||E>=g)&&(E=-1),c>=0&&c1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,E));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-w+b;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],m=i+s+(g<0?o:0)-d,y=n+r+(p>0?a:0)-f;if(p*y-g*m>0){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),T=g/x,w=-p/x,b=m*T+y*w,S=T*b,A=w*b;return S*S+A*A>=s*s+r*r?v||p*(y-r)-g*(m-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-A,t.collision.slope={x:p,y:g,nx:T,ny:w},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),s=i(477),r=i(478),o=i(479),a=new n({initialize:function(t){this.world=t,this.sys=t.scene.sys},body:function(t,e,i,n){return new s(this.world,t,e,i,n)},existing:function(t){var e=t.x-t.frame.centerX,i=t.y-t.frame.centerY,n=t.width,s=t.height;return t.body=this.world.create(e,i,n,s),t.body.parent=t,t.body.gameObject=t,t},image:function(t,e,i,n){var s=new r(this.world,t,e,i,n);return this.sys.displayList.add(s),s},sprite:function(t,e,i,n){var s=new o(this.world,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),s},destroy:function(){this.world=null,this.sys=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(225),r=new n({Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){this.body=t.create(e,i,n,s),this.body.parent=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=r},function(t,e,i){var n=i(0),s=i(225),r=i(88),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(0),s=i(225),r=i(64),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(474),s=i(0),r=i(109),o=i(475),a=i(9),h=i(224),l=i(1),u=i(90),c=i(107),d=i(1299),f=i(33),p=i(110),g=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.bodies=new c,this.gravity=l(e,"gravity",0),this.cellSize=l(e,"cellSize",64),this.collisionMap=new o,this.timeScale=l(e,"timeScale",1),this.maxStep=l(e,"maxStep",.05),this.enabled=!0,this.drawDebug=l(e,"debug",!1),this.debugGraphic;var i=l(e,"maxVelocity",100);if(this.defaults={debugShowBody:l(e,"debugShowBody",!0),debugShowVelocity:l(e,"debugShowVelocity",!0),bodyDebugColor:l(e,"debugBodyColor",16711935),velocityDebugColor:l(e,"debugVelocityColor",65280),maxVelocityX:l(e,"maxVelocityX",i),maxVelocityY:l(e,"maxVelocityY",i),minBounceVelocity:l(e,"minBounceVelocity",40),gravityFactor:l(e,"gravityFactor",1),bounciness:l(e,"bounciness",0)},this.walls={left:null,right:null,top:null,bottom:null},this.delta=0,this._lastId=0,l(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var s=l(n,"x",0),r=l(n,"y",0),h=l(n,"width",t.sys.scale.width),u=l(n,"height",t.sys.scale.height),d=l(n,"thickness",64),f=l(n,"left",!0),p=l(n,"right",!0),g=l(n,"top",!0),v=l(n,"bottom",!0);this.setBounds(s,r,h,u,d,f,p,g,v)}}this.drawDebug&&this.createDebugGraphic()},setCollisionMap:function(t,e){if("string"==typeof t){var i=this.scene.cache.tilemap.get(t);if(!i||i.format!==f.WELTMEISTER)return console.warn("The specified key does not correspond to a Weltmeister tilemap: "+t),null;for(var n,s=i.data.layer,r=0;rr.ACTIVE&&d(this,t,e))},setCollidesNever:function(t){for(var e=0;e=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function r(t,e,i){return s(t,e,i)>0}function o(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function h(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){var i=[],n=[],s=[],r=[];var o=Number.MAX_VALUE;for(var a=0;a0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;su)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LE&&(E+=e.length),A=Number.MAX_VALUE,E<_)return i;for(var D=_;D<=E;++D)o(f(O,L-1),f(O,L),f(O,D))&&h(f(O,L+1),f(O,L),f(O,D))&&(S=d(f(O,L),f(O,D)))3&&n>=0;--n)c(f(t,n-1),f(t,n),f(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var n=t[i],s=i-1;s>=0;--s)S(n,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,n=1;ni[e][0])&&(e=n);return!r(f(t,e-1),f(t,e),f(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var l=[],u=[];function c(t,e,i,n){if(n){var r=l,o=u;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*c))g&&(g=y),a.translate(m,{x:.5*x,y:.5*y}),c=m.bounds.max.x+r,s.addBody(u,m),l=m,f+=1}else c+=r}d+=g+o,c=t}return u},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),n&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,n,o,l,u,c)})},n.newtonsCradle=function(t,e,i,n,o){for(var a=s.create({label:"Newtons Cradle"}),l=0;lu.bounds.max.x||p.bounds.max.yu.bounds.max.y)){var g=n._getRegion(t,p);if(!p.region||g.id!==p.region.id||s){f.broadphaseTests+=1,p.region&&!s||(p.region=g);var v=n._regionUnion(g,p.region);for(o=v.startCol;o<=v.endCol;o++)for(a=v.startRow;a<=v.endRow;a++){h=c[l=n._getBucketId(o,a)];var m=o>=g.startCol&&o<=g.endCol&&a>=g.startRow&&a<=g.endRow,y=o>=p.region.startCol&&o<=p.region.endCol&&a>=p.region.startRow&&a<=p.region.endRow;!m&&y&&y&&h&&n._bucketRemoveBody(t,h,p),(p.region===g||m&&!y||s)&&(h||(h=n._createBucket(c,l)),n._bucketAddBody(t,h,p))}p.region=g,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),s=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,s,r,o)},n._getRegion=function(t,e){var i=e.bounds,s=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(s,r,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n0?n.push(i):delete t.pairs[e[s]];return n}},function(t,e,i){var n={};t.exports=n;var s=i(145),r=i(17);n._pairMaxIdleLife=1e3,n.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;an._pairMaxIdleLife&&l.push(o);for(o=0;of.friction*f.frictionStatic*F*i&&(I=R,k=o.clamp(f.friction*L*i,-I,I));var B=r.cross(A,m),N=r.cross(E,m),Y=T/(g.inverseMass+v.inverseMass+g.inverseInertia*B*B+v.inverseInertia*N*N);if(D*=Y,k*=Y,P<0&&P*P>n._restingThresh*i)b.normalImpulse=0;else{var X=b.normalImpulse;b.normalImpulse=Math.min(b.normalImpulse+D,0),D=b.normalImpulse-X}if(O*O>n._restingThreshTangent*i)b.tangentImpulse=0;else{var z=b.tangentImpulse;b.tangentImpulse=o.clamp(b.tangentImpulse+k,-I,I),k=b.tangentImpulse-z}s.x=m.x*D+y.x*k,s.y=m.y*D+y.y*k,g.isStatic||g.isSleeping||(g.positionPrev.x+=s.x*g.inverseMass,g.positionPrev.y+=s.y*g.inverseMass,g.anglePrev+=r.cross(A,s)*g.inverseInertia),v.isStatic||v.isSleeping||(v.positionPrev.x-=s.x*v.inverseMass,v.positionPrev.y-=s.y*v.inverseMass,v.anglePrev-=r.cross(E,s)*v.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var s=i(233),r=i(111),o=i(490),a=i(489),h=i(1330),l=i(488),u=i(94),c=i(76),d=i(95),f=i(17),p=i(25);n.create=function(t,e){e=f.isElement(t)?e:t,t=f.isElement(t)?t:null,e=e||{},(t||e.render)&&f.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:l}},n=f.extend(i,e);if(t||n.render){var r={element:t,controller:Render};n.render=f.extend(r,n.render)}return n.render&&n.render.controller&&(n.render=n.render.controller.create(n.render)),n.render&&(n.render.engine=n),n.world=e.world||s.create(n.world),n.pairs=a.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n.metrics=h.create(n.metrics),n},n.update=function(t,e,i){e=e||1e3/60,i=i||1;var s,l=t.world,f=t.timing,p=t.broadphase,g=[];f.timestamp+=e*f.timeScale;var v={timestamp:f.timestamp};u.trigger(t,"beforeUpdate",v);var m=c.allBodies(l),y=c.allConstraints(l);for(h.reset(t.metrics),t.enableSleeping&&r.update(m,f.timeScale),n._bodiesApplyGravity(m,l.gravity),n._bodiesUpdate(m,e,f.timeScale,i,l.bounds),d.preSolveAll(m),s=0;s0&&u.trigger(t,"collisionStart",{pairs:T.collisionStart}),o.preSolvePosition(T.list),s=0;s0&&u.trigger(t,"collisionActive",{pairs:T.collisionActive}),T.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:T.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(m),u.trigger(t,"afterUpdate",v),t},n.merge=function(t,e){if(f.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=c.allBodies(t.world),s=0;s0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_START,e,i,n)}),p.on(e,"collisionActive",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_ACTIVE,e,i,n)}),p.on(e,"collisionEnd",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_END,e,i,n)})},setBounds:function(t,e,i,n,s,r,o,a,h){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),void 0===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e-s,s,n+2*s),this.updateWall(o,"right",t+i,e-s,s,n+2*s),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?(o&&v.remove(this.localWorld,o),i+=s/2,n+=r/2,this.walls[e]=this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&v.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,s,r){var o=n.rectangle(t,e,i,s,r);return v.add(this.localWorld,o),o},add:function(t){return v.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return a.remove(this.localWorld,i,e),this},removeConstraint:function(t,e){return a.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i1?1:0;r1?1:0;s-1}return!1}},function(t,e,i){var n=i(78),s=i(112),r=i(234);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!1),void 0===o&&(o=!0),!s(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new n(a,-1,t,e,h.width,h.height),o&&h&&h.collides&&r(t,e,a),h):null}},function(t,e,i){var n=i(33),s=i(237),r=i(498),o=i(499),a=i(510);t.exports=function(t,e,i,h,l,u){var c;switch(e){case n.ARRAY_2D:c=s(t,i,h,l,u);break;case n.CSV:c=r(t,i,h,l,u);break;case n.TILED_JSON:c=o(t,i,u);break;case n.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},function(t,e,i){var n=i(33),s=i(237);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map(function(t){return t.split(",")}),h=s(t,a,i,r,o);return h.format=n.CSV,h}},function(t,e,i){var n=i(33),s=i(114),r=i(500),o=i(502),a=i(503),h=i(506),l=i(508),u=i(509);t.exports=function(t,e,i){if("orthogonal"!==e.orientation)return console.warn("Only orthogonal map types are supported in this version of Phaser"),null;var c=new s({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:e.orientation,format:n.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});c.layers=r(e,i),c.images=o(e);var d=a(e);return c.tilesets=d.tilesets,c.imageCollections=d.imageCollections,c.objects=h(e),c.tiles=l(c),u(c),c}},function(t,e,i){var n=i(501),s=i(1),r=i(113),o=i(238),a=i(78);t.exports=function(t,e){for(var i=s(t,"infinite",!1),h=[],l=0;l0?((f=new a(c,d.gid,C,M,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,g[M][C]=f):(p=e?null:new a(c,-1,C,M,t.tilewidth,t.tileheight),g[M][C]=p),++v===w.width&&(A++,v=0)}}else{c=new r({name:u.name,x:s(u,"offsetx",0)+u.x,y:s(u,"offsety",0)+u.y,width:u.width,height:u.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:u.opacity,visible:u.visible,properties:s(u,"properties",{})});for(var P=[],O=0,R=u.data.length;O0?((f=new a(c,d.gid,v,g.length,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,P.push(f)):(p=e?null:new a(c,-1,v,g.length,t.tilewidth,t.tileheight),P.push(p)),++v===u.width&&(g.push(P),v=0,P=[])}c.data=g,h.push(c)}}return h}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),s=0;s>>0;return n}},function(t,e,i){var n=i(1);t.exports=function(t){for(var e=[],i=0;i1){if(Array.isArray(l.tiles)){for(var c={},d={},f=0;f=this.firstgid&&ta&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(113),s=i(78);t.exports=function(t,e){for(var i=[],r=0;r-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(150);t.exports=function(t){for(var e=[],i=[],s=0;s-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(s,r),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(u=new p(t,o,i,n,s,r)).setImage(h),this.tilesets.push(u),u)},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new c(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:null!==a?(f.Copy(t,e,i,n,s,r,o,a),this):null},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===a&&(a=this.tileWidth),void 0===l&&(l=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var u,c=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;f-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return n},removeTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"removeTileAt")?null:null===s?null:f.RemoveTileAt(t,e,i,n,s)},removeTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"removeTileAtWorldXY")?null:null===r?null:f.RemoveTileAtWorldXY(t,e,i,n,s,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(f.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this))},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(12),r=i(22),o=i(13),a=i(1384),h=i(146),l=i(35),u=i(10),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.events.on(r.CONTEXT_RESTORED,function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;sv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;o>=0;o--)for(a=0;av||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;o>=0;o--)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===m?(m=i.createVertexBuffer(y,n.STATIC_DRAW),this.vertexBuffer[e]=m):(i.setVertexBuffer(m),n.bufferSubData(n.ARRAY_BUFFER,0,y))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=i.tileWidth,l=i.tileHeight,c=h/2,d=l/2,f=a.x/n,p=a.y/s,g=(a.x+h)/n,v=(a.y+l)/s,m=this._tempMatrix,y=-c,x=-d;e.flipX&&(h*=-1,y+=i.tileWidth),e.flipY&&(l*=-1,x+=i.tileHeight);var T=y+h,w=x+l;m.applyITRS(c+e.pixelX,d+e.pixelY,e.rotation,1,1);var b=u.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),S=m.getX(y,x),A=m.getY(y,x),E=m.getX(y,w),_=m.getY(y,w),C=m.getX(T,w),M=m.getY(T,w),P=m.getX(T,x),O=m.getY(T,x);r.roundPixels&&(S=Math.round(S),A=Math.round(A),E=Math.round(E),_=Math.round(_),C=Math.round(C),M=Math.round(M),P=Math.round(P),O=Math.round(O));var R=this.vertexViewF32[o],L=this.vertexViewU32[o];return R[++t]=S,R[++t]=A,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=b,R[++t]=E,R[++t]=_,R[++t]=f,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=S,R[++t]=A,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=b,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=P,R[++t]=O,R[++t]=g,R[++t]=p,R[++t]=0,L[++t]=b,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4){this._renderOrder=t;for(var e=0;e0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(1393);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){var n=i(5);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(243),s=i(14),r=i(98),o=i(89),a=i(151),h=i(5),l=i(242),u=i(244),c=i(246);t.exports=function(t,e,i){void 0===i&&(i=n);var d=h(e,"from",0),f=h(e,"to",1),p=[{value:d}],g=a(e,"delay",i.delay),v=a(e,"duration",i.duration),m=h(e,"easeParams",i.easeParams),y=o(h(e,"ease",i.ease),m),x=a(e,"hold",i.hold),T=a(e,"repeat",i.repeat),w=a(e,"repeatDelay",i.repeatDelay),b=r(e,"yoyo",i.yoyo),S=[],A=l("value",f),E=c(p[0],0,"value",A.getEnd,A.getStart,A.getActive,y,g,v,b,x,T,w,!1,!1);E.start=d,E.current=d,E.to=f,S.push(E);var _=new u(t,S,p);_.offset=s(e,"offset",null),_.completeDelay=s(e,"completeDelay",0),_.loop=Math.round(s(e,"loop",0)),_.loopDelay=Math.round(s(e,"loopDelay",0)),_.paused=r(e,"paused",!1),_.useFrames=r(e,"useFrames",!1);for(var C=h(e,"callbackScope",_),M=[_,null],P=u.TYPES,O=0;O0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var m=0;m0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):(this.state=a.ACTIVE,this.dispatchTimelineEvent(r.TIMELINE_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=a.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=a.PENDING_REMOVE,this.dispatchTimelineEvent(r.TIMELINE_COMPLETE,this.callbacks.onComplete))},update:function(t,e){if(this.state!==a.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var i=this.totalData,n=0;n>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){t.exports="changedata"},function(t,e){t.exports="changedata-"},function(t,e){t.exports="removedata"},function(t,e){t.exports="setdata"},function(t,e){t.exports="destroy"},function(t,e,i){var n=i(39);t.exports=function(t,e,i,s,r){return n(t,"alpha",e,i,s,r)}},function(t,e,i){var n=i(39);t.exports=function(t,e,i,s,r){return n(t,"x",e,i,s,r)}},function(t,e,i){var n=i(39);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"x",e,s,o,a),n(t,"y",i,r,o,a)}},function(t,e,i){var n=i(39);t.exports=function(t,e,i,s,r){return n(t,"y",e,i,s,r)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=0;o0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.001&&(e.zoom=.001))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={Camera:i(287),CameraManager:i(689),Effects:i(295),Events:i(54)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(24),s=i(0),r=i(54),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed=1?1:1/e*(1+(e*t|0))}},function(t,e,i){var n=i(24),s=i(0),r=i(54),o=i(3),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=s,this.camera.emit(r.SHAKE_START,this.camera,this,t,e),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed0&&(o.preRender(1),t.render(n,e,i,o))}},resetAll:function(){for(var t=0;t1)for(var i=1;i=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){var n=i(125),s={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(s.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(s.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(s.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(s.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(s.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(s.webm=!0),""!==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 i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e){var i={h264Video:!1,hlsVideo:!1,mp4Video:!1,oggVideo:!1,vp9Video:!1,webmVideo:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.oggVideo=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264Video=!0,i.mp4Video=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webmVideo=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9Video=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hlsVideo=!0))}catch(t){}return i}()},function(t,e){var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){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;tMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=i(312);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){var n=i(21);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e?t:(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e1?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[i1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(167);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){t.exports={GetNext:i(321),IsSize:i(126),IsValue:i(741)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){t.exports={Ceil:i(322),Floor:i(102),To:i(743)}},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){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;i1?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,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=[],o=0;o0&&t<=e*i&&(r=t>e-1?t-(o=Math.floor(t/e))*e:t,s.set(r,o)),s}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){var n=i(182),s=i(329),r=i(330),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e){t.exports="addtexture"},function(t,e){t.exports="onerror"},function(t,e){t.exports="onload"},function(t,e){t.exports="ready"},function(t,e){t.exports="removetexture"},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," float alpha = mainColor.a;",""," if (!uInvertMaskAlpha)"," {"," alpha *= (maskColor.a);"," }"," else"," {"," alpha *= (1.0 - maskColor.a);"," }",""," gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_FORWARD_DIFFUSE_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);"," vec4 color = texture;",""," if (outTintEffect == 0.0)"," {"," // Multiply texture tint"," color = texture * texel;"," }"," else if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);"," color.a = texture.a * texel.a;"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform mat4 uModelMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}","",""].join("\n")},function(t,e,i){t.exports={GenerateTexture:i(345),Palettes:i(774)}},function(t,e,i){t.exports={ARNE16:i(346),C64:i(775),CGA:i(776),JMP:i(777),MSX:i(778)}},function(t,e){t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},function(t,e){t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},function(t,e,i){t.exports={Path:i(780),CubicBezier:i(347),Curve:i(85),Ellipse:i(348),Line:i(349),QuadraticBezier:i(350),Spline:i(351)}},function(t,e,i){var n=i(0),s=i(347),r=i(348),o=i(6),a=i(349),h=i(781),l=i(350),u=i(11),c=i(351),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(r,o),l=new d(t,e)),this.add(new s(u,a,h,l))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new l(o,s,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e,i){var n=i(36),s=i(355);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=s(l,h,t+1/3),o=s(l,h,t),a=s(l,h,t-1/3)}return(new n).setGLTo(r,o,a,1)}},function(t,e,i){var n=i(173);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(n(s/359,t,e));return i}},function(t,e,i){var n=i(123),s=function(t,e,i,s,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:n(t,s,l),g:n(e,r,l),b:n(i,o,l)}};t.exports={RGBWithRGB:s,ColorWithRGB:function(t,e,i,n,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),s(t.r,t.g,t.b,e,i,n,r,o)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),s(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(180),s=i(36);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var n=i(354);t.exports=function(t,e,i,s,r){return void 0===s&&(s=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+n(s)+n(t)+n(e)+n(i)}},function(t,e,i){t.exports={BitmapMask:i(272),GeometryMask:i(273)}},function(t,e,i){var n={AddToDOM:i(128),DOMContentLoaded:i(356),GetScreenOrientation:i(357),GetTarget:i(362),ParseXML:i(363),RemoveFromDOM:i(188),RequestAnimationFrame:i(343)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(815)}},function(t,e,i){var n=i(0),s=i(9),r=i(18),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){var n=i(128),s=i(283),r=i(286),o=i(27),a=i(0),h=i(308),l=i(817),u=i(331),c=i(100),d=i(341),f=i(309),p=i(356),g=i(9),v=i(22),m=i(364),y=i(18),x=i(369),T=i(370),w=i(372),b=i(127),S=i(375),A=i(342),E=i(344),_=i(379),C=i(387),M=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new S(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new A(this,this.config.fps),this.plugins=new x(this,this.config),this.facebook=new C(this),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),E(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(v.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(v.POST_RENDER,n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),i.emit(v.PRE_RENDER),i.emit(v.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=M},function(t,e,i){var n=i(128);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,n(i,e.parent)}}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},n=document.createElement("div");return n.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(n),i.w=90===e?n.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:n.offsetHeight,document.documentElement.removeChild(n),n=null,90!==Math.abs(window.orientation)?i.h:i.w}},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){var n=i(1),s=i(191);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=n(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(s(e+"Physics")),i)for(var o in i)o=s(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},function(t,e,i){var n=i(1);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){var n={game:"game",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"};n.facebook="facebook",t.exports=n},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s,r=i.getElementsByTagName("SubTexture"),o=0;og||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,m=f,y=0,x=0,T=0;Tr&&(y=w-r),b>o&&(x=b-o),t.add(T,e,i+v,s+m,h-y,l-x),(v+=h+p)+h>r&&(v=f,m+=l+p)}return t}},function(t,e,i){var n=i(1);t.exports=function(t,e,i){var s=n(i,"frameWidth",null),r=n(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=n(i,"startFrame",0),l=n(i,"endFrame",-1),u=n(i,"margin",0),c=n(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,v=e.realWidth,m=e.realHeight,y=Math.floor((v-u+c)/(s+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,b=s-w,S=s-(v-p-w),A=e.y,E=r-A,_=r-(m-g-A);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,M=u,P=0,O=e.sourceIndex,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 o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0){var o=n-t.length;if(o<=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 a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-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&&i0){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&&it.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){var n=i(72);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 o=i-e,a=t.splice(e,o);if(s)for(var h=0;h0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){var n=i(72);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 o=s;o-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=this._list,n=i.length,s=0;sv&&(r=v),o>m&&(o=m);var O=v+g.xAdvance,R=m+u;aE&&(E=C),CE&&(E=C),C0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,m=p.cutY,y=g.width,x=g.height,T=e._isTinted&&e.tintFill,w=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),b=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),S=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),A=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var E,_,C=0,M=0,P=0,O=0,R=e.letterSpacing,L=0,D=0,F=0,k=0,I=e.scrollX,B=e.scrollY,N=e.fontData,Y=N.chars,X=N.lineHeight,z=e.fontSize/N.size,U=0,G=e._align,W=0,V=0;e.getTextBounds(!1);var H=e._bounds.lines;1===G?V=(H.longest-H.lengths[0])/2:2===G&&(V=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;J0&&e.cropHeight>0&&(h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var F=0;F0&&(Y=Y%b-b):Y>b?Y=b:Y<0&&(Y=b+Y%b),null===_&&(_=new o(k+Math.cos(N)*B,I+Math.sin(N)*B,v),S.push(_),F+=.01);F<1+z;)w=Y*F+N,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,_.points.push(new r(x,T,v)),F+=.01;w=Y+N,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,_.points.push(new r(x,T,v));break;case n.FILL_RECT:u.setTexture2D(M),u.batchFillRect(p[++P],p[++P],p[++P],p[++P],f,c);break;case n.FILL_TRIANGLE:u.setTexture2D(M),u.batchFillTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],f,c);break;case n.STROKE_TRIANGLE:u.setTexture2D(M),u.batchStrokeTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],v,f,c);break;case n.LINE_TO:null!==_?_.points.push(new r(p[++P],p[++P],v)):(_=new o(p[++P],p[++P],v),S.push(_));break;case n.MOVE_TO:_=new o(p[++P],p[++P],v),S.push(_);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:k=p[++P],I=p[++P],f.translate(k,I);break;case n.SCALE:k=p[++P],I=p[++P],f.scale(k,I);break;case n.ROTATE:f.rotate(p[++P]);break;case n.SET_TEXTURE:var U=p[++P],G=p[++P];u.currentFrame=U,u.setTexture2D(U.glTexture,0),u.tintEffect=G,M=U.glTexture;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,u.tintEffect=2,M=t.blankTexture.glTexture}}}},function(t,e,i){var n=i(2),s=i(2);n=i(967),s=i(968),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(2),s=i(2);n=i(970),s=i(971),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){t.exports={GravityWell:i(400),Particle:i(401),ParticleEmitter:i(402),ParticleEmitterManager:i(203),Zones:i(977)}},function(t,e,i){var n=i(0),s=i(323),r=i(89),o=i(1),a=i(62),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&(this.has(t,"random")||this.hasBoth(t,"start","end")||this.hasBoth(t,"min","max"))){this.start=this.has(t,"start")?t.start:t.min,this.end=this.has(t,"end")?t.end:t.max;var i=this.hasBoth(t,"min","max")||!!t.random;if(i){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}if(this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){var n=i(2),s=i(2);n=i(975),s=i(976),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.emitters.list,a=o.length;if(0!==a){var h=this.pipeline,l=h._tempMatrix1.copyFrom(s.matrix),u=h._tempMatrix2,c=h._tempMatrix3,d=h._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);l.multiply(d),t.setPipeline(h);var f=s.roundPixels,p=e.defaultFrame.glTexture,g=n.getTintAppendFloatAlphaAndSwap;h.setTexture2D(p,0);for(var v=0;v?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(5);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,m={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},y=0,x=0;x0&&r.maxLines1&&(d+=f*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(2),s=i(2);n=i(986),s=i(987),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){if(0!==e.width&&0!==e.height){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a/e.style.resolution,h/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r)}}},function(t,e){t.exports=function(t,e,i,n,s){0!==e.width&&0!==e.height&&t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(0),s=i(14),r=i(5),o=i(989),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this._font,this.setStyle(e,!1,!0);var i=r(e,"metrics",!1);this.metrics=i?{ascent:r(i,"ascent",0),descent:r(i,"descent",0),fontSize:r(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?r(t,a[n][0],o):s(t,a[n][0],o)}var h=r(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=r(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,n="",s="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),n=r(t,"fontSize","16px"),s=r(t,"fontStyle","");else{var o=t.split(" "),a=0;s=o.length>2?o[a++]:"",n=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&n===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=n,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e,i){var n=i(27);t.exports=function(t){var e=n.create(this),i=e.getContext("2d");t.syncFont(e,i);var s=Math.ceil(i.measureText(t.testString).width*t.baselineX),r=s,o=2*r;r=r*t.baselineY|0,e.width=s,e.height=o,i.fillStyle="#f00",i.fillRect(0,0,s,o),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,r);var a={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,s,o))return a.ascent=r,a.descent=r+6,a.fontSize=a.ascent+a.descent,n.remove(e),a;var h,l,u=i.getImageData(0,0,s,o).data,c=u.length,d=4*s,f=0,p=!1;for(h=0;hr;h--){for(l=0;l0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0){var R=o.strokeTint,L=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(R.TL=L,R.TR=L,R.BL=L,R.BR=L,_=1;_0)for(n(h,e),_=0;_0)for(n(h,e,e.altFillColor,e.altFillAlpha*c),_=0;_0){for(s(h,e,e.outlineFillColor,e.outlineFillAlpha*c),E=1;Eo.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var m=o.vertexViewF32,y=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,T=0,w=e.tintFill,b=0;b0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(83);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e,i){var n=i(51);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(51);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e,i){var n=i(11);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(104);n.Area=i(1090),n.Circumference=i(398),n.CircumferencePoint=i(202),n.Clone=i(1091),n.Contains=i(105),n.ContainsPoint=i(1092),n.ContainsRect=i(1093),n.CopyFrom=i(1094),n.Equals=i(1095),n.GetBounds=i(1096),n.GetPoint=i(396),n.GetPoints=i(397),n.Offset=i(1097),n.OffsetPoint=i(1098),n.Random=i(164),t.exports=n},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(104);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(105);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(105);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e,i){var n=i(11);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(4),s=i(431);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0==(a=(o=-2*f)*o-4*(r=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new n(h,-o/(2*r))):a>0&&(i.push(new n(h,(-o+Math.sqrt(a))/(2*r))),i.push(new n(h,(-o-Math.sqrt(a))/(2*r))));else{var g=(l-d)/(u-f),v=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0==(a=(o=2*u*g-2*v*g-2*l)*o-4*(r=g*g+1)*(l*l+u*u+v*v-c*c-2*u*v))?(h=-o/(2*r),i.push(new n(h,v-h*g))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)),h=(-o-Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)))}}return i}},function(t,e,i){var n=i(211),s=i(432);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();n(r,t,i),n(o,t,i),n(a,t,i),n(h,t,i)}return i}},function(t,e,i){var n=i(11),s=i(139);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e,i){var n=i(213),s=i(139);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();n(r,e,i),n(o,e,i),n(a,e,i),n(h,e,i)}return i}},function(t,e,i){var n=i(434),s=i(213);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(r,t,i),s(o,t,i),s(a,t,i)}return i}},function(t,e,i){var n=i(211),s=i(436);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();n(r,e,i),n(o,e,i),n(a,e,i)}return i}},function(t,e,i){var n=i(439),s=i(437);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(t,r,i),s(t,o,i),s(t,a,i)}return i}},function(t,e,i){var n=i(441);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||si&&(i=h.x),h.xr&&(r=h.y),h.yn(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var n=i(174);t.exports=function(t,e,i){var s=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),n(t,s,r)}},function(t,e,i){var n=i(11),s=i(139);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){var n=i(4),s=i(40);t.exports=function(t,e,i){void 0===i&&(i=new n),e=s(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)-1&&(s.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,n=this.manager,s=n.pointers,r=n.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,n=!1,s=0;s0&&(n=!0)}return this._updatedThisFrame=!0,n},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,this.manager.resetCursor(i),t.input=null;var n=this._draggable.indexOf(t);return n>-1&&this._draggable.splice(n,1),(n=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(n,1),(n=this._over[0].indexOf(t))>-1&&this._over[0].splice(n,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=s?i=!0:n>0&&e>=t.downTime+n&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold||0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],n=0;n0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.x-a.dragStartXGlobal,c=t.y-a.dragStartYGlobal,f=o.getParentRotation(),p=u*Math.cos(f)+c*Math.sin(f),g=c*Math.cos(f)-u*Math.sin(f);s=p+a.dragStartX,r=g+a.dragStartY}else s=t.x-a.dragX,r=t.y-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,s,r),this.emit(d.DRAG,t,o,s,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var s=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e);for(var h=0;h0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,o=!1,h=!1,l=!0;if(m(e)){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),n=p(u,"draggable",!1),s=p(u,"dropZone",!1),r=p(u,"cursor",!1),o=p(u,"useHandCursor",!1),h=p(u,"pixelPerfect",!1);var c=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d=e}}},function(t,e,i){t.exports={Events:i(141),KeyboardManager:i(365),KeyboardPlugin:i(1211),Key:i(454),KeyCodes:i(130),KeyCombo:i(455),JustDown:i(1216),JustUp:i(1217),DownDuration:i(1218),UpDuration:i(1219)}},function(t,e){t.exports="keydown"},function(t,e){t.exports="keyup"},function(t,e){t.exports="keycombomatch"},function(t,e){t.exports="down"},function(t,e){t.exports="keydown-"},function(t,e){t.exports="keyup-"},function(t,e){t.exports="up"},function(t,e,i){var n=i(0),s=i(9),r=i(141),o=i(22),a=i(5),h=i(55),l=i(140),u=i(454),c=i(130),d=i(455),f=i(1215),p=i(102),g=new n({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.useQueue?this.sceneInputPlugin.pluginEvents.on(h.UPDATE,this.update,this):this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n={};if("string"==typeof t){t=t.split(",");for(var s=0;s-1?n[s]=t:n[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),n[t]||(n[t]=new u(this,t),e&&this.addCapture(t),n[t].setEmitOnRepeat(i)),n[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,n=this.keys;if(t instanceof u){var s=n.indexOf(t);s>-1&&(i=this.keys[s],this.keys[s]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(i=n[t],n[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},createCombo:function(t,e){return new d(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=p(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e,i){var n=i(130),s={};for(var r in n)s[n[r]]=r;t.exports=s},function(t,e){t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},function(t,e){t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.sizei&&(n=t,i=e)}),n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,n,s,r){return u(this.world,t,e,i,n,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(d.UPDATE,this.world.update,this.world),t.off(d.POST_UPDATE,this.world.postUpdate,this.world),t.off(d.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(d.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){var i={enableBody:function(t,e,i,n,s){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),s&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=i},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){var i={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=i},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){t.exports=function(t,e,i,n,s,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+n,l.maxY=i+s,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+n,bottom:i+s,isCircle:!1},d=t.intersects;u.iterate(function(t){d(t,c)&&a.push(t)})}return h.concat(a)}},function(t,e){t.exports="collide"},function(t,e){t.exports="overlap"},function(t,e){t.exports="pause"},function(t,e){t.exports="resume"},function(t,e){t.exports="tilecollide"},function(t,e){t.exports="tileoverlap"},function(t,e){t.exports="worldbounds"},function(t,e){t.exports="worldstep"},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e,i){var n=i(1273),s=i(1275),r=i(472);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,f=o.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var v=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&!t.blocked.right&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(1276);t.exports=function(t,e,i,s,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&!t.blocked.up&&c&&t.checkCollision.up?l&&t.y0&&!t.blocked.down&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(468);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e,i){var n=i(469);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){t.exports={Body:i(474),Events:i(224),COLLIDES:i(109),CollisionMap:i(475),Factory:i(476),Image:i(478),ImpactBody:i(477),ImpactPhysics:i(1298),Sprite:i(479),TYPE:i(110),World:i(480)}},function(t,e,i){var n=i(24);t.exports=function(t,e,i,s,r){if(i)return n(e+i*t,-r,r);if(s){var o=s*t;return e-o>0?e-o:e+o<0?e+o:0}return n(e,-r,r)}},function(t,e){t.exports=function(t,e){if(t.standing=!1,e.collision.y&&(t.bounciness>0&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(t.vel.y>0&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(t.bounciness>0&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(t.bounciness>0){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&oi.last.x&&e.last.xi.last.y&&e.last.y0))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,e.bounciness>0&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e,i){t.exports={Factory:i(481),Image:i(485),Matter:i(231),MatterPhysics:i(1332),PolyDecomp:i(482),Sprite:i(486),TileBody:i(228),PhysicsEditorParser:i(484),World:i(492)}},function(t,e,i){var n=i(144),s=i(1),r=i(3);t.exports=function(t,e,i){void 0===i&&(i={});var o=e.x,a=e.y;if(e.body={temp:!0,position:{x:o,y:a}},[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity].forEach(function(t){for(var i in t)(n=t[i]).get&&"function"==typeof n.get||n.set&&"function"==typeof n.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var n}),e.world=t,e._tempVec2=new r(o,a),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,!0);else{var h=s(i,"shape",null);h||(h="rectangle"),e.setBody(h,i)}return e}},function(t,e){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},function(t,e){var i={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i1?1:0;n1;if(!d||t!=d.x||e!=d.y){d&&n?(f=d.x,p=d.y):(f=0,p=0);var s={x:f+t,y:p+e};!n&&d||(d=s),g.push(s),m=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":m=t.x,y=t.y;break;case"H":m=t.x;break;case"V":y=t.y}x(m,y,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i0)for(var a=s+1;ae.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},function(t,e,i){t.exports={List:i(134),Map:i(169),ProcessQueue:i(470),RTree:i(471),Set:i(107),Size:i(371)}},function(t,e,i){var n=i(15),s=i(1347),r={CanvasTexture:i(376),Events:i(127),FilterMode:s,Frame:i(103),Parsers:i(378),Texture:i(192),TextureManager:i(375),TextureSource:i(377)};r=n(!1,r,s),t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){t.exports={Components:i(146),Parsers:i(1378),Formats:i(33),ImageCollection:i(504),ParseToTilemap:i(240),Tile:i(78),Tilemap:i(513),TilemapCreator:i(1387),TilemapFactory:i(1388),Tileset:i(150),LayerData:i(113),MapData:i(114),ObjectLayer:i(507),DynamicTilemapLayer:i(514),StaticTilemapLayer:i(515)}},function(t,e,i){var n=i(26),s=i(59);t.exports=function(t,e,i,r,o,a,h,l){t<0&&(t=0),e<0&&(e=0),void 0===h&&(h=!0);for(var u=n(t,e,i,r,null,l),c=o-t,d=a-e,f=0;f=0&&p=0&&g=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=y;a--)for(o=v;c[a]&&o=y;a--)for(o=m;c[a]&&o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(26),s=i(59),r=i(77);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=n(e,i,o,a,null,l),d=0;d=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;re)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(77),s=i(59),r=i(236);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,r=t.length;s0&&(t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix);var u=t.currentContext,c=e.gidMap;u.save(),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l),l.copyToContext(u)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,h.copyToContext(u));var d=n.alpha*e.alpha;u.globalAlpha=n.alpha*e.alpha;for(var f=0;f-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t-1&&(e.state=u.REMOVED,s.splice(r,1)):(e.state=u.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;tS&&(S=_),b[A][E]=_}}}var C=r?n(r):null;return o?function(t,e,n,s){var r,o=0,a=s%v,h=Math.floor(s/v);if(a>=0&&a=0&&h>2],r+=i[(3&n[o])<<4|n[o+1]>>4],r+=i[(15&n[o+1])<<2|n[o+2]>>6],r+=i[63&n[o+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},function(t,e,i){t.exports={Clone:i(70),Extend:i(15),GetAdvancedValue:i(14),GetFastValue:i(1),GetMinMaxValue:i(1413),GetValue:i(5),HasAll:i(1414),HasAny:i(405),HasValue:i(90),IsPlainObject:i(7),Merge:i(87),MergeRight:i(1415),Pick:i(505),SetValue:i(426)}},function(t,e,i){var n=i(5),s=i(24);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=n(t,e,o);return s(a,i,r)}},function(t,e){t.exports=function(t,e){for(var i=0;i - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); - -/** - * @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 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 {Phaser.Geom.Point} 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; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -1139,7 +1058,7 @@ module.exports = Vector2; /***/ }), -/* 5 */ +/* 4 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -1149,8 +1068,172 @@ module.exports = Vector2; */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); +var GEOM_CONST = __webpack_require__(47); + +/** + * @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 {integer} + * @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 {Phaser.Geom.Point} 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; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Source object +// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' +// The default value to use if the key doesn't exist + +/** + * Retrieves a value from an object. + * + * @function Phaser.Utils.Objects.GetValue + * @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 GetValue = function (source, key, defaultValue) +{ + if (!source || typeof source === 'number') + { + return defaultValue; + } + else if (source.hasOwnProperty(key)) + { + return source[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parent = source; + var value = defaultValue; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parent.hasOwnProperty(keys[i])) + { + // Yes it has a key property, let's carry on down + value = parent[keys[i]]; + + parent = parent[keys[i]]; + } + else + { + // Can't go any further, so reset to default + value = defaultValue; + break; + } + } + + return value; + } + else + { + return defaultValue; + } +}; + +module.exports = GetValue; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -1321,80 +1404,17 @@ GameObjectFactory.register = function (factoryType, factoryFunction) } }; -PluginCache.register('GameObjectFactory', GameObjectFactory, 'add'); - -module.exports = GameObjectFactory; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Source object -// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' -// The default value to use if the key doesn't exist - -/** - * Retrieves a value from an object. - * - * @function Phaser.Utils.Objects.GetValue - * @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 GetValue = function (source, key, defaultValue) +GameObjectFactory.remove = function (factoryType) { - if (!source || typeof source === 'number') + if (GameObjectFactory.prototype.hasOwnProperty(factoryType)) { - return defaultValue; - } - else if (source.hasOwnProperty(key)) - { - return source[key]; - } - else if (key.indexOf('.') !== -1) - { - var keys = key.split('.'); - var parent = source; - var value = defaultValue; - - // Use for loop here so we can break early - for (var i = 0; i < keys.length; i++) - { - if (parent.hasOwnProperty(keys[i])) - { - // Yes it has a key property, let's carry on down - value = parent[keys[i]]; - - parent = parent[keys[i]]; - } - else - { - // Can't go any further, so reset to default - value = defaultValue; - break; - } - } - - return value; - } - else - { - return defaultValue; + delete GameObjectFactory.prototype[factoryType]; } }; -module.exports = GetValue; +PluginCache.register('GameObjectFactory', GameObjectFactory, 'add'); + +module.exports = GameObjectFactory; /***/ }), @@ -1661,6 +1681,349 @@ module.exports = { /* 10 */ /***/ (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; +} + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -1668,11 +2031,12 @@ module.exports = { */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(47); -var GetPoint = __webpack_require__(147); -var GetPoints = __webpack_require__(249); -var Line = __webpack_require__(54); -var Random = __webpack_require__(150); +var Contains = __webpack_require__(48); +var GetPoint = __webpack_require__(148); +var GetPoints = __webpack_require__(252); +var GEOM_CONST = __webpack_require__(47); +var Line = __webpack_require__(55); +var Random = __webpack_require__(151); /** * @classdesc @@ -1699,6 +2063,17 @@ var Rectangle = new Class({ 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 {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.RECTANGLE; + /** * The X coordinate of the top left corner of the Rectangle. * @@ -2156,349 +2531,6 @@ var Rectangle = new Class({ module.exports = Rectangle; -/***/ }), -/* 11 */ -/***/ (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; -} - - /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { @@ -2515,27 +2547,27 @@ if (true) { module.exports = { - Alpha: __webpack_require__(244), - Animation: __webpack_require__(479), - BlendMode: __webpack_require__(247), - ComputedSize: __webpack_require__(522), - Crop: __webpack_require__(523), - Depth: __webpack_require__(248), - Flip: __webpack_require__(524), - GetBounds: __webpack_require__(525), - Mask: __webpack_require__(252), - Origin: __webpack_require__(526), - PathFollower: __webpack_require__(527), - Pipeline: __webpack_require__(151), - ScrollFactor: __webpack_require__(255), - Size: __webpack_require__(528), - Texture: __webpack_require__(529), - TextureCrop: __webpack_require__(530), - Tint: __webpack_require__(531), - ToJSON: __webpack_require__(256), - Transform: __webpack_require__(257), + Alpha: __webpack_require__(247), + Animation: __webpack_require__(481), + BlendMode: __webpack_require__(250), + ComputedSize: __webpack_require__(524), + Crop: __webpack_require__(525), + Depth: __webpack_require__(251), + Flip: __webpack_require__(526), + GetBounds: __webpack_require__(527), + Mask: __webpack_require__(255), + Origin: __webpack_require__(544), + PathFollower: __webpack_require__(545), + Pipeline: __webpack_require__(152), + ScrollFactor: __webpack_require__(258), + Size: __webpack_require__(546), + Texture: __webpack_require__(547), + TextureCrop: __webpack_require__(548), + Tint: __webpack_require__(549), + ToJSON: __webpack_require__(259), + Transform: __webpack_require__(260), TransformMatrix: __webpack_require__(32), - Visible: __webpack_require__(258) + Visible: __webpack_require__(261) }; @@ -2551,10 +2583,10 @@ module.exports = { */ var Class = __webpack_require__(0); -var ComponentsToJSON = __webpack_require__(256); -var DataManager = __webpack_require__(109); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(110); +var ComponentsToJSON = __webpack_require__(259); +var DataManager = __webpack_require__(110); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(111); /** * @classdesc @@ -2859,8 +2891,8 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#setData * @since 3.0.0 * - * @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 GameObject. */ @@ -3191,8 +3223,8 @@ module.exports = GameObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH = __webpack_require__(165); -var GetValue = __webpack_require__(6); +var MATH = __webpack_require__(166); +var GetValue = __webpack_require__(5); /** * Retrieves a value from an object. Allows for more advanced selection options, including: @@ -3272,6 +3304,105 @@ module.exports = GetAdvancedValue; /* 15 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2019 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 + * + * @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; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -3279,8 +3410,8 @@ module.exports = GetAdvancedValue; */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -3423,13 +3554,21 @@ GameObjectCreator.register = function (factoryType, factoryFunction) } }; +GameObjectCreator.remove = function (factoryType) +{ + if (GameObjectCreator.prototype.hasOwnProperty(factoryType)) + { + delete GameObjectCreator.prototype[factoryType]; + } +}; + PluginCache.register('GameObjectCreator', GameObjectCreator, 'make'); module.exports = GameObjectCreator; /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, exports) { /** @@ -3581,7 +3720,7 @@ module.exports = FILE_CONST; /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3590,97 +3729,34 @@ module.exports = FILE_CONST; * @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 - * - * @return {object} The extended object. + * @namespace Phaser.Core.Events */ -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] || {}; +module.exports = { - // skip the boolean and the target - i = 2; - } + BLUR: __webpack_require__(528), + BOOT: __webpack_require__(529), + CONTEXT_LOST: __webpack_require__(530), + CONTEXT_RESTORED: __webpack_require__(531), + DESTROY: __webpack_require__(532), + FOCUS: __webpack_require__(533), + HIDDEN: __webpack_require__(534), + PAUSE: __webpack_require__(535), + POST_RENDER: __webpack_require__(536), + POST_STEP: __webpack_require__(537), + PRE_RENDER: __webpack_require__(538), + PRE_STEP: __webpack_require__(539), + READY: __webpack_require__(540), + RESUME: __webpack_require__(541), + STEP: __webpack_require__(542), + VISIBLE: __webpack_require__(543) - // 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; - /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports) { /** @@ -3889,7 +3965,7 @@ module.exports = PluginCache; /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3904,31 +3980,31 @@ module.exports = PluginCache; module.exports = { - BOOT: __webpack_require__(661), - CREATE: __webpack_require__(662), - DESTROY: __webpack_require__(663), - PAUSE: __webpack_require__(664), - POST_UPDATE: __webpack_require__(665), - PRE_UPDATE: __webpack_require__(666), - READY: __webpack_require__(667), - RENDER: __webpack_require__(668), - RESUME: __webpack_require__(669), - SHUTDOWN: __webpack_require__(670), - SLEEP: __webpack_require__(671), - START: __webpack_require__(672), - TRANSITION_COMPLETE: __webpack_require__(673), - TRANSITION_INIT: __webpack_require__(674), - TRANSITION_OUT: __webpack_require__(675), - TRANSITION_START: __webpack_require__(676), - TRANSITION_WAKE: __webpack_require__(677), - UPDATE: __webpack_require__(678), - WAKE: __webpack_require__(679) + BOOT: __webpack_require__(665), + CREATE: __webpack_require__(666), + DESTROY: __webpack_require__(667), + PAUSE: __webpack_require__(668), + POST_UPDATE: __webpack_require__(669), + PRE_UPDATE: __webpack_require__(670), + READY: __webpack_require__(671), + RENDER: __webpack_require__(672), + RESUME: __webpack_require__(673), + SHUTDOWN: __webpack_require__(674), + SLEEP: __webpack_require__(675), + START: __webpack_require__(676), + TRANSITION_COMPLETE: __webpack_require__(677), + TRANSITION_INIT: __webpack_require__(678), + TRANSITION_OUT: __webpack_require__(679), + TRANSITION_START: __webpack_require__(680), + TRANSITION_WAKE: __webpack_require__(681), + UPDATE: __webpack_require__(682), + WAKE: __webpack_require__(683) }; /***/ }), -/* 20 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3938,13 +4014,13 @@ module.exports = { */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var Events = __webpack_require__(80); +var CONST = __webpack_require__(17); +var Events = __webpack_require__(81); var GetFastValue = __webpack_require__(2); -var GetURL = __webpack_require__(204); -var MergeXHRSettings = __webpack_require__(205); -var XHRLoader = __webpack_require__(428); -var XHRSettings = __webpack_require__(133); +var GetURL = __webpack_require__(206); +var MergeXHRSettings = __webpack_require__(207); +var XHRLoader = __webpack_require__(431); +var XHRSettings = __webpack_require__(134); /** * @classdesc @@ -4469,7 +4545,79 @@ module.exports = File; /***/ }), -/* 21 */ +/* 22 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + +}; + +module.exports = MATH_CONST; + + +/***/ }), +/* 23 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4553,7 +4701,7 @@ module.exports = GetTilesWithin; /***/ }), -/* 22 */ +/* 24 */ /***/ (function(module, exports) { /** @@ -4583,79 +4731,7 @@ module.exports = Clamp; /***/ }), -/* 23 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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 - -}; - -module.exports = MATH_CONST; - - -/***/ }), -/* 24 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4664,8 +4740,8 @@ module.exports = MATH_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(26); -var Smoothing = __webpack_require__(113); +var CONST = __webpack_require__(31); +var Smoothing = __webpack_require__(114); // The pool into which the canvas elements are placed. var pool = []; @@ -4916,7 +4992,7 @@ module.exports = CanvasPool(); /***/ }), -/* 25 */ +/* 26 */ /***/ (function(module, exports) { /** @@ -5000,144 +5076,6 @@ var SetTransform = function (renderer, ctx, src, camera, parentMatrix) module.exports = SetTransform; -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 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.18.1', - - BlendModes: __webpack_require__(52), - - ScaleModes: __webpack_require__(104), - - /** - * AUTO Detect Renderer. - * - * @name Phaser.AUTO - * @const - * @type {integer} - * @since 3.0.0 - */ - AUTO: 0, - - /** - * Canvas Renderer. - * - * @name Phaser.CANVAS - * @const - * @type {integer} - * @since 3.0.0 - */ - CANVAS: 1, - - /** - * WebGL Renderer. - * - * @name Phaser.WEBGL - * @const - * @type {integer} - * @since 3.0.0 - */ - WEBGL: 2, - - /** - * Headless Renderer. - * - * @name Phaser.HEADLESS - * @const - * @type {integer} - * @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 {integer} - * @since 3.0.0 - */ - FOREVER: -1, - - /** - * Direction constant. - * - * @name Phaser.NONE - * @const - * @type {integer} - * @since 3.0.0 - */ - NONE: 4, - - /** - * Direction constant. - * - * @name Phaser.UP - * @const - * @type {integer} - * @since 3.0.0 - */ - UP: 5, - - /** - * Direction constant. - * - * @name Phaser.DOWN - * @const - * @type {integer} - * @since 3.0.0 - */ - DOWN: 6, - - /** - * Direction constant. - * - * @name Phaser.LEFT - * @const - * @type {integer} - * @since 3.0.0 - */ - LEFT: 7, - - /** - * Direction constant. - * - * @name Phaser.RIGHT - * @const - * @type {integer} - * @since 3.0.0 - */ - RIGHT: 8 - -}; - -module.exports = CONST; - - /***/ }), /* 27 */ /***/ (function(module, exports) { @@ -5215,41 +5153,7 @@ module.exports = PropertyValueSet; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.Core.Events - */ - -module.exports = { - - BLUR: __webpack_require__(580), - BOOT: __webpack_require__(581), - DESTROY: __webpack_require__(582), - FOCUS: __webpack_require__(583), - HIDDEN: __webpack_require__(584), - PAUSE: __webpack_require__(585), - POST_RENDER: __webpack_require__(586), - POST_STEP: __webpack_require__(587), - PRE_RENDER: __webpack_require__(588), - PRE_STEP: __webpack_require__(589), - READY: __webpack_require__(590), - RESUME: __webpack_require__(591), - STEP: __webpack_require__(592), - VISIBLE: __webpack_require__(593) - -}; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(52); +var BlendModes = __webpack_require__(53); var GetAdvancedValue = __webpack_require__(14); var ScaleModes = __webpack_require__(104); @@ -5373,7 +5277,7 @@ module.exports = BuildGameObject; /***/ }), -/* 30 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5385,7 +5289,7 @@ module.exports = BuildGameObject; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var Line = __webpack_require__(54); +var Line = __webpack_require__(55); /** * @classdesc @@ -5673,7 +5577,7 @@ module.exports = Shape; /***/ }), -/* 31 */ +/* 30 */ /***/ (function(module, exports) { /** @@ -5727,6 +5631,144 @@ module.exports = { }; +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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.19.0', + + BlendModes: __webpack_require__(53), + + ScaleModes: __webpack_require__(104), + + /** + * AUTO Detect Renderer. + * + * @name Phaser.AUTO + * @const + * @type {integer} + * @since 3.0.0 + */ + AUTO: 0, + + /** + * Canvas Renderer. + * + * @name Phaser.CANVAS + * @const + * @type {integer} + * @since 3.0.0 + */ + CANVAS: 1, + + /** + * WebGL Renderer. + * + * @name Phaser.WEBGL + * @const + * @type {integer} + * @since 3.0.0 + */ + WEBGL: 2, + + /** + * Headless Renderer. + * + * @name Phaser.HEADLESS + * @const + * @type {integer} + * @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 {integer} + * @since 3.0.0 + */ + FOREVER: -1, + + /** + * Direction constant. + * + * @name Phaser.NONE + * @const + * @type {integer} + * @since 3.0.0 + */ + NONE: 4, + + /** + * Direction constant. + * + * @name Phaser.UP + * @const + * @type {integer} + * @since 3.0.0 + */ + UP: 5, + + /** + * Direction constant. + * + * @name Phaser.DOWN + * @const + * @type {integer} + * @since 3.0.0 + */ + DOWN: 6, + + /** + * Direction constant. + * + * @name Phaser.LEFT + * @const + * @type {integer} + * @since 3.0.0 + */ + LEFT: 7, + + /** + * Direction constant. + * + * @name Phaser.RIGHT + * @const + * @type {integer} + * @since 3.0.0 + */ + RIGHT: 8 + +}; + +module.exports = CONST; + + /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { @@ -5738,7 +5780,8 @@ module.exports = { */ var Class = __webpack_require__(0); -var Vector2 = __webpack_require__(4); +var MATH_CONST = __webpack_require__(22); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -5758,8 +5801,8 @@ var Vector2 = __webpack_require__(4); * @since 3.0.0 * * @param {number} [a=1] - The Scale X value. - * @param {number} [b=0] - The Shear Y value. - * @param {number} [c=0] - The Shear 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. @@ -5824,7 +5867,7 @@ var TransformMatrix = new Class({ }, /** - * The Shear Y value. + * The Skew Y value. * * @name Phaser.GameObjects.Components.TransformMatrix#b * @type {number} @@ -5845,7 +5888,7 @@ var TransformMatrix = new Class({ }, /** - * The Shear X value. + * The Skew X value. * * @name Phaser.GameObjects.Components.TransformMatrix#c * @type {number} @@ -5971,7 +6014,7 @@ var TransformMatrix = new Class({ }, /** - * The rotation of the Matrix. + * The rotation of the Matrix. Value is in radians. * * @name Phaser.GameObjects.Components.TransformMatrix#rotation * @type {number} @@ -5982,13 +6025,53 @@ var TransformMatrix = new Class({ get: function () { - return Math.acos(this.a / this.scaleX) * (Math.atan(-this.c / this.a) < 0 ? -1 : 1); + return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1); } }, /** - * The horizontal scale of the Matrix. + * 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} @@ -5999,13 +6082,13 @@ var TransformMatrix = new Class({ get: function () { - return Math.sqrt((this.a * this.a) + (this.c * this.c)); + return Math.sqrt((this.a * this.a) + (this.b * this.b)); } }, /** - * The vertical scale of the Matrix. + * The decomposed vertical scale of the Matrix. This value is always positive. * * @name Phaser.GameObjects.Components.TransformMatrix#scaleY * @type {number} @@ -6016,7 +6099,7 @@ var TransformMatrix = new Class({ get: function () { - return Math.sqrt((this.b * this.b) + (this.d * this.d)); + return Math.sqrt((this.c * this.c) + (this.d * this.d)); } }, @@ -6665,10 +6748,10 @@ module.exports = TransformMatrix; */ var Class = __webpack_require__(0); -var GetColor = __webpack_require__(160); -var GetColor32 = __webpack_require__(270); -var HSVToRGB = __webpack_require__(161); -var RGBToHSV = __webpack_require__(271); +var GetColor = __webpack_require__(161); +var GetColor32 = __webpack_require__(273); +var HSVToRGB = __webpack_require__(162); +var RGBToHSV = __webpack_require__(274); /** * @namespace Phaser.Display.Color @@ -7594,7 +7677,7 @@ module.exports = PropertyValueInc; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); +var CONST = __webpack_require__(22); /** * Convert the given angle from degrees, to the equivalent angle in radians. @@ -8213,7 +8296,7 @@ module.exports = Common; }; })(); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(222))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(225))) /***/ }), /* 38 */ @@ -8504,6 +8587,86 @@ module.exports = Contains; /* 47 */ /***/ (function(module, exports) { +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @since 3.19.0 + */ + CIRCLE: 0, + + /** + * An Ellipse Geometry object type. + * + * @name Phaser.Geom.ELLIPSE + * @type {integer} + * @since 3.19.0 + */ + ELLIPSE: 1, + + /** + * A Line Geometry object type. + * + * @name Phaser.Geom.LINE + * @type {integer} + * @since 3.19.0 + */ + LINE: 2, + + /** + * A Point Geometry object type. + * + * @name Phaser.Geom.POINT + * @type {integer} + * @since 3.19.0 + */ + POINT: 3, + + /** + * A Polygon Geometry object type. + * + * @name Phaser.Geom.POLYGON + * @type {integer} + * @since 3.19.0 + */ + POLYGON: 4, + + /** + * A Rectangle Geometry object type. + * + * @name Phaser.Geom.RECTANGLE + * @type {integer} + * @since 3.19.0 + */ + RECTANGLE: 5, + + /** + * A Triangle Geometry object type. + * + * @name Phaser.Geom.TRIANGLE + * @type {integer} + * @since 3.19.0 + */ + TRIANGLE: 6 + +}; + +module.exports = GEOM_CONST; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -8536,7 +8699,7 @@ module.exports = Contains; /***/ }), -/* 48 */ +/* 49 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8551,27 +8714,27 @@ module.exports = Contains; module.exports = { - DESTROY: __webpack_require__(602), - FADE_IN_COMPLETE: __webpack_require__(603), - FADE_IN_START: __webpack_require__(604), - FADE_OUT_COMPLETE: __webpack_require__(605), - FADE_OUT_START: __webpack_require__(606), - FLASH_COMPLETE: __webpack_require__(607), - FLASH_START: __webpack_require__(608), - PAN_COMPLETE: __webpack_require__(609), - PAN_START: __webpack_require__(610), - POST_RENDER: __webpack_require__(611), - PRE_RENDER: __webpack_require__(612), - SHAKE_COMPLETE: __webpack_require__(613), - SHAKE_START: __webpack_require__(614), - ZOOM_COMPLETE: __webpack_require__(615), - ZOOM_START: __webpack_require__(616) + DESTROY: __webpack_require__(606), + FADE_IN_COMPLETE: __webpack_require__(607), + FADE_IN_START: __webpack_require__(608), + FADE_OUT_COMPLETE: __webpack_require__(609), + FADE_OUT_START: __webpack_require__(610), + FLASH_COMPLETE: __webpack_require__(611), + FLASH_START: __webpack_require__(612), + PAN_COMPLETE: __webpack_require__(613), + PAN_START: __webpack_require__(614), + POST_RENDER: __webpack_require__(615), + PRE_RENDER: __webpack_require__(616), + SHAKE_COMPLETE: __webpack_require__(617), + SHAKE_START: __webpack_require__(618), + ZOOM_COMPLETE: __webpack_require__(619), + ZOOM_START: __webpack_require__(620) }; /***/ }), -/* 49 */ +/* 50 */ /***/ (function(module, exports) { /** @@ -8609,7 +8772,7 @@ module.exports = LineStyleCanvas; /***/ }), -/* 50 */ +/* 51 */ /***/ (function(module, exports) { /** @@ -8738,7 +8901,7 @@ module.exports = CONST; /***/ }), -/* 51 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8747,8 +8910,8 @@ module.exports = CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(137); -var GetTilesWithin = __webpack_require__(21); +var GetTileAt = __webpack_require__(138); +var GetTilesWithin = __webpack_require__(23); /** * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the @@ -8804,7 +8967,7 @@ module.exports = CalculateFacesWithin; /***/ }), -/* 52 */ +/* 53 */ /***/ (function(module, exports) { /** @@ -9143,7 +9306,7 @@ module.exports = { /***/ }), -/* 53 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -9158,58 +9321,58 @@ module.exports = { module.exports = { - BOOT: __webpack_require__(782), - DESTROY: __webpack_require__(783), - DRAG_END: __webpack_require__(784), - DRAG_ENTER: __webpack_require__(785), - DRAG: __webpack_require__(786), - DRAG_LEAVE: __webpack_require__(787), - DRAG_OVER: __webpack_require__(788), - DRAG_START: __webpack_require__(789), - DROP: __webpack_require__(790), - GAME_OUT: __webpack_require__(791), - GAME_OVER: __webpack_require__(792), - GAMEOBJECT_DOWN: __webpack_require__(793), - GAMEOBJECT_DRAG_END: __webpack_require__(794), - GAMEOBJECT_DRAG_ENTER: __webpack_require__(795), - GAMEOBJECT_DRAG: __webpack_require__(796), - GAMEOBJECT_DRAG_LEAVE: __webpack_require__(797), - GAMEOBJECT_DRAG_OVER: __webpack_require__(798), - GAMEOBJECT_DRAG_START: __webpack_require__(799), - GAMEOBJECT_DROP: __webpack_require__(800), - GAMEOBJECT_MOVE: __webpack_require__(801), - GAMEOBJECT_OUT: __webpack_require__(802), - GAMEOBJECT_OVER: __webpack_require__(803), - GAMEOBJECT_POINTER_DOWN: __webpack_require__(804), - GAMEOBJECT_POINTER_MOVE: __webpack_require__(805), - GAMEOBJECT_POINTER_OUT: __webpack_require__(806), - GAMEOBJECT_POINTER_OVER: __webpack_require__(807), - GAMEOBJECT_POINTER_UP: __webpack_require__(808), - GAMEOBJECT_POINTER_WHEEL: __webpack_require__(809), - GAMEOBJECT_UP: __webpack_require__(810), - GAMEOBJECT_WHEEL: __webpack_require__(811), - MANAGER_BOOT: __webpack_require__(812), - MANAGER_PROCESS: __webpack_require__(813), - MANAGER_UPDATE: __webpack_require__(814), - POINTER_DOWN: __webpack_require__(815), - POINTER_DOWN_OUTSIDE: __webpack_require__(816), - POINTER_MOVE: __webpack_require__(817), - POINTER_OUT: __webpack_require__(818), - POINTER_OVER: __webpack_require__(819), - POINTER_UP: __webpack_require__(820), - POINTER_UP_OUTSIDE: __webpack_require__(821), - POINTER_WHEEL: __webpack_require__(822), - POINTERLOCK_CHANGE: __webpack_require__(823), - PRE_UPDATE: __webpack_require__(824), - SHUTDOWN: __webpack_require__(825), - START: __webpack_require__(826), - UPDATE: __webpack_require__(827) + BOOT: __webpack_require__(787), + DESTROY: __webpack_require__(788), + DRAG_END: __webpack_require__(789), + DRAG_ENTER: __webpack_require__(790), + DRAG: __webpack_require__(791), + DRAG_LEAVE: __webpack_require__(792), + DRAG_OVER: __webpack_require__(793), + DRAG_START: __webpack_require__(794), + DROP: __webpack_require__(795), + GAME_OUT: __webpack_require__(796), + GAME_OVER: __webpack_require__(797), + GAMEOBJECT_DOWN: __webpack_require__(798), + GAMEOBJECT_DRAG_END: __webpack_require__(799), + GAMEOBJECT_DRAG_ENTER: __webpack_require__(800), + GAMEOBJECT_DRAG: __webpack_require__(801), + GAMEOBJECT_DRAG_LEAVE: __webpack_require__(802), + GAMEOBJECT_DRAG_OVER: __webpack_require__(803), + GAMEOBJECT_DRAG_START: __webpack_require__(804), + GAMEOBJECT_DROP: __webpack_require__(805), + GAMEOBJECT_MOVE: __webpack_require__(806), + GAMEOBJECT_OUT: __webpack_require__(807), + GAMEOBJECT_OVER: __webpack_require__(808), + GAMEOBJECT_POINTER_DOWN: __webpack_require__(809), + GAMEOBJECT_POINTER_MOVE: __webpack_require__(810), + GAMEOBJECT_POINTER_OUT: __webpack_require__(811), + GAMEOBJECT_POINTER_OVER: __webpack_require__(812), + GAMEOBJECT_POINTER_UP: __webpack_require__(813), + GAMEOBJECT_POINTER_WHEEL: __webpack_require__(814), + GAMEOBJECT_UP: __webpack_require__(815), + GAMEOBJECT_WHEEL: __webpack_require__(816), + MANAGER_BOOT: __webpack_require__(817), + MANAGER_PROCESS: __webpack_require__(818), + MANAGER_UPDATE: __webpack_require__(819), + POINTER_DOWN: __webpack_require__(820), + POINTER_DOWN_OUTSIDE: __webpack_require__(821), + POINTER_MOVE: __webpack_require__(822), + POINTER_OUT: __webpack_require__(823), + POINTER_OVER: __webpack_require__(824), + POINTER_UP: __webpack_require__(825), + POINTER_UP_OUTSIDE: __webpack_require__(826), + POINTER_WHEEL: __webpack_require__(827), + POINTERLOCK_CHANGE: __webpack_require__(828), + PRE_UPDATE: __webpack_require__(829), + SHUTDOWN: __webpack_require__(830), + START: __webpack_require__(831), + UPDATE: __webpack_require__(832) }; /***/ }), -/* 54 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -9219,10 +9382,11 @@ module.exports = { */ var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(250); -var GetPoints = __webpack_require__(148); -var Random = __webpack_require__(149); -var Vector2 = __webpack_require__(4); +var GetPoint = __webpack_require__(253); +var GetPoints = __webpack_require__(149); +var GEOM_CONST = __webpack_require__(47); +var Random = __webpack_require__(150); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -9249,6 +9413,17 @@ var Line = new Class({ if (x2 === undefined) { x2 = 0; } if (y2 === undefined) { y2 = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.LINE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Line#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.LINE; + /** * The x coordinate of the lines starting point. * @@ -9534,7 +9709,7 @@ module.exports = Line; /***/ }), -/* 55 */ +/* 56 */ /***/ (function(module, exports) { /** @@ -9562,7 +9737,7 @@ module.exports = Length; /***/ }), -/* 56 */ +/* 57 */ /***/ (function(module, exports) { /** @@ -9594,7 +9769,7 @@ module.exports = Wrap; /***/ }), -/* 57 */ +/* 58 */ /***/ (function(module, exports) { /** @@ -9628,7 +9803,7 @@ module.exports = DistanceBetween; /***/ }), -/* 58 */ +/* 59 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -9638,11 +9813,11 @@ module.exports = DistanceBetween; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); var IsPlainObject = __webpack_require__(7); /** @@ -9858,7 +10033,7 @@ module.exports = JSONFile; /***/ }), -/* 59 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10052,7 +10227,7 @@ module.exports = MultiFile; /***/ }), -/* 60 */ +/* 61 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10069,12 +10244,12 @@ var Body = {}; module.exports = Body; -var Vertices = __webpack_require__(84); +var Vertices = __webpack_require__(86); var Vector = __webpack_require__(99); -var Sleeping = __webpack_require__(448); +var Sleeping = __webpack_require__(451); var Common = __webpack_require__(37); var Bounds = __webpack_require__(100); -var Axes = __webpack_require__(1240); +var Axes = __webpack_require__(1244); (function() { @@ -11268,7 +11443,7 @@ var Axes = __webpack_require__(1240); /***/ }), -/* 61 */ +/* 62 */ /***/ (function(module, exports) { /** @@ -11319,7 +11494,7 @@ module.exports = WorldToTileX; /***/ }), -/* 62 */ +/* 63 */ /***/ (function(module, exports) { /** @@ -11370,7 +11545,7 @@ module.exports = WorldToTileY; /***/ }), -/* 63 */ +/* 64 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12052,7 +12227,7 @@ earcut.flatten = function (data) { /***/ }), -/* 64 */ +/* 65 */ /***/ (function(module, exports) { /** @@ -12094,7 +12269,7 @@ module.exports = Clone; /***/ }), -/* 65 */ +/* 66 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12109,35 +12284,35 @@ module.exports = Clone; module.exports = { - COMPLETE: __webpack_require__(851), - DECODED: __webpack_require__(852), - DECODED_ALL: __webpack_require__(853), - DESTROY: __webpack_require__(854), - DETUNE: __webpack_require__(855), - GLOBAL_DETUNE: __webpack_require__(856), - GLOBAL_MUTE: __webpack_require__(857), - GLOBAL_RATE: __webpack_require__(858), - GLOBAL_VOLUME: __webpack_require__(859), - LOOP: __webpack_require__(860), - LOOPED: __webpack_require__(861), - MUTE: __webpack_require__(862), - PAUSE_ALL: __webpack_require__(863), - PAUSE: __webpack_require__(864), - PLAY: __webpack_require__(865), - RATE: __webpack_require__(866), - RESUME_ALL: __webpack_require__(867), - RESUME: __webpack_require__(868), - SEEK: __webpack_require__(869), - STOP_ALL: __webpack_require__(870), - STOP: __webpack_require__(871), - UNLOCKED: __webpack_require__(872), - VOLUME: __webpack_require__(873) + COMPLETE: __webpack_require__(855), + DECODED: __webpack_require__(856), + DECODED_ALL: __webpack_require__(857), + DESTROY: __webpack_require__(858), + DETUNE: __webpack_require__(859), + GLOBAL_DETUNE: __webpack_require__(860), + GLOBAL_MUTE: __webpack_require__(861), + GLOBAL_RATE: __webpack_require__(862), + GLOBAL_VOLUME: __webpack_require__(863), + LOOP: __webpack_require__(864), + LOOPED: __webpack_require__(865), + MUTE: __webpack_require__(866), + PAUSE_ALL: __webpack_require__(867), + PAUSE: __webpack_require__(868), + PLAY: __webpack_require__(869), + RATE: __webpack_require__(870), + RESUME_ALL: __webpack_require__(871), + RESUME: __webpack_require__(872), + SEEK: __webpack_require__(873), + STOP_ALL: __webpack_require__(874), + STOP: __webpack_require__(875), + UNLOCKED: __webpack_require__(876), + VOLUME: __webpack_require__(877) }; /***/ }), -/* 66 */ +/* 67 */ /***/ (function(module, exports) { /** @@ -12186,7 +12361,7 @@ module.exports = SafeRange; /***/ }), -/* 67 */ +/* 68 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12198,7 +12373,7 @@ module.exports = SafeRange; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var SpriteRender = __webpack_require__(926); +var SpriteRender = __webpack_require__(930); /** * @classdesc @@ -12364,7 +12539,7 @@ module.exports = Sprite; /***/ }), -/* 68 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12439,7 +12614,7 @@ module.exports = StrokePathWebGL; /***/ }), -/* 69 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12449,11 +12624,12 @@ module.exports = StrokePathWebGL; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(81); -var GetPoint = __webpack_require__(396); -var GetPoints = __webpack_require__(397); -var Line = __webpack_require__(54); -var Random = __webpack_require__(153); +var Contains = __webpack_require__(83); +var GetPoint = __webpack_require__(399); +var GetPoints = __webpack_require__(400); +var GEOM_CONST = __webpack_require__(47); +var Line = __webpack_require__(55); +var Random = __webpack_require__(154); /** * @classdesc @@ -12486,6 +12662,17 @@ var Triangle = new Class({ if (x3 === undefined) { x3 = 0; } if (y3 === undefined) { y3 = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.TRIANGLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Triangle#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.TRIANGLE; + /** * `x` coordinate of the first point. * @@ -12874,7 +13061,7 @@ module.exports = Triangle; /***/ }), -/* 70 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12884,8 +13071,8 @@ module.exports = Triangle; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -13148,7 +13335,7 @@ module.exports = ImageFile; /***/ }), -/* 71 */ +/* 72 */ /***/ (function(module, exports) { /** @@ -13184,7 +13371,7 @@ module.exports = SetTileCollision; /***/ }), -/* 72 */ +/* 73 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13195,7 +13382,7 @@ module.exports = SetTileCollision; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Rectangle = __webpack_require__(417); +var Rectangle = __webpack_require__(420); /** * @classdesc @@ -14022,7 +14209,7 @@ module.exports = Tile; /***/ }), -/* 73 */ +/* 74 */ /***/ (function(module, exports) { /** @@ -14050,7 +14237,7 @@ module.exports = GetCenterX; /***/ }), -/* 74 */ +/* 75 */ /***/ (function(module, exports) { /** @@ -14085,7 +14272,7 @@ module.exports = SetCenterX; /***/ }), -/* 75 */ +/* 76 */ /***/ (function(module, exports) { /** @@ -14120,7 +14307,7 @@ module.exports = SetCenterY; /***/ }), -/* 76 */ +/* 77 */ /***/ (function(module, exports) { /** @@ -14148,7 +14335,7 @@ module.exports = GetCenterY; /***/ }), -/* 77 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14159,9 +14346,10 @@ module.exports = GetCenterY; var Class = __webpack_require__(0); var Contains = __webpack_require__(46); -var GetPoint = __webpack_require__(241); -var GetPoints = __webpack_require__(242); -var Random = __webpack_require__(145); +var GetPoint = __webpack_require__(244); +var GetPoints = __webpack_require__(245); +var GEOM_CONST = __webpack_require__(47); +var Random = __webpack_require__(146); /** * @classdesc @@ -14190,6 +14378,17 @@ var Circle = new Class({ if (y === undefined) { y = 0; } if (radius === undefined) { radius = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.CIRCLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Circle#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.CIRCLE; + /** * The x position of the center of the circle. * @@ -14511,7 +14710,7 @@ module.exports = Circle; /***/ }), -/* 78 */ +/* 79 */ /***/ (function(module, exports) { /** @@ -14557,7 +14756,7 @@ module.exports = SpliceOne; /***/ }), -/* 79 */ +/* 80 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14567,9 +14766,9 @@ module.exports = SpliceOne; */ var Class = __webpack_require__(0); -var FromPoints = __webpack_require__(172); -var Rectangle = __webpack_require__(10); -var Vector2 = __webpack_require__(4); +var FromPoints = __webpack_require__(173); +var Rectangle = __webpack_require__(11); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -14765,10 +14964,8 @@ var Curve = new Class({ return this.getPointAt(1, out); }, - // Get total curve arc length - /** - * [description] + * Get total curve arc length * * @method Phaser.Curves.Curve#getLength * @since 3.0.0 @@ -14782,10 +14979,9 @@ var Curve = new Class({ return lengths[lengths.length - 1]; }, - // Get list of cumulative segment lengths /** - * [description] + * Get list of cumulative segment lengths * * @method Phaser.Curves.Curve#getLengths * @since 3.0.0 @@ -14944,13 +15140,11 @@ var Curve = new Class({ return this.getPointAt(0, out); }, - // Returns a unit vector tangent at t - // In case any sub curve does not implement its tangent derivation, - // 2 points a small delta apart will be used to find its gradient - // which seems to give a reasonable approximation - /** - * [description] + * Returns a unit vector tangent at t + * In case any sub curve does not implement its tangent derivation, + * 2 points a small delta apart will be used to find its gradient + * which seems to give a reasonable approximation * * @method Phaser.Curves.Curve#getTangent * @since 3.0.0 @@ -15132,7 +15326,7 @@ module.exports = Curve; /***/ }), -/* 80 */ +/* 81 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15147,22 +15341,131 @@ module.exports = Curve; module.exports = { - ADD: __webpack_require__(829), - COMPLETE: __webpack_require__(830), - FILE_COMPLETE: __webpack_require__(831), - FILE_KEY_COMPLETE: __webpack_require__(832), - FILE_LOAD_ERROR: __webpack_require__(833), - FILE_LOAD: __webpack_require__(834), - FILE_PROGRESS: __webpack_require__(835), - POST_PROCESS: __webpack_require__(836), - PROGRESS: __webpack_require__(837), - START: __webpack_require__(838) + ADD: __webpack_require__(834), + COMPLETE: __webpack_require__(835), + FILE_COMPLETE: __webpack_require__(836), + FILE_KEY_COMPLETE: __webpack_require__(837), + FILE_LOAD_ERROR: __webpack_require__(838), + FILE_LOAD: __webpack_require__(839), + FILE_PROGRESS: __webpack_require__(840), + POST_PROCESS: __webpack_require__(841), + PROGRESS: __webpack_require__(842), + START: __webpack_require__(843) }; /***/ }), -/* 81 */ +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var EaseMap = __webpack_require__(164); +var UppercaseFirst = __webpack_require__(178); + +/** + * This internal function is used to return the correct ease function for a Tween. + * + * It can take a variety of input, including an EaseMap based string, or a custom function. + * + * @function Phaser.Tweens.Builders.GetEaseFunction + * @since 3.0.0 + * + * @param {(string|function)} ease - The ease to find. This can be either a string from the EaseMap, or a custom function. + * @param {number[]} [easeParams] - An optional array of ease parameters to go with the ease. + * + * @return {function} The ease function. + */ +var GetEaseFunction = function (ease, easeParams) +{ + // Default ease function + var easeFunction = EaseMap.Power0; + + // Prepare ease function + if (typeof ease === 'string') + { + // String based look-up + + // 1) They specified it correctly + if (EaseMap.hasOwnProperty(ease)) + { + easeFunction = EaseMap[ease]; + } + else + { + // Do some string manipulation to try and find it + var direction = ''; + + if (ease.indexOf('.')) + { + // quad.in = Quad.easeIn + // quad.out = Quad.easeOut + // quad.inout =Quad.easeInOut + + direction = ease.substr(ease.indexOf('.') + 1); + + if (direction.toLowerCase() === 'in') + { + direction = 'easeIn'; + } + else if (direction.toLowerCase() === 'out') + { + direction = 'easeOut'; + } + else if (direction.toLowerCase() === 'inout') + { + direction = 'easeInOut'; + } + } + + ease = UppercaseFirst(ease.substr(0, ease.indexOf('.') + 1) + direction); + + if (EaseMap.hasOwnProperty(ease)) + { + easeFunction = EaseMap[ease]; + } + } + } + else if (typeof ease === 'function') + { + // Custom function + easeFunction = ease; + } + else if (Array.isArray(ease) && ease.length === 4) + { + // Bezier function (TODO) + } + + // No custom ease parameters? + if (!easeParams) + { + // Return ease function + return easeFunction; + } + + var cloneParams = easeParams.slice(0); + + cloneParams.unshift(0); + + // Return ease function with custom ease parameters + return function (v) + { + cloneParams[0] = v; + + return easeFunction.apply(this, cloneParams); + }; +}; + +module.exports = GetEaseFunction; + + +/***/ }), +/* 83 */ /***/ (function(module, exports) { /** @@ -15215,7 +15518,7 @@ module.exports = Contains; /***/ }), -/* 82 */ +/* 84 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15224,7 +15527,7 @@ module.exports = Contains; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); // This is based off an explanation and expanded math presented by Paul Bourke: // See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ @@ -15291,7 +15594,7 @@ module.exports = LineToLine; /***/ }), -/* 83 */ +/* 85 */ /***/ (function(module, exports) { /** @@ -15319,7 +15622,7 @@ module.exports = Angle; /***/ }), -/* 84 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15779,7 +16082,7 @@ var Common = __webpack_require__(37); /***/ }), -/* 85 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15788,49 +16091,7 @@ var Common = __webpack_require__(37); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(64); - -/** - * Creates a new Object using all values from obj1 and obj2. - * If a value exists in both obj1 and obj2, the value in obj1 is used. - * - * @function Phaser.Utils.Objects.Merge - * @since 3.0.0 - * - * @param {object} obj1 - The first object. - * @param {object} obj2 - The second object. - * - * @return {object} A new object containing the union of obj1's and obj2's properties. - */ -var Merge = function (obj1, obj2) -{ - var clone = Clone(obj1); - - for (var key in obj2) - { - if (!clone.hasOwnProperty(key)) - { - clone[key] = obj2[key]; - } - } - - return clone; -}; - -module.exports = Merge; - - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); /** * Return a value based on the range between `min` and `max` and the percentage given. @@ -15855,7 +16116,7 @@ module.exports = FromPercent; /***/ }), -/* 87 */ +/* 88 */ /***/ (function(module, exports) { /** @@ -15896,7 +16157,7 @@ module.exports = GetBoolean; /***/ }), -/* 88 */ +/* 89 */ /***/ (function(module, exports) { /** @@ -16068,7 +16329,7 @@ module.exports = TWEEN_CONST; /***/ }), -/* 89 */ +/* 90 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16083,18 +16344,18 @@ module.exports = TWEEN_CONST; module.exports = { - ENTER_FULLSCREEN: __webpack_require__(655), - FULLSCREEN_FAILED: __webpack_require__(656), - FULLSCREEN_UNSUPPORTED: __webpack_require__(657), - LEAVE_FULLSCREEN: __webpack_require__(658), - ORIENTATION_CHANGE: __webpack_require__(659), - RESIZE: __webpack_require__(660) + ENTER_FULLSCREEN: __webpack_require__(659), + FULLSCREEN_FAILED: __webpack_require__(660), + FULLSCREEN_UNSUPPORTED: __webpack_require__(661), + LEAVE_FULLSCREEN: __webpack_require__(662), + ORIENTATION_CHANGE: __webpack_require__(663), + RESIZE: __webpack_require__(664) }; /***/ }), -/* 90 */ +/* 91 */ /***/ (function(module, exports) { /** @@ -16138,7 +16399,7 @@ module.exports = SnapFloor; /***/ }), -/* 91 */ +/* 92 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16148,8 +16409,8 @@ module.exports = SnapFloor; */ var Class = __webpack_require__(0); -var Clamp = __webpack_require__(22); -var Extend = __webpack_require__(17); +var Clamp = __webpack_require__(24); +var Extend = __webpack_require__(15); /** * @classdesc @@ -16850,16 +17111,18 @@ var Frame = new Class({ }, /** - * Destroys this Frames references. + * 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.texture = null; - this.source = null; + this.texture = null; + this.glTexture = null; + this.customData = null; + this.data = null; }, /** @@ -16955,7 +17218,7 @@ module.exports = Frame; /***/ }), -/* 92 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16965,10 +17228,11 @@ module.exports = Frame; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(93); -var GetPoint = __webpack_require__(368); -var GetPoints = __webpack_require__(369); -var Random = __webpack_require__(152); +var Contains = __webpack_require__(94); +var GetPoint = __webpack_require__(371); +var GetPoints = __webpack_require__(372); +var GEOM_CONST = __webpack_require__(47); +var Random = __webpack_require__(153); /** * @classdesc @@ -16999,6 +17263,17 @@ var Ellipse = new Class({ if (width === undefined) { width = 0; } if (height === undefined) { height = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.ELLIPSE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Ellipse#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.ELLIPSE; + /** * The x position of the center of the ellipse. * @@ -17323,7 +17598,7 @@ module.exports = Ellipse; /***/ }), -/* 93 */ +/* 94 */ /***/ (function(module, exports) { /** @@ -17365,7 +17640,7 @@ module.exports = Contains; /***/ }), -/* 94 */ +/* 95 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17374,15 +17649,15 @@ module.exports = Contains; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Actions = __webpack_require__(229); +var Actions = __webpack_require__(232); var Class = __webpack_require__(0); -var Events = __webpack_require__(110); +var Events = __webpack_require__(111); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); var IsPlainObject = __webpack_require__(7); -var Range = __webpack_require__(362); -var Set = __webpack_require__(105); -var Sprite = __webpack_require__(67); +var Range = __webpack_require__(365); +var Set = __webpack_require__(106); +var Sprite = __webpack_require__(68); /** * @classdesc @@ -17719,14 +17994,15 @@ var Group = new Class({ var randomKey = GetFastValue(options, 'randomKey', false); var randomFrame = GetFastValue(options, 'randomFrame', false); var yoyo = GetFastValue(options, 'yoyo', false); - var quantity = GetFastValue(options, 'frameQuantity', 1); + var quantity = GetFastValue(options, 'quantity', false); + var frameQuantity = GetFastValue(options, 'frameQuantity', 1); var max = GetFastValue(options, 'max', 0); - // If a grid is set we use that to override the quantity? + // If a quantity value is set we use that to override the frameQuantity var range = Range(key, frame, { max: max, - qty: quantity, + qty: (quantity) ? quantity : frameQuantity, random: randomKey, randomB: randomFrame, repeat: repeat, @@ -18503,22 +18779,7 @@ var Group = new Class({ return; } - if (destroyChildren) - { - var children = this.children; - - for (var i = 0; i < children.size; i++) - { - var gameObject = children.entries[i]; - - // Remove the event hook first or it'll go all recursive hell on us - gameObject.off(Events.DESTROY, this.remove, this); - - gameObject.destroy(); - } - } - - this.children.clear(); + this.clear(false, destroyChildren); this.scene = undefined; this.children = undefined; @@ -18530,7 +18791,7 @@ module.exports = Group; /***/ }), -/* 95 */ +/* 96 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -18542,7 +18803,7 @@ module.exports = Group; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var ImageRender = __webpack_require__(929); +var ImageRender = __webpack_require__(933); /** * @classdesc @@ -18630,68 +18891,6 @@ var Image = new Class({ module.exports = Image; -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var EaseMap = __webpack_require__(163); - -/** - * [description] - * - * @function Phaser.Tweens.Builders.GetEaseFunction - * @since 3.0.0 - * - * @param {(string|function)} ease - [description] - * @param {array} easeParams - [description] - * - * @return {function} [description] - */ -var GetEaseFunction = function (ease, easeParams) -{ - if (typeof ease === 'string' && EaseMap.hasOwnProperty(ease)) - { - if (easeParams) - { - var cloneParams = easeParams.slice(0); - - cloneParams.unshift(0); - - return function (v) - { - cloneParams[0] = v; - - return EaseMap[ease].apply(this, cloneParams); - }; - } - else - { - // String based look-up - return EaseMap[ease]; - } - } - else if (typeof ease === 'function') - { - // Custom function - return ease; - } - else if (Array.isArray(ease) && ease.length === 4) - { - // Bezier function (TODO) - } - - return EaseMap.Power0; -}; - -module.exports = GetEaseFunction; - - /***/ }), /* 97 */ /***/ (function(module, exports) { @@ -19689,6 +19888,51 @@ module.exports = ScaleModes; /* 105 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clone = __webpack_require__(65); + +/** + * Creates a new Object using all values from obj1 and obj2. + * If a value exists in both obj1 and obj2, the value in obj1 is used. + * + * This is only a shallow copy. Deeply nested objects are not cloned, so be sure to only use this + * function on shallow objects. + * + * @function Phaser.Utils.Objects.Merge + * @since 3.0.0 + * + * @param {object} obj1 - The first object. + * @param {object} obj2 - The second object. + * + * @return {object} A new object containing the union of obj1's and obj2's properties. + */ +var Merge = function (obj1, obj2) +{ + var clone = Clone(obj1); + + for (var key in obj2) + { + if (!clone.hasOwnProperty(key)) + { + clone[key] = obj2[key]; + } + } + + return clone; +}; + +module.exports = Merge; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -20135,7 +20379,7 @@ module.exports = Set; /***/ }), -/* 106 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -20144,14 +20388,14 @@ module.exports = Set; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(52); -var Circle = __webpack_require__(77); +var BlendModes = __webpack_require__(53); +var Circle = __webpack_require__(78); var CircleContains = __webpack_require__(46); var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var Rectangle = __webpack_require__(10); -var RectangleContains = __webpack_require__(47); +var Rectangle = __webpack_require__(11); +var RectangleContains = __webpack_require__(48); /** * @classdesc @@ -20448,7 +20692,7 @@ module.exports = Zone; /***/ }), -/* 107 */ +/* 108 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -20463,30 +20707,30 @@ module.exports = Zone; module.exports = { - ADD_ANIMATION: __webpack_require__(504), - ANIMATION_COMPLETE: __webpack_require__(505), - ANIMATION_REPEAT: __webpack_require__(506), - ANIMATION_RESTART: __webpack_require__(507), - ANIMATION_START: __webpack_require__(508), - PAUSE_ALL: __webpack_require__(509), - REMOVE_ANIMATION: __webpack_require__(510), - RESUME_ALL: __webpack_require__(511), - SPRITE_ANIMATION_COMPLETE: __webpack_require__(512), - SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(513), - SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(514), - SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(515), - SPRITE_ANIMATION_KEY_START: __webpack_require__(516), - SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(517), - SPRITE_ANIMATION_REPEAT: __webpack_require__(518), - SPRITE_ANIMATION_RESTART: __webpack_require__(519), - SPRITE_ANIMATION_START: __webpack_require__(520), - SPRITE_ANIMATION_UPDATE: __webpack_require__(521) + ADD_ANIMATION: __webpack_require__(506), + ANIMATION_COMPLETE: __webpack_require__(507), + ANIMATION_REPEAT: __webpack_require__(508), + ANIMATION_RESTART: __webpack_require__(509), + ANIMATION_START: __webpack_require__(510), + PAUSE_ALL: __webpack_require__(511), + REMOVE_ANIMATION: __webpack_require__(512), + RESUME_ALL: __webpack_require__(513), + SPRITE_ANIMATION_COMPLETE: __webpack_require__(514), + SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(515), + SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(516), + SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(517), + SPRITE_ANIMATION_KEY_START: __webpack_require__(518), + SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(519), + SPRITE_ANIMATION_REPEAT: __webpack_require__(520), + SPRITE_ANIMATION_RESTART: __webpack_require__(521), + SPRITE_ANIMATION_START: __webpack_require__(522), + SPRITE_ANIMATION_UPDATE: __webpack_require__(523) }; /***/ }), -/* 108 */ +/* 109 */ /***/ (function(module, exports) { /** @@ -20514,7 +20758,7 @@ module.exports = Perimeter; /***/ }), -/* 109 */ +/* 110 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -20524,7 +20768,7 @@ module.exports = Perimeter; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(259); +var Events = __webpack_require__(262); /** * @callback DataEachCallback @@ -21155,7 +21399,7 @@ module.exports = DataManager; /***/ }), -/* 110 */ +/* 111 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21168,11 +21412,11 @@ module.exports = DataManager; * @namespace Phaser.GameObjects.Events */ -module.exports = { DESTROY: __webpack_require__(536) }; +module.exports = { DESTROY: __webpack_require__(554) }; /***/ }), -/* 111 */ +/* 112 */ /***/ (function(module, exports) { /** @@ -21210,7 +21454,7 @@ module.exports = Shuffle; /***/ }), -/* 112 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21222,12 +21466,12 @@ module.exports = Shuffle; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var DegToRad = __webpack_require__(35); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(48); -var Rectangle = __webpack_require__(10); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(49); +var Rectangle = __webpack_require__(11); var TransformMatrix = __webpack_require__(32); -var ValueToColor = __webpack_require__(159); -var Vector2 = __webpack_require__(4); +var ValueToColor = __webpack_require__(160); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -23131,7 +23375,7 @@ module.exports = BaseCamera; /***/ }), -/* 113 */ +/* 114 */ /***/ (function(module, exports) { /** @@ -23263,7 +23507,7 @@ module.exports = Smoothing(); /***/ }), -/* 114 */ +/* 115 */ /***/ (function(module, exports) { /** @@ -23293,7 +23537,7 @@ module.exports = Linear; /***/ }), -/* 115 */ +/* 116 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -23462,10 +23706,10 @@ function init () module.exports = init(); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(681))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(685))) /***/ }), -/* 116 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23474,7 +23718,7 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(115); +var OS = __webpack_require__(116); /** * Determines the browser type and version running this Phaser Game instance. @@ -23575,7 +23819,7 @@ module.exports = init(); /***/ }), -/* 117 */ +/* 118 */ /***/ (function(module, exports) { /** @@ -23605,7 +23849,7 @@ module.exports = IsSizePowerOfTwo; /***/ }), -/* 118 */ +/* 119 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23620,17 +23864,17 @@ module.exports = IsSizePowerOfTwo; module.exports = { - ADD: __webpack_require__(727), - ERROR: __webpack_require__(728), - LOAD: __webpack_require__(729), - READY: __webpack_require__(730), - REMOVE: __webpack_require__(731) + ADD: __webpack_require__(732), + ERROR: __webpack_require__(733), + LOAD: __webpack_require__(734), + READY: __webpack_require__(735), + REMOVE: __webpack_require__(736) }; /***/ }), -/* 119 */ +/* 120 */ /***/ (function(module, exports) { /** @@ -23688,7 +23932,7 @@ module.exports = AddToDOM; /***/ }), -/* 120 */ +/* 121 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23697,7 +23941,7 @@ module.exports = AddToDOM; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(78); +var SpliceOne = __webpack_require__(79); /** * Removes the given item, or array of items, from the array. @@ -23779,7 +24023,7 @@ module.exports = Remove; /***/ }), -/* 121 */ +/* 122 */ /***/ (function(module, exports) { /** @@ -24667,7 +24911,7 @@ module.exports = KeyCodes; /***/ }), -/* 122 */ +/* 123 */ /***/ (function(module, exports) { /** @@ -24790,7 +25034,7 @@ module.exports = CONST; /***/ }), -/* 123 */ +/* 124 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -24801,10 +25045,10 @@ module.exports = CONST; */ var Class = __webpack_require__(0); -var Clone = __webpack_require__(64); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(65); -var GameEvents = __webpack_require__(28); +var Clone = __webpack_require__(65); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(66); +var GameEvents = __webpack_require__(18); var NOOP = __webpack_require__(1); /** @@ -25414,7 +25658,7 @@ module.exports = BaseSoundManager; /***/ }), -/* 124 */ +/* 125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25425,9 +25669,9 @@ module.exports = BaseSoundManager; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(65); -var Extend = __webpack_require__(17); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(66); +var Extend = __webpack_require__(15); var NOOP = __webpack_require__(1); /** @@ -25914,7 +26158,7 @@ module.exports = BaseSound; /***/ }), -/* 125 */ +/* 126 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25923,10 +26167,10 @@ module.exports = BaseSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(178); +var ArrayUtils = __webpack_require__(180); var Class = __webpack_require__(0); var NOOP = __webpack_require__(1); -var StableSort = __webpack_require__(127); +var StableSort = __webpack_require__(128); /** * @callback EachListCallback @@ -26730,7 +26974,7 @@ module.exports = List; /***/ }), -/* 126 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26739,8 +26983,8 @@ module.exports = List; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CheckMatrix = __webpack_require__(179); -var TransposeMatrix = __webpack_require__(360); +var CheckMatrix = __webpack_require__(181); +var TransposeMatrix = __webpack_require__(363); /** * Rotates the array matrix based on the given rotation value. @@ -26802,7 +27046,7 @@ module.exports = RotateMatrix; /***/ }), -/* 127 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26947,7 +27191,7 @@ else {} })(); /***/ }), -/* 128 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26959,10 +27203,10 @@ else {} var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var GetBitmapTextSize = __webpack_require__(904); -var ParseFromAtlas = __webpack_require__(905); -var ParseXMLBitmapFont = __webpack_require__(181); -var Render = __webpack_require__(906); +var GetBitmapTextSize = __webpack_require__(908); +var ParseFromAtlas = __webpack_require__(909); +var ParseXMLBitmapFont = __webpack_require__(183); +var Render = __webpack_require__(910); /** * @classdesc @@ -27589,7 +27833,7 @@ module.exports = BitmapText; /***/ }), -/* 129 */ +/* 130 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27601,7 +27845,7 @@ module.exports = BitmapText; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var MeshRender = __webpack_require__(1026); +var MeshRender = __webpack_require__(1030); var NOOP = __webpack_require__(1); /** @@ -27762,7 +28006,7 @@ module.exports = Mesh; /***/ }), -/* 130 */ +/* 131 */ /***/ (function(module, exports) { /** @@ -27798,7 +28042,7 @@ module.exports = RectangleToRectangle; /***/ }), -/* 131 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27807,7 +28051,7 @@ module.exports = RectangleToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); // Contains the plugins that Phaser uses globally and locally. // These are the source objects, not instantiated. @@ -27910,7 +28154,7 @@ module.exports = InputPluginCache; /***/ }), -/* 132 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27925,19 +28169,19 @@ module.exports = InputPluginCache; module.exports = { - ANY_KEY_DOWN: __webpack_require__(1164), - ANY_KEY_UP: __webpack_require__(1165), - COMBO_MATCH: __webpack_require__(1166), - DOWN: __webpack_require__(1167), - KEY_DOWN: __webpack_require__(1168), - KEY_UP: __webpack_require__(1169), - UP: __webpack_require__(1170) + ANY_KEY_DOWN: __webpack_require__(1168), + ANY_KEY_UP: __webpack_require__(1169), + COMBO_MATCH: __webpack_require__(1170), + DOWN: __webpack_require__(1171), + KEY_DOWN: __webpack_require__(1172), + KEY_UP: __webpack_require__(1173), + UP: __webpack_require__(1174) }; /***/ }), -/* 133 */ +/* 134 */ /***/ (function(module, exports) { /** @@ -28001,7 +28245,7 @@ module.exports = XHRSettings; /***/ }), -/* 134 */ +/* 135 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28011,8 +28255,8 @@ module.exports = XHRSettings; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(207); -var Sprite = __webpack_require__(67); +var Components = __webpack_require__(209); +var Sprite = __webpack_require__(68); /** * @classdesc @@ -28102,7 +28346,7 @@ module.exports = ArcadeSprite; /***/ }), -/* 135 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28120,12 +28364,12 @@ var Bodies = {}; module.exports = Bodies; -var Vertices = __webpack_require__(84); +var Vertices = __webpack_require__(86); var Common = __webpack_require__(37); -var Body = __webpack_require__(60); +var Body = __webpack_require__(61); var Bounds = __webpack_require__(100); var Vector = __webpack_require__(99); -var decomp = __webpack_require__(1328); +var decomp = __webpack_require__(1340); (function() { @@ -28439,7 +28683,7 @@ var decomp = __webpack_require__(1328); /***/ }), -/* 136 */ +/* 137 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28454,54 +28698,54 @@ var decomp = __webpack_require__(1328); module.exports = { - CalculateFacesAt: __webpack_require__(210), - CalculateFacesWithin: __webpack_require__(51), - Copy: __webpack_require__(1257), - CreateFromTiles: __webpack_require__(1258), - CullTiles: __webpack_require__(1259), - Fill: __webpack_require__(1260), - FilterTiles: __webpack_require__(1261), - FindByIndex: __webpack_require__(1262), - FindTile: __webpack_require__(1263), - ForEachTile: __webpack_require__(1264), - GetTileAt: __webpack_require__(137), - GetTileAtWorldXY: __webpack_require__(1265), - GetTilesWithin: __webpack_require__(21), - GetTilesWithinShape: __webpack_require__(1266), - GetTilesWithinWorldXY: __webpack_require__(1267), - HasTileAt: __webpack_require__(451), - HasTileAtWorldXY: __webpack_require__(1268), + CalculateFacesAt: __webpack_require__(212), + CalculateFacesWithin: __webpack_require__(52), + Copy: __webpack_require__(1261), + CreateFromTiles: __webpack_require__(1262), + CullTiles: __webpack_require__(1263), + Fill: __webpack_require__(1264), + FilterTiles: __webpack_require__(1265), + FindByIndex: __webpack_require__(1266), + FindTile: __webpack_require__(1267), + ForEachTile: __webpack_require__(1268), + GetTileAt: __webpack_require__(138), + GetTileAtWorldXY: __webpack_require__(1269), + GetTilesWithin: __webpack_require__(23), + GetTilesWithinShape: __webpack_require__(1270), + GetTilesWithinWorldXY: __webpack_require__(1271), + HasTileAt: __webpack_require__(454), + HasTileAtWorldXY: __webpack_require__(1272), IsInLayerBounds: __webpack_require__(101), - PutTileAt: __webpack_require__(211), - PutTileAtWorldXY: __webpack_require__(1269), - PutTilesAt: __webpack_require__(1270), - Randomize: __webpack_require__(1271), - RemoveTileAt: __webpack_require__(452), - RemoveTileAtWorldXY: __webpack_require__(1272), - RenderDebug: __webpack_require__(1273), - ReplaceByIndex: __webpack_require__(450), - SetCollision: __webpack_require__(1274), - SetCollisionBetween: __webpack_require__(1275), - SetCollisionByExclusion: __webpack_require__(1276), - SetCollisionByProperty: __webpack_require__(1277), - SetCollisionFromCollisionGroup: __webpack_require__(1278), - SetTileIndexCallback: __webpack_require__(1279), - SetTileLocationCallback: __webpack_require__(1280), - Shuffle: __webpack_require__(1281), - SwapByIndex: __webpack_require__(1282), - TileToWorldX: __webpack_require__(138), - TileToWorldXY: __webpack_require__(1283), - TileToWorldY: __webpack_require__(139), - WeightedRandomize: __webpack_require__(1284), - WorldToTileX: __webpack_require__(61), - WorldToTileXY: __webpack_require__(1285), - WorldToTileY: __webpack_require__(62) + PutTileAt: __webpack_require__(213), + PutTileAtWorldXY: __webpack_require__(1273), + PutTilesAt: __webpack_require__(1274), + Randomize: __webpack_require__(1275), + RemoveTileAt: __webpack_require__(455), + RemoveTileAtWorldXY: __webpack_require__(1276), + RenderDebug: __webpack_require__(1277), + ReplaceByIndex: __webpack_require__(453), + SetCollision: __webpack_require__(1278), + SetCollisionBetween: __webpack_require__(1279), + SetCollisionByExclusion: __webpack_require__(1280), + SetCollisionByProperty: __webpack_require__(1281), + SetCollisionFromCollisionGroup: __webpack_require__(1282), + SetTileIndexCallback: __webpack_require__(1283), + SetTileLocationCallback: __webpack_require__(1284), + Shuffle: __webpack_require__(1285), + SwapByIndex: __webpack_require__(1286), + TileToWorldX: __webpack_require__(139), + TileToWorldXY: __webpack_require__(1287), + TileToWorldY: __webpack_require__(140), + WeightedRandomize: __webpack_require__(1288), + WorldToTileX: __webpack_require__(62), + WorldToTileXY: __webpack_require__(1289), + WorldToTileY: __webpack_require__(63) }; /***/ }), -/* 137 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28557,7 +28801,7 @@ module.exports = GetTileAt; /***/ }), -/* 138 */ +/* 139 */ /***/ (function(module, exports) { /** @@ -28602,7 +28846,7 @@ module.exports = TileToWorldX; /***/ }), -/* 139 */ +/* 140 */ /***/ (function(module, exports) { /** @@ -28647,7 +28891,7 @@ module.exports = TileToWorldY; /***/ }), -/* 140 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29051,7 +29295,7 @@ module.exports = Tileset; /***/ }), -/* 141 */ +/* 142 */ /***/ (function(module, exports) { /** @@ -29061,16 +29305,17 @@ module.exports = Tileset; */ /** - * [description] + * Internal function used by the Tween Builder to create a function that will return + * the given value from the source. * * @function Phaser.Tweens.Builders.GetNewValue * @since 3.0.0 * - * @param {object} source - [description] - * @param {string} key - [description] - * @param {*} defaultValue - [description] + * @param {any} source - The source object to get the value from. + * @param {string} key - The property to get from the source. + * @param {any} defaultValue - A default value to return should the source not have the property set. * - * @return {function} [description] + * @return {function} A function which when called will return the property value from the source. */ var GetNewValue = function (source, key, defaultValue) { @@ -29082,9 +29327,9 @@ var GetNewValue = function (source, key, defaultValue) if (t === 'function') { - valueCallback = function (index, totalTargets, target) + valueCallback = function (target, targetKey, value, targetIndex, totalTargets, tween) { - return source[key](index, totalTargets, target); + return source[key](target, targetKey, value, targetIndex, totalTargets, tween); }; } else @@ -29114,7 +29359,7 @@ module.exports = GetNewValue; /***/ }), -/* 142 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29123,17 +29368,17 @@ module.exports = GetNewValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Defaults = __webpack_require__(219); +var Defaults = __webpack_require__(221); var GetAdvancedValue = __webpack_require__(14); -var GetBoolean = __webpack_require__(87); -var GetEaseFunction = __webpack_require__(96); -var GetNewValue = __webpack_require__(141); -var GetProps = __webpack_require__(473); -var GetTargets = __webpack_require__(217); -var GetValue = __webpack_require__(6); -var GetValueOp = __webpack_require__(218); -var Tween = __webpack_require__(220); -var TweenData = __webpack_require__(221); +var GetBoolean = __webpack_require__(88); +var GetEaseFunction = __webpack_require__(82); +var GetNewValue = __webpack_require__(142); +var GetProps = __webpack_require__(476); +var GetTargets = __webpack_require__(219); +var GetValue = __webpack_require__(5); +var GetValueOp = __webpack_require__(220); +var Tween = __webpack_require__(222); +var TweenData = __webpack_require__(224); /** * Creates a new Tween. @@ -29187,9 +29432,11 @@ var TweenBuilder = function (parent, config, defaults) var tweenData = TweenData( targets[t], + t, key, ops.getEnd, ops.getStart, + ops.getActive, GetEaseFunction(GetValue(value, 'ease', ease), easeParams), GetNewValue(value, 'delay', delay), GetNewValue(value, 'duration', duration), @@ -29245,7 +29492,7 @@ module.exports = TweenBuilder; /***/ }), -/* 143 */ +/* 144 */ /***/ (function(module, exports) { /** @@ -29379,7 +29626,7 @@ module.exports = ALIGN_CONST; /***/ }), -/* 144 */ +/* 145 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29388,7 +29635,7 @@ module.exports = ALIGN_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle. @@ -29418,7 +29665,7 @@ module.exports = CircumferencePoint; /***/ }), -/* 145 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29427,7 +29674,7 @@ module.exports = CircumferencePoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a uniformly distributed random point from anywhere within the given Circle. @@ -29462,7 +29709,7 @@ module.exports = Random; /***/ }), -/* 146 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29471,13 +29718,13 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(107); -var FindClosestInSorted = __webpack_require__(245); -var Frame = __webpack_require__(246); -var GetValue = __webpack_require__(6); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(108); +var FindClosestInSorted = __webpack_require__(248); +var Frame = __webpack_require__(249); +var GetValue = __webpack_require__(5); /** * @classdesc @@ -30310,9 +30557,11 @@ var Animation = new Class({ var len = this.frames.length; var slice = 1 / (len - 1); + var frame; + for (var i = 0; i < len; i++) { - var frame = this.frames[i]; + frame = this.frames[i]; frame.index = i + 1; frame.isFirst = false; @@ -30322,11 +30571,21 @@ var Animation = new Class({ if (i === 0) { frame.isFirst = true; - frame.isLast = (len === 1); - frame.prevFrame = this.frames[len - 1]; - frame.nextFrame = this.frames[i + 1]; + + if (len === 1) + { + frame.isLast = true; + frame.nextFrame = frame; + frame.prevFrame = frame; + } + else + { + frame.isLast = false; + frame.prevFrame = this.frames[len - 1]; + frame.nextFrame = this.frames[i + 1]; + } } - else if (i === len - 1) + else if (i === len - 1 && len > 1) { frame.isLast = true; frame.prevFrame = this.frames[len - 2]; @@ -30403,7 +30662,7 @@ module.exports = Animation; /***/ }), -/* 147 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30412,8 +30671,8 @@ module.exports = Animation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Perimeter = __webpack_require__(108); -var Point = __webpack_require__(3); +var Perimeter = __webpack_require__(109); +var Point = __webpack_require__(4); /** * Position is a value between 0 and 1 where 0 = the top-left of the rectangle and 0.5 = the bottom right. @@ -30480,7 +30739,7 @@ module.exports = GetPoint; /***/ }), -/* 148 */ +/* 149 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30489,8 +30748,8 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); -var Point = __webpack_require__(3); +var Length = __webpack_require__(56); +var Point = __webpack_require__(4); /** * Get a number of points along a line's length. @@ -30545,7 +30804,7 @@ module.exports = GetPoints; /***/ }), -/* 149 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30554,7 +30813,7 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a random point on a given Line. @@ -30585,7 +30844,7 @@ module.exports = Random; /***/ }), -/* 150 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30594,7 +30853,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a random point within a Rectangle. @@ -30623,7 +30882,7 @@ module.exports = Random; /***/ }), -/* 151 */ +/* 152 */ /***/ (function(module, exports) { /** @@ -30752,7 +31011,7 @@ module.exports = Pipeline; /***/ }), -/* 152 */ +/* 153 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30761,7 +31020,7 @@ module.exports = Pipeline; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a uniformly distributed random point from anywhere within the given Ellipse. @@ -30793,7 +31052,7 @@ module.exports = Random; /***/ }), -/* 153 */ +/* 154 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30802,7 +31061,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * [description] @@ -30849,7 +31108,7 @@ module.exports = Random; /***/ }), -/* 154 */ +/* 155 */ /***/ (function(module, exports) { /** @@ -30886,7 +31145,7 @@ module.exports = RotateAroundDistance; /***/ }), -/* 155 */ +/* 156 */ /***/ (function(module, exports) { /** @@ -30925,7 +31184,7 @@ module.exports = SmootherStep; /***/ }), -/* 156 */ +/* 157 */ /***/ (function(module, exports) { /** @@ -30972,7 +31231,7 @@ module.exports = SmoothStep; /***/ }), -/* 157 */ +/* 158 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31345,7 +31604,7 @@ module.exports = Map; /***/ }), -/* 158 */ +/* 159 */ /***/ (function(module, exports) { /** @@ -31421,7 +31680,7 @@ module.exports = Pad; /***/ }), -/* 159 */ +/* 160 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31430,10 +31689,10 @@ module.exports = Pad; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HexStringToColor = __webpack_require__(269); -var IntegerToColor = __webpack_require__(272); -var ObjectToColor = __webpack_require__(274); -var RGBStringToColor = __webpack_require__(275); +var HexStringToColor = __webpack_require__(272); +var IntegerToColor = __webpack_require__(275); +var ObjectToColor = __webpack_require__(277); +var RGBStringToColor = __webpack_require__(278); /** * Converts the given source color value into an instance of a Color class. @@ -31477,7 +31736,7 @@ module.exports = ValueToColor; /***/ }), -/* 160 */ +/* 161 */ /***/ (function(module, exports) { /** @@ -31507,7 +31766,7 @@ module.exports = GetColor; /***/ }), -/* 161 */ +/* 162 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31516,7 +31775,7 @@ module.exports = GetColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColor = __webpack_require__(160); +var GetColor = __webpack_require__(161); /** * Converts an HSV (hue, saturation and value) color value to RGB. @@ -31608,7 +31867,7 @@ module.exports = HSVToRGB; /***/ }), -/* 162 */ +/* 163 */ /***/ (function(module, exports) { /** @@ -31645,7 +31904,7 @@ module.exports = CenterOn; /***/ }), -/* 163 */ +/* 164 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31654,18 +31913,18 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Back = __webpack_require__(277); -var Bounce = __webpack_require__(278); -var Circular = __webpack_require__(279); -var Cubic = __webpack_require__(280); -var Elastic = __webpack_require__(281); -var Expo = __webpack_require__(282); -var Linear = __webpack_require__(283); -var Quadratic = __webpack_require__(284); -var Quartic = __webpack_require__(285); -var Quintic = __webpack_require__(286); -var Sine = __webpack_require__(287); -var Stepped = __webpack_require__(288); +var Back = __webpack_require__(280); +var Bounce = __webpack_require__(281); +var Circular = __webpack_require__(282); +var Cubic = __webpack_require__(283); +var Elastic = __webpack_require__(284); +var Expo = __webpack_require__(285); +var Linear = __webpack_require__(286); +var Quadratic = __webpack_require__(287); +var Quartic = __webpack_require__(288); +var Quintic = __webpack_require__(289); +var Sine = __webpack_require__(290); +var Stepped = __webpack_require__(291); // EaseMap module.exports = { @@ -31726,7 +31985,7 @@ module.exports = { /***/ }), -/* 164 */ +/* 165 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31735,9 +31994,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(115); -var Browser = __webpack_require__(116); -var CanvasPool = __webpack_require__(24); +var OS = __webpack_require__(116); +var Browser = __webpack_require__(117); +var CanvasPool = __webpack_require__(25); /** * Determines the features of the browser running this Phaser Game instance. @@ -31918,7 +32177,7 @@ module.exports = init(); /***/ }), -/* 165 */ +/* 166 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31927,8 +32186,8 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(22); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Math @@ -31937,61 +32196,62 @@ var Extend = __webpack_require__(17); var PhaserMath = { // Collections of functions - Angle: __webpack_require__(686), - Distance: __webpack_require__(694), - Easing: __webpack_require__(696), - Fuzzy: __webpack_require__(697), - Interpolation: __webpack_require__(700), - Pow2: __webpack_require__(705), - Snap: __webpack_require__(707), + Angle: __webpack_require__(690), + Distance: __webpack_require__(698), + Easing: __webpack_require__(700), + Fuzzy: __webpack_require__(701), + Interpolation: __webpack_require__(704), + Pow2: __webpack_require__(709), + Snap: __webpack_require__(711), // Expose the RNG Class - RandomDataGenerator: __webpack_require__(709), + RandomDataGenerator: __webpack_require__(713), // Single functions - Average: __webpack_require__(710), - Bernstein: __webpack_require__(297), - Between: __webpack_require__(168), - CatmullRom: __webpack_require__(167), - CeilTo: __webpack_require__(711), - Clamp: __webpack_require__(22), + Average: __webpack_require__(714), + Bernstein: __webpack_require__(300), + Between: __webpack_require__(169), + CatmullRom: __webpack_require__(168), + CeilTo: __webpack_require__(715), + Clamp: __webpack_require__(24), DegToRad: __webpack_require__(35), - Difference: __webpack_require__(712), - Factorial: __webpack_require__(298), - FloatBetween: __webpack_require__(304), - FloorTo: __webpack_require__(713), - FromPercent: __webpack_require__(86), - GetSpeed: __webpack_require__(714), - IsEven: __webpack_require__(715), - IsEvenStrict: __webpack_require__(716), - Linear: __webpack_require__(114), - MaxAdd: __webpack_require__(717), - MinSub: __webpack_require__(718), - Percent: __webpack_require__(719), - RadToDeg: __webpack_require__(169), - RandomXY: __webpack_require__(720), - RandomXYZ: __webpack_require__(721), - RandomXYZW: __webpack_require__(722), - Rotate: __webpack_require__(305), - RotateAround: __webpack_require__(251), - RotateAroundDistance: __webpack_require__(154), - RoundAwayFromZero: __webpack_require__(306), - RoundTo: __webpack_require__(723), - SinCosTableGenerator: __webpack_require__(724), - SmootherStep: __webpack_require__(155), - SmoothStep: __webpack_require__(156), - TransformXY: __webpack_require__(307), - Within: __webpack_require__(725), - Wrap: __webpack_require__(56), + Difference: __webpack_require__(716), + Factorial: __webpack_require__(301), + FloatBetween: __webpack_require__(307), + FloorTo: __webpack_require__(717), + FromPercent: __webpack_require__(87), + GetSpeed: __webpack_require__(718), + IsEven: __webpack_require__(719), + IsEvenStrict: __webpack_require__(720), + Linear: __webpack_require__(115), + MaxAdd: __webpack_require__(721), + MinSub: __webpack_require__(722), + Percent: __webpack_require__(723), + RadToDeg: __webpack_require__(170), + RandomXY: __webpack_require__(724), + RandomXYZ: __webpack_require__(725), + RandomXYZW: __webpack_require__(726), + Rotate: __webpack_require__(308), + RotateAround: __webpack_require__(254), + RotateAroundDistance: __webpack_require__(155), + RoundAwayFromZero: __webpack_require__(309), + RoundTo: __webpack_require__(727), + SinCosTableGenerator: __webpack_require__(728), + SmootherStep: __webpack_require__(156), + SmoothStep: __webpack_require__(157), + ToXY: __webpack_require__(729), + TransformXY: __webpack_require__(310), + Within: __webpack_require__(730), + Wrap: __webpack_require__(57), // Vector classes - Vector2: __webpack_require__(4), - Vector3: __webpack_require__(170), - Vector4: __webpack_require__(308), - Matrix3: __webpack_require__(309), - Matrix4: __webpack_require__(310), - Quaternion: __webpack_require__(311), - RotateVec3: __webpack_require__(726) + Vector2: __webpack_require__(3), + Vector3: __webpack_require__(171), + Vector4: __webpack_require__(311), + Matrix3: __webpack_require__(312), + Matrix4: __webpack_require__(313), + Quaternion: __webpack_require__(314), + RotateVec3: __webpack_require__(731) }; @@ -32005,7 +32265,7 @@ module.exports = PhaserMath; /***/ }), -/* 166 */ +/* 167 */ /***/ (function(module, exports) { /** @@ -32039,7 +32299,7 @@ module.exports = Equal; /***/ }), -/* 167 */ +/* 168 */ /***/ (function(module, exports) { /** @@ -32076,7 +32336,7 @@ module.exports = CatmullRom; /***/ }), -/* 168 */ +/* 169 */ /***/ (function(module, exports) { /** @@ -32105,7 +32365,7 @@ module.exports = Between; /***/ }), -/* 169 */ +/* 170 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32114,7 +32374,7 @@ module.exports = Between; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); +var CONST = __webpack_require__(22); /** * Convert the given angle in radians, to the equivalent angle in degrees. @@ -32135,7 +32395,7 @@ module.exports = RadToDeg; /***/ }), -/* 170 */ +/* 171 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32945,7 +33205,7 @@ module.exports = Vector3; /***/ }), -/* 171 */ +/* 172 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33046,7 +33306,7 @@ module.exports = DefaultPlugins; /***/ }), -/* 172 */ +/* 173 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33055,7 +33315,7 @@ module.exports = DefaultPlugins; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); // points is an array of Point-like objects, // either 2 dimensional arrays, or objects with public x/y properties: @@ -33131,7 +33391,7 @@ module.exports = FromPoints; /***/ }), -/* 173 */ +/* 174 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33142,10 +33402,10 @@ module.exports = FromPoints; var CONST = { - CENTER: __webpack_require__(331), - ORIENTATION: __webpack_require__(332), - SCALE_MODE: __webpack_require__(333), - ZOOM: __webpack_require__(334) + CENTER: __webpack_require__(334), + ORIENTATION: __webpack_require__(335), + SCALE_MODE: __webpack_require__(336), + ZOOM: __webpack_require__(337) }; @@ -33153,7 +33413,7 @@ module.exports = CONST; /***/ }), -/* 174 */ +/* 175 */ /***/ (function(module, exports) { /** @@ -33182,7 +33442,7 @@ module.exports = RemoveFromDOM; /***/ }), -/* 175 */ +/* 176 */ /***/ (function(module, exports) { /** @@ -33280,7 +33540,7 @@ module.exports = INPUT_CONST; /***/ }), -/* 176 */ +/* 177 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33290,13 +33550,13 @@ module.exports = INPUT_CONST; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(122); -var DefaultPlugins = __webpack_require__(171); -var Events = __webpack_require__(19); -var GetPhysicsPlugins = __webpack_require__(839); -var GetScenePlugins = __webpack_require__(840); +var CONST = __webpack_require__(123); +var DefaultPlugins = __webpack_require__(172); +var Events = __webpack_require__(20); +var GetPhysicsPlugins = __webpack_require__(844); +var GetScenePlugins = __webpack_require__(845); var NOOP = __webpack_require__(1); -var Settings = __webpack_require__(348); +var Settings = __webpack_require__(350); /** * @classdesc @@ -33451,7 +33711,7 @@ var Systems = new Class({ * In the default set-up you can access this from within a Scene via the `this.sound` property. * * @name Phaser.Scenes.Systems#sound - * @type {Phaser.Sound.BaseSoundManager} + * @type {(Phaser.Sound.NoAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager)} * @since 3.0.0 */ this.sound; @@ -34038,7 +34298,44 @@ module.exports = Systems; /***/ }), -/* 177 */ +/* 178 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Capitalizes the first letter of a string if there is one. + * @example + * UppercaseFirst('abc'); + * // returns 'Abc' + * @example + * UppercaseFirst('the happy family'); + * // returns 'The happy family' + * @example + * UppercaseFirst(''); + * // returns '' + * + * @function Phaser.Utils.String.UppercaseFirst + * @since 3.0.0 + * + * @param {string} str - The string to capitalize. + * + * @return {string} A new string, same as the first, but with the first letter capitalized. + */ +var UppercaseFirst = function (str) +{ + return str && str[0].toUpperCase() + str.slice(1); +}; + +module.exports = UppercaseFirst; + + +/***/ }), +/* 179 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34048,8 +34345,8 @@ module.exports = Systems; */ var Class = __webpack_require__(0); -var Frame = __webpack_require__(91); -var TextureSource = __webpack_require__(350); +var Frame = __webpack_require__(92); +var TextureSource = __webpack_require__(353); var TEXTURE_MISSING_ERROR = 'Texture.frame missing: '; @@ -34220,6 +34517,35 @@ var Texture = new Class({ return frame; }, + /** + * Removes the given Frame from this Texture. The Frame is destroyed immediately. + * + * Any Game Objects using this Frame should stop using it _before_ you remove it, + * as it does not happen automatically. + * + * @method Phaser.Textures.Texture#remove + * @since 3.19.0 + * + * @param {string} name - The key of the Frame to remove. + * + * @return {boolean} True if a Frame with the matching key was removed from this Texture. + */ + remove: function (name) + { + if (this.has(name)) + { + var frame = this.get(name); + + frame.destroy(); + + delete this.frames[name]; + + return true; + } + + return false; + }, + /** * Checks to see if a Frame matching the given key exists within this Texture. * @@ -34529,7 +34855,7 @@ module.exports = Texture; /***/ }), -/* 178 */ +/* 180 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34544,45 +34870,45 @@ module.exports = Texture; module.exports = { - Matrix: __webpack_require__(876), + Matrix: __webpack_require__(880), - Add: __webpack_require__(883), - AddAt: __webpack_require__(884), - BringToTop: __webpack_require__(885), - CountAllMatching: __webpack_require__(886), - Each: __webpack_require__(887), - EachInRange: __webpack_require__(888), - FindClosestInSorted: __webpack_require__(245), - GetAll: __webpack_require__(889), - GetFirst: __webpack_require__(890), - GetRandom: __webpack_require__(180), - MoveDown: __webpack_require__(891), - MoveTo: __webpack_require__(892), - MoveUp: __webpack_require__(893), - NumberArray: __webpack_require__(894), - NumberArrayStep: __webpack_require__(895), - QuickSelect: __webpack_require__(361), - Range: __webpack_require__(362), - Remove: __webpack_require__(120), - RemoveAt: __webpack_require__(896), - RemoveBetween: __webpack_require__(897), - RemoveRandomElement: __webpack_require__(898), - Replace: __webpack_require__(899), - RotateLeft: __webpack_require__(261), - RotateRight: __webpack_require__(262), - SafeRange: __webpack_require__(66), - SendToBack: __webpack_require__(900), - SetAll: __webpack_require__(901), - Shuffle: __webpack_require__(111), - SpliceOne: __webpack_require__(78), - StableSort: __webpack_require__(127), - Swap: __webpack_require__(902) + Add: __webpack_require__(887), + AddAt: __webpack_require__(888), + BringToTop: __webpack_require__(889), + CountAllMatching: __webpack_require__(890), + Each: __webpack_require__(891), + EachInRange: __webpack_require__(892), + FindClosestInSorted: __webpack_require__(248), + GetAll: __webpack_require__(893), + GetFirst: __webpack_require__(894), + GetRandom: __webpack_require__(182), + MoveDown: __webpack_require__(895), + MoveTo: __webpack_require__(896), + MoveUp: __webpack_require__(897), + NumberArray: __webpack_require__(898), + NumberArrayStep: __webpack_require__(899), + QuickSelect: __webpack_require__(364), + Range: __webpack_require__(365), + Remove: __webpack_require__(121), + RemoveAt: __webpack_require__(900), + RemoveBetween: __webpack_require__(901), + RemoveRandomElement: __webpack_require__(902), + Replace: __webpack_require__(903), + RotateLeft: __webpack_require__(264), + RotateRight: __webpack_require__(265), + SafeRange: __webpack_require__(67), + SendToBack: __webpack_require__(904), + SetAll: __webpack_require__(905), + Shuffle: __webpack_require__(112), + SpliceOne: __webpack_require__(79), + StableSort: __webpack_require__(128), + Swap: __webpack_require__(906) }; /***/ }), -/* 179 */ +/* 181 */ /***/ (function(module, exports) { /** @@ -34643,7 +34969,7 @@ module.exports = CheckMatrix; /***/ }), -/* 180 */ +/* 182 */ /***/ (function(module, exports) { /** @@ -34678,7 +35004,7 @@ module.exports = GetRandom; /***/ }), -/* 181 */ +/* 183 */ /***/ (function(module, exports) { /** @@ -34819,7 +35145,7 @@ module.exports = ParseXMLBitmapFont; /***/ }), -/* 182 */ +/* 184 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34828,13 +35154,13 @@ module.exports = ParseXMLBitmapFont; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlitterRender = __webpack_require__(909); -var Bob = __webpack_require__(912); +var BlitterRender = __webpack_require__(913); +var Bob = __webpack_require__(916); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Frame = __webpack_require__(91); +var Frame = __webpack_require__(92); var GameObject = __webpack_require__(13); -var List = __webpack_require__(125); +var List = __webpack_require__(126); /** * @callback CreateCallback @@ -35118,7 +35444,7 @@ module.exports = Blitter; /***/ }), -/* 183 */ +/* 185 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35128,16 +35454,16 @@ module.exports = Blitter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(178); -var BlendModes = __webpack_require__(52); +var ArrayUtils = __webpack_require__(180); +var BlendModes = __webpack_require__(53); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Events = __webpack_require__(110); +var Events = __webpack_require__(111); var GameObject = __webpack_require__(13); -var Rectangle = __webpack_require__(10); -var Render = __webpack_require__(913); -var Union = __webpack_require__(364); -var Vector2 = __webpack_require__(4); +var Rectangle = __webpack_require__(11); +var Render = __webpack_require__(917); +var Union = __webpack_require__(367); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -36443,7 +36769,7 @@ module.exports = Container; /***/ }), -/* 184 */ +/* 186 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36452,9 +36778,9 @@ module.exports = Container; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(128); +var BitmapText = __webpack_require__(129); var Class = __webpack_require__(0); -var Render = __webpack_require__(918); +var Render = __webpack_require__(922); /** * @classdesc @@ -36676,7 +37002,7 @@ module.exports = DynamicBitmapText; /***/ }), -/* 185 */ +/* 187 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36685,26 +37011,26 @@ module.exports = DynamicBitmapText; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(112); +var BaseCamera = __webpack_require__(113); var Class = __webpack_require__(0); -var Commands = __webpack_require__(186); -var ComponentsAlpha = __webpack_require__(244); -var ComponentsBlendMode = __webpack_require__(247); -var ComponentsDepth = __webpack_require__(248); -var ComponentsMask = __webpack_require__(252); -var ComponentsPipeline = __webpack_require__(151); -var ComponentsTransform = __webpack_require__(257); -var ComponentsVisible = __webpack_require__(258); -var ComponentsScrollFactor = __webpack_require__(255); +var Commands = __webpack_require__(188); +var ComponentsAlpha = __webpack_require__(247); +var ComponentsBlendMode = __webpack_require__(250); +var ComponentsDepth = __webpack_require__(251); +var ComponentsMask = __webpack_require__(255); +var ComponentsPipeline = __webpack_require__(152); +var ComponentsTransform = __webpack_require__(260); +var ComponentsVisible = __webpack_require__(261); +var ComponentsScrollFactor = __webpack_require__(258); var TransformMatrix = __webpack_require__(32); -var Ellipse = __webpack_require__(92); +var Ellipse = __webpack_require__(93); var GameObject = __webpack_require__(13); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); -var MATH_CONST = __webpack_require__(23); -var Render = __webpack_require__(924); +var GetValue = __webpack_require__(5); +var MATH_CONST = __webpack_require__(22); +var Render = __webpack_require__(928); /** * @classdesc @@ -38226,7 +38552,7 @@ module.exports = Graphics; /***/ }), -/* 186 */ +/* 188 */ /***/ (function(module, exports) { /** @@ -38263,7 +38589,7 @@ module.exports = { /***/ }), -/* 187 */ +/* 189 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38272,7 +38598,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse based on the given angle. @@ -38305,7 +38631,7 @@ module.exports = CircumferencePoint; /***/ }), -/* 188 */ +/* 190 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38317,10 +38643,10 @@ module.exports = CircumferencePoint; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var GravityWell = __webpack_require__(372); -var List = __webpack_require__(125); -var ParticleEmitter = __webpack_require__(374); -var Render = __webpack_require__(934); +var GravityWell = __webpack_require__(375); +var List = __webpack_require__(126); +var ParticleEmitter = __webpack_require__(377); +var Render = __webpack_require__(938); /** * @classdesc @@ -38779,7 +39105,7 @@ module.exports = ParticleEmitterManager; /***/ }), -/* 189 */ +/* 191 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38788,17 +39114,17 @@ module.exports = ParticleEmitterManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(52); -var Camera = __webpack_require__(112); -var CanvasPool = __webpack_require__(24); +var BlendModes = __webpack_require__(53); +var Camera = __webpack_require__(113); +var CanvasPool = __webpack_require__(25); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(26); -var Frame = __webpack_require__(91); +var CONST = __webpack_require__(31); +var Frame = __webpack_require__(92); var GameObject = __webpack_require__(13); -var Render = __webpack_require__(938); +var Render = __webpack_require__(942); var Utils = __webpack_require__(9); -var UUID = __webpack_require__(380); +var UUID = __webpack_require__(383); /** * @classdesc @@ -39044,6 +39370,17 @@ var RenderTexture = new Class({ */ this.gl = null; + /** + * A reference to the WebGLTexture that is being rendered to in a WebGL Context. + * + * @name Phaser.GameObjects.RenderTexture#glTexture + * @type {WebGLTexture} + * @default null + * @readonly + * @since 3.19.0 + */ + this.glTexture = null; + var renderer = this.renderer; if (renderer.type === CONST.WEBGL) @@ -39051,8 +39388,9 @@ var RenderTexture = new Class({ var gl = renderer.gl; this.gl = gl; + this.glTexture = this.frame.source.glTexture; this.drawGameObject = this.batchGameObjectWebGL; - this.framebuffer = renderer.createFramebuffer(width, height, this.frame.source.glTexture, false); + this.framebuffer = renderer.createFramebuffer(width, height, this.glTexture, false); } else if (renderer.type === CONST.CANVAS) { @@ -39117,7 +39455,8 @@ var RenderTexture = new Class({ { if (this.frame.name === '__BASE') { - // Tesize the texture + // Resize the texture + this.canvas.width = width; this.canvas.height = height; @@ -39128,10 +39467,14 @@ var RenderTexture = new Class({ this.renderer.deleteTexture(this.frame.source.glTexture); this.renderer.deleteFramebuffer(this.framebuffer); - this.frame.source.glTexture = this.renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false); - this.framebuffer = this.renderer.createFramebuffer(width, height, this.frame.source.glTexture, false); + var glTexture = this.renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false); - this.frame.glTexture = this.frame.source.glTexture; + this.framebuffer = this.renderer.createFramebuffer(width, height, glTexture, false); + + this.frame.source.isRenderTexture = true; + + this.frame.glTexture = glTexture; + this.glTexture = glTexture; } this.frame.source.width = width; @@ -39784,8 +40127,6 @@ var RenderTexture = new Class({ * @param {number} [y=0] - The y position to offset the Game Object by. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. * @param {number} [tint] - The tint color to use. If not specified it uses the `globalTint` property. - * - * @return {boolean} `true` if the frame was found and drawn, otherwise `false`. */ batchTextureFrameKey: function (key, frame, x, y, alpha, tint) { @@ -39837,6 +40178,114 @@ var RenderTexture = new Class({ } }, + /** + * Takes a snapshot of the given area of this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture the whole Render Texture see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.GameObjects.RenderTexture#snapshotArea + * @since 3.19.0 + * + * @param {integer} x - The x coordinate to grab from. + * @param {integer} y - The y coordinate to grab from. + * @param {integer} width - The width of the area to grab. + * @param {integer} height - The height of the area to grab. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This Render Texture instance. + */ + snapshotArea: function (x, y, width, height, callback, type, encoderOptions) + { + if (this.gl) + { + this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, x, y, width, height, type, encoderOptions); + } + else + { + this.renderer.snapshotCanvas(this.canvas, callback, false, x, y, width, height, type, encoderOptions); + } + + return this; + }, + + /** + * Takes a snapshot of the whole of this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture just a portion of the Render Texture see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.GameObjects.RenderTexture#snapshot + * @since 3.19.0 + * + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This Render Texture instance. + */ + snapshot: function (callback, type, encoderOptions) + { + if (this.gl) + { + this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, 0, 0, this.width, this.height, type, encoderOptions); + } + else + { + this.renderer.snapshotCanvas(this.canvas, callback, false, 0, 0, this.width, this.height, type, encoderOptions); + } + + return this; + }, + + /** + * Takes a snapshot of the given pixel from this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture the whole Render Texture see the `snapshot` method. To capture a specific portion, see `snapshotArea`. + * + * Unlike the other two snapshot methods, this one will send your callback a `Color` object containing the color data for + * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, + * using less memory, than the other snapshot methods. + * + * @method Phaser.GameObjects.RenderTexture#snapshotPixel + * @since 3.19.0 + * + * @param {integer} x - The x coordinate of the pixel to get. + * @param {integer} y - The y coordinate of the pixel to get. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. + * + * @return {this} This Render Texture instance. + */ + snapshotPixel: function (x, y, callback) + { + if (this.gl) + { + this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, true, x, y); + } + else + { + this.renderer.snapshotCanvas(this.canvas, callback, true, x, y); + } + + return this; + }, + /** * Internal destroy handler, called as part of the destroy process. * @@ -39862,6 +40311,7 @@ var RenderTexture = new Class({ this.context = null; this.framebuffer = null; this.texture = null; + this.glTexture = null; } } @@ -39871,7 +40321,7 @@ module.exports = RenderTexture; /***/ }), -/* 190 */ +/* 192 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39880,17 +40330,17 @@ module.exports = RenderTexture; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(119); -var CanvasPool = __webpack_require__(24); +var AddToDOM = __webpack_require__(120); +var CanvasPool = __webpack_require__(25); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(26); +var GameEvents = __webpack_require__(18); var GameObject = __webpack_require__(13); -var GetTextSize = __webpack_require__(944); -var GetValue = __webpack_require__(6); -var RemoveFromDOM = __webpack_require__(174); -var TextRender = __webpack_require__(945); -var TextStyle = __webpack_require__(948); +var GetTextSize = __webpack_require__(948); +var GetValue = __webpack_require__(5); +var RemoveFromDOM = __webpack_require__(175); +var TextRender = __webpack_require__(949); +var TextStyle = __webpack_require__(952); /** * @classdesc @@ -39957,7 +40407,7 @@ var TextStyle = __webpack_require__(948); * @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|string[])} text - The text this Text object will display. - * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The text style configuration object. + * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The text style configuration object. */ var Text = new Class({ @@ -40164,13 +40614,10 @@ var Text = new Class({ this.lineSpacing = style.lineSpacing; } - if (scene.sys.game.config.renderType === CONST.WEBGL) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function () { - scene.sys.game.renderer.onContextRestored(function () - { - this.dirty = true; - }, this); - } + this.dirty = true; + }, this); }, /** @@ -41279,7 +41726,7 @@ module.exports = Text; /***/ }), -/* 191 */ +/* 193 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41288,15 +41735,15 @@ module.exports = Text; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); +var CanvasPool = __webpack_require__(25); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(26); +var GameEvents = __webpack_require__(18); var GameObject = __webpack_require__(13); -var GetPowerOfTwo = __webpack_require__(302); -var Smoothing = __webpack_require__(113); -var TileSpriteRender = __webpack_require__(950); -var Vector2 = __webpack_require__(4); +var GetPowerOfTwo = __webpack_require__(305); +var Smoothing = __webpack_require__(114); +var TileSpriteRender = __webpack_require__(954); +var Vector2 = __webpack_require__(3); // bitmask flag for GameObject.renderMask var _FLAG = 8; // 1000 @@ -41559,17 +42006,15 @@ var TileSprite = new Class({ this.setOriginFromFrame(); this.initPipeline(); - if (scene.sys.game.config.renderType === CONST.WEBGL) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) { - scene.sys.game.renderer.onContextRestored(function (renderer) - { - var gl = renderer.gl; + var gl = renderer.gl; - this.dirty = true; - this.fillPattern = null; - this.fillPattern = renderer.createTexture2D(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.fillCanvas, this.potWidth, this.potHeight); - }, this); - } + this.dirty = true; + this.fillPattern = null; + this.fillPattern = renderer.createTexture2D(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.fillCanvas, this.potWidth, this.potHeight); + + }, this); }, /** @@ -41916,7 +42361,7 @@ module.exports = TileSprite; /***/ }), -/* 192 */ +/* 194 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41926,8 +42371,9 @@ module.exports = TileSprite; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(193); -var GetPoints = __webpack_require__(390); +var Contains = __webpack_require__(195); +var GetPoints = __webpack_require__(393); +var GEOM_CONST = __webpack_require__(47); /** * @classdesc @@ -41958,6 +42404,17 @@ var Polygon = new Class({ function Polygon (points) { + /** + * The geometry constant type of this object: `GEOM_CONST.POLYGON`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Polygon#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.POLYGON; + /** * The area of this Polygon. * @@ -42137,7 +42594,7 @@ module.exports = Polygon; /***/ }), -/* 193 */ +/* 195 */ /***/ (function(module, exports) { /** @@ -42186,7 +42643,7 @@ module.exports = Contains; /***/ }), -/* 194 */ +/* 196 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42196,7 +42653,7 @@ module.exports = Contains; */ var Class = __webpack_require__(0); -var Mesh = __webpack_require__(129); +var Mesh = __webpack_require__(130); /** * @classdesc @@ -42847,7 +43304,7 @@ module.exports = Quad; /***/ }), -/* 195 */ +/* 197 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42860,9 +43317,9 @@ var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); var GetFastValue = __webpack_require__(2); -var Merge = __webpack_require__(85); -var SetValue = __webpack_require__(398); -var ShaderRender = __webpack_require__(1029); +var Extend = __webpack_require__(15); +var SetValue = __webpack_require__(401); +var ShaderRender = __webpack_require__(1033); var TransformMatrix = __webpack_require__(32); /** @@ -43152,12 +43609,163 @@ var Shader = new Class({ */ this._textureCount = 0; + /** + * A reference to the GL Frame Buffer this Shader is drawing to. + * This property is only set if you have called `Shader.setRenderToTexture`. + * + * @name Phaser.GameObjects.Shader#framebuffer + * @type {?WebGLFramebuffer} + * @since 3.19.0 + */ + this.framebuffer = null; + + /** + * A reference to the WebGLTexture this Shader is rendering to. + * This property is only set if you have called `Shader.setRenderToTexture`. + * + * @name Phaser.GameObjects.Shader#glTexture + * @type {?WebGLTexture} + * @since 3.19.0 + */ + this.glTexture = null; + + /** + * A flag that indicates if this Shader has been set to render to a texture instead of the display list. + * + * This property is `true` if you have called `Shader.setRenderToTexture`, otherwise it's `false`. + * + * A Shader that is rendering to a texture _does not_ appear on the display list. + * + * @name Phaser.GameObjects.Shader#renderToTexture + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this.renderToTexture = false; + + /** + * A reference to the Phaser.Textures.Texture that has been stored in the Texture Manager for this Shader. + * + * This property is only set if you have called `Shader.setRenderToTexture`, otherwise it is `null`. + * + * @name Phaser.GameObjects.Shader#texture + * @type {Phaser.Textures.Texture} + * @since 3.19.0 + */ + this.texture = null; + + /** + * Internal saved texture key. + * + * @name Phaser.GameObjects.Shader#_savedKey + * @type {boolean} + * @private + * @since 3.19.0 + */ + this._savedKey = ''; + this.setPosition(x, y); this.setSize(width, height); this.setOrigin(0.5, 0.5); this.setShader(key, textures); }, + /** + * 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.Shader#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) + { + if (this.renderToTexture) + { + return true; + } + else + { + return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + } + }, + + /** + * Changes this Shader so instead of rendering to the display list it renders to a + * WebGL Framebuffer and WebGL Texture instead. This allows you to use the output + * of this shader as an input for another shader, by mapping a sampler2D uniform + * to it. + * + * After calling this method the `Shader.framebuffer` and `Shader.glTexture` properties + * are populated. + * + * Additionally, you can provide a key to this method. Doing so will create a Phaser Texture + * from this Shader and save it into the Texture Manager, allowing you to then use it for + * any texture-based Game Object, such as a Sprite or Image: + * + * ```javascript + * var shader = this.add.shader('myShader', x, y, width, height); + * + * shader.setRenderToTexture('doodle'); + * + * this.add.image(400, 300, 'doodle'); + * ``` + * + * Note that it stores an active reference to this Shader. That means as this shader updates, + * so does the texture and any object using it to render with. Also, if you destroy this + * shader, be sure to clear any objects that may have been using it as a texture too. + * + * You can access the Phaser Texture that is created via the `Shader.texture` property. + * + * By default it will create a single base texture. You can add frames to the texture + * by using the `Texture.add` method. After doing this, you can then allow Game Objects + * to use a specific frame from a Render Texture. + * + * @method Phaser.GameObjects.Shader#setRenderToTexture + * @since 3.19.0 + * + * @param {string} [key] - The unique key to store the texture as within the global Texture Manager. + * @param {boolean} [flipY=false] - Does this texture need vertically flipping before rendering? This should usually be set to `true` if being fed from a buffer. + * + * @return {this} This Shader instance. + */ + setRenderToTexture: function (key, flipY) + { + if (flipY === undefined) { flipY = false; } + + if (!this.renderToTexture) + { + var width = this.width; + var height = this.height; + var renderer = this.renderer; + + this.glTexture = renderer.createTextureFromSource(null, width, height, 0); + + this.glTexture.flipY = flipY; + + this.framebuffer = renderer.createFramebuffer(width, height, this.glTexture, false); + + this._rendererWidth = width; + this._rendererHeight = height; + + this.renderToTexture = true; + + this.projOrtho(0, this.width, this.height, 0); + + if (key) + { + this._savedKey = key; + + this.texture = this.scene.sys.textures.addGLTexture(key, this.glTexture, width, height); + } + } + + return this; + }, + /** * Sets the fragment and, optionally, the vertex shader source code that this Shader will use. * This will immediately delete the active shader program, if set, and then create a new one @@ -43213,7 +43821,7 @@ var Shader = new Class({ // The default uniforms available within the fragment shader var defaultUniforms = { - resolution: { type: '2f', value: { x: this.width, y: this.height }}, + resolution: { type: '2f', value: { x: this.width, y: this.height } }, time: { type: '1f', value: 0 }, mouse: { type: '2f', value: { x: this.width / 2, y: this.height / 2 } }, date: { type: '4fv', value: [ d.getFullYear(), d.getMonth(), d.getDate(), d.getHours() * 60 * 60 + d.getMinutes() * 60 + d.getSeconds() ] }, @@ -43223,10 +43831,10 @@ var Shader = new Class({ iChannel2: { type: 'sampler2D', value: null, textureData: { repeat: true } }, iChannel3: { type: 'sampler2D', value: null, textureData: { repeat: true } } }; - + if (this.shader.uniforms) { - this.uniforms = Merge(this.shader.uniforms, defaultUniforms); + this.uniforms = Extend(true, {}, this.shader.uniforms, defaultUniforms); } else { @@ -43243,7 +43851,7 @@ var Shader = new Class({ this.initUniforms(); - this.projOrtho(0, renderer.width, renderer.height, 0); + this.projOrtho(0, this._rendererWidth, this._rendererHeight, 0); return this; }, @@ -43343,12 +43951,66 @@ var Shader = new Class({ } }, + /** + * Sets a sampler2D uniform on this shader where the source texture is a WebGLTexture. + * + * This allows you to feed the output from one Shader into another: + * + * ```javascript + * let shader1 = this.add.shader(baseShader1, 0, 0, 512, 512).setRenderToTexture(); + * let shader2 = this.add.shader(baseShader2, 0, 0, 512, 512).setRenderToTexture('output'); + * + * shader1.setSampler2DBuffer('iChannel0', shader2.glTexture, 512, 512); + * shader2.setSampler2DBuffer('iChannel0', shader1.glTexture, 512, 512); + * ``` + * + * In the above code, the result of baseShader1 is fed into Shader2 as the `iChannel0` sampler2D uniform. + * The result of baseShader2 is then fed back into shader1 again, creating a feedback loop. + * + * If you wish to use an image from the Texture Manager as a sampler2D input for this shader, + * see the `Shader.setSampler2D` method. + * + * @method Phaser.GameObjects.Shader#setSampler2DBuffer + * @since 3.19.0 + * + * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`. + * @param {WebGLTexture} texture - A WebGLTexture reference. + * @param {integer} width - The width of the texture. + * @param {integer} height - The height of the texture. + * @param {integer} [textureIndex=0] - The texture index. + * @param {any} [textureData] - Additional texture data. + * + * @return {this} This Shader instance. + */ + setSampler2DBuffer: function (uniformKey, texture, width, height, textureIndex, textureData) + { + if (textureIndex === undefined) { textureIndex = 0; } + if (textureData === undefined) { textureData = {}; } + + var uniform = this.uniforms[uniformKey]; + + uniform.value = texture; + + textureData.width = width; + textureData.height = height; + + uniform.textureData = textureData; + + this._textureCount = textureIndex; + + this.initSampler2D(uniform); + + return this; + }, + /** * Sets a sampler2D uniform on this shader. * * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. * + * If you wish to use another Shader as a sampler2D input for this shader, see the `Shader.setSampler2DBuffer` method. + * * @method Phaser.GameObjects.Shader#setSampler2D * @since 3.17.0 * @@ -43369,11 +44031,23 @@ var Shader = new Class({ { var frame = textureManager.getFrame(textureKey); var uniform = this.uniforms[uniformKey]; + var source = frame.source; uniform.textureKey = textureKey; - uniform.source = frame.source.image; + uniform.source = source.image; uniform.value = frame.glTexture; + if (source.isGLTexture) + { + if (!textureData) + { + textureData = {}; + } + + textureData.width = source.width; + textureData.height = source.height; + } + if (textureData) { uniform.textureData = textureData; @@ -43615,6 +44289,11 @@ var Shader = new Class({ location = uniform.uniformLocation; value = uniform.value; + if (value === null) + { + continue; + } + if (length === 1) { if (uniform.glMatrix) @@ -43661,35 +44340,40 @@ var Shader = new Class({ * @method Phaser.GameObjects.Shader#load * @since 3.17.0 * - * @param {Phaser.GameObjects.Components.TransformMatrix} matrix2D - The transform matrix to use during rendering. + * @param {Phaser.GameObjects.Components.TransformMatrix} [matrix2D] - The transform matrix to use during rendering. */ load: function (matrix2D) { // ITRS + var gl = this.gl; var width = this.width; var height = this.height; var renderer = this.renderer; var program = this.program; - - var x = -this._displayOriginX; - var y = -this._displayOriginY; - var vm = this.viewMatrix; - vm[0] = matrix2D[0]; - vm[1] = matrix2D[1]; - vm[4] = matrix2D[2]; - vm[5] = matrix2D[3]; - vm[8] = matrix2D[4]; - vm[9] = matrix2D[5]; - vm[12] = vm[0] * x + vm[4] * y; - vm[13] = vm[1] * x + vm[5] * y; + if (!this.renderToTexture) + { + var x = -this._displayOriginX; + var y = -this._displayOriginY; + + vm[0] = matrix2D[0]; + vm[1] = matrix2D[1]; + vm[4] = matrix2D[2]; + vm[5] = matrix2D[3]; + vm[8] = matrix2D[4]; + vm[9] = matrix2D[5]; + vm[12] = vm[0] * x + vm[4] * y; + vm[13] = vm[1] * x + vm[5] * y; + } // Update vertex shader uniforms - this.renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); - this.renderer.setFloat2(program, 'uResolution', this.width, this.height); + gl.useProgram(program); + + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uViewMatrix'), false, vm); + gl.uniform2f(gl.getUniformLocation(program, 'uResolution'), this.width, this.height); // Update fragment shader uniforms @@ -43738,8 +44422,16 @@ var Shader = new Class({ var renderer = this.renderer; var vertexSize = Float32Array.BYTES_PER_ELEMENT * 2; - renderer.setProgram(program); - renderer.setVertexBuffer(vertexBuffer); + if (this.renderToTexture) + { + renderer.setFramebuffer(this.framebuffer); + + gl.clearColor(0, 0, 0, 0); + + gl.clear(gl.COLOR_BUFFER_BIT); + } + + gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); var location = gl.getAttribLocation(program, 'inPosition'); @@ -43768,6 +44460,11 @@ var Shader = new Class({ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); gl.drawArrays(gl.TRIANGLES, 0, vertexCount); + + if (this.renderToTexture) + { + renderer.setFramebuffer(null, false); + } }, /** @@ -43807,6 +44504,17 @@ var Shader = new Class({ gl.deleteProgram(this.program); gl.deleteBuffer(this.vertexBuffer); + + if (this.renderToTexture) + { + this.renderer.deleteFramebuffer(this.framebuffer); + + this.texture.destroy(); + + this.framebuffer = null; + this.glTexture = null; + this.texture = null; + } } }); @@ -43815,7 +44523,7 @@ module.exports = Shader; /***/ }), -/* 196 */ +/* 198 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43825,8 +44533,8 @@ module.exports = Shader; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var LineToCircle = __webpack_require__(197); +var Point = __webpack_require__(4); +var LineToCircle = __webpack_require__(199); /** * Checks for intersection between the line segment and circle, @@ -43907,7 +44615,7 @@ module.exports = GetLineToCircle; /***/ }), -/* 197 */ +/* 199 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43917,7 +44625,7 @@ module.exports = GetLineToCircle; */ var Contains = __webpack_require__(46); -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); var tmp = new Point(); @@ -43991,7 +44699,7 @@ module.exports = LineToCircle; /***/ }), -/* 198 */ +/* 200 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44001,9 +44709,9 @@ module.exports = LineToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var LineToLine = __webpack_require__(82); -var LineToRectangle = __webpack_require__(405); +var Point = __webpack_require__(4); +var LineToLine = __webpack_require__(84); +var LineToRectangle = __webpack_require__(408); /** * Checks for intersection between the Line and a Rectangle shape, @@ -44051,7 +44759,7 @@ module.exports = GetLineToRectangle; /***/ }), -/* 199 */ +/* 201 */ /***/ (function(module, exports) { /** @@ -44138,7 +44846,7 @@ module.exports = ContainsArray; /***/ }), -/* 200 */ +/* 202 */ /***/ (function(module, exports) { /** @@ -44186,7 +44894,7 @@ module.exports = RotateAroundXY; /***/ }), -/* 201 */ +/* 203 */ /***/ (function(module, exports) { /** @@ -44214,7 +44922,7 @@ module.exports = GetAspectRatio; /***/ }), -/* 202 */ +/* 204 */ /***/ (function(module, exports) { /** @@ -44268,7 +44976,7 @@ module.exports = RotateAroundXY; /***/ }), -/* 203 */ +/* 205 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44283,18 +44991,18 @@ module.exports = RotateAroundXY; module.exports = { - BUTTON_DOWN: __webpack_require__(1150), - BUTTON_UP: __webpack_require__(1151), - CONNECTED: __webpack_require__(1152), - DISCONNECTED: __webpack_require__(1153), - GAMEPAD_BUTTON_DOWN: __webpack_require__(1154), - GAMEPAD_BUTTON_UP: __webpack_require__(1155) + BUTTON_DOWN: __webpack_require__(1154), + BUTTON_UP: __webpack_require__(1155), + CONNECTED: __webpack_require__(1156), + DISCONNECTED: __webpack_require__(1157), + GAMEPAD_BUTTON_DOWN: __webpack_require__(1158), + GAMEPAD_BUTTON_UP: __webpack_require__(1159) }; /***/ }), -/* 204 */ +/* 206 */ /***/ (function(module, exports) { /** @@ -44335,7 +45043,7 @@ module.exports = GetURL; /***/ }), -/* 205 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44344,8 +45052,8 @@ module.exports = GetURL; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(17); -var XHRSettings = __webpack_require__(133); +var Extend = __webpack_require__(15); +var XHRSettings = __webpack_require__(134); /** * Takes two XHRSettings Objects and creates a new XHRSettings object from them. @@ -44383,7 +45091,7 @@ module.exports = MergeXHRSettings; /***/ }), -/* 206 */ +/* 208 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44393,12 +45101,12 @@ module.exports = MergeXHRSettings; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var ParseXML = __webpack_require__(336); +var ParseXML = __webpack_require__(339); /** * @classdesc @@ -44568,7 +45276,7 @@ module.exports = XMLFile; /***/ }), -/* 207 */ +/* 209 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44583,24 +45291,24 @@ module.exports = XMLFile; module.exports = { - Acceleration: __webpack_require__(1209), - Angular: __webpack_require__(1210), - Bounce: __webpack_require__(1211), - Debug: __webpack_require__(1212), - Drag: __webpack_require__(1213), - Enable: __webpack_require__(1214), - Friction: __webpack_require__(1215), - Gravity: __webpack_require__(1216), - Immovable: __webpack_require__(1217), - Mass: __webpack_require__(1218), - Size: __webpack_require__(1219), - Velocity: __webpack_require__(1220) + Acceleration: __webpack_require__(1213), + Angular: __webpack_require__(1214), + Bounce: __webpack_require__(1215), + Debug: __webpack_require__(1216), + Drag: __webpack_require__(1217), + Enable: __webpack_require__(1218), + Friction: __webpack_require__(1219), + Gravity: __webpack_require__(1220), + Immovable: __webpack_require__(1221), + Mass: __webpack_require__(1222), + Size: __webpack_require__(1223), + Velocity: __webpack_require__(1224) }; /***/ }), -/* 208 */ +/* 210 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44615,20 +45323,20 @@ module.exports = { module.exports = { - COLLIDE: __webpack_require__(1222), - OVERLAP: __webpack_require__(1223), - PAUSE: __webpack_require__(1224), - RESUME: __webpack_require__(1225), - TILE_COLLIDE: __webpack_require__(1226), - TILE_OVERLAP: __webpack_require__(1227), - WORLD_BOUNDS: __webpack_require__(1228), - WORLD_STEP: __webpack_require__(1229) + COLLIDE: __webpack_require__(1226), + OVERLAP: __webpack_require__(1227), + PAUSE: __webpack_require__(1228), + RESUME: __webpack_require__(1229), + TILE_COLLIDE: __webpack_require__(1230), + TILE_OVERLAP: __webpack_require__(1231), + WORLD_BOUNDS: __webpack_require__(1232), + WORLD_STEP: __webpack_require__(1233) }; /***/ }), -/* 209 */ +/* 211 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44646,10 +45354,10 @@ var Composite = {}; module.exports = Composite; -var Events = __webpack_require__(227); +var Events = __webpack_require__(230); var Common = __webpack_require__(37); var Bounds = __webpack_require__(100); -var Body = __webpack_require__(60); +var Body = __webpack_require__(61); (function() { @@ -45319,7 +46027,7 @@ var Body = __webpack_require__(60); /***/ }), -/* 210 */ +/* 212 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45328,7 +46036,7 @@ var Body = __webpack_require__(60); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(137); +var GetTileAt = __webpack_require__(138); /** * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting @@ -45395,7 +46103,7 @@ module.exports = CalculateFacesAt; /***/ }), -/* 211 */ +/* 213 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45404,10 +46112,10 @@ module.exports = CalculateFacesAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tile = __webpack_require__(72); +var Tile = __webpack_require__(73); var IsInLayerBounds = __webpack_require__(101); -var CalculateFacesAt = __webpack_require__(210); -var SetTileCollision = __webpack_require__(71); +var CalculateFacesAt = __webpack_require__(212); +var SetTileCollision = __webpack_require__(72); /** * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index @@ -45475,7 +46183,7 @@ module.exports = PutTileAt; /***/ }), -/* 212 */ +/* 214 */ /***/ (function(module, exports) { /** @@ -45514,7 +46222,7 @@ module.exports = SetLayerCollisionIndex; /***/ }), -/* 213 */ +/* 215 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45523,10 +46231,10 @@ module.exports = SetLayerCollisionIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); +var Formats = __webpack_require__(30); var LayerData = __webpack_require__(102); var MapData = __webpack_require__(103); -var Tile = __webpack_require__(72); +var Tile = __webpack_require__(73); /** * Parses a 2D array of tile indexes into a new MapData object with a single layer. @@ -45606,7 +46314,7 @@ module.exports = Parse2DArray; /***/ }), -/* 214 */ +/* 216 */ /***/ (function(module, exports) { /** @@ -45696,7 +46404,7 @@ module.exports = ParseGID; /***/ }), -/* 215 */ +/* 217 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45705,8 +46413,8 @@ module.exports = ParseGID; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pick = __webpack_require__(461); -var ParseGID = __webpack_require__(214); +var Pick = __webpack_require__(464); +var ParseGID = __webpack_require__(216); var copyPoints = function (p) { return { x: p.x, y: p.y }; }; @@ -45778,7 +46486,7 @@ module.exports = ParseObject; /***/ }), -/* 216 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45787,10 +46495,10 @@ module.exports = ParseObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); +var Formats = __webpack_require__(30); var MapData = __webpack_require__(103); -var Parse = __webpack_require__(453); -var Tilemap = __webpack_require__(469); +var Parse = __webpack_require__(456); +var Tilemap = __webpack_require__(472); /** * Create a Tilemap from the given key or data. If neither is given, make a blank Tilemap. When @@ -45864,7 +46572,7 @@ module.exports = ParseToTilemap; /***/ }), -/* 217 */ +/* 219 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45873,7 +46581,7 @@ module.exports = ParseToTilemap; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** * Extracts an array of targets from a Tween configuration object. @@ -45913,7 +46621,7 @@ module.exports = GetTargets; /***/ }), -/* 218 */ +/* 220 */ /***/ (function(module, exports) { /** @@ -45922,6 +46630,14 @@ module.exports = GetTargets; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +/** + * @ignore + */ +function hasGetActive (def) +{ + return (!!def.getActive && typeof def.getActive === 'function'); +} + /** * @ignore */ @@ -45943,13 +46659,28 @@ function hasGetEnd (def) */ function hasGetters (def) { - return hasGetStart(def) || hasGetEnd(def); + return hasGetStart(def) || hasGetEnd(def) || hasGetActive(def); } /** - * Returns `getStart` and `getEnd` functions for a Tween's Data based on a target property and end value. + * Returns `getActive`, `getStart` and `getEnd` functions for a TweenData based on a target property and end value. + * + * `getActive` if not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * `getEnd` is invoked once any start delays have expired and returns what the value should tween to. + * `getStart` is invoked when the tween reaches the end and needs to either repeat or yoyo, it returns the value to go back to. * - * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. A string can be provided to specify a relative end value which consists of an operation (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current value, or `/=` to divide the current value) followed by its operand. A function can be provided to allow greater control over the end value; it will receive the target object being tweened, the name of the property being tweened, and the current value of the property as its arguments. If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` property is provided, the property will be used as the effective value under the same rules described here. + * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. + * A string can be provided to specify a relative end value which consists of an operation + * (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current + * value, or `/=` to divide the current value) followed by its operand. + * + * A function can be provided to allow greater control over the end value; it will receive the target + * object being tweened, the name of the property being tweened, and the current value of the property + * as its arguments. + * + * If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` + * callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` + * property is provided, the property will be used as the effective value under the same rules described here. * * @function Phaser.Tweens.Builders.GetValueOp * @since 3.0.0 @@ -45957,7 +46688,7 @@ function hasGetters (def) * @param {string} key - The name of the property to modify. * @param {*} propertyValue - The ending value of the property, as described above. * - * @return {function} An array of two functions, `getStart` and `getEnd`, which return the starting and the ending value of the property based on the provided value. + * @return {function} An array of functions, `getActive`, `getStart` and `getEnd`, which return the starting and the ending value of the property based on the provided value. */ var GetValueOp = function (key, propertyValue) { @@ -45969,6 +46700,9 @@ var GetValueOp = function (key, propertyValue) // The returned value sets what the property will be at the START of the Tween (usually called at the end of the Tween) var getStart = function (target, key, value) { return value; }; + // What to set the property to the moment the TweenData is invoked + var getActive = null; + var t = typeof(propertyValue); if (t === 'number') @@ -46037,54 +46771,112 @@ var GetValueOp = function (key, propertyValue) // The same as setting just the getEnd function and no getStart // props: { - // x: function (target, key, value) { return value + 50); }, + // x: function (target, key, value, targetIndex, totalTargets, tween) { return value + 50); }, // } getEnd = propertyValue; } - else if (t === 'object' && hasGetters(propertyValue)) + else if (t === 'object') { - /* - x: { - // Called at the start of the Tween. The returned value sets what the property will be at the END of the Tween. - getEnd: function (target, key, value) - { - return value; - }, + if (hasGetters(propertyValue)) + { + /* + x: { + // Called the moment Tween is active. The returned value sets the property on the target immediately. + getActive: function (target, key, value, targetIndex, totalTargets, tween) + { + return value; + }, - // Called at the end of the Tween. The returned value sets what the property will be at the START of the Tween. - getStart: function (target, key, value) + // Called at the start of the Tween. The returned value sets what the property will be at the END of the Tween. + getEnd: function (target, key, value, targetIndex, totalTargets, tween) + { + return value; + }, + + // Called at the end of the Tween. The returned value sets what the property will be at the START of the Tween. + getStart: function (target, key, value, targetIndex, totalTargets, tween) + { + return value; + } + } + */ + + if (hasGetActive(propertyValue)) { - return value; + getActive = propertyValue.getActive; + } + + if (hasGetEnd(propertyValue)) + { + getEnd = propertyValue.getEnd; + } + + if (hasGetStart(propertyValue)) + { + getStart = propertyValue.getStart; } } - */ - - if (hasGetEnd(propertyValue)) + else if (propertyValue.hasOwnProperty('value')) { - getEnd = propertyValue.getEnd; - } + // 'value' may still be a string, function or a number + // props: { + // x: { value: 400, ... }, + // y: { value: 300, ... } + // } - if (hasGetStart(propertyValue)) + callbacks = GetValueOp(key, propertyValue.value); + } + else { - getStart = propertyValue.getStart; - } - } - else if (propertyValue.hasOwnProperty('value')) - { - // Value may still be a string, function or a number - // props: { - // x: { value: 400, ... }, - // y: { value: 300, ... } - // } + // 'from' and 'to' may still be a string, function or a number + // props: { + // x: { from: 400, to: 600 }, + // y: { from: 300, to: 500 } + // } - callbacks = GetValueOp(key, propertyValue.value); + // Same as above, but the 'start' value is set immediately on the target + // props: { + // x: { start: 400, to: 600 }, + // y: { start: 300, to: 500 } + // } + + // 'start' value is set immediately, then it goes 'from' to 'to' during the tween + // props: { + // x: { start: 200, from: 400, to: 600 }, + // y: { start: 300, from: 300, to: 500 } + // } + + var hasTo = propertyValue.hasOwnProperty('to'); + var hasFrom = propertyValue.hasOwnProperty('from'); + var hasStart = propertyValue.hasOwnProperty('start'); + + if (hasTo && (hasFrom || hasStart)) + { + callbacks = GetValueOp(key, propertyValue.to); + + if (hasStart) + { + var startCallbacks = GetValueOp(key, propertyValue.start); + + callbacks.getActive = startCallbacks.getEnd; + } + + if (hasFrom) + { + var fromCallbacks = GetValueOp(key, propertyValue.from); + + callbacks.getStart = fromCallbacks.getEnd; + } + } + } } // If callback not set by the else if block above then set it here and return it if (!callbacks) { callbacks = { + getActive: getActive, getEnd: getEnd, getStart: getStart }; @@ -46097,7 +46889,7 @@ module.exports = GetValueOp; /***/ }), -/* 219 */ +/* 221 */ /***/ (function(module, exports) { /** @@ -46141,7 +46933,7 @@ module.exports = TWEEN_DEFAULTS; /***/ }), -/* 220 */ +/* 222 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46151,9 +46943,11 @@ module.exports = TWEEN_DEFAULTS; */ var Class = __webpack_require__(0); -var GameObjectCreator = __webpack_require__(15); -var GameObjectFactory = __webpack_require__(5); -var TWEEN_CONST = __webpack_require__(88); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(223); +var GameObjectCreator = __webpack_require__(16); +var GameObjectFactory = __webpack_require__(6); +var TWEEN_CONST = __webpack_require__(89); /** * @classdesc @@ -46163,6 +46957,7 @@ var TWEEN_CONST = __webpack_require__(88); * * @class Tween * @memberof Phaser.Tweens + * @extends Phaser.Events.EventEmitter * @constructor * @since 3.0.0 * @@ -46172,10 +46967,14 @@ var TWEEN_CONST = __webpack_require__(88); */ var Tween = new Class({ + Extends: EventEmitter, + initialize: function Tween (parent, data, targets) { + EventEmitter.call(this); + /** * A reference to the parent of this Tween. * Either the Tween Manager or a Tween Timeline instance. @@ -46283,6 +47082,40 @@ var Tween = new Class({ */ this.loopCounter = 0; + /** + * Time in ms/frames before the 'onStart' event fires. + * This is the shortest `delay` value across all of the TweenDatas of this Tween. + * + * @name Phaser.Tweens.Tween#startDelay + * @type {number} + * @default 0 + * @since 3.19.0 + */ + this.startDelay = 0; + + /** + * Has this Tween started playback yet? + * This boolean is toggled when the Tween leaves the 'delayed' state and starts running. + * + * @name Phaser.Tweens.Tween#hasStarted + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this.hasStarted = false; + + /** + * Is this Tween currently seeking? + * This boolean is toggled in the `Tween.seek` method. + * When a tween is seeking it will not dispatch any events or callbacks. + * + * @name Phaser.Tweens.Tween#isSeeking + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this.isSeeking = false; + /** * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = -1 (as it never completes) * @@ -46340,7 +47173,7 @@ var Tween = new Class({ * @private * @since 3.0.0 */ - this._pausedState = TWEEN_CONST.PENDING_ADD; + this._pausedState = TWEEN_CONST.INIT; /** * Does the Tween start off paused? (if so it needs to be started with Tween.play) @@ -46413,14 +47246,24 @@ var Tween = new Class({ this.totalProgress = 0; /** - * An object containing the various Tween callback references. + * An object containing the different Tween callback functions. + * + * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. + * + * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. + * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. + * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely. + * `onUpdate` When a TweenData updates a property on a source target during playback. + * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. * * @name Phaser.Tweens.Tween#callbacks * @type {object} - * @default 0 * @since 3.0.0 */ this.callbacks = { + onActive: null, onComplete: null, onLoop: null, onRepeat: null, @@ -46429,6 +47272,13 @@ var Tween = new Class({ onYoyo: null }; + /** + * The context in which all callbacks are invoked. + * + * @name Phaser.Tweens.Tween#callbackScope + * @type {any} + * @since 3.0.0 + */ this.callbackScope; }, @@ -46600,7 +47450,8 @@ var Tween = new Class({ */ calcDuration: function () { - var max = 0; + var maxDuration = 0; + var minDelay = Number.MAX_SAFE_INTEGER; var data = this.data; @@ -46631,10 +47482,15 @@ var Tween = new Class({ tweenData.totalDuration += (tweenData.t2 * tweenData.repeat); } - if (tweenData.totalDuration > max) + if (tweenData.totalDuration > maxDuration) { // Get the longest TweenData from the Tween, used to calculate the Tween TD - max = tweenData.totalDuration; + maxDuration = tweenData.totalDuration; + } + + if (tweenData.delay < minDelay) + { + minDelay = tweenData.delay; } } @@ -46642,7 +47498,7 @@ var Tween = new Class({ // If duration has been set to 0 then we give it a super-low value so that it always // renders at least 1 frame, but no more, without causing divided by zero errors elsewhere. - this.duration = Math.max(max, 0.001); + this.duration = Math.max(maxDuration, 0.001); this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; @@ -46654,6 +47510,9 @@ var Tween = new Class({ { this.totalDuration = this.duration + this.completeDelay; } + + // How long before this Tween starts playback? + this.startDelay = minDelay; }, /** @@ -46667,6 +47526,15 @@ var Tween = new Class({ */ init: function () { + // You can't have a paused Tween if it's part of a Timeline + if (this.paused && !this.parentIsTimeline) + { + this.state = TWEEN_CONST.PENDING_ADD; + this._pausedState = TWEEN_CONST.INIT; + + return false; + } + var data = this.data; var totalTargets = this.totalTargets; @@ -46675,12 +47543,17 @@ var Tween = new Class({ var tweenData = data[i]; var target = tweenData.target; var gen = tweenData.gen; + var key = tweenData.key; + var targetIndex = tweenData.index; - tweenData.delay = gen.delay(i, totalTargets, target); - tweenData.duration = Math.max(gen.duration(i, totalTargets, target), 0.001); - tweenData.hold = gen.hold(i, totalTargets, target); - tweenData.repeat = gen.repeat(i, totalTargets, target); - tweenData.repeatDelay = gen.repeatDelay(i, totalTargets, target); + // Old function signature: i, totalTargets, target + // New function signature: target, key, value, index, total, tween + + tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); + tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); + tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); } this.calcDuration(); @@ -46690,26 +47563,32 @@ var Tween = new Class({ this.elapsed = 0; this.totalElapsed = 0; - // You can't have a paused Tween if it's part of a Timeline - if (this.paused && !this.parentIsTimeline) - { - this.state = TWEEN_CONST.PENDING_ADD; - this._pausedState = TWEEN_CONST.INIT; + this.state = TWEEN_CONST.INIT; - return false; - } - else - { - this.state = TWEEN_CONST.INIT; + return true; + }, - return true; - } + /** + * Internal method that makes this Tween active within the TweenManager + * and emits the onActive event and callback. + * + * @method Phaser.Tweens.Tween#makeActive + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.19.0 + */ + makeActive: function () + { + this.parent.makeActive(this); + + this.dispatchTweenEvent(Events.TWEEN_ACTIVE, this.callbacks.onActive); }, /** * Internal method that advances to the next state of the Tween during playback. * * @method Phaser.Tweens.Tween#nextState + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP * @since 3.0.0 */ nextState: function () @@ -46720,15 +47599,6 @@ var Tween = new Class({ this.progress = 0; this.loopCounter--; - var onLoop = this.callbacks.onLoop; - - if (onLoop) - { - onLoop.params[1] = this.targets; - - onLoop.func.apply(onLoop.scope, onLoop.params); - } - this.resetTweenData(true); if (this.loopDelay > 0) @@ -46739,25 +47609,21 @@ var Tween = new Class({ else { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); } } else if (this.completeDelay > 0) { - this.countdown = this.completeDelay; this.state = TWEEN_CONST.COMPLETE_DELAY; + + this.countdown = this.completeDelay; } else { - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.params[1] = this.targets; - - onComplete.func.apply(onComplete.scope, onComplete.params); - } - this.state = TWEEN_CONST.PENDING_REMOVE; + + this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); } }, @@ -46807,11 +47673,21 @@ var Tween = new Class({ { if (resetFromTimeline === undefined) { resetFromTimeline = false; } - if (this.state === TWEEN_CONST.ACTIVE || (this.state === TWEEN_CONST.PENDING_ADD && this._pausedState === TWEEN_CONST.PENDING_ADD)) + var state = this.state; + + if (state === TWEEN_CONST.INIT && !this.parentIsTimeline) + { + this.resetTweenData(false); + + this.state = TWEEN_CONST.ACTIVE; + + return this; + } + else if (state === TWEEN_CONST.ACTIVE || (state === TWEEN_CONST.PENDING_ADD && this._pausedState === TWEEN_CONST.PENDING_ADD)) { return this; } - else if (!this.parentIsTimeline && (this.state === TWEEN_CONST.PENDING_REMOVE || this.state === TWEEN_CONST.REMOVED)) + else if (!this.parentIsTimeline && (state === TWEEN_CONST.PENDING_REMOVE || state === TWEEN_CONST.REMOVED)) { this.seek(0); this.parent.makeActive(this); @@ -46819,21 +47695,12 @@ var Tween = new Class({ return this; } - var onStart = this.callbacks.onStart; - if (this.parentIsTimeline) { this.resetTweenData(resetFromTimeline); if (this.calculatedOffset === 0) { - if (onStart) - { - onStart.params[1] = this.targets; - - onStart.func.apply(onStart.scope, onStart.params); - } - this.state = TWEEN_CONST.ACTIVE; } else @@ -46847,7 +47714,7 @@ var Tween = new Class({ { this.paused = false; - this.parent.makeActive(this); + this.makeActive(); } else { @@ -46855,14 +47722,7 @@ var Tween = new Class({ this.state = TWEEN_CONST.ACTIVE; - if (onStart) - { - onStart.params[1] = this.targets; - - onStart.func.apply(onStart.scope, onStart.params); - } - - this.parent.makeActive(this); + this.makeActive(); } return this; @@ -46879,11 +47739,17 @@ var Tween = new Class({ resetTweenData: function (resetFromLoop) { var data = this.data; + var total = this.totalData; + var totalTargets = this.totalTargets; - for (var i = 0; i < this.totalData; i++) + for (var i = 0; i < total; i++) { var tweenData = data[i]; + var target = tweenData.target; + var key = tweenData.key; + var targetIndex = tweenData.index; + tweenData.progress = 0; tweenData.elapsed = 0; @@ -46891,9 +47757,9 @@ var Tween = new Class({ if (resetFromLoop) { - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.start = tweenData.getStartValue(target, key, tweenData.start, targetIndex, totalTargets, this); - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.end); + tweenData.end = tweenData.getEndValue(target, key, tweenData.end, targetIndex, totalTargets, this); tweenData.current = tweenData.start; @@ -46907,8 +47773,14 @@ var Tween = new Class({ if (tweenData.delay > 0) { tweenData.elapsed = tweenData.delay; + tweenData.state = TWEEN_CONST.DELAY; } + + if (tweenData.getActiveValue) + { + target[key] = tweenData.getActiveValue(tweenData.target, tweenData.key, tweenData.start); + } } }, @@ -46937,73 +47809,110 @@ var Tween = new Class({ }, /** - * Attempts to seek to a specific position in a Tween. + * Seeks to a specific point in the Tween. + * + * **Note:** You cannot seek a Tween that repeats or loops forever, or that has an unusually long total duration. + * + * The given position is a value between 0 and 1 which represents how far through the Tween to seek to. + * A value of 0.5 would seek to half-way through the Tween, where-as a value of zero would seek to the start. + * + * Note that the seek takes the entire duration of the Tween into account, including delays, loops and repeats. + * For example, a Tween that lasts for 2 seconds, but that loops 3 times, would have a total duration of 6 seconds, + * so seeking to 0.5 would seek to 3 seconds into the Tween, as that's half-way through its _entire_ duration. + * + * Seeking works by resetting the Tween to its initial values and then iterating through the Tween at `delta` + * jumps per step. The longer the Tween, the longer this can take. * * @method Phaser.Tweens.Tween#seek * @since 3.0.0 * * @param {number} toPosition - A value between 0 and 1 which represents the progress point to seek to. + * @param {number} [delta=16.6] - The size of each step when seeking through the Tween. A higher value completes faster but at a cost of less precision. * * @return {this} This Tween instance. */ - seek: function (toPosition) + seek: function (toPosition, delta) { + if (delta === undefined) { delta = 16.6; } + + if (this.totalDuration >= 3600000) + { + console.warn('Tween.seek duration too long'); + + return this; + } + + if (this.state === TWEEN_CONST.REMOVED) + { + this.makeActive(); + } + + this.elapsed = 0; + this.progress = 0; + this.totalElapsed = 0; + this.totalProgress = 0; + var data = this.data; + var totalTargets = this.totalTargets; for (var i = 0; i < this.totalData; i++) { - // This won't work with loop > 0 yet - var ms = this.totalDuration * toPosition; - var tweenData = data[i]; - var progress = 0; - var elapsed = 0; + var target = tweenData.target; + var gen = tweenData.gen; + var key = tweenData.key; + var targetIndex = tweenData.index; - if (ms <= tweenData.delay) + tweenData.progress = 0; + tweenData.elapsed = 0; + + tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat; + + // Old function signature: i, totalTargets, target + // New function signature: target, key, value, index, total, tween + + tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); + tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); + tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); + tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); + + tweenData.current = tweenData.start; + tweenData.state = TWEEN_CONST.PLAYING_FORWARD; + + this.updateTweenData(this, tweenData, 0, targetIndex, totalTargets); + + if (tweenData.delay > 0) { - progress = 0; - elapsed = 0; + tweenData.elapsed = tweenData.delay; + tweenData.state = TWEEN_CONST.DELAY; } - else if (ms >= tweenData.totalDuration) - { - progress = 1; - elapsed = tweenData.duration; - } - else if (ms > tweenData.delay && ms <= tweenData.t1) - { - // Keep it zero bound - ms = Math.max(0, ms - tweenData.delay); + } - // Somewhere in the first playthru range - progress = ms / tweenData.t1; - elapsed = tweenData.duration * progress; - } - else if (ms > tweenData.t1 && ms < tweenData.totalDuration) - { - // Somewhere in repeat land - ms -= tweenData.delay; - ms -= tweenData.t1; + this.calcDuration(); - // var repeats = Math.floor(ms / tweenData.t2); + var wasPaused = false; - // remainder - ms = ((ms / tweenData.t2) % 1) * tweenData.t2; + if (this.state === TWEEN_CONST.PAUSED) + { + wasPaused = true; - if (ms > tweenData.repeatDelay) - { - progress = ms / tweenData.t1; - elapsed = tweenData.duration * progress; - } - } + this.state = TWEEN_CONST.ACTIVE; + } - tweenData.progress = progress; - tweenData.elapsed = elapsed; + this.isSeeking = true; - var v = tweenData.ease(tweenData.progress); + do + { + this.update(0, delta); - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + } while (this.totalProgress < toPosition); - tweenData.target[tweenData.key] = tweenData.current; + this.isSeeking = false; + + if (wasPaused) + { + this.state = TWEEN_CONST.PAUSED; } return this; @@ -47011,14 +47920,26 @@ var Tween = new Class({ /** * Sets an event based callback to be invoked during playback. + * + * Calling this method will replace a previously set callback for the given type, if any exists. + * + * The types available are: + * + * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. + * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. + * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely. + * `onUpdate` When a TweenData updates a property on a source target during playback. + * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. * * @method Phaser.Tweens.Tween#setCallback * @since 3.0.0 * - * @param {string} type - Type of the callback. - * @param {function} callback - Callback function. + * @param {string} type - Type of the callback to set. + * @param {function} callback - The function to invoke when this callback happens. * @param {array} [params] - An array of parameters for specified callbacks types. - * @param {object} [scope] - The context the callback will be invoked in. + * @param {any} [scope] - The context the callback will be invoked in. * * @return {this} This Tween instance. */ @@ -47038,6 +47959,7 @@ var Tween = new Class({ * If you don't need a delay, or have an onComplete callback, then call `Tween.stop` instead. * * @method Phaser.Tweens.Tween#complete + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE * @since 3.2.0 * * @param {number} [delay=0] - The time to wait before invoking the complete callback. If zero it will fire immediately. @@ -47050,21 +47972,15 @@ var Tween = new Class({ if (delay) { - this.countdown = delay; this.state = TWEEN_CONST.COMPLETE_DELAY; + + this.countdown = delay; } else { - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.params[1] = this.targets; - - onComplete.func.apply(onComplete.scope, onComplete.params); - } - this.state = TWEEN_CONST.PENDING_REMOVE; + + this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); } return this; @@ -47125,6 +48041,8 @@ var Tween = new Class({ } } + this.removeAllListeners(); + this.state = TWEEN_CONST.PENDING_REMOVE; } @@ -47135,6 +48053,9 @@ var Tween = new Class({ * Internal method that advances the Tween based on the time values. * * @method Phaser.Tweens.Tween#update + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP + * @fires Phaser.Tweens.Events#TWEEN_START * @since 3.0.0 * * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. @@ -47166,11 +48087,25 @@ var Tween = new Class({ { case TWEEN_CONST.ACTIVE: + if (!this.hasStarted && !this.isSeeking) + { + this.startDelay -= delta; + + if (this.startDelay <= 0) + { + this.hasStarted = true; + + this.dispatchTweenEvent(Events.TWEEN_START, this.callbacks.onStart); + } + } + var stillRunning = false; for (var i = 0; i < this.totalData; i++) { - if (this.updateTweenData(this, this.data[i], delta)) + var tweenData = this.data[i]; + + if (this.updateTweenData(this, tweenData, delta)) { stillRunning = true; } @@ -47191,6 +48126,8 @@ var Tween = new Class({ if (this.countdown <= 0) { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); } break; @@ -47201,15 +48138,6 @@ var Tween = new Class({ if (this.countdown <= 0) { - var onStart = this.callbacks.onStart; - - if (onStart) - { - onStart.params[1] = this.targets; - - onStart.func.apply(onStart.scope, onStart.params); - } - this.state = TWEEN_CONST.ACTIVE; } @@ -47221,14 +48149,9 @@ var Tween = new Class({ if (this.countdown <= 0) { - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.func.apply(onComplete.scope, onComplete.params); - } - this.state = TWEEN_CONST.PENDING_REMOVE; + + this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); } break; @@ -47237,10 +48160,61 @@ var Tween = new Class({ return (this.state === TWEEN_CONST.PENDING_REMOVE); }, + /** + * Internal method that will emit a TweenData based Event and invoke the given callback. + * + * @method Phaser.Tweens.Tween#dispatchTweenDataEvent + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData object that caused this event. + */ + dispatchTweenDataEvent: function (event, callback, tweenData) + { + if (!this.isSeeking) + { + this.emit(event, this, tweenData.key, tweenData.target); + + if (callback) + { + callback.params[1] = tweenData.target; + + callback.func.apply(callback.scope, callback.params); + } + } + }, + + /** + * Internal method that will emit a Tween based Event and invoke the given callback. + * + * @method Phaser.Tweens.Tween#dispatchTweenEvent + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchTweenEvent: function (event, callback) + { + if (!this.isSeeking) + { + this.emit(event, this, this.targets); + + if (callback) + { + callback.params[1] = this.targets; + + callback.func.apply(callback.scope, callback.params); + } + } + }, + /** * Internal method used as part of the playback process that sets a tween to play in reverse. * * @method Phaser.Tweens.Tween#setStateFromEnd + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to update. @@ -47264,25 +48238,14 @@ var Tween = new Class({ tweenData.target.toggleFlipX(); } - // Problem: The flip and callback and so on gets called for every TweenData that triggers it at the same time. - // If you're tweening several properties it can fire for all of them, at once. - if (tweenData.flipY) { tweenData.target.toggleFlipY(); } - var onYoyo = tween.callbacks.onYoyo; + this.dispatchTweenDataEvent(Events.TWEEN_YOYO, tween.callbacks.onYoyo, tweenData); - if (onYoyo) - { - // Element 1 is reserved for the target of the yoyo (and needs setting here) - onYoyo.params[1] = tweenData.target; - - onYoyo.func.apply(onYoyo.scope, onYoyo.params); - } - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); return TWEEN_CONST.PLAYING_BACKWARD; } @@ -47307,19 +48270,9 @@ var Tween = new Class({ tweenData.target.toggleFlipY(); } - var onRepeat = tween.callbacks.onRepeat; + tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - if (onRepeat) - { - // Element 1 is reserved for the target of the repeat (and needs setting here) - onRepeat.params[1] = tweenData.target; - - onRepeat.func.apply(onRepeat.scope, onRepeat.params); - } - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); // Delay? if (tweenData.repeatDelay > 0) @@ -47334,6 +48287,8 @@ var Tween = new Class({ } else { + this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); + return TWEEN_CONST.PLAYING_FORWARD; } } @@ -47345,6 +48300,7 @@ var Tween = new Class({ * Internal method used as part of the playback process that sets a tween to play from the start. * * @method Phaser.Tweens.Tween#setStateFromStart + * @fires Phaser.Tweens.Events#TWEEN_REPEAT * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to update. @@ -47373,17 +48329,7 @@ var Tween = new Class({ tweenData.target.toggleFlipY(); } - var onRepeat = tween.callbacks.onRepeat; - - if (onRepeat) - { - // Element 1 is reserved for the target of the repeat (and needs setting here) - onRepeat.params[1] = tweenData.target; - - onRepeat.func.apply(onRepeat.scope, onRepeat.params); - } - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); // Delay? if (tweenData.repeatDelay > 0) @@ -47398,6 +48344,8 @@ var Tween = new Class({ } else { + this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); + return TWEEN_CONST.PLAYING_FORWARD; } } @@ -47409,22 +48357,26 @@ var Tween = new Class({ * Internal method that advances the TweenData based on the time value given. * * @method Phaser.Tweens.Tween#updateTweenData + * @fires Phaser.Tweens.Events#TWEEN_UPDATE + * @fires Phaser.Tweens.Events#TWEEN_REPEAT * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to update. * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true + * @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true. * * @return {boolean} True if the tween is not complete (e.g., playing), or false if the tween is complete. */ updateTweenData: function (tween, tweenData, delta) { + var target = tweenData.target; + switch (tweenData.state) { case TWEEN_CONST.PLAYING_FORWARD: case TWEEN_CONST.PLAYING_BACKWARD: - if (!tweenData.target) + if (!target) { tweenData.state = TWEEN_CONST.COMPLETE; break; @@ -47445,37 +48397,16 @@ var Tween = new Class({ var forward = (tweenData.state === TWEEN_CONST.PLAYING_FORWARD); var progress = elapsed / duration; - var v; - - if (forward) - { - v = tweenData.ease(progress); - } - else - { - v = tweenData.ease(1 - progress); - } - - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); - - tweenData.target[tweenData.key] = tweenData.current; - tweenData.elapsed = elapsed; tweenData.progress = progress; - var onUpdate = tween.callbacks.onUpdate; - - if (onUpdate) - { - onUpdate.params[1] = tweenData.target; - - onUpdate.func.apply(onUpdate.scope, onUpdate.params); - } - if (progress === 1) { if (forward) { + tweenData.current = tweenData.end; + target[tweenData.key] = tweenData.end; + if (tweenData.hold > 0) { tweenData.elapsed = tweenData.hold - diff; @@ -47489,9 +48420,22 @@ var Tween = new Class({ } else { + tweenData.current = tweenData.start; + target[tweenData.key] = tweenData.start; + tweenData.state = this.setStateFromStart(tween, tweenData, diff); } } + else + { + var v = (forward) ? tweenData.ease(progress) : tweenData.ease(1 - progress); + + tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + + target[tweenData.key] = tweenData.current; + } + + this.dispatchTweenDataEvent(Events.TWEEN_UPDATE, tween.callbacks.onUpdate, tweenData); break; @@ -47517,6 +48461,8 @@ var Tween = new Class({ tweenData.elapsed = Math.abs(tweenData.elapsed); tweenData.state = TWEEN_CONST.PLAYING_FORWARD; + + this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); } break; @@ -47534,15 +48480,15 @@ var Tween = new Class({ case TWEEN_CONST.PENDING_RENDER: - if (tweenData.target) + if (target) { - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.target[tweenData.key]); + tweenData.start = tweenData.getStartValue(target, tweenData.key, target[tweenData.key], tweenData.index, tween.totalTargets, tween); - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + tweenData.end = tweenData.getEndValue(target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); tweenData.current = tweenData.start; - tweenData.target[tweenData.key] = tweenData.start; + target[tweenData.key] = tweenData.start; tweenData.state = TWEEN_CONST.PLAYING_FORWARD; } @@ -47560,7 +48506,16 @@ var Tween = new Class({ }); +// onActive = 'active' event = When the Tween is moved from the pending to the active list in the manager, even if playback delayed +// onStart = 'start' event = When the Tween starts playing from a delayed state (will happen same time as onActive if no delay) +// onYoyo = 'yoyo' event = When the Tween starts a yoyo +// onRepeat = 'repeat' event = When a TweenData repeats playback (if any) +// onComplete = 'complete' event = When the Tween finishes all playback (can sometimes never happen if repeat -1), also when 'stop' called +// onUpdate = 'update' event = When the Tween updates a TweenData during playback (expensive!) +// onLoop = 'loop' event = Used to loop ALL TweenDatas in a Tween + Tween.TYPES = [ + 'onActive', 'onComplete', 'onLoop', 'onRepeat', @@ -47572,7 +48527,7 @@ Tween.TYPES = [ /** * Creates a new Tween object. * - * Note: This method will only be available Tweens have been built into Phaser. + * Note: This method will only be available if Tweens have been built into Phaser. * * @method Phaser.GameObjects.GameObjectFactory#tween * @since 3.0.0 @@ -47617,7 +48572,40 @@ module.exports = Tween; /***/ }), -/* 221 */ +/* 223 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tweens.Events + */ + +module.exports = { + + TIMELINE_COMPLETE: __webpack_require__(1306), + TIMELINE_LOOP: __webpack_require__(1307), + TIMELINE_PAUSE: __webpack_require__(1308), + TIMELINE_RESUME: __webpack_require__(1309), + TIMELINE_START: __webpack_require__(1310), + TIMELINE_UPDATE: __webpack_require__(1311), + TWEEN_ACTIVE: __webpack_require__(1312), + TWEEN_COMPLETE: __webpack_require__(1313), + TWEEN_LOOP: __webpack_require__(1314), + TWEEN_REPEAT: __webpack_require__(1315), + TWEEN_START: __webpack_require__(1316), + TWEEN_UPDATE: __webpack_require__(1317), + TWEEN_YOYO: __webpack_require__(1318) + +}; + + +/***/ }), +/* 224 */ /***/ (function(module, exports) { /** @@ -47627,17 +48615,21 @@ module.exports = Tween; */ /** - * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. + * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. + * A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. * - * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, Tweens should be created using the GameObjectFactory or GameObjectCreator. + * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, + * Tweens should be created using the GameObjectFactory or GameObjectCreator. * * @function Phaser.Tweens.TweenData * @since 3.0.0 * - * @param {object} target - The target to tween. + * @param {any} target - The target to tween. + * @param {integer} index - The target index within the Tween targets array. * @param {string} key - The property of the target to tween. * @param {function} getEnd - What the property will be at the END of the Tween. * @param {function} getStart - What the property will be at the START of the Tween. + * @param {?function} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * @param {function} ease - The ease function this tween uses. * @param {number} delay - Time in ms/frames before tween will start. * @param {number} duration - Duration of the tween in ms/frames. @@ -47650,16 +48642,22 @@ module.exports = Tween; * * @return {Phaser.Types.Tweens.TweenDataConfig} The config object describing this TweenData. */ -var TweenData = function (target, key, getEnd, getStart, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) +var TweenData = function (target, index, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) { return { // The target to tween target: target, + // The index of the target within the tween targets array + index: index, + // The property of the target to tween key: key, + // What to set the property to the moment the TweenData is invoked. + getActiveValue: getActive, + // The returned value sets what the property will be at the END of the Tween. getEndValue: getEnd, @@ -47733,7 +48731,7 @@ module.exports = TweenData; /***/ }), -/* 222 */ +/* 225 */ /***/ (function(module, exports) { var g; @@ -47759,7 +48757,7 @@ module.exports = g; /***/ }), -/* 223 */ +/* 226 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47768,7 +48766,7 @@ module.exports = g; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathWrap = __webpack_require__(56); +var MathWrap = __webpack_require__(57); /** * Wrap an angle. @@ -47791,7 +48789,7 @@ module.exports = Wrap; /***/ }), -/* 224 */ +/* 227 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47800,7 +48798,7 @@ module.exports = Wrap; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Wrap = __webpack_require__(56); +var Wrap = __webpack_require__(57); /** * Wrap an angle in degrees. @@ -47823,7 +48821,7 @@ module.exports = WrapDegrees; /***/ }), -/* 225 */ +/* 228 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48588,7 +49586,7 @@ module.exports = WebGLPipeline; /***/ }), -/* 226 */ +/* 229 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48599,14 +49597,14 @@ module.exports = WebGLPipeline; */ var Class = __webpack_require__(0); -var Earcut = __webpack_require__(63); +var Earcut = __webpack_require__(64); var GetFastValue = __webpack_require__(2); -var ModelViewProjection = __webpack_require__(487); -var ShaderSourceFS = __webpack_require__(735); -var ShaderSourceVS = __webpack_require__(736); +var ModelViewProjection = __webpack_require__(489); +var ShaderSourceFS = __webpack_require__(740); +var ShaderSourceVS = __webpack_require__(741); var TransformMatrix = __webpack_require__(32); var Utils = __webpack_require__(9); -var WebGLPipeline = __webpack_require__(225); +var WebGLPipeline = __webpack_require__(228); /** * @classdesc @@ -49126,9 +50124,13 @@ var TextureTintPipeline = new Class({ var frameY = frame.y; var frameWidth = frame.cutWidth; var frameHeight = frame.cutHeight; + var customPivot = frame.customPivot; - var x = -sprite.displayOriginX + frameX; - var y = -sprite.displayOriginY + frameY; + var displayOriginX = sprite.displayOriginX; + var displayOriginY = sprite.displayOriginY; + + var x = -displayOriginX + frameX; + var y = -displayOriginY + frameY; if (sprite.isCropped) { @@ -49150,26 +50152,35 @@ var TextureTintPipeline = new Class({ frameX = crop.x; frameY = crop.y; - x = -sprite.displayOriginX + frameX; - y = -sprite.displayOriginY + frameY; + x = -displayOriginX + frameX; + y = -displayOriginY + frameY; } + var flipX = 1; + var flipY = 1; + if (sprite.flipX) { - x += frameWidth; - frameWidth *= -1; + if (!customPivot) + { + x += (-frame.realWidth + (displayOriginX * 2)); + } + + flipX = -1; } - if (sprite.flipY) + // Auto-invert the flipY if this is coming from a GLTexture + if (sprite.flipY || (frame.source.isGLTexture && !texture.flipY)) { - y += frameHeight; - frameHeight *= -1; + if (!customPivot) + { + y += (-frame.realHeight + (displayOriginY * 2)); + } + + flipY = -1; } - var xw = x + frameWidth; - var yh = y + frameHeight; - - spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX, sprite.scaleY); + spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX * flipX, sprite.scaleY * flipY); camMatrix.copyFrom(camera.matrix); @@ -49194,6 +50205,9 @@ var TextureTintPipeline = new Class({ camMatrix.multiply(spriteMatrix, calcMatrix); } + var xw = x + frameWidth; + var yh = y + frameHeight; + var tx0 = calcMatrix.getX(x, y); var ty0 = calcMatrix.getY(x, y); @@ -50080,7 +51094,7 @@ module.exports = TextureTintPipeline; /***/ }), -/* 227 */ +/* 230 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50198,7 +51212,7 @@ var Common = __webpack_require__(37); /***/ }), -/* 228 */ +/* 231 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50215,11 +51229,11 @@ var Constraint = {}; module.exports = Constraint; -var Vertices = __webpack_require__(84); +var Vertices = __webpack_require__(86); var Vector = __webpack_require__(99); -var Sleeping = __webpack_require__(448); +var Sleeping = __webpack_require__(451); var Bounds = __webpack_require__(100); -var Axes = __webpack_require__(1240); +var Axes = __webpack_require__(1244); var Common = __webpack_require__(37); (function() { @@ -50657,7 +51671,7 @@ var Common = __webpack_require__(37); /***/ }), -/* 229 */ +/* 232 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50672,61 +51686,61 @@ var Common = __webpack_require__(37); module.exports = { - Angle: __webpack_require__(499), - Call: __webpack_require__(500), - GetFirst: __webpack_require__(501), - GetLast: __webpack_require__(502), - GridAlign: __webpack_require__(503), - IncAlpha: __webpack_require__(537), - IncX: __webpack_require__(538), - IncXY: __webpack_require__(539), - IncY: __webpack_require__(540), - PlaceOnCircle: __webpack_require__(541), - PlaceOnEllipse: __webpack_require__(542), - PlaceOnLine: __webpack_require__(543), - PlaceOnRectangle: __webpack_require__(544), - PlaceOnTriangle: __webpack_require__(545), - PlayAnimation: __webpack_require__(546), + Angle: __webpack_require__(501), + Call: __webpack_require__(502), + GetFirst: __webpack_require__(503), + GetLast: __webpack_require__(504), + GridAlign: __webpack_require__(505), + IncAlpha: __webpack_require__(555), + IncX: __webpack_require__(556), + IncXY: __webpack_require__(557), + IncY: __webpack_require__(558), + PlaceOnCircle: __webpack_require__(559), + PlaceOnEllipse: __webpack_require__(560), + PlaceOnLine: __webpack_require__(561), + PlaceOnRectangle: __webpack_require__(562), + PlaceOnTriangle: __webpack_require__(563), + PlayAnimation: __webpack_require__(564), PropertyValueInc: __webpack_require__(34), PropertyValueSet: __webpack_require__(27), - RandomCircle: __webpack_require__(547), - RandomEllipse: __webpack_require__(548), - RandomLine: __webpack_require__(549), - RandomRectangle: __webpack_require__(550), - RandomTriangle: __webpack_require__(551), - Rotate: __webpack_require__(552), - RotateAround: __webpack_require__(553), - RotateAroundDistance: __webpack_require__(554), - ScaleX: __webpack_require__(555), - ScaleXY: __webpack_require__(556), - ScaleY: __webpack_require__(557), - SetAlpha: __webpack_require__(558), - SetBlendMode: __webpack_require__(559), - SetDepth: __webpack_require__(560), - SetHitArea: __webpack_require__(561), - SetOrigin: __webpack_require__(562), - SetRotation: __webpack_require__(563), - SetScale: __webpack_require__(564), - SetScaleX: __webpack_require__(565), - SetScaleY: __webpack_require__(566), - SetTint: __webpack_require__(567), - SetVisible: __webpack_require__(568), - SetX: __webpack_require__(569), - SetXY: __webpack_require__(570), - SetY: __webpack_require__(571), - ShiftPosition: __webpack_require__(572), - Shuffle: __webpack_require__(573), - SmootherStep: __webpack_require__(574), - SmoothStep: __webpack_require__(575), - Spread: __webpack_require__(576), - ToggleVisible: __webpack_require__(577), - WrapInRectangle: __webpack_require__(578) + RandomCircle: __webpack_require__(565), + RandomEllipse: __webpack_require__(566), + RandomLine: __webpack_require__(567), + RandomRectangle: __webpack_require__(568), + RandomTriangle: __webpack_require__(569), + Rotate: __webpack_require__(570), + RotateAround: __webpack_require__(571), + RotateAroundDistance: __webpack_require__(572), + ScaleX: __webpack_require__(573), + ScaleXY: __webpack_require__(574), + ScaleY: __webpack_require__(575), + SetAlpha: __webpack_require__(576), + SetBlendMode: __webpack_require__(577), + SetDepth: __webpack_require__(578), + SetHitArea: __webpack_require__(579), + SetOrigin: __webpack_require__(580), + SetRotation: __webpack_require__(581), + SetScale: __webpack_require__(582), + SetScaleX: __webpack_require__(583), + SetScaleY: __webpack_require__(584), + SetTint: __webpack_require__(585), + SetVisible: __webpack_require__(586), + SetX: __webpack_require__(587), + SetXY: __webpack_require__(588), + SetY: __webpack_require__(589), + ShiftPosition: __webpack_require__(590), + Shuffle: __webpack_require__(591), + SmootherStep: __webpack_require__(592), + SmoothStep: __webpack_require__(593), + Spread: __webpack_require__(594), + ToggleVisible: __webpack_require__(595), + WrapInRectangle: __webpack_require__(596) }; /***/ }), -/* 230 */ +/* 233 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50735,19 +51749,19 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ALIGN_CONST = __webpack_require__(143); +var ALIGN_CONST = __webpack_require__(144); var AlignInMap = []; -AlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(231); -AlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(232); -AlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(233); -AlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(234); -AlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(236); -AlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(237); -AlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(238); -AlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(239); -AlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(240); +AlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(234); +AlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(235); +AlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(236); +AlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(237); +AlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(239); +AlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(240); +AlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(241); +AlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(242); +AlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(243); /** * Takes given Game Object and aligns it so that it is positioned relative to the other. @@ -50775,7 +51789,7 @@ module.exports = QuickSet; /***/ }), -/* 231 */ +/* 234 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50785,9 +51799,9 @@ module.exports = QuickSet; */ var GetBottom = __webpack_require__(38); -var GetCenterX = __webpack_require__(73); +var GetCenterX = __webpack_require__(74); var SetBottom = __webpack_require__(39); -var SetCenterX = __webpack_require__(74); +var SetCenterX = __webpack_require__(75); /** * Takes given Game Object and aligns it so that it is positioned in the bottom center of the other. @@ -50819,7 +51833,7 @@ module.exports = BottomCenter; /***/ }), -/* 232 */ +/* 235 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50863,7 +51877,7 @@ module.exports = BottomLeft; /***/ }), -/* 233 */ +/* 236 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50907,7 +51921,7 @@ module.exports = BottomRight; /***/ }), -/* 234 */ +/* 237 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50916,9 +51930,9 @@ module.exports = BottomRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CenterOn = __webpack_require__(235); -var GetCenterX = __webpack_require__(73); -var GetCenterY = __webpack_require__(76); +var CenterOn = __webpack_require__(238); +var GetCenterX = __webpack_require__(74); +var GetCenterY = __webpack_require__(77); /** * Takes given Game Object and aligns it so that it is positioned in the center of the other. @@ -50949,7 +51963,7 @@ module.exports = Center; /***/ }), -/* 235 */ +/* 238 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50958,8 +51972,8 @@ module.exports = Center; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetCenterX = __webpack_require__(74); -var SetCenterY = __webpack_require__(75); +var SetCenterX = __webpack_require__(75); +var SetCenterY = __webpack_require__(76); /** * Positions the Game Object so that it is centered on the given coordinates. @@ -50986,7 +52000,7 @@ module.exports = CenterOn; /***/ }), -/* 236 */ +/* 239 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50995,9 +52009,9 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(76); +var GetCenterY = __webpack_require__(77); var GetLeft = __webpack_require__(40); -var SetCenterY = __webpack_require__(75); +var SetCenterY = __webpack_require__(76); var SetLeft = __webpack_require__(41); /** @@ -51030,7 +52044,7 @@ module.exports = LeftCenter; /***/ }), -/* 237 */ +/* 240 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51039,9 +52053,9 @@ module.exports = LeftCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(76); +var GetCenterY = __webpack_require__(77); var GetRight = __webpack_require__(42); -var SetCenterY = __webpack_require__(75); +var SetCenterY = __webpack_require__(76); var SetRight = __webpack_require__(43); /** @@ -51074,7 +52088,7 @@ module.exports = RightCenter; /***/ }), -/* 238 */ +/* 241 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51083,9 +52097,9 @@ module.exports = RightCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterX = __webpack_require__(73); +var GetCenterX = __webpack_require__(74); var GetTop = __webpack_require__(44); -var SetCenterX = __webpack_require__(74); +var SetCenterX = __webpack_require__(75); var SetTop = __webpack_require__(45); /** @@ -51118,7 +52132,7 @@ module.exports = TopCenter; /***/ }), -/* 239 */ +/* 242 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51162,7 +52176,7 @@ module.exports = TopLeft; /***/ }), -/* 240 */ +/* 243 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51206,7 +52220,7 @@ module.exports = TopRight; /***/ }), -/* 241 */ +/* 244 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51215,10 +52229,10 @@ module.exports = TopRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircumferencePoint = __webpack_require__(144); -var FromPercent = __webpack_require__(86); -var MATH_CONST = __webpack_require__(23); -var Point = __webpack_require__(3); +var CircumferencePoint = __webpack_require__(145); +var FromPercent = __webpack_require__(87); +var MATH_CONST = __webpack_require__(22); +var Point = __webpack_require__(4); /** * Returns a Point object containing the coordinates of a point on the circumference of the Circle @@ -51249,7 +52263,7 @@ module.exports = GetPoint; /***/ }), -/* 242 */ +/* 245 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51258,10 +52272,10 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circumference = __webpack_require__(243); -var CircumferencePoint = __webpack_require__(144); -var FromPercent = __webpack_require__(86); -var MATH_CONST = __webpack_require__(23); +var Circumference = __webpack_require__(246); +var CircumferencePoint = __webpack_require__(145); +var FromPercent = __webpack_require__(87); +var MATH_CONST = __webpack_require__(22); /** * Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle, @@ -51301,7 +52315,7 @@ module.exports = GetPoints; /***/ }), -/* 243 */ +/* 246 */ /***/ (function(module, exports) { /** @@ -51329,7 +52343,7 @@ module.exports = Circumference; /***/ }), -/* 244 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51338,7 +52352,7 @@ module.exports = Circumference; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); // bitmask flag for GameObject.renderMask var _FLAG = 2; // 0010 @@ -51624,7 +52638,7 @@ module.exports = Alpha; /***/ }), -/* 245 */ +/* 248 */ /***/ (function(module, exports) { /** @@ -51708,7 +52722,7 @@ module.exports = FindClosestInSorted; /***/ }), -/* 246 */ +/* 249 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51882,7 +52896,7 @@ module.exports = AnimationFrame; /***/ }), -/* 247 */ +/* 250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51891,7 +52905,7 @@ module.exports = AnimationFrame; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(52); +var BlendModes = __webpack_require__(53); /** * Provides methods used for setting the blend mode of a Game Object. @@ -52004,7 +53018,7 @@ module.exports = BlendMode; /***/ }), -/* 248 */ +/* 251 */ /***/ (function(module, exports) { /** @@ -52097,7 +53111,7 @@ module.exports = Depth; /***/ }), -/* 249 */ +/* 252 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52106,8 +53120,8 @@ module.exports = Depth; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoint = __webpack_require__(147); -var Perimeter = __webpack_require__(108); +var GetPoint = __webpack_require__(148); +var Perimeter = __webpack_require__(109); // Return an array of points from the perimeter of the rectangle // each spaced out based on the quantity or step required @@ -52151,7 +53165,7 @@ module.exports = GetPoints; /***/ }), -/* 250 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52160,7 +53174,7 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Get a point on a line that's a given percentage along its length. @@ -52190,7 +53204,7 @@ module.exports = GetPoint; /***/ }), -/* 251 */ +/* 254 */ /***/ (function(module, exports) { /** @@ -52230,7 +53244,7 @@ module.exports = RotateAround; /***/ }), -/* 252 */ +/* 255 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52239,8 +53253,8 @@ module.exports = RotateAround; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(253); -var GeometryMask = __webpack_require__(254); +var BitmapMask = __webpack_require__(256); +var GeometryMask = __webpack_require__(257); /** * Provides methods used for getting and setting the mask of a Game Object. @@ -52377,7 +53391,7 @@ module.exports = Mask; /***/ }), -/* 253 */ +/* 256 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52387,6 +53401,7 @@ module.exports = Mask; */ var Class = __webpack_require__(0); +var GameEvents = __webpack_require__(18); /** * @classdesc @@ -52541,7 +53556,7 @@ var BitmapMask = new Class({ this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - renderer.onContextRestored(function (renderer) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) { var width = renderer.width; var height = renderer.height; @@ -52669,7 +53684,7 @@ module.exports = BitmapMask; /***/ }), -/* 254 */ +/* 257 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52984,7 +53999,7 @@ module.exports = GeometryMask; /***/ }), -/* 255 */ +/* 258 */ /***/ (function(module, exports) { /** @@ -53091,7 +54106,7 @@ module.exports = ScrollFactor; /***/ }), -/* 256 */ +/* 259 */ /***/ (function(module, exports) { /** @@ -53153,7 +54168,7 @@ module.exports = ToJSON; /***/ }), -/* 257 */ +/* 260 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53162,10 +54177,10 @@ module.exports = ToJSON; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); +var MATH_CONST = __webpack_require__(22); var TransformMatrix = __webpack_require__(32); -var WrapAngle = __webpack_require__(223); -var WrapAngleDegrees = __webpack_require__(224); +var WrapAngle = __webpack_require__(226); +var WrapAngleDegrees = __webpack_require__(227); // global bitmask flag for GameObject.renderMask (used by Scale) var _FLAG = 4; // 0100 @@ -53353,8 +54368,9 @@ var Transform = { /** * The angle of this Game Object as expressed in degrees. - * - * Where 0 is to the right, 90 is down, 180 is left. + * + * 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. * @@ -53379,6 +54395,9 @@ var Transform = { /** * The angle of this Game Object in radians. + * + * 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 degrees, see the `angle` property instead. * @@ -53683,7 +54702,7 @@ module.exports = Transform; /***/ }), -/* 258 */ +/* 261 */ /***/ (function(module, exports) { /** @@ -53772,7 +54791,7 @@ module.exports = Visible; /***/ }), -/* 259 */ +/* 262 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53787,16 +54806,16 @@ module.exports = Visible; module.exports = { - CHANGE_DATA: __webpack_require__(532), - CHANGE_DATA_KEY: __webpack_require__(533), - REMOVE_DATA: __webpack_require__(534), - SET_DATA: __webpack_require__(535) + CHANGE_DATA: __webpack_require__(550), + CHANGE_DATA_KEY: __webpack_require__(551), + REMOVE_DATA: __webpack_require__(552), + SET_DATA: __webpack_require__(553) }; /***/ }), -/* 260 */ +/* 263 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53805,14 +54824,13 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Perimeter = __webpack_require__(108); -var Point = __webpack_require__(3); +var Perimeter = __webpack_require__(109); +var Point = __webpack_require__(4); -// Return an array of points from the perimeter of the rectangle -// each spaced out based on the quantity or step required /** - * [description] + * 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.MarchingAnts * @since 3.0.0 @@ -53916,7 +54934,7 @@ module.exports = MarchingAnts; /***/ }), -/* 261 */ +/* 264 */ /***/ (function(module, exports) { /** @@ -53956,7 +54974,7 @@ module.exports = RotateLeft; /***/ }), -/* 262 */ +/* 265 */ /***/ (function(module, exports) { /** @@ -53996,7 +55014,7 @@ module.exports = RotateRight; /***/ }), -/* 263 */ +/* 266 */ /***/ (function(module, exports) { /** @@ -54070,7 +55088,7 @@ module.exports = BresenhamPoints; /***/ }), -/* 264 */ +/* 267 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -54079,14 +55097,14 @@ module.exports = BresenhamPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Animation = __webpack_require__(146); +var Animation = __webpack_require__(147); var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(157); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(107); -var GameEvents = __webpack_require__(28); -var GetValue = __webpack_require__(6); -var Pad = __webpack_require__(158); +var CustomMap = __webpack_require__(158); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(108); +var GameEvents = __webpack_require__(18); +var GetValue = __webpack_require__(5); +var Pad = __webpack_require__(159); /** * @classdesc @@ -54517,6 +55535,10 @@ var AnimationManager = new Class({ { anim.load(child, startFrame); } + else + { + console.warn('Missing animation: ' + key); + } return child; }, @@ -54715,7 +55737,7 @@ module.exports = AnimationManager; /***/ }), -/* 265 */ +/* 268 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -54725,9 +55747,9 @@ module.exports = AnimationManager; */ var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(157); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(266); +var CustomMap = __webpack_require__(158); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(269); /** * @classdesc @@ -54901,7 +55923,7 @@ module.exports = BaseCache; /***/ }), -/* 266 */ +/* 269 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -54916,14 +55938,14 @@ module.exports = BaseCache; module.exports = { - ADD: __webpack_require__(595), - REMOVE: __webpack_require__(596) + ADD: __webpack_require__(599), + REMOVE: __webpack_require__(600) }; /***/ }), -/* 267 */ +/* 270 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -54932,9 +55954,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCache = __webpack_require__(265); +var BaseCache = __webpack_require__(268); var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(28); +var GameEvents = __webpack_require__(18); /** * @classdesc @@ -55147,7 +56169,7 @@ module.exports = CacheManager; /***/ }), -/* 268 */ +/* 271 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -55156,16 +56178,16 @@ module.exports = CacheManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(112); -var CanvasPool = __webpack_require__(24); -var CenterOn = __webpack_require__(162); -var Clamp = __webpack_require__(22); +var BaseCamera = __webpack_require__(113); +var CanvasPool = __webpack_require__(25); +var CenterOn = __webpack_require__(163); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Effects = __webpack_require__(276); -var Linear = __webpack_require__(114); -var Rectangle = __webpack_require__(10); -var Vector2 = __webpack_require__(4); +var Effects = __webpack_require__(279); +var Linear = __webpack_require__(115); +var Rectangle = __webpack_require__(11); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -55194,7 +56216,7 @@ var Vector2 = __webpack_require__(4); * @memberof Phaser.Cameras.Scene2D * @constructor * @since 3.0.0 - * + * * @extends Phaser.Cameras.Scene2D.BaseCamera * @extends Phaser.GameObjects.Components.Flip * @extends Phaser.GameObjects.Components.Tint @@ -55346,11 +56368,11 @@ var Camera = new Class({ /** * Is this Camera rendering directly to the canvas or to a texture? - * + * * Enable rendering to texture with the method `setRenderToTexture` (just enabling this boolean won't be enough) - * + * * Once enabled you can toggle it by switching this property. - * + * * To properly remove a render texture you should call the `clearRenderToTexture()` method. * * @name Phaser.Cameras.Scene2D.Camera#renderToTexture @@ -55363,9 +56385,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the HTML Canvas Element that the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only populated if Phaser is running with the Canvas Renderer. * * @name Phaser.Cameras.Scene2D.Camera#canvas @@ -55377,9 +56399,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the Rendering Context belonging to the Canvas element the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only populated if Phaser is running with the Canvas Renderer. * * @name Phaser.Cameras.Scene2D.Camera#context @@ -55391,9 +56413,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the GL Texture belonging the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only set if Phaser is running with the WebGL Renderer. * * @name Phaser.Cameras.Scene2D.Camera#glTexture @@ -55405,9 +56427,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture then this holds a reference * to the GL Frame Buffer belonging the Camera is drawing to. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only set if Phaser is running with the WebGL Renderer. * * @name Phaser.Cameras.Scene2D.Camera#framebuffer @@ -55419,9 +56441,9 @@ var Camera = new Class({ /** * If this Camera has been set to render to a texture and to use a custom pipeline, * then this holds a reference to the pipeline the Camera is drawing with. - * + * * Enable texture rendering using the method `setRenderToTexture`. - * + * * This is only set if Phaser is running with the WebGL Renderer. * * @name Phaser.Cameras.Scene2D.Camera#pipeline @@ -55433,32 +56455,32 @@ var Camera = new Class({ /** * Sets the Camera to render to a texture instead of to the main canvas. - * + * * The Camera will redirect all Game Objects it's asked to render to this texture. - * + * * During the render sequence, the texture itself will then be rendered to the main canvas. - * + * * Doing this gives you the ability to modify the texture before this happens, * allowing for special effects such as Camera specific shaders, or post-processing * on the texture. - * + * * If running under Canvas the Camera will render to its `canvas` property. - * + * * If running under WebGL the Camera will create a frame buffer, which is stored in its `framebuffer` and `glTexture` properties. - * + * * If you set a camera to render to a texture then it will emit 2 events during the render loop: - * + * * First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture. - * + * * Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the * Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before * it appears in-game. - * + * * You should not enable this unless you plan on actually using the texture it creates * somehow, otherwise you're just doubling the work required to render your game. - * + * * To temporarily disable rendering to a texture, toggle the `renderToTexture` boolean. - * + * * If you no longer require the Camera to render to a texture, call the `clearRenderToTexture` method, * which will delete the respective textures and free-up resources. * @@ -55496,9 +56518,9 @@ var Camera = new Class({ /** * Sets the WebGL pipeline this Camera is using when rendering to a texture. - * + * * You can pass either the string-based name of the pipeline, or a reference to the pipeline itself. - * + * * Call this method with no arguments to clear any previously set pipeline. * * @method Phaser.Cameras.Scene2D.Camera#setPipeline @@ -55530,7 +56552,7 @@ var Camera = new Class({ /** * If this Camera was set to render to a texture, this will clear the resources it was using and * redirect it to render back to the primary Canvas again. - * + * * If you only wish to temporarily disable rendering to a texture then you can toggle the * property `renderToTexture` instead. * @@ -55548,6 +56570,11 @@ var Camera = new Class({ var renderer = this.scene.sys.game.renderer; + if (!renderer) + { + return; + } + if (renderer.gl) { if (this.framebuffer) @@ -55767,7 +56794,7 @@ var Camera = new Class({ * @since 3.0.0 * * @param {integer} [duration=100] - The duration of the effect in milliseconds. - * @param {number} [intensity=0.05] - The intensity of the shake. + * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -56040,7 +57067,7 @@ var Camera = new Class({ this.scrollX = fx - originX; this.scrollY = fy - originY; - + if (this.useBounds) { this.scrollX = this.clampX(this.scrollX); @@ -56135,7 +57162,7 @@ module.exports = Camera; /***/ }), -/* 269 */ +/* 272 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56188,7 +57215,7 @@ module.exports = HexStringToColor; /***/ }), -/* 270 */ +/* 273 */ /***/ (function(module, exports) { /** @@ -56219,7 +57246,7 @@ module.exports = GetColor32; /***/ }), -/* 271 */ +/* 274 */ /***/ (function(module, exports) { /** @@ -56299,7 +57326,7 @@ module.exports = RGBToHSV; /***/ }), -/* 272 */ +/* 275 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56309,7 +57336,7 @@ module.exports = RGBToHSV; */ var Color = __webpack_require__(33); -var IntegerToRGB = __webpack_require__(273); +var IntegerToRGB = __webpack_require__(276); /** * Converts the given color value into an instance of a Color object. @@ -56332,7 +57359,7 @@ module.exports = IntegerToColor; /***/ }), -/* 273 */ +/* 276 */ /***/ (function(module, exports) { /** @@ -56380,7 +57407,7 @@ module.exports = IntegerToRGB; /***/ }), -/* 274 */ +/* 277 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56410,7 +57437,7 @@ module.exports = ObjectToColor; /***/ }), -/* 275 */ +/* 278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56456,7 +57483,7 @@ module.exports = RGBStringToColor; /***/ }), -/* 276 */ +/* 279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56471,80 +57498,11 @@ module.exports = RGBStringToColor; module.exports = { - Fade: __webpack_require__(617), - Flash: __webpack_require__(618), - Pan: __webpack_require__(619), - Shake: __webpack_require__(652), - Zoom: __webpack_require__(653) - -}; - - -/***/ }), -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Back - */ - -module.exports = { - - In: __webpack_require__(620), - Out: __webpack_require__(621), - InOut: __webpack_require__(622) - -}; - - -/***/ }), -/* 278 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Bounce - */ - -module.exports = { - - In: __webpack_require__(623), - Out: __webpack_require__(624), - InOut: __webpack_require__(625) - -}; - - -/***/ }), -/* 279 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Circular - */ - -module.exports = { - - In: __webpack_require__(626), - Out: __webpack_require__(627), - InOut: __webpack_require__(628) + Fade: __webpack_require__(621), + Flash: __webpack_require__(622), + Pan: __webpack_require__(623), + Shake: __webpack_require__(656), + Zoom: __webpack_require__(657) }; @@ -56560,14 +57518,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Cubic + * @namespace Phaser.Math.Easing.Back */ module.exports = { - In: __webpack_require__(629), - Out: __webpack_require__(630), - InOut: __webpack_require__(631) + In: __webpack_require__(624), + Out: __webpack_require__(625), + InOut: __webpack_require__(626) }; @@ -56583,14 +57541,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Elastic + * @namespace Phaser.Math.Easing.Bounce */ module.exports = { - In: __webpack_require__(632), - Out: __webpack_require__(633), - InOut: __webpack_require__(634) + In: __webpack_require__(627), + Out: __webpack_require__(628), + InOut: __webpack_require__(629) }; @@ -56606,14 +57564,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Expo + * @namespace Phaser.Math.Easing.Circular */ module.exports = { - In: __webpack_require__(635), - Out: __webpack_require__(636), - InOut: __webpack_require__(637) + In: __webpack_require__(630), + Out: __webpack_require__(631), + InOut: __webpack_require__(632) }; @@ -56629,10 +57587,16 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Linear + * @namespace Phaser.Math.Easing.Cubic */ -module.exports = __webpack_require__(638); +module.exports = { + + In: __webpack_require__(633), + Out: __webpack_require__(634), + InOut: __webpack_require__(635) + +}; /***/ }), @@ -56646,14 +57610,14 @@ module.exports = __webpack_require__(638); */ /** - * @namespace Phaser.Math.Easing.Quadratic + * @namespace Phaser.Math.Easing.Elastic */ module.exports = { - In: __webpack_require__(639), - Out: __webpack_require__(640), - InOut: __webpack_require__(641) + In: __webpack_require__(636), + Out: __webpack_require__(637), + InOut: __webpack_require__(638) }; @@ -56669,14 +57633,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Quartic + * @namespace Phaser.Math.Easing.Expo */ module.exports = { - In: __webpack_require__(642), - Out: __webpack_require__(643), - InOut: __webpack_require__(644) + In: __webpack_require__(639), + Out: __webpack_require__(640), + InOut: __webpack_require__(641) }; @@ -56692,16 +57656,10 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Quintic + * @namespace Phaser.Math.Easing.Linear */ -module.exports = { - - In: __webpack_require__(645), - Out: __webpack_require__(646), - InOut: __webpack_require__(647) - -}; +module.exports = __webpack_require__(642); /***/ }), @@ -56715,14 +57673,14 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Sine + * @namespace Phaser.Math.Easing.Quadratic */ module.exports = { - In: __webpack_require__(648), - Out: __webpack_require__(649), - InOut: __webpack_require__(650) + In: __webpack_require__(643), + Out: __webpack_require__(644), + InOut: __webpack_require__(645) }; @@ -56738,16 +57696,85 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Stepped + * @namespace Phaser.Math.Easing.Quartic */ -module.exports = __webpack_require__(651); +module.exports = { + + In: __webpack_require__(646), + Out: __webpack_require__(647), + InOut: __webpack_require__(648) + +}; /***/ }), /* 289 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(649), + Out: __webpack_require__(650), + InOut: __webpack_require__(651) + +}; + + +/***/ }), +/* 290 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(652), + Out: __webpack_require__(653), + InOut: __webpack_require__(654) + +}; + + +/***/ }), +/* 291 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(655); + + +/***/ }), +/* 292 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. @@ -56755,15 +57782,15 @@ module.exports = __webpack_require__(651); */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(26); -var Device = __webpack_require__(290); +var CONST = __webpack_require__(31); +var Device = __webpack_require__(293); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); var IsPlainObject = __webpack_require__(7); -var PhaserMath = __webpack_require__(165); +var PhaserMath = __webpack_require__(166); var NOOP = __webpack_require__(1); -var DefaultPlugins = __webpack_require__(171); -var ValueToColor = __webpack_require__(159); +var DefaultPlugins = __webpack_require__(172); +var ValueToColor = __webpack_require__(160); /** * @classdesc @@ -57311,7 +58338,7 @@ module.exports = Config; /***/ }), -/* 290 */ +/* 293 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57345,20 +58372,20 @@ module.exports = Config; module.exports = { - os: __webpack_require__(115), - browser: __webpack_require__(116), - features: __webpack_require__(164), - input: __webpack_require__(682), - audio: __webpack_require__(683), - video: __webpack_require__(684), - fullscreen: __webpack_require__(685), - canvasFeatures: __webpack_require__(291) + os: __webpack_require__(116), + browser: __webpack_require__(117), + features: __webpack_require__(165), + input: __webpack_require__(686), + audio: __webpack_require__(687), + video: __webpack_require__(688), + fullscreen: __webpack_require__(689), + canvasFeatures: __webpack_require__(294) }; /***/ }), -/* 291 */ +/* 294 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57367,7 +58394,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); +var CanvasPool = __webpack_require__(25); /** * Determines the canvas features of the browser running this Phaser Game instance. @@ -57472,7 +58499,7 @@ module.exports = init(); /***/ }), -/* 292 */ +/* 295 */ /***/ (function(module, exports) { /** @@ -57503,7 +58530,7 @@ module.exports = Between; /***/ }), -/* 293 */ +/* 296 */ /***/ (function(module, exports) { /** @@ -57540,7 +58567,7 @@ module.exports = Normalize; /***/ }), -/* 294 */ +/* 297 */ /***/ (function(module, exports) { /** @@ -57574,7 +58601,7 @@ module.exports = DistanceSquared; /***/ }), -/* 295 */ +/* 298 */ /***/ (function(module, exports) { /** @@ -57608,7 +58635,7 @@ module.exports = GreaterThan; /***/ }), -/* 296 */ +/* 299 */ /***/ (function(module, exports) { /** @@ -57642,7 +58669,7 @@ module.exports = LessThan; /***/ }), -/* 297 */ +/* 300 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57651,7 +58678,7 @@ module.exports = LessThan; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Factorial = __webpack_require__(298); +var Factorial = __webpack_require__(301); /** * [description] @@ -57673,7 +58700,7 @@ module.exports = Bernstein; /***/ }), -/* 298 */ +/* 301 */ /***/ (function(module, exports) { /** @@ -57713,7 +58740,7 @@ module.exports = Factorial; /***/ }), -/* 299 */ +/* 302 */ /***/ (function(module, exports) { /** @@ -57783,7 +58810,7 @@ module.exports = CubicBezierInterpolation; /***/ }), -/* 300 */ +/* 303 */ /***/ (function(module, exports) { /** @@ -57842,7 +58869,7 @@ module.exports = QuadraticBezierInterpolation; /***/ }), -/* 301 */ +/* 304 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57851,7 +58878,7 @@ module.exports = QuadraticBezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmoothStep = __webpack_require__(156); +var SmoothStep = __webpack_require__(157); /** * A Smooth Step interpolation method. @@ -57875,7 +58902,7 @@ module.exports = SmoothStepInterpolation; /***/ }), -/* 302 */ +/* 305 */ /***/ (function(module, exports) { /** @@ -57905,7 +58932,7 @@ module.exports = GetPowerOfTwo; /***/ }), -/* 303 */ +/* 306 */ /***/ (function(module, exports) { /** @@ -57949,7 +58976,7 @@ module.exports = SnapCeil; /***/ }), -/* 304 */ +/* 307 */ /***/ (function(module, exports) { /** @@ -57978,7 +59005,7 @@ module.exports = FloatBetween; /***/ }), -/* 305 */ +/* 308 */ /***/ (function(module, exports) { /** @@ -58013,7 +59040,7 @@ module.exports = Rotate; /***/ }), -/* 306 */ +/* 309 */ /***/ (function(module, exports) { /** @@ -58042,7 +59069,7 @@ module.exports = RoundAwayFromZero; /***/ }), -/* 307 */ +/* 310 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58051,7 +59078,7 @@ module.exports = RoundAwayFromZero; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector2 = __webpack_require__(4); +var Vector2 = __webpack_require__(3); /** * Takes the `x` and `y` coordinates and transforms them into the same space as @@ -58097,7 +59124,7 @@ module.exports = TransformXY; /***/ }), -/* 308 */ +/* 311 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58642,7 +59669,7 @@ module.exports = Vector4; /***/ }), -/* 309 */ +/* 312 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -59235,7 +60262,7 @@ module.exports = Matrix3; /***/ }), -/* 310 */ +/* 313 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60697,7 +61724,7 @@ module.exports = Matrix4; /***/ }), -/* 311 */ +/* 314 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60710,8 +61737,8 @@ module.exports = Matrix4; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(0); -var Vector3 = __webpack_require__(170); -var Matrix3 = __webpack_require__(309); +var Vector3 = __webpack_require__(171); +var Matrix3 = __webpack_require__(312); var EPSILON = 0.000001; @@ -61469,7 +62496,7 @@ module.exports = Quaternion; /***/ }), -/* 312 */ +/* 315 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61478,10 +62505,10 @@ module.exports = Quaternion; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasInterpolation = __webpack_require__(313); -var CanvasPool = __webpack_require__(24); -var CONST = __webpack_require__(26); -var Features = __webpack_require__(164); +var CanvasInterpolation = __webpack_require__(316); +var CanvasPool = __webpack_require__(25); +var CONST = __webpack_require__(31); +var Features = __webpack_require__(165); /** * Called automatically by Phaser.Game and responsible for creating the renderer it will use. @@ -61571,8 +62598,8 @@ var CreateRenderer = function (game) if (true) { - CanvasRenderer = __webpack_require__(480); - WebGLRenderer = __webpack_require__(483); + CanvasRenderer = __webpack_require__(482); + WebGLRenderer = __webpack_require__(485); // Let the config pick the renderer type, as both are included if (config.renderType === CONST.WEBGL) @@ -61597,7 +62624,7 @@ module.exports = CreateRenderer; /***/ }), -/* 313 */ +/* 316 */ /***/ (function(module, exports) { /** @@ -61660,7 +62687,7 @@ module.exports = CanvasInterpolation; /***/ }), -/* 314 */ +/* 317 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61669,7 +62696,7 @@ module.exports = CanvasInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(26); +var CONST = __webpack_require__(31); /** * Called automatically by Phaser.Game and responsible for creating the console.log debug header. @@ -61790,7 +62817,7 @@ module.exports = DebugHeader; /***/ }), -/* 315 */ +/* 318 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61800,9 +62827,9 @@ module.exports = DebugHeader; */ var Class = __webpack_require__(0); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); var NOOP = __webpack_require__(1); -var RequestAnimationFrame = __webpack_require__(316); +var RequestAnimationFrame = __webpack_require__(319); // Frame Rate config // fps: { @@ -62497,7 +63524,7 @@ module.exports = TimeStep; /***/ }), -/* 316 */ +/* 319 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62697,7 +63724,7 @@ module.exports = RequestAnimationFrame; /***/ }), -/* 317 */ +/* 320 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62706,7 +63733,7 @@ module.exports = RequestAnimationFrame; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Events = __webpack_require__(28); +var Events = __webpack_require__(18); /** * The Visibility Handler is responsible for listening out for document level visibility change events. @@ -62788,7 +63815,7 @@ module.exports = VisibilityHandler; /***/ }), -/* 318 */ +/* 321 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62797,9 +63824,9 @@ module.exports = VisibilityHandler; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Arne16 = __webpack_require__(319); -var CanvasPool = __webpack_require__(24); -var GetValue = __webpack_require__(6); +var Arne16 = __webpack_require__(322); +var CanvasPool = __webpack_require__(25); +var GetValue = __webpack_require__(5); /** * [description] @@ -62882,7 +63909,7 @@ module.exports = GenerateTexture; /***/ }), -/* 319 */ +/* 322 */ /***/ (function(module, exports) { /** @@ -62920,7 +63947,7 @@ module.exports = { /***/ }), -/* 320 */ +/* 323 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62932,9 +63959,9 @@ module.exports = { // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var CubicBezier = __webpack_require__(299); -var Curve = __webpack_require__(79); -var Vector2 = __webpack_require__(4); +var CubicBezier = __webpack_require__(302); +var Curve = __webpack_require__(80); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -63147,7 +64174,7 @@ module.exports = CubicBezierCurve; /***/ }), -/* 321 */ +/* 324 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -63159,11 +64186,11 @@ module.exports = CubicBezierCurve; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var Curve = __webpack_require__(79); +var Curve = __webpack_require__(80); var DegToRad = __webpack_require__(35); -var GetValue = __webpack_require__(6); -var RadToDeg = __webpack_require__(169); -var Vector2 = __webpack_require__(4); +var GetValue = __webpack_require__(5); +var RadToDeg = __webpack_require__(170); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -63183,7 +64210,7 @@ var Vector2 = __webpack_require__(4); * @param {number} [yRadius=0] - The vertical radius of ellipse. * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. - * @param {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). * @param {integer} [rotation=0] - The rotation of the ellipse, in degrees. */ var EllipseCurve = new Class({ @@ -63771,7 +64798,7 @@ module.exports = EllipseCurve; /***/ }), -/* 322 */ +/* 325 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -63783,10 +64810,10 @@ module.exports = EllipseCurve; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var Curve = __webpack_require__(79); -var FromPoints = __webpack_require__(172); -var Rectangle = __webpack_require__(10); -var Vector2 = __webpack_require__(4); +var Curve = __webpack_require__(80); +var FromPoints = __webpack_require__(173); +var Rectangle = __webpack_require__(11); +var Vector2 = __webpack_require__(3); var tmpVec2 = new Vector2(); @@ -64028,7 +65055,7 @@ module.exports = LineCurve; /***/ }), -/* 323 */ +/* 326 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64038,9 +65065,9 @@ module.exports = LineCurve; */ var Class = __webpack_require__(0); -var Curve = __webpack_require__(79); -var QuadraticBezierInterpolation = __webpack_require__(300); -var Vector2 = __webpack_require__(4); +var Curve = __webpack_require__(80); +var QuadraticBezierInterpolation = __webpack_require__(303); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -64242,7 +65269,7 @@ module.exports = QuadraticBezier; /***/ }), -/* 324 */ +/* 327 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64253,10 +65280,10 @@ module.exports = QuadraticBezier; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) -var CatmullRom = __webpack_require__(167); +var CatmullRom = __webpack_require__(168); var Class = __webpack_require__(0); -var Curve = __webpack_require__(79); -var Vector2 = __webpack_require__(4); +var Curve = __webpack_require__(80); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -64467,7 +65494,7 @@ module.exports = SplineCurve; /***/ }), -/* 325 */ +/* 328 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64591,7 +65618,7 @@ module.exports = BaseShader; /***/ }), -/* 326 */ +/* 329 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64602,30 +65629,30 @@ module.exports = BaseShader; var Color = __webpack_require__(33); -Color.ColorToRGBA = __webpack_require__(770); -Color.ComponentToHex = __webpack_require__(327); -Color.GetColor = __webpack_require__(160); -Color.GetColor32 = __webpack_require__(270); -Color.HexStringToColor = __webpack_require__(269); -Color.HSLToColor = __webpack_require__(771); -Color.HSVColorWheel = __webpack_require__(772); -Color.HSVToRGB = __webpack_require__(161); -Color.HueToComponent = __webpack_require__(328); -Color.IntegerToColor = __webpack_require__(272); -Color.IntegerToRGB = __webpack_require__(273); -Color.Interpolate = __webpack_require__(773); -Color.ObjectToColor = __webpack_require__(274); -Color.RandomRGB = __webpack_require__(774); -Color.RGBStringToColor = __webpack_require__(275); -Color.RGBToHSV = __webpack_require__(271); -Color.RGBToString = __webpack_require__(775); -Color.ValueToColor = __webpack_require__(159); +Color.ColorToRGBA = __webpack_require__(775); +Color.ComponentToHex = __webpack_require__(330); +Color.GetColor = __webpack_require__(161); +Color.GetColor32 = __webpack_require__(273); +Color.HexStringToColor = __webpack_require__(272); +Color.HSLToColor = __webpack_require__(776); +Color.HSVColorWheel = __webpack_require__(777); +Color.HSVToRGB = __webpack_require__(162); +Color.HueToComponent = __webpack_require__(331); +Color.IntegerToColor = __webpack_require__(275); +Color.IntegerToRGB = __webpack_require__(276); +Color.Interpolate = __webpack_require__(778); +Color.ObjectToColor = __webpack_require__(277); +Color.RandomRGB = __webpack_require__(779); +Color.RGBStringToColor = __webpack_require__(278); +Color.RGBToHSV = __webpack_require__(274); +Color.RGBToString = __webpack_require__(780); +Color.ValueToColor = __webpack_require__(160); module.exports = Color; /***/ }), -/* 327 */ +/* 330 */ /***/ (function(module, exports) { /** @@ -64655,7 +65682,7 @@ module.exports = ComponentToHex; /***/ }), -/* 328 */ +/* 331 */ /***/ (function(module, exports) { /** @@ -64711,7 +65738,7 @@ module.exports = HueToComponent; /***/ }), -/* 329 */ +/* 332 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64720,7 +65747,7 @@ module.exports = HueToComponent; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(115); +var OS = __webpack_require__(116); /** * @callback ContentLoadedCallback @@ -64774,7 +65801,7 @@ module.exports = DOMContentLoaded; /***/ }), -/* 330 */ +/* 333 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64783,7 +65810,7 @@ module.exports = DOMContentLoaded; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(173); +var CONST = __webpack_require__(174); /** * Attempts to determine the screen orientation using the Orientation API. @@ -64840,7 +65867,7 @@ module.exports = GetScreenOrientation; /***/ }), -/* 331 */ +/* 334 */ /***/ (function(module, exports) { /** @@ -64926,7 +65953,7 @@ module.exports = { /***/ }), -/* 332 */ +/* 335 */ /***/ (function(module, exports) { /** @@ -64979,7 +66006,7 @@ module.exports = { /***/ }), -/* 333 */ +/* 336 */ /***/ (function(module, exports) { /** @@ -65077,7 +66104,7 @@ module.exports = { /***/ }), -/* 334 */ +/* 337 */ /***/ (function(module, exports) { /** @@ -65151,7 +66178,7 @@ module.exports = { /***/ }), -/* 335 */ +/* 338 */ /***/ (function(module, exports) { /** @@ -65202,7 +66229,7 @@ module.exports = GetTarget; /***/ }), -/* 336 */ +/* 339 */ /***/ (function(module, exports) { /** @@ -65259,7 +66286,7 @@ module.exports = ParseXML; /***/ }), -/* 337 */ +/* 340 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -65269,16 +66296,16 @@ module.exports = ParseXML; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(175); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(53); -var GameEvents = __webpack_require__(28); -var Keyboard = __webpack_require__(338); -var Mouse = __webpack_require__(339); -var Pointer = __webpack_require__(340); -var Touch = __webpack_require__(341); +var CONST = __webpack_require__(176); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(54); +var GameEvents = __webpack_require__(18); +var Keyboard = __webpack_require__(341); +var Mouse = __webpack_require__(342); +var Pointer = __webpack_require__(343); +var Touch = __webpack_require__(344); var TransformMatrix = __webpack_require__(32); -var TransformXY = __webpack_require__(307); +var TransformXY = __webpack_require__(310); /** * @classdesc @@ -65722,7 +66749,7 @@ var InputManager = new Class({ */ resetCursor: function (interactiveObject) { - if (interactiveObject.cursor) + if (interactiveObject.cursor && this.canvas) { this.canvas.style.cursor = this.defaultCursor; } @@ -66035,6 +67062,25 @@ var InputManager = new Class({ this.updateInputPlugins(CONST.MOUSE_WHEEL, this.mousePointerContainer); }, + /** + * Processes a pointer lock change event, as passed in by the MouseManager. + * + * @method Phaser.Input.InputManager#onPointerLockChange + * @fires Phaser.Input.Events#POINTERLOCK_CHANGE + * @private + * @since 3.19.0 + * + * @param {MouseEvent} event - The native DOM Mouse event. + */ + onPointerLockChange: function (event) + { + var isLocked = this.mouse.locked; + + this.mousePointer.locked = isLocked; + + this.events.emit(Events.POINTERLOCK_CHANGE, event, isLocked); + }, + /** * Checks if the given Game Object should be considered as a candidate for input or not. * @@ -66322,7 +67368,7 @@ module.exports = InputManager; /***/ }), -/* 338 */ +/* 341 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -66331,11 +67377,11 @@ module.exports = InputManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayRemove = __webpack_require__(120); +var ArrayRemove = __webpack_require__(121); var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(28); -var InputEvents = __webpack_require__(53); -var KeyCodes = __webpack_require__(121); +var GameEvents = __webpack_require__(18); +var InputEvents = __webpack_require__(54); +var KeyCodes = __webpack_require__(122); var NOOP = __webpack_require__(0); /** @@ -66772,7 +67818,7 @@ module.exports = KeyboardManager; /***/ }), -/* 339 */ +/* 342 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -66782,8 +67828,8 @@ module.exports = KeyboardManager; */ var Class = __webpack_require__(0); -var Features = __webpack_require__(164); -var InputEvents = __webpack_require__(53); +var Features = __webpack_require__(165); +var InputEvents = __webpack_require__(54); var NOOP = __webpack_require__(0); // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent @@ -67190,8 +68236,8 @@ var MouseManager = new Class({ var element = _this.target; _this.locked = (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element) ? true : false; - - _this.manager.queue.push(event); + + _this.manager.onPointerLockChange(event); }; document.addEventListener('pointerlockchange', this.pointerLockChange, true); @@ -67254,7 +68300,7 @@ module.exports = MouseManager; /***/ }), -/* 340 */ +/* 343 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67263,12 +68309,12 @@ module.exports = MouseManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Angle = __webpack_require__(292); +var Angle = __webpack_require__(295); var Class = __webpack_require__(0); -var Distance = __webpack_require__(57); -var FuzzyEqual = __webpack_require__(166); -var SmoothStepInterpolation = __webpack_require__(301); -var Vector2 = __webpack_require__(4); +var Distance = __webpack_require__(58); +var FuzzyEqual = __webpack_require__(167); +var SmoothStepInterpolation = __webpack_require__(304); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -67518,6 +68564,9 @@ var Pointer = new Class({ /** * The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. * * @name Phaser.Input.Pointer#worldX * @type {number} @@ -67528,6 +68577,9 @@ var Pointer = new Class({ /** * The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. * * @name Phaser.Input.Pointer#worldY * @type {number} @@ -67698,13 +68750,20 @@ var Pointer = new Class({ this.active = (id === 0) ? true : false; /** - * Time when this Pointer was most recently updated by a DOM Event. + * Is this pointer Pointer Locked? + * + * Only a mouse pointer can be locked and it only becomes locked when requested via + * the browsers Pointer Lock API. + * + * You can request this by calling the `this.input.mouse.requestPointerLock()` method from + * a `pointerdown` or `pointerup` event handler. * - * @name Phaser.Input.Pointer#time - * @type {number} - * @since 3.16.0 + * @name Phaser.Input.Pointer#locked + * @readonly + * @type {boolean} + * @since 3.19.0 */ - this.time = 0; + this.locked = false; /** * The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. @@ -67738,6 +68797,40 @@ var Pointer = new Class({ this.deltaZ = 0; }, + /** + * Takes a Camera and updates this Pointer's `worldX` and `worldY` values so they are + * the result of a translation through the given Camera. + * + * Note that the values will be automatically replaced the moment the Pointer is + * updated by an input event, such as a mouse move, so should be used immediately. + * + * @method Phaser.Input.Pointer#updateWorldPoint + * @since 3.19.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera which is being tested against. + * + * @return {this} This Pointer object. + */ + updateWorldPoint: function (camera) + { + var x = this.x; + var y = this.y; + + if (camera.resolution !== 1) + { + x += camera._x; + y += camera._y; + } + + // Stores the world point inside of tempPoint + var temp = camera.getWorldPoint(x, y); + + this.worldX = temp.x; + this.worldY = temp.y; + + return this; + }, + /** * Takes a Camera and returns a Vector2 containing the translated position of this Pointer * within that Camera. This can be used to convert this Pointers position into camera space. @@ -67902,11 +68995,11 @@ var Pointer = new Class({ // Sets the local x/y properties this.manager.transformPointer(this, event.pageX, event.pageY, true); - if (this.manager.mouse.locked) + if (this.locked) { // Multiple DOM events may occur within one frame, but only one Phaser event will fire - this.movementX += event.movementX || event.mozMovementX || event.webkitMovementX || 0; - this.movementY += event.movementY || event.mozMovementY || event.webkitMovementY || 0; + this.movementX = event.movementX || event.mozMovementX || event.webkitMovementX || 0; + this.movementY = event.movementY || event.mozMovementY || event.webkitMovementY || 0; } this.moveTime = event.timeStamp; @@ -67975,7 +69068,7 @@ var Pointer = new Class({ this.primaryDown = true; this.downX = this.x; this.downY = this.y; - this.downTime = touch.timeStamp; + this.downTime = event.timeStamp; this.isDown = true; @@ -68002,7 +69095,7 @@ var Pointer = new Class({ // Sets the local x/y properties this.manager.transformPointer(this, touch.pageX, touch.pageY, true); - this.moveTime = touch.timeStamp; + this.moveTime = event.timeStamp; this.wasTouch = true; @@ -68033,7 +69126,7 @@ var Pointer = new Class({ this.primaryDown = false; this.upX = this.x; this.upY = this.y; - this.upTime = touch.timeStamp; + this.upTime = event.timeStamp; this.isDown = false; @@ -68069,7 +69162,7 @@ var Pointer = new Class({ this.primaryDown = false; this.upX = this.x; this.upY = this.y; - this.upTime = touch.timeStamp; + this.upTime = event.timeStamp; this.isDown = false; @@ -68313,7 +69406,7 @@ var Pointer = new Class({ { if (this.isDown) { - return (this.time - this.downTime); + return (this.manager.time - this.downTime); } else { @@ -68458,6 +69551,25 @@ var Pointer = new Class({ this.position.y = value; } + }, + + /** + * Time when this Pointer was most recently updated by a DOM Event. + * This comes directly from the `event.timeStamp` property. + * If no event has yet taken place, it will return zero. + * + * @name Phaser.Input.Pointer#time + * @type {number} + * @readonly + * @since 3.16.0 + */ + time: { + + get: function () + { + return (this.event) ? this.event.timeStamp : 0; + } + } }); @@ -68466,7 +69578,7 @@ module.exports = Pointer; /***/ }), -/* 341 */ +/* 344 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -68476,7 +69588,7 @@ module.exports = Pointer; */ var Class = __webpack_require__(0); -var InputEvents = __webpack_require__(53); +var InputEvents = __webpack_require__(54); var NOOP = __webpack_require__(1); // https://developer.mozilla.org/en-US/docs/Web/API/Touch_events @@ -68851,7 +69963,7 @@ module.exports = TouchManager; /***/ }), -/* 342 */ +/* 345 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -68861,14 +69973,14 @@ module.exports = TouchManager; */ var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(28); -var EventEmitter = __webpack_require__(11); +var GameEvents = __webpack_require__(18); +var EventEmitter = __webpack_require__(10); var FileTypesManager = __webpack_require__(8); -var GameObjectCreator = __webpack_require__(15); -var GameObjectFactory = __webpack_require__(5); +var GameObjectCreator = __webpack_require__(16); +var GameObjectFactory = __webpack_require__(6); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(18); -var Remove = __webpack_require__(120); +var PluginCache = __webpack_require__(19); +var Remove = __webpack_require__(121); /** * @classdesc @@ -69640,6 +70752,35 @@ var PluginManager = new Class({ return this; }, + /** + * Removes a previously registered Game Object from the global Game Object Factory and / or Creator. + * This is usually called from within your Plugin destruction code to help clean-up after your plugin has been removed. + * + * @method Phaser.Plugins.PluginManager#removeGameObject + * @since 3.19.0 + * + * @param {string} key - The key of the Game Object to be removed from the factories. + * @param {boolean} [removeFromFactory=true] - Should the Game Object be removed from the Game Object Factory? + * @param {boolean} [removeFromCreator=true] - Should the Game Object be removed from the Game Object Creator? + */ + removeGameObject: function (key, removeFromFactory, removeFromCreator) + { + if (removeFromFactory === undefined) { removeFromFactory = true; } + if (removeFromCreator === undefined) { removeFromCreator = true; } + + if (removeFromFactory) + { + GameObjectFactory.remove(key); + } + + if (removeFromCreator) + { + GameObjectCreator.remove(key); + } + + return this; + }, + /** * Registers a new file type with the global File Types Manager, making it available to all Loader * Plugins created after this. @@ -69724,7 +70865,7 @@ module.exports = PluginManager; /***/ }), -/* 343 */ +/* 346 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -69733,19 +70874,19 @@ module.exports = PluginManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(173); +var CONST = __webpack_require__(174); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(89); -var GameEvents = __webpack_require__(28); -var GetInnerHeight = __webpack_require__(828); -var GetTarget = __webpack_require__(335); -var GetScreenOrientation = __webpack_require__(330); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(90); +var GameEvents = __webpack_require__(18); +var GetInnerHeight = __webpack_require__(833); +var GetTarget = __webpack_require__(338); +var GetScreenOrientation = __webpack_require__(333); var NOOP = __webpack_require__(1); -var Rectangle = __webpack_require__(10); -var Size = __webpack_require__(344); -var SnapFloor = __webpack_require__(90); -var Vector2 = __webpack_require__(4); +var Rectangle = __webpack_require__(11); +var Size = __webpack_require__(347); +var SnapFloor = __webpack_require__(91); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -69989,6 +71130,16 @@ var ScaleManager = new Class({ */ this.zoom = 1; + /** + * Internal flag set when the game zoom factor is modified. + * + * @name Phaser.Scale.ScaleManager#_resetZoom + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this._resetZoom = false; + /** * The scale factor between the baseSize and the canvasBounds. * @@ -70283,6 +71434,11 @@ var ScaleManager = new Class({ this.zoom = zoom; + if (zoom !== 1) + { + this._resetZoom = true; + } + // The modified game size, which is the w/h * resolution this.baseSize.setSize(width * resolution, height * resolution); @@ -70597,6 +71753,7 @@ var ScaleManager = new Class({ setZoom: function (value) { this.zoom = value; + this._resetZoom = true; return this.refresh(); }, @@ -70613,6 +71770,7 @@ var ScaleManager = new Class({ setMaxZoom: function () { this.zoom = this.getMaxZoom(); + this._resetZoom = true; return this.refresh(); }, @@ -70725,10 +71883,12 @@ var ScaleManager = new Class({ styleHeight = Math.floor(styleHeight); } - if (zoom > 1) + if (this._resetZoom) { style.width = styleWidth + 'px'; style.height = styleHeight + 'px'; + + this._resetZoom = false; } } else if (this.scaleMode === CONST.SCALE_MODE.RESIZE) @@ -70955,14 +72115,14 @@ var ScaleManager = new Class({ if (fullscreen.keyboard) { fsTarget[fullscreen.request](Element.ALLOW_KEYBOARD_INPUT) - .then(this.fullscreenSuccessHandler) - .catch(this.fullscreenErrorHandler); + .then(this.fullscreenSuccessHandler.bind(this)) + .catch(this.fullscreenErrorHandler.bind(this)); } else { fsTarget[fullscreen.request](fullscreenOptions) - .then(this.fullscreenSuccessHandler) - .catch(this.fullscreenErrorHandler); + .then(this.fullscreenSuccessHandler.bind(this)) + .catch(this.fullscreenErrorHandler.bind(this)); } } else @@ -71306,11 +72466,12 @@ var ScaleManager = new Class({ this.canvas = null; this.canvasBounds = null; this.parent = null; + this.fullscreenTarget = null; + this.parentSize.destroy(); this.gameSize.destroy(); this.baseSize.destroy(); this.displaySize.destroy(); - this.fullscreenTarget = null; }, /** @@ -71448,7 +72609,7 @@ module.exports = ScaleManager; /***/ }), -/* 344 */ +/* 347 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71457,10 +72618,10 @@ module.exports = ScaleManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var SnapFloor = __webpack_require__(90); -var Vector2 = __webpack_require__(4); +var SnapFloor = __webpack_require__(91); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -72228,7 +73389,7 @@ module.exports = Size; /***/ }), -/* 345 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72238,14 +73399,14 @@ module.exports = Size; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(122); -var Events = __webpack_require__(19); -var GameEvents = __webpack_require__(28); -var GetValue = __webpack_require__(6); -var LoaderEvents = __webpack_require__(80); +var CONST = __webpack_require__(123); +var Events = __webpack_require__(20); +var GameEvents = __webpack_require__(18); +var GetValue = __webpack_require__(5); +var LoaderEvents = __webpack_require__(81); var NOOP = __webpack_require__(1); -var Scene = __webpack_require__(346); -var Systems = __webpack_require__(176); +var Scene = __webpack_require__(349); +var Systems = __webpack_require__(177); /** * @classdesc @@ -73862,7 +75023,7 @@ module.exports = SceneManager; /***/ }), -/* 346 */ +/* 349 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73872,12 +75033,14 @@ module.exports = SceneManager; */ var Class = __webpack_require__(0); -var Systems = __webpack_require__(176); +var Systems = __webpack_require__(177); /** * @classdesc * A base Phaser.Scene class which can be extended for your own use. * + * You can also define the optional methods {@link Phaser.Types.Scenes.SceneInitCallback init()}, {@link Phaser.Types.Scenes.ScenePreloadCallback preload()}, and {@link Phaser.Types.Scenes.SceneCreateCallback create()}. + * * @class Scene * @memberof Phaser * @constructor @@ -74150,80 +75313,13 @@ var Scene = new Class({ { } - /** - * Can be defined on your own Scenes. - * This method is called by the Scene Manager when the scene starts, before `preload()` and `create()`. - * - * @method Phaser.Scene#init - * @since 3.0.0 - * - * @param {object} data - Any data passed via `ScenePlugin.add()` or `ScenePlugin.start()`. Same as Scene.settings.data. - */ - - /** - * Can be defined on your own Scenes. Use it to load assets. - * This method is called by the Scene Manager, after `init()` and before `create()`, only if the Scene has a LoaderPlugin. - * After this method completes, if the LoaderPlugin's queue isn't empty, the LoaderPlugin will start automatically. - * - * @method Phaser.Scene#preload - * @since 3.0.0 - */ - - /** - * Can be defined on your own Scenes. Use it to create your game objects. - * This method is called by the Scene Manager when the scene starts, after `init()` and `preload()`. - * If the LoaderPlugin started after `preload()`, then this method is called only after loading is complete. - * - * @method Phaser.Scene#create - * @since 3.0.0 - * - * @param {object} data - Any data passed via `ScenePlugin.add()` or `ScenePlugin.start()`. Same as Scene.settings.data. - */ - }); module.exports = Scene; /***/ }), -/* 347 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Capitalizes the first letter of a string if there is one. - * @example - * UppercaseFirst('abc'); - * // returns 'Abc' - * @example - * UppercaseFirst('the happy family'); - * // returns 'The happy family' - * @example - * UppercaseFirst(''); - * // returns '' - * - * @function Phaser.Utils.String.UppercaseFirst - * @since 3.0.0 - * - * @param {string} str - The string to capitalize. - * - * @return {string} A new string, same as the first, but with the first letter capitalized. - */ -var UppercaseFirst = function (str) -{ - return str && str[0].toUpperCase() + str.slice(1); -}; - -module.exports = UppercaseFirst; - - -/***/ }), -/* 348 */ +/* 350 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -74232,10 +75328,10 @@ module.exports = UppercaseFirst; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(122); -var GetValue = __webpack_require__(6); -var Merge = __webpack_require__(85); -var InjectionMap = __webpack_require__(841); +var CONST = __webpack_require__(123); +var GetValue = __webpack_require__(5); +var Merge = __webpack_require__(105); +var InjectionMap = __webpack_require__(846); /** * @namespace Phaser.Scenes.Settings @@ -74319,7 +75415,7 @@ module.exports = Settings; /***/ }), -/* 349 */ +/* 351 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -74328,18 +75424,18 @@ module.exports = Settings; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); -var CanvasTexture = __webpack_require__(842); +var CanvasPool = __webpack_require__(25); +var CanvasTexture = __webpack_require__(352); var Class = __webpack_require__(0); var Color = __webpack_require__(33); -var CONST = __webpack_require__(26); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(118); -var GameEvents = __webpack_require__(28); -var GenerateTexture = __webpack_require__(318); -var GetValue = __webpack_require__(6); -var Parser = __webpack_require__(351); -var Texture = __webpack_require__(177); +var CONST = __webpack_require__(31); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(119); +var GameEvents = __webpack_require__(18); +var GenerateTexture = __webpack_require__(321); +var GetValue = __webpack_require__(5); +var Parser = __webpack_require__(354); +var Texture = __webpack_require__(179); /** * @callback EachTextureCallback @@ -74613,6 +75709,10 @@ var TextureManager = new Class({ * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data. * * You can also provide the image type and encoder options. + * + * This will only work with bitmap based texture frames, such as those created from Texture Atlases. + * It will not work with GL Texture objects, such as Shaders, or Render Textures. For those please + * see the WebGL Snapshot function instead. * * @method Phaser.Textures.TextureManager#getBase64 * @since 3.12.0 @@ -74633,7 +75733,11 @@ var TextureManager = new Class({ var textureFrame = this.getFrame(key, frame); - if (textureFrame) + if (textureFrame && (textureFrame.source.isRenderTexture || textureFrame.source.isGLTexture)) + { + console.warn('Cannot getBase64 from WebGL Texture'); + } + else if (textureFrame) { var cd = textureFrame.canvasData; @@ -74694,6 +75798,38 @@ var TextureManager = new Class({ return texture; }, + /** + * Takes a WebGL Texture and creates a Phaser Texture from it, which is added to the Texture Manager using the given key. + * + * This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites. + * + * This is a WebGL only feature. + * + * @method Phaser.Textures.TextureManager#addGLTexture + * @fires Phaser.Textures.Events#ADD + * @since 3.19.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {WebGLTexture} glTexture - The source Render Texture. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addGLTexture: function (key, glTexture, width, height) + { + var texture = null; + + if (this.checkKey(key)) + { + texture = this.create(key, glTexture, width, height); + + texture.add('__BASE', 0, 0, 0, width, height); + + this.emit(Events.ADD, key, texture); + } + + return texture; + }, + /** * Adds a Render Texture to the Texture Manager using the given key. * This allows you to then use the Render Texture as a normal texture for texture based Game Objects like Sprites. @@ -75441,7 +76577,7 @@ module.exports = TextureManager; /***/ }), -/* 350 */ +/* 352 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75450,9 +76586,640 @@ module.exports = TextureManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); var Class = __webpack_require__(0); -var IsSizePowerOfTwo = __webpack_require__(117); +var Clamp = __webpack_require__(24); +var Color = __webpack_require__(33); +var CONST = __webpack_require__(31); +var IsSizePowerOfTwo = __webpack_require__(118); +var Texture = __webpack_require__(179); + +/** + * @classdesc + * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source. + * + * You can use the properties of this texture to draw to the canvas element directly, using all of the standard + * canvas operations available in the browser. Any Game Object can be given this texture and will render with it. + * + * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to + * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this + * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep + * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading + * texture data to it. This restriction does not apply if using the Canvas Renderer. + * + * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify + * sections of the canvas using the `add` method. + * + * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying + * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause + * graphical errors. + * + * @class CanvasTexture + * @extends Phaser.Textures.Texture + * @memberof Phaser.Textures + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to. + * @param {string} key - The unique string-based key of this Texture. + * @param {HTMLCanvasElement} source - The canvas element that is used as the base of this texture. + * @param {integer} width - The width of the canvas. + * @param {integer} height - The height of the canvas. + */ +var CanvasTexture = new Class({ + + Extends: Texture, + + initialize: + + function CanvasTexture (manager, key, source, width, height) + { + Texture.call(this, manager, key, source, width, height); + + this.add('__BASE', 0, 0, 0, width, height); + + /** + * A reference to the Texture Source of this Canvas. + * + * @name Phaser.Textures.CanvasTexture#_source + * @type {Phaser.Textures.TextureSource} + * @private + * @since 3.7.0 + */ + this._source = this.frames['__BASE'].source; + + /** + * The source Canvas Element. + * + * @name Phaser.Textures.CanvasTexture#canvas + * @readonly + * @type {HTMLCanvasElement} + * @since 3.7.0 + */ + this.canvas = this._source.image; + + /** + * The 2D Canvas Rendering Context. + * + * @name Phaser.Textures.CanvasTexture#context + * @readonly + * @type {CanvasRenderingContext2D} + * @since 3.7.0 + */ + this.context = this.canvas.getContext('2d'); + + /** + * The width of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + * + * @name Phaser.Textures.CanvasTexture#width + * @readonly + * @type {integer} + * @since 3.7.0 + */ + this.width = width; + + /** + * The height of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + * + * @name Phaser.Textures.CanvasTexture#height + * @readonly + * @type {integer} + * @since 3.7.0 + */ + this.height = height; + + /** + * The context image data. + * Use the `update` method to populate this when the canvas changes. + * + * @name Phaser.Textures.CanvasTexture#imageData + * @type {ImageData} + * @since 3.13.0 + */ + this.imageData = this.context.getImageData(0, 0, width, height); + + /** + * A Uint8ClampedArray view into the `buffer`. + * Use the `update` method to populate this when the canvas changes. + * Note that this is unavailable in some browsers, such as Epic Browser, due to their security restrictions. + * + * @name Phaser.Textures.CanvasTexture#data + * @type {Uint8ClampedArray} + * @since 3.13.0 + */ + this.data = null; + + if (this.imageData) + { + this.data = this.imageData.data; + } + + /** + * An Uint32Array view into the `buffer`. + * + * @name Phaser.Textures.CanvasTexture#pixels + * @type {Uint32Array} + * @since 3.13.0 + */ + this.pixels = null; + + /** + * An ArrayBuffer the same size as the context ImageData. + * + * @name Phaser.Textures.CanvasTexture#buffer + * @type {ArrayBuffer} + * @since 3.13.0 + */ + this.buffer; + + if (this.data) + { + if (this.imageData.data.buffer) + { + this.buffer = this.imageData.data.buffer; + this.pixels = new Uint32Array(this.buffer); + } + else if (window.ArrayBuffer) + { + this.buffer = new ArrayBuffer(this.imageData.data.length); + this.pixels = new Uint32Array(this.buffer); + } + else + { + this.pixels = this.imageData.data; + } + } + }, + + /** + * This re-creates the `imageData` from the current context. + * It then re-builds the ArrayBuffer, the `data` Uint8ClampedArray reference and the `pixels` Int32Array. + * + * Warning: This is a very expensive operation, so use it sparingly. + * + * @method Phaser.Textures.CanvasTexture#update + * @since 3.13.0 + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + update: function () + { + this.imageData = this.context.getImageData(0, 0, this.width, this.height); + + this.data = this.imageData.data; + + if (this.imageData.data.buffer) + { + this.buffer = this.imageData.data.buffer; + this.pixels = new Uint32Array(this.buffer); + } + else if (window.ArrayBuffer) + { + this.buffer = new ArrayBuffer(this.imageData.data.length); + this.pixels = new Uint32Array(this.buffer); + } + else + { + this.pixels = this.imageData.data; + } + + if (this.manager.game.config.renderType === CONST.WEBGL) + { + this.refresh(); + } + + return this; + }, + + /** + * Draws the given Image or Canvas element to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * + * @method Phaser.Textures.CanvasTexture#draw + * @since 3.13.0 + * + * @param {integer} x - The x coordinate to draw the source at. + * @param {integer} y - The y coordinate to draw the source at. + * @param {(HTMLImageElement|HTMLCanvasElement)} source - The element to draw to this canvas. + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + draw: function (x, y, source) + { + this.context.drawImage(source, x, y); + + return this.update(); + }, + + /** + * Draws the given texture frame to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * + * @method Phaser.Textures.CanvasTexture#drawFrame + * @since 3.16.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {integer} [x=0] - The x coordinate to draw the source at. + * @param {integer} [y=0] - The y coordinate to draw the source at. + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + drawFrame: function (key, frame, x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + var textureFrame = this.manager.getFrame(key, frame); + + if (textureFrame) + { + var cd = textureFrame.canvasData; + + var width = textureFrame.cutWidth; + var height = textureFrame.cutHeight; + var res = textureFrame.source.resolution; + + this.context.drawImage( + textureFrame.source.image, + cd.x, cd.y, + width, + height, + x, y, + width / res, + height / res + ); + + return this.update(); + } + else + { + return this; + } + }, + + /** + * Sets a pixel in the CanvasTexture to the given color and alpha values. + * + * This is an expensive operation to run in large quantities, so use sparingly. + * + * @method Phaser.Textures.CanvasTexture#setPixel + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} red - The red color value. A number between 0 and 255. + * @param {integer} green - The green color value. A number between 0 and 255. + * @param {integer} blue - The blue color value. A number between 0 and 255. + * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + * + * @return {this} This CanvasTexture. + */ + setPixel: function (x, y, red, green, blue, alpha) + { + if (alpha === undefined) { alpha = 255; } + + x = Math.abs(Math.floor(x)); + y = Math.abs(Math.floor(y)); + + var index = this.getIndex(x, y); + + if (index > -1) + { + var imageData = this.context.getImageData(x, y, 1, 1); + + imageData.data[0] = red; + imageData.data[1] = green; + imageData.data[2] = blue; + imageData.data[3] = alpha; + + this.context.putImageData(imageData, x, y); + } + + return this; + }, + + /** + * Puts the ImageData into the context of this CanvasTexture at the given coordinates. + * + * @method Phaser.Textures.CanvasTexture#putData + * @since 3.16.0 + * + * @param {ImageData} imageData - The ImageData to put at the given location. + * @param {integer} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {integer} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {integer} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. + * @param {integer} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. + * + * @return {this} This CanvasTexture. + */ + putData: function (imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight) + { + if (dirtyX === undefined) { dirtyX = 0; } + if (dirtyY === undefined) { dirtyY = 0; } + if (dirtyWidth === undefined) { dirtyWidth = imageData.width; } + if (dirtyHeight === undefined) { dirtyHeight = imageData.height; } + + this.context.putImageData(imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight); + + return this; + }, + + /** + * Gets an ImageData region from this CanvasTexture from the position and size specified. + * You can write this back using `CanvasTexture.putData`, or manipulate it. + * + * @method Phaser.Textures.CanvasTexture#getData + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. + * @param {integer} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. + * + * @return {ImageData} The ImageData extracted from this CanvasTexture. + */ + getData: function (x, y, width, height) + { + x = Clamp(Math.floor(x), 0, this.width - 1); + y = Clamp(Math.floor(y), 0, this.height - 1); + width = Clamp(width, 1, this.width - x); + height = Clamp(height, 1, this.height - y); + + var imageData = this.context.getImageData(x, y, width, height); + + return imageData; + }, + + /** + * Get the color of a specific pixel from this texture and store it in a Color object. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * + * @method Phaser.Textures.CanvasTexture#getPixel + * @since 3.13.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {Phaser.Display.Color} [out] - A Color object to store the pixel values in. If not provided a new Color object will be created. + * + * @return {Phaser.Display.Color} An object with the red, green, blue and alpha values set in the r, g, b and a properties. + */ + getPixel: function (x, y, out) + { + if (!out) + { + out = new Color(); + } + + var index = this.getIndex(x, y); + + if (index > -1) + { + var data = this.data; + + var r = data[index + 0]; + var g = data[index + 1]; + var b = data[index + 2]; + var a = data[index + 3]; + + out.setTo(r, g, b, a); + } + + return out; + }, + + /** + * Returns an array containing all of the pixels in the given region. + * + * If the requested region extends outside the bounds of this CanvasTexture, + * the region is truncated to fit. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * + * @method Phaser.Textures.CanvasTexture#getPixels + * @since 3.16.0 + * + * @param {integer} [x=0] - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [y=0] - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [width] - The width of the region to get. Must be an integer. Defaults to the canvas width if not given. + * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. + * + * @return {Phaser.Types.Textures.PixelConfig[]} An array of Pixel objects. + */ + getPixels: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.width; } + if (height === undefined) { height = width; } + + x = Math.abs(Math.round(x)); + y = Math.abs(Math.round(y)); + + var left = Clamp(x, 0, this.width); + var right = Clamp(x + width, 0, this.width); + var top = Clamp(y, 0, this.height); + var bottom = Clamp(y + height, 0, this.height); + + var pixel = new Color(); + + var out = []; + + for (var py = top; py < bottom; py++) + { + var row = []; + + for (var px = left; px < right; px++) + { + pixel = this.getPixel(px, py, pixel); + + row.push({ x: px, y: py, color: pixel.color, alpha: pixel.alphaGL }); + } + + out.push(row); + } + + return out; + }, + + /** + * Returns the Image Data index for the given pixel in this CanvasTexture. + * + * The index can be used to read directly from the `this.data` array. + * + * The index points to the red value in the array. The subsequent 3 indexes + * point to green, blue and alpha respectively. + * + * @method Phaser.Textures.CanvasTexture#getIndex + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * + * @return {integer} + */ + getIndex: function (x, y) + { + x = Math.abs(Math.round(x)); + y = Math.abs(Math.round(y)); + + if (x < this.width && y < this.height) + { + return (x + y * this.width) * 4; + } + else + { + return -1; + } + }, + + /** + * This should be called manually if you are running under WebGL. + * It will refresh the WebGLTexture from the Canvas source. Only call this if you know that the + * canvas has changed, as there is a significant GPU texture allocation cost involved in doing so. + * + * @method Phaser.Textures.CanvasTexture#refresh + * @since 3.7.0 + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + refresh: function () + { + this._source.update(); + + return this; + }, + + /** + * Gets the Canvas Element. + * + * @method Phaser.Textures.CanvasTexture#getCanvas + * @since 3.7.0 + * + * @return {HTMLCanvasElement} The Canvas DOM element this texture is using. + */ + getCanvas: function () + { + return this.canvas; + }, + + /** + * Gets the 2D Canvas Rendering Context. + * + * @method Phaser.Textures.CanvasTexture#getContext + * @since 3.7.0 + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context this texture is using. + */ + getContext: function () + { + return this.context; + }, + + /** + * Clears the given region of this Canvas Texture, resetting it back to transparent. + * If no region is given, the whole Canvas Texture is cleared. + * + * @method Phaser.Textures.CanvasTexture#clear + * @since 3.7.0 + * + * @param {integer} [x=0] - The x coordinate of the top-left of the region to clear. + * @param {integer} [y=0] - The y coordinate of the top-left of the region to clear. + * @param {integer} [width] - The width of the region. + * @param {integer} [height] - The height of the region. + * + * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. + */ + clear: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.width; } + if (height === undefined) { height = this.height; } + + this.context.clearRect(x, y, width, height); + + return this.update(); + }, + + /** + * Changes the size of this Canvas Texture. + * + * @method Phaser.Textures.CanvasTexture#setSize + * @since 3.7.0 + * + * @param {integer} width - The new width of the Canvas. + * @param {integer} [height] - The new height of the Canvas. If not given it will use the width as the height. + * + * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + if (width !== this.width || height !== this.height) + { + // Update the Canvas + this.canvas.width = width; + this.canvas.height = height; + + // Update the Texture Source + this._source.width = width; + this._source.height = height; + this._source.isPowerOf2 = IsSizePowerOfTwo(width, height); + + // Update the Frame + this.frames['__BASE'].setSize(width, height, 0, 0); + + this.refresh(); + } + + return this; + }, + + /** + * Destroys this Texture and releases references to its sources and frames. + * + * @method Phaser.Textures.CanvasTexture#destroy + * @since 3.16.0 + */ + destroy: function () + { + Texture.prototype.destroy.call(this); + + this._source = null; + this.canvas = null; + this.context = null; + this.imageData = null; + this.data = null; + this.pixels = null; + this.buffer = null; + } + +}); + +module.exports = CanvasTexture; + + +/***/ }), +/* 353 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(25); +var Class = __webpack_require__(0); +var IsSizePowerOfTwo = __webpack_require__(118); var ScaleModes = __webpack_require__(104); /** @@ -75468,7 +77235,7 @@ var ScaleModes = __webpack_require__(104); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture this TextureSource belongs to. - * @param {(HTMLImageElement|HTMLCanvasElement)} source - The source image data. + * @param {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture|WebGLTexture)} source - The source image data. * @param {integer} [width] - Optional width of the source image. If not given it's derived from the source itself. * @param {integer} [height] - Optional height of the source image. If not given it's derived from the source itself. */ @@ -75500,10 +77267,10 @@ var TextureSource = new Class({ /** * The source of the image data. - * This is either an Image Element, a Canvas Element or a RenderTexture. + * This is either an Image Element, a Canvas Element, a RenderTexture or a WebGLTexture. * * @name Phaser.Textures.TextureSource#source - * @type {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture)} + * @type {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture|WebGLTexture)} * @since 3.12.0 */ this.source = source; @@ -75586,6 +77353,15 @@ var TextureSource = new Class({ */ this.isRenderTexture = (source.type === 'RenderTexture'); + /** + * Is the source image a WebGLTexture? + * + * @name Phaser.Textures.TextureSource#isGLTexture + * @type {boolean} + * @since 3.19.0 + */ + this.isGLTexture = (source instanceof WebGLTexture); + /** * Are the source image dimensions a power of two? * @@ -75596,7 +77372,8 @@ var TextureSource = new Class({ this.isPowerOf2 = IsSizePowerOfTwo(this.width, this.height); /** - * The WebGL Texture of the source image. + * The WebGL Texture of the source image. If this TextureSource is driven from a WebGLTexture + * already, then this is a reference to that WebGLTexture. * * @name Phaser.Textures.TextureSource#glTexture * @type {?WebGLTexture} @@ -75632,6 +77409,10 @@ var TextureSource = new Class({ this.glTexture = this.renderer.createTextureFromSource(null, this.width, this.height, this.scaleMode); } + else if (this.isGLTexture) + { + this.glTexture = this.source; + } else { this.glTexture = this.renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode); @@ -75681,19 +77462,6 @@ var TextureSource = new Class({ if (this.renderer.gl && this.isCanvas) { this.glTexture = this.renderer.canvasToTexture(this.image, this.glTexture); - - // Update all the Frames using this TextureSource - - /* - var index = this.texture.getTextureSourceIndex(this); - - var frames = this.texture.getFramesFromTextureSource(index, true); - - for (var i = 0; i < frames.length; i++) - { - frames[i].glTexture = this.glTexture; - } - */ } }, @@ -75728,7 +77496,7 @@ module.exports = TextureSource; /***/ }), -/* 351 */ +/* 354 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75743,20 +77511,20 @@ module.exports = TextureSource; module.exports = { - AtlasXML: __webpack_require__(843), - Canvas: __webpack_require__(844), - Image: __webpack_require__(845), - JSONArray: __webpack_require__(846), - JSONHash: __webpack_require__(847), - SpriteSheet: __webpack_require__(848), - SpriteSheetFromAtlas: __webpack_require__(849), - UnityYAML: __webpack_require__(850) + AtlasXML: __webpack_require__(847), + Canvas: __webpack_require__(848), + Image: __webpack_require__(849), + JSONArray: __webpack_require__(850), + JSONHash: __webpack_require__(851), + SpriteSheet: __webpack_require__(852), + SpriteSheetFromAtlas: __webpack_require__(853), + UnityYAML: __webpack_require__(854) }; /***/ }), -/* 352 */ +/* 355 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75766,9 +77534,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HTML5AudioSoundManager = __webpack_require__(353); -var NoAudioSoundManager = __webpack_require__(355); -var WebAudioSoundManager = __webpack_require__(357); +var HTML5AudioSoundManager = __webpack_require__(356); +var NoAudioSoundManager = __webpack_require__(358); +var WebAudioSoundManager = __webpack_require__(360); /** * Creates a Web Audio, HTML5 Audio or No Audio Sound Manager based on config and device settings. @@ -75806,7 +77574,7 @@ module.exports = SoundManagerCreator; /***/ }), -/* 353 */ +/* 356 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75816,10 +77584,10 @@ module.exports = SoundManagerCreator; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSoundManager = __webpack_require__(123); +var BaseSoundManager = __webpack_require__(124); var Class = __webpack_require__(0); -var Events = __webpack_require__(65); -var HTML5AudioSound = __webpack_require__(354); +var Events = __webpack_require__(66); +var HTML5AudioSound = __webpack_require__(357); /** * HTML5 Audio implementation of the Sound Manager. @@ -76262,7 +78030,7 @@ module.exports = HTML5AudioSoundManager; /***/ }), -/* 354 */ +/* 357 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76272,9 +78040,9 @@ module.exports = HTML5AudioSoundManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(124); +var BaseSound = __webpack_require__(125); var Class = __webpack_require__(0); -var Events = __webpack_require__(65); +var Events = __webpack_require__(66); /** * @classdesc @@ -77189,7 +78957,7 @@ module.exports = HTML5AudioSound; /***/ }), -/* 355 */ +/* 358 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -77199,10 +78967,10 @@ module.exports = HTML5AudioSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSoundManager = __webpack_require__(123); +var BaseSoundManager = __webpack_require__(124); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var NoAudioSound = __webpack_require__(356); +var EventEmitter = __webpack_require__(10); +var NoAudioSound = __webpack_require__(359); var NOOP = __webpack_require__(1); /** @@ -77307,7 +79075,7 @@ module.exports = NoAudioSoundManager; /***/ }), -/* 356 */ +/* 359 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -77317,10 +79085,10 @@ module.exports = NoAudioSoundManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(124); +var BaseSound = __webpack_require__(125); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Extend = __webpack_require__(17); +var EventEmitter = __webpack_require__(10); +var Extend = __webpack_require__(15); /** * @classdesc @@ -77434,7 +79202,7 @@ module.exports = NoAudioSound; /***/ }), -/* 357 */ +/* 360 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -77444,11 +79212,11 @@ module.exports = NoAudioSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Base64ToArrayBuffer = __webpack_require__(358); -var BaseSoundManager = __webpack_require__(123); +var Base64ToArrayBuffer = __webpack_require__(361); +var BaseSoundManager = __webpack_require__(124); var Class = __webpack_require__(0); -var Events = __webpack_require__(65); -var WebAudioSound = __webpack_require__(359); +var Events = __webpack_require__(66); +var WebAudioSound = __webpack_require__(362); /** * @classdesc @@ -77677,6 +79445,11 @@ var WebAudioSoundManager = new Class({ document.body.removeEventListener('click', unlockHandler); _this.unlocked = true; + }, function () + { + document.body.removeEventListener('touchstart', unlockHandler); + document.body.removeEventListener('touchend', unlockHandler); + document.body.removeEventListener('click', unlockHandler); }); } }; @@ -77841,7 +79614,7 @@ module.exports = WebAudioSoundManager; /***/ }), -/* 358 */ +/* 361 */ /***/ (function(module, exports) { /** @@ -77916,7 +79689,7 @@ module.exports = Base64ToArrayBuffer; /***/ }), -/* 359 */ +/* 362 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -77926,9 +79699,9 @@ module.exports = Base64ToArrayBuffer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(124); +var BaseSound = __webpack_require__(125); var Class = __webpack_require__(0); -var Events = __webpack_require__(65); +var Events = __webpack_require__(66); /** * @classdesc @@ -78824,7 +80597,7 @@ module.exports = WebAudioSound; /***/ }), -/* 360 */ +/* 363 */ /***/ (function(module, exports) { /** @@ -78872,7 +80645,7 @@ module.exports = TransposeMatrix; /***/ }), -/* 361 */ +/* 364 */ /***/ (function(module, exports) { /** @@ -78994,7 +80767,7 @@ module.exports = QuickSelect; /***/ }), -/* 362 */ +/* 365 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -79003,8 +80776,8 @@ module.exports = QuickSelect; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); -var Shuffle = __webpack_require__(111); +var GetValue = __webpack_require__(5); +var Shuffle = __webpack_require__(112); var BuildChunk = function (a, b, qty) { @@ -79132,7 +80905,7 @@ module.exports = Range; /***/ }), -/* 363 */ +/* 366 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -79221,7 +80994,7 @@ module.exports = BuildGameObjectAnimation; /***/ }), -/* 364 */ +/* 367 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -79230,7 +81003,7 @@ module.exports = BuildGameObjectAnimation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * 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. @@ -79263,7 +81036,7 @@ module.exports = Union; /***/ }), -/* 365 */ +/* 368 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -79274,11 +81047,11 @@ module.exports = Union; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var DOMElementRender = __webpack_require__(916); +var DOMElementRender = __webpack_require__(920); var GameObject = __webpack_require__(13); var IsPlainObject = __webpack_require__(7); -var RemoveFromDOM = __webpack_require__(174); -var Vector4 = __webpack_require__(308); +var RemoveFromDOM = __webpack_require__(175); +var Vector4 = __webpack_require__(311); /** * @classdesc @@ -80210,7 +81983,7 @@ module.exports = DOMElement; /***/ }), -/* 366 */ +/* 369 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80219,7 +81992,7 @@ module.exports = DOMElement; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CSSBlendModes = __webpack_require__(917); +var CSSBlendModes = __webpack_require__(921); var GameObject = __webpack_require__(13); /** @@ -80331,7 +82104,7 @@ module.exports = DOMElementCSSRenderer; /***/ }), -/* 367 */ +/* 370 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80343,7 +82116,7 @@ module.exports = DOMElementCSSRenderer; var Class = __webpack_require__(0); var Components = __webpack_require__(12); var GameObject = __webpack_require__(13); -var ExternRender = __webpack_require__(921); +var ExternRender = __webpack_require__(925); /** * @classdesc @@ -80427,7 +82200,7 @@ module.exports = Extern; /***/ }), -/* 368 */ +/* 371 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80436,10 +82209,10 @@ module.exports = Extern; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircumferencePoint = __webpack_require__(187); -var FromPercent = __webpack_require__(86); -var MATH_CONST = __webpack_require__(23); -var Point = __webpack_require__(3); +var CircumferencePoint = __webpack_require__(189); +var FromPercent = __webpack_require__(87); +var MATH_CONST = __webpack_require__(22); +var Point = __webpack_require__(4); /** * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse @@ -80470,7 +82243,7 @@ module.exports = GetPoint; /***/ }), -/* 369 */ +/* 372 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80479,10 +82252,10 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circumference = __webpack_require__(370); -var CircumferencePoint = __webpack_require__(187); -var FromPercent = __webpack_require__(86); -var MATH_CONST = __webpack_require__(23); +var Circumference = __webpack_require__(373); +var CircumferencePoint = __webpack_require__(189); +var FromPercent = __webpack_require__(87); +var MATH_CONST = __webpack_require__(22); /** * Returns an array of Point objects containing the coordinates of the points around the circumference of the Ellipse, @@ -80524,7 +82297,7 @@ module.exports = GetPoints; /***/ }), -/* 370 */ +/* 373 */ /***/ (function(module, exports) { /** @@ -80556,7 +82329,7 @@ module.exports = Circumference; /***/ }), -/* 371 */ +/* 374 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80565,8 +82338,8 @@ module.exports = Circumference; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Commands = __webpack_require__(186); -var SetTransform = __webpack_require__(25); +var Commands = __webpack_require__(188); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -80806,7 +82579,7 @@ module.exports = GraphicsCanvasRenderer; /***/ }), -/* 372 */ +/* 375 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -81025,7 +82798,7 @@ module.exports = GravityWell; /***/ }), -/* 373 */ +/* 376 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -81036,7 +82809,7 @@ module.exports = GravityWell; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(35); -var DistanceBetween = __webpack_require__(57); +var DistanceBetween = __webpack_require__(58); /** * @classdesc @@ -81594,7 +83367,7 @@ module.exports = Particle; /***/ }), -/* 374 */ +/* 377 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -81603,22 +83376,22 @@ module.exports = Particle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(52); +var BlendModes = __webpack_require__(53); var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var DeathZone = __webpack_require__(375); -var EdgeZone = __webpack_require__(376); -var EmitterOp = __webpack_require__(933); +var DeathZone = __webpack_require__(378); +var EdgeZone = __webpack_require__(379); +var EmitterOp = __webpack_require__(937); var GetFastValue = __webpack_require__(2); -var GetRandom = __webpack_require__(180); -var HasAny = __webpack_require__(377); +var GetRandom = __webpack_require__(182); +var HasAny = __webpack_require__(380); var HasValue = __webpack_require__(97); -var Particle = __webpack_require__(373); -var RandomZone = __webpack_require__(378); -var Rectangle = __webpack_require__(10); -var StableSort = __webpack_require__(127); -var Vector2 = __webpack_require__(4); -var Wrap = __webpack_require__(56); +var Particle = __webpack_require__(376); +var RandomZone = __webpack_require__(381); +var Rectangle = __webpack_require__(11); +var StableSort = __webpack_require__(128); +var Vector2 = __webpack_require__(3); +var Wrap = __webpack_require__(57); /** * @classdesc @@ -83633,7 +85406,7 @@ module.exports = ParticleEmitter; /***/ }), -/* 375 */ +/* 378 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83711,7 +85484,7 @@ module.exports = DeathZone; /***/ }), -/* 376 */ +/* 379 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83955,7 +85728,7 @@ module.exports = EdgeZone; /***/ }), -/* 377 */ +/* 380 */ /***/ (function(module, exports) { /** @@ -83992,7 +85765,7 @@ module.exports = HasAny; /***/ }), -/* 378 */ +/* 381 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84002,7 +85775,7 @@ module.exports = HasAny; */ var Class = __webpack_require__(0); -var Vector2 = __webpack_require__(4); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -84065,7 +85838,7 @@ module.exports = RandomZone; /***/ }), -/* 379 */ +/* 382 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84076,7 +85849,7 @@ module.exports = RandomZone; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var Sprite = __webpack_require__(67); +var Sprite = __webpack_require__(68); /** * @classdesc @@ -84147,7 +85920,7 @@ module.exports = PathFollower; /***/ }), -/* 380 */ +/* 383 */ /***/ (function(module, exports) { /** @@ -84182,7 +85955,7 @@ module.exports = UUID; /***/ }), -/* 381 */ +/* 384 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84191,13 +85964,13 @@ module.exports = UUID; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcRender = __webpack_require__(953); +var ArcRender = __webpack_require__(957); var Class = __webpack_require__(0); var DegToRad = __webpack_require__(35); -var Earcut = __webpack_require__(63); -var GeomCircle = __webpack_require__(77); -var MATH_CONST = __webpack_require__(23); -var Shape = __webpack_require__(30); +var Earcut = __webpack_require__(64); +var GeomCircle = __webpack_require__(78); +var MATH_CONST = __webpack_require__(22); +var Shape = __webpack_require__(29); /** * @classdesc @@ -84353,7 +86126,8 @@ var Arc = new Class({ { this.geom.radius = value; - this.setSize(value, value); + var diameter = value * 2; + this.setSize(diameter, diameter); this.updateDisplayOrigin(); this.updateData(); } @@ -84534,8 +86308,8 @@ var Arc = new Class({ var endAngle = DegToRad(this._endAngle); var anticlockwise = this._anticlockwise; - var x = radius / 2; - var y = radius / 2; + var x = radius; + var y = radius; endAngle -= startAngle; @@ -84590,7 +86364,7 @@ module.exports = Arc; /***/ }), -/* 382 */ +/* 385 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84600,10 +86374,10 @@ module.exports = Arc; */ var Class = __webpack_require__(0); -var CurveRender = __webpack_require__(956); -var Earcut = __webpack_require__(63); -var Rectangle = __webpack_require__(10); -var Shape = __webpack_require__(30); +var CurveRender = __webpack_require__(960); +var Earcut = __webpack_require__(64); +var Rectangle = __webpack_require__(11); +var Shape = __webpack_require__(29); /** * @classdesc @@ -84772,7 +86546,7 @@ module.exports = Curve; /***/ }), -/* 383 */ +/* 386 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84782,10 +86556,10 @@ module.exports = Curve; */ var Class = __webpack_require__(0); -var Earcut = __webpack_require__(63); -var EllipseRender = __webpack_require__(959); -var GeomEllipse = __webpack_require__(92); -var Shape = __webpack_require__(30); +var Earcut = __webpack_require__(64); +var EllipseRender = __webpack_require__(963); +var GeomEllipse = __webpack_require__(93); +var Shape = __webpack_require__(29); /** * @classdesc @@ -84959,7 +86733,7 @@ module.exports = Ellipse; /***/ }), -/* 384 */ +/* 387 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84969,8 +86743,8 @@ module.exports = Ellipse; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GridRender = __webpack_require__(962); +var Shape = __webpack_require__(29); +var GridRender = __webpack_require__(966); /** * @classdesc @@ -85241,7 +87015,7 @@ module.exports = Grid; /***/ }), -/* 385 */ +/* 388 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85250,9 +87024,9 @@ module.exports = Grid; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var IsoBoxRender = __webpack_require__(965); +var IsoBoxRender = __webpack_require__(969); var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(29); /** * @classdesc @@ -85456,7 +87230,7 @@ module.exports = IsoBox; /***/ }), -/* 386 */ +/* 389 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85466,8 +87240,8 @@ module.exports = IsoBox; */ var Class = __webpack_require__(0); -var IsoTriangleRender = __webpack_require__(968); -var Shape = __webpack_require__(30); +var IsoTriangleRender = __webpack_require__(972); +var Shape = __webpack_require__(29); /** * @classdesc @@ -85702,7 +87476,7 @@ module.exports = IsoTriangle; /***/ }), -/* 387 */ +/* 390 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85712,9 +87486,9 @@ module.exports = IsoTriangle; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GeomLine = __webpack_require__(54); -var LineRender = __webpack_require__(971); +var Shape = __webpack_require__(29); +var GeomLine = __webpack_require__(55); +var LineRender = __webpack_require__(975); /** * @classdesc @@ -85869,7 +87643,7 @@ module.exports = Line; /***/ }), -/* 388 */ +/* 391 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85878,13 +87652,13 @@ module.exports = Line; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PolygonRender = __webpack_require__(974); +var PolygonRender = __webpack_require__(978); var Class = __webpack_require__(0); -var Earcut = __webpack_require__(63); -var GetAABB = __webpack_require__(389); -var GeomPolygon = __webpack_require__(192); -var Shape = __webpack_require__(30); -var Smooth = __webpack_require__(392); +var Earcut = __webpack_require__(64); +var GetAABB = __webpack_require__(392); +var GeomPolygon = __webpack_require__(194); +var Shape = __webpack_require__(29); +var Smooth = __webpack_require__(395); /** * @classdesc @@ -86008,7 +87782,7 @@ module.exports = Polygon; /***/ }), -/* 389 */ +/* 392 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86017,7 +87791,7 @@ module.exports = Polygon; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * Calculates the bounding AABB rectangle of a polygon. @@ -86064,7 +87838,7 @@ module.exports = GetAABB; /***/ }), -/* 390 */ +/* 393 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86073,9 +87847,9 @@ module.exports = GetAABB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); -var Line = __webpack_require__(54); -var Perimeter = __webpack_require__(391); +var Length = __webpack_require__(56); +var Line = __webpack_require__(55); +var Perimeter = __webpack_require__(394); /** * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, @@ -86141,7 +87915,7 @@ module.exports = GetPoints; /***/ }), -/* 391 */ +/* 394 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86150,8 +87924,8 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); -var Line = __webpack_require__(54); +var Length = __webpack_require__(56); +var Line = __webpack_require__(55); /** * Returns the perimeter of the given Polygon. @@ -86189,7 +87963,7 @@ module.exports = Perimeter; /***/ }), -/* 392 */ +/* 395 */ /***/ (function(module, exports) { /** @@ -86265,7 +88039,7 @@ module.exports = Smooth; /***/ }), -/* 393 */ +/* 396 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86275,9 +88049,9 @@ module.exports = Smooth; */ var Class = __webpack_require__(0); -var GeomRectangle = __webpack_require__(10); -var Shape = __webpack_require__(30); -var RectangleRender = __webpack_require__(977); +var GeomRectangle = __webpack_require__(11); +var Shape = __webpack_require__(29); +var RectangleRender = __webpack_require__(981); /** * @classdesc @@ -86377,7 +88151,7 @@ module.exports = Rectangle; /***/ }), -/* 394 */ +/* 397 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86386,10 +88160,10 @@ module.exports = Rectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StarRender = __webpack_require__(980); +var StarRender = __webpack_require__(984); var Class = __webpack_require__(0); -var Earcut = __webpack_require__(63); -var Shape = __webpack_require__(30); +var Earcut = __webpack_require__(64); +var Shape = __webpack_require__(29); /** * @classdesc @@ -86665,7 +88439,7 @@ module.exports = Star; /***/ }), -/* 395 */ +/* 398 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86675,9 +88449,9 @@ module.exports = Star; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GeomTriangle = __webpack_require__(69); -var TriangleRender = __webpack_require__(983); +var Shape = __webpack_require__(29); +var GeomTriangle = __webpack_require__(70); +var TriangleRender = __webpack_require__(987); /** * @classdesc @@ -86808,7 +88582,7 @@ module.exports = Triangle; /***/ }), -/* 396 */ +/* 399 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86817,8 +88591,8 @@ module.exports = Triangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var Length = __webpack_require__(55); +var Point = __webpack_require__(4); +var Length = __webpack_require__(56); /** * Returns a Point from around the perimeter of a Triangle. @@ -86895,7 +88669,7 @@ module.exports = GetPoint; /***/ }), -/* 397 */ +/* 400 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86904,8 +88678,8 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); -var Point = __webpack_require__(3); +var Length = __webpack_require__(56); +var Point = __webpack_require__(4); /** * Returns an array of evenly spaced points on the perimeter of a Triangle. @@ -86988,7 +88762,7 @@ module.exports = GetPoints; /***/ }), -/* 398 */ +/* 401 */ /***/ (function(module, exports) { /** @@ -87071,7 +88845,7 @@ module.exports = SetValue; /***/ }), -/* 399 */ +/* 402 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87334,7 +89108,7 @@ module.exports = Light; /***/ }), -/* 400 */ +/* 403 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87344,7 +89118,7 @@ module.exports = Light; */ var Class = __webpack_require__(0); -var Light = __webpack_require__(399); +var Light = __webpack_require__(402); var Utils = __webpack_require__(9); /** @@ -87697,7 +89471,7 @@ module.exports = LightsManager; /***/ }), -/* 401 */ +/* 404 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87706,26 +89480,34 @@ module.exports = LightsManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var CONST = __webpack_require__(47); +var Extend = __webpack_require__(15); + /** * @namespace Phaser.Geom */ -module.exports = { +var Geom = { - Circle: __webpack_require__(1039), - Ellipse: __webpack_require__(1049), - Intersects: __webpack_require__(402), - Line: __webpack_require__(1068), - Point: __webpack_require__(1089), - Polygon: __webpack_require__(1103), - Rectangle: __webpack_require__(417), - Triangle: __webpack_require__(1133) + Circle: __webpack_require__(1043), + Ellipse: __webpack_require__(1053), + Intersects: __webpack_require__(405), + Line: __webpack_require__(1072), + Point: __webpack_require__(1093), + Polygon: __webpack_require__(1107), + Rectangle: __webpack_require__(420), + Triangle: __webpack_require__(1137) }; +// Merge in the consts +Geom = Extend(false, Geom, CONST); + +module.exports = Geom; + /***/ }), -/* 402 */ +/* 405 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87740,35 +89522,35 @@ module.exports = { module.exports = { - CircleToCircle: __webpack_require__(403), - CircleToRectangle: __webpack_require__(404), - GetCircleToCircle: __webpack_require__(1059), - GetCircleToRectangle: __webpack_require__(1060), - GetLineToCircle: __webpack_require__(196), - GetLineToRectangle: __webpack_require__(198), - GetRectangleIntersection: __webpack_require__(1061), - GetRectangleToRectangle: __webpack_require__(1062), - GetRectangleToTriangle: __webpack_require__(1063), - GetTriangleToCircle: __webpack_require__(1064), - GetTriangleToLine: __webpack_require__(409), - GetTriangleToTriangle: __webpack_require__(1065), - LineToCircle: __webpack_require__(197), - LineToLine: __webpack_require__(82), - LineToRectangle: __webpack_require__(405), - PointToLine: __webpack_require__(413), - PointToLineSegment: __webpack_require__(1066), - RectangleToRectangle: __webpack_require__(130), - RectangleToTriangle: __webpack_require__(406), - RectangleToValues: __webpack_require__(1067), - TriangleToCircle: __webpack_require__(408), - TriangleToLine: __webpack_require__(410), - TriangleToTriangle: __webpack_require__(411) + CircleToCircle: __webpack_require__(406), + CircleToRectangle: __webpack_require__(407), + GetCircleToCircle: __webpack_require__(1063), + GetCircleToRectangle: __webpack_require__(1064), + GetLineToCircle: __webpack_require__(198), + GetLineToRectangle: __webpack_require__(200), + GetRectangleIntersection: __webpack_require__(1065), + GetRectangleToRectangle: __webpack_require__(1066), + GetRectangleToTriangle: __webpack_require__(1067), + GetTriangleToCircle: __webpack_require__(1068), + GetTriangleToLine: __webpack_require__(412), + GetTriangleToTriangle: __webpack_require__(1069), + LineToCircle: __webpack_require__(199), + LineToLine: __webpack_require__(84), + LineToRectangle: __webpack_require__(408), + PointToLine: __webpack_require__(416), + PointToLineSegment: __webpack_require__(1070), + RectangleToRectangle: __webpack_require__(131), + RectangleToTriangle: __webpack_require__(409), + RectangleToValues: __webpack_require__(1071), + TriangleToCircle: __webpack_require__(411), + TriangleToLine: __webpack_require__(413), + TriangleToTriangle: __webpack_require__(414) }; /***/ }), -/* 403 */ +/* 406 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87777,7 +89559,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DistanceBetween = __webpack_require__(57); +var DistanceBetween = __webpack_require__(58); /** * Checks if two Circles intersect. @@ -87799,7 +89581,7 @@ module.exports = CircleToCircle; /***/ }), -/* 404 */ +/* 407 */ /***/ (function(module, exports) { /** @@ -87853,7 +89635,7 @@ module.exports = CircleToRectangle; /***/ }), -/* 405 */ +/* 408 */ /***/ (function(module, exports) { /** @@ -87954,7 +89736,7 @@ module.exports = LineToRectangle; /***/ }), -/* 406 */ +/* 409 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87963,10 +89745,10 @@ module.exports = LineToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineToLine = __webpack_require__(82); -var Contains = __webpack_require__(47); -var ContainsArray = __webpack_require__(199); -var Decompose = __webpack_require__(407); +var LineToLine = __webpack_require__(84); +var Contains = __webpack_require__(48); +var ContainsArray = __webpack_require__(201); +var Decompose = __webpack_require__(410); /** * Checks for intersection between Rectangle shape and Triangle shape. @@ -88047,7 +89829,7 @@ module.exports = RectangleToTriangle; /***/ }), -/* 407 */ +/* 410 */ /***/ (function(module, exports) { /** @@ -88084,7 +89866,7 @@ module.exports = Decompose; /***/ }), -/* 408 */ +/* 411 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88093,8 +89875,8 @@ module.exports = Decompose; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineToCircle = __webpack_require__(197); -var Contains = __webpack_require__(81); +var LineToCircle = __webpack_require__(199); +var Contains = __webpack_require__(83); /** * Checks if a Triangle and a Circle intersect. @@ -88149,7 +89931,7 @@ module.exports = TriangleToCircle; /***/ }), -/* 409 */ +/* 412 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88159,9 +89941,9 @@ module.exports = TriangleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var TriangleToLine = __webpack_require__(410); -var LineToLine = __webpack_require__(82); +var Point = __webpack_require__(4); +var TriangleToLine = __webpack_require__(413); +var LineToLine = __webpack_require__(84); /** * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array. @@ -88208,7 +89990,7 @@ module.exports = GetTriangleToLine; /***/ }), -/* 410 */ +/* 413 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88217,8 +89999,8 @@ module.exports = GetTriangleToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(81); -var LineToLine = __webpack_require__(82); +var Contains = __webpack_require__(83); +var LineToLine = __webpack_require__(84); /** * Checks if a Triangle and a Line intersect. @@ -88264,7 +90046,7 @@ module.exports = TriangleToLine; /***/ }), -/* 411 */ +/* 414 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88273,9 +90055,9 @@ module.exports = TriangleToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ContainsArray = __webpack_require__(199); -var Decompose = __webpack_require__(412); -var LineToLine = __webpack_require__(82); +var ContainsArray = __webpack_require__(201); +var Decompose = __webpack_require__(415); +var LineToLine = __webpack_require__(84); /** * Checks if two Triangles intersect. @@ -88354,7 +90136,7 @@ module.exports = TriangleToTriangle; /***/ }), -/* 412 */ +/* 415 */ /***/ (function(module, exports) { /** @@ -88389,7 +90171,7 @@ module.exports = Decompose; /***/ }), -/* 413 */ +/* 416 */ /***/ (function(module, exports) { /** @@ -88459,7 +90241,7 @@ module.exports = PointToLine; /***/ }), -/* 414 */ +/* 417 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88468,9 +90250,9 @@ module.exports = PointToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Wrap = __webpack_require__(56); -var Angle = __webpack_require__(83); +var MATH_CONST = __webpack_require__(22); +var Wrap = __webpack_require__(57); +var Angle = __webpack_require__(85); /** * Get the angle of the normal of the given line in radians. @@ -88493,7 +90275,7 @@ module.exports = NormalAngle; /***/ }), -/* 415 */ +/* 418 */ /***/ (function(module, exports) { /** @@ -88521,7 +90303,7 @@ module.exports = GetMagnitude; /***/ }), -/* 416 */ +/* 419 */ /***/ (function(module, exports) { /** @@ -88549,7 +90331,7 @@ module.exports = GetMagnitudeSq; /***/ }), -/* 417 */ +/* 420 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88558,51 +90340,51 @@ module.exports = GetMagnitudeSq; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); -Rectangle.Area = __webpack_require__(1108); -Rectangle.Ceil = __webpack_require__(1109); -Rectangle.CeilAll = __webpack_require__(1110); -Rectangle.CenterOn = __webpack_require__(162); -Rectangle.Clone = __webpack_require__(1111); -Rectangle.Contains = __webpack_require__(47); -Rectangle.ContainsPoint = __webpack_require__(1112); -Rectangle.ContainsRect = __webpack_require__(418); -Rectangle.CopyFrom = __webpack_require__(1113); -Rectangle.Decompose = __webpack_require__(407); -Rectangle.Equals = __webpack_require__(1114); -Rectangle.FitInside = __webpack_require__(1115); -Rectangle.FitOutside = __webpack_require__(1116); -Rectangle.Floor = __webpack_require__(1117); -Rectangle.FloorAll = __webpack_require__(1118); -Rectangle.FromPoints = __webpack_require__(172); -Rectangle.GetAspectRatio = __webpack_require__(201); -Rectangle.GetCenter = __webpack_require__(1119); -Rectangle.GetPoint = __webpack_require__(147); -Rectangle.GetPoints = __webpack_require__(249); -Rectangle.GetSize = __webpack_require__(1120); -Rectangle.Inflate = __webpack_require__(1121); -Rectangle.Intersection = __webpack_require__(1122); -Rectangle.MarchingAnts = __webpack_require__(260); -Rectangle.MergePoints = __webpack_require__(1123); -Rectangle.MergeRect = __webpack_require__(1124); -Rectangle.MergeXY = __webpack_require__(1125); -Rectangle.Offset = __webpack_require__(1126); -Rectangle.OffsetPoint = __webpack_require__(1127); -Rectangle.Overlaps = __webpack_require__(1128); -Rectangle.Perimeter = __webpack_require__(108); -Rectangle.PerimeterPoint = __webpack_require__(1129); -Rectangle.Random = __webpack_require__(150); -Rectangle.RandomOutside = __webpack_require__(1130); -Rectangle.SameDimensions = __webpack_require__(1131); -Rectangle.Scale = __webpack_require__(1132); -Rectangle.Union = __webpack_require__(364); +Rectangle.Area = __webpack_require__(1112); +Rectangle.Ceil = __webpack_require__(1113); +Rectangle.CeilAll = __webpack_require__(1114); +Rectangle.CenterOn = __webpack_require__(163); +Rectangle.Clone = __webpack_require__(1115); +Rectangle.Contains = __webpack_require__(48); +Rectangle.ContainsPoint = __webpack_require__(1116); +Rectangle.ContainsRect = __webpack_require__(421); +Rectangle.CopyFrom = __webpack_require__(1117); +Rectangle.Decompose = __webpack_require__(410); +Rectangle.Equals = __webpack_require__(1118); +Rectangle.FitInside = __webpack_require__(1119); +Rectangle.FitOutside = __webpack_require__(1120); +Rectangle.Floor = __webpack_require__(1121); +Rectangle.FloorAll = __webpack_require__(1122); +Rectangle.FromPoints = __webpack_require__(173); +Rectangle.GetAspectRatio = __webpack_require__(203); +Rectangle.GetCenter = __webpack_require__(1123); +Rectangle.GetPoint = __webpack_require__(148); +Rectangle.GetPoints = __webpack_require__(252); +Rectangle.GetSize = __webpack_require__(1124); +Rectangle.Inflate = __webpack_require__(1125); +Rectangle.Intersection = __webpack_require__(1126); +Rectangle.MarchingAnts = __webpack_require__(263); +Rectangle.MergePoints = __webpack_require__(1127); +Rectangle.MergeRect = __webpack_require__(1128); +Rectangle.MergeXY = __webpack_require__(1129); +Rectangle.Offset = __webpack_require__(1130); +Rectangle.OffsetPoint = __webpack_require__(1131); +Rectangle.Overlaps = __webpack_require__(1132); +Rectangle.Perimeter = __webpack_require__(109); +Rectangle.PerimeterPoint = __webpack_require__(1133); +Rectangle.Random = __webpack_require__(151); +Rectangle.RandomOutside = __webpack_require__(1134); +Rectangle.SameDimensions = __webpack_require__(1135); +Rectangle.Scale = __webpack_require__(1136); +Rectangle.Union = __webpack_require__(367); module.exports = Rectangle; /***/ }), -/* 418 */ +/* 421 */ /***/ (function(module, exports) { /** @@ -88642,7 +90424,7 @@ module.exports = ContainsRect; /***/ }), -/* 419 */ +/* 422 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88651,7 +90433,7 @@ module.exports = ContainsRect; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); // The three medians (the lines drawn from the vertices to the bisectors of the opposite sides) // meet in the centroid or center of mass (center of gravity). @@ -88686,7 +90468,7 @@ module.exports = Centroid; /***/ }), -/* 420 */ +/* 423 */ /***/ (function(module, exports) { /** @@ -88727,7 +90509,7 @@ module.exports = Offset; /***/ }), -/* 421 */ +/* 424 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88736,7 +90518,7 @@ module.exports = Offset; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); // The three angle bisectors of a triangle meet in one point called the incenter. // It is the center of the incircle, the circle inscribed in the triangle. @@ -88792,7 +90574,7 @@ module.exports = InCenter; /***/ }), -/* 422 */ +/* 425 */ /***/ (function(module, exports) { /** @@ -88834,6 +90616,7 @@ var CreateInteractiveObject = function (gameObject, hitArea, hitAreaCallback) hitArea: hitArea, hitAreaCallback: hitAreaCallback, + hitAreaDebug: null, // Has the dev specified their own shape, or is this bound to the texture size? customHitArea: false, @@ -88861,7 +90644,7 @@ module.exports = CreateInteractiveObject; /***/ }), -/* 423 */ +/* 426 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88986,7 +90769,7 @@ module.exports = Axis; /***/ }), -/* 424 */ +/* 427 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88996,7 +90779,7 @@ module.exports = Axis; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(203); +var Events = __webpack_require__(205); /** * @classdesc @@ -89132,7 +90915,7 @@ module.exports = Button; /***/ }), -/* 425 */ +/* 428 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89141,11 +90924,11 @@ module.exports = Button; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Axis = __webpack_require__(423); -var Button = __webpack_require__(424); +var Axis = __webpack_require__(426); +var Button = __webpack_require__(427); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Vector2 = __webpack_require__(4); +var EventEmitter = __webpack_require__(10); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -89890,7 +91673,7 @@ module.exports = Gamepad; /***/ }), -/* 426 */ +/* 429 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89900,8 +91683,8 @@ module.exports = Gamepad; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(132); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(133); /** * @classdesc @@ -90292,7 +92075,7 @@ module.exports = Key; /***/ }), -/* 427 */ +/* 430 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -90302,10 +92085,10 @@ module.exports = Key; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(132); +var Events = __webpack_require__(133); var GetFastValue = __webpack_require__(2); -var ProcessKeyCombo = __webpack_require__(1172); -var ResetKeyCombo = __webpack_require__(1174); +var ProcessKeyCombo = __webpack_require__(1176); +var ResetKeyCombo = __webpack_require__(1178); /** * @classdesc @@ -90585,7 +92368,7 @@ module.exports = KeyCombo; /***/ }), -/* 428 */ +/* 431 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -90594,7 +92377,7 @@ module.exports = KeyCombo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MergeXHRSettings = __webpack_require__(205); +var MergeXHRSettings = __webpack_require__(207); /** * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings @@ -90653,7 +92436,7 @@ module.exports = XHRLoader; /***/ }), -/* 429 */ +/* 432 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -90663,11 +92446,11 @@ module.exports = XHRLoader; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(26); -var File = __webpack_require__(20); +var CONST = __webpack_require__(31); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var HTML5AudioFile = __webpack_require__(430); +var HTML5AudioFile = __webpack_require__(433); var IsPlainObject = __webpack_require__(7); /** @@ -90924,7 +92707,7 @@ module.exports = AudioFile; /***/ }), -/* 430 */ +/* 433 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -90934,10 +92717,10 @@ module.exports = AudioFile; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(80); -var File = __webpack_require__(20); +var Events = __webpack_require__(81); +var File = __webpack_require__(21); var GetFastValue = __webpack_require__(2); -var GetURL = __webpack_require__(204); +var GetURL = __webpack_require__(206); var IsPlainObject = __webpack_require__(7); /** @@ -91122,7 +92905,7 @@ module.exports = HTML5AudioFile; /***/ }), -/* 431 */ +/* 434 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91132,8 +92915,8 @@ module.exports = HTML5AudioFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -91293,7 +93076,7 @@ module.exports = ScriptFile; /***/ }), -/* 432 */ +/* 435 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91303,8 +93086,8 @@ module.exports = ScriptFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -91468,7 +93251,7 @@ module.exports = TextFile; /***/ }), -/* 433 */ +/* 436 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91477,12 +93260,12 @@ module.exports = TextFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeImage = __webpack_require__(434); -var ArcadeSprite = __webpack_require__(134); +var ArcadeImage = __webpack_require__(437); +var ArcadeSprite = __webpack_require__(135); var Class = __webpack_require__(0); -var CONST = __webpack_require__(50); -var PhysicsGroup = __webpack_require__(435); -var StaticPhysicsGroup = __webpack_require__(436); +var CONST = __webpack_require__(51); +var PhysicsGroup = __webpack_require__(438); +var StaticPhysicsGroup = __webpack_require__(439); /** * @classdesc @@ -91739,7 +93522,7 @@ module.exports = Factory; /***/ }), -/* 434 */ +/* 437 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91749,8 +93532,8 @@ module.exports = Factory; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(207); -var Image = __webpack_require__(95); +var Components = __webpack_require__(209); +var Image = __webpack_require__(96); /** * @classdesc @@ -91839,7 +93622,7 @@ module.exports = ArcadeImage; /***/ }), -/* 435 */ +/* 438 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91848,11 +93631,11 @@ module.exports = ArcadeImage; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeSprite = __webpack_require__(134); +var ArcadeSprite = __webpack_require__(135); var Class = __webpack_require__(0); -var CONST = __webpack_require__(50); +var CONST = __webpack_require__(51); var GetFastValue = __webpack_require__(2); -var Group = __webpack_require__(94); +var Group = __webpack_require__(95); var IsPlainObject = __webpack_require__(7); /** @@ -92112,7 +93895,7 @@ module.exports = PhysicsGroup; /***/ }), -/* 436 */ +/* 439 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92121,11 +93904,11 @@ module.exports = PhysicsGroup; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeSprite = __webpack_require__(134); +var ArcadeSprite = __webpack_require__(135); var Class = __webpack_require__(0); -var CONST = __webpack_require__(50); +var CONST = __webpack_require__(51); var GetFastValue = __webpack_require__(2); -var Group = __webpack_require__(94); +var Group = __webpack_require__(95); var IsPlainObject = __webpack_require__(7); /** @@ -92292,7 +94075,7 @@ module.exports = StaticPhysicsGroup; /***/ }), -/* 437 */ +/* 440 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92301,33 +94084,33 @@ module.exports = StaticPhysicsGroup; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(438); -var Clamp = __webpack_require__(22); +var Body = __webpack_require__(441); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Collider = __webpack_require__(439); -var CONST = __webpack_require__(50); -var DistanceBetween = __webpack_require__(57); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(208); -var FuzzyEqual = __webpack_require__(166); -var FuzzyGreaterThan = __webpack_require__(295); -var FuzzyLessThan = __webpack_require__(296); -var GetOverlapX = __webpack_require__(440); -var GetOverlapY = __webpack_require__(441); -var GetValue = __webpack_require__(6); -var ProcessQueue = __webpack_require__(442); -var ProcessTileCallbacks = __webpack_require__(1230); -var Rectangle = __webpack_require__(10); -var RTree = __webpack_require__(443); -var SeparateTile = __webpack_require__(1231); -var SeparateX = __webpack_require__(1236); -var SeparateY = __webpack_require__(1237); -var Set = __webpack_require__(105); -var StaticBody = __webpack_require__(445); -var TileIntersectsBody = __webpack_require__(444); +var Collider = __webpack_require__(442); +var CONST = __webpack_require__(51); +var DistanceBetween = __webpack_require__(58); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(210); +var FuzzyEqual = __webpack_require__(167); +var FuzzyGreaterThan = __webpack_require__(298); +var FuzzyLessThan = __webpack_require__(299); +var GetOverlapX = __webpack_require__(443); +var GetOverlapY = __webpack_require__(444); +var GetValue = __webpack_require__(5); +var ProcessQueue = __webpack_require__(445); +var ProcessTileCallbacks = __webpack_require__(1234); +var Rectangle = __webpack_require__(11); +var RTree = __webpack_require__(446); +var SeparateTile = __webpack_require__(1235); +var SeparateX = __webpack_require__(1240); +var SeparateY = __webpack_require__(1241); +var Set = __webpack_require__(106); +var StaticBody = __webpack_require__(448); +var TileIntersectsBody = __webpack_require__(447); var TransformMatrix = __webpack_require__(32); -var Vector2 = __webpack_require__(4); -var Wrap = __webpack_require__(56); +var Vector2 = __webpack_require__(3); +var Wrap = __webpack_require__(57); /** * @classdesc @@ -94669,7 +96452,7 @@ module.exports = World; /***/ }), -/* 438 */ +/* 441 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94680,12 +96463,12 @@ module.exports = World; var CircleContains = __webpack_require__(46); var Class = __webpack_require__(0); -var CONST = __webpack_require__(50); -var Events = __webpack_require__(208); -var RadToDeg = __webpack_require__(169); -var Rectangle = __webpack_require__(10); -var RectangleContains = __webpack_require__(47); -var Vector2 = __webpack_require__(4); +var CONST = __webpack_require__(51); +var Events = __webpack_require__(210); +var RadToDeg = __webpack_require__(170); +var Rectangle = __webpack_require__(11); +var RectangleContains = __webpack_require__(48); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -96857,7 +98640,7 @@ module.exports = Body; /***/ }), -/* 439 */ +/* 442 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97040,7 +98823,7 @@ module.exports = Collider; /***/ }), -/* 440 */ +/* 443 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97049,7 +98832,7 @@ module.exports = Collider; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(50); +var CONST = __webpack_require__(51); /** * Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties @@ -97148,7 +98931,7 @@ module.exports = GetOverlapX; /***/ }), -/* 441 */ +/* 444 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97157,7 +98940,7 @@ module.exports = GetOverlapX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(50); +var CONST = __webpack_require__(51); /** * Calculates and returns the vertical overlap between two arcade physics bodies and sets their properties @@ -97256,7 +99039,7 @@ module.exports = GetOverlapY; /***/ }), -/* 442 */ +/* 445 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97488,7 +99271,7 @@ module.exports = ProcessQueue; /***/ }), -/* 443 */ +/* 446 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97498,7 +99281,7 @@ module.exports = ProcessQueue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var quickselect = __webpack_require__(361); +var quickselect = __webpack_require__(364); /** * @classdesc @@ -98099,7 +99882,7 @@ function multiSelect (arr, left, right, n, compare) module.exports = rbush; /***/ }), -/* 444 */ +/* 447 */ /***/ (function(module, exports) { /** @@ -98135,7 +99918,7 @@ module.exports = TileIntersectsBody; /***/ }), -/* 445 */ +/* 448 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98146,9 +99929,9 @@ module.exports = TileIntersectsBody; var CircleContains = __webpack_require__(46); var Class = __webpack_require__(0); -var CONST = __webpack_require__(50); -var RectangleContains = __webpack_require__(47); -var Vector2 = __webpack_require__(4); +var CONST = __webpack_require__(51); +var RectangleContains = __webpack_require__(48); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -99124,7 +100907,7 @@ module.exports = StaticBody; /***/ }), -/* 446 */ +/* 449 */ /***/ (function(module, exports) { /** @@ -99203,7 +100986,7 @@ module.exports = { /***/ }), -/* 447 */ +/* 450 */ /***/ (function(module, exports) { /** @@ -99271,7 +101054,7 @@ module.exports = { /***/ }), -/* 448 */ +/* 451 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99284,7 +101067,7 @@ var Sleeping = {}; module.exports = Sleeping; -var Events = __webpack_require__(227); +var Events = __webpack_require__(230); (function() { @@ -99406,7 +101189,7 @@ var Events = __webpack_require__(227); /***/ }), -/* 449 */ +/* 452 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99587,7 +101370,7 @@ module.exports = BasePlugin; /***/ }), -/* 450 */ +/* 453 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99596,7 +101379,7 @@ module.exports = BasePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -99632,7 +101415,7 @@ module.exports = ReplaceByIndex; /***/ }), -/* 451 */ +/* 454 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99675,7 +101458,7 @@ module.exports = HasTileAt; /***/ }), -/* 452 */ +/* 455 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99684,9 +101467,9 @@ module.exports = HasTileAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tile = __webpack_require__(72); +var Tile = __webpack_require__(73); var IsInLayerBounds = __webpack_require__(101); -var CalculateFacesAt = __webpack_require__(210); +var CalculateFacesAt = __webpack_require__(212); /** * Removes the tile at the given tile coordinates in the specified layer and updates the layer's @@ -99738,7 +101521,7 @@ module.exports = RemoveTileAt; /***/ }), -/* 453 */ +/* 456 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99747,11 +101530,11 @@ module.exports = RemoveTileAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); -var Parse2DArray = __webpack_require__(213); -var ParseCSV = __webpack_require__(454); -var ParseJSONTiled = __webpack_require__(455); -var ParseWeltmeister = __webpack_require__(466); +var Formats = __webpack_require__(30); +var Parse2DArray = __webpack_require__(215); +var ParseCSV = __webpack_require__(457); +var ParseJSONTiled = __webpack_require__(458); +var ParseWeltmeister = __webpack_require__(469); /** * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format @@ -99808,7 +101591,7 @@ module.exports = Parse; /***/ }), -/* 454 */ +/* 457 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99817,8 +101600,8 @@ module.exports = Parse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); -var Parse2DArray = __webpack_require__(213); +var Formats = __webpack_require__(30); +var Parse2DArray = __webpack_require__(215); /** * Parses a CSV string of tile indexes into a new MapData object with a single layer. @@ -99856,7 +101639,7 @@ module.exports = ParseCSV; /***/ }), -/* 455 */ +/* 458 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99865,14 +101648,14 @@ module.exports = ParseCSV; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); +var Formats = __webpack_require__(30); var MapData = __webpack_require__(103); -var ParseTileLayers = __webpack_require__(456); -var ParseImageLayers = __webpack_require__(458); -var ParseTilesets = __webpack_require__(459); -var ParseObjectLayers = __webpack_require__(462); -var BuildTilesetIndex = __webpack_require__(464); -var AssignTileProperties = __webpack_require__(465); +var ParseTileLayers = __webpack_require__(459); +var ParseImageLayers = __webpack_require__(461); +var ParseTilesets = __webpack_require__(462); +var ParseObjectLayers = __webpack_require__(465); +var BuildTilesetIndex = __webpack_require__(467); +var AssignTileProperties = __webpack_require__(468); /** * Parses a Tiled JSON object into a new MapData object. @@ -99934,7 +101717,7 @@ module.exports = ParseJSONTiled; /***/ }), -/* 456 */ +/* 459 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99943,11 +101726,11 @@ module.exports = ParseJSONTiled; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Base64Decode = __webpack_require__(457); +var Base64Decode = __webpack_require__(460); var GetFastValue = __webpack_require__(2); var LayerData = __webpack_require__(102); -var ParseGID = __webpack_require__(214); -var Tile = __webpack_require__(72); +var ParseGID = __webpack_require__(216); +var Tile = __webpack_require__(73); /** * [description] @@ -100144,7 +101927,7 @@ module.exports = ParseTileLayers; /***/ }), -/* 457 */ +/* 460 */ /***/ (function(module, exports) { /** @@ -100187,7 +101970,7 @@ module.exports = Base64Decode; /***/ }), -/* 458 */ +/* 461 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100239,7 +102022,7 @@ module.exports = ParseImageLayers; /***/ }), -/* 459 */ +/* 462 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100248,9 +102031,9 @@ module.exports = ParseImageLayers; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tileset = __webpack_require__(140); -var ImageCollection = __webpack_require__(460); -var ParseObject = __webpack_require__(215); +var Tileset = __webpack_require__(141); +var ImageCollection = __webpack_require__(463); +var ParseObject = __webpack_require__(217); /** * Tilesets and Image Collections @@ -100408,7 +102191,7 @@ module.exports = ParseTilesets; /***/ }), -/* 460 */ +/* 463 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100580,7 +102363,7 @@ module.exports = ImageCollection; /***/ }), -/* 461 */ +/* 464 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100624,7 +102407,7 @@ module.exports = Pick; /***/ }), -/* 462 */ +/* 465 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100634,8 +102417,8 @@ module.exports = Pick; */ var GetFastValue = __webpack_require__(2); -var ParseObject = __webpack_require__(215); -var ObjectLayer = __webpack_require__(463); +var ParseObject = __webpack_require__(217); +var ObjectLayer = __webpack_require__(466); /** * Parses a Tiled JSON object into an array of ObjectLayer objects. @@ -100683,7 +102466,7 @@ module.exports = ParseObjectLayers; /***/ }), -/* 463 */ +/* 466 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100805,7 +102588,7 @@ module.exports = ObjectLayer; /***/ }), -/* 464 */ +/* 467 */ /***/ (function(module, exports) { /** @@ -100878,7 +102661,7 @@ module.exports = BuildTilesetIndex; /***/ }), -/* 465 */ +/* 468 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100887,7 +102670,7 @@ module.exports = BuildTilesetIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(17); +var Extend = __webpack_require__(15); /** * Copy properties from tileset to tiles. @@ -100951,7 +102734,7 @@ module.exports = AssignTileProperties; /***/ }), -/* 466 */ +/* 469 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100960,10 +102743,10 @@ module.exports = AssignTileProperties; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(31); +var Formats = __webpack_require__(30); var MapData = __webpack_require__(103); -var ParseTileLayers = __webpack_require__(467); -var ParseTilesets = __webpack_require__(468); +var ParseTileLayers = __webpack_require__(470); +var ParseTilesets = __webpack_require__(471); /** * Parses a Weltmeister JSON object into a new MapData object. @@ -101018,7 +102801,7 @@ module.exports = ParseWeltmeister; /***/ }), -/* 467 */ +/* 470 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101028,7 +102811,7 @@ module.exports = ParseWeltmeister; */ var LayerData = __webpack_require__(102); -var Tile = __webpack_require__(72); +var Tile = __webpack_require__(73); /** * [description] @@ -101102,7 +102885,7 @@ module.exports = ParseTileLayers; /***/ }), -/* 468 */ +/* 471 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101111,7 +102894,7 @@ module.exports = ParseTileLayers; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tileset = __webpack_require__(140); +var Tileset = __webpack_require__(141); /** * [description] @@ -101153,7 +102936,7 @@ module.exports = ParseTilesets; /***/ }), -/* 469 */ +/* 472 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101164,16 +102947,16 @@ module.exports = ParseTilesets; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(35); -var DynamicTilemapLayer = __webpack_require__(470); -var Extend = __webpack_require__(17); -var Formats = __webpack_require__(31); +var DynamicTilemapLayer = __webpack_require__(473); +var Extend = __webpack_require__(15); +var Formats = __webpack_require__(30); var LayerData = __webpack_require__(102); -var Rotate = __webpack_require__(305); -var SpliceOne = __webpack_require__(78); -var StaticTilemapLayer = __webpack_require__(471); -var Tile = __webpack_require__(72); -var TilemapComponents = __webpack_require__(136); -var Tileset = __webpack_require__(140); +var Rotate = __webpack_require__(308); +var SpliceOne = __webpack_require__(79); +var StaticTilemapLayer = __webpack_require__(474); +var Tile = __webpack_require__(73); +var TilemapComponents = __webpack_require__(137); +var Tileset = __webpack_require__(141); /** * @callback TilemapFilterCallback @@ -101796,7 +103579,7 @@ var Tilemap = new Class({ config.x = obj.x; config.y = obj.y; - var sprite = this.scene.make.sprite(config); + var sprite = scene.make.sprite(config); sprite.name = obj.name; @@ -102333,7 +104116,7 @@ var Tilemap = new Class({ layer = this.getLayer(layer); if (layer === null) { return null; } - + return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, layer); }, @@ -102705,7 +104488,7 @@ var Tilemap = new Class({ /** * Removes the given TilemapLayer from this Tilemap without destroying it. - * + * * If no layer specified, the map's current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeLayer @@ -102738,7 +104521,7 @@ var Tilemap = new Class({ /** * Destroys the given TilemapLayer and removes it from this Tilemap. - * + * * If no layer specified, the map's current layer is used. * * @method Phaser.Tilemaps.Tilemap#destroyLayer @@ -102805,7 +104588,7 @@ var Tilemap = new Class({ /** * Removes the given Tile, or an array of Tiles, from the layer to which they belong, * and optionally recalculates the collision information. - * + * * This cannot be applied to Tiles that belong to Static Tilemap Layers. * * @method Phaser.Tilemaps.Tilemap#removeTile @@ -102933,7 +104716,7 @@ var Tilemap = new Class({ /** * Draws a debug representation of all layers within this Tilemap to the given Graphics object. - * + * * This is helpful when you want to get a quick idea of which of your tiles are colliding and which * have interesting faces. The tiles are drawn starting at (0, 0) in the Graphics, allowing you to * place the debug representation wherever you want on the screen. @@ -103610,7 +105393,7 @@ module.exports = Tilemap; /***/ }), -/* 470 */ +/* 473 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103621,9 +105404,9 @@ module.exports = Tilemap; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var DynamicTilemapLayerRender = __webpack_require__(1289); +var DynamicTilemapLayerRender = __webpack_require__(1293); var GameObject = __webpack_require__(13); -var TilemapComponents = __webpack_require__(136); +var TilemapComponents = __webpack_require__(137); /** * @classdesc @@ -104073,6 +105856,12 @@ var DynamicTilemapLayer = new Class({ { if (removeFromTilemap === undefined) { removeFromTilemap = true; } + if (!this.tilemap) + { + // Abort, we've already been destroyed + return; + } + // Uninstall this layer only if it is still installed on the LayerData object if (this.layer.tilemapLayer === this) { @@ -104921,7 +106710,7 @@ module.exports = DynamicTilemapLayer; /***/ }), -/* 471 */ +/* 474 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -104932,10 +106721,10 @@ module.exports = DynamicTilemapLayer; var Class = __webpack_require__(0); var Components = __webpack_require__(12); -var CONST = __webpack_require__(26); +var GameEvents = __webpack_require__(18); var GameObject = __webpack_require__(13); -var StaticTilemapLayerRender = __webpack_require__(1292); -var TilemapComponents = __webpack_require__(136); +var StaticTilemapLayerRender = __webpack_require__(1296); +var TilemapComponents = __webpack_require__(137); var TransformMatrix = __webpack_require__(32); var Utils = __webpack_require__(9); @@ -105285,13 +107074,10 @@ var StaticTilemapLayer = new Class({ this.initPipeline('TextureTintPipeline'); - if (scene.sys.game.config.renderType === CONST.WEBGL) + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function () { - scene.sys.game.renderer.onContextRestored(function () - { - this.updateVBOData(); - }, this); - } + this.updateVBOData(); + }, this); }, /** @@ -106372,7 +108158,13 @@ var StaticTilemapLayer = new Class({ { if (removeFromTilemap === undefined) { removeFromTilemap = true; } - // Uninstall this layer only if it is still installed on the LayerData object + if (!this.tilemap) + { + // Abort, we've already been destroyed + return; + } + + // Uninstall this layer only if it is still installed on the LayerData object if (this.layer.tilemapLayer === this) { this.layer.tilemapLayer = undefined; @@ -106410,7 +108202,7 @@ module.exports = StaticTilemapLayer; /***/ }), -/* 472 */ +/* 475 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -106689,7 +108481,7 @@ var TimerEvent = new Class({ * @method Phaser.Time.TimerEvent#remove * @since 3.0.0 * - * @param {boolean} [dispatchCallback] - If `true` (by default `false`), the function of the Timer Event will be called before its removal from its Clock. + * @param {boolean} [dispatchCallback=false] - If `true`, the function of the Timer Event will be called before its removal. */ remove: function (dispatchCallback) { @@ -106723,7 +108515,7 @@ module.exports = TimerEvent; /***/ }), -/* 473 */ +/* 476 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -106732,17 +108524,20 @@ module.exports = TimerEvent; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RESERVED = __webpack_require__(1301); +var RESERVED = __webpack_require__(1305); /** - * [description] + * Internal function used by the Tween Builder to return an array of properties + * that the Tween will be operating on. It takes a tween configuration object + * and then checks that none of the `props` entries start with an underscore, or that + * none of the direct properties are on the Reserved list. * * @function Phaser.Tweens.Builders.GetProps * @since 3.0.0 * - * @param {object} config - The configuration object of the tween to get the target(s) from. + * @param {Phaser.Types.Tweens.TweenBuilderConfig} config - The configuration object of the Tween to get the properties from. * - * @return {array} An array of all the targets the tween is operating on. + * @return {string[]} An array of all the properties the tween will operate on. */ var GetProps = function (config) { @@ -106781,7 +108576,7 @@ module.exports = GetProps; /***/ }), -/* 474 */ +/* 477 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -106790,17 +108585,19 @@ module.exports = GetProps; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** - * Returns an array of all tweens in the given config + * Internal function used by the Timeline Builder. + * + * It returns an array of all tweens in the given timeline config. * * @function Phaser.Tweens.Builders.GetTweens * @since 3.0.0 * - * @param {object} config - [description] + * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline. * - * @return {array} [description] + * @return {Phaser.Tweens.Tween[]} An array of Tween instances that the Timeline will manage. */ var GetTweens = function (config) { @@ -106827,7 +108624,7 @@ module.exports = GetTweens; /***/ }), -/* 475 */ +/* 478 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -106836,15 +108633,15 @@ module.exports = GetTweens; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Defaults = __webpack_require__(219); +var Defaults = __webpack_require__(221); var GetAdvancedValue = __webpack_require__(14); -var GetBoolean = __webpack_require__(87); -var GetEaseFunction = __webpack_require__(96); -var GetNewValue = __webpack_require__(141); -var GetValue = __webpack_require__(6); -var GetValueOp = __webpack_require__(218); -var Tween = __webpack_require__(220); -var TweenData = __webpack_require__(221); +var GetBoolean = __webpack_require__(88); +var GetEaseFunction = __webpack_require__(82); +var GetNewValue = __webpack_require__(142); +var GetValue = __webpack_require__(5); +var GetValueOp = __webpack_require__(220); +var Tween = __webpack_require__(222); +var TweenData = __webpack_require__(224); /** * Creates a new Number Tween. @@ -106895,9 +108692,11 @@ var NumberTweenBuilder = function (parent, config, defaults) var tweenData = TweenData( targets[0], + 0, 'value', ops.getEnd, ops.getStart, + ops.getActive, ease, delay, duration, @@ -106955,7 +108754,7 @@ module.exports = NumberTweenBuilder; /***/ }), -/* 476 */ +/* 479 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -106964,17 +108763,17 @@ module.exports = NumberTweenBuilder; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(64); -var Defaults = __webpack_require__(219); +var Clone = __webpack_require__(65); +var Defaults = __webpack_require__(221); var GetAdvancedValue = __webpack_require__(14); -var GetBoolean = __webpack_require__(87); -var GetEaseFunction = __webpack_require__(96); -var GetNewValue = __webpack_require__(141); -var GetTargets = __webpack_require__(217); -var GetTweens = __webpack_require__(474); -var GetValue = __webpack_require__(6); -var Timeline = __webpack_require__(477); -var TweenBuilder = __webpack_require__(142); +var GetBoolean = __webpack_require__(88); +var GetEaseFunction = __webpack_require__(82); +var GetNewValue = __webpack_require__(142); +var GetTargets = __webpack_require__(219); +var GetTweens = __webpack_require__(477); +var GetValue = __webpack_require__(5); +var Timeline = __webpack_require__(480); +var TweenBuilder = __webpack_require__(143); /** * Builds a Timeline of Tweens based on a configuration object. @@ -107107,7 +108906,7 @@ module.exports = TimelineBuilder; /***/ }), -/* 477 */ +/* 480 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -107117,10 +108916,10 @@ module.exports = TimelineBuilder; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(478); -var TweenBuilder = __webpack_require__(142); -var TWEEN_CONST = __webpack_require__(88); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(223); +var TweenBuilder = __webpack_require__(143); +var TWEEN_CONST = __webpack_require__(89); /** * @classdesc @@ -107347,6 +109146,21 @@ var Timeline = new Class({ */ this.totalProgress = 0; + /** + * An object containing the different Tween callback functions. + * + * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. + * + * `onComplete` When the Timeline finishes playback fully or `Timeline.stop` is called. Never invoked if timeline is set to repeat infinitely. + * `onLoop` When a Timeline loops. + * `onStart` When the Timeline starts playing. + * `onUpdate` When a Timeline updates a child Tween. + * `onYoyo` When a Timeline starts a yoyo. + * + * @name Phaser.Tweens.Timeline#callbacks + * @type {object} + * @since 3.0.0 + */ this.callbacks = { onComplete: null, onLoop: null, @@ -107355,9 +109169,37 @@ var Timeline = new Class({ onYoyo: null }; + /** + * The context in which all callbacks are invoked. + * + * @name Phaser.Tweens.Timeline#callbackScope + * @type {any} + * @since 3.0.0 + */ this.callbackScope; }, + /** + * Internal method that will emit a Timeline based Event and invoke the given callback. + * + * @method Phaser.Tweens.Timeline#dispatchTimelineEvent + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchTimelineEvent: function (event, callback) + { + this.emit(event, this, this.targets); + + if (callback) + { + callback.params[1] = this.targets; + + callback.func.apply(callback.scope, callback.params); + } + }, + /** * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. * A value of 0.5 runs 50% slower, and so on. @@ -107716,14 +109558,7 @@ var Timeline = new Class({ this.state = TWEEN_CONST.ACTIVE; } - var onStart = this.callbacks.onStart; - - if (onStart) - { - onStart.func.apply(onStart.scope, onStart.params); - } - - this.emit(Events.TIMELINE_START, this); + this.dispatchTimelineEvent(Events.TIMELINE_START, this.callbacks.onStart); }, /** @@ -107746,44 +109581,32 @@ var Timeline = new Class({ this.loopCounter--; - var onLoop = this.callbacks.onLoop; - - if (onLoop) - { - onLoop.func.apply(onLoop.scope, onLoop.params); - } - - this.emit(Events.TIMELINE_LOOP, this, this.loopCounter); - this.resetTweens(true); if (this.loopDelay > 0) { this.countdown = this.loopDelay; + this.state = TWEEN_CONST.LOOP_DELAY; } else { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); } } else if (this.completeDelay > 0) { - this.countdown = this.completeDelay; this.state = TWEEN_CONST.COMPLETE_DELAY; + + this.countdown = this.completeDelay; } else { this.state = TWEEN_CONST.PENDING_REMOVE; - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.func.apply(onComplete.scope, onComplete.params); - } - - this.emit(Events.TIMELINE_COMPLETE, this); + this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); } }, @@ -107837,14 +109660,7 @@ var Timeline = new Class({ } } - var onUpdate = this.callbacks.onUpdate; - - if (onUpdate) - { - onUpdate.func.apply(onUpdate.scope, onUpdate.params); - } - - this.emit(Events.TIMELINE_UPDATE, this); + this.dispatchTimelineEvent(Events.TIMELINE_UPDATE, this.callbacks.onUpdate); // Anything still running? If not, we're done if (stillRunning === 0) @@ -107861,6 +109677,8 @@ var Timeline = new Class({ if (this.countdown <= 0) { this.state = TWEEN_CONST.ACTIVE; + + this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); } break; @@ -107873,14 +109691,7 @@ var Timeline = new Class({ { this.state = TWEEN_CONST.PENDING_REMOVE; - var onComplete = this.callbacks.onComplete; - - if (onComplete) - { - onComplete.func.apply(onComplete.scope, onComplete.params); - } - - this.emit(Events.TIMELINE_COMPLETE, this); + this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); } break; @@ -108002,7 +109813,7 @@ module.exports = Timeline; /***/ }), -/* 478 */ +/* 481 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -108011,35 +109822,9 @@ module.exports = Timeline; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.Tweens.Events - */ - -module.exports = { - - TIMELINE_COMPLETE: __webpack_require__(1302), - TIMELINE_LOOP: __webpack_require__(1303), - TIMELINE_PAUSE: __webpack_require__(1304), - TIMELINE_RESUME: __webpack_require__(1305), - TIMELINE_START: __webpack_require__(1306), - TIMELINE_UPDATE: __webpack_require__(1307) - -}; - - -/***/ }), -/* 479 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BaseAnimation = __webpack_require__(146); +var BaseAnimation = __webpack_require__(147); var Class = __webpack_require__(0); -var Events = __webpack_require__(107); +var Events = __webpack_require__(108); /** * @classdesc @@ -108618,6 +110403,11 @@ var Animation = new Class({ var anim = this.currentAnim; var gameObject = this.parent; + if (!anim) + { + return gameObject; + } + // Should give us 9,007,199,254,740,991 safe repeats this.repeatCounter = (this._repeat === -1) ? Number.MAX_VALUE : this._repeat; @@ -108761,7 +110551,7 @@ var Animation = new Class({ { this._repeat = value; - this.repeatCounter = 0; + this.repeatCounter = (value === -1) ? Number.MAX_VALUE : value; return this.parent; }, @@ -109196,7 +110986,7 @@ module.exports = Animation; /***/ }), -/* 480 */ +/* 482 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -109206,14 +110996,14 @@ module.exports = Animation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasSnapshot = __webpack_require__(481); -var CameraEvents = __webpack_require__(48); +var CanvasSnapshot = __webpack_require__(483); +var CameraEvents = __webpack_require__(49); var Class = __webpack_require__(0); -var CONST = __webpack_require__(26); -var GetBlendModes = __webpack_require__(482); -var ScaleEvents = __webpack_require__(89); +var CONST = __webpack_require__(31); +var GetBlendModes = __webpack_require__(484); +var ScaleEvents = __webpack_require__(90); var ScaleModes = __webpack_require__(104); -var Smoothing = __webpack_require__(113); +var Smoothing = __webpack_require__(114); var TransformMatrix = __webpack_require__(32); /** @@ -109478,30 +111268,6 @@ var CanvasRenderer = new Class({ } }, - /** - * A NOOP method for handling lost context. Intentionally empty. - * - * @method Phaser.Renderer.Canvas.CanvasRenderer#onContextLost - * @since 3.0.0 - * - * @param {function} callback - Ignored parameter. - */ - onContextLost: function () - { - }, - - /** - * A NOOP method for handling restored context. Intentionally empty. - * - * @method Phaser.Renderer.Canvas.CanvasRenderer#onContextRestored - * @since 3.0.0 - * - * @param {function} callback - Ignored parameter. - */ - onContextRestored: function () - { - }, - /** * Resets the transformation matrix of the current context to the identity matrix, thus resetting any transformation. * @@ -109730,6 +111496,46 @@ var CanvasRenderer = new Class({ } }, + /** + * Takes a snapshot of the given area of the given canvas. + * + * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render. + * + * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets + * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotCanvas + * @since 3.19.0 + * + * @param {HTMLCanvasElement} canvas - The canvas to grab from. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? + * @param {integer} [x=0] - The x coordinate to grab from. + * @param {integer} [y=0] - The y coordinate to grab from. + * @param {integer} [width=canvas.width] - The width of the area to grab. + * @param {integer} [height=canvas.height] - The height of the area to grab. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This Canvas Renderer. + */ + snapshotCanvas: function (canvas, callback, getPixel, x, y, width, height, type, encoderOptions) + { + if (getPixel === undefined) { getPixel = false; } + + this.snapshotArea(x, y, width, height, callback, type, encoderOptions); + + var state = this.snapshotState; + + state.getPixel = getPixel; + + CanvasSnapshot(this.canvas, state); + + state.callback = null; + + return this; + }, + /** * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. * @@ -109858,14 +111664,16 @@ var CanvasRenderer = new Class({ var frameY = cd.y; var frameWidth = frame.cutWidth; var frameHeight = frame.cutHeight; + var customPivot = frame.customPivot; + var res = frame.source.resolution; - var x = -sprite.displayOriginX + frame.x; - var y = -sprite.displayOriginY + frame.y; + var displayOriginX = sprite.displayOriginX; + var displayOriginY = sprite.displayOriginY; + + var x = -displayOriginX + frame.x; + var y = -displayOriginY + frame.y; - var fx = (sprite.flipX) ? -1 : 1; - var fy = (sprite.flipY) ? -1 : 1; - if (sprite.isCropped) { var crop = sprite._crop; @@ -109881,10 +111689,10 @@ var CanvasRenderer = new Class({ frameX = crop.cx; frameY = crop.cy; - x = -sprite.displayOriginX + crop.x; - y = -sprite.displayOriginY + crop.y; + x = -displayOriginX + crop.x; + y = -displayOriginY + crop.y; - if (fx === -1) + if (sprite.flipX) { if (x >= 0) { @@ -109896,7 +111704,7 @@ var CanvasRenderer = new Class({ } } - if (fy === -1) + if (sprite.flipY) { if (y >= 0) { @@ -109909,7 +111717,31 @@ var CanvasRenderer = new Class({ } } - spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX, sprite.scaleY); + var flipX = 1; + var flipY = 1; + + if (sprite.flipX) + { + if (!customPivot) + { + x += (-frame.realWidth + (displayOriginX * 2)); + } + + flipX = -1; + } + + // Auto-invert the flipY if this is coming from a GLTexture + if (sprite.flipY) + { + if (!customPivot) + { + y += (-frame.realHeight + (displayOriginY * 2)); + } + + flipY = -1; + } + + spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX * flipX, sprite.scaleY * flipY); camMatrix.copyFrom(camera.matrix); @@ -109938,8 +111770,6 @@ var CanvasRenderer = new Class({ calcMatrix.setToContext(ctx); - ctx.scale(fx, fy); - ctx.globalCompositeOperation = this.blendModes[sprite.blendMode]; ctx.globalAlpha = alpha; @@ -109969,7 +111799,7 @@ module.exports = CanvasRenderer; /***/ }), -/* 481 */ +/* 483 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -109978,7 +111808,7 @@ module.exports = CanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); +var CanvasPool = __webpack_require__(25); var Color = __webpack_require__(33); var GetFastValue = __webpack_require__(2); @@ -110062,7 +111892,7 @@ module.exports = CanvasSnapshot; /***/ }), -/* 482 */ +/* 484 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110071,8 +111901,8 @@ module.exports = CanvasSnapshot; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var modes = __webpack_require__(52); -var CanvasFeatures = __webpack_require__(291); +var modes = __webpack_require__(53); +var CanvasFeatures = __webpack_require__(294); /** * Returns an array which maps the default blend modes to supported Canvas blend modes. @@ -110126,7 +111956,7 @@ module.exports = GetBlendModes; /***/ }), -/* 483 */ +/* 485 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110136,22 +111966,24 @@ module.exports = GetBlendModes; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(112); -var CameraEvents = __webpack_require__(48); +var BaseCamera = __webpack_require__(113); +var CameraEvents = __webpack_require__(49); var Class = __webpack_require__(0); -var CONST = __webpack_require__(26); -var IsSizePowerOfTwo = __webpack_require__(117); -var ScaleEvents = __webpack_require__(89); -var SpliceOne = __webpack_require__(78); -var TextureEvents = __webpack_require__(118); +var CONST = __webpack_require__(31); +var GameEvents = __webpack_require__(18); +var IsSizePowerOfTwo = __webpack_require__(118); +var NOOP = __webpack_require__(1); +var ScaleEvents = __webpack_require__(90); +var SpliceOne = __webpack_require__(79); +var TextureEvents = __webpack_require__(119); var TransformMatrix = __webpack_require__(32); var Utils = __webpack_require__(9); -var WebGLSnapshot = __webpack_require__(484); +var WebGLSnapshot = __webpack_require__(486); // Default Pipelines -var BitmapMaskPipeline = __webpack_require__(485); -var ForwardDiffuseLightPipeline = __webpack_require__(486); -var TextureTintPipeline = __webpack_require__(226); +var BitmapMaskPipeline = __webpack_require__(487); +var ForwardDiffuseLightPipeline = __webpack_require__(488); +var TextureTintPipeline = __webpack_require__(229); /** * @callback WebGLContextCallback @@ -110182,9 +112014,6 @@ var WebGLRenderer = new Class({ function WebGLRenderer (game) { - // eslint-disable-next-line consistent-this - var renderer = this; - var gameConfig = game.config; var contextCreationConfig = { @@ -110265,24 +112094,6 @@ var WebGLRenderer = new Class({ */ this.canvas = game.canvas; - /** - * An array of functions to invoke if the WebGL context is lost. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#lostContextCallbacks - * @type {WebGLContextCallback[]} - * @since 3.0.0 - */ - this.lostContextCallbacks = []; - - /** - * An array of functions to invoke if the WebGL context is restored. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#restoredContextCallbacks - * @type {WebGLContextCallback[]} - * @since 3.0.0 - */ - this.restoredContextCallbacks = []; - /** * An array of blend modes supported by the WebGL Renderer. * @@ -110306,7 +112117,7 @@ var WebGLRenderer = new Class({ this.nativeTextures = []; /** - * Set to `true` if the WebGL context of the renderer is lost. + * This property is set to `true` if the WebGL context of the renderer is lost. * * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLost * @type {boolean} @@ -110342,7 +112153,10 @@ var WebGLRenderer = new Class({ getPixel: false, callback: null, type: 'image/png', - encoder: 0.92 + encoder: 0.92, + isFramebuffer: false, + bufferWidth: 0, + bufferHeight: 0 }; // Internal Renderer State (Textures, Framebuffers, Pipelines, Buffers, etc) @@ -110441,7 +112255,6 @@ var WebGLRenderer = new Class({ * @type {Uint32Array} * @since 3.0.0 */ - // this.currentScissor = new Uint32Array([ 0, 0, this.width, this.height ]); this.currentScissor = null; /** @@ -110453,32 +112266,25 @@ var WebGLRenderer = new Class({ */ this.scissorStack = []; - // Setup context lost and restore event listeners + /** + * The handler to invoke when the context is lost. + * This should not be changed and is set in the boot method. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLostHandler + * @type {function} + * @since 3.19.0 + */ + this.contextLostHandler = NOOP; - this.canvas.addEventListener('webglcontextlost', function (event) - { - renderer.contextLost = true; - event.preventDefault(); - - for (var index = 0; index < renderer.lostContextCallbacks.length; ++index) - { - var callback = renderer.lostContextCallbacks[index]; - callback[0].call(callback[1], renderer); - } - }, false); - - this.canvas.addEventListener('webglcontextrestored', function () - { - renderer.contextLost = false; - renderer.init(renderer.config); - for (var index = 0; index < renderer.restoredContextCallbacks.length; ++index) - { - var callback = renderer.restoredContextCallbacks[index]; - callback[0].call(callback[1], renderer); - } - }, false); - - // These are initialized post context creation + /** + * The handler to invoke when the context is restored. + * This should not be changed and is set in the boot method. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#contextRestoredHandler + * @type {function} + * @since 3.19.0 + */ + this.contextRestoredHandler = NOOP; /** * The underlying WebGL context of the renderer. @@ -110649,6 +112455,36 @@ var WebGLRenderer = new Class({ */ this.glFuncMap = null; + /** + * The `type` of the Game Object being currently rendered. + * This can be used by advanced render functions for batching look-ahead. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentType + * @type {string} + * @since 3.19.0 + */ + this.currentType = ''; + + /** + * Is the `type` of the Game Object being currently rendered different than the + * type of the object before it in the display list? I.e. it's a 'new' type. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#newType + * @type {boolean} + * @since 3.19.0 + */ + this.newType = false; + + /** + * Does the `type` of the next Game Object in the display list match that + * of the object being currently rendered? + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#nextTypeMatch + * @type {boolean} + * @since 3.19.0 + */ + this.nextTypeMatch = false; + this.init(this.config); }, @@ -110688,6 +112524,29 @@ var WebGLRenderer = new Class({ this.gl = gl; + var _this = this; + + this.contextLostHandler = function (event) + { + _this.contextLost = true; + + _this.game.events.emit(GameEvents.CONTEXT_LOST, _this); + + event.preventDefault(); + }; + + this.contextRestoredHandler = function () + { + _this.contextLost = false; + + _this.init(_this.config); + + _this.game.events.emit(GameEvents.CONTEXT_RESTORED, _this); + }; + + canvas.addEventListener('webglcontextlost', this.contextLostHandler, false); + canvas.addEventListener('webglcontextrestored', this.contextRestoredHandler, false); + // Set it back into the Game, so developers can access it from there too game.context = gl; @@ -110886,42 +112745,6 @@ var WebGLRenderer = new Class({ return this; }, - /** - * Adds a callback to be invoked when the WebGL context has been restored by the browser. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextRestored - * @since 3.0.0 - * - * @param {WebGLContextCallback} callback - The callback to be invoked on context restoration. - * @param {object} target - The context of the callback. - * - * @return {this} This WebGLRenderer instance. - */ - onContextRestored: function (callback, target) - { - this.restoredContextCallbacks.push([ callback, target ]); - - return this; - }, - - /** - * Adds a callback to be invoked when the WebGL context has been lost by the browser. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextLost - * @since 3.0.0 - * - * @param {WebGLContextCallback} callback - The callback to be invoked on context loss. - * @param {object} target - The context of the callback. - * - * @return {this} This WebGLRenderer instance. - */ - onContextLost: function (callback, target) - { - this.lostContextCallbacks.push([ callback, target ]); - - return this; - }, - /** * Checks if a WebGL extension is supported * @@ -111094,6 +112917,8 @@ var WebGLRenderer = new Class({ */ setScissor: function (x, y, width, height, drawingBufferHeight) { + if (drawingBufferHeight === undefined) { drawingBufferHeight = this.drawingBufferHeight; } + var gl = this.gl; var current = this.currentScissor; @@ -111306,12 +113131,14 @@ var WebGLRenderer = new Class({ /** * Creates a new custom blend mode for the renderer. + * + * See https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Blending_modes * * @method Phaser.Renderer.WebGL.WebGLRenderer#addBlendMode * @since 3.0.0 * - * @param {function} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. - * @param {function} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. + * @param {GLenum[]} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. + * @param {GLenum} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. * * @return {integer} The index of the new blend mode, used for referencing it in the future. */ @@ -112148,6 +113975,20 @@ var WebGLRenderer = new Class({ // Apply scissor for cam region + render background color, if not transparent this.preRenderCamera(camera); + // Nothing to render, so bail out + if (childCount === 0) + { + this.setBlendMode(CONST.BlendModes.NORMAL); + + // Applies camera effects and pops the scissor, if set + this.postRenderCamera(camera); + + return; + } + + // Reset the current type + this.currentType = ''; + var current = this.currentMask; for (var i = 0; i < childCount; i++) @@ -112179,7 +114020,19 @@ var WebGLRenderer = new Class({ mask.preRenderWebGL(this, child, camera); } + var type = child.type; + + if (type !== this.currentType) + { + this.newType = true; + this.currentType = type; + } + + this.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === this.currentType) : false; + child.renderWebGL(this, child, interpolationPercentage, camera); + + this.newType = false; } current = this.currentMask; @@ -112326,6 +114179,65 @@ var WebGLRenderer = new Class({ return this; }, + /** + * Takes a snapshot of the given area of the given frame buffer. + * + * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotFramebuffer + * @since 3.19.0 + * + * @param {WebGLFramebuffer} framebuffer - The framebuffer to grab from. + * @param {integer} bufferWidth - The width of the framebuffer. + * @param {integer} bufferHeight - The height of the framebuffer. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? + * @param {integer} [x=0] - The x coordinate to grab from. + * @param {integer} [y=0] - The y coordinate to grab from. + * @param {integer} [width=bufferWidth] - The width of the area to grab. + * @param {integer} [height=bufferHeight] - The height of the area to grab. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This WebGL Renderer. + */ + snapshotFramebuffer: function (framebuffer, bufferWidth, bufferHeight, callback, getPixel, x, y, width, height, type, encoderOptions) + { + if (getPixel === undefined) { getPixel = false; } + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = bufferWidth; } + if (height === undefined) { height = bufferHeight; } + + var currentFramebuffer = this.currentFramebuffer; + + this.snapshotArea(x, y, width, height, callback, type, encoderOptions); + + var state = this.snapshotState; + + state.getPixel = getPixel; + + state.isFramebuffer = true; + state.bufferWidth = bufferWidth; + state.bufferHeight = bufferHeight; + + this.setFramebuffer(framebuffer); + + WebGLSnapshot(this.canvas, state); + + this.setFramebuffer(currentFramebuffer); + + state.callback = null; + state.isFramebuffer = false; + + return this; + }, + /** * Creates a WebGL Texture based on the given canvas element. * @@ -112766,6 +114678,14 @@ var WebGLRenderer = new Class({ destroy: function () { // Clear-up anything that should be cleared :) + + for (var i = 0; i < this.nativeTextures.length; i++) + { + this.gl.deleteTexture(this.nativeTextures[i]); + } + + this.nativeTextures = []; + for (var key in this.pipelines) { this.pipelines[key].destroy(); @@ -112773,21 +114693,23 @@ var WebGLRenderer = new Class({ delete this.pipelines[key]; } - for (var index = 0; index < this.nativeTextures.length; index++) - { - this.deleteTexture(this.nativeTextures[index]); + this.defaultCamera.destroy(); - delete this.nativeTextures[index]; - } + this.currentMask = null; + this.currentCameraMask = null; - delete this.gl; - delete this.game; + this.canvas.removeEventListener('webglcontextlost', this.contextLostHandler, false); + this.canvas.removeEventListener('webglcontextrestored', this.contextRestoredHandler, false); - this.maskStack.length = 0; + this.game = null; + this.gl = null; + this.canvas = null; + + this.maskStack = []; this.contextLost = true; + this.extensions = {}; - this.nativeTextures.length = 0; } }); @@ -112796,7 +114718,7 @@ module.exports = WebGLRenderer; /***/ }), -/* 484 */ +/* 486 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -112805,7 +114727,7 @@ module.exports = WebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); +var CanvasPool = __webpack_require__(25); var Color = __webpack_require__(33); var GetFastValue = __webpack_require__(2); @@ -112830,23 +114752,34 @@ var WebGLSnapshot = function (sourceCanvas, config) var encoderOptions = GetFastValue(config, 'encoder', 0.92); var x = GetFastValue(config, 'x', 0); var y = GetFastValue(config, 'y', 0); - var width = GetFastValue(config, 'width', gl.drawingBufferWidth); - var height = GetFastValue(config, 'height', gl.drawingBufferHeight); + var getPixel = GetFastValue(config, 'getPixel', false); + var isFramebuffer = GetFastValue(config, 'isFramebuffer', false); + + var bufferWidth = (isFramebuffer) ? GetFastValue(config, 'bufferWidth', 1) : gl.drawingBufferWidth; + var bufferHeight = (isFramebuffer) ? GetFastValue(config, 'bufferHeight', 1) : gl.drawingBufferHeight; + if (getPixel) { var pixel = new Uint8Array(4); - gl.readPixels(x, gl.drawingBufferHeight - y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); + var destY = (isFramebuffer) ? y : bufferHeight - y; + + gl.readPixels(x, destY, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3] / 255)); } else { - var pixels = new Uint8Array(width * height * 4); + var width = GetFastValue(config, 'width', bufferWidth); + var height = GetFastValue(config, 'height', bufferHeight); - gl.readPixels(x, gl.drawingBufferHeight - y - height, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + var total = width * height * 4; + + var pixels = new Uint8Array(total); + + gl.readPixels(x, bufferHeight - y - height, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); var canvas = CanvasPool.createWebGL(this, width, height); var ctx = canvas.getContext('2d'); @@ -112854,13 +114787,13 @@ var WebGLSnapshot = function (sourceCanvas, config) var imageData = ctx.getImageData(0, 0, width, height); var data = imageData.data; - + for (var py = 0; py < height; py++) { for (var px = 0; px < width; px++) { var sourceIndex = ((height - py) * width + px) * 4; - var destIndex = (py * width + px) * 4; + var destIndex = (isFramebuffer) ? total - ((py * width + (width - px)) * 4) : (py * width + px) * 4; data[destIndex + 0] = pixels[sourceIndex + 0]; data[destIndex + 1] = pixels[sourceIndex + 1]; @@ -112868,7 +114801,7 @@ var WebGLSnapshot = function (sourceCanvas, config) data[destIndex + 3] = pixels[sourceIndex + 3]; } } - + ctx.putImageData(imageData, 0, 0); var image = new Image(); @@ -112895,7 +114828,7 @@ module.exports = WebGLSnapshot; /***/ }), -/* 485 */ +/* 487 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -112906,9 +114839,9 @@ module.exports = WebGLSnapshot; */ var Class = __webpack_require__(0); -var ShaderSourceFS = __webpack_require__(732); -var ShaderSourceVS = __webpack_require__(733); -var WebGLPipeline = __webpack_require__(225); +var ShaderSourceFS = __webpack_require__(737); +var ShaderSourceVS = __webpack_require__(738); +var WebGLPipeline = __webpack_require__(228); /** * @classdesc @@ -113158,7 +115091,7 @@ module.exports = BitmapMaskPipeline; /***/ }), -/* 486 */ +/* 488 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113169,8 +115102,8 @@ module.exports = BitmapMaskPipeline; */ var Class = __webpack_require__(0); -var ShaderSourceFS = __webpack_require__(734); -var TextureTintPipeline = __webpack_require__(226); +var ShaderSourceFS = __webpack_require__(739); +var TextureTintPipeline = __webpack_require__(229); var LIGHT_COUNT = 10; @@ -113660,7 +115593,7 @@ module.exports = ForwardDiffuseLightPipeline; /***/ }), -/* 487 */ +/* 489 */ /***/ (function(module, exports) { /** @@ -114410,7 +116343,7 @@ module.exports = ModelViewProjection; /***/ }), -/* 488 */ +/* 490 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114425,24 +116358,24 @@ module.exports = ModelViewProjection; module.exports = { - Bounce: __webpack_require__(1365), - Collision: __webpack_require__(1366), - Force: __webpack_require__(1367), - Friction: __webpack_require__(1368), - Gravity: __webpack_require__(1369), - Mass: __webpack_require__(1370), - Static: __webpack_require__(1371), - Sensor: __webpack_require__(1372), - SetBody: __webpack_require__(1373), - Sleep: __webpack_require__(1375), - Transform: __webpack_require__(1388), - Velocity: __webpack_require__(1389) + Bounce: __webpack_require__(1378), + Collision: __webpack_require__(1379), + Force: __webpack_require__(1380), + Friction: __webpack_require__(1381), + Gravity: __webpack_require__(1382), + Mass: __webpack_require__(1383), + Static: __webpack_require__(1384), + Sensor: __webpack_require__(1385), + SetBody: __webpack_require__(1386), + Sleep: __webpack_require__(1387), + Transform: __webpack_require__(1400), + Velocity: __webpack_require__(1401) }; /***/ }), -/* 489 */ +/* 491 */ /***/ (function(module, exports) { /** @@ -114568,21 +116501,21 @@ module.exports = Pair; /***/ }), -/* 490 */ +/* 492 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(491); -__webpack_require__(492); __webpack_require__(493); __webpack_require__(494); __webpack_require__(495); __webpack_require__(496); __webpack_require__(497); __webpack_require__(498); +__webpack_require__(499); +__webpack_require__(500); /***/ }), -/* 491 */ +/* 493 */ /***/ (function(module, exports) { /** @@ -114622,7 +116555,7 @@ if (!Array.prototype.forEach) /***/ }), -/* 492 */ +/* 494 */ /***/ (function(module, exports) { /** @@ -114638,7 +116571,7 @@ if (!Array.isArray) /***/ }), -/* 493 */ +/* 495 */ /***/ (function(module, exports) { /* Copyright 2013 Chris Wilson @@ -114825,7 +116758,7 @@ BiquadFilterNode.type and OscillatorNode.type. /***/ }), -/* 494 */ +/* 496 */ /***/ (function(module, exports) { /** @@ -114840,7 +116773,7 @@ if (!window.console) /***/ }), -/* 495 */ +/* 497 */ /***/ (function(module, exports) { // ES6 Math.trunc - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc @@ -114852,7 +116785,7 @@ if (!Math.trunc) { /***/ }), -/* 496 */ +/* 498 */ /***/ (function(module, exports) { /** @@ -114889,7 +116822,7 @@ if (!Math.trunc) { /***/ }), -/* 497 */ +/* 499 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {// References: @@ -114959,10 +116892,10 @@ if (!global.cancelAnimationFrame) { }; } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(222))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(225))) /***/ }), -/* 498 */ +/* 500 */ /***/ (function(module, exports) { /** @@ -115015,7 +116948,7 @@ if (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'o /***/ }), -/* 499 */ +/* 501 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115056,7 +116989,7 @@ module.exports = Angle; /***/ }), -/* 500 */ +/* 502 */ /***/ (function(module, exports) { /** @@ -115095,7 +117028,7 @@ module.exports = Call; /***/ }), -/* 501 */ +/* 503 */ /***/ (function(module, exports) { /** @@ -115153,7 +117086,7 @@ module.exports = GetFirst; /***/ }), -/* 502 */ +/* 504 */ /***/ (function(module, exports) { /** @@ -115211,7 +117144,7 @@ module.exports = GetLast; /***/ }), -/* 503 */ +/* 505 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115220,11 +117153,11 @@ module.exports = GetLast; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AlignIn = __webpack_require__(230); -var CONST = __webpack_require__(143); +var AlignIn = __webpack_require__(233); +var CONST = __webpack_require__(144); var GetFastValue = __webpack_require__(2); var NOOP = __webpack_require__(1); -var Zone = __webpack_require__(106); +var Zone = __webpack_require__(107); var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1); @@ -115321,7 +117254,7 @@ module.exports = GridAlign; /***/ }), -/* 504 */ +/* 506 */ /***/ (function(module, exports) { /** @@ -115348,7 +117281,7 @@ module.exports = 'add'; /***/ }), -/* 505 */ +/* 507 */ /***/ (function(module, exports) { /** @@ -115376,7 +117309,7 @@ module.exports = 'complete'; /***/ }), -/* 506 */ +/* 508 */ /***/ (function(module, exports) { /** @@ -115403,7 +117336,7 @@ module.exports = 'repeat'; /***/ }), -/* 507 */ +/* 509 */ /***/ (function(module, exports) { /** @@ -115431,7 +117364,7 @@ module.exports = 'restart'; /***/ }), -/* 508 */ +/* 510 */ /***/ (function(module, exports) { /** @@ -115459,7 +117392,7 @@ module.exports = 'start'; /***/ }), -/* 509 */ +/* 511 */ /***/ (function(module, exports) { /** @@ -115483,7 +117416,7 @@ module.exports = 'pauseall'; /***/ }), -/* 510 */ +/* 512 */ /***/ (function(module, exports) { /** @@ -115507,7 +117440,7 @@ module.exports = 'remove'; /***/ }), -/* 511 */ +/* 513 */ /***/ (function(module, exports) { /** @@ -115530,7 +117463,7 @@ module.exports = 'resumeall'; /***/ }), -/* 512 */ +/* 514 */ /***/ (function(module, exports) { /** @@ -115559,7 +117492,7 @@ module.exports = 'animationcomplete'; /***/ }), -/* 513 */ +/* 515 */ /***/ (function(module, exports) { /** @@ -115587,7 +117520,7 @@ module.exports = 'animationcomplete-'; /***/ }), -/* 514 */ +/* 516 */ /***/ (function(module, exports) { /** @@ -115616,7 +117549,7 @@ module.exports = 'animationrepeat-'; /***/ }), -/* 515 */ +/* 517 */ /***/ (function(module, exports) { /** @@ -115644,7 +117577,7 @@ module.exports = 'animationrestart-'; /***/ }), -/* 516 */ +/* 518 */ /***/ (function(module, exports) { /** @@ -115672,7 +117605,7 @@ module.exports = 'animationstart-'; /***/ }), -/* 517 */ +/* 519 */ /***/ (function(module, exports) { /** @@ -115701,7 +117634,7 @@ module.exports = 'animationupdate-'; /***/ }), -/* 518 */ +/* 520 */ /***/ (function(module, exports) { /** @@ -115731,7 +117664,7 @@ module.exports = 'animationrepeat'; /***/ }), -/* 519 */ +/* 521 */ /***/ (function(module, exports) { /** @@ -115760,7 +117693,7 @@ module.exports = 'animationrestart'; /***/ }), -/* 520 */ +/* 522 */ /***/ (function(module, exports) { /** @@ -115789,7 +117722,7 @@ module.exports = 'animationstart'; /***/ }), -/* 521 */ +/* 523 */ /***/ (function(module, exports) { /** @@ -115819,7 +117752,7 @@ module.exports = 'animationupdate'; /***/ }), -/* 522 */ +/* 524 */ /***/ (function(module, exports) { /** @@ -115968,7 +117901,7 @@ module.exports = ComputedSize; /***/ }), -/* 523 */ +/* 525 */ /***/ (function(module, exports) { /** @@ -116093,7 +118026,7 @@ module.exports = Crop; /***/ }), -/* 524 */ +/* 526 */ /***/ (function(module, exports) { /** @@ -116257,7 +118190,7 @@ module.exports = Flip; /***/ }), -/* 525 */ +/* 527 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116266,9 +118199,9 @@ module.exports = Flip; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); -var RotateAround = __webpack_require__(251); -var Vector2 = __webpack_require__(4); +var Rectangle = __webpack_require__(11); +var RotateAround = __webpack_require__(254); +var Vector2 = __webpack_require__(3); /** * Provides methods used for obtaining the bounds of a Game Object. @@ -116616,7 +118549,383 @@ module.exports = GetBounds; /***/ }), -/* 526 */ +/* 528 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Blur Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps + * tab, or if they simply remove focus from the browser to another app. + * + * @event Phaser.Core.Events#BLUR + * @since 3.0.0 + */ +module.exports = 'blur'; + + +/***/ }), +/* 529 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Boot Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. + * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. + * + * @event Phaser.Core.Events#BOOT + * @since 3.0.0 + */ +module.exports = 'boot'; + + +/***/ }), +/* 530 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Context Lost Event. + * + * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Lost event from the browser. + * + * The partner event is `CONTEXT_RESTORED`. + * + * @event Phaser.Core.Events#CONTEXT_LOST + * @since 3.19.0 + */ +module.exports = 'contextlost'; + + +/***/ }), +/* 531 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Context Restored Event. + * + * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Restored event from the browser. + * + * The partner event is `CONTEXT_LOST`. + * + * @event Phaser.Core.Events#CONTEXT_RESTORED + * @since 3.19.0 + */ +module.exports = 'contextrestored'; + + +/***/ }), +/* 532 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Destroy Event. + * + * This event is dispatched when the game instance has been told to destroy itself. + * Lots of internal systems listen to this event in order to clear themselves out. + * Custom plugins and game code should also do the same. + * + * @event Phaser.Core.Events#DESTROY + * @since 3.0.0 + */ +module.exports = 'destroy'; + + +/***/ }), +/* 533 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Focus Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. + * + * @event Phaser.Core.Events#FOCUS + * @since 3.0.0 + */ +module.exports = 'focus'; + + +/***/ }), +/* 534 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Hidden Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted. + * + * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which + * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something + * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) + * + * @event Phaser.Core.Events#HIDDEN + * @since 3.0.0 + */ +module.exports = 'hidden'; + + +/***/ }), +/* 535 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pause Event. + * + * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. + * + * @event Phaser.Core.Events#PAUSE + * @since 3.0.0 + */ +module.exports = 'pause'; + + +/***/ }), +/* 536 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Post-Render Event. + * + * This event is dispatched right at the end of the render process. + * + * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. + * Use it for any last minute post-processing before the next game step begins. + * + * @event Phaser.Core.Events#POST_RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. + */ +module.exports = 'postrender'; + + +/***/ }), +/* 537 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Post-Step Event. + * + * This event is dispatched after the Scene Manager has updated. + * Hook into it from plugins or systems that need to do things before the render starts. + * + * @event Phaser.Core.Events#POST_STEP + * @since 3.0.0 + * + * @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 = 'poststep'; + + +/***/ }), +/* 538 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pre-Render Event. + * + * This event is dispatched immediately before any of the Scenes have started to render. + * + * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. + * + * @event Phaser.Core.Events#PRE_RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. + */ +module.exports = 'prerender'; + + +/***/ }), +/* 539 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pre-Step Event. + * + * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. + * Hook into it from plugins or systems that need to update before the Scene Manager does. + * + * @event Phaser.Core.Events#PRE_STEP + * @since 3.0.0 + * + * @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 = 'prestep'; + + +/***/ }), +/* 540 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Ready Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, + * and all local systems are now able to start. + * + * @event Phaser.Core.Events#READY + * @since 3.0.0 + */ +module.exports = 'ready'; + + +/***/ }), +/* 541 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Resume Event. + * + * This event is dispatched when the game loop leaves a paused state and resumes running. + * + * @event Phaser.Core.Events#RESUME + * @since 3.0.0 + */ +module.exports = 'resume'; + + +/***/ }), +/* 542 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Step Event. + * + * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. + * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. + * + * @event Phaser.Core.Events#STEP + * @since 3.0.0 + * + * @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 = 'step'; + + +/***/ }), +/* 543 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Visible Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a visible state, previously having been hidden. + * + * Only browsers that support the Visibility API will cause this event to be emitted. + * + * @event Phaser.Core.Events#VISIBLE + * @since 3.0.0 + */ +module.exports = 'visible'; + + +/***/ }), +/* 544 */ /***/ (function(module, exports) { /** @@ -116807,8 +119116,8 @@ var Origin = { */ updateDisplayOrigin: function () { - this._displayOriginX = Math.round(this.originX * this.width); - this._displayOriginY = Math.round(this.originY * this.height); + this._displayOriginX = this.originX * this.width; + this._displayOriginY = this.originY * this.height; return this; } @@ -116819,7 +119128,7 @@ module.exports = Origin; /***/ }), -/* 527 */ +/* 545 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116829,10 +119138,10 @@ module.exports = Origin; */ var DegToRad = __webpack_require__(35); -var GetBoolean = __webpack_require__(87); -var GetValue = __webpack_require__(6); -var TWEEN_CONST = __webpack_require__(88); -var Vector2 = __webpack_require__(4); +var GetBoolean = __webpack_require__(88); +var GetValue = __webpack_require__(5); +var TWEEN_CONST = __webpack_require__(89); +var Vector2 = __webpack_require__(3); /** * Provides methods used for managing a Game Object following a Path. @@ -117216,7 +119525,7 @@ module.exports = PathFollower; /***/ }), -/* 528 */ +/* 546 */ /***/ (function(module, exports) { /** @@ -117403,7 +119712,7 @@ module.exports = Size; /***/ }), -/* 529 */ +/* 547 */ /***/ (function(module, exports) { /** @@ -117533,7 +119842,7 @@ module.exports = Texture; /***/ }), -/* 530 */ +/* 548 */ /***/ (function(module, exports) { /** @@ -117741,7 +120050,7 @@ module.exports = TextureCrop; /***/ }), -/* 531 */ +/* 549 */ /***/ (function(module, exports) { /** @@ -118042,6 +120351,7 @@ var Tint = { /** * 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 {integer} @@ -118080,7 +120390,7 @@ module.exports = Tint; /***/ }), -/* 532 */ +/* 550 */ /***/ (function(module, exports) { /** @@ -118112,7 +120422,7 @@ module.exports = 'changedata'; /***/ }), -/* 533 */ +/* 551 */ /***/ (function(module, exports) { /** @@ -118143,7 +120453,7 @@ module.exports = 'changedata-'; /***/ }), -/* 534 */ +/* 552 */ /***/ (function(module, exports) { /** @@ -118171,7 +120481,7 @@ module.exports = 'removedata'; /***/ }), -/* 535 */ +/* 553 */ /***/ (function(module, exports) { /** @@ -118199,7 +120509,7 @@ module.exports = 'setdata'; /***/ }), -/* 536 */ +/* 554 */ /***/ (function(module, exports) { /** @@ -118224,7 +120534,7 @@ module.exports = 'destroy'; /***/ }), -/* 537 */ +/* 555 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118265,7 +120575,7 @@ module.exports = IncAlpha; /***/ }), -/* 538 */ +/* 556 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118306,7 +120616,7 @@ module.exports = IncX; /***/ }), -/* 539 */ +/* 557 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118353,7 +120663,7 @@ module.exports = IncXY; /***/ }), -/* 540 */ +/* 558 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118394,7 +120704,7 @@ module.exports = IncY; /***/ }), -/* 541 */ +/* 559 */ /***/ (function(module, exports) { /** @@ -118443,7 +120753,7 @@ module.exports = PlaceOnCircle; /***/ }), -/* 542 */ +/* 560 */ /***/ (function(module, exports) { /** @@ -118495,7 +120805,7 @@ module.exports = PlaceOnEllipse; /***/ }), -/* 543 */ +/* 561 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118504,7 +120814,7 @@ module.exports = PlaceOnEllipse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoints = __webpack_require__(148); +var GetPoints = __webpack_require__(149); /** * Positions an array of Game Objects on evenly spaced points of a Line. @@ -118539,7 +120849,7 @@ module.exports = PlaceOnLine; /***/ }), -/* 544 */ +/* 562 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118548,9 +120858,9 @@ module.exports = PlaceOnLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MarchingAnts = __webpack_require__(260); -var RotateLeft = __webpack_require__(261); -var RotateRight = __webpack_require__(262); +var MarchingAnts = __webpack_require__(263); +var RotateLeft = __webpack_require__(264); +var RotateRight = __webpack_require__(265); /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. @@ -118597,7 +120907,7 @@ module.exports = PlaceOnRectangle; /***/ }), -/* 545 */ +/* 563 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118606,7 +120916,7 @@ module.exports = PlaceOnRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BresenhamPoints = __webpack_require__(263); +var BresenhamPoints = __webpack_require__(266); /** * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. @@ -118658,7 +120968,7 @@ module.exports = PlaceOnTriangle; /***/ }), -/* 546 */ +/* 564 */ /***/ (function(module, exports) { /** @@ -118695,7 +121005,7 @@ module.exports = PlayAnimation; /***/ }), -/* 547 */ +/* 565 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118704,7 +121014,7 @@ module.exports = PlayAnimation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(145); +var Random = __webpack_require__(146); /** * Takes an array of Game Objects and positions them at random locations within the Circle. @@ -118735,7 +121045,7 @@ module.exports = RandomCircle; /***/ }), -/* 548 */ +/* 566 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118744,7 +121054,7 @@ module.exports = RandomCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(152); +var Random = __webpack_require__(153); /** * Takes an array of Game Objects and positions them at random locations within the Ellipse. @@ -118775,7 +121085,7 @@ module.exports = RandomEllipse; /***/ }), -/* 549 */ +/* 567 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118784,7 +121094,7 @@ module.exports = RandomEllipse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(149); +var Random = __webpack_require__(150); /** * Takes an array of Game Objects and positions them at random locations on the Line. @@ -118815,7 +121125,7 @@ module.exports = RandomLine; /***/ }), -/* 550 */ +/* 568 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118824,7 +121134,7 @@ module.exports = RandomLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(150); +var Random = __webpack_require__(151); /** * Takes an array of Game Objects and positions them at random locations within the Rectangle. @@ -118853,7 +121163,7 @@ module.exports = RandomRectangle; /***/ }), -/* 551 */ +/* 569 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118862,7 +121172,7 @@ module.exports = RandomRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(153); +var Random = __webpack_require__(154); /** * Takes an array of Game Objects and positions them at random locations within the Triangle. @@ -118893,7 +121203,7 @@ module.exports = RandomTriangle; /***/ }), -/* 552 */ +/* 570 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118934,7 +121244,7 @@ module.exports = Rotate; /***/ }), -/* 553 */ +/* 571 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118943,8 +121253,8 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundDistance = __webpack_require__(154); -var DistanceBetween = __webpack_require__(57); +var RotateAroundDistance = __webpack_require__(155); +var DistanceBetween = __webpack_require__(58); /** * Rotates each item around the given point by the given angle. @@ -118980,7 +121290,7 @@ module.exports = RotateAround; /***/ }), -/* 554 */ +/* 572 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118989,7 +121299,7 @@ module.exports = RotateAround; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathRotateAroundDistance = __webpack_require__(154); +var MathRotateAroundDistance = __webpack_require__(155); /** * Rotates an array of Game Objects around a point by the given angle and distance. @@ -119029,7 +121339,7 @@ module.exports = RotateAroundDistance; /***/ }), -/* 555 */ +/* 573 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119070,7 +121380,7 @@ module.exports = ScaleX; /***/ }), -/* 556 */ +/* 574 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119117,7 +121427,7 @@ module.exports = ScaleXY; /***/ }), -/* 557 */ +/* 575 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119158,7 +121468,7 @@ module.exports = ScaleY; /***/ }), -/* 558 */ +/* 576 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119199,7 +121509,7 @@ module.exports = SetAlpha; /***/ }), -/* 559 */ +/* 577 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119239,7 +121549,7 @@ module.exports = SetBlendMode; /***/ }), -/* 560 */ +/* 578 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119280,7 +121590,7 @@ module.exports = SetDepth; /***/ }), -/* 561 */ +/* 579 */ /***/ (function(module, exports) { /** @@ -119319,7 +121629,7 @@ module.exports = SetHitArea; /***/ }), -/* 562 */ +/* 580 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119366,7 +121676,7 @@ module.exports = SetOrigin; /***/ }), -/* 563 */ +/* 581 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119407,7 +121717,7 @@ module.exports = SetRotation; /***/ }), -/* 564 */ +/* 582 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119454,7 +121764,7 @@ module.exports = SetScale; /***/ }), -/* 565 */ +/* 583 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119495,7 +121805,7 @@ module.exports = SetScaleX; /***/ }), -/* 566 */ +/* 584 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119536,7 +121846,7 @@ module.exports = SetScaleY; /***/ }), -/* 567 */ +/* 585 */ /***/ (function(module, exports) { /** @@ -119575,7 +121885,7 @@ module.exports = SetTint; /***/ }), -/* 568 */ +/* 586 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119613,7 +121923,7 @@ module.exports = SetVisible; /***/ }), -/* 569 */ +/* 587 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119654,7 +121964,7 @@ module.exports = SetX; /***/ }), -/* 570 */ +/* 588 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119701,7 +122011,7 @@ module.exports = SetXY; /***/ }), -/* 571 */ +/* 589 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119742,7 +122052,7 @@ module.exports = SetY; /***/ }), -/* 572 */ +/* 590 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119751,7 +122061,7 @@ module.exports = SetY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector2 = __webpack_require__(4); +var Vector2 = __webpack_require__(3); /** * Iterate through the items array changing the position of each element to be that of the element that came before @@ -119872,7 +122182,7 @@ module.exports = ShiftPosition; /***/ }), -/* 573 */ +/* 591 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119881,7 +122191,7 @@ module.exports = ShiftPosition; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayShuffle = __webpack_require__(111); +var ArrayShuffle = __webpack_require__(112); /** * Shuffles the array in place. The shuffled array is both modified and returned. @@ -119905,7 +122215,7 @@ module.exports = Shuffle; /***/ }), -/* 574 */ +/* 592 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119914,7 +122224,7 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathSmootherStep = __webpack_require__(155); +var MathSmootherStep = __webpack_require__(156); /** * Smootherstep is a sigmoid-like interpolation and clamping function. @@ -119963,7 +122273,7 @@ module.exports = SmootherStep; /***/ }), -/* 575 */ +/* 593 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119972,7 +122282,7 @@ module.exports = SmootherStep; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathSmoothStep = __webpack_require__(156); +var MathSmoothStep = __webpack_require__(157); /** * Smoothstep is a sigmoid-like interpolation and clamping function. @@ -120021,7 +122331,7 @@ module.exports = SmoothStep; /***/ }), -/* 576 */ +/* 594 */ /***/ (function(module, exports) { /** @@ -120084,7 +122394,7 @@ module.exports = Spread; /***/ }), -/* 577 */ +/* 595 */ /***/ (function(module, exports) { /** @@ -120120,7 +122430,7 @@ module.exports = ToggleVisible; /***/ }), -/* 578 */ +/* 596 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -120130,7 +122440,7 @@ module.exports = ToggleVisible; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Wrap = __webpack_require__(56); +var Wrap = __webpack_require__(57); /** * Wrap each item's coordinates within a rectangle's area. @@ -120169,7 +122479,7 @@ module.exports = WrapInRectangle; /***/ }), -/* 579 */ +/* 597 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -120184,346 +122494,16 @@ module.exports = WrapInRectangle; module.exports = { - Animation: __webpack_require__(146), - AnimationFrame: __webpack_require__(246), - AnimationManager: __webpack_require__(264), - Events: __webpack_require__(107) + Animation: __webpack_require__(147), + AnimationFrame: __webpack_require__(249), + AnimationManager: __webpack_require__(267), + Events: __webpack_require__(108) }; /***/ }), -/* 580 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Blur Event. - * - * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded - * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps - * tab, or if they simply remove focus from the browser to another app. - * - * @event Phaser.Core.Events#BLUR - * @since 3.0.0 - */ -module.exports = 'blur'; - - -/***/ }), -/* 581 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Boot Event. - * - * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. - * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. - * - * @event Phaser.Core.Events#BOOT - * @since 3.0.0 - */ -module.exports = 'boot'; - - -/***/ }), -/* 582 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Destroy Event. - * - * This event is dispatched when the game instance has been told to destroy itself. - * Lots of internal systems listen to this event in order to clear themselves out. - * Custom plugins and game code should also do the same. - * - * @event Phaser.Core.Events#DESTROY - * @since 3.0.0 - */ -module.exports = 'destroy'; - - -/***/ }), -/* 583 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Focus Event. - * - * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded - * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. - * - * @event Phaser.Core.Events#FOCUS - * @since 3.0.0 - */ -module.exports = 'focus'; - - -/***/ }), -/* 584 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Hidden Event. - * - * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded - * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted. - * - * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which - * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something - * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) - * - * @event Phaser.Core.Events#HIDDEN - * @since 3.0.0 - */ -module.exports = 'hidden'; - - -/***/ }), -/* 585 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Pause Event. - * - * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. - * - * @event Phaser.Core.Events#PAUSE - * @since 3.0.0 - */ -module.exports = 'pause'; - - -/***/ }), -/* 586 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Post-Render Event. - * - * This event is dispatched right at the end of the render process. - * - * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. - * Use it for any last minute post-processing before the next game step begins. - * - * @event Phaser.Core.Events#POST_RENDER - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. - */ -module.exports = 'postrender'; - - -/***/ }), -/* 587 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Post-Step Event. - * - * This event is dispatched after the Scene Manager has updated. - * Hook into it from plugins or systems that need to do things before the render starts. - * - * @event Phaser.Core.Events#POST_STEP - * @since 3.0.0 - * - * @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 = 'poststep'; - - -/***/ }), -/* 588 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Pre-Render Event. - * - * This event is dispatched immediately before any of the Scenes have started to render. - * - * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. - * - * @event Phaser.Core.Events#PRE_RENDER - * @since 3.0.0 - * - * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. - */ -module.exports = 'prerender'; - - -/***/ }), -/* 589 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Pre-Step Event. - * - * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. - * Hook into it from plugins or systems that need to update before the Scene Manager does. - * - * @event Phaser.Core.Events#PRE_STEP - * @since 3.0.0 - * - * @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 = 'prestep'; - - -/***/ }), -/* 590 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Ready Event. - * - * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, - * and all local systems are now able to start. - * - * @event Phaser.Core.Events#READY - * @since 3.0.0 - */ -module.exports = 'ready'; - - -/***/ }), -/* 591 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Resume Event. - * - * This event is dispatched when the game loop leaves a paused state and resumes running. - * - * @event Phaser.Core.Events#RESUME - * @since 3.0.0 - */ -module.exports = 'resume'; - - -/***/ }), -/* 592 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Step Event. - * - * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. - * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. - * - * @event Phaser.Core.Events#STEP - * @since 3.0.0 - * - * @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 = 'step'; - - -/***/ }), -/* 593 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Game Visible Event. - * - * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded - * enters a visible state, previously having been hidden. - * - * Only browsers that support the Visibility API will cause this event to be emitted. - * - * @event Phaser.Core.Events#VISIBLE - * @since 3.0.0 - */ -module.exports = 'visible'; - - -/***/ }), -/* 594 */ +/* 598 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -120538,15 +122518,15 @@ module.exports = 'visible'; module.exports = { - BaseCache: __webpack_require__(265), - CacheManager: __webpack_require__(267), - Events: __webpack_require__(266) + BaseCache: __webpack_require__(268), + CacheManager: __webpack_require__(270), + Events: __webpack_require__(269) }; /***/ }), -/* 595 */ +/* 599 */ /***/ (function(module, exports) { /** @@ -120571,7 +122551,7 @@ module.exports = 'add'; /***/ }), -/* 596 */ +/* 600 */ /***/ (function(module, exports) { /** @@ -120596,7 +122576,7 @@ module.exports = 'remove'; /***/ }), -/* 597 */ +/* 601 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -120615,14 +122595,14 @@ module.exports = 'remove'; module.exports = { - Controls: __webpack_require__(598), - Scene2D: __webpack_require__(601) + Controls: __webpack_require__(602), + Scene2D: __webpack_require__(605) }; /***/ }), -/* 598 */ +/* 602 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -120637,14 +122617,14 @@ module.exports = { module.exports = { - FixedKeyControl: __webpack_require__(599), - SmoothedKeyControl: __webpack_require__(600) + FixedKeyControl: __webpack_require__(603), + SmoothedKeyControl: __webpack_require__(604) }; /***/ }), -/* 599 */ +/* 603 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -120654,7 +122634,7 @@ module.exports = { */ var Class = __webpack_require__(0); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** * @classdesc @@ -120950,7 +122930,7 @@ module.exports = FixedKeyControl; /***/ }), -/* 600 */ +/* 604 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -120960,7 +122940,7 @@ module.exports = FixedKeyControl; */ var Class = __webpack_require__(0); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** * @classdesc @@ -121401,9 +123381,9 @@ var SmoothedKeyControl = new Class({ { cam.zoom += this._zoom; - if (cam.zoom < 0.1) + if (cam.zoom < 0.001) { - cam.zoom = 0.1; + cam.zoom = 0.001; } } }, @@ -121433,7 +123413,7 @@ module.exports = SmoothedKeyControl; /***/ }), -/* 601 */ +/* 605 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -121448,16 +123428,16 @@ module.exports = SmoothedKeyControl; module.exports = { - Camera: __webpack_require__(268), - CameraManager: __webpack_require__(654), - Effects: __webpack_require__(276), - Events: __webpack_require__(48) + Camera: __webpack_require__(271), + CameraManager: __webpack_require__(658), + Effects: __webpack_require__(279), + Events: __webpack_require__(49) }; /***/ }), -/* 602 */ +/* 606 */ /***/ (function(module, exports) { /** @@ -121480,7 +123460,7 @@ module.exports = 'cameradestroy'; /***/ }), -/* 603 */ +/* 607 */ /***/ (function(module, exports) { /** @@ -121506,7 +123486,7 @@ module.exports = 'camerafadeincomplete'; /***/ }), -/* 604 */ +/* 608 */ /***/ (function(module, exports) { /** @@ -121536,7 +123516,7 @@ module.exports = 'camerafadeinstart'; /***/ }), -/* 605 */ +/* 609 */ /***/ (function(module, exports) { /** @@ -121562,7 +123542,7 @@ module.exports = 'camerafadeoutcomplete'; /***/ }), -/* 606 */ +/* 610 */ /***/ (function(module, exports) { /** @@ -121592,7 +123572,7 @@ module.exports = 'camerafadeoutstart'; /***/ }), -/* 607 */ +/* 611 */ /***/ (function(module, exports) { /** @@ -121616,7 +123596,7 @@ module.exports = 'cameraflashcomplete'; /***/ }), -/* 608 */ +/* 612 */ /***/ (function(module, exports) { /** @@ -121644,7 +123624,7 @@ module.exports = 'cameraflashstart'; /***/ }), -/* 609 */ +/* 613 */ /***/ (function(module, exports) { /** @@ -121668,7 +123648,7 @@ module.exports = 'camerapancomplete'; /***/ }), -/* 610 */ +/* 614 */ /***/ (function(module, exports) { /** @@ -121695,7 +123675,7 @@ module.exports = 'camerapanstart'; /***/ }), -/* 611 */ +/* 615 */ /***/ (function(module, exports) { /** @@ -121721,7 +123701,7 @@ module.exports = 'postrender'; /***/ }), -/* 612 */ +/* 616 */ /***/ (function(module, exports) { /** @@ -121747,7 +123727,7 @@ module.exports = 'prerender'; /***/ }), -/* 613 */ +/* 617 */ /***/ (function(module, exports) { /** @@ -121771,7 +123751,7 @@ module.exports = 'camerashakecomplete'; /***/ }), -/* 614 */ +/* 618 */ /***/ (function(module, exports) { /** @@ -121797,7 +123777,7 @@ module.exports = 'camerashakestart'; /***/ }), -/* 615 */ +/* 619 */ /***/ (function(module, exports) { /** @@ -121821,7 +123801,7 @@ module.exports = 'camerazoomcomplete'; /***/ }), -/* 616 */ +/* 620 */ /***/ (function(module, exports) { /** @@ -121847,7 +123827,7 @@ module.exports = 'camerazoomstart'; /***/ }), -/* 617 */ +/* 621 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -121856,9 +123836,9 @@ module.exports = 'camerazoomstart'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(48); +var Events = __webpack_require__(49); /** * @classdesc @@ -122235,7 +124215,7 @@ module.exports = Fade; /***/ }), -/* 618 */ +/* 622 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122244,9 +124224,9 @@ module.exports = Fade; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(48); +var Events = __webpack_require__(49); /** * @classdesc @@ -122586,7 +124566,7 @@ module.exports = Flash; /***/ }), -/* 619 */ +/* 623 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122595,11 +124575,11 @@ module.exports = Flash; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var EaseMap = __webpack_require__(163); -var Events = __webpack_require__(48); -var Vector2 = __webpack_require__(4); +var EaseMap = __webpack_require__(164); +var Events = __webpack_require__(49); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -122911,7 +124891,7 @@ module.exports = Pan; /***/ }), -/* 620 */ +/* 624 */ /***/ (function(module, exports) { /** @@ -122942,7 +124922,7 @@ module.exports = In; /***/ }), -/* 621 */ +/* 625 */ /***/ (function(module, exports) { /** @@ -122973,7 +124953,7 @@ module.exports = Out; /***/ }), -/* 622 */ +/* 626 */ /***/ (function(module, exports) { /** @@ -123013,7 +124993,7 @@ module.exports = InOut; /***/ }), -/* 623 */ +/* 627 */ /***/ (function(module, exports) { /** @@ -123058,7 +125038,7 @@ module.exports = In; /***/ }), -/* 624 */ +/* 628 */ /***/ (function(module, exports) { /** @@ -123101,7 +125081,7 @@ module.exports = Out; /***/ }), -/* 625 */ +/* 629 */ /***/ (function(module, exports) { /** @@ -123165,7 +125145,7 @@ module.exports = InOut; /***/ }), -/* 626 */ +/* 630 */ /***/ (function(module, exports) { /** @@ -123193,7 +125173,7 @@ module.exports = In; /***/ }), -/* 627 */ +/* 631 */ /***/ (function(module, exports) { /** @@ -123221,7 +125201,7 @@ module.exports = Out; /***/ }), -/* 628 */ +/* 632 */ /***/ (function(module, exports) { /** @@ -123256,7 +125236,7 @@ module.exports = InOut; /***/ }), -/* 629 */ +/* 633 */ /***/ (function(module, exports) { /** @@ -123284,7 +125264,7 @@ module.exports = In; /***/ }), -/* 630 */ +/* 634 */ /***/ (function(module, exports) { /** @@ -123312,7 +125292,7 @@ module.exports = Out; /***/ }), -/* 631 */ +/* 635 */ /***/ (function(module, exports) { /** @@ -123347,7 +125327,7 @@ module.exports = InOut; /***/ }), -/* 632 */ +/* 636 */ /***/ (function(module, exports) { /** @@ -123402,7 +125382,7 @@ module.exports = In; /***/ }), -/* 633 */ +/* 637 */ /***/ (function(module, exports) { /** @@ -123457,7 +125437,7 @@ module.exports = Out; /***/ }), -/* 634 */ +/* 638 */ /***/ (function(module, exports) { /** @@ -123519,7 +125499,7 @@ module.exports = InOut; /***/ }), -/* 635 */ +/* 639 */ /***/ (function(module, exports) { /** @@ -123547,7 +125527,7 @@ module.exports = In; /***/ }), -/* 636 */ +/* 640 */ /***/ (function(module, exports) { /** @@ -123575,7 +125555,7 @@ module.exports = Out; /***/ }), -/* 637 */ +/* 641 */ /***/ (function(module, exports) { /** @@ -123610,7 +125590,7 @@ module.exports = InOut; /***/ }), -/* 638 */ +/* 642 */ /***/ (function(module, exports) { /** @@ -123638,7 +125618,7 @@ module.exports = Linear; /***/ }), -/* 639 */ +/* 643 */ /***/ (function(module, exports) { /** @@ -123666,7 +125646,7 @@ module.exports = In; /***/ }), -/* 640 */ +/* 644 */ /***/ (function(module, exports) { /** @@ -123694,7 +125674,7 @@ module.exports = Out; /***/ }), -/* 641 */ +/* 645 */ /***/ (function(module, exports) { /** @@ -123729,7 +125709,7 @@ module.exports = InOut; /***/ }), -/* 642 */ +/* 646 */ /***/ (function(module, exports) { /** @@ -123757,7 +125737,7 @@ module.exports = In; /***/ }), -/* 643 */ +/* 647 */ /***/ (function(module, exports) { /** @@ -123785,7 +125765,7 @@ module.exports = Out; /***/ }), -/* 644 */ +/* 648 */ /***/ (function(module, exports) { /** @@ -123820,7 +125800,7 @@ module.exports = InOut; /***/ }), -/* 645 */ +/* 649 */ /***/ (function(module, exports) { /** @@ -123848,7 +125828,7 @@ module.exports = In; /***/ }), -/* 646 */ +/* 650 */ /***/ (function(module, exports) { /** @@ -123876,7 +125856,7 @@ module.exports = Out; /***/ }), -/* 647 */ +/* 651 */ /***/ (function(module, exports) { /** @@ -123911,7 +125891,7 @@ module.exports = InOut; /***/ }), -/* 648 */ +/* 652 */ /***/ (function(module, exports) { /** @@ -123950,7 +125930,7 @@ module.exports = In; /***/ }), -/* 649 */ +/* 653 */ /***/ (function(module, exports) { /** @@ -123989,7 +125969,7 @@ module.exports = Out; /***/ }), -/* 650 */ +/* 654 */ /***/ (function(module, exports) { /** @@ -124028,7 +126008,7 @@ module.exports = InOut; /***/ }), -/* 651 */ +/* 655 */ /***/ (function(module, exports) { /** @@ -124070,7 +126050,7 @@ module.exports = Stepped; /***/ }), -/* 652 */ +/* 656 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124079,10 +126059,10 @@ module.exports = Stepped; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(48); -var Vector2 = __webpack_require__(4); +var Events = __webpack_require__(49); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -124224,7 +126204,7 @@ var Shake = new Class({ * @since 3.5.0 * * @param {integer} [duration=100] - The duration of the effect in milliseconds. - * @param {number} [intensity=0.05] - The intensity of the shake. + * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraShakeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -124389,7 +126369,7 @@ module.exports = Shake; /***/ }), -/* 653 */ +/* 657 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124398,10 +126378,10 @@ module.exports = Shake; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var EaseMap = __webpack_require__(163); -var Events = __webpack_require__(48); +var EaseMap = __webpack_require__(164); +var Events = __webpack_require__(49); /** * @classdesc @@ -124682,7 +126662,7 @@ module.exports = Zoom; /***/ }), -/* 654 */ +/* 658 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124691,13 +126671,13 @@ module.exports = Zoom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Camera = __webpack_require__(268); +var Camera = __webpack_require__(271); var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(18); -var RectangleContains = __webpack_require__(47); -var ScaleEvents = __webpack_require__(89); -var SceneEvents = __webpack_require__(19); +var PluginCache = __webpack_require__(19); +var RectangleContains = __webpack_require__(48); +var ScaleEvents = __webpack_require__(90); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -125430,7 +127410,7 @@ module.exports = CameraManager; /***/ }), -/* 655 */ +/* 659 */ /***/ (function(module, exports) { /** @@ -125449,7 +127429,7 @@ module.exports = 'enterfullscreen'; /***/ }), -/* 656 */ +/* 660 */ /***/ (function(module, exports) { /** @@ -125468,7 +127448,7 @@ module.exports = 'fullscreenfailed'; /***/ }), -/* 657 */ +/* 661 */ /***/ (function(module, exports) { /** @@ -125487,7 +127467,7 @@ module.exports = 'fullscreenunsupported'; /***/ }), -/* 658 */ +/* 662 */ /***/ (function(module, exports) { /** @@ -125507,7 +127487,7 @@ module.exports = 'leavefullscreen'; /***/ }), -/* 659 */ +/* 663 */ /***/ (function(module, exports) { /** @@ -125528,7 +127508,7 @@ module.exports = 'orientationchange'; /***/ }), -/* 660 */ +/* 664 */ /***/ (function(module, exports) { /** @@ -125559,7 +127539,7 @@ module.exports = 'resize'; /***/ }), -/* 661 */ +/* 665 */ /***/ (function(module, exports) { /** @@ -125584,7 +127564,7 @@ module.exports = 'boot'; /***/ }), -/* 662 */ +/* 666 */ /***/ (function(module, exports) { /** @@ -125613,7 +127593,7 @@ module.exports = 'create'; /***/ }), -/* 663 */ +/* 667 */ /***/ (function(module, exports) { /** @@ -125640,7 +127620,7 @@ module.exports = 'destroy'; /***/ }), -/* 664 */ +/* 668 */ /***/ (function(module, exports) { /** @@ -125667,7 +127647,7 @@ module.exports = 'pause'; /***/ }), -/* 665 */ +/* 669 */ /***/ (function(module, exports) { /** @@ -125704,7 +127684,7 @@ module.exports = 'postupdate'; /***/ }), -/* 666 */ +/* 670 */ /***/ (function(module, exports) { /** @@ -125741,7 +127721,7 @@ module.exports = 'preupdate'; /***/ }), -/* 667 */ +/* 671 */ /***/ (function(module, exports) { /** @@ -125769,7 +127749,7 @@ module.exports = 'ready'; /***/ }), -/* 668 */ +/* 672 */ /***/ (function(module, exports) { /** @@ -125805,7 +127785,7 @@ module.exports = 'render'; /***/ }), -/* 669 */ +/* 673 */ /***/ (function(module, exports) { /** @@ -125832,7 +127812,7 @@ module.exports = 'resume'; /***/ }), -/* 670 */ +/* 674 */ /***/ (function(module, exports) { /** @@ -125862,7 +127842,7 @@ module.exports = 'shutdown'; /***/ }), -/* 671 */ +/* 675 */ /***/ (function(module, exports) { /** @@ -125889,7 +127869,7 @@ module.exports = 'sleep'; /***/ }), -/* 672 */ +/* 676 */ /***/ (function(module, exports) { /** @@ -125914,7 +127894,7 @@ module.exports = 'start'; /***/ }), -/* 673 */ +/* 677 */ /***/ (function(module, exports) { /** @@ -125950,7 +127930,7 @@ module.exports = 'transitioncomplete'; /***/ }), -/* 674 */ +/* 678 */ /***/ (function(module, exports) { /** @@ -125987,7 +127967,7 @@ module.exports = 'transitioninit'; /***/ }), -/* 675 */ +/* 679 */ /***/ (function(module, exports) { /** @@ -126021,7 +128001,7 @@ module.exports = 'transitionout'; /***/ }), -/* 676 */ +/* 680 */ /***/ (function(module, exports) { /** @@ -126061,7 +128041,7 @@ module.exports = 'transitionstart'; /***/ }), -/* 677 */ +/* 681 */ /***/ (function(module, exports) { /** @@ -126096,7 +128076,7 @@ module.exports = 'transitionwake'; /***/ }), -/* 678 */ +/* 682 */ /***/ (function(module, exports) { /** @@ -126133,7 +128113,7 @@ module.exports = 'update'; /***/ }), -/* 679 */ +/* 683 */ /***/ (function(module, exports) { /** @@ -126160,7 +128140,7 @@ module.exports = 'wake'; /***/ }), -/* 680 */ +/* 684 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126175,18 +128155,18 @@ module.exports = 'wake'; module.exports = { - Config: __webpack_require__(289), - CreateRenderer: __webpack_require__(312), - DebugHeader: __webpack_require__(314), - Events: __webpack_require__(28), - TimeStep: __webpack_require__(315), - VisibilityHandler: __webpack_require__(317) + Config: __webpack_require__(292), + CreateRenderer: __webpack_require__(315), + DebugHeader: __webpack_require__(317), + Events: __webpack_require__(18), + TimeStep: __webpack_require__(318), + VisibilityHandler: __webpack_require__(320) }; /***/ }), -/* 681 */ +/* 685 */ /***/ (function(module, exports) { // shim for using process in browser @@ -126376,7 +128356,7 @@ process.umask = function() { return 0; }; /***/ }), -/* 682 */ +/* 686 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126385,7 +128365,7 @@ process.umask = function() { return 0; }; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Browser = __webpack_require__(116); +var Browser = __webpack_require__(117); /** * Determines the input support of the browser running this Phaser Game instance. @@ -126451,7 +128431,7 @@ module.exports = init(); /***/ }), -/* 683 */ +/* 687 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126460,7 +128440,7 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Browser = __webpack_require__(116); +var Browser = __webpack_require__(117); /** * Determines the audio playback capabilities of the device running this Phaser Game instance. @@ -126576,7 +128556,7 @@ module.exports = init(); /***/ }), -/* 684 */ +/* 688 */ /***/ (function(module, exports) { /** @@ -126661,7 +128641,7 @@ module.exports = init(); /***/ }), -/* 685 */ +/* 689 */ /***/ (function(module, exports) { /** @@ -126765,7 +128745,7 @@ module.exports = init(); /***/ }), -/* 686 */ +/* 690 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126780,23 +128760,23 @@ module.exports = init(); module.exports = { - Between: __webpack_require__(292), - BetweenPoints: __webpack_require__(687), - BetweenPointsY: __webpack_require__(688), - BetweenY: __webpack_require__(689), - CounterClockwise: __webpack_require__(690), - Normalize: __webpack_require__(293), - Reverse: __webpack_require__(691), - RotateTo: __webpack_require__(692), - ShortestBetween: __webpack_require__(693), - Wrap: __webpack_require__(223), - WrapDegrees: __webpack_require__(224) + Between: __webpack_require__(295), + BetweenPoints: __webpack_require__(691), + BetweenPointsY: __webpack_require__(692), + BetweenY: __webpack_require__(693), + CounterClockwise: __webpack_require__(694), + Normalize: __webpack_require__(296), + Reverse: __webpack_require__(695), + RotateTo: __webpack_require__(696), + ShortestBetween: __webpack_require__(697), + Wrap: __webpack_require__(226), + WrapDegrees: __webpack_require__(227) }; /***/ }), -/* 687 */ +/* 691 */ /***/ (function(module, exports) { /** @@ -126827,7 +128807,7 @@ module.exports = BetweenPoints; /***/ }), -/* 688 */ +/* 692 */ /***/ (function(module, exports) { /** @@ -126859,7 +128839,7 @@ module.exports = BetweenPointsY; /***/ }), -/* 689 */ +/* 693 */ /***/ (function(module, exports) { /** @@ -126893,7 +128873,7 @@ module.exports = BetweenY; /***/ }), -/* 690 */ +/* 694 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126902,7 +128882,7 @@ module.exports = BetweenY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(23); +var CONST = __webpack_require__(22); /** * Takes an angle in Phasers default clockwise format and converts it so that @@ -126926,6 +128906,11 @@ var CONST = __webpack_require__(23); */ var CounterClockwise = function (angle) { + if (angle > Math.PI) + { + angle -= CONST.PI2; + } + return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); }; @@ -126933,7 +128918,7 @@ module.exports = CounterClockwise; /***/ }), -/* 691 */ +/* 695 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126942,7 +128927,7 @@ module.exports = CounterClockwise; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Normalize = __webpack_require__(293); +var Normalize = __webpack_require__(296); /** * Reverse the given angle. @@ -126963,7 +128948,7 @@ module.exports = Reverse; /***/ }), -/* 692 */ +/* 696 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126972,7 +128957,7 @@ module.exports = Reverse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); +var MATH_CONST = __webpack_require__(22); /** * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. @@ -127030,7 +129015,7 @@ module.exports = RotateTo; /***/ }), -/* 693 */ +/* 697 */ /***/ (function(module, exports) { /** @@ -127079,7 +129064,7 @@ module.exports = ShortestBetween; /***/ }), -/* 694 */ +/* 698 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127094,15 +129079,15 @@ module.exports = ShortestBetween; module.exports = { - Between: __webpack_require__(57), - Power: __webpack_require__(695), - Squared: __webpack_require__(294) + Between: __webpack_require__(58), + Power: __webpack_require__(699), + Squared: __webpack_require__(297) }; /***/ }), -/* 695 */ +/* 699 */ /***/ (function(module, exports) { /** @@ -127136,7 +129121,7 @@ module.exports = DistancePower; /***/ }), -/* 696 */ +/* 700 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127151,24 +129136,24 @@ module.exports = DistancePower; module.exports = { - Back: __webpack_require__(277), - Bounce: __webpack_require__(278), - Circular: __webpack_require__(279), - Cubic: __webpack_require__(280), - Elastic: __webpack_require__(281), - Expo: __webpack_require__(282), - Linear: __webpack_require__(283), - Quadratic: __webpack_require__(284), - Quartic: __webpack_require__(285), - Quintic: __webpack_require__(286), - Sine: __webpack_require__(287), - Stepped: __webpack_require__(288) + Back: __webpack_require__(280), + Bounce: __webpack_require__(281), + Circular: __webpack_require__(282), + Cubic: __webpack_require__(283), + Elastic: __webpack_require__(284), + Expo: __webpack_require__(285), + Linear: __webpack_require__(286), + Quadratic: __webpack_require__(287), + Quartic: __webpack_require__(288), + Quintic: __webpack_require__(289), + Sine: __webpack_require__(290), + Stepped: __webpack_require__(291) }; /***/ }), -/* 697 */ +/* 701 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127183,17 +129168,17 @@ module.exports = { module.exports = { - Ceil: __webpack_require__(698), - Equal: __webpack_require__(166), - Floor: __webpack_require__(699), - GreaterThan: __webpack_require__(295), - LessThan: __webpack_require__(296) + Ceil: __webpack_require__(702), + Equal: __webpack_require__(167), + Floor: __webpack_require__(703), + GreaterThan: __webpack_require__(298), + LessThan: __webpack_require__(299) }; /***/ }), -/* 698 */ +/* 702 */ /***/ (function(module, exports) { /** @@ -127224,7 +129209,7 @@ module.exports = Ceil; /***/ }), -/* 699 */ +/* 703 */ /***/ (function(module, exports) { /** @@ -127255,7 +129240,7 @@ module.exports = Floor; /***/ }), -/* 700 */ +/* 704 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127270,19 +129255,19 @@ module.exports = Floor; module.exports = { - Bezier: __webpack_require__(701), - CatmullRom: __webpack_require__(702), - CubicBezier: __webpack_require__(299), - Linear: __webpack_require__(703), - QuadraticBezier: __webpack_require__(300), - SmoothStep: __webpack_require__(301), - SmootherStep: __webpack_require__(704) + Bezier: __webpack_require__(705), + CatmullRom: __webpack_require__(706), + CubicBezier: __webpack_require__(302), + Linear: __webpack_require__(707), + QuadraticBezier: __webpack_require__(303), + SmoothStep: __webpack_require__(304), + SmootherStep: __webpack_require__(708) }; /***/ }), -/* 701 */ +/* 705 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127291,7 +129276,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bernstein = __webpack_require__(297); +var Bernstein = __webpack_require__(300); /** * A bezier interpolation method. @@ -127321,7 +129306,7 @@ module.exports = BezierInterpolation; /***/ }), -/* 702 */ +/* 706 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127330,7 +129315,7 @@ module.exports = BezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CatmullRom = __webpack_require__(167); +var CatmullRom = __webpack_require__(168); /** * A Catmull-Rom interpolation method. @@ -127378,7 +129363,7 @@ module.exports = CatmullRomInterpolation; /***/ }), -/* 703 */ +/* 707 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127387,7 +129372,7 @@ module.exports = CatmullRomInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(114); +var Linear = __webpack_require__(115); /** * A linear interpolation method. @@ -127425,7 +129410,7 @@ module.exports = LinearInterpolation; /***/ }), -/* 704 */ +/* 708 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127434,7 +129419,7 @@ module.exports = LinearInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmootherStep = __webpack_require__(155); +var SmootherStep = __webpack_require__(156); /** * A Smoother Step interpolation method. @@ -127458,7 +129443,7 @@ module.exports = SmootherStepInterpolation; /***/ }), -/* 705 */ +/* 709 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127473,15 +129458,15 @@ module.exports = SmootherStepInterpolation; module.exports = { - GetNext: __webpack_require__(302), - IsSize: __webpack_require__(117), - IsValue: __webpack_require__(706) + GetNext: __webpack_require__(305), + IsSize: __webpack_require__(118), + IsValue: __webpack_require__(710) }; /***/ }), -/* 706 */ +/* 710 */ /***/ (function(module, exports) { /** @@ -127509,7 +129494,7 @@ module.exports = IsValuePowerOfTwo; /***/ }), -/* 707 */ +/* 711 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127524,15 +129509,15 @@ module.exports = IsValuePowerOfTwo; module.exports = { - Ceil: __webpack_require__(303), - Floor: __webpack_require__(90), - To: __webpack_require__(708) + Ceil: __webpack_require__(306), + Floor: __webpack_require__(91), + To: __webpack_require__(712) }; /***/ }), -/* 708 */ +/* 712 */ /***/ (function(module, exports) { /** @@ -127575,7 +129560,7 @@ module.exports = SnapTo; /***/ }), -/* 709 */ +/* 713 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -128074,7 +130059,7 @@ module.exports = RandomDataGenerator; /***/ }), -/* 710 */ +/* 714 */ /***/ (function(module, exports) { /** @@ -128109,7 +130094,7 @@ module.exports = Average; /***/ }), -/* 711 */ +/* 715 */ /***/ (function(module, exports) { /** @@ -128146,7 +130131,7 @@ module.exports = CeilTo; /***/ }), -/* 712 */ +/* 716 */ /***/ (function(module, exports) { /** @@ -128175,7 +130160,7 @@ module.exports = Difference; /***/ }), -/* 713 */ +/* 717 */ /***/ (function(module, exports) { /** @@ -128212,7 +130197,7 @@ module.exports = FloorTo; /***/ }), -/* 714 */ +/* 718 */ /***/ (function(module, exports) { /** @@ -128241,7 +130226,7 @@ module.exports = GetSpeed; /***/ }), -/* 715 */ +/* 719 */ /***/ (function(module, exports) { /** @@ -128272,7 +130257,7 @@ module.exports = IsEven; /***/ }), -/* 716 */ +/* 720 */ /***/ (function(module, exports) { /** @@ -128301,7 +130286,7 @@ module.exports = IsEvenStrict; /***/ }), -/* 717 */ +/* 721 */ /***/ (function(module, exports) { /** @@ -128331,7 +130316,7 @@ module.exports = MaxAdd; /***/ }), -/* 718 */ +/* 722 */ /***/ (function(module, exports) { /** @@ -128361,7 +130346,7 @@ module.exports = MinSub; /***/ }), -/* 719 */ +/* 723 */ /***/ (function(module, exports) { /** @@ -128420,7 +130405,7 @@ module.exports = Percent; /***/ }), -/* 720 */ +/* 724 */ /***/ (function(module, exports) { /** @@ -128460,7 +130445,7 @@ module.exports = RandomXY; /***/ }), -/* 721 */ +/* 725 */ /***/ (function(module, exports) { /** @@ -128499,7 +130484,7 @@ module.exports = RandomXYZ; /***/ }), -/* 722 */ +/* 726 */ /***/ (function(module, exports) { /** @@ -128536,7 +130521,7 @@ module.exports = RandomXYZW; /***/ }), -/* 723 */ +/* 727 */ /***/ (function(module, exports) { /** @@ -128588,7 +130573,7 @@ module.exports = RoundTo; /***/ }), -/* 724 */ +/* 728 */ /***/ (function(module, exports) { /** @@ -128641,7 +130626,65 @@ module.exports = SinCosTableGenerator; /***/ }), -/* 725 */ +/* 729 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Returns a Vec2 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 Vec2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {integer} index - The position within the grid to get the x/y value for. + * @param {integer} width - The width of the grid. + * @param {integer} 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; + } + + out.set(x, y); + } + + return out; +}; + +module.exports = ToXY; + + +/***/ }), +/* 730 */ /***/ (function(module, exports) { /** @@ -128671,7 +130714,7 @@ module.exports = Within; /***/ }), -/* 726 */ +/* 731 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -128680,9 +130723,9 @@ module.exports = Within; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(170); -var Matrix4 = __webpack_require__(310); -var Quaternion = __webpack_require__(311); +var Vector3 = __webpack_require__(171); +var Matrix4 = __webpack_require__(313); +var Quaternion = __webpack_require__(314); var tmpMat4 = new Matrix4(); var tmpQuat = new Quaternion(); @@ -128719,7 +130762,7 @@ module.exports = RotateVec3; /***/ }), -/* 727 */ +/* 732 */ /***/ (function(module, exports) { /** @@ -128745,7 +130788,7 @@ module.exports = 'addtexture'; /***/ }), -/* 728 */ +/* 733 */ /***/ (function(module, exports) { /** @@ -128771,7 +130814,7 @@ module.exports = 'onerror'; /***/ }), -/* 729 */ +/* 734 */ /***/ (function(module, exports) { /** @@ -128800,7 +130843,7 @@ module.exports = 'onload'; /***/ }), -/* 730 */ +/* 735 */ /***/ (function(module, exports) { /** @@ -128823,7 +130866,7 @@ module.exports = 'ready'; /***/ }), -/* 731 */ +/* 736 */ /***/ (function(module, exports) { /** @@ -128851,7 +130894,7 @@ module.exports = 'removetexture'; /***/ }), -/* 732 */ +/* 737 */ /***/ (function(module, exports) { module.exports = [ @@ -128887,7 +130930,7 @@ module.exports = [ /***/ }), -/* 733 */ +/* 738 */ /***/ (function(module, exports) { module.exports = [ @@ -128906,7 +130949,7 @@ module.exports = [ /***/ }), -/* 734 */ +/* 739 */ /***/ (function(module, exports) { module.exports = [ @@ -128965,7 +131008,7 @@ module.exports = [ /***/ }), -/* 735 */ +/* 740 */ /***/ (function(module, exports) { module.exports = [ @@ -129009,7 +131052,7 @@ module.exports = [ /***/ }), -/* 736 */ +/* 741 */ /***/ (function(module, exports) { module.exports = [ @@ -129044,7 +131087,7 @@ module.exports = [ /***/ }), -/* 737 */ +/* 742 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129059,14 +131102,14 @@ module.exports = [ module.exports = { - GenerateTexture: __webpack_require__(318), - Palettes: __webpack_require__(738) + GenerateTexture: __webpack_require__(321), + Palettes: __webpack_require__(743) }; /***/ }), -/* 738 */ +/* 743 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129081,17 +131124,17 @@ module.exports = { module.exports = { - ARNE16: __webpack_require__(319), - C64: __webpack_require__(739), - CGA: __webpack_require__(740), - JMP: __webpack_require__(741), - MSX: __webpack_require__(742) + ARNE16: __webpack_require__(322), + C64: __webpack_require__(744), + CGA: __webpack_require__(745), + JMP: __webpack_require__(746), + MSX: __webpack_require__(747) }; /***/ }), -/* 739 */ +/* 744 */ /***/ (function(module, exports) { /** @@ -129129,7 +131172,7 @@ module.exports = { /***/ }), -/* 740 */ +/* 745 */ /***/ (function(module, exports) { /** @@ -129167,7 +131210,7 @@ module.exports = { /***/ }), -/* 741 */ +/* 746 */ /***/ (function(module, exports) { /** @@ -129205,7 +131248,7 @@ module.exports = { /***/ }), -/* 742 */ +/* 747 */ /***/ (function(module, exports) { /** @@ -129243,7 +131286,7 @@ module.exports = { /***/ }), -/* 743 */ +/* 748 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129257,19 +131300,19 @@ module.exports = { */ module.exports = { - Path: __webpack_require__(744), + Path: __webpack_require__(749), - CubicBezier: __webpack_require__(320), - Curve: __webpack_require__(79), - Ellipse: __webpack_require__(321), - Line: __webpack_require__(322), - QuadraticBezier: __webpack_require__(323), - Spline: __webpack_require__(324) + CubicBezier: __webpack_require__(323), + Curve: __webpack_require__(80), + Ellipse: __webpack_require__(324), + Line: __webpack_require__(325), + QuadraticBezier: __webpack_require__(326), + Spline: __webpack_require__(327) }; /***/ }), -/* 744 */ +/* 749 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129281,15 +131324,15 @@ module.exports = { // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var CubicBezierCurve = __webpack_require__(320); -var EllipseCurve = __webpack_require__(321); -var GameObjectFactory = __webpack_require__(5); -var LineCurve = __webpack_require__(322); -var MovePathTo = __webpack_require__(745); -var QuadraticBezierCurve = __webpack_require__(323); -var Rectangle = __webpack_require__(10); -var SplineCurve = __webpack_require__(324); -var Vector2 = __webpack_require__(4); +var CubicBezierCurve = __webpack_require__(323); +var EllipseCurve = __webpack_require__(324); +var GameObjectFactory = __webpack_require__(6); +var LineCurve = __webpack_require__(325); +var MovePathTo = __webpack_require__(750); +var QuadraticBezierCurve = __webpack_require__(326); +var Rectangle = __webpack_require__(11); +var SplineCurve = __webpack_require__(327); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -129576,12 +131619,12 @@ var Path = new Class({ * @method Phaser.Curves.Path#ellipseTo * @since 3.0.0 * - * @param {number} xRadius - The horizontal radius of the ellipse. - * @param {number} yRadius - The vertical radius of the ellipse. - * @param {number} startAngle - The start angle of the ellipse, in degrees. - * @param {number} endAngle - The end angle of the ellipse, in degrees. - * @param {boolean} clockwise - Whether the ellipse should be rotated clockwise (`true`) or counter-clockwise (`false`). - * @param {number} rotation - The rotation of the ellipse, in degrees. + * @param {number} [xRadius=0] - The horizontal radius of ellipse. + * @param {number} [yRadius=0] - The vertical radius of ellipse. + * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). + * @param {number} [rotation=0] - The rotation of the ellipse, in degrees. * * @return {Phaser.Curves.Path} This Path object. */ @@ -129964,10 +132007,8 @@ var Path = new Class({ return out.copy(this.startPoint); }, - // Creates a line curve from the previous end point to x/y - /** - * [description] + * Creates a line curve from the previous end point to x/y * * @method Phaser.Curves.Path#lineTo * @since 3.0.0 @@ -130054,10 +132095,8 @@ var Path = new Class({ }; }, - // cacheLengths must be recalculated. - /** - * [description] + * cacheLengths must be recalculated. * * @method Phaser.Curves.Path#updateArcLengths * @since 3.0.0 @@ -130112,7 +132151,7 @@ module.exports = Path; /***/ }), -/* 745 */ +/* 750 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130122,7 +132161,7 @@ module.exports = Path; */ var Class = __webpack_require__(0); -var Vector2 = __webpack_require__(4); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -130252,7 +132291,7 @@ module.exports = MoveTo; /***/ }), -/* 746 */ +/* 751 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130267,15 +132306,15 @@ module.exports = MoveTo; module.exports = { - DataManager: __webpack_require__(109), - DataManagerPlugin: __webpack_require__(747), - Events: __webpack_require__(259) + DataManager: __webpack_require__(110), + DataManagerPlugin: __webpack_require__(752), + Events: __webpack_require__(262) }; /***/ }), -/* 747 */ +/* 752 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130285,9 +132324,9 @@ module.exports = { */ var Class = __webpack_require__(0); -var DataManager = __webpack_require__(109); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); +var DataManager = __webpack_require__(110); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -130402,7 +132441,7 @@ module.exports = DataManagerPlugin; /***/ }), -/* 748 */ +/* 753 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130417,18 +132456,18 @@ module.exports = DataManagerPlugin; module.exports = { - Align: __webpack_require__(749), - BaseShader: __webpack_require__(325), - Bounds: __webpack_require__(764), - Canvas: __webpack_require__(767), - Color: __webpack_require__(326), - Masks: __webpack_require__(776) + Align: __webpack_require__(754), + BaseShader: __webpack_require__(328), + Bounds: __webpack_require__(769), + Canvas: __webpack_require__(772), + Color: __webpack_require__(329), + Masks: __webpack_require__(781) }; /***/ }), -/* 749 */ +/* 754 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130437,8 +132476,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(143); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(144); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Display.Align @@ -130446,8 +132485,8 @@ var Extend = __webpack_require__(17); var Align = { - In: __webpack_require__(750), - To: __webpack_require__(751) + In: __webpack_require__(755), + To: __webpack_require__(756) }; @@ -130458,7 +132497,7 @@ module.exports = Align; /***/ }), -/* 750 */ +/* 755 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130473,22 +132512,22 @@ module.exports = Align; module.exports = { - BottomCenter: __webpack_require__(231), - BottomLeft: __webpack_require__(232), - BottomRight: __webpack_require__(233), - Center: __webpack_require__(234), - LeftCenter: __webpack_require__(236), - QuickSet: __webpack_require__(230), - RightCenter: __webpack_require__(237), - TopCenter: __webpack_require__(238), - TopLeft: __webpack_require__(239), - TopRight: __webpack_require__(240) + BottomCenter: __webpack_require__(234), + BottomLeft: __webpack_require__(235), + BottomRight: __webpack_require__(236), + Center: __webpack_require__(237), + LeftCenter: __webpack_require__(239), + QuickSet: __webpack_require__(233), + RightCenter: __webpack_require__(240), + TopCenter: __webpack_require__(241), + TopLeft: __webpack_require__(242), + TopRight: __webpack_require__(243) }; /***/ }), -/* 751 */ +/* 756 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130503,24 +132542,24 @@ module.exports = { module.exports = { - BottomCenter: __webpack_require__(752), - BottomLeft: __webpack_require__(753), - BottomRight: __webpack_require__(754), - LeftBottom: __webpack_require__(755), - LeftCenter: __webpack_require__(756), - LeftTop: __webpack_require__(757), - RightBottom: __webpack_require__(758), - RightCenter: __webpack_require__(759), - RightTop: __webpack_require__(760), - TopCenter: __webpack_require__(761), - TopLeft: __webpack_require__(762), - TopRight: __webpack_require__(763) + BottomCenter: __webpack_require__(757), + BottomLeft: __webpack_require__(758), + BottomRight: __webpack_require__(759), + LeftBottom: __webpack_require__(760), + LeftCenter: __webpack_require__(761), + LeftTop: __webpack_require__(762), + RightBottom: __webpack_require__(763), + RightCenter: __webpack_require__(764), + RightTop: __webpack_require__(765), + TopCenter: __webpack_require__(766), + TopLeft: __webpack_require__(767), + TopRight: __webpack_require__(768) }; /***/ }), -/* 752 */ +/* 757 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130530,8 +132569,8 @@ module.exports = { */ var GetBottom = __webpack_require__(38); -var GetCenterX = __webpack_require__(73); -var SetCenterX = __webpack_require__(74); +var GetCenterX = __webpack_require__(74); +var SetCenterX = __webpack_require__(75); var SetTop = __webpack_require__(45); /** @@ -130564,7 +132603,7 @@ module.exports = BottomCenter; /***/ }), -/* 753 */ +/* 758 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130608,7 +132647,7 @@ module.exports = BottomLeft; /***/ }), -/* 754 */ +/* 759 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130652,7 +132691,7 @@ module.exports = BottomRight; /***/ }), -/* 755 */ +/* 760 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130696,7 +132735,7 @@ module.exports = LeftBottom; /***/ }), -/* 756 */ +/* 761 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130705,9 +132744,9 @@ module.exports = LeftBottom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(76); +var GetCenterY = __webpack_require__(77); var GetLeft = __webpack_require__(40); -var SetCenterY = __webpack_require__(75); +var SetCenterY = __webpack_require__(76); var SetRight = __webpack_require__(43); /** @@ -130740,7 +132779,7 @@ module.exports = LeftCenter; /***/ }), -/* 757 */ +/* 762 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130784,7 +132823,7 @@ module.exports = LeftTop; /***/ }), -/* 758 */ +/* 763 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130828,7 +132867,7 @@ module.exports = RightBottom; /***/ }), -/* 759 */ +/* 764 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130837,9 +132876,9 @@ module.exports = RightBottom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(76); +var GetCenterY = __webpack_require__(77); var GetRight = __webpack_require__(42); -var SetCenterY = __webpack_require__(75); +var SetCenterY = __webpack_require__(76); var SetLeft = __webpack_require__(41); /** @@ -130872,7 +132911,7 @@ module.exports = RightCenter; /***/ }), -/* 760 */ +/* 765 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130916,7 +132955,7 @@ module.exports = RightTop; /***/ }), -/* 761 */ +/* 766 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130925,10 +132964,10 @@ module.exports = RightTop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterX = __webpack_require__(73); +var GetCenterX = __webpack_require__(74); var GetTop = __webpack_require__(44); var SetBottom = __webpack_require__(39); -var SetCenterX = __webpack_require__(74); +var SetCenterX = __webpack_require__(75); /** * Takes given Game Object and aligns it so that it is positioned next to the top center position of the other. @@ -130960,7 +132999,7 @@ module.exports = TopCenter; /***/ }), -/* 762 */ +/* 767 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131004,7 +133043,7 @@ module.exports = TopLeft; /***/ }), -/* 763 */ +/* 768 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131048,7 +133087,7 @@ module.exports = TopRight; /***/ }), -/* 764 */ +/* 769 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131063,18 +133102,18 @@ module.exports = TopRight; module.exports = { - CenterOn: __webpack_require__(235), + CenterOn: __webpack_require__(238), GetBottom: __webpack_require__(38), - GetCenterX: __webpack_require__(73), - GetCenterY: __webpack_require__(76), + GetCenterX: __webpack_require__(74), + GetCenterY: __webpack_require__(77), GetLeft: __webpack_require__(40), - GetOffsetX: __webpack_require__(765), - GetOffsetY: __webpack_require__(766), + GetOffsetX: __webpack_require__(770), + GetOffsetY: __webpack_require__(771), GetRight: __webpack_require__(42), GetTop: __webpack_require__(44), SetBottom: __webpack_require__(39), - SetCenterX: __webpack_require__(74), - SetCenterY: __webpack_require__(75), + SetCenterX: __webpack_require__(75), + SetCenterY: __webpack_require__(76), SetLeft: __webpack_require__(41), SetRight: __webpack_require__(43), SetTop: __webpack_require__(45) @@ -131083,7 +133122,7 @@ module.exports = { /***/ }), -/* 765 */ +/* 770 */ /***/ (function(module, exports) { /** @@ -131113,7 +133152,7 @@ module.exports = GetOffsetX; /***/ }), -/* 766 */ +/* 771 */ /***/ (function(module, exports) { /** @@ -131143,7 +133182,7 @@ module.exports = GetOffsetY; /***/ }), -/* 767 */ +/* 772 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131158,17 +133197,17 @@ module.exports = GetOffsetY; module.exports = { - CanvasInterpolation: __webpack_require__(313), - CanvasPool: __webpack_require__(24), - Smoothing: __webpack_require__(113), - TouchAction: __webpack_require__(768), - UserSelect: __webpack_require__(769) + CanvasInterpolation: __webpack_require__(316), + CanvasPool: __webpack_require__(25), + Smoothing: __webpack_require__(114), + TouchAction: __webpack_require__(773), + UserSelect: __webpack_require__(774) }; /***/ }), -/* 768 */ +/* 773 */ /***/ (function(module, exports) { /** @@ -131203,7 +133242,7 @@ module.exports = TouchAction; /***/ }), -/* 769 */ +/* 774 */ /***/ (function(module, exports) { /** @@ -131250,7 +133289,7 @@ module.exports = UserSelect; /***/ }), -/* 770 */ +/* 775 */ /***/ (function(module, exports) { /** @@ -131290,7 +133329,7 @@ module.exports = ColorToRGBA; /***/ }), -/* 771 */ +/* 776 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131300,7 +133339,7 @@ module.exports = ColorToRGBA; */ var Color = __webpack_require__(33); -var HueToComponent = __webpack_require__(328); +var HueToComponent = __webpack_require__(331); /** * Converts HSL (hue, saturation and lightness) values to a Phaser Color object. @@ -131340,7 +133379,7 @@ module.exports = HSLToColor; /***/ }), -/* 772 */ +/* 777 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131349,7 +133388,7 @@ module.exports = HSLToColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HSVToRGB = __webpack_require__(161); +var HSVToRGB = __webpack_require__(162); /** * Get HSV color wheel values in an array which will be 360 elements in size. @@ -131381,7 +133420,7 @@ module.exports = HSVColorWheel; /***/ }), -/* 773 */ +/* 778 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131390,7 +133429,7 @@ module.exports = HSVColorWheel; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(114); +var Linear = __webpack_require__(115); /** * @namespace Phaser.Display.Color.Interpolate @@ -131489,7 +133528,7 @@ module.exports = { /***/ }), -/* 774 */ +/* 779 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131498,7 +133537,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Between = __webpack_require__(168); +var Between = __webpack_require__(169); var Color = __webpack_require__(33); /** @@ -131525,7 +133564,7 @@ module.exports = RandomRGB; /***/ }), -/* 775 */ +/* 780 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131534,7 +133573,7 @@ module.exports = RandomRGB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ComponentToHex = __webpack_require__(327); +var ComponentToHex = __webpack_require__(330); /** * Converts the color values into an HTML compatible color string, prefixed with either `#` or `0x`. @@ -131569,7 +133608,7 @@ module.exports = RGBToString; /***/ }), -/* 776 */ +/* 781 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131584,14 +133623,14 @@ module.exports = RGBToString; module.exports = { - BitmapMask: __webpack_require__(253), - GeometryMask: __webpack_require__(254) + BitmapMask: __webpack_require__(256), + GeometryMask: __webpack_require__(257) }; /***/ }), -/* 777 */ +/* 782 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131606,13 +133645,13 @@ module.exports = { var Dom = { - AddToDOM: __webpack_require__(119), - DOMContentLoaded: __webpack_require__(329), - GetScreenOrientation: __webpack_require__(330), - GetTarget: __webpack_require__(335), - ParseXML: __webpack_require__(336), - RemoveFromDOM: __webpack_require__(174), - RequestAnimationFrame: __webpack_require__(316) + AddToDOM: __webpack_require__(120), + DOMContentLoaded: __webpack_require__(332), + GetScreenOrientation: __webpack_require__(333), + GetTarget: __webpack_require__(338), + ParseXML: __webpack_require__(339), + RemoveFromDOM: __webpack_require__(175), + RequestAnimationFrame: __webpack_require__(319) }; @@ -131620,7 +133659,7 @@ module.exports = Dom; /***/ }), -/* 778 */ +/* 783 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131633,11 +133672,11 @@ module.exports = Dom; * @namespace Phaser.Events */ -module.exports = { EventEmitter: __webpack_require__(779) }; +module.exports = { EventEmitter: __webpack_require__(784) }; /***/ }), -/* 779 */ +/* 784 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131647,8 +133686,8 @@ module.exports = { EventEmitter: __webpack_require__(779) }; */ var Class = __webpack_require__(0); -var EE = __webpack_require__(11); -var PluginCache = __webpack_require__(18); +var EE = __webpack_require__(10); +var PluginCache = __webpack_require__(19); /** * @classdesc @@ -131821,7 +133860,7 @@ module.exports = EventEmitter; /***/ }), -/* 780 */ +/* 785 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131830,33 +133869,33 @@ module.exports = EventEmitter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(119); -var AnimationManager = __webpack_require__(264); -var CacheManager = __webpack_require__(267); -var CanvasPool = __webpack_require__(24); +var AddToDOM = __webpack_require__(120); +var AnimationManager = __webpack_require__(267); +var CacheManager = __webpack_require__(270); +var CanvasPool = __webpack_require__(25); var Class = __webpack_require__(0); -var Config = __webpack_require__(289); -var CreateDOMContainer = __webpack_require__(781); -var CreateRenderer = __webpack_require__(312); -var DataManager = __webpack_require__(109); -var DebugHeader = __webpack_require__(314); -var Device = __webpack_require__(290); -var DOMContentLoaded = __webpack_require__(329); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(28); -var InputManager = __webpack_require__(337); -var PluginCache = __webpack_require__(18); -var PluginManager = __webpack_require__(342); -var ScaleManager = __webpack_require__(343); -var SceneManager = __webpack_require__(345); -var TextureEvents = __webpack_require__(118); -var TextureManager = __webpack_require__(349); -var TimeStep = __webpack_require__(315); -var VisibilityHandler = __webpack_require__(317); +var Config = __webpack_require__(292); +var CreateDOMContainer = __webpack_require__(786); +var CreateRenderer = __webpack_require__(315); +var DataManager = __webpack_require__(110); +var DebugHeader = __webpack_require__(317); +var Device = __webpack_require__(293); +var DOMContentLoaded = __webpack_require__(332); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(18); +var InputManager = __webpack_require__(340); +var PluginCache = __webpack_require__(19); +var PluginManager = __webpack_require__(345); +var ScaleManager = __webpack_require__(346); +var SceneManager = __webpack_require__(348); +var TextureEvents = __webpack_require__(119); +var TextureManager = __webpack_require__(351); +var TimeStep = __webpack_require__(318); +var VisibilityHandler = __webpack_require__(320); if (true) { - var SoundManagerCreator = __webpack_require__(352); + var SoundManagerCreator = __webpack_require__(355); } if (false) @@ -132072,7 +134111,7 @@ var Game = new Class({ * You can disable the inclusion of the Sound Manager in your build by toggling the webpack `FEATURE_SOUND` flag. * * @name Phaser.Game#sound - * @type {Phaser.Sound.BaseSoundManager} + * @type {(Phaser.Sound.NoAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager)} * @since 3.0.0 */ this.sound = null; @@ -132519,7 +134558,7 @@ module.exports = Game; /***/ }), -/* 781 */ +/* 786 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132528,7 +134567,7 @@ module.exports = Game; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(119); +var AddToDOM = __webpack_require__(120); var CreateDOMContainer = function (game) { @@ -132542,7 +134581,7 @@ var CreateDOMContainer = function (game) // DOM Element Container var div = document.createElement('div'); - div.style = [ + div.style.cssText = [ 'display: block;', 'width: ' + game.scale.width + 'px;', 'height: ' + game.scale.height + 'px;', @@ -132563,7 +134602,7 @@ module.exports = CreateDOMContainer; /***/ }), -/* 782 */ +/* 787 */ /***/ (function(module, exports) { /** @@ -132584,7 +134623,7 @@ module.exports = 'boot'; /***/ }), -/* 783 */ +/* 788 */ /***/ (function(module, exports) { /** @@ -132605,7 +134644,7 @@ module.exports = 'destroy'; /***/ }), -/* 784 */ +/* 789 */ /***/ (function(module, exports) { /** @@ -132633,7 +134672,7 @@ module.exports = 'dragend'; /***/ }), -/* 785 */ +/* 790 */ /***/ (function(module, exports) { /** @@ -132664,7 +134703,7 @@ module.exports = 'dragenter'; /***/ }), -/* 786 */ +/* 791 */ /***/ (function(module, exports) { /** @@ -132696,7 +134735,7 @@ module.exports = 'drag'; /***/ }), -/* 787 */ +/* 792 */ /***/ (function(module, exports) { /** @@ -132727,7 +134766,7 @@ module.exports = 'dragleave'; /***/ }), -/* 788 */ +/* 793 */ /***/ (function(module, exports) { /** @@ -132761,7 +134800,7 @@ module.exports = 'dragover'; /***/ }), -/* 789 */ +/* 794 */ /***/ (function(module, exports) { /** @@ -132791,7 +134830,7 @@ module.exports = 'dragstart'; /***/ }), -/* 790 */ +/* 795 */ /***/ (function(module, exports) { /** @@ -132820,7 +134859,7 @@ module.exports = 'drop'; /***/ }), -/* 791 */ +/* 796 */ /***/ (function(module, exports) { /** @@ -132847,7 +134886,7 @@ module.exports = 'gameout'; /***/ }), -/* 792 */ +/* 797 */ /***/ (function(module, exports) { /** @@ -132874,7 +134913,7 @@ module.exports = 'gameover'; /***/ }), -/* 793 */ +/* 798 */ /***/ (function(module, exports) { /** @@ -132915,7 +134954,7 @@ module.exports = 'gameobjectdown'; /***/ }), -/* 794 */ +/* 799 */ /***/ (function(module, exports) { /** @@ -132946,7 +134985,7 @@ module.exports = 'dragend'; /***/ }), -/* 795 */ +/* 800 */ /***/ (function(module, exports) { /** @@ -132976,7 +135015,7 @@ module.exports = 'dragenter'; /***/ }), -/* 796 */ +/* 801 */ /***/ (function(module, exports) { /** @@ -133007,7 +135046,7 @@ module.exports = 'drag'; /***/ }), -/* 797 */ +/* 802 */ /***/ (function(module, exports) { /** @@ -133037,7 +135076,7 @@ module.exports = 'dragleave'; /***/ }), -/* 798 */ +/* 803 */ /***/ (function(module, exports) { /** @@ -133070,7 +135109,7 @@ module.exports = 'dragover'; /***/ }), -/* 799 */ +/* 804 */ /***/ (function(module, exports) { /** @@ -133104,7 +135143,7 @@ module.exports = 'dragstart'; /***/ }), -/* 800 */ +/* 805 */ /***/ (function(module, exports) { /** @@ -133134,7 +135173,7 @@ module.exports = 'drop'; /***/ }), -/* 801 */ +/* 806 */ /***/ (function(module, exports) { /** @@ -133175,7 +135214,7 @@ module.exports = 'gameobjectmove'; /***/ }), -/* 802 */ +/* 807 */ /***/ (function(module, exports) { /** @@ -133216,7 +135255,7 @@ module.exports = 'gameobjectout'; /***/ }), -/* 803 */ +/* 808 */ /***/ (function(module, exports) { /** @@ -133257,7 +135296,7 @@ module.exports = 'gameobjectover'; /***/ }), -/* 804 */ +/* 809 */ /***/ (function(module, exports) { /** @@ -133298,7 +135337,7 @@ module.exports = 'pointerdown'; /***/ }), -/* 805 */ +/* 810 */ /***/ (function(module, exports) { /** @@ -133339,7 +135378,7 @@ module.exports = 'pointermove'; /***/ }), -/* 806 */ +/* 811 */ /***/ (function(module, exports) { /** @@ -133378,7 +135417,7 @@ module.exports = 'pointerout'; /***/ }), -/* 807 */ +/* 812 */ /***/ (function(module, exports) { /** @@ -133419,7 +135458,7 @@ module.exports = 'pointerover'; /***/ }), -/* 808 */ +/* 813 */ /***/ (function(module, exports) { /** @@ -133460,7 +135499,7 @@ module.exports = 'pointerup'; /***/ }), -/* 809 */ +/* 814 */ /***/ (function(module, exports) { /** @@ -133502,7 +135541,7 @@ module.exports = 'wheel'; /***/ }), -/* 810 */ +/* 815 */ /***/ (function(module, exports) { /** @@ -133543,7 +135582,7 @@ module.exports = 'gameobjectup'; /***/ }), -/* 811 */ +/* 816 */ /***/ (function(module, exports) { /** @@ -133587,7 +135626,7 @@ module.exports = 'gameobjectwheel'; /***/ }), -/* 812 */ +/* 817 */ /***/ (function(module, exports) { /** @@ -133608,7 +135647,7 @@ module.exports = 'boot'; /***/ }), -/* 813 */ +/* 818 */ /***/ (function(module, exports) { /** @@ -133633,7 +135672,7 @@ module.exports = 'process'; /***/ }), -/* 814 */ +/* 819 */ /***/ (function(module, exports) { /** @@ -133654,7 +135693,7 @@ module.exports = 'update'; /***/ }), -/* 815 */ +/* 820 */ /***/ (function(module, exports) { /** @@ -133689,7 +135728,7 @@ module.exports = 'pointerdown'; /***/ }), -/* 816 */ +/* 821 */ /***/ (function(module, exports) { /** @@ -133723,7 +135762,7 @@ module.exports = 'pointerdownoutside'; /***/ }), -/* 817 */ +/* 822 */ /***/ (function(module, exports) { /** @@ -133758,7 +135797,7 @@ module.exports = 'pointermove'; /***/ }), -/* 818 */ +/* 823 */ /***/ (function(module, exports) { /** @@ -133793,7 +135832,7 @@ module.exports = 'pointerout'; /***/ }), -/* 819 */ +/* 824 */ /***/ (function(module, exports) { /** @@ -133828,7 +135867,7 @@ module.exports = 'pointerover'; /***/ }), -/* 820 */ +/* 825 */ /***/ (function(module, exports) { /** @@ -133863,7 +135902,7 @@ module.exports = 'pointerup'; /***/ }), -/* 821 */ +/* 826 */ /***/ (function(module, exports) { /** @@ -133897,7 +135936,7 @@ module.exports = 'pointerupoutside'; /***/ }), -/* 822 */ +/* 827 */ /***/ (function(module, exports) { /** @@ -133935,7 +135974,7 @@ module.exports = 'wheel'; /***/ }), -/* 823 */ +/* 828 */ /***/ (function(module, exports) { /** @@ -133959,7 +135998,7 @@ module.exports = 'pointerlockchange'; /***/ }), -/* 824 */ +/* 829 */ /***/ (function(module, exports) { /** @@ -133981,7 +136020,7 @@ module.exports = 'preupdate'; /***/ }), -/* 825 */ +/* 830 */ /***/ (function(module, exports) { /** @@ -134002,7 +136041,7 @@ module.exports = 'shutdown'; /***/ }), -/* 826 */ +/* 831 */ /***/ (function(module, exports) { /** @@ -134024,7 +136063,7 @@ module.exports = 'start'; /***/ }), -/* 827 */ +/* 832 */ /***/ (function(module, exports) { /** @@ -134049,7 +136088,7 @@ module.exports = 'update'; /***/ }), -/* 828 */ +/* 833 */ /***/ (function(module, exports) { /** @@ -134108,7 +136147,7 @@ module.exports = GetInnerHeight; /***/ }), -/* 829 */ +/* 834 */ /***/ (function(module, exports) { /** @@ -134138,7 +136177,7 @@ module.exports = 'addfile'; /***/ }), -/* 830 */ +/* 835 */ /***/ (function(module, exports) { /** @@ -134166,7 +136205,7 @@ module.exports = 'complete'; /***/ }), -/* 831 */ +/* 836 */ /***/ (function(module, exports) { /** @@ -134195,7 +136234,7 @@ module.exports = 'filecomplete'; /***/ }), -/* 832 */ +/* 837 */ /***/ (function(module, exports) { /** @@ -134249,7 +136288,7 @@ module.exports = 'filecomplete-'; /***/ }), -/* 833 */ +/* 838 */ /***/ (function(module, exports) { /** @@ -134274,7 +136313,7 @@ module.exports = 'loaderror'; /***/ }), -/* 834 */ +/* 839 */ /***/ (function(module, exports) { /** @@ -134300,7 +136339,7 @@ module.exports = 'load'; /***/ }), -/* 835 */ +/* 840 */ /***/ (function(module, exports) { /** @@ -134327,7 +136366,7 @@ module.exports = 'fileprogress'; /***/ }), -/* 836 */ +/* 841 */ /***/ (function(module, exports) { /** @@ -134356,7 +136395,7 @@ module.exports = 'postprocess'; /***/ }), -/* 837 */ +/* 842 */ /***/ (function(module, exports) { /** @@ -134381,7 +136420,7 @@ module.exports = 'progress'; /***/ }), -/* 838 */ +/* 843 */ /***/ (function(module, exports) { /** @@ -134408,7 +136447,7 @@ module.exports = 'start'; /***/ }), -/* 839 */ +/* 844 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134418,7 +136457,7 @@ module.exports = 'start'; */ var GetFastValue = __webpack_require__(2); -var UppercaseFirst = __webpack_require__(347); +var UppercaseFirst = __webpack_require__(178); /** * Builds an array of which physics plugins should be activated for the given Scene. @@ -134470,7 +136509,7 @@ module.exports = GetPhysicsPlugins; /***/ }), -/* 840 */ +/* 845 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134517,7 +136556,7 @@ module.exports = GetScenePlugins; /***/ }), -/* 841 */ +/* 846 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134578,629 +136617,7 @@ module.exports = InjectionMap; /***/ }), -/* 842 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Clamp = __webpack_require__(22); -var Color = __webpack_require__(33); -var IsSizePowerOfTwo = __webpack_require__(117); -var Texture = __webpack_require__(177); - -/** - * @classdesc - * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source. - * - * You can use the properties of this texture to draw to the canvas element directly, using all of the standard - * canvas operations available in the browser. Any Game Object can be given this texture and will render with it. - * - * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to - * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this - * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep - * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading - * texture data to it. This restriction does not apply if using the Canvas Renderer. - * - * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify - * sections of the canvas using the `add` method. - * - * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying - * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause - * graphical errors. - * - * @class CanvasTexture - * @extends Phaser.Textures.Texture - * @memberof Phaser.Textures - * @constructor - * @since 3.7.0 - * - * @param {Phaser.Textures.CanvasTexture} manager - A reference to the Texture Manager this Texture belongs to. - * @param {string} key - The unique string-based key of this Texture. - * @param {HTMLCanvasElement} source - The canvas element that is used as the base of this texture. - * @param {integer} width - The width of the canvas. - * @param {integer} height - The height of the canvas. - */ -var CanvasTexture = new Class({ - - Extends: Texture, - - initialize: - - function CanvasTexture (manager, key, source, width, height) - { - Texture.call(this, manager, key, source, width, height); - - this.add('__BASE', 0, 0, 0, width, height); - - /** - * A reference to the Texture Source of this Canvas. - * - * @name Phaser.Textures.CanvasTexture#_source - * @type {Phaser.Textures.TextureSource} - * @private - * @since 3.7.0 - */ - this._source = this.frames['__BASE'].source; - - /** - * The source Canvas Element. - * - * @name Phaser.Textures.CanvasTexture#canvas - * @readonly - * @type {HTMLCanvasElement} - * @since 3.7.0 - */ - this.canvas = this._source.image; - - /** - * The 2D Canvas Rendering Context. - * - * @name Phaser.Textures.CanvasTexture#context - * @readonly - * @type {CanvasRenderingContext2D} - * @since 3.7.0 - */ - this.context = this.canvas.getContext('2d'); - - /** - * The width of the Canvas. - * This property is read-only, if you wish to change it use the `setSize` method. - * - * @name Phaser.Textures.CanvasTexture#width - * @readonly - * @type {integer} - * @since 3.7.0 - */ - this.width = width; - - /** - * The height of the Canvas. - * This property is read-only, if you wish to change it use the `setSize` method. - * - * @name Phaser.Textures.CanvasTexture#height - * @readonly - * @type {integer} - * @since 3.7.0 - */ - this.height = height; - - /** - * The context image data. - * Use the `update` method to populate this when the canvas changes. - * - * @name Phaser.Textures.CanvasTexture#imageData - * @type {ImageData} - * @since 3.13.0 - */ - this.imageData = this.context.getImageData(0, 0, width, height); - - /** - * A Uint8ClampedArray view into the `buffer`. - * Use the `update` method to populate this when the canvas changes. - * Note that this is unavailable in some browsers, such as Epic Browser, due to their security restrictions. - * - * @name Phaser.Textures.CanvasTexture#data - * @type {Uint8ClampedArray} - * @since 3.13.0 - */ - this.data = null; - - if (this.imageData) - { - this.data = this.imageData.data; - } - - /** - * An Uint32Array view into the `buffer`. - * - * @name Phaser.Textures.CanvasTexture#pixels - * @type {Uint32Array} - * @since 3.13.0 - */ - this.pixels = null; - - /** - * An ArrayBuffer the same size as the context ImageData. - * - * @name Phaser.Textures.CanvasTexture#buffer - * @type {ArrayBuffer} - * @since 3.13.0 - */ - this.buffer; - - if (this.data) - { - if (this.imageData.data.buffer) - { - this.buffer = this.imageData.data.buffer; - this.pixels = new Uint32Array(this.buffer); - } - else if (window.ArrayBuffer) - { - this.buffer = new ArrayBuffer(this.imageData.data.length); - this.pixels = new Uint32Array(this.buffer); - } - else - { - this.pixels = this.imageData.data; - } - } - }, - - /** - * This re-creates the `imageData` from the current context. - * It then re-builds the ArrayBuffer, the `data` Uint8ClampedArray reference and the `pixels` Int32Array. - * - * Warning: This is a very expensive operation, so use it sparingly. - * - * @method Phaser.Textures.CanvasTexture#update - * @since 3.13.0 - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - update: function () - { - this.imageData = this.context.getImageData(0, 0, this.width, this.height); - - this.data = this.imageData.data; - - if (this.imageData.data.buffer) - { - this.buffer = this.imageData.data.buffer; - this.pixels = new Uint32Array(this.buffer); - } - else if (window.ArrayBuffer) - { - this.buffer = new ArrayBuffer(this.imageData.data.length); - this.pixels = new Uint32Array(this.buffer); - } - else - { - this.pixels = this.imageData.data; - } - - return this; - }, - - /** - * Draws the given Image or Canvas element to this CanvasTexture, then updates the internal - * ImageData buffer and arrays. - * - * @method Phaser.Textures.CanvasTexture#draw - * @since 3.13.0 - * - * @param {integer} x - The x coordinate to draw the source at. - * @param {integer} y - The y coordinate to draw the source at. - * @param {(HTMLImageElement|HTMLCanvasElement)} source - The element to draw to this canvas. - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - draw: function (x, y, source) - { - this.context.drawImage(source, x, y); - - return this.update(); - }, - - /** - * Draws the given texture frame to this CanvasTexture, then updates the internal - * ImageData buffer and arrays. - * - * @method Phaser.Textures.CanvasTexture#drawFrame - * @since 3.16.0 - * - * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. - * @param {integer} [x=0] - The x coordinate to draw the source at. - * @param {integer} [y=0] - The y coordinate to draw the source at. - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - drawFrame: function (key, frame, x, y) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - - var textureFrame = this.manager.getFrame(key, frame); - - if (textureFrame) - { - var cd = textureFrame.canvasData; - - var width = textureFrame.cutWidth; - var height = textureFrame.cutHeight; - var res = textureFrame.source.resolution; - - this.context.drawImage( - textureFrame.source.image, - cd.x, cd.y, - width, - height, - x, y, - width / res, - height / res - ); - - return this.update(); - } - else - { - return this; - } - }, - - /** - * Sets a pixel in the CanvasTexture to the given color and alpha values. - * - * This is an expensive operation to run in large quantities, so use sparingly. - * - * @method Phaser.Textures.CanvasTexture#setPixel - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. - * - * @return {this} This CanvasTexture. - */ - setPixel: function (x, y, red, green, blue, alpha) - { - if (alpha === undefined) { alpha = 255; } - - x = Math.abs(Math.floor(x)); - y = Math.abs(Math.floor(y)); - - var index = this.getIndex(x, y); - - if (index > -1) - { - var imageData = this.context.getImageData(x, y, 1, 1); - - imageData.data[0] = red; - imageData.data[1] = green; - imageData.data[2] = blue; - imageData.data[3] = alpha; - - this.context.putImageData(imageData, x, y); - } - - return this; - }, - - /** - * Puts the ImageData into the context of this CanvasTexture at the given coordinates. - * - * @method Phaser.Textures.CanvasTexture#putData - * @since 3.16.0 - * - * @param {ImageData} imageData - The ImageData to put at the given location. - * @param {integer} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. - * @param {integer} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. - * - * @return {this} This CanvasTexture. - */ - putData: function (imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight) - { - if (dirtyX === undefined) { dirtyX = 0; } - if (dirtyY === undefined) { dirtyY = 0; } - if (dirtyWidth === undefined) { dirtyWidth = imageData.width; } - if (dirtyHeight === undefined) { dirtyHeight = imageData.height; } - - this.context.putImageData(imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight); - - return this; - }, - - /** - * Gets an ImageData region from this CanvasTexture from the position and size specified. - * You can write this back using `CanvasTexture.putData`, or manipulate it. - * - * @method Phaser.Textures.CanvasTexture#getData - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. - * @param {integer} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. - * - * @return {ImageData} The ImageData extracted from this CanvasTexture. - */ - getData: function (x, y, width, height) - { - x = Clamp(Math.floor(x), 0, this.width - 1); - y = Clamp(Math.floor(y), 0, this.height - 1); - width = Clamp(width, 1, this.width - x); - height = Clamp(height, 1, this.height - y); - - var imageData = this.context.getImageData(x, y, width, height); - - return imageData; - }, - - /** - * Get the color of a specific pixel from this texture and store it in a Color object. - * - * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, - * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. - * - * @method Phaser.Textures.CanvasTexture#getPixel - * @since 3.13.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {Phaser.Display.Color} [out] - A Color object to store the pixel values in. If not provided a new Color object will be created. - * - * @return {Phaser.Display.Color} An object with the red, green, blue and alpha values set in the r, g, b and a properties. - */ - getPixel: function (x, y, out) - { - if (!out) - { - out = new Color(); - } - - var index = this.getIndex(x, y); - - if (index > -1) - { - var data = this.data; - - var r = data[index + 0]; - var g = data[index + 1]; - var b = data[index + 2]; - var a = data[index + 3]; - - out.setTo(r, g, b, a); - } - - return out; - }, - - /** - * Returns an array containing all of the pixels in the given region. - * - * If the requested region extends outside the bounds of this CanvasTexture, - * the region is truncated to fit. - * - * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, - * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. - * - * @method Phaser.Textures.CanvasTexture#getPixels - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} width - The width of the region to get. Must be an integer. - * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. - * - * @return {Phaser.Types.Textures.PixelConfig[]} An array of Pixel objects. - */ - getPixels: function (x, y, width, height) - { - if (height === undefined) { height = width; } - - x = Math.abs(Math.round(x)); - y = Math.abs(Math.round(y)); - - var left = Clamp(x, 0, this.width); - var right = Clamp(x + width, 0, this.width); - var top = Clamp(y, 0, this.height); - var bottom = Clamp(y + height, 0, this.height); - - var pixel = new Color(); - - var out = []; - - for (var py = top; py < bottom; py++) - { - var row = []; - - for (var px = left; px < right; px++) - { - pixel = this.getPixel(px, py, pixel); - - row.push({ x: px, y: py, color: pixel.color, alpha: pixel.alphaGL }); - } - - out.push(row); - } - - return out; - }, - - /** - * Returns the Image Data index for the given pixel in this CanvasTexture. - * - * The index can be used to read directly from the `this.data` array. - * - * The index points to the red value in the array. The subsequent 3 indexes - * point to green, blue and alpha respectively. - * - * @method Phaser.Textures.CanvasTexture#getIndex - * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * - * @return {integer} - */ - getIndex: function (x, y) - { - x = Math.abs(Math.round(x)); - y = Math.abs(Math.round(y)); - - if (x < this.width && y < this.height) - { - return (x + y * this.width) * 4; - } - else - { - return -1; - } - }, - - /** - * This should be called manually if you are running under WebGL. - * It will refresh the WebGLTexture from the Canvas source. Only call this if you know that the - * canvas has changed, as there is a significant GPU texture allocation cost involved in doing so. - * - * @method Phaser.Textures.CanvasTexture#refresh - * @since 3.7.0 - * - * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. - */ - refresh: function () - { - this._source.update(); - - return this; - }, - - /** - * Gets the Canvas Element. - * - * @method Phaser.Textures.CanvasTexture#getCanvas - * @since 3.7.0 - * - * @return {HTMLCanvasElement} The Canvas DOM element this texture is using. - */ - getCanvas: function () - { - return this.canvas; - }, - - /** - * Gets the 2D Canvas Rendering Context. - * - * @method Phaser.Textures.CanvasTexture#getContext - * @since 3.7.0 - * - * @return {CanvasRenderingContext2D} The Canvas Rendering Context this texture is using. - */ - getContext: function () - { - return this.context; - }, - - /** - * Clears the given region of this Canvas Texture, resetting it back to transparent. - * If no region is given, the whole Canvas Texture is cleared. - * - * @method Phaser.Textures.CanvasTexture#clear - * @since 3.7.0 - * - * @param {integer} [x=0] - The x coordinate of the top-left of the region to clear. - * @param {integer} [y=0] - The y coordinate of the top-left of the region to clear. - * @param {integer} [width] - The width of the region. - * @param {integer} [height] - The height of the region. - * - * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. - */ - clear: function (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = this.width; } - if (height === undefined) { height = this.height; } - - this.context.clearRect(x, y, width, height); - - return this.update(); - }, - - /** - * Changes the size of this Canvas Texture. - * - * @method Phaser.Textures.CanvasTexture#setSize - * @since 3.7.0 - * - * @param {integer} width - The new width of the Canvas. - * @param {integer} [height] - The new height of the Canvas. If not given it will use the width as the height. - * - * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. - */ - setSize: function (width, height) - { - if (height === undefined) { height = width; } - - if (width !== this.width || height !== this.height) - { - // Update the Canvas - this.canvas.width = width; - this.canvas.height = height; - - // Update the Texture Source - this._source.width = width; - this._source.height = height; - this._source.isPowerOf2 = IsSizePowerOfTwo(width, height); - - // Update the Frame - this.frames['__BASE'].setSize(width, height, 0, 0); - - this.refresh(); - } - - return this; - }, - - /** - * Destroys this Texture and releases references to its sources and frames. - * - * @method Phaser.Textures.CanvasTexture#destroy - * @since 3.16.0 - */ - destroy: function () - { - Texture.prototype.destroy.call(this); - - this._source = null; - this.canvas = null; - this.context = null; - this.imageData = null; - this.data = null; - this.pixels = null; - this.buffer = null; - } - -}); - -module.exports = CanvasTexture; - - -/***/ }), -/* 843 */ +/* 847 */ /***/ (function(module, exports) { /** @@ -135281,7 +136698,7 @@ module.exports = AtlasXML; /***/ }), -/* 844 */ +/* 848 */ /***/ (function(module, exports) { /** @@ -135316,7 +136733,7 @@ module.exports = Canvas; /***/ }), -/* 845 */ +/* 849 */ /***/ (function(module, exports) { /** @@ -135351,7 +136768,7 @@ module.exports = Image; /***/ }), -/* 846 */ +/* 850 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135360,7 +136777,7 @@ module.exports = Image; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(64); +var Clone = __webpack_require__(65); /** * Parses a Texture Atlas JSON Array and adds the Frames to the Texture. @@ -135458,7 +136875,7 @@ module.exports = JSONArray; /***/ }), -/* 847 */ +/* 851 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135467,7 +136884,7 @@ module.exports = JSONArray; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(64); +var Clone = __webpack_require__(65); /** * Parses a Texture Atlas JSON Hash and adds the Frames to the Texture. @@ -135557,7 +136974,7 @@ module.exports = JSONHash; /***/ }), -/* 848 */ +/* 852 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135682,7 +137099,7 @@ module.exports = SpriteSheet; /***/ }), -/* 849 */ +/* 853 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135873,7 +137290,7 @@ module.exports = SpriteSheetFromAtlas; /***/ }), -/* 850 */ +/* 854 */ /***/ (function(module, exports) { /** @@ -136043,7 +137460,7 @@ TextureImporter: /***/ }), -/* 851 */ +/* 855 */ /***/ (function(module, exports) { /** @@ -136074,7 +137491,7 @@ module.exports = 'complete'; /***/ }), -/* 852 */ +/* 856 */ /***/ (function(module, exports) { /** @@ -136104,7 +137521,7 @@ module.exports = 'decoded'; /***/ }), -/* 853 */ +/* 857 */ /***/ (function(module, exports) { /** @@ -136136,7 +137553,7 @@ module.exports = 'decodedall'; /***/ }), -/* 854 */ +/* 858 */ /***/ (function(module, exports) { /** @@ -136168,7 +137585,7 @@ module.exports = 'destroy'; /***/ }), -/* 855 */ +/* 859 */ /***/ (function(module, exports) { /** @@ -136201,7 +137618,7 @@ module.exports = 'detune'; /***/ }), -/* 856 */ +/* 860 */ /***/ (function(module, exports) { /** @@ -136229,7 +137646,7 @@ module.exports = 'detune'; /***/ }), -/* 857 */ +/* 861 */ /***/ (function(module, exports) { /** @@ -136256,7 +137673,7 @@ module.exports = 'mute'; /***/ }), -/* 858 */ +/* 862 */ /***/ (function(module, exports) { /** @@ -136284,7 +137701,7 @@ module.exports = 'rate'; /***/ }), -/* 859 */ +/* 863 */ /***/ (function(module, exports) { /** @@ -136311,7 +137728,7 @@ module.exports = 'volume'; /***/ }), -/* 860 */ +/* 864 */ /***/ (function(module, exports) { /** @@ -136345,7 +137762,7 @@ module.exports = 'loop'; /***/ }), -/* 861 */ +/* 865 */ /***/ (function(module, exports) { /** @@ -136379,7 +137796,7 @@ module.exports = 'looped'; /***/ }), -/* 862 */ +/* 866 */ /***/ (function(module, exports) { /** @@ -136412,7 +137829,7 @@ module.exports = 'mute'; /***/ }), -/* 863 */ +/* 867 */ /***/ (function(module, exports) { /** @@ -136439,7 +137856,7 @@ module.exports = 'pauseall'; /***/ }), -/* 864 */ +/* 868 */ /***/ (function(module, exports) { /** @@ -136471,7 +137888,7 @@ module.exports = 'pause'; /***/ }), -/* 865 */ +/* 869 */ /***/ (function(module, exports) { /** @@ -136502,7 +137919,7 @@ module.exports = 'play'; /***/ }), -/* 866 */ +/* 870 */ /***/ (function(module, exports) { /** @@ -136535,7 +137952,7 @@ module.exports = 'rate'; /***/ }), -/* 867 */ +/* 871 */ /***/ (function(module, exports) { /** @@ -136562,7 +137979,7 @@ module.exports = 'resumeall'; /***/ }), -/* 868 */ +/* 872 */ /***/ (function(module, exports) { /** @@ -136595,7 +138012,7 @@ module.exports = 'resume'; /***/ }), -/* 869 */ +/* 873 */ /***/ (function(module, exports) { /** @@ -136628,7 +138045,7 @@ module.exports = 'seek'; /***/ }), -/* 870 */ +/* 874 */ /***/ (function(module, exports) { /** @@ -136655,7 +138072,7 @@ module.exports = 'stopall'; /***/ }), -/* 871 */ +/* 875 */ /***/ (function(module, exports) { /** @@ -136687,7 +138104,7 @@ module.exports = 'stop'; /***/ }), -/* 872 */ +/* 876 */ /***/ (function(module, exports) { /** @@ -136714,7 +138131,7 @@ module.exports = 'unlocked'; /***/ }), -/* 873 */ +/* 877 */ /***/ (function(module, exports) { /** @@ -136747,7 +138164,7 @@ module.exports = 'volume'; /***/ }), -/* 874 */ +/* 878 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136762,99 +138179,99 @@ module.exports = 'volume'; var GameObjects = { - Events: __webpack_require__(110), + Events: __webpack_require__(111), - DisplayList: __webpack_require__(875), - GameObjectCreator: __webpack_require__(15), - GameObjectFactory: __webpack_require__(5), - UpdateList: __webpack_require__(903), + DisplayList: __webpack_require__(879), + GameObjectCreator: __webpack_require__(16), + GameObjectFactory: __webpack_require__(6), + UpdateList: __webpack_require__(907), Components: __webpack_require__(12), - BuildGameObject: __webpack_require__(29), - BuildGameObjectAnimation: __webpack_require__(363), + BuildGameObject: __webpack_require__(28), + BuildGameObjectAnimation: __webpack_require__(366), GameObject: __webpack_require__(13), - BitmapText: __webpack_require__(128), - Blitter: __webpack_require__(182), - Container: __webpack_require__(183), - DOMElement: __webpack_require__(365), - DynamicBitmapText: __webpack_require__(184), - Extern: __webpack_require__(367), - Graphics: __webpack_require__(185), - Group: __webpack_require__(94), - Image: __webpack_require__(95), - Particles: __webpack_require__(932), - PathFollower: __webpack_require__(379), - RenderTexture: __webpack_require__(189), - RetroFont: __webpack_require__(941), - Sprite: __webpack_require__(67), - Text: __webpack_require__(190), - TileSprite: __webpack_require__(191), - Zone: __webpack_require__(106), + BitmapText: __webpack_require__(129), + Blitter: __webpack_require__(184), + Container: __webpack_require__(185), + DOMElement: __webpack_require__(368), + DynamicBitmapText: __webpack_require__(186), + Extern: __webpack_require__(370), + Graphics: __webpack_require__(187), + Group: __webpack_require__(95), + Image: __webpack_require__(96), + Particles: __webpack_require__(936), + PathFollower: __webpack_require__(382), + RenderTexture: __webpack_require__(191), + RetroFont: __webpack_require__(945), + Sprite: __webpack_require__(68), + Text: __webpack_require__(192), + TileSprite: __webpack_require__(193), + Zone: __webpack_require__(107), // Shapes - Shape: __webpack_require__(30), - Arc: __webpack_require__(381), - Curve: __webpack_require__(382), - Ellipse: __webpack_require__(383), - Grid: __webpack_require__(384), - IsoBox: __webpack_require__(385), - IsoTriangle: __webpack_require__(386), - Line: __webpack_require__(387), - Polygon: __webpack_require__(388), - Rectangle: __webpack_require__(393), - Star: __webpack_require__(394), - Triangle: __webpack_require__(395), + Shape: __webpack_require__(29), + Arc: __webpack_require__(384), + Curve: __webpack_require__(385), + Ellipse: __webpack_require__(386), + Grid: __webpack_require__(387), + IsoBox: __webpack_require__(388), + IsoTriangle: __webpack_require__(389), + Line: __webpack_require__(390), + Polygon: __webpack_require__(391), + Rectangle: __webpack_require__(396), + Star: __webpack_require__(397), + Triangle: __webpack_require__(398), // Game Object Factories Factories: { - Blitter: __webpack_require__(986), - Container: __webpack_require__(987), - DOMElement: __webpack_require__(988), - DynamicBitmapText: __webpack_require__(989), - Extern: __webpack_require__(990), - Graphics: __webpack_require__(991), - Group: __webpack_require__(992), - Image: __webpack_require__(993), - Particles: __webpack_require__(994), - PathFollower: __webpack_require__(995), - RenderTexture: __webpack_require__(996), - Sprite: __webpack_require__(997), - StaticBitmapText: __webpack_require__(998), - Text: __webpack_require__(999), - TileSprite: __webpack_require__(1000), - Zone: __webpack_require__(1001), + Blitter: __webpack_require__(990), + Container: __webpack_require__(991), + DOMElement: __webpack_require__(992), + DynamicBitmapText: __webpack_require__(993), + Extern: __webpack_require__(994), + Graphics: __webpack_require__(995), + Group: __webpack_require__(996), + Image: __webpack_require__(997), + Particles: __webpack_require__(998), + PathFollower: __webpack_require__(999), + RenderTexture: __webpack_require__(1000), + Sprite: __webpack_require__(1001), + StaticBitmapText: __webpack_require__(1002), + Text: __webpack_require__(1003), + TileSprite: __webpack_require__(1004), + Zone: __webpack_require__(1005), // Shapes - Arc: __webpack_require__(1002), - Curve: __webpack_require__(1003), - Ellipse: __webpack_require__(1004), - Grid: __webpack_require__(1005), - IsoBox: __webpack_require__(1006), - IsoTriangle: __webpack_require__(1007), - Line: __webpack_require__(1008), - Polygon: __webpack_require__(1009), - Rectangle: __webpack_require__(1010), - Star: __webpack_require__(1011), - Triangle: __webpack_require__(1012) + Arc: __webpack_require__(1006), + Curve: __webpack_require__(1007), + Ellipse: __webpack_require__(1008), + Grid: __webpack_require__(1009), + IsoBox: __webpack_require__(1010), + IsoTriangle: __webpack_require__(1011), + Line: __webpack_require__(1012), + Polygon: __webpack_require__(1013), + Rectangle: __webpack_require__(1014), + Star: __webpack_require__(1015), + Triangle: __webpack_require__(1016) }, Creators: { - Blitter: __webpack_require__(1013), - Container: __webpack_require__(1014), - DynamicBitmapText: __webpack_require__(1015), - Graphics: __webpack_require__(1016), - Group: __webpack_require__(1017), - Image: __webpack_require__(1018), - Particles: __webpack_require__(1019), - RenderTexture: __webpack_require__(1020), - Sprite: __webpack_require__(1021), - StaticBitmapText: __webpack_require__(1022), - Text: __webpack_require__(1023), - TileSprite: __webpack_require__(1024), - Zone: __webpack_require__(1025) + Blitter: __webpack_require__(1017), + Container: __webpack_require__(1018), + DynamicBitmapText: __webpack_require__(1019), + Graphics: __webpack_require__(1020), + Group: __webpack_require__(1021), + Image: __webpack_require__(1022), + Particles: __webpack_require__(1023), + RenderTexture: __webpack_require__(1024), + Sprite: __webpack_require__(1025), + StaticBitmapText: __webpack_require__(1026), + Text: __webpack_require__(1027), + TileSprite: __webpack_require__(1028), + Zone: __webpack_require__(1029) } }; @@ -136862,29 +138279,29 @@ var GameObjects = { if (true) { // WebGL only Game Objects - GameObjects.Mesh = __webpack_require__(129); - GameObjects.Quad = __webpack_require__(194); - GameObjects.Shader = __webpack_require__(195); + GameObjects.Mesh = __webpack_require__(130); + GameObjects.Quad = __webpack_require__(196); + GameObjects.Shader = __webpack_require__(197); - GameObjects.Factories.Mesh = __webpack_require__(1032); - GameObjects.Factories.Quad = __webpack_require__(1033); - GameObjects.Factories.Shader = __webpack_require__(1034); + GameObjects.Factories.Mesh = __webpack_require__(1036); + GameObjects.Factories.Quad = __webpack_require__(1037); + GameObjects.Factories.Shader = __webpack_require__(1038); - GameObjects.Creators.Mesh = __webpack_require__(1035); - GameObjects.Creators.Quad = __webpack_require__(1036); - GameObjects.Creators.Shader = __webpack_require__(1037); + GameObjects.Creators.Mesh = __webpack_require__(1039); + GameObjects.Creators.Quad = __webpack_require__(1040); + GameObjects.Creators.Shader = __webpack_require__(1041); - GameObjects.Light = __webpack_require__(399); + GameObjects.Light = __webpack_require__(402); - __webpack_require__(400); - __webpack_require__(1038); + __webpack_require__(403); + __webpack_require__(1042); } module.exports = GameObjects; /***/ }), -/* 875 */ +/* 879 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136894,10 +138311,10 @@ module.exports = GameObjects; */ var Class = __webpack_require__(0); -var List = __webpack_require__(125); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var StableSort = __webpack_require__(127); +var List = __webpack_require__(126); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var StableSort = __webpack_require__(128); /** * @classdesc @@ -137089,7 +138506,7 @@ module.exports = DisplayList; /***/ }), -/* 876 */ +/* 880 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137104,21 +138521,21 @@ module.exports = DisplayList; module.exports = { - CheckMatrix: __webpack_require__(179), - MatrixToString: __webpack_require__(877), - ReverseColumns: __webpack_require__(878), - ReverseRows: __webpack_require__(879), - Rotate180: __webpack_require__(880), - RotateLeft: __webpack_require__(881), - RotateMatrix: __webpack_require__(126), - RotateRight: __webpack_require__(882), - TransposeMatrix: __webpack_require__(360) + CheckMatrix: __webpack_require__(181), + MatrixToString: __webpack_require__(881), + ReverseColumns: __webpack_require__(882), + ReverseRows: __webpack_require__(883), + Rotate180: __webpack_require__(884), + RotateLeft: __webpack_require__(885), + RotateMatrix: __webpack_require__(127), + RotateRight: __webpack_require__(886), + TransposeMatrix: __webpack_require__(363) }; /***/ }), -/* 877 */ +/* 881 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137127,8 +138544,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pad = __webpack_require__(158); -var CheckMatrix = __webpack_require__(179); +var Pad = __webpack_require__(159); +var CheckMatrix = __webpack_require__(181); /** * Generates a string (which you can pass to console.log) from the given Array Matrix. @@ -137199,7 +138616,7 @@ module.exports = MatrixToString; /***/ }), -/* 878 */ +/* 882 */ /***/ (function(module, exports) { /** @@ -137230,7 +138647,7 @@ module.exports = ReverseColumns; /***/ }), -/* 879 */ +/* 883 */ /***/ (function(module, exports) { /** @@ -137266,7 +138683,7 @@ module.exports = ReverseRows; /***/ }), -/* 880 */ +/* 884 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137275,7 +138692,7 @@ module.exports = ReverseRows; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(126); +var RotateMatrix = __webpack_require__(127); /** * Rotates the array matrix 180 degrees. @@ -137299,7 +138716,7 @@ module.exports = Rotate180; /***/ }), -/* 881 */ +/* 885 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137308,7 +138725,7 @@ module.exports = Rotate180; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(126); +var RotateMatrix = __webpack_require__(127); /** * Rotates the array matrix to the left (or 90 degrees) @@ -137332,7 +138749,7 @@ module.exports = RotateLeft; /***/ }), -/* 882 */ +/* 886 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137341,7 +138758,7 @@ module.exports = RotateLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(126); +var RotateMatrix = __webpack_require__(127); /** * Rotates the array matrix to the left (or -90 degrees) @@ -137365,7 +138782,7 @@ module.exports = RotateRight; /***/ }), -/* 883 */ +/* 887 */ /***/ (function(module, exports) { /** @@ -137482,7 +138899,7 @@ module.exports = Add; /***/ }), -/* 884 */ +/* 888 */ /***/ (function(module, exports) { /** @@ -137604,7 +139021,7 @@ module.exports = AddAt; /***/ }), -/* 885 */ +/* 889 */ /***/ (function(module, exports) { /** @@ -137642,7 +139059,7 @@ module.exports = BringToTop; /***/ }), -/* 886 */ +/* 890 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137651,7 +139068,7 @@ module.exports = BringToTop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Returns the total number of elements in the array which have a property matching the given value. @@ -137694,7 +139111,7 @@ module.exports = CountAllMatching; /***/ }), -/* 887 */ +/* 891 */ /***/ (function(module, exports) { /** @@ -137740,7 +139157,7 @@ module.exports = Each; /***/ }), -/* 888 */ +/* 892 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137749,7 +139166,7 @@ module.exports = Each; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Passes each element in the array, between the start and end indexes, to the given callback. @@ -137796,7 +139213,7 @@ module.exports = EachInRange; /***/ }), -/* 889 */ +/* 893 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137805,7 +139222,7 @@ module.exports = EachInRange; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Returns all elements in the array. @@ -137858,7 +139275,7 @@ module.exports = GetAll; /***/ }), -/* 890 */ +/* 894 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137867,7 +139284,7 @@ module.exports = GetAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Returns the first element in the array. @@ -137917,7 +139334,7 @@ module.exports = GetFirst; /***/ }), -/* 891 */ +/* 895 */ /***/ (function(module, exports) { /** @@ -137959,7 +139376,7 @@ module.exports = MoveDown; /***/ }), -/* 892 */ +/* 896 */ /***/ (function(module, exports) { /** @@ -138006,7 +139423,7 @@ module.exports = MoveTo; /***/ }), -/* 893 */ +/* 897 */ /***/ (function(module, exports) { /** @@ -138048,7 +139465,7 @@ module.exports = MoveUp; /***/ }), -/* 894 */ +/* 898 */ /***/ (function(module, exports) { /** @@ -138112,7 +139529,7 @@ module.exports = NumberArray; /***/ }), -/* 895 */ +/* 899 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138121,7 +139538,7 @@ module.exports = NumberArray; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RoundAwayFromZero = __webpack_require__(306); +var RoundAwayFromZero = __webpack_require__(309); /** * Create an array of numbers (positive and/or negative) progressing from `start` @@ -138189,7 +139606,7 @@ module.exports = NumberArrayStep; /***/ }), -/* 896 */ +/* 900 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138198,7 +139615,7 @@ module.exports = NumberArrayStep; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(78); +var SpliceOne = __webpack_require__(79); /** * Removes the item from the given position in the array. @@ -138240,7 +139657,7 @@ module.exports = RemoveAt; /***/ }), -/* 897 */ +/* 901 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138249,7 +139666,7 @@ module.exports = RemoveAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Removes the item within the given range in the array. @@ -138303,7 +139720,7 @@ module.exports = RemoveBetween; /***/ }), -/* 898 */ +/* 902 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138312,7 +139729,7 @@ module.exports = RemoveBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(78); +var SpliceOne = __webpack_require__(79); /** * Removes a random object from the given array and returns it. @@ -138341,7 +139758,7 @@ module.exports = RemoveRandomElement; /***/ }), -/* 899 */ +/* 903 */ /***/ (function(module, exports) { /** @@ -138384,7 +139801,7 @@ module.exports = Replace; /***/ }), -/* 900 */ +/* 904 */ /***/ (function(module, exports) { /** @@ -138422,7 +139839,7 @@ module.exports = SendToBack; /***/ }), -/* 901 */ +/* 905 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138431,7 +139848,7 @@ module.exports = SendToBack; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(66); +var SafeRange = __webpack_require__(67); /** * Scans the array for elements with the given property. If found, the property is set to the `value`. @@ -138477,7 +139894,7 @@ module.exports = SetAll; /***/ }), -/* 902 */ +/* 906 */ /***/ (function(module, exports) { /** @@ -138525,7 +139942,7 @@ module.exports = Swap; /***/ }), -/* 903 */ +/* 907 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138535,8 +139952,8 @@ module.exports = Swap; */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -138723,9 +140140,12 @@ var UpdateList = new Class({ */ update: function (time, delta) { - for (var i = 0; i < this._list.length; i++) + var list = this._list; + var length = list.length; + + for (var i = 0; i < length; i++) { - var gameObject = this._list[i]; + var gameObject = list[i]; if (gameObject.active) { @@ -138746,9 +140166,7 @@ var UpdateList = new Class({ */ remove: function (child) { - var index = this._pendingRemoval.indexOf(child); - - if (index !== -1) + if (this._list.indexOf(child) !== -1 && this._pendingRemoval.indexOf(child) === -1) { this._pendingRemoval.push(child); } @@ -138859,7 +140277,7 @@ module.exports = UpdateList; /***/ }), -/* 904 */ +/* 908 */ /***/ (function(module, exports) { /** @@ -139072,7 +140490,7 @@ module.exports = GetBitmapTextSize; /***/ }), -/* 905 */ +/* 909 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139081,7 +140499,7 @@ module.exports = GetBitmapTextSize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ParseXMLBitmapFont = __webpack_require__(181); +var ParseXMLBitmapFont = __webpack_require__(183); /** * Parse an XML Bitmap Font from an Atlas. @@ -139125,7 +140543,7 @@ module.exports = ParseFromAtlas; /***/ }), -/* 906 */ +/* 910 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139139,12 +140557,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(907); + renderWebGL = __webpack_require__(911); } if (true) { - renderCanvas = __webpack_require__(908); + renderCanvas = __webpack_require__(912); } module.exports = { @@ -139156,7 +140574,7 @@ module.exports = { /***/ }), -/* 907 */ +/* 911 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139385,7 +140803,7 @@ module.exports = BitmapTextWebGLRenderer; /***/ }), -/* 908 */ +/* 912 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139394,7 +140812,7 @@ module.exports = BitmapTextWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTransform = __webpack_require__(25); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -139560,7 +140978,7 @@ module.exports = BitmapTextCanvasRenderer; /***/ }), -/* 909 */ +/* 913 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139574,12 +140992,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(910); + renderWebGL = __webpack_require__(914); } if (true) { - renderCanvas = __webpack_require__(911); + renderCanvas = __webpack_require__(915); } module.exports = { @@ -139591,7 +141009,7 @@ module.exports = { /***/ }), -/* 910 */ +/* 914 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139721,7 +141139,7 @@ module.exports = BlitterWebGLRenderer; /***/ }), -/* 911 */ +/* 915 */ /***/ (function(module, exports) { /** @@ -139849,7 +141267,7 @@ module.exports = BlitterCanvasRenderer; /***/ }), -/* 912 */ +/* 916 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139859,7 +141277,7 @@ module.exports = BlitterCanvasRenderer; */ var Class = __webpack_require__(0); -var Frame = __webpack_require__(91); +var Frame = __webpack_require__(92); /** * @classdesc @@ -140233,7 +141651,7 @@ module.exports = Bob; /***/ }), -/* 913 */ +/* 917 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140248,12 +141666,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(914); + renderWebGL = __webpack_require__(918); } if (true) { - renderCanvas = __webpack_require__(915); + renderCanvas = __webpack_require__(919); } module.exports = { @@ -140265,7 +141683,7 @@ module.exports = { /***/ }), -/* 914 */ +/* 918 */ /***/ (function(module, exports) { /** @@ -140335,7 +141753,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent continue; } - var childAlpha = child._alpha; + var childAlpha = child.alpha; var childScrollFactorX = child.scrollFactorX; var childScrollFactorY = child.scrollFactorY; @@ -140372,7 +141790,7 @@ module.exports = ContainerWebGLRenderer; /***/ }), -/* 915 */ +/* 919 */ /***/ (function(module, exports) { /** @@ -140442,7 +141860,7 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen continue; } - var childAlpha = child._alpha; + var childAlpha = child.alpha; var childBlendMode = child._blendMode; var childScrollFactorX = child.scrollFactorX; var childScrollFactorY = child.scrollFactorY; @@ -140470,7 +141888,7 @@ module.exports = ContainerCanvasRenderer; /***/ }), -/* 916 */ +/* 920 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140484,12 +141902,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(366); + renderWebGL = __webpack_require__(369); } if (true) { - renderCanvas = __webpack_require__(366); + renderCanvas = __webpack_require__(369); } module.exports = { @@ -140501,7 +141919,7 @@ module.exports = { /***/ }), -/* 917 */ +/* 921 */ /***/ (function(module, exports) { /** @@ -140542,7 +141960,7 @@ module.exports = [ /***/ }), -/* 918 */ +/* 922 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140556,12 +141974,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(919); + renderWebGL = __webpack_require__(923); } if (true) { - renderCanvas = __webpack_require__(920); + renderCanvas = __webpack_require__(924); } module.exports = { @@ -140573,7 +141991,7 @@ module.exports = { /***/ }), -/* 919 */ +/* 923 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140879,7 +142297,7 @@ module.exports = DynamicBitmapTextWebGLRenderer; /***/ }), -/* 920 */ +/* 924 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140888,7 +142306,7 @@ module.exports = DynamicBitmapTextWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTransform = __webpack_require__(25); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -141058,7 +142476,7 @@ module.exports = DynamicBitmapTextCanvasRenderer; /***/ }), -/* 921 */ +/* 925 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141072,12 +142490,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(922); + renderWebGL = __webpack_require__(926); } if (true) { - renderCanvas = __webpack_require__(923); + renderCanvas = __webpack_require__(927); } module.exports = { @@ -141089,7 +142507,7 @@ module.exports = { /***/ }), -/* 922 */ +/* 926 */ /***/ (function(module, exports) { /** @@ -141158,13 +142576,13 @@ module.exports = ExternWebGLRenderer; /***/ }), -/* 923 */ +/* 927 */ /***/ (function(module, exports) { /***/ }), -/* 924 */ +/* 928 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141178,15 +142596,15 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(925); + renderWebGL = __webpack_require__(929); // Needed for Graphics.generateTexture - renderCanvas = __webpack_require__(371); + renderCanvas = __webpack_require__(374); } if (true) { - renderCanvas = __webpack_require__(371); + renderCanvas = __webpack_require__(374); } module.exports = { @@ -141198,7 +142616,7 @@ module.exports = { /***/ }), -/* 925 */ +/* 929 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141207,7 +142625,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Commands = __webpack_require__(186); +var Commands = __webpack_require__(188); var Utils = __webpack_require__(9); // TODO: Remove the use of this @@ -141563,7 +142981,7 @@ module.exports = GraphicsWebGLRenderer; /***/ }), -/* 926 */ +/* 930 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141577,12 +142995,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(927); + renderWebGL = __webpack_require__(931); } if (true) { - renderCanvas = __webpack_require__(928); + renderCanvas = __webpack_require__(932); } module.exports = { @@ -141594,7 +143012,7 @@ module.exports = { /***/ }), -/* 927 */ +/* 931 */ /***/ (function(module, exports) { /** @@ -141627,7 +143045,7 @@ module.exports = SpriteWebGLRenderer; /***/ }), -/* 928 */ +/* 932 */ /***/ (function(module, exports) { /** @@ -141660,7 +143078,7 @@ module.exports = SpriteCanvasRenderer; /***/ }), -/* 929 */ +/* 933 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141674,12 +143092,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(930); + renderWebGL = __webpack_require__(934); } if (true) { - renderCanvas = __webpack_require__(931); + renderCanvas = __webpack_require__(935); } module.exports = { @@ -141691,7 +143109,7 @@ module.exports = { /***/ }), -/* 930 */ +/* 934 */ /***/ (function(module, exports) { /** @@ -141724,7 +143142,7 @@ module.exports = ImageWebGLRenderer; /***/ }), -/* 931 */ +/* 935 */ /***/ (function(module, exports) { /** @@ -141757,7 +143175,7 @@ module.exports = ImageCanvasRenderer; /***/ }), -/* 932 */ +/* 936 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141772,17 +143190,17 @@ module.exports = ImageCanvasRenderer; module.exports = { - GravityWell: __webpack_require__(372), - Particle: __webpack_require__(373), - ParticleEmitter: __webpack_require__(374), - ParticleEmitterManager: __webpack_require__(188), - Zones: __webpack_require__(937) + GravityWell: __webpack_require__(375), + Particle: __webpack_require__(376), + ParticleEmitter: __webpack_require__(377), + ParticleEmitterManager: __webpack_require__(190), + Zones: __webpack_require__(941) }; /***/ }), -/* 933 */ +/* 937 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141792,10 +143210,10 @@ module.exports = { */ var Class = __webpack_require__(0); -var FloatBetween = __webpack_require__(304); -var GetEaseFunction = __webpack_require__(96); +var FloatBetween = __webpack_require__(307); +var GetEaseFunction = __webpack_require__(82); var GetFastValue = __webpack_require__(2); -var Wrap = __webpack_require__(56); +var Wrap = __webpack_require__(57); /** * @classdesc @@ -142373,7 +143791,7 @@ module.exports = EmitterOp; /***/ }), -/* 934 */ +/* 938 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142387,12 +143805,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(935); + renderWebGL = __webpack_require__(939); } if (true) { - renderCanvas = __webpack_require__(936); + renderCanvas = __webpack_require__(940); } module.exports = { @@ -142404,7 +143822,7 @@ module.exports = { /***/ }), -/* 935 */ +/* 939 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142563,7 +143981,7 @@ module.exports = ParticleManagerWebGLRenderer; /***/ }), -/* 936 */ +/* 940 */ /***/ (function(module, exports) { /** @@ -142684,7 +144102,7 @@ module.exports = ParticleManagerCanvasRenderer; /***/ }), -/* 937 */ +/* 941 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142699,15 +144117,15 @@ module.exports = ParticleManagerCanvasRenderer; module.exports = { - DeathZone: __webpack_require__(375), - EdgeZone: __webpack_require__(376), - RandomZone: __webpack_require__(378) + DeathZone: __webpack_require__(378), + EdgeZone: __webpack_require__(379), + RandomZone: __webpack_require__(381) }; /***/ }), -/* 938 */ +/* 942 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142721,12 +144139,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(939); + renderWebGL = __webpack_require__(943); } if (true) { - renderCanvas = __webpack_require__(940); + renderCanvas = __webpack_require__(944); } module.exports = { @@ -142738,7 +144156,7 @@ module.exports = { /***/ }), -/* 939 */ +/* 943 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142801,7 +144219,7 @@ module.exports = RenderTextureWebGLRenderer; /***/ }), -/* 940 */ +/* 944 */ /***/ (function(module, exports) { /** @@ -142834,7 +144252,7 @@ module.exports = RenderTextureCanvasRenderer; /***/ }), -/* 941 */ +/* 945 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142843,15 +144261,15 @@ module.exports = RenderTextureCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RETRO_FONT_CONST = __webpack_require__(942); -var Extend = __webpack_require__(17); +var RETRO_FONT_CONST = __webpack_require__(946); +var Extend = __webpack_require__(15); /** * @namespace Phaser.GameObjects.RetroFont * @since 3.6.0 */ -var RetroFont = { Parse: __webpack_require__(943) }; +var RetroFont = { Parse: __webpack_require__(947) }; // Merge in the consts RetroFont = Extend(false, RetroFont, RETRO_FONT_CONST); @@ -142860,7 +144278,7 @@ module.exports = RetroFont; /***/ }), -/* 942 */ +/* 946 */ /***/ (function(module, exports) { /** @@ -142976,7 +144394,7 @@ module.exports = RETRO_FONT_CONST; /***/ }), -/* 943 */ +/* 947 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142985,7 +144403,7 @@ module.exports = RETRO_FONT_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** * Parses a Retro Font configuration object so you can pass it to the BitmapText constructor @@ -143092,7 +144510,7 @@ module.exports = ParseRetroFont; /***/ }), -/* 944 */ +/* 948 */ /***/ (function(module, exports) { /** @@ -143174,7 +144592,7 @@ module.exports = GetTextSize; /***/ }), -/* 945 */ +/* 949 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143188,12 +144606,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(946); + renderWebGL = __webpack_require__(950); } if (true) { - renderCanvas = __webpack_require__(947); + renderCanvas = __webpack_require__(951); } module.exports = { @@ -143205,7 +144623,7 @@ module.exports = { /***/ }), -/* 946 */ +/* 950 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143270,7 +144688,7 @@ module.exports = TextWebGLRenderer; /***/ }), -/* 947 */ +/* 951 */ /***/ (function(module, exports) { /** @@ -143308,7 +144726,7 @@ module.exports = TextCanvasRenderer; /***/ }), -/* 948 */ +/* 952 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143319,8 +144737,8 @@ module.exports = TextCanvasRenderer; var Class = __webpack_require__(0); var GetAdvancedValue = __webpack_require__(14); -var GetValue = __webpack_require__(6); -var MeasureText = __webpack_require__(949); +var GetValue = __webpack_require__(5); +var MeasureText = __webpack_require__(953); // Key: [ Object Key, Default Value ] @@ -143367,7 +144785,7 @@ var propertyMap = { * @since 3.0.0 * * @param {Phaser.GameObjects.Text} text - The Text object that this TextStyle is styling. - * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The style settings to set. + * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The style settings to set. */ var TextStyle = new Class({ @@ -143653,7 +145071,7 @@ var TextStyle = new Class({ * @method Phaser.GameObjects.TextStyle#setStyle * @since 3.0.0 * - * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The style settings to set. + * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The style settings to set. * @param {boolean} [updateText=true] - Whether to update the text immediately. * @param {boolean} [setDefaults=false] - Use the default values is not set, or the local values. * @@ -144361,7 +145779,7 @@ module.exports = TextStyle; /***/ }), -/* 949 */ +/* 953 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144370,7 +145788,7 @@ module.exports = TextStyle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(24); +var CanvasPool = __webpack_require__(25); /** * Calculates the ascent, descent and fontSize of a given font style. @@ -144496,7 +145914,7 @@ module.exports = MeasureText; /***/ }), -/* 950 */ +/* 954 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144510,12 +145928,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(951); + renderWebGL = __webpack_require__(955); } if (true) { - renderCanvas = __webpack_require__(952); + renderCanvas = __webpack_require__(956); } module.exports = { @@ -144527,7 +145945,7 @@ module.exports = { /***/ }), -/* 951 */ +/* 955 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144587,7 +146005,7 @@ module.exports = TileSpriteWebGLRenderer; /***/ }), -/* 952 */ +/* 956 */ /***/ (function(module, exports) { /** @@ -144622,7 +146040,7 @@ module.exports = TileSpriteCanvasRenderer; /***/ }), -/* 953 */ +/* 957 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144636,12 +146054,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(954); + renderWebGL = __webpack_require__(958); } if (true) { - renderCanvas = __webpack_require__(955); + renderCanvas = __webpack_require__(959); } module.exports = { @@ -144653,7 +146071,7 @@ module.exports = { /***/ }), -/* 954 */ +/* 958 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144663,7 +146081,7 @@ module.exports = { */ var FillPathWebGL = __webpack_require__(98); -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -144731,7 +146149,7 @@ module.exports = ArcWebGLRenderer; /***/ }), -/* 955 */ +/* 959 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144742,8 +146160,8 @@ module.exports = ArcWebGLRenderer; var DegToRad = __webpack_require__(35); var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -144807,7 +146225,7 @@ module.exports = ArcCanvasRenderer; /***/ }), -/* 956 */ +/* 960 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144821,12 +146239,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(957); + renderWebGL = __webpack_require__(961); } if (true) { - renderCanvas = __webpack_require__(958); + renderCanvas = __webpack_require__(962); } module.exports = { @@ -144838,7 +146256,7 @@ module.exports = { /***/ }), -/* 957 */ +/* 961 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144848,7 +146266,7 @@ module.exports = { */ var FillPathWebGL = __webpack_require__(98); -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -144916,7 +146334,7 @@ module.exports = CurveWebGLRenderer; /***/ }), -/* 958 */ +/* 962 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144926,8 +146344,8 @@ module.exports = CurveWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -145004,7 +146422,7 @@ module.exports = CurveCanvasRenderer; /***/ }), -/* 959 */ +/* 963 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145018,12 +146436,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(960); + renderWebGL = __webpack_require__(964); } if (true) { - renderCanvas = __webpack_require__(961); + renderCanvas = __webpack_require__(965); } module.exports = { @@ -145035,7 +146453,7 @@ module.exports = { /***/ }), -/* 960 */ +/* 964 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145045,7 +146463,7 @@ module.exports = { */ var FillPathWebGL = __webpack_require__(98); -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -145113,7 +146531,7 @@ module.exports = EllipseWebGLRenderer; /***/ }), -/* 961 */ +/* 965 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145123,8 +146541,8 @@ module.exports = EllipseWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -145198,7 +146616,7 @@ module.exports = EllipseCanvasRenderer; /***/ }), -/* 962 */ +/* 966 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145212,12 +146630,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(963); + renderWebGL = __webpack_require__(967); } if (true) { - renderCanvas = __webpack_require__(964); + renderCanvas = __webpack_require__(968); } module.exports = { @@ -145229,7 +146647,7 @@ module.exports = { /***/ }), -/* 963 */ +/* 967 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145455,7 +146873,7 @@ module.exports = GridWebGLRenderer; /***/ }), -/* 964 */ +/* 968 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145465,8 +146883,8 @@ module.exports = GridWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -145644,7 +147062,7 @@ module.exports = GridCanvasRenderer; /***/ }), -/* 965 */ +/* 969 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145658,12 +147076,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(966); + renderWebGL = __webpack_require__(970); } if (true) { - renderCanvas = __webpack_require__(967); + renderCanvas = __webpack_require__(971); } module.exports = { @@ -145675,7 +147093,7 @@ module.exports = { /***/ }), -/* 966 */ +/* 970 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145833,7 +147251,7 @@ module.exports = IsoBoxWebGLRenderer; /***/ }), -/* 967 */ +/* 971 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145843,7 +147261,7 @@ module.exports = IsoBoxWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var SetTransform = __webpack_require__(25); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -145934,7 +147352,7 @@ module.exports = IsoBoxCanvasRenderer; /***/ }), -/* 968 */ +/* 972 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145948,12 +147366,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(969); + renderWebGL = __webpack_require__(973); } if (true) { - renderCanvas = __webpack_require__(970); + renderCanvas = __webpack_require__(974); } module.exports = { @@ -145965,7 +147383,7 @@ module.exports = { /***/ }), -/* 969 */ +/* 973 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146142,7 +147560,7 @@ module.exports = IsoTriangleWebGLRenderer; /***/ }), -/* 970 */ +/* 974 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146152,7 +147570,7 @@ module.exports = IsoTriangleWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var SetTransform = __webpack_require__(25); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -146256,7 +147674,7 @@ module.exports = IsoTriangleCanvasRenderer; /***/ }), -/* 971 */ +/* 975 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146270,12 +147688,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(972); + renderWebGL = __webpack_require__(976); } if (true) { - renderCanvas = __webpack_require__(973); + renderCanvas = __webpack_require__(977); } module.exports = { @@ -146287,7 +147705,7 @@ module.exports = { /***/ }), -/* 972 */ +/* 976 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146380,7 +147798,7 @@ module.exports = LineWebGLRenderer; /***/ }), -/* 973 */ +/* 977 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146389,8 +147807,8 @@ module.exports = LineWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -146437,7 +147855,7 @@ module.exports = LineCanvasRenderer; /***/ }), -/* 974 */ +/* 978 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146451,12 +147869,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(975); + renderWebGL = __webpack_require__(979); } if (true) { - renderCanvas = __webpack_require__(976); + renderCanvas = __webpack_require__(980); } module.exports = { @@ -146468,7 +147886,7 @@ module.exports = { /***/ }), -/* 975 */ +/* 979 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146478,7 +147896,7 @@ module.exports = { */ var FillPathWebGL = __webpack_require__(98); -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -146546,7 +147964,7 @@ module.exports = PolygonWebGLRenderer; /***/ }), -/* 976 */ +/* 980 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146556,8 +147974,8 @@ module.exports = PolygonWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -146631,7 +148049,7 @@ module.exports = PolygonCanvasRenderer; /***/ }), -/* 977 */ +/* 981 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146645,12 +148063,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(978); + renderWebGL = __webpack_require__(982); } if (true) { - renderCanvas = __webpack_require__(979); + renderCanvas = __webpack_require__(983); } module.exports = { @@ -146662,7 +148080,7 @@ module.exports = { /***/ }), -/* 978 */ +/* 982 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146671,7 +148089,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); var Utils = __webpack_require__(9); /** @@ -146754,7 +148172,7 @@ module.exports = RectangleWebGLRenderer; /***/ }), -/* 979 */ +/* 983 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146764,8 +148182,8 @@ module.exports = RectangleWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -146828,7 +148246,7 @@ module.exports = RectangleCanvasRenderer; /***/ }), -/* 980 */ +/* 984 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146842,12 +148260,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(981); + renderWebGL = __webpack_require__(985); } if (true) { - renderCanvas = __webpack_require__(982); + renderCanvas = __webpack_require__(986); } module.exports = { @@ -146859,7 +148277,7 @@ module.exports = { /***/ }), -/* 981 */ +/* 985 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146869,7 +148287,7 @@ module.exports = { */ var FillPathWebGL = __webpack_require__(98); -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -146937,7 +148355,7 @@ module.exports = StarWebGLRenderer; /***/ }), -/* 982 */ +/* 986 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146947,8 +148365,8 @@ module.exports = StarWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -147022,7 +148440,7 @@ module.exports = StarCanvasRenderer; /***/ }), -/* 983 */ +/* 987 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147036,12 +148454,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(984); + renderWebGL = __webpack_require__(988); } if (true) { - renderCanvas = __webpack_require__(985); + renderCanvas = __webpack_require__(989); } module.exports = { @@ -147053,7 +148471,7 @@ module.exports = { /***/ }), -/* 984 */ +/* 988 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147062,7 +148480,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StrokePathWebGL = __webpack_require__(68); +var StrokePathWebGL = __webpack_require__(69); var Utils = __webpack_require__(9); /** @@ -147156,7 +148574,7 @@ module.exports = TriangleWebGLRenderer; /***/ }), -/* 985 */ +/* 989 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147166,8 +148584,8 @@ module.exports = TriangleWebGLRenderer; */ var FillStyleCanvas = __webpack_require__(36); -var LineStyleCanvas = __webpack_require__(49); -var SetTransform = __webpack_require__(25); +var LineStyleCanvas = __webpack_require__(50); +var SetTransform = __webpack_require__(26); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -147231,7 +148649,7 @@ module.exports = TriangleCanvasRenderer; /***/ }), -/* 986 */ +/* 990 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147240,8 +148658,8 @@ module.exports = TriangleCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Blitter = __webpack_require__(182); -var GameObjectFactory = __webpack_require__(5); +var Blitter = __webpack_require__(184); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Blitter Game Object and adds it to the Scene. @@ -147273,7 +148691,7 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) /***/ }), -/* 987 */ +/* 991 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147283,8 +148701,8 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Container = __webpack_require__(183); -var GameObjectFactory = __webpack_require__(5); +var Container = __webpack_require__(185); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Container Game Object and adds it to the Scene. @@ -147307,7 +148725,7 @@ GameObjectFactory.register('container', function (x, y, children) /***/ }), -/* 988 */ +/* 992 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147316,8 +148734,8 @@ GameObjectFactory.register('container', function (x, y, children) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DOMElement = __webpack_require__(365); -var GameObjectFactory = __webpack_require__(5); +var DOMElement = __webpack_require__(368); +var GameObjectFactory = __webpack_require__(6); /** * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. @@ -147397,7 +148815,7 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) /***/ }), -/* 989 */ +/* 993 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147406,8 +148824,8 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DynamicBitmapText = __webpack_require__(184); -var GameObjectFactory = __webpack_require__(5); +var DynamicBitmapText = __webpack_require__(186); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Dynamic Bitmap Text Game Object and adds it to the Scene. @@ -147466,7 +148884,7 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size /***/ }), -/* 990 */ +/* 994 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147475,8 +148893,8 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extern = __webpack_require__(367); -var GameObjectFactory = __webpack_require__(5); +var Extern = __webpack_require__(370); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Extern Game Object and adds it to the Scene. @@ -147508,7 +148926,7 @@ GameObjectFactory.register('extern', function () /***/ }), -/* 991 */ +/* 995 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147517,8 +148935,8 @@ GameObjectFactory.register('extern', function () * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Graphics = __webpack_require__(185); -var GameObjectFactory = __webpack_require__(5); +var Graphics = __webpack_require__(187); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Graphics Game Object and adds it to the Scene. @@ -147547,7 +148965,7 @@ GameObjectFactory.register('graphics', function (config) /***/ }), -/* 992 */ +/* 996 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147556,8 +148974,8 @@ GameObjectFactory.register('graphics', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Group = __webpack_require__(94); -var GameObjectFactory = __webpack_require__(5); +var Group = __webpack_require__(95); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Group Game Object and adds it to the Scene. @@ -147579,7 +148997,7 @@ GameObjectFactory.register('group', function (children, config) /***/ }), -/* 993 */ +/* 997 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147588,8 +149006,8 @@ GameObjectFactory.register('group', function (children, config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Image = __webpack_require__(95); -var GameObjectFactory = __webpack_require__(5); +var Image = __webpack_require__(96); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Image Game Object and adds it to the Scene. @@ -147621,7 +149039,7 @@ GameObjectFactory.register('image', function (x, y, key, frame) /***/ }), -/* 994 */ +/* 998 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147630,8 +149048,8 @@ GameObjectFactory.register('image', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var ParticleEmitterManager = __webpack_require__(188); +var GameObjectFactory = __webpack_require__(6); +var ParticleEmitterManager = __webpack_require__(190); /** * Creates a new Particle Emitter Manager Game Object and adds it to the Scene. @@ -147667,7 +149085,7 @@ GameObjectFactory.register('particles', function (key, frame, emitters) /***/ }), -/* 995 */ +/* 999 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147676,8 +149094,8 @@ GameObjectFactory.register('particles', function (key, frame, emitters) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var PathFollower = __webpack_require__(379); +var GameObjectFactory = __webpack_require__(6); +var PathFollower = __webpack_require__(382); /** * Creates a new PathFollower Game Object and adds it to the Scene. @@ -147715,7 +149133,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) /***/ }), -/* 996 */ +/* 1000 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147724,8 +149142,8 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var RenderTexture = __webpack_require__(189); +var GameObjectFactory = __webpack_require__(6); +var RenderTexture = __webpack_require__(191); /** * Creates a new Render Texture Game Object and adds it to the Scene. @@ -147755,7 +149173,7 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, /***/ }), -/* 997 */ +/* 1001 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147764,8 +149182,8 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Sprite = __webpack_require__(67); +var GameObjectFactory = __webpack_require__(6); +var Sprite = __webpack_require__(68); /** * Creates a new Sprite Game Object and adds it to the Scene. @@ -147802,7 +149220,7 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) /***/ }), -/* 998 */ +/* 1002 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147811,8 +149229,8 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(128); -var GameObjectFactory = __webpack_require__(5); +var BitmapText = __webpack_require__(129); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Bitmap Text Game Object and adds it to the Scene. @@ -147866,7 +149284,7 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align /***/ }), -/* 999 */ +/* 1003 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147875,8 +149293,8 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Text = __webpack_require__(190); -var GameObjectFactory = __webpack_require__(5); +var Text = __webpack_require__(192); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Text Game Object and adds it to the Scene. @@ -147931,7 +149349,7 @@ GameObjectFactory.register('text', function (x, y, text, style) /***/ }), -/* 1000 */ +/* 1004 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147940,8 +149358,8 @@ GameObjectFactory.register('text', function (x, y, text, style) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileSprite = __webpack_require__(191); -var GameObjectFactory = __webpack_require__(5); +var TileSprite = __webpack_require__(193); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new TileSprite Game Object and adds it to the Scene. @@ -147975,7 +149393,7 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra /***/ }), -/* 1001 */ +/* 1005 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147984,8 +149402,8 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Zone = __webpack_require__(106); -var GameObjectFactory = __webpack_require__(5); +var Zone = __webpack_require__(107); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Zone Game Object and adds it to the Scene. @@ -148017,7 +149435,7 @@ GameObjectFactory.register('zone', function (x, y, width, height) /***/ }), -/* 1002 */ +/* 1006 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148026,8 +149444,8 @@ GameObjectFactory.register('zone', function (x, y, width, height) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Arc = __webpack_require__(381); -var GameObjectFactory = __webpack_require__(5); +var Arc = __webpack_require__(384); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Arc Shape Game Object and adds it to the Scene. @@ -148090,7 +149508,7 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph /***/ }), -/* 1003 */ +/* 1007 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148099,8 +149517,8 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Curve = __webpack_require__(382); +var GameObjectFactory = __webpack_require__(6); +var Curve = __webpack_require__(385); /** * Creates a new Curve Shape Game Object and adds it to the Scene. @@ -148140,7 +149558,7 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) /***/ }), -/* 1004 */ +/* 1008 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148149,8 +149567,8 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(383); -var GameObjectFactory = __webpack_require__(5); +var Ellipse = __webpack_require__(386); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Ellipse Shape Game Object and adds it to the Scene. @@ -148192,7 +149610,7 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, /***/ }), -/* 1005 */ +/* 1009 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148201,8 +149619,8 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Grid = __webpack_require__(384); +var GameObjectFactory = __webpack_require__(6); +var Grid = __webpack_require__(387); /** * Creates a new Grid Shape Game Object and adds it to the Scene. @@ -148247,7 +149665,7 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel /***/ }), -/* 1006 */ +/* 1010 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148256,8 +149674,8 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var IsoBox = __webpack_require__(385); +var GameObjectFactory = __webpack_require__(6); +var IsoBox = __webpack_require__(388); /** * Creates a new IsoBox Shape Game Object and adds it to the Scene. @@ -148298,7 +149716,7 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill /***/ }), -/* 1007 */ +/* 1011 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148307,8 +149725,8 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var IsoTriangle = __webpack_require__(386); +var GameObjectFactory = __webpack_require__(6); +var IsoTriangle = __webpack_require__(389); /** * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. @@ -148351,7 +149769,7 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed /***/ }), -/* 1008 */ +/* 1012 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148360,8 +149778,8 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Line = __webpack_require__(387); +var GameObjectFactory = __webpack_require__(6); +var Line = __webpack_require__(390); /** * Creates a new Line Shape Game Object and adds it to the Scene. @@ -148402,7 +149820,7 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, /***/ }), -/* 1009 */ +/* 1013 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148411,8 +149829,8 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Polygon = __webpack_require__(388); +var GameObjectFactory = __webpack_require__(6); +var Polygon = __webpack_require__(391); /** * Creates a new Polygon Shape Game Object and adds it to the Scene. @@ -148455,7 +149873,7 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp /***/ }), -/* 1010 */ +/* 1014 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148464,8 +149882,8 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Rectangle = __webpack_require__(393); +var GameObjectFactory = __webpack_require__(6); +var Rectangle = __webpack_require__(396); /** * Creates a new Rectangle Shape Game Object and adds it to the Scene. @@ -148500,7 +149918,7 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor /***/ }), -/* 1011 */ +/* 1015 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148509,8 +149927,8 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Star = __webpack_require__(394); -var GameObjectFactory = __webpack_require__(5); +var Star = __webpack_require__(397); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Star Shape Game Object and adds it to the Scene. @@ -148552,7 +149970,7 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad /***/ }), -/* 1012 */ +/* 1016 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148561,8 +149979,8 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var Triangle = __webpack_require__(395); +var GameObjectFactory = __webpack_require__(6); +var Triangle = __webpack_require__(398); /** * Creates a new Triangle Shape Game Object and adds it to the Scene. @@ -148603,7 +150021,7 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f /***/ }), -/* 1013 */ +/* 1017 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148612,9 +150030,9 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Blitter = __webpack_require__(182); -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var Blitter = __webpack_require__(184); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); /** @@ -148653,7 +150071,7 @@ GameObjectCreator.register('blitter', function (config, addToScene) /***/ }), -/* 1014 */ +/* 1018 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148663,9 +150081,9 @@ GameObjectCreator.register('blitter', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var Container = __webpack_require__(183); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var Container = __webpack_require__(185); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); /** @@ -148702,7 +150120,7 @@ GameObjectCreator.register('container', function (config, addToScene) /***/ }), -/* 1015 */ +/* 1019 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148711,9 +150129,9 @@ GameObjectCreator.register('container', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(184); -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BitmapText = __webpack_require__(186); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); /** @@ -148753,7 +150171,7 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) /***/ }), -/* 1016 */ +/* 1020 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148762,8 +150180,8 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); -var Graphics = __webpack_require__(185); +var GameObjectCreator = __webpack_require__(16); +var Graphics = __webpack_require__(187); /** * Creates a new Graphics Game Object and returns it. @@ -148801,7 +150219,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) /***/ }), -/* 1017 */ +/* 1021 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148810,8 +150228,8 @@ GameObjectCreator.register('graphics', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); -var Group = __webpack_require__(94); +var GameObjectCreator = __webpack_require__(16); +var Group = __webpack_require__(95); /** * Creates a new Group Game Object and returns it. @@ -148834,7 +150252,7 @@ GameObjectCreator.register('group', function (config) /***/ }), -/* 1018 */ +/* 1022 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148843,10 +150261,10 @@ GameObjectCreator.register('group', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Image = __webpack_require__(95); +var Image = __webpack_require__(96); /** * Creates a new Image Game Object and returns it. @@ -148884,7 +150302,7 @@ GameObjectCreator.register('image', function (config, addToScene) /***/ }), -/* 1019 */ +/* 1023 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148893,10 +150311,10 @@ GameObjectCreator.register('image', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); var GetFastValue = __webpack_require__(2); -var ParticleEmitterManager = __webpack_require__(188); +var ParticleEmitterManager = __webpack_require__(190); /** * Creates a new Particle Emitter Manager Game Object and returns it. @@ -148941,7 +150359,7 @@ GameObjectCreator.register('particles', function (config, addToScene) /***/ }), -/* 1020 */ +/* 1024 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148950,10 +150368,10 @@ GameObjectCreator.register('particles', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var RenderTexture = __webpack_require__(189); +var RenderTexture = __webpack_require__(191); /** * Creates a new Render Texture Game Object and returns it. @@ -148993,7 +150411,7 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) /***/ }), -/* 1021 */ +/* 1025 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149002,11 +150420,11 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var BuildGameObjectAnimation = __webpack_require__(363); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var BuildGameObjectAnimation = __webpack_require__(366); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Sprite = __webpack_require__(67); +var Sprite = __webpack_require__(68); /** * Creates a new Sprite Game Object and returns it. @@ -149046,7 +150464,7 @@ GameObjectCreator.register('sprite', function (config, addToScene) /***/ }), -/* 1022 */ +/* 1026 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149055,11 +150473,11 @@ GameObjectCreator.register('sprite', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(128); -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BitmapText = __webpack_require__(129); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(5); /** * Creates a new Bitmap Text Game Object and returns it. @@ -149099,7 +150517,7 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) /***/ }), -/* 1023 */ +/* 1027 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149108,10 +150526,10 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Text = __webpack_require__(190); +var Text = __webpack_require__(192); /** * Creates a new Text Game Object and returns it. @@ -149186,7 +150604,7 @@ GameObjectCreator.register('text', function (config, addToScene) /***/ }), -/* 1024 */ +/* 1028 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149195,10 +150613,10 @@ GameObjectCreator.register('text', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var TileSprite = __webpack_require__(191); +var TileSprite = __webpack_require__(193); /** * Creates a new TileSprite Game Object and returns it. @@ -149238,7 +150656,7 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) /***/ }), -/* 1025 */ +/* 1029 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149247,9 +150665,9 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Zone = __webpack_require__(106); +var Zone = __webpack_require__(107); /** * Creates a new Zone Game Object and returns it. @@ -149277,7 +150695,7 @@ GameObjectCreator.register('zone', function (config) /***/ }), -/* 1026 */ +/* 1030 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149291,12 +150709,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1027); + renderWebGL = __webpack_require__(1031); } if (true) { - renderCanvas = __webpack_require__(1028); + renderCanvas = __webpack_require__(1032); } module.exports = { @@ -149308,7 +150726,7 @@ module.exports = { /***/ }), -/* 1027 */ +/* 1031 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149426,7 +150844,7 @@ module.exports = MeshWebGLRenderer; /***/ }), -/* 1028 */ +/* 1032 */ /***/ (function(module, exports) { /** @@ -149455,7 +150873,7 @@ module.exports = MeshCanvasRenderer; /***/ }), -/* 1029 */ +/* 1033 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149469,12 +150887,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1030); + renderWebGL = __webpack_require__(1034); } if (true) { - renderCanvas = __webpack_require__(1031); + renderCanvas = __webpack_require__(1035); } module.exports = { @@ -149486,7 +150904,7 @@ module.exports = { /***/ }), -/* 1030 */ +/* 1034 */ /***/ (function(module, exports) { /** @@ -149521,40 +150939,48 @@ var ShaderWebGLRenderer = function (renderer, src, interpolationPercentage, came renderer.clearPipeline(); - var camMatrix = src._tempMatrix1; - var shapeMatrix = src._tempMatrix2; - var calcMatrix = src._tempMatrix3; - - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) + if (src.renderToTexture) { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; + src.load(); + src.flush(); } else { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + var camMatrix = src._tempMatrix1; + var shapeMatrix = src._tempMatrix2; + var calcMatrix = src._tempMatrix3; + + shapeMatrix.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 + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + // Renderer size changed? + if (renderer.width !== src._rendererWidth || renderer.height !== src._rendererHeight) + { + src.projOrtho(0, renderer.width, renderer.height, 0); + } + + src.load(calcMatrix.matrix); + src.flush(); } - camMatrix.multiply(shapeMatrix, calcMatrix); - - // Renderer size changed? - if (renderer.width !== src._rendererWidth || renderer.height !== src._rendererHeight) - { - src.projOrtho(0, renderer.width, renderer.height, 0); - } - - src.load(calcMatrix.matrix); - src.flush(); - renderer.rebindPipeline(pipeline); }; @@ -149562,7 +150988,7 @@ module.exports = ShaderWebGLRenderer; /***/ }), -/* 1031 */ +/* 1035 */ /***/ (function(module, exports) { /** @@ -149591,7 +151017,7 @@ module.exports = ShaderCanvasRenderer; /***/ }), -/* 1032 */ +/* 1036 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149600,8 +151026,8 @@ module.exports = ShaderCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Mesh = __webpack_require__(129); -var GameObjectFactory = __webpack_require__(5); +var Mesh = __webpack_require__(130); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Mesh Game Object and adds it to the Scene. @@ -149641,7 +151067,7 @@ if (true) /***/ }), -/* 1033 */ +/* 1037 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149650,8 +151076,8 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Quad = __webpack_require__(194); -var GameObjectFactory = __webpack_require__(5); +var Quad = __webpack_require__(196); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Quad Game Object and adds it to the Scene. @@ -149687,7 +151113,7 @@ if (true) /***/ }), -/* 1034 */ +/* 1038 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149696,8 +151122,8 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Shader = __webpack_require__(195); -var GameObjectFactory = __webpack_require__(5); +var Shader = __webpack_require__(197); +var GameObjectFactory = __webpack_require__(6); /** * Creates a new Shader Game Object and adds it to the Scene. @@ -149727,7 +151153,7 @@ if (true) /***/ }), -/* 1035 */ +/* 1039 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149736,11 +151162,11 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var GetValue = __webpack_require__(6); -var Mesh = __webpack_require__(129); +var GetValue = __webpack_require__(5); +var Mesh = __webpack_require__(130); /** * Creates a new Mesh Game Object and returns it. @@ -149782,7 +151208,7 @@ GameObjectCreator.register('mesh', function (config, addToScene) /***/ }), -/* 1036 */ +/* 1040 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149791,10 +151217,10 @@ GameObjectCreator.register('mesh', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Quad = __webpack_require__(194); +var Quad = __webpack_require__(196); /** * Creates a new Quad Game Object and returns it. @@ -149832,7 +151258,7 @@ GameObjectCreator.register('quad', function (config, addToScene) /***/ }), -/* 1037 */ +/* 1041 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149841,10 +151267,10 @@ GameObjectCreator.register('quad', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(29); -var GameObjectCreator = __webpack_require__(15); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(16); var GetAdvancedValue = __webpack_require__(14); -var Shader = __webpack_require__(195); +var Shader = __webpack_require__(197); /** * Creates a new Shader Game Object and returns it. @@ -149885,7 +151311,7 @@ GameObjectCreator.register('shader', function (config, addToScene) /***/ }), -/* 1038 */ +/* 1042 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149895,9 +151321,9 @@ GameObjectCreator.register('shader', function (config, addToScene) */ var Class = __webpack_require__(0); -var LightsManager = __webpack_require__(400); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); +var LightsManager = __webpack_require__(403); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -150001,7 +151427,7 @@ module.exports = LightsPlugin; /***/ }), -/* 1039 */ +/* 1043 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150010,29 +151436,29 @@ module.exports = LightsPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(77); +var Circle = __webpack_require__(78); -Circle.Area = __webpack_require__(1040); -Circle.Circumference = __webpack_require__(243); -Circle.CircumferencePoint = __webpack_require__(144); -Circle.Clone = __webpack_require__(1041); +Circle.Area = __webpack_require__(1044); +Circle.Circumference = __webpack_require__(246); +Circle.CircumferencePoint = __webpack_require__(145); +Circle.Clone = __webpack_require__(1045); Circle.Contains = __webpack_require__(46); -Circle.ContainsPoint = __webpack_require__(1042); -Circle.ContainsRect = __webpack_require__(1043); -Circle.CopyFrom = __webpack_require__(1044); -Circle.Equals = __webpack_require__(1045); -Circle.GetBounds = __webpack_require__(1046); -Circle.GetPoint = __webpack_require__(241); -Circle.GetPoints = __webpack_require__(242); -Circle.Offset = __webpack_require__(1047); -Circle.OffsetPoint = __webpack_require__(1048); -Circle.Random = __webpack_require__(145); +Circle.ContainsPoint = __webpack_require__(1046); +Circle.ContainsRect = __webpack_require__(1047); +Circle.CopyFrom = __webpack_require__(1048); +Circle.Equals = __webpack_require__(1049); +Circle.GetBounds = __webpack_require__(1050); +Circle.GetPoint = __webpack_require__(244); +Circle.GetPoints = __webpack_require__(245); +Circle.Offset = __webpack_require__(1051); +Circle.OffsetPoint = __webpack_require__(1052); +Circle.Random = __webpack_require__(146); module.exports = Circle; /***/ }), -/* 1040 */ +/* 1044 */ /***/ (function(module, exports) { /** @@ -150060,7 +151486,7 @@ module.exports = Area; /***/ }), -/* 1041 */ +/* 1045 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150069,7 +151495,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(77); +var Circle = __webpack_require__(78); /** * Creates a new Circle instance based on the values contained in the given source. @@ -150090,7 +151516,7 @@ module.exports = Clone; /***/ }), -/* 1042 */ +/* 1046 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150121,7 +151547,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1043 */ +/* 1047 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150157,7 +151583,7 @@ module.exports = ContainsRect; /***/ }), -/* 1044 */ +/* 1048 */ /***/ (function(module, exports) { /** @@ -150189,7 +151615,7 @@ module.exports = CopyFrom; /***/ }), -/* 1045 */ +/* 1049 */ /***/ (function(module, exports) { /** @@ -150223,7 +151649,7 @@ module.exports = Equals; /***/ }), -/* 1046 */ +/* 1050 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150232,7 +151658,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * Returns the bounds of the Circle object. @@ -150263,7 +151689,7 @@ module.exports = GetBounds; /***/ }), -/* 1047 */ +/* 1051 */ /***/ (function(module, exports) { /** @@ -150298,7 +151724,7 @@ module.exports = Offset; /***/ }), -/* 1048 */ +/* 1052 */ /***/ (function(module, exports) { /** @@ -150332,7 +151758,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1049 */ +/* 1053 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150341,29 +151767,29 @@ module.exports = OffsetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(92); +var Ellipse = __webpack_require__(93); -Ellipse.Area = __webpack_require__(1050); -Ellipse.Circumference = __webpack_require__(370); -Ellipse.CircumferencePoint = __webpack_require__(187); -Ellipse.Clone = __webpack_require__(1051); -Ellipse.Contains = __webpack_require__(93); -Ellipse.ContainsPoint = __webpack_require__(1052); -Ellipse.ContainsRect = __webpack_require__(1053); -Ellipse.CopyFrom = __webpack_require__(1054); -Ellipse.Equals = __webpack_require__(1055); -Ellipse.GetBounds = __webpack_require__(1056); -Ellipse.GetPoint = __webpack_require__(368); -Ellipse.GetPoints = __webpack_require__(369); -Ellipse.Offset = __webpack_require__(1057); -Ellipse.OffsetPoint = __webpack_require__(1058); -Ellipse.Random = __webpack_require__(152); +Ellipse.Area = __webpack_require__(1054); +Ellipse.Circumference = __webpack_require__(373); +Ellipse.CircumferencePoint = __webpack_require__(189); +Ellipse.Clone = __webpack_require__(1055); +Ellipse.Contains = __webpack_require__(94); +Ellipse.ContainsPoint = __webpack_require__(1056); +Ellipse.ContainsRect = __webpack_require__(1057); +Ellipse.CopyFrom = __webpack_require__(1058); +Ellipse.Equals = __webpack_require__(1059); +Ellipse.GetBounds = __webpack_require__(1060); +Ellipse.GetPoint = __webpack_require__(371); +Ellipse.GetPoints = __webpack_require__(372); +Ellipse.Offset = __webpack_require__(1061); +Ellipse.OffsetPoint = __webpack_require__(1062); +Ellipse.Random = __webpack_require__(153); module.exports = Ellipse; /***/ }), -/* 1050 */ +/* 1054 */ /***/ (function(module, exports) { /** @@ -150397,7 +151823,7 @@ module.exports = Area; /***/ }), -/* 1051 */ +/* 1055 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150406,7 +151832,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(92); +var Ellipse = __webpack_require__(93); /** * Creates a new Ellipse instance based on the values contained in the given source. @@ -150427,7 +151853,7 @@ module.exports = Clone; /***/ }), -/* 1052 */ +/* 1056 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150436,7 +151862,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(93); +var Contains = __webpack_require__(94); /** * Check to see if the Ellipse contains the given Point object. @@ -150458,7 +151884,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1053 */ +/* 1057 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150467,7 +151893,7 @@ module.exports = ContainsPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(93); +var Contains = __webpack_require__(94); /** * Check to see if the Ellipse contains all four points of the given Rectangle object. @@ -150494,7 +151920,7 @@ module.exports = ContainsRect; /***/ }), -/* 1054 */ +/* 1058 */ /***/ (function(module, exports) { /** @@ -150526,7 +151952,7 @@ module.exports = CopyFrom; /***/ }), -/* 1055 */ +/* 1059 */ /***/ (function(module, exports) { /** @@ -150561,7 +151987,7 @@ module.exports = Equals; /***/ }), -/* 1056 */ +/* 1060 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150570,7 +151996,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * Returns the bounds of the Ellipse object. @@ -150601,7 +152027,7 @@ module.exports = GetBounds; /***/ }), -/* 1057 */ +/* 1061 */ /***/ (function(module, exports) { /** @@ -150636,7 +152062,7 @@ module.exports = Offset; /***/ }), -/* 1058 */ +/* 1062 */ /***/ (function(module, exports) { /** @@ -150670,7 +152096,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1059 */ +/* 1063 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150680,8 +152106,8 @@ module.exports = OffsetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var CircleToCircle = __webpack_require__(403); +var Point = __webpack_require__(4); +var CircleToCircle = __webpack_require__(406); /** * Checks if two Circles intersect and returns the intersection points as a Point object array. @@ -150764,7 +152190,7 @@ module.exports = GetCircleToCircle; /***/ }), -/* 1060 */ +/* 1064 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150774,8 +152200,8 @@ module.exports = GetCircleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToCircle = __webpack_require__(196); -var CircleToRectangle = __webpack_require__(404); +var GetLineToCircle = __webpack_require__(198); +var CircleToRectangle = __webpack_require__(407); /** * Checks for intersection between a circle and a rectangle, @@ -150814,7 +152240,7 @@ module.exports = GetCircleToRectangle; /***/ }), -/* 1061 */ +/* 1065 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150823,8 +152249,8 @@ module.exports = GetCircleToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); -var RectangleToRectangle = __webpack_require__(130); +var Rectangle = __webpack_require__(11); +var RectangleToRectangle = __webpack_require__(131); /** * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. @@ -150863,7 +152289,7 @@ module.exports = GetRectangleIntersection; /***/ }), -/* 1062 */ +/* 1066 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150873,8 +152299,8 @@ module.exports = GetRectangleIntersection; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToRectangle = __webpack_require__(198); -var RectangleToRectangle = __webpack_require__(130); +var GetLineToRectangle = __webpack_require__(200); +var RectangleToRectangle = __webpack_require__(131); /** * Checks if two Rectangles intersect and returns the intersection points as a Point object array. @@ -150914,7 +152340,7 @@ module.exports = GetRectangleToRectangle; /***/ }), -/* 1063 */ +/* 1067 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150924,8 +152350,8 @@ module.exports = GetRectangleToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RectangleToTriangle = __webpack_require__(406); -var GetLineToRectangle = __webpack_require__(198); +var RectangleToTriangle = __webpack_require__(409); +var GetLineToRectangle = __webpack_require__(200); /** * Checks for intersection between Rectangle shape and Triangle shape, @@ -150962,7 +152388,7 @@ module.exports = GetRectangleToTriangle; /***/ }), -/* 1064 */ +/* 1068 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150972,8 +152398,8 @@ module.exports = GetRectangleToTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToCircle = __webpack_require__(196); -var TriangleToCircle = __webpack_require__(408); +var GetLineToCircle = __webpack_require__(198); +var TriangleToCircle = __webpack_require__(411); /** * Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array. @@ -151011,7 +152437,7 @@ module.exports = GetTriangleToCircle; /***/ }), -/* 1065 */ +/* 1069 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151021,8 +152447,8 @@ module.exports = GetTriangleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TriangleToTriangle = __webpack_require__(411); -var GetTriangleToLine = __webpack_require__(409); +var TriangleToTriangle = __webpack_require__(414); +var GetTriangleToLine = __webpack_require__(412); /** * Checks if two Triangles intersect, and returns the intersection points as a Point object array. @@ -151060,7 +152486,7 @@ module.exports = GetTriangleToTriangle; /***/ }), -/* 1066 */ +/* 1070 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151069,7 +152495,7 @@ module.exports = GetTriangleToTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PointToLine = __webpack_require__(413); +var PointToLine = __webpack_require__(416); /** * Checks if a Point is located on the given line segment. @@ -151101,7 +152527,7 @@ module.exports = PointToLineSegment; /***/ }), -/* 1067 */ +/* 1071 */ /***/ (function(module, exports) { /** @@ -151141,7 +152567,7 @@ module.exports = RectangleToValues; /***/ }), -/* 1068 */ +/* 1072 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151150,42 +152576,42 @@ module.exports = RectangleToValues; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Line = __webpack_require__(54); +var Line = __webpack_require__(55); -Line.Angle = __webpack_require__(83); -Line.BresenhamPoints = __webpack_require__(263); -Line.CenterOn = __webpack_require__(1069); -Line.Clone = __webpack_require__(1070); -Line.CopyFrom = __webpack_require__(1071); -Line.Equals = __webpack_require__(1072); -Line.Extend = __webpack_require__(1073); -Line.GetMidPoint = __webpack_require__(1074); -Line.GetNearestPoint = __webpack_require__(1075); -Line.GetNormal = __webpack_require__(1076); -Line.GetPoint = __webpack_require__(250); -Line.GetPoints = __webpack_require__(148); -Line.GetShortestDistance = __webpack_require__(1077); -Line.Height = __webpack_require__(1078); -Line.Length = __webpack_require__(55); -Line.NormalAngle = __webpack_require__(414); -Line.NormalX = __webpack_require__(1079); -Line.NormalY = __webpack_require__(1080); -Line.Offset = __webpack_require__(1081); -Line.PerpSlope = __webpack_require__(1082); -Line.Random = __webpack_require__(149); -Line.ReflectAngle = __webpack_require__(1083); -Line.Rotate = __webpack_require__(1084); -Line.RotateAroundPoint = __webpack_require__(1085); -Line.RotateAroundXY = __webpack_require__(200); -Line.SetToAngle = __webpack_require__(1086); -Line.Slope = __webpack_require__(1087); -Line.Width = __webpack_require__(1088); +Line.Angle = __webpack_require__(85); +Line.BresenhamPoints = __webpack_require__(266); +Line.CenterOn = __webpack_require__(1073); +Line.Clone = __webpack_require__(1074); +Line.CopyFrom = __webpack_require__(1075); +Line.Equals = __webpack_require__(1076); +Line.Extend = __webpack_require__(1077); +Line.GetMidPoint = __webpack_require__(1078); +Line.GetNearestPoint = __webpack_require__(1079); +Line.GetNormal = __webpack_require__(1080); +Line.GetPoint = __webpack_require__(253); +Line.GetPoints = __webpack_require__(149); +Line.GetShortestDistance = __webpack_require__(1081); +Line.Height = __webpack_require__(1082); +Line.Length = __webpack_require__(56); +Line.NormalAngle = __webpack_require__(417); +Line.NormalX = __webpack_require__(1083); +Line.NormalY = __webpack_require__(1084); +Line.Offset = __webpack_require__(1085); +Line.PerpSlope = __webpack_require__(1086); +Line.Random = __webpack_require__(150); +Line.ReflectAngle = __webpack_require__(1087); +Line.Rotate = __webpack_require__(1088); +Line.RotateAroundPoint = __webpack_require__(1089); +Line.RotateAroundXY = __webpack_require__(202); +Line.SetToAngle = __webpack_require__(1090); +Line.Slope = __webpack_require__(1091); +Line.Width = __webpack_require__(1092); module.exports = Line; /***/ }), -/* 1069 */ +/* 1073 */ /***/ (function(module, exports) { /** @@ -151225,7 +152651,7 @@ module.exports = CenterOn; /***/ }), -/* 1070 */ +/* 1074 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151234,7 +152660,7 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Line = __webpack_require__(54); +var Line = __webpack_require__(55); /** * Clone the given line. @@ -151255,7 +152681,7 @@ module.exports = Clone; /***/ }), -/* 1071 */ +/* 1075 */ /***/ (function(module, exports) { /** @@ -151286,7 +152712,7 @@ module.exports = CopyFrom; /***/ }), -/* 1072 */ +/* 1076 */ /***/ (function(module, exports) { /** @@ -151320,7 +152746,7 @@ module.exports = Equals; /***/ }), -/* 1073 */ +/* 1077 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151329,7 +152755,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); +var Length = __webpack_require__(56); /** * Extends the start and end points of a Line by the given amounts. @@ -151378,7 +152804,7 @@ module.exports = Extend; /***/ }), -/* 1074 */ +/* 1078 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151387,7 +152813,7 @@ module.exports = Extend; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Get the midpoint of the given line. @@ -151416,7 +152842,7 @@ module.exports = GetMidPoint; /***/ }), -/* 1075 */ +/* 1079 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151426,7 +152852,7 @@ module.exports = GetMidPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Get the nearest point on a line perpendicular to the given point. @@ -151471,7 +152897,7 @@ module.exports = GetNearestPoint; /***/ }), -/* 1076 */ +/* 1080 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151480,9 +152906,9 @@ module.exports = GetNearestPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Angle = __webpack_require__(83); -var Point = __webpack_require__(3); +var MATH_CONST = __webpack_require__(22); +var Angle = __webpack_require__(85); +var Point = __webpack_require__(4); /** * Calculate the normal of the given line. @@ -151515,7 +152941,7 @@ module.exports = GetNormal; /***/ }), -/* 1077 */ +/* 1081 */ /***/ (function(module, exports) { /** @@ -151562,7 +152988,7 @@ module.exports = GetShortestDistance; /***/ }), -/* 1078 */ +/* 1082 */ /***/ (function(module, exports) { /** @@ -151590,7 +153016,7 @@ module.exports = Height; /***/ }), -/* 1079 */ +/* 1083 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151599,8 +153025,8 @@ module.exports = Height; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Angle = __webpack_require__(83); +var MATH_CONST = __webpack_require__(22); +var Angle = __webpack_require__(85); /** * [description] @@ -151621,7 +153047,7 @@ module.exports = NormalX; /***/ }), -/* 1080 */ +/* 1084 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151630,8 +153056,8 @@ module.exports = NormalX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(23); -var Angle = __webpack_require__(83); +var MATH_CONST = __webpack_require__(22); +var Angle = __webpack_require__(85); /** * The Y value of the normal of the given line. @@ -151653,7 +153079,7 @@ module.exports = NormalY; /***/ }), -/* 1081 */ +/* 1085 */ /***/ (function(module, exports) { /** @@ -151691,7 +153117,7 @@ module.exports = Offset; /***/ }), -/* 1082 */ +/* 1086 */ /***/ (function(module, exports) { /** @@ -151719,7 +153145,7 @@ module.exports = PerpSlope; /***/ }), -/* 1083 */ +/* 1087 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151728,8 +153154,8 @@ module.exports = PerpSlope; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Angle = __webpack_require__(83); -var NormalAngle = __webpack_require__(414); +var Angle = __webpack_require__(85); +var NormalAngle = __webpack_require__(417); /** * Calculate the reflected angle between two lines. @@ -151753,7 +153179,7 @@ module.exports = ReflectAngle; /***/ }), -/* 1084 */ +/* 1088 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151762,7 +153188,7 @@ module.exports = ReflectAngle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(200); +var RotateAroundXY = __webpack_require__(202); /** * Rotate a line around its midpoint by the given angle in radians. @@ -151789,7 +153215,7 @@ module.exports = Rotate; /***/ }), -/* 1085 */ +/* 1089 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151798,7 +153224,7 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(200); +var RotateAroundXY = __webpack_require__(202); /** * Rotate a line around a point by the given angle in radians. @@ -151823,7 +153249,7 @@ module.exports = RotateAroundPoint; /***/ }), -/* 1086 */ +/* 1090 */ /***/ (function(module, exports) { /** @@ -151863,7 +153289,7 @@ module.exports = SetToAngle; /***/ }), -/* 1087 */ +/* 1091 */ /***/ (function(module, exports) { /** @@ -151891,7 +153317,7 @@ module.exports = Slope; /***/ }), -/* 1088 */ +/* 1092 */ /***/ (function(module, exports) { /** @@ -151919,7 +153345,7 @@ module.exports = Width; /***/ }), -/* 1089 */ +/* 1093 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151928,29 +153354,29 @@ module.exports = Width; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); -Point.Ceil = __webpack_require__(1090); -Point.Clone = __webpack_require__(1091); -Point.CopyFrom = __webpack_require__(1092); -Point.Equals = __webpack_require__(1093); -Point.Floor = __webpack_require__(1094); -Point.GetCentroid = __webpack_require__(1095); -Point.GetMagnitude = __webpack_require__(415); -Point.GetMagnitudeSq = __webpack_require__(416); -Point.GetRectangleFromPoints = __webpack_require__(1096); -Point.Interpolate = __webpack_require__(1097); -Point.Invert = __webpack_require__(1098); -Point.Negative = __webpack_require__(1099); -Point.Project = __webpack_require__(1100); -Point.ProjectUnit = __webpack_require__(1101); -Point.SetMagnitude = __webpack_require__(1102); +Point.Ceil = __webpack_require__(1094); +Point.Clone = __webpack_require__(1095); +Point.CopyFrom = __webpack_require__(1096); +Point.Equals = __webpack_require__(1097); +Point.Floor = __webpack_require__(1098); +Point.GetCentroid = __webpack_require__(1099); +Point.GetMagnitude = __webpack_require__(418); +Point.GetMagnitudeSq = __webpack_require__(419); +Point.GetRectangleFromPoints = __webpack_require__(1100); +Point.Interpolate = __webpack_require__(1101); +Point.Invert = __webpack_require__(1102); +Point.Negative = __webpack_require__(1103); +Point.Project = __webpack_require__(1104); +Point.ProjectUnit = __webpack_require__(1105); +Point.SetMagnitude = __webpack_require__(1106); module.exports = Point; /***/ }), -/* 1090 */ +/* 1094 */ /***/ (function(module, exports) { /** @@ -151980,7 +153406,7 @@ module.exports = Ceil; /***/ }), -/* 1091 */ +/* 1095 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151989,7 +153415,7 @@ module.exports = Ceil; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Clone the given Point. @@ -152010,7 +153436,7 @@ module.exports = Clone; /***/ }), -/* 1092 */ +/* 1096 */ /***/ (function(module, exports) { /** @@ -152041,7 +153467,7 @@ module.exports = CopyFrom; /***/ }), -/* 1093 */ +/* 1097 */ /***/ (function(module, exports) { /** @@ -152070,7 +153496,7 @@ module.exports = Equals; /***/ }), -/* 1094 */ +/* 1098 */ /***/ (function(module, exports) { /** @@ -152100,7 +153526,7 @@ module.exports = Floor; /***/ }), -/* 1095 */ +/* 1099 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152109,7 +153535,7 @@ module.exports = Floor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Get the centroid or geometric center of a plane figure (the arithmetic mean position of all the points in the figure). @@ -152164,7 +153590,7 @@ module.exports = GetCentroid; /***/ }), -/* 1096 */ +/* 1100 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152173,7 +153599,7 @@ module.exports = GetCentroid; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * Calculates the Axis Aligned Bounding Box (or aabb) from an array of points. @@ -152234,7 +153660,7 @@ module.exports = GetRectangleFromPoints; /***/ }), -/* 1097 */ +/* 1101 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152243,7 +153669,7 @@ module.exports = GetRectangleFromPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * [description] @@ -152275,7 +153701,7 @@ module.exports = Interpolate; /***/ }), -/* 1098 */ +/* 1102 */ /***/ (function(module, exports) { /** @@ -152305,7 +153731,7 @@ module.exports = Invert; /***/ }), -/* 1099 */ +/* 1103 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152314,7 +153740,7 @@ module.exports = Invert; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Inverts a Point's coordinates. @@ -152340,7 +153766,7 @@ module.exports = Negative; /***/ }), -/* 1100 */ +/* 1104 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152349,8 +153775,8 @@ module.exports = Negative; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); -var GetMagnitudeSq = __webpack_require__(416); +var Point = __webpack_require__(4); +var GetMagnitudeSq = __webpack_require__(419); /** * [description] @@ -152386,7 +153812,7 @@ module.exports = Project; /***/ }), -/* 1101 */ +/* 1105 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152395,7 +153821,7 @@ module.exports = Project; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * [description] @@ -152430,7 +153856,7 @@ module.exports = ProjectUnit; /***/ }), -/* 1102 */ +/* 1106 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152439,7 +153865,7 @@ module.exports = ProjectUnit; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetMagnitude = __webpack_require__(415); +var GetMagnitude = __webpack_require__(418); /** * Changes the magnitude (length) of a two-dimensional vector without changing its direction. @@ -152474,7 +153900,7 @@ module.exports = SetMagnitude; /***/ }), -/* 1103 */ +/* 1107 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152483,23 +153909,23 @@ module.exports = SetMagnitude; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Polygon = __webpack_require__(192); +var Polygon = __webpack_require__(194); -Polygon.Clone = __webpack_require__(1104); -Polygon.Contains = __webpack_require__(193); -Polygon.ContainsPoint = __webpack_require__(1105); -Polygon.GetAABB = __webpack_require__(389); -Polygon.GetNumberArray = __webpack_require__(1106); -Polygon.GetPoints = __webpack_require__(390); -Polygon.Perimeter = __webpack_require__(391); -Polygon.Reverse = __webpack_require__(1107); -Polygon.Smooth = __webpack_require__(392); +Polygon.Clone = __webpack_require__(1108); +Polygon.Contains = __webpack_require__(195); +Polygon.ContainsPoint = __webpack_require__(1109); +Polygon.GetAABB = __webpack_require__(392); +Polygon.GetNumberArray = __webpack_require__(1110); +Polygon.GetPoints = __webpack_require__(393); +Polygon.Perimeter = __webpack_require__(394); +Polygon.Reverse = __webpack_require__(1111); +Polygon.Smooth = __webpack_require__(395); module.exports = Polygon; /***/ }), -/* 1104 */ +/* 1108 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152508,7 +153934,7 @@ module.exports = Polygon; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Polygon = __webpack_require__(192); +var Polygon = __webpack_require__(194); /** * Create a new polygon which is a copy of the specified polygon @@ -152529,7 +153955,7 @@ module.exports = Clone; /***/ }), -/* 1105 */ +/* 1109 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152538,7 +153964,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(193); +var Contains = __webpack_require__(195); /** * [description] @@ -152560,7 +153986,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1106 */ +/* 1110 */ /***/ (function(module, exports) { /** @@ -152603,7 +154029,7 @@ module.exports = GetNumberArray; /***/ }), -/* 1107 */ +/* 1111 */ /***/ (function(module, exports) { /** @@ -152635,7 +154061,7 @@ module.exports = Reverse; /***/ }), -/* 1108 */ +/* 1112 */ /***/ (function(module, exports) { /** @@ -152663,7 +154089,7 @@ module.exports = Area; /***/ }), -/* 1109 */ +/* 1113 */ /***/ (function(module, exports) { /** @@ -152696,7 +154122,7 @@ module.exports = Ceil; /***/ }), -/* 1110 */ +/* 1114 */ /***/ (function(module, exports) { /** @@ -152731,7 +154157,7 @@ module.exports = CeilAll; /***/ }), -/* 1111 */ +/* 1115 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152740,7 +154166,7 @@ module.exports = CeilAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); +var Rectangle = __webpack_require__(11); /** * Creates a new Rectangle which is identical to the given one. @@ -152761,7 +154187,7 @@ module.exports = Clone; /***/ }), -/* 1112 */ +/* 1116 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152770,7 +154196,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(47); +var Contains = __webpack_require__(48); /** * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. @@ -152792,7 +154218,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1113 */ +/* 1117 */ /***/ (function(module, exports) { /** @@ -152823,7 +154249,7 @@ module.exports = CopyFrom; /***/ }), -/* 1114 */ +/* 1118 */ /***/ (function(module, exports) { /** @@ -152857,7 +154283,7 @@ module.exports = Equals; /***/ }), -/* 1115 */ +/* 1119 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152866,7 +154292,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetAspectRatio = __webpack_require__(201); +var GetAspectRatio = __webpack_require__(203); /** * Adjusts the target rectangle, changing its width, height and position, @@ -152881,7 +154307,7 @@ var GetAspectRatio = __webpack_require__(201); * @generic {Phaser.Geom.Rectangle} O - [target,$return] * * @param {Phaser.Geom.Rectangle} target - The target rectangle to adjust. - * @param {Phaser.Geom.Rectangle} source - The source rectangle to envlope the target in. + * @param {Phaser.Geom.Rectangle} source - The source rectangle to envelop the target in. * * @return {Phaser.Geom.Rectangle} The modified target rectangle instance. */ @@ -152910,7 +154336,7 @@ module.exports = FitInside; /***/ }), -/* 1116 */ +/* 1120 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152919,7 +154345,7 @@ module.exports = FitInside; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetAspectRatio = __webpack_require__(201); +var GetAspectRatio = __webpack_require__(203); /** * Adjusts the target rectangle, changing its width, height and position, @@ -152963,7 +154389,7 @@ module.exports = FitOutside; /***/ }), -/* 1117 */ +/* 1121 */ /***/ (function(module, exports) { /** @@ -152996,7 +154422,7 @@ module.exports = Floor; /***/ }), -/* 1118 */ +/* 1122 */ /***/ (function(module, exports) { /** @@ -153031,7 +154457,7 @@ module.exports = FloorAll; /***/ }), -/* 1119 */ +/* 1123 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153040,7 +154466,7 @@ module.exports = FloorAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); /** * Returns the center of a Rectangle as a Point. @@ -153069,7 +154495,7 @@ module.exports = GetCenter; /***/ }), -/* 1120 */ +/* 1124 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153078,13 +154504,12 @@ module.exports = GetCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); -// The size of the Rectangle object, expressed as a Point object -// with the values of the width and height properties. /** - * [description] + * The size of the Rectangle object, expressed as a Point object + * with the values of the width and height properties. * * @function Phaser.Geom.Rectangle.GetSize * @since 3.0.0 @@ -153110,7 +154535,7 @@ module.exports = GetSize; /***/ }), -/* 1121 */ +/* 1125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153119,7 +154544,7 @@ module.exports = GetSize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CenterOn = __webpack_require__(162); +var CenterOn = __webpack_require__(163); /** @@ -153152,7 +154577,7 @@ module.exports = Inflate; /***/ }), -/* 1122 */ +/* 1126 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153161,8 +154586,8 @@ module.exports = Inflate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(10); -var Intersects = __webpack_require__(130); +var Rectangle = __webpack_require__(11); +var Intersects = __webpack_require__(131); /** * Takes two Rectangles and first checks to see if they intersect. @@ -153203,7 +154628,7 @@ module.exports = Intersection; /***/ }), -/* 1123 */ +/* 1127 */ /***/ (function(module, exports) { /** @@ -153252,7 +154677,7 @@ module.exports = MergePoints; /***/ }), -/* 1124 */ +/* 1128 */ /***/ (function(module, exports) { /** @@ -153299,7 +154724,7 @@ module.exports = MergeRect; /***/ }), -/* 1125 */ +/* 1129 */ /***/ (function(module, exports) { /** @@ -153343,7 +154768,7 @@ module.exports = MergeXY; /***/ }), -/* 1126 */ +/* 1130 */ /***/ (function(module, exports) { /** @@ -153378,7 +154803,7 @@ module.exports = Offset; /***/ }), -/* 1127 */ +/* 1131 */ /***/ (function(module, exports) { /** @@ -153412,7 +154837,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1128 */ +/* 1132 */ /***/ (function(module, exports) { /** @@ -153446,7 +154871,7 @@ module.exports = Overlaps; /***/ }), -/* 1129 */ +/* 1133 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153455,7 +154880,7 @@ module.exports = Overlaps; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(3); +var Point = __webpack_require__(4); var DegToRad = __webpack_require__(35); /** @@ -153503,7 +154928,7 @@ module.exports = PerimeterPoint; /***/ }), -/* 1130 */ +/* 1134 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153512,9 +154937,9 @@ module.exports = PerimeterPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Between = __webpack_require__(168); -var ContainsRect = __webpack_require__(418); -var Point = __webpack_require__(3); +var Between = __webpack_require__(169); +var ContainsRect = __webpack_require__(421); +var Point = __webpack_require__(4); /** * Calculates a random point that lies within the `outer` Rectangle, but outside of the `inner` Rectangle. @@ -153574,7 +154999,7 @@ module.exports = RandomOutside; /***/ }), -/* 1131 */ +/* 1135 */ /***/ (function(module, exports) { /** @@ -153603,7 +155028,7 @@ module.exports = SameDimensions; /***/ }), -/* 1132 */ +/* 1136 */ /***/ (function(module, exports) { /** @@ -153642,7 +155067,7 @@ module.exports = Scale; /***/ }), -/* 1133 */ +/* 1137 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153651,38 +155076,38 @@ module.exports = Scale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(69); +var Triangle = __webpack_require__(70); -Triangle.Area = __webpack_require__(1134); -Triangle.BuildEquilateral = __webpack_require__(1135); -Triangle.BuildFromPolygon = __webpack_require__(1136); -Triangle.BuildRight = __webpack_require__(1137); -Triangle.CenterOn = __webpack_require__(1138); -Triangle.Centroid = __webpack_require__(419); -Triangle.CircumCenter = __webpack_require__(1139); -Triangle.CircumCircle = __webpack_require__(1140); -Triangle.Clone = __webpack_require__(1141); -Triangle.Contains = __webpack_require__(81); -Triangle.ContainsArray = __webpack_require__(199); -Triangle.ContainsPoint = __webpack_require__(1142); -Triangle.CopyFrom = __webpack_require__(1143); -Triangle.Decompose = __webpack_require__(412); -Triangle.Equals = __webpack_require__(1144); -Triangle.GetPoint = __webpack_require__(396); -Triangle.GetPoints = __webpack_require__(397); -Triangle.InCenter = __webpack_require__(421); -Triangle.Perimeter = __webpack_require__(1145); -Triangle.Offset = __webpack_require__(420); -Triangle.Random = __webpack_require__(153); -Triangle.Rotate = __webpack_require__(1146); -Triangle.RotateAroundPoint = __webpack_require__(1147); -Triangle.RotateAroundXY = __webpack_require__(202); +Triangle.Area = __webpack_require__(1138); +Triangle.BuildEquilateral = __webpack_require__(1139); +Triangle.BuildFromPolygon = __webpack_require__(1140); +Triangle.BuildRight = __webpack_require__(1141); +Triangle.CenterOn = __webpack_require__(1142); +Triangle.Centroid = __webpack_require__(422); +Triangle.CircumCenter = __webpack_require__(1143); +Triangle.CircumCircle = __webpack_require__(1144); +Triangle.Clone = __webpack_require__(1145); +Triangle.Contains = __webpack_require__(83); +Triangle.ContainsArray = __webpack_require__(201); +Triangle.ContainsPoint = __webpack_require__(1146); +Triangle.CopyFrom = __webpack_require__(1147); +Triangle.Decompose = __webpack_require__(415); +Triangle.Equals = __webpack_require__(1148); +Triangle.GetPoint = __webpack_require__(399); +Triangle.GetPoints = __webpack_require__(400); +Triangle.InCenter = __webpack_require__(424); +Triangle.Perimeter = __webpack_require__(1149); +Triangle.Offset = __webpack_require__(423); +Triangle.Random = __webpack_require__(154); +Triangle.Rotate = __webpack_require__(1150); +Triangle.RotateAroundPoint = __webpack_require__(1151); +Triangle.RotateAroundXY = __webpack_require__(204); module.exports = Triangle; /***/ }), -/* 1134 */ +/* 1138 */ /***/ (function(module, exports) { /** @@ -153721,7 +155146,7 @@ module.exports = Area; /***/ }), -/* 1135 */ +/* 1139 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153730,7 +155155,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(69); +var Triangle = __webpack_require__(70); /** * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). @@ -153765,7 +155190,7 @@ module.exports = BuildEquilateral; /***/ }), -/* 1136 */ +/* 1140 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153774,8 +155199,8 @@ module.exports = BuildEquilateral; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var EarCut = __webpack_require__(63); -var Triangle = __webpack_require__(69); +var EarCut = __webpack_require__(64); +var Triangle = __webpack_require__(70); /** * [description] @@ -153840,7 +155265,7 @@ module.exports = BuildFromPolygon; /***/ }), -/* 1137 */ +/* 1141 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153849,7 +155274,7 @@ module.exports = BuildFromPolygon; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(69); +var Triangle = __webpack_require__(70); // Builds a right triangle, with one 90 degree angle and two acute angles // The x/y is the coordinate of the 90 degree angle (and will map to x1/y1 in the resulting Triangle) @@ -153889,7 +155314,7 @@ module.exports = BuildRight; /***/ }), -/* 1138 */ +/* 1142 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153898,8 +155323,8 @@ module.exports = BuildRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Centroid = __webpack_require__(419); -var Offset = __webpack_require__(420); +var Centroid = __webpack_require__(422); +var Offset = __webpack_require__(423); /** * @callback CenterFunction @@ -153942,7 +155367,7 @@ module.exports = CenterOn; /***/ }), -/* 1139 */ +/* 1143 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153951,7 +155376,7 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector2 = __webpack_require__(4); +var Vector2 = __webpack_require__(3); // Adapted from http://bjornharrtell.github.io/jsts/doc/api/jsts_geom_Triangle.js.html @@ -154018,7 +155443,7 @@ module.exports = CircumCenter; /***/ }), -/* 1140 */ +/* 1144 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154027,7 +155452,7 @@ module.exports = CircumCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(77); +var Circle = __webpack_require__(78); // Adapted from https://gist.github.com/mutoo/5617691 @@ -154101,7 +155526,7 @@ module.exports = CircumCircle; /***/ }), -/* 1141 */ +/* 1145 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154110,7 +155535,7 @@ module.exports = CircumCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(69); +var Triangle = __webpack_require__(70); /** * Clones a Triangle object. @@ -154131,7 +155556,7 @@ module.exports = Clone; /***/ }), -/* 1142 */ +/* 1146 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154140,7 +155565,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(81); +var Contains = __webpack_require__(83); /** * Tests if a triangle contains a point. @@ -154162,7 +155587,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1143 */ +/* 1147 */ /***/ (function(module, exports) { /** @@ -154193,7 +155618,7 @@ module.exports = CopyFrom; /***/ }), -/* 1144 */ +/* 1148 */ /***/ (function(module, exports) { /** @@ -154229,7 +155654,7 @@ module.exports = Equals; /***/ }), -/* 1145 */ +/* 1149 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154238,7 +155663,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(55); +var Length = __webpack_require__(56); // The 2D area of a triangle. The area value is always non-negative. @@ -154265,7 +155690,7 @@ module.exports = Perimeter; /***/ }), -/* 1146 */ +/* 1150 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154274,8 +155699,8 @@ module.exports = Perimeter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(202); -var InCenter = __webpack_require__(421); +var RotateAroundXY = __webpack_require__(204); +var InCenter = __webpack_require__(424); /** * Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet. @@ -154301,7 +155726,7 @@ module.exports = Rotate; /***/ }), -/* 1147 */ +/* 1151 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154310,7 +155735,7 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(202); +var RotateAroundXY = __webpack_require__(204); /** * Rotates a Triangle at a certain angle about a given Point or object with public `x` and `y` properties. @@ -154335,7 +155760,7 @@ module.exports = RotateAroundPoint; /***/ }), -/* 1148 */ +/* 1152 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154344,8 +155769,8 @@ module.exports = RotateAroundPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(175); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(176); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Input @@ -154353,16 +155778,16 @@ var Extend = __webpack_require__(17); var Input = { - CreateInteractiveObject: __webpack_require__(422), - Events: __webpack_require__(53), - Gamepad: __webpack_require__(1149), - InputManager: __webpack_require__(337), - InputPlugin: __webpack_require__(1161), - InputPluginCache: __webpack_require__(131), - Keyboard: __webpack_require__(1163), - Mouse: __webpack_require__(1180), - Pointer: __webpack_require__(340), - Touch: __webpack_require__(1181) + CreateInteractiveObject: __webpack_require__(425), + Events: __webpack_require__(54), + Gamepad: __webpack_require__(1153), + InputManager: __webpack_require__(340), + InputPlugin: __webpack_require__(1165), + InputPluginCache: __webpack_require__(132), + Keyboard: __webpack_require__(1167), + Mouse: __webpack_require__(1184), + Pointer: __webpack_require__(343), + Touch: __webpack_require__(1185) }; @@ -154373,7 +155798,7 @@ module.exports = Input; /***/ }), -/* 1149 */ +/* 1153 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154388,18 +155813,18 @@ module.exports = Input; module.exports = { - Axis: __webpack_require__(423), - Button: __webpack_require__(424), - Events: __webpack_require__(203), - Gamepad: __webpack_require__(425), - GamepadPlugin: __webpack_require__(1156), + Axis: __webpack_require__(426), + Button: __webpack_require__(427), + Events: __webpack_require__(205), + Gamepad: __webpack_require__(428), + GamepadPlugin: __webpack_require__(1160), - Configs: __webpack_require__(1157) + Configs: __webpack_require__(1161) }; /***/ }), -/* 1150 */ +/* 1154 */ /***/ (function(module, exports) { /** @@ -154428,7 +155853,7 @@ module.exports = 'down'; /***/ }), -/* 1151 */ +/* 1155 */ /***/ (function(module, exports) { /** @@ -154457,7 +155882,7 @@ module.exports = 'up'; /***/ }), -/* 1152 */ +/* 1156 */ /***/ (function(module, exports) { /** @@ -154488,7 +155913,7 @@ module.exports = 'connected'; /***/ }), -/* 1153 */ +/* 1157 */ /***/ (function(module, exports) { /** @@ -154514,7 +155939,7 @@ module.exports = 'disconnected'; /***/ }), -/* 1154 */ +/* 1158 */ /***/ (function(module, exports) { /** @@ -154546,7 +155971,7 @@ module.exports = 'down'; /***/ }), -/* 1155 */ +/* 1159 */ /***/ (function(module, exports) { /** @@ -154578,7 +156003,7 @@ module.exports = 'up'; /***/ }), -/* 1156 */ +/* 1160 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154588,12 +156013,12 @@ module.exports = 'up'; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(203); -var Gamepad = __webpack_require__(425); -var GetValue = __webpack_require__(6); -var InputPluginCache = __webpack_require__(131); -var InputEvents = __webpack_require__(53); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(205); +var Gamepad = __webpack_require__(428); +var GetValue = __webpack_require__(5); +var InputPluginCache = __webpack_require__(132); +var InputEvents = __webpack_require__(54); /** * @classdesc @@ -155218,7 +156643,7 @@ module.exports = GamepadPlugin; /***/ }), -/* 1157 */ +/* 1161 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155233,15 +156658,15 @@ module.exports = GamepadPlugin; module.exports = { - DUALSHOCK_4: __webpack_require__(1158), - SNES_USB: __webpack_require__(1159), - XBOX_360: __webpack_require__(1160) + DUALSHOCK_4: __webpack_require__(1162), + SNES_USB: __webpack_require__(1163), + XBOX_360: __webpack_require__(1164) }; /***/ }), -/* 1158 */ +/* 1162 */ /***/ (function(module, exports) { /** @@ -155291,7 +156716,7 @@ module.exports = { /***/ }), -/* 1159 */ +/* 1163 */ /***/ (function(module, exports) { /** @@ -155330,7 +156755,7 @@ module.exports = { /***/ }), -/* 1160 */ +/* 1164 */ /***/ (function(module, exports) { /** @@ -155381,7 +156806,7 @@ module.exports = { /***/ }), -/* 1161 */ +/* 1165 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155390,26 +156815,27 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(77); +var Circle = __webpack_require__(78); var CircleContains = __webpack_require__(46); var Class = __webpack_require__(0); -var CONST = __webpack_require__(175); -var CreateInteractiveObject = __webpack_require__(422); -var CreatePixelPerfectHandler = __webpack_require__(1162); -var DistanceBetween = __webpack_require__(57); -var Ellipse = __webpack_require__(92); -var EllipseContains = __webpack_require__(93); -var Events = __webpack_require__(53); -var EventEmitter = __webpack_require__(11); +var CONST = __webpack_require__(176); +var CreateInteractiveObject = __webpack_require__(425); +var CreatePixelPerfectHandler = __webpack_require__(1166); +var DistanceBetween = __webpack_require__(58); +var Ellipse = __webpack_require__(93); +var EllipseContains = __webpack_require__(94); +var Events = __webpack_require__(54); +var EventEmitter = __webpack_require__(10); var GetFastValue = __webpack_require__(2); -var InputPluginCache = __webpack_require__(131); +var GEOM_CONST = __webpack_require__(47); +var InputPluginCache = __webpack_require__(132); var IsPlainObject = __webpack_require__(7); -var PluginCache = __webpack_require__(18); -var Rectangle = __webpack_require__(10); -var RectangleContains = __webpack_require__(47); -var SceneEvents = __webpack_require__(19); -var Triangle = __webpack_require__(69); -var TriangleContains = __webpack_require__(81); +var PluginCache = __webpack_require__(19); +var Rectangle = __webpack_require__(11); +var RectangleContains = __webpack_require__(48); +var SceneEvents = __webpack_require__(20); +var Triangle = __webpack_require__(70); +var TriangleContains = __webpack_require__(83); /** * @classdesc @@ -155930,17 +157356,35 @@ var InputPlugin = new Class({ return false; } - // So the Gamepad and Keyboard update, regardless + // The plugins should update every frame, regardless if there has been + // any DOM input events or not (such as the Gamepad and Keyboard) this.pluginEvents.emit(Events.UPDATE, time, delta); - // Nothing else? Let's leave - if (this._list.length === 0 || this._updatedThisFrame) + // We can leave now if we've already updated once this frame via the immediate DOM event handlers + if (this._updatedThisFrame) { this._updatedThisFrame = false; return false; } + var i; + var manager = this.manager; + + var pointers = manager.pointers; + var pointersTotal = manager.pointersTotal; + + for (i = 0; i < pointersTotal; i++) + { + pointers[i].updateMotion(); + } + + // No point going any further if there aren't any interactive objects + if (this._list.length === 0) + { + return false; + } + var rate = this.pollRate; if (rate === -1) @@ -155964,15 +157408,12 @@ var InputPlugin = new Class({ } // We got this far? Then we should poll for movement - var manager = this.manager; - - var pointers = manager.pointers; - var pointersTotal = manager.pointersTotal; var captured = false; - for (var i = 0; i < pointersTotal; i++) + for (i = 0; i < pointersTotal; i++) { var total = 0; + var pointer = pointers[i]; // Always reset this array @@ -156355,7 +157796,7 @@ var InputPlugin = new Class({ } // If they released outside the canvas, but pressed down inside it, we'll still dispatch the event. - if (!aborted) + if (!aborted && this.manager) { if (pointer.downElement === this.manager.game.canvas) { @@ -157307,7 +158748,7 @@ var InputPlugin = new Class({ } // If they released outside the canvas, but pressed down inside it, we'll still dispatch the event. - if (!aborted) + if (!aborted && this.manager) { if (pointer.upElement === this.manager.game.canvas) { @@ -157487,6 +158928,7 @@ var InputPlugin = new Class({ var cursor = false; var useHandCursor = false; var pixelPerfect = false; + var customHitArea = true; // Config object? if (IsPlainObject(shape)) @@ -157513,6 +158955,7 @@ var InputPlugin = new Class({ if (!shape || !callback) { this.setHitAreaFromTexture(gameObjects); + customHitArea = false; } } else if (typeof shape === 'function' && !callback) @@ -157533,7 +158976,7 @@ var InputPlugin = new Class({ var io = (!gameObject.input) ? CreateInteractiveObject(gameObject, shape, callback) : gameObject.input; - io.customHitArea = true; + io.customHitArea = customHitArea; io.dropZone = dropZone; io.cursor = (useHandCursor) ? 'pointer' : cursor; @@ -157709,6 +159152,145 @@ var InputPlugin = new Class({ return this.setHitArea(gameObjects, shape, callback); }, + /** + * Creates an Input Debug Shape for the given Game Object. + * + * The Game Object must have _already_ been enabled for input prior to calling this method. + * + * This is intended to assist you during development and debugging. + * + * Debug Shapes can only be created for Game Objects that are using standard Phaser Geometry for input, + * including: Circle, Ellipse, Line, Polygon, Rectangle and Triangle. + * + * Game Objects that are using their automatic hit areas are using Rectangles by default, so will also work. + * + * The Debug Shape is created and added to the display list and is then kept in sync with the Game Object + * it is connected with. Should you need to modify it yourself, such as to hide it, you can access it via + * the Game Object property: `GameObject.input.hitAreaDebug`. + * + * Calling this method on a Game Object that already has a Debug Shape will first destroy the old shape, + * before creating a new one. If you wish to remove the Debug Shape entirely, you should call the + * method `InputPlugin.removeDebug`. + * + * Note that the debug shape will only show the outline of the input area. If the input test is using a + * pixel perfect check, for example, then this is not displayed. If you are using a custom shape, that + * doesn't extend one of the base Phaser Geometry objects, as your hit area, then this method will not + * work. + * + * @method Phaser.Input.InputPlugin#enableDebug + * @since 3.19.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to create the input debug shape for. + * @param {number} [color=0x00ff00] - The outline color of the debug shape. + * + * @return {Phaser.Input.InputPlugin} This Input Plugin. + */ + enableDebug: function (gameObject, color) + { + if (color === undefined) { color = 0x00ff00; } + + var input = gameObject.input; + + if (!input || !input.hitArea) + { + return this; + } + + var shape = input.hitArea; + var shapeType = shape.type; + var debug = input.hitAreaDebug; + var factory = this.systems.add; + var updateList = this.systems.updateList; + + if (debug) + { + updateList.remove(debug); + + debug.destroy(); + + debug = null; + } + + switch (shapeType) + { + case GEOM_CONST.CIRCLE: + debug = factory.arc(0, 0, shape.radius); + break; + + case GEOM_CONST.ELLIPSE: + debug = factory.ellipse(0, 0, shape.width, shape.height); + break; + + case GEOM_CONST.LINE: + debug = factory.line(0, 0, shape.x1, shape.y1, shape.x2, shape.y2); + break; + + case GEOM_CONST.POLYGON: + debug = factory.polygon(0, 0, shape.points); + break; + + case GEOM_CONST.RECTANGLE: + debug = factory.rectangle(0, 0, shape.width, shape.height); + break; + + case GEOM_CONST.TRIANGLE: + debug = factory.triangle(0, 0, shape.x1, shape.y1, shape.x2, shape.y2, shape.x3, shape.y3); + break; + } + + if (debug) + { + debug.isFilled = false; + + debug.preUpdate = function () + { + debug.setStrokeStyle(1 / gameObject.scale, color); + + debug.setDisplayOrigin(gameObject.displayOriginX, gameObject.displayOriginY); + debug.setRotation(gameObject.rotation); + debug.setScale(gameObject.scaleX, gameObject.scaleY); + debug.setPosition(gameObject.x, gameObject.y); + debug.setScrollFactor(gameObject.scrollFactorX, gameObject.scrollFactorY); + }; + + updateList.add(debug); + + input.hitAreaDebug = debug; + } + + return this; + }, + + /** + * Removes an Input Debug Shape from the given Game Object. + * + * The shape is destroyed immediately and the `hitAreaDebug` property is set to `null`. + * + * @method Phaser.Input.InputPlugin#removeDebug + * @since 3.19.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to remove the input debug shape from. + * + * @return {Phaser.Input.InputPlugin} This Input Plugin. + */ + removeDebug: function (gameObject) + { + var input = gameObject.input; + + if (input && input.hitAreaDebug) + { + var debug = input.hitAreaDebug; + + this.systems.updateList.remove(debug); + + debug.destroy(); + + input.hitAreaDebug = null; + } + + return this; + }, + /** * Sets the Pointers to always poll. * @@ -158350,7 +159932,7 @@ module.exports = InputPlugin; /***/ }), -/* 1162 */ +/* 1166 */ /***/ (function(module, exports) { /** @@ -158386,7 +159968,7 @@ module.exports = CreatePixelPerfectHandler; /***/ }), -/* 1163 */ +/* 1167 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158401,26 +159983,26 @@ module.exports = CreatePixelPerfectHandler; module.exports = { - Events: __webpack_require__(132), + Events: __webpack_require__(133), - KeyboardManager: __webpack_require__(338), - KeyboardPlugin: __webpack_require__(1171), + KeyboardManager: __webpack_require__(341), + KeyboardPlugin: __webpack_require__(1175), - Key: __webpack_require__(426), - KeyCodes: __webpack_require__(121), + Key: __webpack_require__(429), + KeyCodes: __webpack_require__(122), - KeyCombo: __webpack_require__(427), + KeyCombo: __webpack_require__(430), - JustDown: __webpack_require__(1176), - JustUp: __webpack_require__(1177), - DownDuration: __webpack_require__(1178), - UpDuration: __webpack_require__(1179) + JustDown: __webpack_require__(1180), + JustUp: __webpack_require__(1181), + DownDuration: __webpack_require__(1182), + UpDuration: __webpack_require__(1183) }; /***/ }), -/* 1164 */ +/* 1168 */ /***/ (function(module, exports) { /** @@ -158456,7 +160038,7 @@ module.exports = 'keydown'; /***/ }), -/* 1165 */ +/* 1169 */ /***/ (function(module, exports) { /** @@ -158485,7 +160067,7 @@ module.exports = 'keyup'; /***/ }), -/* 1166 */ +/* 1170 */ /***/ (function(module, exports) { /** @@ -158519,7 +160101,7 @@ module.exports = 'keycombomatch'; /***/ }), -/* 1167 */ +/* 1171 */ /***/ (function(module, exports) { /** @@ -158553,7 +160135,7 @@ module.exports = 'down'; /***/ }), -/* 1168 */ +/* 1172 */ /***/ (function(module, exports) { /** @@ -158592,7 +160174,7 @@ module.exports = 'keydown-'; /***/ }), -/* 1169 */ +/* 1173 */ /***/ (function(module, exports) { /** @@ -158624,7 +160206,7 @@ module.exports = 'keyup-'; /***/ }), -/* 1170 */ +/* 1174 */ /***/ (function(module, exports) { /** @@ -158658,7 +160240,7 @@ module.exports = 'up'; /***/ }), -/* 1171 */ +/* 1175 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158668,17 +160250,17 @@ module.exports = 'up'; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(132); -var GameEvents = __webpack_require__(28); -var GetValue = __webpack_require__(6); -var InputEvents = __webpack_require__(53); -var InputPluginCache = __webpack_require__(131); -var Key = __webpack_require__(426); -var KeyCodes = __webpack_require__(121); -var KeyCombo = __webpack_require__(427); -var KeyMap = __webpack_require__(1175); -var SnapFloor = __webpack_require__(90); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(133); +var GameEvents = __webpack_require__(18); +var GetValue = __webpack_require__(5); +var InputEvents = __webpack_require__(54); +var InputPluginCache = __webpack_require__(132); +var Key = __webpack_require__(429); +var KeyCodes = __webpack_require__(122); +var KeyCombo = __webpack_require__(430); +var KeyMap = __webpack_require__(1179); +var SnapFloor = __webpack_require__(91); /** * @classdesc @@ -159544,7 +161126,7 @@ module.exports = KeyboardPlugin; /***/ }), -/* 1172 */ +/* 1176 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159553,7 +161135,7 @@ module.exports = KeyboardPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AdvanceKeyCombo = __webpack_require__(1173); +var AdvanceKeyCombo = __webpack_require__(1177); /** * Used internally by the KeyCombo class. @@ -159625,7 +161207,7 @@ module.exports = ProcessKeyCombo; /***/ }), -/* 1173 */ +/* 1177 */ /***/ (function(module, exports) { /** @@ -159667,7 +161249,7 @@ module.exports = AdvanceKeyCombo; /***/ }), -/* 1174 */ +/* 1178 */ /***/ (function(module, exports) { /** @@ -159702,7 +161284,7 @@ module.exports = ResetKeyCombo; /***/ }), -/* 1175 */ +/* 1179 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159711,7 +161293,7 @@ module.exports = ResetKeyCombo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var KeyCodes = __webpack_require__(121); +var KeyCodes = __webpack_require__(122); var KeyMap = {}; @@ -159724,7 +161306,7 @@ module.exports = KeyMap; /***/ }), -/* 1176 */ +/* 1180 */ /***/ (function(module, exports) { /** @@ -159766,7 +161348,7 @@ module.exports = JustDown; /***/ }), -/* 1177 */ +/* 1181 */ /***/ (function(module, exports) { /** @@ -159808,7 +161390,7 @@ module.exports = JustUp; /***/ }), -/* 1178 */ +/* 1182 */ /***/ (function(module, exports) { /** @@ -159842,7 +161424,7 @@ module.exports = DownDuration; /***/ }), -/* 1179 */ +/* 1183 */ /***/ (function(module, exports) { /** @@ -159876,7 +161458,7 @@ module.exports = UpDuration; /***/ }), -/* 1180 */ +/* 1184 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159892,14 +161474,14 @@ module.exports = UpDuration; /* eslint-disable */ module.exports = { - MouseManager: __webpack_require__(339) + MouseManager: __webpack_require__(342) }; /* eslint-enable */ /***/ }), -/* 1181 */ +/* 1185 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159915,14 +161497,14 @@ module.exports = { /* eslint-disable */ module.exports = { - TouchManager: __webpack_require__(341) + TouchManager: __webpack_require__(344) }; /* eslint-enable */ /***/ }), -/* 1182 */ +/* 1186 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159931,8 +161513,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(16); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(17); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Loader @@ -159940,18 +161522,18 @@ var Extend = __webpack_require__(17); var Loader = { - Events: __webpack_require__(80), + Events: __webpack_require__(81), - FileTypes: __webpack_require__(1183), + FileTypes: __webpack_require__(1187), - File: __webpack_require__(20), + File: __webpack_require__(21), FileTypesManager: __webpack_require__(8), - GetURL: __webpack_require__(204), - LoaderPlugin: __webpack_require__(1206), - MergeXHRSettings: __webpack_require__(205), - MultiFile: __webpack_require__(59), - XHRLoader: __webpack_require__(428), - XHRSettings: __webpack_require__(133) + GetURL: __webpack_require__(206), + LoaderPlugin: __webpack_require__(1210), + MergeXHRSettings: __webpack_require__(207), + MultiFile: __webpack_require__(60), + XHRLoader: __webpack_require__(431), + XHRSettings: __webpack_require__(134) }; @@ -159962,7 +161544,7 @@ module.exports = Loader; /***/ }), -/* 1183 */ +/* 1187 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159977,41 +161559,41 @@ module.exports = Loader; module.exports = { - AnimationJSONFile: __webpack_require__(1184), - AtlasJSONFile: __webpack_require__(1185), - AtlasXMLFile: __webpack_require__(1186), - AudioFile: __webpack_require__(429), - AudioSpriteFile: __webpack_require__(1187), - BinaryFile: __webpack_require__(1188), - BitmapFontFile: __webpack_require__(1189), - CSSFile: __webpack_require__(1190), - GLSLFile: __webpack_require__(1191), - HTML5AudioFile: __webpack_require__(430), - HTMLFile: __webpack_require__(1192), - HTMLTextureFile: __webpack_require__(1193), - ImageFile: __webpack_require__(70), - JSONFile: __webpack_require__(58), - MultiAtlasFile: __webpack_require__(1194), - MultiScriptFile: __webpack_require__(1195), - PackFile: __webpack_require__(1196), - PluginFile: __webpack_require__(1197), - SceneFile: __webpack_require__(1198), - ScenePluginFile: __webpack_require__(1199), - ScriptFile: __webpack_require__(431), - SpriteSheetFile: __webpack_require__(1200), - SVGFile: __webpack_require__(1201), - TextFile: __webpack_require__(432), - TilemapCSVFile: __webpack_require__(1202), - TilemapImpactFile: __webpack_require__(1203), - TilemapJSONFile: __webpack_require__(1204), - UnityAtlasFile: __webpack_require__(1205), - XMLFile: __webpack_require__(206) + AnimationJSONFile: __webpack_require__(1188), + AtlasJSONFile: __webpack_require__(1189), + AtlasXMLFile: __webpack_require__(1190), + AudioFile: __webpack_require__(432), + AudioSpriteFile: __webpack_require__(1191), + BinaryFile: __webpack_require__(1192), + BitmapFontFile: __webpack_require__(1193), + CSSFile: __webpack_require__(1194), + GLSLFile: __webpack_require__(1195), + HTML5AudioFile: __webpack_require__(433), + HTMLFile: __webpack_require__(1196), + HTMLTextureFile: __webpack_require__(1197), + ImageFile: __webpack_require__(71), + JSONFile: __webpack_require__(59), + MultiAtlasFile: __webpack_require__(1198), + MultiScriptFile: __webpack_require__(1199), + PackFile: __webpack_require__(1200), + PluginFile: __webpack_require__(1201), + SceneFile: __webpack_require__(1202), + ScenePluginFile: __webpack_require__(1203), + ScriptFile: __webpack_require__(434), + SpriteSheetFile: __webpack_require__(1204), + SVGFile: __webpack_require__(1205), + TextFile: __webpack_require__(435), + TilemapCSVFile: __webpack_require__(1206), + TilemapImpactFile: __webpack_require__(1207), + TilemapJSONFile: __webpack_require__(1208), + UnityAtlasFile: __webpack_require__(1209), + XMLFile: __webpack_require__(208) }; /***/ }), -/* 1184 */ +/* 1188 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160022,8 +161604,8 @@ module.exports = { var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(58); -var LoaderEvents = __webpack_require__(80); +var JSONFile = __webpack_require__(59); +var LoaderEvents = __webpack_require__(81); /** * @classdesc @@ -160214,7 +161796,7 @@ module.exports = AnimationJSONFile; /***/ }), -/* 1185 */ +/* 1189 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160226,10 +161808,10 @@ module.exports = AnimationJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(58); -var MultiFile = __webpack_require__(59); +var JSONFile = __webpack_require__(59); +var MultiFile = __webpack_require__(60); /** * @classdesc @@ -160463,7 +162045,7 @@ module.exports = AtlasJSONFile; /***/ }), -/* 1186 */ +/* 1190 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160475,10 +162057,10 @@ module.exports = AtlasJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(59); -var XMLFile = __webpack_require__(206); +var MultiFile = __webpack_require__(60); +var XMLFile = __webpack_require__(208); /** * @classdesc @@ -160706,7 +162288,7 @@ module.exports = AtlasXMLFile; /***/ }), -/* 1187 */ +/* 1191 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160715,13 +162297,13 @@ module.exports = AtlasXMLFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AudioFile = __webpack_require__(429); +var AudioFile = __webpack_require__(432); var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(58); -var MultiFile = __webpack_require__(59); +var JSONFile = __webpack_require__(59); +var MultiFile = __webpack_require__(60); /** * @classdesc @@ -160996,7 +162578,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio /***/ }), -/* 1188 */ +/* 1192 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161006,8 +162588,8 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -161178,7 +162760,7 @@ module.exports = BinaryFile; /***/ }), -/* 1189 */ +/* 1193 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161190,11 +162772,11 @@ module.exports = BinaryFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(59); -var ParseXMLBitmapFont = __webpack_require__(181); -var XMLFile = __webpack_require__(206); +var MultiFile = __webpack_require__(60); +var ParseXMLBitmapFont = __webpack_require__(183); +var XMLFile = __webpack_require__(208); /** * @classdesc @@ -161421,7 +163003,7 @@ module.exports = BitmapFontFile; /***/ }), -/* 1190 */ +/* 1194 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161431,8 +163013,8 @@ module.exports = BitmapFontFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -161589,7 +163171,7 @@ module.exports = CSSFile; /***/ }), -/* 1191 */ +/* 1195 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161599,12 +163181,12 @@ module.exports = CSSFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var Shader = __webpack_require__(325); +var Shader = __webpack_require__(328); /** * @classdesc @@ -162000,7 +163582,7 @@ module.exports = GLSLFile; /***/ }), -/* 1192 */ +/* 1196 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162010,8 +163592,8 @@ module.exports = GLSLFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -162175,7 +163757,7 @@ module.exports = HTMLFile; /***/ }), -/* 1193 */ +/* 1197 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162185,8 +163767,8 @@ module.exports = HTMLFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -162433,7 +164015,7 @@ module.exports = HTMLTextureFile; /***/ }), -/* 1194 */ +/* 1198 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162445,10 +164027,10 @@ module.exports = HTMLTextureFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(58); -var MultiFile = __webpack_require__(59); +var JSONFile = __webpack_require__(59); +var MultiFile = __webpack_require__(60); /** * @classdesc @@ -162757,7 +164339,7 @@ module.exports = MultiAtlasFile; /***/ }), -/* 1195 */ +/* 1199 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162770,8 +164352,8 @@ var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(59); -var ScriptFile = __webpack_require__(431); +var MultiFile = __webpack_require__(60); +var ScriptFile = __webpack_require__(434); /** * @classdesc @@ -162974,7 +164556,7 @@ module.exports = MultiScriptFile; /***/ }), -/* 1196 */ +/* 1200 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162984,9 +164566,9 @@ module.exports = MultiScriptFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); +var CONST = __webpack_require__(17); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(58); +var JSONFile = __webpack_require__(59); /** * @classdesc @@ -163192,7 +164774,7 @@ module.exports = PackFile; /***/ }), -/* 1197 */ +/* 1201 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163202,8 +164784,8 @@ module.exports = PackFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -163404,7 +164986,7 @@ module.exports = PluginFile; /***/ }), -/* 1198 */ +/* 1202 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163414,8 +164996,8 @@ module.exports = PluginFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -163622,7 +165204,7 @@ module.exports = SceneFile; /***/ }), -/* 1199 */ +/* 1203 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163632,8 +165214,8 @@ module.exports = SceneFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -163828,7 +165410,7 @@ module.exports = ScenePluginFile; /***/ }), -/* 1200 */ +/* 1204 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163839,7 +165421,7 @@ module.exports = ScenePluginFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); /** * @classdesc @@ -164019,7 +165601,7 @@ module.exports = SpriteSheetFile; /***/ }), -/* 1201 */ +/* 1205 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164029,8 +165611,8 @@ module.exports = SpriteSheetFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -164358,7 +165940,7 @@ module.exports = SVGFile; /***/ }), -/* 1202 */ +/* 1206 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164368,12 +165950,12 @@ module.exports = SVGFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var File = __webpack_require__(20); +var CONST = __webpack_require__(17); +var File = __webpack_require__(21); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var TILEMAP_FORMATS = __webpack_require__(31); +var TILEMAP_FORMATS = __webpack_require__(30); /** * @classdesc @@ -164553,7 +166135,7 @@ module.exports = TilemapCSVFile; /***/ }), -/* 1203 */ +/* 1207 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164564,8 +166146,8 @@ module.exports = TilemapCSVFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(58); -var TILEMAP_FORMATS = __webpack_require__(31); +var JSONFile = __webpack_require__(59); +var TILEMAP_FORMATS = __webpack_require__(30); /** * @classdesc @@ -164709,7 +166291,7 @@ module.exports = TilemapImpactFile; /***/ }), -/* 1204 */ +/* 1208 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164720,8 +166302,8 @@ module.exports = TilemapImpactFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(58); -var TILEMAP_FORMATS = __webpack_require__(31); +var JSONFile = __webpack_require__(59); +var TILEMAP_FORMATS = __webpack_require__(30); /** * @classdesc @@ -164865,7 +166447,7 @@ module.exports = TilemapJSONFile; /***/ }), -/* 1205 */ +/* 1209 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164877,10 +166459,10 @@ module.exports = TilemapJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(70); +var ImageFile = __webpack_require__(71); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(59); -var TextFile = __webpack_require__(432); +var MultiFile = __webpack_require__(60); +var TextFile = __webpack_require__(435); /** * @classdesc @@ -165107,7 +166689,7 @@ module.exports = UnityAtlasFile; /***/ }), -/* 1206 */ +/* 1210 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165117,15 +166699,15 @@ module.exports = UnityAtlasFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(16); -var CustomSet = __webpack_require__(105); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(80); +var CONST = __webpack_require__(17); +var CustomSet = __webpack_require__(106); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(81); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var XHRSettings = __webpack_require__(133); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var XHRSettings = __webpack_require__(134); /** * @classdesc @@ -166174,7 +167756,7 @@ module.exports = LoaderPlugin; /***/ }), -/* 1207 */ +/* 1211 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166183,8 +167765,8 @@ module.exports = LoaderPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(50); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(51); +var Extend = __webpack_require__(15); /** * @callback ArcadePhysicsCallback @@ -166199,18 +167781,18 @@ var Extend = __webpack_require__(17); var Arcade = { - ArcadePhysics: __webpack_require__(1208), - Body: __webpack_require__(438), - Collider: __webpack_require__(439), - Components: __webpack_require__(207), - Events: __webpack_require__(208), - Factory: __webpack_require__(433), - Group: __webpack_require__(435), - Image: __webpack_require__(434), - Sprite: __webpack_require__(134), - StaticBody: __webpack_require__(445), - StaticGroup: __webpack_require__(436), - World: __webpack_require__(437) + ArcadePhysics: __webpack_require__(1212), + Body: __webpack_require__(441), + Collider: __webpack_require__(442), + Components: __webpack_require__(209), + Events: __webpack_require__(210), + Factory: __webpack_require__(436), + Group: __webpack_require__(438), + Image: __webpack_require__(437), + Sprite: __webpack_require__(135), + StaticBody: __webpack_require__(448), + StaticGroup: __webpack_require__(439), + World: __webpack_require__(440) }; @@ -166221,7 +167803,7 @@ module.exports = Arcade; /***/ }), -/* 1208 */ +/* 1212 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166232,16 +167814,16 @@ module.exports = Arcade; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(35); -var DistanceBetween = __webpack_require__(57); -var DistanceSquared = __webpack_require__(294); -var Factory = __webpack_require__(433); +var DistanceBetween = __webpack_require__(58); +var DistanceSquared = __webpack_require__(297); +var Factory = __webpack_require__(436); var GetFastValue = __webpack_require__(2); -var Merge = __webpack_require__(85); -var OverlapRect = __webpack_require__(1221); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var Vector2 = __webpack_require__(4); -var World = __webpack_require__(437); +var Merge = __webpack_require__(105); +var OverlapRect = __webpack_require__(1225); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var Vector2 = __webpack_require__(3); +var World = __webpack_require__(440); /** * @classdesc @@ -166848,7 +168430,7 @@ module.exports = ArcadePhysics; /***/ }), -/* 1209 */ +/* 1213 */ /***/ (function(module, exports) { /** @@ -166923,7 +168505,7 @@ module.exports = Acceleration; /***/ }), -/* 1210 */ +/* 1214 */ /***/ (function(module, exports) { /** @@ -167005,7 +168587,7 @@ module.exports = Angular; /***/ }), -/* 1211 */ +/* 1215 */ /***/ (function(module, exports) { /** @@ -167104,7 +168686,7 @@ module.exports = Bounce; /***/ }), -/* 1212 */ +/* 1216 */ /***/ (function(module, exports) { /** @@ -167231,7 +168813,7 @@ module.exports = Debug; /***/ }), -/* 1213 */ +/* 1217 */ /***/ (function(module, exports) { /** @@ -167364,7 +168946,7 @@ module.exports = Drag; /***/ }), -/* 1214 */ +/* 1218 */ /***/ (function(module, exports) { /** @@ -167488,7 +169070,7 @@ module.exports = Enable; /***/ }), -/* 1215 */ +/* 1219 */ /***/ (function(module, exports) { /** @@ -167566,7 +169148,7 @@ module.exports = Friction; /***/ }), -/* 1216 */ +/* 1220 */ /***/ (function(module, exports) { /** @@ -167644,7 +169226,7 @@ module.exports = Gravity; /***/ }), -/* 1217 */ +/* 1221 */ /***/ (function(module, exports) { /** @@ -167686,7 +169268,7 @@ module.exports = Immovable; /***/ }), -/* 1218 */ +/* 1222 */ /***/ (function(module, exports) { /** @@ -167726,7 +169308,7 @@ module.exports = Mass; /***/ }), -/* 1219 */ +/* 1223 */ /***/ (function(module, exports) { /** @@ -167808,7 +169390,7 @@ module.exports = Size; /***/ }), -/* 1220 */ +/* 1224 */ /***/ (function(module, exports) { /** @@ -167907,7 +169489,7 @@ module.exports = Velocity; /***/ }), -/* 1221 */ +/* 1225 */ /***/ (function(module, exports) { /** @@ -167992,7 +169574,7 @@ module.exports = OverlapRect; /***/ }), -/* 1222 */ +/* 1226 */ /***/ (function(module, exports) { /** @@ -168025,7 +169607,7 @@ module.exports = 'collide'; /***/ }), -/* 1223 */ +/* 1227 */ /***/ (function(module, exports) { /** @@ -168058,7 +169640,7 @@ module.exports = 'overlap'; /***/ }), -/* 1224 */ +/* 1228 */ /***/ (function(module, exports) { /** @@ -168081,7 +169663,7 @@ module.exports = 'pause'; /***/ }), -/* 1225 */ +/* 1229 */ /***/ (function(module, exports) { /** @@ -168104,7 +169686,7 @@ module.exports = 'resume'; /***/ }), -/* 1226 */ +/* 1230 */ /***/ (function(module, exports) { /** @@ -168136,7 +169718,7 @@ module.exports = 'tilecollide'; /***/ }), -/* 1227 */ +/* 1231 */ /***/ (function(module, exports) { /** @@ -168168,7 +169750,7 @@ module.exports = 'tileoverlap'; /***/ }), -/* 1228 */ +/* 1232 */ /***/ (function(module, exports) { /** @@ -168200,7 +169782,7 @@ module.exports = 'worldbounds'; /***/ }), -/* 1229 */ +/* 1233 */ /***/ (function(module, exports) { /** @@ -168226,7 +169808,7 @@ module.exports = 'worldstep'; /***/ }), -/* 1230 */ +/* 1234 */ /***/ (function(module, exports) { /** @@ -168267,7 +169849,7 @@ module.exports = ProcessTileCallbacks; /***/ }), -/* 1231 */ +/* 1235 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168276,9 +169858,9 @@ module.exports = ProcessTileCallbacks; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileCheckX = __webpack_require__(1232); -var TileCheckY = __webpack_require__(1234); -var TileIntersectsBody = __webpack_require__(444); +var TileCheckX = __webpack_require__(1236); +var TileCheckY = __webpack_require__(1238); +var TileIntersectsBody = __webpack_require__(447); /** * The core separation function to separate a physics body and a tile. @@ -168387,7 +169969,7 @@ module.exports = SeparateTile; /***/ }), -/* 1232 */ +/* 1236 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168396,7 +169978,7 @@ module.exports = SeparateTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ProcessTileSeparationX = __webpack_require__(1233); +var ProcessTileSeparationX = __webpack_require__(1237); /** * Check the body against the given tile on the X axis. @@ -168477,7 +170059,7 @@ module.exports = TileCheckX; /***/ }), -/* 1233 */ +/* 1237 */ /***/ (function(module, exports) { /** @@ -168524,7 +170106,7 @@ module.exports = ProcessTileSeparationX; /***/ }), -/* 1234 */ +/* 1238 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168533,7 +170115,7 @@ module.exports = ProcessTileSeparationX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ProcessTileSeparationY = __webpack_require__(1235); +var ProcessTileSeparationY = __webpack_require__(1239); /** * Check the body against the given tile on the Y axis. @@ -168614,7 +170196,7 @@ module.exports = TileCheckY; /***/ }), -/* 1235 */ +/* 1239 */ /***/ (function(module, exports) { /** @@ -168661,7 +170243,7 @@ module.exports = ProcessTileSeparationY; /***/ }), -/* 1236 */ +/* 1240 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168670,7 +170252,7 @@ module.exports = ProcessTileSeparationY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetOverlapX = __webpack_require__(440); +var GetOverlapX = __webpack_require__(443); /** * Separates two overlapping bodies on the X-axis (horizontally). @@ -168752,7 +170334,7 @@ module.exports = SeparateX; /***/ }), -/* 1237 */ +/* 1241 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168761,7 +170343,7 @@ module.exports = SeparateX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetOverlapY = __webpack_require__(441); +var GetOverlapY = __webpack_require__(444); /** * Separates two overlapping bodies on the Y-axis (vertically). @@ -168843,7 +170425,7 @@ module.exports = SeparateY; /***/ }), -/* 1238 */ +/* 1242 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168858,15 +170440,15 @@ module.exports = SeparateY; module.exports = { - COLLIDE: __webpack_require__(1343), - PAUSE: __webpack_require__(1344), - RESUME: __webpack_require__(1345) + COLLIDE: __webpack_require__(1356), + PAUSE: __webpack_require__(1357), + RESUME: __webpack_require__(1358) }; /***/ }), -/* 1239 */ +/* 1243 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168881,24 +170463,24 @@ module.exports = { module.exports = { - Acceleration: __webpack_require__(1347), - BodyScale: __webpack_require__(1348), - BodyType: __webpack_require__(1349), - Bounce: __webpack_require__(1350), - CheckAgainst: __webpack_require__(1351), - Collides: __webpack_require__(1352), - Debug: __webpack_require__(1353), - Friction: __webpack_require__(1354), - Gravity: __webpack_require__(1355), - Offset: __webpack_require__(1356), - SetGameObject: __webpack_require__(1357), - Velocity: __webpack_require__(1358) + Acceleration: __webpack_require__(1360), + BodyScale: __webpack_require__(1361), + BodyType: __webpack_require__(1362), + Bounce: __webpack_require__(1363), + CheckAgainst: __webpack_require__(1364), + Collides: __webpack_require__(1365), + Debug: __webpack_require__(1366), + Friction: __webpack_require__(1367), + Gravity: __webpack_require__(1368), + Offset: __webpack_require__(1369), + SetGameObject: __webpack_require__(1370), + Velocity: __webpack_require__(1371) }; /***/ }), -/* 1240 */ +/* 1244 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168968,7 +170550,7 @@ var Common = __webpack_require__(37); /***/ }), -/* 1241 */ +/* 1245 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168983,24 +170565,24 @@ var Common = __webpack_require__(37); module.exports = { - AFTER_UPDATE: __webpack_require__(1376), - BEFORE_UPDATE: __webpack_require__(1377), - COLLISION_ACTIVE: __webpack_require__(1378), - COLLISION_END: __webpack_require__(1379), - COLLISION_START: __webpack_require__(1380), - DRAG_END: __webpack_require__(1381), - DRAG: __webpack_require__(1382), - DRAG_START: __webpack_require__(1383), - PAUSE: __webpack_require__(1384), - RESUME: __webpack_require__(1385), - SLEEP_END: __webpack_require__(1386), - SLEEP_START: __webpack_require__(1387) + AFTER_UPDATE: __webpack_require__(1388), + BEFORE_UPDATE: __webpack_require__(1389), + COLLISION_ACTIVE: __webpack_require__(1390), + COLLISION_END: __webpack_require__(1391), + COLLISION_START: __webpack_require__(1392), + DRAG_END: __webpack_require__(1393), + DRAG: __webpack_require__(1394), + DRAG_START: __webpack_require__(1395), + PAUSE: __webpack_require__(1396), + RESUME: __webpack_require__(1397), + SLEEP_END: __webpack_require__(1398), + SLEEP_START: __webpack_require__(1399) }; /***/ }), -/* 1242 */ +/* 1246 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169009,13 +170591,13 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(135); -var Body = __webpack_require__(60); +var Bodies = __webpack_require__(136); +var Body = __webpack_require__(61); var Class = __webpack_require__(0); -var Components = __webpack_require__(488); +var Components = __webpack_require__(490); var GetFastValue = __webpack_require__(2); var HasValue = __webpack_require__(97); -var Vertices = __webpack_require__(84); +var Vertices = __webpack_require__(86); /** * @classdesc @@ -169313,7 +170895,7 @@ module.exports = MatterTileBody; /***/ }), -/* 1243 */ +/* 1247 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169328,8 +170910,8 @@ var Detector = {}; module.exports = Detector; -var SAT = __webpack_require__(1244); -var Pair = __webpack_require__(489); +var SAT = __webpack_require__(1248); +var Pair = __webpack_require__(491); var Bounds = __webpack_require__(100); (function() { @@ -169426,7 +171008,7 @@ var Bounds = __webpack_require__(100); /***/ }), -/* 1244 */ +/* 1248 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169441,7 +171023,7 @@ var SAT = {}; module.exports = SAT; -var Vertices = __webpack_require__(84); +var Vertices = __webpack_require__(86); var Vector = __webpack_require__(99); (function() { @@ -169702,7 +171284,7 @@ var Vector = __webpack_require__(99); /***/ }), -/* 1245 */ +/* 1249 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169711,36 +171293,40 @@ var Vector = __webpack_require__(99); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Matter = __webpack_require__(1332); +/** + * @namespace Phaser.Physics.Matter.Matter + */ -Matter.Body = __webpack_require__(60); -Matter.Composite = __webpack_require__(209); -Matter.World = __webpack_require__(1247); +var Matter = __webpack_require__(1345); -Matter.Detector = __webpack_require__(1243); -Matter.Grid = __webpack_require__(1333); -Matter.Pairs = __webpack_require__(1334); -Matter.Pair = __webpack_require__(489); -Matter.Query = __webpack_require__(1391); -Matter.Resolver = __webpack_require__(1335); -Matter.SAT = __webpack_require__(1244); +Matter.Body = __webpack_require__(61); +Matter.Composite = __webpack_require__(211); +Matter.World = __webpack_require__(1251); -Matter.Constraint = __webpack_require__(228); +Matter.Detector = __webpack_require__(1247); +Matter.Grid = __webpack_require__(1346); +Matter.Pairs = __webpack_require__(1347); +Matter.Pair = __webpack_require__(491); +Matter.Query = __webpack_require__(1403); +Matter.Resolver = __webpack_require__(1348); +Matter.SAT = __webpack_require__(1248); + +Matter.Constraint = __webpack_require__(231); Matter.Common = __webpack_require__(37); -Matter.Engine = __webpack_require__(1336); -Matter.Events = __webpack_require__(227); -Matter.Sleeping = __webpack_require__(448); -Matter.Plugin = __webpack_require__(1246); +Matter.Engine = __webpack_require__(1349); +Matter.Events = __webpack_require__(230); +Matter.Sleeping = __webpack_require__(451); +Matter.Plugin = __webpack_require__(1250); -Matter.Bodies = __webpack_require__(135); -Matter.Composites = __webpack_require__(1329); +Matter.Bodies = __webpack_require__(136); +Matter.Composites = __webpack_require__(1341); -Matter.Axes = __webpack_require__(1240); +Matter.Axes = __webpack_require__(1244); Matter.Bounds = __webpack_require__(100); -Matter.Svg = __webpack_require__(1393); +Matter.Svg = __webpack_require__(1405); Matter.Vector = __webpack_require__(99); -Matter.Vertices = __webpack_require__(84); +Matter.Vertices = __webpack_require__(86); // aliases @@ -169755,7 +171341,7 @@ module.exports = Matter; /***/ }), -/* 1246 */ +/* 1250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170105,7 +171691,7 @@ var Common = __webpack_require__(37); /***/ }), -/* 1247 */ +/* 1251 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170125,8 +171711,8 @@ var World = {}; module.exports = World; -var Composite = __webpack_require__(209); -var Constraint = __webpack_require__(228); +var Composite = __webpack_require__(211); +var Constraint = __webpack_require__(231); var Common = __webpack_require__(37); (function() { @@ -170258,7 +171844,7 @@ var Common = __webpack_require__(37); /***/ }), -/* 1248 */ +/* 1252 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170273,17 +171859,17 @@ var Common = __webpack_require__(37); module.exports = { - BasePlugin: __webpack_require__(449), - DefaultPlugins: __webpack_require__(171), - PluginCache: __webpack_require__(18), - PluginManager: __webpack_require__(342), - ScenePlugin: __webpack_require__(1249) + BasePlugin: __webpack_require__(452), + DefaultPlugins: __webpack_require__(172), + PluginCache: __webpack_require__(19), + PluginManager: __webpack_require__(345), + ScenePlugin: __webpack_require__(1253) }; /***/ }), -/* 1249 */ +/* 1253 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170292,9 +171878,9 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ -var BasePlugin = __webpack_require__(449); +var BasePlugin = __webpack_require__(452); var Class = __webpack_require__(0); -var SceneEvents = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); /** * @classdesc @@ -170372,7 +171958,7 @@ module.exports = ScenePlugin; /***/ }), -/* 1250 */ +/* 1254 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170381,8 +171967,8 @@ module.exports = ScenePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(17); -var CONST = __webpack_require__(173); +var Extend = __webpack_require__(15); +var CONST = __webpack_require__(174); /** * @namespace Phaser.Scale @@ -170410,12 +171996,12 @@ var CONST = __webpack_require__(173); var Scale = { - Center: __webpack_require__(331), - Events: __webpack_require__(89), - Orientation: __webpack_require__(332), - ScaleManager: __webpack_require__(343), - ScaleModes: __webpack_require__(333), - Zoom: __webpack_require__(334) + Center: __webpack_require__(334), + Events: __webpack_require__(90), + Orientation: __webpack_require__(335), + ScaleManager: __webpack_require__(346), + ScaleModes: __webpack_require__(336), + Zoom: __webpack_require__(337) }; @@ -170428,7 +172014,7 @@ module.exports = Scale; /***/ }), -/* 1251 */ +/* 1255 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170437,8 +172023,8 @@ module.exports = Scale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(122); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(123); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Scenes @@ -170446,11 +172032,11 @@ var Extend = __webpack_require__(17); var Scene = { - Events: __webpack_require__(19), - SceneManager: __webpack_require__(345), - ScenePlugin: __webpack_require__(1252), - Settings: __webpack_require__(348), - Systems: __webpack_require__(176) + Events: __webpack_require__(20), + SceneManager: __webpack_require__(348), + ScenePlugin: __webpack_require__(1256), + Settings: __webpack_require__(350), + Systems: __webpack_require__(177) }; @@ -170461,7 +172047,7 @@ module.exports = Scene; /***/ }), -/* 1252 */ +/* 1256 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170470,11 +172056,11 @@ module.exports = Scene; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); -var Events = __webpack_require__(19); +var Events = __webpack_require__(20); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(18); +var PluginCache = __webpack_require__(19); /** * @classdesc @@ -171455,7 +173041,7 @@ module.exports = ScenePlugin; /***/ }), -/* 1253 */ +/* 1257 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171470,18 +173056,18 @@ module.exports = ScenePlugin; module.exports = { - List: __webpack_require__(125), - Map: __webpack_require__(157), - ProcessQueue: __webpack_require__(442), - RTree: __webpack_require__(443), - Set: __webpack_require__(105), - Size: __webpack_require__(344) + List: __webpack_require__(126), + Map: __webpack_require__(158), + ProcessQueue: __webpack_require__(445), + RTree: __webpack_require__(446), + Set: __webpack_require__(106), + Size: __webpack_require__(347) }; /***/ }), -/* 1254 */ +/* 1258 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171490,8 +173076,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(17); -var FilterMode = __webpack_require__(1255); +var Extend = __webpack_require__(15); +var FilterMode = __webpack_require__(1259); /** * @namespace Phaser.Textures @@ -171517,13 +173103,14 @@ var FilterMode = __webpack_require__(1255); var Textures = { - Events: __webpack_require__(118), + CanvasTexture: __webpack_require__(352), + Events: __webpack_require__(119), FilterMode: FilterMode, - Frame: __webpack_require__(91), - Parsers: __webpack_require__(351), - Texture: __webpack_require__(177), - TextureManager: __webpack_require__(349), - TextureSource: __webpack_require__(350) + Frame: __webpack_require__(92), + Parsers: __webpack_require__(354), + Texture: __webpack_require__(179), + TextureManager: __webpack_require__(351), + TextureSource: __webpack_require__(353) }; @@ -171533,7 +173120,7 @@ module.exports = Textures; /***/ }), -/* 1255 */ +/* 1259 */ /***/ (function(module, exports) { /** @@ -171577,7 +173164,7 @@ module.exports = CONST; /***/ }), -/* 1256 */ +/* 1260 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171592,30 +173179,30 @@ module.exports = CONST; module.exports = { - Components: __webpack_require__(136), - Parsers: __webpack_require__(1286), + Components: __webpack_require__(137), + Parsers: __webpack_require__(1290), - Formats: __webpack_require__(31), - ImageCollection: __webpack_require__(460), - ParseToTilemap: __webpack_require__(216), - Tile: __webpack_require__(72), - Tilemap: __webpack_require__(469), - TilemapCreator: __webpack_require__(1295), - TilemapFactory: __webpack_require__(1296), - Tileset: __webpack_require__(140), + Formats: __webpack_require__(30), + ImageCollection: __webpack_require__(463), + ParseToTilemap: __webpack_require__(218), + Tile: __webpack_require__(73), + Tilemap: __webpack_require__(472), + TilemapCreator: __webpack_require__(1299), + TilemapFactory: __webpack_require__(1300), + Tileset: __webpack_require__(141), LayerData: __webpack_require__(102), MapData: __webpack_require__(103), - ObjectLayer: __webpack_require__(463), + ObjectLayer: __webpack_require__(466), - DynamicTilemapLayer: __webpack_require__(470), - StaticTilemapLayer: __webpack_require__(471) + DynamicTilemapLayer: __webpack_require__(473), + StaticTilemapLayer: __webpack_require__(474) }; /***/ }), -/* 1257 */ +/* 1261 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171624,8 +173211,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var CalculateFacesWithin = __webpack_require__(51); +var GetTilesWithin = __webpack_require__(23); +var CalculateFacesWithin = __webpack_require__(52); /** * Copies the tiles in the source rectangular area to a new destination (all specified in tile @@ -171680,7 +173267,7 @@ module.exports = Copy; /***/ }), -/* 1258 */ +/* 1262 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171689,10 +173276,10 @@ module.exports = Copy; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileToWorldX = __webpack_require__(138); -var TileToWorldY = __webpack_require__(139); -var GetTilesWithin = __webpack_require__(21); -var ReplaceByIndex = __webpack_require__(450); +var TileToWorldX = __webpack_require__(139); +var TileToWorldY = __webpack_require__(140); +var GetTilesWithin = __webpack_require__(23); +var ReplaceByIndex = __webpack_require__(453); /** * Creates a Sprite for every object matching the given tile indexes in the layer. You can @@ -171765,7 +173352,7 @@ module.exports = CreateFromTiles; /***/ }), -/* 1259 */ +/* 1263 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171774,8 +173361,8 @@ module.exports = CreateFromTiles; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SnapFloor = __webpack_require__(90); -var SnapCeil = __webpack_require__(303); +var SnapFloor = __webpack_require__(91); +var SnapCeil = __webpack_require__(306); /** * Returns the tiles in the given layer that are within the camera's viewport. This is used internally. @@ -171922,7 +173509,7 @@ module.exports = CullTiles; /***/ }), -/* 1260 */ +/* 1264 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171931,9 +173518,9 @@ module.exports = CullTiles; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var CalculateFacesWithin = __webpack_require__(51); -var SetTileCollision = __webpack_require__(71); +var GetTilesWithin = __webpack_require__(23); +var CalculateFacesWithin = __webpack_require__(52); +var SetTileCollision = __webpack_require__(72); /** * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the @@ -171976,7 +173563,7 @@ module.exports = Fill; /***/ }), -/* 1261 */ +/* 1265 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171985,7 +173572,7 @@ module.exports = Fill; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given @@ -172024,7 +173611,7 @@ module.exports = FilterTiles; /***/ }), -/* 1262 */ +/* 1266 */ /***/ (function(module, exports) { /** @@ -172112,7 +173699,7 @@ module.exports = FindByIndex; /***/ }), -/* 1263 */ +/* 1267 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172121,7 +173708,7 @@ module.exports = FindByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * @callback FindTileCallback @@ -172166,7 +173753,7 @@ module.exports = FindTile; /***/ }), -/* 1264 */ +/* 1268 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172175,7 +173762,7 @@ module.exports = FindTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * @callback EachTileCallback @@ -172216,7 +173803,7 @@ module.exports = ForEachTile; /***/ }), -/* 1265 */ +/* 1269 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172225,9 +173812,9 @@ module.exports = ForEachTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(137); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var GetTileAt = __webpack_require__(138); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); /** * Gets a tile at the given world coordinates from the given layer. @@ -172257,7 +173844,7 @@ module.exports = GetTileAtWorldXY; /***/ }), -/* 1266 */ +/* 1270 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172266,14 +173853,14 @@ module.exports = GetTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Geom = __webpack_require__(401); -var GetTilesWithin = __webpack_require__(21); -var Intersects = __webpack_require__(402); +var Geom = __webpack_require__(404); +var GetTilesWithin = __webpack_require__(23); +var Intersects = __webpack_require__(405); var NOOP = __webpack_require__(1); -var TileToWorldX = __webpack_require__(138); -var TileToWorldY = __webpack_require__(139); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var TileToWorldX = __webpack_require__(139); +var TileToWorldY = __webpack_require__(140); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); var TriangleToRectangle = function (triangle, rect) { @@ -172354,7 +173941,7 @@ module.exports = GetTilesWithinShape; /***/ }), -/* 1267 */ +/* 1271 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172363,9 +173950,9 @@ module.exports = GetTilesWithinShape; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var GetTilesWithin = __webpack_require__(23); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. @@ -172404,7 +173991,7 @@ module.exports = GetTilesWithinWorldXY; /***/ }), -/* 1268 */ +/* 1272 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172413,9 +174000,9 @@ module.exports = GetTilesWithinWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HasTileAt = __webpack_require__(451); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var HasTileAt = __webpack_require__(454); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); /** * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns @@ -172444,7 +174031,7 @@ module.exports = HasTileAtWorldXY; /***/ }), -/* 1269 */ +/* 1273 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172453,9 +174040,9 @@ module.exports = HasTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PutTileAt = __webpack_require__(211); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var PutTileAt = __webpack_require__(213); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); /** * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either @@ -172487,7 +174074,7 @@ module.exports = PutTileAtWorldXY; /***/ }), -/* 1270 */ +/* 1274 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172496,8 +174083,8 @@ module.exports = PutTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CalculateFacesWithin = __webpack_require__(51); -var PutTileAt = __webpack_require__(211); +var CalculateFacesWithin = __webpack_require__(52); +var PutTileAt = __webpack_require__(213); /** * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified @@ -172551,7 +174138,7 @@ module.exports = PutTilesAt; /***/ }), -/* 1271 */ +/* 1275 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172560,8 +174147,8 @@ module.exports = PutTilesAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var GetRandom = __webpack_require__(180); +var GetTilesWithin = __webpack_require__(23); +var GetRandom = __webpack_require__(182); /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -172609,7 +174196,7 @@ module.exports = Randomize; /***/ }), -/* 1272 */ +/* 1276 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172618,9 +174205,9 @@ module.exports = Randomize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RemoveTileAt = __webpack_require__(452); -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); +var RemoveTileAt = __webpack_require__(455); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); /** * Removes the tile at the given world coordinates in the specified layer and updates the layer's @@ -172650,7 +174237,7 @@ module.exports = RemoveTileAtWorldXY; /***/ }), -/* 1273 */ +/* 1277 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172659,8 +174246,8 @@ module.exports = RemoveTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var Color = __webpack_require__(326); +var GetTilesWithin = __webpack_require__(23); +var Color = __webpack_require__(329); var defaultTileColor = new Color(105, 210, 231, 150); var defaultCollidingTileColor = new Color(243, 134, 48, 200); @@ -172697,8 +174284,8 @@ var RenderDebug = function (graphics, styleConfig, layer) var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer); - graphics.translate(layer.tilemapLayer.x, layer.tilemapLayer.y); - graphics.scale(layer.tilemapLayer.scaleX, layer.tilemapLayer.scaleY); + graphics.translateCanvas(layer.tilemapLayer.x, layer.tilemapLayer.y); + graphics.scaleCanvas(layer.tilemapLayer.scaleX, layer.tilemapLayer.scaleY); for (var i = 0; i < tiles.length; i++) { @@ -172739,7 +174326,7 @@ module.exports = RenderDebug; /***/ }), -/* 1274 */ +/* 1278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172748,9 +174335,9 @@ module.exports = RenderDebug; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(71); -var CalculateFacesWithin = __webpack_require__(51); -var SetLayerCollisionIndex = __webpack_require__(212); +var SetTileCollision = __webpack_require__(72); +var CalculateFacesWithin = __webpack_require__(52); +var SetLayerCollisionIndex = __webpack_require__(214); /** * Sets collision on the given tile or tiles within a layer by index. You can pass in either a @@ -172802,7 +174389,7 @@ module.exports = SetCollision; /***/ }), -/* 1275 */ +/* 1279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172811,9 +174398,9 @@ module.exports = SetCollision; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(71); -var CalculateFacesWithin = __webpack_require__(51); -var SetLayerCollisionIndex = __webpack_require__(212); +var SetTileCollision = __webpack_require__(72); +var CalculateFacesWithin = __webpack_require__(52); +var SetLayerCollisionIndex = __webpack_require__(214); /** * Sets collision on a range of tiles in a layer whose index is between the specified `start` and @@ -172870,7 +174457,7 @@ module.exports = SetCollisionBetween; /***/ }), -/* 1276 */ +/* 1280 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172879,9 +174466,9 @@ module.exports = SetCollisionBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(71); -var CalculateFacesWithin = __webpack_require__(51); -var SetLayerCollisionIndex = __webpack_require__(212); +var SetTileCollision = __webpack_require__(72); +var CalculateFacesWithin = __webpack_require__(52); +var SetLayerCollisionIndex = __webpack_require__(214); /** * Sets collision on all tiles in the given layer, except for tiles that have an index specified in @@ -172927,7 +174514,7 @@ module.exports = SetCollisionByExclusion; /***/ }), -/* 1277 */ +/* 1281 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172936,8 +174523,8 @@ module.exports = SetCollisionByExclusion; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(71); -var CalculateFacesWithin = __webpack_require__(51); +var SetTileCollision = __webpack_require__(72); +var CalculateFacesWithin = __webpack_require__(52); var HasValue = __webpack_require__(97); /** @@ -173002,7 +174589,7 @@ module.exports = SetCollisionByProperty; /***/ }), -/* 1278 */ +/* 1282 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173011,8 +174598,8 @@ module.exports = SetCollisionByProperty; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(71); -var CalculateFacesWithin = __webpack_require__(51); +var SetTileCollision = __webpack_require__(72); +var CalculateFacesWithin = __webpack_require__(52); /** * Sets collision on the tiles within a layer by checking each tile's collision group data @@ -173062,7 +174649,7 @@ module.exports = SetCollisionFromCollisionGroup; /***/ }), -/* 1279 */ +/* 1283 */ /***/ (function(module, exports) { /** @@ -173109,7 +174696,7 @@ module.exports = SetTileIndexCallback; /***/ }), -/* 1280 */ +/* 1284 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173118,7 +174705,7 @@ module.exports = SetTileIndexCallback; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. @@ -173152,7 +174739,7 @@ module.exports = SetTileLocationCallback; /***/ }), -/* 1281 */ +/* 1285 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173161,8 +174748,8 @@ module.exports = SetTileLocationCallback; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); -var ShuffleArray = __webpack_require__(111); +var GetTilesWithin = __webpack_require__(23); +var ShuffleArray = __webpack_require__(112); /** * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given @@ -173197,7 +174784,7 @@ module.exports = Shuffle; /***/ }), -/* 1282 */ +/* 1286 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173206,7 +174793,7 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -173248,7 +174835,7 @@ module.exports = SwapByIndex; /***/ }), -/* 1283 */ +/* 1287 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173257,9 +174844,9 @@ module.exports = SwapByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileToWorldX = __webpack_require__(138); -var TileToWorldY = __webpack_require__(139); -var Vector2 = __webpack_require__(4); +var TileToWorldX = __webpack_require__(139); +var TileToWorldY = __webpack_require__(140); +var Vector2 = __webpack_require__(3); /** * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the @@ -173292,7 +174879,7 @@ module.exports = TileToWorldXY; /***/ }), -/* 1284 */ +/* 1288 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173301,7 +174888,7 @@ module.exports = TileToWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(21); +var GetTilesWithin = __webpack_require__(23); /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -173372,7 +174959,7 @@ module.exports = WeightedRandomize; /***/ }), -/* 1285 */ +/* 1289 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173381,9 +174968,9 @@ module.exports = WeightedRandomize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var WorldToTileX = __webpack_require__(61); -var WorldToTileY = __webpack_require__(62); -var Vector2 = __webpack_require__(4); +var WorldToTileX = __webpack_require__(62); +var WorldToTileY = __webpack_require__(63); +var Vector2 = __webpack_require__(3); /** * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the @@ -173417,7 +175004,7 @@ module.exports = WorldToTileXY; /***/ }), -/* 1286 */ +/* 1290 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173432,18 +175019,18 @@ module.exports = WorldToTileXY; module.exports = { - Parse: __webpack_require__(453), - Parse2DArray: __webpack_require__(213), - ParseCSV: __webpack_require__(454), + Parse: __webpack_require__(456), + Parse2DArray: __webpack_require__(215), + ParseCSV: __webpack_require__(457), - Impact: __webpack_require__(1287), - Tiled: __webpack_require__(1288) + Impact: __webpack_require__(1291), + Tiled: __webpack_require__(1292) }; /***/ }), -/* 1287 */ +/* 1291 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173458,15 +175045,15 @@ module.exports = { module.exports = { - ParseTileLayers: __webpack_require__(467), - ParseTilesets: __webpack_require__(468), - ParseWeltmeister: __webpack_require__(466) + ParseTileLayers: __webpack_require__(470), + ParseTilesets: __webpack_require__(471), + ParseWeltmeister: __webpack_require__(469) }; /***/ }), -/* 1288 */ +/* 1292 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173481,22 +175068,22 @@ module.exports = { module.exports = { - AssignTileProperties: __webpack_require__(465), - Base64Decode: __webpack_require__(457), - BuildTilesetIndex: __webpack_require__(464), - ParseGID: __webpack_require__(214), - ParseImageLayers: __webpack_require__(458), - ParseJSONTiled: __webpack_require__(455), - ParseObject: __webpack_require__(215), - ParseObjectLayers: __webpack_require__(462), - ParseTileLayers: __webpack_require__(456), - ParseTilesets: __webpack_require__(459) + AssignTileProperties: __webpack_require__(468), + Base64Decode: __webpack_require__(460), + BuildTilesetIndex: __webpack_require__(467), + ParseGID: __webpack_require__(216), + ParseImageLayers: __webpack_require__(461), + ParseJSONTiled: __webpack_require__(458), + ParseObject: __webpack_require__(217), + ParseObjectLayers: __webpack_require__(465), + ParseTileLayers: __webpack_require__(459), + ParseTilesets: __webpack_require__(462) }; /***/ }), -/* 1289 */ +/* 1293 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173510,12 +175097,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1290); + renderWebGL = __webpack_require__(1294); } if (true) { - renderCanvas = __webpack_require__(1291); + renderCanvas = __webpack_require__(1295); } module.exports = { @@ -173527,7 +175114,7 @@ module.exports = { /***/ }), -/* 1290 */ +/* 1294 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173644,7 +175231,7 @@ module.exports = DynamicTilemapLayerWebGLRenderer; /***/ }), -/* 1291 */ +/* 1295 */ /***/ (function(module, exports) { /** @@ -173771,7 +175358,7 @@ module.exports = DynamicTilemapLayerCanvasRenderer; /***/ }), -/* 1292 */ +/* 1296 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173785,12 +175372,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1293); + renderWebGL = __webpack_require__(1297); } if (true) { - renderCanvas = __webpack_require__(1294); + renderCanvas = __webpack_require__(1298); } module.exports = { @@ -173802,7 +175389,7 @@ module.exports = { /***/ }), -/* 1293 */ +/* 1297 */ /***/ (function(module, exports) { /** @@ -173874,7 +175461,7 @@ module.exports = StaticTilemapLayerWebGLRenderer; /***/ }), -/* 1294 */ +/* 1298 */ /***/ (function(module, exports) { /** @@ -174005,7 +175592,7 @@ module.exports = StaticTilemapLayerCanvasRenderer; /***/ }), -/* 1295 */ +/* 1299 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174014,8 +175601,8 @@ module.exports = StaticTilemapLayerCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(15); -var ParseToTilemap = __webpack_require__(216); +var GameObjectCreator = __webpack_require__(16); +var ParseToTilemap = __webpack_require__(218); /** * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. @@ -174049,7 +175636,7 @@ GameObjectCreator.register('tilemap', function (config) /***/ }), -/* 1296 */ +/* 1300 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174058,8 +175645,8 @@ GameObjectCreator.register('tilemap', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectFactory = __webpack_require__(5); -var ParseToTilemap = __webpack_require__(216); +var GameObjectFactory = __webpack_require__(6); +var ParseToTilemap = __webpack_require__(218); /** * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. @@ -174115,7 +175702,7 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt /***/ }), -/* 1297 */ +/* 1301 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174130,14 +175717,14 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt module.exports = { - Clock: __webpack_require__(1298), - TimerEvent: __webpack_require__(472) + Clock: __webpack_require__(1302), + TimerEvent: __webpack_require__(475) }; /***/ }), -/* 1298 */ +/* 1302 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174147,9 +175734,9 @@ module.exports = { */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var TimerEvent = __webpack_require__(472); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var TimerEvent = __webpack_require__(475); /** * @classdesc @@ -174543,7 +176130,7 @@ module.exports = Clock; /***/ }), -/* 1299 */ +/* 1303 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174552,8 +176139,8 @@ module.exports = Clock; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(88); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(89); +var Extend = __webpack_require__(15); /** * @namespace Phaser.Tweens @@ -174561,13 +176148,13 @@ var Extend = __webpack_require__(17); var Tweens = { - Builders: __webpack_require__(1300), - Events: __webpack_require__(478), + Builders: __webpack_require__(1304), + Events: __webpack_require__(223), - TweenManager: __webpack_require__(1308), - Tween: __webpack_require__(220), - TweenData: __webpack_require__(221), - Timeline: __webpack_require__(477) + TweenManager: __webpack_require__(1319), + Tween: __webpack_require__(222), + TweenData: __webpack_require__(224), + Timeline: __webpack_require__(480) }; @@ -174578,7 +176165,7 @@ module.exports = Tweens; /***/ }), -/* 1300 */ +/* 1304 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174593,22 +176180,22 @@ module.exports = Tweens; module.exports = { - GetBoolean: __webpack_require__(87), - GetEaseFunction: __webpack_require__(96), - GetNewValue: __webpack_require__(141), - GetProps: __webpack_require__(473), - GetTargets: __webpack_require__(217), - GetTweens: __webpack_require__(474), - GetValueOp: __webpack_require__(218), - NumberTweenBuilder: __webpack_require__(475), - TimelineBuilder: __webpack_require__(476), - TweenBuilder: __webpack_require__(142) + GetBoolean: __webpack_require__(88), + GetEaseFunction: __webpack_require__(82), + GetNewValue: __webpack_require__(142), + GetProps: __webpack_require__(476), + GetTargets: __webpack_require__(219), + GetTweens: __webpack_require__(477), + GetValueOp: __webpack_require__(220), + NumberTweenBuilder: __webpack_require__(478), + TimelineBuilder: __webpack_require__(479), + TweenBuilder: __webpack_require__(143) }; /***/ }), -/* 1301 */ +/* 1305 */ /***/ (function(module, exports) { /** @@ -174651,6 +176238,9 @@ module.exports = [ 'loop', 'loopDelay', 'offset', + 'onActive', + 'onActiveParams', + 'onActiveScope', 'onComplete', 'onCompleteParams', 'onCompleteScope', @@ -174680,7 +176270,7 @@ module.exports = [ /***/ }), -/* 1302 */ +/* 1306 */ /***/ (function(module, exports) { /** @@ -174716,7 +176306,7 @@ module.exports = 'complete'; /***/ }), -/* 1303 */ +/* 1307 */ /***/ (function(module, exports) { /** @@ -174748,13 +176338,12 @@ module.exports = 'complete'; * @since 3.0.0 * * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - * @param {integer} loopCount - The number of loops left before this Timeline completes. */ module.exports = 'loop'; /***/ }), -/* 1304 */ +/* 1308 */ /***/ (function(module, exports) { /** @@ -174791,7 +176380,7 @@ module.exports = 'pause'; /***/ }), -/* 1305 */ +/* 1309 */ /***/ (function(module, exports) { /** @@ -174828,7 +176417,7 @@ module.exports = 'resume'; /***/ }), -/* 1306 */ +/* 1310 */ /***/ (function(module, exports) { /** @@ -174864,7 +176453,7 @@ module.exports = 'start'; /***/ }), -/* 1307 */ +/* 1311 */ /***/ (function(module, exports) { /** @@ -174901,7 +176490,304 @@ module.exports = 'update'; /***/ }), -/* 1308 */ +/* 1312 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Active Event. + * + * This event is dispatched by a Tween when it becomes active within the Tween Manager. + * + * An 'active' Tween is one that is now progressing, although it may not yet be updating + * any target properties, due to settings such as `delay`. If you need an event for when + * the Tween starts actually updating its first property, see `TWEEN_START`. + * + * Listen to it from a Tween instance using `Tween.on('active', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('active', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'active'; + + +/***/ }), +/* 1313 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Complete Event. + * + * This event is dispatched by a Tween when it completes playback entirely, factoring in repeats and loops. + * + * If the Tween has been set to loop or repeat infinitely, this event will not be dispatched + * unless the `Tween.stop` method is called. + * + * If a Tween has a `completeDelay` set, this event will fire after that delay expires. + * + * Listen to it from a Tween instance using `Tween.on('complete', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('complete', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_COMPLETE + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'complete'; + + +/***/ }), +/* 1314 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Loop Event. + * + * This event is dispatched by a Tween when it loops. + * + * This event will only be dispatched if the Tween has a loop count set. + * + * If a Tween has a `loopDelay` set, this event will fire after that delay expires. + * + * The difference between `loop` and `repeat` is that `repeat` is a property setting, + * where-as `loop` applies to the entire Tween. + * + * Listen to it from a Tween instance using `Tween.on('loop', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * loop: 6 + * }); + * tween.on('loop', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_LOOP + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'loop'; + + +/***/ }), +/* 1315 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Repeat Event. + * + * This event is dispatched by a Tween when one of the properties it is tweening repeats. + * + * This event will only be dispatched if the Tween has a property with a repeat count set. + * + * If a Tween has a `repeatDelay` set, this event will fire after that delay expires. + * + * The difference between `loop` and `repeat` is that `repeat` is a property setting, + * where-as `loop` applies to the entire Tween. + * + * Listen to it from a Tween instance using `Tween.on('repeat', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * repeat: 4 + * }); + * tween.on('repeat', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {string} key - The key of the property that just repeated. + * @param {any} target - The target that the property just repated on. + */ +module.exports = 'repeat'; + + +/***/ }), +/* 1316 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Start Event. + * + * This event is dispatched by a Tween when it starts tweening its first property. + * + * A Tween will only emit this event once, as it can only start once. + * + * If a Tween has a `delay` set, this event will fire after that delay expires. + * + * Listen to it from a Tween instance using `Tween.on('start', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('start', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_START + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + */ +module.exports = 'start'; + + +/***/ }), +/* 1317 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Update Event. + * + * This event is dispatched by a Tween every time it updates _any_ of the properties it is tweening. + * + * A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property. + * + * **Note:** This is a very high frequency event and may be dispatched multiple times, every single frame. + * + * Listen to it from a Tween instance using `Tween.on('update', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * }); + * tween.on('update', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_UPDATE + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {string} key - The property that was updated, i.e. `x` or `scale`. + * @param {any} target - The target object that was updated. Usually a Game Object, but can be of any type. + */ +module.exports = 'update'; + + +/***/ }), +/* 1318 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Yoyo Event. + * + * This event is dispatched by a Tween whenever a property it is tweening yoyos. + * + * This event will only be dispatched if the Tween has a property with `yoyo` set. + * + * If the Tween has a `hold` value, this event is dispatched when the hold expires. + * + * This event is dispatched for every property, and for every target, that yoyos. + * For example, if a Tween was updating 2 properties and had 10 targets, this event + * would be dispatched 20 times (twice per target). So be careful how you use it! + * + * Listen to it from a Tween instance using `Tween.on('yoyo', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * yoyo: true + * }); + * tween.on('yoyo', listener); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.19.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + * @param {string} key - The property that yoyo'd, i.e. `x` or `scale`. + * @param {any} target - The target object that was yoyo'd. Usually a Game Object, but can be of any type. + */ +module.exports = 'yoyo'; + + +/***/ }), +/* 1319 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174910,14 +176796,15 @@ module.exports = 'update'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayRemove = __webpack_require__(120); +var ArrayRemove = __webpack_require__(121); var Class = __webpack_require__(0); -var NumberTweenBuilder = __webpack_require__(475); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var TimelineBuilder = __webpack_require__(476); -var TWEEN_CONST = __webpack_require__(88); -var TweenBuilder = __webpack_require__(142); +var NumberTweenBuilder = __webpack_require__(478); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var StaggerBuilder = __webpack_require__(1320); +var TimelineBuilder = __webpack_require__(479); +var TWEEN_CONST = __webpack_require__(89); +var TweenBuilder = __webpack_require__(143); /** * @classdesc @@ -175169,6 +177056,51 @@ var TweenManager = new Class({ return tween; }, + /** + * Creates a Stagger function to be used by a Tween property. + * + * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. + * + * This is only worth using if the tween has multiple targets. + * + * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 + * over the duration specified: + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(100) + * }); + * ``` + * + * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering + * from the center out, using a cubic ease. + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' }) + * }); + * ``` + * + * @method Phaser.Tweens.TweenManager#stagger + * @since 3.19.0 + * + * @param {Phaser.Types.Tweens.StaggerConfig} config - The configuration object for the Stagger function. + * + * @return {function} The stagger function. + */ + stagger: function (value, options) + { + return StaggerBuilder(value, options); + }, + /** * Updates the Tween Manager's internal lists at the start of the frame. * @@ -175626,7 +177558,252 @@ module.exports = TweenManager; /***/ }), -/* 1309 */ +/* 1320 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetEaseFunction = __webpack_require__(82); +var GetValue = __webpack_require__(5); + +/** + * Creates a Stagger function to be used by a Tween property. + * + * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. + * + * This is only worth using if the tween has multiple targets. + * + * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 + * over the duration specified: + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(100) + * }); + * ``` + * + * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering + * from the center out, using a cubic ease. + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' }) + * }); + * ``` + * + * @function Phaser.Tweens.Builders.StaggerBuilder + * @since 3.19.0 + * + * @param {(number|number[])} value - The amount to stagger by, or an array containing two elements representing the min and max values to stagger between. + * @param {Phaser.Types.Tweens.StaggerConfig} [config] - A Stagger Configuration object. + * + * @return {function} The stagger function. + */ +var StaggerBuilder = function (value, options) +{ + if (options === undefined) { options = {}; } + + var result; + + var start = GetValue(options, 'start', 0); + var ease = GetValue(options, 'ease', null); + var grid = GetValue(options, 'grid', null); + + var from = GetValue(options, 'from', 0); + + var fromFirst = (from === 'first'); + var fromCenter = (from === 'center'); + var fromLast = (from === 'last'); + var fromValue = (typeof(from) === 'number'); + + var isRange = (Array.isArray(value)); + var value1 = (isRange) ? parseFloat(value[0]) : parseFloat(value); + var value2 = (isRange) ? parseFloat(value[1]) : 0; + var maxValue = Math.max(value1, value2); + + if (isRange) + { + start += value1; + } + + if (grid) + { + // Pre-calc the grid to save doing it for ever tweendata update + var gridWidth = grid[0]; + var gridHeight = grid[1]; + + var fromX = 0; + var fromY = 0; + + var distanceX = 0; + var distanceY = 0; + + var gridValues = []; + + if (fromLast) + { + fromX = gridWidth - 1; + fromY = gridHeight - 1; + } + else if (fromValue) + { + fromX = from % gridWidth; + fromY = Math.floor(from / gridWidth); + } + else if (fromCenter) + { + fromX = (gridWidth - 1) / 2; + fromY = (gridHeight - 1) / 2; + } + + var gridMax = Number.MIN_SAFE_INTEGER; + + for (var toY = 0; toY < gridHeight; toY++) + { + gridValues[toY] = []; + + for (var toX = 0; toX < gridWidth; toX++) + { + distanceX = fromX - toX; + distanceY = fromY - toY; + + var dist = Math.sqrt(distanceX * distanceX + distanceY * distanceY); + + if (dist > gridMax) + { + gridMax = dist; + } + + gridValues[toY][toX] = dist; + } + } + } + + var easeFunction = (ease) ? GetEaseFunction(ease) : null; + + if (grid) + { + result = function (target, key, value, index) + { + var gridSpace = 0; + var toX = index % gridWidth; + var toY = Math.floor(index / gridWidth); + + if (toX >= 0 && toX < gridWidth && toY >= 0 && toY < gridHeight) + { + gridSpace = gridValues[toY][toX]; + } + + var output; + + if (isRange) + { + var diff = (value2 - value1); + + if (easeFunction) + { + output = ((gridSpace / gridMax) * diff) * easeFunction(gridSpace / gridMax); + } + else + { + output = (gridSpace / gridMax) * diff; + } + } + else if (easeFunction) + { + output = (gridSpace * value1) * easeFunction(gridSpace / gridMax); + } + else + { + output = gridSpace * value1; + } + + return output + start; + }; + } + else + { + result = function (target, key, value, index, total) + { + // zero offset + total--; + + var fromIndex; + + if (fromFirst) + { + fromIndex = index; + } + else if (fromCenter) + { + fromIndex = Math.abs((total / 2) - index); + } + else if (fromLast) + { + fromIndex = total - index; + } + else if (fromValue) + { + fromIndex = Math.abs(from - index); + } + + var output; + + if (isRange) + { + var spacing; + + if (fromCenter) + { + spacing = ((value2 - value1) / total) * (fromIndex * 2); + } + else + { + spacing = ((value2 - value1) / total) * fromIndex; + } + + if (easeFunction) + { + output = spacing * easeFunction(fromIndex / total); + } + else + { + output = spacing; + } + } + else if (easeFunction) + { + output = (total * maxValue) * easeFunction(fromIndex / total); + } + else + { + output = fromIndex * value1; + } + + return output + start; + }; + } + + return result; +}; + +module.exports = StaggerBuilder; + + +/***/ }), +/* 1321 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175641,16 +177818,16 @@ module.exports = TweenManager; module.exports = { - Array: __webpack_require__(178), - Base64: __webpack_require__(1310), - Objects: __webpack_require__(1312), - String: __webpack_require__(1316) + Array: __webpack_require__(180), + Base64: __webpack_require__(1322), + Objects: __webpack_require__(1324), + String: __webpack_require__(1328) }; /***/ }), -/* 1310 */ +/* 1322 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175665,14 +177842,14 @@ module.exports = { module.exports = { - ArrayBufferToBase64: __webpack_require__(1311), - Base64ToArrayBuffer: __webpack_require__(358) + ArrayBufferToBase64: __webpack_require__(1323), + Base64ToArrayBuffer: __webpack_require__(361) }; /***/ }), -/* 1311 */ +/* 1323 */ /***/ (function(module, exports) { /** @@ -175730,7 +177907,7 @@ module.exports = ArrayBufferToBase64; /***/ }), -/* 1312 */ +/* 1324 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175745,26 +177922,26 @@ module.exports = ArrayBufferToBase64; module.exports = { - Clone: __webpack_require__(64), - Extend: __webpack_require__(17), + Clone: __webpack_require__(65), + Extend: __webpack_require__(15), GetAdvancedValue: __webpack_require__(14), GetFastValue: __webpack_require__(2), - GetMinMaxValue: __webpack_require__(1313), - GetValue: __webpack_require__(6), - HasAll: __webpack_require__(1314), - HasAny: __webpack_require__(377), + GetMinMaxValue: __webpack_require__(1325), + GetValue: __webpack_require__(5), + HasAll: __webpack_require__(1326), + HasAny: __webpack_require__(380), HasValue: __webpack_require__(97), IsPlainObject: __webpack_require__(7), - Merge: __webpack_require__(85), - MergeRight: __webpack_require__(1315), - Pick: __webpack_require__(461), - SetValue: __webpack_require__(398) + Merge: __webpack_require__(105), + MergeRight: __webpack_require__(1327), + Pick: __webpack_require__(464), + SetValue: __webpack_require__(401) }; /***/ }), -/* 1313 */ +/* 1325 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175773,8 +177950,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); -var Clamp = __webpack_require__(22); +var GetValue = __webpack_require__(5); +var Clamp = __webpack_require__(24); /** * Retrieves and clamps a numerical value from an object. @@ -175803,7 +177980,7 @@ module.exports = GetMinMaxValue; /***/ }), -/* 1314 */ +/* 1326 */ /***/ (function(module, exports) { /** @@ -175840,7 +178017,7 @@ module.exports = HasAll; /***/ }), -/* 1315 */ +/* 1327 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175849,7 +178026,7 @@ module.exports = HasAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(64); +var Clone = __webpack_require__(65); /** * Creates a new Object using all values from obj1. @@ -175883,7 +178060,7 @@ module.exports = MergeRight; /***/ }), -/* 1316 */ +/* 1328 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175898,17 +178075,17 @@ module.exports = MergeRight; module.exports = { - Format: __webpack_require__(1317), - Pad: __webpack_require__(158), - Reverse: __webpack_require__(1318), - UppercaseFirst: __webpack_require__(347), - UUID: __webpack_require__(380) + Format: __webpack_require__(1329), + Pad: __webpack_require__(159), + Reverse: __webpack_require__(1330), + UppercaseFirst: __webpack_require__(178), + UUID: __webpack_require__(383) }; /***/ }), -/* 1317 */ +/* 1329 */ /***/ (function(module, exports) { /** @@ -175943,7 +178120,7 @@ module.exports = Format; /***/ }), -/* 1318 */ +/* 1330 */ /***/ (function(module, exports) { /** @@ -175972,7 +178149,7 @@ module.exports = Reverse; /***/ }), -/* 1319 */ +/* 1331 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175988,27 +178165,27 @@ module.exports = Reverse; module.exports = { - SoundManagerCreator: __webpack_require__(352), + SoundManagerCreator: __webpack_require__(355), - Events: __webpack_require__(65), + Events: __webpack_require__(66), - BaseSound: __webpack_require__(124), - BaseSoundManager: __webpack_require__(123), + BaseSound: __webpack_require__(125), + BaseSoundManager: __webpack_require__(124), - WebAudioSound: __webpack_require__(359), - WebAudioSoundManager: __webpack_require__(357), + WebAudioSound: __webpack_require__(362), + WebAudioSoundManager: __webpack_require__(360), - HTML5AudioSound: __webpack_require__(354), - HTML5AudioSoundManager: __webpack_require__(353), + HTML5AudioSound: __webpack_require__(357), + HTML5AudioSoundManager: __webpack_require__(356), - NoAudioSound: __webpack_require__(356), - NoAudioSoundManager: __webpack_require__(355) + NoAudioSound: __webpack_require__(359), + NoAudioSoundManager: __webpack_require__(358) }; /***/ }), -/* 1320 */ +/* 1332 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176018,10 +178195,10 @@ module.exports = { */ var Class = __webpack_require__(0); -var COLLIDES = __webpack_require__(446); -var GetVelocity = __webpack_require__(1341); -var TYPE = __webpack_require__(447); -var UpdateMotion = __webpack_require__(1342); +var COLLIDES = __webpack_require__(449); +var GetVelocity = __webpack_require__(1354); +var TYPE = __webpack_require__(450); +var UpdateMotion = __webpack_require__(1355); /** * @callback Phaser.Types.Physics.Impact.BodyUpdateCallback @@ -176609,7 +178786,7 @@ module.exports = Body; /***/ }), -/* 1321 */ +/* 1333 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176619,7 +178796,7 @@ module.exports = Body; */ var Class = __webpack_require__(0); -var DefaultDefs = __webpack_require__(1346); +var DefaultDefs = __webpack_require__(1359); /** * @classdesc @@ -176973,7 +179150,7 @@ module.exports = CollisionMap; /***/ }), -/* 1322 */ +/* 1334 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176983,9 +179160,9 @@ module.exports = CollisionMap; */ var Class = __webpack_require__(0); -var ImpactBody = __webpack_require__(1323); -var ImpactImage = __webpack_require__(1324); -var ImpactSprite = __webpack_require__(1325); +var ImpactBody = __webpack_require__(1335); +var ImpactImage = __webpack_require__(1336); +var ImpactSprite = __webpack_require__(1337); /** * @classdesc @@ -177130,7 +179307,7 @@ module.exports = Factory; /***/ }), -/* 1323 */ +/* 1335 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -177140,7 +179317,7 @@ module.exports = Factory; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(1239); +var Components = __webpack_require__(1243); /** * @classdesc @@ -177263,7 +179440,7 @@ module.exports = ImpactBody; /***/ }), -/* 1324 */ +/* 1336 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -177273,8 +179450,8 @@ module.exports = ImpactBody; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(1239); -var Image = __webpack_require__(95); +var Components = __webpack_require__(1243); +var Image = __webpack_require__(96); /** * @classdesc @@ -177421,7 +179598,7 @@ module.exports = ImpactImage; /***/ }), -/* 1325 */ +/* 1337 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -177431,8 +179608,8 @@ module.exports = ImpactImage; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(1239); -var Sprite = __webpack_require__(67); +var Components = __webpack_require__(1243); +var Sprite = __webpack_require__(68); /** * @classdesc @@ -177582,7 +179759,7 @@ module.exports = ImpactSprite; /***/ }), -/* 1326 */ +/* 1338 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -177591,18 +179768,18 @@ module.exports = ImpactSprite; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(1320); +var Body = __webpack_require__(1332); var Class = __webpack_require__(0); -var COLLIDES = __webpack_require__(446); -var CollisionMap = __webpack_require__(1321); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(1238); +var COLLIDES = __webpack_require__(449); +var CollisionMap = __webpack_require__(1333); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(1242); var GetFastValue = __webpack_require__(2); var HasValue = __webpack_require__(97); -var Set = __webpack_require__(105); -var Solver = __webpack_require__(1360); -var TILEMAP_FORMATS = __webpack_require__(31); -var TYPE = __webpack_require__(447); +var Set = __webpack_require__(106); +var Solver = __webpack_require__(1373); +var TILEMAP_FORMATS = __webpack_require__(30); +var TYPE = __webpack_require__(450); /** * @classdesc @@ -178567,7 +180744,7 @@ module.exports = World; /***/ }), -/* 1327 */ +/* 1339 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -178576,17 +180753,17 @@ module.exports = World; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(135); -var Body = __webpack_require__(60); +var Bodies = __webpack_require__(136); +var Body = __webpack_require__(61); var Class = __webpack_require__(0); -var Composites = __webpack_require__(1329); -var Constraint = __webpack_require__(228); -var MatterGameObject = __webpack_require__(1364); -var MatterImage = __webpack_require__(1330); -var MatterSprite = __webpack_require__(1331); -var MatterTileBody = __webpack_require__(1242); -var PointerConstraint = __webpack_require__(1390); -var Vertices = __webpack_require__(84); +var Composites = __webpack_require__(1341); +var Constraint = __webpack_require__(231); +var MatterGameObject = __webpack_require__(1377); +var MatterImage = __webpack_require__(1343); +var MatterSprite = __webpack_require__(1344); +var MatterTileBody = __webpack_require__(1246); +var PointerConstraint = __webpack_require__(1402); +var Vertices = __webpack_require__(86); /** * @classdesc @@ -178972,10 +181149,10 @@ var Factory = new Class({ * @method Phaser.Physics.Matter.Factory#joint * @since 3.0.0 * - * @param {MatterJS.Body} bodyA - [description] - * @param {MatterJS.Body} bodyB - [description] - * @param {number} length - [description] - * @param {number} [stiffness=1] - [description] + * @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to. + * @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to. + * @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. * @param {object} [options={}] - [description] * * @return {MatterJS.Constraint} A Matter JS Constraint. @@ -178993,7 +181170,7 @@ var Factory = new Class({ * * @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to. * @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to. - * @param {number} length - A Number that specifies the target resting length of the constraint. It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB` + * @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. * @param {object} [options={}] - [description] * @@ -179010,10 +181187,10 @@ var Factory = new Class({ * @method Phaser.Physics.Matter.Factory#constraint * @since 3.0.0 * - * @param {MatterJS.Body} bodyA - [description] - * @param {MatterJS.Body} bodyB - [description] - * @param {number} [length] - [description] - * @param {number} [stiffness=1] - [description] + * @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to. + * @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to. + * @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. * @param {object} [options={}] - [description] * * @return {MatterJS.Constraint} A Matter JS Constraint. @@ -179026,7 +181203,7 @@ var Factory = new Class({ options.bodyA = (bodyA.type === 'body') ? bodyA : bodyA.body; options.bodyB = (bodyB.type === 'body') ? bodyB : bodyB.body; - if (length) + if (!isNaN(length)) { options.length = length; } @@ -179046,9 +181223,9 @@ var Factory = new Class({ * @method Phaser.Physics.Matter.Factory#worldConstraint * @since 3.0.0 * - * @param {MatterJS.Body} bodyB - [description] - * @param {number} length - [description] - * @param {number} [stiffness=1] - [description] + * @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to. + * @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. * @param {object} [options={}] - [description] * * @return {MatterJS.Constraint} A Matter JS Constraint. @@ -179059,7 +181236,12 @@ var Factory = new Class({ if (options === undefined) { options = {}; } options.bodyB = (bodyB.type === 'body') ? bodyB : bodyB.body; - options.length = length; + + if (!isNaN(length)) + { + options.length = length; + } + options.stiffness = stiffness; var constraint = Constraint.create(options); @@ -179269,7 +181451,7 @@ module.exports = Factory; /***/ }), -/* 1328 */ +/* 1340 */ /***/ (function(module, exports) { /** @@ -179939,7 +182121,7 @@ function points_eq(a,b,precision){ /***/ }), -/* 1329 */ +/* 1341 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -179955,11 +182137,11 @@ var Composites = {}; module.exports = Composites; -var Composite = __webpack_require__(209); -var Constraint = __webpack_require__(228); +var Composite = __webpack_require__(211); +var Constraint = __webpack_require__(231); var Common = __webpack_require__(37); -var Body = __webpack_require__(60); -var Bodies = __webpack_require__(135); +var Body = __webpack_require__(61); +var Bodies = __webpack_require__(136); (function() { @@ -180272,7 +182454,184 @@ var Bodies = __webpack_require__(135); /***/ }), -/* 1330 */ +/* 1342 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Joachim Grill + * @copyright 2018 CodeAndWeb GmbH + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bodies = __webpack_require__(136); +var Body = __webpack_require__(61); +var Bounds = __webpack_require__(100); +var Common = __webpack_require__(37); +var GetFastValue = __webpack_require__(2); +var Vector = __webpack_require__(99); +var Vertices = __webpack_require__(86); + +/** + * Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file + * created and exported with PhysicsEditor (https://www.codeandweb.com/physicseditor). + * + * @namespace Phaser.Physics.Matter.PhysicsEditorParser + * @since 3.10.0 + */ +var PhysicsEditorParser = { + + /** + * Parses a body element exported by PhysicsEditor. + * + * @function Phaser.Physics.Matter.PhysicsEditorParser.parseBody + * @since 3.10.0 + * + * @param {number} x - x position. + * @param {number} y - y position. + * @param {number} w - width. + * @param {number} h - height. + * @param {object} config - body configuration and fixture (child body) definitions. + * + * @return {object} A matter body, consisting of several parts (child bodies) + */ + parseBody: function (x, y, w, h, config) + { + var fixtureConfigs = GetFastValue(config, 'fixtures', []); + var fixtures = []; + + for (var fc = 0; fc < fixtureConfigs.length; fc++) + { + var fixtureParts = this.parseFixture(fixtureConfigs[fc]); + + for (var i = 0; i < fixtureParts.length; i++) + { + fixtures.push(fixtureParts[i]); + } + } + + var matterConfig = Common.extend({}, false, config); + + delete matterConfig.fixtures; + delete matterConfig.type; + + var body = Body.create(matterConfig); + + Body.setParts(body, fixtures); + body.render.sprite.xOffset = body.position.x / w; + body.render.sprite.yOffset = body.position.y / h; + Body.setPosition(body, { x: x, y: y }); + + return body; + }, + + + /** + * Parses an element of the "fixtures" list exported by PhysicsEditor + * + * @function Phaser.Physics.Matter.PhysicsEditorParser.parseFixture + * @since 3.10.0 + * + * @param {object} fixtureConfig - the fixture object to parse + * + * @return {object[]} - A list of matter bodies + */ + parseFixture: function (fixtureConfig) + { + var matterConfig = Common.extend({}, false, fixtureConfig); + + delete matterConfig.circle; + delete matterConfig.vertices; + + var fixtures; + + if (fixtureConfig.circle) + { + var x = GetFastValue(fixtureConfig.circle, 'x'); + var y = GetFastValue(fixtureConfig.circle, 'y'); + var r = GetFastValue(fixtureConfig.circle, 'radius'); + fixtures = [ Bodies.circle(x, y, r, matterConfig) ]; + } + else if (fixtureConfig.vertices) + { + fixtures = this.parseVertices(fixtureConfig.vertices, matterConfig); + } + + return fixtures; + }, + + /** + * Parses the "vertices" lists exported by PhysicsEditor. + * + * @function Phaser.Physics.Matter.PhysicsEditorParser.parseVertices + * @since 3.10.0 + * + * @param {object} vertexSets - The vertex lists to parse. + * @param {object} options - Matter body options. + * + * @return {object[]} - A list of matter bodies. + */ + parseVertices: function (vertexSets, options) + { + var i, j, k, v, z; + var parts = []; + + options = options || {}; + + for (v = 0; v < vertexSets.length; v += 1) + { + parts.push(Body.create(Common.extend({ + position: Vertices.centre(vertexSets[v]), + vertices: vertexSets[v] + }, options))); + } + + // flag coincident part edges + var coincidentMaxDist = 5; + + for (i = 0; i < parts.length; i++) + { + var partA = parts[i]; + + for (j = i + 1; j < parts.length; j++) + { + var partB = parts[j]; + + if (Bounds.overlaps(partA.bounds, partB.bounds)) + { + var pav = partA.vertices, + pbv = partB.vertices; + + // iterate vertices of both parts + for (k = 0; k < partA.vertices.length; k++) + { + for (z = 0; z < partB.vertices.length; z++) + { + // find distances between the vertices + var da = Vector.magnitudeSquared(Vector.sub(pav[(k + 1) % pav.length], pbv[z])), + db = Vector.magnitudeSquared(Vector.sub(pav[k], pbv[(z + 1) % pbv.length])); + + // if both vertices are very close, consider the edge concident (internal) + if (da < coincidentMaxDist && db < coincidentMaxDist) + { + pav[k].isInternal = true; + pbv[z].isInternal = true; + } + } + } + + } + } + } + + return parts; + } +}; + +module.exports = PhysicsEditorParser; + + +/***/ }), +/* 1343 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180282,12 +182641,12 @@ var Bodies = __webpack_require__(135); */ var Class = __webpack_require__(0); -var Components = __webpack_require__(488); +var Components = __webpack_require__(490); var GameObject = __webpack_require__(13); var GetFastValue = __webpack_require__(2); -var Image = __webpack_require__(95); -var Pipeline = __webpack_require__(151); -var Vector2 = __webpack_require__(4); +var Image = __webpack_require__(96); +var Pipeline = __webpack_require__(152); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -180408,7 +182767,7 @@ module.exports = MatterImage; /***/ }), -/* 1331 */ +/* 1344 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180417,14 +182776,14 @@ module.exports = MatterImage; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AnimationComponent = __webpack_require__(479); +var AnimationComponent = __webpack_require__(481); var Class = __webpack_require__(0); -var Components = __webpack_require__(488); +var Components = __webpack_require__(490); var GameObject = __webpack_require__(13); var GetFastValue = __webpack_require__(2); -var Pipeline = __webpack_require__(151); -var Sprite = __webpack_require__(67); -var Vector2 = __webpack_require__(4); +var Pipeline = __webpack_require__(152); +var Sprite = __webpack_require__(68); +var Vector2 = __webpack_require__(3); /** * @classdesc @@ -180550,7 +182909,7 @@ module.exports = MatterSprite; /***/ }), -/* 1332 */ +/* 1345 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180563,7 +182922,7 @@ var Matter = {}; module.exports = Matter; -var Plugin = __webpack_require__(1246); +var Plugin = __webpack_require__(1250); var Common = __webpack_require__(37); (function() { @@ -180642,7 +183001,7 @@ var Common = __webpack_require__(37); /***/ }), -/* 1333 */ +/* 1346 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180655,8 +183014,8 @@ var Grid = {}; module.exports = Grid; -var Pair = __webpack_require__(489); -var Detector = __webpack_require__(1243); +var Pair = __webpack_require__(491); +var Detector = __webpack_require__(1247); var Common = __webpack_require__(37); (function() { @@ -180969,7 +183328,7 @@ var Common = __webpack_require__(37); /***/ }), -/* 1334 */ +/* 1347 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180982,7 +183341,7 @@ var Pairs = {}; module.exports = Pairs; -var Pair = __webpack_require__(489); +var Pair = __webpack_require__(491); var Common = __webpack_require__(37); (function() { @@ -181134,7 +183493,7 @@ var Common = __webpack_require__(37); /***/ }), -/* 1335 */ +/* 1348 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181147,7 +183506,7 @@ var Resolver = {}; module.exports = Resolver; -var Vertices = __webpack_require__(84); +var Vertices = __webpack_require__(86); var Vector = __webpack_require__(99); var Common = __webpack_require__(37); var Bounds = __webpack_require__(100); @@ -181490,7 +183849,7 @@ var Bounds = __webpack_require__(100); /***/ }), -/* 1336 */ +/* 1349 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181507,17 +183866,17 @@ var Engine = {}; module.exports = Engine; -var World = __webpack_require__(1247); -var Sleeping = __webpack_require__(448); -var Resolver = __webpack_require__(1335); -var Pairs = __webpack_require__(1334); -var Metrics = __webpack_require__(1392); -var Grid = __webpack_require__(1333); -var Events = __webpack_require__(227); -var Composite = __webpack_require__(209); -var Constraint = __webpack_require__(228); +var World = __webpack_require__(1251); +var Sleeping = __webpack_require__(451); +var Resolver = __webpack_require__(1348); +var Pairs = __webpack_require__(1347); +var Metrics = __webpack_require__(1404); +var Grid = __webpack_require__(1346); +var Events = __webpack_require__(230); +var Composite = __webpack_require__(211); +var Constraint = __webpack_require__(231); var Common = __webpack_require__(37); -var Body = __webpack_require__(60); +var Body = __webpack_require__(61); (function() { @@ -182003,7 +184362,7 @@ var Body = __webpack_require__(60); /***/ }), -/* 1337 */ +/* 1350 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182012,20 +184371,20 @@ var Body = __webpack_require__(60); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(135); -var Body = __webpack_require__(60); +var Bodies = __webpack_require__(136); +var Body = __webpack_require__(61); var Class = __webpack_require__(0); var Common = __webpack_require__(37); -var Composite = __webpack_require__(209); -var Engine = __webpack_require__(1336); -var EventEmitter = __webpack_require__(11); -var Events = __webpack_require__(1241); +var Composite = __webpack_require__(211); +var Engine = __webpack_require__(1349); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(1245); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); -var MatterBody = __webpack_require__(60); -var MatterEvents = __webpack_require__(227); -var MatterTileBody = __webpack_require__(1242); -var MatterWorld = __webpack_require__(1247); +var GetValue = __webpack_require__(5); +var MatterBody = __webpack_require__(61); +var MatterEvents = __webpack_require__(230); +var MatterTileBody = __webpack_require__(1246); +var MatterWorld = __webpack_require__(1251); var Vector = __webpack_require__(99); /** @@ -183148,7 +185507,7 @@ module.exports = World; /***/ }), -/* 1338 */ +/* 1351 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** @@ -183157,10 +185516,10 @@ module.exports = World; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -__webpack_require__(490); +__webpack_require__(492); -var CONST = __webpack_require__(26); -var Extend = __webpack_require__(17); +var CONST = __webpack_require__(31); +var Extend = __webpack_require__(15); /** * @namespace Phaser @@ -183168,38 +185527,38 @@ var Extend = __webpack_require__(17); var Phaser = { - Actions: __webpack_require__(229), - Animations: __webpack_require__(579), - BlendModes: __webpack_require__(52), - Cache: __webpack_require__(594), - Cameras: __webpack_require__(597), - Core: __webpack_require__(680), + Actions: __webpack_require__(232), + Animations: __webpack_require__(597), + BlendModes: __webpack_require__(53), + Cache: __webpack_require__(598), + Cameras: __webpack_require__(601), + Core: __webpack_require__(684), Class: __webpack_require__(0), - Create: __webpack_require__(737), - Curves: __webpack_require__(743), - Data: __webpack_require__(746), - Display: __webpack_require__(748), - DOM: __webpack_require__(777), - Events: __webpack_require__(778), - Game: __webpack_require__(780), - GameObjects: __webpack_require__(874), - Geom: __webpack_require__(401), - Input: __webpack_require__(1148), - Loader: __webpack_require__(1182), - Math: __webpack_require__(165), - Physics: __webpack_require__(1339), - Plugins: __webpack_require__(1248), - Renderer: __webpack_require__(1397), - Scale: __webpack_require__(1250), + Create: __webpack_require__(742), + Curves: __webpack_require__(748), + Data: __webpack_require__(751), + Display: __webpack_require__(753), + DOM: __webpack_require__(782), + Events: __webpack_require__(783), + Game: __webpack_require__(785), + GameObjects: __webpack_require__(878), + Geom: __webpack_require__(404), + Input: __webpack_require__(1152), + Loader: __webpack_require__(1186), + Math: __webpack_require__(166), + Physics: __webpack_require__(1352), + Plugins: __webpack_require__(1252), + Renderer: __webpack_require__(1409), + Scale: __webpack_require__(1254), ScaleModes: __webpack_require__(104), - Scene: __webpack_require__(346), - Scenes: __webpack_require__(1251), - Structs: __webpack_require__(1253), - Textures: __webpack_require__(1254), - Tilemaps: __webpack_require__(1256), - Time: __webpack_require__(1297), - Tweens: __webpack_require__(1299), - Utils: __webpack_require__(1309) + Scene: __webpack_require__(349), + Scenes: __webpack_require__(1255), + Structs: __webpack_require__(1257), + Textures: __webpack_require__(1258), + Tilemaps: __webpack_require__(1260), + Time: __webpack_require__(1301), + Tweens: __webpack_require__(1303), + Utils: __webpack_require__(1321) }; @@ -183207,7 +185566,7 @@ var Phaser = { if (true) { - Phaser.Sound = __webpack_require__(1319); + Phaser.Sound = __webpack_require__(1331); } if (false) @@ -183239,10 +185598,10 @@ global.Phaser = Phaser; * -- Dick Brandon */ -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(222))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(225))) /***/ }), -/* 1339 */ +/* 1352 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183261,15 +185620,15 @@ global.Phaser = Phaser; module.exports = { - Arcade: __webpack_require__(1207), - Impact: __webpack_require__(1340), - Matter: __webpack_require__(1363) + Arcade: __webpack_require__(1211), + Impact: __webpack_require__(1353), + Matter: __webpack_require__(1376) }; /***/ }), -/* 1340 */ +/* 1353 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183295,23 +185654,23 @@ module.exports = { */ module.exports = { - Body: __webpack_require__(1320), - Events: __webpack_require__(1238), - COLLIDES: __webpack_require__(446), - CollisionMap: __webpack_require__(1321), - Factory: __webpack_require__(1322), - Image: __webpack_require__(1324), - ImpactBody: __webpack_require__(1323), - ImpactPhysics: __webpack_require__(1359), - Sprite: __webpack_require__(1325), - TYPE: __webpack_require__(447), - World: __webpack_require__(1326) + Body: __webpack_require__(1332), + Events: __webpack_require__(1242), + COLLIDES: __webpack_require__(449), + CollisionMap: __webpack_require__(1333), + Factory: __webpack_require__(1334), + Image: __webpack_require__(1336), + ImpactBody: __webpack_require__(1335), + ImpactPhysics: __webpack_require__(1372), + Sprite: __webpack_require__(1337), + TYPE: __webpack_require__(450), + World: __webpack_require__(1338) }; /***/ }), -/* 1341 */ +/* 1354 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183320,7 +185679,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(22); +var Clamp = __webpack_require__(24); /** * [description] @@ -183367,7 +185726,7 @@ module.exports = GetVelocity; /***/ }), -/* 1342 */ +/* 1355 */ /***/ (function(module, exports) { /** @@ -183462,7 +185821,7 @@ module.exports = UpdateMotion; /***/ }), -/* 1343 */ +/* 1356 */ /***/ (function(module, exports) { /** @@ -183489,7 +185848,7 @@ module.exports = 'collide'; /***/ }), -/* 1344 */ +/* 1357 */ /***/ (function(module, exports) { /** @@ -183512,7 +185871,7 @@ module.exports = 'pause'; /***/ }), -/* 1345 */ +/* 1358 */ /***/ (function(module, exports) { /** @@ -183535,7 +185894,7 @@ module.exports = 'resume'; /***/ }), -/* 1346 */ +/* 1359 */ /***/ (function(module, exports) { /** @@ -183606,7 +185965,7 @@ module.exports = { /***/ }), -/* 1347 */ +/* 1360 */ /***/ (function(module, exports) { /** @@ -183683,7 +186042,7 @@ module.exports = Acceleration; /***/ }), -/* 1348 */ +/* 1361 */ /***/ (function(module, exports) { /** @@ -183757,7 +186116,7 @@ module.exports = BodyScale; /***/ }), -/* 1349 */ +/* 1362 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183766,7 +186125,7 @@ module.exports = BodyScale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TYPE = __webpack_require__(447); +var TYPE = __webpack_require__(450); /** * The Impact Body Type component. @@ -183841,7 +186200,7 @@ module.exports = BodyType; /***/ }), -/* 1350 */ +/* 1363 */ /***/ (function(module, exports) { /** @@ -183921,7 +186280,7 @@ module.exports = Bounce; /***/ }), -/* 1351 */ +/* 1364 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183930,7 +186289,7 @@ module.exports = Bounce; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TYPE = __webpack_require__(447); +var TYPE = __webpack_require__(450); /** * The Impact Check Against component. @@ -184043,7 +186402,7 @@ module.exports = CheckAgainst; /***/ }), -/* 1352 */ +/* 1365 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184052,7 +186411,7 @@ module.exports = CheckAgainst; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var COLLIDES = __webpack_require__(446); +var COLLIDES = __webpack_require__(449); /** * @callback CollideCallback @@ -184199,7 +186558,7 @@ module.exports = Collides; /***/ }), -/* 1353 */ +/* 1366 */ /***/ (function(module, exports) { /** @@ -184324,7 +186683,7 @@ module.exports = Debug; /***/ }), -/* 1354 */ +/* 1367 */ /***/ (function(module, exports) { /** @@ -184401,7 +186760,7 @@ module.exports = Friction; /***/ }), -/* 1355 */ +/* 1368 */ /***/ (function(module, exports) { /** @@ -184463,7 +186822,7 @@ module.exports = Gravity; /***/ }), -/* 1356 */ +/* 1369 */ /***/ (function(module, exports) { /** @@ -184513,7 +186872,7 @@ module.exports = Offset; /***/ }), -/* 1357 */ +/* 1370 */ /***/ (function(module, exports) { /** @@ -184589,7 +186948,7 @@ module.exports = SetGameObject; /***/ }), -/* 1358 */ +/* 1371 */ /***/ (function(module, exports) { /** @@ -184689,7 +187048,7 @@ module.exports = Velocity; /***/ }), -/* 1359 */ +/* 1372 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184699,12 +187058,12 @@ module.exports = Velocity; */ var Class = __webpack_require__(0); -var Factory = __webpack_require__(1322); +var Factory = __webpack_require__(1334); var GetFastValue = __webpack_require__(2); -var Merge = __webpack_require__(85); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var World = __webpack_require__(1326); +var Merge = __webpack_require__(105); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var World = __webpack_require__(1338); /** * @classdesc @@ -184906,7 +187265,7 @@ module.exports = ImpactPhysics; /***/ }), -/* 1360 */ +/* 1373 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184915,10 +187274,10 @@ module.exports = ImpactPhysics; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var COLLIDES = __webpack_require__(446); -var Events = __webpack_require__(1238); -var SeparateX = __webpack_require__(1361); -var SeparateY = __webpack_require__(1362); +var COLLIDES = __webpack_require__(449); +var Events = __webpack_require__(1242); +var SeparateX = __webpack_require__(1374); +var SeparateY = __webpack_require__(1375); /** * Impact Physics Solver @@ -184982,7 +187341,7 @@ module.exports = Solver; /***/ }), -/* 1361 */ +/* 1374 */ /***/ (function(module, exports) { /** @@ -185038,7 +187397,7 @@ module.exports = SeparateX; /***/ }), -/* 1362 */ +/* 1375 */ /***/ (function(module, exports) { /** @@ -185123,7 +187482,7 @@ module.exports = SeparateY; /***/ }), -/* 1363 */ +/* 1376 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185138,14 +187497,15 @@ module.exports = SeparateY; module.exports = { - Factory: __webpack_require__(1327), - Image: __webpack_require__(1330), - Matter: __webpack_require__(1245), - MatterPhysics: __webpack_require__(1394), - PolyDecomp: __webpack_require__(1328), - Sprite: __webpack_require__(1331), - TileBody: __webpack_require__(1242), - World: __webpack_require__(1337) + Factory: __webpack_require__(1339), + Image: __webpack_require__(1343), + Matter: __webpack_require__(1249), + MatterPhysics: __webpack_require__(1406), + PolyDecomp: __webpack_require__(1340), + Sprite: __webpack_require__(1344), + TileBody: __webpack_require__(1246), + PhysicsEditorParser: __webpack_require__(1342), + World: __webpack_require__(1350) }; @@ -185227,7 +187587,7 @@ module.exports = { /***/ }), -/* 1364 */ +/* 1377 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185236,9 +187596,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Components = __webpack_require__(488); +var Components = __webpack_require__(490); var GetFastValue = __webpack_require__(2); -var Vector2 = __webpack_require__(4); +var Vector2 = __webpack_require__(3); /** * Internal function to check if the object has a getter or setter. @@ -185345,7 +187705,7 @@ module.exports = MatterGameObject; /***/ }), -/* 1365 */ +/* 1378 */ /***/ (function(module, exports) { /** @@ -185385,7 +187745,7 @@ module.exports = Bounce; /***/ }), -/* 1366 */ +/* 1379 */ /***/ (function(module, exports) { /** @@ -185473,7 +187833,7 @@ module.exports = Collision; /***/ }), -/* 1367 */ +/* 1380 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185482,7 +187842,7 @@ module.exports = Collision; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(60); +var Body = __webpack_require__(61); /** * A component to apply force to Matter.js bodies. @@ -185621,7 +187981,7 @@ module.exports = Force; /***/ }), -/* 1368 */ +/* 1381 */ /***/ (function(module, exports) { /** @@ -185707,7 +188067,7 @@ module.exports = Friction; /***/ }), -/* 1369 */ +/* 1382 */ /***/ (function(module, exports) { /** @@ -185747,7 +188107,7 @@ module.exports = Gravity; /***/ }), -/* 1370 */ +/* 1383 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185756,8 +188116,8 @@ module.exports = Gravity; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(60); -var Vector2 = __webpack_require__(4); +var Body = __webpack_require__(61); +var Vector2 = __webpack_require__(3); /** * Allows accessing the mass, density, and center of mass of a Matter-enabled Game Object. Should be used as a mixin and not directly. @@ -185825,7 +188185,7 @@ module.exports = Mass; /***/ }), -/* 1371 */ +/* 1384 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185834,7 +188194,7 @@ module.exports = Mass; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(60); +var Body = __webpack_require__(61); /** * [description] @@ -185880,7 +188240,7 @@ module.exports = Static; /***/ }), -/* 1372 */ +/* 1385 */ /***/ (function(module, exports) { /** @@ -185933,7 +188293,7 @@ module.exports = Sensor; /***/ }), -/* 1373 */ +/* 1386 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185942,11 +188302,11 @@ module.exports = Sensor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(135); -var Body = __webpack_require__(60); +var Bodies = __webpack_require__(136); +var Body = __webpack_require__(61); var GetFastValue = __webpack_require__(2); -var PhysicsEditorParser = __webpack_require__(1374); -var Vertices = __webpack_require__(84); +var PhysicsEditorParser = __webpack_require__(1342); +var Vertices = __webpack_require__(86); /** * [description] @@ -186183,184 +188543,7 @@ module.exports = SetBody; /***/ }), -/* 1374 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Joachim Grill - * @copyright 2018 CodeAndWeb GmbH - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Bodies = __webpack_require__(135); -var Body = __webpack_require__(60); -var Bounds = __webpack_require__(100); -var Common = __webpack_require__(37); -var GetFastValue = __webpack_require__(2); -var Vector = __webpack_require__(99); -var Vertices = __webpack_require__(84); - -/** - * Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file - * created and exported with PhysicsEditor (https://www.codeandweb.com/physicseditor). - * - * @namespace Phaser.Physics.Matter.PhysicsEditorParser - * @since 3.10.0 - */ -var PhysicsEditorParser = { - - /** - * Parses a body element exported by PhysicsEditor. - * - * @function Phaser.Physics.Matter.PhysicsEditorParser.parseBody - * @since 3.10.0 - * - * @param {number} x - x position. - * @param {number} y - y position. - * @param {number} w - width. - * @param {number} h - height. - * @param {object} config - body configuration and fixture (child body) definitions. - * - * @return {object} A matter body, consisting of several parts (child bodies) - */ - parseBody: function (x, y, w, h, config) - { - var fixtureConfigs = GetFastValue(config, 'fixtures', []); - var fixtures = []; - - for (var fc = 0; fc < fixtureConfigs.length; fc++) - { - var fixtureParts = this.parseFixture(fixtureConfigs[fc]); - - for (var i = 0; i < fixtureParts.length; i++) - { - fixtures.push(fixtureParts[i]); - } - } - - var matterConfig = Common.extend({}, false, config); - - delete matterConfig.fixtures; - delete matterConfig.type; - - var body = Body.create(matterConfig); - - Body.setParts(body, fixtures); - body.render.sprite.xOffset = body.position.x / w; - body.render.sprite.yOffset = body.position.y / h; - Body.setPosition(body, { x: x, y: y }); - - return body; - }, - - - /** - * Parses an element of the "fixtures" list exported by PhysicsEditor - * - * @function Phaser.Physics.Matter.PhysicsEditorParser.parseFixture - * @since 3.10.0 - * - * @param {object} fixtureConfig - the fixture object to parse - * - * @return {object[]} - A list of matter bodies - */ - parseFixture: function (fixtureConfig) - { - var matterConfig = Common.extend({}, false, fixtureConfig); - - delete matterConfig.circle; - delete matterConfig.vertices; - - var fixtures; - - if (fixtureConfig.circle) - { - var x = GetFastValue(fixtureConfig.circle, 'x'); - var y = GetFastValue(fixtureConfig.circle, 'y'); - var r = GetFastValue(fixtureConfig.circle, 'radius'); - fixtures = [ Bodies.circle(x, y, r, matterConfig) ]; - } - else if (fixtureConfig.vertices) - { - fixtures = this.parseVertices(fixtureConfig.vertices, matterConfig); - } - - return fixtures; - }, - - /** - * Parses the "vertices" lists exported by PhysicsEditor. - * - * @function Phaser.Physics.Matter.PhysicsEditorParser.parseVertices - * @since 3.10.0 - * - * @param {object} vertexSets - The vertex lists to parse. - * @param {object} options - Matter body options. - * - * @return {object[]} - A list of matter bodies. - */ - parseVertices: function (vertexSets, options) - { - var i, j, k, v, z; - var parts = []; - - options = options || {}; - - for (v = 0; v < vertexSets.length; v += 1) - { - parts.push(Body.create(Common.extend({ - position: Vertices.centre(vertexSets[v]), - vertices: vertexSets[v] - }, options))); - } - - // flag coincident part edges - var coincidentMaxDist = 5; - - for (i = 0; i < parts.length; i++) - { - var partA = parts[i]; - - for (j = i + 1; j < parts.length; j++) - { - var partB = parts[j]; - - if (Bounds.overlaps(partA.bounds, partB.bounds)) - { - var pav = partA.vertices, - pbv = partB.vertices; - - // iterate vertices of both parts - for (k = 0; k < partA.vertices.length; k++) - { - for (z = 0; z < partB.vertices.length; z++) - { - // find distances between the vertices - var da = Vector.magnitudeSquared(Vector.sub(pav[(k + 1) % pav.length], pbv[z])), - db = Vector.magnitudeSquared(Vector.sub(pav[k], pbv[(z + 1) % pbv.length])); - - // if both vertices are very close, consider the edge concident (internal) - if (da < coincidentMaxDist && db < coincidentMaxDist) - { - pav[k].isInternal = true; - pbv[z].isInternal = true; - } - } - } - - } - } - } - - return parts; - } -}; - -module.exports = PhysicsEditorParser; - - -/***/ }), -/* 1375 */ +/* 1387 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186369,8 +188552,8 @@ module.exports = PhysicsEditorParser; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Events = __webpack_require__(1241); -var MatterEvents = __webpack_require__(227); +var Events = __webpack_require__(1245); +var MatterEvents = __webpack_require__(230); /** * [description] @@ -186482,7 +188665,7 @@ module.exports = Sleep; /***/ }), -/* 1376 */ +/* 1388 */ /***/ (function(module, exports) { /** @@ -186515,7 +188698,7 @@ module.exports = 'afterupdate'; /***/ }), -/* 1377 */ +/* 1389 */ /***/ (function(module, exports) { /** @@ -186548,7 +188731,7 @@ module.exports = 'beforeupdate'; /***/ }), -/* 1378 */ +/* 1390 */ /***/ (function(module, exports) { /** @@ -186585,7 +188768,7 @@ module.exports = 'collisionactive'; /***/ }), -/* 1379 */ +/* 1391 */ /***/ (function(module, exports) { /** @@ -186622,7 +188805,7 @@ module.exports = 'collisionend'; /***/ }), -/* 1380 */ +/* 1392 */ /***/ (function(module, exports) { /** @@ -186659,7 +188842,7 @@ module.exports = 'collisionstart'; /***/ }), -/* 1381 */ +/* 1393 */ /***/ (function(module, exports) { /** @@ -186686,7 +188869,7 @@ module.exports = 'dragend'; /***/ }), -/* 1382 */ +/* 1394 */ /***/ (function(module, exports) { /** @@ -186713,7 +188896,7 @@ module.exports = 'drag'; /***/ }), -/* 1383 */ +/* 1395 */ /***/ (function(module, exports) { /** @@ -186741,7 +188924,7 @@ module.exports = 'dragstart'; /***/ }), -/* 1384 */ +/* 1396 */ /***/ (function(module, exports) { /** @@ -186764,7 +188947,7 @@ module.exports = 'pause'; /***/ }), -/* 1385 */ +/* 1397 */ /***/ (function(module, exports) { /** @@ -186787,7 +188970,7 @@ module.exports = 'resume'; /***/ }), -/* 1386 */ +/* 1398 */ /***/ (function(module, exports) { /** @@ -186820,7 +189003,7 @@ module.exports = 'sleepend'; /***/ }), -/* 1387 */ +/* 1399 */ /***/ (function(module, exports) { /** @@ -186853,7 +189036,7 @@ module.exports = 'sleepstart'; /***/ }), -/* 1388 */ +/* 1400 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186862,10 +189045,10 @@ module.exports = 'sleepstart'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(60); -var MATH_CONST = __webpack_require__(23); -var WrapAngle = __webpack_require__(223); -var WrapAngleDegrees = __webpack_require__(224); +var Body = __webpack_require__(61); +var MATH_CONST = __webpack_require__(22); +var WrapAngle = __webpack_require__(226); +var WrapAngleDegrees = __webpack_require__(227); // global bitmask flag for GameObject.renderMask (used by Scale) var _FLAG = 4; // 0100 @@ -187161,7 +189344,7 @@ module.exports = Transform; /***/ }), -/* 1389 */ +/* 1401 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187170,7 +189353,7 @@ module.exports = Transform; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(60); +var Body = __webpack_require__(61); /** * [description] @@ -187261,7 +189444,7 @@ module.exports = Velocity; /***/ }), -/* 1390 */ +/* 1402 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187272,15 +189455,15 @@ module.exports = Velocity; var Bounds = __webpack_require__(100); var Class = __webpack_require__(0); -var Composite = __webpack_require__(209); -var Constraint = __webpack_require__(228); -var Detector = __webpack_require__(1243); -var Events = __webpack_require__(1241); -var InputEvents = __webpack_require__(53); -var Merge = __webpack_require__(85); -var Sleeping = __webpack_require__(448); -var Vector2 = __webpack_require__(4); -var Vertices = __webpack_require__(84); +var Composite = __webpack_require__(211); +var Constraint = __webpack_require__(231); +var Detector = __webpack_require__(1247); +var Events = __webpack_require__(1245); +var InputEvents = __webpack_require__(54); +var Merge = __webpack_require__(105); +var Sleeping = __webpack_require__(451); +var Vector2 = __webpack_require__(3); +var Vertices = __webpack_require__(86); /** * @classdesc @@ -187624,7 +189807,7 @@ module.exports = PointerConstraint; /***/ }), -/* 1391 */ +/* 1403 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187640,10 +189823,10 @@ var Query = {}; module.exports = Query; var Vector = __webpack_require__(99); -var SAT = __webpack_require__(1244); +var SAT = __webpack_require__(1248); var Bounds = __webpack_require__(100); -var Bodies = __webpack_require__(135); -var Vertices = __webpack_require__(84); +var Bodies = __webpack_require__(136); +var Vertices = __webpack_require__(86); (function() { @@ -187760,7 +189943,7 @@ var Vertices = __webpack_require__(84); /***/ }), -/* 1392 */ +/* 1404 */ /***/ (function(module, exports, __webpack_require__) { // @if DEBUG @@ -187773,7 +189956,7 @@ var Metrics = {}; module.exports = Metrics; -var Composite = __webpack_require__(209); +var Composite = __webpack_require__(211); var Common = __webpack_require__(37); (function() { @@ -187859,7 +190042,7 @@ var Common = __webpack_require__(37); /***/ }), -/* 1393 */ +/* 1405 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188090,7 +190273,7 @@ var Common = __webpack_require__(37); })(); /***/ }), -/* 1394 */ +/* 1406 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188099,21 +190282,21 @@ var Common = __webpack_require__(37); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(60); -var Bodies = __webpack_require__(135); +var Body = __webpack_require__(61); +var Bodies = __webpack_require__(136); var Class = __webpack_require__(0); -var Factory = __webpack_require__(1327); +var Factory = __webpack_require__(1339); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); -var MatterAttractors = __webpack_require__(1395); -var MatterLib = __webpack_require__(1332); -var MatterWrap = __webpack_require__(1396); -var Merge = __webpack_require__(85); -var Plugin = __webpack_require__(1246); -var PluginCache = __webpack_require__(18); -var SceneEvents = __webpack_require__(19); -var World = __webpack_require__(1337); -var Vertices = __webpack_require__(84); +var GetValue = __webpack_require__(5); +var MatterAttractors = __webpack_require__(1407); +var MatterLib = __webpack_require__(1345); +var MatterWrap = __webpack_require__(1408); +var Merge = __webpack_require__(105); +var Plugin = __webpack_require__(1250); +var PluginCache = __webpack_require__(19); +var SceneEvents = __webpack_require__(20); +var World = __webpack_require__(1350); +var Vertices = __webpack_require__(86); /** * @classdesc @@ -188458,10 +190641,10 @@ module.exports = MatterPhysics; /***/ }), -/* 1395 */ +/* 1407 */ /***/ (function(module, exports, __webpack_require__) { -var Matter = __webpack_require__(1245); +var Matter = __webpack_require__(1249); /** * An attractors plugin for matter.js. @@ -188600,10 +190783,10 @@ module.exports = MatterAttractors; /***/ }), -/* 1396 */ +/* 1408 */ /***/ (function(module, exports, __webpack_require__) { -var Matter = __webpack_require__(1245); +var Matter = __webpack_require__(1249); /** * A coordinate wrapping plugin for matter.js. @@ -188782,7 +190965,7 @@ module.exports = MatterWrap; */ /***/ }), -/* 1397 */ +/* 1409 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188801,15 +190984,15 @@ module.exports = MatterWrap; module.exports = { - Canvas: __webpack_require__(1398), - Snapshot: __webpack_require__(1399), - WebGL: __webpack_require__(1400) + Canvas: __webpack_require__(1410), + Snapshot: __webpack_require__(1411), + WebGL: __webpack_require__(1412) }; /***/ }), -/* 1398 */ +/* 1410 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188824,15 +191007,15 @@ module.exports = { module.exports = { - CanvasRenderer: __webpack_require__(480), - GetBlendModes: __webpack_require__(482), - SetTransform: __webpack_require__(25) + CanvasRenderer: __webpack_require__(482), + GetBlendModes: __webpack_require__(484), + SetTransform: __webpack_require__(26) }; /***/ }), -/* 1399 */ +/* 1411 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188847,14 +191030,14 @@ module.exports = { module.exports = { - Canvas: __webpack_require__(481), - WebGL: __webpack_require__(484) + Canvas: __webpack_require__(483), + WebGL: __webpack_require__(486) }; /***/ }), -/* 1400 */ +/* 1412 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188870,9 +191053,9 @@ module.exports = { module.exports = { Utils: __webpack_require__(9), - WebGLPipeline: __webpack_require__(225), - WebGLRenderer: __webpack_require__(483), - Pipelines: __webpack_require__(1401), + WebGLPipeline: __webpack_require__(228), + WebGLRenderer: __webpack_require__(485), + Pipelines: __webpack_require__(1413), // Constants BYTE: 0, @@ -188885,7 +191068,7 @@ module.exports = { /***/ }), -/* 1401 */ +/* 1413 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188900,10 +191083,10 @@ module.exports = { module.exports = { - BitmapMaskPipeline: __webpack_require__(485), - ForwardDiffuseLightPipeline: __webpack_require__(486), - TextureTintPipeline: __webpack_require__(226), - ModelViewProjection: __webpack_require__(487) + BitmapMaskPipeline: __webpack_require__(487), + ForwardDiffuseLightPipeline: __webpack_require__(488), + TextureTintPipeline: __webpack_require__(229), + ModelViewProjection: __webpack_require__(489) }; diff --git a/dist/phaser.min.js b/dist/phaser.min.js index 00fa33a0d..c9ddb1352 100644 --- a/dist/phaser.min.js +++ b/dist/phaser.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(window,function(){return 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=1338)}([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||!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 a in e)if(e.hasOwnProperty(a)){var h=i(e,a,s);if(!1!==h){if(n((r||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0&&(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},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}});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},function(t,e,i){var n=i(0),s=i(18),r=i(19),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.systems.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.systems.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},s.register("GameObjectFactory",o,"add"),t.exports=o},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n=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=l},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,s="~";function r(){}function o(t,e,i,n,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new function(t,e,i){this.fn=t,this.context=e,this.once=i||!1}(i,n||t,r),a=s?s+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function h(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),h.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},h.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,o=new Array(r);n=400&&t.status<=599&&(n=!1),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(){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.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){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)},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,i){var n=i(2);t.exports=function(t,e,i,s,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===s&&(s=o.height);var a=n(r,"isNotEmpty",!1),h=n(r,"isColliding",!1),l=n(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(s+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){t.exports={BLUR:i(580),BOOT:i(581),DESTROY:i(582),FOCUS:i(583),HIDDEN:i(584),PAUSE:i(585),POST_RENDER:i(586),POST_STEP:i(587),PRE_RENDER:i(588),PRE_STEP:i(589),READY:i(590),RESUME:i(591),STEP:i(592),VISIBLE:i(593)}},function(t,e,i){var n=i(52),s=i(14),r=i(104);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 o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"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 h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),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){var n=i(0),s=i(12),r=i(13),o=i(54),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e,i){var n=i(0),s=i(4),r=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}},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)}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},scaleY:{get:function(){return Math.sqrt(this.b*this.b+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],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[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],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,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 o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(t.translateX=e[4],t.translateY=e[5],i||n){var a=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}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=o/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,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=r*c*e+-o*c*t+(-u*r+l*o)*c,i},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},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.decomposedMatrix=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(160),r=i(270),o=i(161),a=i(271),h=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=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=i(23);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.fillColor,r=n||e.fillAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},function(t,e,i){(function(e){var i={};t.exports=i,function(){i._nextId=0,i._seed=0,i._nowStartTime=+new Date,i.extend=function(t,e){var n,s;"boolean"==typeof e?(n=2,s=e):(n=1,s=!0);for(var r=n;r0;e--){var n=Math.floor(i.random()*(e+1)),s=t[e];t[e]=t[n],t[n]=s}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===toString.call(t)},i.clamp=function(t,e,i){return ti?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return e=void 0!==e?e:0,i=void 0!==i?i:1,e+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},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){t.exports={DESTROY:i(602),FADE_IN_COMPLETE:i(603),FADE_IN_START:i(604),FADE_OUT_COMPLETE:i(605),FADE_OUT_START:i(606),FLASH_COMPLETE:i(607),FLASH_START:i(608),PAN_COMPLETE:i(609),PAN_START:i(610),POST_RENDER:i(611),PRE_RENDER:i(612),SHAKE_COMPLETE:i(613),SHAKE_START:i(614),ZOOM_COMPLETE:i(615),ZOOM_START:i(616)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e,i){var n=i(137),s=i(21);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;dthis.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=h},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},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,i){var n=i(0),s=i(16),r=i(20),o=i(8),a=i(2),h=i(6),l=i(7),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s0&&r.rotateAbout(o.position,i,t.position,o.position)}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,r.add(t.position,e))},n.rotate=function(t,e,i){if(i){var s=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*s-a*r),y:i.y+(o*r+a*s)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*n+t.force.x/t.mass*o,t.velocity.y=c*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(f.vertices,t.angularVelocity,t.position),l.rotate(f.axes,t.angularVelocity),d>0&&r.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),h.update(f.bounds,f.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i80*i){n=h=t[0],a=l=t[1];for(var T=i;Th&&(h=u),f>l&&(l=f);g=0!==(g=Math.max(h-n,l-a))?1/g:0}return o(y,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===_(t,e,i,n)>0)for(r=e;r=e;r-=n)o=b(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(S(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(S(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),S(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(m(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&m(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(m(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.prevZ,v=t.nextZ;p&&p.z>=c&&v&&v.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!y(s,r)&&x(s,n,n.next,r)&&T(s,r)&&T(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),S(n),S(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=w(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&T(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=w(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&T(t,e)&&T(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(y(t,e)&&y(i,n)||y(t,n)&&y(i,e))||m(t,e,i)>0!=m(t,e,n)>0&&m(i,n,t)>0!=m(i,n,e)>0}function T(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function w(t,e){var i=new A(t.i,t.x,t.y),n=new A(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function b(t,e,i,n){var s=new A(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){t.exports={COMPLETE:i(851),DECODED:i(852),DECODED_ALL:i(853),DESTROY:i(854),DETUNE:i(855),GLOBAL_DETUNE:i(856),GLOBAL_MUTE:i(857),GLOBAL_RATE:i(858),GLOBAL_VOLUME:i(859),LOOP:i(860),LOOPED:i(861),MUTE:i(862),PAUSE_ALL:i(863),PAUSE:i(864),PLAY:i(865),RATE:i(866),RESUME_ALL:i(867),RESUME:i(868),SEEK:i(869),STOP_ALL:i(870),STOP:i(871),UNLOCKED:i(872),VOLUME:i(873)}},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||e>s||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(926),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,o){r.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s.Animation(this),this.setTexture(n,o),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e,i){return this.anims.play(t,e,i),this},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=a},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(0),s=i(16),r=i(20),o=i(8),a=i(2),h=i(7),l=new n({Extends:r,initialize:function t(e,i,n,s,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),n=a(c,"url"),l=a(c,"normalMap"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(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:o};if(r.call(this,e,d),l){var f=new t(e,this.key,l,s,o);f.type="normalMap",this.setLink(f),e.addFile(f)}},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")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;nthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight,this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e,i){var n=i(0),s=i(46),r=i(241),o=i(242),a=i(145),h=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=h},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;si&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){t.exports={ADD:i(829),COMPLETE:i(830),FILE_COMPLETE:i(831),FILE_KEY_COMPLETE:i(832),FILE_LOAD_ERROR:i(833),FILE_LOAD:i(834),FILE_PROGRESS:i(835),POST_PROCESS:i(836),PROGRESS:i(837),START:i(838)}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},function(t,e,i){var n=i(3);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(u-h)*(r-l)-(c-l)*(s-h),f=(o-s)*(r-l)-(a-r)*(s-h),p=(c-l)*(o-s)-(u-h)*(a-r);if(0===p)return!1;var g=d/p,v=f/p;return g>=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(t,e,i){var n={};t.exports=n;var s=i(99),r=i(37);n.create=function(t,e){for(var i=[],n=0;n0)return!1}return!0},n.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||n.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},n.hull=function(t){var e,i,n=[],r=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),r.pop(),n.concat(r)}},function(t,e,i){var n=i(64);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i}},function(t,e,i){var n=i(22);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e,i){t.exports={ENTER_FULLSCREEN:i(655),FULLSCREEN_FAILED:i(656),FULLSCREEN_UNSUPPORTED:i(657),LEAVE_FULLSCREEN:i(658),ORIENTATION_CHANGE:i(659),RESIZE:i(660)}},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,i){var n=i(0),s=i(22),r=i(17),o=new n({initialize:function(t,e,i,n,s,r,o){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,o,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 o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.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,o,a){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)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),m=r=s(r,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(n=s(n,0,u-e)),w=i+(r=s(r,0,c-i));if(!(x.rT||x.y>w)){var b=Math.max(x.x,e),S=Math.max(x.y,i),A=Math.min(x.r,T)-b,_=Math.min(x.b,w)-S;v=A,m=_,p=o?h+(u-(b-x.x)-A):h+(b-x.x),g=a?l+(c-(S-x.y)-_):l+(S-x.y),e=b,i=S,n=A,r=_}else p=0,g=0,v=0,m=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var E=this.source.width,C=this.source.height;return t.u0=Math.max(0,p/E),t.v0=Math.max(0,g/C),t.u1=Math.min(1,(p+v)/E),t.v1=Math.min(1,(g+m)/C),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=m,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},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,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,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 o(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.texture=null,this.source=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=o},function(t,e,i){var n=i(0),s=i(93),r=i(368),o=i(369),a=i(152),h=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.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 o(this,t,e,i)},getRandomPoint:function(t){return a(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.width=0,this.height=0,this},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},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=h},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var n=i(229),s=i(0),r=i(110),o=i(2),a=i(6),h=i(7),l=i(362),u=i(105),c=i(67),d=new s({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?h(e[0])&&(i=e,e=null):h(e)&&(i=e,e=null),this.scene=t,this.children=new u(e),this.isParent=!0,this.classType=o(i,"classType",c),this.name=o(i,"name",""),this.active=o(i,"active",!0),this.maxSize=o(i,"maxSize",-1),this.defaultKey=o(i,"defaultKey",null),this.defaultFrame=o(i,"defaultFrame",null),this.runChildUpdate=o(i,"runChildUpdate",!1),this.createCallback=o(i,"createCallback",null),this.removeCallback=o(i,"removeCallback",null),this.createMultipleCallback=o(i,"createMultipleCallback",null),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;it.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return t0;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){var n=i(0),s=i(12),r=i(35),o=i(11),a=i(48),h=i(10),l=i(32),u=i(159),c=i(4),d=new n({Extends:o,Mixins:[s.Alpha,s.Visible],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),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;gC&&w_&&bs&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras;var i=this.scaleManager.resolution;return this.resolution=i,this._cx=this._x*i,this._cy=this._y*i,this._cw=this._width*i,this._ch=this._height*i,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=d},function(t,e){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;i0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){t.exports={ADD:i(727),ERROR:i(728),LOAD:i(729),READY:i(730),REMOVE:i(731)}},function(t,e){t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement)return t;return i||(i=document.body),i.appendChild(t),t}},function(t,e,i){var n=i(78);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 o=e.length-1;o>=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e,i){var n=i(0),s=i(64),r=i(11),o=i(65),a=i(28),h=i(1),l=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on(a.FOCUS,function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once(o.COMPLETE,n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(o.STOP_ALL,this)},unlock:h,onBlur:h,onFocus:h,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=l},function(t,e,i){var n=i(0),s=i(11),r=i(65),o=i(17),a=i(1),h=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},function(t,e,i){var n=i(178),s=i(0),r=i(1),o=i(127),a=new s({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?n.Add(this.list,t):n.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?n.AddAt(this.list,t,e):n.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o.inplace(this.list,e),this):this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return n.GetFirst(this.list,t,e,i,s)},getAll:function(t,e,i,s){return n.GetAll(this.list,t,e,i,s)},count:function(t,e){return n.CountAllMatching(this.list,t,e)},swap:function(t,e){n.Swap(this.list,t,e)},moveTo:function(t,e){return n.MoveTo(this.list,t,e)},remove:function(t,e){return e?n.Remove(this.list,t):n.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?n.RemoveAt(this.list,t):n.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?n.RemoveBetween(this.list,t,e):n.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return n.BringToTop(this.list,t)},sendToBack:function(t){return n.SendToBack(this.list,t)},moveUp:function(t){return n.MoveUp(this.list,t),t},moveDown:function(t){return n.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e){return n.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?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}}});t.exports=a},function(t,e,i){var n=i(179),s=i(360);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;il&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a0&&o.length0&&a.lengthe.right||t.y>e.bottom)}},function(t,e,i){var n=i(6),s={},r={register:function(t,e,i,n,r){s[t]={plugin:e,mapping:i,settingsKey:n,configKey:r}},getPlugin:function(t){return s[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in s){var a=s[o].plugin,h=s[o].mapping,l=s[o].settingsKey,u=s[o].configKey;n(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){s.hasOwnProperty(t)&&delete s[t]}};t.exports=r},function(t,e,i){t.exports={ANY_KEY_DOWN:i(1164),ANY_KEY_UP:i(1165),COMBO_MATCH:i(1166),DOWN:i(1167),KEY_DOWN:i(1168),KEY_UP:i(1169),UP:i(1170)}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),{responseType:t,async:e,user:i,password:n,timeout:s,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e,i){var n=i(0),s=i(207),r=i(67),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e,i){var n={};t.exports=n;var s=i(84),r=i(37),o=i(60),a=i(100),h=i(99),l=i(1328);n.rectangle=function(t,e,i,n,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(a.chamfer){var l=a.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},n.trapezoid=function(t,e,i,n,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-n+" L "+c+" "+-n+" L "+d+" 0":"L 0 0 L "+c+" "+-n+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return o.create(r.extend({},f,h))},n.circle=function(t,e,i,s,o){s=s||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),n.polygon(t,e,h,i,r.extend({},a,s))},n.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return n.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&s.area(A)1?(f=o.create(r.extend({parts:p.slice(0)},n)),o.setPosition(f,{x:t,y:e}),f):p[0]}},function(t,e,i){t.exports={CalculateFacesAt:i(210),CalculateFacesWithin:i(51),Copy:i(1257),CreateFromTiles:i(1258),CullTiles:i(1259),Fill:i(1260),FilterTiles:i(1261),FindByIndex:i(1262),FindTile:i(1263),ForEachTile:i(1264),GetTileAt:i(137),GetTileAtWorldXY:i(1265),GetTilesWithin:i(21),GetTilesWithinShape:i(1266),GetTilesWithinWorldXY:i(1267),HasTileAt:i(451),HasTileAtWorldXY:i(1268),IsInLayerBounds:i(101),PutTileAt:i(211),PutTileAtWorldXY:i(1269),PutTilesAt:i(1270),Randomize:i(1271),RemoveTileAt:i(452),RemoveTileAtWorldXY:i(1272),RenderDebug:i(1273),ReplaceByIndex:i(450),SetCollision:i(1274),SetCollisionBetween:i(1275),SetCollisionByExclusion:i(1276),SetCollisionByProperty:i(1277),SetCollisionFromCollisionGroup:i(1278),SetTileIndexCallback:i(1279),SetTileLocationCallback:i(1280),Shuffle:i(1281),SwapByIndex:i(1282),TileToWorldX:i(138),TileToWorldXY:i(1283),TileToWorldY:i(139),WeightedRandomize:i(1284),WorldToTileX:i(61),WorldToTileXY:i(1285),WorldToTileY:i(62)}},function(t,e,i){var n=i(101);t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),n(t,e,s)){var r=s.data[e][t]||null;return null===r?null:-1===r.index?i?r:null:r}return null}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.x+e.scrollX*(1-s.scrollFactorX),n*=s.scaleX),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.y+e.scrollY*(1-s.scrollFactorY),n*=s.scaleY),r+t*n}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o,a){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o={}),void 0===a&&(a={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=n,this.tileMargin=s,this.tileSpacing=r,this.tileProperties=o,this.tileData=a,this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(22),s=i(0),r=i(11),o=i(107),a=i(245),h=i(246),l=i(6),u=new s({Extends:r,initialize:function(t,e,i){r.call(this),this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,l(i,"frames",[]),l(i,"defaultTextureKey",null)),this.frameRate=l(i,"frameRate",null),this.duration=l(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=l(i,"skipMissedFrames",!0),this.delay=l(i,"delay",0),this.repeat=l(i,"repeat",0),this.repeatDelay=l(i,"repeatDelay",0),this.yoyo=l(i,"yoyo",!1),this.showOnStart=l(i,"showOnStart",!1),this.hideOnComplete=l(i,"hideOnComplete",!1),this.paused=!1,this.manager.on(o.PAUSE_ALL,this.pause,this),this.manager.on(o.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=a[0],a[0].prevFrame=s;var v=1/(a.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),a(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);if(t._repeatDelay>0&&!1===t.pendingRepeat)t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay;else if(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying){this.getNextTick(t),t.pendingRepeat=!1;var e=t.currentFrame,i=t.parent;this.emit(o.ANIMATION_REPEAT,this,e),i.emit(o.SPRITE_ANIMATION_KEY_REPEAT+this.key,this,e,t.repeatCounter,i),i.emit(o.SPRITE_ANIMATION_REPEAT,this,e,t.repeatCounter,i)}},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i1&&(n.prevFrame=this.frames[i-1],n.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.removeAllListeners(),this.manager.off(o.PAUSE_ALL,this.pause,this),this.manager.off(o.RESUME_ALL,this.resume,this),this.manager.remove(this.key);for(var t=0;t=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,i){var n=i(55),s=i(3);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},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){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){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=(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,i){var n=i(269),s=i(272),r=i(274),o=i(275);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var n=i(160);t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1);var r=Math.floor(6*t),o=6*t-r,a=Math.floor(i*(1-e)*255),h=Math.floor(i*(1-o*e)*255),l=Math.floor(i*(1-(1-o)*e)*255),u=i=Math.floor(i*=255),c=i,d=i,f=r%6;return 0===f?(c=l,d=a):1===f?(u=h,d=a):2===f?(u=a,d=l):3===f?(u=a,c=h):4===f?(u=l,c=a):5===f&&(c=a,d=h),s?s.setTo?s.setTo(u,c,d,s.alpha,!1):(s.r=u,s.g=c,s.b=d,s.color=n(u,c,d),s):{r:u,g:c,b:d,color:n(u,c,d)}}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var n=i(277),s=i(278),r=i(279),o=i(280),a=i(281),h=i(282),l=i(283),u=i(284),c=i(285),d=i(286),f=i(287),p=i(288);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:n.Out,Bounce:s.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":n.In,"Bounce.easeIn":s.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":n.Out,"Bounce.easeOut":s.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":s.InOut}},function(t,e,i){var n=i(115),s=i(116),r=i(24),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.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").createImageData(1,1);return a=n.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.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,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(o.getUserMedia=!1),!n.iOS&&(s.ie||s.firefox||s.chrome)&&(o.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.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)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},function(t,e,i){var n=i(23),s=i(17),r={Angle:i(686),Distance:i(694),Easing:i(696),Fuzzy:i(697),Interpolation:i(700),Pow2:i(705),Snap:i(707),RandomDataGenerator:i(709),Average:i(710),Bernstein:i(297),Between:i(168),CatmullRom:i(167),CeilTo:i(711),Clamp:i(22),DegToRad:i(35),Difference:i(712),Factorial:i(298),FloatBetween:i(304),FloorTo:i(713),FromPercent:i(86),GetSpeed:i(714),IsEven:i(715),IsEvenStrict:i(716),Linear:i(114),MaxAdd:i(717),MinSub:i(718),Percent:i(719),RadToDeg:i(169),RandomXY:i(720),RandomXYZ:i(721),RandomXYZW:i(722),Rotate:i(305),RotateAround:i(251),RotateAroundDistance:i(154),RoundAwayFromZero:i(306),RoundTo:i(723),SinCosTableGenerator:i(724),SmootherStep:i(155),SmoothStep:i(156),TransformXY:i(307),Within:i(725),Wrap:i(56),Vector2:i(4),Vector3:i(170),Vector4:i(308),Matrix3:i(309),Matrix4:i(310),Quaternion:i(311),RotateVec3:i(726)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)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,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,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},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],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=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=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],m=s[12],y=s[13],x=s[14],T=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+m)*T,this.y=(e*o+i*u+n*p+y)*T,this.z=(e*a+i*c+n*g+x)*T,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/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){t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},function(t,e,i){var n=i(10);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,r,o=Number.MAX_VALUE,a=Number.MAX_VALUE,h=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,u=0;u0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit(o.START,this),this.events.emit(o.READY,this,t)},shutdown:function(t){this.events.off(o.TRANSITION_INIT),this.events.off(o.TRANSITION_START),this.events.off(o.TRANSITION_COMPLETE),this.events.off(o.TRANSITION_OUT),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.SHUTDOWN,this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.DESTROY,this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e,i){var n=i(178),s=i(52),r=i(0),o=i(12),a=i(110),h=i(13),l=i(10),u=i(913),c=i(364),d=i(4),f=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Transform,o.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 o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,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.list.length>0)for(var e=this.list,i=new l,n=0;n-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=[],this._displayList=null}});t.exports=f},function(t,e,i){var n=i(128),s=i(0),r=i(918),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(112),s=i(0),r=i(186),o=i(244),a=i(247),h=i(248),l=i(252),u=i(151),c=i(257),d=i(258),f=i(255),p=i(32),g=i(92),v=i(13),m=i(2),y=i(6),x=i(23),T=i(924),w=new s({Extends:v,Mixins:[o,a,h,l,u,c,d,f,T],initialize:function(t,e){var i=y(e,"x",0),n=y(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this.setDefaultStyles(e)},setDefaultStyles:function(t){return y(t,"lineStyle",null)&&(this.defaultStrokeWidth=y(t,"lineStyle.width",1),this.defaultStrokeColor=y(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=y(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),y(t,"fillStyle",null)&&(this.defaultFillColor=y(t,"fillStyle.color",16777215),this.defaultFillAlpha=y(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,s){return void 0===s&&(s=1),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,s,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,s,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,n,s),this},setTexture:function(t,e,i){if(void 0===i&&(i=0),void 0===t)this.commandBuffer.push(r.CLEAR_TEXTURE);else{var n=this.scene.sys.textures.getFrame(t,e);n&&(2===i&&(i=3),this.commandBuffer.push(r.SET_TEXTURE,n,i))}return this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(r.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var s=this._lineWidth/2,r=t-s,o=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+n),this.lineTo(o+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,n,s,o),this},strokeTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,n,s,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,SET_TEXTURE:19,CLEAR_TEXTURE:20,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e,i){var n=i(3);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.width/2,r=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(372),a=i(125),h=i(374),l=i(934),u=new n({Extends:r,Mixins:[s.Depth,s.Mask,s.Pipeline,s.Transform,s.Visible,l],initialize:function(t,e,i,n){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var s=0;s0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;sn.width&&(t=n.width-this.frame.cutX),this.frame.cutY+e>n.height&&(e=n.height-this.frame.cutY),this.frame.setSize(t,e,this.frame.cutX,this.frame.cutY)}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.frame.cutWidth),void 0===r&&(r=this.frame.cutHeight);var o=255&(t>>16|0),a=255&(t>>8|0),h=255&(0|t),l=this.gl,u=this.frame;if(l){var c=this.renderer,f=this.getBounds();c.setFramebuffer(this.framebuffer,!0),s===u.source.width&&r===u.source.height||l.scissor(i+u.cutX,n+u.cutY,s,r),this.pipeline.drawFillRect(f.x,f.y,f.right,f.bottom,d.getTintFromFloats(o/255,a/255,h/255,1),e),s===u.source.width&&r===u.source.height||l.scissor(0,0,u.source.width,u.source.height),this.renderer.setFramebuffer(null,!0)}else this.context.fillStyle="rgba("+o+","+a+","+h+","+e+")",this.context.fillRect(i+u.cutX,n+u.cutY,s,r);return this},clear:function(){if(this.dirty){var t=this.gl;if(t){var e=this.renderer;e.setFramebuffer(this.framebuffer,!0),this.frame.cutWidth===this.canvas.width&&this.frame.cutHeight===this.canvas.height||t.scissor(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),e.setFramebuffer(null,!0)}else{var i=this.context;i.save(),i.setTransform(1,0,0,1,0,0),i.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),i.restore()}this.dirty=!1}return this},erase:function(t,e,i){this._eraseMode=!0;var s=this.renderer.currentBlendMode;return this.renderer.setBlendMode(n.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(s),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1),r){var o=this.camera._cx,a=this.camera._cy,h=this.camera._cw,l=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(o,a,h,l,l);var u=this.pipeline;u.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),this.batchList(t,e,i,n,s),u.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),u.projOrtho(0,u.width,u.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1),o){var h=this.camera._cx,l=this.camera._cy,u=this.camera._cw,c=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(h,l,u,c,c);var d=this.pipeline;d.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),d.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,r,s,this.camera.matrix,null),d.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),d.projOrtho(0,d.width,d.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;rl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=y+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=l,n+=a[h],h0&&(d+=h.lineSpacing*g),i.rtl)c=f-c;else if("right"===i.align)c+=o-h.lineWidths[g];else if("center"===i.align)c+=(o-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var v=h.width-h.lineWidths[g],m=e.measureText(" ").width,y=a[g].trim(),x=y.split(" ");v+=(a[g].length-y.length)*m;for(var T=Math.floor(v/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[g]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[g],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[g],c,d))}e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var b=this.input;return b&&!b.customHitArea&&(b.hitArea.width=this.width,b.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(24),s=i(0),r=i(12),o=i(26),a=i(13),h=i(302),l=i(113),u=i(950),c=i(4),d=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,s,r,l,u){var d=t.sys.game.renderer;a.call(this,t,"TileSprite");var f=t.sys.textures.get(l),p=f.get(u);s&&r?(s=Math.floor(s),r=Math.floor(r)):(s=p.width,r=p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=n.create(this,s,r),this.context=this.canvas.getContext("2d"),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(p.width),this.potHeight=h(p.height),this.fillCanvas=n.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(s,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.config.renderType===o.WEBGL&&t.sys.game.renderer.onContextRestored(function(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)},this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){return this.displayFrame=this.displayTexture.get(t),this.displayFrame.cutWidth&&this.displayFrame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame,e=this.fillContext,i=this.fillCanvas,n=this.potWidth,s=this.potHeight;this.renderer.gl||(n=t.cutWidth,s=t.cutHeight),e.clearRect(0,0,n,s),i.width=n,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,s),this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,n=this._tileScale.y,s=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,n),e.translate(-s,-r),e.fillStyle=this.fillPattern,e.fillRect(s,r,this.width/i,this.height/n),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),n.remove(this.canvas),n.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},function(t,e,i){var n=i(0),s=i(193),r=i(390),o=new n({initialize:function(t){this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return s(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n=0&&w<=1&&i.push(new n(r,o))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);r=a+b*p,o=h+b*g,b>=0&&b<=1&&i.push(new n(r,o));var S=(-x+Math.sqrt(T))/(2*y);r=a+S*p,o=h+S*g,S>=0&&S<=1&&i.push(new n(r,o))}}return i}},function(t,e,i){var n=i(46),s=new(i(3));t.exports=function(t,e,i){if(void 0===i&&(i=s),n(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(n(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){var n=i(3),s=i(82),r=i(405);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new n,new n,new n,new n],c=[s(o,t,u[0]),s(a,t,u[1]),s(h,t,u[2]),s(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var s,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,m=p*v-g*g,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&s+r<1&&(n.push({x:e[w].x,y:e[w].y}),i)));w++);return n}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,t}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,o=t.x3-e,a=t.y3-i,t.x3=o*s-a*r+e,t.y3=o*r+a*s+i,t}},function(t,e,i){t.exports={BUTTON_DOWN:i(1150),BUTTON_UP:i(1151),CONNECTED:i(1152),DISCONNECTED:i(1153),GAMEPAD_BUTTON_DOWN:i(1154),GAMEPAD_BUTTON_UP:i(1155)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,i){var n=i(17),s=i(133);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,i){var n=i(0),s=i(16),r=i(20),o=i(8),a=i(2),h=i(7),l=i(336),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=Math.max(t,.001),this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},pause:function(){return this.state===o.PAUSED?this:(this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this)},play:function(t){if(void 0===t&&(t=!1),this.state===o.ACTIVE||this.state===o.PENDING_ADD&&this._pausedState===o.PENDING_ADD)return this;if(!this.parentIsTimeline&&(this.state===o.PENDING_REMOVE||this.state===o.REMOVED))return this.seek(0),this.parent.makeActive(this),this;var e=this.callbacks.onStart;return this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.ACTIVE):(this.countdown=this.calculatedOffset,this.state=o.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=o.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.parent.makeActive(this)),this},resetTweenData:function(t){for(var e=this.data,i=0;i0&&(n.elapsed=n.delay,n.state=o.DELAY)}},resume:function(){return this.state===o.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&ns.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}return this},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}return this},remove:function(){return this.parent.remove(this),this},stop:function(t){return this.state===o.ACTIVE&&void 0!==t&&this.seek(t),this.state!==o.REMOVED&&(this.state!==o.PAUSED&&this.state!==o.PENDING_ADD||(this.parentIsTimeline?(this.parent.manager._destroy.push(this),this.parent.manager._toProcess++):(this.parent._destroy.push(this),this.parent._toProcess++)),this.state=o.PENDING_REMOVE),this},update:function(t,e){if(this.state===o.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=!1,n=0;n0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},setStateFromStart:function(t,e,i){if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case o.PLAYING_FORWARD:case o.PLAYING_BACKWARD:if(!e.target){e.state=o.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;(n+=i)>s&&(r=n-s,n=s);var a,h=e.state===o.PLAYING_FORWARD,l=n/s;a=h?e.ease(l):e.ease(1-l),e.current=e.start+(e.end-e.start)*a,e.target[e.key]=e.current,e.elapsed=n,e.progress=l;var u=t.callbacks.onUpdate;u&&(u.params[1]=e.target,u.func.apply(u.scope,u.params)),1===l&&(h?e.hold>0?(e.elapsed=e.hold-r,e.state=o.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case o.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PENDING_RENDER);break;case o.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PLAYING_FORWARD);break;case o.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case o.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=o.PLAYING_FORWARD):e.state=o.COMPLETE}return e.state!==o.COMPLETE}});a.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=a},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d){return{target:t,key:e,getEndValue:i,getStartValue:n,ease:s,duration:0,totalDuration:0,delay:0,yoyo:a,hold:0,repeat:0,repeatDelay:0,flipX:c,flipY:d,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:r,duration:o,hold:h,repeat:l,repeatDelay:u},state:0}}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(56);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){var n=i(56);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(0),s=i(9),r=new n({initialize:function(t){this.name="WebGLPipeline",this.game=t.game,this.view=t.game.canvas,this.resolution=1,this.width=0,this.height=0,this.gl=t.gl,this.vertexCount=0,this.vertexCapacity=t.vertexCapacity,this.renderer=t.renderer,this.vertexData=t.vertices?t.vertices:new ArrayBuffer(t.vertexCapacity*t.vertexSize),this.vertexBuffer=this.renderer.createVertexBuffer(t.vertices?t.vertices:this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=this.renderer.createProgram(t.vertShader,t.fragShader),this.attributes=t.attributes,this.vertexSize=t.vertexSize,this.topology=t.topology,this.bytes=new Uint8Array(this.vertexData),this.vertexComponentCount=s.getComponentCount(t.attributes,this.gl),this.flushLocked=!1,this.active=!1},boot:function(){},addAttribute:function(t,e,i,n,s){return this.attributes.push({name:t,size:e,type:this.renderer.glFormats[i],normalized:n,offset:s}),this},shouldFlush:function(){return this.vertexCount>=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this.resolution=i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):-1!==h&&t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(0),s=i(63),r=i(2),o=i(487),a=i(735),h=i(736),l=i(32),u=i(9),c=i(225),d=new n({Extends:c,Mixins:[o],initialize:function(t){var e=t.renderer.config;c.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:r(t,"topology",t.renderer.gl.TRIANGLES),vertShader:r(t,"vertShader",h),fragShader:r(t,"fragShader",a),vertexCapacity:r(t,"vertexCapacity",6*e.batchSize),vertexSize:r(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this.batches=[],this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return c.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return c.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){return void 0===t&&(t=this.renderer.blankTexture.glTexture),void 0===e&&(e=0),this.requireTextureBatch(t,e)&&this.pushBatch(t,e),this},requireTextureBatch:function(t,e){var i=this.batches,n=i.length;return!(n>0)||!((e>0?i[n-1].textures[e-1]:i[n-1].texture)===t)},pushBatch:function(t,e){if(0===e)this.batches.push({first:this.vertexCount,texture:t,textures:[]});else{var i=[];i[e-1]=t,this.batches.push({first:this.vertexCount,texture:null,textures:i})}},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,n=this.gl,s=this.vertexCount,r=this.topology,o=this.vertexSize,a=this.renderer,h=this.batches,l=h.length,u=0,c=null;if(0===l||0===s)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,s*o));for(var d=0;d0){for(e=0;e0){for(e=0;e0&&(a.setTexture2D(c.texture,0,!1),n.drawArrays(r,c.first,u)),this.vertexCount=0,h.length=0,this.flushLocked=!1,this},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,l=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.cutWidth,v=o.cutHeight,m=-t.displayOriginX+f,y=-t.displayOriginY+p;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||o.updateCropUVs(x,t.flipX,t.flipY),h=x.u0,l=x.v0,c=x.u1,d=x.v1,g=x.width,v=x.height,f=x.x,p=x.y,m=-t.displayOriginX+f,y=-t.displayOriginY+p}t.flipX&&(m+=g,g*=-1),t.flipY&&(y+=v,v*=-1);var T=m+g,w=y+v;s.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),s.e=t.x,s.f=t.y,n.multiply(s,r)):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY,n.multiply(s,r));var b=r.getX(m,y),S=r.getY(m,y),A=r.getX(m,w),_=r.getY(m,w),E=r.getX(T,w),C=r.getY(T,w),M=r.getX(T,y),P=r.getY(T,y),O=u.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),R=u.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),L=u.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),D=u.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(b=Math.round(b),S=Math.round(S),A=Math.round(A),_=Math.round(_),E=Math.round(E),C=Math.round(C),M=Math.round(M),P=Math.round(P)),this.setTexture2D(a,0);var F=t._isTinted&&t.tintFill;this.batchQuad(b,S,A,_,E,C,M,P,h,l,c,d,O,R,L,D,F,a,0)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y){var x=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),x=!0,this.setTexture2D(m,y));var T=this.vertexViewF32,w=this.vertexViewU32,b=this.vertexCount*this.vertexComponentCount-1;return T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=i,T[++b]=n,T[++b]=h,T[++b]=c,T[++b]=v,w[++b]=p,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=o,T[++b]=a,T[++b]=u,T[++b]=l,T[++b]=v,w[++b]=f,this.vertexCount+=6,x},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g){var v=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),this.setTexture2D(p,g),v=!0);var m=this.vertexViewF32,y=this.vertexViewU32,x=this.vertexCount*this.vertexComponentCount-1;return m[++x]=t,m[++x]=e,m[++x]=o,m[++x]=a,m[++x]=f,y[++x]=u,m[++x]=i,m[++x]=n,m[++x]=o,m[++x]=l,m[++x]=f,y[++x]=c,m[++x]=s,m[++x]=r,m[++x]=h,m[++x]=l,m[++x]=f,y[++x]=d,this.vertexCount+=3,v},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,S,A,_,E,C,M,P,O){this.renderer.setPipeline(this,t);var R=this._tempMatrix1,L=this._tempMatrix2,D=this._tempMatrix3,F=m/i+E,k=y/n+C,I=(m+x)/i+E,B=(y+T)/n+C,Y=o,N=a,X=-g,z=-v;if(t.isCropped){var U=t._crop;Y=U.width,N=U.height,o=U.width,a=U.height;var G=m=U.x,W=y=U.y;c&&(G=x-U.x-U.width),d&&!e.isRenderTexture&&(W=T-U.y-U.height),F=G/i+E,k=W/n+C,I=(G+U.width)/i+E,B=(W+U.height)/n+C,X=-g+m,z=-v+y}d^=!O&&e.isRenderTexture?1:0,c&&(Y*=-1,X+=o),d&&(N*=-1,z+=a);var V=X+Y,H=z+N;L.applyITRS(s,r,u,h,l),R.copyFrom(M.matrix),P?(R.multiplyWithOffset(P,-M.scrollX*f,-M.scrollY*p),L.e=s,L.f=r,R.multiply(L,D)):(L.e-=M.scrollX*f,L.f-=M.scrollY*p,R.multiply(L,D));var j=D.getX(X,z),q=D.getY(X,z),K=D.getX(X,H),J=D.getY(X,H),Z=D.getX(V,H),Q=D.getY(V,H),$=D.getX(V,z),tt=D.getY(V,z);M.roundPixels&&(j=Math.round(j),q=Math.round(q),K=Math.round(K),J=Math.round(J),Z=Math.round(Z),Q=Math.round(Q),$=Math.round($),tt=Math.round(tt)),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,F,k,I,B,w,b,S,A,_,e,0)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),m=h.getY(l,c),y=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,m,y,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n;this.setTexture2D();var h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),m=this.currentFrame,y=m.u0,x=m.v0,T=m.u1,w=m.v1;this.batchQuad(l,u,c,d,f,p,g,v,y,x,T,w,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,m=g.v0,y=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,m,y,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&H[4]?this.batchQuad(D,F,P,O,H[0],H[1],H[2],H[3],U,G,W,V,B,Y,N,X,I):(j[0]=D,j[1]=F,j[2]=P,j[3]=O,j[4]=1),h&&j[4]?this.batchQuad(C,M,R,L,j[0],j[1],j[2],j[3],U,G,W,V,B,Y,N,X,I):(H[0]=C,H[1]=M,H[2]=R,H[3]=L,H[4]=1)}}});t.exports=d},function(t,e,i){var n={};t.exports=n;var s=i(37);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r0){i||(i={}),n=e.split(" ");for(var l=0;l0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(s.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}}},function(t,e,i){t.exports={Angle:i(499),Call:i(500),GetFirst:i(501),GetLast:i(502),GridAlign:i(503),IncAlpha:i(537),IncX:i(538),IncXY:i(539),IncY:i(540),PlaceOnCircle:i(541),PlaceOnEllipse:i(542),PlaceOnLine:i(543),PlaceOnRectangle:i(544),PlaceOnTriangle:i(545),PlayAnimation:i(546),PropertyValueInc:i(34),PropertyValueSet:i(27),RandomCircle:i(547),RandomEllipse:i(548),RandomLine:i(549),RandomRectangle:i(550),RandomTriangle:i(551),Rotate:i(552),RotateAround:i(553),RotateAroundDistance:i(554),ScaleX:i(555),ScaleXY:i(556),ScaleY:i(557),SetAlpha:i(558),SetBlendMode:i(559),SetDepth:i(560),SetHitArea:i(561),SetOrigin:i(562),SetRotation:i(563),SetScale:i(564),SetScaleX:i(565),SetScaleY:i(566),SetTint:i(567),SetVisible:i(568),SetX:i(569),SetXY:i(570),SetY:i(571),ShiftPosition:i(572),Shuffle:i(573),SmootherStep:i(574),SmoothStep:i(575),Spread:i(576),ToggleVisible:i(577),WrapInRectangle:i(578)}},function(t,e,i){var n=i(143),s=[];s[n.BOTTOM_CENTER]=i(231),s[n.BOTTOM_LEFT]=i(232),s[n.BOTTOM_RIGHT]=i(233),s[n.CENTER]=i(234),s[n.LEFT_CENTER]=i(236),s[n.RIGHT_CENTER]=i(237),s[n.TOP_CENTER]=i(238),s[n.TOP_LEFT]=i(239),s[n.TOP_RIGHT]=i(240);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){var n=i(38),s=i(73),r=i(39),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(38),s=i(40),r=i(39),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(38),s=i(42),r=i(39),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(235),s=i(73),r=i(76);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(74),s=i(75);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(76),s=i(40),r=i(75),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(76),s=i(42),r=i(75),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(73),s=i(44),r=i(74),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(40),s=i(44),r=i(41),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(42),s=i(44),r=i(43),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(144),s=i(86),r=i(23),o=i(3);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(243),s=i(144),r=i(86),o=i(23);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;he.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,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e,i){var n=i(52),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){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e,i){var n=i(147),s=i(108);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n-h&&(c-=h,n+=l),fd.right&&(f=u(f,f+(g-d.right),this.lerp.x)),vd.bottom&&(p=u(p,p+(v-d.bottom),this.lerp.y))):(f=u(f,g-h,this.lerp.x),p=u(p,v-l,this.lerp.y))}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.roundPixels&&(h=Math.round(h),l=Math.round(l)),this.scrollX=f,this.scrollY=p;var m=f+n,y=p+s;this.midPoint.set(m,y);var x=e/o,T=i/o;this.worldView.setTo(m-x/2,y-T/2,x,T),a.applyITRS(this.x+h,this.y+l,this.rotation,o,o),a.translate(-h,-l),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(33);t.exports=function(t){var e=new n;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(s,r,o)}return e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(e16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(33);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){var n=i(33);t.exports=function(t){var e=new n,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var s=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(s,r,o,255*a)}return e}},function(t,e,i){t.exports={Fade:i(617),Flash:i(618),Pan:i(619),Shake:i(652),Zoom:i(653)}},function(t,e,i){t.exports={In:i(620),Out:i(621),InOut:i(622)}},function(t,e,i){t.exports={In:i(623),Out:i(624),InOut:i(625)}},function(t,e,i){t.exports={In:i(626),Out:i(627),InOut:i(628)}},function(t,e,i){t.exports={In:i(629),Out:i(630),InOut:i(631)}},function(t,e,i){t.exports={In:i(632),Out:i(633),InOut:i(634)}},function(t,e,i){t.exports={In:i(635),Out:i(636),InOut:i(637)}},function(t,e,i){t.exports=i(638)},function(t,e,i){t.exports={In:i(639),Out:i(640),InOut:i(641)}},function(t,e,i){t.exports={In:i(642),Out:i(643),InOut:i(644)}},function(t,e,i){t.exports={In:i(645),Out:i(646),InOut:i(647)}},function(t,e,i){t.exports={In:i(648),Out:i(649),InOut:i(650)}},function(t,e,i){t.exports=i(651)},function(t,e,i){var n=i(0),s=i(26),r=i(290),o=i(2),a=i(6),h=i(7),l=i(165),u=i(1),c=i(171),d=i(159),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",void 0),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!0),this.autoRound=a(t,"autoRound",!1),this.autoCenter=a(t,"autoCenter",0),this.resizeInterval=a(t,"resizeInterval",500),this.fullscreenTarget=a(t,"fullscreenTarget",null),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"expandParent",this.expandParent),this.autoRound=a(e,"autoRound",this.autoRound),this.autoCenter=a(e,"autoCenter",this.autoCenter),this.resizeInterval=a(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=a(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.antialias=a(i,"antialias",!0),this.desynchronized=a(i,"desynchronized",!1),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3),this.maxLights=a(i,"maxLights",10);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){t.exports={os:i(115),browser:i(116),features:i(164),input:i(682),audio:i(683),video:i(684),fullscreen:i(685),canvasFeatures:i(291)}},function(t,e,i){var n,s,r,o=i(24),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");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;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");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);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},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){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},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),t0?Math.ceil(t):Math.floor(t)}},function(t,e,i){var n=i(4);t.exports=function(t,e,i,s,r,o,a,h){void 0===h&&(h=new n);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,f=-l*a,p=u*a,g=1/(c*p+f*-d);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=c*g*e+-d*g*t+(-s*c+i*d)*g,h}},function(t,e,i){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,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+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){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],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,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]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*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],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-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],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+m*h,e[4]=g*n+v*o+m*l,e[5]=g*s+v*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*n+x*o+T*l,e[8]=y*s+x*a+T*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],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-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,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,m=this.val;return m[0]=1-(c+f),m[3]=l+v,m[6]=u-g,m[1]=l-v,m[4]=1-(h+f),m[7]=d+p,m[2]=u+g,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=n*h-s*a,T=n*l-r*a,w=n*u-o*a,b=s*l-r*h,S=s*u-o*h,A=r*u-o*l,_=c*v-d*g,E=c*m-f*g,C=c*y-p*g,M=d*m-f*v,P=d*y-p*v,O=f*y-p*m,R=x*O-T*P+w*M+b*C-S*E+A*_;return R?(R=1/R,i[0]=(h*O-l*P+u*M)*R,i[1]=(l*C-a*O-u*E)*R,i[2]=(a*P-h*C+u*_)*R,i[3]=(r*P-s*O-o*M)*R,i[4]=(n*O-r*C+o*E)*R,i[5]=(s*C-n*P-o*_)*R,i[6]=(v*A-m*S+y*b)*R,i[7]=(m*w-g*A-y*T)*R,i[8]=(g*S-v*w+y*x)*R,this):null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),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],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},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(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=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]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],m=e*o-i*r,y=e*a-n*r,x=e*h-s*r,T=i*a-n*o,w=i*h-s*o,b=n*h-s*a,S=l*p-u*f,A=l*g-c*f,_=l*v-d*f,E=u*g-c*p,C=u*v-d*p,M=c*v-d*g,P=m*M-y*C+x*E+T*_-w*A+b*S;return P?(P=1/P,t[0]=(o*M-a*C+h*E)*P,t[1]=(n*C-i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*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*o+w*u+b*p,e[1]=x*n+T*a+w*c+b*g,e[2]=x*s+T*h+w*d+b*v,e[3]=x*r+T*l+w*f+b*m,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*o+w*u+b*p,e[5]=x*n+T*a+w*c+b*g,e[6]=x*s+T*h+w*d+b*v,e[7]=x*r+T*l+w*f+b*m,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*o+w*u+b*p,e[9]=x*n+T*a+w*c+b*g,e[10]=x*s+T*h+w*d+b*v,e[11]=x*r+T*l+w*f+b*m,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*o+w*u+b*p,e[13]=x*n+T*a+w*c+b*g,e[14]=x*s+T*h+w*d+b*v,e[15]=x*r+T*l+w*f+b*m,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},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){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},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,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=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],g=i[5],v=i[6],m=i[7],y=i[8],x=i[9],T=i[10],w=i[11],b=n*n*l+h,S=s*n*l+r*a,A=r*n*l-s*a,_=n*s*l-r*a,E=s*s*l+h,C=r*s*l+n*a,M=n*r*l+s*a,P=s*r*l-n*a,O=r*r*l+h;return i[0]=u*b+p*S+y*A,i[1]=c*b+g*S+x*A,i[2]=d*b+v*S+T*A,i[3]=f*b+m*S+w*A,i[4]=u*_+p*E+y*C,i[5]=c*_+g*E+x*C,i[6]=d*_+v*E+T*C,i[7]=f*_+m*E+w*C,i[8]=u*M+p*P+y*O,i[9]=c*M+g*P+x*O,i[10]=d*M+v*P+T*O,i[11]=f*M+m*P+w*O,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=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]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=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]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*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],o=e[2],a=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]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,m=o*h,y=o*l;return i[0]=1-(f+g),i[1]=c+y,i[2]=d-m,i[3]=0,i[4]=c-y,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+m,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,m=r*h;return e[0]=1-(d+p),e[1]=u+m,e[2]=c-v,e[3]=0,e[4]=u-m,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),m=h*(g*=v)-l*(p*=v),y=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(m*m+y*y+x*x))?(m*=v=1/v,y*=v,x*=v):(m=0,y=0,x=0);var T=p*x-g*y,w=g*m-f*x,b=f*y-p*m;return(v=Math.sqrt(T*T+w*w+b*b))?(T*=v=1/v,w*=v,b*=v):(T=0,w=0,b=0),n[0]=m,n[1]=T,n[2]=f,n[3]=0,n[4]=y,n[5]=w,n[6]=p,n[7]=0,n[8]=x,n[9]=b,n[10]=g,n[11]=0,n[12]=-(m*s+y*r+x*o),n[13]=-(T*s+w*r+b*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.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),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=i(0),s=i(170),r=i(309),o=new Int8Array([1,2,0]),a=new Float32Array([0,0,0]),h=new s(1,0,0),l=new s(0,1,0),u=new s,c=new r,d=new n({initialize:function(t,e,i,n){"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)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},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,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,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},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(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 n=c.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(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,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.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},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.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},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},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],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=i(313),s=i(24),r=i(26),o=i(164);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.CANVAS||e.renderType!==r.CANVAS&&!o.webGL){if(!o.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=r.CANVAS}else e.renderType=r.WEBGL;e.antialias||s.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=s.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||n.setCrisp(t.canvas),e.renderType!==r.HEADLESS&&(a=i(480),h=i(483),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(26);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===n.CANVAS?i="Canvas":e.renderType===n.HEADLESS&&(i="Headless");var s,r=e.audio,o=t.device.audio;if(s=!o.webAudio||r&&r.disableWebAudio?r&&r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio":"Web Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+n.VERSION+" / https://phaser.io");else{var a,h="",l=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach(function(t){h=h.concat("%c "),l.push("background: "+t),a=t}),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a):(h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),l.push("background: #fff"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+n.VERSION+" ("+i+" | "+s+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},function(t,e,i){var n=i(0),s=i(6),r=i(1),o=i(316),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step()},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.max(16+t.lastTime-i,0);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(28);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)},!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var n=i(319),s=i(24),r=i(6);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",n),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*a)),p=Math.floor(Math.abs(e.length*h));i||(i=s.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var g=i.getContext("2d");u&&g.clearRect(0,0,f,p),c&&c(i,g);for(var v=0;vi;)n-=i;ni.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e,i){var n=i(115);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e,i){var n=i(173);t.exports=function(t,e){var i=window.screen,s=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);if(s&&"string"==typeof s.type)return s.type;if("string"==typeof s)return s;if(i)return i.height>i.width?n.PORTRAIT:n.LANDSCAPE;if("number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?n.PORTRAIT:n.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return n.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return n.LANDSCAPE}return e>t?n.PORTRAIT:n.LANDSCAPE}},function(t,e){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},function(t,e){t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},function(t,e){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},function(t,e){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},function(t,e){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(0),s=i(175),r=i(11),o=i(53),a=i(28),h=i(338),l=i(339),u=i(340),c=i(341),d=i(32),f=i(307),p=new n({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var n=new u(this,i);n.smoothFactor=e.inputSmoothFactor,this.pointers.push(n)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(o.MANAGER_BOOT),this.game.events.on(a.PRE_RENDER,this.preRender,this),this.game.events.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var n=0;n10&&(t=10-this.pointersTotal);for(var i=0;i-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.useQueue||t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},function(t,e,i){var n=i(0),s=i(164),r=i(53),o=i(0),a=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.capture=t.inputMouseCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},requestPointerLock:function(){if(s.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){s.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onMouseMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseMove(e),t.capture&&e.preventDefault())},this.onMouseDown=function(n){i&&window.focus(),!n.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseDown(n),t.capture&&n.target===e&&n.preventDefault())},this.onMouseDownWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseDown(i)},this.onMouseUp=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseUp(i),t.capture&&i.target===e&&i.preventDefault())},this.onMouseUpWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseUp(i)},this.onMouseOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onMouseOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)},this.onMouseWheel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onMouseWheel(e)};var n=this.target;if(n){var r={passive:!0},o={passive:!1};n.addEventListener("mousemove",this.onMouseMove,this.capture?o:r),n.addEventListener("mousedown",this.onMouseDown,this.capture?o:r),n.addEventListener("mouseup",this.onMouseUp,this.capture?o:r),n.addEventListener("mouseover",this.onMouseOver,this.capture?o:r),n.addEventListener("mouseout",this.onMouseOut,this.capture?o:r),n.addEventListener("wheel",this.onMouseWheel,this.capture?o:r),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o)),s.pointerLock&&(this.pointerLockChange=function(e){var i=t.target;t.locked=document.pointerLockElement===i||document.mozPointerLockElement===i||document.webkitPointerLockElement===i,t.manager.queue.push(e)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&(window.removeEventListener("mousedown",this.onMouseDownWindow),window.removeEventListener("mouseup",this.onMouseUpWindow)),s.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},function(t,e,i){var n=i(292),s=i(0),r=i(57),o=i(166),a=i(301),h=i(4),l=new s({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.time=0,this.deltaX=0,this.deltaY=0,this.deltaZ=0},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,s=this.midPoint.y;if(t!==i||e!==s){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,s,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=n(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp),this.isDown=!1,this.wasTouch=!1},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp),this.isDown=!0,this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.manager.mouse.locked&&(this.movementX+=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY+=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=t.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,s=this.position.x,r=this.position.y,o=0;o0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,r=t.resolution,o=t.zoom,a=t.autoRound;if("string"==typeof e){var h=this.parentSize.width;0===h&&(h=window.innerWidth);var l=parseInt(e,10)/100;e=Math.floor(h*l)}if("string"==typeof i){var c=this.parentSize.height;0===c&&(c=window.innerHeight);var d=parseInt(i,10)/100;i=Math.floor(c*d)}this.resolution=1,this.scaleMode=s,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),o===n.ZOOM.MAX_ZOOM&&(o=this.getMaxZoom()),this.zoom=o,this.baseSize.setSize(e*r,i*r),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*o,t.minHeight*o),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*o,t.maxHeight*o),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==n.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=this.resolution,n=e.width*i,s=e.height*i;return(t.width!==n||t.height!==s)&&(t.setSize(n,s),!0)},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e(t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound,n=this.resolution;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t,e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,n=this.resolution,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,o=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i*n,e*i*n),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,h=t*i,l=e*i;return s&&(h=Math.floor(h),l=Math.floor(l)),h===t&&l===e||(a.width=h+"px",a.height=l+"px"),this.refresh(r,o)},setZoom:function(t){return this.zoom=t,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var n=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=n.marginLeft,s.marginTop=n.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,this.resolution,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===n.SCALE_MODE.NONE?(this.displaySize.setSize(s*o*1,r*o*1),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),o>1&&(i.width=t+"px",i.height=e+"px")):this.scaleMode===n.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(1*this.displaySize.width,1*this.displaySize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=p(this.parentSize.width,this.gameSize.width,0,!0),e=p(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==n.CENTER.NO_CENTER){var e=this.canvas,i=e.style,s=e.getBoundingClientRect(),r=s.width,o=s.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===n.CENTER.CENTER_HORIZONTALLY?h=0:t===n.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();this._requestedFullscreenChange=!0,"undefined"!=typeof Promise?e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT).then(this.fullscreenSuccessHandler).catch(this.fullscreenErrorHandler):i[e.request](t).then(this.fullscreenSuccessHandler).catch(this.fullscreenErrorHandler):(e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t),e.active?this.fullscreenSuccessHandler():this.fullscreenErrorHandler())}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&(this._requestedFullscreenChange=!0,document[t.cancel]()),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach(function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){this._requestedFullscreenChange||this.stopFullscreen(),this._requestedFullscreenChange=!1},onFullScreenError:function(){this.removeFullscreenTarget()},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy(),this.fullscreenTarget=null},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===n.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===n.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=v},function(t,e,i){var n=i(22),s=i(0),r=i(90),o=i(4),a=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio0&&(t=(e=r(e,n.y))*this.aspectRatio)):(i&&this.aspectRatios)&&(t=(e=r(e,n.y))*this.aspectRatio,n.x>0&&(e=(t=r(t,n.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},function(t,e,i){var n=i(0),s=i(122),r=i(19),o=i(28),a=i(6),h=i(80),l=i(1),u=i(346),c=i(176),d=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit(r.TRANSITION_INIT,n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=r.x&&t=r.y&&e=r.x&&t=r.y&&e0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=o},function(t,e,i){var n=i(123),s=i(0),r=i(11),o=i(356),a=i(1),h=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){var n=i(124),s=i(0),r=i(11),o=i(17),a=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!1},updateMarker:function(t){return!1},removeMarker:function(t){return null},play:function(t,e){return!1},pause:function(){return!1},resume:function(){return!1},stop:function(){return!1},destroy:function(){this.manager.remove(this),n.prototype.destroy.call(this)}});t.exports=a},function(t,e,i){var n=i(358),s=i(123),r=i(0),o=i(65),a=i(359),h=new r({Extends:s,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),s.call(this,t),this.locked&&this.unlock()},createAudioContext:function(t){var e=t.config.audio;return e&&e.context?(e.context.resume(),e.context):new AudioContext},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var s=this.game.cache.audio,r=i.length,a=0;a>4,u[h++]=(15&i)<<4|s>>2,u[h++]=(3&s)<<6|63&r;return l}},function(t,e,i){var n=i(124),s=i(0),r=i(65),o=new s({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),this.audioBuffer?(this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime-1;r--)n[s][r]=t[r][s]}return n}},function(t,e){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,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=n);o>r;){if(o-r>600){var h=o-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(o,Math.floor(e+(h-l)*c/h+d));s(t,e,f,p,a)}var g=t[e],v=r,m=o;for(i(t,r,e),a(t[o],g)>0&&i(t,r,o);v0;)m--}0===a(t[r],g)?i(t,r,m):i(t,++m,o),m<=e&&(r=m+1),e<=m&&(o=m-1)}};t.exports=s},function(t,e,i){var n=i(6),s=i(111),r=function(t,e,i){for(var n=[],s=0;s0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(10);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),o=Math.max(t.right,e.right)-s,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(s,r,o,a)}},function(t,e,i){var n=i(0),s=i(12),r=i(916),o=i(13),a=i(7),h=i(174),l=i(308),u=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Origin,s.ScrollFactor,s.Transform,s.Visible,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new l,this.rotate3dAngle="deg",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof n?"#"===n[0]?this.setElement(n.substr(1),s,r):this.createElement(n,s,r):n&&this.setElement(n,s,r)},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e>>16,y=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+m+","+y+","+x+","+d+")",c.lineWidth=v,T+=3;break;case n.FILL_STYLE:g=l[T+1],f=l[T+2],m=(16711680&g)>>>16,y=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+m+","+y+","+x+","+f+")",T+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[T+1],l[T+2],l[T+3],l[T+4]):c.fillRect(l[T+1],l[T+2],l[T+3],l[T+4]),T+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.fill(),T+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.stroke(),T+=6;break;case n.LINE_TO:c.lineTo(l[T+1],l[T+2]),T+=2;break;case n.MOVE_TO:c.moveTo(l[T+1],l[T+2]),T+=2;break;case n.LINE_FX_TO:c.lineTo(l[T+1],l[T+2]),T+=5;break;case n.MOVE_FX_TO:c.moveTo(l[T+1],l[T+2]),T+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[T+1],l[T+2]),T+=2;break;case n.SCALE:c.scale(l[T+1],l[T+2]),T+=2;break;case n.ROTATE:c.rotate(l[T+1]),T+=1;break;case n.GRADIENT_FILL_STYLE:T+=5;break;case n.GRADIENT_LINE_STYLE:T+=6;break;case n.SET_TEXTURE:T+=2}c.restore()}}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(52),s=i(0),r=i(12),o=i(375),a=i(376),h=i(933),l=i(2),u=i(180),c=i(377),d=i(97),f=i(373),p=i(378),g=i(10),v=i(127),m=i(4),y=i(56),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];s.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===n&&(n=!1),void 0===s&&(s=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=s,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;i0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e,i){var n=i(0),s=i(956),r=i(63),o=i(10),a=i(30),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;sc+v)){var m=g.getPoint((u-c)/v);o.push(m);break}c+=v}return o}},function(t,e,i){var n=i(55),s=i(54);t.exports=function(t){for(var e=t.points,i=0,r=0;r0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(0),s=i(10),r=i(30),o=i(977),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new s(0,0,n,o)),this.setPosition(e,i),this.setSize(n,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(980),s=i(0),r=i(63),o=i(30),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(55),s=i(3);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e){t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=t,o=0;o0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],o):h=new s(t,e,i,a[0],a[1],a[2],o),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=o},function(t,e,i){t.exports={Circle:i(1039),Ellipse:i(1049),Intersects:i(402),Line:i(1068),Point:i(1089),Polygon:i(1103),Rectangle:i(417),Triangle:i(1133)}},function(t,e,i){t.exports={CircleToCircle:i(403),CircleToRectangle:i(404),GetCircleToCircle:i(1059),GetCircleToRectangle:i(1060),GetLineToCircle:i(196),GetLineToRectangle:i(198),GetRectangleIntersection:i(1061),GetRectangleToRectangle:i(1062),GetRectangleToTriangle:i(1063),GetTriangleToCircle:i(1064),GetTriangleToLine:i(409),GetTriangleToTriangle:i(1065),LineToCircle:i(197),LineToLine:i(82),LineToRectangle:i(405),PointToLine:i(413),PointToLineSegment:i(1066),RectangleToRectangle:i(130),RectangleToTriangle:i(406),RectangleToValues:i(1067),TriangleToCircle:i(408),TriangleToLine:i(410),TriangleToTriangle:i(411)}},function(t,e,i){var n=i(57);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(82),s=i(47),r=i(199),o=i(407);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e,i){var n=i(197),s=i(81);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=1);var n=e.x1,s=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-n)*(r-n)+(o-s)*(o-s);if(0===l)return!1;var u=((a-n)*(r-n)+(h-s)*(o-s))/l;if(u<0)return Math.sqrt((n-a)*(n-a)+(s-h)*(s-h))<=i;if(u>=0&&u<=1){var c=((s-h)*(r-n)-(n-a)*(o-s))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},function(t,e,i){var n=i(23),s=i(56),r=i(83);t.exports=function(t){var e=r(t)-n.TAU;return s(e,-Math.PI,Math.PI)}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e,i){var n=i(10);n.Area=i(1108),n.Ceil=i(1109),n.CeilAll=i(1110),n.CenterOn=i(162),n.Clone=i(1111),n.Contains=i(47),n.ContainsPoint=i(1112),n.ContainsRect=i(418),n.CopyFrom=i(1113),n.Decompose=i(407),n.Equals=i(1114),n.FitInside=i(1115),n.FitOutside=i(1116),n.Floor=i(1117),n.FloorAll=i(1118),n.FromPoints=i(172),n.GetAspectRatio=i(201),n.GetCenter=i(1119),n.GetPoint=i(147),n.GetPoints=i(249),n.GetSize=i(1120),n.Inflate=i(1121),n.Intersection=i(1122),n.MarchingAnts=i(260),n.MergePoints=i(1123),n.MergeRect=i(1124),n.MergeXY=i(1125),n.Offset=i(1126),n.OffsetPoint=i(1127),n.Overlaps=i(1128),n.Perimeter=i(108),n.PerimeterPoint=i(1129),n.Random=i(150),n.RandomOutside=i(1130),n.SameDimensions=i(1131),n.Scale=i(1132),n.Union=i(364),t.exports=n},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var n=i(423),s=i(424),r=i(0),o=i(11),a=i(4),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=r;for(i=0;i=r;)this._elapsed-=r,this.step(s)}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(n=(i=h.entries).length,t=0;t-1&&p>g&&(t.velocity.normalize().scale(g),p=g),t.speed=p},separate:function(t,e,i,n,s){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,s);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.ya.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,c=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)r.right&&(s=h(o.x,o.y,r.right,r.y)-o.radius):o.y>r.bottom&&(o.xr.right&&(s=h(o.x,o.y,r.right,r.bottom)-o.radius)),s*=-1}else s=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s&&(t.onOverlap||e.onOverlap)&&this.emit(u.OVERLAP,t.gameObject,e.gameObject,t,e),0!==s;var a=t.position.x-e.position.x,l=t.position.y-e.position.y,c=Math.sqrt(Math.pow(a,2)+Math.pow(l,2)),d=(e.position.x-t.position.x)/c||0,f=(e.position.y-t.position.y)/c||0,v=2*(t.velocity.x*d+t.velocity.y*f-e.velocity.x*d-e.velocity.y*f)/(t.mass+e.mass);t.immovable||(t.velocity.x=(t.velocity.x-v*t.mass*d)*t.bounce.x,t.velocity.y=(t.velocity.y-v*t.mass*f)*t.bounce.y),e.immovable||(e.velocity.x=(e.velocity.x+v*e.mass*d)*e.bounce.x,e.velocity.y=(e.velocity.y+v*e.mass*f)*e.bounce.y);var m=e.velocity.x-t.velocity.x,y=e.velocity.y-t.velocity.y,x=Math.atan2(y,m),T=this._frameTime;return t.immovable||(t.x+=t.velocity.x*T-s*Math.cos(x),t.y+=t.velocity.y*T-s*Math.sin(x)),e.immovable||(e.x+=e.velocity.x*T+s*Math.cos(x),e.y+=e.velocity.y*T+s*Math.sin(x)),(t.onCollide||e.onCollide)&&this.emit(u.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o,a;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f=e.getTilesWithinWorldXY(a,h,l,u);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,n,s,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,s,r,o){for(var a,h,l=t.body,c={left:0,right:0,top:0,bottom:0},d=!1,f=0;f0&&t>i&&(t=i)),0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),this.gameObject.x+=t,this.gameObject.y+=e,this._reset=!0}t<0?this.facing=r.FACING_LEFT:t>0&&(this.facing=r.FACING_RIGHT),e<0?this.facing=r.FACING_UP:e>0&&(this.facing=r.FACING_DOWN),this._dx=t,this._dy=e,this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,s=void 0!==i;return(n||s)&&(this.worldBounce||(this.worldBounce=new u),n&&(this.worldBounce.x=e),s&&(this.worldBounce.y=i)),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(50);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=i(50);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,m,y;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,m-g)*Math.max(0,y-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(46),s=i(0),r=i(50),o=i(47),a=i(4),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports={NEVER:0,LITE:1,PASSIVE:2,ACTIVE:4,FIXED:8}},function(t,e){t.exports={NONE:0,A:1,B:2,BOTH:3}},function(t,e,i){var n={};t.exports=n;var s=i(227);n._motionWakeThreshold=.18,n._motionSleepThreshold=.08,n._minBias=.9,n.update=function(t,e){for(var i=e*e*e,s=0;s0&&r.motion=r.sleepThreshold&&n.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else n.set(r,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,s=0;sn._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||s.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&s.trigger(t,"sleepEnd"))}},function(t,e,i){var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game,this.scene,this.systems},init:function(){},start:function(){},stop:function(){},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e,i){var n=i(21);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l-1}return!1}},function(t,e,i){var n=i(72),s=i(101),r=i(210);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!1),void 0===o&&(o=!0),!s(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new n(a,-1,t,e,h.width,h.height),o&&h&&h.collides&&r(t,e,a),h):null}},function(t,e,i){var n=i(31),s=i(213),r=i(454),o=i(455),a=i(466);t.exports=function(t,e,i,h,l,u){var c;switch(e){case n.ARRAY_2D:c=s(t,i,h,l,u);break;case n.CSV:c=r(t,i,h,l,u);break;case n.TILED_JSON:c=o(t,i,u);break;case n.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},function(t,e,i){var n=i(31),s=i(213);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map(function(t){return t.split(",")}),h=s(t,a,i,r,o);return h.format=n.CSV,h}},function(t,e,i){var n=i(31),s=i(103),r=i(456),o=i(458),a=i(459),h=i(462),l=i(464),u=i(465);t.exports=function(t,e,i){if("orthogonal"!==e.orientation)return console.warn("Only orthogonal map types are supported in this version of Phaser"),null;var c=new s({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:e.orientation,format:n.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});c.layers=r(e,i),c.images=o(e);var d=a(e);return c.tilesets=d.tilesets,c.imageCollections=d.imageCollections,c.objects=h(e),c.tiles=l(c),u(c),c}},function(t,e,i){var n=i(457),s=i(2),r=i(102),o=i(214),a=i(72);t.exports=function(t,e){for(var i=s(t,"infinite",!1),h=[],l=0;l0?((f=new a(c,d.gid,C,M,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,g[M][C]=f):(p=e?null:new a(c,-1,C,M,t.tilewidth,t.tileheight),g[M][C]=p),++v===w.width&&(A++,v=0)}}else{c=new r({name:u.name,x:s(u,"offsetx",0)+u.x,y:s(u,"offsety",0)+u.y,width:u.width,height:u.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:u.opacity,visible:u.visible,properties:s(u,"properties",{})});for(var P=[],O=0,R=u.data.length;O0?((f=new a(c,d.gid,v,g.length,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,P.push(f)):(p=e?null:new a(c,-1,v,g.length,t.tilewidth,t.tileheight),P.push(p)),++v===u.width&&(g.push(P),v=0,P=[])}c.data=g,h.push(c)}}return h}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),s=0;s>>0;return n}},function(t,e,i){var n=i(2);t.exports=function(t){for(var e=[],i=0;i1){if(Array.isArray(l.tiles)){for(var c={},d={},f=0;f=this.firstgid&&ta&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(102),s=i(72);t.exports=function(t,e){for(var i=[],r=0;r-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(140);t.exports=function(t){for(var e=[],i=[],s=0;s-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(s,r),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(u=new p(t,o,i,n,s,r)).setImage(h),this.tilesets.push(u),u)},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new c(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:null!==a?(f.Copy(t,e,i,n,s,r,o,a),this):null},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===a&&(a=this.tileWidth),void 0===l&&(l=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var u,c=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;f-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return n},removeTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"removeTileAt")?null:null===s?null:f.RemoveTileAt(t,e,i,n,s)},removeTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"removeTileAtWorldXY")?null:null===r?null:f.RemoveTileAtWorldXY(t,e,i,n,s,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(f.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(t){void 0===t&&(t=!0),this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(12),r=i(26),o=i(13),a=i(1292),h=i(136),l=i(32),u=i(9),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===r.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;sv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;o>=0;o--)for(a=0;av||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;o>=0;o--)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===m?(m=i.createVertexBuffer(y,n.STATIC_DRAW),this.vertexBuffer[e]=m):(i.setVertexBuffer(m),n.bufferSubData(n.ARRAY_BUFFER,0,y))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=i.tileWidth,l=i.tileHeight,c=h/2,d=l/2,f=a.x/n,p=a.y/s,g=(a.x+h)/n,v=(a.y+l)/s,m=this._tempMatrix,y=-c,x=-d;e.flipX&&(h*=-1,y+=i.tileWidth),e.flipY&&(l*=-1,x+=i.tileHeight);var T=y+h,w=x+l;m.applyITRS(c+e.pixelX,d+e.pixelY,e.rotation,1,1);var b=u.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),S=m.getX(y,x),A=m.getY(y,x),_=m.getX(y,w),E=m.getY(y,w),C=m.getX(T,w),M=m.getY(T,w),P=m.getX(T,x),O=m.getY(T,x);r.roundPixels&&(S=Math.round(S),A=Math.round(A),_=Math.round(_),E=Math.round(E),C=Math.round(C),M=Math.round(M),P=Math.round(P),O=Math.round(O));var R=this.vertexViewF32[o],L=this.vertexViewU32[o];return R[++t]=S,R[++t]=A,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=b,R[++t]=_,R[++t]=E,R[++t]=f,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=S,R[++t]=A,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=b,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=P,R[++t]=O,R[++t]=g,R[++t]=p,R[++t]=0,L[++t]=b,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4){this._renderOrder=t;for(var e=0;e0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(1301);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){var n=i(6);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(219),s=i(14),r=i(87),o=i(96),a=i(141),h=i(6),l=i(218),u=i(220),c=i(221);t.exports=function(t,e,i){void 0===i&&(i=n);var d=h(e,"from",0),f=h(e,"to",1),p=[{value:d}],g=a(e,"delay",i.delay),v=a(e,"duration",i.duration),m=h(e,"easeParams",i.easeParams),y=o(h(e,"ease",i.ease),m),x=a(e,"hold",i.hold),T=a(e,"repeat",i.repeat),w=a(e,"repeatDelay",i.repeatDelay),b=r(e,"yoyo",i.yoyo),S=[],A=l("value",f),_=c(p[0],"value",A.getEnd,A.getStart,y,g,v,b,x,T,w,!1,!1);_.start=d,_.current=d,_.to=f,S.push(_);var E=new u(t,S,p);E.offset=s(e,"offset",null),E.completeDelay=s(e,"completeDelay",0),E.loop=Math.round(s(e,"loop",0)),E.loopDelay=Math.round(s(e,"loopDelay",0)),E.paused=r(e,"paused",!1),E.useFrames=r(e,"useFrames",!1);for(var C=h(e,"callbackScope",E),M=[E,null],P=u.TYPES,O=0;O0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var m=0;m0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit(r.TIMELINE_LOOP,this,this.loopCounter),this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):this.state=a.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=a.COMPLETE_DELAY;else{this.state=a.PENDING_REMOVE;var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit(r.TIMELINE_COMPLETE,this)}},update:function(t,e){if(this.state!==a.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var i=this.totalData,n=0;n=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit(r.SPRITE_ANIMATION_KEY_UPDATE+i.key,i,t,e),e.emit(r.SPRITE_ANIMATION_UPDATE,i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=o},function(t,e,i){var n=i(481),s=i(48),r=i(0),o=i(26),a=i(482),h=i(89),l=i(104),u=i(113),c=i(32),d=new r({initialize:function(t){this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.config={clearBeforeRender:t.config.clearBeforeRender,backgroundColor:t.config.backgroundColor,resolution:t.config.resolution,antialias:t.config.antialias,roundPixels:t.config.roundPixels},this.scaleMode=t.config.antialias?l.LINEAR:l.NEAREST,this.gameCanvas=t.canvas;var e={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d",e),this.currentContext=this.gameContext,this.blendModes=a(),this.currentScaleMode=0,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new c,this._tempMatrix2=new c,this._tempMatrix3=new c,this._tempMatrix4=new c,this.init()},init:function(){this.game.scale.on(h.RESIZE,this.onResize,this);var t=this.game.scale.baseSize;this.resize(t.width,t.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.scaleMode===l.NEAREST&&u.disable(this.gameContext)},onContextLost:function(){},onContextRestored:function(){},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),t.save(),this.drawCount=0},render:function(t,e,i,n){var r=e.list,o=r.length,a=n._cx,h=n._cy,l=n._cw,u=n._ch,c=n.renderToTexture?n.context:t.sys.context;c.save(),this.game.scene.customViewports&&(c.beginPath(),c.rect(a,h,l,u),c.clip()),this.currentContext=c;var d=n.mask;d&&d.preRenderCanvas(this,null,n._maskCamera),n.transparent||(c.fillStyle=n.backgroundColor.rgba,c.fillRect(a,h,l,u)),c.globalAlpha=n.alpha,c.globalCompositeOperation="source-over",this.drawCount+=r.length,n.renderToTexture&&n.emit(s.PRE_RENDER,n),n.matrix.copyToContext(c);for(var f=0;f=0?g=-(g+d):g<0&&(g=Math.abs(g)-d)),-1===y&&(v>=0?v=-(v+f):v<0&&(v=Math.abs(v)-f))}a.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.scale(m,y),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,g,v,d/p,f/p),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=d},function(t,e,i){var n=i(24),s=i(33),r=i(2);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=r(e,"width",t.width),c=r(e,"height",t.height);if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new s(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=n.createWebGL(this,u,c);f.getContext("2d").drawImage(t,h,l,u,c,0,0,u,c);var p=new Image;p.onerror=function(){i.call(null),n.remove(f)},p.onload=function(){i.call(null,p),n.remove(f)},p.src=f.toDataURL(o,a)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(o,a)}}},function(t,e,i){var n=i(52),s=i(291);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t[n.ERASE]="destination-out",t[n.SOURCE_IN]="source-in",t[n.SOURCE_OUT]="source-out",t[n.SOURCE_ATOP]="source-atop",t[n.DESTINATION_OVER]="destination-over",t[n.DESTINATION_IN]="destination-in",t[n.DESTINATION_OUT]="destination-out",t[n.DESTINATION_ATOP]="destination-atop",t[n.LIGHTER]="lighter",t[n.COPY]="copy",t[n.XOR]="xor",t}},function(t,e,i){var n=i(112),s=i(48),r=i(0),o=i(26),a=i(117),h=i(89),l=i(78),u=i(118),c=i(32),d=i(9),f=i(484),p=i(485),g=i(486),v=i(226),m=new r({initialize:function(t){var e=this,i=t.config,s={alpha:i.transparent,desynchronized:i.desynchronized,depth:!1,antialias:i.antialias,premultipliedAlpha:i.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:i.failIfMajorPerformanceCaveat,powerPreference:i.powerPreference};this.config={clearBeforeRender:i.clearBeforeRender,antialias:i.antialias,backgroundColor:i.backgroundColor,contextCreation:s,resolution:i.resolution,roundPixels:i.roundPixels,maxTextures:i.maxTextures,maxTextureSize:i.maxTextureSize,batchSize:i.batchSize,maxLights:i.maxLights},this.game=t,this.type=o.WEBGL,this.width=0,this.height=0,this.canvas=t.canvas,this.lostContextCallbacks=[],this.restoredContextCallbacks=[],this.blendModes=[],this.nativeTextures=[],this.contextLost=!1,this.pipelines=null,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this.currentActiveTextureUnit=0,this.currentTextures=new Array(16),this.currentFramebuffer=null,this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.canvas.addEventListener("webglcontextlost",function(t){e.contextLost=!0,t.preventDefault();for(var i=0;i0&&n>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==n}a&&(this.flush(),r.scissor(t,s-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},rebindPipeline:function(t){var e=this.gl;e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),this.hasActiveStencilMask()?e.clear(e.DEPTH_BUFFER_BIT):(e.disable(e.STENCIL_TEST),e.clear(e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)),e.viewport(0,0,this.width,this.height),this.setBlendMode(0,!0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.blankTexture.glTexture),this.currentActiveTextureUnit=0,this.currentTextures[0]=this.blankTexture.glTexture,this.currentPipeline=t,this.currentPipeline.bind(),this.currentPipeline.onBind()},clearPipeline:function(){this.flush(),this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.setBlendMode(0,!0)},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(n.equation),n.func.length>2?i.blendFuncSeparate(n.func[0],n.func[1],n.func[2],n.func[3]):i.blendFunc(n.func[0],n.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e,i){void 0===i&&(i=!0);var n=this.gl;return t!==this.currentTextures[e]&&(i&&this.flush(),this.currentActiveTextureUnit!==e&&(n.activeTexture(n.TEXTURE0+e),this.currentActiveTextureUnit=e),n.bindTexture(n.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.width,s=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(n=t.renderTexture.width,s=t.renderTexture.height):this.flush(),i.bindFramebuffer(i.FRAMEBUFFER,t),i.viewport(0,0,n,s),e&&(t?(this.drawingBufferHeight=s,this.pushScissor(0,0,n,s)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,r=s.NEAREST,h=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,a(e,i)&&(h=s.REPEAT),n===o.ScaleModes.LINEAR&&this.config.antialias&&(r=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,r,r,h,h,s.RGBA,t):this.createTexture2D(0,r,r,h,h,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&l(this.nativeTextures,e),this.gl.deleteTexture(t),this.currentTextures[0]!==t||this.game.pendingDestroy||this.setBlankTexture(!0),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,r=t._ch,o=this.pipelines.TextureTintPipeline,a=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-r),this.setFramebuffer(t.framebuffer);var h=this.gl;h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT),o.projOrtho(e,n+e,i,r+i,-1e3,1e3),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n+e,r+i,d.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL),t.emit(s.PRE_RENDER,t)}else this.pushScissor(e,i,n,r),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n,r,d.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,d.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,d.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit(s.POST_RENDER,t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=d.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera))},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.pipelines;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var i=this.config.backgroundColor;t.clearColor(i.redGL,i.greenGL,i.blueGL,i.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}for(var n in t.enable(t.SCISSOR_TEST),e)e[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,r=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);this.preRenderCamera(n);for(var l=this.currentMask,u=0;u>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){t.exports="changedata"},function(t,e){t.exports="changedata-"},function(t,e){t.exports="removedata"},function(t,e){t.exports="setdata"},function(t,e){t.exports="destroy"},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"alpha",e,i,s,r)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"x",e,i,s,r)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"x",e,s,o,a),n(t,"y",i,r,o,a)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"y",e,i,s,r)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=0;o0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={Camera:i(268),CameraManager:i(654),Effects:i(276),Events:i(48)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(22),s=i(0),r=i(48),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed=1?1:1/e*(1+(e*t|0))}},function(t,e,i){var n=i(22),s=i(0),r=i(48),o=i(4),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=s,this.camera.emit(r.SHAKE_START,this.camera,this,t,e),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed0&&(o.preRender(1),t.render(n,e,i,o))}},resetAll:function(){for(var t=0;t1)for(var i=1;i=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){var n=i(116),s={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(s.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(s.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(s.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(s.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(s.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(s.webm=!0),""!==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 i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e){var i={h264Video:!1,hlsVideo:!1,mp4Video:!1,oggVideo:!1,vp9Video:!1,webmVideo:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.oggVideo=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264Video=!0,i.mp4Video=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webmVideo=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9Video=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hlsVideo=!0))}catch(t){}return i}()},function(t,e){var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){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=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e1?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[i1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(155);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){t.exports={GetNext:i(302),IsSize:i(117),IsValue:i(706)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){t.exports={Ceil:i(303),Floor:i(90),To:i(708)}},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){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;i1?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,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=[],o=0;o0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e,i){var n=i(33),s=i(328);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=s(l,h,t+1/3),o=s(l,h,t),a=s(l,h,t-1/3)}return(new n).setGLTo(r,o,a,1)}},function(t,e,i){var n=i(161);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(n(s/359,t,e));return i}},function(t,e,i){var n=i(114),s=function(t,e,i,s,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:n(t,s,l),g:n(e,r,l),b:n(i,o,l)}};t.exports={RGBWithRGB:s,ColorWithRGB:function(t,e,i,n,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),s(t.r,t.g,t.b,e,i,n,r,o)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),s(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(168),s=i(33);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var n=i(327);t.exports=function(t,e,i,s,r){return void 0===s&&(s=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+n(s)+n(t)+n(e)+n(i)}},function(t,e,i){t.exports={BitmapMask:i(253),GeometryMask:i(254)}},function(t,e,i){var n={AddToDOM:i(119),DOMContentLoaded:i(329),GetScreenOrientation:i(330),GetTarget:i(335),ParseXML:i(336),RemoveFromDOM:i(174),RequestAnimationFrame:i(316)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(779)}},function(t,e,i){var n=i(0),s=i(11),r=i(18),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){var n=i(119),s=i(264),r=i(267),o=i(24),a=i(0),h=i(289),l=i(781),u=i(312),c=i(109),d=i(314),f=i(290),p=i(329),g=i(11),v=i(28),m=i(337),y=i(18),x=i(342),T=i(343),w=i(345),b=i(118),S=i(349),A=i(315),_=i(317),E=i(352),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new S(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=E.create(this),this.loop=new A(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),_(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(v.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(v.POST_RENDER,n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),i.emit(v.PRE_RENDER),i.emit(v.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},function(t,e,i){var n=i(119);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,n(i,e.parent)}}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},n=document.createElement("div");return n.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(n),i.w=90===e?n.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:n.offsetHeight,document.documentElement.removeChild(n),n=null,90!==Math.abs(window.orientation)?i.h:i.w}},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){var n=i(2),s=i(347);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=n(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(s(e+"Physics")),i)for(var o in i)o=s(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},function(t,e,i){var n=i(2);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){t.exports={game:"game",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e,i){var n=i(0),s=i(22),r=i(33),o=i(117),a=i(177),h=new n({Extends:a,initialize:function(t,e,i,n,s){a.call(this,t,e,i,n,s),this.add("__BASE",0,0,0,n,s),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=n,this.height=s,this.imageData=this.context.getImageData(0,0,n,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0);var s=this.manager.getFrame(t,e);if(s){var r=s.canvasData,o=s.cutWidth,a=s.cutHeight,h=s.source.resolution;return this.context.drawImage(s.source.image,r.x,r.y,o,a,i,n,o/h,a/h),this.update()}return this},setPixel:function(t,e,i,n,s,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=n,o.data[2]=s,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,n,s,r,o){return void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,n,s,r,o),this},getData:function(t,e,i,n){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),n=s(n,1,this.height-e),this.context.getImageData(t,e,i,n)},getPixel:function(t,e,i){i||(i=new r);var n=this.getIndex(t,e);if(n>-1){var s=this.data,o=s[n+0],a=s[n+1],h=s[n+2],l=s[n+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,n){void 0===n&&(n=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=s(t,0,this.width),a=s(t+i,0,this.width),h=s(e,0,this.height),l=s(e+n,0,this.height),u=new r,c=[],d=h;dg||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,m=f,y=0,x=0,T=0;Tr&&(y=w-r),b>o&&(x=b-o),t.add(T,e,i+v,s+m,h-y,l-x),(v+=h+p)+h>r&&(v=f,m+=l+p)}return t}},function(t,e,i){var n=i(2);t.exports=function(t,e,i){var s=n(i,"frameWidth",null),r=n(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=n(i,"startFrame",0),l=n(i,"endFrame",-1),u=n(i,"margin",0),c=n(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,v=e.realWidth,m=e.realHeight,y=Math.floor((v-u+c)/(s+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,b=s-w,S=s-(v-p-w),A=e.y,_=r-A,E=r-(m-g-A);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,M=u,P=0,O=e.sourceIndex,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 o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0){var o=n-t.length;if(o<=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 a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-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&&i0){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&&it.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){var n=i(66);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 o=i-e,a=t.splice(e,o);if(s)for(var h=0;h0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){var n=i(66);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 o=s;o-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;iv&&(r=v),o>m&&(o=m);var O=v+g.xAdvance,R=m+u;a_&&(_=C),C_&&(_=C),C0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,m=p.cutY,y=g.width,x=g.height,T=e._isTinted&&e.tintFill,w=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),b=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),S=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),A=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var _,E,C=0,M=0,P=0,O=0,R=e.letterSpacing,L=0,D=0,F=0,k=0,I=e.scrollX,B=e.scrollY,Y=e.fontData,N=Y.chars,X=Y.lineHeight,z=e.fontSize/Y.size,U=0,G=e._align,W=0,V=0;e.getTextBounds(!1);var H=e._bounds.lines;1===G?V=(H.longest-H.lengths[0])/2:2===G&&(V=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;J0&&e.cropHeight>0&&(h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var F=0;F0&&(N=N%b-b):N>b?N=b:N<0&&(N=b+N%b),null===E&&(E=new o(k+Math.cos(Y)*B,I+Math.sin(Y)*B,v),S.push(E),F+=.01);F<1+z;)w=N*F+Y,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,E.points.push(new r(x,T,v)),F+=.01;w=N+Y,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,E.points.push(new r(x,T,v));break;case n.FILL_RECT:u.setTexture2D(M),u.batchFillRect(p[++P],p[++P],p[++P],p[++P],f,c);break;case n.FILL_TRIANGLE:u.setTexture2D(M),u.batchFillTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],f,c);break;case n.STROKE_TRIANGLE:u.setTexture2D(M),u.batchStrokeTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],v,f,c);break;case n.LINE_TO:null!==E?E.points.push(new r(p[++P],p[++P],v)):(E=new o(p[++P],p[++P],v),S.push(E));break;case n.MOVE_TO:E=new o(p[++P],p[++P],v),S.push(E);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:k=p[++P],I=p[++P],f.translate(k,I);break;case n.SCALE:k=p[++P],I=p[++P],f.scale(k,I);break;case n.ROTATE:f.rotate(p[++P]);break;case n.SET_TEXTURE:var U=p[++P],G=p[++P];u.currentFrame=U,u.setTexture2D(U.glTexture,0),u.tintEffect=G,M=U.glTexture;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,u.tintEffect=2,M=t.blankTexture.glTexture}}}},function(t,e,i){var n=i(1),s=i(1);n=i(927),s=i(928),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(1),s=i(1);n=i(930),s=i(931),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){t.exports={GravityWell:i(372),Particle:i(373),ParticleEmitter:i(374),ParticleEmitterManager:i(188),Zones:i(937)}},function(t,e,i){var n=i(0),s=i(304),r=i(96),o=i(2),a=i(56),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&(this.has(t,"random")||this.hasBoth(t,"start","end")||this.hasBoth(t,"min","max"))){this.start=this.has(t,"start")?t.start:t.min,this.end=this.has(t,"end")?t.end:t.max;var i=this.hasBoth(t,"min","max")||!!t.random;if(i){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}if(this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){var n=i(1),s=i(1);n=i(935),s=i(936),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=e.emitters.list,a=o.length;if(0!==a){var h=this.pipeline,l=h._tempMatrix1.copyFrom(s.matrix),u=h._tempMatrix2,c=h._tempMatrix3,d=h._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);l.multiply(d),t.setPipeline(h);var f=s.roundPixels,p=e.defaultFrame.glTexture,g=n.getTintAppendFloatAlphaAndSwap;h.setTexture2D(p,0);for(var v=0;v?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(6);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,m={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},y=0,x=0;x0&&r.maxLines1&&(d+=f*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(1),s=i(1);n=i(946),s=i(947),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){if(0!==e.width&&0!==e.height){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a/e.style.resolution,h/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r)}}},function(t,e){t.exports=function(t,e,i,n,s){0!==e.width&&0!==e.height&&t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(0),s=i(14),r=i(6),o=i(949),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this._font,this.setStyle(e,!1,!0);var i=r(e,"metrics",!1);this.metrics=i?{ascent:r(i,"ascent",0),descent:r(i,"descent",0),fontSize:r(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?r(t,a[n][0],o):s(t,a[n][0],o)}var h=r(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=r(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,n="",s="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),n=r(t,"fontSize","16px"),s=r(t,"fontStyle","");else{var o=t.split(" "),a=0;s=o.length>2?o[a++]:"",n=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&n===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=n,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e,i){var n=i(24);t.exports=function(t){var e=n.create(this),i=e.getContext("2d");t.syncFont(e,i);var s=Math.ceil(i.measureText(t.testString).width*t.baselineX),r=s,o=2*r;r=r*t.baselineY|0,e.width=s,e.height=o,i.fillStyle="#f00",i.fillRect(0,0,s,o),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,r);var a={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,s,o))return a.ascent=r,a.descent=r+6,a.fontSize=a.ascent+a.descent,n.remove(e),a;var h,l,u=i.getImageData(0,0,s,o).data,c=u.length,d=4*s,f=0,p=!1;for(h=0;hr;h--){for(l=0;l0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0){var R=o.strokeTint,L=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(R.TL=L,R.TR=L,R.BL=L,R.BR=L,E=1;E0)for(n(h,e),E=0;E0)for(n(h,e,e.altFillColor,e.altFillAlpha*c),E=0;E0){for(s(h,e,e.outlineFillColor,e.outlineFillAlpha*c),_=1;_o.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var m=o.vertexViewF32,y=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,T=0,w=e.tintFill,b=0;b0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(77);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e,i){var n=i(46);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(46);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e,i){var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(92);n.Area=i(1050),n.Circumference=i(370),n.CircumferencePoint=i(187),n.Clone=i(1051),n.Contains=i(93),n.ContainsPoint=i(1052),n.ContainsRect=i(1053),n.CopyFrom=i(1054),n.Equals=i(1055),n.GetBounds=i(1056),n.GetPoint=i(368),n.GetPoints=i(369),n.Offset=i(1057),n.OffsetPoint=i(1058),n.Random=i(152),t.exports=n},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(92);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(93);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(93);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e,i){var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(3),s=i(403);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0==(a=(o=-2*f)*o-4*(r=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new n(h,-o/(2*r))):a>0&&(i.push(new n(h,(-o+Math.sqrt(a))/(2*r))),i.push(new n(h,(-o-Math.sqrt(a))/(2*r))));else{var g=(l-d)/(u-f),v=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0==(a=(o=2*u*g-2*v*g-2*l)*o-4*(r=g*g+1)*(l*l+u*u+v*v-c*c-2*u*v))?(h=-o/(2*r),i.push(new n(h,v-h*g))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)),h=(-o-Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)))}}return i}},function(t,e,i){var n=i(196),s=i(404);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();n(r,t,i),n(o,t,i),n(a,t,i),n(h,t,i)}return i}},function(t,e,i){var n=i(10),s=i(130);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e,i){var n=i(198),s=i(130);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();n(r,e,i),n(o,e,i),n(a,e,i),n(h,e,i)}return i}},function(t,e,i){var n=i(406),s=i(198);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(r,t,i),s(o,t,i),s(a,t,i)}return i}},function(t,e,i){var n=i(196),s=i(408);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();n(r,e,i),n(o,e,i),n(a,e,i)}return i}},function(t,e,i){var n=i(411),s=i(409);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(t,r,i),s(t,o,i),s(t,a,i)}return i}},function(t,e,i){var n=i(413);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||si&&(i=h.x),h.xr&&(r=h.y),h.yn(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){var n=i(3);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){var n=i(3);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var n=i(162);t.exports=function(t,e,i){var s=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),n(t,s,r)}},function(t,e,i){var n=i(10),s=i(130);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){var n=i(3),s=i(35);t.exports=function(t,e,i){void 0===i&&(i=new n),e=s(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)-1&&(s.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),0===this._list.length||this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i=this.pollRate;if(-1===i)return!1;if(i>0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}for(var n=this.manager,s=n.pointers,r=n.pointersTotal,o=!1,a=0;a0&&(o=!0)}return o},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,n=!1,s=0;s0&&(n=!0)}return this._updatedThisFrame=!0,n},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,this.manager.resetCursor(i),t.input=null;var n=this._draggable.indexOf(t);return n>-1&&this._draggable.splice(n,1),(n=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(n,1),(n=this._over[0].indexOf(t))>-1&&this._over[0].splice(n,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=s?i=!0:n>0&&e>=t.downTime+n&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold||0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],n=0;n0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.x-a.dragStartXGlobal,c=t.y-a.dragStartYGlobal,f=o.getParentRotation(),p=u*Math.cos(f)+c*Math.sin(f),g=c*Math.cos(f)-u*Math.sin(f);s=p+a.dragStartX,r=g+a.dragStartY}else s=t.x-a.dragX,r=t.y-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,s,r),this.emit(d.DRAG,t,o,s,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var s=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e);for(var h=0;h0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,o=!1,h=!1;if(v(e)){var l=e;e=p(l,"hitArea",null),i=p(l,"hitAreaCallback",null),n=p(l,"draggable",!1),s=p(l,"dropZone",!1),r=p(l,"cursor",!1),o=p(l,"useHandCursor",!1),h=p(l,"pixelPerfect",!1);var u=p(l,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(u)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c=e}}},function(t,e,i){t.exports={Events:i(132),KeyboardManager:i(338),KeyboardPlugin:i(1171),Key:i(426),KeyCodes:i(121),KeyCombo:i(427),JustDown:i(1176),JustUp:i(1177),DownDuration:i(1178),UpDuration:i(1179)}},function(t,e){t.exports="keydown"},function(t,e){t.exports="keyup"},function(t,e){t.exports="keycombomatch"},function(t,e){t.exports="down"},function(t,e){t.exports="keydown-"},function(t,e){t.exports="keyup-"},function(t,e){t.exports="up"},function(t,e,i){var n=i(0),s=i(11),r=i(132),o=i(28),a=i(6),h=i(53),l=i(131),u=i(426),c=i(121),d=i(427),f=i(1175),p=i(90),g=new n({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.useQueue?this.sceneInputPlugin.pluginEvents.on(h.UPDATE,this.update,this):this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n={};if("string"==typeof t){t=t.split(",");for(var s=0;s-1?n[s]=t:n[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),n[t]||(n[t]=new u(this,t),e&&this.addCapture(t),n[t].setEmitOnRepeat(i)),n[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,n=this.keys;if(t instanceof u){var s=n.indexOf(t);s>-1&&(i=this.keys[s],this.keys[s]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(i=n[t],n[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},createCombo:function(t,e){return new d(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=p(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e,i){var n=i(121),s={};for(var r in n)s[n[r]]=r;t.exports=s},function(t,e){t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},function(t,e){t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.sizei&&(n=t,i=e)}),n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,n,s,r){return u(this.world,t,e,i,n,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(d.UPDATE,this.world.update,this.world),t.off(d.POST_UPDATE,this.world.postUpdate,this.world),t.off(d.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(d.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){var i={enableBody:function(t,e,i,n,s){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),s&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=i},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){var i={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=i},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){t.exports=function(t,e,i,n,s,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+n,l.maxY=i+s,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+n,bottom:i+s,isCircle:!1},d=t.intersects;u.iterate(function(t){d(t,c)&&a.push(t)})}return h.concat(a)}},function(t,e){t.exports="collide"},function(t,e){t.exports="overlap"},function(t,e){t.exports="pause"},function(t,e){t.exports="resume"},function(t,e){t.exports="tilecollide"},function(t,e){t.exports="tileoverlap"},function(t,e){t.exports="worldbounds"},function(t,e){t.exports="worldstep"},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e,i){var n=i(1232),s=i(1234),r=i(444);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,f=o.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var v=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&!t.blocked.right&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(1235);t.exports=function(t,e,i,s,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&!t.blocked.up&&c&&t.checkCollision.up?l&&t.y0&&!t.blocked.down&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(440);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e,i){var n=i(441);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){t.exports={COLLIDE:i(1343),PAUSE:i(1344),RESUME:i(1345)}},function(t,e,i){t.exports={Acceleration:i(1347),BodyScale:i(1348),BodyType:i(1349),Bounce:i(1350),CheckAgainst:i(1351),Collides:i(1352),Debug:i(1353),Friction:i(1354),Gravity:i(1355),Offset:i(1356),SetGameObject:i(1357),Velocity:i(1358)}},function(t,e,i){var n={};t.exports=n;var s=i(99),r=i(37);n.fromVertices=function(t){for(var e={},i=0;i0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,r=n.rectangle(i,s,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),u=this.tile.getCollisionGroup(),c=a(u,"objects",[]),d=[],f=0;f1&&(t.parts=d,this.setBody(s.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(1244),r=i(489),o=i(100);n.collisions=function(t,e){for(var i=[],a=e.pairs.table,h=e.metrics,l=0;l1?1:0;d1?1:0;p0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n={};t.exports=n;var s=i(84),r=i(99);n.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,f=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&f<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var p=l.axisBody,g=p===t?e:t,v=[p.axes[i.axisNumber]];if(h=n._overlapAxes(p.vertices,g.vertices,v),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlaps?s=a:a=0?o.index-1:u.length-1],l.x=s.x-c.x,l.y=s.y-c.y,h=-r.dot(i,l),a=s,s=u[(o.index+1)%u.length],l.x=s.x-c.x,l.y=s.y-c.y,(n=-r.dot(i,l))r?(s.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),r=s.topologicalSort(i),o=[],a=0;a0&&!h.silent&&s.info(o.join(" "))}else s.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=n.resolve(t)||t,e[r]=s.map(t.uses||[],function(e){n.isPlugin(e)&&n.register(e);var r=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,r.range)?(s.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(r),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(s.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),r.name});for(var o=0;o=s[2];if("^"===i.operator)return s[0]>0?o[0]===s[0]&&r.number>=i.number:s[1]>0?o[1]===s[1]&&o[2]>=s[2]:o[2]===s[2]}return t===e||"*"===t}},function(t,e,i){var n={};t.exports=n;var s=i(209),r=(i(228),i(37));n.create=function(t){var e=s.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},function(t,e,i){t.exports={BasePlugin:i(449),DefaultPlugins:i(171),PluginCache:i(18),PluginManager:i(342),ScenePlugin:i(1249)}},function(t,e,i){var n=i(449),s=i(0),r=i(19),o=new s({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){}});t.exports=o},function(t,e,i){var n=i(17),s=i(173),r={Center:i(331),Events:i(89),Orientation:i(332),ScaleManager:i(343),ScaleModes:i(333),Zoom:i(334)};r=n(!1,r=n(!1,r=n(!1,r=n(!1,r,s.CENTER),s.ORIENTATION),s.SCALE_MODE),s.ZOOM),t.exports=r},function(t,e,i){var n=i(122),s=i(17),r={Events:i(19),SceneManager:i(345),ScenePlugin:i(1252),Settings:i(348),Systems:i(176)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(22),s=i(0),r=i(19),o=i(2),a=i(18),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var s=o(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=n,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake():this.manager.start(e,o(t,"data")),this.systems.events.emit(r.TRANSITION_OUT,i,n),this.systems.events.on(r.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},function(t,e,i){t.exports={List:i(125),Map:i(157),ProcessQueue:i(442),RTree:i(443),Set:i(105),Size:i(344)}},function(t,e,i){var n=i(17),s=i(1255),r={Events:i(118),FilterMode:s,Frame:i(91),Parsers:i(351),Texture:i(177),TextureManager:i(349),TextureSource:i(350)};r=n(!1,r,s),t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){t.exports={Components:i(136),Parsers:i(1286),Formats:i(31),ImageCollection:i(460),ParseToTilemap:i(216),Tile:i(72),Tilemap:i(469),TilemapCreator:i(1295),TilemapFactory:i(1296),Tileset:i(140),LayerData:i(102),MapData:i(103),ObjectLayer:i(463),DynamicTilemapLayer:i(470),StaticTilemapLayer:i(471)}},function(t,e,i){var n=i(21),s=i(51);t.exports=function(t,e,i,r,o,a,h,l){t<0&&(t=0),e<0&&(e=0),void 0===h&&(h=!0);for(var u=n(t,e,i,r,null,l),c=o-t,d=a-e,f=0;f=0&&p=0&&g=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=y;a--)for(o=v;c[a]&&o=y;a--)for(o=m;c[a]&&o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(21),s=i(51),r=i(71);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=n(e,i,o,a,null,l),d=0;d=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;re)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(71),s=i(51),r=i(212);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,r=t.length;s0&&(t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix);var u=t.currentContext,c=e.gidMap;u.save(),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l),l.copyToContext(u)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,h.copyToContext(u));var d=n.alpha*e.alpha;u.globalAlpha=n.alpha*e.alpha;for(var f=0;f-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t-1&&(e.state=l.REMOVED,s.splice(r,1)):(e.state=l.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t>2],r+=i[(3&n[o])<<4|n[o+1]>>4],r+=i[(15&n[o+1])<<2|n[o+2]>>6],r+=i[63&n[o+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},function(t,e,i){t.exports={Clone:i(64),Extend:i(17),GetAdvancedValue:i(14),GetFastValue:i(2),GetMinMaxValue:i(1313),GetValue:i(6),HasAll:i(1314),HasAny:i(377),HasValue:i(97),IsPlainObject:i(7),Merge:i(85),MergeRight:i(1315),Pick:i(461),SetValue:i(398)}},function(t,e,i){var n=i(6),s=i(22);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=n(t,e,o);return s(a,i,r)}},function(t,e){t.exports=function(t,e){for(var i=0;i=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=h},function(t,e,i){var n=i(0),s=i(1346),r=new n({initialize:function(t,e){void 0===t&&(t=32),this.tilesize=t,this.data=Array.isArray(e)?e:[],this.width=Array.isArray(e)?e[0].length:0,this.height=Array.isArray(e)?e.length:0,this.lastSlope=55,this.tiledef=s},trace:function(t,e,i,n,s,r){var o={collision:{x:!1,y:!1,slope:!1},pos:{x:t+i,y:e+n},tile:{x:0,y:0}};if(!this.data)return o;var a=Math.ceil(Math.max(Math.abs(i),Math.abs(n))/this.tilesize);if(a>1)for(var h=i/a,l=n/a,u=0;u0?r:0,m=n<0?f:0,y=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var T=Math.floor((e+v)/f);if((l>0||u===T||T<0||T>=p)&&(T=-1),u>=0&&u1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,T,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+m,e=t.pos.x,a=0;break}}if(s){var w=s>0?o:0,b=s<0?f:0,S=Math.max(Math.floor(t.pos.x/f),0),A=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+w)/f);var _=Math.floor((i+w)/f);if((l>0||c===_||_<0||_>=g)&&(_=-1),c>=0&&c1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,_));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-w+b;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],m=i+s+(g<0?o:0)-d,y=n+r+(p>0?a:0)-f;if(p*y-g*m>0){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),T=g/x,w=-p/x,b=m*T+y*w,S=T*b,A=w*b;return S*S+A*A>=s*s+r*r?v||p*(y-r)-g*(m-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-A,t.collision.slope={x:p,y:g,nx:T,ny:w},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),s=i(1323),r=i(1324),o=i(1325),a=new n({initialize:function(t){this.world=t,this.sys=t.scene.sys},body:function(t,e,i,n){return new s(this.world,t,e,i,n)},existing:function(t){var e=t.x-t.frame.centerX,i=t.y-t.frame.centerY,n=t.width,s=t.height;return t.body=this.world.create(e,i,n,s),t.body.parent=t,t.body.gameObject=t,t},image:function(t,e,i,n){var s=new r(this.world,t,e,i,n);return this.sys.displayList.add(s),s},sprite:function(t,e,i,n){var s=new o(this.world,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),s},destroy:function(){this.world=null,this.sys=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1239),r=new n({Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){this.body=t.create(e,i,n,s),this.body.parent=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=r},function(t,e,i){var n=i(0),s=i(1239),r=i(95),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(0),s=i(1239),r=i(67),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(1320),s=i(0),r=i(446),o=i(1321),a=i(11),h=i(1238),l=i(2),u=i(97),c=i(105),d=i(1360),f=i(31),p=i(447),g=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.bodies=new c,this.gravity=l(e,"gravity",0),this.cellSize=l(e,"cellSize",64),this.collisionMap=new o,this.timeScale=l(e,"timeScale",1),this.maxStep=l(e,"maxStep",.05),this.enabled=!0,this.drawDebug=l(e,"debug",!1),this.debugGraphic;var i=l(e,"maxVelocity",100);if(this.defaults={debugShowBody:l(e,"debugShowBody",!0),debugShowVelocity:l(e,"debugShowVelocity",!0),bodyDebugColor:l(e,"debugBodyColor",16711935),velocityDebugColor:l(e,"debugVelocityColor",65280),maxVelocityX:l(e,"maxVelocityX",i),maxVelocityY:l(e,"maxVelocityY",i),minBounceVelocity:l(e,"minBounceVelocity",40),gravityFactor:l(e,"gravityFactor",1),bounciness:l(e,"bounciness",0)},this.walls={left:null,right:null,top:null,bottom:null},this.delta=0,this._lastId=0,l(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var s=l(n,"x",0),r=l(n,"y",0),h=l(n,"width",t.sys.scale.width),u=l(n,"height",t.sys.scale.height),d=l(n,"thickness",64),f=l(n,"left",!0),p=l(n,"right",!0),g=l(n,"top",!0),v=l(n,"bottom",!0);this.setBounds(s,r,h,u,d,f,p,g,v)}}this.drawDebug&&this.createDebugGraphic()},setCollisionMap:function(t,e){if("string"==typeof t){var i=this.scene.cache.tilemap.get(t);if(!i||i.format!==f.WELTMEISTER)return console.warn("The specified key does not correspond to a Weltmeister tilemap: "+t),null;for(var n,s=i.data.layer,r=0;rr.ACTIVE&&d(this,t,e))},setCollidesNever:function(t){for(var e=0;e=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function r(t,e,i){return s(t,e,i)>0}function o(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function h(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){var i=[],n=[],s=[],r=[];var o=Number.MAX_VALUE;for(var a=0;a0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;su)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;L_&&(_+=e.length),A=Number.MAX_VALUE,_3&&n>=0;--n)c(f(t,n-1),f(t,n),f(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var n=t[i],s=i-1;s>=0;--s)S(n,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,n=1;ni[e][0])&&(e=n);return!r(f(t,e-1),f(t,e),f(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var l=[],u=[];function c(t,e,i,n){if(n){var r=l,o=u;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*c))g&&(g=y),a.translate(m,{x:.5*x,y:.5*y}),c=m.bounds.max.x+r,s.addBody(u,m),l=m,f+=1}else c+=r}d+=g+o,c=t}return u},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),n&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,n,o,l,u,c)})},n.newtonsCradle=function(t,e,i,n,o){for(var a=s.create({label:"Newtons Cradle"}),l=0;lu.bounds.max.x||p.bounds.max.yu.bounds.max.y)){var g=n._getRegion(t,p);if(!p.region||g.id!==p.region.id||s){f.broadphaseTests+=1,p.region&&!s||(p.region=g);var v=n._regionUnion(g,p.region);for(o=v.startCol;o<=v.endCol;o++)for(a=v.startRow;a<=v.endRow;a++){h=c[l=n._getBucketId(o,a)];var m=o>=g.startCol&&o<=g.endCol&&a>=g.startRow&&a<=g.endRow,y=o>=p.region.startCol&&o<=p.region.endCol&&a>=p.region.startRow&&a<=p.region.endRow;!m&&y&&y&&h&&n._bucketRemoveBody(t,h,p),(p.region===g||m&&!y||s)&&(h||(h=n._createBucket(c,l)),n._bucketAddBody(t,h,p))}p.region=g,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),s=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,s,r,o)},n._getRegion=function(t,e){var i=e.bounds,s=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(s,r,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n0?n.push(i):delete t.pairs[e[s]];return n}},function(t,e,i){var n={};t.exports=n;var s=i(489),r=i(37);n._pairMaxIdleLife=1e3,n.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;an._pairMaxIdleLife&&l.push(o);for(o=0;of.friction*f.frictionStatic*F*i&&(I=R,k=o.clamp(f.friction*L*i,-I,I));var B=r.cross(A,m),Y=r.cross(_,m),N=T/(g.inverseMass+v.inverseMass+g.inverseInertia*B*B+v.inverseInertia*Y*Y);if(D*=N,k*=N,P<0&&P*P>n._restingThresh*i)b.normalImpulse=0;else{var X=b.normalImpulse;b.normalImpulse=Math.min(b.normalImpulse+D,0),D=b.normalImpulse-X}if(O*O>n._restingThreshTangent*i)b.tangentImpulse=0;else{var z=b.tangentImpulse;b.tangentImpulse=o.clamp(b.tangentImpulse+k,-I,I),k=b.tangentImpulse-z}s.x=m.x*D+y.x*k,s.y=m.y*D+y.y*k,g.isStatic||g.isSleeping||(g.positionPrev.x+=s.x*g.inverseMass,g.positionPrev.y+=s.y*g.inverseMass,g.anglePrev+=r.cross(A,s)*g.inverseInertia),v.isStatic||v.isSleeping||(v.positionPrev.x-=s.x*v.inverseMass,v.positionPrev.y-=s.y*v.inverseMass,v.anglePrev-=r.cross(_,s)*v.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var s=i(1247),r=i(448),o=i(1335),a=i(1334),h=i(1392),l=i(1333),u=i(227),c=i(209),d=i(228),f=i(37),p=i(60);n.create=function(t,e){e=f.isElement(t)?e:t,t=f.isElement(t)?t:null,e=e||{},(t||e.render)&&f.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:l}},n=f.extend(i,e);if(t||n.render){var r={element:t,controller:Render};n.render=f.extend(r,n.render)}return n.render&&n.render.controller&&(n.render=n.render.controller.create(n.render)),n.render&&(n.render.engine=n),n.world=e.world||s.create(n.world),n.pairs=a.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n.metrics=h.create(n.metrics),n},n.update=function(t,e,i){e=e||1e3/60,i=i||1;var s,l=t.world,f=t.timing,p=t.broadphase,g=[];f.timestamp+=e*f.timeScale;var v={timestamp:f.timestamp};u.trigger(t,"beforeUpdate",v);var m=c.allBodies(l),y=c.allConstraints(l);for(h.reset(t.metrics),t.enableSleeping&&r.update(m,f.timeScale),n._bodiesApplyGravity(m,l.gravity),n._bodiesUpdate(m,e,f.timeScale,i,l.bounds),d.preSolveAll(m),s=0;s0&&u.trigger(t,"collisionStart",{pairs:T.collisionStart}),o.preSolvePosition(T.list),s=0;s0&&u.trigger(t,"collisionActive",{pairs:T.collisionActive}),T.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:T.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(m),u.trigger(t,"afterUpdate",v),t},n.merge=function(t,e){if(f.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=c.allBodies(t.world),s=0;s0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_START,e,i,n)}),p.on(e,"collisionActive",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_ACTIVE,e,i,n)}),p.on(e,"collisionEnd",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_END,e,i,n)})},setBounds:function(t,e,i,n,s,r,o,a,h){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),void 0===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e-s,s,n+2*s),this.updateWall(o,"right",t+i,e-s,s,n+2*s),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?(o&&v.remove(this.localWorld,o),i+=s/2,n+=r/2,this.walls[e]=this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&v.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,s,r){var o=n.rectangle(t,e,i,s,r);return v.add(this.localWorld,o),o},add:function(t){return v.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return a.remove(this.localWorld,i,e),this},removeConstraint:function(t,e){return a.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i1?1:0;r1?1:0;s0?e-o:e+o<0?e+o:0}return n(e,-r,r)}},function(t,e){t.exports=function(t,e){if(t.standing=!1,e.collision.y&&(t.bounciness>0&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(t.vel.y>0&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(t.bounciness>0&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(t.bounciness>0){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&oi.last.x&&e.last.xi.last.y&&e.last.y0))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,e.bounciness>0&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e,i){t.exports={Factory:i(1327),Image:i(1330),Matter:i(1245),MatterPhysics:i(1394),PolyDecomp:i(1328),Sprite:i(1331),TileBody:i(1242),World:i(1337)}},function(t,e,i){var n=i(488),s=i(2),r=i(4);t.exports=function(t,e,i){void 0===i&&(i={});var o=e.x,a=e.y;if(e.body={temp:!0,position:{x:o,y:a}},[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity].forEach(function(t){for(var i in t)(n=t[i]).get&&"function"==typeof n.get||n.set&&"function"==typeof n.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var n}),e.world=t,e._tempVec2=new r(o,a),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,!0);else{var h=s(i,"shape",null);h||(h="rectangle"),e.setBody(h,i)}return e}},function(t,e){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},function(t,e){var i={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i1?1:0;n1;if(!d||t!=d.x||e!=d.y){d&&n?(f=d.x,p=d.y):(f=0,p=0);var s={x:f+t,y:p+e};!n&&d||(d=s),g.push(s),m=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":m=t.x,y=t.y;break;case"H":m=t.x;break;case"V":y=t.y}x(m,y,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i0)for(var a=s+1;ae.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y0&&(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},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}});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},function(t,e,i){var n=i(0),s=i(47),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){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n=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,i){t.exports={Alpha:i(247),Animation:i(481),BlendMode:i(250),ComputedSize:i(524),Crop:i(525),Depth:i(251),Flip:i(526),GetBounds:i(527),Mask:i(255),Origin:i(544),PathFollower:i(545),Pipeline:i(152),ScrollFactor:i(258),Size:i(546),Texture:i(547),TextureCrop:i(548),Tint:i(549),ToJSON:i(259),Transform:i(260),TransformMatrix:i(32),Visible:i(261)}},function(t,e,i){var n=i(0),s=i(259),r=i(110),o=i(10),a=i(111),h=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,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,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},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.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return s(this)},willRender:function(t){return!(h.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 i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.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),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});h.RENDER_MASK=15,t.exports=h},function(t,e,i){var n=i(166),s=i(5);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){var n=i(7),s=function(){var t,e,i,r,o,a,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=400&&t.status<=599&&(n=!1),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(){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.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){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)},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){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};t.exports=i},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===s&&(s=o.height);var a=n(r,"isNotEmpty",!1),h=n(r,"isColliding",!1),l=n(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(s+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n=i(53),s=i(14),r=i(104);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 o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"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 h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),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){var n=i(0),s=i(12),r=i(13),o=i(55),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e,i){var n={VERSION:"3.19.0",BlendModes:i(53),ScaleModes:i(104),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,i){var n=i(0),s=i(22),r=i(3),o=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}},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],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[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],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,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 o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(t.translateX=e[4],t.translateY=e[5],i||n){var a=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}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=o/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,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var n=this.matrix,s=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(s*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=s*c*e+-o*c*t+(-u*s+l*o)*c,i},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},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.decomposedMatrix=null}});t.exports=o},function(t,e,i){var n=i(0),s=i(161),r=i(273),o=i(162),a=i(274),h=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=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=i(22);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.fillColor,r=n||e.fillAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},function(t,e,i){(function(e){var i={};t.exports=i,function(){i._nextId=0,i._seed=0,i._nowStartTime=+new Date,i.extend=function(t,e){var n,s;"boolean"==typeof e?(n=2,s=e):(n=1,s=!0);for(var r=n;r0;e--){var n=Math.floor(i.random()*(e+1)),s=t[e];t[e]=t[n],t[n]=s}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===toString.call(t)},i.clamp=function(t,e,i){return ti?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return e=void 0!==e?e:0,i=void 0!==i?i:1,e+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},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){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){t.exports={DESTROY:i(606),FADE_IN_COMPLETE:i(607),FADE_IN_START:i(608),FADE_OUT_COMPLETE:i(609),FADE_OUT_START:i(610),FLASH_COMPLETE:i(611),FLASH_START:i(612),PAN_COMPLETE:i(613),PAN_START:i(614),POST_RENDER:i(615),PRE_RENDER:i(616),SHAKE_COMPLETE:i(617),SHAKE_START:i(618),ZOOM_COMPLETE:i(619),ZOOM_START:i(620)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e,i){var n=i(138),s=i(23);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;dthis.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){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},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,i){var n=i(0),s=i(17),r=i(21),o=i(8),a=i(2),h=i(5),l=i(7),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s0&&r.rotateAbout(o.position,i,t.position,o.position)}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,r.add(t.position,e))},n.rotate=function(t,e,i){if(i){var s=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*s-a*r),y:i.y+(o*r+a*s)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*n+t.force.x/t.mass*o,t.velocity.y=c*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(f.vertices,t.angularVelocity,t.position),l.rotate(f.axes,t.angularVelocity),d>0&&r.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),h.update(f.bounds,f.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i80*i){n=h=t[0],a=l=t[1];for(var T=i;Th&&(h=u),f>l&&(l=f);g=0!==(g=Math.max(h-n,l-a))?1/g:0}return o(y,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===A(t,e,i,n)>0)for(r=e;r=e;r-=n)o=b(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(S(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(S(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),S(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(m(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&m(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(m(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.prevZ,v=t.nextZ;p&&p.z>=c&&v&&v.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!y(s,r)&&x(s,n,n.next,r)&&T(s,r)&&T(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),S(n),S(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=w(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&T(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=w(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&T(t,e)&&T(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(y(t,e)&&y(i,n)||y(t,n)&&y(i,e))||m(t,e,i)>0!=m(t,e,n)>0&&m(i,n,t)>0!=m(i,n,e)>0}function T(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function w(t,e){var i=new E(t.i,t.x,t.y),n=new E(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function b(t,e,i,n){var s=new E(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function E(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){t.exports={COMPLETE:i(855),DECODED:i(856),DECODED_ALL:i(857),DESTROY:i(858),DETUNE:i(859),GLOBAL_DETUNE:i(860),GLOBAL_MUTE:i(861),GLOBAL_RATE:i(862),GLOBAL_VOLUME:i(863),LOOP:i(864),LOOPED:i(865),MUTE:i(866),PAUSE_ALL:i(867),PAUSE:i(868),PLAY:i(869),RATE:i(870),RESUME_ALL:i(871),RESUME:i(872),SEEK:i(873),STOP_ALL:i(874),STOP:i(875),UNLOCKED:i(876),VOLUME:i(877)}},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||e>s||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(930),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,o){r.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s.Animation(this),this.setTexture(n,o),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e,i){return this.anims.play(t,e,i),this},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=a},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},function(t,e,i){var n=i(0),s=i(17),r=i(21),o=i(8),a=i(2),h=i(7),l=new n({Extends:r,initialize:function t(e,i,n,s,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),n=a(c,"url"),l=a(c,"normalMap"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(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:o};if(r.call(this,e,d),l){var f=new t(e,this.key,l,s,o);f.type="normalMap",this.setLink(f),e.addFile(f)}},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")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;nthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight,this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e,i){var n=i(0),s=i(46),r=i(244),o=i(245),a=i(47),h=i(146),l=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;si&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){t.exports={ADD:i(834),COMPLETE:i(835),FILE_COMPLETE:i(836),FILE_KEY_COMPLETE:i(837),FILE_LOAD_ERROR:i(838),FILE_LOAD:i(839),FILE_PROGRESS:i(840),POST_PROCESS:i(841),PROGRESS:i(842),START:i(843)}},function(t,e,i){var n=i(164),s=i(178);t.exports=function(t,e){var i=n.Power0;if("string"==typeof t)if(n.hasOwnProperty(t))i=n[t];else{var r="";t.indexOf(".")&&("in"===(r=t.substr(t.indexOf(".")+1)).toLowerCase()?r="easeIn":"out"===r.toLowerCase()?r="easeOut":"inout"===r.toLowerCase()&&(r="easeInOut")),t=s(t.substr(0,t.indexOf(".")+1)+r),n.hasOwnProperty(t)&&(i=n[t])}else"function"==typeof t?i=t:Array.isArray(t)&&t.length;if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(u-h)*(r-l)-(c-l)*(s-h),f=(o-s)*(r-l)-(a-r)*(s-h),p=(c-l)*(o-s)-(u-h)*(a-r);if(0===p)return!1;var g=d/p,v=f/p;return g>=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(t,e,i){var n={};t.exports=n;var s=i(99),r=i(37);n.create=function(t,e){for(var i=[],n=0;n0)return!1}return!0},n.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||n.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},n.hull=function(t){var e,i,n=[],r=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),r.pop(),n.concat(r)}},function(t,e,i){var n=i(24);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e,i){t.exports={ENTER_FULLSCREEN:i(659),FULLSCREEN_FAILED:i(660),FULLSCREEN_UNSUPPORTED:i(661),LEAVE_FULLSCREEN:i(662),ORIENTATION_CHANGE:i(663),RESIZE:i(664)}},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,i){var n=i(0),s=i(24),r=i(15),o=new n({initialize:function(t,e,i,n,s,r,o){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,o,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 o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.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,o,a){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)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),m=r=s(r,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(n=s(n,0,u-e)),w=i+(r=s(r,0,c-i));if(!(x.rT||x.y>w)){var b=Math.max(x.x,e),S=Math.max(x.y,i),E=Math.min(x.r,T)-b,A=Math.min(x.b,w)-S;v=E,m=A,p=o?h+(u-(b-x.x)-E):h+(b-x.x),g=a?l+(c-(S-x.y)-A):l+(S-x.y),e=b,i=S,n=E,r=A}else p=0,g=0,v=0,m=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var _=this.source.width,C=this.source.height;return t.u0=Math.max(0,p/_),t.v0=Math.max(0,g/C),t.u1=Math.min(1,(p+v)/_),t.v1=Math.min(1,(g+m)/C),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=m,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},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,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,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 o(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=o},function(t,e,i){var n=i(0),s=i(94),r=i(371),o=i(372),a=i(47),h=i(153),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.ELLIPSE,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 o(this,t,e,i)},getRandomPoint:function(t){return h(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.width=0,this.height=0,this},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},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var n=i(232),s=i(0),r=i(111),o=i(2),a=i(5),h=i(7),l=i(365),u=i(106),c=i(68),d=new s({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?h(e[0])&&(i=e,e=null):h(e)&&(i=e,e=null),this.scene=t,this.children=new u(e),this.isParent=!0,this.classType=o(i,"classType",c),this.name=o(i,"name",""),this.active=o(i,"active",!0),this.maxSize=o(i,"maxSize",-1),this.defaultKey=o(i,"defaultKey",null),this.defaultFrame=o(i,"defaultFrame",null),this.runChildUpdate=o(i,"runChildUpdate",!1),this.createCallback=o(i,"createCallback",null),this.removeCallback=o(i,"removeCallback",null),this.createMultipleCallback=o(i,"createMultipleCallback",null),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;it.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return t0;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){var n=i(0),s=i(12),r=i(35),o=i(10),a=i(49),h=i(11),l=i(32),u=i(160),c=i(3),d=new n({Extends:o,Mixins:[s.Alpha,s.Visible],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),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;gC&&wA&&b<_&&f.push(v)}else f.push(v)}return f},getWorldPoint:function(t,e,i){void 0===i&&(i=new c);var n=this.matrix.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5],u=s*a-r*o;if(!u)return i.x=t,i.y=e,i;var d=a*(u=1/u),f=-r*u,p=-o*u,g=s*u,v=(o*l-a*h)*u,m=(r*h-s*l)*u,y=Math.cos(this.rotation),x=Math.sin(this.rotation),T=this.zoom,w=this.resolution,b=this.scrollX,S=this.scrollY,E=t+(b*y-S*x)*T,A=e+(b*x+S*y)*T;return i.x=(E*d+A*p)*w+v,i.y=(E*f+A*g)*w+m,i},ignore:function(t){var e=this.id;Array.isArray(t)||(t=[t]);for(var i=0;is&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras;var i=this.scaleManager.resolution;return this.resolution=i,this._cx=this._x*i,this._cy=this._y*i,this._cw=this._width*i,this._ch=this._height*i,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=d},function(t,e){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;i0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){t.exports={ADD:i(732),ERROR:i(733),LOAD:i(734),READY:i(735),REMOVE:i(736)}},function(t,e){t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement)return t;return i||(i=document.body),i.appendChild(t),t}},function(t,e,i){var n=i(79);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 o=e.length-1;o>=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e,i){var n=i(0),s=i(65),r=i(10),o=i(66),a=i(18),h=i(1),l=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on(a.FOCUS,function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once(o.COMPLETE,n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(o.STOP_ALL,this)},unlock:h,onBlur:h,onFocus:h,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=l},function(t,e,i){var n=i(0),s=i(10),r=i(66),o=i(15),a=i(1),h=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},function(t,e,i){var n=i(180),s=i(0),r=i(1),o=i(128),a=new s({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?n.Add(this.list,t):n.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?n.AddAt(this.list,t,e):n.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o.inplace(this.list,e),this):this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return n.GetFirst(this.list,t,e,i,s)},getAll:function(t,e,i,s){return n.GetAll(this.list,t,e,i,s)},count:function(t,e){return n.CountAllMatching(this.list,t,e)},swap:function(t,e){n.Swap(this.list,t,e)},moveTo:function(t,e){return n.MoveTo(this.list,t,e)},remove:function(t,e){return e?n.Remove(this.list,t):n.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?n.RemoveAt(this.list,t):n.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?n.RemoveBetween(this.list,t,e):n.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return n.BringToTop(this.list,t)},sendToBack:function(t){return n.SendToBack(this.list,t)},moveUp:function(t){return n.MoveUp(this.list,t),t},moveDown:function(t){return n.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e){return n.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?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}}});t.exports=a},function(t,e,i){var n=i(181),s=i(363);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;il&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a0&&o.length0&&a.lengthe.right||t.y>e.bottom)}},function(t,e,i){var n=i(5),s={},r={register:function(t,e,i,n,r){s[t]={plugin:e,mapping:i,settingsKey:n,configKey:r}},getPlugin:function(t){return s[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in s){var a=s[o].plugin,h=s[o].mapping,l=s[o].settingsKey,u=s[o].configKey;n(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){s.hasOwnProperty(t)&&delete s[t]}};t.exports=r},function(t,e,i){t.exports={ANY_KEY_DOWN:i(1168),ANY_KEY_UP:i(1169),COMBO_MATCH:i(1170),DOWN:i(1171),KEY_DOWN:i(1172),KEY_UP:i(1173),UP:i(1174)}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),{responseType:t,async:e,user:i,password:n,timeout:s,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e,i){var n=i(0),s=i(209),r=i(68),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e,i){var n={};t.exports=n;var s=i(86),r=i(37),o=i(61),a=i(100),h=i(99),l=i(1340);n.rectangle=function(t,e,i,n,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(a.chamfer){var l=a.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},n.trapezoid=function(t,e,i,n,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-n+" L "+c+" "+-n+" L "+d+" 0":"L 0 0 L "+c+" "+-n+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return o.create(r.extend({},f,h))},n.circle=function(t,e,i,s,o){s=s||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),n.polygon(t,e,h,i,r.extend({},a,s))},n.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return n.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&s.area(E)1?(f=o.create(r.extend({parts:p.slice(0)},n)),o.setPosition(f,{x:t,y:e}),f):p[0]}},function(t,e,i){t.exports={CalculateFacesAt:i(212),CalculateFacesWithin:i(52),Copy:i(1261),CreateFromTiles:i(1262),CullTiles:i(1263),Fill:i(1264),FilterTiles:i(1265),FindByIndex:i(1266),FindTile:i(1267),ForEachTile:i(1268),GetTileAt:i(138),GetTileAtWorldXY:i(1269),GetTilesWithin:i(23),GetTilesWithinShape:i(1270),GetTilesWithinWorldXY:i(1271),HasTileAt:i(454),HasTileAtWorldXY:i(1272),IsInLayerBounds:i(101),PutTileAt:i(213),PutTileAtWorldXY:i(1273),PutTilesAt:i(1274),Randomize:i(1275),RemoveTileAt:i(455),RemoveTileAtWorldXY:i(1276),RenderDebug:i(1277),ReplaceByIndex:i(453),SetCollision:i(1278),SetCollisionBetween:i(1279),SetCollisionByExclusion:i(1280),SetCollisionByProperty:i(1281),SetCollisionFromCollisionGroup:i(1282),SetTileIndexCallback:i(1283),SetTileLocationCallback:i(1284),Shuffle:i(1285),SwapByIndex:i(1286),TileToWorldX:i(139),TileToWorldXY:i(1287),TileToWorldY:i(140),WeightedRandomize:i(1288),WorldToTileX:i(62),WorldToTileXY:i(1289),WorldToTileY:i(63)}},function(t,e,i){var n=i(101);t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),n(t,e,s)){var r=s.data[e][t]||null;return null===r?null:-1===r.index?i?r:null:r}return null}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.x+e.scrollX*(1-s.scrollFactorX),n*=s.scaleX),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.y+e.scrollY*(1-s.scrollFactorY),n*=s.scaleY),r+t*n}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o,a){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o={}),void 0===a&&(a={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=n,this.tileMargin=s,this.tileSpacing=r,this.tileProperties=o,this.tileData=a,this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(24),s=i(0),r=i(10),o=i(108),a=i(248),h=i(249),l=i(5),u=new s({Extends:r,initialize:function(t,e,i){r.call(this),this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,l(i,"frames",[]),l(i,"defaultTextureKey",null)),this.frameRate=l(i,"frameRate",null),this.duration=l(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=l(i,"skipMissedFrames",!0),this.delay=l(i,"delay",0),this.repeat=l(i,"repeat",0),this.repeatDelay=l(i,"repeatDelay",0),this.yoyo=l(i,"yoyo",!1),this.showOnStart=l(i,"showOnStart",!1),this.hideOnComplete=l(i,"hideOnComplete",!1),this.paused=!1,this.manager.on(o.PAUSE_ALL,this.pause,this),this.manager.on(o.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=a[0],a[0].prevFrame=s;var v=1/(a.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),a(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);if(t._repeatDelay>0&&!1===t.pendingRepeat)t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay;else if(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying){this.getNextTick(t),t.pendingRepeat=!1;var e=t.currentFrame,i=t.parent;this.emit(o.ANIMATION_REPEAT,this,e),i.emit(o.SPRITE_ANIMATION_KEY_REPEAT+this.key,this,e,t.repeatCounter,i),i.emit(o.SPRITE_ANIMATION_REPEAT,this,e,t.repeatCounter,i)}},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),n=0;n1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[n-1],t.nextFrame=this.frames[n+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.removeAllListeners(),this.manager.off(o.PAUSE_ALL,this.pause,this),this.manager.off(o.RESUME_ALL,this.resume,this),this.manager.remove(this.key);for(var t=0;t=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,i){var n=i(56),s=i(4);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},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){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){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=(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,i){var n=i(272),s=i(275),r=i(277),o=i(278);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var n=i(161);t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1);var r=Math.floor(6*t),o=6*t-r,a=Math.floor(i*(1-e)*255),h=Math.floor(i*(1-o*e)*255),l=Math.floor(i*(1-(1-o)*e)*255),u=i=Math.floor(i*=255),c=i,d=i,f=r%6;return 0===f?(c=l,d=a):1===f?(u=h,d=a):2===f?(u=a,d=l):3===f?(u=a,c=h):4===f?(u=l,c=a):5===f&&(c=a,d=h),s?s.setTo?s.setTo(u,c,d,s.alpha,!1):(s.r=u,s.g=c,s.b=d,s.color=n(u,c,d),s):{r:u,g:c,b:d,color:n(u,c,d)}}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var n=i(280),s=i(281),r=i(282),o=i(283),a=i(284),h=i(285),l=i(286),u=i(287),c=i(288),d=i(289),f=i(290),p=i(291);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:n.Out,Bounce:s.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":n.In,"Bounce.easeIn":s.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":n.Out,"Bounce.easeOut":s.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":s.InOut}},function(t,e,i){var n=i(116),s=i(117),r=i(25),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.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").createImageData(1,1);return a=n.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.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,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(o.getUserMedia=!1),!n.iOS&&(s.ie||s.firefox||s.chrome)&&(o.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.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)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},function(t,e,i){var n=i(22),s=i(15),r={Angle:i(690),Distance:i(698),Easing:i(700),Fuzzy:i(701),Interpolation:i(704),Pow2:i(709),Snap:i(711),RandomDataGenerator:i(713),Average:i(714),Bernstein:i(300),Between:i(169),CatmullRom:i(168),CeilTo:i(715),Clamp:i(24),DegToRad:i(35),Difference:i(716),Factorial:i(301),FloatBetween:i(307),FloorTo:i(717),FromPercent:i(87),GetSpeed:i(718),IsEven:i(719),IsEvenStrict:i(720),Linear:i(115),MaxAdd:i(721),MinSub:i(722),Percent:i(723),RadToDeg:i(170),RandomXY:i(724),RandomXYZ:i(725),RandomXYZW:i(726),Rotate:i(308),RotateAround:i(254),RotateAroundDistance:i(155),RoundAwayFromZero:i(309),RoundTo:i(727),SinCosTableGenerator:i(728),SmootherStep:i(156),SmoothStep:i(157),ToXY:i(729),TransformXY:i(310),Within:i(730),Wrap:i(57),Vector2:i(3),Vector3:i(171),Vector4:i(311),Matrix3:i(312),Matrix4:i(313),Quaternion:i(314),RotateVec3:i(731)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)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,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,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},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],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=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=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],m=s[12],y=s[13],x=s[14],T=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+m)*T,this.y=(e*o+i*u+n*p+y)*T,this.z=(e*a+i*c+n*g+x)*T,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/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){t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},function(t,e,i){var n=i(11);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,r,o=Number.MAX_VALUE,a=Number.MAX_VALUE,h=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,u=0;u0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit(o.START,this),this.events.emit(o.READY,this,t)},shutdown:function(t){this.events.off(o.TRANSITION_INIT),this.events.off(o.TRANSITION_START),this.events.off(o.TRANSITION_COMPLETE),this.events.off(o.TRANSITION_OUT),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.SHUTDOWN,this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.DESTROY,this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e,i){var n=i(180),s=i(53),r=i(0),o=i(12),a=i(111),h=i(13),l=i(11),u=i(917),c=i(367),d=i(3),f=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Transform,o.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 o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,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.list.length>0)for(var e=this.list,i=new l,n=0;n-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=[],this._displayList=null}});t.exports=f},function(t,e,i){var n=i(129),s=i(0),r=i(922),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(113),s=i(0),r=i(188),o=i(247),a=i(250),h=i(251),l=i(255),u=i(152),c=i(260),d=i(261),f=i(258),p=i(32),g=i(93),v=i(13),m=i(2),y=i(5),x=i(22),T=i(928),w=new s({Extends:v,Mixins:[o,a,h,l,u,c,d,f,T],initialize:function(t,e){var i=y(e,"x",0),n=y(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this.setDefaultStyles(e)},setDefaultStyles:function(t){return y(t,"lineStyle",null)&&(this.defaultStrokeWidth=y(t,"lineStyle.width",1),this.defaultStrokeColor=y(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=y(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),y(t,"fillStyle",null)&&(this.defaultFillColor=y(t,"fillStyle.color",16777215),this.defaultFillAlpha=y(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,s){return void 0===s&&(s=1),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,s,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,s,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,n,s),this},setTexture:function(t,e,i){if(void 0===i&&(i=0),void 0===t)this.commandBuffer.push(r.CLEAR_TEXTURE);else{var n=this.scene.sys.textures.getFrame(t,e);n&&(2===i&&(i=3),this.commandBuffer.push(r.SET_TEXTURE,n,i))}return this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(r.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var s=this._lineWidth/2,r=t-s,o=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+n),this.lineTo(o+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,n,s,o),this},strokeTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,n,s,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,SET_TEXTURE:19,CLEAR_TEXTURE:20,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.width/2,r=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(375),a=i(126),h=i(377),l=i(938),u=new n({Extends:r,Mixins:[s.Depth,s.Mask,s.Pipeline,s.Transform,s.Visible,l],initialize:function(t,e,i,n){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var s=0;s0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;ss.width&&(t=s.width-this.frame.cutX),this.frame.cutY+e>s.height&&(e=s.height-this.frame.cutY),this.frame.setSize(t,e,this.frame.cutX,this.frame.cutY)}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.frame.cutWidth),void 0===r&&(r=this.frame.cutHeight);var o=255&(t>>16|0),a=255&(t>>8|0),h=255&(0|t),l=this.gl,u=this.frame;if(l){var c=this.renderer,f=this.getBounds();c.setFramebuffer(this.framebuffer,!0),s===u.source.width&&r===u.source.height||l.scissor(i+u.cutX,n+u.cutY,s,r),this.pipeline.drawFillRect(f.x,f.y,f.right,f.bottom,d.getTintFromFloats(o/255,a/255,h/255,1),e),s===u.source.width&&r===u.source.height||l.scissor(0,0,u.source.width,u.source.height),this.renderer.setFramebuffer(null,!0)}else this.context.fillStyle="rgba("+o+","+a+","+h+","+e+")",this.context.fillRect(i+u.cutX,n+u.cutY,s,r);return this},clear:function(){if(this.dirty){var t=this.gl;if(t){var e=this.renderer;e.setFramebuffer(this.framebuffer,!0),this.frame.cutWidth===this.canvas.width&&this.frame.cutHeight===this.canvas.height||t.scissor(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),e.setFramebuffer(null,!0)}else{var i=this.context;i.save(),i.setTransform(1,0,0,1,0,0),i.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),i.restore()}this.dirty=!1}return this},erase:function(t,e,i){this._eraseMode=!0;var s=this.renderer.currentBlendMode;return this.renderer.setBlendMode(n.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(s),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1),r){var o=this.camera._cx,a=this.camera._cy,h=this.camera._cw,l=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(o,a,h,l,l);var u=this.pipeline;u.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),this.batchList(t,e,i,n,s),u.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),u.projOrtho(0,u.width,u.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1),o){var h=this.camera._cx,l=this.camera._cy,u=this.camera._cw,c=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(h,l,u,c,c);var d=this.pipeline;d.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),d.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,r,s,this.camera.matrix,null),d.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),d.projOrtho(0,d.width,d.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;rl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=y+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=l,n+=a[h],h0&&(d+=h.lineSpacing*g),i.rtl)c=f-c;else if("right"===i.align)c+=o-h.lineWidths[g];else if("center"===i.align)c+=(o-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var v=h.width-h.lineWidths[g],m=e.measureText(" ").width,y=a[g].trim(),x=y.split(" ");v+=(a[g].length-y.length)*m;for(var T=Math.floor(v/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[g]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[g],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[g],c,d))}e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var b=this.input;return b&&!b.customHitArea&&(b.hitArea.width=this.width,b.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(25),s=i(0),r=i(12),o=i(18),a=i(13),h=i(305),l=i(114),u=i(954),c=i(3),d=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,s,r,l,u){var d=t.sys.game.renderer;a.call(this,t,"TileSprite");var f=t.sys.textures.get(l),p=f.get(u);s&&r?(s=Math.floor(s),r=Math.floor(r)):(s=p.width,r=p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=n.create(this,s,r),this.context=this.canvas.getContext("2d"),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(p.width),this.potHeight=h(p.height),this.fillCanvas=n.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(s,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(o.CONTEXT_RESTORED,function(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)},this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){return this.displayFrame=this.displayTexture.get(t),this.displayFrame.cutWidth&&this.displayFrame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame,e=this.fillContext,i=this.fillCanvas,n=this.potWidth,s=this.potHeight;this.renderer.gl||(n=t.cutWidth,s=t.cutHeight),e.clearRect(0,0,n,s),i.width=n,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,s),this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,n=this._tileScale.y,s=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,n),e.translate(-s,-r),e.fillStyle=this.fillPattern,e.fillRect(s,r,this.width/i,this.height/n),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),n.remove(this.canvas),n.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},function(t,e,i){var n=i(0),s=i(195),r=i(393),o=i(47),a=new n({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return s(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n=0&&w<=1&&i.push(new n(r,o))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);r=a+b*p,o=h+b*g,b>=0&&b<=1&&i.push(new n(r,o));var S=(-x+Math.sqrt(T))/(2*y);r=a+S*p,o=h+S*g,S>=0&&S<=1&&i.push(new n(r,o))}}return i}},function(t,e,i){var n=i(46),s=new(i(4));t.exports=function(t,e,i){if(void 0===i&&(i=s),n(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(n(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){var n=i(4),s=i(84),r=i(408);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new n,new n,new n,new n],c=[s(o,t,u[0]),s(a,t,u[1]),s(h,t,u[2]),s(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var s,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,m=p*v-g*g,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&s+r<1&&(n.push({x:e[w].x,y:e[w].y}),i)));w++);return n}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,t}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,o=t.x3-e,a=t.y3-i,t.x3=o*s-a*r+e,t.y3=o*r+a*s+i,t}},function(t,e,i){t.exports={BUTTON_DOWN:i(1154),BUTTON_UP:i(1155),CONNECTED:i(1156),DISCONNECTED:i(1157),GAMEPAD_BUTTON_DOWN:i(1158),GAMEPAD_BUTTON_UP:i(1159)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,i){var n=i(15),s=i(134);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,i){var n=i(0),s=i(17),r=i(21),o=i(8),a=i(2),h=i(7),l=i(339),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n0&&(s.totalDuration+=s.t2*s.repeat),s.totalDuration>t&&(t=s.totalDuration),s.delay0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay,this.startDelay=e},init:function(){if(this.paused&&!this.parentIsTimeline)return this.state=h.PENDING_ADD,this._pausedState=h.INIT,!1;for(var t=this.data,e=this.totalTargets,i=0;i0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=h.LOOP_DELAY):(this.state=h.ACTIVE,this.dispatchTweenEvent(r.TWEEN_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=h.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(r.TWEEN_COMPLETE,this.callbacks.onComplete))},pause:function(){return this.state===h.PAUSED?this:(this.paused=!0,this._pausedState=this.state,this.state=h.PAUSED,this)},play:function(t){void 0===t&&(t=!1);var e=this.state;return e!==h.INIT||this.parentIsTimeline?e===h.ACTIVE||e===h.PENDING_ADD&&this._pausedState===h.PENDING_ADD?this:this.parentIsTimeline||e!==h.PENDING_REMOVE&&e!==h.REMOVED?(this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?this.state=h.ACTIVE:(this.countdown=this.calculatedOffset,this.state=h.OFFSET_DELAY)):this.paused?(this.paused=!1,this.makeActive()):(this.resetTweenData(t),this.state=h.ACTIVE,this.makeActive()),this):(this.seek(0),this.parent.makeActive(this),this):(this.resetTweenData(!1),this.state=h.ACTIVE,this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,n=this.totalTargets,s=0;s0&&(r.elapsed=r.delay,r.state=h.DELAY),r.getActiveValue&&(o[a]=r.getActiveValue(r.target,r.key,r.start))}},resume:function(){return this.state===h.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t,e){if(void 0===e&&(e=16.6),this.totalDuration>=36e5)return console.warn("Tween.seek duration too long"),this;this.state===h.REMOVED&&this.makeActive(),this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0;for(var i=this.data,n=this.totalTargets,s=0;s0&&(r.elapsed=r.delay,r.state=h.DELAY)}this.calcDuration();var c=!1;this.state===h.PAUSED&&(c=!0,this.state=h.ACTIVE),this.isSeeking=!0;do{this.update(0,e)}while(this.totalProgress0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},setStateFromStart:function(t,e,i){return e.repeatCounter>0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},updateTweenData:function(t,e,i){var n=e.target;switch(e.state){case h.PLAYING_FORWARD:case h.PLAYING_BACKWARD:if(!n){e.state=h.COMPLETE;break}var s=e.elapsed,o=e.duration,a=0;(s+=i)>o&&(a=s-o,s=o);var l=e.state===h.PLAYING_FORWARD,u=s/o;if(e.elapsed=s,e.progress=u,1===u)l?(e.current=e.end,n[e.key]=e.end,e.hold>0?(e.elapsed=e.hold-a,e.state=h.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,a)):(e.current=e.start,n[e.key]=e.start,e.state=this.setStateFromStart(t,e,a));else{var c=l?e.ease(u):e.ease(1-u);e.current=e.start+(e.end-e.start)*c,n[e.key]=e.current}this.dispatchTweenDataEvent(r.TWEEN_UPDATE,t.callbacks.onUpdate,e);break;case h.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PENDING_RENDER);break;case h.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PLAYING_FORWARD,this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e));break;case h.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case h.PENDING_RENDER:n?(e.start=e.getStartValue(n,e.key,n[e.key],e.index,t.totalTargets,t),e.end=e.getEndValue(n,e.key,e.start,e.index,t.totalTargets,t),e.current=e.start,n[e.key]=e.start,e.state=h.PLAYING_FORWARD):e.state=h.COMPLETE}return e.state!==h.COMPLETE}});l.TYPES=["onActive","onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],a.register("tween",function(t){return this.scene.sys.tweens.add(t)}),o.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=l},function(t,e,i){t.exports={TIMELINE_COMPLETE:i(1306),TIMELINE_LOOP:i(1307),TIMELINE_PAUSE:i(1308),TIMELINE_RESUME:i(1309),TIMELINE_START:i(1310),TIMELINE_UPDATE:i(1311),TWEEN_ACTIVE:i(1312),TWEEN_COMPLETE:i(1313),TWEEN_LOOP:i(1314),TWEEN_REPEAT:i(1315),TWEEN_START:i(1316),TWEEN_UPDATE:i(1317),TWEEN_YOYO:i(1318)}},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p){return{target:t,index:e,key:i,getActiveValue:r,getEndValue:n,getStartValue:s,ease:o,duration:0,totalDuration:0,delay:0,yoyo:l,hold:0,repeat:0,repeatDelay:0,flipX:f,flipY:p,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:a,duration:h,hold:u,repeat:c,repeatDelay:d},state:0}}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(57);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){var n=i(57);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(0),s=i(9),r=new n({initialize:function(t){this.name="WebGLPipeline",this.game=t.game,this.view=t.game.canvas,this.resolution=1,this.width=0,this.height=0,this.gl=t.gl,this.vertexCount=0,this.vertexCapacity=t.vertexCapacity,this.renderer=t.renderer,this.vertexData=t.vertices?t.vertices:new ArrayBuffer(t.vertexCapacity*t.vertexSize),this.vertexBuffer=this.renderer.createVertexBuffer(t.vertices?t.vertices:this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=this.renderer.createProgram(t.vertShader,t.fragShader),this.attributes=t.attributes,this.vertexSize=t.vertexSize,this.topology=t.topology,this.bytes=new Uint8Array(this.vertexData),this.vertexComponentCount=s.getComponentCount(t.attributes,this.gl),this.flushLocked=!1,this.active=!1},boot:function(){},addAttribute:function(t,e,i,n,s){return this.attributes.push({name:t,size:e,type:this.renderer.glFormats[i],normalized:n,offset:s}),this},shouldFlush:function(){return this.vertexCount>=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this.resolution=i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):-1!==h&&t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(0),s=i(64),r=i(2),o=i(489),a=i(740),h=i(741),l=i(32),u=i(9),c=i(228),d=new n({Extends:c,Mixins:[o],initialize:function(t){var e=t.renderer.config;c.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:r(t,"topology",t.renderer.gl.TRIANGLES),vertShader:r(t,"vertShader",h),fragShader:r(t,"fragShader",a),vertexCapacity:r(t,"vertexCapacity",6*e.batchSize),vertexSize:r(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this.batches=[],this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return c.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return c.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){return void 0===t&&(t=this.renderer.blankTexture.glTexture),void 0===e&&(e=0),this.requireTextureBatch(t,e)&&this.pushBatch(t,e),this},requireTextureBatch:function(t,e){var i=this.batches,n=i.length;return!(n>0)||!((e>0?i[n-1].textures[e-1]:i[n-1].texture)===t)},pushBatch:function(t,e){if(0===e)this.batches.push({first:this.vertexCount,texture:t,textures:[]});else{var i=[];i[e-1]=t,this.batches.push({first:this.vertexCount,texture:null,textures:i})}},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,n=this.gl,s=this.vertexCount,r=this.topology,o=this.vertexSize,a=this.renderer,h=this.batches,l=h.length,u=0,c=null;if(0===l||0===s)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,s*o));for(var d=0;d0){for(e=0;e0){for(e=0;e0&&(a.setTexture2D(c.texture,0,!1),n.drawArrays(r,c.first,u)),this.vertexCount=0,h.length=0,this.flushLocked=!1,this},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,l=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.cutWidth,v=o.cutHeight,m=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+f,w=-x+p;if(t.isCropped){var b=t._crop;b.flipX===t.flipX&&b.flipY===t.flipY||o.updateCropUVs(b,t.flipX,t.flipY),h=b.u0,l=b.v0,c=b.u1,d=b.v1,g=b.width,v=b.height,T=-y+(f=b.x),w=-x+(p=b.y)}var S=1,E=1;t.flipX&&(m||(T+=-o.realWidth+2*y),S=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(m||(w+=-o.realHeight+2*x),E=-1),s.applyITRS(t.x,t.y,t.rotation,t.scaleX*S,t.scaleY*E),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),s.e=t.x,s.f=t.y,n.multiply(s,r)):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY,n.multiply(s,r));var A=T+g,_=w+v,C=r.getX(T,w),M=r.getY(T,w),P=r.getX(T,_),O=r.getY(T,_),R=r.getX(A,_),L=r.getY(A,_),D=r.getX(A,w),F=r.getY(A,w),k=u.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),I=u.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),B=u.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),N=u.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(C=Math.round(C),M=Math.round(M),P=Math.round(P),O=Math.round(O),R=Math.round(R),L=Math.round(L),D=Math.round(D),F=Math.round(F)),this.setTexture2D(a,0);var Y=t._isTinted&&t.tintFill;this.batchQuad(C,M,P,O,R,L,D,F,h,l,c,d,k,I,B,N,Y,a,0)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y){var x=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),x=!0,this.setTexture2D(m,y));var T=this.vertexViewF32,w=this.vertexViewU32,b=this.vertexCount*this.vertexComponentCount-1;return T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=i,T[++b]=n,T[++b]=h,T[++b]=c,T[++b]=v,w[++b]=p,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=o,T[++b]=a,T[++b]=u,T[++b]=l,T[++b]=v,w[++b]=f,this.vertexCount+=6,x},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g){var v=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),this.setTexture2D(p,g),v=!0);var m=this.vertexViewF32,y=this.vertexViewU32,x=this.vertexCount*this.vertexComponentCount-1;return m[++x]=t,m[++x]=e,m[++x]=o,m[++x]=a,m[++x]=f,y[++x]=u,m[++x]=i,m[++x]=n,m[++x]=o,m[++x]=l,m[++x]=f,y[++x]=c,m[++x]=s,m[++x]=r,m[++x]=h,m[++x]=l,m[++x]=f,y[++x]=d,this.vertexCount+=3,v},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,S,E,A,_,C,M,P,O){this.renderer.setPipeline(this,t);var R=this._tempMatrix1,L=this._tempMatrix2,D=this._tempMatrix3,F=m/i+_,k=y/n+C,I=(m+x)/i+_,B=(y+T)/n+C,N=o,Y=a,X=-g,z=-v;if(t.isCropped){var U=t._crop;N=U.width,Y=U.height,o=U.width,a=U.height;var G=m=U.x,W=y=U.y;c&&(G=x-U.x-U.width),d&&!e.isRenderTexture&&(W=T-U.y-U.height),F=G/i+_,k=W/n+C,I=(G+U.width)/i+_,B=(W+U.height)/n+C,X=-g+m,z=-v+y}d^=!O&&e.isRenderTexture?1:0,c&&(N*=-1,X+=o),d&&(Y*=-1,z+=a);var V=X+N,H=z+Y;L.applyITRS(s,r,u,h,l),R.copyFrom(M.matrix),P?(R.multiplyWithOffset(P,-M.scrollX*f,-M.scrollY*p),L.e=s,L.f=r,R.multiply(L,D)):(L.e-=M.scrollX*f,L.f-=M.scrollY*p,R.multiply(L,D));var j=D.getX(X,z),q=D.getY(X,z),K=D.getX(X,H),J=D.getY(X,H),Z=D.getX(V,H),Q=D.getY(V,H),$=D.getX(V,z),tt=D.getY(V,z);M.roundPixels&&(j=Math.round(j),q=Math.round(q),K=Math.round(K),J=Math.round(J),Z=Math.round(Z),Q=Math.round(Q),$=Math.round($),tt=Math.round(tt)),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,F,k,I,B,w,b,S,E,A,e,0)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),m=h.getY(l,c),y=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,m,y,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n;this.setTexture2D();var h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),m=this.currentFrame,y=m.u0,x=m.v0,T=m.u1,w=m.v1;this.batchQuad(l,u,c,d,f,p,g,v,y,x,T,w,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,m=g.v0,y=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,m,y,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&H[4]?this.batchQuad(D,F,P,O,H[0],H[1],H[2],H[3],U,G,W,V,B,N,Y,X,I):(j[0]=D,j[1]=F,j[2]=P,j[3]=O,j[4]=1),h&&j[4]?this.batchQuad(C,M,R,L,j[0],j[1],j[2],j[3],U,G,W,V,B,N,Y,X,I):(H[0]=C,H[1]=M,H[2]=R,H[3]=L,H[4]=1)}}});t.exports=d},function(t,e,i){var n={};t.exports=n;var s=i(37);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r0){i||(i={}),n=e.split(" ");for(var l=0;l0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(s.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}}},function(t,e,i){t.exports={Angle:i(501),Call:i(502),GetFirst:i(503),GetLast:i(504),GridAlign:i(505),IncAlpha:i(555),IncX:i(556),IncXY:i(557),IncY:i(558),PlaceOnCircle:i(559),PlaceOnEllipse:i(560),PlaceOnLine:i(561),PlaceOnRectangle:i(562),PlaceOnTriangle:i(563),PlayAnimation:i(564),PropertyValueInc:i(34),PropertyValueSet:i(27),RandomCircle:i(565),RandomEllipse:i(566),RandomLine:i(567),RandomRectangle:i(568),RandomTriangle:i(569),Rotate:i(570),RotateAround:i(571),RotateAroundDistance:i(572),ScaleX:i(573),ScaleXY:i(574),ScaleY:i(575),SetAlpha:i(576),SetBlendMode:i(577),SetDepth:i(578),SetHitArea:i(579),SetOrigin:i(580),SetRotation:i(581),SetScale:i(582),SetScaleX:i(583),SetScaleY:i(584),SetTint:i(585),SetVisible:i(586),SetX:i(587),SetXY:i(588),SetY:i(589),ShiftPosition:i(590),Shuffle:i(591),SmootherStep:i(592),SmoothStep:i(593),Spread:i(594),ToggleVisible:i(595),WrapInRectangle:i(596)}},function(t,e,i){var n=i(144),s=[];s[n.BOTTOM_CENTER]=i(234),s[n.BOTTOM_LEFT]=i(235),s[n.BOTTOM_RIGHT]=i(236),s[n.CENTER]=i(237),s[n.LEFT_CENTER]=i(239),s[n.RIGHT_CENTER]=i(240),s[n.TOP_CENTER]=i(241),s[n.TOP_LEFT]=i(242),s[n.TOP_RIGHT]=i(243);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){var n=i(38),s=i(74),r=i(39),o=i(75);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(38),s=i(40),r=i(39),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(38),s=i(42),r=i(39),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(238),s=i(74),r=i(77);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(75),s=i(76);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(77),s=i(40),r=i(76),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(77),s=i(42),r=i(76),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(74),s=i(44),r=i(75),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(40),s=i(44),r=i(41),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(42),s=i(44),r=i(43),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(145),s=i(87),r=i(22),o=i(4);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(246),s=i(145),r=i(87),o=i(22);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;he.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,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e,i){var n=i(53),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){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e,i){var n=i(148),s=i(109);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n-h&&(c-=h,n+=l),fd.right&&(f=u(f,f+(g-d.right),this.lerp.x)),vd.bottom&&(p=u(p,p+(v-d.bottom),this.lerp.y))):(f=u(f,g-h,this.lerp.x),p=u(p,v-l,this.lerp.y))}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.roundPixels&&(h=Math.round(h),l=Math.round(l)),this.scrollX=f,this.scrollY=p;var m=f+n,y=p+s;this.midPoint.set(m,y);var x=e/o,T=i/o;this.worldView.setTo(m-x/2,y-T/2,x,T),a.applyITRS(this.x+h,this.y+l,this.rotation,o,o),a.translate(-h,-l),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(33);t.exports=function(t){var e=new n;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(s,r,o)}return e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(e16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(33);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){var n=i(33);t.exports=function(t){var e=new n,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var s=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(s,r,o,255*a)}return e}},function(t,e,i){t.exports={Fade:i(621),Flash:i(622),Pan:i(623),Shake:i(656),Zoom:i(657)}},function(t,e,i){t.exports={In:i(624),Out:i(625),InOut:i(626)}},function(t,e,i){t.exports={In:i(627),Out:i(628),InOut:i(629)}},function(t,e,i){t.exports={In:i(630),Out:i(631),InOut:i(632)}},function(t,e,i){t.exports={In:i(633),Out:i(634),InOut:i(635)}},function(t,e,i){t.exports={In:i(636),Out:i(637),InOut:i(638)}},function(t,e,i){t.exports={In:i(639),Out:i(640),InOut:i(641)}},function(t,e,i){t.exports=i(642)},function(t,e,i){t.exports={In:i(643),Out:i(644),InOut:i(645)}},function(t,e,i){t.exports={In:i(646),Out:i(647),InOut:i(648)}},function(t,e,i){t.exports={In:i(649),Out:i(650),InOut:i(651)}},function(t,e,i){t.exports={In:i(652),Out:i(653),InOut:i(654)}},function(t,e,i){t.exports=i(655)},function(t,e,i){var n=i(0),s=i(31),r=i(293),o=i(2),a=i(5),h=i(7),l=i(166),u=i(1),c=i(172),d=i(160),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",void 0),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!0),this.autoRound=a(t,"autoRound",!1),this.autoCenter=a(t,"autoCenter",0),this.resizeInterval=a(t,"resizeInterval",500),this.fullscreenTarget=a(t,"fullscreenTarget",null),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"expandParent",this.expandParent),this.autoRound=a(e,"autoRound",this.autoRound),this.autoCenter=a(e,"autoCenter",this.autoCenter),this.resizeInterval=a(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=a(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.antialias=a(i,"antialias",!0),this.desynchronized=a(i,"desynchronized",!1),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3),this.maxLights=a(i,"maxLights",10);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){t.exports={os:i(116),browser:i(117),features:i(165),input:i(686),audio:i(687),video:i(688),fullscreen:i(689),canvasFeatures:i(294)}},function(t,e,i){var n,s,r,o=i(25),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");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;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");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);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},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){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},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),t0?Math.ceil(t):Math.floor(t)}},function(t,e,i){var n=i(3);t.exports=function(t,e,i,s,r,o,a,h){void 0===h&&(h=new n);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,f=-l*a,p=u*a,g=1/(c*p+f*-d);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=c*g*e+-d*g*t+(-s*c+i*d)*g,h}},function(t,e,i){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,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+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){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],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,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]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*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],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-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],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+m*h,e[4]=g*n+v*o+m*l,e[5]=g*s+v*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*n+x*o+T*l,e[8]=y*s+x*a+T*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],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-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,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,m=this.val;return m[0]=1-(c+f),m[3]=l+v,m[6]=u-g,m[1]=l-v,m[4]=1-(h+f),m[7]=d+p,m[2]=u+g,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=n*h-s*a,T=n*l-r*a,w=n*u-o*a,b=s*l-r*h,S=s*u-o*h,E=r*u-o*l,A=c*v-d*g,_=c*m-f*g,C=c*y-p*g,M=d*m-f*v,P=d*y-p*v,O=f*y-p*m,R=x*O-T*P+w*M+b*C-S*_+E*A;return R?(R=1/R,i[0]=(h*O-l*P+u*M)*R,i[1]=(l*C-a*O-u*_)*R,i[2]=(a*P-h*C+u*A)*R,i[3]=(r*P-s*O-o*M)*R,i[4]=(n*O-r*C+o*_)*R,i[5]=(s*C-n*P-o*A)*R,i[6]=(v*E-m*S+y*b)*R,i[7]=(m*w-g*E-y*T)*R,i[8]=(g*S-v*w+y*x)*R,this):null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),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],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},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(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=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]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[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+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*o+w*u+b*p,e[1]=x*n+T*a+w*c+b*g,e[2]=x*s+T*h+w*d+b*v,e[3]=x*r+T*l+w*f+b*m,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*o+w*u+b*p,e[5]=x*n+T*a+w*c+b*g,e[6]=x*s+T*h+w*d+b*v,e[7]=x*r+T*l+w*f+b*m,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*o+w*u+b*p,e[9]=x*n+T*a+w*c+b*g,e[10]=x*s+T*h+w*d+b*v,e[11]=x*r+T*l+w*f+b*m,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*o+w*u+b*p,e[13]=x*n+T*a+w*c+b*g,e[14]=x*s+T*h+w*d+b*v,e[15]=x*r+T*l+w*f+b*m,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},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){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},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,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=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],g=i[5],v=i[6],m=i[7],y=i[8],x=i[9],T=i[10],w=i[11],b=n*n*l+h,S=s*n*l+r*a,E=r*n*l-s*a,A=n*s*l-r*a,_=s*s*l+h,C=r*s*l+n*a,M=n*r*l+s*a,P=s*r*l-n*a,O=r*r*l+h;return i[0]=u*b+p*S+y*E,i[1]=c*b+g*S+x*E,i[2]=d*b+v*S+T*E,i[3]=f*b+m*S+w*E,i[4]=u*A+p*_+y*C,i[5]=c*A+g*_+x*C,i[6]=d*A+v*_+T*C,i[7]=f*A+m*_+w*C,i[8]=u*M+p*P+y*O,i[9]=c*M+g*P+x*O,i[10]=d*M+v*P+T*O,i[11]=f*M+m*P+w*O,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=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]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=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]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*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],o=e[2],a=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]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,m=o*h,y=o*l;return i[0]=1-(f+g),i[1]=c+y,i[2]=d-m,i[3]=0,i[4]=c-y,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+m,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,m=r*h;return e[0]=1-(d+p),e[1]=u+m,e[2]=c-v,e[3]=0,e[4]=u-m,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),m=h*(g*=v)-l*(p*=v),y=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(m*m+y*y+x*x))?(m*=v=1/v,y*=v,x*=v):(m=0,y=0,x=0);var T=p*x-g*y,w=g*m-f*x,b=f*y-p*m;return(v=Math.sqrt(T*T+w*w+b*b))?(T*=v=1/v,w*=v,b*=v):(T=0,w=0,b=0),n[0]=m,n[1]=T,n[2]=f,n[3]=0,n[4]=y,n[5]=w,n[6]=p,n[7]=0,n[8]=x,n[9]=b,n[10]=g,n[11]=0,n[12]=-(m*s+y*r+x*o),n[13]=-(T*s+w*r+b*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.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),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=i(0),s=i(171),r=i(312),o=new Int8Array([1,2,0]),a=new Float32Array([0,0,0]),h=new s(1,0,0),l=new s(0,1,0),u=new s,c=new r,d=new n({initialize:function(t,e,i,n){"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)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},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,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,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},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(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 n=c.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(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,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.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},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.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},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},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],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=i(316),s=i(25),r=i(31),o=i(165);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.CANVAS||e.renderType!==r.CANVAS&&!o.webGL){if(!o.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=r.CANVAS}else e.renderType=r.WEBGL;e.antialias||s.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=s.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||n.setCrisp(t.canvas),e.renderType!==r.HEADLESS&&(a=i(482),h=i(485),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(31);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===n.CANVAS?i="Canvas":e.renderType===n.HEADLESS&&(i="Headless");var s,r=e.audio,o=t.device.audio;if(s=!o.webAudio||r&&r.disableWebAudio?r&&r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio":"Web Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+n.VERSION+" / https://phaser.io");else{var a,h="",l=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach(function(t){h=h.concat("%c "),l.push("background: "+t),a=t}),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a):(h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),l.push("background: #fff"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+n.VERSION+" ("+i+" | "+s+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},function(t,e,i){var n=i(0),s=i(5),r=i(1),o=i(319),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step()},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.max(16+t.lastTime-i,0);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(18);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)},!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var n=i(322),s=i(25),r=i(5);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",n),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*a)),p=Math.floor(Math.abs(e.length*h));i||(i=s.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var g=i.getContext("2d");u&&g.clearRect(0,0,f,p),c&&c(i,g);for(var v=0;vi;)n-=i;ni.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e,i){var n=i(116);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e,i){var n=i(174);t.exports=function(t,e){var i=window.screen,s=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);if(s&&"string"==typeof s.type)return s.type;if("string"==typeof s)return s;if(i)return i.height>i.width?n.PORTRAIT:n.LANDSCAPE;if("number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?n.PORTRAIT:n.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return n.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return n.LANDSCAPE}return e>t?n.PORTRAIT:n.LANDSCAPE}},function(t,e){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},function(t,e){t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},function(t,e){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},function(t,e){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},function(t,e){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(0),s=i(176),r=i(10),o=i(54),a=i(18),h=i(341),l=i(342),u=i(343),c=i(344),d=i(32),f=i(310),p=new n({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var n=new u(this,i);n.smoothFactor=e.inputSmoothFactor,this.pointers.push(n)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(o.MANAGER_BOOT),this.game.events.on(a.PRE_RENDER,this.preRender,this),this.game.events.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var n=0;n10&&(t=10-this.pointersTotal);for(var i=0;i-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.useQueue||t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},function(t,e,i){var n=i(0),s=i(165),r=i(54),o=i(0),a=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.capture=t.inputMouseCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},requestPointerLock:function(){if(s.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){s.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onMouseMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseMove(e),t.capture&&e.preventDefault())},this.onMouseDown=function(n){i&&window.focus(),!n.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseDown(n),t.capture&&n.target===e&&n.preventDefault())},this.onMouseDownWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseDown(i)},this.onMouseUp=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseUp(i),t.capture&&i.target===e&&i.preventDefault())},this.onMouseUpWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseUp(i)},this.onMouseOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onMouseOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)},this.onMouseWheel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onMouseWheel(e)};var n=this.target;if(n){var r={passive:!0},o={passive:!1};n.addEventListener("mousemove",this.onMouseMove,this.capture?o:r),n.addEventListener("mousedown",this.onMouseDown,this.capture?o:r),n.addEventListener("mouseup",this.onMouseUp,this.capture?o:r),n.addEventListener("mouseover",this.onMouseOver,this.capture?o:r),n.addEventListener("mouseout",this.onMouseOut,this.capture?o:r),n.addEventListener("wheel",this.onMouseWheel,this.capture?o:r),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o)),s.pointerLock&&(this.pointerLockChange=function(e){var i=t.target;t.locked=document.pointerLockElement===i||document.mozPointerLockElement===i||document.webkitPointerLockElement===i,t.manager.onPointerLockChange(e)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&(window.removeEventListener("mousedown",this.onMouseDownWindow),window.removeEventListener("mouseup",this.onMouseUpWindow)),s.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},function(t,e,i){var n=i(295),s=i(0),r=i(58),o=i(167),a=i(304),h=i(3),l=new s({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=this.x,i=this.y;1!==t.resolution&&(e+=t._x,i+=t._y);var n=t.getWorldPoint(e,i);return this.worldX=n.x,this.worldY=n.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,s=this.midPoint.y;if(t!==i||e!==s){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,s,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=n(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp),this.isDown=!1,this.wasTouch=!1},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp),this.isDown=!0,this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,s=this.position.x,r=this.position.y,o=0;o0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,r=t.resolution,o=t.zoom,a=t.autoRound;if("string"==typeof e){var h=this.parentSize.width;0===h&&(h=window.innerWidth);var l=parseInt(e,10)/100;e=Math.floor(h*l)}if("string"==typeof i){var c=this.parentSize.height;0===c&&(c=window.innerHeight);var d=parseInt(i,10)/100;i=Math.floor(c*d)}this.resolution=1,this.scaleMode=s,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),o===n.ZOOM.MAX_ZOOM&&(o=this.getMaxZoom()),this.zoom=o,1!==o&&(this._resetZoom=!0),this.baseSize.setSize(e*r,i*r),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*o,t.minHeight*o),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*o,t.maxHeight*o),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==n.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=this.resolution,n=e.width*i,s=e.height*i;return(t.width!==n||t.height!==s)&&(t.setSize(n,s),!0)},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e(t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound,n=this.resolution;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t,e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,n=this.resolution,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,o=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i*n,e*i*n),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,h=t*i,l=e*i;return s&&(h=Math.floor(h),l=Math.floor(l)),h===t&&l===e||(a.width=h+"px",a.height=l+"px"),this.refresh(r,o)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var n=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=n.marginLeft,s.marginTop=n.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,this.resolution,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===n.SCALE_MODE.NONE?(this.displaySize.setSize(s*o*1,r*o*1),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===n.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(1*this.displaySize.width,1*this.displaySize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=p(this.parentSize.width,this.gameSize.width,0,!0),e=p(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==n.CENTER.NO_CENTER){var e=this.canvas,i=e.style,s=e.getBoundingClientRect(),r=s.width,o=s.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===n.CENTER.CENTER_HORIZONTALLY?h=0:t===n.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();this._requestedFullscreenChange=!0,"undefined"!=typeof Promise?e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT).then(this.fullscreenSuccessHandler.bind(this)).catch(this.fullscreenErrorHandler.bind(this)):i[e.request](t).then(this.fullscreenSuccessHandler.bind(this)).catch(this.fullscreenErrorHandler.bind(this)):(e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t),e.active?this.fullscreenSuccessHandler():this.fullscreenErrorHandler())}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&(this._requestedFullscreenChange=!0,document[t.cancel]()),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach(function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){this._requestedFullscreenChange||this.stopFullscreen(),this._requestedFullscreenChange=!1},onFullScreenError:function(){this.removeFullscreenTarget()},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===n.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===n.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=v},function(t,e,i){var n=i(24),s=i(0),r=i(91),o=i(3),a=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio0&&(t=(e=r(e,n.y))*this.aspectRatio)):(i&&this.aspectRatios)&&(t=(e=r(e,n.y))*this.aspectRatio,n.x>0&&(e=(t=r(t,n.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},function(t,e,i){var n=i(0),s=i(123),r=i(20),o=i(18),a=i(5),h=i(81),l=i(1),u=i(349),c=i(177),d=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit(r.TRANSITION_INIT,n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=r.x&&t=r.y&&e=r.x&&t=r.y&&e-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=n,o.data[2]=s,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,n,s,r,o){return void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,n,s,r,o),this},getData:function(t,e,i,n){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),n=s(n,1,this.height-e),this.context.getImageData(t,e,i,n)},getPixel:function(t,e,i){i||(i=new r);var n=this.getIndex(t,e);if(n>-1){var s=this.data,o=s[n+0],a=s[n+1],h=s[n+2],l=s[n+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=s(t,0,this.width),a=s(t+i,0,this.width),h=s(e,0,this.height),l=s(e+n,0,this.height),u=new r,c=[],d=h;d0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=o},function(t,e,i){var n=i(124),s=i(0),r=i(10),o=i(359),a=i(1),h=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){var n=i(125),s=i(0),r=i(10),o=i(15),a=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!1},updateMarker:function(t){return!1},removeMarker:function(t){return null},play:function(t,e){return!1},pause:function(){return!1},resume:function(){return!1},stop:function(){return!1},destroy:function(){this.manager.remove(this),n.prototype.destroy.call(this)}});t.exports=a},function(t,e,i){var n=i(361),s=i(124),r=i(0),o=i(66),a=i(362),h=new r({Extends:s,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),s.call(this,t),this.locked&&this.unlock()},createAudioContext:function(t){var e=t.config.audio;return e&&e.context?(e.context.resume(),e.context):new AudioContext},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var s=this.game.cache.audio,r=i.length,a=0;a>4,u[h++]=(15&i)<<4|s>>2,u[h++]=(3&s)<<6|63&r;return l}},function(t,e,i){var n=i(125),s=i(0),r=i(66),o=new s({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),this.audioBuffer?(this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime-1;r--)n[s][r]=t[r][s]}return n}},function(t,e){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,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=n);o>r;){if(o-r>600){var h=o-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(o,Math.floor(e+(h-l)*c/h+d));s(t,e,f,p,a)}var g=t[e],v=r,m=o;for(i(t,r,e),a(t[o],g)>0&&i(t,r,o);v0;)m--}0===a(t[r],g)?i(t,r,m):i(t,++m,o),m<=e&&(r=m+1),e<=m&&(o=m-1)}};t.exports=s},function(t,e,i){var n=i(5),s=i(112),r=function(t,e,i){for(var n=[],s=0;s0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(11);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),o=Math.max(t.right,e.right)-s,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(s,r,o,a)}},function(t,e,i){var n=i(0),s=i(12),r=i(920),o=i(13),a=i(7),h=i(175),l=i(311),u=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Origin,s.ScrollFactor,s.Transform,s.Visible,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new l,this.rotate3dAngle="deg",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof n?"#"===n[0]?this.setElement(n.substr(1),s,r):this.createElement(n,s,r):n&&this.setElement(n,s,r)},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e>>16,y=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+m+","+y+","+x+","+d+")",c.lineWidth=v,T+=3;break;case n.FILL_STYLE:g=l[T+1],f=l[T+2],m=(16711680&g)>>>16,y=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+m+","+y+","+x+","+f+")",T+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[T+1],l[T+2],l[T+3],l[T+4]):c.fillRect(l[T+1],l[T+2],l[T+3],l[T+4]),T+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.fill(),T+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.stroke(),T+=6;break;case n.LINE_TO:c.lineTo(l[T+1],l[T+2]),T+=2;break;case n.MOVE_TO:c.moveTo(l[T+1],l[T+2]),T+=2;break;case n.LINE_FX_TO:c.lineTo(l[T+1],l[T+2]),T+=5;break;case n.MOVE_FX_TO:c.moveTo(l[T+1],l[T+2]),T+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[T+1],l[T+2]),T+=2;break;case n.SCALE:c.scale(l[T+1],l[T+2]),T+=2;break;case n.ROTATE:c.rotate(l[T+1]),T+=1;break;case n.GRADIENT_FILL_STYLE:T+=5;break;case n.GRADIENT_LINE_STYLE:T+=6;break;case n.SET_TEXTURE:T+=2}c.restore()}}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(53),s=i(0),r=i(12),o=i(378),a=i(379),h=i(937),l=i(2),u=i(182),c=i(380),d=i(97),f=i(376),p=i(381),g=i(11),v=i(128),m=i(3),y=i(57),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];s.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===n&&(n=!1),void 0===s&&(s=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=s,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;i0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e,i){var n=i(0),s=i(960),r=i(64),o=i(11),a=i(29),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;sc+v)){var m=g.getPoint((u-c)/v);o.push(m);break}c+=v}return o}},function(t,e,i){var n=i(56),s=i(55);t.exports=function(t){for(var e=t.points,i=0,r=0;r0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(0),s=i(11),r=i(29),o=i(981),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new s(0,0,n,o)),this.setPosition(e,i),this.setSize(n,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(984),s=i(0),r=i(64),o=i(29),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(56),s=i(4);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e){t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=t,o=0;o0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],o):h=new s(t,e,i,a[0],a[1],a[2],o),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=o},function(t,e,i){var n=i(47),s=i(15),r={Circle:i(1043),Ellipse:i(1053),Intersects:i(405),Line:i(1072),Point:i(1093),Polygon:i(1107),Rectangle:i(420),Triangle:i(1137)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={CircleToCircle:i(406),CircleToRectangle:i(407),GetCircleToCircle:i(1063),GetCircleToRectangle:i(1064),GetLineToCircle:i(198),GetLineToRectangle:i(200),GetRectangleIntersection:i(1065),GetRectangleToRectangle:i(1066),GetRectangleToTriangle:i(1067),GetTriangleToCircle:i(1068),GetTriangleToLine:i(412),GetTriangleToTriangle:i(1069),LineToCircle:i(199),LineToLine:i(84),LineToRectangle:i(408),PointToLine:i(416),PointToLineSegment:i(1070),RectangleToRectangle:i(131),RectangleToTriangle:i(409),RectangleToValues:i(1071),TriangleToCircle:i(411),TriangleToLine:i(413),TriangleToTriangle:i(414)}},function(t,e,i){var n=i(58);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(84),s=i(48),r=i(201),o=i(410);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e,i){var n=i(199),s=i(83);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=1);var n=e.x1,s=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-n)*(r-n)+(o-s)*(o-s);if(0===l)return!1;var u=((a-n)*(r-n)+(h-s)*(o-s))/l;if(u<0)return Math.sqrt((n-a)*(n-a)+(s-h)*(s-h))<=i;if(u>=0&&u<=1){var c=((s-h)*(r-n)-(n-a)*(o-s))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},function(t,e,i){var n=i(22),s=i(57),r=i(85);t.exports=function(t){var e=r(t)-n.TAU;return s(e,-Math.PI,Math.PI)}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e,i){var n=i(11);n.Area=i(1112),n.Ceil=i(1113),n.CeilAll=i(1114),n.CenterOn=i(163),n.Clone=i(1115),n.Contains=i(48),n.ContainsPoint=i(1116),n.ContainsRect=i(421),n.CopyFrom=i(1117),n.Decompose=i(410),n.Equals=i(1118),n.FitInside=i(1119),n.FitOutside=i(1120),n.Floor=i(1121),n.FloorAll=i(1122),n.FromPoints=i(173),n.GetAspectRatio=i(203),n.GetCenter=i(1123),n.GetPoint=i(148),n.GetPoints=i(252),n.GetSize=i(1124),n.Inflate=i(1125),n.Intersection=i(1126),n.MarchingAnts=i(263),n.MergePoints=i(1127),n.MergeRect=i(1128),n.MergeXY=i(1129),n.Offset=i(1130),n.OffsetPoint=i(1131),n.Overlaps=i(1132),n.Perimeter=i(109),n.PerimeterPoint=i(1133),n.Random=i(151),n.RandomOutside=i(1134),n.SameDimensions=i(1135),n.Scale=i(1136),n.Union=i(367),t.exports=n},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var n=i(426),s=i(427),r=i(0),o=i(10),a=i(3),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=r;for(i=0;i=r;)this._elapsed-=r,this.step(s)}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(n=(i=h.entries).length,t=0;t-1&&p>g&&(t.velocity.normalize().scale(g),p=g),t.speed=p},separate:function(t,e,i,n,s){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,s);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.ya.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,c=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)r.right&&(s=h(o.x,o.y,r.right,r.y)-o.radius):o.y>r.bottom&&(o.xr.right&&(s=h(o.x,o.y,r.right,r.bottom)-o.radius)),s*=-1}else s=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s&&(t.onOverlap||e.onOverlap)&&this.emit(u.OVERLAP,t.gameObject,e.gameObject,t,e),0!==s;var a=t.position.x-e.position.x,l=t.position.y-e.position.y,c=Math.sqrt(Math.pow(a,2)+Math.pow(l,2)),d=(e.position.x-t.position.x)/c||0,f=(e.position.y-t.position.y)/c||0,v=2*(t.velocity.x*d+t.velocity.y*f-e.velocity.x*d-e.velocity.y*f)/(t.mass+e.mass);t.immovable||(t.velocity.x=(t.velocity.x-v*t.mass*d)*t.bounce.x,t.velocity.y=(t.velocity.y-v*t.mass*f)*t.bounce.y),e.immovable||(e.velocity.x=(e.velocity.x+v*e.mass*d)*e.bounce.x,e.velocity.y=(e.velocity.y+v*e.mass*f)*e.bounce.y);var m=e.velocity.x-t.velocity.x,y=e.velocity.y-t.velocity.y,x=Math.atan2(y,m),T=this._frameTime;return t.immovable||(t.x+=t.velocity.x*T-s*Math.cos(x),t.y+=t.velocity.y*T-s*Math.sin(x)),e.immovable||(e.x+=e.velocity.x*T+s*Math.cos(x),e.y+=e.velocity.y*T+s*Math.sin(x)),(t.onCollide||e.onCollide)&&this.emit(u.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o,a;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f=e.getTilesWithinWorldXY(a,h,l,u);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,n,s,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,s,r,o){for(var a,h,l=t.body,c={left:0,right:0,top:0,bottom:0},d=!1,f=0;f0&&t>i&&(t=i)),0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),this.gameObject.x+=t,this.gameObject.y+=e,this._reset=!0}t<0?this.facing=r.FACING_LEFT:t>0&&(this.facing=r.FACING_RIGHT),e<0?this.facing=r.FACING_UP:e>0&&(this.facing=r.FACING_DOWN),this._dx=t,this._dy=e,this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,s=void 0!==i;return(n||s)&&(this.worldBounce||(this.worldBounce=new u),n&&(this.worldBounce.x=e),s&&(this.worldBounce.y=i)),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(51);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=i(51);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;t=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,m,y;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,m-g)*Math.max(0,y-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(46),s=i(0),r=i(51),o=i(48),a=i(3),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports={NEVER:0,LITE:1,PASSIVE:2,ACTIVE:4,FIXED:8}},function(t,e){t.exports={NONE:0,A:1,B:2,BOTH:3}},function(t,e,i){var n={};t.exports=n;var s=i(230);n._motionWakeThreshold=.18,n._motionSleepThreshold=.08,n._minBias=.9,n.update=function(t,e){for(var i=e*e*e,s=0;s0&&r.motion=r.sleepThreshold&&n.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else n.set(r,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,s=0;sn._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||s.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&s.trigger(t,"sleepEnd"))}},function(t,e,i){var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game,this.scene,this.systems},init:function(){},start:function(){},stop:function(){},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e,i){var n=i(23);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l-1}return!1}},function(t,e,i){var n=i(73),s=i(101),r=i(212);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!1),void 0===o&&(o=!0),!s(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new n(a,-1,t,e,h.width,h.height),o&&h&&h.collides&&r(t,e,a),h):null}},function(t,e,i){var n=i(30),s=i(215),r=i(457),o=i(458),a=i(469);t.exports=function(t,e,i,h,l,u){var c;switch(e){case n.ARRAY_2D:c=s(t,i,h,l,u);break;case n.CSV:c=r(t,i,h,l,u);break;case n.TILED_JSON:c=o(t,i,u);break;case n.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},function(t,e,i){var n=i(30),s=i(215);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map(function(t){return t.split(",")}),h=s(t,a,i,r,o);return h.format=n.CSV,h}},function(t,e,i){var n=i(30),s=i(103),r=i(459),o=i(461),a=i(462),h=i(465),l=i(467),u=i(468);t.exports=function(t,e,i){if("orthogonal"!==e.orientation)return console.warn("Only orthogonal map types are supported in this version of Phaser"),null;var c=new s({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:e.orientation,format:n.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});c.layers=r(e,i),c.images=o(e);var d=a(e);return c.tilesets=d.tilesets,c.imageCollections=d.imageCollections,c.objects=h(e),c.tiles=l(c),u(c),c}},function(t,e,i){var n=i(460),s=i(2),r=i(102),o=i(216),a=i(73);t.exports=function(t,e){for(var i=s(t,"infinite",!1),h=[],l=0;l0?((f=new a(c,d.gid,C,M,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,g[M][C]=f):(p=e?null:new a(c,-1,C,M,t.tilewidth,t.tileheight),g[M][C]=p),++v===w.width&&(E++,v=0)}}else{c=new r({name:u.name,x:s(u,"offsetx",0)+u.x,y:s(u,"offsety",0)+u.y,width:u.width,height:u.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:u.opacity,visible:u.visible,properties:s(u,"properties",{})});for(var P=[],O=0,R=u.data.length;O0?((f=new a(c,d.gid,v,g.length,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,P.push(f)):(p=e?null:new a(c,-1,v,g.length,t.tilewidth,t.tileheight),P.push(p)),++v===u.width&&(g.push(P),v=0,P=[])}c.data=g,h.push(c)}}return h}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),s=0;s>>0;return n}},function(t,e,i){var n=i(2);t.exports=function(t){for(var e=[],i=0;i1){if(Array.isArray(l.tiles)){for(var c={},d={},f=0;f=this.firstgid&&ta&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(102),s=i(73);t.exports=function(t,e){for(var i=[],r=0;r-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(141);t.exports=function(t){for(var e=[],i=[],s=0;s-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(s,r),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(u=new p(t,o,i,n,s,r)).setImage(h),this.tilesets.push(u),u)},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new c(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:null!==a?(f.Copy(t,e,i,n,s,r,o,a),this):null},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===a&&(a=this.tileWidth),void 0===l&&(l=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var u,c=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;f-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return n},removeTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"removeTileAt")?null:null===s?null:f.RemoveTileAt(t,e,i,n,s)},removeTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"removeTileAtWorldXY")?null:null===r?null:f.RemoveTileAtWorldXY(t,e,i,n,s,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(f.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this))},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(12),r=i(18),o=i(13),a=i(1296),h=i(137),l=i(32),u=i(9),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.events.on(r.CONTEXT_RESTORED,function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;sv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;o>=0;o--)for(a=0;av||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;o>=0;o--)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===m?(m=i.createVertexBuffer(y,n.STATIC_DRAW),this.vertexBuffer[e]=m):(i.setVertexBuffer(m),n.bufferSubData(n.ARRAY_BUFFER,0,y))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=i.tileWidth,l=i.tileHeight,c=h/2,d=l/2,f=a.x/n,p=a.y/s,g=(a.x+h)/n,v=(a.y+l)/s,m=this._tempMatrix,y=-c,x=-d;e.flipX&&(h*=-1,y+=i.tileWidth),e.flipY&&(l*=-1,x+=i.tileHeight);var T=y+h,w=x+l;m.applyITRS(c+e.pixelX,d+e.pixelY,e.rotation,1,1);var b=u.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),S=m.getX(y,x),E=m.getY(y,x),A=m.getX(y,w),_=m.getY(y,w),C=m.getX(T,w),M=m.getY(T,w),P=m.getX(T,x),O=m.getY(T,x);r.roundPixels&&(S=Math.round(S),E=Math.round(E),A=Math.round(A),_=Math.round(_),C=Math.round(C),M=Math.round(M),P=Math.round(P),O=Math.round(O));var R=this.vertexViewF32[o],L=this.vertexViewU32[o];return R[++t]=S,R[++t]=E,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=b,R[++t]=A,R[++t]=_,R[++t]=f,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=S,R[++t]=E,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=b,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=P,R[++t]=O,R[++t]=g,R[++t]=p,R[++t]=0,L[++t]=b,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4){this._renderOrder=t;for(var e=0;e0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(1305);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){var n=i(5);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(221),s=i(14),r=i(88),o=i(82),a=i(142),h=i(5),l=i(220),u=i(222),c=i(224);t.exports=function(t,e,i){void 0===i&&(i=n);var d=h(e,"from",0),f=h(e,"to",1),p=[{value:d}],g=a(e,"delay",i.delay),v=a(e,"duration",i.duration),m=h(e,"easeParams",i.easeParams),y=o(h(e,"ease",i.ease),m),x=a(e,"hold",i.hold),T=a(e,"repeat",i.repeat),w=a(e,"repeatDelay",i.repeatDelay),b=r(e,"yoyo",i.yoyo),S=[],E=l("value",f),A=c(p[0],0,"value",E.getEnd,E.getStart,E.getActive,y,g,v,b,x,T,w,!1,!1);A.start=d,A.current=d,A.to=f,S.push(A);var _=new u(t,S,p);_.offset=s(e,"offset",null),_.completeDelay=s(e,"completeDelay",0),_.loop=Math.round(s(e,"loop",0)),_.loopDelay=Math.round(s(e,"loopDelay",0)),_.paused=r(e,"paused",!1),_.useFrames=r(e,"useFrames",!1);for(var C=h(e,"callbackScope",_),M=[_,null],P=u.TYPES,O=0;O0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var m=0;m0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):(this.state=a.ACTIVE,this.dispatchTimelineEvent(r.TIMELINE_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=a.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=a.PENDING_REMOVE,this.dispatchTimelineEvent(r.TIMELINE_COMPLETE,this.callbacks.onComplete))},update:function(t,e){if(this.state!==a.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var i=this.totalData,n=0;n=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit(r.SPRITE_ANIMATION_KEY_UPDATE+i.key,i,t,e),e.emit(r.SPRITE_ANIMATION_UPDATE,i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=o},function(t,e,i){var n=i(483),s=i(49),r=i(0),o=i(31),a=i(484),h=i(90),l=i(104),u=i(114),c=i(32),d=new r({initialize:function(t){this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.config={clearBeforeRender:t.config.clearBeforeRender,backgroundColor:t.config.backgroundColor,resolution:t.config.resolution,antialias:t.config.antialias,roundPixels:t.config.roundPixels},this.scaleMode=t.config.antialias?l.LINEAR:l.NEAREST,this.gameCanvas=t.canvas;var e={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d",e),this.currentContext=this.gameContext,this.blendModes=a(),this.currentScaleMode=0,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new c,this._tempMatrix2=new c,this._tempMatrix3=new c,this._tempMatrix4=new c,this.init()},init:function(){this.game.scale.on(h.RESIZE,this.onResize,this);var t=this.game.scale.baseSize;this.resize(t.width,t.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.scaleMode===l.NEAREST&&u.disable(this.gameContext)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),t.save(),this.drawCount=0},render:function(t,e,i,n){var r=e.list,o=r.length,a=n._cx,h=n._cy,l=n._cw,u=n._ch,c=n.renderToTexture?n.context:t.sys.context;c.save(),this.game.scene.customViewports&&(c.beginPath(),c.rect(a,h,l,u),c.clip()),this.currentContext=c;var d=n.mask;d&&d.preRenderCanvas(this,null,n._maskCamera),n.transparent||(c.fillStyle=n.backgroundColor.rgba,c.fillRect(a,h,l,u)),c.globalAlpha=n.alpha,c.globalCompositeOperation="source-over",this.drawCount+=r.length,n.renderToTexture&&n.emit(s.PRE_RENDER,n),n.matrix.copyToContext(c);for(var f=0;f=0?y=-(y+d):y<0&&(y=Math.abs(y)-d)),t.flipY&&(x>=0?x=-(x+f):x<0&&(x=Math.abs(x)-f))}var w=1,b=1;t.flipX&&(p||(y+=-e.realWidth+2*v),w=-1),t.flipY&&(p||(x+=-e.realHeight+2*m),b=-1),a.applyITRS(t.x,t.y,t.rotation,t.scaleX*w,t.scaleY*b),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,y,x,d/g,f/g),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=d},function(t,e,i){var n=i(25),s=i(33),r=i(2);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=r(e,"width",t.width),c=r(e,"height",t.height);if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new s(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=n.createWebGL(this,u,c);f.getContext("2d").drawImage(t,h,l,u,c,0,0,u,c);var p=new Image;p.onerror=function(){i.call(null),n.remove(f)},p.onload=function(){i.call(null,p),n.remove(f)},p.src=f.toDataURL(o,a)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(o,a)}}},function(t,e,i){var n=i(53),s=i(294);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t[n.ERASE]="destination-out",t[n.SOURCE_IN]="source-in",t[n.SOURCE_OUT]="source-out",t[n.SOURCE_ATOP]="source-atop",t[n.DESTINATION_OVER]="destination-over",t[n.DESTINATION_IN]="destination-in",t[n.DESTINATION_OUT]="destination-out",t[n.DESTINATION_ATOP]="destination-atop",t[n.LIGHTER]="lighter",t[n.COPY]="copy",t[n.XOR]="xor",t}},function(t,e,i){var n=i(113),s=i(49),r=i(0),o=i(31),a=i(18),h=i(118),l=i(1),u=i(90),c=i(79),d=i(119),f=i(32),p=i(9),g=i(486),v=i(487),m=i(488),y=i(229),x=new r({initialize:function(t){var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialias,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,resolution:e.resolution,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights},this.game=t,this.type=o.WEBGL,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.nativeTextures=[],this.contextLost=!1,this.pipelines=null,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTextureUnit=0,this.currentTextures=new Array(16),this.currentFramebuffer=null,this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=l,this.contextRestoredHandler=l,this.gl=null,this.supportedExtensions=null,this.extensions={},this.glFormats=[],this.compression={ETC1:!1,PVRTC:!1,S3TC:!1},this.drawingBufferHeight=0,this.blankTexture=null,this.defaultCamera=new n(0,0,0,0),this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this._tempMatrix4=new f,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.init(this.config)},init:function(t){var e,i=this.game,n=this.canvas,s=t.backgroundColor;if(!(e=i.config.context?i.config.context:n.getContext("webgl",t.contextCreation)||n.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var r=this;this.contextLostHandler=function(t){r.contextLost=!0,r.game.events.emit(a.CONTEXT_LOST,r),t.preventDefault()},this.contextRestoredHandler=function(){r.contextLost=!1,r.init(r.config),r.game.events.emit(a.CONTEXT_RESTORED,r)},n.addEventListener("webglcontextlost",this.contextLostHandler,!1),n.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var h=0;h<=27;h++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var l=e.getSupportedExtensions();t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE));var u="WEBGL_compressed_texture_",c="WEBKIT_"+u;this.compression.ETC1=e.getExtension(u+"etc1")||e.getExtension(c+"etc1"),this.compression.PVRTC=e.getExtension(u+"pvrtc")||e.getExtension(c+"pvrtc"),this.compression.S3TC=e.getExtension(u+"s3tc")||e.getExtension(c+"s3tc"),this.supportedExtensions=l,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(s.redGL,s.greenGL,s.blueGL,s.alphaGL);for(var f=0;f0&&n>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==n}a&&(this.flush(),r.scissor(t,s-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},rebindPipeline:function(t){var e=this.gl;e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),this.hasActiveStencilMask()?e.clear(e.DEPTH_BUFFER_BIT):(e.disable(e.STENCIL_TEST),e.clear(e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)),e.viewport(0,0,this.width,this.height),this.setBlendMode(0,!0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.blankTexture.glTexture),this.currentActiveTextureUnit=0,this.currentTextures[0]=this.blankTexture.glTexture,this.currentPipeline=t,this.currentPipeline.bind(),this.currentPipeline.onBind()},clearPipeline:function(){this.flush(),this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.setBlendMode(0,!0)},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(n.equation),n.func.length>2?i.blendFuncSeparate(n.func[0],n.func[1],n.func[2],n.func[3]):i.blendFunc(n.func[0],n.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e,i){void 0===i&&(i=!0);var n=this.gl;return t!==this.currentTextures[e]&&(i&&this.flush(),this.currentActiveTextureUnit!==e&&(n.activeTexture(n.TEXTURE0+e),this.currentActiveTextureUnit=e),n.bindTexture(n.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.width,s=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(n=t.renderTexture.width,s=t.renderTexture.height):this.flush(),i.bindFramebuffer(i.FRAMEBUFFER,t),i.viewport(0,0,n,s),e&&(t?(this.drawingBufferHeight=s,this.pushScissor(0,0,n,s)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,r=s.NEAREST,a=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,h(e,i)&&(a=s.REPEAT),n===o.ScaleModes.LINEAR&&this.config.antialias&&(r=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,r,r,a,a,s.RGBA,t):this.createTexture2D(0,r,r,a,a,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&c(this.nativeTextures,e),this.gl.deleteTexture(t),this.currentTextures[0]!==t||this.game.pendingDestroy||this.setBlankTexture(!0),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,r=t._ch,o=this.pipelines.TextureTintPipeline,a=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-r),this.setFramebuffer(t.framebuffer);var h=this.gl;h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT),o.projOrtho(e,n+e,i,r+i,-1e3,1e3),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n+e,r+i,p.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL),t.emit(s.PRE_RENDER,t)}else this.pushScissor(e,i,n,r),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n,r,p.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,p.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,p.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit(s.POST_RENDER,t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=p.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera))},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.pipelines;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var i=this.config.backgroundColor;t.clearColor(i.redGL,i.greenGL,i.blueGL,i.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}for(var n in t.enable(t.SCISSOR_TEST),e)e[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,r=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);if(this.preRenderCamera(n),0===r)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(n);this.currentType="";for(var l=this.currentMask,u=0;u>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){t.exports="changedata"},function(t,e){t.exports="changedata-"},function(t,e){t.exports="removedata"},function(t,e){t.exports="setdata"},function(t,e){t.exports="destroy"},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"alpha",e,i,s,r)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"x",e,i,s,r)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"x",e,s,o,a),n(t,"y",i,r,o,a)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"y",e,i,s,r)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=0;o0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.001&&(e.zoom=.001))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={Camera:i(271),CameraManager:i(658),Effects:i(279),Events:i(49)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(24),s=i(0),r=i(49),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed=1?1:1/e*(1+(e*t|0))}},function(t,e,i){var n=i(24),s=i(0),r=i(49),o=i(3),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=s,this.camera.emit(r.SHAKE_START,this.camera,this,t,e),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed0&&(o.preRender(1),t.render(n,e,i,o))}},resetAll:function(){for(var t=0;t1)for(var i=1;i=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){var n=i(117),s={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(s.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(s.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(s.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(s.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(s.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(s.webm=!0),""!==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 i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e){var i={h264Video:!1,hlsVideo:!1,mp4Video:!1,oggVideo:!1,vp9Video:!1,webmVideo:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.oggVideo=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264Video=!0,i.mp4Video=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webmVideo=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9Video=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hlsVideo=!0))}catch(t){}return i}()},function(t,e){var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){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;tMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=i(296);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){var n=i(22);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e?t:(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e1?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[i1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(156);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){t.exports={GetNext:i(305),IsSize:i(118),IsValue:i(710)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){t.exports={Ceil:i(306),Floor:i(91),To:i(712)}},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){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;i1?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,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=[],o=0;o0&&t<=e*i&&(r=t>e-1?t-(o=Math.floor(t/e))*e:t,s.set(r,o)),s}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){var n=i(171),s=i(313),r=i(314),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e){t.exports="addtexture"},function(t,e){t.exports="onerror"},function(t,e){t.exports="onload"},function(t,e){t.exports="ready"},function(t,e){t.exports="removetexture"},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," float alpha = mainColor.a;",""," if (!uInvertMaskAlpha)"," {"," alpha *= (maskColor.a);"," }"," else"," {"," alpha *= (1.0 - maskColor.a);"," }",""," gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_FORWARD_DIFFUSE_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);"," vec4 color = texture;",""," if (outTintEffect == 0.0)"," {"," // Multiply texture tint"," color = texture * texel;"," }"," else if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);"," color.a = texture.a * texel.a;"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform mat4 uModelMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}","",""].join("\n")},function(t,e,i){t.exports={GenerateTexture:i(321),Palettes:i(743)}},function(t,e,i){t.exports={ARNE16:i(322),C64:i(744),CGA:i(745),JMP:i(746),MSX:i(747)}},function(t,e){t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},function(t,e){t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},function(t,e,i){t.exports={Path:i(749),CubicBezier:i(323),Curve:i(80),Ellipse:i(324),Line:i(325),QuadraticBezier:i(326),Spline:i(327)}},function(t,e,i){var n=i(0),s=i(323),r=i(324),o=i(6),a=i(325),h=i(750),l=i(326),u=i(11),c=i(327),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(r,o),l=new d(t,e)),this.add(new s(u,a,h,l))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new l(o,s,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e,i){var n=i(33),s=i(331);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=s(l,h,t+1/3),o=s(l,h,t),a=s(l,h,t-1/3)}return(new n).setGLTo(r,o,a,1)}},function(t,e,i){var n=i(162);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(n(s/359,t,e));return i}},function(t,e,i){var n=i(115),s=function(t,e,i,s,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:n(t,s,l),g:n(e,r,l),b:n(i,o,l)}};t.exports={RGBWithRGB:s,ColorWithRGB:function(t,e,i,n,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),s(t.r,t.g,t.b,e,i,n,r,o)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),s(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(169),s=i(33);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var n=i(330);t.exports=function(t,e,i,s,r){return void 0===s&&(s=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+n(s)+n(t)+n(e)+n(i)}},function(t,e,i){t.exports={BitmapMask:i(256),GeometryMask:i(257)}},function(t,e,i){var n={AddToDOM:i(120),DOMContentLoaded:i(332),GetScreenOrientation:i(333),GetTarget:i(338),ParseXML:i(339),RemoveFromDOM:i(175),RequestAnimationFrame:i(319)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(784)}},function(t,e,i){var n=i(0),s=i(10),r=i(19),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){var n=i(120),s=i(267),r=i(270),o=i(25),a=i(0),h=i(292),l=i(786),u=i(315),c=i(110),d=i(317),f=i(293),p=i(332),g=i(10),v=i(18),m=i(340),y=i(19),x=i(345),T=i(346),w=i(348),b=i(119),S=i(351),E=i(318),A=i(320),_=i(355),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new S(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new E(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(v.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(v.POST_RENDER,n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),i.emit(v.PRE_RENDER),i.emit(v.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},function(t,e,i){var n=i(120);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,n(i,e.parent)}}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},n=document.createElement("div");return n.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(n),i.w=90===e?n.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:n.offsetHeight,document.documentElement.removeChild(n),n=null,90!==Math.abs(window.orientation)?i.h:i.w}},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){var n=i(2),s=i(178);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=n(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(s(e+"Physics")),i)for(var o in i)o=s(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},function(t,e,i){var n=i(2);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){t.exports={game:"game",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s,r=i.getElementsByTagName("SubTexture"),o=0;og||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,m=f,y=0,x=0,T=0;Tr&&(y=w-r),b>o&&(x=b-o),t.add(T,e,i+v,s+m,h-y,l-x),(v+=h+p)+h>r&&(v=f,m+=l+p)}return t}},function(t,e,i){var n=i(2);t.exports=function(t,e,i){var s=n(i,"frameWidth",null),r=n(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=n(i,"startFrame",0),l=n(i,"endFrame",-1),u=n(i,"margin",0),c=n(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,v=e.realWidth,m=e.realHeight,y=Math.floor((v-u+c)/(s+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,b=s-w,S=s-(v-p-w),E=e.y,A=r-E,_=r-(m-g-E);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,M=u,P=0,O=e.sourceIndex,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 o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0){var o=n-t.length;if(o<=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 a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-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&&i0){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&&it.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){var n=i(67);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 o=i-e,a=t.splice(e,o);if(s)for(var h=0;h0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){var n=i(67);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 o=s;o-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=this._list,n=i.length,s=0;sv&&(r=v),o>m&&(o=m);var O=v+g.xAdvance,R=m+u;aA&&(A=C),CA&&(A=C),C0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,m=p.cutY,y=g.width,x=g.height,T=e._isTinted&&e.tintFill,w=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),b=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),S=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),E=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var A,_,C=0,M=0,P=0,O=0,R=e.letterSpacing,L=0,D=0,F=0,k=0,I=e.scrollX,B=e.scrollY,N=e.fontData,Y=N.chars,X=N.lineHeight,z=e.fontSize/N.size,U=0,G=e._align,W=0,V=0;e.getTextBounds(!1);var H=e._bounds.lines;1===G?V=(H.longest-H.lengths[0])/2:2===G&&(V=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;J0&&e.cropHeight>0&&(h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var F=0;F0&&(Y=Y%b-b):Y>b?Y=b:Y<0&&(Y=b+Y%b),null===_&&(_=new o(k+Math.cos(N)*B,I+Math.sin(N)*B,v),S.push(_),F+=.01);F<1+z;)w=Y*F+N,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,_.points.push(new r(x,T,v)),F+=.01;w=Y+N,x=k+Math.cos(w)*B,T=I+Math.sin(w)*B,_.points.push(new r(x,T,v));break;case n.FILL_RECT:u.setTexture2D(M),u.batchFillRect(p[++P],p[++P],p[++P],p[++P],f,c);break;case n.FILL_TRIANGLE:u.setTexture2D(M),u.batchFillTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],f,c);break;case n.STROKE_TRIANGLE:u.setTexture2D(M),u.batchStrokeTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],v,f,c);break;case n.LINE_TO:null!==_?_.points.push(new r(p[++P],p[++P],v)):(_=new o(p[++P],p[++P],v),S.push(_));break;case n.MOVE_TO:_=new o(p[++P],p[++P],v),S.push(_);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:k=p[++P],I=p[++P],f.translate(k,I);break;case n.SCALE:k=p[++P],I=p[++P],f.scale(k,I);break;case n.ROTATE:f.rotate(p[++P]);break;case n.SET_TEXTURE:var U=p[++P],G=p[++P];u.currentFrame=U,u.setTexture2D(U.glTexture,0),u.tintEffect=G,M=U.glTexture;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,u.tintEffect=2,M=t.blankTexture.glTexture}}}},function(t,e,i){var n=i(1),s=i(1);n=i(931),s=i(932),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(1),s=i(1);n=i(934),s=i(935),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){t.exports={GravityWell:i(375),Particle:i(376),ParticleEmitter:i(377),ParticleEmitterManager:i(190),Zones:i(941)}},function(t,e,i){var n=i(0),s=i(307),r=i(82),o=i(2),a=i(57),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&(this.has(t,"random")||this.hasBoth(t,"start","end")||this.hasBoth(t,"min","max"))){this.start=this.has(t,"start")?t.start:t.min,this.end=this.has(t,"end")?t.end:t.max;var i=this.hasBoth(t,"min","max")||!!t.random;if(i){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}if(this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){var n=i(1),s=i(1);n=i(939),s=i(940),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=e.emitters.list,a=o.length;if(0!==a){var h=this.pipeline,l=h._tempMatrix1.copyFrom(s.matrix),u=h._tempMatrix2,c=h._tempMatrix3,d=h._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);l.multiply(d),t.setPipeline(h);var f=s.roundPixels,p=e.defaultFrame.glTexture,g=n.getTintAppendFloatAlphaAndSwap;h.setTexture2D(p,0);for(var v=0;v?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(5);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,m={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},y=0,x=0;x0&&r.maxLines1&&(d+=f*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(1),s=i(1);n=i(950),s=i(951),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){if(0!==e.width&&0!==e.height){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a/e.style.resolution,h/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r)}}},function(t,e){t.exports=function(t,e,i,n,s){0!==e.width&&0!==e.height&&t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(0),s=i(14),r=i(5),o=i(953),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this._font,this.setStyle(e,!1,!0);var i=r(e,"metrics",!1);this.metrics=i?{ascent:r(i,"ascent",0),descent:r(i,"descent",0),fontSize:r(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?r(t,a[n][0],o):s(t,a[n][0],o)}var h=r(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=r(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,n="",s="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),n=r(t,"fontSize","16px"),s=r(t,"fontStyle","");else{var o=t.split(" "),a=0;s=o.length>2?o[a++]:"",n=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&n===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=n,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e,i){var n=i(25);t.exports=function(t){var e=n.create(this),i=e.getContext("2d");t.syncFont(e,i);var s=Math.ceil(i.measureText(t.testString).width*t.baselineX),r=s,o=2*r;r=r*t.baselineY|0,e.width=s,e.height=o,i.fillStyle="#f00",i.fillRect(0,0,s,o),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,r);var a={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,s,o))return a.ascent=r,a.descent=r+6,a.fontSize=a.ascent+a.descent,n.remove(e),a;var h,l,u=i.getImageData(0,0,s,o).data,c=u.length,d=4*s,f=0,p=!1;for(h=0;hr;h--){for(l=0;l0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0){var R=o.strokeTint,L=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(R.TL=L,R.TR=L,R.BL=L,R.BR=L,_=1;_0)for(n(h,e),_=0;_0)for(n(h,e,e.altFillColor,e.altFillAlpha*c),_=0;_0){for(s(h,e,e.outlineFillColor,e.outlineFillAlpha*c),A=1;Ao.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var m=o.vertexViewF32,y=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,T=0,w=e.tintFill,b=0;b0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(78);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e,i){var n=i(46);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(46);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e,i){var n=i(11);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(93);n.Area=i(1054),n.Circumference=i(373),n.CircumferencePoint=i(189),n.Clone=i(1055),n.Contains=i(94),n.ContainsPoint=i(1056),n.ContainsRect=i(1057),n.CopyFrom=i(1058),n.Equals=i(1059),n.GetBounds=i(1060),n.GetPoint=i(371),n.GetPoints=i(372),n.Offset=i(1061),n.OffsetPoint=i(1062),n.Random=i(153),t.exports=n},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(93);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(94);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(94);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e,i){var n=i(11);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(4),s=i(406);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0==(a=(o=-2*f)*o-4*(r=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new n(h,-o/(2*r))):a>0&&(i.push(new n(h,(-o+Math.sqrt(a))/(2*r))),i.push(new n(h,(-o-Math.sqrt(a))/(2*r))));else{var g=(l-d)/(u-f),v=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0==(a=(o=2*u*g-2*v*g-2*l)*o-4*(r=g*g+1)*(l*l+u*u+v*v-c*c-2*u*v))?(h=-o/(2*r),i.push(new n(h,v-h*g))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)),h=(-o-Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)))}}return i}},function(t,e,i){var n=i(198),s=i(407);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();n(r,t,i),n(o,t,i),n(a,t,i),n(h,t,i)}return i}},function(t,e,i){var n=i(11),s=i(131);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e,i){var n=i(200),s=i(131);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();n(r,e,i),n(o,e,i),n(a,e,i),n(h,e,i)}return i}},function(t,e,i){var n=i(409),s=i(200);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(r,t,i),s(o,t,i),s(a,t,i)}return i}},function(t,e,i){var n=i(198),s=i(411);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();n(r,e,i),n(o,e,i),n(a,e,i)}return i}},function(t,e,i){var n=i(414),s=i(412);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(t,r,i),s(t,o,i),s(t,a,i)}return i}},function(t,e,i){var n=i(416);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||si&&(i=h.x),h.xr&&(r=h.y),h.yn(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var n=i(163);t.exports=function(t,e,i){var s=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),n(t,s,r)}},function(t,e,i){var n=i(11),s=i(131);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){var n=i(4),s=i(35);t.exports=function(t,e,i){void 0===i&&(i=new n),e=s(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)-1&&(s.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,n=this.manager,s=n.pointers,r=n.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,n=!1,s=0;s0&&(n=!0)}return this._updatedThisFrame=!0,n},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,this.manager.resetCursor(i),t.input=null;var n=this._draggable.indexOf(t);return n>-1&&this._draggable.splice(n,1),(n=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(n,1),(n=this._over[0].indexOf(t))>-1&&this._over[0].splice(n,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=s?i=!0:n>0&&e>=t.downTime+n&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold||0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],n=0;n0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.x-a.dragStartXGlobal,c=t.y-a.dragStartYGlobal,f=o.getParentRotation(),p=u*Math.cos(f)+c*Math.sin(f),g=c*Math.cos(f)-u*Math.sin(f);s=p+a.dragStartX,r=g+a.dragStartY}else s=t.x-a.dragX,r=t.y-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,s,r),this.emit(d.DRAG,t,o,s,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var s=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e);for(var h=0;h0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,o=!1,h=!1,l=!0;if(m(e)){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),n=p(u,"draggable",!1),s=p(u,"dropZone",!1),r=p(u,"cursor",!1),o=p(u,"useHandCursor",!1),h=p(u,"pixelPerfect",!1);var c=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d=e}}},function(t,e,i){t.exports={Events:i(133),KeyboardManager:i(341),KeyboardPlugin:i(1175),Key:i(429),KeyCodes:i(122),KeyCombo:i(430),JustDown:i(1180),JustUp:i(1181),DownDuration:i(1182),UpDuration:i(1183)}},function(t,e){t.exports="keydown"},function(t,e){t.exports="keyup"},function(t,e){t.exports="keycombomatch"},function(t,e){t.exports="down"},function(t,e){t.exports="keydown-"},function(t,e){t.exports="keyup-"},function(t,e){t.exports="up"},function(t,e,i){var n=i(0),s=i(10),r=i(133),o=i(18),a=i(5),h=i(54),l=i(132),u=i(429),c=i(122),d=i(430),f=i(1179),p=i(91),g=new n({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.useQueue?this.sceneInputPlugin.pluginEvents.on(h.UPDATE,this.update,this):this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n={};if("string"==typeof t){t=t.split(",");for(var s=0;s-1?n[s]=t:n[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),n[t]||(n[t]=new u(this,t),e&&this.addCapture(t),n[t].setEmitOnRepeat(i)),n[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,n=this.keys;if(t instanceof u){var s=n.indexOf(t);s>-1&&(i=this.keys[s],this.keys[s]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(i=n[t],n[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},createCombo:function(t,e){return new d(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=p(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e,i){var n=i(122),s={};for(var r in n)s[n[r]]=r;t.exports=s},function(t,e){t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},function(t,e){t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.sizei&&(n=t,i=e)}),n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,n,s,r){return u(this.world,t,e,i,n,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(d.UPDATE,this.world.update,this.world),t.off(d.POST_UPDATE,this.world.postUpdate,this.world),t.off(d.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(d.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){var i={enableBody:function(t,e,i,n,s){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),s&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=i},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){var i={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=i},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){t.exports=function(t,e,i,n,s,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+n,l.maxY=i+s,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+n,bottom:i+s,isCircle:!1},d=t.intersects;u.iterate(function(t){d(t,c)&&a.push(t)})}return h.concat(a)}},function(t,e){t.exports="collide"},function(t,e){t.exports="overlap"},function(t,e){t.exports="pause"},function(t,e){t.exports="resume"},function(t,e){t.exports="tilecollide"},function(t,e){t.exports="tileoverlap"},function(t,e){t.exports="worldbounds"},function(t,e){t.exports="worldstep"},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e,i){var n=i(1236),s=i(1238),r=i(447);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,f=o.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var v=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&!t.blocked.right&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(1239);t.exports=function(t,e,i,s,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&!t.blocked.up&&c&&t.checkCollision.up?l&&t.y0&&!t.blocked.down&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(443);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e,i){var n=i(444);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){t.exports={COLLIDE:i(1356),PAUSE:i(1357),RESUME:i(1358)}},function(t,e,i){t.exports={Acceleration:i(1360),BodyScale:i(1361),BodyType:i(1362),Bounce:i(1363),CheckAgainst:i(1364),Collides:i(1365),Debug:i(1366),Friction:i(1367),Gravity:i(1368),Offset:i(1369),SetGameObject:i(1370),Velocity:i(1371)}},function(t,e,i){var n={};t.exports=n;var s=i(99),r=i(37);n.fromVertices=function(t){for(var e={},i=0;i0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,r=n.rectangle(i,s,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),u=this.tile.getCollisionGroup(),c=a(u,"objects",[]),d=[],f=0;f1&&(t.parts=d,this.setBody(s.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(1248),r=i(491),o=i(100);n.collisions=function(t,e){for(var i=[],a=e.pairs.table,h=e.metrics,l=0;l1?1:0;d1?1:0;p0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n={};t.exports=n;var s=i(86),r=i(99);n.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,f=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&f<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var p=l.axisBody,g=p===t?e:t,v=[p.axes[i.axisNumber]];if(h=n._overlapAxes(p.vertices,g.vertices,v),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlaps?s=a:a=0?o.index-1:u.length-1],l.x=s.x-c.x,l.y=s.y-c.y,h=-r.dot(i,l),a=s,s=u[(o.index+1)%u.length],l.x=s.x-c.x,l.y=s.y-c.y,(n=-r.dot(i,l))r?(s.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),r=s.topologicalSort(i),o=[],a=0;a0&&!h.silent&&s.info(o.join(" "))}else s.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=n.resolve(t)||t,e[r]=s.map(t.uses||[],function(e){n.isPlugin(e)&&n.register(e);var r=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,r.range)?(s.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(r),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(s.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),r.name});for(var o=0;o=s[2];if("^"===i.operator)return s[0]>0?o[0]===s[0]&&r.number>=i.number:s[1]>0?o[1]===s[1]&&o[2]>=s[2]:o[2]===s[2]}return t===e||"*"===t}},function(t,e,i){var n={};t.exports=n;var s=i(211),r=(i(231),i(37));n.create=function(t){var e=s.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},function(t,e,i){t.exports={BasePlugin:i(452),DefaultPlugins:i(172),PluginCache:i(19),PluginManager:i(345),ScenePlugin:i(1253)}},function(t,e,i){var n=i(452),s=i(0),r=i(20),o=new s({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){}});t.exports=o},function(t,e,i){var n=i(15),s=i(174),r={Center:i(334),Events:i(90),Orientation:i(335),ScaleManager:i(346),ScaleModes:i(336),Zoom:i(337)};r=n(!1,r=n(!1,r=n(!1,r=n(!1,r,s.CENTER),s.ORIENTATION),s.SCALE_MODE),s.ZOOM),t.exports=r},function(t,e,i){var n=i(123),s=i(15),r={Events:i(20),SceneManager:i(348),ScenePlugin:i(1256),Settings:i(350),Systems:i(177)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(24),s=i(0),r=i(20),o=i(2),a=i(19),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var s=o(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=n,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake():this.manager.start(e,o(t,"data")),this.systems.events.emit(r.TRANSITION_OUT,i,n),this.systems.events.on(r.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},function(t,e,i){t.exports={List:i(126),Map:i(158),ProcessQueue:i(445),RTree:i(446),Set:i(106),Size:i(347)}},function(t,e,i){var n=i(15),s=i(1259),r={CanvasTexture:i(352),Events:i(119),FilterMode:s,Frame:i(92),Parsers:i(354),Texture:i(179),TextureManager:i(351),TextureSource:i(353)};r=n(!1,r,s),t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){t.exports={Components:i(137),Parsers:i(1290),Formats:i(30),ImageCollection:i(463),ParseToTilemap:i(218),Tile:i(73),Tilemap:i(472),TilemapCreator:i(1299),TilemapFactory:i(1300),Tileset:i(141),LayerData:i(102),MapData:i(103),ObjectLayer:i(466),DynamicTilemapLayer:i(473),StaticTilemapLayer:i(474)}},function(t,e,i){var n=i(23),s=i(52);t.exports=function(t,e,i,r,o,a,h,l){t<0&&(t=0),e<0&&(e=0),void 0===h&&(h=!0);for(var u=n(t,e,i,r,null,l),c=o-t,d=a-e,f=0;f=0&&p=0&&g=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=y;a--)for(o=v;c[a]&&o=y;a--)for(o=m;c[a]&&o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(23),s=i(52),r=i(72);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=n(e,i,o,a,null,l),d=0;d=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;re)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(72),s=i(52),r=i(214);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,r=t.length;s0&&(t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix);var u=t.currentContext,c=e.gidMap;u.save(),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l),l.copyToContext(u)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,h.copyToContext(u));var d=n.alpha*e.alpha;u.globalAlpha=n.alpha*e.alpha;for(var f=0;f-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t-1&&(e.state=u.REMOVED,s.splice(r,1)):(e.state=u.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;tS&&(S=_),b[E][A]=_}}}var C=r?n(r):null;return o?function(t,e,n,s){var r,o=0,a=s%v,h=Math.floor(s/v);if(a>=0&&a=0&&h>2],r+=i[(3&n[o])<<4|n[o+1]>>4],r+=i[(15&n[o+1])<<2|n[o+2]>>6],r+=i[63&n[o+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},function(t,e,i){t.exports={Clone:i(65),Extend:i(15),GetAdvancedValue:i(14),GetFastValue:i(2),GetMinMaxValue:i(1325),GetValue:i(5),HasAll:i(1326),HasAny:i(380),HasValue:i(97),IsPlainObject:i(7),Merge:i(105),MergeRight:i(1327),Pick:i(464),SetValue:i(401)}},function(t,e,i){var n=i(5),s=i(24);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=n(t,e,o);return s(a,i,r)}},function(t,e){t.exports=function(t,e){for(var i=0;i=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=h},function(t,e,i){var n=i(0),s=i(1359),r=new n({initialize:function(t,e){void 0===t&&(t=32),this.tilesize=t,this.data=Array.isArray(e)?e:[],this.width=Array.isArray(e)?e[0].length:0,this.height=Array.isArray(e)?e.length:0,this.lastSlope=55,this.tiledef=s},trace:function(t,e,i,n,s,r){var o={collision:{x:!1,y:!1,slope:!1},pos:{x:t+i,y:e+n},tile:{x:0,y:0}};if(!this.data)return o;var a=Math.ceil(Math.max(Math.abs(i),Math.abs(n))/this.tilesize);if(a>1)for(var h=i/a,l=n/a,u=0;u0?r:0,m=n<0?f:0,y=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var T=Math.floor((e+v)/f);if((l>0||u===T||T<0||T>=p)&&(T=-1),u>=0&&u1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,T,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+m,e=t.pos.x,a=0;break}}if(s){var w=s>0?o:0,b=s<0?f:0,S=Math.max(Math.floor(t.pos.x/f),0),E=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+w)/f);var A=Math.floor((i+w)/f);if((l>0||c===A||A<0||A>=g)&&(A=-1),c>=0&&c1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,A));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-w+b;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],m=i+s+(g<0?o:0)-d,y=n+r+(p>0?a:0)-f;if(p*y-g*m>0){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),T=g/x,w=-p/x,b=m*T+y*w,S=T*b,E=w*b;return S*S+E*E>=s*s+r*r?v||p*(y-r)-g*(m-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-E,t.collision.slope={x:p,y:g,nx:T,ny:w},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),s=i(1335),r=i(1336),o=i(1337),a=new n({initialize:function(t){this.world=t,this.sys=t.scene.sys},body:function(t,e,i,n){return new s(this.world,t,e,i,n)},existing:function(t){var e=t.x-t.frame.centerX,i=t.y-t.frame.centerY,n=t.width,s=t.height;return t.body=this.world.create(e,i,n,s),t.body.parent=t,t.body.gameObject=t,t},image:function(t,e,i,n){var s=new r(this.world,t,e,i,n);return this.sys.displayList.add(s),s},sprite:function(t,e,i,n){var s=new o(this.world,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),s},destroy:function(){this.world=null,this.sys=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1243),r=new n({Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){this.body=t.create(e,i,n,s),this.body.parent=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=r},function(t,e,i){var n=i(0),s=i(1243),r=i(96),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(0),s=i(1243),r=i(68),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(1332),s=i(0),r=i(449),o=i(1333),a=i(10),h=i(1242),l=i(2),u=i(97),c=i(106),d=i(1373),f=i(30),p=i(450),g=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.bodies=new c,this.gravity=l(e,"gravity",0),this.cellSize=l(e,"cellSize",64),this.collisionMap=new o,this.timeScale=l(e,"timeScale",1),this.maxStep=l(e,"maxStep",.05),this.enabled=!0,this.drawDebug=l(e,"debug",!1),this.debugGraphic;var i=l(e,"maxVelocity",100);if(this.defaults={debugShowBody:l(e,"debugShowBody",!0),debugShowVelocity:l(e,"debugShowVelocity",!0),bodyDebugColor:l(e,"debugBodyColor",16711935),velocityDebugColor:l(e,"debugVelocityColor",65280),maxVelocityX:l(e,"maxVelocityX",i),maxVelocityY:l(e,"maxVelocityY",i),minBounceVelocity:l(e,"minBounceVelocity",40),gravityFactor:l(e,"gravityFactor",1),bounciness:l(e,"bounciness",0)},this.walls={left:null,right:null,top:null,bottom:null},this.delta=0,this._lastId=0,l(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var s=l(n,"x",0),r=l(n,"y",0),h=l(n,"width",t.sys.scale.width),u=l(n,"height",t.sys.scale.height),d=l(n,"thickness",64),f=l(n,"left",!0),p=l(n,"right",!0),g=l(n,"top",!0),v=l(n,"bottom",!0);this.setBounds(s,r,h,u,d,f,p,g,v)}}this.drawDebug&&this.createDebugGraphic()},setCollisionMap:function(t,e){if("string"==typeof t){var i=this.scene.cache.tilemap.get(t);if(!i||i.format!==f.WELTMEISTER)return console.warn("The specified key does not correspond to a Weltmeister tilemap: "+t),null;for(var n,s=i.data.layer,r=0;rr.ACTIVE&&d(this,t,e))},setCollidesNever:function(t){for(var e=0;e=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function r(t,e,i){return s(t,e,i)>0}function o(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function h(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){var i=[],n=[],s=[],r=[];var o=Number.MAX_VALUE;for(var a=0;a0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;su)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LA&&(A+=e.length),E=Number.MAX_VALUE,A<_)return i;for(var D=_;D<=A;++D)o(f(O,L-1),f(O,L),f(O,D))&&h(f(O,L+1),f(O,L),f(O,D))&&(S=d(f(O,L),f(O,D)))3&&n>=0;--n)c(f(t,n-1),f(t,n),f(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var n=t[i],s=i-1;s>=0;--s)S(n,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,n=1;ni[e][0])&&(e=n);return!r(f(t,e-1),f(t,e),f(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var l=[],u=[];function c(t,e,i,n){if(n){var r=l,o=u;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*c))g&&(g=y),a.translate(m,{x:.5*x,y:.5*y}),c=m.bounds.max.x+r,s.addBody(u,m),l=m,f+=1}else c+=r}d+=g+o,c=t}return u},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),n&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,n,o,l,u,c)})},n.newtonsCradle=function(t,e,i,n,o){for(var a=s.create({label:"Newtons Cradle"}),l=0;lu.bounds.max.x||p.bounds.max.yu.bounds.max.y)){var g=n._getRegion(t,p);if(!p.region||g.id!==p.region.id||s){f.broadphaseTests+=1,p.region&&!s||(p.region=g);var v=n._regionUnion(g,p.region);for(o=v.startCol;o<=v.endCol;o++)for(a=v.startRow;a<=v.endRow;a++){h=c[l=n._getBucketId(o,a)];var m=o>=g.startCol&&o<=g.endCol&&a>=g.startRow&&a<=g.endRow,y=o>=p.region.startCol&&o<=p.region.endCol&&a>=p.region.startRow&&a<=p.region.endRow;!m&&y&&y&&h&&n._bucketRemoveBody(t,h,p),(p.region===g||m&&!y||s)&&(h||(h=n._createBucket(c,l)),n._bucketAddBody(t,h,p))}p.region=g,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),s=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,s,r,o)},n._getRegion=function(t,e){var i=e.bounds,s=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(s,r,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n0?n.push(i):delete t.pairs[e[s]];return n}},function(t,e,i){var n={};t.exports=n;var s=i(491),r=i(37);n._pairMaxIdleLife=1e3,n.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;an._pairMaxIdleLife&&l.push(o);for(o=0;of.friction*f.frictionStatic*F*i&&(I=R,k=o.clamp(f.friction*L*i,-I,I));var B=r.cross(E,m),N=r.cross(A,m),Y=T/(g.inverseMass+v.inverseMass+g.inverseInertia*B*B+v.inverseInertia*N*N);if(D*=Y,k*=Y,P<0&&P*P>n._restingThresh*i)b.normalImpulse=0;else{var X=b.normalImpulse;b.normalImpulse=Math.min(b.normalImpulse+D,0),D=b.normalImpulse-X}if(O*O>n._restingThreshTangent*i)b.tangentImpulse=0;else{var z=b.tangentImpulse;b.tangentImpulse=o.clamp(b.tangentImpulse+k,-I,I),k=b.tangentImpulse-z}s.x=m.x*D+y.x*k,s.y=m.y*D+y.y*k,g.isStatic||g.isSleeping||(g.positionPrev.x+=s.x*g.inverseMass,g.positionPrev.y+=s.y*g.inverseMass,g.anglePrev+=r.cross(E,s)*g.inverseInertia),v.isStatic||v.isSleeping||(v.positionPrev.x-=s.x*v.inverseMass,v.positionPrev.y-=s.y*v.inverseMass,v.anglePrev-=r.cross(A,s)*v.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var s=i(1251),r=i(451),o=i(1348),a=i(1347),h=i(1404),l=i(1346),u=i(230),c=i(211),d=i(231),f=i(37),p=i(61);n.create=function(t,e){e=f.isElement(t)?e:t,t=f.isElement(t)?t:null,e=e||{},(t||e.render)&&f.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:l}},n=f.extend(i,e);if(t||n.render){var r={element:t,controller:Render};n.render=f.extend(r,n.render)}return n.render&&n.render.controller&&(n.render=n.render.controller.create(n.render)),n.render&&(n.render.engine=n),n.world=e.world||s.create(n.world),n.pairs=a.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n.metrics=h.create(n.metrics),n},n.update=function(t,e,i){e=e||1e3/60,i=i||1;var s,l=t.world,f=t.timing,p=t.broadphase,g=[];f.timestamp+=e*f.timeScale;var v={timestamp:f.timestamp};u.trigger(t,"beforeUpdate",v);var m=c.allBodies(l),y=c.allConstraints(l);for(h.reset(t.metrics),t.enableSleeping&&r.update(m,f.timeScale),n._bodiesApplyGravity(m,l.gravity),n._bodiesUpdate(m,e,f.timeScale,i,l.bounds),d.preSolveAll(m),s=0;s0&&u.trigger(t,"collisionStart",{pairs:T.collisionStart}),o.preSolvePosition(T.list),s=0;s0&&u.trigger(t,"collisionActive",{pairs:T.collisionActive}),T.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:T.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(m),u.trigger(t,"afterUpdate",v),t},n.merge=function(t,e){if(f.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=c.allBodies(t.world),s=0;s0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_START,e,i,n)}),p.on(e,"collisionActive",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_ACTIVE,e,i,n)}),p.on(e,"collisionEnd",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_END,e,i,n)})},setBounds:function(t,e,i,n,s,r,o,a,h){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),void 0===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e-s,s,n+2*s),this.updateWall(o,"right",t+i,e-s,s,n+2*s),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?(o&&v.remove(this.localWorld,o),i+=s/2,n+=r/2,this.walls[e]=this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&v.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,s,r){var o=n.rectangle(t,e,i,s,r);return v.add(this.localWorld,o),o},add:function(t){return v.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return a.remove(this.localWorld,i,e),this},removeConstraint:function(t,e){return a.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i1?1:0;r1?1:0;s0?e-o:e+o<0?e+o:0}return n(e,-r,r)}},function(t,e){t.exports=function(t,e){if(t.standing=!1,e.collision.y&&(t.bounciness>0&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(t.vel.y>0&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(t.bounciness>0&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(t.bounciness>0){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&oi.last.x&&e.last.xi.last.y&&e.last.y0))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,e.bounciness>0&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e,i){t.exports={Factory:i(1339),Image:i(1343),Matter:i(1249),MatterPhysics:i(1406),PolyDecomp:i(1340),Sprite:i(1344),TileBody:i(1246),PhysicsEditorParser:i(1342),World:i(1350)}},function(t,e,i){var n=i(490),s=i(2),r=i(3);t.exports=function(t,e,i){void 0===i&&(i={});var o=e.x,a=e.y;if(e.body={temp:!0,position:{x:o,y:a}},[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity].forEach(function(t){for(var i in t)(n=t[i]).get&&"function"==typeof n.get||n.set&&"function"==typeof n.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var n}),e.world=t,e._tempVec2=new r(o,a),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,!0);else{var h=s(i,"shape",null);h||(h="rectangle"),e.setBody(h,i)}return e}},function(t,e){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},function(t,e){var i={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i1?1:0;n1;if(!d||t!=d.x||e!=d.y){d&&n?(f=d.x,p=d.y):(f=0,p=0);var s={x:f+t,y:p+e};!n&&d||(d=s),g.push(s),m=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":m=t.x,y=t.y;break;case"H":m=t.x;break;case"V":y=t.y}x(m,y,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i0)for(var a=s+1;ae.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y (http://www.photonstorm.com)", "homepage": "http://phaser.io", @@ -28,10 +28,15 @@ "plugin.spine": "webpack --config plugins/spine/webpack.config.js", "plugin.spine.dist": "webpack --config plugins/spine/webpack.auto.dist.config.js", "plugin.spine.watch": "webpack --config plugins/spine/webpack.auto.config.js --watch --display-modules", + "plugin.spine.dev": "webpack --config plugins/spine/webpack.auto.config.js", "plugin.spine.canvas.dist": "webpack --config plugins/spine/webpack.canvas.dist.config.js", "plugin.spine.canvas.watch": "webpack --config plugins/spine/webpack.canvas.config.js --watch --display-modules", + "plugin.spine.canvas.dev": "webpack --config plugins/spine/webpack.canvas.config.js", "plugin.spine.webgl.dist": "webpack --config plugins/spine/webpack.webgl.dist.config.js", - "plugin.spine.webgl.watch": "webpack --config plugins/spine/webpack.webgl.config.js --watch", + "plugin.spine.webgl.watch": "webpack --config plugins/spine/webpack.webgl.config.js --watch --display-modules", + "plugin.spine.webgl.dev": "webpack --config plugins/spine/webpack.webgl.config.js", + "plugin.spine.full": "npm run plugin.spine.dev && npm run plugin.spine.canvas.dev && npm run plugin.spine.webgl.dev", + "plugin.spine.full.dist": "npm run plugin.spine.dist && npm run plugin.spine.canvas.dist && npm run plugin.spine.webgl.dist", "lint": "eslint --config .eslintrc.json \"src/**/*.js\"", "lintfix": "eslint --config .eslintrc.json \"src/**/*.js\" --fix", "sloc": "node-sloc \"./src\" --include-extensions \"js\"", @@ -74,6 +79,7 @@ "imports-loader": "^0.8.0", "jsdoc": "^3.6.1", "path": "^0.12.7", + "remove-files-webpack-plugin": "^1.1.3", "typescript": "^3.4.5" } } diff --git a/plugins/spine/copy-to-examples.js b/plugins/spine/copy-to-examples.js index e4efae47b..2b0382953 100644 --- a/plugins/spine/copy-to-examples.js +++ b/plugins/spine/copy-to-examples.js @@ -11,3 +11,10 @@ else { console.log('Copy-to-Examples failed: Phaser 3 Examples not present at ../phaser3-examples'); } + +dest = '../100-phaser3-snippets/public/libs/'; + +if (fs.existsSync(dest)) +{ + fs.copySync(source, dest, { overwrite: true }); +} diff --git a/plugins/spine/dist/SpineCanvasPlugin.js b/plugins/spine/dist/SpineCanvasPlugin.js new file mode 100644 index 000000000..20d176c2f --- /dev/null +++ b/plugins/spine/dist/SpineCanvasPlugin.js @@ -0,0 +1,28428 @@ +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 = 32); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// 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; +} + +/** + * Extends the given `myClass` object's prototype with the properties of `definition`. + * + * @function extend + * @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. + */ +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]; + } + } +} + +/** + * Applies the given `mixins` to the prototype of `myClass`. + * + * @function mixin + * @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) + { + return; + } + + if (!Array.isArray(mixins)) + { + mixins = [ mixins ]; + } + + 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; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + +}; + +module.exports = MATH_CONST; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 (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; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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 2D space. + * + * A two-component vector. + * + * @class Vector2 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties. + * @param {number} [y] - 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.Math.Vector2} 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.Math.Vector2} 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)); + }, + + /** + * 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; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector2#add + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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); + }, + + /** + * 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; + }, + + /** + * Right-hand normalize (make unit length) this Vector. + * + * @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; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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; + } + +}); + +/** + * 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; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {integer} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {integer} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {integer} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started + * + * @name Phaser.Loader.FILE_PENDING + * @type {integer} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing + * + * @name Phaser.Loader.FILE_LOADED + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load + * + * @name Phaser.Loader.FILE_FAILED + * @type {integer} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {integer} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {integer} + * @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 {integer} + * @since 3.0.0 + */ + FILE_POPULATED: 19 + +}; + +module.exports = FILE_CONST; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(1); + +/** + * 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; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(1); + +/** + * 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 {integer} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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; + }, + + /** + * 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); + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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 Matrix. + * + * @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; + }, + + /** + * 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; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Source object +// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' +// The default value to use if the key doesn't exist + +/** + * Retrieves a value from an object. + * + * @function Phaser.Utils.Objects.GetValue + * @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 GetValue = function (source, key, defaultValue) +{ + if (!source || typeof source === 'number') + { + return defaultValue; + } + else if (source.hasOwnProperty(key)) + { + return source[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parent = source; + var value = defaultValue; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parent.hasOwnProperty(keys[i])) + { + // Yes it has a key property, let's carry on down + value = parent[keys[i]]; + + parent = parent[keys[i]]; + } + else + { + // Can't go any further, so reset to default + value = defaultValue; + break; + } + } + + return value; + } + else + { + return defaultValue; + } +}; + +module.exports = GetValue; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(6); +var Events = __webpack_require__(170); +var GetFastValue = __webpack_require__(3); +var GetURL = __webpack_require__(181); +var MergeXHRSettings = __webpack_require__(29); +var XHRLoader = __webpack_require__(182); +var XHRSettings = __webpack_require__(30); + +/** + * @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); + + /** + * 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.type || !this.key) + { + throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + } + + /** + * The URL of the file, not including baseURL. + * Automatically has Loader.path prepended to it. + * + * @name Phaser.Loader.File#url + * @type {string} + * @since 3.0.0 + */ + this.url = GetFastValue(fileConfig, 'url'); + + if (this.url === undefined) + { + this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof(this.url) !== 'function') + { + this.url = loader.path + this.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 {integer} + * @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.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 localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && 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.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 () + { + 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.cache.add(this.key, this.data); + } + + this.pendingDestroy(); + }, + + /** + * 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 (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); + }, + + /** + * 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; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsPlainObject = __webpack_require__(2); + +// @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 + * + * @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; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathWrap = __webpack_require__(4); + +/** + * 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; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(4); + +/** + * 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; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Factorial = __webpack_require__(20); + +/** + * [description] + * + * @function Phaser.Math.Bernstein + * @since 3.0.0 + * + * @param {number} n - [description] + * @param {number} i - [description] + * + * @return {number} [description] + */ +var Bernstein = function (n, i) +{ + return Factorial(n) / Factorial(i) / Factorial(n - i); +}; + +module.exports = Bernstein; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a Catmull-Rom value. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - [description] + * @param {number} p0 - [description] + * @param {number} p1 - [description] + * @param {number} p2 - [description] + * @param {number} p3 - [description] + * + * @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; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(1); + +/** + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {integer} 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; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - [description] + * + * @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; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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 EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * @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); + }, + + // TODO - Should work with basic values + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + 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]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + 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]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * 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 () + { + var out = this.val; + + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 0; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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 null; + } + + det = 1 / det; + + a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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]; + + a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); + a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); + a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); + a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); + a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); + a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); + a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); + a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - [description] + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = []; + var m1 = this.val; + var m2 = src.val; + + a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; + a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; + a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; + a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; + + a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; + a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; + a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; + a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; + + a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; + a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; + a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; + a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; + + a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; + a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; + a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; + a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; + + return this.fromArray(a); + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + translate: function (v) + { + var x = v.x; + var y = v.y; + var z = v.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; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + scale: function (v) + { + var x = v.x; + var y = v.y; + var z = v.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; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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; + + this.fromArray([ + 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 + ]); + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 null; + } + + 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]; + + // 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 + a[0] = a00 * b00 + a10 * b01 + a20 * b02; + a[1] = a01 * b00 + a11 * b01 + a21 * b02; + a[2] = a02 * b00 + a12 * b01 + a22 * b02; + a[3] = a03 * b00 + a13 * b01 + a23 * b02; + a[4] = a00 * b10 + a10 * b11 + a20 * b12; + a[5] = a01 * b10 + a11 * b11 + a21 * b12; + a[6] = a02 * b10 + a12 * b11 + a22 * b12; + a[7] = a03 * b10 + a13 * b11 + a23 * b12; + a[8] = a00 * b20 + a10 * b21 + a20 * b22; + a[9] = a01 * b20 + a11 * b21 + a21 * b22; + a[10] = a02 * b20 + a12 * b21 + a22 * b22; + a[11] = a03 * b20 + a13 * b21 + a23 * b22; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var out = this.val; + + 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; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = v.x; + out[13] = v.y; + out[14] = v.z; + out[15] = 1; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + fromQuat: function (q) + { + var out = this.val; + + 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; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var out = this.val; + + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + out[0] = (near * 2) * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (near * 2) * tb; + out[6] = 0; + out[7] = 0; + + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (far * near * 2) * nf; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var out = this.val; + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (2 * far * near) * nf; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + var out = this.val; + + out[0] = (2 * near) / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (2 * near) / height; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = -far / (near - far); + out[11] = 1; + + out[12] = 0; + out[13] = 0; + out[14] = (near * far) / (near - far); + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var out = this.val; + 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; + + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + + 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 {Phaser.Math.Matrix4} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var out = this.val; + + 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; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + + return this; + }, + + /** + * 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 - [description] + * @param {number} pitch - [description] + * @param {number} roll - [description] + * + * @return {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 !== undefined) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix !== undefined) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + } + +}); + +var _tempMat1 = new Matrix4(); +var _tempMat2 = new Matrix4(); + +module.exports = Matrix4; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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 Vector3 = __webpack_require__(10); +var Matrix3 = __webpack_require__(26); + +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] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + * @param {number} [w] - 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 + * @since 3.0.0 + */ + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.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; + } + }, + + /** + * 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) + { + this.x = src.x; + this.y = src.y; + this.z = src.z; + this.w = src.w; + + return this; + }, + + /** + * Set the components of this Quaternion. + * + * @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. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + 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 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; + + 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; + + 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; + + 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; + } + + 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; + + 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Quaternion#rotationTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - [description] + * @param {Phaser.Math.Vector3} b - [description] + * + * @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) + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + } + 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 () + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + }, + + /** + * 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); + + this.x = s * axis.x; + this.y = s * axis.y; + this.z = s * axis.z; + this.w = Math.cos(rad); + + return this; + }, + + /** + * 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; + + this.x = ax * bw + aw * bx + ay * bz - az * by; + this.y = ay * bw + aw * by + az * bx - ax * bz; + this.z = az * bw + aw * bz + ax * by - ay * bx; + this.w = aw * bw - ax * bx - ay * by - az * bz; + + return this; + }, + + /** + * 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 + this.x = scale0 * ax + scale1 * bx; + this.y = scale0 * ay + scale1 * by; + this.z = scale0 * az + scale1 * bz; + this.w = scale0 * aw + scale1 * bw; + + return this; + }, + + /** + * 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; + + // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + this.x = -a0 * invDot; + this.y = -a1 * invDot; + this.z = -a2 * invDot; + this.w = a3 * invDot; + + return this; + }, + + /** + * 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; + + 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); + + this.x = ax * bw + aw * bx; + this.y = ay * bw + az * bx; + this.z = az * bw - ay * bx; + this.w = aw * bw - ax * bx; + + return this; + }, + + /** + * 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); + + this.x = ax * bw - az * by; + this.y = ay * bw + aw * by; + this.z = az * bw + ax * by; + this.w = aw * bw - ay * by; + + return this; + }, + + /** + * 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); + + this.x = ax * bw + ay * bz; + this.y = ay * bw - ax * bz; + this.z = az * bw + aw * bz; + this.w = aw * bw - az * bz; + + return this; + }, + + /** + * 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; + }, + + /** + * 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; + } + + return this; + } + +}); + +module.exports = Quaternion; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(14); +var XHRSettings = __webpack_require__(30); + +/** + * 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; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [timeout=0] - Optional XHR timeout value. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + */ +var XHRSettings = function (responseType, async, user, password, timeout) +{ + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } + + // 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 + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined + + }; +}; + +module.exports = XHRSettings; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var BuildGameObject = __webpack_require__(33); +var Class = __webpack_require__(0); +var GetValue = __webpack_require__(11); +var ResizeEvent = __webpack_require__(144); +var ScenePlugin = __webpack_require__(145); +var Spine = __webpack_require__(167); +var SpineFile = __webpack_require__(168); +var SpineGameObject = __webpack_require__(186); + +/** + * @classdesc + * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game objects. + * + * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin + * uses the Spine 3.7 runtimes. Files created in a more recent version of Spine may not work as a result. + * + * You can find more details about Spine at http://esotericsoftware.com/. + * + * 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. + * + * 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 a Game Object Factory method, allowin you to create Spine Game Objects: + * + * ```javascript + * this.add.spine(512, 650, 'stretchyman') + * ``` + * + * 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 preMultipiedAlpha 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. + * + * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference + * + * @class SpinePlugin + * @memberOf Phaser + * @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. + */ +var SpinePlugin = new Class({ + + Extends: ScenePlugin, + + initialize: + + function SpinePlugin (scene, pluginManager) + { + ScenePlugin.call(this, scene, pluginManager); + + 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. + * + * 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; + } + + pluginManager.registerFileType('spine', this.spineFileCallback, scene); + + pluginManager.registerGameObject('spine', this.add.bind(this), this.make.bind(this)); + }, + + /** + * 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); + }, + + /** + * 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 () + { + this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + + // Monkeypatch the Spine setBlendMode functions, or batching is destroyed + + var setBlendMode = function (srcBlend, dstBlend) + { + if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend) + { + var gl = this.context.gl; + + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + + if (this.isDrawing) + { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + } + }; + + this.sceneRenderer.batcher.setBlendMode = setBlendMode; + this.sceneRenderer.shapes.setBlendMode = setBlendMode; + + this.skeletonRenderer = this.sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = this.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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage()); + + spineTextures.add(key, canvasTexture); + + return canvasTexture; + }); + } + + 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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + var gl = this.sceneRenderer.context.gl; + + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage(), false); + + spineTextures.add(key, glTexture); + + return glTexture; + }); + } + + 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 preMultipiedAlpha 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#addFileEvent + * @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} [preMultipiedAlpha=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. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ + spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings) + { + var multifile; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new SpineFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; + }, + + /** + * 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. + */ + add: function (x, y, key, animationName, loop) + { + var spineGO = new SpineGameObject(this.scene, this, x, y, key, animationName, loop); + + this.scene.sys.displayList.add(spineGO); + this.scene.sys.updateList.add(spineGO); + + return spineGO; + }, + + /** + * 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. + */ + 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 spineGO = new SpineGameObject(this.scene, this, 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(); + }, + + /** + * 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 Spine.Vector2(temp2.x, temp2.y); + } + else if (bone) + { + return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y); + } + else + { + return new Spine.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 Spine.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; + } + + var preMultipliedAlpha = atlasData.preMultipliedAlpha; + + var atlasLoader = new Spine.AtlasAttachmentLoader(atlas); + + var skeletonJson = new Spine.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 Spine.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 Spine.AnimationStateData(skeleton.data); + + var state = new Spine.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 Spine.Vector2(); + var size = new Spine.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.viewportWidth = viewportWidth; + sceneRenderer.camera.viewportHeight = 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); + + this.sceneRenderer.dispose(); + }, + + /** + * 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.pluginManager.removeGameObject('spine', true, true); + + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; + + this.cache = null; + this.spineTextures = null; + this.json = null; + this.textures = null; + this.sceneRenderer = null; + this.skeletonRenderer = null; + this.gl = null; + } + +}); + +module.exports = SpinePlugin; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(34); +var GetAdvancedValue = __webpack_require__(35); +var ScaleModes = __webpack_require__(143); + +/** + * 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); + } + + // ScaleMode + + gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT); + + // 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; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + DIFFERENCE: 11, + + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + * + * @name Phaser.BlendModes.EXCLUSION + * @type {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + LUMINOSITY: 16, + + /** + * Alpha erase blend mode. For Canvas and WebGL. + * + * @name Phaser.BlendModes.ERASE + * @type {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + LIGHTER: 25, + + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + * + * @name Phaser.BlendModes.COPY + * @type {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + XOR: 27 + +}; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH = __webpack_require__(36); +var GetValue = __webpack_require__(11); + +/** + * 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; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(1); +var Extend = __webpack_require__(14); + +/** + * @namespace Phaser.Math + */ + +var PhaserMath = { + + // Collections of functions + Angle: __webpack_require__(37), + Distance: __webpack_require__(44), + Easing: __webpack_require__(48), + Fuzzy: __webpack_require__(93), + Interpolation: __webpack_require__(99), + Pow2: __webpack_require__(107), + Snap: __webpack_require__(111), + + // Expose the RNG Class + RandomDataGenerator: __webpack_require__(115), + + // Single functions + Average: __webpack_require__(116), + Bernstein: __webpack_require__(19), + Between: __webpack_require__(117), + CatmullRom: __webpack_require__(21), + CeilTo: __webpack_require__(118), + Clamp: __webpack_require__(8), + DegToRad: __webpack_require__(25), + Difference: __webpack_require__(119), + Factorial: __webpack_require__(20), + FloatBetween: __webpack_require__(120), + FloorTo: __webpack_require__(121), + FromPercent: __webpack_require__(122), + GetSpeed: __webpack_require__(123), + IsEven: __webpack_require__(124), + IsEvenStrict: __webpack_require__(125), + Linear: __webpack_require__(22), + MaxAdd: __webpack_require__(126), + MinSub: __webpack_require__(127), + Percent: __webpack_require__(128), + RadToDeg: __webpack_require__(9), + RandomXY: __webpack_require__(129), + RandomXYZ: __webpack_require__(130), + RandomXYZW: __webpack_require__(131), + Rotate: __webpack_require__(132), + RotateAround: __webpack_require__(133), + RotateAroundDistance: __webpack_require__(134), + RoundAwayFromZero: __webpack_require__(135), + RoundTo: __webpack_require__(136), + SinCosTableGenerator: __webpack_require__(137), + SmootherStep: __webpack_require__(24), + SmoothStep: __webpack_require__(23), + ToXY: __webpack_require__(138), + TransformXY: __webpack_require__(139), + Within: __webpack_require__(140), + Wrap: __webpack_require__(4), + + // Vector classes + Vector2: __webpack_require__(5), + Vector3: __webpack_require__(10), + Vector4: __webpack_require__(141), + Matrix3: __webpack_require__(26), + Matrix4: __webpack_require__(27), + Quaternion: __webpack_require__(28), + RotateVec3: __webpack_require__(142) + +}; + +// Merge in the consts + +PhaserMath = Extend(false, PhaserMath, CONST); + +// Export it + +module.exports = PhaserMath; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Angle + */ + +module.exports = { + + Between: __webpack_require__(15), + BetweenPoints: __webpack_require__(38), + BetweenPointsY: __webpack_require__(39), + BetweenY: __webpack_require__(40), + CounterClockwise: __webpack_require__(7), + Normalize: __webpack_require__(16), + Reverse: __webpack_require__(41), + RotateTo: __webpack_require__(42), + ShortestBetween: __webpack_require__(43), + Wrap: __webpack_require__(17), + WrapDegrees: __webpack_require__(18) + +}; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} 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; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} 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; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Normalize = __webpack_require__(16); + +/** + * 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; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(1); + +/** + * 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; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. + * + * TODO: Wrap the angles in this function? + * + * @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; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Distance + */ + +module.exports = { + + Between: __webpack_require__(45), + Power: __webpack_require__(46), + Squared: __webpack_require__(47) + +}; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing + */ + +module.exports = { + + Back: __webpack_require__(49), + Bounce: __webpack_require__(53), + Circular: __webpack_require__(57), + Cubic: __webpack_require__(61), + Elastic: __webpack_require__(65), + Expo: __webpack_require__(69), + Linear: __webpack_require__(73), + Quadratic: __webpack_require__(75), + Quartic: __webpack_require__(79), + Quintic: __webpack_require__(83), + Sine: __webpack_require__(87), + Stepped: __webpack_require__(91) + +}; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Back + */ + +module.exports = { + + In: __webpack_require__(50), + Out: __webpack_require__(51), + InOut: __webpack_require__(52) + +}; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(54), + Out: __webpack_require__(55), + InOut: __webpack_require__(56) + +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 56 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(58), + Out: __webpack_require__(59), + InOut: __webpack_require__(60) + +}; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 60 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(62), + Out: __webpack_require__(63), + InOut: __webpack_require__(64) + +}; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 64 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(66), + Out: __webpack_require__(67), + InOut: __webpack_require__(68) + +}; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 67 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(70), + Out: __webpack_require__(71), + InOut: __webpack_require__(72) + +}; + + +/***/ }), +/* 70 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 71 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Linear + */ + +module.exports = __webpack_require__(74); + + +/***/ }), +/* 74 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Linear easing (no variation). + * + * @function Phaser.Math.Easing.Linear.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; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(76), + Out: __webpack_require__(77), + InOut: __webpack_require__(78) + +}; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 77 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(80), + Out: __webpack_require__(81), + InOut: __webpack_require__(82) + +}; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(84), + Out: __webpack_require__(85), + InOut: __webpack_require__(86) + +}; + + +/***/ }), +/* 84 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 86 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(88), + Out: __webpack_require__(89), + InOut: __webpack_require__(90) + +}; + + +/***/ }), +/* 88 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(92); + + +/***/ }), +/* 92 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Stepped easing. + * + * @function Phaser.Math.Easing.Stepped.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; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Fuzzy + */ + +module.exports = { + + Ceil: __webpack_require__(94), + Equal: __webpack_require__(95), + Floor: __webpack_require__(96), + GreaterThan: __webpack_require__(97), + LessThan: __webpack_require__(98) + +}; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 95 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 96 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Interpolation + */ + +module.exports = { + + Bezier: __webpack_require__(100), + CatmullRom: __webpack_require__(101), + CubicBezier: __webpack_require__(102), + Linear: __webpack_require__(103), + QuadraticBezier: __webpack_require__(104), + SmoothStep: __webpack_require__(105), + SmootherStep: __webpack_require__(106) + +}; + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bernstein = __webpack_require__(19); + +/** + * 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; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CatmullRom = __webpack_require__(21); + +/** + * 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; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Linear = __webpack_require__(22); + +/** + * 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; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmoothStep = __webpack_require__(23); + +/** + * 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; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmootherStep = __webpack_require__(24); + +/** + * 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; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Pow2 + */ + +module.exports = { + + GetNext: __webpack_require__(108), + IsSize: __webpack_require__(109), + IsValue: __webpack_require__(110) + +}; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.GetPowerOfTwo + * @since 3.0.0 + * + * @param {number} value - The value. + * + * @return {integer} 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; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsSizePowerOfTwo + * @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; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsValuePowerOfTwo + * @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; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Snap + */ + +module.exports = { + + Ceil: __webpack_require__(112), + Floor: __webpack_require__(113), + To: __webpack_require__(114) + +}; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} [array] - The array to be shuffled. + * + * @return {array} 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; + + +/***/ }), +/* 116 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 117 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} min - The minimum value. + * @param {integer} max - The maximum value. + * + * @return {integer} The random integer. + */ +var Between = function (min, max) +{ + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +module.exports = Between; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [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; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. + * @param {integer} [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; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(8); + +/** + * 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; +}; + +module.exports = FromPercent; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the speed required to cover a distance in the time given. + * + * @function Phaser.Math.GetSpeed + * @since 3.0.0 + * + * @param {number} distance - The distance to travel in pixels. + * @param {integer} time - The time, in ms, to cover the distance in. + * + * @return {number} The amount you will need to increment the position by each step in order to cover the distance in the time given. + */ +var GetSpeed = function (distance, time) +{ + return (distance / time) / 1000; +}; + +module.exports = GetSpeed; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 128 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 130 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 131 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; } + + // TODO: Not spherical; should fix this for more uniform distribution + 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; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 133 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` by the given `angle`. + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @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.Geom.Point} The given point, rotated by the given angle around the given coordinates. + */ +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; + + +/***/ }), +/* 134 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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`. + * + * @function Phaser.Math.RotateAroundDistance + * @since 3.0.0 + * + * @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.Geom.Point} 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; + + +/***/ }), +/* 135 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {integer} [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; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(5); + +/** + * Returns a Vec2 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 Vec2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {integer} index - The position within the grid to get the x/y value for. + * @param {integer} width - The width of the grid. + * @param {integer} 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; + } + + out.set(x, y); + } + + return out; +}; + +module.exports = ToXY; + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(5); + +/** + * 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; + + +/***/ }), +/* 140 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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) + { + // TODO: is this really the same as Vector3? + // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/ + // 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; + }, + + /** + * 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; + } + +}); + +// TODO: Check if these are required internally, if not, remove. +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; + + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector3 = __webpack_require__(10); +var Matrix4 = __webpack_require__(27); +var Quaternion = __webpack_require__(28); + +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; + + +/***/ }), +/* 143 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @readonly + * @since 3.0.0 + */ + DEFAULT: 0, + + /** + * Linear Scale Mode. + * + * @name Phaser.ScaleModes.LINEAR + * @type {integer} + * @readonly + * @since 3.0.0 + */ + LINEAR: 0, + + /** + * Nearest Scale Mode. + * + * @name Phaser.ScaleModes.NEAREST + * @type {integer} + * @readonly + * @since 3.0.0 + */ + NEAREST: 1 + +}; + +module.exports = ScaleModes; + + +/***/ }), +/* 144 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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 multiplied by resolution. + * @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} resolution - The current resolution. Defaults to 1 at the moment. + * @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'; + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var BasePlugin = __webpack_require__(146); +var Class = __webpack_require__(0); +var SceneEvents = __webpack_require__(147); + +/** + * @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. + */ +var ScenePlugin = new Class({ + + Extends: BasePlugin, + + initialize: + + function ScenePlugin (scene, pluginManager) + { + BasePlugin.call(this, pluginManager); + + this.scene = scene; + this.systems = scene.sys; + + 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 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 () + { + } + +}); + +module.exports = ScenePlugin; + + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 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; + + /** + * 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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#scene + * @type {?Phaser.Scene} + * @protected + * @since 3.8.0 + */ + this.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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#systems + * @type {?Phaser.Scenes.Systems} + * @protected + * @since 3.8.0 + */ + this.systems; + }, + + /** + * Called by the PluginManager when this 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. + * + * @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 () + { + }, + + /** + * Called by the PluginManager when this plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + * + * @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); + }, + + /** + * Called by the PluginManager when this 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. + * + * @method Phaser.Plugins.BasePlugin#stop + * @since 3.8.0 + */ + stop: function () + { + }, + + /** + * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots. + * By this point the plugin properties `scene` and `systems` will have already been set. + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + * + * @method Phaser.Plugins.BasePlugin#boot + * @since 3.8.0 + */ + boot: function () + { + // Here are the Scene events you can listen to. + // At the very least you should offer a destroy handler for when the Scene closes down. + + // var eventEmitter = this.systems.events; + + // eventEmitter.once('destroy', this.sceneDestroy, this); + // eventEmitter.on('start', this.sceneStart, this); + // eventEmitter.on('preupdate', this.scenePreUpdate, this); + // eventEmitter.on('update', this.sceneUpdate, this); + // eventEmitter.on('postupdate', this.scenePostUpdate, this); + // eventEmitter.on('pause', this.scenePause, this); + // eventEmitter.on('resume', this.sceneResume, this); + // eventEmitter.on('sleep', this.sceneSleep, this); + // eventEmitter.on('wake', this.sceneWake, this); + // eventEmitter.on('shutdown', this.sceneShutdown, this); + // eventEmitter.on('destroy', this.sceneDestroy, this); + }, + + /** + * 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; + + +/***/ }), +/* 147 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Scenes.Events + */ + +module.exports = { + + BOOT: __webpack_require__(148), + CREATE: __webpack_require__(149), + DESTROY: __webpack_require__(150), + PAUSE: __webpack_require__(151), + POST_UPDATE: __webpack_require__(152), + PRE_UPDATE: __webpack_require__(153), + READY: __webpack_require__(154), + RENDER: __webpack_require__(155), + RESUME: __webpack_require__(156), + SHUTDOWN: __webpack_require__(157), + SLEEP: __webpack_require__(158), + START: __webpack_require__(159), + TRANSITION_COMPLETE: __webpack_require__(160), + TRANSITION_INIT: __webpack_require__(161), + TRANSITION_OUT: __webpack_require__(162), + TRANSITION_START: __webpack_require__(163), + TRANSITION_WAKE: __webpack_require__(164), + UPDATE: __webpack_require__(165), + WAKE: __webpack_require__(166) + +}; + + +/***/ }), +/* 148 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('boot', listener)`. + * + * @event Phaser.Scenes.Events#BOOT + * @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'; + + +/***/ }), +/* 149 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('create', listener)`. + * + * @event Phaser.Scenes.Events#CREATE + * @since 3.17.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. + */ +module.exports = 'create'; + + +/***/ }), +/* 150 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 151 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('pause', listener)`. + * + * @event Phaser.Scenes.Events#PAUSE + * @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'; + + +/***/ }), +/* 152 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#POST_UPDATE + * @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'; + + +/***/ }), +/* 153 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#PRE_UPDATE + * @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'; + + +/***/ }), +/* 154 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('ready', listener)`. + * + * @event Phaser.Scenes.Events#READY + * @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'; + + +/***/ }), +/* 155 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('render', listener)`. + * + * A Scene will only render if it is visible and active. + * By the time this event is dispatched, the Scene will have already been rendered. + * + * @event Phaser.Scenes.Events#RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'render'; + + +/***/ }), +/* 156 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('resume', listener)`. + * + * @event Phaser.Scenes.Events#RESUME + * @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'; + + +/***/ }), +/* 157 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 158 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('sleep', listener)`. + * + * @event Phaser.Scenes.Events#SLEEP + * @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'; + + +/***/ }), +/* 159 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('start', listener)`. + * + * @event Phaser.Scenes.Events#START + * @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'; + + +/***/ }), +/* 160 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @since 3.5.0 + * + * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. + */ +module.exports = 'transitioncomplete'; + + +/***/ }), +/* 161 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 162 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 163 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 164 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 165 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#UPDATE + * @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'; + + +/***/ }), +/* 166 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('wake', listener)`. + * + * @event Phaser.Scenes.Events#WAKE + * @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'; + + +/***/ }), +/* 167 */ +/***/ (function(module, exports) { + +/*** IMPORTS FROM imports-loader ***/ +(function() { + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var spine; +(function (spine) { + var Animation = (function () { + function Animation(name, timelines, duration) { + if (name == null) + throw new Error("name cannot be null."); + if (timelines == null) + throw new Error("timelines cannot be null."); + this.name = name; + this.timelines = timelines; + this.duration = duration; + } + Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (loop && this.duration != 0) { + time %= this.duration; + if (lastTime > 0) + lastTime %= this.duration; + } + var timelines = this.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction); + }; + Animation.binarySearch = function (values, target, step) { + if (step === void 0) { step = 1; } + var low = 0; + var high = values.length / step - 2; + if (high == 0) + return step; + var current = high >>> 1; + while (true) { + if (values[(current + 1) * step] <= target) + low = current + 1; + else + high = current; + if (low == high) + return (low + 1) * step; + current = (low + high) >>> 1; + } + }; + Animation.linearSearch = function (values, target, step) { + for (var i = 0, last = values.length - step; i <= last; i += step) + if (values[i] > target) + return i; + return -1; + }; + return Animation; + }()); + spine.Animation = Animation; + var MixBlend; + (function (MixBlend) { + MixBlend[MixBlend["setup"] = 0] = "setup"; + MixBlend[MixBlend["first"] = 1] = "first"; + MixBlend[MixBlend["replace"] = 2] = "replace"; + MixBlend[MixBlend["add"] = 3] = "add"; + })(MixBlend = spine.MixBlend || (spine.MixBlend = {})); + var MixDirection; + (function (MixDirection) { + MixDirection[MixDirection["in"] = 0] = "in"; + MixDirection[MixDirection["out"] = 1] = "out"; + })(MixDirection = spine.MixDirection || (spine.MixDirection = {})); + var TimelineType; + (function (TimelineType) { + TimelineType[TimelineType["rotate"] = 0] = "rotate"; + TimelineType[TimelineType["translate"] = 1] = "translate"; + TimelineType[TimelineType["scale"] = 2] = "scale"; + TimelineType[TimelineType["shear"] = 3] = "shear"; + TimelineType[TimelineType["attachment"] = 4] = "attachment"; + TimelineType[TimelineType["color"] = 5] = "color"; + TimelineType[TimelineType["deform"] = 6] = "deform"; + TimelineType[TimelineType["event"] = 7] = "event"; + TimelineType[TimelineType["drawOrder"] = 8] = "drawOrder"; + TimelineType[TimelineType["ikConstraint"] = 9] = "ikConstraint"; + TimelineType[TimelineType["transformConstraint"] = 10] = "transformConstraint"; + TimelineType[TimelineType["pathConstraintPosition"] = 11] = "pathConstraintPosition"; + TimelineType[TimelineType["pathConstraintSpacing"] = 12] = "pathConstraintSpacing"; + TimelineType[TimelineType["pathConstraintMix"] = 13] = "pathConstraintMix"; + TimelineType[TimelineType["twoColor"] = 14] = "twoColor"; + })(TimelineType = spine.TimelineType || (spine.TimelineType = {})); + var CurveTimeline = (function () { + function CurveTimeline(frameCount) { + if (frameCount <= 0) + throw new Error("frameCount must be > 0: " + frameCount); + this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE); + } + CurveTimeline.prototype.getFrameCount = function () { + return this.curves.length / CurveTimeline.BEZIER_SIZE + 1; + }; + CurveTimeline.prototype.setLinear = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR; + }; + CurveTimeline.prototype.setStepped = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED; + }; + CurveTimeline.prototype.getCurveType = function (frameIndex) { + var index = frameIndex * CurveTimeline.BEZIER_SIZE; + if (index == this.curves.length) + return CurveTimeline.LINEAR; + var type = this.curves[index]; + if (type == CurveTimeline.LINEAR) + return CurveTimeline.LINEAR; + if (type == CurveTimeline.STEPPED) + return CurveTimeline.STEPPED; + return CurveTimeline.BEZIER; + }; + CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) { + var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03; + var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006; + var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy; + var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var curves = this.curves; + curves[i++] = CurveTimeline.BEZIER; + var x = dfx, y = dfy; + for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + curves[i] = x; + curves[i + 1] = y; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + x += dfx; + y += dfy; + } + }; + CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) { + percent = spine.MathUtils.clamp(percent, 0, 1); + var curves = this.curves; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var type = curves[i]; + if (type == CurveTimeline.LINEAR) + return percent; + if (type == CurveTimeline.STEPPED) + return 0; + i++; + var x = 0; + for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + x = curves[i]; + if (x >= percent) { + var prevX = void 0, prevY = void 0; + if (i == start) { + prevX = 0; + prevY = 0; + } + else { + prevX = curves[i - 2]; + prevY = curves[i - 1]; + } + return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); + } + } + var y = curves[i - 1]; + return y + (1 - y) * (percent - x) / (1 - x); + }; + CurveTimeline.LINEAR = 0; + CurveTimeline.STEPPED = 1; + CurveTimeline.BEZIER = 2; + CurveTimeline.BEZIER_SIZE = 10 * 2 - 1; + return CurveTimeline; + }()); + spine.CurveTimeline = CurveTimeline; + var RotateTimeline = (function (_super) { + __extends(RotateTimeline, _super); + function RotateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount << 1); + return _this; + } + RotateTimeline.prototype.getPropertyId = function () { + return (TimelineType.rotate << 24) + this.boneIndex; + }; + RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) { + frameIndex <<= 1; + this.frames[frameIndex] = time; + this.frames[frameIndex + RotateTimeline.ROTATION] = degrees; + }; + RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation; + return; + case MixBlend.first: + var r_1 = bone.data.rotation - bone.rotation; + bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha; + } + return; + } + if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { + var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION]; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + r_2 * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r_2 += bone.data.rotation - bone.rotation; + r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; + case MixBlend.add: + bone.rotation += r_2 * alpha; + } + return; + } + var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES); + var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime)); + var r = frames[frame + RotateTimeline.ROTATION] - prevRotation; + r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r += bone.data.rotation - bone.rotation; + case MixBlend.add: + bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + } + }; + RotateTimeline.ENTRIES = 2; + RotateTimeline.PREV_TIME = -2; + RotateTimeline.PREV_ROTATION = -1; + RotateTimeline.ROTATION = 1; + return RotateTimeline; + }(CurveTimeline)); + spine.RotateTimeline = RotateTimeline; + var TranslateTimeline = (function (_super) { + __extends(TranslateTimeline, _super); + function TranslateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES); + return _this; + } + TranslateTimeline.prototype.getPropertyId = function () { + return (TimelineType.translate << 24) + this.boneIndex; + }; + TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) { + frameIndex *= TranslateTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TranslateTimeline.X] = x; + this.frames[frameIndex + TranslateTimeline.Y] = y; + }; + TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x; + bone.y = bone.data.y; + return; + case MixBlend.first: + bone.x += (bone.data.x - bone.x) * alpha; + bone.y += (bone.data.y - bone.y) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { + x = frames[frames.length + TranslateTimeline.PREV_X]; + y = frames[frames.length + TranslateTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES); + x = frames[frame + TranslateTimeline.PREV_X]; + y = frames[frame + TranslateTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime)); + x += (frames[frame + TranslateTimeline.X] - x) * percent; + y += (frames[frame + TranslateTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x + x * alpha; + bone.y = bone.data.y + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.x += (bone.data.x + x - bone.x) * alpha; + bone.y += (bone.data.y + y - bone.y) * alpha; + break; + case MixBlend.add: + bone.x += x * alpha; + bone.y += y * alpha; + } + }; + TranslateTimeline.ENTRIES = 3; + TranslateTimeline.PREV_TIME = -3; + TranslateTimeline.PREV_X = -2; + TranslateTimeline.PREV_Y = -1; + TranslateTimeline.X = 1; + TranslateTimeline.Y = 2; + return TranslateTimeline; + }(CurveTimeline)); + spine.TranslateTimeline = TranslateTimeline; + var ScaleTimeline = (function (_super) { + __extends(ScaleTimeline, _super); + function ScaleTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ScaleTimeline.prototype.getPropertyId = function () { + return (TimelineType.scale << 24) + this.boneIndex; + }; + ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.scaleX = bone.data.scaleX; + bone.scaleY = bone.data.scaleY; + return; + case MixBlend.first: + bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha; + bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { + x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX; + y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY; + } + else { + var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES); + x = frames[frame + ScaleTimeline.PREV_X]; + y = frames[frame + ScaleTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime)); + x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX; + y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY; + } + if (alpha == 1) { + if (blend == MixBlend.add) { + bone.scaleX += x - bone.data.scaleX; + bone.scaleY += y - bone.data.scaleY; + } + else { + bone.scaleX = x; + bone.scaleY = y; + } + } + else { + var bx = 0, by = 0; + if (direction == MixDirection.out) { + switch (blend) { + case MixBlend.setup: + bx = bone.data.scaleX; + by = bone.data.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.add: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha; + } + } + else { + switch (blend) { + case MixBlend.setup: + bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.add: + bx = spine.MathUtils.signum(x); + by = spine.MathUtils.signum(y); + bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha; + bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha; + } + } + } + }; + return ScaleTimeline; + }(TranslateTimeline)); + spine.ScaleTimeline = ScaleTimeline; + var ShearTimeline = (function (_super) { + __extends(ShearTimeline, _super); + function ShearTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ShearTimeline.prototype.getPropertyId = function () { + return (TimelineType.shear << 24) + this.boneIndex; + }; + ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX; + bone.shearY = bone.data.shearY; + return; + case MixBlend.first: + bone.shearX += (bone.data.shearX - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY - bone.shearY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { + x = frames[frames.length + ShearTimeline.PREV_X]; + y = frames[frames.length + ShearTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES); + x = frames[frame + ShearTimeline.PREV_X]; + y = frames[frame + ShearTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime)); + x = x + (frames[frame + ShearTimeline.X] - x) * percent; + y = y + (frames[frame + ShearTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX + x * alpha; + bone.shearY = bone.data.shearY + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha; + break; + case MixBlend.add: + bone.shearX += x * alpha; + bone.shearY += y * alpha; + } + }; + return ShearTimeline; + }(TranslateTimeline)); + spine.ShearTimeline = ShearTimeline; + var ColorTimeline = (function (_super) { + __extends(ColorTimeline, _super); + function ColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES); + return _this; + } + ColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.color << 24) + this.slotIndex; + }; + ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) { + frameIndex *= ColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + ColorTimeline.R] = r; + this.frames[frameIndex + ColorTimeline.G] = g; + this.frames[frameIndex + ColorTimeline.B] = b; + this.frames[frameIndex + ColorTimeline.A] = a; + }; + ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + return; + case MixBlend.first: + var color = slot.color, setup = slot.data.color; + color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha); + } + return; + } + var r = 0, g = 0, b = 0, a = 0; + if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + ColorTimeline.PREV_R]; + g = frames[i + ColorTimeline.PREV_G]; + b = frames[i + ColorTimeline.PREV_B]; + a = frames[i + ColorTimeline.PREV_A]; + } + else { + var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES); + r = frames[frame + ColorTimeline.PREV_R]; + g = frames[frame + ColorTimeline.PREV_G]; + b = frames[frame + ColorTimeline.PREV_B]; + a = frames[frame + ColorTimeline.PREV_A]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + ColorTimeline.R] - r) * percent; + g += (frames[frame + ColorTimeline.G] - g) * percent; + b += (frames[frame + ColorTimeline.B] - b) * percent; + a += (frames[frame + ColorTimeline.A] - a) * percent; + } + if (alpha == 1) + slot.color.set(r, g, b, a); + else { + var color = slot.color; + if (blend == MixBlend.setup) + color.setFromColor(slot.data.color); + color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); + } + }; + ColorTimeline.ENTRIES = 5; + ColorTimeline.PREV_TIME = -5; + ColorTimeline.PREV_R = -4; + ColorTimeline.PREV_G = -3; + ColorTimeline.PREV_B = -2; + ColorTimeline.PREV_A = -1; + ColorTimeline.R = 1; + ColorTimeline.G = 2; + ColorTimeline.B = 3; + ColorTimeline.A = 4; + return ColorTimeline; + }(CurveTimeline)); + spine.ColorTimeline = ColorTimeline; + var TwoColorTimeline = (function (_super) { + __extends(TwoColorTimeline, _super); + function TwoColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES); + return _this; + } + TwoColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.twoColor << 24) + this.slotIndex; + }; + TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) { + frameIndex *= TwoColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TwoColorTimeline.R] = r; + this.frames[frameIndex + TwoColorTimeline.G] = g; + this.frames[frameIndex + TwoColorTimeline.B] = b; + this.frames[frameIndex + TwoColorTimeline.A] = a; + this.frames[frameIndex + TwoColorTimeline.R2] = r2; + this.frames[frameIndex + TwoColorTimeline.G2] = g2; + this.frames[frameIndex + TwoColorTimeline.B2] = b2; + }; + TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + slot.darkColor.setFromColor(slot.data.darkColor); + return; + case MixBlend.first: + var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor; + light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha); + dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0); + } + return; + } + var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; + if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + TwoColorTimeline.PREV_R]; + g = frames[i + TwoColorTimeline.PREV_G]; + b = frames[i + TwoColorTimeline.PREV_B]; + a = frames[i + TwoColorTimeline.PREV_A]; + r2 = frames[i + TwoColorTimeline.PREV_R2]; + g2 = frames[i + TwoColorTimeline.PREV_G2]; + b2 = frames[i + TwoColorTimeline.PREV_B2]; + } + else { + var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES); + r = frames[frame + TwoColorTimeline.PREV_R]; + g = frames[frame + TwoColorTimeline.PREV_G]; + b = frames[frame + TwoColorTimeline.PREV_B]; + a = frames[frame + TwoColorTimeline.PREV_A]; + r2 = frames[frame + TwoColorTimeline.PREV_R2]; + g2 = frames[frame + TwoColorTimeline.PREV_G2]; + b2 = frames[frame + TwoColorTimeline.PREV_B2]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + TwoColorTimeline.R] - r) * percent; + g += (frames[frame + TwoColorTimeline.G] - g) * percent; + b += (frames[frame + TwoColorTimeline.B] - b) * percent; + a += (frames[frame + TwoColorTimeline.A] - a) * percent; + r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent; + g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent; + b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent; + } + if (alpha == 1) { + slot.color.set(r, g, b, a); + slot.darkColor.set(r2, g2, b2, 1); + } + else { + var light = slot.color, dark = slot.darkColor; + if (blend == MixBlend.setup) { + light.setFromColor(slot.data.color); + dark.setFromColor(slot.data.darkColor); + } + light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); + dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0); + } + }; + TwoColorTimeline.ENTRIES = 8; + TwoColorTimeline.PREV_TIME = -8; + TwoColorTimeline.PREV_R = -7; + TwoColorTimeline.PREV_G = -6; + TwoColorTimeline.PREV_B = -5; + TwoColorTimeline.PREV_A = -4; + TwoColorTimeline.PREV_R2 = -3; + TwoColorTimeline.PREV_G2 = -2; + TwoColorTimeline.PREV_B2 = -1; + TwoColorTimeline.R = 1; + TwoColorTimeline.G = 2; + TwoColorTimeline.B = 3; + TwoColorTimeline.A = 4; + TwoColorTimeline.R2 = 5; + TwoColorTimeline.G2 = 6; + TwoColorTimeline.B2 = 7; + return TwoColorTimeline; + }(CurveTimeline)); + spine.TwoColorTimeline = TwoColorTimeline; + var AttachmentTimeline = (function () { + function AttachmentTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.attachmentNames = new Array(frameCount); + } + AttachmentTimeline.prototype.getPropertyId = function () { + return (TimelineType.attachment << 24) + this.slotIndex; + }; + AttachmentTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) { + this.frames[frameIndex] = time; + this.attachmentNames[frameIndex] = attachmentName; + }; + AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + if (direction == MixDirection.out && blend == MixBlend.setup) { + var attachmentName_1 = slot.data.attachmentName; + slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1)); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) { + var attachmentName_2 = slot.data.attachmentName; + slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2)); + } + return; + } + var frameIndex = 0; + if (time >= frames[frames.length - 1]) + frameIndex = frames.length - 1; + else + frameIndex = Animation.binarySearch(frames, time, 1) - 1; + var attachmentName = this.attachmentNames[frameIndex]; + skeleton.slots[this.slotIndex] + .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); + }; + return AttachmentTimeline; + }()); + spine.AttachmentTimeline = AttachmentTimeline; + var zeros = null; + var DeformTimeline = (function (_super) { + __extends(DeformTimeline, _super); + function DeformTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount); + _this.frameVertices = new Array(frameCount); + if (zeros == null) + zeros = spine.Utils.newFloatArray(64); + return _this; + } + DeformTimeline.prototype.getPropertyId = function () { + return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex; + }; + DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) { + this.frames[frameIndex] = time; + this.frameVertices[frameIndex] = vertices; + }; + DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var slotAttachment = slot.getAttachment(); + if (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment)) + return; + var verticesArray = slot.attachmentVertices; + if (verticesArray.length == 0) + blend = MixBlend.setup; + var frameVertices = this.frameVertices; + var vertexCount = frameVertices[0].length; + var frames = this.frames; + if (time < frames[0]) { + var vertexAttachment = slotAttachment; + switch (blend) { + case MixBlend.setup: + verticesArray.length = 0; + return; + case MixBlend.first: + if (alpha == 1) { + verticesArray.length = 0; + break; + } + var vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount); + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha; + } + else { + alpha = 1 - alpha; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] *= alpha; + } + } + return; + } + var vertices = spine.Utils.setArraySize(verticesArray, vertexCount); + if (time >= frames[frames.length - 1]) { + var lastVertices = frameVertices[frames.length - 1]; + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_1 = 0; i_1 < vertexCount; i_1++) { + vertices[i_1] += lastVertices[i_1] - setupVertices[i_1]; + } + } + else { + for (var i_2 = 0; i_2 < vertexCount; i_2++) + vertices[i_2] += lastVertices[i_2]; + } + } + else { + spine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount); + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_1 = slotAttachment; + if (vertexAttachment_1.bones == null) { + var setupVertices = vertexAttachment_1.vertices; + for (var i_3 = 0; i_3 < vertexCount; i_3++) { + var setup = setupVertices[i_3]; + vertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha; + } + } + else { + for (var i_4 = 0; i_4 < vertexCount; i_4++) + vertices[i_4] = lastVertices[i_4] * alpha; + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_5 = 0; i_5 < vertexCount; i_5++) + vertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_6 = 0; i_6 < vertexCount; i_6++) { + vertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha; + } + } + else { + for (var i_7 = 0; i_7 < vertexCount; i_7++) + vertices[i_7] += lastVertices[i_7] * alpha; + } + } + } + return; + } + var frame = Animation.binarySearch(frames, time); + var prevVertices = frameVertices[frame - 1]; + var nextVertices = frameVertices[frame]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime)); + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_8 = 0; i_8 < vertexCount; i_8++) { + var prev = prevVertices[i_8]; + vertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8]; + } + } + else { + for (var i_9 = 0; i_9 < vertexCount; i_9++) { + var prev = prevVertices[i_9]; + vertices[i_9] += prev + (nextVertices[i_9] - prev) * percent; + } + } + } + else { + for (var i_10 = 0; i_10 < vertexCount; i_10++) { + var prev = prevVertices[i_10]; + vertices[i_10] = prev + (nextVertices[i_10] - prev) * percent; + } + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_2 = slotAttachment; + if (vertexAttachment_2.bones == null) { + var setupVertices = vertexAttachment_2.vertices; + for (var i_11 = 0; i_11 < vertexCount; i_11++) { + var prev = prevVertices[i_11], setup = setupVertices[i_11]; + vertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha; + } + } + else { + for (var i_12 = 0; i_12 < vertexCount; i_12++) { + var prev = prevVertices[i_12]; + vertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha; + } + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_13 = 0; i_13 < vertexCount; i_13++) { + var prev = prevVertices[i_13]; + vertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha; + } + break; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_14 = 0; i_14 < vertexCount; i_14++) { + var prev = prevVertices[i_14]; + vertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha; + } + } + else { + for (var i_15 = 0; i_15 < vertexCount; i_15++) { + var prev = prevVertices[i_15]; + vertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha; + } + } + } + } + }; + return DeformTimeline; + }(CurveTimeline)); + spine.DeformTimeline = DeformTimeline; + var EventTimeline = (function () { + function EventTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.events = new Array(frameCount); + } + EventTimeline.prototype.getPropertyId = function () { + return TimelineType.event << 24; + }; + EventTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + EventTimeline.prototype.setFrame = function (frameIndex, event) { + this.frames[frameIndex] = event.time; + this.events[frameIndex] = event; + }; + EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + if (firedEvents == null) + return; + var frames = this.frames; + var frameCount = this.frames.length; + if (lastTime > time) { + this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction); + lastTime = -1; + } + else if (lastTime >= frames[frameCount - 1]) + return; + if (time < frames[0]) + return; + var frame = 0; + if (lastTime < frames[0]) + frame = 0; + else { + frame = Animation.binarySearch(frames, lastTime); + var frameTime = frames[frame]; + while (frame > 0) { + if (frames[frame - 1] != frameTime) + break; + frame--; + } + } + for (; frame < frameCount && time >= frames[frame]; frame++) + firedEvents.push(this.events[frame]); + }; + return EventTimeline; + }()); + spine.EventTimeline = EventTimeline; + var DrawOrderTimeline = (function () { + function DrawOrderTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.drawOrders = new Array(frameCount); + } + DrawOrderTimeline.prototype.getPropertyId = function () { + return TimelineType.drawOrder << 24; + }; + DrawOrderTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) { + this.frames[frameIndex] = time; + this.drawOrders[frameIndex] = drawOrder; + }; + DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var drawOrder = skeleton.drawOrder; + var slots = skeleton.slots; + if (direction == MixDirection.out && blend == MixBlend.setup) { + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frame = 0; + if (time >= frames[frames.length - 1]) + frame = frames.length - 1; + else + frame = Animation.binarySearch(frames, time) - 1; + var drawOrderToSetupIndex = this.drawOrders[frame]; + if (drawOrderToSetupIndex == null) + spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length); + else { + for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) + drawOrder[i] = slots[drawOrderToSetupIndex[i]]; + } + }; + return DrawOrderTimeline; + }()); + spine.DrawOrderTimeline = DrawOrderTimeline; + var IkConstraintTimeline = (function (_super) { + __extends(IkConstraintTimeline, _super); + function IkConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES); + return _this; + } + IkConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex; + }; + IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) { + frameIndex *= IkConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + IkConstraintTimeline.MIX] = mix; + this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection; + this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0; + this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0; + }; + IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.ikConstraints[this.ikConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + return; + case MixBlend.first: + constraint.mix += (constraint.data.mix - constraint.mix) * alpha; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + return; + } + if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + return; + } + var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES); + var mix = frames[frame + IkConstraintTimeline.PREV_MIX]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime)); + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + }; + IkConstraintTimeline.ENTRIES = 5; + IkConstraintTimeline.PREV_TIME = -5; + IkConstraintTimeline.PREV_MIX = -4; + IkConstraintTimeline.PREV_BEND_DIRECTION = -3; + IkConstraintTimeline.PREV_COMPRESS = -2; + IkConstraintTimeline.PREV_STRETCH = -1; + IkConstraintTimeline.MIX = 1; + IkConstraintTimeline.BEND_DIRECTION = 2; + IkConstraintTimeline.COMPRESS = 3; + IkConstraintTimeline.STRETCH = 4; + return IkConstraintTimeline; + }(CurveTimeline)); + spine.IkConstraintTimeline = IkConstraintTimeline; + var TransformConstraintTimeline = (function (_super) { + __extends(TransformConstraintTimeline, _super); + function TransformConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES); + return _this; + } + TransformConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex; + }; + TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) { + frameIndex *= TransformConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix; + this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix; + this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix; + }; + TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.transformConstraints[this.transformConstraintIndex]; + if (time < frames[0]) { + var data = constraint.data; + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + return; + case MixBlend.first: + constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha; + constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha; + constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha; + } + return; + } + var rotate = 0, translate = 0, scale = 0, shear = 0; + if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { + var i = frames.length; + rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[i + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[i + TransformConstraintTimeline.PREV_SHEAR]; + } + else { + var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES); + rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[frame + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent; + scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent; + shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent; + } + if (blend == MixBlend.setup) { + var data = constraint.data; + constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha; + constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha; + constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha; + constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + constraint.scaleMix += (scale - constraint.scaleMix) * alpha; + constraint.shearMix += (shear - constraint.shearMix) * alpha; + } + }; + TransformConstraintTimeline.ENTRIES = 5; + TransformConstraintTimeline.PREV_TIME = -5; + TransformConstraintTimeline.PREV_ROTATE = -4; + TransformConstraintTimeline.PREV_TRANSLATE = -3; + TransformConstraintTimeline.PREV_SCALE = -2; + TransformConstraintTimeline.PREV_SHEAR = -1; + TransformConstraintTimeline.ROTATE = 1; + TransformConstraintTimeline.TRANSLATE = 2; + TransformConstraintTimeline.SCALE = 3; + TransformConstraintTimeline.SHEAR = 4; + return TransformConstraintTimeline; + }(CurveTimeline)); + spine.TransformConstraintTimeline = TransformConstraintTimeline; + var PathConstraintPositionTimeline = (function (_super) { + __extends(PathConstraintPositionTimeline, _super); + function PathConstraintPositionTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES); + return _this; + } + PathConstraintPositionTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex; + }; + PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) { + frameIndex *= PathConstraintPositionTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value; + }; + PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.position = constraint.data.position; + return; + case MixBlend.first: + constraint.position += (constraint.data.position - constraint.position) * alpha; + } + return; + } + var position = 0; + if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) + position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES); + position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime)); + position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent; + } + if (blend == MixBlend.setup) + constraint.position = constraint.data.position + (position - constraint.data.position) * alpha; + else + constraint.position += (position - constraint.position) * alpha; + }; + PathConstraintPositionTimeline.ENTRIES = 2; + PathConstraintPositionTimeline.PREV_TIME = -2; + PathConstraintPositionTimeline.PREV_VALUE = -1; + PathConstraintPositionTimeline.VALUE = 1; + return PathConstraintPositionTimeline; + }(CurveTimeline)); + spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline; + var PathConstraintSpacingTimeline = (function (_super) { + __extends(PathConstraintSpacingTimeline, _super); + function PathConstraintSpacingTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + PathConstraintSpacingTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex; + }; + PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.spacing = constraint.data.spacing; + return; + case MixBlend.first: + constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha; + } + return; + } + var spacing = 0; + if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) + spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES); + spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime)); + spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent; + } + if (blend == MixBlend.setup) + constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha; + else + constraint.spacing += (spacing - constraint.spacing) * alpha; + }; + return PathConstraintSpacingTimeline; + }(PathConstraintPositionTimeline)); + spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline; + var PathConstraintMixTimeline = (function (_super) { + __extends(PathConstraintMixTimeline, _super); + function PathConstraintMixTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES); + return _this; + } + PathConstraintMixTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex; + }; + PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) { + frameIndex *= PathConstraintMixTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix; + }; + PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = constraint.data.rotateMix; + constraint.translateMix = constraint.data.translateMix; + return; + case MixBlend.first: + constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha; + } + return; + } + var rotate = 0, translate = 0; + if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { + rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE]; + } + else { + var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES); + rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent; + } + if (blend == MixBlend.setup) { + constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha; + constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + } + }; + PathConstraintMixTimeline.ENTRIES = 3; + PathConstraintMixTimeline.PREV_TIME = -3; + PathConstraintMixTimeline.PREV_ROTATE = -2; + PathConstraintMixTimeline.PREV_TRANSLATE = -1; + PathConstraintMixTimeline.ROTATE = 1; + PathConstraintMixTimeline.TRANSLATE = 2; + return PathConstraintMixTimeline; + }(CurveTimeline)); + spine.PathConstraintMixTimeline = PathConstraintMixTimeline; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationState = (function () { + function AnimationState(data) { + this.tracks = new Array(); + this.events = new Array(); + this.listeners = new Array(); + this.queue = new EventQueue(this); + this.propertyIDs = new spine.IntSet(); + this.animationsChanged = false; + this.timeScale = 1; + this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); }); + this.data = data; + } + AnimationState.prototype.update = function (delta) { + delta *= this.timeScale; + var tracks = this.tracks; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null) + continue; + current.animationLast = current.nextAnimationLast; + current.trackLast = current.nextTrackLast; + var currentDelta = delta * current.timeScale; + if (current.delay > 0) { + current.delay -= currentDelta; + if (current.delay > 0) + continue; + currentDelta = -current.delay; + current.delay = 0; + } + var next = current.next; + if (next != null) { + var nextTime = current.trackLast - next.delay; + if (nextTime >= 0) { + next.delay = 0; + next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; + current.trackTime += currentDelta; + this.setCurrent(i, next, true); + while (next.mixingFrom != null) { + next.mixTime += delta; + next = next.mixingFrom; + } + continue; + } + } + else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) { + tracks[i] = null; + this.queue.end(current); + this.disposeNext(current); + continue; + } + if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) { + var from = current.mixingFrom; + current.mixingFrom = null; + if (from != null) + from.mixingTo = null; + while (from != null) { + this.queue.end(from); + from = from.mixingFrom; + } + } + current.trackTime += currentDelta; + } + this.queue.drain(); + }; + AnimationState.prototype.updateMixingFrom = function (to, delta) { + var from = to.mixingFrom; + if (from == null) + return true; + var finished = this.updateMixingFrom(from, delta); + from.animationLast = from.nextAnimationLast; + from.trackLast = from.nextTrackLast; + if (to.mixTime > 0 && to.mixTime >= to.mixDuration) { + if (from.totalAlpha == 0 || to.mixDuration == 0) { + to.mixingFrom = from.mixingFrom; + if (from.mixingFrom != null) + from.mixingFrom.mixingTo = to; + to.interruptAlpha = from.interruptAlpha; + this.queue.end(from); + } + return finished; + } + from.trackTime += delta * from.timeScale; + to.mixTime += delta; + return false; + }; + AnimationState.prototype.apply = function (skeleton) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (this.animationsChanged) + this._animationsChanged(); + var events = this.events; + var tracks = this.tracks; + var applied = false; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null || current.delay > 0) + continue; + applied = true; + var blend = i == 0 ? spine.MixBlend.first : current.mixBlend; + var mix = current.alpha; + if (current.mixingFrom != null) + mix *= this.applyMixingFrom(current, skeleton, blend); + else if (current.trackTime >= current.trackEnd && current.next == null) + mix = 0; + var animationLast = current.animationLast, animationTime = current.getAnimationTime(); + var timelineCount = current.animation.timelines.length; + var timelines = current.animation.timelines; + if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) { + for (var ii = 0; ii < timelineCount; ii++) + timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]); + } + else { + var timelineMode = current.timelineMode; + var firstFrame = current.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = current.timelinesRotation; + for (var ii = 0; ii < timelineCount; ii++) { + var timeline = timelines[ii]; + var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup; + if (timeline instanceof spine.RotateTimeline) { + this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame); + } + else { + spine.Utils.webkit602BugfixHelper(mix, blend); + timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]); + } + } + } + this.queueEvents(current, animationTime); + events.length = 0; + current.nextAnimationLast = animationTime; + current.nextTrackLast = current.trackTime; + } + this.queue.drain(); + return applied; + }; + AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) { + var from = to.mixingFrom; + if (from.mixingFrom != null) + this.applyMixingFrom(from, skeleton, blend); + var mix = 0; + if (to.mixDuration == 0) { + mix = 1; + if (blend == spine.MixBlend.first) + blend = spine.MixBlend.setup; + } + else { + mix = to.mixTime / to.mixDuration; + if (mix > 1) + mix = 1; + if (blend != spine.MixBlend.first) + blend = from.mixBlend; + } + var events = mix < from.eventThreshold ? this.events : null; + var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold; + var animationLast = from.animationLast, animationTime = from.getAnimationTime(); + var timelineCount = from.animation.timelines.length; + var timelines = from.animation.timelines; + var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); + if (blend == spine.MixBlend.add) { + for (var i = 0; i < timelineCount; i++) + timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out); + } + else { + var timelineMode = from.timelineMode; + var timelineHoldMix = from.timelineHoldMix; + var firstFrame = from.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = from.timelinesRotation; + from.totalAlpha = 0; + for (var i = 0; i < timelineCount; i++) { + var timeline = timelines[i]; + var direction = spine.MixDirection.out; + var timelineBlend = void 0; + var alpha = 0; + switch (timelineMode[i]) { + case AnimationState.SUBSEQUENT: + if (!attachments && timeline instanceof spine.AttachmentTimeline) + continue; + if (!drawOrder && timeline instanceof spine.DrawOrderTimeline) + continue; + timelineBlend = blend; + alpha = alphaMix; + break; + case AnimationState.FIRST: + timelineBlend = spine.MixBlend.setup; + alpha = alphaMix; + break; + case AnimationState.HOLD: + timelineBlend = spine.MixBlend.setup; + alpha = alphaHold; + break; + default: + timelineBlend = spine.MixBlend.setup; + var holdMix = timelineHoldMix[i]; + alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); + break; + } + from.totalAlpha += alpha; + if (timeline instanceof spine.RotateTimeline) + this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame); + else { + spine.Utils.webkit602BugfixHelper(alpha, blend); + if (timelineBlend == spine.MixBlend.setup) { + if (timeline instanceof spine.AttachmentTimeline) { + if (attachments) + direction = spine.MixDirection.out; + } + else if (timeline instanceof spine.DrawOrderTimeline) { + if (drawOrder) + direction = spine.MixDirection.out; + } + } + timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction); + } + } + } + if (to.mixDuration > 0) + this.queueEvents(from, animationTime); + this.events.length = 0; + from.nextAnimationLast = animationTime; + from.nextTrackLast = from.trackTime; + return mix; + }; + AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { + if (firstFrame) + timelinesRotation[i] = 0; + if (alpha == 1) { + timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]); + return; + } + var rotateTimeline = timeline; + var frames = rotateTimeline.frames; + var bone = skeleton.bones[rotateTimeline.boneIndex]; + var r1 = 0, r2 = 0; + if (time < frames[0]) { + switch (blend) { + case spine.MixBlend.setup: + bone.rotation = bone.data.rotation; + default: + return; + case spine.MixBlend.first: + r1 = bone.rotation; + r2 = bone.data.rotation; + } + } + else { + r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation; + if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES]) + r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION]; + else { + var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES); + var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime)); + r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + r2 = prevRotation + r2 * percent + bone.data.rotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + } + } + var total = 0, diff = r2 - r1; + diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360; + if (diff == 0) { + total = timelinesRotation[i]; + } + else { + var lastTotal = 0, lastDiff = 0; + if (firstFrame) { + lastTotal = 0; + lastDiff = diff; + } + else { + lastTotal = timelinesRotation[i]; + lastDiff = timelinesRotation[i + 1]; + } + var current = diff > 0, dir = lastTotal >= 0; + if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) { + if (Math.abs(lastTotal) > 180) + lastTotal += 360 * spine.MathUtils.signum(lastTotal); + dir = current; + } + total = diff + lastTotal - lastTotal % 360; + if (dir != current) + total += 360 * spine.MathUtils.signum(lastTotal); + timelinesRotation[i] = total; + } + timelinesRotation[i + 1] = diff; + r1 += total * alpha; + bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360; + }; + AnimationState.prototype.queueEvents = function (entry, animationTime) { + var animationStart = entry.animationStart, animationEnd = entry.animationEnd; + var duration = animationEnd - animationStart; + var trackLastWrapped = entry.trackLast % duration; + var events = this.events; + var i = 0, n = events.length; + for (; i < n; i++) { + var event_1 = events[i]; + if (event_1.time < trackLastWrapped) + break; + if (event_1.time > animationEnd) + continue; + this.queue.event(entry, event_1); + } + var complete = false; + if (entry.loop) + complete = duration == 0 || trackLastWrapped > entry.trackTime % duration; + else + complete = animationTime >= animationEnd && entry.animationLast < animationEnd; + if (complete) + this.queue.complete(entry); + for (; i < n; i++) { + var event_2 = events[i]; + if (event_2.time < animationStart) + continue; + this.queue.event(entry, events[i]); + } + }; + AnimationState.prototype.clearTracks = function () { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) + this.clearTrack(i); + this.tracks.length = 0; + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.clearTrack = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return; + var current = this.tracks[trackIndex]; + if (current == null) + return; + this.queue.end(current); + this.disposeNext(current); + var entry = current; + while (true) { + var from = entry.mixingFrom; + if (from == null) + break; + this.queue.end(from); + entry.mixingFrom = null; + entry.mixingTo = null; + entry = from; + } + this.tracks[current.trackIndex] = null; + this.queue.drain(); + }; + AnimationState.prototype.setCurrent = function (index, current, interrupt) { + var from = this.expandToIndex(index); + this.tracks[index] = current; + if (from != null) { + if (interrupt) + this.queue.interrupt(from); + current.mixingFrom = from; + from.mixingTo = current; + current.mixTime = 0; + if (from.mixingFrom != null && from.mixDuration > 0) + current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); + from.timelinesRotation.length = 0; + } + this.queue.start(current); + }; + AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.setAnimationWith(trackIndex, animation, loop); + }; + AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) { + if (animation == null) + throw new Error("animation cannot be null."); + var interrupt = true; + var current = this.expandToIndex(trackIndex); + if (current != null) { + if (current.nextTrackLast == -1) { + this.tracks[trackIndex] = current.mixingFrom; + this.queue.interrupt(current); + this.queue.end(current); + this.disposeNext(current); + current = current.mixingFrom; + interrupt = false; + } + else + this.disposeNext(current); + } + var entry = this.trackEntry(trackIndex, animation, loop, current); + this.setCurrent(trackIndex, entry, interrupt); + this.queue.drain(); + return entry; + }; + AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.addAnimationWith(trackIndex, animation, loop, delay); + }; + AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) { + if (animation == null) + throw new Error("animation cannot be null."); + var last = this.expandToIndex(trackIndex); + if (last != null) { + while (last.next != null) + last = last.next; + } + var entry = this.trackEntry(trackIndex, animation, loop, last); + if (last == null) { + this.setCurrent(trackIndex, entry, true); + this.queue.drain(); + } + else { + last.next = entry; + if (delay <= 0) { + var duration = last.animationEnd - last.animationStart; + if (duration != 0) { + if (last.loop) + delay += duration * (1 + ((last.trackTime / duration) | 0)); + else + delay += Math.max(duration, last.trackTime); + delay -= this.data.getMix(last.animation, animation); + } + else + delay = last.trackTime; + } + } + entry.delay = delay; + return entry; + }; + AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) { + var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) { + if (delay <= 0) + delay -= mixDuration; + var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.setEmptyAnimations = function (mixDuration) { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) { + var current = this.tracks[i]; + if (current != null) + this.setEmptyAnimation(current.trackIndex, mixDuration); + } + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.expandToIndex = function (index) { + if (index < this.tracks.length) + return this.tracks[index]; + spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null); + this.tracks.length = index + 1; + return null; + }; + AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) { + var entry = this.trackEntryPool.obtain(); + entry.trackIndex = trackIndex; + entry.animation = animation; + entry.loop = loop; + entry.holdPrevious = false; + entry.eventThreshold = 0; + entry.attachmentThreshold = 0; + entry.drawOrderThreshold = 0; + entry.animationStart = 0; + entry.animationEnd = animation.duration; + entry.animationLast = -1; + entry.nextAnimationLast = -1; + entry.delay = 0; + entry.trackTime = 0; + entry.trackLast = -1; + entry.nextTrackLast = -1; + entry.trackEnd = Number.MAX_VALUE; + entry.timeScale = 1; + entry.alpha = 1; + entry.interruptAlpha = 1; + entry.mixTime = 0; + entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); + return entry; + }; + AnimationState.prototype.disposeNext = function (entry) { + var next = entry.next; + while (next != null) { + this.queue.dispose(next); + next = next.next; + } + entry.next = null; + }; + AnimationState.prototype._animationsChanged = function () { + this.animationsChanged = false; + this.propertyIDs.clear(); + for (var i = 0, n = this.tracks.length; i < n; i++) { + var entry = this.tracks[i]; + if (entry == null) + continue; + while (entry.mixingFrom != null) + entry = entry.mixingFrom; + do { + if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add) + this.setTimelineModes(entry); + entry = entry.mixingTo; + } while (entry != null); + } + }; + AnimationState.prototype.setTimelineModes = function (entry) { + var to = entry.mixingTo; + var timelines = entry.animation.timelines; + var timelinesCount = entry.animation.timelines.length; + var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount); + entry.timelineHoldMix.length = 0; + var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount); + var propertyIDs = this.propertyIDs; + if (to != null && to.holdPrevious) { + for (var i = 0; i < timelinesCount; i++) { + propertyIDs.add(timelines[i].getPropertyId()); + timelineMode[i] = AnimationState.HOLD; + } + return; + } + outer: for (var i = 0; i < timelinesCount; i++) { + var id = timelines[i].getPropertyId(); + if (!propertyIDs.add(id)) + timelineMode[i] = AnimationState.SUBSEQUENT; + else if (to == null || !this.hasTimeline(to, id)) + timelineMode[i] = AnimationState.FIRST; + else { + for (var next = to.mixingTo; next != null; next = next.mixingTo) { + if (this.hasTimeline(next, id)) + continue; + if (entry.mixDuration > 0) { + timelineMode[i] = AnimationState.HOLD_MIX; + timelineDipMix[i] = next; + continue outer; + } + break; + } + timelineMode[i] = AnimationState.HOLD; + } + } + }; + AnimationState.prototype.hasTimeline = function (entry, id) { + var timelines = entry.animation.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + if (timelines[i].getPropertyId() == id) + return true; + return false; + }; + AnimationState.prototype.getCurrent = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return null; + return this.tracks[trackIndex]; + }; + AnimationState.prototype.addListener = function (listener) { + if (listener == null) + throw new Error("listener cannot be null."); + this.listeners.push(listener); + }; + AnimationState.prototype.removeListener = function (listener) { + var index = this.listeners.indexOf(listener); + if (index >= 0) + this.listeners.splice(index, 1); + }; + AnimationState.prototype.clearListeners = function () { + this.listeners.length = 0; + }; + AnimationState.prototype.clearListenerNotifications = function () { + this.queue.clear(); + }; + AnimationState.emptyAnimation = new spine.Animation("", [], 0); + AnimationState.SUBSEQUENT = 0; + AnimationState.FIRST = 1; + AnimationState.HOLD = 2; + AnimationState.HOLD_MIX = 3; + return AnimationState; + }()); + spine.AnimationState = AnimationState; + var TrackEntry = (function () { + function TrackEntry() { + this.mixBlend = spine.MixBlend.replace; + this.timelineMode = new Array(); + this.timelineHoldMix = new Array(); + this.timelinesRotation = new Array(); + } + TrackEntry.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; + }; + TrackEntry.prototype.getAnimationTime = function () { + if (this.loop) { + var duration = this.animationEnd - this.animationStart; + if (duration == 0) + return this.animationStart; + return (this.trackTime % duration) + this.animationStart; + } + return Math.min(this.trackTime + this.animationStart, this.animationEnd); + }; + TrackEntry.prototype.setAnimationLast = function (animationLast) { + this.animationLast = animationLast; + this.nextAnimationLast = animationLast; + }; + TrackEntry.prototype.isComplete = function () { + return this.trackTime >= this.animationEnd - this.animationStart; + }; + TrackEntry.prototype.resetRotationDirections = function () { + this.timelinesRotation.length = 0; + }; + return TrackEntry; + }()); + spine.TrackEntry = TrackEntry; + var EventQueue = (function () { + function EventQueue(animState) { + this.objects = []; + this.drainDisabled = false; + this.animState = animState; + } + EventQueue.prototype.start = function (entry) { + this.objects.push(EventType.start); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.interrupt = function (entry) { + this.objects.push(EventType.interrupt); + this.objects.push(entry); + }; + EventQueue.prototype.end = function (entry) { + this.objects.push(EventType.end); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.dispose = function (entry) { + this.objects.push(EventType.dispose); + this.objects.push(entry); + }; + EventQueue.prototype.complete = function (entry) { + this.objects.push(EventType.complete); + this.objects.push(entry); + }; + EventQueue.prototype.event = function (entry, event) { + this.objects.push(EventType.event); + this.objects.push(entry); + this.objects.push(event); + }; + EventQueue.prototype.drain = function () { + if (this.drainDisabled) + return; + this.drainDisabled = true; + var objects = this.objects; + var listeners = this.animState.listeners; + for (var i = 0; i < objects.length; i += 2) { + var type = objects[i]; + var entry = objects[i + 1]; + switch (type) { + case EventType.start: + if (entry.listener != null && entry.listener.start) + entry.listener.start(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].start) + listeners[ii].start(entry); + break; + case EventType.interrupt: + if (entry.listener != null && entry.listener.interrupt) + entry.listener.interrupt(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].interrupt) + listeners[ii].interrupt(entry); + break; + case EventType.end: + if (entry.listener != null && entry.listener.end) + entry.listener.end(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].end) + listeners[ii].end(entry); + case EventType.dispose: + if (entry.listener != null && entry.listener.dispose) + entry.listener.dispose(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].dispose) + listeners[ii].dispose(entry); + this.animState.trackEntryPool.free(entry); + break; + case EventType.complete: + if (entry.listener != null && entry.listener.complete) + entry.listener.complete(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].complete) + listeners[ii].complete(entry); + break; + case EventType.event: + var event_3 = objects[i++ + 2]; + if (entry.listener != null && entry.listener.event) + entry.listener.event(entry, event_3); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].event) + listeners[ii].event(entry, event_3); + break; + } + } + this.clear(); + this.drainDisabled = false; + }; + EventQueue.prototype.clear = function () { + this.objects.length = 0; + }; + return EventQueue; + }()); + spine.EventQueue = EventQueue; + var EventType; + (function (EventType) { + EventType[EventType["start"] = 0] = "start"; + EventType[EventType["interrupt"] = 1] = "interrupt"; + EventType[EventType["end"] = 2] = "end"; + EventType[EventType["dispose"] = 3] = "dispose"; + EventType[EventType["complete"] = 4] = "complete"; + EventType[EventType["event"] = 5] = "event"; + })(EventType = spine.EventType || (spine.EventType = {})); + var AnimationStateAdapter2 = (function () { + function AnimationStateAdapter2() { + } + AnimationStateAdapter2.prototype.start = function (entry) { + }; + AnimationStateAdapter2.prototype.interrupt = function (entry) { + }; + AnimationStateAdapter2.prototype.end = function (entry) { + }; + AnimationStateAdapter2.prototype.dispose = function (entry) { + }; + AnimationStateAdapter2.prototype.complete = function (entry) { + }; + AnimationStateAdapter2.prototype.event = function (entry, event) { + }; + return AnimationStateAdapter2; + }()); + spine.AnimationStateAdapter2 = AnimationStateAdapter2; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationStateData = (function () { + function AnimationStateData(skeletonData) { + this.animationToMixTime = {}; + this.defaultMix = 0; + if (skeletonData == null) + throw new Error("skeletonData cannot be null."); + this.skeletonData = skeletonData; + } + AnimationStateData.prototype.setMix = function (fromName, toName, duration) { + var from = this.skeletonData.findAnimation(fromName); + if (from == null) + throw new Error("Animation not found: " + fromName); + var to = this.skeletonData.findAnimation(toName); + if (to == null) + throw new Error("Animation not found: " + toName); + this.setMixWith(from, to, duration); + }; + AnimationStateData.prototype.setMixWith = function (from, to, duration) { + if (from == null) + throw new Error("from cannot be null."); + if (to == null) + throw new Error("to cannot be null."); + var key = from.name + "." + to.name; + this.animationToMixTime[key] = duration; + }; + AnimationStateData.prototype.getMix = function (from, to) { + var key = from.name + "." + to.name; + var value = this.animationToMixTime[key]; + return value === undefined ? this.defaultMix : value; + }; + return AnimationStateData; + }()); + spine.AnimationStateData = AnimationStateData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AssetManager = (function () { + function AssetManager(textureLoader, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.assets = {}; + this.errors = {}; + this.toLoad = 0; + this.loaded = 0; + this.textureLoader = textureLoader; + this.pathPrefix = pathPrefix; + } + AssetManager.downloadText = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.onload = function () { + if (request.status == 200) { + success(request.responseText); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.downloadBinary = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.responseType = "arraybuffer"; + request.onload = function () { + if (request.status == 200) { + success(new Uint8Array(request.response)); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.prototype.loadText = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (data) { + _this.assets[path] = data; + if (success) + success(path, data); + _this.toLoad--; + _this.loaded++; + }, function (state, responseText) { + _this.errors[path] = "Couldn't load text " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load text " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.loadTexture = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = path; + }; + AssetManager.prototype.loadTextureData = function (path, data, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = data; + }; + AssetManager.prototype.loadTextureAtlas = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + var parent = path.lastIndexOf("/") >= 0 ? path.substring(0, path.lastIndexOf("/")) : ""; + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (atlasData) { + var pagesLoaded = { count: 0 }; + var atlasPages = new Array(); + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + atlasPages.push(parent + "/" + path); + var image = document.createElement("img"); + image.width = 16; + image.height = 16; + return new spine.FakeTexture(image); + }); + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + return; + } + var _loop_1 = function (atlasPage) { + var pageLoadError = false; + _this.loadTexture(atlasPage, function (imagePath, image) { + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + if (!pageLoadError) { + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + return _this.get(parent + "/" + path); + }); + _this.assets[path] = atlas; + if (success) + success(path, atlas); + _this.toLoad--; + _this.loaded++; + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + } + } + else { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + } + }, function (imagePath, errorMessage) { + pageLoadError = true; + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + }); + }; + for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) { + var atlasPage = atlasPages_1[_i]; + _loop_1(atlasPage); + } + }, function (state, responseText) { + _this.errors[path] = "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.get = function (path) { + path = this.pathPrefix + path; + return this.assets[path]; + }; + AssetManager.prototype.remove = function (path) { + path = this.pathPrefix + path; + var asset = this.assets[path]; + if (asset.dispose) + asset.dispose(); + this.assets[path] = null; + }; + AssetManager.prototype.removeAll = function () { + for (var key in this.assets) { + var asset = this.assets[key]; + if (asset.dispose) + asset.dispose(); + } + this.assets = {}; + }; + AssetManager.prototype.isLoadingComplete = function () { + return this.toLoad == 0; + }; + AssetManager.prototype.getToLoad = function () { + return this.toLoad; + }; + AssetManager.prototype.getLoaded = function () { + return this.loaded; + }; + AssetManager.prototype.dispose = function () { + this.removeAll(); + }; + AssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + AssetManager.prototype.getErrors = function () { + return this.errors; + }; + return AssetManager; + }()); + spine.AssetManager = AssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AtlasAttachmentLoader = (function () { + function AtlasAttachmentLoader(atlas) { + this.atlas = atlas; + } + AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.RegionAttachment(name); + attachment.setRegion(region); + return attachment; + }; + AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.MeshAttachment(name); + attachment.region = region; + return attachment; + }; + AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) { + return new spine.BoundingBoxAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) { + return new spine.PathAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) { + return new spine.PointAttachment(name); + }; + AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) { + return new spine.ClippingAttachment(name); + }; + return AtlasAttachmentLoader; + }()); + spine.AtlasAttachmentLoader = AtlasAttachmentLoader; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BlendMode; + (function (BlendMode) { + BlendMode[BlendMode["Normal"] = 0] = "Normal"; + BlendMode[BlendMode["Additive"] = 1] = "Additive"; + BlendMode[BlendMode["Multiply"] = 2] = "Multiply"; + BlendMode[BlendMode["Screen"] = 3] = "Screen"; + })(BlendMode = spine.BlendMode || (spine.BlendMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Bone = (function () { + function Bone(data, skeleton, parent) { + 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 = false; + this.a = 0; + this.b = 0; + this.worldX = 0; + this.c = 0; + this.d = 0; + this.worldY = 0; + this.sorted = false; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.skeleton = skeleton; + this.parent = parent; + this.setToSetupPose(); + } + Bone.prototype.update = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransform = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) { + this.ax = x; + this.ay = y; + this.arotation = rotation; + this.ascaleX = scaleX; + this.ascaleY = scaleY; + this.ashearX = shearX; + this.ashearY = shearY; + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + var skeleton = this.skeleton; + var rotationY = rotation + 90 + shearY; + var sx = skeleton.scaleX; + var sy = skeleton.scaleY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy; + this.worldX = x * sx + skeleton.x; + this.worldY = y * sy + skeleton.y; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + this.worldX = pa * x + pb * y + parent.worldX; + this.worldY = pc * x + pd * y + parent.worldY; + switch (this.data.transformMode) { + case spine.TransformMode.Normal: { + var rotationY = rotation + 90 + shearY; + var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(rotationY) * scaleY; + var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(rotationY) * scaleY; + this.a = pa * la + pb * lc; + this.b = pa * lb + pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + return; + } + case spine.TransformMode.OnlyTranslation: { + var rotationY = rotation + 90 + shearY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY; + break; + } + case spine.TransformMode.NoRotationOrReflection: { + var s = pa * pa + pc * pc; + var prx = 0; + if (s > 0.0001) { + s = Math.abs(pa * pd - pb * pc) / s; + pb = pc * s; + pd = pa * s; + prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg; + } + else { + pa = 0; + pc = 0; + prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg; + } + var rx = rotation + shearX - prx; + var ry = rotation + shearY - prx + 90; + var la = spine.MathUtils.cosDeg(rx) * scaleX; + var lb = spine.MathUtils.cosDeg(ry) * scaleY; + var lc = spine.MathUtils.sinDeg(rx) * scaleX; + var ld = spine.MathUtils.sinDeg(ry) * scaleY; + this.a = pa * la - pb * lc; + this.b = pa * lb - pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + break; + } + case spine.TransformMode.NoScale: + case spine.TransformMode.NoScaleOrReflection: { + var cos = spine.MathUtils.cosDeg(rotation); + var sin = spine.MathUtils.sinDeg(rotation); + var za = (pa * cos + pb * sin) / this.skeleton.scaleX; + var zc = (pc * cos + pd * sin) / this.skeleton.scaleY; + var s = Math.sqrt(za * za + zc * zc); + if (s > 0.00001) + s = 1 / s; + za *= s; + zc *= s; + s = Math.sqrt(za * za + zc * zc); + if (this.data.transformMode == spine.TransformMode.NoScale + && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) + s = -s; + var r = Math.PI / 2 + Math.atan2(zc, za); + var zb = Math.cos(r) * s; + var zd = Math.sin(r) * s; + var la = spine.MathUtils.cosDeg(shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY; + var lc = spine.MathUtils.sinDeg(shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY; + this.a = za * la + zb * lc; + this.b = za * lb + zb * ld; + this.c = zc * la + zd * lc; + this.d = zc * lb + zd * ld; + break; + } + } + this.a *= this.skeleton.scaleX; + this.b *= this.skeleton.scaleX; + this.c *= this.skeleton.scaleY; + this.d *= this.skeleton.scaleY; + }; + Bone.prototype.setToSetupPose = function () { + var data = this.data; + this.x = data.x; + this.y = data.y; + this.rotation = data.rotation; + this.scaleX = data.scaleX; + this.scaleY = data.scaleY; + this.shearX = data.shearX; + this.shearY = data.shearY; + }; + Bone.prototype.getWorldRotationX = function () { + return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldRotationY = function () { + return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldScaleX = function () { + return Math.sqrt(this.a * this.a + this.c * this.c); + }; + Bone.prototype.getWorldScaleY = function () { + return Math.sqrt(this.b * this.b + this.d * this.d); + }; + Bone.prototype.updateAppliedTransform = function () { + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + this.ax = this.worldX; + this.ay = this.worldY; + this.arotation = Math.atan2(this.c, this.a) * spine.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; + this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + var pid = 1 / (pa * pd - pb * pc); + var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; + this.ax = (dx * pd * pid - dy * pb * pid); + this.ay = (dy * pa * pid - dx * pc * pid); + var ia = pid * pd; + var id = pid * pa; + var ib = pid * pb; + var ic = pid * pc; + var ra = ia * this.a - ib * this.c; + var rb = ia * this.b - ib * this.d; + var rc = id * this.c - ic * this.a; + var rd = id * this.d - ic * this.b; + this.ashearX = 0; + this.ascaleX = Math.sqrt(ra * ra + rc * rc); + if (this.ascaleX > 0.0001) { + var det = ra * rd - rb * rc; + this.ascaleY = det / this.ascaleX; + this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg; + this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg; + } + else { + this.ascaleX = 0; + this.ascaleY = Math.sqrt(rb * rb + rd * rd); + this.ashearY = 0; + this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg; + } + }; + Bone.prototype.worldToLocal = function (world) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var invDet = 1 / (a * d - b * c); + var x = world.x - this.worldX, y = world.y - this.worldY; + world.x = (x * d * invDet - y * b * invDet); + world.y = (y * a * invDet - x * c * invDet); + return world; + }; + Bone.prototype.localToWorld = function (local) { + var x = local.x, y = local.y; + local.x = x * this.a + y * this.b + this.worldX; + local.y = x * this.c + y * this.d + this.worldY; + return local; + }; + Bone.prototype.worldToLocalRotation = function (worldRotation) { + var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation); + return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX; + }; + Bone.prototype.localToWorldRotation = function (localRotation) { + localRotation -= this.rotation - this.shearX; + var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation); + return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.rotateWorld = function (degrees) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees); + this.a = cos * a - sin * c; + this.b = cos * b - sin * d; + this.c = sin * a + cos * c; + this.d = sin * b + cos * d; + this.appliedValid = false; + }; + return Bone; + }()); + spine.Bone = Bone; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoneData = (function () { + function BoneData(index, name, parent) { + this.x = 0; + this.y = 0; + this.rotation = 0; + this.scaleX = 1; + this.scaleY = 1; + this.shearX = 0; + this.shearY = 0; + this.transformMode = TransformMode.Normal; + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + this.index = index; + this.name = name; + this.parent = parent; + } + return BoneData; + }()); + spine.BoneData = BoneData; + var TransformMode; + (function (TransformMode) { + TransformMode[TransformMode["Normal"] = 0] = "Normal"; + TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation"; + TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; + TransformMode[TransformMode["NoScale"] = 3] = "NoScale"; + TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; + })(TransformMode = spine.TransformMode || (spine.TransformMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Event = (function () { + function Event(time, data) { + if (data == null) + throw new Error("data cannot be null."); + this.time = time; + this.data = data; + } + return Event; + }()); + spine.Event = Event; +})(spine || (spine = {})); +var spine; +(function (spine) { + var EventData = (function () { + function EventData(name) { + this.name = name; + } + return EventData; + }()); + spine.EventData = EventData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraint = (function () { + function IkConstraint(data, skeleton) { + this.bendDirection = 0; + this.compress = false; + this.stretch = false; + this.mix = 1; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.mix = data.mix; + this.bendDirection = data.bendDirection; + this.compress = data.compress; + this.stretch = data.stretch; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + IkConstraint.prototype.getOrder = function () { + return this.data.order; + }; + IkConstraint.prototype.apply = function () { + this.update(); + }; + IkConstraint.prototype.update = function () { + var target = this.target; + var bones = this.bones; + switch (bones.length) { + case 1: + this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix); + break; + case 2: + this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix); + break; + } + }; + IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) { + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var p = bone.parent; + var id = 1 / (p.a * p.d - p.b * p.c); + var x = targetX - p.worldX, y = targetY - p.worldY; + var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay; + var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation; + if (bone.ascaleX < 0) + rotationIK += 180; + if (rotationIK > 180) + rotationIK -= 360; + else if (rotationIK < -180) + rotationIK += 360; + var sx = bone.ascaleX, sy = bone.ascaleY; + if (compress || stretch) { + var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty); + if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) { + var s = (dd / b - 1) * alpha + 1; + sx *= s; + if (uniform) + sy *= s; + } + } + bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY); + }; + IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) { + if (alpha == 0) { + child.updateWorldTransform(); + return; + } + if (!parent.appliedValid) + parent.updateAppliedTransform(); + if (!child.appliedValid) + child.updateAppliedTransform(); + var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX; + var os1 = 0, os2 = 0, s2 = 0; + if (psx < 0) { + psx = -psx; + os1 = 180; + s2 = -1; + } + else { + os1 = 0; + s2 = 1; + } + if (psy < 0) { + psy = -psy; + s2 = -s2; + } + if (csx < 0) { + csx = -csx; + os2 = 180; + } + else + os2 = 0; + var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; + var u = Math.abs(psx - psy) <= 0.0001; + if (!u) { + cy = 0; + cwx = a * cx + parent.worldX; + cwy = c * cx + parent.worldY; + } + else { + cy = child.ay; + cwx = a * cx + b * cy + parent.worldX; + cwy = c * cx + d * cy + parent.worldY; + } + var pp = parent.parent; + a = pp.a; + b = pp.b; + c = pp.c; + d = pp.d; + var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY; + var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty; + x = cwx - pp.worldX; + y = cwy - pp.worldY; + var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; + var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0; + outer: if (u) { + l2 *= psx; + var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); + if (cos < -1) + cos = -1; + else if (cos > 1) { + cos = 1; + if (stretch && l1 + l2 > 0.0001) + sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1; + } + a2 = Math.acos(cos) * bendDir; + a = l1 + l2 * cos; + b = l2 * Math.sin(a2); + a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b); + } + else { + a = psx * l2; + b = psy * l2; + var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); + c = bb * l1 * l1 + aa * dd - aa * bb; + var c1 = -2 * bb * l1, c2 = bb - aa; + d = c1 * c1 - 4 * c2 * c; + if (d >= 0) { + var q = Math.sqrt(d); + if (c1 < 0) + q = -q; + q = -(c1 + q) / 2; + var r0 = q / c2, r1 = c / q; + var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; + if (r * r <= dd) { + y = Math.sqrt(dd - r * r) * bendDir; + a1 = ta - Math.atan2(y, r); + a2 = Math.atan2(y / psy, (r - l1) / psx); + break outer; + } + } + var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; + var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; + c = -a * l1 / (aa - bb); + if (c >= -1 && c <= 1) { + c = Math.acos(c); + x = a * Math.cos(c) + l1; + y = b * Math.sin(c); + d = x * x + y * y; + if (d < minDist) { + minAngle = c; + minDist = d; + minX = x; + minY = y; + } + if (d > maxDist) { + maxAngle = c; + maxDist = d; + maxX = x; + maxY = y; + } + } + if (dd <= (minDist + maxDist) / 2) { + a1 = ta - Math.atan2(minY * bendDir, minX); + a2 = minAngle * bendDir; + } + else { + a1 = ta - Math.atan2(maxY * bendDir, maxX); + a2 = maxAngle * bendDir; + } + } + var os = Math.atan2(cy, cx) * s2; + var rotation = parent.arotation; + a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation; + if (a1 > 180) + a1 -= 360; + else if (a1 < -180) + a1 += 360; + parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0); + rotation = child.arotation; + a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; + if (a2 > 180) + a2 -= 360; + else if (a2 < -180) + a2 += 360; + child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); + }; + return IkConstraint; + }()); + spine.IkConstraint = IkConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraintData = (function () { + function IkConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.bendDirection = 1; + this.compress = false; + this.stretch = false; + this.uniform = false; + this.mix = 1; + this.name = name; + } + return IkConstraintData; + }()); + spine.IkConstraintData = IkConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraint = (function () { + function PathConstraint(data, skeleton) { + 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(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0, n = data.bones.length; i < n; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findSlot(data.target.name); + this.position = data.position; + this.spacing = data.spacing; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + } + PathConstraint.prototype.apply = function () { + this.update(); + }; + PathConstraint.prototype.update = function () { + var attachment = this.target.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + return; + var rotateMix = this.rotateMix, translateMix = this.translateMix; + var translate = translateMix > 0, rotate = rotateMix > 0; + if (!translate && !rotate) + return; + var data = this.data; + var percentSpacing = data.spacingMode == spine.SpacingMode.Percent; + var rotateMode = data.rotateMode; + var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale; + var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1; + var bones = this.bones; + var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null; + var spacing = this.spacing; + if (scale || !percentSpacing) { + if (scale) + lengths = spine.Utils.setArraySize(this.lengths, boneCount); + var lengthSpacing = data.spacingMode == spine.SpacingMode.Length; + for (var i = 0, n = spacesCount - 1; i < n;) { + var bone = bones[i]; + var setupLength = bone.data.length; + if (setupLength < PathConstraint.epsilon) { + if (scale) + lengths[i] = 0; + spaces[++i] = 0; + } + else if (percentSpacing) { + if (scale) { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_1 = Math.sqrt(x * x + y * y); + lengths[i] = length_1; + } + spaces[++i] = spacing; + } + else { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_2 = Math.sqrt(x * x + y * y); + if (scale) + lengths[i] = length_2; + spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength; + } + } + } + else { + for (var i = 1; i < spacesCount; i++) + spaces[i] = spacing; + } + var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing); + var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; + var tip = false; + if (offsetRotation == 0) + tip = rotateMode == spine.RotateMode.Chain; + else { + tip = false; + var p = this.target.bone; + offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + } + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.worldX += (boneX - bone.worldX) * translateMix; + bone.worldY += (boneY - bone.worldY) * translateMix; + var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; + if (scale) { + var length_3 = lengths[i]; + if (length_3 != 0) { + var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1; + bone.a *= s; + bone.c *= s; + } + } + boneX = x; + boneY = y; + if (rotate) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; + if (tangents) + r = positions[p - 1]; + else if (spaces[i + 1] == 0) + r = positions[p + 2]; + else + r = Math.atan2(dy, dx); + r -= Math.atan2(c, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_4 = bone.data.length; + boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix; + boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix; + } + else { + r += offsetRotation; + } + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + } + bone.appliedValid = false; + } + }; + PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) { + var target = this.target; + var position = this.position; + var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null; + var closed = path.closed; + var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE; + if (!path.constantSpeed) { + var lengths = path.lengths; + curveCount -= closed ? 1 : 2; + var pathLength_1 = lengths[curveCount]; + if (percentPosition) + position *= pathLength_1; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength_1; + } + world = spine.Utils.setArraySize(this.world, 8); + for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength_1; + if (p < 0) + p += pathLength_1; + curve = 0; + } + else if (p < 0) { + if (prevCurve != PathConstraint.BEFORE) { + prevCurve = PathConstraint.BEFORE; + path.computeWorldVertices(target, 2, 4, world, 0, 2); + } + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength_1) { + if (prevCurve != PathConstraint.AFTER) { + prevCurve = PathConstraint.AFTER; + path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2); + } + this.addAfterPosition(p - pathLength_1, world, 0, out, o); + continue; + } + for (;; curve++) { + var length_5 = lengths[curve]; + if (p > length_5) + continue; + if (curve == 0) + p /= length_5; + else { + var prev = lengths[curve - 1]; + p = (p - prev) / (length_5 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + if (closed && curve == curveCount) { + path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2); + path.computeWorldVertices(target, 0, 4, world, 4, 2); + } + else + path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2); + } + this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0)); + } + return out; + } + if (closed) { + verticesLength += 2; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2); + path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2); + world[verticesLength - 2] = world[0]; + world[verticesLength - 1] = world[1]; + } + else { + curveCount--; + verticesLength -= 4; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength, world, 0, 2); + } + var curves = spine.Utils.setArraySize(this.curves, curveCount); + var pathLength = 0; + var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = world[w]; + cy1 = world[w + 1]; + cx2 = world[w + 2]; + cy2 = world[w + 3]; + x2 = world[w + 4]; + y2 = world[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) + position *= pathLength; + else + position *= pathLength / path.lengths[curveCount - 1]; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength; + } + var segments = this.segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength) { + this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); + continue; + } + for (;; curve++) { + var length_6 = curves[curve]; + if (p > length_6) + continue; + if (curve == 0) + p /= length_6; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_6 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + var ii = curve * 6; + x1 = world[ii]; + y1 = world[ii + 1]; + cx1 = world[ii + 2]; + cy1 = world[ii + 3]; + cx2 = world[ii + 4]; + cy2 = world[ii + 5]; + x2 = world[ii + 6]; + y2 = world[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + p *= curveLength; + for (;; segment++) { + var length_7 = segments[segment]; + if (p > length_7) + continue; + if (segment == 0) + p /= length_7; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_7 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0)); + } + return out; + }; + PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) { + var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) { + var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { + if (p == 0 || isNaN(p)) { + out[o] = x1; + out[o + 1] = y1; + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + return; + } + var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; + var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; + var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; + out[o] = x; + out[o + 1] = y; + if (tangents) { + if (p < 0.001) + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + else + out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); + } + }; + PathConstraint.prototype.getOrder = function () { + return this.data.order; + }; + PathConstraint.NONE = -1; + PathConstraint.BEFORE = -2; + PathConstraint.AFTER = -3; + PathConstraint.epsilon = 0.00001; + return PathConstraint; + }()); + spine.PathConstraint = PathConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraintData = (function () { + function PathConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.name = name; + } + return PathConstraintData; + }()); + spine.PathConstraintData = PathConstraintData; + var PositionMode; + (function (PositionMode) { + PositionMode[PositionMode["Fixed"] = 0] = "Fixed"; + PositionMode[PositionMode["Percent"] = 1] = "Percent"; + })(PositionMode = spine.PositionMode || (spine.PositionMode = {})); + var SpacingMode; + (function (SpacingMode) { + SpacingMode[SpacingMode["Length"] = 0] = "Length"; + SpacingMode[SpacingMode["Fixed"] = 1] = "Fixed"; + SpacingMode[SpacingMode["Percent"] = 2] = "Percent"; + })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {})); + var RotateMode; + (function (RotateMode) { + RotateMode[RotateMode["Tangent"] = 0] = "Tangent"; + RotateMode[RotateMode["Chain"] = 1] = "Chain"; + RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale"; + })(RotateMode = spine.RotateMode || (spine.RotateMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Assets = (function () { + function Assets(clientId) { + this.toLoad = new Array(); + this.assets = {}; + this.clientId = clientId; + } + Assets.prototype.loaded = function () { + var i = 0; + for (var v in this.assets) + i++; + return i; + }; + return Assets; + }()); + var SharedAssetManager = (function () { + function SharedAssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.clientAssets = {}; + this.queuedAssets = {}; + this.rawAssets = {}; + this.errors = {}; + this.pathPrefix = pathPrefix; + } + SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) { + clientAssets = new Assets(clientId); + this.clientAssets[clientId] = clientAssets; + } + if (textureLoader !== null) + clientAssets.textureLoader = textureLoader; + clientAssets.toLoad.push(path); + if (this.queuedAssets[path] === path) { + return false; + } + else { + this.queuedAssets[path] = path; + return true; + } + }; + SharedAssetManager.prototype.loadText = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = request.responseText; + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadJson = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = JSON.parse(request.responseText); + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, textureLoader, path)) + return; + var img = new Image(); + img.src = path; + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + _this.rawAssets[path] = img; + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + }; + }; + SharedAssetManager.prototype.get = function (clientId, path) { + path = this.pathPrefix + path; + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + return clientAssets.assets[path]; + }; + SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { + for (var i = 0; i < clientAssets.toLoad.length; i++) { + var path = clientAssets.toLoad[i]; + var asset = clientAssets.assets[path]; + if (asset === null || asset === undefined) { + var rawAsset = this.rawAssets[path]; + if (rawAsset === null || rawAsset === undefined) + continue; + if (rawAsset instanceof HTMLImageElement) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } + } + } + }; + SharedAssetManager.prototype.isLoadingComplete = function (clientId) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + this.updateClientAssets(clientAssets); + return clientAssets.toLoad.length == clientAssets.loaded(); + }; + SharedAssetManager.prototype.dispose = function () { + }; + SharedAssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + SharedAssetManager.prototype.getErrors = function () { + return this.errors; + }; + return SharedAssetManager; + }()); + spine.SharedAssetManager = SharedAssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skeleton = (function () { + function Skeleton(data) { + this._updateCache = new Array(); + this.updateCacheReset = new Array(); + this.time = 0; + this.scaleX = 1; + this.scaleY = 1; + this.x = 0; + this.y = 0; + if (data == null) + throw new Error("data cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) { + var boneData = data.bones[i]; + var bone = void 0; + if (boneData.parent == null) + bone = new spine.Bone(boneData, this, null); + else { + var parent_1 = this.bones[boneData.parent.index]; + bone = new spine.Bone(boneData, this, parent_1); + parent_1.children.push(bone); + } + this.bones.push(bone); + } + this.slots = new Array(); + this.drawOrder = new Array(); + for (var i = 0; i < data.slots.length; i++) { + var slotData = data.slots[i]; + var bone = this.bones[slotData.boneData.index]; + var slot = new spine.Slot(slotData, bone); + this.slots.push(slot); + this.drawOrder.push(slot); + } + this.ikConstraints = new Array(); + for (var i = 0; i < data.ikConstraints.length; i++) { + var ikConstraintData = data.ikConstraints[i]; + this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this)); + } + this.transformConstraints = new Array(); + for (var i = 0; i < data.transformConstraints.length; i++) { + var transformConstraintData = data.transformConstraints[i]; + this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this)); + } + this.pathConstraints = new Array(); + for (var i = 0; i < data.pathConstraints.length; i++) { + var pathConstraintData = data.pathConstraints[i]; + this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this)); + } + this.color = new spine.Color(1, 1, 1, 1); + this.updateCache(); + } + Skeleton.prototype.updateCache = function () { + var updateCache = this._updateCache; + updateCache.length = 0; + this.updateCacheReset.length = 0; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].sorted = false; + var ikConstraints = this.ikConstraints; + var transformConstraints = this.transformConstraints; + var pathConstraints = this.pathConstraints; + var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length; + var constraintCount = ikCount + transformCount + pathCount; + outer: for (var i = 0; i < constraintCount; i++) { + for (var ii = 0; ii < ikCount; ii++) { + var constraint = ikConstraints[ii]; + if (constraint.data.order == i) { + this.sortIkConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < transformCount; ii++) { + var constraint = transformConstraints[ii]; + if (constraint.data.order == i) { + this.sortTransformConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < pathCount; ii++) { + var constraint = pathConstraints[ii]; + if (constraint.data.order == i) { + this.sortPathConstraint(constraint); + continue outer; + } + } + } + for (var i = 0, n = bones.length; i < n; i++) + this.sortBone(bones[i]); + }; + Skeleton.prototype.sortIkConstraint = function (constraint) { + var target = constraint.target; + this.sortBone(target); + var constrained = constraint.bones; + var parent = constrained[0]; + this.sortBone(parent); + if (constrained.length > 1) { + var child = constrained[constrained.length - 1]; + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + this._updateCache.push(constraint); + this.sortReset(parent.children); + constrained[constrained.length - 1].sorted = true; + }; + Skeleton.prototype.sortPathConstraint = function (constraint) { + var slot = constraint.target; + var slotIndex = slot.data.index; + var slotBone = slot.bone; + if (this.skin != null) + this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); + if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin) + this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); + for (var i = 0, n = this.data.skins.length; i < n; i++) + this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone); + var attachment = slot.getAttachment(); + if (attachment instanceof spine.PathAttachment) + this.sortPathConstraintAttachmentWith(attachment, slotBone); + var constrained = constraint.bones; + var boneCount = constrained.length; + for (var i = 0; i < boneCount; i++) + this.sortBone(constrained[i]); + this._updateCache.push(constraint); + for (var i = 0; i < boneCount; i++) + this.sortReset(constrained[i].children); + for (var i = 0; i < boneCount; i++) + constrained[i].sorted = true; + }; + Skeleton.prototype.sortTransformConstraint = function (constraint) { + this.sortBone(constraint.target); + var constrained = constraint.bones; + var boneCount = constrained.length; + if (constraint.data.local) { + for (var i = 0; i < boneCount; i++) { + var child = constrained[i]; + this.sortBone(child.parent); + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + } + else { + for (var i = 0; i < boneCount; i++) { + this.sortBone(constrained[i]); + } + } + this._updateCache.push(constraint); + for (var ii = 0; ii < boneCount; ii++) + this.sortReset(constrained[ii].children); + for (var ii = 0; ii < boneCount; ii++) + constrained[ii].sorted = true; + }; + Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) { + var attachments = skin.attachments[slotIndex]; + if (!attachments) + return; + for (var key in attachments) { + this.sortPathConstraintAttachmentWith(attachments[key], slotBone); + } + }; + Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) { + if (!(attachment instanceof spine.PathAttachment)) + return; + var pathBones = attachment.bones; + if (pathBones == null) + this.sortBone(slotBone); + else { + var bones = this.bones; + var i = 0; + while (i < pathBones.length) { + var boneCount = pathBones[i++]; + for (var n = i + boneCount; i < n; i++) { + var boneIndex = pathBones[i]; + this.sortBone(bones[boneIndex]); + } + } + } + }; + Skeleton.prototype.sortBone = function (bone) { + if (bone.sorted) + return; + var parent = bone.parent; + if (parent != null) + this.sortBone(parent); + bone.sorted = true; + this._updateCache.push(bone); + }; + Skeleton.prototype.sortReset = function (bones) { + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.sorted) + this.sortReset(bone.children); + bone.sorted = false; + } + }; + Skeleton.prototype.updateWorldTransform = function () { + var updateCacheReset = this.updateCacheReset; + for (var i = 0, n = updateCacheReset.length; i < n; i++) { + var bone = updateCacheReset[i]; + bone.ax = bone.x; + bone.ay = bone.y; + bone.arotation = bone.rotation; + bone.ascaleX = bone.scaleX; + bone.ascaleY = bone.scaleY; + bone.ashearX = bone.shearX; + bone.ashearY = bone.shearY; + bone.appliedValid = true; + } + var updateCache = this._updateCache; + for (var i = 0, n = updateCache.length; i < n; i++) + updateCache[i].update(); + }; + Skeleton.prototype.setToSetupPose = function () { + this.setBonesToSetupPose(); + this.setSlotsToSetupPose(); + }; + Skeleton.prototype.setBonesToSetupPose = function () { + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].setToSetupPose(); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + var data = constraint.data; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + } + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + var data = constraint.data; + constraint.position = data.position; + constraint.spacing = data.spacing; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + } + }; + Skeleton.prototype.setSlotsToSetupPose = function () { + var slots = this.slots; + spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); + for (var i = 0, n = slots.length; i < n; i++) + slots[i].setToSetupPose(); + }; + Skeleton.prototype.getRootBone = function () { + if (this.bones.length == 0) + return null; + return this.bones[0]; + }; + Skeleton.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.data.name == boneName) + return bone; + } + return null; + }; + Skeleton.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].data.name == boneName) + return i; + return -1; + }; + Skeleton.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) + return slot; + } + return null; + }; + Skeleton.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].data.name == slotName) + return i; + return -1; + }; + Skeleton.prototype.setSkinByName = function (skinName) { + var skin = this.data.findSkin(skinName); + if (skin == null) + throw new Error("Skin not found: " + skinName); + this.setSkin(skin); + }; + Skeleton.prototype.setSkin = function (newSkin) { + if (newSkin != null) { + if (this.skin != null) + newSkin.attachAll(this, this.skin); + else { + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var name_1 = slot.data.attachmentName; + if (name_1 != null) { + var attachment = newSkin.getAttachment(i, name_1); + if (attachment != null) + slot.setAttachment(attachment); + } + } + } + } + this.skin = newSkin; + }; + Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) { + return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName); + }; + Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) { + if (attachmentName == null) + throw new Error("attachmentName cannot be null."); + if (this.skin != null) { + var attachment = this.skin.getAttachment(slotIndex, attachmentName); + if (attachment != null) + return attachment; + } + if (this.data.defaultSkin != null) + return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); + return null; + }; + Skeleton.prototype.setAttachment = function (slotName, attachmentName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) { + var attachment = null; + if (attachmentName != null) { + attachment = this.getAttachment(i, attachmentName); + if (attachment == null) + throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName); + } + slot.setAttachment(attachment); + return; + } + } + throw new Error("Slot not found: " + slotName); + }; + Skeleton.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var ikConstraint = ikConstraints[i]; + if (ikConstraint.data.name == constraintName) + return ikConstraint; + } + return null; + }; + Skeleton.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.getBounds = function (offset, size, temp) { + if (temp === void 0) { temp = new Array(2); } + if (offset == null) + throw new Error("offset cannot be null."); + if (size == null) + throw new Error("size cannot be null."); + var drawOrder = this.drawOrder; + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var verticesLength = 0; + var vertices = null; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + verticesLength = 8; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + attachment.computeWorldVertices(slot.bone, vertices, 0, 2); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + verticesLength = mesh.worldVerticesLength; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2); + } + if (vertices != null) { + for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + } + offset.set(minX, minY); + size.set(maxX - minX, maxY - minY); + }; + Skeleton.prototype.update = function (delta) { + this.time += delta; + }; + return Skeleton; + }()); + spine.Skeleton = Skeleton; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonBounds = (function () { + function SkeletonBounds() { + this.minX = 0; + this.minY = 0; + this.maxX = 0; + this.maxY = 0; + this.boundingBoxes = new Array(); + this.polygons = new Array(); + this.polygonPool = new spine.Pool(function () { + return spine.Utils.newFloatArray(16); + }); + } + SkeletonBounds.prototype.update = function (skeleton, updateAabb) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + var boundingBoxes = this.boundingBoxes; + var polygons = this.polygons; + var polygonPool = this.polygonPool; + var slots = skeleton.slots; + var slotCount = slots.length; + boundingBoxes.length = 0; + polygonPool.freeAll(polygons); + polygons.length = 0; + for (var i = 0; i < slotCount; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.BoundingBoxAttachment) { + var boundingBox = attachment; + boundingBoxes.push(boundingBox); + var polygon = polygonPool.obtain(); + if (polygon.length != boundingBox.worldVerticesLength) { + polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength); + } + polygons.push(polygon); + boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2); + } + } + if (updateAabb) { + this.aabbCompute(); + } + else { + this.minX = Number.POSITIVE_INFINITY; + this.minY = Number.POSITIVE_INFINITY; + this.maxX = Number.NEGATIVE_INFINITY; + this.maxY = Number.NEGATIVE_INFINITY; + } + }; + SkeletonBounds.prototype.aabbCompute = function () { + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + var vertices = polygon; + for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) { + var x = vertices[ii]; + var y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + this.minX = minX; + this.minY = minY; + this.maxX = maxX; + this.maxY = maxY; + }; + SkeletonBounds.prototype.aabbContainsPoint = function (x, y) { + return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; + }; + SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) { + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) + return false; + var m = (y2 - y1) / (x2 - x1); + var y = m * (minX - x1) + y1; + if (y > minY && y < maxY) + return true; + y = m * (maxX - x1) + y1; + if (y > minY && y < maxY) + return true; + var x = (minY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + x = (maxY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + return false; + }; + SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) { + return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; + }; + SkeletonBounds.prototype.containsPoint = function (x, y) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.containsPointPolygon(polygons[i], x, y)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) { + var vertices = polygon; + var nn = polygon.length; + var prevIndex = nn - 2; + var inside = false; + for (var ii = 0; ii < nn; ii += 2) { + var vertexY = vertices[ii + 1]; + var prevY = vertices[prevIndex + 1]; + if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { + var vertexX = vertices[ii]; + if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) + inside = !inside; + } + prevIndex = ii; + } + return inside; + }; + SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) { + var vertices = polygon; + var nn = polygon.length; + var width12 = x1 - x2, height12 = y1 - y2; + var det1 = x1 * y2 - y1 * x2; + var x3 = vertices[nn - 2], y3 = vertices[nn - 1]; + for (var ii = 0; ii < nn; ii += 2) { + var x4 = vertices[ii], y4 = vertices[ii + 1]; + var det2 = x3 * y4 - y3 * x4; + var width34 = x3 - x4, height34 = y3 - y4; + var det3 = width12 * height34 - height12 * width34; + var x = (det1 * width34 - width12 * det2) / det3; + if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { + var y = (det1 * height34 - height12 * det2) / det3; + if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) + return true; + } + x3 = x4; + y3 = y4; + } + return false; + }; + SkeletonBounds.prototype.getPolygon = function (boundingBox) { + if (boundingBox == null) + throw new Error("boundingBox cannot be null."); + var index = this.boundingBoxes.indexOf(boundingBox); + return index == -1 ? null : this.polygons[index]; + }; + SkeletonBounds.prototype.getWidth = function () { + return this.maxX - this.minX; + }; + SkeletonBounds.prototype.getHeight = function () { + return this.maxY - this.minY; + }; + return SkeletonBounds; + }()); + spine.SkeletonBounds = SkeletonBounds; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonClipping = (function () { + function SkeletonClipping() { + this.triangulator = new spine.Triangulator(); + this.clippingPolygon = new Array(); + this.clipOutput = new Array(); + this.clippedVertices = new Array(); + this.clippedTriangles = new Array(); + this.scratch = new Array(); + } + SkeletonClipping.prototype.clipStart = function (slot, clip) { + if (this.clipAttachment != null) + return 0; + this.clipAttachment = clip; + var n = clip.worldVerticesLength; + var vertices = spine.Utils.setArraySize(this.clippingPolygon, n); + clip.computeWorldVertices(slot, 0, n, vertices, 0, 2); + var clippingPolygon = this.clippingPolygon; + SkeletonClipping.makeClockwise(clippingPolygon); + var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); + for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) { + var polygon = clippingPolygons[i]; + SkeletonClipping.makeClockwise(polygon); + polygon.push(polygon[0]); + polygon.push(polygon[1]); + } + return clippingPolygons.length; + }; + SkeletonClipping.prototype.clipEndWithSlot = function (slot) { + if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data) + this.clipEnd(); + }; + SkeletonClipping.prototype.clipEnd = function () { + if (this.clipAttachment == null) + return; + this.clipAttachment = null; + this.clippingPolygons = null; + this.clippedVertices.length = 0; + this.clippedTriangles.length = 0; + this.clippingPolygon.length = 0; + }; + SkeletonClipping.prototype.isClipping = function () { + return this.clipAttachment != null; + }; + SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) { + var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; + var clippedTriangles = this.clippedTriangles; + var polygons = this.clippingPolygons; + var polygonsCount = this.clippingPolygons.length; + var vertexSize = twoColor ? 12 : 8; + var index = 0; + clippedVertices.length = 0; + clippedTriangles.length = 0; + outer: for (var i = 0; i < trianglesLength; i += 3) { + var vertexOffset = triangles[i] << 1; + var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; + var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 1] << 1; + var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; + var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 2] << 1; + var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; + var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; + for (var p = 0; p < polygonsCount; p++) { + var s = clippedVertices.length; + if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { + var clipOutputLength = clipOutput.length; + if (clipOutputLength == 0) + continue; + var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; + var d = 1 / (d0 * d2 + d1 * (y1 - y3)); + var clipOutputCount = clipOutputLength >> 1; + var clipOutputItems = this.clipOutput; + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize); + for (var ii = 0; ii < clipOutputLength; ii += 2) { + var x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; + clippedVerticesItems[s] = x; + clippedVerticesItems[s + 1] = y; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + var c0 = x - x3, c1 = y - y3; + var a = (d0 * c0 + d1 * c1) * d; + var b = (d4 * c0 + d2 * c1) * d; + var c = 1 - a - b; + clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c; + clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c; + if (twoColor) { + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + } + s += vertexSize; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); + clipOutputCount--; + for (var ii = 1; ii < clipOutputCount; ii++) { + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + ii); + clippedTrianglesItems[s + 2] = (index + ii + 1); + s += 3; + } + index += clipOutputCount + 1; + } + else { + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize); + clippedVerticesItems[s] = x1; + clippedVerticesItems[s + 1] = y1; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + if (!twoColor) { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = x2; + clippedVerticesItems[s + 9] = y2; + clippedVerticesItems[s + 10] = light.r; + clippedVerticesItems[s + 11] = light.g; + clippedVerticesItems[s + 12] = light.b; + clippedVerticesItems[s + 13] = light.a; + clippedVerticesItems[s + 14] = u2; + clippedVerticesItems[s + 15] = v2; + clippedVerticesItems[s + 16] = x3; + clippedVerticesItems[s + 17] = y3; + clippedVerticesItems[s + 18] = light.r; + clippedVerticesItems[s + 19] = light.g; + clippedVerticesItems[s + 20] = light.b; + clippedVerticesItems[s + 21] = light.a; + clippedVerticesItems[s + 22] = u3; + clippedVerticesItems[s + 23] = v3; + } + else { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + clippedVerticesItems[s + 12] = x2; + clippedVerticesItems[s + 13] = y2; + clippedVerticesItems[s + 14] = light.r; + clippedVerticesItems[s + 15] = light.g; + clippedVerticesItems[s + 16] = light.b; + clippedVerticesItems[s + 17] = light.a; + clippedVerticesItems[s + 18] = u2; + clippedVerticesItems[s + 19] = v2; + clippedVerticesItems[s + 20] = dark.r; + clippedVerticesItems[s + 21] = dark.g; + clippedVerticesItems[s + 22] = dark.b; + clippedVerticesItems[s + 23] = dark.a; + clippedVerticesItems[s + 24] = x3; + clippedVerticesItems[s + 25] = y3; + clippedVerticesItems[s + 26] = light.r; + clippedVerticesItems[s + 27] = light.g; + clippedVerticesItems[s + 28] = light.b; + clippedVerticesItems[s + 29] = light.a; + clippedVerticesItems[s + 30] = u3; + clippedVerticesItems[s + 31] = v3; + clippedVerticesItems[s + 32] = dark.r; + clippedVerticesItems[s + 33] = dark.g; + clippedVerticesItems[s + 34] = dark.b; + clippedVerticesItems[s + 35] = dark.a; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3); + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + 1); + clippedTrianglesItems[s + 2] = (index + 2); + index += 3; + continue outer; + } + } + } + }; + SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) { + var originalOutput = output; + var clipped = false; + var input = null; + if (clippingArea.length % 4 >= 2) { + input = output; + output = this.scratch; + } + else + input = this.scratch; + input.length = 0; + input.push(x1); + input.push(y1); + input.push(x2); + input.push(y2); + input.push(x3); + input.push(y3); + input.push(x1); + input.push(y1); + output.length = 0; + var clippingVertices = clippingArea; + var clippingVerticesLast = clippingArea.length - 4; + for (var i = 0;; i += 2) { + var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; + var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3]; + var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2; + var inputVertices = input; + var inputVerticesLength = input.length - 2, outputStart = output.length; + for (var ii = 0; ii < inputVerticesLength; ii += 2) { + var inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; + var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3]; + var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0; + if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) { + if (side2) { + output.push(inputX2); + output.push(inputY2); + continue; + } + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + } + else if (side2) { + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + output.push(inputX2); + output.push(inputY2); + } + clipped = true; + } + if (outputStart == output.length) { + originalOutput.length = 0; + return true; + } + output.push(output[0]); + output.push(output[1]); + if (i == clippingVerticesLast) + break; + var temp = output; + output = input; + output.length = 0; + input = temp; + } + if (originalOutput != output) { + originalOutput.length = 0; + for (var i = 0, n = output.length - 2; i < n; i++) + originalOutput[i] = output[i]; + } + else + originalOutput.length = originalOutput.length - 2; + return clipped; + }; + SkeletonClipping.makeClockwise = function (polygon) { + var vertices = polygon; + var verticeslength = polygon.length; + var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; + for (var i = 0, n = verticeslength - 3; i < n; i += 2) { + p1x = vertices[i]; + p1y = vertices[i + 1]; + p2x = vertices[i + 2]; + p2y = vertices[i + 3]; + area += p1x * p2y - p2x * p1y; + } + if (area < 0) + return; + for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { + var x = vertices[i], y = vertices[i + 1]; + var other = lastX - i; + vertices[i] = vertices[other]; + vertices[i + 1] = vertices[other + 1]; + vertices[other] = x; + vertices[other + 1] = y; + } + }; + return SkeletonClipping; + }()); + spine.SkeletonClipping = SkeletonClipping; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonData = (function () { + function SkeletonData() { + this.bones = new Array(); + this.slots = new Array(); + this.skins = new Array(); + this.events = new Array(); + this.animations = new Array(); + this.ikConstraints = new Array(); + this.transformConstraints = new Array(); + this.pathConstraints = new Array(); + this.fps = 0; + } + SkeletonData.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.name == boneName) + return bone; + } + return null; + }; + SkeletonData.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].name == boneName) + return i; + return -1; + }; + SkeletonData.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.name == slotName) + return slot; + } + return null; + }; + SkeletonData.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].name == slotName) + return i; + return -1; + }; + SkeletonData.prototype.findSkin = function (skinName) { + if (skinName == null) + throw new Error("skinName cannot be null."); + var skins = this.skins; + for (var i = 0, n = skins.length; i < n; i++) { + var skin = skins[i]; + if (skin.name == skinName) + return skin; + } + return null; + }; + SkeletonData.prototype.findEvent = function (eventDataName) { + if (eventDataName == null) + throw new Error("eventDataName cannot be null."); + var events = this.events; + for (var i = 0, n = events.length; i < n; i++) { + var event_4 = events[i]; + if (event_4.name == eventDataName) + return event_4; + } + return null; + }; + SkeletonData.prototype.findAnimation = function (animationName) { + if (animationName == null) + throw new Error("animationName cannot be null."); + var animations = this.animations; + for (var i = 0, n = animations.length; i < n; i++) { + var animation = animations[i]; + if (animation.name == animationName) + return animation; + } + return null; + }; + SkeletonData.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) { + if (pathConstraintName == null) + throw new Error("pathConstraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) + if (pathConstraints[i].name == pathConstraintName) + return i; + return -1; + }; + return SkeletonData; + }()); + spine.SkeletonData = SkeletonData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonJson = (function () { + function SkeletonJson(attachmentLoader) { + this.scale = 1; + this.linkedMeshes = new Array(); + this.attachmentLoader = attachmentLoader; + } + SkeletonJson.prototype.readSkeletonData = function (json) { + var scale = this.scale; + var skeletonData = new spine.SkeletonData(); + var root = typeof (json) === "string" ? JSON.parse(json) : json; + var skeletonMap = root.skeleton; + if (skeletonMap != null) { + skeletonData.hash = skeletonMap.hash; + skeletonData.version = skeletonMap.spine; + skeletonData.width = skeletonMap.width; + skeletonData.height = skeletonMap.height; + skeletonData.fps = skeletonMap.fps; + skeletonData.imagesPath = skeletonMap.images; + } + if (root.bones) { + for (var i = 0; i < root.bones.length; i++) { + var boneMap = root.bones[i]; + var parent_2 = null; + var parentName = this.getValue(boneMap, "parent", null); + if (parentName != null) { + parent_2 = skeletonData.findBone(parentName); + if (parent_2 == null) + throw new Error("Parent bone not found: " + parentName); + } + var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2); + data.length = this.getValue(boneMap, "length", 0) * scale; + data.x = this.getValue(boneMap, "x", 0) * scale; + data.y = this.getValue(boneMap, "y", 0) * scale; + data.rotation = this.getValue(boneMap, "rotation", 0); + data.scaleX = this.getValue(boneMap, "scaleX", 1); + data.scaleY = this.getValue(boneMap, "scaleY", 1); + data.shearX = this.getValue(boneMap, "shearX", 0); + data.shearY = this.getValue(boneMap, "shearY", 0); + data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal")); + skeletonData.bones.push(data); + } + } + if (root.slots) { + for (var i = 0; i < root.slots.length; i++) { + var slotMap = root.slots[i]; + var slotName = slotMap.name; + var boneName = slotMap.bone; + var boneData = skeletonData.findBone(boneName); + if (boneData == null) + throw new Error("Slot bone not found: " + boneName); + var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData); + var color = this.getValue(slotMap, "color", null); + if (color != null) + data.color.setFromString(color); + var dark = this.getValue(slotMap, "dark", null); + if (dark != null) { + data.darkColor = new spine.Color(1, 1, 1, 1); + data.darkColor.setFromString(dark); + } + data.attachmentName = this.getValue(slotMap, "attachment", null); + data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, "blend", "normal")); + skeletonData.slots.push(data); + } + } + if (root.ik) { + for (var i = 0; i < root.ik.length; i++) { + var constraintMap = root.ik[i]; + var data = new spine.IkConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("IK bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("IK target bone not found: " + targetName); + data.mix = this.getValue(constraintMap, "mix", 1); + data.bendDirection = this.getValue(constraintMap, "bendPositive", true) ? 1 : -1; + data.compress = this.getValue(constraintMap, "compress", false); + data.stretch = this.getValue(constraintMap, "stretch", false); + data.uniform = this.getValue(constraintMap, "uniform", false); + skeletonData.ikConstraints.push(data); + } + } + if (root.transform) { + for (var i = 0; i < root.transform.length; i++) { + var constraintMap = root.transform[i]; + var data = new spine.TransformConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("Transform constraint target bone not found: " + targetName); + data.local = this.getValue(constraintMap, "local", false); + data.relative = this.getValue(constraintMap, "relative", false); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.offsetX = this.getValue(constraintMap, "x", 0) * scale; + data.offsetY = this.getValue(constraintMap, "y", 0) * scale; + data.offsetScaleX = this.getValue(constraintMap, "scaleX", 0); + data.offsetScaleY = this.getValue(constraintMap, "scaleY", 0); + data.offsetShearY = this.getValue(constraintMap, "shearY", 0); + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + data.scaleMix = this.getValue(constraintMap, "scaleMix", 1); + data.shearMix = this.getValue(constraintMap, "shearMix", 1); + skeletonData.transformConstraints.push(data); + } + } + if (root.path) { + for (var i = 0; i < root.path.length; i++) { + var constraintMap = root.path[i]; + var data = new spine.PathConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findSlot(targetName); + if (data.target == null) + throw new Error("Path target slot not found: " + targetName); + data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, "positionMode", "percent")); + data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, "spacingMode", "length")); + data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, "rotateMode", "tangent")); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.position = this.getValue(constraintMap, "position", 0); + if (data.positionMode == spine.PositionMode.Fixed) + data.position *= scale; + data.spacing = this.getValue(constraintMap, "spacing", 0); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + data.spacing *= scale; + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + skeletonData.pathConstraints.push(data); + } + } + if (root.skins) { + for (var skinName in root.skins) { + var skinMap = root.skins[skinName]; + var skin = new spine.Skin(skinName); + for (var slotName in skinMap) { + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + var slotMap = skinMap[slotName]; + for (var entryName in slotMap) { + var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData); + if (attachment != null) + skin.addAttachment(slotIndex, entryName, attachment); + } + } + skeletonData.skins.push(skin); + if (skin.name == "default") + skeletonData.defaultSkin = skin; + } + } + for (var i = 0, n = this.linkedMeshes.length; i < n; i++) { + var linkedMesh = this.linkedMeshes[i]; + var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); + if (skin == null) + throw new Error("Skin not found: " + linkedMesh.skin); + var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); + if (parent_3 == null) + throw new Error("Parent mesh not found: " + linkedMesh.parent); + linkedMesh.mesh.setParentMesh(parent_3); + linkedMesh.mesh.updateUVs(); + } + this.linkedMeshes.length = 0; + if (root.events) { + for (var eventName in root.events) { + var eventMap = root.events[eventName]; + var data = new spine.EventData(eventName); + data.intValue = this.getValue(eventMap, "int", 0); + data.floatValue = this.getValue(eventMap, "float", 0); + data.stringValue = this.getValue(eventMap, "string", ""); + data.audioPath = this.getValue(eventMap, "audio", null); + if (data.audioPath != null) { + data.volume = this.getValue(eventMap, "volume", 1); + data.balance = this.getValue(eventMap, "balance", 0); + } + skeletonData.events.push(data); + } + } + if (root.animations) { + for (var animationName in root.animations) { + var animationMap = root.animations[animationName]; + this.readAnimation(animationMap, animationName, skeletonData); + } + } + return skeletonData; + }; + SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) { + var scale = this.scale; + name = this.getValue(map, "name", name); + var type = this.getValue(map, "type", "region"); + switch (type) { + case "region": { + var path = this.getValue(map, "path", name); + var region = this.attachmentLoader.newRegionAttachment(skin, name, path); + if (region == null) + return null; + region.path = path; + region.x = this.getValue(map, "x", 0) * scale; + region.y = this.getValue(map, "y", 0) * scale; + region.scaleX = this.getValue(map, "scaleX", 1); + region.scaleY = this.getValue(map, "scaleY", 1); + region.rotation = this.getValue(map, "rotation", 0); + region.width = map.width * scale; + region.height = map.height * scale; + var color = this.getValue(map, "color", null); + if (color != null) + region.color.setFromString(color); + region.updateOffset(); + return region; + } + case "boundingbox": { + var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); + if (box == null) + return null; + this.readVertices(map, box, map.vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + box.color.setFromString(color); + return box; + } + case "mesh": + case "linkedmesh": { + var path = this.getValue(map, "path", name); + var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); + if (mesh == null) + return null; + mesh.path = path; + var color = this.getValue(map, "color", null); + if (color != null) + mesh.color.setFromString(color); + var parent_4 = this.getValue(map, "parent", null); + if (parent_4 != null) { + mesh.inheritDeform = this.getValue(map, "deform", true); + this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, "skin", null), slotIndex, parent_4)); + return mesh; + } + var uvs = map.uvs; + this.readVertices(map, mesh, uvs.length); + mesh.triangles = map.triangles; + mesh.regionUVs = uvs; + mesh.updateUVs(); + mesh.hullLength = this.getValue(map, "hull", 0) * 2; + return mesh; + } + case "path": { + var path = this.attachmentLoader.newPathAttachment(skin, name); + if (path == null) + return null; + path.closed = this.getValue(map, "closed", false); + path.constantSpeed = this.getValue(map, "constantSpeed", true); + var vertexCount = map.vertexCount; + this.readVertices(map, path, vertexCount << 1); + var lengths = spine.Utils.newArray(vertexCount / 3, 0); + for (var i = 0; i < map.lengths.length; i++) + lengths[i] = map.lengths[i] * scale; + path.lengths = lengths; + var color = this.getValue(map, "color", null); + if (color != null) + path.color.setFromString(color); + return path; + } + case "point": { + var point = this.attachmentLoader.newPointAttachment(skin, name); + if (point == null) + return null; + point.x = this.getValue(map, "x", 0) * scale; + point.y = this.getValue(map, "y", 0) * scale; + point.rotation = this.getValue(map, "rotation", 0); + var color = this.getValue(map, "color", null); + if (color != null) + point.color.setFromString(color); + return point; + } + case "clipping": { + var clip = this.attachmentLoader.newClippingAttachment(skin, name); + if (clip == null) + return null; + var end = this.getValue(map, "end", null); + if (end != null) { + var slot = skeletonData.findSlot(end); + if (slot == null) + throw new Error("Clipping end slot not found: " + end); + clip.endSlot = slot; + } + var vertexCount = map.vertexCount; + this.readVertices(map, clip, vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + clip.color.setFromString(color); + return clip; + } + } + return null; + }; + SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) { + var scale = this.scale; + attachment.worldVerticesLength = verticesLength; + var vertices = map.vertices; + if (verticesLength == vertices.length) { + var scaledVertices = spine.Utils.toFloatArray(vertices); + if (scale != 1) { + for (var i = 0, n = vertices.length; i < n; i++) + scaledVertices[i] *= scale; + } + attachment.vertices = scaledVertices; + return; + } + var weights = new Array(); + var bones = new Array(); + for (var i = 0, n = vertices.length; i < n;) { + var boneCount = vertices[i++]; + bones.push(boneCount); + for (var nn = i + boneCount * 4; i < nn; i += 4) { + bones.push(vertices[i]); + weights.push(vertices[i + 1] * scale); + weights.push(vertices[i + 2] * scale); + weights.push(vertices[i + 3]); + } + } + attachment.bones = bones; + attachment.vertices = spine.Utils.toFloatArray(weights); + }; + SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) { + var scale = this.scale; + var timelines = new Array(); + var duration = 0; + if (map.slots) { + for (var slotName in map.slots) { + var slotMap = map.slots[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + if (timelineName == "attachment") { + var timeline = new spine.AttachmentTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex++, valueMap.time, valueMap.name); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + else if (timelineName == "color") { + var timeline = new spine.ColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var color = new spine.Color(); + color.setFromString(valueMap.color); + timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]); + } + else if (timelineName == "twoColor") { + var timeline = new spine.TwoColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var light = new spine.Color(); + var dark = new spine.Color(); + light.setFromString(valueMap.light); + dark.setFromString(valueMap.dark); + timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"); + } + } + } + if (map.bones) { + for (var boneName in map.bones) { + var boneMap = map.bones[boneName]; + var boneIndex = skeletonData.findBoneIndex(boneName); + if (boneIndex == -1) + throw new Error("Bone not found: " + boneName); + for (var timelineName in boneMap) { + var timelineMap = boneMap[timelineName]; + if (timelineName === "rotate") { + var timeline = new spine.RotateTimeline(timelineMap.length); + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, valueMap.angle); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]); + } + else if (timelineName === "translate" || timelineName === "scale" || timelineName === "shear") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "scale") + timeline = new spine.ScaleTimeline(timelineMap.length); + else if (timelineName === "shear") + timeline = new spine.ShearTimeline(timelineMap.length); + else { + timeline = new spine.TranslateTimeline(timelineMap.length); + timelineScale = scale; + } + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var x = this.getValue(valueMap, "x", 0), y = this.getValue(valueMap, "y", 0); + timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"); + } + } + } + if (map.ik) { + for (var constraintName in map.ik) { + var constraintMap = map.ik[constraintName]; + var constraint = skeletonData.findIkConstraint(constraintName); + var timeline = new spine.IkConstraintTimeline(constraintMap.length); + timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "mix", 1), this.getValue(valueMap, "bendPositive", true) ? 1 : -1, this.getValue(valueMap, "compress", false), this.getValue(valueMap, "stretch", false)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]); + } + } + if (map.transform) { + for (var constraintName in map.transform) { + var constraintMap = map.transform[constraintName]; + var constraint = skeletonData.findTransformConstraint(constraintName); + var timeline = new spine.TransformConstraintTimeline(constraintMap.length); + timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1), this.getValue(valueMap, "scaleMix", 1), this.getValue(valueMap, "shearMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]); + } + } + if (map.paths) { + for (var constraintName in map.paths) { + var constraintMap = map.paths[constraintName]; + var index = skeletonData.findPathConstraintIndex(constraintName); + if (index == -1) + throw new Error("Path constraint not found: " + constraintName); + var data = skeletonData.pathConstraints[index]; + for (var timelineName in constraintMap) { + var timelineMap = constraintMap[timelineName]; + if (timelineName === "position" || timelineName === "spacing") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "spacing") { + timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + timelineScale = scale; + } + else { + timeline = new spine.PathConstraintPositionTimeline(timelineMap.length); + if (data.positionMode == spine.PositionMode.Fixed) + timelineScale = scale; + } + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]); + } + else if (timelineName === "mix") { + var timeline = new spine.PathConstraintMixTimeline(timelineMap.length); + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]); + } + } + } + } + if (map.deform) { + for (var deformName in map.deform) { + var deformMap = map.deform[deformName]; + var skin = skeletonData.findSkin(deformName); + if (skin == null) + throw new Error("Skin not found: " + deformName); + for (var slotName in deformMap) { + var slotMap = deformMap[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotMap.name); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + var attachment = skin.getAttachment(slotIndex, timelineName); + if (attachment == null) + throw new Error("Deform attachment not found: " + timelineMap.name); + var weighted = attachment.bones != null; + var vertices = attachment.vertices; + var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; + var timeline = new spine.DeformTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + timeline.attachment = attachment; + var frameIndex = 0; + for (var j = 0; j < timelineMap.length; j++) { + var valueMap = timelineMap[j]; + var deform = void 0; + var verticesValue = this.getValue(valueMap, "vertices", null); + if (verticesValue == null) + deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices; + else { + deform = spine.Utils.newFloatArray(deformLength); + var start = this.getValue(valueMap, "offset", 0); + spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); + if (scale != 1) { + for (var i = start, n = i + verticesValue.length; i < n; i++) + deform[i] *= scale; + } + if (!weighted) { + for (var i = 0; i < deformLength; i++) + deform[i] += vertices[i]; + } + } + timeline.setFrame(frameIndex, valueMap.time, deform); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + } + } + } + var drawOrderNode = map.drawOrder; + if (drawOrderNode == null) + drawOrderNode = map.draworder; + if (drawOrderNode != null) { + var timeline = new spine.DrawOrderTimeline(drawOrderNode.length); + var slotCount = skeletonData.slots.length; + var frameIndex = 0; + for (var j = 0; j < drawOrderNode.length; j++) { + var drawOrderMap = drawOrderNode[j]; + var drawOrder = null; + var offsets = this.getValue(drawOrderMap, "offsets", null); + if (offsets != null) { + drawOrder = spine.Utils.newArray(slotCount, -1); + var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0); + var originalIndex = 0, unchangedIndex = 0; + for (var i = 0; i < offsets.length; i++) { + var offsetMap = offsets[i]; + var slotIndex = skeletonData.findSlotIndex(offsetMap.slot); + if (slotIndex == -1) + throw new Error("Slot not found: " + offsetMap.slot); + while (originalIndex != slotIndex) + unchanged[unchangedIndex++] = originalIndex++; + drawOrder[originalIndex + offsetMap.offset] = originalIndex++; + } + while (originalIndex < slotCount) + unchanged[unchangedIndex++] = originalIndex++; + for (var i = slotCount - 1; i >= 0; i--) + if (drawOrder[i] == -1) + drawOrder[i] = unchanged[--unchangedIndex]; + } + timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (map.events) { + var timeline = new spine.EventTimeline(map.events.length); + var frameIndex = 0; + for (var i = 0; i < map.events.length; i++) { + var eventMap = map.events[i]; + var eventData = skeletonData.findEvent(eventMap.name); + if (eventData == null) + throw new Error("Event not found: " + eventMap.name); + var event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData); + event_5.intValue = this.getValue(eventMap, "int", eventData.intValue); + event_5.floatValue = this.getValue(eventMap, "float", eventData.floatValue); + event_5.stringValue = this.getValue(eventMap, "string", eventData.stringValue); + if (event_5.data.audioPath != null) { + event_5.volume = this.getValue(eventMap, "volume", 1); + event_5.balance = this.getValue(eventMap, "balance", 0); + } + timeline.setFrame(frameIndex++, event_5); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (isNaN(duration)) { + throw new Error("Error while parsing animation, duration is NaN"); + } + skeletonData.animations.push(new spine.Animation(name, timelines, duration)); + }; + SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) { + if (!map.curve) + return; + if (map.curve === "stepped") + timeline.setStepped(frameIndex); + else if (Object.prototype.toString.call(map.curve) === '[object Array]') { + var curve = map.curve; + timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); + } + }; + SkeletonJson.prototype.getValue = function (map, prop, defaultValue) { + return map[prop] !== undefined ? map[prop] : defaultValue; + }; + SkeletonJson.blendModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.BlendMode.Normal; + if (str == "additive") + return spine.BlendMode.Additive; + if (str == "multiply") + return spine.BlendMode.Multiply; + if (str == "screen") + return spine.BlendMode.Screen; + throw new Error("Unknown blend mode: " + str); + }; + SkeletonJson.positionModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "fixed") + return spine.PositionMode.Fixed; + if (str == "percent") + return spine.PositionMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.spacingModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "length") + return spine.SpacingMode.Length; + if (str == "fixed") + return spine.SpacingMode.Fixed; + if (str == "percent") + return spine.SpacingMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.rotateModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "tangent") + return spine.RotateMode.Tangent; + if (str == "chain") + return spine.RotateMode.Chain; + if (str == "chainscale") + return spine.RotateMode.ChainScale; + throw new Error("Unknown rotate mode: " + str); + }; + SkeletonJson.transformModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.TransformMode.Normal; + if (str == "onlytranslation") + return spine.TransformMode.OnlyTranslation; + if (str == "norotationorreflection") + return spine.TransformMode.NoRotationOrReflection; + if (str == "noscale") + return spine.TransformMode.NoScale; + if (str == "noscaleorreflection") + return spine.TransformMode.NoScaleOrReflection; + throw new Error("Unknown transform mode: " + str); + }; + return SkeletonJson; + }()); + spine.SkeletonJson = SkeletonJson; + var LinkedMesh = (function () { + function LinkedMesh(mesh, skin, slotIndex, parent) { + this.mesh = mesh; + this.skin = skin; + this.slotIndex = slotIndex; + this.parent = parent; + } + return LinkedMesh; + }()); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skin = (function () { + function Skin(name) { + this.attachments = new Array(); + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + Skin.prototype.addAttachment = function (slotIndex, name, attachment) { + if (attachment == null) + throw new Error("attachment cannot be null."); + var attachments = this.attachments; + if (slotIndex >= attachments.length) + attachments.length = slotIndex + 1; + if (!attachments[slotIndex]) + attachments[slotIndex] = {}; + attachments[slotIndex][name] = attachment; + }; + Skin.prototype.getAttachment = function (slotIndex, name) { + var dictionary = this.attachments[slotIndex]; + return dictionary ? dictionary[name] : null; + }; + Skin.prototype.attachAll = function (skeleton, oldSkin) { + var slotIndex = 0; + for (var i = 0; i < skeleton.slots.length; i++) { + var slot = skeleton.slots[i]; + var slotAttachment = slot.getAttachment(); + if (slotAttachment && slotIndex < oldSkin.attachments.length) { + var dictionary = oldSkin.attachments[slotIndex]; + for (var key in dictionary) { + var skinAttachment = dictionary[key]; + if (slotAttachment == skinAttachment) { + var attachment = this.getAttachment(slotIndex, key); + if (attachment != null) + slot.setAttachment(attachment); + break; + } + } + } + slotIndex++; + } + }; + return Skin; + }()); + spine.Skin = Skin; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Slot = (function () { + function Slot(data, bone) { + this.attachmentVertices = new Array(); + if (data == null) + throw new Error("data cannot be null."); + if (bone == null) + throw new Error("bone cannot be null."); + this.data = data; + this.bone = bone; + this.color = new spine.Color(); + this.darkColor = data.darkColor == null ? null : new spine.Color(); + this.setToSetupPose(); + } + Slot.prototype.getAttachment = function () { + return this.attachment; + }; + Slot.prototype.setAttachment = function (attachment) { + if (this.attachment == attachment) + return; + this.attachment = attachment; + this.attachmentTime = this.bone.skeleton.time; + this.attachmentVertices.length = 0; + }; + Slot.prototype.setAttachmentTime = function (time) { + this.attachmentTime = this.bone.skeleton.time - time; + }; + Slot.prototype.getAttachmentTime = function () { + return this.bone.skeleton.time - this.attachmentTime; + }; + Slot.prototype.setToSetupPose = function () { + this.color.setFromColor(this.data.color); + if (this.darkColor != null) + this.darkColor.setFromColor(this.data.darkColor); + if (this.data.attachmentName == null) + this.attachment = null; + else { + this.attachment = null; + this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)); + } + }; + return Slot; + }()); + spine.Slot = Slot; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SlotData = (function () { + function SlotData(index, name, boneData) { + this.color = new spine.Color(1, 1, 1, 1); + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + if (boneData == null) + throw new Error("boneData cannot be null."); + this.index = index; + this.name = name; + this.boneData = boneData; + } + return SlotData; + }()); + spine.SlotData = SlotData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Texture = (function () { + function Texture(image) { + this._image = image; + } + Texture.prototype.getImage = function () { + return this._image; + }; + Texture.filterFromString = function (text) { + switch (text.toLowerCase()) { + case "nearest": return TextureFilter.Nearest; + case "linear": return TextureFilter.Linear; + case "mipmap": return TextureFilter.MipMap; + case "mipmapnearestnearest": return TextureFilter.MipMapNearestNearest; + case "mipmaplinearnearest": return TextureFilter.MipMapLinearNearest; + case "mipmapnearestlinear": return TextureFilter.MipMapNearestLinear; + case "mipmaplinearlinear": return TextureFilter.MipMapLinearLinear; + default: throw new Error("Unknown texture filter " + text); + } + }; + Texture.wrapFromString = function (text) { + switch (text.toLowerCase()) { + case "mirroredtepeat": return TextureWrap.MirroredRepeat; + case "clamptoedge": return TextureWrap.ClampToEdge; + case "repeat": return TextureWrap.Repeat; + default: throw new Error("Unknown texture wrap " + text); + } + }; + return Texture; + }()); + spine.Texture = Texture; + var TextureFilter; + (function (TextureFilter) { + TextureFilter[TextureFilter["Nearest"] = 9728] = "Nearest"; + TextureFilter[TextureFilter["Linear"] = 9729] = "Linear"; + TextureFilter[TextureFilter["MipMap"] = 9987] = "MipMap"; + TextureFilter[TextureFilter["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; + TextureFilter[TextureFilter["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; + TextureFilter[TextureFilter["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; + TextureFilter[TextureFilter["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; + })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {})); + var TextureWrap; + (function (TextureWrap) { + TextureWrap[TextureWrap["MirroredRepeat"] = 33648] = "MirroredRepeat"; + TextureWrap[TextureWrap["ClampToEdge"] = 33071] = "ClampToEdge"; + TextureWrap[TextureWrap["Repeat"] = 10497] = "Repeat"; + })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {})); + var TextureRegion = (function () { + function TextureRegion() { + this.u = 0; + this.v = 0; + this.u2 = 0; + this.v2 = 0; + this.width = 0; + this.height = 0; + this.rotate = false; + this.offsetX = 0; + this.offsetY = 0; + this.originalWidth = 0; + this.originalHeight = 0; + } + return TextureRegion; + }()); + spine.TextureRegion = TextureRegion; + var FakeTexture = (function (_super) { + __extends(FakeTexture, _super); + function FakeTexture() { + return _super !== null && _super.apply(this, arguments) || this; + } + FakeTexture.prototype.setFilters = function (minFilter, magFilter) { }; + FakeTexture.prototype.setWraps = function (uWrap, vWrap) { }; + FakeTexture.prototype.dispose = function () { }; + return FakeTexture; + }(Texture)); + spine.FakeTexture = FakeTexture; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TextureAtlas = (function () { + function TextureAtlas(atlasText, textureLoader) { + this.pages = new Array(); + this.regions = new Array(); + this.load(atlasText, textureLoader); + } + TextureAtlas.prototype.load = function (atlasText, textureLoader) { + if (textureLoader == null) + throw new Error("textureLoader cannot be null."); + var reader = new TextureAtlasReader(atlasText); + var tuple = new Array(4); + var page = null; + while (true) { + var line = reader.readLine(); + if (line == null) + break; + line = line.trim(); + if (line.length == 0) + page = null; + else if (!page) { + page = new TextureAtlasPage(); + page.name = line; + if (reader.readTuple(tuple) == 2) { + page.width = parseInt(tuple[0]); + page.height = parseInt(tuple[1]); + reader.readTuple(tuple); + } + reader.readTuple(tuple); + page.minFilter = spine.Texture.filterFromString(tuple[0]); + page.magFilter = spine.Texture.filterFromString(tuple[1]); + var direction = reader.readValue(); + page.uWrap = spine.TextureWrap.ClampToEdge; + page.vWrap = spine.TextureWrap.ClampToEdge; + if (direction == "x") + page.uWrap = spine.TextureWrap.Repeat; + else if (direction == "y") + page.vWrap = spine.TextureWrap.Repeat; + else if (direction == "xy") + page.uWrap = page.vWrap = spine.TextureWrap.Repeat; + page.texture = textureLoader(line); + page.texture.setFilters(page.minFilter, page.magFilter); + page.texture.setWraps(page.uWrap, page.vWrap); + page.width = page.texture.getImage().width; + page.height = page.texture.getImage().height; + this.pages.push(page); + } + else { + var region = new TextureAtlasRegion(); + region.name = line; + region.page = page; + region.rotate = reader.readValue() == "true"; + reader.readTuple(tuple); + var x = parseInt(tuple[0]); + var y = parseInt(tuple[1]); + reader.readTuple(tuple); + var width = parseInt(tuple[0]); + var height = parseInt(tuple[1]); + region.u = x / page.width; + region.v = y / page.height; + if (region.rotate) { + region.u2 = (x + height) / page.width; + region.v2 = (y + width) / page.height; + } + else { + region.u2 = (x + width) / page.width; + region.v2 = (y + height) / page.height; + } + region.x = x; + region.y = y; + region.width = Math.abs(width); + region.height = Math.abs(height); + if (reader.readTuple(tuple) == 4) { + if (reader.readTuple(tuple) == 4) { + reader.readTuple(tuple); + } + } + region.originalWidth = parseInt(tuple[0]); + region.originalHeight = parseInt(tuple[1]); + reader.readTuple(tuple); + region.offsetX = parseInt(tuple[0]); + region.offsetY = parseInt(tuple[1]); + region.index = parseInt(reader.readValue()); + region.texture = page.texture; + this.regions.push(region); + } + } + }; + TextureAtlas.prototype.findRegion = function (name) { + for (var i = 0; i < this.regions.length; i++) { + if (this.regions[i].name == name) { + return this.regions[i]; + } + } + return null; + }; + TextureAtlas.prototype.dispose = function () { + for (var i = 0; i < this.pages.length; i++) { + this.pages[i].texture.dispose(); + } + }; + return TextureAtlas; + }()); + spine.TextureAtlas = TextureAtlas; + var TextureAtlasReader = (function () { + function TextureAtlasReader(text) { + this.index = 0; + this.lines = text.split(/\r\n|\r|\n/); + } + TextureAtlasReader.prototype.readLine = function () { + if (this.index >= this.lines.length) + return null; + return this.lines[this.index++]; + }; + TextureAtlasReader.prototype.readValue = function () { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + return line.substring(colon + 1).trim(); + }; + TextureAtlasReader.prototype.readTuple = function (tuple) { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + var i = 0, lastMatch = colon + 1; + for (; i < 3; i++) { + var comma = line.indexOf(",", lastMatch); + if (comma == -1) + break; + tuple[i] = line.substr(lastMatch, comma - lastMatch).trim(); + lastMatch = comma + 1; + } + tuple[i] = line.substring(lastMatch).trim(); + return i + 1; + }; + return TextureAtlasReader; + }()); + var TextureAtlasPage = (function () { + function TextureAtlasPage() { + } + return TextureAtlasPage; + }()); + spine.TextureAtlasPage = TextureAtlasPage; + var TextureAtlasRegion = (function (_super) { + __extends(TextureAtlasRegion, _super); + function TextureAtlasRegion() { + return _super !== null && _super.apply(this, arguments) || this; + } + return TextureAtlasRegion; + }(spine.TextureRegion)); + spine.TextureAtlasRegion = TextureAtlasRegion; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraint = (function () { + function TransformConstraint(data, skeleton) { + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.temp = new spine.Vector2(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + this.scaleMix = data.scaleMix; + this.shearMix = data.shearMix; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + TransformConstraint.prototype.apply = function () { + this.update(); + }; + TransformConstraint.prototype.update = function () { + if (this.data.local) { + if (this.data.relative) + this.applyRelativeLocal(); + else + this.applyAbsoluteLocal(); + } + else { + if (this.data.relative) + this.applyRelativeWorld(); + else + this.applyAbsoluteWorld(); + } + }; + TransformConstraint.prototype.applyAbsoluteWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect; + var offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += (temp.x - bone.worldX) * translateMix; + bone.worldY += (temp.y - bone.worldY) * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c); + var ts = Math.sqrt(ta * ta + tc * tc); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s; + bone.a *= s; + bone.c *= s; + s = Math.sqrt(bone.b * bone.b + bone.d * bone.d); + ts = Math.sqrt(tb * tb + td * td); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var b = bone.b, d = bone.d; + var by = Math.atan2(d, b); + var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a)); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r = by + (r + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyRelativeWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += temp.x * translateMix; + bone.worldY += temp.y * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1; + bone.a *= s; + bone.c *= s; + s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var r = Math.atan2(td, tb) - Math.atan2(tc, ta); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + var b = bone.b, d = bone.d; + r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyAbsoluteLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) { + var r = target.arotation - rotation + this.data.offsetRotation; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + rotation += r * rotateMix; + } + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax - x + this.data.offsetX) * translateMix; + y += (target.ay - y + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX; + if (scaleY > 0.00001) + scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY; + } + var shearY = bone.ashearY; + if (shearMix != 0) { + var r = target.ashearY - shearY + this.data.offsetShearY; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + bone.shearY += r * shearMix; + } + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.applyRelativeLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) + rotation += (target.arotation + this.data.offsetRotation) * rotateMix; + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax + this.data.offsetX) * translateMix; + y += (target.ay + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1; + if (scaleY > 0.00001) + scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1; + } + var shearY = bone.ashearY; + if (shearMix != 0) + shearY += (target.ashearY + this.data.offsetShearY) * shearMix; + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.getOrder = function () { + return this.data.order; + }; + return TransformConstraint; + }()); + spine.TransformConstraint = TransformConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraintData = (function () { + function TransformConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.offsetRotation = 0; + this.offsetX = 0; + this.offsetY = 0; + this.offsetScaleX = 0; + this.offsetScaleY = 0; + this.offsetShearY = 0; + this.relative = false; + this.local = false; + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return TransformConstraintData; + }()); + spine.TransformConstraintData = TransformConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Triangulator = (function () { + function Triangulator() { + this.convexPolygons = new Array(); + this.convexPolygonsIndices = new Array(); + this.indicesArray = new Array(); + this.isConcaveArray = new Array(); + this.triangles = new Array(); + this.polygonPool = new spine.Pool(function () { + return new Array(); + }); + this.polygonIndicesPool = new spine.Pool(function () { + return new Array(); + }); + } + Triangulator.prototype.triangulate = function (verticesArray) { + var vertices = verticesArray; + var vertexCount = verticesArray.length >> 1; + var indices = this.indicesArray; + indices.length = 0; + for (var i = 0; i < vertexCount; i++) + indices[i] = i; + var isConcave = this.isConcaveArray; + isConcave.length = 0; + for (var i = 0, n = vertexCount; i < n; ++i) + isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices); + var triangles = this.triangles; + triangles.length = 0; + while (vertexCount > 3) { + var previous = vertexCount - 1, i = 0, next = 1; + while (true) { + outer: if (!isConcave[i]) { + var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; + var p1x = vertices[p1], p1y = vertices[p1 + 1]; + var p2x = vertices[p2], p2y = vertices[p2 + 1]; + var p3x = vertices[p3], p3y = vertices[p3 + 1]; + for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { + if (!isConcave[ii]) + continue; + var v = indices[ii] << 1; + var vx = vertices[v], vy = vertices[v + 1]; + if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { + if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { + if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) + break outer; + } + } + } + break; + } + if (next == 0) { + do { + if (!isConcave[i]) + break; + i--; + } while (i > 0); + break; + } + previous = i; + i = next; + next = (next + 1) % vertexCount; + } + triangles.push(indices[(vertexCount + i - 1) % vertexCount]); + triangles.push(indices[i]); + triangles.push(indices[(i + 1) % vertexCount]); + indices.splice(i, 1); + isConcave.splice(i, 1); + vertexCount--; + var previousIndex = (vertexCount + i - 1) % vertexCount; + var nextIndex = i == vertexCount ? 0 : i; + isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices); + isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices); + } + if (vertexCount == 3) { + triangles.push(indices[2]); + triangles.push(indices[0]); + triangles.push(indices[1]); + } + return triangles; + }; + Triangulator.prototype.decompose = function (verticesArray, triangles) { + var vertices = verticesArray; + var convexPolygons = this.convexPolygons; + this.polygonPool.freeAll(convexPolygons); + convexPolygons.length = 0; + var convexPolygonsIndices = this.convexPolygonsIndices; + this.polygonIndicesPool.freeAll(convexPolygonsIndices); + convexPolygonsIndices.length = 0; + var polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + var polygon = this.polygonPool.obtain(); + polygon.length = 0; + var fanBaseIndex = -1, lastWinding = 0; + for (var i = 0, n = triangles.length; i < n; i += 3) { + var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; + var x1 = vertices[t1], y1 = vertices[t1 + 1]; + var x2 = vertices[t2], y2 = vertices[t2 + 1]; + var x3 = vertices[t3], y3 = vertices[t3 + 1]; + var merged = false; + if (fanBaseIndex == t1) { + var o = polygon.length - 4; + var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); + var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]); + if (winding1 == lastWinding && winding2 == lastWinding) { + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(t3); + merged = true; + } + } + if (!merged) { + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + else { + this.polygonPool.free(polygon); + this.polygonIndicesPool.free(polygonIndices); + } + polygon = this.polygonPool.obtain(); + polygon.length = 0; + polygon.push(x1); + polygon.push(y1); + polygon.push(x2); + polygon.push(y2); + polygon.push(x3); + polygon.push(y3); + polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + polygonIndices.push(t1); + polygonIndices.push(t2); + polygonIndices.push(t3); + lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3); + fanBaseIndex = t1; + } + } + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + for (var i = 0, n = convexPolygons.length; i < n; i++) { + polygonIndices = convexPolygonsIndices[i]; + if (polygonIndices.length == 0) + continue; + var firstIndex = polygonIndices[0]; + var lastIndex = polygonIndices[polygonIndices.length - 1]; + polygon = convexPolygons[i]; + var o = polygon.length - 4; + var prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; + var prevX = polygon[o + 2], prevY = polygon[o + 3]; + var firstX = polygon[0], firstY = polygon[1]; + var secondX = polygon[2], secondY = polygon[3]; + var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); + for (var ii = 0; ii < n; ii++) { + if (ii == i) + continue; + var otherIndices = convexPolygonsIndices[ii]; + if (otherIndices.length != 3) + continue; + var otherFirstIndex = otherIndices[0]; + var otherSecondIndex = otherIndices[1]; + var otherLastIndex = otherIndices[2]; + var otherPoly = convexPolygons[ii]; + var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; + if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) + continue; + var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); + var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY); + if (winding1 == winding && winding2 == winding) { + otherPoly.length = 0; + otherIndices.length = 0; + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(otherLastIndex); + prevPrevX = prevX; + prevPrevY = prevY; + prevX = x3; + prevY = y3; + ii = 0; + } + } + } + for (var i = convexPolygons.length - 1; i >= 0; i--) { + polygon = convexPolygons[i]; + if (polygon.length == 0) { + convexPolygons.splice(i, 1); + this.polygonPool.free(polygon); + polygonIndices = convexPolygonsIndices[i]; + convexPolygonsIndices.splice(i, 1); + this.polygonIndicesPool.free(polygonIndices); + } + } + return convexPolygons; + }; + Triangulator.isConcave = function (index, vertexCount, vertices, indices) { + var previous = indices[(vertexCount + index - 1) % vertexCount] << 1; + var current = indices[index] << 1; + var next = indices[(index + 1) % vertexCount] << 1; + return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); + }; + Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) { + return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; + }; + Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) { + var px = p2x - p1x, py = p2y - p1y; + return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; + }; + return Triangulator; + }()); + spine.Triangulator = Triangulator; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IntSet = (function () { + function IntSet() { + this.array = new Array(); + } + IntSet.prototype.add = function (value) { + var contains = this.contains(value); + this.array[value | 0] = value | 0; + return !contains; + }; + IntSet.prototype.contains = function (value) { + return this.array[value | 0] != undefined; + }; + IntSet.prototype.remove = function (value) { + this.array[value | 0] = undefined; + }; + IntSet.prototype.clear = function () { + this.array.length = 0; + }; + return IntSet; + }()); + spine.IntSet = IntSet; + var Color = (function () { + function Color(r, g, b, a) { + if (r === void 0) { r = 0; } + if (g === void 0) { g = 0; } + if (b === void 0) { b = 0; } + if (a === void 0) { a = 0; } + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + Color.prototype.set = function (r, g, b, a) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + this.clamp(); + return this; + }; + Color.prototype.setFromColor = function (c) { + this.r = c.r; + this.g = c.g; + this.b = c.b; + this.a = c.a; + return this; + }; + Color.prototype.setFromString = function (hex) { + hex = hex.charAt(0) == '#' ? hex.substr(1) : hex; + this.r = parseInt(hex.substr(0, 2), 16) / 255.0; + this.g = parseInt(hex.substr(2, 2), 16) / 255.0; + this.b = parseInt(hex.substr(4, 2), 16) / 255.0; + this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0; + return this; + }; + Color.prototype.add = function (r, g, b, a) { + this.r += r; + this.g += g; + this.b += b; + this.a += a; + this.clamp(); + return this; + }; + Color.prototype.clamp = function () { + if (this.r < 0) + this.r = 0; + else if (this.r > 1) + this.r = 1; + if (this.g < 0) + this.g = 0; + else if (this.g > 1) + this.g = 1; + if (this.b < 0) + this.b = 0; + else if (this.b > 1) + this.b = 1; + if (this.a < 0) + this.a = 0; + else if (this.a > 1) + this.a = 1; + return this; + }; + Color.WHITE = new Color(1, 1, 1, 1); + Color.RED = new Color(1, 0, 0, 1); + Color.GREEN = new Color(0, 1, 0, 1); + Color.BLUE = new Color(0, 0, 1, 1); + Color.MAGENTA = new Color(1, 0, 1, 1); + return Color; + }()); + spine.Color = Color; + var MathUtils = (function () { + function MathUtils() { + } + MathUtils.clamp = function (value, min, max) { + if (value < min) + return min; + if (value > max) + return max; + return value; + }; + MathUtils.cosDeg = function (degrees) { + return Math.cos(degrees * MathUtils.degRad); + }; + MathUtils.sinDeg = function (degrees) { + return Math.sin(degrees * MathUtils.degRad); + }; + MathUtils.signum = function (value) { + return value > 0 ? 1 : value < 0 ? -1 : 0; + }; + MathUtils.toInt = function (x) { + return x > 0 ? Math.floor(x) : Math.ceil(x); + }; + MathUtils.cbrt = function (x) { + var y = Math.pow(Math.abs(x), 1 / 3); + return x < 0 ? -y : y; + }; + MathUtils.randomTriangular = function (min, max) { + return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); + }; + MathUtils.randomTriangularWith = function (min, max, mode) { + var u = Math.random(); + var d = max - min; + if (u <= (mode - min) / d) + return min + Math.sqrt(u * d * (mode - min)); + return max - Math.sqrt((1 - u) * d * (max - mode)); + }; + MathUtils.PI = 3.1415927; + MathUtils.PI2 = MathUtils.PI * 2; + MathUtils.radiansToDegrees = 180 / MathUtils.PI; + MathUtils.radDeg = MathUtils.radiansToDegrees; + MathUtils.degreesToRadians = MathUtils.PI / 180; + MathUtils.degRad = MathUtils.degreesToRadians; + return MathUtils; + }()); + spine.MathUtils = MathUtils; + var Interpolation = (function () { + function Interpolation() { + } + Interpolation.prototype.apply = function (start, end, a) { + return start + (end - start) * this.applyInternal(a); + }; + return Interpolation; + }()); + spine.Interpolation = Interpolation; + var Pow = (function (_super) { + __extends(Pow, _super); + function Pow(power) { + var _this = _super.call(this) || this; + _this.power = 2; + _this.power = power; + return _this; + } + Pow.prototype.applyInternal = function (a) { + if (a <= 0.5) + return Math.pow(a * 2, this.power) / 2; + return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1; + }; + return Pow; + }(Interpolation)); + spine.Pow = Pow; + var PowOut = (function (_super) { + __extends(PowOut, _super); + function PowOut(power) { + return _super.call(this, power) || this; + } + PowOut.prototype.applyInternal = function (a) { + return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1; + }; + return PowOut; + }(Pow)); + spine.PowOut = PowOut; + var Utils = (function () { + function Utils() { + } + Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) { + for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { + dest[j] = source[i]; + } + }; + Utils.setArraySize = function (array, size, value) { + if (value === void 0) { value = 0; } + var oldSize = array.length; + if (oldSize == size) + return array; + array.length = size; + if (oldSize < size) { + for (var i = oldSize; i < size; i++) + array[i] = value; + } + return array; + }; + Utils.ensureArrayCapacity = function (array, size, value) { + if (value === void 0) { value = 0; } + if (array.length >= size) + return array; + return Utils.setArraySize(array, size, value); + }; + Utils.newArray = function (size, defaultValue) { + var array = new Array(size); + for (var i = 0; i < size; i++) + array[i] = defaultValue; + return array; + }; + Utils.newFloatArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Float32Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.newShortArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Int16Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.toFloatArray = function (array) { + return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; + }; + Utils.toSinglePrecision = function (value) { + return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; + }; + Utils.webkit602BugfixHelper = function (alpha, blend) { + }; + Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== "undefined"; + return Utils; + }()); + spine.Utils = Utils; + var DebugUtils = (function () { + function DebugUtils() { + } + DebugUtils.logBones = function (skeleton) { + for (var i = 0; i < skeleton.bones.length; i++) { + var bone = skeleton.bones[i]; + console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY); + } + }; + return DebugUtils; + }()); + spine.DebugUtils = DebugUtils; + var Pool = (function () { + function Pool(instantiator) { + this.items = new Array(); + this.instantiator = instantiator; + } + Pool.prototype.obtain = function () { + return this.items.length > 0 ? this.items.pop() : this.instantiator(); + }; + Pool.prototype.free = function (item) { + if (item.reset) + item.reset(); + this.items.push(item); + }; + Pool.prototype.freeAll = function (items) { + for (var i = 0; i < items.length; i++) { + if (items[i].reset) + items[i].reset(); + this.items[i] = items[i]; + } + }; + Pool.prototype.clear = function () { + this.items.length = 0; + }; + return Pool; + }()); + spine.Pool = Pool; + var Vector2 = (function () { + function Vector2(x, y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + this.x = x; + this.y = y; + } + Vector2.prototype.set = function (x, y) { + this.x = x; + this.y = y; + return this; + }; + Vector2.prototype.length = function () { + var x = this.x; + var y = this.y; + return Math.sqrt(x * x + y * y); + }; + Vector2.prototype.normalize = function () { + var len = this.length(); + if (len != 0) { + this.x /= len; + this.y /= len; + } + return this; + }; + return Vector2; + }()); + spine.Vector2 = Vector2; + var TimeKeeper = (function () { + function TimeKeeper() { + this.maxDelta = 0.064; + this.framesPerSecond = 0; + this.delta = 0; + this.totalTime = 0; + this.lastTime = Date.now() / 1000; + this.frameCount = 0; + this.frameTime = 0; + } + TimeKeeper.prototype.update = function () { + var now = Date.now() / 1000; + this.delta = now - this.lastTime; + this.frameTime += this.delta; + this.totalTime += this.delta; + if (this.delta > this.maxDelta) + this.delta = this.maxDelta; + this.lastTime = now; + this.frameCount++; + if (this.frameTime > 1) { + this.framesPerSecond = this.frameCount / this.frameTime; + this.frameTime = 0; + this.frameCount = 0; + } + }; + return TimeKeeper; + }()); + spine.TimeKeeper = TimeKeeper; + var WindowedMean = (function () { + function WindowedMean(windowSize) { + if (windowSize === void 0) { windowSize = 32; } + this.addedValues = 0; + this.lastValue = 0; + this.mean = 0; + this.dirty = true; + this.values = new Array(windowSize); + } + WindowedMean.prototype.hasEnoughData = function () { + return this.addedValues >= this.values.length; + }; + WindowedMean.prototype.addValue = function (value) { + if (this.addedValues < this.values.length) + this.addedValues++; + this.values[this.lastValue++] = value; + if (this.lastValue > this.values.length - 1) + this.lastValue = 0; + this.dirty = true; + }; + WindowedMean.prototype.getMean = function () { + if (this.hasEnoughData()) { + if (this.dirty) { + var mean = 0; + for (var i = 0; i < this.values.length; i++) { + mean += this.values[i]; + } + this.mean = mean / this.values.length; + this.dirty = false; + } + return this.mean; + } + else { + return 0; + } + }; + return WindowedMean; + }()); + spine.WindowedMean = WindowedMean; +})(spine || (spine = {})); +(function () { + if (!Math.fround) { + Math.fround = (function (array) { + return function (x) { + return array[0] = x, array[0]; + }; + })(new Float32Array(1)); + } +})(); +var spine; +(function (spine) { + var Attachment = (function () { + function Attachment(name) { + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return Attachment; + }()); + spine.Attachment = Attachment; + var VertexAttachment = (function (_super) { + __extends(VertexAttachment, _super); + function VertexAttachment(name) { + var _this = _super.call(this, name) || this; + _this.id = (VertexAttachment.nextID++ & 65535) << 11; + _this.worldVerticesLength = 0; + return _this; + } + VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) { + count = offset + (count >> 1) * stride; + var skeleton = slot.bone.skeleton; + var deformArray = slot.attachmentVertices; + var vertices = this.vertices; + var bones = this.bones; + if (bones == null) { + if (deformArray.length > 0) + vertices = deformArray; + var bone = slot.bone; + var x = bone.worldX; + var y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) { + var vx = vertices[v_1], vy = vertices[v_1 + 1]; + worldVertices[w] = vx * a + vy * b + x; + worldVertices[w + 1] = vx * c + vy * d + y; + } + return; + } + var v = 0, skip = 0; + for (var i = 0; i < start; i += 2) { + var n = bones[v]; + v += n + 1; + skip += n; + } + var skeletonBones = skeleton.bones; + if (deformArray.length == 0) { + for (var w = offset, b = skip * 3; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + else { + var deform = deformArray; + for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3, f += 2) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + }; + VertexAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment; + }; + VertexAttachment.nextID = 0; + return VertexAttachment; + }(Attachment)); + spine.VertexAttachment = VertexAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AttachmentType; + (function (AttachmentType) { + AttachmentType[AttachmentType["Region"] = 0] = "Region"; + AttachmentType[AttachmentType["BoundingBox"] = 1] = "BoundingBox"; + AttachmentType[AttachmentType["Mesh"] = 2] = "Mesh"; + AttachmentType[AttachmentType["LinkedMesh"] = 3] = "LinkedMesh"; + AttachmentType[AttachmentType["Path"] = 4] = "Path"; + AttachmentType[AttachmentType["Point"] = 5] = "Point"; + })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoundingBoxAttachment = (function (_super) { + __extends(BoundingBoxAttachment, _super); + function BoundingBoxAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return BoundingBoxAttachment; + }(spine.VertexAttachment)); + spine.BoundingBoxAttachment = BoundingBoxAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var ClippingAttachment = (function (_super) { + __extends(ClippingAttachment, _super); + function ClippingAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1); + return _this; + } + return ClippingAttachment; + }(spine.VertexAttachment)); + spine.ClippingAttachment = ClippingAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var MeshAttachment = (function (_super) { + __extends(MeshAttachment, _super); + function MeshAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + _this.inheritDeform = false; + _this.tempColor = new spine.Color(0, 0, 0, 0); + return _this; + } + MeshAttachment.prototype.updateUVs = function () { + var regionUVs = this.regionUVs; + if (this.uvs == null || this.uvs.length != regionUVs.length) + this.uvs = spine.Utils.newFloatArray(regionUVs.length); + var uvs = this.uvs; + var u = 0, v = 0, width = 0, height = 0; + if (this.region instanceof spine.TextureAtlasRegion) { + var region = this.region; + var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height; + if (region.rotate) { + u = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth; + v = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight; + width = region.originalHeight / textureWidth; + height = region.originalWidth / textureHeight; + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i + 1] * width; + uvs[i + 1] = v + height - regionUVs[i] * height; + } + return; + } + u = region.u - region.offsetX / textureWidth; + v = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight; + width = region.originalWidth / textureWidth; + height = region.originalHeight / textureHeight; + } + else if (this.region == null) { + u = v = 0; + width = height = 1; + } + else { + u = this.region.u; + v = this.region.v; + width = this.region.u2 - u; + height = this.region.v2 - v; + } + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i] * width; + uvs[i + 1] = v + regionUVs[i + 1] * height; + } + }; + MeshAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment); + }; + MeshAttachment.prototype.getParentMesh = function () { + return this.parentMesh; + }; + MeshAttachment.prototype.setParentMesh = function (parentMesh) { + this.parentMesh = parentMesh; + if (parentMesh != null) { + this.bones = parentMesh.bones; + this.vertices = parentMesh.vertices; + this.worldVerticesLength = parentMesh.worldVerticesLength; + this.regionUVs = parentMesh.regionUVs; + this.triangles = parentMesh.triangles; + this.hullLength = parentMesh.hullLength; + this.worldVerticesLength = parentMesh.worldVerticesLength; + } + }; + return MeshAttachment; + }(spine.VertexAttachment)); + spine.MeshAttachment = MeshAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathAttachment = (function (_super) { + __extends(PathAttachment, _super); + function PathAttachment(name) { + var _this = _super.call(this, name) || this; + _this.closed = false; + _this.constantSpeed = false; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return PathAttachment; + }(spine.VertexAttachment)); + spine.PathAttachment = PathAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PointAttachment = (function (_super) { + __extends(PointAttachment, _super); + function PointAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.38, 0.94, 0, 1); + return _this; + } + PointAttachment.prototype.computeWorldPosition = function (bone, point) { + point.x = this.x * bone.a + this.y * bone.b + bone.worldX; + point.y = this.x * bone.c + this.y * bone.d + bone.worldY; + return point; + }; + PointAttachment.prototype.computeWorldRotation = function (bone) { + var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation); + var x = cos * bone.a + sin * bone.b; + var y = cos * bone.c + sin * bone.d; + return Math.atan2(y, x) * spine.MathUtils.radDeg; + }; + return PointAttachment; + }(spine.VertexAttachment)); + spine.PointAttachment = PointAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var RegionAttachment = (function (_super) { + __extends(RegionAttachment, _super); + function RegionAttachment(name) { + var _this = _super.call(this, name) || this; + _this.x = 0; + _this.y = 0; + _this.scaleX = 1; + _this.scaleY = 1; + _this.rotation = 0; + _this.width = 0; + _this.height = 0; + _this.color = new spine.Color(1, 1, 1, 1); + _this.offset = spine.Utils.newFloatArray(8); + _this.uvs = spine.Utils.newFloatArray(8); + _this.tempColor = new spine.Color(1, 1, 1, 1); + return _this; + } + RegionAttachment.prototype.updateOffset = function () { + var regionScaleX = this.width / this.region.originalWidth * this.scaleX; + var regionScaleY = this.height / this.region.originalHeight * this.scaleY; + var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; + var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; + var localX2 = localX + this.region.width * regionScaleX; + var localY2 = localY + this.region.height * regionScaleY; + var radians = this.rotation * Math.PI / 180; + var cos = Math.cos(radians); + var sin = Math.sin(radians); + var localXCos = localX * cos + this.x; + var localXSin = localX * sin; + var localYCos = localY * cos + this.y; + var localYSin = localY * sin; + var localX2Cos = localX2 * cos + this.x; + var localX2Sin = localX2 * sin; + var localY2Cos = localY2 * cos + this.y; + var localY2Sin = localY2 * sin; + var offset = this.offset; + offset[RegionAttachment.OX1] = localXCos - localYSin; + offset[RegionAttachment.OY1] = localYCos + localXSin; + offset[RegionAttachment.OX2] = localXCos - localY2Sin; + offset[RegionAttachment.OY2] = localY2Cos + localXSin; + offset[RegionAttachment.OX3] = localX2Cos - localY2Sin; + offset[RegionAttachment.OY3] = localY2Cos + localX2Sin; + offset[RegionAttachment.OX4] = localX2Cos - localYSin; + offset[RegionAttachment.OY4] = localYCos + localX2Sin; + }; + RegionAttachment.prototype.setRegion = function (region) { + this.region = region; + var uvs = this.uvs; + if (region.rotate) { + uvs[2] = region.u; + uvs[3] = region.v2; + uvs[4] = region.u; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v; + uvs[0] = region.u2; + uvs[1] = region.v2; + } + else { + uvs[0] = region.u; + uvs[1] = region.v2; + uvs[2] = region.u; + uvs[3] = region.v; + uvs[4] = region.u2; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v2; + } + }; + RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) { + var vertexOffset = this.offset; + var x = bone.worldX, y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var offsetX = 0, offsetY = 0; + offsetX = vertexOffset[RegionAttachment.OX1]; + offsetY = vertexOffset[RegionAttachment.OY1]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX2]; + offsetY = vertexOffset[RegionAttachment.OY2]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX3]; + offsetY = vertexOffset[RegionAttachment.OY3]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX4]; + offsetY = vertexOffset[RegionAttachment.OY4]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + }; + RegionAttachment.OX1 = 0; + RegionAttachment.OY1 = 1; + RegionAttachment.OX2 = 2; + RegionAttachment.OY2 = 3; + RegionAttachment.OX3 = 4; + RegionAttachment.OY3 = 5; + RegionAttachment.OX4 = 6; + RegionAttachment.OY4 = 7; + RegionAttachment.X1 = 0; + RegionAttachment.Y1 = 1; + RegionAttachment.C1R = 2; + RegionAttachment.C1G = 3; + RegionAttachment.C1B = 4; + RegionAttachment.C1A = 5; + RegionAttachment.U1 = 6; + RegionAttachment.V1 = 7; + RegionAttachment.X2 = 8; + RegionAttachment.Y2 = 9; + RegionAttachment.C2R = 10; + RegionAttachment.C2G = 11; + RegionAttachment.C2B = 12; + RegionAttachment.C2A = 13; + RegionAttachment.U2 = 14; + RegionAttachment.V2 = 15; + RegionAttachment.X3 = 16; + RegionAttachment.Y3 = 17; + RegionAttachment.C3R = 18; + RegionAttachment.C3G = 19; + RegionAttachment.C3B = 20; + RegionAttachment.C3A = 21; + RegionAttachment.U3 = 22; + RegionAttachment.V3 = 23; + RegionAttachment.X4 = 24; + RegionAttachment.Y4 = 25; + RegionAttachment.C4R = 26; + RegionAttachment.C4G = 27; + RegionAttachment.C4B = 28; + RegionAttachment.C4A = 29; + RegionAttachment.U4 = 30; + RegionAttachment.V4 = 31; + return RegionAttachment; + }(spine.Attachment)); + spine.RegionAttachment = RegionAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var JitterEffect = (function () { + function JitterEffect(jitterX, jitterY) { + this.jitterX = 0; + this.jitterY = 0; + this.jitterX = jitterX; + this.jitterY = jitterY; + } + JitterEffect.prototype.begin = function (skeleton) { + }; + JitterEffect.prototype.transform = function (position, uv, light, dark) { + position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + }; + JitterEffect.prototype.end = function () { + }; + return JitterEffect; + }()); + spine.JitterEffect = JitterEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SwirlEffect = (function () { + function SwirlEffect(radius) { + this.centerX = 0; + this.centerY = 0; + this.radius = 0; + this.angle = 0; + this.worldX = 0; + this.worldY = 0; + this.radius = radius; + } + SwirlEffect.prototype.begin = function (skeleton) { + this.worldX = skeleton.x + this.centerX; + this.worldY = skeleton.y + this.centerY; + }; + SwirlEffect.prototype.transform = function (position, uv, light, dark) { + var radAngle = this.angle * spine.MathUtils.degreesToRadians; + var x = position.x - this.worldX; + var y = position.y - this.worldY; + var dist = Math.sqrt(x * x + y * y); + if (dist < this.radius) { + var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius); + var cos = Math.cos(theta); + var sin = Math.sin(theta); + position.x = cos * x - sin * y + this.worldX; + position.y = sin * x + cos * y + this.worldY; + } + }; + SwirlEffect.prototype.end = function () { + }; + SwirlEffect.interpolation = new spine.PowOut(2); + return SwirlEffect; + }()); + spine.SwirlEffect = SwirlEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var AssetManager = (function (_super) { + __extends(AssetManager, _super); + function AssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + return _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this; + } + return AssetManager; + }(spine.AssetManager)); + canvas.AssetManager = AssetManager; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var CanvasTexture = (function (_super) { + __extends(CanvasTexture, _super); + function CanvasTexture(image) { + return _super.call(this, image) || this; + } + CanvasTexture.prototype.setFilters = function (minFilter, magFilter) { }; + CanvasTexture.prototype.setWraps = function (uWrap, vWrap) { }; + CanvasTexture.prototype.dispose = function () { }; + return CanvasTexture; + }(spine.Texture)); + canvas.CanvasTexture = CanvasTexture; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var SkeletonRenderer = (function () { + function SkeletonRenderer(context) { + this.triangleRendering = false; + this.debugRendering = false; + this.vertices = spine.Utils.newFloatArray(8 * 1024); + this.tempColor = new spine.Color(); + this.ctx = context; + } + SkeletonRenderer.prototype.draw = function (skeleton) { + if (this.triangleRendering) + this.drawTriangles(skeleton); + else + this.drawImages(skeleton); + }; + SkeletonRenderer.prototype.drawImages = function (skeleton) { + var ctx = this.ctx; + var drawOrder = skeleton.drawOrder; + if (this.debugRendering) + ctx.strokeStyle = "green"; + ctx.save(); + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var attachment = slot.getAttachment(); + var regionAttachment = null; + var region = null; + var image = null; + if (attachment instanceof spine.RegionAttachment) { + regionAttachment = attachment; + region = regionAttachment.region; + image = region.texture.getImage(); + } + else + continue; + var skeleton_1 = slot.bone.skeleton; + var skeletonColor = skeleton_1.color; + var slotColor = slot.color; + var regionColor = regionAttachment.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha); + var att = attachment; + var bone = slot.bone; + var w = region.width; + var h = region.height; + ctx.save(); + ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY); + ctx.translate(attachment.offset[0], attachment.offset[1]); + ctx.rotate(attachment.rotation * Math.PI / 180); + var atlasScale = att.width / w; + ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY); + ctx.translate(w / 2, h / 2); + if (attachment.region.rotate) { + var t = w; + w = h; + h = t; + ctx.rotate(-Math.PI / 2); + } + ctx.scale(1, -1); + ctx.translate(-w / 2, -h / 2); + if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { + ctx.globalAlpha = color.a; + } + ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h); + if (this.debugRendering) + ctx.strokeRect(0, 0, w, h); + ctx.restore(); + } + ctx.restore(); + }; + SkeletonRenderer.prototype.drawTriangles = function (skeleton) { + var blendMode = null; + var vertices = this.vertices; + var triangles = null; + var drawOrder = skeleton.drawOrder; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var attachment = slot.getAttachment(); + var texture = null; + var region = null; + if (attachment instanceof spine.RegionAttachment) { + var regionAttachment = attachment; + vertices = this.computeRegionVertices(slot, regionAttachment, false); + triangles = SkeletonRenderer.QUAD_TRIANGLES; + region = regionAttachment.region; + texture = region.texture.getImage(); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + vertices = this.computeMeshVertices(slot, mesh, false); + triangles = mesh.triangles; + texture = mesh.region.renderObject.texture.getImage(); + } + else + continue; + if (texture != null) { + var slotBlendMode = slot.data.blendMode; + if (slotBlendMode != blendMode) { + blendMode = slotBlendMode; + } + var skeleton_2 = slot.bone.skeleton; + var skeletonColor = skeleton_2.color; + var slotColor = slot.color; + var attachmentColor = attachment.color; + var alpha = skeletonColor.a * slotColor.a * attachmentColor.a; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha); + var ctx = this.ctx; + if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { + ctx.globalAlpha = color.a; + } + for (var j = 0; j < triangles.length; j += 3) { + var t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8; + var x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7]; + var x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7]; + var x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7]; + this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2); + if (this.debugRendering) { + ctx.strokeStyle = "green"; + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.lineTo(x0, y0); + ctx.stroke(); + } + } + } + } + this.ctx.globalAlpha = 1; + }; + SkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) { + var ctx = this.ctx; + u0 *= img.width; + v0 *= img.height; + u1 *= img.width; + v1 *= img.height; + u2 *= img.width; + v2 *= img.height; + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.closePath(); + x1 -= x0; + y1 -= y0; + x2 -= x0; + y2 -= y0; + u1 -= u0; + v1 -= v0; + u2 -= u0; + v2 -= v0; + var det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0; + ctx.save(); + ctx.transform(a, b, c, d, e, f); + ctx.clip(); + ctx.drawImage(img, 0, 0); + ctx.restore(); + }; + SkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) { + var skeleton = slot.bone.skeleton; + var skeletonColor = skeleton.color; + var slotColor = slot.color; + var regionColor = region.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var multiplier = pma ? alpha : 1; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); + region.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE); + var vertices = this.vertices; + var uvs = region.uvs; + vertices[spine.RegionAttachment.C1R] = color.r; + vertices[spine.RegionAttachment.C1G] = color.g; + vertices[spine.RegionAttachment.C1B] = color.b; + vertices[spine.RegionAttachment.C1A] = color.a; + vertices[spine.RegionAttachment.U1] = uvs[0]; + vertices[spine.RegionAttachment.V1] = uvs[1]; + vertices[spine.RegionAttachment.C2R] = color.r; + vertices[spine.RegionAttachment.C2G] = color.g; + vertices[spine.RegionAttachment.C2B] = color.b; + vertices[spine.RegionAttachment.C2A] = color.a; + vertices[spine.RegionAttachment.U2] = uvs[2]; + vertices[spine.RegionAttachment.V2] = uvs[3]; + vertices[spine.RegionAttachment.C3R] = color.r; + vertices[spine.RegionAttachment.C3G] = color.g; + vertices[spine.RegionAttachment.C3B] = color.b; + vertices[spine.RegionAttachment.C3A] = color.a; + vertices[spine.RegionAttachment.U3] = uvs[4]; + vertices[spine.RegionAttachment.V3] = uvs[5]; + vertices[spine.RegionAttachment.C4R] = color.r; + vertices[spine.RegionAttachment.C4G] = color.g; + vertices[spine.RegionAttachment.C4B] = color.b; + vertices[spine.RegionAttachment.C4A] = color.a; + vertices[spine.RegionAttachment.U4] = uvs[6]; + vertices[spine.RegionAttachment.V4] = uvs[7]; + return vertices; + }; + SkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) { + var skeleton = slot.bone.skeleton; + var skeletonColor = skeleton.color; + var slotColor = slot.color; + var regionColor = mesh.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var multiplier = pma ? alpha : 1; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); + var numVertices = mesh.worldVerticesLength / 2; + if (this.vertices.length < mesh.worldVerticesLength) { + this.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength); + } + var vertices = this.vertices; + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE); + var uvs = mesh.uvs; + for (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) { + vertices[v++] = color.r; + vertices[v++] = color.g; + vertices[v++] = color.b; + vertices[v++] = color.a; + vertices[v++] = uvs[u++]; + vertices[v++] = uvs[u++]; + v += 2; + } + return vertices; + }; + SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; + SkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4; + return SkeletonRenderer; + }()); + canvas.SkeletonRenderer = SkeletonRenderer; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +//# sourceMappingURL=spine-canvas.js.map + +/*** EXPORTS FROM exports-loader ***/ +module.exports = spine; +}.call(window)); + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(3); +var ImageFile = __webpack_require__(169); +var IsPlainObject = __webpack_require__(2); +var JSONFile = __webpack_require__(183); +var MultiFile = __webpack_require__(184); +var TextFile = __webpack_require__(185); + +/** + * @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} [textureURL] - The absolute or relative URL to load the texture image file from. + * @property {string} [textureExtension='png'] - The default file extension to use for the image texture if no url is provided. + * @property {XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture image file. + * @property {string} [normalMap] - The filename of an associated normal map. It uses the same path and url to load as the texture image. + * @property {string} [atlasURL] - The absolute or relative URL to load the atlas data file from. + * @property {string} [atlasExtension='txt'] - The default file extension to use for the atlas data if no url is provided. + * @property {XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas data file. + */ + +/** + * @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, + 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 = []; + + 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', currentBaseURL); + var path = GetFastValue(config, 'path', currentPath); + var prefix = GetFastValue(config, 'prefix', currentPrefix); + 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 = '_SP_' + textureURL; + + var image = new ImageFile(loader, key, textureURL, textureXhrSettings); + + 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 combinedAtlastData = ''; + var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; + + for (var i = 1; i < this.files.length; i++) + { + var file = this.files[i]; + + if (file.type === 'text') + { + atlasKey = file.key.substr(0, file.key.length - 2); + + atlasCache = file.cache; + + combinedAtlastData = combinedAtlastData.concat(file.data); + } + else + { + var key = file.key.substr(4).trim(); + + this.loader.textureManager.addImage(key, file.data); + } + + file.pendingDestroy(); + } + + atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlastData }); + + this.complete = true; + } + } + +}); + +module.exports = SpineFile; + + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(6); +var File = __webpack_require__(12); +var FileTypesManager = __webpack_require__(13); +var GetFastValue = __webpack_require__(3); +var IsPlainObject = __webpack_require__(2); + +/** + * @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); + } + }, + + /** + * 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'); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture; + var linkFile = this.linkFile; + + if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + { + if (this.type === 'image') + { + texture = this.cache.addImage(this.key, this.data, linkFile.data); + } + else + { + texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); + } + + this.pendingDestroy(texture); + + linkFile.pendingDestroy(texture); + } + else if (!linkFile) + { + texture = this.cache.addImage(this.key, this.data); + + this.pendingDestroy(texture); + } + } + +}); + +/** + * 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. + * + * 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#addFileEvent + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Loader.Events + */ + +module.exports = { + + ADD: __webpack_require__(171), + COMPLETE: __webpack_require__(172), + FILE_COMPLETE: __webpack_require__(173), + FILE_KEY_COMPLETE: __webpack_require__(174), + FILE_LOAD_ERROR: __webpack_require__(175), + FILE_LOAD: __webpack_require__(176), + FILE_PROGRESS: __webpack_require__(177), + POST_PROCESS: __webpack_require__(178), + PROGRESS: __webpack_require__(179), + START: __webpack_require__(180) + +}; + + +/***/ }), +/* 171 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), +/* 172 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {integer} totalComplete - The total number of files that successfully loaded. + * @param {integer} totalFailed - The total number of files that failed to load. + */ +module.exports = 'complete'; + + +/***/ }), +/* 173 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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)`. + * + * 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 + * @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. + */ +module.exports = 'filecomplete'; + + +/***/ }), +/* 174 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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-atlas-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 + * }); + * ``` + * + * 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 + * @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. + */ +module.exports = 'filecomplete-'; + + +/***/ }), +/* 175 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + */ +module.exports = 'loaderror'; + + +/***/ }), +/* 176 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + */ +module.exports = 'load'; + + +/***/ }), +/* 177 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), +/* 178 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'postprocess'; + + +/***/ }), +/* 179 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {number} progress - The current progress of the load. A value between 0 and 1. + */ +module.exports = 'progress'; + + +/***/ }), +/* 180 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'start'; + + +/***/ }), +/* 181 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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:|http:\/\/|https:\/\/|\/\/)/)) + { + return file.url; + } + else + { + return baseURL + file.url; + } +}; + +module.exports = GetURL; + + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(29); + +/** + * 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.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); + } + + // 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; + + +/***/ }), +/* 183 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(6); +var File = __webpack_require__(12); +var FileTypesManager = __webpack_require__(13); +var GetFastValue = __webpack_require__(3); +var GetValue = __webpack_require__(11); +var IsPlainObject = __webpack_require__(2); + +/** + * @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 {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". + * @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); + + if (IsPlainObject(url)) + { + // Object provided instead of a URL, so no need to actually load it (populate data with value) + 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; + + var json = JSON.parse(this.xhrLoader.responseText); + + 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#addFileEvent + * @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 {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". + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), +/* 184 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @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) + { + /** + * 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; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = files; + + /** + * 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 {integer} + * @since 3.7.0 + */ + + this.pending = files.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {integer} + * @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 = {}; + + // Link the files + for (var i = 0; i < files.length; i++) + { + files[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++; + } + } + +}); + +module.exports = MultiFile; + + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(6); +var File = __webpack_require__(12); +var FileTypesManager = __webpack_require__(13); +var GetFastValue = __webpack_require__(3); +var IsPlainObject = __webpack_require__(2); + +/** + * @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 extension = 'txt'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'text', + cache: loader.cacheManager.text, + 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#addFileEvent + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), +/* 186 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var AngleBetween = __webpack_require__(15); +var Clamp = __webpack_require__(8); +var Class = __webpack_require__(0); +var ComponentsComputedSize = __webpack_require__(187); +var ComponentsDepth = __webpack_require__(188); +var ComponentsFlip = __webpack_require__(189); +var ComponentsScrollFactor = __webpack_require__(190); +var ComponentsTransform = __webpack_require__(191); +var ComponentsVisible = __webpack_require__(193); +var CounterClockwise = __webpack_require__(7); +var DegToRad = __webpack_require__(25); +var GameObject = __webpack_require__(194); +var RadToDeg = __webpack_require__(9); +var SpineEvents = __webpack_require__(205); +var SpineGameObjectRender = __webpack_require__(212); + +/** + * @classdesc + * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates + * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to + * easily change the skin, slot attachment, bone positions and more. + * + * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly. + * You can only create them if the Spine plugin has been loaded into Phaser. + * + * The quickest way is the Game Object Factory: + * + * ```javascript + * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true); + * ``` + * + * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly` + * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is + * an optional animation to start playing on the skeleton. The final argument `true` sets the + * animation to loop. Look at the documentation for further details on each of these options. + * + * For more control, you can use the Game Object Creator, passing in a Spine Game Object + * Configuration object: + * + * ```javascript + * let jelly = this.make.spine({ + * x: 512, y: 550, key: 'jelly', + * scale: 1.5, + * skinName: 'square_Green', + * animationName: 'jelly-think', loop: true, + * slotName: 'hat', attachmentName: 'images/La_14' + * }); + * ``` + * + * Here, you've got the ability to specify extra details, such as the slot name, attachments or + * overall scale. + * + * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to + * update and render, it must be added to the display and update lists of your Scene: + * + * ```javascript + * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true); + * this.sys.displayList.add(jelly); + * this.sys.updateList.add(jelly); + * ``` + * + * It's possible to enable Spine Game Objects for input, but you should be aware that it will use + * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but + * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created. + * If it's not suitable, provide your own shape to the `setInteractive` method. + * + * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for + * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game + * Object position with it. See the examples for further details. + * + * If your Spine Game Object has black outlines around the different parts of the texture when it + * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have + * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details. + * + * @class SpineGameObject + * @constructor + * @since 3.19.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 {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? + */ +var SpineGameObject = new Class({ + + Extends: GameObject, + + Mixins: [ + ComponentsComputedSize, + ComponentsDepth, + ComponentsFlip, + ComponentsScrollFactor, + ComponentsTransform, + ComponentsVisible, + SpineGameObjectRender + ], + + initialize: + + function SpineGameObject (scene, plugin, x, y, key, animationName, loop) + { + GameObject.call(this, scene, 'Spine'); + + /** + * A reference to the Spine Plugin. + * + * @name SpineGameObject#plugin + * @type {SpinePlugin} + * @since 3.19.0 + */ + this.plugin = plugin; + + /** + * The Spine Skeleton this Game Object is using. + * + * @name SpineGameObject#skeleton + * @type {spine.Skeleton} + * @since 3.19.0 + */ + this.skeleton = null; + + /** + * The Spine Skeleton Data associated with the Skeleton this Game Object is using. + * + * @name SpineGameObject#skeletonData + * @type {spine.SkeletonData} + * @since 3.19.0 + */ + this.skeletonData = null; + + /** + * The Spine Animation State this Game Object is using. + * + * @name SpineGameObject#state + * @type {spine.AnimationState} + * @since 3.19.0 + */ + this.state = null; + + /** + * The Spine Animation State Data associated with the Animation State this Game Object is using. + * + * @name SpineGameObject#stateData + * @type {spine.AnimationStateData} + * @since 3.19.0 + */ + this.stateData = null; + + /** + * A reference to the root bone of the Skeleton. + * + * @name SpineGameObject#root + * @type {spine.Bone} + * @since 3.19.0 + */ + this.root = null; + + /** + * This object holds the calculated bounds of the current + * pose, as set when a new Skeleton is applied. + * + * @name SpineGameObject#bounds + * @type {any} + * @since 3.19.0 + */ + this.bounds = null; + + /** + * A Game Object level flag that allows you to enable debug drawing + * to the Skeleton Debug Renderer by toggling it. + * + * @name SpineGameObject#drawDebug + * @type {boolean} + * @since 3.19.0 + */ + this.drawDebug = false; + + /** + * The factor to scale the Animation update time by. + * + * @name SpineGameObject#timeScale + * @type {number} + * @since 3.19.0 + */ + this.timeScale = 1; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginX + * @type {number} + * @since 3.19.0 + */ + this.displayOriginX = 0; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginY + * @type {number} + * @since 3.19.0 + */ + this.displayOriginY = 0; + + /** + * A flag that stores if the texture associated with the current + * Skin being used by this Game Object, has its alpha pre-multiplied + * into it, or not. + * + * @name SpineGameObject#preMultipliedAlpha + * @type {boolean} + * @since 3.19.0 + */ + this.preMultipliedAlpha = false; + + /** + * A default Blend Mode. You cannot change the blend mode of a + * Spine Game Object. + * + * @name SpineGameObject#blendMode + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.blendMode = 0; + + this.setPosition(x, y); + + if (key) + { + this.setSkeleton(key, animationName, loop); + } + }, + + /** + * Overrides the default Game Object method and always returns true. + * Rendering is decided in the renderer functions. + * + * @method SpineGameObject#willRender + * @since 3.19.0 + * + * @return {boolean} Always returns `true`. + */ + willRender: function () + { + return true; + }, + + /** + * Set the Alpha level for the whole Skeleton 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 SpineGameObject#setAlpha + * @since 3.19.0 + * + * @param {number} [value=1] - The alpha value used for the whole Skeleton. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (value, slotName) + { + if (value === undefined) { value = 1; } + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + slot.color.a = Clamp(value, 0, 1); + } + } + else + { + this.alpha = value; + } + + return this; + }, + + /** + * The alpha value of the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#alpha + * @type {number} + * @since 3.19.0 + */ + alpha: { + + get: function () + { + return this.skeleton.color.a; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.a = v; + } + + if (v === 0) + { + this.renderFlags &= ~2; + } + else + { + this.renderFlags |= 2; + } + } + + }, + + /** + * The amount of red used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#red + * @type {number} + * @since 3.19.0 + */ + red: { + + get: function () + { + return this.skeleton.color.r; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.r = v; + } + } + + }, + + /** + * The amount of green used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#green + * @type {number} + * @since 3.19.0 + */ + green: { + + get: function () + { + return this.skeleton.color.g; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.g = v; + } + } + + }, + + /** + * The amount of blue used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#blue + * @type {number} + * @since 3.19.0 + */ + blue: { + + get: function () + { + return this.skeleton.color.b; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.b = v; + } + } + + }, + + /** + * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton. + * + * @method SpineGameObject#setColor + * @since 3.19.0 + * + * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color. + * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton. + * + * @return {this} This Game Object instance. + */ + setColor: function (color, slotName) + { + if (color === undefined) { color = 0xffffff; } + + var red = (color >> 16 & 0xFF) / 255; + var green = (color >> 8 & 0xFF) / 255; + var blue = (color & 0xFF) / 255; + var alpha = (color > 16777215) ? (color >>> 24) / 255 : null; + + var target = this.skeleton; + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + target = slot; + } + } + + target.color.r = red; + target.color.g = green; + target.color.b = blue; + + if (alpha !== null) + { + target.color.a = alpha; + } + + return this; + }, + + /** + * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object + * that contains the Skeleton data. + * + * @method SpineGameObject#setSkeletonFromJSON + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ + setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop) + { + return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop); + }, + + /** + * Sets this Game Object to use the given Skeleton based on its cache key. + * + * Typically, once set, the Skeleton doesn't change. Instead, you change the skin, + * or slot attachment, or any other property to adjust it. + * + * @method SpineGameObject#setSkeleton + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ + setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON) + { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON); + + this.skeletonData = data.skeletonData; + + this.preMultipliedAlpha = data.preMultipliedAlpha; + + var skeleton = data.skeleton; + + skeleton.setSkinByName('default'); + skeleton.setToSetupPose(); + + this.skeleton = skeleton; + + // AnimationState + data = this.plugin.createAnimationState(skeleton); + + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + this.state = data.state; + this.stateData = data.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) + }); + + if (animationName) + { + this.setAnimation(0, animationName, loop); + } + + this.root = this.getRootBone(); + + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.state.apply(skeleton); + + skeleton.updateCache(); + + return this.updateSize(); + }, + + /** + * Internal event handler that emits the Spine onComplete event via this Game Object. + * + * @method SpineGameObject#onComplete + * @fires SpinePluginEvents#COMPLETE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onComplete: function (entry) + { + this.emit(SpineEvents.COMPLETE, entry); + }, + + /** + * Internal event handler that emits the Spine onDispose event via this Game Object. + * + * @method SpineGameObject#onDispose + * @fires SpinePluginEvents#DISPOSE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onDispose: function (entry) + { + this.emit(SpineEvents.DISPOSE, entry); + }, + + /** + * Internal event handler that emits the Spine onEnd event via this Game Object. + * + * @method SpineGameObject#onEnd + * @fires SpinePluginEvents#END + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onEnd: function (entry) + { + this.emit(SpineEvents.END, entry); + }, + + /** + * Internal event handler that emits the Spine Event event via this Game Object. + * + * @method SpineGameObject#onEvent + * @fires SpinePluginEvents#EVENT + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + * @param {spine.Event} event - The Spine event. + */ + onEvent: function (entry, event) + { + this.emit(SpineEvents.EVENT, entry, event); + }, + + /** + * Internal event handler that emits the Spine onInterrupted event via this Game Object. + * + * @method SpineGameObject#onInterrupted + * @fires SpinePluginEvents#INTERRUPTED + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onInterrupted: function (entry) + { + this.emit(SpineEvents.INTERRUPTED, entry); + }, + + /** + * Internal event handler that emits the Spine onStart event via this Game Object. + * + * @method SpineGameObject#onStart + * @fires SpinePluginEvents#START + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onStart: function (entry) + { + this.emit(SpineEvents.START, entry); + }, + + /** + * Refreshes the data about the current Skeleton. + * + * This will reset the rotation, position and size of the Skeleton to match this Game Object. + * + * Call this method if you need to access the Skeleton data directly, and it may have changed + * recently. + * + * @method SpineGameObject#refresh + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + refresh: function () + { + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.updateSize(); + + this.skeleton.updateCache(); + + return this; + }, + + /** + * Sets the size of this Game Object. + * + * If no arguments are given it uses the current skeleton data dimensions. + * + * You can use this method to set a fixed size of this Game Object, such as for input detection, + * when the skeleton data doesn't match what is required in-game. + * + * @method SpineGameObject#setSize + * @since 3.19.0 + * + * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width. + * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height. + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setSize: function (width, height, offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (width === undefined) { width = skeleton.data.width; } + if (height === undefined) { height = skeleton.data.height; } + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.width = width; + this.height = height; + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Sets the offset of this Game Object from the Skeleton position. + * + * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using. + * + * @method SpineGameObject#setOffset + * @since 3.19.0 + * + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setOffset: function (offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Internal method that syncs all of the Game Object position and scale data to the Skeleton. + * It then syncs the skeleton bounds back to this Game Object. + * + * This method is called automatically as needed internally, however, it's also exposed should + * you require overriding the size settings. + * + * @method SpineGameObject#updateSize + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + updateSize: function () + { + var skeleton = this.skeleton; + var renderer = this.plugin.renderer; + + var height = renderer.height; + + var oldScaleX = this.scaleX; + var oldScaleY = this.scaleY; + + skeleton.x = this.x; + skeleton.y = height - this.y; + skeleton.scaleX = 1; + skeleton.scaleY = 1; + + skeleton.updateWorldTransform(); + + var bounds = this.getBounds(); + + this.width = bounds.size.x; + this.height = bounds.size.y; + + this.displayOriginX = this.x - bounds.offset.x; + this.displayOriginY = this.y - (height - (this.height + bounds.offset.y)); + + skeleton.scaleX = oldScaleX; + skeleton.scaleY = oldScaleY; + + skeleton.updateWorldTransform(); + + return this; + }, + + /** + * The horizontal scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleX + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + this.refresh(); + } + + }, + + /** + * The vertical scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleY + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + this.refresh(); + } + + }, + + /** + * Returns an array containing the names of all the bones in the Skeleton Data. + * + * @method SpineGameObject#getBoneList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the bones in the Skeleton Data. + */ + getBoneList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.bones.length; i++) + { + output.push(skeletonData.bones[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the skins in the Skeleton Data. + * + * @method SpineGameObject#getSkinList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the skins in the Skeleton Data. + */ + getSkinList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.skins.length; i++) + { + output.push(skeletonData.skins[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the slots in the Skeleton. + * + * @method SpineGameObject#getSlotList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the slots in the Skeleton. + */ + getSlotList: function () + { + var output = []; + + var skeleton = this.skeleton; + + for (var i = 0; i < skeleton.slots.length; i++) + { + output.push(skeleton.slots[i].data.name); + } + + return output; + }, + + /** + * Returns an array containing the names of all the animations in the Skeleton Data. + * + * @method SpineGameObject#getAnimationList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the animations in the Skeleton Data. + */ + getAnimationList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.animations.length; i++) + { + output.push(skeletonData.animations[i].name); + } + } + + return output; + }, + + /** + * Returns the current animation being played on the given track, if any. + * + * @method SpineGameObject#getCurrentAnimation + * @since 3.19.0 + * + * @param {integer} [trackIndex=0] - The track to return the current animation on. + * + * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation. + */ + getCurrentAnimation: function (trackIndex) + { + if (trackIndex === undefined) { trackIndex = 0; } + + var current = this.state.getCurrent(trackIndex); + + if (current) + { + return current.animation; + } + }, + + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#play + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead. + */ + play: function (animationName, loop, ignoreIfPlaying) + { + this.setAnimation(0, animationName, loop, ignoreIfPlaying); + + return this; + }, + + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#setAnimation + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to play the animation on. + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying) + { + if (loop === undefined) { loop = false; } + if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } + + if (ignoreIfPlaying && this.state) + { + var currentTrack = this.state.getCurrent(0); + + if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete()) + { + return; + } + } + + if (this.findAnimation(animationName)) + { + return this.state.setAnimation(trackIndex, animationName, loop); + } + }, + + /** + * Adds an animation to be played after the current or last queued animation for a track. + * If the track is empty, it is equivalent to calling setAnimation. + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous + * track entry minus any mix duration (from the AnimationStateData) plus the specified delay + * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration). + * If the previous entry is looping, its next loop completion is used instead of its duration. + * + * @method SpineGameObject#addAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {string} animationName - The string-based key of the animation to add. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + addAnimation: function (trackIndex, animationName, loop, delay) + { + return this.state.addAnimation(trackIndex, animationName, loop, delay); + }, + + /** + * Sets an empty animation for a track, discarding any queued animations, and sets the track + * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out. + * + * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation, + * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be + * applied less and less over the mix duration. Properties keyed in the previous animation transition to + * the value from lower tracks or to the setup pose value if no lower tracks key the property. + * A mix duration of 0 still mixes out over one frame. + * + * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation + * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new + * animation to be applied more and more over the mix duration. Properties keyed in the new animation + * transition from the value from lower tracks or from the setup pose value if no lower tracks key the + * property to the value keyed in the new animation. + * + * @method SpineGameObject#setEmptyAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {spine.TrackEntry} The returned Track Entry. + */ + setEmptyAnimation: function (trackIndex, mixDuration) + { + return this.state.setEmptyAnimation(trackIndex, mixDuration); + }, + + /** + * Removes all animations from the track, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTrack + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * + * @return {this} This Game Object. + */ + clearTrack: function (trackIndex) + { + this.state.clearTrack(trackIndex); + + return this; + }, + + /** + * Removes all animations from all tracks, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTracks + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + clearTracks: function () + { + this.state.clearTracks(); + + return this; + }, + + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkinByName + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to set. + * + * @return {this} This Game Object. + */ + setSkinByName: function (skinName) + { + var skeleton = this.skeleton; + + skeleton.setSkinByName(skinName); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); + + return this; + }, + + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkin + * @since 3.19.0 + * + * @param {?spine.Skin} newSkin - The Skin to set. May be `null`. + * + * @return {this} This Game Object. + */ + setSkin: function (newSkin) + { + var skeleton = this.skeleton; + + skeleton.setSkin(newSkin); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); + + return this; + }, + + /** + * Sets the mix duration when changing from the specified animation to the other. + * + * @method SpineGameObject#setMix + * @since 3.19.0 + * + * @param {string} fromName - The animation to mix from. + * @param {string} toName - The animation to mix to. + * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {this} This Game Object. + */ + setMix: function (fromName, toName, duration) + { + this.stateData.setMix(fromName, toName, duration); + + return this; + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot + * index and attachment name. First the skin is checked and if the attachment was not found, + * the default skin is checked. + * + * @method SpineGameObject#getAttachment + * @since 3.19.0 + * + * @param {integer} slotIndex - The slot index to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachment: function (slotIndex, attachmentName) + { + return this.skeleton.getAttachment(slotIndex, attachmentName); + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name. + * + * @method SpineGameObject#getAttachmentByName + * @since 3.19.0 + * + * @param {string} slotName - The slot name to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachmentByName: function (slotName, attachmentName) + { + return this.skeleton.getAttachmentByName(slotName, attachmentName); + }, + + /** + * A convenience method to set an attachment by finding the slot with findSlot, + * finding the attachment with getAttachment, then setting the slot's attachment. + * + * @method SpineGameObject#setAttachment + * @since 3.19.0 + * + * @param {string} slotName - The slot name to add the attachment to. + * @param {string} attachmentName - The attachment name to add. + * + * @return {this} This Game Object. + */ + setAttachment: function (slotName, attachmentName) + { + if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length) + { + for (var i = 0; i < slotName.length; i++) + { + this.skeleton.setAttachment(slotName[i], attachmentName[i]); + } + } + else + { + this.skeleton.setAttachment(slotName, attachmentName); + } + + return this; + }, + + /** + * Sets the bones, constraints, slots, and draw order to their setup pose values. + * + * @method SpineGameObject#setToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setToSetupPose: function () + { + this.skeleton.setToSetupPose(); + + return this; + }, + + /** + * Sets the slots and draw order to their setup pose values. + * + * @method SpineGameObject#setSlotsToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setSlotsToSetupPose: function () + { + this.skeleton.setSlotsToSetupPose(); + + return this; + }, + + /** + * Sets the bones and constraints to their setup pose values. + * + * @method SpineGameObject#setBonesToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setBonesToSetupPose: function () + { + this.skeleton.setBonesToSetupPose(); + + return this; + }, + + /** + * Gets the root bone, or null. + * + * @method SpineGameObject#getRootBone + * @since 3.19.0 + * + * @return {spine.Bone} The root bone, or null. + */ + getRootBone: function () + { + return this.skeleton.getRootBone(); + }, + + /** + * Takes a Bone object and a position in world space and rotates the Bone so it is angled + * towards the given position. You can set an optional angle offset, should the bone be + * designed at a specific angle already. You can also set a minimum and maximum range for the angle. + * + * @method SpineGameObject#angleBoneToXY + * @since 3.19.0 + * + * @param {spine.Bone} bone - The bone to rotate towards the world position. + * @param {number} worldX - The world x coordinate to rotate the bone towards. + * @param {number} worldY - The world y coordinate to rotate the bone towards. + * @param {number} [offset=0] - An offset to add to the rotation angle. + * @param {number} [minAngle=0] - The minimum range of the rotation angle. + * @param {number} [maxAngle=360] - The maximum range of the rotation angle. + * + * @return {this} This Game Object. + */ + angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle) + { + if (offset === undefined) { offset = 0; } + if (minAngle === undefined) { minAngle = 0; } + if (maxAngle === undefined) { maxAngle = 360; } + + var renderer = this.plugin.renderer; + var height = renderer.height; + + var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset)); + + bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle); + + return this; + }, + + /** + * Finds a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBone + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {spine.Bone} The bone, or null. + */ + findBone: function (boneName) + { + return this.skeleton.findBone(boneName); + }, + + /** + * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBoneIndex + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {integer} The bone index. Or -1 if the bone was not found. + */ + findBoneIndex: function (boneName) + { + return this.skeleton.findBoneIndex(boneName); + }, + + /** + * Finds a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlot + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {spine.Slot} The Slot. May be null. + */ + findSlot: function (slotName) + { + return this.skeleton.findSlot(slotName); + }, + + /** + * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlotIndex + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {integer} The slot index. Or -1 if the Slot was not found. + */ + findSlotIndex: function (slotName) + { + return this.skeleton.findSlotIndex(slotName); + }, + + /** + * Finds a skin by comparing each skin's name. It is more efficient to cache the results of + * this method than to call it multiple times. + * + * @method SpineGameObject#findSkin + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to find. + * + * @return {spine.Skin} The Skin. May be null. + */ + findSkin: function (skinName) + { + return this.skeletonData.findSkin(skinName); + }, + + /** + * Finds an event by comparing each events's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findEvent + * @since 3.19.0 + * + * @param {string} eventDataName - The name of the event to find. + * + * @return {spine.EventData} The Event Data. May be null. + */ + findEvent: function (eventDataName) + { + return this.skeletonData.findEvent(eventDataName); + }, + + /** + * Finds an animation by comparing each animation's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findAnimation + * @since 3.19.0 + * + * @param {string} animationName - The name of the animation to find. + * + * @return {spine.Animation} The Animation. May be null. + */ + findAnimation: function (animationName) + { + return this.skeletonData.findAnimation(animationName); + }, + + /** + * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findIkConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.IkConstraintData} The IK constraint. May be null. + */ + findIkConstraint: function (constraintName) + { + return this.skeletonData.findIkConstraint(constraintName); + }, + + /** + * Finds an transform constraint by comparing each transform constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findTransformConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.TransformConstraintData} The transform constraint. May be null. + */ + findTransformConstraint: function (constraintName) + { + return this.skeletonData.findTransformConstraint(constraintName); + }, + + /** + * Finds a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.PathConstraintData} The path constraint. May be null. + */ + findPathConstraint: function (constraintName) + { + return this.skeletonData.findPathConstraint(constraintName); + }, + + /** + * Finds the index of a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraintIndex + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {integer} The constraint index. Or -1 if the constraint was not found. + */ + findPathConstraintIndex: function (constraintName) + { + return this.skeletonData.findPathConstraintIndex(constraintName); + }, + + /** + * 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 SpineGameObject#getBounds + * @since 3.19.0 + * + * @return {any} The bounds object. + */ + getBounds: function () + { + return this.plugin.getBounds(this.skeleton); + }, + + /** + * Internal update handler. + * + * @method SpineGameObject#preUpdate + * @protected + * @since 3.19.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + var skeleton = this.skeleton; + + this.state.update((delta / 1000) * this.timeScale); + + this.state.apply(skeleton); + + // this.emit('spine.update', skeleton); + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method SpineGameObject#preDestroy + * @protected + * @since 3.19.0 + */ + preDestroy: function () + { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + this.plugin = null; + + this.skeleton = null; + this.skeletonData = null; + + this.state = null; + this.stateData = null; + } + +}); + +module.exports = SpineGameObject; + + +/***/ }), +/* 187 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 188 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * 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 depth starts from zero (the default value) and increases from that point. 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) + { + this.scene.sys.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 depth starts from zero (the default value) and increases from that point. 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 {integer} value - The depth of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), +/* 189 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 190 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 191 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(1); +var TransformMatrix = __webpack_require__(192); +var WrapAngle = __webpack_require__(17); +var WrapAngleDegrees = __webpack_require__(18); + +// 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 = { + + /** + * 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: Do not use this value to set the z-index, instead see the `depth` property. + * + * @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 {integer} + * @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, 90 is down, 180/-180 is left + * and -90 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; + }, + + /** + * 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. + * + * @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; + }, + + /** + * 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; + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var MATH_CONST = __webpack_require__(1); +var Vector2 = __webpack_require__(5); + +/** + * @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 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 {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) ? this : out; + + destinationMatrix.a = (sourceA * localA) + (sourceB * localC); + destinationMatrix.b = (sourceA * localB) + (sourceB * localD); + destinationMatrix.c = (sourceC * localA) + (sourceD * localC); + destinationMatrix.d = (sourceC * localB) + (sourceD * localD); + destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE; + destinationMatrix.f = (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 using 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.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates. + * + * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} 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; + }, + + /** + * 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 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.decomposedMatrix = null; + } + +}); + +module.exports = TransformMatrix; + + +/***/ }), +/* 193 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 194 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var ComponentsToJSON = __webpack_require__(195); +var DataManager = __webpack_require__(196); +var EventEmitter = __webpack_require__(202); +var Events = __webpack_require__(203); + +/** + * @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); + + /** + * The Scene to which this Game Object belongs. + * Game Objects can only belong to one Scene. + * + * @name Phaser.GameObjects.GameObject#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * 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 move 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 {(integer|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 {integer} + * @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 {integer} + * @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 physics then this property will contain a reference to a Physics Body. + * + * @name Phaser.GameObjects.GameObject#body + * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)} + * @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; + + // 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 {(integer|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 + * + * @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; + }, + + /** + * 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. + * + * @method Phaser.GameObjects.GameObject#setInteractive + * @since 3.0.0 + * + * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. 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 (shape, callback, dropZone) + { + this.scene.sys.input.enable(this, shape, callback, 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 () + { + if (this.input) + { + this.input.enabled = false; + } + + 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; + }, + + /** + * 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) + { + return !(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 {integer[]} 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), parent.name]); + indexes.unshift(parent.getIndex(child)); + + child = parent; + + if (!parent.parentContainer) + { + break; + } + else + { + parent = parent.parentContainer; + } + } + + // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']); + indexes.unshift(this.scene.sys.displayList.getIndex(child)); + + return indexes; + }, + + /** + * 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] - Is this Game Object being destroyed as the result of a Scene shutdown? + */ + destroy: function (fromScene) + { + if (fromScene === undefined) { fromScene = false; } + + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + if (this.preDestroy) + { + this.preDestroy.call(this); + } + + this.emit(Events.DESTROY, this); + + var sys = this.scene.sys; + + if (!fromScene) + { + sys.displayList.remove(this); + sys.updateList.remove(this); + } + + if (this.input) + { + 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; + } + + // Tell the Scene to re-sort the children + if (!fromScene) + { + sys.queueDepthSort(); + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + + this.parentContainer = undefined; + + this.removeAllListeners(); + } + +}); + +/** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + * + * @constant {integer} RENDER_MASK + * @memberof Phaser.GameObjects.GameObject + * @default + */ +GameObject.RENDER_MASK = 15; + +module.exports = GameObject; + + +/***/ }), +/* 195 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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, + scaleMode: gameObject.scaleMode, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Events = __webpack_require__(197); + +/** + * @callback DataEachCallback + * + * @param {*} parent - The parent object of the DataManager. + * @param {string} key - The key of the value. + * @param {*} value - The value. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + */ + +/** + * @classdesc + * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + * + * @class DataManager + * @memberof Phaser.Data + * @constructor + * @since 3.0.0 + * + * @param {object} parent - The object that this DataManager belongs to. + * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter. + */ +var DataManager = new Class({ + + initialize: + + function DataManager (parent, eventEmitter) + { + /** + * The object that this DataManager belongs to. + * + * @name Phaser.Data.DataManager#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The DataManager's event emitter. + * + * @name Phaser.Data.DataManager#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = eventEmitter; + + if (!eventEmitter) + { + this.events = (parent.events) ? parent.events : parent; + } + + /** + * The data list. + * + * @name Phaser.Data.DataManager#list + * @type {Object.} + * @default {} + * @since 3.0.0 + */ + this.list = {}; + + /** + * The public values list. You can use this to access anything you have stored + * in this Data Manager. For example, if you set a value called `gold` you can + * access it via: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also modify it directly: + * + * ```javascript + * this.data.values.gold += 1000; + * ``` + * + * Doing so will emit a `setdata` event from the parent of this Data Manager. + * + * Do not modify this object directly. Adding properties directly to this object will not + * emit any events. Always use `DataManager.set` to create new items the first time around. + * + * @name Phaser.Data.DataManager#values + * @type {Object.} + * @default {} + * @since 3.10.0 + */ + this.values = {}; + + /** + * Whether setting data is frozen for this DataManager. + * + * @name Phaser.Data.DataManager#_frozen + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._frozen = false; + + if (!parent.hasOwnProperty('sys') && this.events) + { + this.events.once('destroy', this.destroy, this); + } + }, + + /** + * Retrieves the value for the given key, 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 + * this.data.get('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * this.data.get([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.Data.DataManager#get + * @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. + */ + get: function (key) + { + var list = this.list; + + if (Array.isArray(key)) + { + var output = []; + + for (var i = 0; i < key.length; i++) + { + output.push(list[key[i]]); + } + + return output; + } + else + { + return list[key]; + } + }, + + /** + * Retrieves all data values in a new object. + * + * @method Phaser.Data.DataManager#getAll + * @since 3.0.0 + * + * @return {Object.} All data values. + */ + getAll: function () + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Queries the DataManager for the values of keys matching the given regular expression. + * + * @method Phaser.Data.DataManager#query + * @since 3.0.0 + * + * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). + * + * @return {Object.} The values of the keys matching the search string. + */ + query: function (search) + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key) && key.match(search)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * data.set('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `get`: + * + * ```javascript + * data.get('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted. + * + * 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.Data.DataManager#set + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @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. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + set: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (typeof key === 'string') + { + return this.setValue(key, data); + } + else + { + for (var entry in key) + { + this.setValue(entry, key[entry]); + } + } + + return this; + }, + + /** + * Internal value setter, called automatically by the `set` method. + * + * @method Phaser.Data.DataManager#setValue + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @private + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * @param {*} data - The value to set. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setValue: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (this.has(key)) + { + // Hit the key getter, which will in turn emit the events. + this.values[key] = data; + } + else + { + var _this = this; + var list = this.list; + var events = this.events; + var parent = this.parent; + + Object.defineProperty(this.values, key, { + + enumerable: true, + + configurable: true, + + get: function () + { + return list[key]; + }, + + set: function (value) + { + if (!_this._frozen) + { + var previousValue = list[key]; + list[key] = value; + + events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); + events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); + } + } + + }); + + list[key] = data; + + events.emit(Events.SET_DATA, parent, key, data); + } + + return this; + }, + + /** + * Passes all data entries to the given callback. + * + * @method Phaser.Data.DataManager#each + * @since 3.0.0 + * + * @param {DataEachCallback} callback - The function to call. + * @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 {Phaser.Data.DataManager} This DataManager object. + */ + each: function (callback, context) + { + var args = [ this.parent, null, undefined ]; + + for (var i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (var key in this.list) + { + args[1] = key; + args[2] = this.list[key]; + + callback.apply(context, args); + } + + return this; + }, + + /** + * Merge the given object of key value pairs into this DataManager. + * + * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) + * will emit a `changedata` event. + * + * @method Phaser.Data.DataManager#merge + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {Object.} data - The data to merge. + * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + merge: function (data, overwrite) + { + if (overwrite === undefined) { overwrite = true; } + + // Merge data from another component into this one + for (var key in data) + { + if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) + { + this.setValue(key, data[key]); + } + } + + return this; + }, + + /** + * Remove the value for the given key. + * + * If the key is found in this Data Manager it is removed from the internal lists and a + * `removedata` event is emitted. + * + * You can also pass in an array of keys, in which case all keys in the array will be removed: + * + * ```javascript + * this.data.remove([ 'gold', 'armor', 'health' ]); + * ``` + * + * @method Phaser.Data.DataManager#remove + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {(string|string[])} key - The key to remove, or an array of keys to remove. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + remove: function (key) + { + if (this._frozen) + { + return this; + } + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + this.removeValue(key[i]); + } + } + else + { + return this.removeValue(key); + } + + return this; + }, + + /** + * Internal value remover, called automatically by the `remove` method. + * + * @method Phaser.Data.DataManager#removeValue + * @private + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + removeValue: function (key) + { + if (this.has(key)) + { + var data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return this; + }, + + /** + * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. + * + * @method Phaser.Data.DataManager#pop + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {string} key - The key of the value to retrieve and delete. + * + * @return {*} The value of the given key. + */ + pop: function (key) + { + var data = undefined; + + if (!this._frozen && this.has(key)) + { + data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return data; + }, + + /** + * Determines whether the given key is set in this Data Manager. + * + * Please note that the 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.Data.DataManager#has + * @since 3.0.0 + * + * @param {string} key - The key to check. + * + * @return {boolean} Returns `true` if the key exists, otherwise `false`. + */ + has: function (key) + { + return this.list.hasOwnProperty(key); + }, + + /** + * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts + * to create new values or update existing ones. + * + * @method Phaser.Data.DataManager#setFreeze + * @since 3.0.0 + * + * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setFreeze: function (value) + { + this._frozen = value; + + return this; + }, + + /** + * Delete all data in this Data Manager and unfreeze it. + * + * @method Phaser.Data.DataManager#reset + * @since 3.0.0 + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + reset: function () + { + for (var key in this.list) + { + delete this.list[key]; + delete this.values[key]; + } + + this._frozen = false; + + return this; + }, + + /** + * Destroy this data manager. + * + * @method Phaser.Data.DataManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.reset(); + + this.events.off(Events.CHANGE_DATA); + this.events.off(Events.SET_DATA); + this.events.off(Events.REMOVE_DATA); + + this.parent = null; + }, + + /** + * Gets or sets the frozen state of this Data Manager. + * A frozen Data Manager will block all attempts to create new values or update existing ones. + * + * @name Phaser.Data.DataManager#freeze + * @type {boolean} + * @since 3.0.0 + */ + freeze: { + + get: function () + { + return this._frozen; + }, + + set: function (value) + { + this._frozen = (value) ? true : false; + } + + }, + + /** + * Return the total number of entries in this Data Manager. + * + * @name Phaser.Data.DataManager#count + * @type {integer} + * @since 3.0.0 + */ + count: { + + get: function () + { + var i = 0; + + for (var key in this.list) + { + if (this.list[key] !== undefined) + { + i++; + } + } + + return i; + } + + } + +}); + +module.exports = DataManager; + + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Data.Events + */ + +module.exports = { + + CHANGE_DATA: __webpack_require__(198), + CHANGE_DATA_KEY: __webpack_require__(199), + REMOVE_DATA: __webpack_require__(200), + SET_DATA: __webpack_require__(201) + +}; + + +/***/ }), +/* 198 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`. + * + * This event is dispatched for all items that change in the Data Manager. + * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. + * + * @event Phaser.Data.Events#CHANGE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The new value of the item in the Data Manager. + * @param {any} previousValue - The previous value of the item in the Data Manager. + */ +module.exports = 'changedata'; + + +/***/ }), +/* 199 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Key Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`, + * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` + * then you can listen for `sprite.data.on('changedata-gold')`. + * + * @event Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.16.1 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'changedata-'; + + +/***/ }), +/* 200 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Remove Data Event. + * + * This event is dispatched by a Data Manager when an item is removed from it. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`. + * + * @event Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'removedata'; + + +/***/ }), +/* 201 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Set Data Event. + * + * This event is dispatched by a Data Manager when a new item is added to the data store. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`. + * + * @event Phaser.Data.Events#SET_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'setdata'; + + +/***/ }), +/* 202 */ +/***/ (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; +} + + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { DESTROY: __webpack_require__(204) }; + + +/***/ }), +/* 204 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Destroy Event. + * + * 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 + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. + */ +module.exports = 'destroy'; + + +/***/ }), +/* 205 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace SpinePluginEvents + */ + +module.exports = { + + COMPLETE: __webpack_require__(206), + DISPOSE: __webpack_require__(207), + END: __webpack_require__(208), + EVENT: __webpack_require__(209), + INTERRUPTED: __webpack_require__(210), + START: __webpack_require__(211) + +}; + + +/***/ }), +/* 206 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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'; + + +/***/ }), +/* 207 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#DISPOSE + * @since 3.19.0 + */ +module.exports = 'dispose'; + + +/***/ }), +/* 208 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#END + * @since 3.19.0 + */ +module.exports = 'end'; + + +/***/ }), +/* 209 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#EVENT + * @since 3.19.0 + */ +module.exports = 'event'; + + +/***/ }), +/* 210 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#INTERRUPTED + * @since 3.19.0 + */ +module.exports = 'interrupted'; + + +/***/ }), +/* 211 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#START + * @since 3.19.0 + */ +module.exports = 'start'; + + +/***/ }), +/* 212 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var renderWebGL = __webpack_require__(31); +var renderCanvas = __webpack_require__(31); + +if (false) +{} + +if (true) +{ + renderCanvas = __webpack_require__(213); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 213 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var CounterClockwise = __webpack_require__(7); +var RadToDeg = __webpack_require__(9); +var Wrap = __webpack_require__(4); + +/** + * 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 {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @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, interpolationPercentage, camera, parentMatrix) +{ + var context = renderer.currentContext; + + var plugin = src.plugin; + var skeleton = src.skeleton; + var skeletonRenderer = plugin.skeletonRenderer; + + var GameObjectRenderMask = 15; + + var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); + + if (!skeleton || !willRender) + { + return; + } + + var camMatrix = renderer._tempMatrix1; + var spriteMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + 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; + } + + // Add autoUpdate option + skeleton.updateWorldTransform(); + + skeletonRenderer.ctx = context; + skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug); + + context.save(); + + skeletonRenderer.draw(skeleton); + + context.restore(); +}; + +module.exports = SpineGameObjectCanvasRenderer; + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/plugins/spine/dist/SpineCanvasPlugin.min.js b/plugins/spine/dist/SpineCanvasPlugin.min.js new file mode 100644 index 000000000..4112ef1aa --- /dev/null +++ b/plugins/spine/dist/SpineCanvasPlugin.min.js @@ -0,0 +1 @@ +window.SpinePlugin=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=32)}([function(t,e){function n(t,e,n){var i=n?t[e]:Object.getOwnPropertyDescriptor(t,e);return!n&&i.value&&"object"==typeof i.value&&(i=i.value),!(!i||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(i))&&(void 0===i.enumerable&&(i.enumerable=!0),void 0===i.configurable&&(i.configurable=!0),i)}function i(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!!n&&(n.value&&"object"==typeof n.value&&(n=n.value),!1===n.configurable)}function r(t,e,r,s){for(var o in e)if(e.hasOwnProperty(o)){var h=n(e,o,r);if(!1!==h){if(i((s||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 s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var n=0;n0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=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 n=this.x,i=this.y;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this},transformMat3:function(t){var e=this.x,n=this.y,i=t.val;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},transformMat4:function(t){var e=this.x,n=this.y,i=t.val;return this.x=i[0]*e+i[4]*n+i[12],this.y=i[1]*e+i[5]*n+i[13],this},reset:function(){return this.x=0,this.y=0,this}});i.ZERO=new i,i.RIGHT=new i(1,0),i.LEFT=new i(-1,0),i.UP=new i(0,-1),i.DOWN=new i(0,1),i.ONE=new i(1,1),t.exports=i},function(t,e){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}},function(t,e,n){var i=n(1);t.exports=function(t){return t>Math.PI&&(t-=i.PI2),Math.abs(((t+i.TAU)%i.PI2-i.PI2)%i.PI2)}},function(t,e){t.exports=function(t,e,n){return Math.max(e,Math.min(n,t))}},function(t,e,n){var i=n(1);t.exports=function(t){return t*i.RAD_TO_DEG}},function(t,e,n){var i=new(n(0))({initialize:function(t,e,n){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=n||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},clone:function(){return new i(this.x,this.y,this.z)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*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,n){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=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||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,n=t.y-this.y,i=t.z-this.z||0;return Math.sqrt(e*e+n*n+i*i)},distanceSq:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0;return e*e+n*n+i*i},length:function(){var t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)},lengthSq:function(){var t=this.x,e=this.y,n=this.z;return t*t+e*e+n*n},normalize:function(){var t=this.x,e=this.y,n=this.z,i=t*t+e*e+n*n;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i,this.z=n*i),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z;return this.x=n*a-i*s,this.y=i*r-e*a,this.z=e*s-n*r,this},lerp:function(t,e){void 0===e&&(e=0);var n=this.x,i=this.y,r=this.z;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this.z=r+e*(t.z-r),this},transformMat3:function(t){var e=this.x,n=this.y,i=this.z,r=t.val;return this.x=e*r[0]+n*r[3]+i*r[6],this.y=e*r[1]+n*r[4]+i*r[7],this.z=e*r[2]+n*r[5]+i*r[8],this},transformMat4:function(t){var e=this.x,n=this.y,i=this.z,r=t.val;return this.x=r[0]*e+r[4]*n+r[8]*i+r[12],this.y=r[1]*e+r[5]*n+r[9]*i+r[13],this.z=r[2]*e+r[6]*n+r[10]*i+r[14],this},transformCoordinates:function(t){var e=this.x,n=this.y,i=this.z,r=t.val,s=e*r[0]+n*r[4]+i*r[8]+r[12],a=e*r[1]+n*r[5]+i*r[9]+r[13],o=e*r[2]+n*r[6]+i*r[10]+r[14],h=e*r[3]+n*r[7]+i*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,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*i-a*n,l=o*n+a*e-r*i,u=o*i+r*n-s*e,c=-r*e-s*n-a*i;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,n=this.y,i=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],f=r[7],p=r[8],d=r[9],v=r[10],m=r[11],g=r[12],y=r[13],x=r[14],w=1/(e*h+n*f+i*m+r[15]);return this.x=(e*s+n*l+i*p+g)*w,this.y=(e*a+n*u+i*d+y)*w,this.z=(e*o+n*c+i*v+x)*w,this},unproject:function(t,e){var n=t.x,i=t.y,r=t.z,s=t.w,a=this.x-n,o=s-this.y-1-i,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}});i.ZERO=new i,i.RIGHT=new i(1,0,0),i.LEFT=new i(-1,0,0),i.UP=new i(0,-1,0),i.DOWN=new i(0,1,0),i.FORWARD=new i(0,0,1),i.BACK=new i(0,0,-1),i.ONE=new i(1,1,1),t.exports=i},function(t,e){t.exports=function(t,e,n){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var i=e.split("."),r=t,s=n,a=0;a=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},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(){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.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,n=this.type;this.loader.emit(s.FILE_COMPLETE,e,n,t),this.loader.emit(s.FILE_KEY_COMPLETE+n+"-"+e,e,n,t),this.loader.flagForRemoval(this)},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,n){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var i=new FileReader;i.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||n)+";base64,"+i.result.split(",")[1]},i.onerror=t.onerror,i.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},function(t,e){var n={},i={install:function(t){for(var e in n)t[e]=n[e]},register:function(t,e){n[t]=e},destroy:function(){n={}}};t.exports=i},function(t,e,n){var i=n(2),r=function(){var t,e,n,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=0?t:t+2*Math.PI}},function(t,e,n){var i=n(4);t.exports=function(t){return i(t,-Math.PI,Math.PI)}},function(t,e,n){var i=n(4);t.exports=function(t){return i(t,-180,180)}},function(t,e,n){var i=n(20);t.exports=function(t,e){return i(t)/i(e)/i(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,n,i,r){var s=.5*(i-e),a=.5*(r-n),o=t*t;return(2*n-2*i+s+a)*(t*o)+(-3*n+3*i-2*s-a)*o+s*t+n}},function(t,e){t.exports=function(t,e,n){return(e-t)*n+t}},function(t,e){t.exports=function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,n){return(t=Math.max(0,Math.min(1,(t-e)/(n-e))))*t*t*(t*(6*t-15)+10)}},function(t,e,n){var i=n(1);t.exports=function(t){return t*i.DEG_TO_RAD}},function(t,e,n){var i=new(n(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new i(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,n=t.val;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},fromMat4:function(t){var e=t.val,n=this.val;return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[4],n[4]=e[5],n[5]=e[6],n[6]=e[8],n[7]=e[9],n[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],n=t[2],i=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=n,t[7]=i,this},invert:function(){var t=this.val,e=t[0],n=t[1],i=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,f=h*r-s*o,p=e*u+n*c+i*f;return p?(p=1/p,t[0]=u*p,t[1]=(-l*n+i*h)*p,t[2]=(a*n-i*s)*p,t[3]=c*p,t[4]=(l*e-i*o)*p,t[5]=(-a*e+i*r)*p,t[6]=f*p,t[7]=(-h*e+n*o)*p,t[8]=(s*e-n*r)*p,this):null},adjoint:function(){var t=this.val,e=t[0],n=t[1],i=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]=i*h-n*l,t[2]=n*a-i*s,t[3]=a*o-r*l,t[4]=e*l-i*o,t[5]=i*r-e*a,t[6]=r*h-s*o,t[7]=n*o-e*h,t[8]=e*s-n*r,this},determinant:function(){var t=this.val,e=t[0],n=t[1],i=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)+n*(-l*r+a*o)+i*(h*r-s*o)},multiply:function(t){var e=this.val,n=e[0],i=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,f=c[0],p=c[1],d=c[2],v=c[3],m=c[4],g=c[5],y=c[6],x=c[7],w=c[8];return e[0]=f*n+p*s+d*h,e[1]=f*i+p*a+d*l,e[2]=f*r+p*o+d*u,e[3]=v*n+m*s+g*h,e[4]=v*i+m*a+g*l,e[5]=v*r+m*o+g*u,e[6]=y*n+x*s+w*h,e[7]=y*i+x*a+w*l,e[8]=y*r+x*o+w*u,this},translate:function(t){var e=this.val,n=t.x,i=t.y;return e[6]=n*e[0]+i*e[3]+e[6],e[7]=n*e[1]+i*e[4]+e[7],e[8]=n*e[2]+i*e[5]+e[8],this},rotate:function(t){var e=this.val,n=e[0],i=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*n+h*s,e[1]=l*i+h*a,e[2]=l*r+h*o,e[3]=l*s-h*n,e[4]=l*a-h*i,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,n=t.x,i=t.y;return e[0]=n*e[0],e[1]=n*e[1],e[2]=n*e[2],e[3]=i*e[3],e[4]=i*e[4],e[5]=i*e[5],this},fromQuat:function(t){var e=t.x,n=t.y,i=t.z,r=t.w,s=e+e,a=n+n,o=i+i,h=e*s,l=e*a,u=e*o,c=n*a,f=n*o,p=i*o,d=r*s,v=r*a,m=r*o,g=this.val;return g[0]=1-(c+p),g[3]=l+m,g[6]=u-v,g[1]=l-m,g[4]=1-(h+p),g[7]=f+d,g[2]=u+v,g[5]=f-d,g[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,n=this.val,i=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],f=e[9],p=e[10],d=e[11],v=e[12],m=e[13],g=e[14],y=e[15],x=i*h-r*o,w=i*l-s*o,M=i*u-a*o,E=r*l-s*h,T=r*u-a*h,A=s*u-a*l,b=c*m-f*v,R=c*g-p*v,S=c*y-d*v,I=f*g-p*m,P=f*y-d*m,C=p*y-d*g,k=x*C-w*P+M*I+E*S-T*R+A*b;return k?(k=1/k,n[0]=(h*C-l*P+u*I)*k,n[1]=(l*S-o*C-u*R)*k,n[2]=(o*P-h*S+u*b)*k,n[3]=(s*P-r*C-a*I)*k,n[4]=(i*C-s*S+a*R)*k,n[5]=(r*S-i*P-a*b)*k,n[6]=(m*A-g*T+y*E)*k,n[7]=(g*M-v*A-y*w)*k,n[8]=(v*T-m*M+y*x)*k,this):null}});t.exports=i},function(t,e,n){var i=new(n(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new i(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,n=t.val;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,n){this.identity();var i=this.val;return i[12]=t,i[13]=e,i[14]=n,this},scaling:function(t,e,n){this.zero();var i=this.val;return i[0]=t,i[5]=e,i[10]=n,i[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],n=t[2],i=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]=n,t[9]=r,t[11]=t[14],t[12]=i,t[13]=s,t[14]=a,this},invert:function(){var t=this.val,e=t[0],n=t[1],i=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],f=t[11],p=t[12],d=t[13],v=t[14],m=t[15],g=e*a-n*s,y=e*o-i*s,x=e*h-r*s,w=n*o-i*a,M=n*h-r*a,E=i*h-r*o,T=l*d-u*p,A=l*v-c*p,b=l*m-f*p,R=u*v-c*d,S=u*m-f*d,I=c*m-f*v,P=g*I-y*S+x*R+w*b-M*A+E*T;return P?(P=1/P,t[0]=(a*I-o*S+h*R)*P,t[1]=(i*S-n*I-r*R)*P,t[2]=(d*E-v*M+m*w)*P,t[3]=(c*M-u*E-f*w)*P,t[4]=(o*b-s*I-h*A)*P,t[5]=(e*I-i*b+r*A)*P,t[6]=(v*x-p*E-m*y)*P,t[7]=(l*E-c*x+f*y)*P,t[8]=(s*S-a*b+h*T)*P,t[9]=(n*b-e*S-r*T)*P,t[10]=(p*M-d*x+m*g)*P,t[11]=(u*x-l*M-f*g)*P,t[12]=(a*A-s*R-o*T)*P,t[13]=(e*R-n*A+i*T)*P,t[14]=(d*y-p*w-v*g)*P,t[15]=(l*w-u*y+c*g)*P,this):null},adjoint:function(){var t=this.val,e=t[0],n=t[1],i=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],f=t[11],p=t[12],d=t[13],v=t[14],m=t[15];return t[0]=a*(c*m-f*v)-u*(o*m-h*v)+d*(o*f-h*c),t[1]=-(n*(c*m-f*v)-u*(i*m-r*v)+d*(i*f-r*c)),t[2]=n*(o*m-h*v)-a*(i*m-r*v)+d*(i*h-r*o),t[3]=-(n*(o*f-h*c)-a*(i*f-r*c)+u*(i*h-r*o)),t[4]=-(s*(c*m-f*v)-l*(o*m-h*v)+p*(o*f-h*c)),t[5]=e*(c*m-f*v)-l*(i*m-r*v)+p*(i*f-r*c),t[6]=-(e*(o*m-h*v)-s*(i*m-r*v)+p*(i*h-r*o)),t[7]=e*(o*f-h*c)-s*(i*f-r*c)+l*(i*h-r*o),t[8]=s*(u*m-f*d)-l*(a*m-h*d)+p*(a*f-h*u),t[9]=-(e*(u*m-f*d)-l*(n*m-r*d)+p*(n*f-r*u)),t[10]=e*(a*m-h*d)-s*(n*m-r*d)+p*(n*h-r*a),t[11]=-(e*(a*f-h*u)-s*(n*f-r*u)+l*(n*h-r*a)),t[12]=-(s*(u*v-c*d)-l*(a*v-o*d)+p*(a*c-o*u)),t[13]=e*(u*v-c*d)-l*(n*v-i*d)+p*(n*c-i*u),t[14]=-(e*(a*v-o*d)-s*(n*v-i*d)+p*(n*o-i*a)),t[15]=e*(a*c-o*u)-s*(n*c-i*u)+l*(n*o-i*a),this},determinant:function(){var t=this.val,e=t[0],n=t[1],i=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],f=t[11],p=t[12],d=t[13],v=t[14],m=t[15];return(e*a-n*s)*(c*m-f*v)-(e*o-i*s)*(u*m-f*d)+(e*h-r*s)*(u*v-c*d)+(n*o-i*a)*(l*m-f*p)-(n*h-r*a)*(l*v-c*p)+(i*h-r*o)*(l*d-u*p)},multiply:function(t){var e=this.val,n=e[0],i=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],f=e[10],p=e[11],d=e[12],v=e[13],m=e[14],g=e[15],y=t.val,x=y[0],w=y[1],M=y[2],E=y[3];return e[0]=x*n+w*a+M*u+E*d,e[1]=x*i+w*o+M*c+E*v,e[2]=x*r+w*h+M*f+E*m,e[3]=x*s+w*l+M*p+E*g,x=y[4],w=y[5],M=y[6],E=y[7],e[4]=x*n+w*a+M*u+E*d,e[5]=x*i+w*o+M*c+E*v,e[6]=x*r+w*h+M*f+E*m,e[7]=x*s+w*l+M*p+E*g,x=y[8],w=y[9],M=y[10],E=y[11],e[8]=x*n+w*a+M*u+E*d,e[9]=x*i+w*o+M*c+E*v,e[10]=x*r+w*h+M*f+E*m,e[11]=x*s+w*l+M*p+E*g,x=y[12],w=y[13],M=y[14],E=y[15],e[12]=x*n+w*a+M*u+E*d,e[13]=x*i+w*o+M*c+E*v,e[14]=x*r+w*h+M*f+E*m,e[15]=x*s+w*l+M*p+E*g,this},multiplyLocal:function(t){var e=[],n=this.val,i=t.val;return e[0]=n[0]*i[0]+n[1]*i[4]+n[2]*i[8]+n[3]*i[12],e[1]=n[0]*i[1]+n[1]*i[5]+n[2]*i[9]+n[3]*i[13],e[2]=n[0]*i[2]+n[1]*i[6]+n[2]*i[10]+n[3]*i[14],e[3]=n[0]*i[3]+n[1]*i[7]+n[2]*i[11]+n[3]*i[15],e[4]=n[4]*i[0]+n[5]*i[4]+n[6]*i[8]+n[7]*i[12],e[5]=n[4]*i[1]+n[5]*i[5]+n[6]*i[9]+n[7]*i[13],e[6]=n[4]*i[2]+n[5]*i[6]+n[6]*i[10]+n[7]*i[14],e[7]=n[4]*i[3]+n[5]*i[7]+n[6]*i[11]+n[7]*i[15],e[8]=n[8]*i[0]+n[9]*i[4]+n[10]*i[8]+n[11]*i[12],e[9]=n[8]*i[1]+n[9]*i[5]+n[10]*i[9]+n[11]*i[13],e[10]=n[8]*i[2]+n[9]*i[6]+n[10]*i[10]+n[11]*i[14],e[11]=n[8]*i[3]+n[9]*i[7]+n[10]*i[11]+n[11]*i[15],e[12]=n[12]*i[0]+n[13]*i[4]+n[14]*i[8]+n[15]*i[12],e[13]=n[12]*i[1]+n[13]*i[5]+n[14]*i[9]+n[15]*i[13],e[14]=n[12]*i[2]+n[13]*i[6]+n[14]*i[10]+n[15]*i[14],e[15]=n[12]*i[3]+n[13]*i[7]+n[14]*i[11]+n[15]*i[15],this.fromArray(e)},translate:function(t){var e=t.x,n=t.y,i=t.z,r=this.val;return r[12]=r[0]*e+r[4]*n+r[8]*i+r[12],r[13]=r[1]*e+r[5]*n+r[9]*i+r[13],r[14]=r[2]*e+r[6]*n+r[10]*i+r[14],r[15]=r[3]*e+r[7]*n+r[11]*i+r[15],this},translateXYZ:function(t,e,n){var i=this.val;return i[12]=i[0]*t+i[4]*e+i[8]*n+i[12],i[13]=i[1]*t+i[5]*e+i[9]*n+i[13],i[14]=i[2]*t+i[6]*e+i[10]*n+i[14],i[15]=i[3]*t+i[7]*e+i[11]*n+i[15],this},scale:function(t){var e=t.x,n=t.y,i=t.z,r=this.val;return r[0]=r[0]*e,r[1]=r[1]*e,r[2]=r[2]*e,r[3]=r[3]*e,r[4]=r[4]*n,r[5]=r[5]*n,r[6]=r[6]*n,r[7]=r[7]*n,r[8]=r[8]*i,r[9]=r[9]*i,r[10]=r[10]*i,r[11]=r[11]*i,this},scaleXYZ:function(t,e,n){var i=this.val;return i[0]=i[0]*t,i[1]=i[1]*t,i[2]=i[2]*t,i[3]=i[3]*t,i[4]=i[4]*e,i[5]=i[5]*e,i[6]=i[6]*e,i[7]=i[7]*e,i[8]=i[8]*n,i[9]=i[9]*n,i[10]=i[10]*n,i[11]=i[11]*n,this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,h=r*s,l=r*a;return this.fromArray([h*s+n,h*a-i*o,h*o+i*a,0,h*a+i*o,l*a+n,l*o-i*s,0,h*o-i*a,l*o+i*s,r*o*o+n,0,0,0,0,1]),this},rotate:function(t,e){var n=this.val,i=e.x,r=e.y,s=e.z,a=Math.sqrt(i*i+r*r+s*s);if(Math.abs(a)<1e-6)return null;i*=a=1/a,r*=a,s*=a;var o=Math.sin(t),h=Math.cos(t),l=1-h,u=n[0],c=n[1],f=n[2],p=n[3],d=n[4],v=n[5],m=n[6],g=n[7],y=n[8],x=n[9],w=n[10],M=n[11],E=i*i*l+h,T=r*i*l+s*o,A=s*i*l-r*o,b=i*r*l-s*o,R=r*r*l+h,S=s*r*l+i*o,I=i*s*l+r*o,P=r*s*l-i*o,C=s*s*l+h;return n[0]=u*E+d*T+y*A,n[1]=c*E+v*T+x*A,n[2]=f*E+m*T+w*A,n[3]=p*E+g*T+M*A,n[4]=u*b+d*R+y*S,n[5]=c*b+v*R+x*S,n[6]=f*b+m*R+w*S,n[7]=p*b+g*R+M*S,n[8]=u*I+d*P+y*C,n[9]=c*I+v*P+x*C,n[10]=f*I+m*P+w*C,n[11]=p*I+g*P+M*C,this},rotateX:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[4],s=e[5],a=e[6],o=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=r*i+h*n,e[5]=s*i+l*n,e[6]=a*i+u*n,e[7]=o*i+c*n,e[8]=h*i-r*n,e[9]=l*i-s*n,e[10]=u*i-a*n,e[11]=c*i-o*n,this},rotateY:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[0],s=e[1],a=e[2],o=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=r*i-h*n,e[1]=s*i-l*n,e[2]=a*i-u*n,e[3]=o*i-c*n,e[8]=r*n+h*i,e[9]=s*n+l*i,e[10]=a*n+u*i,e[11]=o*n+c*i,this},rotateZ:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[0],s=e[1],a=e[2],o=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=r*i+h*n,e[1]=s*i+l*n,e[2]=a*i+u*n,e[3]=o*i+c*n,e[4]=h*i-r*n,e[5]=l*i-s*n,e[6]=u*i-a*n,e[7]=c*i-o*n,this},fromRotationTranslation:function(t,e){var n=this.val,i=t.x,r=t.y,s=t.z,a=t.w,o=i+i,h=r+r,l=s+s,u=i*o,c=i*h,f=i*l,p=r*h,d=r*l,v=s*l,m=a*o,g=a*h,y=a*l;return n[0]=1-(p+v),n[1]=c+y,n[2]=f-g,n[3]=0,n[4]=c-y,n[5]=1-(u+v),n[6]=d+m,n[7]=0,n[8]=f+g,n[9]=d-m,n[10]=1-(u+p),n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this},fromQuat:function(t){var e=this.val,n=t.x,i=t.y,r=t.z,s=t.w,a=n+n,o=i+i,h=r+r,l=n*a,u=n*o,c=n*h,f=i*o,p=i*h,d=r*h,v=s*a,m=s*o,g=s*h;return e[0]=1-(f+d),e[1]=u+g,e[2]=c-m,e[3]=0,e[4]=u-g,e[5]=1-(l+d),e[6]=p+v,e[7]=0,e[8]=c+m,e[9]=p-v,e[10]=1-(l+f),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,n,i,r,s){var a=this.val,o=1/(e-t),h=1/(i-n),l=1/(r-s);return a[0]=2*r*o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*r*h,a[6]=0,a[7]=0,a[8]=(e+t)*o,a[9]=(i+n)*h,a[10]=(s+r)*l,a[11]=-1,a[12]=0,a[13]=0,a[14]=s*r*2*l,a[15]=0,this},perspective:function(t,e,n,i){var r=this.val,s=1/Math.tan(t/2),a=1/(n-i);return r[0]=s/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(i+n)*a,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*i*n*a,r[15]=0,this},perspectiveLH:function(t,e,n,i){var r=this.val;return r[0]=2*n/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2*n/e,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-i/(n-i),r[11]=1,r[12]=0,r[13]=0,r[14]=n*i/(n-i),r[15]=0,this},ortho:function(t,e,n,i,r,s){var a=this.val,o=t-e,h=n-i,l=r-s;return o=0===o?o:1/o,h=0===h?h:1/h,l=0===l?l:1/l,a[0]=-2*o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*l,a[11]=0,a[12]=(t+e)*o,a[13]=(i+n)*h,a[14]=(s+r)*l,a[15]=1,this},lookAt:function(t,e,n){var i=this.val,r=t.x,s=t.y,a=t.z,o=n.x,h=n.y,l=n.z,u=e.x,c=e.y,f=e.z;if(Math.abs(r-u)<1e-6&&Math.abs(s-c)<1e-6&&Math.abs(a-f)<1e-6)return this.identity();var p=r-u,d=s-c,v=a-f,m=1/Math.sqrt(p*p+d*d+v*v),g=h*(v*=m)-l*(d*=m),y=l*(p*=m)-o*v,x=o*d-h*p;(m=Math.sqrt(g*g+y*y+x*x))?(g*=m=1/m,y*=m,x*=m):(g=0,y=0,x=0);var w=d*x-v*y,M=v*g-p*x,E=p*y-d*g;return(m=Math.sqrt(w*w+M*M+E*E))?(w*=m=1/m,M*=m,E*=m):(w=0,M=0,E=0),i[0]=g,i[1]=w,i[2]=p,i[3]=0,i[4]=y,i[5]=M,i[6]=d,i[7]=0,i[8]=x,i[9]=E,i[10]=v,i[11]=0,i[12]=-(g*r+y*s+x*a),i[13]=-(w*r+M*s+E*a),i[14]=-(p*r+d*s+v*a),i[15]=1,this},yawPitchRoll:function(t,e,n){this.zero(),r.zero(),s.zero();var i=this.val,a=r.val,o=s.val,h=Math.sin(n),l=Math.cos(n);return i[10]=1,i[15]=1,i[0]=l,i[1]=h,i[4]=-h,i[5]=l,h=Math.sin(e),l=Math.cos(e),a[0]=1,a[15]=1,a[5]=l,a[10]=l,a[9]=-h,a[6]=h,h=Math.sin(t),l=Math.cos(t),o[5]=1,o[15]=1,o[0]=l,o[2]=-h,o[8]=h,o[10]=l,this.multiplyLocal(r),this.multiplyLocal(s),this},setWorldMatrix:function(t,e,n,i,a){return this.yawPitchRoll(t.y,t.x,t.z),r.scaling(n.x,n.y,n.z),s.xyz(e.x,e.y,e.z),this.multiplyLocal(r),this.multiplyLocal(s),void 0!==i&&this.multiplyLocal(i),void 0!==a&&this.multiplyLocal(a),this}}),r=new i,s=new i;t.exports=i},function(t,e,n){var i=n(0),r=n(10),s=n(26),a=new Int8Array([1,2,0]),o=new Float32Array([0,0,0]),h=new r(1,0,0),l=new r(0,1,0),u=new r,c=new s,f=new i({initialize:function(t,e,n,i){"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=n||0,this.w=i||0)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},set:function(t,e,n,i){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=n||0,this.w=i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,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,n=this.z,i=this.w;return Math.sqrt(t*t+e*e+n*n+i*i)},lengthSq:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return t*t+e*e+n*n+i*i},normalize:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=n*r,this.w=i*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 n=this.x,i=this.y,r=this.z,s=this.w;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},rotationTo:function(t,e){var n=t.x*e.x+t.y*e.y+t.z*e.z;return n<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):n>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+n,this.normalize())},setAxes:function(t,e,n){var i=c.val;return i[0]=e.x,i[3]=e.y,i[6]=e.z,i[1]=n.x,i[4]=n.y,i[7]=n.z,i[2]=-t.x,i[5]=-t.y,i[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var n=Math.sin(e);return this.x=n*t.x,this.y=n*t.y,this.z=n*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,s=t.x,a=t.y,o=t.z,h=t.w;return this.x=e*h+r*s+n*o-i*a,this.y=n*h+r*a+i*s-e*o,this.z=i*h+r*o+e*a-n*s,this.w=r*h-e*s-n*a-i*o,this},slerp:function(t,e){var n=this.x,i=this.y,r=this.z,s=this.w,a=t.x,o=t.y,h=t.z,l=t.w,u=n*a+i*o+r*h+s*l;u<0&&(u=-u,a=-a,o=-o,h=-h,l=-l);var c=1-e,f=e;if(1-u>1e-6){var p=Math.acos(u),d=Math.sin(p);c=Math.sin((1-e)*p)/d,f=Math.sin(e*p)/d}return this.x=c*n+f*a,this.y=c*i+f*o,this.z=c*r+f*h,this.w=c*s+f*l,this},invert:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i,s=r?1/r:0;return this.x=-t*s,this.y=-e*s,this.z=-n*s,this.w=i*s,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.x=e*a+r*s,this.y=n*a+i*s,this.z=i*a-n*s,this.w=r*a-e*s,this},rotateY:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.x=e*a-i*s,this.y=n*a+r*s,this.z=i*a+e*s,this.w=r*a-n*s,this},rotateZ:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.x=e*a+n*s,this.y=n*a-e*s,this.z=i*a+r*s,this.w=r*a-i*s,this},calculateW:function(){var t=this.x,e=this.y,n=this.z;return this.w=-Math.sqrt(1-t*t-e*e-n*n),this},fromMat3:function(t){var e,n=t.val,i=n[0]+n[4]+n[8];if(i>0)e=Math.sqrt(i+1),this.w=.5*e,e=.5/e,this.x=(n[7]-n[5])*e,this.y=(n[2]-n[6])*e,this.z=(n[3]-n[1])*e;else{var r=0;n[4]>n[0]&&(r=1),n[8]>n[3*r+r]&&(r=2);var s=a[r],h=a[s];e=Math.sqrt(n[3*r+r]-n[3*s+s]-n[3*h+h]+1),o[r]=.5*e,e=.5/e,o[s]=(n[3*s+r]+n[3*r+s])*e,o[h]=(n[3*h+r]+n[3*r+h])*e,this.x=o[0],this.y=o[1],this.z=o[2],this.w=(n[3*h+s]-n[3*s+h])*e}return this}});t.exports=f},function(t,e,n){var i=n(14),r=n(30);t.exports=function(t,e){var n=void 0===t?r():i({},t);if(e)for(var s in e)void 0!==e[s]&&(n[s]=e[s]);return n}},function(t,e){t.exports=function(t,e,n,i,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===n&&(n=""),void 0===i&&(i=""),void 0===r&&(r=0),{responseType:t,async:e,user:n,password:i,timeout:r,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e){t.exports=function(){}},function(t,e,n){var i=n(33),r=n(0),s=n(11),a=n(144),o=n(145),h=n(167),l=n(168),u=n(186),c=new r({Extends:o,initialize:function(t,e){o.call(this,t,e);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),e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",this.add.bind(this),this.make.bind(this))},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)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){this.sceneRenderer=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0);var t=function(t,e){if(t!==this.srcBlend||e!==this.dstBlend){var n=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),n.blendFunc(this.srcBlend,this.dstBlend))}};this.sceneRenderer.batcher.setBlendMode=t,this.sceneRenderer.shapes.setBlendMode=t,this.skeletonRenderer=this.sceneRenderer.skeletonRenderer,this.skeletonDebugRenderer=this.sceneRenderer.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 n,i=this.spineTextures;if(i.has(t))n=new h.TextureAtlas(e.data,function(){return i.get(t)});else{var r=this.textures;n=new h.TextureAtlas(e.data,function(e){var n=new h.canvas.CanvasTexture(r.get(e).getSourceImage());return i.add(t,n),n})}return n}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var n,i=this.spineTextures;if(i.has(t))n=new h.TextureAtlas(e.data,function(){return i.get(t)});else{var r=this.textures,s=this.sceneRenderer.context.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n=new h.TextureAtlas(e.data,function(e){var n=new h.webgl.GLTexture(s,r.get(e).getSourceImage(),!1);return i.add(t,n),n})}return n}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,n,i,r,s){var a;if(Array.isArray(t))for(var o=0;o=i.PI2-n?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=n:e=1?1:1/e*(1+(e*t|0))}},function(t,e,n){t.exports={Ceil:n(94),Equal:n(95),Floor:n(96),GreaterThan:n(97),LessThan:n(98)}},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,n){return void 0===n&&(n=1e-4),Math.abs(t-e)e-n}},function(t,e){t.exports=function(t,e,n){return void 0===n&&(n=1e-4),t1?t[n]-(i(r-n,t[n],t[n],t[n-1],t[n-1])-t[n]):i(r-s,t[s?s-1:0],t[s],t[n1?i(t[n],t[n-1],n-r):i(t[s],t[s+1>n?n:s+1],r-s)}},function(t,e){t.exports=function(t,e,n,i){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}},function(t,e,n){var i=n(23);t.exports=function(t,e,n){return e+(n-e)*i(t,0,1)}},function(t,e,n){var i=n(24);t.exports=function(t,e,n){return e+(n-e)*i(t,0,1)}},function(t,e,n){t.exports={GetNext:n(108),IsSize:n(109),IsValue:n(110)}},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,n){t.exports={Ceil:n(112),Floor:n(113),To:n(114)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.ceil(t/e),i?(n+t)/e:n+t)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.floor(t/e),i?(n+t)/e:n+t)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.round(t/e),i?(n+t)/e:n+t)}},function(t,e,n){var i=new(n(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,n=this.n;t=t.toString();for(var i=0;i>>0,n=(e*=n)>>>0,n+=4294967296*(e-=n);return this.n=n,2.3283064365386963e-10*(n>>>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 n=Math.floor(this.frac()*(e+1)),i=t[n];t[n]=t[e],t[e]=i}return t}});t.exports=i},function(t,e){t.exports=function(t){for(var e=0,n=0;n1?void 0!==i?(r=(i-t)/(i-n))<0&&(r=0):r=1:r<0&&(r=0),r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var n=2*Math.random()*Math.PI;return t.x=Math.cos(n)*e,t.y=Math.sin(n)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var n=2*Math.random()*Math.PI,i=2*Math.random()-1,r=Math.sqrt(1-i*i)*e;return t.x=Math.cos(n)*r,t.y=Math.sin(n)*r,t.z=i*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 n=t.x,i=t.y;return t.x=n*Math.cos(e)-i*Math.sin(e),t.y=n*Math.sin(e)+i*Math.cos(e),t}},function(t,e){t.exports=function(t,e,n,i){var r=Math.cos(i),s=Math.sin(i),a=t.x-e,o=t.y-n;return t.x=a*r-o*s+e,t.y=a*s+o*r+n,t}},function(t,e){t.exports=function(t,e,n,i,r){var s=i+Math.atan2(t.y-n,t.x-e);return t.x=e+r*Math.cos(s),t.y=n+r*Math.sin(s),t}},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=10);var i=Math.pow(n,-e);return Math.round(t*i)/i}},function(t,e){t.exports=function(t,e,n,i){void 0===e&&(e=1),void 0===n&&(n=1),void 0===i&&(i=1),i*=Math.PI/t;for(var r=[],s=[],a=0;a0&&t<=e*n&&(s=t>e-1?t-(a=Math.floor(t/e))*e:t,r.set(s,a)),r}},function(t,e,n){var i=n(5);t.exports=function(t,e,n,r,s,a,o,h){void 0===h&&(h=new i);var l=Math.sin(s),u=Math.cos(s),c=u*a,f=l*a,p=-l*o,d=u*o,v=1/(c*d+p*-f);return h.x=d*v*t+-p*v*e+(r*p-n*d)*v,h.y=c*v*e+-f*v*t+(-r*c+n*f)*v,h}},function(t,e){t.exports=function(t,e,n){return Math.abs(t-e)<=n}},function(t,e,n){var i=new(n(0))({initialize:function(t,e,n,i){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=n||0,this.w=i||0)},clone:function(){return new i(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,n,i){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=n||0,this.w=i||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,n=this.z,i=this.w;return Math.sqrt(t*t+e*e+n*n+i*i)},lengthSq:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return t*t+e*e+n*n+i*i},normalize:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=n*r,this.w=i*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 n=this.x,i=this.y,r=this.z,s=this.w;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),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,n=t.y-this.y,i=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+n*n+i*i+r*r)},distanceSq:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0,r=t.w-this.w||0;return e*e+n*n+i*i+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,n=this.y,i=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this},transformQuat:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*i-a*n,l=o*n+a*e-r*i,u=o*i+r*n-s*e,c=-r*e-s*n-a*i;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}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.distSq=i.prototype.distanceSq,i.prototype.len=i.prototype.length,i.prototype.lenSq=i.prototype.lengthSq,t.exports=i},function(t,e,n){var i=n(10),r=n(27),s=n(28),a=new r,o=new s,h=new i;t.exports=function(t,e,n){return o.setAxisAngle(e,n),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e){t.exports="resize"},function(t,e,n){var i=n(146),r=n(0),s=n(147),a=new r({Extends:i,initialize:function(t,e){i.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){}});t.exports=a},function(t,e,n){var i=new(n(0))({initialize:function(t){this.pluginManager=t,this.game=t.game,this.scene,this.systems},init:function(){},start:function(){},stop:function(){},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=i},function(t,e,n){t.exports={BOOT:n(148),CREATE:n(149),DESTROY:n(150),PAUSE:n(151),POST_UPDATE:n(152),PRE_UPDATE:n(153),READY:n(154),RENDER:n(155),RESUME:n(156),SHUTDOWN:n(157),SLEEP:n(158),START:n(159),TRANSITION_COMPLETE:n(160),TRANSITION_INIT:n(161),TRANSITION_OUT:n(162),TRANSITION_START:n(163),TRANSITION_WAKE:n(164),UPDATE:n(165),WAKE:n(166)}},function(t,e){t.exports="boot"},function(t,e){t.exports="create"},function(t,e){t.exports="destroy"},function(t,e){t.exports="pause"},function(t,e){t.exports="postupdate"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="ready"},function(t,e){t.exports="render"},function(t,e){t.exports="resume"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="sleep"},function(t,e){t.exports="start"},function(t,e){t.exports="transitioncomplete"},function(t,e){t.exports="transitioninit"},function(t,e){t.exports="transitionout"},function(t,e){t.exports="transitionstart"},function(t,e){t.exports="transitionwake"},function(t,e){t.exports="update"},function(t,e){t.exports="wake"},function(t,e){(function(){var e,n,i,r=this&&this.__extends||(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)});!function(t){var e,n,i,s=function(){function t(t,e,n){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.duration=n}return t.prototype.apply=function(t,e,n,i,r,s,a,o){if(null==t)throw new Error("skeleton cannot be null.");i&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(s+1)*n]<=e?i=s+1:r=s,i==r)return(i+1)*n;s=i+r>>>1}},t.linearSearch=function(t,e,n){for(var i=0,r=t.length-n;i<=r;i+=n)if(t[i]>e)return i;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.in=0]="in",t[t.out=1]="out"}(n=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"}(i=t.TimelineType||(t.TimelineType={}));var a=function(){function e(n){if(n<=0)throw new Error("frameCount must be > 0: "+n);this.curves=t.Utils.newFloatArray((n-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 n=t*e.BEZIER_SIZE;if(n==this.curves.length)return e.LINEAR;var i=this.curves[n];return i==e.LINEAR?e.LINEAR:i==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,i,r,s){var a=.03*(2*-n+r),o=.03*(2*-i+s),h=.006*(3*(n-r)+1),l=.006*(3*(i-s)+1),u=2*a+h,c=2*o+l,f=.3*n+a+.16666667*h,p=.3*i+o+.16666667*l,d=t*e.BEZIER_SIZE,v=this.curves;v[d++]=e.BEZIER;for(var m=f,g=p,y=d+e.BEZIER_SIZE-1;d=i){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)*(i-u)/(o-u)}var f=r[s-1];return f+(1-f)*(i-o)/(1-o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var o=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e<<1),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=n},a.prototype.apply=function(t,n,i,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(i=u[u.length-a.ENTRIES]){var p=u[u.length+a.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+p*o;break;case e.first:case e.replace:p+=c.data.rotation-c.rotation,p-=360*(16384-(16384.499999999996-p/360|0));case e.add:c.rotation+=p*o}}else{var d=s.binarySearch(u,i,a.ENTRIES),v=u[d+a.PREV_ROTATION],m=u[d],g=this.getCurvePercent((d>>1)-1,1-(i-m)/(u[d+a.PREV_TIME]-m)),y=u[d+a.ROTATION]-v;switch(y=v+(y-360*(16384-(16384.499999999996-y/360|0)))*g,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(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n,i){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=n,this.frames[t+a.Y]=i},a.prototype.apply=function(t,n,i,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(i=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_X],p=u[u.length+a.PREV_Y];else{var d=s.binarySearch(u,i,a.ENTRIES);f=u[d+a.PREV_X],p=u[d+a.PREV_Y];var v=u[d],m=this.getCurvePercent(d/a.ENTRIES-1,1-(i-v)/(u[d+a.PREV_TIME]-v));f+=(u[d+a.X]-f)*m,p+=(u[d+a.Y]-p)*m}switch(h){case e.setup:c.x=c.data.x+f*o,c.y=c.data.y+p*o;break;case e.first:case e.replace:c.x+=(c.data.x+f-c.x)*o,c.y+=(c.data.y+p-c.y)*o;break;case e.add:c.x+=f*o,c.y+=p*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(i.scale<<24)+this.boneIndex},o.prototype.apply=function(i,r,a,h,l,u,c){var f=this.frames,p=i.bones[this.boneIndex];if(a=f[f.length-o.ENTRIES])d=f[f.length+o.PREV_X]*p.data.scaleX,v=f[f.length+o.PREV_Y]*p.data.scaleY;else{var m=s.binarySearch(f,a,o.ENTRIES);d=f[m+o.PREV_X],v=f[m+o.PREV_Y];var g=f[m],y=this.getCurvePercent(m/o.ENTRIES-1,1-(a-g)/(f[m+o.PREV_TIME]-g));d=(d+(f[m+o.X]-d)*y)*p.data.scaleX,v=(v+(f[m+o.Y]-v)*y)*p.data.scaleY}if(1==l)u==e.add?(p.scaleX+=d-p.data.scaleX,p.scaleY+=v-p.data.scaleY):(p.scaleX=d,p.scaleY=v);else{var x=0,w=0;if(c==n.out)switch(u){case e.setup:x=p.data.scaleX,w=p.data.scaleY,p.scaleX=x+(Math.abs(d)*t.MathUtils.signum(x)-x)*l,p.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-w)*l;break;case e.first:case e.replace:x=p.scaleX,w=p.scaleY,p.scaleX=x+(Math.abs(d)*t.MathUtils.signum(x)-x)*l,p.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-w)*l;break;case e.add:x=p.scaleX,w=p.scaleY,p.scaleX=x+(Math.abs(d)*t.MathUtils.signum(x)-p.data.scaleX)*l,p.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-p.data.scaleY)*l}else switch(u){case e.setup:x=Math.abs(p.data.scaleX)*t.MathUtils.signum(d),w=Math.abs(p.data.scaleY)*t.MathUtils.signum(v),p.scaleX=x+(d-x)*l,p.scaleY=w+(v-w)*l;break;case e.first:case e.replace:x=Math.abs(p.scaleX)*t.MathUtils.signum(d),w=Math.abs(p.scaleY)*t.MathUtils.signum(v),p.scaleX=x+(d-x)*l,p.scaleY=w+(v-w)*l;break;case e.add:x=t.MathUtils.signum(d),w=t.MathUtils.signum(v),p.scaleX=Math.abs(p.scaleX)*x+(d-Math.abs(p.data.scaleX)*x)*l,p.scaleY=Math.abs(p.scaleY)*w+(v-Math.abs(p.data.scaleY)*w)*l}}}},o}(h);t.ScaleTimeline=l;var u=function(t){function n(e){return t.call(this,e)||this}return r(n,t),n.prototype.getPropertyId=function(){return(i.shear<<24)+this.boneIndex},n.prototype.apply=function(t,i,r,a,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(r=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_X],p=u[u.length+n.PREV_Y];else{var d=s.binarySearch(u,r,n.ENTRIES);f=u[d+n.PREV_X],p=u[d+n.PREV_Y];var v=u[d],m=this.getCurvePercent(d/n.ENTRIES-1,1-(r-v)/(u[d+n.PREV_TIME]-v));f+=(u[d+n.X]-f)*m,p+=(u[d+n.Y]-p)*m}switch(h){case e.setup:c.shearX=c.data.shearX+f*o,c.shearY=c.data.shearY+p*o;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+f-c.shearX)*o,c.shearY+=(c.data.shearY+p-c.shearY)*o;break;case e.add:c.shearX+=f*o,c.shearY+=p*o}}},n}(h);t.ShearTimeline=u;var c=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,i,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=i,this.frames[t+a.B]=r,this.frames[t+a.A]=s},a.prototype.apply=function(t,n,i,r,o,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(i=c[c.length-a.ENTRIES]){var y=c.length;d=c[y+a.PREV_R],v=c[y+a.PREV_G],m=c[y+a.PREV_B],g=c[y+a.PREV_A]}else{var x=s.binarySearch(c,i,a.ENTRIES);d=c[x+a.PREV_R],v=c[x+a.PREV_G],m=c[x+a.PREV_B],g=c[x+a.PREV_A];var w=c[x],M=this.getCurvePercent(x/a.ENTRIES-1,1-(i-w)/(c[x+a.PREV_TIME]-w));d+=(c[x+a.R]-d)*M,v+=(c[x+a.G]-v)*M,m+=(c[x+a.B]-m)*M,g+=(c[x+a.A]-g)*M}if(1==o)u.color.set(d,v,m,g);else{f=u.color;h==e.setup&&f.setFromColor(u.data.color),f.add((d-f.r)*o,(v-f.g)*o,(m-f.b)*o,(g-f.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 f=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,i,r,s,o,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=i,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,n,i,r,o,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(i=c[c.length-a.ENTRIES]){var T=c.length;m=c[T+a.PREV_R],g=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,i,a.ENTRIES);m=c[A+a.PREV_R],g=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],R=this.getCurvePercent(A/a.ENTRIES-1,1-(i-b)/(c[A+a.PREV_TIME]-b));m+=(c[A+a.R]-m)*R,g+=(c[A+a.G]-g)*R,y+=(c[A+a.B]-y)*R,x+=(c[A+a.A]-x)*R,w+=(c[A+a.R2]-w)*R,M+=(c[A+a.G2]-M)*R,E+=(c[A+a.B2]-E)*R}if(1==o)u.color.set(m,g,y,x),u.darkColor.set(w,M,E,1);else{f=u.color,p=u.darkColor;h==e.setup&&(f.setFromColor(u.data.color),p.setFromColor(u.data.darkColor)),f.add((m-f.r)*o,(g-f.g)*o,(y-f.b)*o,(x-f.a)*o),p.add((w-p.r)*o,(M-p.g)*o,(E-p.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=f;var p=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return r.prototype.getPropertyId=function(){return(i.attachment<<24)+this.slotIndex},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},r.prototype.apply=function(t,i,r,a,o,h,l){var u=t.slots[this.slotIndex];if(l!=n.out||h!=e.setup){var c=this.frames;if(r=c[c.length-1]?c.length-1:s.binarySearch(c,r,1)-1;var d=this.attachmentNames[p];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else{var v=u.data.attachmentName;u.setAttachment(null==v?null:t.getAttachment(this.slotIndex,v))}},r}();t.AttachmentTimeline=p;var d=null,v=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e),i.frameVertices=new Array(e),null==d&&(d=t.Utils.newFloatArray(64)),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},a.prototype.apply=function(n,i,r,a,o,h,l){var u=n.slots[this.slotIndex],c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.applyDeform(this.attachment)){var f=u.attachmentVertices;0==f.length&&(h=e.setup);var p=this.frameVertices,d=p[0].length,v=this.frames;if(r=v[v.length-1]){var M=p[v.length-1];if(1==o)if(h==e.add)if(null==(m=c).bones){y=m.vertices;for(var E=0;En)this.apply(t,e,Number.MAX_VALUE,i,r,a,o),e=-1;else if(e>=h[l-1])return;if(!(n0&&h[u-1]==c;)u--;for(;u=h[u];u++)i.push(this.events[u])}}},e}();t.EventTimeline=m;var g=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return r.prototype.getPropertyId=function(){return i.drawOrder<<24},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},r.prototype.apply=function(i,r,a,o,h,l,u){var c=i.drawOrder,f=i.slots;if(u!=n.out||l!=e.setup){var p=this.frames;if(a=p[p.length-1]?p.length-1:s.binarySearch(p,a)-1;var v=this.drawOrders[d];if(null==v)t.Utils.arrayCopy(f,0,c,0,f.length);else for(var m=0,g=v.length;m=c[c.length-o.ENTRIES])l==e.setup?(f.mix=f.data.mix+(c[c.length+o.PREV_MIX]-f.data.mix)*h,u==n.out?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+o.PREV_COMPRESS],f.stretch=0!=c[c.length+o.PREV_STRETCH])):(f.mix+=(c[c.length+o.PREV_MIX]-f.mix)*h,u==n.in&&(f.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+o.PREV_COMPRESS],f.stretch=0!=c[c.length+o.PREV_STRETCH]));else{var p=s.binarySearch(c,r,o.ENTRIES),d=c[p+o.PREV_MIX],v=c[p],m=this.getCurvePercent(p/o.ENTRIES-1,1-(r-v)/(c[p+o.PREV_TIME]-v));l==e.setup?(f.mix=f.data.mix+(d+(c[p+o.MIX]-d)*m-f.data.mix)*h,u==n.out?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[p+o.PREV_BEND_DIRECTION],f.compress=0!=c[p+o.PREV_COMPRESS],f.stretch=0!=c[p+o.PREV_STRETCH])):(f.mix+=(d+(c[p+o.MIX]-d)*m-f.mix)*h,u==n.in&&(f.bendDirection=c[p+o.PREV_BEND_DIRECTION],f.compress=0!=c[p+o.PREV_COMPRESS],f.stretch=0!=c[p+o.PREV_STRETCH]))}},o.ENTRIES=5,o.PREV_TIME=-5,o.PREV_MIX=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.BEND_DIRECTION=2,o.COMPRESS=3,o.STRETCH=4,o}(a);t.IkConstraintTimeline=y;var x=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,n,i,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=i,this.frames[t+a.SCALE]=r,this.frames[t+a.SHEAR]=s},a.prototype.apply=function(t,n,i,r,o,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(i=u[u.length-a.ENTRIES]){var g=u.length;p=u[g+a.PREV_ROTATE],d=u[g+a.PREV_TRANSLATE],v=u[g+a.PREV_SCALE],m=u[g+a.PREV_SHEAR]}else{var y=s.binarySearch(u,i,a.ENTRIES);p=u[y+a.PREV_ROTATE],d=u[y+a.PREV_TRANSLATE],v=u[y+a.PREV_SCALE],m=u[y+a.PREV_SHEAR];var x=u[y],w=this.getCurvePercent(y/a.ENTRIES-1,1-(i-x)/(u[y+a.PREV_TIME]-x));p+=(u[y+a.ROTATE]-p)*w,d+=(u[y+a.TRANSLATE]-d)*w,v+=(u[y+a.SCALE]-v)*w,m+=(u[y+a.SHEAR]-m)*w}if(h==e.setup){f=c.data;c.rotateMix=f.rotateMix+(p-f.rotateMix)*o,c.translateMix=f.translateMix+(d-f.translateMix)*o,c.scaleMix=f.scaleMix+(v-f.scaleMix)*o,c.shearMix=f.shearMix+(m-f.shearMix)*o}else c.rotateMix+=(p-c.rotateMix)*o,c.translateMix+=(d-c.translateMix)*o,c.scaleMix+=(v-c.scaleMix)*o,c.shearMix+=(m-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(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=n},a.prototype.apply=function(t,n,i,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(i=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_VALUE];else{var p=s.binarySearch(u,i,a.ENTRIES);f=u[p+a.PREV_VALUE];var d=u[p],v=this.getCurvePercent(p/a.ENTRIES-1,1-(i-d)/(u[p+a.PREV_TIME]-d));f+=(u[p+a.VALUE]-f)*v}h==e.setup?c.position=c.data.position+(f-c.data.position)*o:c.position+=(f-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 n(e){return t.call(this,e)||this}return r(n,t),n.prototype.getPropertyId=function(){return(i.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,i,r,a,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_VALUE];else{var p=s.binarySearch(u,r,n.ENTRIES);f=u[p+n.PREV_VALUE];var d=u[p],v=this.getCurvePercent(p/n.ENTRIES-1,1-(r-d)/(u[p+n.PREV_TIME]-d));f+=(u[p+n.VALUE]-f)*v}h==e.setup?c.spacing=c.data.spacing+(f-c.data.spacing)*o:c.spacing+=(f-c.spacing)*o}},n}(w);t.PathConstraintSpacingTimeline=M;var E=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n,i){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=i},a.prototype.apply=function(t,n,i,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(i=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_ROTATE],p=u[u.length+a.PREV_TRANSLATE];else{var d=s.binarySearch(u,i,a.ENTRIES);f=u[d+a.PREV_ROTATE],p=u[d+a.PREV_TRANSLATE];var v=u[d],m=this.getCurvePercent(d/a.ENTRIES-1,1-(i-v)/(u[d+a.PREV_TIME]-v));f+=(u[d+a.ROTATE]-f)*m,p+=(u[d+a.TRANSLATE]-p)*m}h==e.setup?(c.rotateMix=c.data.rotateMix+(f-c.data.rotateMix)*o,c.translateMix=c.data.translateMix+(p-c.data.translateMix)*o):(c.rotateMix+=(f-c.rotateMix)*o,c.translateMix+=(p-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}(i||(i={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new t.Pool(function(){return new n}),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,i=e.length;n0){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(n,a,!0);null!=a.mixingFrom;)a.mixTime+=t,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[n]=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 n=t.mixingFrom;if(null==n)return!0;var i=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),i):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var i=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,n,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,f=h.getAnimationTime(),p=h.animation.timelines.length,d=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.applyRotateTimeline=function(e,n,i,r,s,a,o,h){if(h&&(a[o]=0),1!=r){var l=e,u=l.frames,c=n.bones[l.boneIndex],f=0,p=0;if(i=u[u.length-t.RotateTimeline.ENTRIES])p=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var d=t.Animation.binarySearch(u,i,t.RotateTimeline.ENTRIES),v=u[d+t.RotateTimeline.PREV_ROTATION],m=u[d],g=l.getCurvePercent((d>>1)-1,1-(i-m)/(u[d+t.RotateTimeline.PREV_TIME]-m));p=u[d+t.RotateTimeline.ROTATION]-v,p=v+(p-=360*(16384-(16384.499999999996-p/360|0)))*g+c.data.rotation,p-=360*(16384-(16384.499999999996-p/360|0))}var y=0,x=p-f;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,f+=y*r,c.rotation=f-360*(16384-(16384.499999999996-f/360|0))}else e.apply(n,0,i,null,1,s,t.MixDirection.in)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,i=t.animationEnd,r=i-n,s=t.trackLast%r,a=this.events,o=0,h=a.length;oi||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:e>=i&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var i=n.mixingFrom;if(null==i)break;this.queue.end(i),n.mixingFrom=null,n.mixingTo=null,n=i}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var i=this.expandToIndex(t);this.tracks[t]=e,null!=i&&(n&&this.queue.interrupt(i),e.mixingFrom=i,i.mixingTo=e,e.mixTime=0,null!=i.mixingFrom&&i.mixDuration>0&&(e.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var i=this.data.skeletonData.findAnimation(e);if(null==i)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,i,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var i=!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,i=!1):this.disposeNext(r));var s=this.trackEntry(t,e,n,r);return this.setCurrent(t,s,i),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,n,i){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,n,i)},e.prototype.addAnimationWith=function(t,e,n,i){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,n,r);if(null==r)this.setCurrent(t,s,!0),this.queue.drain();else if(r.next=s,i<=0){var a=r.animationEnd-r.animationStart;0!=a?(r.loop?i+=a*(1+(r.trackTime/a|0)):i+=Math.max(a,r.trackTime),i-=this.data.getMix(r.animation,e)):i=r.trackTime}return s.delay=i,s},e.prototype.setEmptyAnimation=function(t,n){var i=this.setAnimationWith(t,e.emptyAnimation,!1);return i.mixDuration=n,i.trackEnd=n,i},e.prototype.addEmptyAnimation=function(t,n,i){i<=0&&(i-=n);var r=this.addAnimationWith(t,e.emptyAnimation,!1,i);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,i=this.tracks.length;n0){a[l]=e.HOLD_MIX,o[l]=c;continue t}break}a[l]=e.HOLD}else a[l]=e.FIRST;else a[l]=e.SUBSEQUENT}},e.prototype.hasTimeline=function(t,e){for(var n=t.animation.timelines,i=0,r=n.length;i=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=2,e.HOLD_MIX=3,e}();t.AnimationState=e;var n=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=n;var i,r=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(i.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(i.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(i.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(i.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(i.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(i.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,n=0;n=0?n.substring(0,n.lastIndexOf("/")):"";n=this.pathPrefix+n,this.toLoad++,e.downloadText(n,function(e){var o={count:0},h=new Array;try{new t.TextureAtlas(e,function(e){h.push(a+"/"+e);var n=document.createElement("img");return n.width=16,n.height=16,new t.FakeTexture(n)})}catch(t){var l=t;return s.errors[n]="Couldn't load texture atlas "+n+": "+l.message,r&&r(n,"Couldn't load texture atlas "+n+": "+l.message),s.toLoad--,void s.loaded++}for(var u=function(l){var u=!1;s.loadTexture(l,function(l,c){if(o.count++,o.count==h.length)if(u)s.errors[n]="Couldn't load texture atlas page "+l+"} of atlas "+n,r&&r(n,"Couldn't load texture atlas page "+l+" of atlas "+n),s.toLoad--,s.loaded++;else try{var f=new t.TextureAtlas(e,function(t){return s.get(a+"/"+t)});s.assets[n]=f,i&&i(n,f),s.toLoad--,s.loaded++}catch(t){var p=t;s.errors[n]="Couldn't load texture atlas "+n+": "+p.message,r&&r(n,"Couldn't load texture atlas "+n+": "+p.message),s.toLoad--,s.loaded++}},function(t,e){u=!0,o.count++,o.count==h.length&&(s.errors[n]="Couldn't load texture atlas page "+t+"} of atlas "+n,r&&r(n,"Couldn't load texture atlas page "+t+" of atlas "+n),s.toLoad--,s.loaded++)})},c=0,f=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(i||(i={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,n,i){var r=this.atlas.findRegion(i);if(null==r)throw new Error("Region not found in atlas: "+i+" (region attachment: "+n+")");r.renderObject=r;var s=new t.RegionAttachment(n);return s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,n,i){var r=this.atlas.findRegion(i);if(null==r)throw new Error("Region not found in atlas: "+i+" (mesh attachment: "+n+")");r.renderObject=r;var s=new t.MeshAttachment(n);return s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,n){return new t.BoundingBoxAttachment(n)},e.prototype.newPathAttachment=function(e,n){return new t.PathAttachment(n)},e.prototype.newPointAttachment=function(e,n){return new t.PointAttachment(n)},e.prototype.newClippingAttachment=function(e,n){return new t.ClippingAttachment(n)},e}();t.AtlasAttachmentLoader=e}(i||(i={})),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={}))}(i||(i={})),function(t){var e=function(){function e(t,e,n){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.worldX=0,this.c=0,this.d=0,this.worldY=0,this.sorted=!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=n,this.setToSetupPose()}return 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,n,i,r,s,a,o){this.ax=e,this.ay=n,this.arotation=i,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=i+90+o,c=l.scaleX,f=l.scaleY;return this.a=t.MathUtils.cosDeg(i+a)*r*c,this.b=t.MathUtils.cosDeg(u)*s*c,this.c=t.MathUtils.sinDeg(i+a)*r*f,this.d=t.MathUtils.sinDeg(u)*s*f,this.worldX=e*c+l.x,void(this.worldY=n*f+l.y)}var p=h.a,d=h.b,v=h.c,m=h.d;switch(this.worldX=p*e+d*n+h.worldX,this.worldY=v*e+m*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=i+90+o;var g=t.MathUtils.cosDeg(i+a)*r,y=t.MathUtils.cosDeg(u)*s,x=t.MathUtils.sinDeg(i+a)*r,w=t.MathUtils.sinDeg(u)*s;return this.a=p*g+d*x,this.b=p*y+d*w,this.c=v*g+m*x,void(this.d=v*y+m*w);case t.TransformMode.OnlyTranslation:u=i+90+o;this.a=t.MathUtils.cosDeg(i+a)*r,this.b=t.MathUtils.cosDeg(u)*s,this.c=t.MathUtils.sinDeg(i+a)*r,this.d=t.MathUtils.sinDeg(u)*s;break;case t.TransformMode.NoRotationOrReflection:var M=0;(A=p*p+v*v)>1e-4?(d=v*(A=Math.abs(p*m-d*v)/A),m=p*A,M=Math.atan2(v,p)*t.MathUtils.radDeg):(p=0,v=0,M=90-Math.atan2(m,d)*t.MathUtils.radDeg);var E=i+a-M,T=i+o-M+90;g=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=p*g-d*x,this.b=p*y-d*w,this.c=v*g+m*x,this.d=v*y+m*w;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var A,b=t.MathUtils.cosDeg(i),R=t.MathUtils.sinDeg(i),S=(p*b+d*R)/this.skeleton.scaleX,I=(v*b+m*R)/this.skeleton.scaleY;(A=Math.sqrt(S*S+I*I))>1e-5&&(A=1/A),S*=A,I*=A,A=Math.sqrt(S*S+I*I),this.data.transformMode==t.TransformMode.NoScale&&p*m-d*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(A=-A);var P=Math.PI/2+Math.atan2(I,S),C=Math.cos(P)*A,k=Math.sin(P)*A;g=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=S*g+C*x,this.b=S*y+C*w,this.c=I*g+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 n=e.a,i=e.b,r=e.c,s=e.d,a=1/(n*s-i*r),o=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=o*s*a-h*i*a,this.ay=h*n*a-o*r*a;var l=a*s,u=a*n,c=a*i,f=a*r,p=l*this.a-c*this.c,d=l*this.b-c*this.d,v=u*this.c-f*this.a,m=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(p*p+v*v),this.ascaleX>1e-4){var g=p*m-d*v;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(p*d+v*m,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(v,p)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,d)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,i=this.c,r=this.d,s=1/(e*r-n*i),a=t.x-this.worldX,o=t.y-this.worldY;return t.x=a*r*s-o*n*s,t.y=o*e*s-a*i*s,t},e.prototype.localToWorld=function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var n=t.MathUtils.sinDeg(e),i=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*i,this.d*i-this.b*n)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var n=t.MathUtils.sinDeg(e),i=t.MathUtils.cosDeg(e);return Math.atan2(i*this.c+n*this.d,i*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,i=this.b,r=this.c,s=this.d,a=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e);this.a=a*n-o*r,this.b=a*i-o*s,this.c=o*n+a*r,this.d=o*i+a*s,this.appliedValid=!1},e}();t.Bone=e}(i||(i={})),function(t){var e,n=function(){return function(t,n,i){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,t<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=t,this.name=n,this.parent=i}}();t.BoneData=n,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={}))}(i||(i={})),function(t){var e=function(){return function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e}}();t.Event=e}(i||(i={})),function(t){var e=function(){return function(t){this.name=t}}();t.EventData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=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.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var n=0;n180?d-=360:d<-180&&(d+=360);var v=e.ascaleX,m=e.ascaleY;if(r||s){var g=e.data.length*v,y=Math.sqrt(f*f+p*p);if(r&&yg&&g>1e-4){var x=(y/g-1)*o+1;v*=x,a&&(m*=x)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+d*o,v,m,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,i,r,s,a,o){if(0!=o){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var h=e.ax,l=e.ay,u=e.ascaleX,c=u,f=e.ascaleY,p=n.ascaleX,d=0,v=0,m=0;u<0?(u=-u,d=180,m=-1):(d=0,m=1),f<0&&(f=-f,m=-m),p<0?(p=-p,v=180):v=0;var g=n.ax,y=0,x=0,w=0,M=e.a,E=e.b,T=e.c,A=e.d,b=Math.abs(u-f)<=1e-4;b?(x=M*g+E*(y=n.ay)+e.worldX,w=T*g+A*y+e.worldY):(y=0,x=M*g+e.worldX,w=T*g+e.worldY);var R=e.parent;M=R.a,E=R.b,T=R.c;var S=1/(M*(A=R.d)-E*T),I=i-R.worldX,P=r-R.worldY,C=(I*A-P*E)*S-h,k=(P*M-I*T)*S-l,V=C*C+k*k,O=((I=x-R.worldX)*A-(P=w-R.worldY)*E)*S-h,D=(P*M-I*T)*S-l,L=Math.sqrt(O*O+D*D),_=n.data.length*p,N=0,F=0;t:if(b){var Y=(V-L*L-(_*=u)*_)/(2*L*_);Y<-1?Y=-1:Y>1&&(Y=1,a&&L+_>1e-4&&(c*=(Math.sqrt(V)/(L+_)-1)*o+1)),F=Math.acos(Y)*s,M=L+_*Y,E=_*Math.sin(F),N=Math.atan2(k*M-C*E,C*M+k*E)}else{var X=(M=u*_)*M,z=(E=f*_)*E,U=Math.atan2(k,C),B=-2*z*L,q=z-X;if((A=B*B-4*q*(T=z*L*L+X*V-X*z))>=0){var W=Math.sqrt(A);B<0&&(W=-W);var j=(W=-(B+W)/2)/q,G=T/W,H=Math.abs(j)=-1&&T<=1&&(T=Math.acos(T),(A=(I=M*Math.cos(T)+L)*I+(P=E*Math.sin(T))*P)et&&($=T,et=A,tt=I,nt=P)),V<=(Q+et)/2?(N=U-Math.atan2(J*s,K),F=Z*s):(N=U-Math.atan2(nt*s,tt),F=$*s)}var it=Math.atan2(y,g)*m,rt=e.arotation;(N=(N-it)*t.MathUtils.radDeg+d-rt)>180?N-=360:N<-180&&(N+=360),e.updateWorldTransformWith(h,l,rt+N*o,c,e.ascaleY,0,0),rt=n.arotation,(F=((F+it)*t.MathUtils.radDeg-n.ashearX)*m+v-rt)>180?F-=360:F<-180&&(F+=360),n.updateWorldTransformWith(g,y,rt+F*o,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(i||(i={})),function(t){var e=function(){return function(t){this.order=0,this.bones=new Array,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.name=t}}();t.IkConstraintData=e}(i||(i={})),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,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 n=0,i=t.bones.length;n0;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,f=l?c:c+1,p=this.bones,d=t.Utils.setArraySize(this.spaces,f),v=null,m=this.spacing;if(u||!o){u&&(v=t.Utils.setArraySize(this.lengths,c));for(var g=a.spacingMode==t.SpacingMode.Length,y=0,x=f-1;y0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var C=3;yt.MathUtils.PI?X-=t.MathUtils.PI2:X<-t.MathUtils.PI&&(X+=t.MathUtils.PI2),X*=i,z=Math.cos(X),U=Math.sin(X),k.a=z*_-U*F,k.b=z*N-U*Y,k.c=U*_+z*F,k.d=U*N+z*Y}k.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,i,r,s,a){var o=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*i+2),c=null,f=n.closed,p=n.worldVerticesLength,d=p/6,v=e.NONE;if(!n.constantSpeed){var m=n.lengths,g=m[d-=f?1:2];if(s&&(h*=g),a)for(var y=1;yg){v!=e.AFTER&&(v=e.AFTER,n.computeWorldVertices(o,p-6,4,c,0,2)),this.addAfterPosition(M-g,c,0,u,x);continue}}for(;;w++){var E=m[w];if(!(M>E)){if(0==w)M/=E;else M=(M-(Z=m[w-1]))/(E-Z);break}}w!=v&&(v=w,f&&w==d?(n.computeWorldVertices(o,p-4,4,c,0,2),n.computeWorldVertices(o,0,4,c,4,2)):n.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==W)}return u}f?(p+=2,c=t.Utils.setArraySize(this.world,p),n.computeWorldVertices(o,2,p-4,c,0,2),n.computeWorldVertices(o,0,2,c,p-4,2),c[p-2]=c[0],c[p-1]=c[1]):(d--,p-=4,c=t.Utils.setArraySize(this.world,p),n.computeWorldVertices(o,2,p,c,0,2));for(var T=t.Utils.setArraySize(this.curves,d),A=0,b=c[0],R=c[1],S=0,I=0,P=0,C=0,k=0,V=0,O=0,D=0,L=0,_=0,N=0,F=0,Y=0,X=0,z=(y=0,2);yA){this.addAfterPosition(M-A,c,p-4,u,x);continue}}for(;;w++){var j=T[w];if(!(M>j)){if(0==w)M/=j;else M=(M-(Z=T[w-1]))/(j-Z);break}}if(w!=v){v=w;var G=6*w;for(b=c[G],R=c[G+1],S=c[G+2],I=c[G+3],P=c[G+4],C=c[G+5],k=c[G+6],V=c[G+7],N=2*(O=.03*(b-2*S+P))+(L=.006*(3*(S-P)-b+k)),F=2*(D=.03*(R-2*I+C))+(_=.006*(3*(I-C)-R+V)),Y=.3*(S-b)+O+.16666667*L,X=.3*(I-R)+D+.16666667*_,B=Math.sqrt(Y*Y+X*X),U[0]=B,G=1;G<8;G++)Y+=N,X+=F,N+=L,F+=_,B+=Math.sqrt(Y*Y+X*X),U[G]=B;Y+=N,X+=F,B+=Math.sqrt(Y*Y+X*X),U[8]=B,Y+=N+L,X+=F+_,B+=Math.sqrt(Y*Y+X*X),U[9]=B,q=0}for(M*=B;;q++){var H=U[q];if(!(M>H)){var Z;if(0==q)M/=H;else M=q+(M-(Z=U[q-1]))/(H-Z);break}}this.addCurvePosition(.1*M,b,R,S,I,P,C,k,V,u,x,r||y>0&&0==W)}return u},e.prototype.addBeforePosition=function(t,e,n,i,r){var s=e[n],a=e[n+1],o=e[n+2]-s,h=e[n+3]-a,l=Math.atan2(h,o);i[r]=s+t*Math.cos(l),i[r+1]=a+t*Math.sin(l),i[r+2]=l},e.prototype.addAfterPosition=function(t,e,n,i,r){var s=e[n+2],a=e[n+3],o=s-e[n],h=a-e[n+1],l=Math.atan2(h,o);i[r]=s+t*Math.cos(l),i[r+1]=a+t*Math.sin(l),i[r+2]=l},e.prototype.addCurvePosition=function(t,e,n,i,r,s,a,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=n,void(l[u+2]=Math.atan2(r-n,i-e));var f=t*t,p=f*t,d=1-t,v=d*d,m=v*d,g=d*t,y=3*g,x=d*y,w=y*t,M=e*m+i*x+s*w+o*p,E=n*m+r*x+a*w+h*p;l[u]=M,l[u+1]=E,c&&(l[u+2]=t<.001?Math.atan2(r-n,i-e):Math.atan2(E-(n*v+r*g*2+a*f),M-(e*v+i*g*2+s*f)))},e.prototype.getOrder=function(){return this.data.order},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(i||(i={})),function(t){var e=function(){return function(t){this.order=0,this.bones=new Array,this.name=t}}();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={}))}(i||(i={})),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}(),n=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,n,i){var r=this.clientAssets[t];return null!==r&&void 0!==r||(r=new e(t),this.clientAssets[t]=r),null!==n&&(r.textureLoader=n),r.toLoad.push(i),this.queuedAssets[i]!==i&&(this.queuedAssets[i]=i,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState==XMLHttpRequest.DONE&&(i.status>=200&&i.status<300?n.rawAssets[e]=i.responseText:n.errors[e]="Couldn't load text "+e+": status "+i.status+", "+i.responseText)},i.open("GET",e,!0),i.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState==XMLHttpRequest.DONE&&(i.status>=200&&i.status<300?n.rawAssets[e]=JSON.parse(i.responseText):n.errors[e]="Couldn't load text "+e+": status "+i.status+", "+i.responseText)},i.open("GET",e,!0),i.send()}},t.prototype.loadTexture=function(t,e,n){var i=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n)){var r=new Image;r.src=n,r.crossOrigin="anonymous",r.onload=function(t){i.rawAssets[n]=r},r.onerror=function(t){i.errors[n]="Couldn't load image "+n}}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var n=this.clientAssets[t];return null===n||void 0===n||n.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=0;e0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=n}(i||(i={})),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 n=0;n1){var r=n[n.length-1];this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}this._updateCache.push(t),this.sortReset(i.children),n[n.length-1].sorted=!0},e.prototype.sortPathConstraint=function(e){var n=e.target,i=n.data.index,r=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,i,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,i,r);for(var s=0,a=this.data.skins.length;s-1||this.updateCacheReset.push(r)}else for(i=0;i=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,i){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=s&&i<=s||t>=a&&n>=a||e>=o&&i>=o)return!1;var h=(i-e)/(n-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 n=this.polygons,i=0,r=n.length;i=n||l=n){var u=i[o];u+(n-h)/(l-h)*(i[s]-u)=u&&x<=p||x>=p&&x<=u)&&(x>=e&&x<=i||x>=i&&x<=e)){var w=(l*g-h*v)/y;if((w>=c&&w<=d||w>=d&&w<=c)&&(w>=n&&w<=r||w>=r&&w<=n))return!0}u=p,c=d}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}(i||(i={})),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(n,i){if(null!=this.clipAttachment)return 0;this.clipAttachment=i;var r=i.worldVerticesLength,s=t.Utils.setArraySize(this.clippingPolygon,r);i.computeWorldVertices(n,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+F*d),z=0;z=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(i),u.push(r),u.push(s),u.push(t),u.push(e),o.length=0;for(var c=a,f=a.length-4,p=0;;p+=2){for(var d=c[p],v=c[p+1],m=c[p+2],g=c[p+3],y=d-m,x=v-g,w=u,M=u.length-2,E=o.length,T=0;T0;if(y*(b-g)-x*(A-m)>0){if(I){o.push(R),o.push(S);continue}var P=(k=S-b)*(m-d)-(V=R-A)*(g-v);if(Math.abs(P)>1e-6){var C=(V*(v-b)-k*(d-A))/P;o.push(d+(m-d)*C),o.push(v+(g-v)*C)}else o.push(d),o.push(v)}else if(I){var k,V;P=(k=S-b)*(m-d)-(V=R-A)*(g-v);if(Math.abs(P)>1e-6){C=(V*(v-b)-k*(d-A))/P;o.push(d+(m-d)*C),o.push(v+(g-v)*C)}else o.push(d),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]),p==f)break;var O=o;(o=u).length=0,u=O}if(h!=o){h.length=0;p=0;for(var D=o.length-2;p>1;o=0;f--)-1==q[f]&&(q[f]=j[--H])}w.setFrame(c++,B.time,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,f=0;f=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=n},t.prototype.getAttachment=function(t,e){var n=this.attachments[t];return n?n[e]:null},t.prototype.attachAll=function(t,e){for(var n=0,i=0;i= 0.");if(null==n)throw new Error("name cannot be null.");if(null==i)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=i}}();t.SlotData=e}(i||(i={})),function(t){var e,n,i=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 "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return n.MirroredRepeat;case"clamptoedge":return n.ClampToEdge;case"repeat":return n.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();t.Texture=i,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"}(n=t.TextureWrap||(t.TextureWrap={}));var s=function(){return 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}(i);t.FakeTexture=a}(i||(i={})),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 n(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,u.rotate="true"==a.readValue(),a.readTuple(o);var c=parseInt(o[0]),f=parseInt(o[1]);a.readTuple(o);var p=parseInt(o[0]),d=parseInt(o[1]);u.u=c/h.width,u.v=f/h.height,u.rotate?(u.u2=(c+d)/h.width,u.v2=(f+p)/h.height):(u.u2=(c+p)/h.width,u.v2=(f+d)/h.height),u.x=c,u.y=f,u.width=Math.abs(p),u.height=Math.abs(d),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 i).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 v=a.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==v?h.uWrap=t.TextureWrap.Repeat:"y"==v?h.vWrap=t.TextureWrap.Repeat:"xy"==v&&(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(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var i=0,r=n+1;i<3;i++){var s=e.indexOf(",",r);if(-1==s)break;t[i]=e.substr(r,s-r).trim(),r=s+1}return t[i]=e.substring(r).trim(),i+1},t}(),i=function(){return function(){}}();t.TextureAtlasPage=i;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=s}(i||(i={})),function(t){var e=function(){function e(e,n){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,null==e)throw new Error("data cannot be null.");if(null==n)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 i=0;i0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,p=this.bones,d=0,v=p.length;dt.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);m.a=E*y-T*w,m.b=E*x-T*M,m.c=T*y+E*w,m.d=T*x+E*M,g=!0}if(0!=n){var A=this.temp;s.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),m.worldX+=(A.x-m.worldX)*n,m.worldY+=(A.y-m.worldY)*n,g=!0}if(i>0){var b=Math.sqrt(m.a*m.a+m.c*m.c),R=Math.sqrt(a*a+h*h);b>1e-5&&(b=(b+(R-b+this.data.offsetScaleX)*i)/b),m.a*=b,m.c*=b,b=Math.sqrt(m.b*m.b+m.d*m.d),R=Math.sqrt(o*o+l*l),b>1e-5&&(b=(b+(R-b+this.data.offsetScaleY)*i)/b),m.b*=b,m.d*=b,g=!0}if(r>0){x=m.b,M=m.d;var S,I=Math.atan2(M,x);(S=Math.atan2(l,o)-Math.atan2(h,a)-(I-Math.atan2(m.c,m.a)))>t.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S=I+(S+f)*r;b=Math.sqrt(x*x+M*M);m.b=Math.cos(S)*b,m.d=Math.sin(S)*b,g=!0}g&&(m.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,i=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,f=this.data.offsetShearY*u,p=this.bones,d=0,v=p.length;dt.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);m.a=E*y-T*w,m.b=E*x-T*M,m.c=T*y+E*w,m.d=T*x+E*M,g=!0}if(0!=n){var A=this.temp;s.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),m.worldX+=A.x*n,m.worldY+=A.y*n,g=!0}if(i>0){var b=(Math.sqrt(a*a+h*h)-1+this.data.offsetScaleX)*i+1;m.a*=b,m.c*=b,b=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleY)*i+1,m.b*=b,m.d*=b,g=!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=m.b,M=m.d;R=Math.atan2(M,x)+(R-t.MathUtils.PI/2+f)*r;b=Math.sqrt(x*x+M*M);m.b=Math.cos(R)*b,m.d=Math.sin(R)*b,g=!0}g&&(m.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(p=(p+(r.ascaleX-p+this.data.offsetScaleX)*n)/p),d>1e-5&&(d=(d+(r.ascaleY-d+this.data.offsetScaleY)*n)/d));var v=h.ashearY;if(0!=i){u=r.ashearY-v+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*i}h.updateWorldTransformWith(c,f,l,p,d,h.ashearX,v)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a1e-5&&(f*=(r.ascaleX-1+this.data.offsetScaleX)*n+1),p>1e-5&&(p*=(r.ascaleY-1+this.data.offsetScaleY)*n+1));var d=h.ashearY;0!=i&&(d+=(r.ashearY+this.data.offsetShearY)*i),h.updateWorldTransformWith(u,c,l,f,p,h.ashearX,d)}},e.prototype.getOrder=function(){return this.data.order},e}();t.TransformConstraint=e}(i||(i={})),function(t){var e=function(){return function(t){if(this.order=0,this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=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,null==t)throw new Error("name cannot be null.");this.name=t}}();t.TransformConstraintData=e}(i||(i={})),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 n=t,i=t.length>>1,r=this.indicesArray;r.length=0;for(var s=0;s3;){for(var l=i-1,u=(s=0,1);;){t:if(!a[s]){for(var c=r[l]<<1,f=r[s]<<1,p=r[u]<<1,d=n[c],v=n[c+1],m=n[f],g=n[f+1],y=n[p],x=n[p+1],w=(u+1)%i;w!=l;w=(w+1)%i)if(a[w]){var M=r[w]<<1,E=n[M],T=n[M+1];if(e.positiveArea(y,x,d,v,E,T)&&e.positiveArea(d,v,m,g,E,T)&&e.positiveArea(m,g,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)%i}h.push(r[(i+s-1)%i]),h.push(r[s]),h.push(r[(s+1)%i]),r.splice(s,1),a.splice(s,1);var A=(--i+s-1)%i,b=s==i?0:s;a[A]=e.isConcave(A,i,n,r),a[b]=e.isConcave(b,i,n,r)}return 3==i&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},e.prototype.decompose=function(t,n){var i=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=n.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(m),o.push(g),o.push(y),o.push(x),o.push(w),(a=this.polygonIndicesPool.obtain()).length=0,a.push(f),a.push(p),a.push(d),l=e.winding(v,m,g,y,x,w),h=f)}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,n,i){var r=i[(e+t-1)%e]<<1,s=i[t]<<1,a=i[(t+1)%e]<<1;return!this.positiveArea(n[r],n[r+1],n[s],n[s+1],n[a],n[a+1])},e.positiveArea=function(t,e,n,i,r,s){return t*(s-i)+n*(e-s)+r*(i-e)>=0},e.winding=function(t,e,n,i,r,s){var a=n-t,o=i-e;return r*o-s*a+a*e-t*o>=0?1:-1},e}();t.Triangulator=e}(i||(i={})),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 void 0!=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 n=function(){function t(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.r=t,this.g=e,this.b=n,this.a=i}return t.prototype.set=function(t,e,n,i){return this.r=t,this.g=e,this.b=n,this.a=i,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,n,i){return this.r+=t,this.g+=e,this.b+=n,this.a+=i,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.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=n;var i=function(){function t(){}return t.clamp=function(t,e,n){return tn?n: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,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var i=Math.random(),r=e-t;return i<=(n-t)/r?t+Math.sqrt(i*r*(n-t)):e-Math.sqrt((1-i)*r*(e-n))},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=i;var s=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=s;var a=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}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,n,i,r){for(var s=e,a=i;s=n?e:t.setArraySize(e,n,i)},t.newArray=function(t,e){for(var n=new Array(t),i=0;i0?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=f;var p=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.attachmentVertices,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f0&&(h=o);for(var w,M=(w=t.bone).worldX,E=w.worldY,T=w.a,A=w.b,b=w.c,R=w.d,S=e,I=r;I>16&255)/255,i=(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=n,a.color.g=i,a.color.b=r,null!==s&&(a.color.a=s),this},setSkeletonFromJSON:function(t,e,n,i){return this.setSkeleton(t,e,n,i)},setSkeleton:function(t,e,n,i){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,i);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkinByName("default"),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,n),this.root=this.getRootBone(),this.root&&(this.root.rotation=v(f(this.rotation))+90),this.state.apply(s),s.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=v(f(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,n,i){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===n&&(n=0),void 0===i&&(i=0),this.width=t,this.height=e,this.displayOriginX=r.x-n,this.displayOriginY=r.y-i,this},setOffset:function(t,e){var n=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=n.x-t,this.displayOriginY=n.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,n=this.scaleX,i=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=n,t.scaleY=i,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 n=0;n0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):i||s?r.TAU-(s>0?Math.acos(-i/this.scaleY):-Math.acos(i/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 n=this.matrix;return n[4]=n[0]*t+n[2]*e+n[4],n[5]=n[1]*t+n[3]*e+n[5],this},scale:function(t,e){var n=this.matrix;return n[0]*=t,n[1]*=t,n[2]*=e,n[3]*=e,this},rotate:function(t){var e=Math.sin(t),n=Math.cos(t),i=this.matrix,r=i[0],s=i[1],a=i[2],o=i[3];return i[0]=r*n+a*e,i[1]=s*n+o*e,i[2]=r*-e+a*n,i[3]=s*-e+o*n,this},multiply:function(t,e){var n=this.matrix,i=t.matrix,r=n[0],s=n[1],a=n[2],o=n[3],h=n[4],l=n[5],u=i[0],c=i[1],f=i[2],p=i[3],d=i[4],v=i[5],m=void 0===e?this:e;return m.a=u*r+c*a,m.b=u*s+c*o,m.c=f*r+p*a,m.d=f*s+p*o,m.e=d*r+v*a+h,m.f=d*s+v*o+l,m},multiplyWithOffset:function(t,e,n){var i=this.matrix,r=t.matrix,s=i[0],a=i[1],o=i[2],h=i[3],l=e*s+n*o+i[4],u=e*a+n*h+i[5],c=r[0],f=r[1],p=r[2],d=r[3],v=r[4],m=r[5];return i[0]=c*s+f*o,i[1]=c*a+f*h,i[2]=p*s+d*o,i[3]=p*a+d*h,i[4]=v*s+m*o+l,i[5]=v*a+m*h+u,this},transform:function(t,e,n,i,r,s){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],f=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=n*o+i*l,a[3]=n*h+i*u,a[4]=r*o+s*l+c,a[5]=r*h+s*u+f,this},transformPoint:function(t,e,n){void 0===n&&(n={x:0,y:0});var i=this.matrix,r=i[0],s=i[1],a=i[2],o=i[3],h=i[4],l=i[5];return n.x=t*r+e*a+h,n.y=t*s+e*o+l,n},invert:function(){var t=this.matrix,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=e*r-n*i;return t[0]=r/o,t[1]=-n/o,t[2]=-i/o,t[3]=e/o,t[4]=(i*a-r*s)/o,t[5]=-(e*a-n*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,n,i,r,s){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=n,a[3]=i,a[4]=r,a[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,n=e[0],i=e[1],r=e[2],s=e[3],a=n*s-i*r;if(t.translateX=e[4],t.translateY=e[5],n||i){var o=Math.sqrt(n*n+i*i);t.rotation=i>0?Math.acos(n/o):-Math.acos(n/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,n,i,r){var s=this.matrix,a=Math.sin(n),o=Math.cos(n);return s[4]=t,s[5]=e,s[0]=o*i,s[1]=a*i,s[2]=-a*r,s[3]=o*r,this},applyInverse:function(t,e,n){void 0===n&&(n=new s);var i=this.matrix,r=i[0],a=i[1],o=i[2],h=i[3],l=i[4],u=i[5],c=1/(r*h+o*-a);return n.x=h*c*t+-o*c*e+(u*o-l*h)*c,n.y=r*c*e+-a*c*t+(-u*r+l*a)*c,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},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.decomposedMatrix=null}});t.exports=a},function(t,e){var n={_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=n},function(t,e,n){var i=n(0),r=n(195),s=n(196),a=n(202),o=n(203),h=new i({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,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,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},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,n){return this.scene.sys.input.enable(this,t,e,n),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,n=[];e&&(n.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return n.unshift(this.scene.sys.displayList.getIndex(t)),n},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.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),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});h.RENDER_MASK=15,t.exports=h},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,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,n){var i=n(0),r=n(197),s=new i({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("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var n=[],i=0;i + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var Events = __webpack_require__(/*! ./events */ "../../../src/data/events/index.js"); + +/** + * @callback DataEachCallback + * + * @param {*} parent - The parent object of the DataManager. + * @param {string} key - The key of the value. + * @param {*} value - The value. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + */ + +/** + * @classdesc + * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + * + * @class DataManager + * @memberof Phaser.Data + * @constructor + * @since 3.0.0 + * + * @param {object} parent - The object that this DataManager belongs to. + * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter. + */ +var DataManager = new Class({ + + initialize: + + function DataManager (parent, eventEmitter) + { + /** + * The object that this DataManager belongs to. + * + * @name Phaser.Data.DataManager#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The DataManager's event emitter. + * + * @name Phaser.Data.DataManager#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = eventEmitter; + + if (!eventEmitter) + { + this.events = (parent.events) ? parent.events : parent; + } + + /** + * The data list. + * + * @name Phaser.Data.DataManager#list + * @type {Object.} + * @default {} + * @since 3.0.0 + */ + this.list = {}; + + /** + * The public values list. You can use this to access anything you have stored + * in this Data Manager. For example, if you set a value called `gold` you can + * access it via: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also modify it directly: + * + * ```javascript + * this.data.values.gold += 1000; + * ``` + * + * Doing so will emit a `setdata` event from the parent of this Data Manager. + * + * Do not modify this object directly. Adding properties directly to this object will not + * emit any events. Always use `DataManager.set` to create new items the first time around. + * + * @name Phaser.Data.DataManager#values + * @type {Object.} + * @default {} + * @since 3.10.0 + */ + this.values = {}; + + /** + * Whether setting data is frozen for this DataManager. + * + * @name Phaser.Data.DataManager#_frozen + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._frozen = false; + + if (!parent.hasOwnProperty('sys') && this.events) + { + this.events.once('destroy', this.destroy, this); + } + }, + + /** + * Retrieves the value for the given key, 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 + * this.data.get('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * this.data.get([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.Data.DataManager#get + * @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. + */ + get: function (key) + { + var list = this.list; + + if (Array.isArray(key)) + { + var output = []; + + for (var i = 0; i < key.length; i++) + { + output.push(list[key[i]]); + } + + return output; + } + else + { + return list[key]; + } + }, + + /** + * Retrieves all data values in a new object. + * + * @method Phaser.Data.DataManager#getAll + * @since 3.0.0 + * + * @return {Object.} All data values. + */ + getAll: function () + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Queries the DataManager for the values of keys matching the given regular expression. + * + * @method Phaser.Data.DataManager#query + * @since 3.0.0 + * + * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). + * + * @return {Object.} The values of the keys matching the search string. + */ + query: function (search) + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key) && key.match(search)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * data.set('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `get`: + * + * ```javascript + * data.get('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted. + * + * 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.Data.DataManager#set + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @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. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + set: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (typeof key === 'string') + { + return this.setValue(key, data); + } + else + { + for (var entry in key) + { + this.setValue(entry, key[entry]); + } + } + + return this; + }, + + /** + * Internal value setter, called automatically by the `set` method. + * + * @method Phaser.Data.DataManager#setValue + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @private + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * @param {*} data - The value to set. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setValue: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (this.has(key)) + { + // Hit the key getter, which will in turn emit the events. + this.values[key] = data; + } + else + { + var _this = this; + var list = this.list; + var events = this.events; + var parent = this.parent; + + Object.defineProperty(this.values, key, { + + enumerable: true, + + configurable: true, + + get: function () + { + return list[key]; + }, + + set: function (value) + { + if (!_this._frozen) + { + var previousValue = list[key]; + list[key] = value; + + events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); + events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); + } + } + + }); + + list[key] = data; + + events.emit(Events.SET_DATA, parent, key, data); + } + + return this; + }, + + /** + * Passes all data entries to the given callback. + * + * @method Phaser.Data.DataManager#each + * @since 3.0.0 + * + * @param {DataEachCallback} callback - The function to call. + * @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 {Phaser.Data.DataManager} This DataManager object. + */ + each: function (callback, context) + { + var args = [ this.parent, null, undefined ]; + + for (var i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (var key in this.list) + { + args[1] = key; + args[2] = this.list[key]; + + callback.apply(context, args); + } + + return this; + }, + + /** + * Merge the given object of key value pairs into this DataManager. + * + * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) + * will emit a `changedata` event. + * + * @method Phaser.Data.DataManager#merge + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {Object.} data - The data to merge. + * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + merge: function (data, overwrite) + { + if (overwrite === undefined) { overwrite = true; } + + // Merge data from another component into this one + for (var key in data) + { + if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) + { + this.setValue(key, data[key]); + } + } + + return this; + }, + + /** + * Remove the value for the given key. + * + * If the key is found in this Data Manager it is removed from the internal lists and a + * `removedata` event is emitted. + * + * You can also pass in an array of keys, in which case all keys in the array will be removed: + * + * ```javascript + * this.data.remove([ 'gold', 'armor', 'health' ]); + * ``` + * + * @method Phaser.Data.DataManager#remove + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {(string|string[])} key - The key to remove, or an array of keys to remove. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + remove: function (key) + { + if (this._frozen) + { + return this; + } + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + this.removeValue(key[i]); + } + } + else + { + return this.removeValue(key); + } + + return this; + }, + + /** + * Internal value remover, called automatically by the `remove` method. + * + * @method Phaser.Data.DataManager#removeValue + * @private + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + removeValue: function (key) + { + if (this.has(key)) + { + var data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return this; + }, + + /** + * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. + * + * @method Phaser.Data.DataManager#pop + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {string} key - The key of the value to retrieve and delete. + * + * @return {*} The value of the given key. + */ + pop: function (key) + { + var data = undefined; + + if (!this._frozen && this.has(key)) + { + data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return data; + }, + + /** + * Determines whether the given key is set in this Data Manager. + * + * Please note that the 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.Data.DataManager#has + * @since 3.0.0 + * + * @param {string} key - The key to check. + * + * @return {boolean} Returns `true` if the key exists, otherwise `false`. + */ + has: function (key) + { + return this.list.hasOwnProperty(key); + }, + + /** + * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts + * to create new values or update existing ones. + * + * @method Phaser.Data.DataManager#setFreeze + * @since 3.0.0 + * + * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setFreeze: function (value) + { + this._frozen = value; + + return this; + }, + + /** + * Delete all data in this Data Manager and unfreeze it. + * + * @method Phaser.Data.DataManager#reset + * @since 3.0.0 + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + reset: function () + { + for (var key in this.list) + { + delete this.list[key]; + delete this.values[key]; + } + + this._frozen = false; + + return this; + }, + + /** + * Destroy this data manager. + * + * @method Phaser.Data.DataManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.reset(); + + this.events.off(Events.CHANGE_DATA); + this.events.off(Events.SET_DATA); + this.events.off(Events.REMOVE_DATA); + + this.parent = null; + }, + + /** + * Gets or sets the frozen state of this Data Manager. + * A frozen Data Manager will block all attempts to create new values or update existing ones. + * + * @name Phaser.Data.DataManager#freeze + * @type {boolean} + * @since 3.0.0 + */ + freeze: { + + get: function () + { + return this._frozen; + }, + + set: function (value) + { + this._frozen = (value) ? true : false; + } + + }, + + /** + * Return the total number of entries in this Data Manager. + * + * @name Phaser.Data.DataManager#count + * @type {integer} + * @since 3.0.0 + */ + count: { + + get: function () + { + var i = 0; + + for (var key in this.list) + { + if (this.list[key] !== undefined) + { + i++; + } + } + + return i; + } + + } + +}); + +module.exports = DataManager; + + +/***/ }), + +/***/ "../../../src/data/events/CHANGE_DATA_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/CHANGE_DATA_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`. + * + * This event is dispatched for all items that change in the Data Manager. + * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. + * + * @event Phaser.Data.Events#CHANGE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The new value of the item in the Data Manager. + * @param {any} previousValue - The previous value of the item in the Data Manager. + */ +module.exports = 'changedata'; + + +/***/ }), + +/***/ "../../../src/data/events/CHANGE_DATA_KEY_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Key Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`, + * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` + * then you can listen for `sprite.data.on('changedata-gold')`. + * + * @event Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.16.1 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'changedata-'; + + +/***/ }), + +/***/ "../../../src/data/events/REMOVE_DATA_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/REMOVE_DATA_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Remove Data Event. + * + * This event is dispatched by a Data Manager when an item is removed from it. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`. + * + * @event Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'removedata'; + + +/***/ }), + +/***/ "../../../src/data/events/SET_DATA_EVENT.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/SET_DATA_EVENT.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Set Data Event. + * + * This event is dispatched by a Data Manager when a new item is added to the data store. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`. + * + * @event Phaser.Data.Events#SET_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'setdata'; + + +/***/ }), + +/***/ "../../../src/data/events/index.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/index.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Data.Events + */ + +module.exports = { + + CHANGE_DATA: __webpack_require__(/*! ./CHANGE_DATA_EVENT */ "../../../src/data/events/CHANGE_DATA_EVENT.js"), + CHANGE_DATA_KEY: __webpack_require__(/*! ./CHANGE_DATA_KEY_EVENT */ "../../../src/data/events/CHANGE_DATA_KEY_EVENT.js"), + REMOVE_DATA: __webpack_require__(/*! ./REMOVE_DATA_EVENT */ "../../../src/data/events/REMOVE_DATA_EVENT.js"), + SET_DATA: __webpack_require__(/*! ./SET_DATA_EVENT */ "../../../src/data/events/SET_DATA_EVENT.js") + +}; + + +/***/ }), + +/***/ "../../../src/gameobjects/BuildGameObject.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/BuildGameObject.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(/*! ../renderer/BlendModes */ "../../../src/renderer/BlendModes.js"); +var GetAdvancedValue = __webpack_require__(/*! ../utils/object/GetAdvancedValue */ "../../../src/utils/object/GetAdvancedValue.js"); +var ScaleModes = __webpack_require__(/*! ../renderer/ScaleModes */ "../../../src/renderer/ScaleModes.js"); + +/** + * 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); + } + + // ScaleMode + + gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT); + + // 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/GameObject.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/GameObject.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var ComponentsToJSON = __webpack_require__(/*! ./components/ToJSON */ "../../../src/gameobjects/components/ToJSON.js"); +var DataManager = __webpack_require__(/*! ../data/DataManager */ "../../../src/data/DataManager.js"); +var EventEmitter = __webpack_require__(/*! eventemitter3 */ "../../../node_modules/eventemitter3/index.js"); +var Events = __webpack_require__(/*! ./events */ "../../../src/gameobjects/events/index.js"); + +/** + * @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); + + /** + * The Scene to which this Game Object belongs. + * Game Objects can only belong to one Scene. + * + * @name Phaser.GameObjects.GameObject#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * 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 move 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 {(integer|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 {integer} + * @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 {integer} + * @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 physics then this property will contain a reference to a Physics Body. + * + * @name Phaser.GameObjects.GameObject#body + * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)} + * @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; + + // 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 {(integer|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 + * + * @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; + }, + + /** + * 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. + * + * @method Phaser.GameObjects.GameObject#setInteractive + * @since 3.0.0 + * + * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. 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 (shape, callback, dropZone) + { + this.scene.sys.input.enable(this, shape, callback, 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 () + { + if (this.input) + { + this.input.enabled = false; + } + + 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; + }, + + /** + * 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) + { + return !(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 {integer[]} 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), parent.name]); + indexes.unshift(parent.getIndex(child)); + + child = parent; + + if (!parent.parentContainer) + { + break; + } + else + { + parent = parent.parentContainer; + } + } + + // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']); + indexes.unshift(this.scene.sys.displayList.getIndex(child)); + + return indexes; + }, + + /** + * 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] - Is this Game Object being destroyed as the result of a Scene shutdown? + */ + destroy: function (fromScene) + { + if (fromScene === undefined) { fromScene = false; } + + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + if (this.preDestroy) + { + this.preDestroy.call(this); + } + + this.emit(Events.DESTROY, this); + + var sys = this.scene.sys; + + if (!fromScene) + { + sys.displayList.remove(this); + sys.updateList.remove(this); + } + + if (this.input) + { + 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; + } + + // Tell the Scene to re-sort the children + if (!fromScene) + { + sys.queueDepthSort(); + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + + this.parentContainer = undefined; + + this.removeAllListeners(); + } + +}); + +/** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + * + * @constant {integer} RENDER_MASK + * @memberof Phaser.GameObjects.GameObject + * @default + */ +GameObject.RENDER_MASK = 15; + +module.exports = GameObject; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/ComputedSize.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/ComputedSize.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Depth.js": +/*!**************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Depth.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * 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 depth starts from zero (the default value) and increases from that point. 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) + { + this.scene.sys.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 depth starts from zero (the default value) and increases from that point. 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 {integer} value - The depth of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Flip.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Flip.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/ScrollFactor.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/ScrollFactor.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/ToJSON.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/ToJSON.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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, + scaleMode: gameObject.scaleMode, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Transform.js": +/*!******************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Transform.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(/*! ../../math/const */ "../../../src/math/const.js"); +var TransformMatrix = __webpack_require__(/*! ./TransformMatrix */ "../../../src/gameobjects/components/TransformMatrix.js"); +var WrapAngle = __webpack_require__(/*! ../../math/angle/Wrap */ "../../../src/math/angle/Wrap.js"); +var WrapAngleDegrees = __webpack_require__(/*! ../../math/angle/WrapDegrees */ "../../../src/math/angle/WrapDegrees.js"); + +// 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 = { + + /** + * 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: Do not use this value to set the z-index, instead see the `depth` property. + * + * @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 {integer} + * @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, 90 is down, 180/-180 is left + * and -90 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; + }, + + /** + * 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. + * + * @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; + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/TransformMatrix.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/TransformMatrix.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var MATH_CONST = __webpack_require__(/*! ../../math/const */ "../../../src/math/const.js"); +var Vector2 = __webpack_require__(/*! ../../math/Vector2 */ "../../../src/math/Vector2.js"); + +/** + * @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 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 {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) ? this : out; + + destinationMatrix.a = (sourceA * localA) + (sourceB * localC); + destinationMatrix.b = (sourceA * localB) + (sourceB * localD); + destinationMatrix.c = (sourceC * localA) + (sourceD * localC); + destinationMatrix.d = (sourceC * localB) + (sourceD * localD); + destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE; + destinationMatrix.f = (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 using 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.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates. + * + * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} 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; + }, + + /** + * 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 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.decomposedMatrix = null; + } + +}); + +module.exports = TransformMatrix; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Visible.js": +/*!****************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Visible.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/events/DESTROY_EVENT.js": +/*!******************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/events/DESTROY_EVENT.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Destroy Event. + * + * 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 + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. + */ +module.exports = 'destroy'; + + +/***/ }), + +/***/ "../../../src/gameobjects/events/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/events/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ "../../../src/gameobjects/events/DESTROY_EVENT.js") }; + + +/***/ }), + +/***/ "../../../src/loader/File.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/loader/File.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ./const */ "../../../src/loader/const.js"); +var Events = __webpack_require__(/*! ./events */ "../../../src/loader/events/index.js"); +var GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var GetURL = __webpack_require__(/*! ./GetURL */ "../../../src/loader/GetURL.js"); +var MergeXHRSettings = __webpack_require__(/*! ./MergeXHRSettings */ "../../../src/loader/MergeXHRSettings.js"); +var XHRLoader = __webpack_require__(/*! ./XHRLoader */ "../../../src/loader/XHRLoader.js"); +var XHRSettings = __webpack_require__(/*! ./XHRSettings */ "../../../src/loader/XHRSettings.js"); + +/** + * @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); + + /** + * 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.type || !this.key) + { + throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + } + + /** + * The URL of the file, not including baseURL. + * Automatically has Loader.path prepended to it. + * + * @name Phaser.Loader.File#url + * @type {string} + * @since 3.0.0 + */ + this.url = GetFastValue(fileConfig, 'url'); + + if (this.url === undefined) + { + this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof(this.url) !== 'function') + { + this.url = loader.path + this.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 {integer} + * @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.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 localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && 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.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 () + { + 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.cache.add(this.key, this.data); + } + + this.pendingDestroy(); + }, + + /** + * 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 (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); + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/loader/FileTypesManager.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/FileTypesManager.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/loader/GetURL.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/loader/GetURL.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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:|http:\/\/|https:\/\/|\/\/)/)) + { + return file.url; + } + else + { + return baseURL + file.url; + } +}; + +module.exports = GetURL; + + +/***/ }), + +/***/ "../../../src/loader/MergeXHRSettings.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/MergeXHRSettings.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(/*! ../utils/object/Extend */ "../../../src/utils/object/Extend.js"); +var XHRSettings = __webpack_require__(/*! ./XHRSettings */ "../../../src/loader/XHRSettings.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/loader/MultiFile.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/MultiFile.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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) + { + /** + * 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; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = files; + + /** + * 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 {integer} + * @since 3.7.0 + */ + + this.pending = files.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {integer} + * @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 = {}; + + // Link the files + for (var i = 0; i < files.length; i++) + { + files[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++; + } + } + +}); + +module.exports = MultiFile; + + +/***/ }), + +/***/ "../../../src/loader/XHRLoader.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/XHRLoader.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(/*! ./MergeXHRSettings */ "../../../src/loader/MergeXHRSettings.js"); + +/** + * 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.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); + } + + // 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; + + +/***/ }), + +/***/ "../../../src/loader/XHRSettings.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/XHRSettings.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [timeout=0] - Optional XHR timeout value. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + */ +var XHRSettings = function (responseType, async, user, password, timeout) +{ + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } + + // 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 + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined + + }; +}; + +module.exports = XHRSettings; + + +/***/ }), + +/***/ "../../../src/loader/const.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/loader/const.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {integer} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {integer} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {integer} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started + * + * @name Phaser.Loader.FILE_PENDING + * @type {integer} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing + * + * @name Phaser.Loader.FILE_LOADED + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load + * + * @name Phaser.Loader.FILE_FAILED + * @type {integer} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {integer} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {integer} + * @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 {integer} + * @since 3.0.0 + */ + FILE_POPULATED: 19 + +}; + +module.exports = FILE_CONST; + + +/***/ }), + +/***/ "../../../src/loader/events/ADD_EVENT.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/ADD_EVENT.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), + +/***/ "../../../src/loader/events/COMPLETE_EVENT.js": +/*!**************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/COMPLETE_EVENT.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {integer} totalComplete - The total number of files that successfully loaded. + * @param {integer} totalFailed - The total number of files that failed to load. + */ +module.exports = 'complete'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_COMPLETE_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_COMPLETE_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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)`. + * + * 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 + * @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. + */ +module.exports = 'filecomplete'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_KEY_COMPLETE_EVENT.js": +/*!***********************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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-atlas-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 + * }); + * ``` + * + * 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 + * @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. + */ +module.exports = 'filecomplete-'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_LOAD_ERROR_EVENT.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + */ +module.exports = 'loaderror'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_LOAD_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_LOAD_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + */ +module.exports = 'load'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_PROGRESS_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_PROGRESS_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), + +/***/ "../../../src/loader/events/POST_PROCESS_EVENT.js": +/*!******************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/POST_PROCESS_EVENT.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'postprocess'; + + +/***/ }), + +/***/ "../../../src/loader/events/PROGRESS_EVENT.js": +/*!**************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/PROGRESS_EVENT.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {number} progress - The current progress of the load. A value between 0 and 1. + */ +module.exports = 'progress'; + + +/***/ }), + +/***/ "../../../src/loader/events/START_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/START_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'start'; + + +/***/ }), + +/***/ "../../../src/loader/events/index.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/index.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Loader.Events + */ + +module.exports = { + + ADD: __webpack_require__(/*! ./ADD_EVENT */ "../../../src/loader/events/ADD_EVENT.js"), + COMPLETE: __webpack_require__(/*! ./COMPLETE_EVENT */ "../../../src/loader/events/COMPLETE_EVENT.js"), + FILE_COMPLETE: __webpack_require__(/*! ./FILE_COMPLETE_EVENT */ "../../../src/loader/events/FILE_COMPLETE_EVENT.js"), + FILE_KEY_COMPLETE: __webpack_require__(/*! ./FILE_KEY_COMPLETE_EVENT */ "../../../src/loader/events/FILE_KEY_COMPLETE_EVENT.js"), + FILE_LOAD_ERROR: __webpack_require__(/*! ./FILE_LOAD_ERROR_EVENT */ "../../../src/loader/events/FILE_LOAD_ERROR_EVENT.js"), + FILE_LOAD: __webpack_require__(/*! ./FILE_LOAD_EVENT */ "../../../src/loader/events/FILE_LOAD_EVENT.js"), + FILE_PROGRESS: __webpack_require__(/*! ./FILE_PROGRESS_EVENT */ "../../../src/loader/events/FILE_PROGRESS_EVENT.js"), + POST_PROCESS: __webpack_require__(/*! ./POST_PROCESS_EVENT */ "../../../src/loader/events/POST_PROCESS_EVENT.js"), + PROGRESS: __webpack_require__(/*! ./PROGRESS_EVENT */ "../../../src/loader/events/PROGRESS_EVENT.js"), + START: __webpack_require__(/*! ./START_EVENT */ "../../../src/loader/events/START_EVENT.js") + +}; + + +/***/ }), + +/***/ "../../../src/loader/filetypes/ImageFile.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/filetypes/ImageFile.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); +var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); +var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); +var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +/** + * @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); + } + }, + + /** + * 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'); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture; + var linkFile = this.linkFile; + + if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + { + if (this.type === 'image') + { + texture = this.cache.addImage(this.key, this.data, linkFile.data); + } + else + { + texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); + } + + this.pendingDestroy(texture); + + linkFile.pendingDestroy(texture); + } + else if (!linkFile) + { + texture = this.cache.addImage(this.key, this.data); + + this.pendingDestroy(texture); + } + } + +}); + +/** + * 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. + * + * 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#addFileEvent + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), + +/***/ "../../../src/loader/filetypes/JSONFile.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/filetypes/JSONFile.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); +var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); +var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); +var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ "../../../src/utils/object/GetValue.js"); +var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +/** + * @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 {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". + * @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); + + if (IsPlainObject(url)) + { + // Object provided instead of a URL, so no need to actually load it (populate data with value) + 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; + + var json = JSON.parse(this.xhrLoader.responseText); + + 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#addFileEvent + * @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 {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". + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), + +/***/ "../../../src/loader/filetypes/TextFile.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/filetypes/TextFile.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); +var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); +var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); +var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +/** + * @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 extension = 'txt'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'text', + cache: loader.cacheManager.text, + 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#addFileEvent + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), + +/***/ "../../../src/math/Average.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Average.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Bernstein.js": +/*!************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Bernstein.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Factorial = __webpack_require__(/*! ./Factorial */ "../../../src/math/Factorial.js"); + +/** + * [description] + * + * @function Phaser.Math.Bernstein + * @since 3.0.0 + * + * @param {number} n - [description] + * @param {number} i - [description] + * + * @return {number} [description] + */ +var Bernstein = function (n, i) +{ + return Factorial(n) / Factorial(i) / Factorial(n - i); +}; + +module.exports = Bernstein; + + +/***/ }), + +/***/ "../../../src/math/Between.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Between.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} min - The minimum value. + * @param {integer} max - The maximum value. + * + * @return {integer} The random integer. + */ +var Between = function (min, max) +{ + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +module.exports = Between; + + +/***/ }), + +/***/ "../../../src/math/CatmullRom.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/CatmullRom.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a Catmull-Rom value. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - [description] + * @param {number} p0 - [description] + * @param {number} p1 - [description] + * @param {number} p2 - [description] + * @param {number} p3 - [description] + * + * @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; + + +/***/ }), + +/***/ "../../../src/math/CeilTo.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/CeilTo.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [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; + + +/***/ }), + +/***/ "../../../src/math/Clamp.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Clamp.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/DegToRad.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/DegToRad.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); + +/** + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {integer} 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; + + +/***/ }), + +/***/ "../../../src/math/Difference.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Difference.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Factorial.js": +/*!************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Factorial.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/FloatBetween.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/FloatBetween.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/FloorTo.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/FloorTo.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. + * @param {integer} [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; + + +/***/ }), + +/***/ "../../../src/math/FromPercent.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/FromPercent.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(/*! ./Clamp */ "../../../src/math/Clamp.js"); + +/** + * 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; +}; + +module.exports = FromPercent; + + +/***/ }), + +/***/ "../../../src/math/GetSpeed.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/GetSpeed.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the speed required to cover a distance in the time given. + * + * @function Phaser.Math.GetSpeed + * @since 3.0.0 + * + * @param {number} distance - The distance to travel in pixels. + * @param {integer} time - The time, in ms, to cover the distance in. + * + * @return {number} The amount you will need to increment the position by each step in order to cover the distance in the time given. + */ +var GetSpeed = function (distance, time) +{ + return (distance / time) / 1000; +}; + +module.exports = GetSpeed; + + +/***/ }), + +/***/ "../../../src/math/IsEven.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/IsEven.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/IsEvenStrict.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/IsEvenStrict.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Linear.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Linear.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Matrix3.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Matrix3.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - [description] + * + * @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; + + +/***/ }), + +/***/ "../../../src/math/Matrix4.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Matrix4.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * @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); + }, + + // TODO - Should work with basic values + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + 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]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + 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]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * 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 () + { + var out = this.val; + + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 0; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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 null; + } + + det = 1 / det; + + a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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]; + + a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); + a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); + a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); + a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); + a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); + a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); + a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); + a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - [description] + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = []; + var m1 = this.val; + var m2 = src.val; + + a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; + a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; + a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; + a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; + + a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; + a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; + a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; + a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; + + a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; + a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; + a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; + a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; + + a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; + a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; + a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; + a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; + + return this.fromArray(a); + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + translate: function (v) + { + var x = v.x; + var y = v.y; + var z = v.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; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + scale: function (v) + { + var x = v.x; + var y = v.y; + var z = v.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; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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; + + this.fromArray([ + 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 + ]); + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 null; + } + + 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]; + + // 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 + a[0] = a00 * b00 + a10 * b01 + a20 * b02; + a[1] = a01 * b00 + a11 * b01 + a21 * b02; + a[2] = a02 * b00 + a12 * b01 + a22 * b02; + a[3] = a03 * b00 + a13 * b01 + a23 * b02; + a[4] = a00 * b10 + a10 * b11 + a20 * b12; + a[5] = a01 * b10 + a11 * b11 + a21 * b12; + a[6] = a02 * b10 + a12 * b11 + a22 * b12; + a[7] = a03 * b10 + a13 * b11 + a23 * b12; + a[8] = a00 * b20 + a10 * b21 + a20 * b22; + a[9] = a01 * b20 + a11 * b21 + a21 * b22; + a[10] = a02 * b20 + a12 * b21 + a22 * b22; + a[11] = a03 * b20 + a13 * b21 + a23 * b22; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var out = this.val; + + 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; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = v.x; + out[13] = v.y; + out[14] = v.z; + out[15] = 1; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + fromQuat: function (q) + { + var out = this.val; + + 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; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var out = this.val; + + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + out[0] = (near * 2) * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (near * 2) * tb; + out[6] = 0; + out[7] = 0; + + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (far * near * 2) * nf; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var out = this.val; + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (2 * far * near) * nf; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + var out = this.val; + + out[0] = (2 * near) / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (2 * near) / height; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = -far / (near - far); + out[11] = 1; + + out[12] = 0; + out[13] = 0; + out[14] = (near * far) / (near - far); + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var out = this.val; + 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; + + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + + 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 {Phaser.Math.Matrix4} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var out = this.val; + + 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; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + + return this; + }, + + /** + * 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 - [description] + * @param {number} pitch - [description] + * @param {number} roll - [description] + * + * @return {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 !== undefined) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix !== undefined) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + } + +}); + +var _tempMat1 = new Matrix4(); +var _tempMat2 = new Matrix4(); + +module.exports = Matrix4; + + +/***/ }), + +/***/ "../../../src/math/MaxAdd.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/MaxAdd.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/MinSub.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/MinSub.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Percent.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Percent.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Quaternion.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Quaternion.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var Vector3 = __webpack_require__(/*! ./Vector3 */ "../../../src/math/Vector3.js"); +var Matrix3 = __webpack_require__(/*! ./Matrix3 */ "../../../src/math/Matrix3.js"); + +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] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + * @param {number} [w] - 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 + * @since 3.0.0 + */ + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.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; + } + }, + + /** + * 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) + { + this.x = src.x; + this.y = src.y; + this.z = src.z; + this.w = src.w; + + return this; + }, + + /** + * Set the components of this Quaternion. + * + * @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. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + 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 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; + + 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; + + 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; + + 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; + } + + 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; + + 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Quaternion#rotationTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - [description] + * @param {Phaser.Math.Vector3} b - [description] + * + * @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) + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + } + 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 () + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + }, + + /** + * 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); + + this.x = s * axis.x; + this.y = s * axis.y; + this.z = s * axis.z; + this.w = Math.cos(rad); + + return this; + }, + + /** + * 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; + + this.x = ax * bw + aw * bx + ay * bz - az * by; + this.y = ay * bw + aw * by + az * bx - ax * bz; + this.z = az * bw + aw * bz + ax * by - ay * bx; + this.w = aw * bw - ax * bx - ay * by - az * bz; + + return this; + }, + + /** + * 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 + this.x = scale0 * ax + scale1 * bx; + this.y = scale0 * ay + scale1 * by; + this.z = scale0 * az + scale1 * bz; + this.w = scale0 * aw + scale1 * bw; + + return this; + }, + + /** + * 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; + + // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + this.x = -a0 * invDot; + this.y = -a1 * invDot; + this.z = -a2 * invDot; + this.w = a3 * invDot; + + return this; + }, + + /** + * 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; + + 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); + + this.x = ax * bw + aw * bx; + this.y = ay * bw + az * bx; + this.z = az * bw - ay * bx; + this.w = aw * bw - ax * bx; + + return this; + }, + + /** + * 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); + + this.x = ax * bw - az * by; + this.y = ay * bw + aw * by; + this.z = az * bw + ax * by; + this.w = aw * bw - ay * by; + + return this; + }, + + /** + * 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); + + this.x = ax * bw + ay * bz; + this.y = ay * bw - ax * bz; + this.z = az * bw + aw * bz; + this.w = aw * bw - az * bz; + + return this; + }, + + /** + * 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; + }, + + /** + * 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; + } + + return this; + } + +}); + +module.exports = Quaternion; + + +/***/ }), + +/***/ "../../../src/math/RadToDeg.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/RadToDeg.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); + +/** + * 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 {integer} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), + +/***/ "../../../src/math/RandomXY.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/RandomXY.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RandomXYZ.js": +/*!************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RandomXYZ.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RandomXYZW.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RandomXYZW.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; } + + // TODO: Not spherical; should fix this for more uniform distribution + 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; + + +/***/ }), + +/***/ "../../../src/math/Rotate.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Rotate.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RotateAround.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RotateAround.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` by the given `angle`. + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @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.Geom.Point} The given point, rotated by the given angle around the given coordinates. + */ +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; + + +/***/ }), + +/***/ "../../../src/math/RotateAroundDistance.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RotateAroundDistance.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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`. + * + * @function Phaser.Math.RotateAroundDistance + * @since 3.0.0 + * + * @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.Geom.Point} 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; + + +/***/ }), + +/***/ "../../../src/math/RotateVec3.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RotateVec3.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector3 = __webpack_require__(/*! ../math/Vector3 */ "../../../src/math/Vector3.js"); +var Matrix4 = __webpack_require__(/*! ../math/Matrix4 */ "../../../src/math/Matrix4.js"); +var Quaternion = __webpack_require__(/*! ../math/Quaternion */ "../../../src/math/Quaternion.js"); + +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; + + +/***/ }), + +/***/ "../../../src/math/RoundAwayFromZero.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RoundAwayFromZero.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RoundTo.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/RoundTo.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {integer} [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; + + +/***/ }), + +/***/ "../../../src/math/SinCosTableGenerator.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/SinCosTableGenerator.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/SmoothStep.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/SmoothStep.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/SmootherStep.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/SmootherStep.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/ToXY.js": +/*!*******************************************!*\ + !*** D:/wamp/www/phaser/src/math/ToXY.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(/*! ./Vector2 */ "../../../src/math/Vector2.js"); + +/** + * Returns a Vec2 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 Vec2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {integer} index - The position within the grid to get the x/y value for. + * @param {integer} width - The width of the grid. + * @param {integer} 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; + } + + out.set(x, y); + } + + return out; +}; + +module.exports = ToXY; + + +/***/ }), + +/***/ "../../../src/math/TransformXY.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/TransformXY.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(/*! ./Vector2 */ "../../../src/math/Vector2.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/Vector2.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Vector2.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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] - The x component, or an object with `x` and `y` properties. + * @param {number} [y] - 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.Math.Vector2} 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.Math.Vector2} 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)); + }, + + /** + * 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; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector2#add + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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); + }, + + /** + * 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; + }, + + /** + * Right-hand normalize (make unit length) this Vector. + * + * @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; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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; + } + +}); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/Vector3.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Vector3.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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; + }, + + /** + * 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); + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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 Matrix. + * + * @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; + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/math/Vector4.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Vector4.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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) + { + // TODO: is this really the same as Vector3? + // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/ + // 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; + }, + + /** + * 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; + } + +}); + +// TODO: Check if these are required internally, if not, remove. +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; + + +/***/ }), + +/***/ "../../../src/math/Within.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Within.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Wrap.js": +/*!*******************************************!*\ + !*** D:/wamp/www/phaser/src/math/Wrap.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/Between.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Between.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/BetweenPoints.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/BetweenPoints.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} 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; + + +/***/ }), + +/***/ "../../../src/math/angle/BetweenPointsY.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/BetweenPointsY.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} 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; + + +/***/ }), + +/***/ "../../../src/math/angle/BetweenY.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/BetweenY.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/CounterClockwise.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/CounterClockwise.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ../const */ "../../../src/math/const.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/Normalize.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Normalize.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/Reverse.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Reverse.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Normalize = __webpack_require__(/*! ./Normalize */ "../../../src/math/angle/Normalize.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/RotateTo.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/RotateTo.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(/*! ../const */ "../../../src/math/const.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/ShortestBetween.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/ShortestBetween.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. + * + * TODO: Wrap the angles in this function? + * + * @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; + + +/***/ }), + +/***/ "../../../src/math/angle/Wrap.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Wrap.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathWrap = __webpack_require__(/*! ../Wrap */ "../../../src/math/Wrap.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/WrapDegrees.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/WrapDegrees.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(/*! ../Wrap */ "../../../src/math/Wrap.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/index.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/index.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Angle + */ + +module.exports = { + + Between: __webpack_require__(/*! ./Between */ "../../../src/math/angle/Between.js"), + BetweenPoints: __webpack_require__(/*! ./BetweenPoints */ "../../../src/math/angle/BetweenPoints.js"), + BetweenPointsY: __webpack_require__(/*! ./BetweenPointsY */ "../../../src/math/angle/BetweenPointsY.js"), + BetweenY: __webpack_require__(/*! ./BetweenY */ "../../../src/math/angle/BetweenY.js"), + CounterClockwise: __webpack_require__(/*! ./CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"), + Normalize: __webpack_require__(/*! ./Normalize */ "../../../src/math/angle/Normalize.js"), + Reverse: __webpack_require__(/*! ./Reverse */ "../../../src/math/angle/Reverse.js"), + RotateTo: __webpack_require__(/*! ./RotateTo */ "../../../src/math/angle/RotateTo.js"), + ShortestBetween: __webpack_require__(/*! ./ShortestBetween */ "../../../src/math/angle/ShortestBetween.js"), + Wrap: __webpack_require__(/*! ./Wrap */ "../../../src/math/angle/Wrap.js"), + WrapDegrees: __webpack_require__(/*! ./WrapDegrees */ "../../../src/math/angle/WrapDegrees.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/const.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/math/const.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + +}; + +module.exports = MATH_CONST; + + +/***/ }), + +/***/ "../../../src/math/distance/DistanceBetween.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/DistanceBetween.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/distance/DistancePower.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/DistancePower.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/distance/DistanceSquared.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/DistanceSquared.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/distance/index.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/index.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Distance + */ + +module.exports = { + + Between: __webpack_require__(/*! ./DistanceBetween */ "../../../src/math/distance/DistanceBetween.js"), + Power: __webpack_require__(/*! ./DistancePower */ "../../../src/math/distance/DistancePower.js"), + Squared: __webpack_require__(/*! ./DistanceSquared */ "../../../src/math/distance/DistanceSquared.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/back/In.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/In.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/back/InOut.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/InOut.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/back/Out.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/Out.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/back/index.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Back + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/back/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/back/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/back/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/In.js": +/*!*******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/In.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/InOut.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/InOut.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/Out.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/Out.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/bounce/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/bounce/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/bounce/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/In.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/In.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/InOut.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/InOut.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/Out.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/Out.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/index.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/index.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/circular/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/circular/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/circular/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/In.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/In.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/InOut.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/InOut.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/Out.js": +/*!*******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/Out.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/index.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/index.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/cubic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/cubic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/cubic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/In.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/In.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/InOut.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/InOut.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/Out.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/Out.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/elastic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/elastic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/elastic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/In.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/In.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/InOut.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/InOut.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/Out.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/Out.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/index.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/expo/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/expo/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/expo/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/index.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/index.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing + */ + +module.exports = { + + Back: __webpack_require__(/*! ./back */ "../../../src/math/easing/back/index.js"), + Bounce: __webpack_require__(/*! ./bounce */ "../../../src/math/easing/bounce/index.js"), + Circular: __webpack_require__(/*! ./circular */ "../../../src/math/easing/circular/index.js"), + Cubic: __webpack_require__(/*! ./cubic */ "../../../src/math/easing/cubic/index.js"), + Elastic: __webpack_require__(/*! ./elastic */ "../../../src/math/easing/elastic/index.js"), + Expo: __webpack_require__(/*! ./expo */ "../../../src/math/easing/expo/index.js"), + Linear: __webpack_require__(/*! ./linear */ "../../../src/math/easing/linear/index.js"), + Quadratic: __webpack_require__(/*! ./quadratic */ "../../../src/math/easing/quadratic/index.js"), + Quartic: __webpack_require__(/*! ./quartic */ "../../../src/math/easing/quartic/index.js"), + Quintic: __webpack_require__(/*! ./quintic */ "../../../src/math/easing/quintic/index.js"), + Sine: __webpack_require__(/*! ./sine */ "../../../src/math/easing/sine/index.js"), + Stepped: __webpack_require__(/*! ./stepped */ "../../../src/math/easing/stepped/index.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/linear/Linear.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/linear/Linear.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Linear easing (no variation). + * + * @function Phaser.Math.Easing.Linear.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; + + +/***/ }), + +/***/ "../../../src/math/easing/linear/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/linear/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Linear + */ + +module.exports = __webpack_require__(/*! ./Linear */ "../../../src/math/easing/linear/Linear.js"); + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/In.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/In.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/InOut.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/InOut.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/Out.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/Out.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/index.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/index.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/quadratic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/quadratic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/quadratic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/In.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/In.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/InOut.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/InOut.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/Out.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/Out.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/quartic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/quartic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/quartic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/In.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/In.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/InOut.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/InOut.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/Out.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/Out.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/quintic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/quintic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/quintic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/In.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/In.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/InOut.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/InOut.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/Out.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/Out.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/index.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/sine/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/sine/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/sine/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/stepped/Stepped.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/stepped/Stepped.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Stepped easing. + * + * @function Phaser.Math.Easing.Stepped.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; + + +/***/ }), + +/***/ "../../../src/math/easing/stepped/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/stepped/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(/*! ./Stepped */ "../../../src/math/easing/stepped/Stepped.js"); + + +/***/ }), + +/***/ "../../../src/math/fuzzy/Ceil.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/Ceil.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/Equal.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/Equal.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/Floor.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/Floor.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/GreaterThan.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/GreaterThan.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/LessThan.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/LessThan.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/index.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/index.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Fuzzy + */ + +module.exports = { + + Ceil: __webpack_require__(/*! ./Ceil */ "../../../src/math/fuzzy/Ceil.js"), + Equal: __webpack_require__(/*! ./Equal */ "../../../src/math/fuzzy/Equal.js"), + Floor: __webpack_require__(/*! ./Floor */ "../../../src/math/fuzzy/Floor.js"), + GreaterThan: __webpack_require__(/*! ./GreaterThan */ "../../../src/math/fuzzy/GreaterThan.js"), + LessThan: __webpack_require__(/*! ./LessThan */ "../../../src/math/fuzzy/LessThan.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/index.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/math/index.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); +var Extend = __webpack_require__(/*! ../utils/object/Extend */ "../../../src/utils/object/Extend.js"); + +/** + * @namespace Phaser.Math + */ + +var PhaserMath = { + + // Collections of functions + Angle: __webpack_require__(/*! ./angle/ */ "../../../src/math/angle/index.js"), + Distance: __webpack_require__(/*! ./distance/ */ "../../../src/math/distance/index.js"), + Easing: __webpack_require__(/*! ./easing/ */ "../../../src/math/easing/index.js"), + Fuzzy: __webpack_require__(/*! ./fuzzy/ */ "../../../src/math/fuzzy/index.js"), + Interpolation: __webpack_require__(/*! ./interpolation/ */ "../../../src/math/interpolation/index.js"), + Pow2: __webpack_require__(/*! ./pow2/ */ "../../../src/math/pow2/index.js"), + Snap: __webpack_require__(/*! ./snap/ */ "../../../src/math/snap/index.js"), + + // Expose the RNG Class + RandomDataGenerator: __webpack_require__(/*! ./random-data-generator/RandomDataGenerator */ "../../../src/math/random-data-generator/RandomDataGenerator.js"), + + // Single functions + Average: __webpack_require__(/*! ./Average */ "../../../src/math/Average.js"), + Bernstein: __webpack_require__(/*! ./Bernstein */ "../../../src/math/Bernstein.js"), + Between: __webpack_require__(/*! ./Between */ "../../../src/math/Between.js"), + CatmullRom: __webpack_require__(/*! ./CatmullRom */ "../../../src/math/CatmullRom.js"), + CeilTo: __webpack_require__(/*! ./CeilTo */ "../../../src/math/CeilTo.js"), + Clamp: __webpack_require__(/*! ./Clamp */ "../../../src/math/Clamp.js"), + DegToRad: __webpack_require__(/*! ./DegToRad */ "../../../src/math/DegToRad.js"), + Difference: __webpack_require__(/*! ./Difference */ "../../../src/math/Difference.js"), + Factorial: __webpack_require__(/*! ./Factorial */ "../../../src/math/Factorial.js"), + FloatBetween: __webpack_require__(/*! ./FloatBetween */ "../../../src/math/FloatBetween.js"), + FloorTo: __webpack_require__(/*! ./FloorTo */ "../../../src/math/FloorTo.js"), + FromPercent: __webpack_require__(/*! ./FromPercent */ "../../../src/math/FromPercent.js"), + GetSpeed: __webpack_require__(/*! ./GetSpeed */ "../../../src/math/GetSpeed.js"), + IsEven: __webpack_require__(/*! ./IsEven */ "../../../src/math/IsEven.js"), + IsEvenStrict: __webpack_require__(/*! ./IsEvenStrict */ "../../../src/math/IsEvenStrict.js"), + Linear: __webpack_require__(/*! ./Linear */ "../../../src/math/Linear.js"), + MaxAdd: __webpack_require__(/*! ./MaxAdd */ "../../../src/math/MaxAdd.js"), + MinSub: __webpack_require__(/*! ./MinSub */ "../../../src/math/MinSub.js"), + Percent: __webpack_require__(/*! ./Percent */ "../../../src/math/Percent.js"), + RadToDeg: __webpack_require__(/*! ./RadToDeg */ "../../../src/math/RadToDeg.js"), + RandomXY: __webpack_require__(/*! ./RandomXY */ "../../../src/math/RandomXY.js"), + RandomXYZ: __webpack_require__(/*! ./RandomXYZ */ "../../../src/math/RandomXYZ.js"), + RandomXYZW: __webpack_require__(/*! ./RandomXYZW */ "../../../src/math/RandomXYZW.js"), + Rotate: __webpack_require__(/*! ./Rotate */ "../../../src/math/Rotate.js"), + RotateAround: __webpack_require__(/*! ./RotateAround */ "../../../src/math/RotateAround.js"), + RotateAroundDistance: __webpack_require__(/*! ./RotateAroundDistance */ "../../../src/math/RotateAroundDistance.js"), + RoundAwayFromZero: __webpack_require__(/*! ./RoundAwayFromZero */ "../../../src/math/RoundAwayFromZero.js"), + RoundTo: __webpack_require__(/*! ./RoundTo */ "../../../src/math/RoundTo.js"), + SinCosTableGenerator: __webpack_require__(/*! ./SinCosTableGenerator */ "../../../src/math/SinCosTableGenerator.js"), + SmootherStep: __webpack_require__(/*! ./SmootherStep */ "../../../src/math/SmootherStep.js"), + SmoothStep: __webpack_require__(/*! ./SmoothStep */ "../../../src/math/SmoothStep.js"), + ToXY: __webpack_require__(/*! ./ToXY */ "../../../src/math/ToXY.js"), + TransformXY: __webpack_require__(/*! ./TransformXY */ "../../../src/math/TransformXY.js"), + Within: __webpack_require__(/*! ./Within */ "../../../src/math/Within.js"), + Wrap: __webpack_require__(/*! ./Wrap */ "../../../src/math/Wrap.js"), + + // Vector classes + Vector2: __webpack_require__(/*! ./Vector2 */ "../../../src/math/Vector2.js"), + Vector3: __webpack_require__(/*! ./Vector3 */ "../../../src/math/Vector3.js"), + Vector4: __webpack_require__(/*! ./Vector4 */ "../../../src/math/Vector4.js"), + Matrix3: __webpack_require__(/*! ./Matrix3 */ "../../../src/math/Matrix3.js"), + Matrix4: __webpack_require__(/*! ./Matrix4 */ "../../../src/math/Matrix4.js"), + Quaternion: __webpack_require__(/*! ./Quaternion */ "../../../src/math/Quaternion.js"), + RotateVec3: __webpack_require__(/*! ./RotateVec3 */ "../../../src/math/RotateVec3.js") + +}; + +// Merge in the consts + +PhaserMath = Extend(false, PhaserMath, CONST); + +// Export it + +module.exports = PhaserMath; + + +/***/ }), + +/***/ "../../../src/math/interpolation/BezierInterpolation.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/BezierInterpolation.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bernstein = __webpack_require__(/*! ../Bernstein */ "../../../src/math/Bernstein.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/CatmullRomInterpolation.js": +/*!****************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/CatmullRomInterpolation.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CatmullRom = __webpack_require__(/*! ../CatmullRom */ "../../../src/math/CatmullRom.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/CubicBezierInterpolation.js": +/*!*****************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/CubicBezierInterpolation.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/LinearInterpolation.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/LinearInterpolation.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Linear = __webpack_require__(/*! ../Linear */ "../../../src/math/Linear.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/QuadraticBezierInterpolation.js": +/*!*********************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/QuadraticBezierInterpolation.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/SmoothStepInterpolation.js": +/*!****************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/SmoothStepInterpolation.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmoothStep = __webpack_require__(/*! ../SmoothStep */ "../../../src/math/SmoothStep.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/SmootherStepInterpolation.js": +/*!******************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/SmootherStepInterpolation.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmootherStep = __webpack_require__(/*! ../SmootherStep */ "../../../src/math/SmootherStep.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Interpolation + */ + +module.exports = { + + Bezier: __webpack_require__(/*! ./BezierInterpolation */ "../../../src/math/interpolation/BezierInterpolation.js"), + CatmullRom: __webpack_require__(/*! ./CatmullRomInterpolation */ "../../../src/math/interpolation/CatmullRomInterpolation.js"), + CubicBezier: __webpack_require__(/*! ./CubicBezierInterpolation */ "../../../src/math/interpolation/CubicBezierInterpolation.js"), + Linear: __webpack_require__(/*! ./LinearInterpolation */ "../../../src/math/interpolation/LinearInterpolation.js"), + QuadraticBezier: __webpack_require__(/*! ./QuadraticBezierInterpolation */ "../../../src/math/interpolation/QuadraticBezierInterpolation.js"), + SmoothStep: __webpack_require__(/*! ./SmoothStepInterpolation */ "../../../src/math/interpolation/SmoothStepInterpolation.js"), + SmootherStep: __webpack_require__(/*! ./SmootherStepInterpolation */ "../../../src/math/interpolation/SmootherStepInterpolation.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/pow2/GetPowerOfTwo.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/GetPowerOfTwo.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.GetPowerOfTwo + * @since 3.0.0 + * + * @param {number} value - The value. + * + * @return {integer} 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; + + +/***/ }), + +/***/ "../../../src/math/pow2/IsSizePowerOfTwo.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/IsSizePowerOfTwo.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsSizePowerOfTwo + * @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; + + +/***/ }), + +/***/ "../../../src/math/pow2/IsValuePowerOfTwo.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/IsValuePowerOfTwo.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsValuePowerOfTwo + * @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; + + +/***/ }), + +/***/ "../../../src/math/pow2/index.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/index.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Pow2 + */ + +module.exports = { + + GetNext: __webpack_require__(/*! ./GetPowerOfTwo */ "../../../src/math/pow2/GetPowerOfTwo.js"), + IsSize: __webpack_require__(/*! ./IsSizePowerOfTwo */ "../../../src/math/pow2/IsSizePowerOfTwo.js"), + IsValue: __webpack_require__(/*! ./IsValuePowerOfTwo */ "../../../src/math/pow2/IsValuePowerOfTwo.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/random-data-generator/RandomDataGenerator.js": +/*!********************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/random-data-generator/RandomDataGenerator.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} [array] - The array to be shuffled. + * + * @return {array} 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; + + +/***/ }), + +/***/ "../../../src/math/snap/SnapCeil.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/SnapCeil.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/snap/SnapFloor.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/SnapFloor.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/snap/SnapTo.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/SnapTo.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/snap/index.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/index.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Snap + */ + +module.exports = { + + Ceil: __webpack_require__(/*! ./SnapCeil */ "../../../src/math/snap/SnapCeil.js"), + Floor: __webpack_require__(/*! ./SnapFloor */ "../../../src/math/snap/SnapFloor.js"), + To: __webpack_require__(/*! ./SnapTo */ "../../../src/math/snap/SnapTo.js") + +}; + + +/***/ }), + +/***/ "../../../src/plugins/BasePlugin.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/plugins/BasePlugin.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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; + + /** + * 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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#scene + * @type {?Phaser.Scene} + * @protected + * @since 3.8.0 + */ + this.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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#systems + * @type {?Phaser.Scenes.Systems} + * @protected + * @since 3.8.0 + */ + this.systems; + }, + + /** + * Called by the PluginManager when this 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. + * + * @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 () + { + }, + + /** + * Called by the PluginManager when this plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + * + * @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); + }, + + /** + * Called by the PluginManager when this 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. + * + * @method Phaser.Plugins.BasePlugin#stop + * @since 3.8.0 + */ + stop: function () + { + }, + + /** + * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots. + * By this point the plugin properties `scene` and `systems` will have already been set. + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + * + * @method Phaser.Plugins.BasePlugin#boot + * @since 3.8.0 + */ + boot: function () + { + // Here are the Scene events you can listen to. + // At the very least you should offer a destroy handler for when the Scene closes down. + + // var eventEmitter = this.systems.events; + + // eventEmitter.once('destroy', this.sceneDestroy, this); + // eventEmitter.on('start', this.sceneStart, this); + // eventEmitter.on('preupdate', this.scenePreUpdate, this); + // eventEmitter.on('update', this.sceneUpdate, this); + // eventEmitter.on('postupdate', this.scenePostUpdate, this); + // eventEmitter.on('pause', this.scenePause, this); + // eventEmitter.on('resume', this.sceneResume, this); + // eventEmitter.on('sleep', this.sceneSleep, this); + // eventEmitter.on('wake', this.sceneWake, this); + // eventEmitter.on('shutdown', this.sceneShutdown, this); + // eventEmitter.on('destroy', this.sceneDestroy, this); + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/plugins/ScenePlugin.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/plugins/ScenePlugin.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var BasePlugin = __webpack_require__(/*! ./BasePlugin */ "../../../src/plugins/BasePlugin.js"); +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var SceneEvents = __webpack_require__(/*! ../scene/events */ "../../../src/scene/events/index.js"); + +/** + * @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. + */ +var ScenePlugin = new Class({ + + Extends: BasePlugin, + + initialize: + + function ScenePlugin (scene, pluginManager) + { + BasePlugin.call(this, pluginManager); + + this.scene = scene; + this.systems = scene.sys; + + 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 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 () + { + } + +}); + +module.exports = ScenePlugin; + + +/***/ }), + +/***/ "../../../src/renderer/BlendModes.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/renderer/BlendModes.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + DIFFERENCE: 11, + + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + * + * @name Phaser.BlendModes.EXCLUSION + * @type {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + LUMINOSITY: 16, + + /** + * Alpha erase blend mode. For Canvas and WebGL. + * + * @name Phaser.BlendModes.ERASE + * @type {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + LIGHTER: 25, + + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + * + * @name Phaser.BlendModes.COPY + * @type {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + XOR: 27 + +}; + + +/***/ }), + +/***/ "../../../src/renderer/ScaleModes.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/renderer/ScaleModes.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @readonly + * @since 3.0.0 + */ + DEFAULT: 0, + + /** + * Linear Scale Mode. + * + * @name Phaser.ScaleModes.LINEAR + * @type {integer} + * @readonly + * @since 3.0.0 + */ + LINEAR: 0, + + /** + * Nearest Scale Mode. + * + * @name Phaser.ScaleModes.NEAREST + * @type {integer} + * @readonly + * @since 3.0.0 + */ + NEAREST: 1 + +}; + +module.exports = ScaleModes; + + +/***/ }), + +/***/ "../../../src/scale/events/RESIZE_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scale/events/RESIZE_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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 multiplied by resolution. + * @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} resolution - The current resolution. Defaults to 1 at the moment. + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/BOOT_EVENT.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/BOOT_EVENT.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('boot', listener)`. + * + * @event Phaser.Scenes.Events#BOOT + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/CREATE_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/CREATE_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('create', listener)`. + * + * @event Phaser.Scenes.Events#CREATE + * @since 3.17.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. + */ +module.exports = 'create'; + + +/***/ }), + +/***/ "../../../src/scene/events/DESTROY_EVENT.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/DESTROY_EVENT.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/PAUSE_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/PAUSE_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('pause', listener)`. + * + * @event Phaser.Scenes.Events#PAUSE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/POST_UPDATE_EVENT.js": +/*!****************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/POST_UPDATE_EVENT.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#POST_UPDATE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/PRE_UPDATE_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/PRE_UPDATE_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#PRE_UPDATE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/READY_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/READY_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('ready', listener)`. + * + * @event Phaser.Scenes.Events#READY + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/RENDER_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/RENDER_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('render', listener)`. + * + * A Scene will only render if it is visible and active. + * By the time this event is dispatched, the Scene will have already been rendered. + * + * @event Phaser.Scenes.Events#RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'render'; + + +/***/ }), + +/***/ "../../../src/scene/events/RESUME_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/RESUME_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('resume', listener)`. + * + * @event Phaser.Scenes.Events#RESUME + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/SHUTDOWN_EVENT.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/SHUTDOWN_EVENT.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/SLEEP_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/SLEEP_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('sleep', listener)`. + * + * @event Phaser.Scenes.Events#SLEEP + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/START_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/START_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('start', listener)`. + * + * @event Phaser.Scenes.Events#START + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_COMPLETE_EVENT.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @since 3.5.0 + * + * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. + */ +module.exports = 'transitioncomplete'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_INIT_EVENT.js": +/*!********************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_INIT_EVENT.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_OUT_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_OUT_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_START_EVENT.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_START_EVENT.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_WAKE_EVENT.js": +/*!********************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/UPDATE_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/UPDATE_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#UPDATE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/WAKE_EVENT.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/WAKE_EVENT.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('wake', listener)`. + * + * @event Phaser.Scenes.Events#WAKE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/index.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/index.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Scenes.Events + */ + +module.exports = { + + BOOT: __webpack_require__(/*! ./BOOT_EVENT */ "../../../src/scene/events/BOOT_EVENT.js"), + CREATE: __webpack_require__(/*! ./CREATE_EVENT */ "../../../src/scene/events/CREATE_EVENT.js"), + DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ "../../../src/scene/events/DESTROY_EVENT.js"), + PAUSE: __webpack_require__(/*! ./PAUSE_EVENT */ "../../../src/scene/events/PAUSE_EVENT.js"), + POST_UPDATE: __webpack_require__(/*! ./POST_UPDATE_EVENT */ "../../../src/scene/events/POST_UPDATE_EVENT.js"), + PRE_UPDATE: __webpack_require__(/*! ./PRE_UPDATE_EVENT */ "../../../src/scene/events/PRE_UPDATE_EVENT.js"), + READY: __webpack_require__(/*! ./READY_EVENT */ "../../../src/scene/events/READY_EVENT.js"), + RENDER: __webpack_require__(/*! ./RENDER_EVENT */ "../../../src/scene/events/RENDER_EVENT.js"), + RESUME: __webpack_require__(/*! ./RESUME_EVENT */ "../../../src/scene/events/RESUME_EVENT.js"), + SHUTDOWN: __webpack_require__(/*! ./SHUTDOWN_EVENT */ "../../../src/scene/events/SHUTDOWN_EVENT.js"), + SLEEP: __webpack_require__(/*! ./SLEEP_EVENT */ "../../../src/scene/events/SLEEP_EVENT.js"), + START: __webpack_require__(/*! ./START_EVENT */ "../../../src/scene/events/START_EVENT.js"), + TRANSITION_COMPLETE: __webpack_require__(/*! ./TRANSITION_COMPLETE_EVENT */ "../../../src/scene/events/TRANSITION_COMPLETE_EVENT.js"), + TRANSITION_INIT: __webpack_require__(/*! ./TRANSITION_INIT_EVENT */ "../../../src/scene/events/TRANSITION_INIT_EVENT.js"), + TRANSITION_OUT: __webpack_require__(/*! ./TRANSITION_OUT_EVENT */ "../../../src/scene/events/TRANSITION_OUT_EVENT.js"), + TRANSITION_START: __webpack_require__(/*! ./TRANSITION_START_EVENT */ "../../../src/scene/events/TRANSITION_START_EVENT.js"), + TRANSITION_WAKE: __webpack_require__(/*! ./TRANSITION_WAKE_EVENT */ "../../../src/scene/events/TRANSITION_WAKE_EVENT.js"), + UPDATE: __webpack_require__(/*! ./UPDATE_EVENT */ "../../../src/scene/events/UPDATE_EVENT.js"), + WAKE: __webpack_require__(/*! ./WAKE_EVENT */ "../../../src/scene/events/WAKE_EVENT.js") + +}; + + +/***/ }), + +/***/ "../../../src/utils/Class.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/utils/Class.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// 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; +} + +/** + * Extends the given `myClass` object's prototype with the properties of `definition`. + * + * @function extend + * @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. + */ +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]; + } + } +} + +/** + * Applies the given `mixins` to the prototype of `myClass`. + * + * @function mixin + * @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) + { + return; + } + + if (!Array.isArray(mixins)) + { + mixins = [ mixins ]; + } + + 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; + + +/***/ }), + +/***/ "../../../src/utils/NOOP.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/utils/NOOP.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/utils/object/Extend.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/Extend.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsPlainObject = __webpack_require__(/*! ./IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +// @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 + * + * @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; + + +/***/ }), + +/***/ "../../../src/utils/object/GetAdvancedValue.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/GetAdvancedValue.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH = __webpack_require__(/*! ../../math */ "../../../src/math/index.js"); +var GetValue = __webpack_require__(/*! ./GetValue */ "../../../src/utils/object/GetValue.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/utils/object/GetFastValue.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/GetFastValue.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/utils/object/GetValue.js": +/*!*******************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/GetValue.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Source object +// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' +// The default value to use if the key doesn't exist + +/** + * Retrieves a value from an object. + * + * @function Phaser.Utils.Objects.GetValue + * @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 GetValue = function (source, key, defaultValue) +{ + if (!source || typeof source === 'number') + { + return defaultValue; + } + else if (source.hasOwnProperty(key)) + { + return source[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parent = source; + var value = defaultValue; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parent.hasOwnProperty(keys[i])) + { + // Yes it has a key property, let's carry on down + value = parent[keys[i]]; + + parent = parent[keys[i]]; + } + else + { + // Can't go any further, so reset to default + value = defaultValue; + break; + } + } + + return value; + } + else + { + return defaultValue; + } +}; + +module.exports = GetValue; + + +/***/ }), + +/***/ "../../../src/utils/object/IsPlainObject.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/IsPlainObject.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 (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; + + +/***/ }), + +/***/ "./SpineFile.js": +/*!**********************!*\ + !*** ./SpineFile.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Class = __webpack_require__(/*! ../../../src/utils/Class */ "../../../src/utils/Class.js"); +var GetFastValue = __webpack_require__(/*! ../../../src/utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var ImageFile = __webpack_require__(/*! ../../../src/loader/filetypes/ImageFile.js */ "../../../src/loader/filetypes/ImageFile.js"); +var IsPlainObject = __webpack_require__(/*! ../../../src/utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); +var JSONFile = __webpack_require__(/*! ../../../src/loader/filetypes/JSONFile.js */ "../../../src/loader/filetypes/JSONFile.js"); +var MultiFile = __webpack_require__(/*! ../../../src/loader/MultiFile.js */ "../../../src/loader/MultiFile.js"); +var TextFile = __webpack_require__(/*! ../../../src/loader/filetypes/TextFile.js */ "../../../src/loader/filetypes/TextFile.js"); + +/** + * @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} [textureURL] - The absolute or relative URL to load the texture image file from. + * @property {string} [textureExtension='png'] - The default file extension to use for the image texture if no url is provided. + * @property {XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture image file. + * @property {string} [normalMap] - The filename of an associated normal map. It uses the same path and url to load as the texture image. + * @property {string} [atlasURL] - The absolute or relative URL to load the atlas data file from. + * @property {string} [atlasExtension='txt'] - The default file extension to use for the atlas data if no url is provided. + * @property {XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas data file. + */ + +/** + * @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, + 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 = []; + + 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', currentBaseURL); + var path = GetFastValue(config, 'path', currentPath); + var prefix = GetFastValue(config, 'prefix', currentPrefix); + 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 = '_SP_' + textureURL; + + var image = new ImageFile(loader, key, textureURL, textureXhrSettings); + + 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 combinedAtlastData = ''; + var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; + + for (var i = 1; i < this.files.length; i++) + { + var file = this.files[i]; + + if (file.type === 'text') + { + atlasKey = file.key.substr(0, file.key.length - 2); + + atlasCache = file.cache; + + combinedAtlastData = combinedAtlastData.concat(file.data); + } + else + { + var key = file.key.substr(4).trim(); + + this.loader.textureManager.addImage(key, file.data); + } + + file.pendingDestroy(); + } + + atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlastData }); + + this.complete = true; + } + } + +}); + +module.exports = SpineFile; + + +/***/ }), + +/***/ "./SpinePlugin.js": +/*!************************!*\ + !*** ./SpinePlugin.js ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var BuildGameObject = __webpack_require__(/*! ../../../src/gameobjects/BuildGameObject */ "../../../src/gameobjects/BuildGameObject.js"); +var Class = __webpack_require__(/*! ../../../src/utils/Class */ "../../../src/utils/Class.js"); +var GetValue = __webpack_require__(/*! ../../../src/utils/object/GetValue */ "../../../src/utils/object/GetValue.js"); +var ResizeEvent = __webpack_require__(/*! ../../../src/scale/events/RESIZE_EVENT */ "../../../src/scale/events/RESIZE_EVENT.js"); +var ScenePlugin = __webpack_require__(/*! ../../../src/plugins/ScenePlugin */ "../../../src/plugins/ScenePlugin.js"); +var Spine = __webpack_require__(/*! Spine */ "./runtimes/spine-canvas.js"); +var SpineFile = __webpack_require__(/*! ./SpineFile */ "./SpineFile.js"); +var SpineGameObject = __webpack_require__(/*! ./gameobject/SpineGameObject */ "./gameobject/SpineGameObject.js"); + +/** + * @classdesc + * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game objects. + * + * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin + * uses the Spine 3.7 runtimes. Files created in a more recent version of Spine may not work as a result. + * + * You can find more details about Spine at http://esotericsoftware.com/. + * + * 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. + * + * 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 a Game Object Factory method, allowin you to create Spine Game Objects: + * + * ```javascript + * this.add.spine(512, 650, 'stretchyman') + * ``` + * + * 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 preMultipiedAlpha 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. + * + * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference + * + * @class SpinePlugin + * @memberOf Phaser + * @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. + */ +var SpinePlugin = new Class({ + + Extends: ScenePlugin, + + initialize: + + function SpinePlugin (scene, pluginManager) + { + ScenePlugin.call(this, scene, pluginManager); + + 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. + * + * 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; + } + + pluginManager.registerFileType('spine', this.spineFileCallback, scene); + + pluginManager.registerGameObject('spine', this.add.bind(this), this.make.bind(this)); + }, + + /** + * 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); + }, + + /** + * 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 () + { + this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + + // Monkeypatch the Spine setBlendMode functions, or batching is destroyed + + var setBlendMode = function (srcBlend, dstBlend) + { + if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend) + { + var gl = this.context.gl; + + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + + if (this.isDrawing) + { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + } + }; + + this.sceneRenderer.batcher.setBlendMode = setBlendMode; + this.sceneRenderer.shapes.setBlendMode = setBlendMode; + + this.skeletonRenderer = this.sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = this.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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage()); + + spineTextures.add(key, canvasTexture); + + return canvasTexture; + }); + } + + 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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + var gl = this.sceneRenderer.context.gl; + + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage(), false); + + spineTextures.add(key, glTexture); + + return glTexture; + }); + } + + 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 preMultipiedAlpha 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#addFileEvent + * @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} [preMultipiedAlpha=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. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ + spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings) + { + var multifile; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new SpineFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; + }, + + /** + * 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. + */ + add: function (x, y, key, animationName, loop) + { + var spineGO = new SpineGameObject(this.scene, this, x, y, key, animationName, loop); + + this.scene.sys.displayList.add(spineGO); + this.scene.sys.updateList.add(spineGO); + + return spineGO; + }, + + /** + * 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. + */ + 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 spineGO = new SpineGameObject(this.scene, this, 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(); + }, + + /** + * 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 Spine.Vector2(temp2.x, temp2.y); + } + else if (bone) + { + return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y); + } + else + { + return new Spine.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 Spine.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; + } + + var preMultipliedAlpha = atlasData.preMultipliedAlpha; + + var atlasLoader = new Spine.AtlasAttachmentLoader(atlas); + + var skeletonJson = new Spine.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 Spine.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 Spine.AnimationStateData(skeleton.data); + + var state = new Spine.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 Spine.Vector2(); + var size = new Spine.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.viewportWidth = viewportWidth; + sceneRenderer.camera.viewportHeight = 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); + + this.sceneRenderer.dispose(); + }, + + /** + * 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.pluginManager.removeGameObject('spine', true, true); + + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; + + this.cache = null; + this.spineTextures = null; + this.json = null; + this.textures = null; + this.sceneRenderer = null; + this.skeletonRenderer = null; + this.gl = null; + } + +}); + +module.exports = SpinePlugin; + + +/***/ }), + +/***/ "./events/COMPLETE_EVENT.js": +/*!**********************************!*\ + !*** ./events/COMPLETE_EVENT.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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'; + + +/***/ }), + +/***/ "./events/DISPOSE_EVENT.js": +/*!*********************************!*\ + !*** ./events/DISPOSE_EVENT.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#DISPOSE + * @since 3.19.0 + */ +module.exports = 'dispose'; + + +/***/ }), + +/***/ "./events/END_EVENT.js": +/*!*****************************!*\ + !*** ./events/END_EVENT.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#END + * @since 3.19.0 + */ +module.exports = 'end'; + + +/***/ }), + +/***/ "./events/EVENT_EVENT.js": +/*!*******************************!*\ + !*** ./events/EVENT_EVENT.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#EVENT + * @since 3.19.0 + */ +module.exports = 'event'; + + +/***/ }), + +/***/ "./events/INTERRUPTED_EVENT.js": +/*!*************************************!*\ + !*** ./events/INTERRUPTED_EVENT.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#INTERRUPTED + * @since 3.19.0 + */ +module.exports = 'interrupted'; + + +/***/ }), + +/***/ "./events/START_EVENT.js": +/*!*******************************!*\ + !*** ./events/START_EVENT.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#START + * @since 3.19.0 + */ +module.exports = 'start'; + + +/***/ }), + +/***/ "./events/index.js": +/*!*************************!*\ + !*** ./events/index.js ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace SpinePluginEvents + */ + +module.exports = { + + COMPLETE: __webpack_require__(/*! ./COMPLETE_EVENT */ "./events/COMPLETE_EVENT.js"), + DISPOSE: __webpack_require__(/*! ./DISPOSE_EVENT */ "./events/DISPOSE_EVENT.js"), + END: __webpack_require__(/*! ./END_EVENT */ "./events/END_EVENT.js"), + EVENT: __webpack_require__(/*! ./EVENT_EVENT */ "./events/EVENT_EVENT.js"), + INTERRUPTED: __webpack_require__(/*! ./INTERRUPTED_EVENT */ "./events/INTERRUPTED_EVENT.js"), + START: __webpack_require__(/*! ./START_EVENT */ "./events/START_EVENT.js") + +}; + + +/***/ }), + +/***/ "./gameobject/SpineGameObject.js": +/*!***************************************!*\ + !*** ./gameobject/SpineGameObject.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var AngleBetween = __webpack_require__(/*! ../../../../src/math/angle/Between */ "../../../src/math/angle/Between.js"); +var Clamp = __webpack_require__(/*! ../../../../src/math/Clamp */ "../../../src/math/Clamp.js"); +var Class = __webpack_require__(/*! ../../../../src/utils/Class */ "../../../src/utils/Class.js"); +var ComponentsComputedSize = __webpack_require__(/*! ../../../../src/gameobjects/components/ComputedSize */ "../../../src/gameobjects/components/ComputedSize.js"); +var ComponentsDepth = __webpack_require__(/*! ../../../../src/gameobjects/components/Depth */ "../../../src/gameobjects/components/Depth.js"); +var ComponentsFlip = __webpack_require__(/*! ../../../../src/gameobjects/components/Flip */ "../../../src/gameobjects/components/Flip.js"); +var ComponentsScrollFactor = __webpack_require__(/*! ../../../../src/gameobjects/components/ScrollFactor */ "../../../src/gameobjects/components/ScrollFactor.js"); +var ComponentsTransform = __webpack_require__(/*! ../../../../src/gameobjects/components/Transform */ "../../../src/gameobjects/components/Transform.js"); +var ComponentsVisible = __webpack_require__(/*! ../../../../src/gameobjects/components/Visible */ "../../../src/gameobjects/components/Visible.js"); +var CounterClockwise = __webpack_require__(/*! ../../../../src/math/angle/CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"); +var DegToRad = __webpack_require__(/*! ../../../../src/math/DegToRad */ "../../../src/math/DegToRad.js"); +var GameObject = __webpack_require__(/*! ../../../../src/gameobjects/GameObject */ "../../../src/gameobjects/GameObject.js"); +var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../../src/math/RadToDeg.js"); +var SpineEvents = __webpack_require__(/*! ../events/ */ "./events/index.js"); +var SpineGameObjectRender = __webpack_require__(/*! ./SpineGameObjectRender */ "./gameobject/SpineGameObjectRender.js"); + +/** + * @classdesc + * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates + * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to + * easily change the skin, slot attachment, bone positions and more. + * + * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly. + * You can only create them if the Spine plugin has been loaded into Phaser. + * + * The quickest way is the Game Object Factory: + * + * ```javascript + * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true); + * ``` + * + * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly` + * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is + * an optional animation to start playing on the skeleton. The final argument `true` sets the + * animation to loop. Look at the documentation for further details on each of these options. + * + * For more control, you can use the Game Object Creator, passing in a Spine Game Object + * Configuration object: + * + * ```javascript + * let jelly = this.make.spine({ + * x: 512, y: 550, key: 'jelly', + * scale: 1.5, + * skinName: 'square_Green', + * animationName: 'jelly-think', loop: true, + * slotName: 'hat', attachmentName: 'images/La_14' + * }); + * ``` + * + * Here, you've got the ability to specify extra details, such as the slot name, attachments or + * overall scale. + * + * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to + * update and render, it must be added to the display and update lists of your Scene: + * + * ```javascript + * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true); + * this.sys.displayList.add(jelly); + * this.sys.updateList.add(jelly); + * ``` + * + * It's possible to enable Spine Game Objects for input, but you should be aware that it will use + * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but + * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created. + * If it's not suitable, provide your own shape to the `setInteractive` method. + * + * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for + * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game + * Object position with it. See the examples for further details. + * + * If your Spine Game Object has black outlines around the different parts of the texture when it + * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have + * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details. + * + * @class SpineGameObject + * @constructor + * @since 3.19.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 {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? + */ +var SpineGameObject = new Class({ + + Extends: GameObject, + + Mixins: [ + ComponentsComputedSize, + ComponentsDepth, + ComponentsFlip, + ComponentsScrollFactor, + ComponentsTransform, + ComponentsVisible, + SpineGameObjectRender + ], + + initialize: + + function SpineGameObject (scene, plugin, x, y, key, animationName, loop) + { + GameObject.call(this, scene, 'Spine'); + + /** + * A reference to the Spine Plugin. + * + * @name SpineGameObject#plugin + * @type {SpinePlugin} + * @since 3.19.0 + */ + this.plugin = plugin; + + /** + * The Spine Skeleton this Game Object is using. + * + * @name SpineGameObject#skeleton + * @type {spine.Skeleton} + * @since 3.19.0 + */ + this.skeleton = null; + + /** + * The Spine Skeleton Data associated with the Skeleton this Game Object is using. + * + * @name SpineGameObject#skeletonData + * @type {spine.SkeletonData} + * @since 3.19.0 + */ + this.skeletonData = null; + + /** + * The Spine Animation State this Game Object is using. + * + * @name SpineGameObject#state + * @type {spine.AnimationState} + * @since 3.19.0 + */ + this.state = null; + + /** + * The Spine Animation State Data associated with the Animation State this Game Object is using. + * + * @name SpineGameObject#stateData + * @type {spine.AnimationStateData} + * @since 3.19.0 + */ + this.stateData = null; + + /** + * A reference to the root bone of the Skeleton. + * + * @name SpineGameObject#root + * @type {spine.Bone} + * @since 3.19.0 + */ + this.root = null; + + /** + * This object holds the calculated bounds of the current + * pose, as set when a new Skeleton is applied. + * + * @name SpineGameObject#bounds + * @type {any} + * @since 3.19.0 + */ + this.bounds = null; + + /** + * A Game Object level flag that allows you to enable debug drawing + * to the Skeleton Debug Renderer by toggling it. + * + * @name SpineGameObject#drawDebug + * @type {boolean} + * @since 3.19.0 + */ + this.drawDebug = false; + + /** + * The factor to scale the Animation update time by. + * + * @name SpineGameObject#timeScale + * @type {number} + * @since 3.19.0 + */ + this.timeScale = 1; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginX + * @type {number} + * @since 3.19.0 + */ + this.displayOriginX = 0; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginY + * @type {number} + * @since 3.19.0 + */ + this.displayOriginY = 0; + + /** + * A flag that stores if the texture associated with the current + * Skin being used by this Game Object, has its alpha pre-multiplied + * into it, or not. + * + * @name SpineGameObject#preMultipliedAlpha + * @type {boolean} + * @since 3.19.0 + */ + this.preMultipliedAlpha = false; + + /** + * A default Blend Mode. You cannot change the blend mode of a + * Spine Game Object. + * + * @name SpineGameObject#blendMode + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.blendMode = 0; + + this.setPosition(x, y); + + if (key) + { + this.setSkeleton(key, animationName, loop); + } + }, + + /** + * Overrides the default Game Object method and always returns true. + * Rendering is decided in the renderer functions. + * + * @method SpineGameObject#willRender + * @since 3.19.0 + * + * @return {boolean} Always returns `true`. + */ + willRender: function () + { + return true; + }, + + /** + * Set the Alpha level for the whole Skeleton 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 SpineGameObject#setAlpha + * @since 3.19.0 + * + * @param {number} [value=1] - The alpha value used for the whole Skeleton. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (value, slotName) + { + if (value === undefined) { value = 1; } + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + slot.color.a = Clamp(value, 0, 1); + } + } + else + { + this.alpha = value; + } + + return this; + }, + + /** + * The alpha value of the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#alpha + * @type {number} + * @since 3.19.0 + */ + alpha: { + + get: function () + { + return this.skeleton.color.a; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.a = v; + } + + if (v === 0) + { + this.renderFlags &= ~2; + } + else + { + this.renderFlags |= 2; + } + } + + }, + + /** + * The amount of red used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#red + * @type {number} + * @since 3.19.0 + */ + red: { + + get: function () + { + return this.skeleton.color.r; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.r = v; + } + } + + }, + + /** + * The amount of green used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#green + * @type {number} + * @since 3.19.0 + */ + green: { + + get: function () + { + return this.skeleton.color.g; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.g = v; + } + } + + }, + + /** + * The amount of blue used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#blue + * @type {number} + * @since 3.19.0 + */ + blue: { + + get: function () + { + return this.skeleton.color.b; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.b = v; + } + } + + }, + + /** + * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton. + * + * @method SpineGameObject#setColor + * @since 3.19.0 + * + * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color. + * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton. + * + * @return {this} This Game Object instance. + */ + setColor: function (color, slotName) + { + if (color === undefined) { color = 0xffffff; } + + var red = (color >> 16 & 0xFF) / 255; + var green = (color >> 8 & 0xFF) / 255; + var blue = (color & 0xFF) / 255; + var alpha = (color > 16777215) ? (color >>> 24) / 255 : null; + + var target = this.skeleton; + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + target = slot; + } + } + + target.color.r = red; + target.color.g = green; + target.color.b = blue; + + if (alpha !== null) + { + target.color.a = alpha; + } + + return this; + }, + + /** + * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object + * that contains the Skeleton data. + * + * @method SpineGameObject#setSkeletonFromJSON + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ + setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop) + { + return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop); + }, + + /** + * Sets this Game Object to use the given Skeleton based on its cache key. + * + * Typically, once set, the Skeleton doesn't change. Instead, you change the skin, + * or slot attachment, or any other property to adjust it. + * + * @method SpineGameObject#setSkeleton + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ + setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON) + { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON); + + this.skeletonData = data.skeletonData; + + this.preMultipliedAlpha = data.preMultipliedAlpha; + + var skeleton = data.skeleton; + + skeleton.setSkinByName('default'); + skeleton.setToSetupPose(); + + this.skeleton = skeleton; + + // AnimationState + data = this.plugin.createAnimationState(skeleton); + + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + this.state = data.state; + this.stateData = data.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) + }); + + if (animationName) + { + this.setAnimation(0, animationName, loop); + } + + this.root = this.getRootBone(); + + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.state.apply(skeleton); + + skeleton.updateCache(); + + return this.updateSize(); + }, + + /** + * Internal event handler that emits the Spine onComplete event via this Game Object. + * + * @method SpineGameObject#onComplete + * @fires SpinePluginEvents#COMPLETE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onComplete: function (entry) + { + this.emit(SpineEvents.COMPLETE, entry); + }, + + /** + * Internal event handler that emits the Spine onDispose event via this Game Object. + * + * @method SpineGameObject#onDispose + * @fires SpinePluginEvents#DISPOSE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onDispose: function (entry) + { + this.emit(SpineEvents.DISPOSE, entry); + }, + + /** + * Internal event handler that emits the Spine onEnd event via this Game Object. + * + * @method SpineGameObject#onEnd + * @fires SpinePluginEvents#END + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onEnd: function (entry) + { + this.emit(SpineEvents.END, entry); + }, + + /** + * Internal event handler that emits the Spine Event event via this Game Object. + * + * @method SpineGameObject#onEvent + * @fires SpinePluginEvents#EVENT + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + * @param {spine.Event} event - The Spine event. + */ + onEvent: function (entry, event) + { + this.emit(SpineEvents.EVENT, entry, event); + }, + + /** + * Internal event handler that emits the Spine onInterrupted event via this Game Object. + * + * @method SpineGameObject#onInterrupted + * @fires SpinePluginEvents#INTERRUPTED + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onInterrupted: function (entry) + { + this.emit(SpineEvents.INTERRUPTED, entry); + }, + + /** + * Internal event handler that emits the Spine onStart event via this Game Object. + * + * @method SpineGameObject#onStart + * @fires SpinePluginEvents#START + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onStart: function (entry) + { + this.emit(SpineEvents.START, entry); + }, + + /** + * Refreshes the data about the current Skeleton. + * + * This will reset the rotation, position and size of the Skeleton to match this Game Object. + * + * Call this method if you need to access the Skeleton data directly, and it may have changed + * recently. + * + * @method SpineGameObject#refresh + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + refresh: function () + { + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.updateSize(); + + this.skeleton.updateCache(); + + return this; + }, + + /** + * Sets the size of this Game Object. + * + * If no arguments are given it uses the current skeleton data dimensions. + * + * You can use this method to set a fixed size of this Game Object, such as for input detection, + * when the skeleton data doesn't match what is required in-game. + * + * @method SpineGameObject#setSize + * @since 3.19.0 + * + * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width. + * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height. + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setSize: function (width, height, offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (width === undefined) { width = skeleton.data.width; } + if (height === undefined) { height = skeleton.data.height; } + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.width = width; + this.height = height; + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Sets the offset of this Game Object from the Skeleton position. + * + * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using. + * + * @method SpineGameObject#setOffset + * @since 3.19.0 + * + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setOffset: function (offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Internal method that syncs all of the Game Object position and scale data to the Skeleton. + * It then syncs the skeleton bounds back to this Game Object. + * + * This method is called automatically as needed internally, however, it's also exposed should + * you require overriding the size settings. + * + * @method SpineGameObject#updateSize + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + updateSize: function () + { + var skeleton = this.skeleton; + var renderer = this.plugin.renderer; + + var height = renderer.height; + + var oldScaleX = this.scaleX; + var oldScaleY = this.scaleY; + + skeleton.x = this.x; + skeleton.y = height - this.y; + skeleton.scaleX = 1; + skeleton.scaleY = 1; + + skeleton.updateWorldTransform(); + + var bounds = this.getBounds(); + + this.width = bounds.size.x; + this.height = bounds.size.y; + + this.displayOriginX = this.x - bounds.offset.x; + this.displayOriginY = this.y - (height - (this.height + bounds.offset.y)); + + skeleton.scaleX = oldScaleX; + skeleton.scaleY = oldScaleY; + + skeleton.updateWorldTransform(); + + return this; + }, + + /** + * The horizontal scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleX + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + this.refresh(); + } + + }, + + /** + * The vertical scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleY + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + this.refresh(); + } + + }, + + /** + * Returns an array containing the names of all the bones in the Skeleton Data. + * + * @method SpineGameObject#getBoneList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the bones in the Skeleton Data. + */ + getBoneList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.bones.length; i++) + { + output.push(skeletonData.bones[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the skins in the Skeleton Data. + * + * @method SpineGameObject#getSkinList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the skins in the Skeleton Data. + */ + getSkinList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.skins.length; i++) + { + output.push(skeletonData.skins[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the slots in the Skeleton. + * + * @method SpineGameObject#getSlotList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the slots in the Skeleton. + */ + getSlotList: function () + { + var output = []; + + var skeleton = this.skeleton; + + for (var i = 0; i < skeleton.slots.length; i++) + { + output.push(skeleton.slots[i].data.name); + } + + return output; + }, + + /** + * Returns an array containing the names of all the animations in the Skeleton Data. + * + * @method SpineGameObject#getAnimationList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the animations in the Skeleton Data. + */ + getAnimationList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.animations.length; i++) + { + output.push(skeletonData.animations[i].name); + } + } + + return output; + }, + + /** + * Returns the current animation being played on the given track, if any. + * + * @method SpineGameObject#getCurrentAnimation + * @since 3.19.0 + * + * @param {integer} [trackIndex=0] - The track to return the current animation on. + * + * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation. + */ + getCurrentAnimation: function (trackIndex) + { + if (trackIndex === undefined) { trackIndex = 0; } + + var current = this.state.getCurrent(trackIndex); + + if (current) + { + return current.animation; + } + }, + + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#play + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead. + */ + play: function (animationName, loop, ignoreIfPlaying) + { + this.setAnimation(0, animationName, loop, ignoreIfPlaying); + + return this; + }, + + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#setAnimation + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to play the animation on. + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying) + { + if (loop === undefined) { loop = false; } + if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } + + if (ignoreIfPlaying && this.state) + { + var currentTrack = this.state.getCurrent(0); + + if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete()) + { + return; + } + } + + if (this.findAnimation(animationName)) + { + return this.state.setAnimation(trackIndex, animationName, loop); + } + }, + + /** + * Adds an animation to be played after the current or last queued animation for a track. + * If the track is empty, it is equivalent to calling setAnimation. + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous + * track entry minus any mix duration (from the AnimationStateData) plus the specified delay + * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration). + * If the previous entry is looping, its next loop completion is used instead of its duration. + * + * @method SpineGameObject#addAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {string} animationName - The string-based key of the animation to add. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + addAnimation: function (trackIndex, animationName, loop, delay) + { + return this.state.addAnimation(trackIndex, animationName, loop, delay); + }, + + /** + * Sets an empty animation for a track, discarding any queued animations, and sets the track + * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out. + * + * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation, + * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be + * applied less and less over the mix duration. Properties keyed in the previous animation transition to + * the value from lower tracks or to the setup pose value if no lower tracks key the property. + * A mix duration of 0 still mixes out over one frame. + * + * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation + * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new + * animation to be applied more and more over the mix duration. Properties keyed in the new animation + * transition from the value from lower tracks or from the setup pose value if no lower tracks key the + * property to the value keyed in the new animation. + * + * @method SpineGameObject#setEmptyAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {spine.TrackEntry} The returned Track Entry. + */ + setEmptyAnimation: function (trackIndex, mixDuration) + { + return this.state.setEmptyAnimation(trackIndex, mixDuration); + }, + + /** + * Removes all animations from the track, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTrack + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * + * @return {this} This Game Object. + */ + clearTrack: function (trackIndex) + { + this.state.clearTrack(trackIndex); + + return this; + }, + + /** + * Removes all animations from all tracks, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTracks + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + clearTracks: function () + { + this.state.clearTracks(); + + return this; + }, + + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkinByName + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to set. + * + * @return {this} This Game Object. + */ + setSkinByName: function (skinName) + { + var skeleton = this.skeleton; + + skeleton.setSkinByName(skinName); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); + + return this; + }, + + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkin + * @since 3.19.0 + * + * @param {?spine.Skin} newSkin - The Skin to set. May be `null`. + * + * @return {this} This Game Object. + */ + setSkin: function (newSkin) + { + var skeleton = this.skeleton; + + skeleton.setSkin(newSkin); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); + + return this; + }, + + /** + * Sets the mix duration when changing from the specified animation to the other. + * + * @method SpineGameObject#setMix + * @since 3.19.0 + * + * @param {string} fromName - The animation to mix from. + * @param {string} toName - The animation to mix to. + * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {this} This Game Object. + */ + setMix: function (fromName, toName, duration) + { + this.stateData.setMix(fromName, toName, duration); + + return this; + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot + * index and attachment name. First the skin is checked and if the attachment was not found, + * the default skin is checked. + * + * @method SpineGameObject#getAttachment + * @since 3.19.0 + * + * @param {integer} slotIndex - The slot index to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachment: function (slotIndex, attachmentName) + { + return this.skeleton.getAttachment(slotIndex, attachmentName); + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name. + * + * @method SpineGameObject#getAttachmentByName + * @since 3.19.0 + * + * @param {string} slotName - The slot name to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachmentByName: function (slotName, attachmentName) + { + return this.skeleton.getAttachmentByName(slotName, attachmentName); + }, + + /** + * A convenience method to set an attachment by finding the slot with findSlot, + * finding the attachment with getAttachment, then setting the slot's attachment. + * + * @method SpineGameObject#setAttachment + * @since 3.19.0 + * + * @param {string} slotName - The slot name to add the attachment to. + * @param {string} attachmentName - The attachment name to add. + * + * @return {this} This Game Object. + */ + setAttachment: function (slotName, attachmentName) + { + if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length) + { + for (var i = 0; i < slotName.length; i++) + { + this.skeleton.setAttachment(slotName[i], attachmentName[i]); + } + } + else + { + this.skeleton.setAttachment(slotName, attachmentName); + } + + return this; + }, + + /** + * Sets the bones, constraints, slots, and draw order to their setup pose values. + * + * @method SpineGameObject#setToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setToSetupPose: function () + { + this.skeleton.setToSetupPose(); + + return this; + }, + + /** + * Sets the slots and draw order to their setup pose values. + * + * @method SpineGameObject#setSlotsToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setSlotsToSetupPose: function () + { + this.skeleton.setSlotsToSetupPose(); + + return this; + }, + + /** + * Sets the bones and constraints to their setup pose values. + * + * @method SpineGameObject#setBonesToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setBonesToSetupPose: function () + { + this.skeleton.setBonesToSetupPose(); + + return this; + }, + + /** + * Gets the root bone, or null. + * + * @method SpineGameObject#getRootBone + * @since 3.19.0 + * + * @return {spine.Bone} The root bone, or null. + */ + getRootBone: function () + { + return this.skeleton.getRootBone(); + }, + + /** + * Takes a Bone object and a position in world space and rotates the Bone so it is angled + * towards the given position. You can set an optional angle offset, should the bone be + * designed at a specific angle already. You can also set a minimum and maximum range for the angle. + * + * @method SpineGameObject#angleBoneToXY + * @since 3.19.0 + * + * @param {spine.Bone} bone - The bone to rotate towards the world position. + * @param {number} worldX - The world x coordinate to rotate the bone towards. + * @param {number} worldY - The world y coordinate to rotate the bone towards. + * @param {number} [offset=0] - An offset to add to the rotation angle. + * @param {number} [minAngle=0] - The minimum range of the rotation angle. + * @param {number} [maxAngle=360] - The maximum range of the rotation angle. + * + * @return {this} This Game Object. + */ + angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle) + { + if (offset === undefined) { offset = 0; } + if (minAngle === undefined) { minAngle = 0; } + if (maxAngle === undefined) { maxAngle = 360; } + + var renderer = this.plugin.renderer; + var height = renderer.height; + + var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset)); + + bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle); + + return this; + }, + + /** + * Finds a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBone + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {spine.Bone} The bone, or null. + */ + findBone: function (boneName) + { + return this.skeleton.findBone(boneName); + }, + + /** + * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBoneIndex + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {integer} The bone index. Or -1 if the bone was not found. + */ + findBoneIndex: function (boneName) + { + return this.skeleton.findBoneIndex(boneName); + }, + + /** + * Finds a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlot + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {spine.Slot} The Slot. May be null. + */ + findSlot: function (slotName) + { + return this.skeleton.findSlot(slotName); + }, + + /** + * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlotIndex + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {integer} The slot index. Or -1 if the Slot was not found. + */ + findSlotIndex: function (slotName) + { + return this.skeleton.findSlotIndex(slotName); + }, + + /** + * Finds a skin by comparing each skin's name. It is more efficient to cache the results of + * this method than to call it multiple times. + * + * @method SpineGameObject#findSkin + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to find. + * + * @return {spine.Skin} The Skin. May be null. + */ + findSkin: function (skinName) + { + return this.skeletonData.findSkin(skinName); + }, + + /** + * Finds an event by comparing each events's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findEvent + * @since 3.19.0 + * + * @param {string} eventDataName - The name of the event to find. + * + * @return {spine.EventData} The Event Data. May be null. + */ + findEvent: function (eventDataName) + { + return this.skeletonData.findEvent(eventDataName); + }, + + /** + * Finds an animation by comparing each animation's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findAnimation + * @since 3.19.0 + * + * @param {string} animationName - The name of the animation to find. + * + * @return {spine.Animation} The Animation. May be null. + */ + findAnimation: function (animationName) + { + return this.skeletonData.findAnimation(animationName); + }, + + /** + * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findIkConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.IkConstraintData} The IK constraint. May be null. + */ + findIkConstraint: function (constraintName) + { + return this.skeletonData.findIkConstraint(constraintName); + }, + + /** + * Finds an transform constraint by comparing each transform constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findTransformConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.TransformConstraintData} The transform constraint. May be null. + */ + findTransformConstraint: function (constraintName) + { + return this.skeletonData.findTransformConstraint(constraintName); + }, + + /** + * Finds a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.PathConstraintData} The path constraint. May be null. + */ + findPathConstraint: function (constraintName) + { + return this.skeletonData.findPathConstraint(constraintName); + }, + + /** + * Finds the index of a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraintIndex + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {integer} The constraint index. Or -1 if the constraint was not found. + */ + findPathConstraintIndex: function (constraintName) + { + return this.skeletonData.findPathConstraintIndex(constraintName); + }, + + /** + * 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 SpineGameObject#getBounds + * @since 3.19.0 + * + * @return {any} The bounds object. + */ + getBounds: function () + { + return this.plugin.getBounds(this.skeleton); + }, + + /** + * Internal update handler. + * + * @method SpineGameObject#preUpdate + * @protected + * @since 3.19.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + var skeleton = this.skeleton; + + this.state.update((delta / 1000) * this.timeScale); + + this.state.apply(skeleton); + + // this.emit('spine.update', skeleton); + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method SpineGameObject#preDestroy + * @protected + * @since 3.19.0 + */ + preDestroy: function () + { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + this.plugin = null; + + this.skeleton = null; + this.skeletonData = null; + + this.state = null; + this.stateData = null; + } + +}); + +module.exports = SpineGameObject; + + +/***/ }), + +/***/ "./gameobject/SpineGameObjectCanvasRenderer.js": +/*!*****************************************************!*\ + !*** ./gameobject/SpineGameObjectCanvasRenderer.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var CounterClockwise = __webpack_require__(/*! ../../../../src/math/angle/CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"); +var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../../src/math/RadToDeg.js"); +var Wrap = __webpack_require__(/*! ../../../../src/math/Wrap */ "../../../src/math/Wrap.js"); + +/** + * 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 {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @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, interpolationPercentage, camera, parentMatrix) +{ + var context = renderer.currentContext; + + var plugin = src.plugin; + var skeleton = src.skeleton; + var skeletonRenderer = plugin.skeletonRenderer; + + var GameObjectRenderMask = 15; + + var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); + + if (!skeleton || !willRender) + { + return; + } + + var camMatrix = renderer._tempMatrix1; + var spriteMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + 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; + } + + // Add autoUpdate option + skeleton.updateWorldTransform(); + + skeletonRenderer.ctx = context; + skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug); + + context.save(); + + skeletonRenderer.draw(skeleton); + + context.restore(); +}; + +module.exports = SpineGameObjectCanvasRenderer; + + +/***/ }), + +/***/ "./gameobject/SpineGameObjectRender.js": +/*!*********************************************!*\ + !*** ./gameobject/SpineGameObjectRender.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var renderWebGL = __webpack_require__(/*! ../../../../src/utils/NOOP */ "../../../src/utils/NOOP.js"); +var renderCanvas = __webpack_require__(/*! ../../../../src/utils/NOOP */ "../../../src/utils/NOOP.js"); + +if (false) +{} + +if (true) +{ + renderCanvas = __webpack_require__(/*! ./SpineGameObjectCanvasRenderer */ "./gameobject/SpineGameObjectCanvasRenderer.js"); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), + +/***/ "./runtimes/spine-canvas.js": +/*!**********************************!*\ + !*** ./runtimes/spine-canvas.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/*** IMPORTS FROM imports-loader ***/ +(function() { + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var spine; +(function (spine) { + var Animation = (function () { + function Animation(name, timelines, duration) { + if (name == null) + throw new Error("name cannot be null."); + if (timelines == null) + throw new Error("timelines cannot be null."); + this.name = name; + this.timelines = timelines; + this.duration = duration; + } + Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (loop && this.duration != 0) { + time %= this.duration; + if (lastTime > 0) + lastTime %= this.duration; + } + var timelines = this.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction); + }; + Animation.binarySearch = function (values, target, step) { + if (step === void 0) { step = 1; } + var low = 0; + var high = values.length / step - 2; + if (high == 0) + return step; + var current = high >>> 1; + while (true) { + if (values[(current + 1) * step] <= target) + low = current + 1; + else + high = current; + if (low == high) + return (low + 1) * step; + current = (low + high) >>> 1; + } + }; + Animation.linearSearch = function (values, target, step) { + for (var i = 0, last = values.length - step; i <= last; i += step) + if (values[i] > target) + return i; + return -1; + }; + return Animation; + }()); + spine.Animation = Animation; + var MixBlend; + (function (MixBlend) { + MixBlend[MixBlend["setup"] = 0] = "setup"; + MixBlend[MixBlend["first"] = 1] = "first"; + MixBlend[MixBlend["replace"] = 2] = "replace"; + MixBlend[MixBlend["add"] = 3] = "add"; + })(MixBlend = spine.MixBlend || (spine.MixBlend = {})); + var MixDirection; + (function (MixDirection) { + MixDirection[MixDirection["in"] = 0] = "in"; + MixDirection[MixDirection["out"] = 1] = "out"; + })(MixDirection = spine.MixDirection || (spine.MixDirection = {})); + var TimelineType; + (function (TimelineType) { + TimelineType[TimelineType["rotate"] = 0] = "rotate"; + TimelineType[TimelineType["translate"] = 1] = "translate"; + TimelineType[TimelineType["scale"] = 2] = "scale"; + TimelineType[TimelineType["shear"] = 3] = "shear"; + TimelineType[TimelineType["attachment"] = 4] = "attachment"; + TimelineType[TimelineType["color"] = 5] = "color"; + TimelineType[TimelineType["deform"] = 6] = "deform"; + TimelineType[TimelineType["event"] = 7] = "event"; + TimelineType[TimelineType["drawOrder"] = 8] = "drawOrder"; + TimelineType[TimelineType["ikConstraint"] = 9] = "ikConstraint"; + TimelineType[TimelineType["transformConstraint"] = 10] = "transformConstraint"; + TimelineType[TimelineType["pathConstraintPosition"] = 11] = "pathConstraintPosition"; + TimelineType[TimelineType["pathConstraintSpacing"] = 12] = "pathConstraintSpacing"; + TimelineType[TimelineType["pathConstraintMix"] = 13] = "pathConstraintMix"; + TimelineType[TimelineType["twoColor"] = 14] = "twoColor"; + })(TimelineType = spine.TimelineType || (spine.TimelineType = {})); + var CurveTimeline = (function () { + function CurveTimeline(frameCount) { + if (frameCount <= 0) + throw new Error("frameCount must be > 0: " + frameCount); + this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE); + } + CurveTimeline.prototype.getFrameCount = function () { + return this.curves.length / CurveTimeline.BEZIER_SIZE + 1; + }; + CurveTimeline.prototype.setLinear = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR; + }; + CurveTimeline.prototype.setStepped = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED; + }; + CurveTimeline.prototype.getCurveType = function (frameIndex) { + var index = frameIndex * CurveTimeline.BEZIER_SIZE; + if (index == this.curves.length) + return CurveTimeline.LINEAR; + var type = this.curves[index]; + if (type == CurveTimeline.LINEAR) + return CurveTimeline.LINEAR; + if (type == CurveTimeline.STEPPED) + return CurveTimeline.STEPPED; + return CurveTimeline.BEZIER; + }; + CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) { + var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03; + var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006; + var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy; + var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var curves = this.curves; + curves[i++] = CurveTimeline.BEZIER; + var x = dfx, y = dfy; + for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + curves[i] = x; + curves[i + 1] = y; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + x += dfx; + y += dfy; + } + }; + CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) { + percent = spine.MathUtils.clamp(percent, 0, 1); + var curves = this.curves; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var type = curves[i]; + if (type == CurveTimeline.LINEAR) + return percent; + if (type == CurveTimeline.STEPPED) + return 0; + i++; + var x = 0; + for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + x = curves[i]; + if (x >= percent) { + var prevX = void 0, prevY = void 0; + if (i == start) { + prevX = 0; + prevY = 0; + } + else { + prevX = curves[i - 2]; + prevY = curves[i - 1]; + } + return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); + } + } + var y = curves[i - 1]; + return y + (1 - y) * (percent - x) / (1 - x); + }; + CurveTimeline.LINEAR = 0; + CurveTimeline.STEPPED = 1; + CurveTimeline.BEZIER = 2; + CurveTimeline.BEZIER_SIZE = 10 * 2 - 1; + return CurveTimeline; + }()); + spine.CurveTimeline = CurveTimeline; + var RotateTimeline = (function (_super) { + __extends(RotateTimeline, _super); + function RotateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount << 1); + return _this; + } + RotateTimeline.prototype.getPropertyId = function () { + return (TimelineType.rotate << 24) + this.boneIndex; + }; + RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) { + frameIndex <<= 1; + this.frames[frameIndex] = time; + this.frames[frameIndex + RotateTimeline.ROTATION] = degrees; + }; + RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation; + return; + case MixBlend.first: + var r_1 = bone.data.rotation - bone.rotation; + bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha; + } + return; + } + if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { + var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION]; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + r_2 * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r_2 += bone.data.rotation - bone.rotation; + r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; + case MixBlend.add: + bone.rotation += r_2 * alpha; + } + return; + } + var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES); + var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime)); + var r = frames[frame + RotateTimeline.ROTATION] - prevRotation; + r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r += bone.data.rotation - bone.rotation; + case MixBlend.add: + bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + } + }; + RotateTimeline.ENTRIES = 2; + RotateTimeline.PREV_TIME = -2; + RotateTimeline.PREV_ROTATION = -1; + RotateTimeline.ROTATION = 1; + return RotateTimeline; + }(CurveTimeline)); + spine.RotateTimeline = RotateTimeline; + var TranslateTimeline = (function (_super) { + __extends(TranslateTimeline, _super); + function TranslateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES); + return _this; + } + TranslateTimeline.prototype.getPropertyId = function () { + return (TimelineType.translate << 24) + this.boneIndex; + }; + TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) { + frameIndex *= TranslateTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TranslateTimeline.X] = x; + this.frames[frameIndex + TranslateTimeline.Y] = y; + }; + TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x; + bone.y = bone.data.y; + return; + case MixBlend.first: + bone.x += (bone.data.x - bone.x) * alpha; + bone.y += (bone.data.y - bone.y) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { + x = frames[frames.length + TranslateTimeline.PREV_X]; + y = frames[frames.length + TranslateTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES); + x = frames[frame + TranslateTimeline.PREV_X]; + y = frames[frame + TranslateTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime)); + x += (frames[frame + TranslateTimeline.X] - x) * percent; + y += (frames[frame + TranslateTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x + x * alpha; + bone.y = bone.data.y + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.x += (bone.data.x + x - bone.x) * alpha; + bone.y += (bone.data.y + y - bone.y) * alpha; + break; + case MixBlend.add: + bone.x += x * alpha; + bone.y += y * alpha; + } + }; + TranslateTimeline.ENTRIES = 3; + TranslateTimeline.PREV_TIME = -3; + TranslateTimeline.PREV_X = -2; + TranslateTimeline.PREV_Y = -1; + TranslateTimeline.X = 1; + TranslateTimeline.Y = 2; + return TranslateTimeline; + }(CurveTimeline)); + spine.TranslateTimeline = TranslateTimeline; + var ScaleTimeline = (function (_super) { + __extends(ScaleTimeline, _super); + function ScaleTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ScaleTimeline.prototype.getPropertyId = function () { + return (TimelineType.scale << 24) + this.boneIndex; + }; + ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.scaleX = bone.data.scaleX; + bone.scaleY = bone.data.scaleY; + return; + case MixBlend.first: + bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha; + bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { + x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX; + y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY; + } + else { + var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES); + x = frames[frame + ScaleTimeline.PREV_X]; + y = frames[frame + ScaleTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime)); + x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX; + y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY; + } + if (alpha == 1) { + if (blend == MixBlend.add) { + bone.scaleX += x - bone.data.scaleX; + bone.scaleY += y - bone.data.scaleY; + } + else { + bone.scaleX = x; + bone.scaleY = y; + } + } + else { + var bx = 0, by = 0; + if (direction == MixDirection.out) { + switch (blend) { + case MixBlend.setup: + bx = bone.data.scaleX; + by = bone.data.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.add: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha; + } + } + else { + switch (blend) { + case MixBlend.setup: + bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.add: + bx = spine.MathUtils.signum(x); + by = spine.MathUtils.signum(y); + bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha; + bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha; + } + } + } + }; + return ScaleTimeline; + }(TranslateTimeline)); + spine.ScaleTimeline = ScaleTimeline; + var ShearTimeline = (function (_super) { + __extends(ShearTimeline, _super); + function ShearTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ShearTimeline.prototype.getPropertyId = function () { + return (TimelineType.shear << 24) + this.boneIndex; + }; + ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX; + bone.shearY = bone.data.shearY; + return; + case MixBlend.first: + bone.shearX += (bone.data.shearX - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY - bone.shearY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { + x = frames[frames.length + ShearTimeline.PREV_X]; + y = frames[frames.length + ShearTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES); + x = frames[frame + ShearTimeline.PREV_X]; + y = frames[frame + ShearTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime)); + x = x + (frames[frame + ShearTimeline.X] - x) * percent; + y = y + (frames[frame + ShearTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX + x * alpha; + bone.shearY = bone.data.shearY + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha; + break; + case MixBlend.add: + bone.shearX += x * alpha; + bone.shearY += y * alpha; + } + }; + return ShearTimeline; + }(TranslateTimeline)); + spine.ShearTimeline = ShearTimeline; + var ColorTimeline = (function (_super) { + __extends(ColorTimeline, _super); + function ColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES); + return _this; + } + ColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.color << 24) + this.slotIndex; + }; + ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) { + frameIndex *= ColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + ColorTimeline.R] = r; + this.frames[frameIndex + ColorTimeline.G] = g; + this.frames[frameIndex + ColorTimeline.B] = b; + this.frames[frameIndex + ColorTimeline.A] = a; + }; + ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + return; + case MixBlend.first: + var color = slot.color, setup = slot.data.color; + color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha); + } + return; + } + var r = 0, g = 0, b = 0, a = 0; + if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + ColorTimeline.PREV_R]; + g = frames[i + ColorTimeline.PREV_G]; + b = frames[i + ColorTimeline.PREV_B]; + a = frames[i + ColorTimeline.PREV_A]; + } + else { + var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES); + r = frames[frame + ColorTimeline.PREV_R]; + g = frames[frame + ColorTimeline.PREV_G]; + b = frames[frame + ColorTimeline.PREV_B]; + a = frames[frame + ColorTimeline.PREV_A]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + ColorTimeline.R] - r) * percent; + g += (frames[frame + ColorTimeline.G] - g) * percent; + b += (frames[frame + ColorTimeline.B] - b) * percent; + a += (frames[frame + ColorTimeline.A] - a) * percent; + } + if (alpha == 1) + slot.color.set(r, g, b, a); + else { + var color = slot.color; + if (blend == MixBlend.setup) + color.setFromColor(slot.data.color); + color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); + } + }; + ColorTimeline.ENTRIES = 5; + ColorTimeline.PREV_TIME = -5; + ColorTimeline.PREV_R = -4; + ColorTimeline.PREV_G = -3; + ColorTimeline.PREV_B = -2; + ColorTimeline.PREV_A = -1; + ColorTimeline.R = 1; + ColorTimeline.G = 2; + ColorTimeline.B = 3; + ColorTimeline.A = 4; + return ColorTimeline; + }(CurveTimeline)); + spine.ColorTimeline = ColorTimeline; + var TwoColorTimeline = (function (_super) { + __extends(TwoColorTimeline, _super); + function TwoColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES); + return _this; + } + TwoColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.twoColor << 24) + this.slotIndex; + }; + TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) { + frameIndex *= TwoColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TwoColorTimeline.R] = r; + this.frames[frameIndex + TwoColorTimeline.G] = g; + this.frames[frameIndex + TwoColorTimeline.B] = b; + this.frames[frameIndex + TwoColorTimeline.A] = a; + this.frames[frameIndex + TwoColorTimeline.R2] = r2; + this.frames[frameIndex + TwoColorTimeline.G2] = g2; + this.frames[frameIndex + TwoColorTimeline.B2] = b2; + }; + TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + slot.darkColor.setFromColor(slot.data.darkColor); + return; + case MixBlend.first: + var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor; + light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha); + dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0); + } + return; + } + var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; + if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + TwoColorTimeline.PREV_R]; + g = frames[i + TwoColorTimeline.PREV_G]; + b = frames[i + TwoColorTimeline.PREV_B]; + a = frames[i + TwoColorTimeline.PREV_A]; + r2 = frames[i + TwoColorTimeline.PREV_R2]; + g2 = frames[i + TwoColorTimeline.PREV_G2]; + b2 = frames[i + TwoColorTimeline.PREV_B2]; + } + else { + var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES); + r = frames[frame + TwoColorTimeline.PREV_R]; + g = frames[frame + TwoColorTimeline.PREV_G]; + b = frames[frame + TwoColorTimeline.PREV_B]; + a = frames[frame + TwoColorTimeline.PREV_A]; + r2 = frames[frame + TwoColorTimeline.PREV_R2]; + g2 = frames[frame + TwoColorTimeline.PREV_G2]; + b2 = frames[frame + TwoColorTimeline.PREV_B2]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + TwoColorTimeline.R] - r) * percent; + g += (frames[frame + TwoColorTimeline.G] - g) * percent; + b += (frames[frame + TwoColorTimeline.B] - b) * percent; + a += (frames[frame + TwoColorTimeline.A] - a) * percent; + r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent; + g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent; + b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent; + } + if (alpha == 1) { + slot.color.set(r, g, b, a); + slot.darkColor.set(r2, g2, b2, 1); + } + else { + var light = slot.color, dark = slot.darkColor; + if (blend == MixBlend.setup) { + light.setFromColor(slot.data.color); + dark.setFromColor(slot.data.darkColor); + } + light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); + dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0); + } + }; + TwoColorTimeline.ENTRIES = 8; + TwoColorTimeline.PREV_TIME = -8; + TwoColorTimeline.PREV_R = -7; + TwoColorTimeline.PREV_G = -6; + TwoColorTimeline.PREV_B = -5; + TwoColorTimeline.PREV_A = -4; + TwoColorTimeline.PREV_R2 = -3; + TwoColorTimeline.PREV_G2 = -2; + TwoColorTimeline.PREV_B2 = -1; + TwoColorTimeline.R = 1; + TwoColorTimeline.G = 2; + TwoColorTimeline.B = 3; + TwoColorTimeline.A = 4; + TwoColorTimeline.R2 = 5; + TwoColorTimeline.G2 = 6; + TwoColorTimeline.B2 = 7; + return TwoColorTimeline; + }(CurveTimeline)); + spine.TwoColorTimeline = TwoColorTimeline; + var AttachmentTimeline = (function () { + function AttachmentTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.attachmentNames = new Array(frameCount); + } + AttachmentTimeline.prototype.getPropertyId = function () { + return (TimelineType.attachment << 24) + this.slotIndex; + }; + AttachmentTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) { + this.frames[frameIndex] = time; + this.attachmentNames[frameIndex] = attachmentName; + }; + AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + if (direction == MixDirection.out && blend == MixBlend.setup) { + var attachmentName_1 = slot.data.attachmentName; + slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1)); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) { + var attachmentName_2 = slot.data.attachmentName; + slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2)); + } + return; + } + var frameIndex = 0; + if (time >= frames[frames.length - 1]) + frameIndex = frames.length - 1; + else + frameIndex = Animation.binarySearch(frames, time, 1) - 1; + var attachmentName = this.attachmentNames[frameIndex]; + skeleton.slots[this.slotIndex] + .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); + }; + return AttachmentTimeline; + }()); + spine.AttachmentTimeline = AttachmentTimeline; + var zeros = null; + var DeformTimeline = (function (_super) { + __extends(DeformTimeline, _super); + function DeformTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount); + _this.frameVertices = new Array(frameCount); + if (zeros == null) + zeros = spine.Utils.newFloatArray(64); + return _this; + } + DeformTimeline.prototype.getPropertyId = function () { + return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex; + }; + DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) { + this.frames[frameIndex] = time; + this.frameVertices[frameIndex] = vertices; + }; + DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var slotAttachment = slot.getAttachment(); + if (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment)) + return; + var verticesArray = slot.attachmentVertices; + if (verticesArray.length == 0) + blend = MixBlend.setup; + var frameVertices = this.frameVertices; + var vertexCount = frameVertices[0].length; + var frames = this.frames; + if (time < frames[0]) { + var vertexAttachment = slotAttachment; + switch (blend) { + case MixBlend.setup: + verticesArray.length = 0; + return; + case MixBlend.first: + if (alpha == 1) { + verticesArray.length = 0; + break; + } + var vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount); + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha; + } + else { + alpha = 1 - alpha; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] *= alpha; + } + } + return; + } + var vertices = spine.Utils.setArraySize(verticesArray, vertexCount); + if (time >= frames[frames.length - 1]) { + var lastVertices = frameVertices[frames.length - 1]; + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_1 = 0; i_1 < vertexCount; i_1++) { + vertices[i_1] += lastVertices[i_1] - setupVertices[i_1]; + } + } + else { + for (var i_2 = 0; i_2 < vertexCount; i_2++) + vertices[i_2] += lastVertices[i_2]; + } + } + else { + spine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount); + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_1 = slotAttachment; + if (vertexAttachment_1.bones == null) { + var setupVertices = vertexAttachment_1.vertices; + for (var i_3 = 0; i_3 < vertexCount; i_3++) { + var setup = setupVertices[i_3]; + vertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha; + } + } + else { + for (var i_4 = 0; i_4 < vertexCount; i_4++) + vertices[i_4] = lastVertices[i_4] * alpha; + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_5 = 0; i_5 < vertexCount; i_5++) + vertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_6 = 0; i_6 < vertexCount; i_6++) { + vertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha; + } + } + else { + for (var i_7 = 0; i_7 < vertexCount; i_7++) + vertices[i_7] += lastVertices[i_7] * alpha; + } + } + } + return; + } + var frame = Animation.binarySearch(frames, time); + var prevVertices = frameVertices[frame - 1]; + var nextVertices = frameVertices[frame]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime)); + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_8 = 0; i_8 < vertexCount; i_8++) { + var prev = prevVertices[i_8]; + vertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8]; + } + } + else { + for (var i_9 = 0; i_9 < vertexCount; i_9++) { + var prev = prevVertices[i_9]; + vertices[i_9] += prev + (nextVertices[i_9] - prev) * percent; + } + } + } + else { + for (var i_10 = 0; i_10 < vertexCount; i_10++) { + var prev = prevVertices[i_10]; + vertices[i_10] = prev + (nextVertices[i_10] - prev) * percent; + } + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_2 = slotAttachment; + if (vertexAttachment_2.bones == null) { + var setupVertices = vertexAttachment_2.vertices; + for (var i_11 = 0; i_11 < vertexCount; i_11++) { + var prev = prevVertices[i_11], setup = setupVertices[i_11]; + vertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha; + } + } + else { + for (var i_12 = 0; i_12 < vertexCount; i_12++) { + var prev = prevVertices[i_12]; + vertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha; + } + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_13 = 0; i_13 < vertexCount; i_13++) { + var prev = prevVertices[i_13]; + vertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha; + } + break; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_14 = 0; i_14 < vertexCount; i_14++) { + var prev = prevVertices[i_14]; + vertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha; + } + } + else { + for (var i_15 = 0; i_15 < vertexCount; i_15++) { + var prev = prevVertices[i_15]; + vertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha; + } + } + } + } + }; + return DeformTimeline; + }(CurveTimeline)); + spine.DeformTimeline = DeformTimeline; + var EventTimeline = (function () { + function EventTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.events = new Array(frameCount); + } + EventTimeline.prototype.getPropertyId = function () { + return TimelineType.event << 24; + }; + EventTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + EventTimeline.prototype.setFrame = function (frameIndex, event) { + this.frames[frameIndex] = event.time; + this.events[frameIndex] = event; + }; + EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + if (firedEvents == null) + return; + var frames = this.frames; + var frameCount = this.frames.length; + if (lastTime > time) { + this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction); + lastTime = -1; + } + else if (lastTime >= frames[frameCount - 1]) + return; + if (time < frames[0]) + return; + var frame = 0; + if (lastTime < frames[0]) + frame = 0; + else { + frame = Animation.binarySearch(frames, lastTime); + var frameTime = frames[frame]; + while (frame > 0) { + if (frames[frame - 1] != frameTime) + break; + frame--; + } + } + for (; frame < frameCount && time >= frames[frame]; frame++) + firedEvents.push(this.events[frame]); + }; + return EventTimeline; + }()); + spine.EventTimeline = EventTimeline; + var DrawOrderTimeline = (function () { + function DrawOrderTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.drawOrders = new Array(frameCount); + } + DrawOrderTimeline.prototype.getPropertyId = function () { + return TimelineType.drawOrder << 24; + }; + DrawOrderTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) { + this.frames[frameIndex] = time; + this.drawOrders[frameIndex] = drawOrder; + }; + DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var drawOrder = skeleton.drawOrder; + var slots = skeleton.slots; + if (direction == MixDirection.out && blend == MixBlend.setup) { + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frame = 0; + if (time >= frames[frames.length - 1]) + frame = frames.length - 1; + else + frame = Animation.binarySearch(frames, time) - 1; + var drawOrderToSetupIndex = this.drawOrders[frame]; + if (drawOrderToSetupIndex == null) + spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length); + else { + for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) + drawOrder[i] = slots[drawOrderToSetupIndex[i]]; + } + }; + return DrawOrderTimeline; + }()); + spine.DrawOrderTimeline = DrawOrderTimeline; + var IkConstraintTimeline = (function (_super) { + __extends(IkConstraintTimeline, _super); + function IkConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES); + return _this; + } + IkConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex; + }; + IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) { + frameIndex *= IkConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + IkConstraintTimeline.MIX] = mix; + this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection; + this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0; + this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0; + }; + IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.ikConstraints[this.ikConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + return; + case MixBlend.first: + constraint.mix += (constraint.data.mix - constraint.mix) * alpha; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + return; + } + if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + return; + } + var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES); + var mix = frames[frame + IkConstraintTimeline.PREV_MIX]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime)); + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + }; + IkConstraintTimeline.ENTRIES = 5; + IkConstraintTimeline.PREV_TIME = -5; + IkConstraintTimeline.PREV_MIX = -4; + IkConstraintTimeline.PREV_BEND_DIRECTION = -3; + IkConstraintTimeline.PREV_COMPRESS = -2; + IkConstraintTimeline.PREV_STRETCH = -1; + IkConstraintTimeline.MIX = 1; + IkConstraintTimeline.BEND_DIRECTION = 2; + IkConstraintTimeline.COMPRESS = 3; + IkConstraintTimeline.STRETCH = 4; + return IkConstraintTimeline; + }(CurveTimeline)); + spine.IkConstraintTimeline = IkConstraintTimeline; + var TransformConstraintTimeline = (function (_super) { + __extends(TransformConstraintTimeline, _super); + function TransformConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES); + return _this; + } + TransformConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex; + }; + TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) { + frameIndex *= TransformConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix; + this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix; + this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix; + }; + TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.transformConstraints[this.transformConstraintIndex]; + if (time < frames[0]) { + var data = constraint.data; + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + return; + case MixBlend.first: + constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha; + constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha; + constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha; + } + return; + } + var rotate = 0, translate = 0, scale = 0, shear = 0; + if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { + var i = frames.length; + rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[i + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[i + TransformConstraintTimeline.PREV_SHEAR]; + } + else { + var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES); + rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[frame + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent; + scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent; + shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent; + } + if (blend == MixBlend.setup) { + var data = constraint.data; + constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha; + constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha; + constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha; + constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + constraint.scaleMix += (scale - constraint.scaleMix) * alpha; + constraint.shearMix += (shear - constraint.shearMix) * alpha; + } + }; + TransformConstraintTimeline.ENTRIES = 5; + TransformConstraintTimeline.PREV_TIME = -5; + TransformConstraintTimeline.PREV_ROTATE = -4; + TransformConstraintTimeline.PREV_TRANSLATE = -3; + TransformConstraintTimeline.PREV_SCALE = -2; + TransformConstraintTimeline.PREV_SHEAR = -1; + TransformConstraintTimeline.ROTATE = 1; + TransformConstraintTimeline.TRANSLATE = 2; + TransformConstraintTimeline.SCALE = 3; + TransformConstraintTimeline.SHEAR = 4; + return TransformConstraintTimeline; + }(CurveTimeline)); + spine.TransformConstraintTimeline = TransformConstraintTimeline; + var PathConstraintPositionTimeline = (function (_super) { + __extends(PathConstraintPositionTimeline, _super); + function PathConstraintPositionTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES); + return _this; + } + PathConstraintPositionTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex; + }; + PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) { + frameIndex *= PathConstraintPositionTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value; + }; + PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.position = constraint.data.position; + return; + case MixBlend.first: + constraint.position += (constraint.data.position - constraint.position) * alpha; + } + return; + } + var position = 0; + if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) + position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES); + position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime)); + position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent; + } + if (blend == MixBlend.setup) + constraint.position = constraint.data.position + (position - constraint.data.position) * alpha; + else + constraint.position += (position - constraint.position) * alpha; + }; + PathConstraintPositionTimeline.ENTRIES = 2; + PathConstraintPositionTimeline.PREV_TIME = -2; + PathConstraintPositionTimeline.PREV_VALUE = -1; + PathConstraintPositionTimeline.VALUE = 1; + return PathConstraintPositionTimeline; + }(CurveTimeline)); + spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline; + var PathConstraintSpacingTimeline = (function (_super) { + __extends(PathConstraintSpacingTimeline, _super); + function PathConstraintSpacingTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + PathConstraintSpacingTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex; + }; + PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.spacing = constraint.data.spacing; + return; + case MixBlend.first: + constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha; + } + return; + } + var spacing = 0; + if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) + spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES); + spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime)); + spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent; + } + if (blend == MixBlend.setup) + constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha; + else + constraint.spacing += (spacing - constraint.spacing) * alpha; + }; + return PathConstraintSpacingTimeline; + }(PathConstraintPositionTimeline)); + spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline; + var PathConstraintMixTimeline = (function (_super) { + __extends(PathConstraintMixTimeline, _super); + function PathConstraintMixTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES); + return _this; + } + PathConstraintMixTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex; + }; + PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) { + frameIndex *= PathConstraintMixTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix; + }; + PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = constraint.data.rotateMix; + constraint.translateMix = constraint.data.translateMix; + return; + case MixBlend.first: + constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha; + } + return; + } + var rotate = 0, translate = 0; + if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { + rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE]; + } + else { + var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES); + rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent; + } + if (blend == MixBlend.setup) { + constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha; + constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + } + }; + PathConstraintMixTimeline.ENTRIES = 3; + PathConstraintMixTimeline.PREV_TIME = -3; + PathConstraintMixTimeline.PREV_ROTATE = -2; + PathConstraintMixTimeline.PREV_TRANSLATE = -1; + PathConstraintMixTimeline.ROTATE = 1; + PathConstraintMixTimeline.TRANSLATE = 2; + return PathConstraintMixTimeline; + }(CurveTimeline)); + spine.PathConstraintMixTimeline = PathConstraintMixTimeline; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationState = (function () { + function AnimationState(data) { + this.tracks = new Array(); + this.events = new Array(); + this.listeners = new Array(); + this.queue = new EventQueue(this); + this.propertyIDs = new spine.IntSet(); + this.animationsChanged = false; + this.timeScale = 1; + this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); }); + this.data = data; + } + AnimationState.prototype.update = function (delta) { + delta *= this.timeScale; + var tracks = this.tracks; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null) + continue; + current.animationLast = current.nextAnimationLast; + current.trackLast = current.nextTrackLast; + var currentDelta = delta * current.timeScale; + if (current.delay > 0) { + current.delay -= currentDelta; + if (current.delay > 0) + continue; + currentDelta = -current.delay; + current.delay = 0; + } + var next = current.next; + if (next != null) { + var nextTime = current.trackLast - next.delay; + if (nextTime >= 0) { + next.delay = 0; + next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; + current.trackTime += currentDelta; + this.setCurrent(i, next, true); + while (next.mixingFrom != null) { + next.mixTime += delta; + next = next.mixingFrom; + } + continue; + } + } + else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) { + tracks[i] = null; + this.queue.end(current); + this.disposeNext(current); + continue; + } + if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) { + var from = current.mixingFrom; + current.mixingFrom = null; + if (from != null) + from.mixingTo = null; + while (from != null) { + this.queue.end(from); + from = from.mixingFrom; + } + } + current.trackTime += currentDelta; + } + this.queue.drain(); + }; + AnimationState.prototype.updateMixingFrom = function (to, delta) { + var from = to.mixingFrom; + if (from == null) + return true; + var finished = this.updateMixingFrom(from, delta); + from.animationLast = from.nextAnimationLast; + from.trackLast = from.nextTrackLast; + if (to.mixTime > 0 && to.mixTime >= to.mixDuration) { + if (from.totalAlpha == 0 || to.mixDuration == 0) { + to.mixingFrom = from.mixingFrom; + if (from.mixingFrom != null) + from.mixingFrom.mixingTo = to; + to.interruptAlpha = from.interruptAlpha; + this.queue.end(from); + } + return finished; + } + from.trackTime += delta * from.timeScale; + to.mixTime += delta; + return false; + }; + AnimationState.prototype.apply = function (skeleton) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (this.animationsChanged) + this._animationsChanged(); + var events = this.events; + var tracks = this.tracks; + var applied = false; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null || current.delay > 0) + continue; + applied = true; + var blend = i == 0 ? spine.MixBlend.first : current.mixBlend; + var mix = current.alpha; + if (current.mixingFrom != null) + mix *= this.applyMixingFrom(current, skeleton, blend); + else if (current.trackTime >= current.trackEnd && current.next == null) + mix = 0; + var animationLast = current.animationLast, animationTime = current.getAnimationTime(); + var timelineCount = current.animation.timelines.length; + var timelines = current.animation.timelines; + if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) { + for (var ii = 0; ii < timelineCount; ii++) + timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]); + } + else { + var timelineMode = current.timelineMode; + var firstFrame = current.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = current.timelinesRotation; + for (var ii = 0; ii < timelineCount; ii++) { + var timeline = timelines[ii]; + var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup; + if (timeline instanceof spine.RotateTimeline) { + this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame); + } + else { + spine.Utils.webkit602BugfixHelper(mix, blend); + timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]); + } + } + } + this.queueEvents(current, animationTime); + events.length = 0; + current.nextAnimationLast = animationTime; + current.nextTrackLast = current.trackTime; + } + this.queue.drain(); + return applied; + }; + AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) { + var from = to.mixingFrom; + if (from.mixingFrom != null) + this.applyMixingFrom(from, skeleton, blend); + var mix = 0; + if (to.mixDuration == 0) { + mix = 1; + if (blend == spine.MixBlend.first) + blend = spine.MixBlend.setup; + } + else { + mix = to.mixTime / to.mixDuration; + if (mix > 1) + mix = 1; + if (blend != spine.MixBlend.first) + blend = from.mixBlend; + } + var events = mix < from.eventThreshold ? this.events : null; + var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold; + var animationLast = from.animationLast, animationTime = from.getAnimationTime(); + var timelineCount = from.animation.timelines.length; + var timelines = from.animation.timelines; + var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); + if (blend == spine.MixBlend.add) { + for (var i = 0; i < timelineCount; i++) + timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out); + } + else { + var timelineMode = from.timelineMode; + var timelineHoldMix = from.timelineHoldMix; + var firstFrame = from.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = from.timelinesRotation; + from.totalAlpha = 0; + for (var i = 0; i < timelineCount; i++) { + var timeline = timelines[i]; + var direction = spine.MixDirection.out; + var timelineBlend = void 0; + var alpha = 0; + switch (timelineMode[i]) { + case AnimationState.SUBSEQUENT: + if (!attachments && timeline instanceof spine.AttachmentTimeline) + continue; + if (!drawOrder && timeline instanceof spine.DrawOrderTimeline) + continue; + timelineBlend = blend; + alpha = alphaMix; + break; + case AnimationState.FIRST: + timelineBlend = spine.MixBlend.setup; + alpha = alphaMix; + break; + case AnimationState.HOLD: + timelineBlend = spine.MixBlend.setup; + alpha = alphaHold; + break; + default: + timelineBlend = spine.MixBlend.setup; + var holdMix = timelineHoldMix[i]; + alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); + break; + } + from.totalAlpha += alpha; + if (timeline instanceof spine.RotateTimeline) + this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame); + else { + spine.Utils.webkit602BugfixHelper(alpha, blend); + if (timelineBlend == spine.MixBlend.setup) { + if (timeline instanceof spine.AttachmentTimeline) { + if (attachments) + direction = spine.MixDirection.out; + } + else if (timeline instanceof spine.DrawOrderTimeline) { + if (drawOrder) + direction = spine.MixDirection.out; + } + } + timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction); + } + } + } + if (to.mixDuration > 0) + this.queueEvents(from, animationTime); + this.events.length = 0; + from.nextAnimationLast = animationTime; + from.nextTrackLast = from.trackTime; + return mix; + }; + AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { + if (firstFrame) + timelinesRotation[i] = 0; + if (alpha == 1) { + timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]); + return; + } + var rotateTimeline = timeline; + var frames = rotateTimeline.frames; + var bone = skeleton.bones[rotateTimeline.boneIndex]; + var r1 = 0, r2 = 0; + if (time < frames[0]) { + switch (blend) { + case spine.MixBlend.setup: + bone.rotation = bone.data.rotation; + default: + return; + case spine.MixBlend.first: + r1 = bone.rotation; + r2 = bone.data.rotation; + } + } + else { + r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation; + if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES]) + r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION]; + else { + var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES); + var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime)); + r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + r2 = prevRotation + r2 * percent + bone.data.rotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + } + } + var total = 0, diff = r2 - r1; + diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360; + if (diff == 0) { + total = timelinesRotation[i]; + } + else { + var lastTotal = 0, lastDiff = 0; + if (firstFrame) { + lastTotal = 0; + lastDiff = diff; + } + else { + lastTotal = timelinesRotation[i]; + lastDiff = timelinesRotation[i + 1]; + } + var current = diff > 0, dir = lastTotal >= 0; + if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) { + if (Math.abs(lastTotal) > 180) + lastTotal += 360 * spine.MathUtils.signum(lastTotal); + dir = current; + } + total = diff + lastTotal - lastTotal % 360; + if (dir != current) + total += 360 * spine.MathUtils.signum(lastTotal); + timelinesRotation[i] = total; + } + timelinesRotation[i + 1] = diff; + r1 += total * alpha; + bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360; + }; + AnimationState.prototype.queueEvents = function (entry, animationTime) { + var animationStart = entry.animationStart, animationEnd = entry.animationEnd; + var duration = animationEnd - animationStart; + var trackLastWrapped = entry.trackLast % duration; + var events = this.events; + var i = 0, n = events.length; + for (; i < n; i++) { + var event_1 = events[i]; + if (event_1.time < trackLastWrapped) + break; + if (event_1.time > animationEnd) + continue; + this.queue.event(entry, event_1); + } + var complete = false; + if (entry.loop) + complete = duration == 0 || trackLastWrapped > entry.trackTime % duration; + else + complete = animationTime >= animationEnd && entry.animationLast < animationEnd; + if (complete) + this.queue.complete(entry); + for (; i < n; i++) { + var event_2 = events[i]; + if (event_2.time < animationStart) + continue; + this.queue.event(entry, events[i]); + } + }; + AnimationState.prototype.clearTracks = function () { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) + this.clearTrack(i); + this.tracks.length = 0; + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.clearTrack = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return; + var current = this.tracks[trackIndex]; + if (current == null) + return; + this.queue.end(current); + this.disposeNext(current); + var entry = current; + while (true) { + var from = entry.mixingFrom; + if (from == null) + break; + this.queue.end(from); + entry.mixingFrom = null; + entry.mixingTo = null; + entry = from; + } + this.tracks[current.trackIndex] = null; + this.queue.drain(); + }; + AnimationState.prototype.setCurrent = function (index, current, interrupt) { + var from = this.expandToIndex(index); + this.tracks[index] = current; + if (from != null) { + if (interrupt) + this.queue.interrupt(from); + current.mixingFrom = from; + from.mixingTo = current; + current.mixTime = 0; + if (from.mixingFrom != null && from.mixDuration > 0) + current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); + from.timelinesRotation.length = 0; + } + this.queue.start(current); + }; + AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.setAnimationWith(trackIndex, animation, loop); + }; + AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) { + if (animation == null) + throw new Error("animation cannot be null."); + var interrupt = true; + var current = this.expandToIndex(trackIndex); + if (current != null) { + if (current.nextTrackLast == -1) { + this.tracks[trackIndex] = current.mixingFrom; + this.queue.interrupt(current); + this.queue.end(current); + this.disposeNext(current); + current = current.mixingFrom; + interrupt = false; + } + else + this.disposeNext(current); + } + var entry = this.trackEntry(trackIndex, animation, loop, current); + this.setCurrent(trackIndex, entry, interrupt); + this.queue.drain(); + return entry; + }; + AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.addAnimationWith(trackIndex, animation, loop, delay); + }; + AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) { + if (animation == null) + throw new Error("animation cannot be null."); + var last = this.expandToIndex(trackIndex); + if (last != null) { + while (last.next != null) + last = last.next; + } + var entry = this.trackEntry(trackIndex, animation, loop, last); + if (last == null) { + this.setCurrent(trackIndex, entry, true); + this.queue.drain(); + } + else { + last.next = entry; + if (delay <= 0) { + var duration = last.animationEnd - last.animationStart; + if (duration != 0) { + if (last.loop) + delay += duration * (1 + ((last.trackTime / duration) | 0)); + else + delay += Math.max(duration, last.trackTime); + delay -= this.data.getMix(last.animation, animation); + } + else + delay = last.trackTime; + } + } + entry.delay = delay; + return entry; + }; + AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) { + var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) { + if (delay <= 0) + delay -= mixDuration; + var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.setEmptyAnimations = function (mixDuration) { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) { + var current = this.tracks[i]; + if (current != null) + this.setEmptyAnimation(current.trackIndex, mixDuration); + } + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.expandToIndex = function (index) { + if (index < this.tracks.length) + return this.tracks[index]; + spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null); + this.tracks.length = index + 1; + return null; + }; + AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) { + var entry = this.trackEntryPool.obtain(); + entry.trackIndex = trackIndex; + entry.animation = animation; + entry.loop = loop; + entry.holdPrevious = false; + entry.eventThreshold = 0; + entry.attachmentThreshold = 0; + entry.drawOrderThreshold = 0; + entry.animationStart = 0; + entry.animationEnd = animation.duration; + entry.animationLast = -1; + entry.nextAnimationLast = -1; + entry.delay = 0; + entry.trackTime = 0; + entry.trackLast = -1; + entry.nextTrackLast = -1; + entry.trackEnd = Number.MAX_VALUE; + entry.timeScale = 1; + entry.alpha = 1; + entry.interruptAlpha = 1; + entry.mixTime = 0; + entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); + return entry; + }; + AnimationState.prototype.disposeNext = function (entry) { + var next = entry.next; + while (next != null) { + this.queue.dispose(next); + next = next.next; + } + entry.next = null; + }; + AnimationState.prototype._animationsChanged = function () { + this.animationsChanged = false; + this.propertyIDs.clear(); + for (var i = 0, n = this.tracks.length; i < n; i++) { + var entry = this.tracks[i]; + if (entry == null) + continue; + while (entry.mixingFrom != null) + entry = entry.mixingFrom; + do { + if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add) + this.setTimelineModes(entry); + entry = entry.mixingTo; + } while (entry != null); + } + }; + AnimationState.prototype.setTimelineModes = function (entry) { + var to = entry.mixingTo; + var timelines = entry.animation.timelines; + var timelinesCount = entry.animation.timelines.length; + var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount); + entry.timelineHoldMix.length = 0; + var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount); + var propertyIDs = this.propertyIDs; + if (to != null && to.holdPrevious) { + for (var i = 0; i < timelinesCount; i++) { + propertyIDs.add(timelines[i].getPropertyId()); + timelineMode[i] = AnimationState.HOLD; + } + return; + } + outer: for (var i = 0; i < timelinesCount; i++) { + var id = timelines[i].getPropertyId(); + if (!propertyIDs.add(id)) + timelineMode[i] = AnimationState.SUBSEQUENT; + else if (to == null || !this.hasTimeline(to, id)) + timelineMode[i] = AnimationState.FIRST; + else { + for (var next = to.mixingTo; next != null; next = next.mixingTo) { + if (this.hasTimeline(next, id)) + continue; + if (entry.mixDuration > 0) { + timelineMode[i] = AnimationState.HOLD_MIX; + timelineDipMix[i] = next; + continue outer; + } + break; + } + timelineMode[i] = AnimationState.HOLD; + } + } + }; + AnimationState.prototype.hasTimeline = function (entry, id) { + var timelines = entry.animation.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + if (timelines[i].getPropertyId() == id) + return true; + return false; + }; + AnimationState.prototype.getCurrent = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return null; + return this.tracks[trackIndex]; + }; + AnimationState.prototype.addListener = function (listener) { + if (listener == null) + throw new Error("listener cannot be null."); + this.listeners.push(listener); + }; + AnimationState.prototype.removeListener = function (listener) { + var index = this.listeners.indexOf(listener); + if (index >= 0) + this.listeners.splice(index, 1); + }; + AnimationState.prototype.clearListeners = function () { + this.listeners.length = 0; + }; + AnimationState.prototype.clearListenerNotifications = function () { + this.queue.clear(); + }; + AnimationState.emptyAnimation = new spine.Animation("", [], 0); + AnimationState.SUBSEQUENT = 0; + AnimationState.FIRST = 1; + AnimationState.HOLD = 2; + AnimationState.HOLD_MIX = 3; + return AnimationState; + }()); + spine.AnimationState = AnimationState; + var TrackEntry = (function () { + function TrackEntry() { + this.mixBlend = spine.MixBlend.replace; + this.timelineMode = new Array(); + this.timelineHoldMix = new Array(); + this.timelinesRotation = new Array(); + } + TrackEntry.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; + }; + TrackEntry.prototype.getAnimationTime = function () { + if (this.loop) { + var duration = this.animationEnd - this.animationStart; + if (duration == 0) + return this.animationStart; + return (this.trackTime % duration) + this.animationStart; + } + return Math.min(this.trackTime + this.animationStart, this.animationEnd); + }; + TrackEntry.prototype.setAnimationLast = function (animationLast) { + this.animationLast = animationLast; + this.nextAnimationLast = animationLast; + }; + TrackEntry.prototype.isComplete = function () { + return this.trackTime >= this.animationEnd - this.animationStart; + }; + TrackEntry.prototype.resetRotationDirections = function () { + this.timelinesRotation.length = 0; + }; + return TrackEntry; + }()); + spine.TrackEntry = TrackEntry; + var EventQueue = (function () { + function EventQueue(animState) { + this.objects = []; + this.drainDisabled = false; + this.animState = animState; + } + EventQueue.prototype.start = function (entry) { + this.objects.push(EventType.start); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.interrupt = function (entry) { + this.objects.push(EventType.interrupt); + this.objects.push(entry); + }; + EventQueue.prototype.end = function (entry) { + this.objects.push(EventType.end); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.dispose = function (entry) { + this.objects.push(EventType.dispose); + this.objects.push(entry); + }; + EventQueue.prototype.complete = function (entry) { + this.objects.push(EventType.complete); + this.objects.push(entry); + }; + EventQueue.prototype.event = function (entry, event) { + this.objects.push(EventType.event); + this.objects.push(entry); + this.objects.push(event); + }; + EventQueue.prototype.drain = function () { + if (this.drainDisabled) + return; + this.drainDisabled = true; + var objects = this.objects; + var listeners = this.animState.listeners; + for (var i = 0; i < objects.length; i += 2) { + var type = objects[i]; + var entry = objects[i + 1]; + switch (type) { + case EventType.start: + if (entry.listener != null && entry.listener.start) + entry.listener.start(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].start) + listeners[ii].start(entry); + break; + case EventType.interrupt: + if (entry.listener != null && entry.listener.interrupt) + entry.listener.interrupt(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].interrupt) + listeners[ii].interrupt(entry); + break; + case EventType.end: + if (entry.listener != null && entry.listener.end) + entry.listener.end(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].end) + listeners[ii].end(entry); + case EventType.dispose: + if (entry.listener != null && entry.listener.dispose) + entry.listener.dispose(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].dispose) + listeners[ii].dispose(entry); + this.animState.trackEntryPool.free(entry); + break; + case EventType.complete: + if (entry.listener != null && entry.listener.complete) + entry.listener.complete(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].complete) + listeners[ii].complete(entry); + break; + case EventType.event: + var event_3 = objects[i++ + 2]; + if (entry.listener != null && entry.listener.event) + entry.listener.event(entry, event_3); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].event) + listeners[ii].event(entry, event_3); + break; + } + } + this.clear(); + this.drainDisabled = false; + }; + EventQueue.prototype.clear = function () { + this.objects.length = 0; + }; + return EventQueue; + }()); + spine.EventQueue = EventQueue; + var EventType; + (function (EventType) { + EventType[EventType["start"] = 0] = "start"; + EventType[EventType["interrupt"] = 1] = "interrupt"; + EventType[EventType["end"] = 2] = "end"; + EventType[EventType["dispose"] = 3] = "dispose"; + EventType[EventType["complete"] = 4] = "complete"; + EventType[EventType["event"] = 5] = "event"; + })(EventType = spine.EventType || (spine.EventType = {})); + var AnimationStateAdapter2 = (function () { + function AnimationStateAdapter2() { + } + AnimationStateAdapter2.prototype.start = function (entry) { + }; + AnimationStateAdapter2.prototype.interrupt = function (entry) { + }; + AnimationStateAdapter2.prototype.end = function (entry) { + }; + AnimationStateAdapter2.prototype.dispose = function (entry) { + }; + AnimationStateAdapter2.prototype.complete = function (entry) { + }; + AnimationStateAdapter2.prototype.event = function (entry, event) { + }; + return AnimationStateAdapter2; + }()); + spine.AnimationStateAdapter2 = AnimationStateAdapter2; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationStateData = (function () { + function AnimationStateData(skeletonData) { + this.animationToMixTime = {}; + this.defaultMix = 0; + if (skeletonData == null) + throw new Error("skeletonData cannot be null."); + this.skeletonData = skeletonData; + } + AnimationStateData.prototype.setMix = function (fromName, toName, duration) { + var from = this.skeletonData.findAnimation(fromName); + if (from == null) + throw new Error("Animation not found: " + fromName); + var to = this.skeletonData.findAnimation(toName); + if (to == null) + throw new Error("Animation not found: " + toName); + this.setMixWith(from, to, duration); + }; + AnimationStateData.prototype.setMixWith = function (from, to, duration) { + if (from == null) + throw new Error("from cannot be null."); + if (to == null) + throw new Error("to cannot be null."); + var key = from.name + "." + to.name; + this.animationToMixTime[key] = duration; + }; + AnimationStateData.prototype.getMix = function (from, to) { + var key = from.name + "." + to.name; + var value = this.animationToMixTime[key]; + return value === undefined ? this.defaultMix : value; + }; + return AnimationStateData; + }()); + spine.AnimationStateData = AnimationStateData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AssetManager = (function () { + function AssetManager(textureLoader, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.assets = {}; + this.errors = {}; + this.toLoad = 0; + this.loaded = 0; + this.textureLoader = textureLoader; + this.pathPrefix = pathPrefix; + } + AssetManager.downloadText = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.onload = function () { + if (request.status == 200) { + success(request.responseText); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.downloadBinary = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.responseType = "arraybuffer"; + request.onload = function () { + if (request.status == 200) { + success(new Uint8Array(request.response)); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.prototype.loadText = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (data) { + _this.assets[path] = data; + if (success) + success(path, data); + _this.toLoad--; + _this.loaded++; + }, function (state, responseText) { + _this.errors[path] = "Couldn't load text " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load text " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.loadTexture = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = path; + }; + AssetManager.prototype.loadTextureData = function (path, data, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = data; + }; + AssetManager.prototype.loadTextureAtlas = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + var parent = path.lastIndexOf("/") >= 0 ? path.substring(0, path.lastIndexOf("/")) : ""; + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (atlasData) { + var pagesLoaded = { count: 0 }; + var atlasPages = new Array(); + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + atlasPages.push(parent + "/" + path); + var image = document.createElement("img"); + image.width = 16; + image.height = 16; + return new spine.FakeTexture(image); + }); + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + return; + } + var _loop_1 = function (atlasPage) { + var pageLoadError = false; + _this.loadTexture(atlasPage, function (imagePath, image) { + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + if (!pageLoadError) { + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + return _this.get(parent + "/" + path); + }); + _this.assets[path] = atlas; + if (success) + success(path, atlas); + _this.toLoad--; + _this.loaded++; + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + } + } + else { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + } + }, function (imagePath, errorMessage) { + pageLoadError = true; + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + }); + }; + for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) { + var atlasPage = atlasPages_1[_i]; + _loop_1(atlasPage); + } + }, function (state, responseText) { + _this.errors[path] = "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.get = function (path) { + path = this.pathPrefix + path; + return this.assets[path]; + }; + AssetManager.prototype.remove = function (path) { + path = this.pathPrefix + path; + var asset = this.assets[path]; + if (asset.dispose) + asset.dispose(); + this.assets[path] = null; + }; + AssetManager.prototype.removeAll = function () { + for (var key in this.assets) { + var asset = this.assets[key]; + if (asset.dispose) + asset.dispose(); + } + this.assets = {}; + }; + AssetManager.prototype.isLoadingComplete = function () { + return this.toLoad == 0; + }; + AssetManager.prototype.getToLoad = function () { + return this.toLoad; + }; + AssetManager.prototype.getLoaded = function () { + return this.loaded; + }; + AssetManager.prototype.dispose = function () { + this.removeAll(); + }; + AssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + AssetManager.prototype.getErrors = function () { + return this.errors; + }; + return AssetManager; + }()); + spine.AssetManager = AssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AtlasAttachmentLoader = (function () { + function AtlasAttachmentLoader(atlas) { + this.atlas = atlas; + } + AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.RegionAttachment(name); + attachment.setRegion(region); + return attachment; + }; + AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.MeshAttachment(name); + attachment.region = region; + return attachment; + }; + AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) { + return new spine.BoundingBoxAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) { + return new spine.PathAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) { + return new spine.PointAttachment(name); + }; + AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) { + return new spine.ClippingAttachment(name); + }; + return AtlasAttachmentLoader; + }()); + spine.AtlasAttachmentLoader = AtlasAttachmentLoader; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BlendMode; + (function (BlendMode) { + BlendMode[BlendMode["Normal"] = 0] = "Normal"; + BlendMode[BlendMode["Additive"] = 1] = "Additive"; + BlendMode[BlendMode["Multiply"] = 2] = "Multiply"; + BlendMode[BlendMode["Screen"] = 3] = "Screen"; + })(BlendMode = spine.BlendMode || (spine.BlendMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Bone = (function () { + function Bone(data, skeleton, parent) { + 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 = false; + this.a = 0; + this.b = 0; + this.worldX = 0; + this.c = 0; + this.d = 0; + this.worldY = 0; + this.sorted = false; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.skeleton = skeleton; + this.parent = parent; + this.setToSetupPose(); + } + Bone.prototype.update = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransform = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) { + this.ax = x; + this.ay = y; + this.arotation = rotation; + this.ascaleX = scaleX; + this.ascaleY = scaleY; + this.ashearX = shearX; + this.ashearY = shearY; + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + var skeleton = this.skeleton; + var rotationY = rotation + 90 + shearY; + var sx = skeleton.scaleX; + var sy = skeleton.scaleY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy; + this.worldX = x * sx + skeleton.x; + this.worldY = y * sy + skeleton.y; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + this.worldX = pa * x + pb * y + parent.worldX; + this.worldY = pc * x + pd * y + parent.worldY; + switch (this.data.transformMode) { + case spine.TransformMode.Normal: { + var rotationY = rotation + 90 + shearY; + var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(rotationY) * scaleY; + var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(rotationY) * scaleY; + this.a = pa * la + pb * lc; + this.b = pa * lb + pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + return; + } + case spine.TransformMode.OnlyTranslation: { + var rotationY = rotation + 90 + shearY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY; + break; + } + case spine.TransformMode.NoRotationOrReflection: { + var s = pa * pa + pc * pc; + var prx = 0; + if (s > 0.0001) { + s = Math.abs(pa * pd - pb * pc) / s; + pb = pc * s; + pd = pa * s; + prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg; + } + else { + pa = 0; + pc = 0; + prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg; + } + var rx = rotation + shearX - prx; + var ry = rotation + shearY - prx + 90; + var la = spine.MathUtils.cosDeg(rx) * scaleX; + var lb = spine.MathUtils.cosDeg(ry) * scaleY; + var lc = spine.MathUtils.sinDeg(rx) * scaleX; + var ld = spine.MathUtils.sinDeg(ry) * scaleY; + this.a = pa * la - pb * lc; + this.b = pa * lb - pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + break; + } + case spine.TransformMode.NoScale: + case spine.TransformMode.NoScaleOrReflection: { + var cos = spine.MathUtils.cosDeg(rotation); + var sin = spine.MathUtils.sinDeg(rotation); + var za = (pa * cos + pb * sin) / this.skeleton.scaleX; + var zc = (pc * cos + pd * sin) / this.skeleton.scaleY; + var s = Math.sqrt(za * za + zc * zc); + if (s > 0.00001) + s = 1 / s; + za *= s; + zc *= s; + s = Math.sqrt(za * za + zc * zc); + if (this.data.transformMode == spine.TransformMode.NoScale + && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) + s = -s; + var r = Math.PI / 2 + Math.atan2(zc, za); + var zb = Math.cos(r) * s; + var zd = Math.sin(r) * s; + var la = spine.MathUtils.cosDeg(shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY; + var lc = spine.MathUtils.sinDeg(shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY; + this.a = za * la + zb * lc; + this.b = za * lb + zb * ld; + this.c = zc * la + zd * lc; + this.d = zc * lb + zd * ld; + break; + } + } + this.a *= this.skeleton.scaleX; + this.b *= this.skeleton.scaleX; + this.c *= this.skeleton.scaleY; + this.d *= this.skeleton.scaleY; + }; + Bone.prototype.setToSetupPose = function () { + var data = this.data; + this.x = data.x; + this.y = data.y; + this.rotation = data.rotation; + this.scaleX = data.scaleX; + this.scaleY = data.scaleY; + this.shearX = data.shearX; + this.shearY = data.shearY; + }; + Bone.prototype.getWorldRotationX = function () { + return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldRotationY = function () { + return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldScaleX = function () { + return Math.sqrt(this.a * this.a + this.c * this.c); + }; + Bone.prototype.getWorldScaleY = function () { + return Math.sqrt(this.b * this.b + this.d * this.d); + }; + Bone.prototype.updateAppliedTransform = function () { + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + this.ax = this.worldX; + this.ay = this.worldY; + this.arotation = Math.atan2(this.c, this.a) * spine.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; + this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + var pid = 1 / (pa * pd - pb * pc); + var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; + this.ax = (dx * pd * pid - dy * pb * pid); + this.ay = (dy * pa * pid - dx * pc * pid); + var ia = pid * pd; + var id = pid * pa; + var ib = pid * pb; + var ic = pid * pc; + var ra = ia * this.a - ib * this.c; + var rb = ia * this.b - ib * this.d; + var rc = id * this.c - ic * this.a; + var rd = id * this.d - ic * this.b; + this.ashearX = 0; + this.ascaleX = Math.sqrt(ra * ra + rc * rc); + if (this.ascaleX > 0.0001) { + var det = ra * rd - rb * rc; + this.ascaleY = det / this.ascaleX; + this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg; + this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg; + } + else { + this.ascaleX = 0; + this.ascaleY = Math.sqrt(rb * rb + rd * rd); + this.ashearY = 0; + this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg; + } + }; + Bone.prototype.worldToLocal = function (world) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var invDet = 1 / (a * d - b * c); + var x = world.x - this.worldX, y = world.y - this.worldY; + world.x = (x * d * invDet - y * b * invDet); + world.y = (y * a * invDet - x * c * invDet); + return world; + }; + Bone.prototype.localToWorld = function (local) { + var x = local.x, y = local.y; + local.x = x * this.a + y * this.b + this.worldX; + local.y = x * this.c + y * this.d + this.worldY; + return local; + }; + Bone.prototype.worldToLocalRotation = function (worldRotation) { + var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation); + return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX; + }; + Bone.prototype.localToWorldRotation = function (localRotation) { + localRotation -= this.rotation - this.shearX; + var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation); + return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.rotateWorld = function (degrees) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees); + this.a = cos * a - sin * c; + this.b = cos * b - sin * d; + this.c = sin * a + cos * c; + this.d = sin * b + cos * d; + this.appliedValid = false; + }; + return Bone; + }()); + spine.Bone = Bone; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoneData = (function () { + function BoneData(index, name, parent) { + this.x = 0; + this.y = 0; + this.rotation = 0; + this.scaleX = 1; + this.scaleY = 1; + this.shearX = 0; + this.shearY = 0; + this.transformMode = TransformMode.Normal; + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + this.index = index; + this.name = name; + this.parent = parent; + } + return BoneData; + }()); + spine.BoneData = BoneData; + var TransformMode; + (function (TransformMode) { + TransformMode[TransformMode["Normal"] = 0] = "Normal"; + TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation"; + TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; + TransformMode[TransformMode["NoScale"] = 3] = "NoScale"; + TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; + })(TransformMode = spine.TransformMode || (spine.TransformMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Event = (function () { + function Event(time, data) { + if (data == null) + throw new Error("data cannot be null."); + this.time = time; + this.data = data; + } + return Event; + }()); + spine.Event = Event; +})(spine || (spine = {})); +var spine; +(function (spine) { + var EventData = (function () { + function EventData(name) { + this.name = name; + } + return EventData; + }()); + spine.EventData = EventData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraint = (function () { + function IkConstraint(data, skeleton) { + this.bendDirection = 0; + this.compress = false; + this.stretch = false; + this.mix = 1; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.mix = data.mix; + this.bendDirection = data.bendDirection; + this.compress = data.compress; + this.stretch = data.stretch; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + IkConstraint.prototype.getOrder = function () { + return this.data.order; + }; + IkConstraint.prototype.apply = function () { + this.update(); + }; + IkConstraint.prototype.update = function () { + var target = this.target; + var bones = this.bones; + switch (bones.length) { + case 1: + this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix); + break; + case 2: + this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix); + break; + } + }; + IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) { + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var p = bone.parent; + var id = 1 / (p.a * p.d - p.b * p.c); + var x = targetX - p.worldX, y = targetY - p.worldY; + var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay; + var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation; + if (bone.ascaleX < 0) + rotationIK += 180; + if (rotationIK > 180) + rotationIK -= 360; + else if (rotationIK < -180) + rotationIK += 360; + var sx = bone.ascaleX, sy = bone.ascaleY; + if (compress || stretch) { + var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty); + if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) { + var s = (dd / b - 1) * alpha + 1; + sx *= s; + if (uniform) + sy *= s; + } + } + bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY); + }; + IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) { + if (alpha == 0) { + child.updateWorldTransform(); + return; + } + if (!parent.appliedValid) + parent.updateAppliedTransform(); + if (!child.appliedValid) + child.updateAppliedTransform(); + var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX; + var os1 = 0, os2 = 0, s2 = 0; + if (psx < 0) { + psx = -psx; + os1 = 180; + s2 = -1; + } + else { + os1 = 0; + s2 = 1; + } + if (psy < 0) { + psy = -psy; + s2 = -s2; + } + if (csx < 0) { + csx = -csx; + os2 = 180; + } + else + os2 = 0; + var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; + var u = Math.abs(psx - psy) <= 0.0001; + if (!u) { + cy = 0; + cwx = a * cx + parent.worldX; + cwy = c * cx + parent.worldY; + } + else { + cy = child.ay; + cwx = a * cx + b * cy + parent.worldX; + cwy = c * cx + d * cy + parent.worldY; + } + var pp = parent.parent; + a = pp.a; + b = pp.b; + c = pp.c; + d = pp.d; + var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY; + var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty; + x = cwx - pp.worldX; + y = cwy - pp.worldY; + var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; + var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0; + outer: if (u) { + l2 *= psx; + var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); + if (cos < -1) + cos = -1; + else if (cos > 1) { + cos = 1; + if (stretch && l1 + l2 > 0.0001) + sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1; + } + a2 = Math.acos(cos) * bendDir; + a = l1 + l2 * cos; + b = l2 * Math.sin(a2); + a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b); + } + else { + a = psx * l2; + b = psy * l2; + var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); + c = bb * l1 * l1 + aa * dd - aa * bb; + var c1 = -2 * bb * l1, c2 = bb - aa; + d = c1 * c1 - 4 * c2 * c; + if (d >= 0) { + var q = Math.sqrt(d); + if (c1 < 0) + q = -q; + q = -(c1 + q) / 2; + var r0 = q / c2, r1 = c / q; + var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; + if (r * r <= dd) { + y = Math.sqrt(dd - r * r) * bendDir; + a1 = ta - Math.atan2(y, r); + a2 = Math.atan2(y / psy, (r - l1) / psx); + break outer; + } + } + var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; + var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; + c = -a * l1 / (aa - bb); + if (c >= -1 && c <= 1) { + c = Math.acos(c); + x = a * Math.cos(c) + l1; + y = b * Math.sin(c); + d = x * x + y * y; + if (d < minDist) { + minAngle = c; + minDist = d; + minX = x; + minY = y; + } + if (d > maxDist) { + maxAngle = c; + maxDist = d; + maxX = x; + maxY = y; + } + } + if (dd <= (minDist + maxDist) / 2) { + a1 = ta - Math.atan2(minY * bendDir, minX); + a2 = minAngle * bendDir; + } + else { + a1 = ta - Math.atan2(maxY * bendDir, maxX); + a2 = maxAngle * bendDir; + } + } + var os = Math.atan2(cy, cx) * s2; + var rotation = parent.arotation; + a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation; + if (a1 > 180) + a1 -= 360; + else if (a1 < -180) + a1 += 360; + parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0); + rotation = child.arotation; + a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; + if (a2 > 180) + a2 -= 360; + else if (a2 < -180) + a2 += 360; + child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); + }; + return IkConstraint; + }()); + spine.IkConstraint = IkConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraintData = (function () { + function IkConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.bendDirection = 1; + this.compress = false; + this.stretch = false; + this.uniform = false; + this.mix = 1; + this.name = name; + } + return IkConstraintData; + }()); + spine.IkConstraintData = IkConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraint = (function () { + function PathConstraint(data, skeleton) { + 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(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0, n = data.bones.length; i < n; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findSlot(data.target.name); + this.position = data.position; + this.spacing = data.spacing; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + } + PathConstraint.prototype.apply = function () { + this.update(); + }; + PathConstraint.prototype.update = function () { + var attachment = this.target.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + return; + var rotateMix = this.rotateMix, translateMix = this.translateMix; + var translate = translateMix > 0, rotate = rotateMix > 0; + if (!translate && !rotate) + return; + var data = this.data; + var percentSpacing = data.spacingMode == spine.SpacingMode.Percent; + var rotateMode = data.rotateMode; + var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale; + var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1; + var bones = this.bones; + var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null; + var spacing = this.spacing; + if (scale || !percentSpacing) { + if (scale) + lengths = spine.Utils.setArraySize(this.lengths, boneCount); + var lengthSpacing = data.spacingMode == spine.SpacingMode.Length; + for (var i = 0, n = spacesCount - 1; i < n;) { + var bone = bones[i]; + var setupLength = bone.data.length; + if (setupLength < PathConstraint.epsilon) { + if (scale) + lengths[i] = 0; + spaces[++i] = 0; + } + else if (percentSpacing) { + if (scale) { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_1 = Math.sqrt(x * x + y * y); + lengths[i] = length_1; + } + spaces[++i] = spacing; + } + else { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_2 = Math.sqrt(x * x + y * y); + if (scale) + lengths[i] = length_2; + spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength; + } + } + } + else { + for (var i = 1; i < spacesCount; i++) + spaces[i] = spacing; + } + var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing); + var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; + var tip = false; + if (offsetRotation == 0) + tip = rotateMode == spine.RotateMode.Chain; + else { + tip = false; + var p = this.target.bone; + offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + } + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.worldX += (boneX - bone.worldX) * translateMix; + bone.worldY += (boneY - bone.worldY) * translateMix; + var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; + if (scale) { + var length_3 = lengths[i]; + if (length_3 != 0) { + var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1; + bone.a *= s; + bone.c *= s; + } + } + boneX = x; + boneY = y; + if (rotate) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; + if (tangents) + r = positions[p - 1]; + else if (spaces[i + 1] == 0) + r = positions[p + 2]; + else + r = Math.atan2(dy, dx); + r -= Math.atan2(c, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_4 = bone.data.length; + boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix; + boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix; + } + else { + r += offsetRotation; + } + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + } + bone.appliedValid = false; + } + }; + PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) { + var target = this.target; + var position = this.position; + var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null; + var closed = path.closed; + var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE; + if (!path.constantSpeed) { + var lengths = path.lengths; + curveCount -= closed ? 1 : 2; + var pathLength_1 = lengths[curveCount]; + if (percentPosition) + position *= pathLength_1; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength_1; + } + world = spine.Utils.setArraySize(this.world, 8); + for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength_1; + if (p < 0) + p += pathLength_1; + curve = 0; + } + else if (p < 0) { + if (prevCurve != PathConstraint.BEFORE) { + prevCurve = PathConstraint.BEFORE; + path.computeWorldVertices(target, 2, 4, world, 0, 2); + } + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength_1) { + if (prevCurve != PathConstraint.AFTER) { + prevCurve = PathConstraint.AFTER; + path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2); + } + this.addAfterPosition(p - pathLength_1, world, 0, out, o); + continue; + } + for (;; curve++) { + var length_5 = lengths[curve]; + if (p > length_5) + continue; + if (curve == 0) + p /= length_5; + else { + var prev = lengths[curve - 1]; + p = (p - prev) / (length_5 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + if (closed && curve == curveCount) { + path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2); + path.computeWorldVertices(target, 0, 4, world, 4, 2); + } + else + path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2); + } + this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0)); + } + return out; + } + if (closed) { + verticesLength += 2; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2); + path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2); + world[verticesLength - 2] = world[0]; + world[verticesLength - 1] = world[1]; + } + else { + curveCount--; + verticesLength -= 4; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength, world, 0, 2); + } + var curves = spine.Utils.setArraySize(this.curves, curveCount); + var pathLength = 0; + var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = world[w]; + cy1 = world[w + 1]; + cx2 = world[w + 2]; + cy2 = world[w + 3]; + x2 = world[w + 4]; + y2 = world[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) + position *= pathLength; + else + position *= pathLength / path.lengths[curveCount - 1]; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength; + } + var segments = this.segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength) { + this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); + continue; + } + for (;; curve++) { + var length_6 = curves[curve]; + if (p > length_6) + continue; + if (curve == 0) + p /= length_6; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_6 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + var ii = curve * 6; + x1 = world[ii]; + y1 = world[ii + 1]; + cx1 = world[ii + 2]; + cy1 = world[ii + 3]; + cx2 = world[ii + 4]; + cy2 = world[ii + 5]; + x2 = world[ii + 6]; + y2 = world[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + p *= curveLength; + for (;; segment++) { + var length_7 = segments[segment]; + if (p > length_7) + continue; + if (segment == 0) + p /= length_7; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_7 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0)); + } + return out; + }; + PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) { + var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) { + var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { + if (p == 0 || isNaN(p)) { + out[o] = x1; + out[o + 1] = y1; + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + return; + } + var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; + var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; + var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; + out[o] = x; + out[o + 1] = y; + if (tangents) { + if (p < 0.001) + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + else + out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); + } + }; + PathConstraint.prototype.getOrder = function () { + return this.data.order; + }; + PathConstraint.NONE = -1; + PathConstraint.BEFORE = -2; + PathConstraint.AFTER = -3; + PathConstraint.epsilon = 0.00001; + return PathConstraint; + }()); + spine.PathConstraint = PathConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraintData = (function () { + function PathConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.name = name; + } + return PathConstraintData; + }()); + spine.PathConstraintData = PathConstraintData; + var PositionMode; + (function (PositionMode) { + PositionMode[PositionMode["Fixed"] = 0] = "Fixed"; + PositionMode[PositionMode["Percent"] = 1] = "Percent"; + })(PositionMode = spine.PositionMode || (spine.PositionMode = {})); + var SpacingMode; + (function (SpacingMode) { + SpacingMode[SpacingMode["Length"] = 0] = "Length"; + SpacingMode[SpacingMode["Fixed"] = 1] = "Fixed"; + SpacingMode[SpacingMode["Percent"] = 2] = "Percent"; + })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {})); + var RotateMode; + (function (RotateMode) { + RotateMode[RotateMode["Tangent"] = 0] = "Tangent"; + RotateMode[RotateMode["Chain"] = 1] = "Chain"; + RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale"; + })(RotateMode = spine.RotateMode || (spine.RotateMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Assets = (function () { + function Assets(clientId) { + this.toLoad = new Array(); + this.assets = {}; + this.clientId = clientId; + } + Assets.prototype.loaded = function () { + var i = 0; + for (var v in this.assets) + i++; + return i; + }; + return Assets; + }()); + var SharedAssetManager = (function () { + function SharedAssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.clientAssets = {}; + this.queuedAssets = {}; + this.rawAssets = {}; + this.errors = {}; + this.pathPrefix = pathPrefix; + } + SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) { + clientAssets = new Assets(clientId); + this.clientAssets[clientId] = clientAssets; + } + if (textureLoader !== null) + clientAssets.textureLoader = textureLoader; + clientAssets.toLoad.push(path); + if (this.queuedAssets[path] === path) { + return false; + } + else { + this.queuedAssets[path] = path; + return true; + } + }; + SharedAssetManager.prototype.loadText = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = request.responseText; + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadJson = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = JSON.parse(request.responseText); + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, textureLoader, path)) + return; + var img = new Image(); + img.src = path; + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + _this.rawAssets[path] = img; + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + }; + }; + SharedAssetManager.prototype.get = function (clientId, path) { + path = this.pathPrefix + path; + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + return clientAssets.assets[path]; + }; + SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { + for (var i = 0; i < clientAssets.toLoad.length; i++) { + var path = clientAssets.toLoad[i]; + var asset = clientAssets.assets[path]; + if (asset === null || asset === undefined) { + var rawAsset = this.rawAssets[path]; + if (rawAsset === null || rawAsset === undefined) + continue; + if (rawAsset instanceof HTMLImageElement) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } + } + } + }; + SharedAssetManager.prototype.isLoadingComplete = function (clientId) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + this.updateClientAssets(clientAssets); + return clientAssets.toLoad.length == clientAssets.loaded(); + }; + SharedAssetManager.prototype.dispose = function () { + }; + SharedAssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + SharedAssetManager.prototype.getErrors = function () { + return this.errors; + }; + return SharedAssetManager; + }()); + spine.SharedAssetManager = SharedAssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skeleton = (function () { + function Skeleton(data) { + this._updateCache = new Array(); + this.updateCacheReset = new Array(); + this.time = 0; + this.scaleX = 1; + this.scaleY = 1; + this.x = 0; + this.y = 0; + if (data == null) + throw new Error("data cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) { + var boneData = data.bones[i]; + var bone = void 0; + if (boneData.parent == null) + bone = new spine.Bone(boneData, this, null); + else { + var parent_1 = this.bones[boneData.parent.index]; + bone = new spine.Bone(boneData, this, parent_1); + parent_1.children.push(bone); + } + this.bones.push(bone); + } + this.slots = new Array(); + this.drawOrder = new Array(); + for (var i = 0; i < data.slots.length; i++) { + var slotData = data.slots[i]; + var bone = this.bones[slotData.boneData.index]; + var slot = new spine.Slot(slotData, bone); + this.slots.push(slot); + this.drawOrder.push(slot); + } + this.ikConstraints = new Array(); + for (var i = 0; i < data.ikConstraints.length; i++) { + var ikConstraintData = data.ikConstraints[i]; + this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this)); + } + this.transformConstraints = new Array(); + for (var i = 0; i < data.transformConstraints.length; i++) { + var transformConstraintData = data.transformConstraints[i]; + this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this)); + } + this.pathConstraints = new Array(); + for (var i = 0; i < data.pathConstraints.length; i++) { + var pathConstraintData = data.pathConstraints[i]; + this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this)); + } + this.color = new spine.Color(1, 1, 1, 1); + this.updateCache(); + } + Skeleton.prototype.updateCache = function () { + var updateCache = this._updateCache; + updateCache.length = 0; + this.updateCacheReset.length = 0; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].sorted = false; + var ikConstraints = this.ikConstraints; + var transformConstraints = this.transformConstraints; + var pathConstraints = this.pathConstraints; + var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length; + var constraintCount = ikCount + transformCount + pathCount; + outer: for (var i = 0; i < constraintCount; i++) { + for (var ii = 0; ii < ikCount; ii++) { + var constraint = ikConstraints[ii]; + if (constraint.data.order == i) { + this.sortIkConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < transformCount; ii++) { + var constraint = transformConstraints[ii]; + if (constraint.data.order == i) { + this.sortTransformConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < pathCount; ii++) { + var constraint = pathConstraints[ii]; + if (constraint.data.order == i) { + this.sortPathConstraint(constraint); + continue outer; + } + } + } + for (var i = 0, n = bones.length; i < n; i++) + this.sortBone(bones[i]); + }; + Skeleton.prototype.sortIkConstraint = function (constraint) { + var target = constraint.target; + this.sortBone(target); + var constrained = constraint.bones; + var parent = constrained[0]; + this.sortBone(parent); + if (constrained.length > 1) { + var child = constrained[constrained.length - 1]; + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + this._updateCache.push(constraint); + this.sortReset(parent.children); + constrained[constrained.length - 1].sorted = true; + }; + Skeleton.prototype.sortPathConstraint = function (constraint) { + var slot = constraint.target; + var slotIndex = slot.data.index; + var slotBone = slot.bone; + if (this.skin != null) + this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); + if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin) + this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); + for (var i = 0, n = this.data.skins.length; i < n; i++) + this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone); + var attachment = slot.getAttachment(); + if (attachment instanceof spine.PathAttachment) + this.sortPathConstraintAttachmentWith(attachment, slotBone); + var constrained = constraint.bones; + var boneCount = constrained.length; + for (var i = 0; i < boneCount; i++) + this.sortBone(constrained[i]); + this._updateCache.push(constraint); + for (var i = 0; i < boneCount; i++) + this.sortReset(constrained[i].children); + for (var i = 0; i < boneCount; i++) + constrained[i].sorted = true; + }; + Skeleton.prototype.sortTransformConstraint = function (constraint) { + this.sortBone(constraint.target); + var constrained = constraint.bones; + var boneCount = constrained.length; + if (constraint.data.local) { + for (var i = 0; i < boneCount; i++) { + var child = constrained[i]; + this.sortBone(child.parent); + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + } + else { + for (var i = 0; i < boneCount; i++) { + this.sortBone(constrained[i]); + } + } + this._updateCache.push(constraint); + for (var ii = 0; ii < boneCount; ii++) + this.sortReset(constrained[ii].children); + for (var ii = 0; ii < boneCount; ii++) + constrained[ii].sorted = true; + }; + Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) { + var attachments = skin.attachments[slotIndex]; + if (!attachments) + return; + for (var key in attachments) { + this.sortPathConstraintAttachmentWith(attachments[key], slotBone); + } + }; + Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) { + if (!(attachment instanceof spine.PathAttachment)) + return; + var pathBones = attachment.bones; + if (pathBones == null) + this.sortBone(slotBone); + else { + var bones = this.bones; + var i = 0; + while (i < pathBones.length) { + var boneCount = pathBones[i++]; + for (var n = i + boneCount; i < n; i++) { + var boneIndex = pathBones[i]; + this.sortBone(bones[boneIndex]); + } + } + } + }; + Skeleton.prototype.sortBone = function (bone) { + if (bone.sorted) + return; + var parent = bone.parent; + if (parent != null) + this.sortBone(parent); + bone.sorted = true; + this._updateCache.push(bone); + }; + Skeleton.prototype.sortReset = function (bones) { + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.sorted) + this.sortReset(bone.children); + bone.sorted = false; + } + }; + Skeleton.prototype.updateWorldTransform = function () { + var updateCacheReset = this.updateCacheReset; + for (var i = 0, n = updateCacheReset.length; i < n; i++) { + var bone = updateCacheReset[i]; + bone.ax = bone.x; + bone.ay = bone.y; + bone.arotation = bone.rotation; + bone.ascaleX = bone.scaleX; + bone.ascaleY = bone.scaleY; + bone.ashearX = bone.shearX; + bone.ashearY = bone.shearY; + bone.appliedValid = true; + } + var updateCache = this._updateCache; + for (var i = 0, n = updateCache.length; i < n; i++) + updateCache[i].update(); + }; + Skeleton.prototype.setToSetupPose = function () { + this.setBonesToSetupPose(); + this.setSlotsToSetupPose(); + }; + Skeleton.prototype.setBonesToSetupPose = function () { + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].setToSetupPose(); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + var data = constraint.data; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + } + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + var data = constraint.data; + constraint.position = data.position; + constraint.spacing = data.spacing; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + } + }; + Skeleton.prototype.setSlotsToSetupPose = function () { + var slots = this.slots; + spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); + for (var i = 0, n = slots.length; i < n; i++) + slots[i].setToSetupPose(); + }; + Skeleton.prototype.getRootBone = function () { + if (this.bones.length == 0) + return null; + return this.bones[0]; + }; + Skeleton.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.data.name == boneName) + return bone; + } + return null; + }; + Skeleton.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].data.name == boneName) + return i; + return -1; + }; + Skeleton.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) + return slot; + } + return null; + }; + Skeleton.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].data.name == slotName) + return i; + return -1; + }; + Skeleton.prototype.setSkinByName = function (skinName) { + var skin = this.data.findSkin(skinName); + if (skin == null) + throw new Error("Skin not found: " + skinName); + this.setSkin(skin); + }; + Skeleton.prototype.setSkin = function (newSkin) { + if (newSkin != null) { + if (this.skin != null) + newSkin.attachAll(this, this.skin); + else { + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var name_1 = slot.data.attachmentName; + if (name_1 != null) { + var attachment = newSkin.getAttachment(i, name_1); + if (attachment != null) + slot.setAttachment(attachment); + } + } + } + } + this.skin = newSkin; + }; + Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) { + return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName); + }; + Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) { + if (attachmentName == null) + throw new Error("attachmentName cannot be null."); + if (this.skin != null) { + var attachment = this.skin.getAttachment(slotIndex, attachmentName); + if (attachment != null) + return attachment; + } + if (this.data.defaultSkin != null) + return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); + return null; + }; + Skeleton.prototype.setAttachment = function (slotName, attachmentName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) { + var attachment = null; + if (attachmentName != null) { + attachment = this.getAttachment(i, attachmentName); + if (attachment == null) + throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName); + } + slot.setAttachment(attachment); + return; + } + } + throw new Error("Slot not found: " + slotName); + }; + Skeleton.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var ikConstraint = ikConstraints[i]; + if (ikConstraint.data.name == constraintName) + return ikConstraint; + } + return null; + }; + Skeleton.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.getBounds = function (offset, size, temp) { + if (temp === void 0) { temp = new Array(2); } + if (offset == null) + throw new Error("offset cannot be null."); + if (size == null) + throw new Error("size cannot be null."); + var drawOrder = this.drawOrder; + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var verticesLength = 0; + var vertices = null; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + verticesLength = 8; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + attachment.computeWorldVertices(slot.bone, vertices, 0, 2); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + verticesLength = mesh.worldVerticesLength; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2); + } + if (vertices != null) { + for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + } + offset.set(minX, minY); + size.set(maxX - minX, maxY - minY); + }; + Skeleton.prototype.update = function (delta) { + this.time += delta; + }; + return Skeleton; + }()); + spine.Skeleton = Skeleton; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonBounds = (function () { + function SkeletonBounds() { + this.minX = 0; + this.minY = 0; + this.maxX = 0; + this.maxY = 0; + this.boundingBoxes = new Array(); + this.polygons = new Array(); + this.polygonPool = new spine.Pool(function () { + return spine.Utils.newFloatArray(16); + }); + } + SkeletonBounds.prototype.update = function (skeleton, updateAabb) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + var boundingBoxes = this.boundingBoxes; + var polygons = this.polygons; + var polygonPool = this.polygonPool; + var slots = skeleton.slots; + var slotCount = slots.length; + boundingBoxes.length = 0; + polygonPool.freeAll(polygons); + polygons.length = 0; + for (var i = 0; i < slotCount; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.BoundingBoxAttachment) { + var boundingBox = attachment; + boundingBoxes.push(boundingBox); + var polygon = polygonPool.obtain(); + if (polygon.length != boundingBox.worldVerticesLength) { + polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength); + } + polygons.push(polygon); + boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2); + } + } + if (updateAabb) { + this.aabbCompute(); + } + else { + this.minX = Number.POSITIVE_INFINITY; + this.minY = Number.POSITIVE_INFINITY; + this.maxX = Number.NEGATIVE_INFINITY; + this.maxY = Number.NEGATIVE_INFINITY; + } + }; + SkeletonBounds.prototype.aabbCompute = function () { + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + var vertices = polygon; + for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) { + var x = vertices[ii]; + var y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + this.minX = minX; + this.minY = minY; + this.maxX = maxX; + this.maxY = maxY; + }; + SkeletonBounds.prototype.aabbContainsPoint = function (x, y) { + return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; + }; + SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) { + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) + return false; + var m = (y2 - y1) / (x2 - x1); + var y = m * (minX - x1) + y1; + if (y > minY && y < maxY) + return true; + y = m * (maxX - x1) + y1; + if (y > minY && y < maxY) + return true; + var x = (minY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + x = (maxY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + return false; + }; + SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) { + return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; + }; + SkeletonBounds.prototype.containsPoint = function (x, y) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.containsPointPolygon(polygons[i], x, y)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) { + var vertices = polygon; + var nn = polygon.length; + var prevIndex = nn - 2; + var inside = false; + for (var ii = 0; ii < nn; ii += 2) { + var vertexY = vertices[ii + 1]; + var prevY = vertices[prevIndex + 1]; + if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { + var vertexX = vertices[ii]; + if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) + inside = !inside; + } + prevIndex = ii; + } + return inside; + }; + SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) { + var vertices = polygon; + var nn = polygon.length; + var width12 = x1 - x2, height12 = y1 - y2; + var det1 = x1 * y2 - y1 * x2; + var x3 = vertices[nn - 2], y3 = vertices[nn - 1]; + for (var ii = 0; ii < nn; ii += 2) { + var x4 = vertices[ii], y4 = vertices[ii + 1]; + var det2 = x3 * y4 - y3 * x4; + var width34 = x3 - x4, height34 = y3 - y4; + var det3 = width12 * height34 - height12 * width34; + var x = (det1 * width34 - width12 * det2) / det3; + if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { + var y = (det1 * height34 - height12 * det2) / det3; + if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) + return true; + } + x3 = x4; + y3 = y4; + } + return false; + }; + SkeletonBounds.prototype.getPolygon = function (boundingBox) { + if (boundingBox == null) + throw new Error("boundingBox cannot be null."); + var index = this.boundingBoxes.indexOf(boundingBox); + return index == -1 ? null : this.polygons[index]; + }; + SkeletonBounds.prototype.getWidth = function () { + return this.maxX - this.minX; + }; + SkeletonBounds.prototype.getHeight = function () { + return this.maxY - this.minY; + }; + return SkeletonBounds; + }()); + spine.SkeletonBounds = SkeletonBounds; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonClipping = (function () { + function SkeletonClipping() { + this.triangulator = new spine.Triangulator(); + this.clippingPolygon = new Array(); + this.clipOutput = new Array(); + this.clippedVertices = new Array(); + this.clippedTriangles = new Array(); + this.scratch = new Array(); + } + SkeletonClipping.prototype.clipStart = function (slot, clip) { + if (this.clipAttachment != null) + return 0; + this.clipAttachment = clip; + var n = clip.worldVerticesLength; + var vertices = spine.Utils.setArraySize(this.clippingPolygon, n); + clip.computeWorldVertices(slot, 0, n, vertices, 0, 2); + var clippingPolygon = this.clippingPolygon; + SkeletonClipping.makeClockwise(clippingPolygon); + var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); + for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) { + var polygon = clippingPolygons[i]; + SkeletonClipping.makeClockwise(polygon); + polygon.push(polygon[0]); + polygon.push(polygon[1]); + } + return clippingPolygons.length; + }; + SkeletonClipping.prototype.clipEndWithSlot = function (slot) { + if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data) + this.clipEnd(); + }; + SkeletonClipping.prototype.clipEnd = function () { + if (this.clipAttachment == null) + return; + this.clipAttachment = null; + this.clippingPolygons = null; + this.clippedVertices.length = 0; + this.clippedTriangles.length = 0; + this.clippingPolygon.length = 0; + }; + SkeletonClipping.prototype.isClipping = function () { + return this.clipAttachment != null; + }; + SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) { + var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; + var clippedTriangles = this.clippedTriangles; + var polygons = this.clippingPolygons; + var polygonsCount = this.clippingPolygons.length; + var vertexSize = twoColor ? 12 : 8; + var index = 0; + clippedVertices.length = 0; + clippedTriangles.length = 0; + outer: for (var i = 0; i < trianglesLength; i += 3) { + var vertexOffset = triangles[i] << 1; + var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; + var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 1] << 1; + var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; + var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 2] << 1; + var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; + var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; + for (var p = 0; p < polygonsCount; p++) { + var s = clippedVertices.length; + if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { + var clipOutputLength = clipOutput.length; + if (clipOutputLength == 0) + continue; + var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; + var d = 1 / (d0 * d2 + d1 * (y1 - y3)); + var clipOutputCount = clipOutputLength >> 1; + var clipOutputItems = this.clipOutput; + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize); + for (var ii = 0; ii < clipOutputLength; ii += 2) { + var x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; + clippedVerticesItems[s] = x; + clippedVerticesItems[s + 1] = y; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + var c0 = x - x3, c1 = y - y3; + var a = (d0 * c0 + d1 * c1) * d; + var b = (d4 * c0 + d2 * c1) * d; + var c = 1 - a - b; + clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c; + clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c; + if (twoColor) { + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + } + s += vertexSize; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); + clipOutputCount--; + for (var ii = 1; ii < clipOutputCount; ii++) { + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + ii); + clippedTrianglesItems[s + 2] = (index + ii + 1); + s += 3; + } + index += clipOutputCount + 1; + } + else { + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize); + clippedVerticesItems[s] = x1; + clippedVerticesItems[s + 1] = y1; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + if (!twoColor) { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = x2; + clippedVerticesItems[s + 9] = y2; + clippedVerticesItems[s + 10] = light.r; + clippedVerticesItems[s + 11] = light.g; + clippedVerticesItems[s + 12] = light.b; + clippedVerticesItems[s + 13] = light.a; + clippedVerticesItems[s + 14] = u2; + clippedVerticesItems[s + 15] = v2; + clippedVerticesItems[s + 16] = x3; + clippedVerticesItems[s + 17] = y3; + clippedVerticesItems[s + 18] = light.r; + clippedVerticesItems[s + 19] = light.g; + clippedVerticesItems[s + 20] = light.b; + clippedVerticesItems[s + 21] = light.a; + clippedVerticesItems[s + 22] = u3; + clippedVerticesItems[s + 23] = v3; + } + else { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + clippedVerticesItems[s + 12] = x2; + clippedVerticesItems[s + 13] = y2; + clippedVerticesItems[s + 14] = light.r; + clippedVerticesItems[s + 15] = light.g; + clippedVerticesItems[s + 16] = light.b; + clippedVerticesItems[s + 17] = light.a; + clippedVerticesItems[s + 18] = u2; + clippedVerticesItems[s + 19] = v2; + clippedVerticesItems[s + 20] = dark.r; + clippedVerticesItems[s + 21] = dark.g; + clippedVerticesItems[s + 22] = dark.b; + clippedVerticesItems[s + 23] = dark.a; + clippedVerticesItems[s + 24] = x3; + clippedVerticesItems[s + 25] = y3; + clippedVerticesItems[s + 26] = light.r; + clippedVerticesItems[s + 27] = light.g; + clippedVerticesItems[s + 28] = light.b; + clippedVerticesItems[s + 29] = light.a; + clippedVerticesItems[s + 30] = u3; + clippedVerticesItems[s + 31] = v3; + clippedVerticesItems[s + 32] = dark.r; + clippedVerticesItems[s + 33] = dark.g; + clippedVerticesItems[s + 34] = dark.b; + clippedVerticesItems[s + 35] = dark.a; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3); + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + 1); + clippedTrianglesItems[s + 2] = (index + 2); + index += 3; + continue outer; + } + } + } + }; + SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) { + var originalOutput = output; + var clipped = false; + var input = null; + if (clippingArea.length % 4 >= 2) { + input = output; + output = this.scratch; + } + else + input = this.scratch; + input.length = 0; + input.push(x1); + input.push(y1); + input.push(x2); + input.push(y2); + input.push(x3); + input.push(y3); + input.push(x1); + input.push(y1); + output.length = 0; + var clippingVertices = clippingArea; + var clippingVerticesLast = clippingArea.length - 4; + for (var i = 0;; i += 2) { + var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; + var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3]; + var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2; + var inputVertices = input; + var inputVerticesLength = input.length - 2, outputStart = output.length; + for (var ii = 0; ii < inputVerticesLength; ii += 2) { + var inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; + var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3]; + var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0; + if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) { + if (side2) { + output.push(inputX2); + output.push(inputY2); + continue; + } + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + } + else if (side2) { + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + output.push(inputX2); + output.push(inputY2); + } + clipped = true; + } + if (outputStart == output.length) { + originalOutput.length = 0; + return true; + } + output.push(output[0]); + output.push(output[1]); + if (i == clippingVerticesLast) + break; + var temp = output; + output = input; + output.length = 0; + input = temp; + } + if (originalOutput != output) { + originalOutput.length = 0; + for (var i = 0, n = output.length - 2; i < n; i++) + originalOutput[i] = output[i]; + } + else + originalOutput.length = originalOutput.length - 2; + return clipped; + }; + SkeletonClipping.makeClockwise = function (polygon) { + var vertices = polygon; + var verticeslength = polygon.length; + var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; + for (var i = 0, n = verticeslength - 3; i < n; i += 2) { + p1x = vertices[i]; + p1y = vertices[i + 1]; + p2x = vertices[i + 2]; + p2y = vertices[i + 3]; + area += p1x * p2y - p2x * p1y; + } + if (area < 0) + return; + for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { + var x = vertices[i], y = vertices[i + 1]; + var other = lastX - i; + vertices[i] = vertices[other]; + vertices[i + 1] = vertices[other + 1]; + vertices[other] = x; + vertices[other + 1] = y; + } + }; + return SkeletonClipping; + }()); + spine.SkeletonClipping = SkeletonClipping; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonData = (function () { + function SkeletonData() { + this.bones = new Array(); + this.slots = new Array(); + this.skins = new Array(); + this.events = new Array(); + this.animations = new Array(); + this.ikConstraints = new Array(); + this.transformConstraints = new Array(); + this.pathConstraints = new Array(); + this.fps = 0; + } + SkeletonData.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.name == boneName) + return bone; + } + return null; + }; + SkeletonData.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].name == boneName) + return i; + return -1; + }; + SkeletonData.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.name == slotName) + return slot; + } + return null; + }; + SkeletonData.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].name == slotName) + return i; + return -1; + }; + SkeletonData.prototype.findSkin = function (skinName) { + if (skinName == null) + throw new Error("skinName cannot be null."); + var skins = this.skins; + for (var i = 0, n = skins.length; i < n; i++) { + var skin = skins[i]; + if (skin.name == skinName) + return skin; + } + return null; + }; + SkeletonData.prototype.findEvent = function (eventDataName) { + if (eventDataName == null) + throw new Error("eventDataName cannot be null."); + var events = this.events; + for (var i = 0, n = events.length; i < n; i++) { + var event_4 = events[i]; + if (event_4.name == eventDataName) + return event_4; + } + return null; + }; + SkeletonData.prototype.findAnimation = function (animationName) { + if (animationName == null) + throw new Error("animationName cannot be null."); + var animations = this.animations; + for (var i = 0, n = animations.length; i < n; i++) { + var animation = animations[i]; + if (animation.name == animationName) + return animation; + } + return null; + }; + SkeletonData.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) { + if (pathConstraintName == null) + throw new Error("pathConstraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) + if (pathConstraints[i].name == pathConstraintName) + return i; + return -1; + }; + return SkeletonData; + }()); + spine.SkeletonData = SkeletonData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonJson = (function () { + function SkeletonJson(attachmentLoader) { + this.scale = 1; + this.linkedMeshes = new Array(); + this.attachmentLoader = attachmentLoader; + } + SkeletonJson.prototype.readSkeletonData = function (json) { + var scale = this.scale; + var skeletonData = new spine.SkeletonData(); + var root = typeof (json) === "string" ? JSON.parse(json) : json; + var skeletonMap = root.skeleton; + if (skeletonMap != null) { + skeletonData.hash = skeletonMap.hash; + skeletonData.version = skeletonMap.spine; + skeletonData.width = skeletonMap.width; + skeletonData.height = skeletonMap.height; + skeletonData.fps = skeletonMap.fps; + skeletonData.imagesPath = skeletonMap.images; + } + if (root.bones) { + for (var i = 0; i < root.bones.length; i++) { + var boneMap = root.bones[i]; + var parent_2 = null; + var parentName = this.getValue(boneMap, "parent", null); + if (parentName != null) { + parent_2 = skeletonData.findBone(parentName); + if (parent_2 == null) + throw new Error("Parent bone not found: " + parentName); + } + var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2); + data.length = this.getValue(boneMap, "length", 0) * scale; + data.x = this.getValue(boneMap, "x", 0) * scale; + data.y = this.getValue(boneMap, "y", 0) * scale; + data.rotation = this.getValue(boneMap, "rotation", 0); + data.scaleX = this.getValue(boneMap, "scaleX", 1); + data.scaleY = this.getValue(boneMap, "scaleY", 1); + data.shearX = this.getValue(boneMap, "shearX", 0); + data.shearY = this.getValue(boneMap, "shearY", 0); + data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal")); + skeletonData.bones.push(data); + } + } + if (root.slots) { + for (var i = 0; i < root.slots.length; i++) { + var slotMap = root.slots[i]; + var slotName = slotMap.name; + var boneName = slotMap.bone; + var boneData = skeletonData.findBone(boneName); + if (boneData == null) + throw new Error("Slot bone not found: " + boneName); + var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData); + var color = this.getValue(slotMap, "color", null); + if (color != null) + data.color.setFromString(color); + var dark = this.getValue(slotMap, "dark", null); + if (dark != null) { + data.darkColor = new spine.Color(1, 1, 1, 1); + data.darkColor.setFromString(dark); + } + data.attachmentName = this.getValue(slotMap, "attachment", null); + data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, "blend", "normal")); + skeletonData.slots.push(data); + } + } + if (root.ik) { + for (var i = 0; i < root.ik.length; i++) { + var constraintMap = root.ik[i]; + var data = new spine.IkConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("IK bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("IK target bone not found: " + targetName); + data.mix = this.getValue(constraintMap, "mix", 1); + data.bendDirection = this.getValue(constraintMap, "bendPositive", true) ? 1 : -1; + data.compress = this.getValue(constraintMap, "compress", false); + data.stretch = this.getValue(constraintMap, "stretch", false); + data.uniform = this.getValue(constraintMap, "uniform", false); + skeletonData.ikConstraints.push(data); + } + } + if (root.transform) { + for (var i = 0; i < root.transform.length; i++) { + var constraintMap = root.transform[i]; + var data = new spine.TransformConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("Transform constraint target bone not found: " + targetName); + data.local = this.getValue(constraintMap, "local", false); + data.relative = this.getValue(constraintMap, "relative", false); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.offsetX = this.getValue(constraintMap, "x", 0) * scale; + data.offsetY = this.getValue(constraintMap, "y", 0) * scale; + data.offsetScaleX = this.getValue(constraintMap, "scaleX", 0); + data.offsetScaleY = this.getValue(constraintMap, "scaleY", 0); + data.offsetShearY = this.getValue(constraintMap, "shearY", 0); + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + data.scaleMix = this.getValue(constraintMap, "scaleMix", 1); + data.shearMix = this.getValue(constraintMap, "shearMix", 1); + skeletonData.transformConstraints.push(data); + } + } + if (root.path) { + for (var i = 0; i < root.path.length; i++) { + var constraintMap = root.path[i]; + var data = new spine.PathConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findSlot(targetName); + if (data.target == null) + throw new Error("Path target slot not found: " + targetName); + data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, "positionMode", "percent")); + data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, "spacingMode", "length")); + data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, "rotateMode", "tangent")); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.position = this.getValue(constraintMap, "position", 0); + if (data.positionMode == spine.PositionMode.Fixed) + data.position *= scale; + data.spacing = this.getValue(constraintMap, "spacing", 0); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + data.spacing *= scale; + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + skeletonData.pathConstraints.push(data); + } + } + if (root.skins) { + for (var skinName in root.skins) { + var skinMap = root.skins[skinName]; + var skin = new spine.Skin(skinName); + for (var slotName in skinMap) { + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + var slotMap = skinMap[slotName]; + for (var entryName in slotMap) { + var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData); + if (attachment != null) + skin.addAttachment(slotIndex, entryName, attachment); + } + } + skeletonData.skins.push(skin); + if (skin.name == "default") + skeletonData.defaultSkin = skin; + } + } + for (var i = 0, n = this.linkedMeshes.length; i < n; i++) { + var linkedMesh = this.linkedMeshes[i]; + var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); + if (skin == null) + throw new Error("Skin not found: " + linkedMesh.skin); + var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); + if (parent_3 == null) + throw new Error("Parent mesh not found: " + linkedMesh.parent); + linkedMesh.mesh.setParentMesh(parent_3); + linkedMesh.mesh.updateUVs(); + } + this.linkedMeshes.length = 0; + if (root.events) { + for (var eventName in root.events) { + var eventMap = root.events[eventName]; + var data = new spine.EventData(eventName); + data.intValue = this.getValue(eventMap, "int", 0); + data.floatValue = this.getValue(eventMap, "float", 0); + data.stringValue = this.getValue(eventMap, "string", ""); + data.audioPath = this.getValue(eventMap, "audio", null); + if (data.audioPath != null) { + data.volume = this.getValue(eventMap, "volume", 1); + data.balance = this.getValue(eventMap, "balance", 0); + } + skeletonData.events.push(data); + } + } + if (root.animations) { + for (var animationName in root.animations) { + var animationMap = root.animations[animationName]; + this.readAnimation(animationMap, animationName, skeletonData); + } + } + return skeletonData; + }; + SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) { + var scale = this.scale; + name = this.getValue(map, "name", name); + var type = this.getValue(map, "type", "region"); + switch (type) { + case "region": { + var path = this.getValue(map, "path", name); + var region = this.attachmentLoader.newRegionAttachment(skin, name, path); + if (region == null) + return null; + region.path = path; + region.x = this.getValue(map, "x", 0) * scale; + region.y = this.getValue(map, "y", 0) * scale; + region.scaleX = this.getValue(map, "scaleX", 1); + region.scaleY = this.getValue(map, "scaleY", 1); + region.rotation = this.getValue(map, "rotation", 0); + region.width = map.width * scale; + region.height = map.height * scale; + var color = this.getValue(map, "color", null); + if (color != null) + region.color.setFromString(color); + region.updateOffset(); + return region; + } + case "boundingbox": { + var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); + if (box == null) + return null; + this.readVertices(map, box, map.vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + box.color.setFromString(color); + return box; + } + case "mesh": + case "linkedmesh": { + var path = this.getValue(map, "path", name); + var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); + if (mesh == null) + return null; + mesh.path = path; + var color = this.getValue(map, "color", null); + if (color != null) + mesh.color.setFromString(color); + var parent_4 = this.getValue(map, "parent", null); + if (parent_4 != null) { + mesh.inheritDeform = this.getValue(map, "deform", true); + this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, "skin", null), slotIndex, parent_4)); + return mesh; + } + var uvs = map.uvs; + this.readVertices(map, mesh, uvs.length); + mesh.triangles = map.triangles; + mesh.regionUVs = uvs; + mesh.updateUVs(); + mesh.hullLength = this.getValue(map, "hull", 0) * 2; + return mesh; + } + case "path": { + var path = this.attachmentLoader.newPathAttachment(skin, name); + if (path == null) + return null; + path.closed = this.getValue(map, "closed", false); + path.constantSpeed = this.getValue(map, "constantSpeed", true); + var vertexCount = map.vertexCount; + this.readVertices(map, path, vertexCount << 1); + var lengths = spine.Utils.newArray(vertexCount / 3, 0); + for (var i = 0; i < map.lengths.length; i++) + lengths[i] = map.lengths[i] * scale; + path.lengths = lengths; + var color = this.getValue(map, "color", null); + if (color != null) + path.color.setFromString(color); + return path; + } + case "point": { + var point = this.attachmentLoader.newPointAttachment(skin, name); + if (point == null) + return null; + point.x = this.getValue(map, "x", 0) * scale; + point.y = this.getValue(map, "y", 0) * scale; + point.rotation = this.getValue(map, "rotation", 0); + var color = this.getValue(map, "color", null); + if (color != null) + point.color.setFromString(color); + return point; + } + case "clipping": { + var clip = this.attachmentLoader.newClippingAttachment(skin, name); + if (clip == null) + return null; + var end = this.getValue(map, "end", null); + if (end != null) { + var slot = skeletonData.findSlot(end); + if (slot == null) + throw new Error("Clipping end slot not found: " + end); + clip.endSlot = slot; + } + var vertexCount = map.vertexCount; + this.readVertices(map, clip, vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + clip.color.setFromString(color); + return clip; + } + } + return null; + }; + SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) { + var scale = this.scale; + attachment.worldVerticesLength = verticesLength; + var vertices = map.vertices; + if (verticesLength == vertices.length) { + var scaledVertices = spine.Utils.toFloatArray(vertices); + if (scale != 1) { + for (var i = 0, n = vertices.length; i < n; i++) + scaledVertices[i] *= scale; + } + attachment.vertices = scaledVertices; + return; + } + var weights = new Array(); + var bones = new Array(); + for (var i = 0, n = vertices.length; i < n;) { + var boneCount = vertices[i++]; + bones.push(boneCount); + for (var nn = i + boneCount * 4; i < nn; i += 4) { + bones.push(vertices[i]); + weights.push(vertices[i + 1] * scale); + weights.push(vertices[i + 2] * scale); + weights.push(vertices[i + 3]); + } + } + attachment.bones = bones; + attachment.vertices = spine.Utils.toFloatArray(weights); + }; + SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) { + var scale = this.scale; + var timelines = new Array(); + var duration = 0; + if (map.slots) { + for (var slotName in map.slots) { + var slotMap = map.slots[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + if (timelineName == "attachment") { + var timeline = new spine.AttachmentTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex++, valueMap.time, valueMap.name); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + else if (timelineName == "color") { + var timeline = new spine.ColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var color = new spine.Color(); + color.setFromString(valueMap.color); + timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]); + } + else if (timelineName == "twoColor") { + var timeline = new spine.TwoColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var light = new spine.Color(); + var dark = new spine.Color(); + light.setFromString(valueMap.light); + dark.setFromString(valueMap.dark); + timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"); + } + } + } + if (map.bones) { + for (var boneName in map.bones) { + var boneMap = map.bones[boneName]; + var boneIndex = skeletonData.findBoneIndex(boneName); + if (boneIndex == -1) + throw new Error("Bone not found: " + boneName); + for (var timelineName in boneMap) { + var timelineMap = boneMap[timelineName]; + if (timelineName === "rotate") { + var timeline = new spine.RotateTimeline(timelineMap.length); + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, valueMap.angle); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]); + } + else if (timelineName === "translate" || timelineName === "scale" || timelineName === "shear") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "scale") + timeline = new spine.ScaleTimeline(timelineMap.length); + else if (timelineName === "shear") + timeline = new spine.ShearTimeline(timelineMap.length); + else { + timeline = new spine.TranslateTimeline(timelineMap.length); + timelineScale = scale; + } + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var x = this.getValue(valueMap, "x", 0), y = this.getValue(valueMap, "y", 0); + timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"); + } + } + } + if (map.ik) { + for (var constraintName in map.ik) { + var constraintMap = map.ik[constraintName]; + var constraint = skeletonData.findIkConstraint(constraintName); + var timeline = new spine.IkConstraintTimeline(constraintMap.length); + timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "mix", 1), this.getValue(valueMap, "bendPositive", true) ? 1 : -1, this.getValue(valueMap, "compress", false), this.getValue(valueMap, "stretch", false)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]); + } + } + if (map.transform) { + for (var constraintName in map.transform) { + var constraintMap = map.transform[constraintName]; + var constraint = skeletonData.findTransformConstraint(constraintName); + var timeline = new spine.TransformConstraintTimeline(constraintMap.length); + timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1), this.getValue(valueMap, "scaleMix", 1), this.getValue(valueMap, "shearMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]); + } + } + if (map.paths) { + for (var constraintName in map.paths) { + var constraintMap = map.paths[constraintName]; + var index = skeletonData.findPathConstraintIndex(constraintName); + if (index == -1) + throw new Error("Path constraint not found: " + constraintName); + var data = skeletonData.pathConstraints[index]; + for (var timelineName in constraintMap) { + var timelineMap = constraintMap[timelineName]; + if (timelineName === "position" || timelineName === "spacing") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "spacing") { + timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + timelineScale = scale; + } + else { + timeline = new spine.PathConstraintPositionTimeline(timelineMap.length); + if (data.positionMode == spine.PositionMode.Fixed) + timelineScale = scale; + } + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]); + } + else if (timelineName === "mix") { + var timeline = new spine.PathConstraintMixTimeline(timelineMap.length); + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]); + } + } + } + } + if (map.deform) { + for (var deformName in map.deform) { + var deformMap = map.deform[deformName]; + var skin = skeletonData.findSkin(deformName); + if (skin == null) + throw new Error("Skin not found: " + deformName); + for (var slotName in deformMap) { + var slotMap = deformMap[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotMap.name); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + var attachment = skin.getAttachment(slotIndex, timelineName); + if (attachment == null) + throw new Error("Deform attachment not found: " + timelineMap.name); + var weighted = attachment.bones != null; + var vertices = attachment.vertices; + var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; + var timeline = new spine.DeformTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + timeline.attachment = attachment; + var frameIndex = 0; + for (var j = 0; j < timelineMap.length; j++) { + var valueMap = timelineMap[j]; + var deform = void 0; + var verticesValue = this.getValue(valueMap, "vertices", null); + if (verticesValue == null) + deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices; + else { + deform = spine.Utils.newFloatArray(deformLength); + var start = this.getValue(valueMap, "offset", 0); + spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); + if (scale != 1) { + for (var i = start, n = i + verticesValue.length; i < n; i++) + deform[i] *= scale; + } + if (!weighted) { + for (var i = 0; i < deformLength; i++) + deform[i] += vertices[i]; + } + } + timeline.setFrame(frameIndex, valueMap.time, deform); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + } + } + } + var drawOrderNode = map.drawOrder; + if (drawOrderNode == null) + drawOrderNode = map.draworder; + if (drawOrderNode != null) { + var timeline = new spine.DrawOrderTimeline(drawOrderNode.length); + var slotCount = skeletonData.slots.length; + var frameIndex = 0; + for (var j = 0; j < drawOrderNode.length; j++) { + var drawOrderMap = drawOrderNode[j]; + var drawOrder = null; + var offsets = this.getValue(drawOrderMap, "offsets", null); + if (offsets != null) { + drawOrder = spine.Utils.newArray(slotCount, -1); + var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0); + var originalIndex = 0, unchangedIndex = 0; + for (var i = 0; i < offsets.length; i++) { + var offsetMap = offsets[i]; + var slotIndex = skeletonData.findSlotIndex(offsetMap.slot); + if (slotIndex == -1) + throw new Error("Slot not found: " + offsetMap.slot); + while (originalIndex != slotIndex) + unchanged[unchangedIndex++] = originalIndex++; + drawOrder[originalIndex + offsetMap.offset] = originalIndex++; + } + while (originalIndex < slotCount) + unchanged[unchangedIndex++] = originalIndex++; + for (var i = slotCount - 1; i >= 0; i--) + if (drawOrder[i] == -1) + drawOrder[i] = unchanged[--unchangedIndex]; + } + timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (map.events) { + var timeline = new spine.EventTimeline(map.events.length); + var frameIndex = 0; + for (var i = 0; i < map.events.length; i++) { + var eventMap = map.events[i]; + var eventData = skeletonData.findEvent(eventMap.name); + if (eventData == null) + throw new Error("Event not found: " + eventMap.name); + var event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData); + event_5.intValue = this.getValue(eventMap, "int", eventData.intValue); + event_5.floatValue = this.getValue(eventMap, "float", eventData.floatValue); + event_5.stringValue = this.getValue(eventMap, "string", eventData.stringValue); + if (event_5.data.audioPath != null) { + event_5.volume = this.getValue(eventMap, "volume", 1); + event_5.balance = this.getValue(eventMap, "balance", 0); + } + timeline.setFrame(frameIndex++, event_5); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (isNaN(duration)) { + throw new Error("Error while parsing animation, duration is NaN"); + } + skeletonData.animations.push(new spine.Animation(name, timelines, duration)); + }; + SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) { + if (!map.curve) + return; + if (map.curve === "stepped") + timeline.setStepped(frameIndex); + else if (Object.prototype.toString.call(map.curve) === '[object Array]') { + var curve = map.curve; + timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); + } + }; + SkeletonJson.prototype.getValue = function (map, prop, defaultValue) { + return map[prop] !== undefined ? map[prop] : defaultValue; + }; + SkeletonJson.blendModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.BlendMode.Normal; + if (str == "additive") + return spine.BlendMode.Additive; + if (str == "multiply") + return spine.BlendMode.Multiply; + if (str == "screen") + return spine.BlendMode.Screen; + throw new Error("Unknown blend mode: " + str); + }; + SkeletonJson.positionModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "fixed") + return spine.PositionMode.Fixed; + if (str == "percent") + return spine.PositionMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.spacingModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "length") + return spine.SpacingMode.Length; + if (str == "fixed") + return spine.SpacingMode.Fixed; + if (str == "percent") + return spine.SpacingMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.rotateModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "tangent") + return spine.RotateMode.Tangent; + if (str == "chain") + return spine.RotateMode.Chain; + if (str == "chainscale") + return spine.RotateMode.ChainScale; + throw new Error("Unknown rotate mode: " + str); + }; + SkeletonJson.transformModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.TransformMode.Normal; + if (str == "onlytranslation") + return spine.TransformMode.OnlyTranslation; + if (str == "norotationorreflection") + return spine.TransformMode.NoRotationOrReflection; + if (str == "noscale") + return spine.TransformMode.NoScale; + if (str == "noscaleorreflection") + return spine.TransformMode.NoScaleOrReflection; + throw new Error("Unknown transform mode: " + str); + }; + return SkeletonJson; + }()); + spine.SkeletonJson = SkeletonJson; + var LinkedMesh = (function () { + function LinkedMesh(mesh, skin, slotIndex, parent) { + this.mesh = mesh; + this.skin = skin; + this.slotIndex = slotIndex; + this.parent = parent; + } + return LinkedMesh; + }()); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skin = (function () { + function Skin(name) { + this.attachments = new Array(); + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + Skin.prototype.addAttachment = function (slotIndex, name, attachment) { + if (attachment == null) + throw new Error("attachment cannot be null."); + var attachments = this.attachments; + if (slotIndex >= attachments.length) + attachments.length = slotIndex + 1; + if (!attachments[slotIndex]) + attachments[slotIndex] = {}; + attachments[slotIndex][name] = attachment; + }; + Skin.prototype.getAttachment = function (slotIndex, name) { + var dictionary = this.attachments[slotIndex]; + return dictionary ? dictionary[name] : null; + }; + Skin.prototype.attachAll = function (skeleton, oldSkin) { + var slotIndex = 0; + for (var i = 0; i < skeleton.slots.length; i++) { + var slot = skeleton.slots[i]; + var slotAttachment = slot.getAttachment(); + if (slotAttachment && slotIndex < oldSkin.attachments.length) { + var dictionary = oldSkin.attachments[slotIndex]; + for (var key in dictionary) { + var skinAttachment = dictionary[key]; + if (slotAttachment == skinAttachment) { + var attachment = this.getAttachment(slotIndex, key); + if (attachment != null) + slot.setAttachment(attachment); + break; + } + } + } + slotIndex++; + } + }; + return Skin; + }()); + spine.Skin = Skin; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Slot = (function () { + function Slot(data, bone) { + this.attachmentVertices = new Array(); + if (data == null) + throw new Error("data cannot be null."); + if (bone == null) + throw new Error("bone cannot be null."); + this.data = data; + this.bone = bone; + this.color = new spine.Color(); + this.darkColor = data.darkColor == null ? null : new spine.Color(); + this.setToSetupPose(); + } + Slot.prototype.getAttachment = function () { + return this.attachment; + }; + Slot.prototype.setAttachment = function (attachment) { + if (this.attachment == attachment) + return; + this.attachment = attachment; + this.attachmentTime = this.bone.skeleton.time; + this.attachmentVertices.length = 0; + }; + Slot.prototype.setAttachmentTime = function (time) { + this.attachmentTime = this.bone.skeleton.time - time; + }; + Slot.prototype.getAttachmentTime = function () { + return this.bone.skeleton.time - this.attachmentTime; + }; + Slot.prototype.setToSetupPose = function () { + this.color.setFromColor(this.data.color); + if (this.darkColor != null) + this.darkColor.setFromColor(this.data.darkColor); + if (this.data.attachmentName == null) + this.attachment = null; + else { + this.attachment = null; + this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)); + } + }; + return Slot; + }()); + spine.Slot = Slot; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SlotData = (function () { + function SlotData(index, name, boneData) { + this.color = new spine.Color(1, 1, 1, 1); + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + if (boneData == null) + throw new Error("boneData cannot be null."); + this.index = index; + this.name = name; + this.boneData = boneData; + } + return SlotData; + }()); + spine.SlotData = SlotData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Texture = (function () { + function Texture(image) { + this._image = image; + } + Texture.prototype.getImage = function () { + return this._image; + }; + Texture.filterFromString = function (text) { + switch (text.toLowerCase()) { + case "nearest": return TextureFilter.Nearest; + case "linear": return TextureFilter.Linear; + case "mipmap": return TextureFilter.MipMap; + case "mipmapnearestnearest": return TextureFilter.MipMapNearestNearest; + case "mipmaplinearnearest": return TextureFilter.MipMapLinearNearest; + case "mipmapnearestlinear": return TextureFilter.MipMapNearestLinear; + case "mipmaplinearlinear": return TextureFilter.MipMapLinearLinear; + default: throw new Error("Unknown texture filter " + text); + } + }; + Texture.wrapFromString = function (text) { + switch (text.toLowerCase()) { + case "mirroredtepeat": return TextureWrap.MirroredRepeat; + case "clamptoedge": return TextureWrap.ClampToEdge; + case "repeat": return TextureWrap.Repeat; + default: throw new Error("Unknown texture wrap " + text); + } + }; + return Texture; + }()); + spine.Texture = Texture; + var TextureFilter; + (function (TextureFilter) { + TextureFilter[TextureFilter["Nearest"] = 9728] = "Nearest"; + TextureFilter[TextureFilter["Linear"] = 9729] = "Linear"; + TextureFilter[TextureFilter["MipMap"] = 9987] = "MipMap"; + TextureFilter[TextureFilter["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; + TextureFilter[TextureFilter["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; + TextureFilter[TextureFilter["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; + TextureFilter[TextureFilter["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; + })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {})); + var TextureWrap; + (function (TextureWrap) { + TextureWrap[TextureWrap["MirroredRepeat"] = 33648] = "MirroredRepeat"; + TextureWrap[TextureWrap["ClampToEdge"] = 33071] = "ClampToEdge"; + TextureWrap[TextureWrap["Repeat"] = 10497] = "Repeat"; + })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {})); + var TextureRegion = (function () { + function TextureRegion() { + this.u = 0; + this.v = 0; + this.u2 = 0; + this.v2 = 0; + this.width = 0; + this.height = 0; + this.rotate = false; + this.offsetX = 0; + this.offsetY = 0; + this.originalWidth = 0; + this.originalHeight = 0; + } + return TextureRegion; + }()); + spine.TextureRegion = TextureRegion; + var FakeTexture = (function (_super) { + __extends(FakeTexture, _super); + function FakeTexture() { + return _super !== null && _super.apply(this, arguments) || this; + } + FakeTexture.prototype.setFilters = function (minFilter, magFilter) { }; + FakeTexture.prototype.setWraps = function (uWrap, vWrap) { }; + FakeTexture.prototype.dispose = function () { }; + return FakeTexture; + }(Texture)); + spine.FakeTexture = FakeTexture; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TextureAtlas = (function () { + function TextureAtlas(atlasText, textureLoader) { + this.pages = new Array(); + this.regions = new Array(); + this.load(atlasText, textureLoader); + } + TextureAtlas.prototype.load = function (atlasText, textureLoader) { + if (textureLoader == null) + throw new Error("textureLoader cannot be null."); + var reader = new TextureAtlasReader(atlasText); + var tuple = new Array(4); + var page = null; + while (true) { + var line = reader.readLine(); + if (line == null) + break; + line = line.trim(); + if (line.length == 0) + page = null; + else if (!page) { + page = new TextureAtlasPage(); + page.name = line; + if (reader.readTuple(tuple) == 2) { + page.width = parseInt(tuple[0]); + page.height = parseInt(tuple[1]); + reader.readTuple(tuple); + } + reader.readTuple(tuple); + page.minFilter = spine.Texture.filterFromString(tuple[0]); + page.magFilter = spine.Texture.filterFromString(tuple[1]); + var direction = reader.readValue(); + page.uWrap = spine.TextureWrap.ClampToEdge; + page.vWrap = spine.TextureWrap.ClampToEdge; + if (direction == "x") + page.uWrap = spine.TextureWrap.Repeat; + else if (direction == "y") + page.vWrap = spine.TextureWrap.Repeat; + else if (direction == "xy") + page.uWrap = page.vWrap = spine.TextureWrap.Repeat; + page.texture = textureLoader(line); + page.texture.setFilters(page.minFilter, page.magFilter); + page.texture.setWraps(page.uWrap, page.vWrap); + page.width = page.texture.getImage().width; + page.height = page.texture.getImage().height; + this.pages.push(page); + } + else { + var region = new TextureAtlasRegion(); + region.name = line; + region.page = page; + region.rotate = reader.readValue() == "true"; + reader.readTuple(tuple); + var x = parseInt(tuple[0]); + var y = parseInt(tuple[1]); + reader.readTuple(tuple); + var width = parseInt(tuple[0]); + var height = parseInt(tuple[1]); + region.u = x / page.width; + region.v = y / page.height; + if (region.rotate) { + region.u2 = (x + height) / page.width; + region.v2 = (y + width) / page.height; + } + else { + region.u2 = (x + width) / page.width; + region.v2 = (y + height) / page.height; + } + region.x = x; + region.y = y; + region.width = Math.abs(width); + region.height = Math.abs(height); + if (reader.readTuple(tuple) == 4) { + if (reader.readTuple(tuple) == 4) { + reader.readTuple(tuple); + } + } + region.originalWidth = parseInt(tuple[0]); + region.originalHeight = parseInt(tuple[1]); + reader.readTuple(tuple); + region.offsetX = parseInt(tuple[0]); + region.offsetY = parseInt(tuple[1]); + region.index = parseInt(reader.readValue()); + region.texture = page.texture; + this.regions.push(region); + } + } + }; + TextureAtlas.prototype.findRegion = function (name) { + for (var i = 0; i < this.regions.length; i++) { + if (this.regions[i].name == name) { + return this.regions[i]; + } + } + return null; + }; + TextureAtlas.prototype.dispose = function () { + for (var i = 0; i < this.pages.length; i++) { + this.pages[i].texture.dispose(); + } + }; + return TextureAtlas; + }()); + spine.TextureAtlas = TextureAtlas; + var TextureAtlasReader = (function () { + function TextureAtlasReader(text) { + this.index = 0; + this.lines = text.split(/\r\n|\r|\n/); + } + TextureAtlasReader.prototype.readLine = function () { + if (this.index >= this.lines.length) + return null; + return this.lines[this.index++]; + }; + TextureAtlasReader.prototype.readValue = function () { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + return line.substring(colon + 1).trim(); + }; + TextureAtlasReader.prototype.readTuple = function (tuple) { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + var i = 0, lastMatch = colon + 1; + for (; i < 3; i++) { + var comma = line.indexOf(",", lastMatch); + if (comma == -1) + break; + tuple[i] = line.substr(lastMatch, comma - lastMatch).trim(); + lastMatch = comma + 1; + } + tuple[i] = line.substring(lastMatch).trim(); + return i + 1; + }; + return TextureAtlasReader; + }()); + var TextureAtlasPage = (function () { + function TextureAtlasPage() { + } + return TextureAtlasPage; + }()); + spine.TextureAtlasPage = TextureAtlasPage; + var TextureAtlasRegion = (function (_super) { + __extends(TextureAtlasRegion, _super); + function TextureAtlasRegion() { + return _super !== null && _super.apply(this, arguments) || this; + } + return TextureAtlasRegion; + }(spine.TextureRegion)); + spine.TextureAtlasRegion = TextureAtlasRegion; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraint = (function () { + function TransformConstraint(data, skeleton) { + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.temp = new spine.Vector2(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + this.scaleMix = data.scaleMix; + this.shearMix = data.shearMix; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + TransformConstraint.prototype.apply = function () { + this.update(); + }; + TransformConstraint.prototype.update = function () { + if (this.data.local) { + if (this.data.relative) + this.applyRelativeLocal(); + else + this.applyAbsoluteLocal(); + } + else { + if (this.data.relative) + this.applyRelativeWorld(); + else + this.applyAbsoluteWorld(); + } + }; + TransformConstraint.prototype.applyAbsoluteWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect; + var offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += (temp.x - bone.worldX) * translateMix; + bone.worldY += (temp.y - bone.worldY) * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c); + var ts = Math.sqrt(ta * ta + tc * tc); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s; + bone.a *= s; + bone.c *= s; + s = Math.sqrt(bone.b * bone.b + bone.d * bone.d); + ts = Math.sqrt(tb * tb + td * td); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var b = bone.b, d = bone.d; + var by = Math.atan2(d, b); + var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a)); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r = by + (r + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyRelativeWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += temp.x * translateMix; + bone.worldY += temp.y * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1; + bone.a *= s; + bone.c *= s; + s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var r = Math.atan2(td, tb) - Math.atan2(tc, ta); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + var b = bone.b, d = bone.d; + r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyAbsoluteLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) { + var r = target.arotation - rotation + this.data.offsetRotation; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + rotation += r * rotateMix; + } + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax - x + this.data.offsetX) * translateMix; + y += (target.ay - y + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX; + if (scaleY > 0.00001) + scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY; + } + var shearY = bone.ashearY; + if (shearMix != 0) { + var r = target.ashearY - shearY + this.data.offsetShearY; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + bone.shearY += r * shearMix; + } + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.applyRelativeLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) + rotation += (target.arotation + this.data.offsetRotation) * rotateMix; + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax + this.data.offsetX) * translateMix; + y += (target.ay + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1; + if (scaleY > 0.00001) + scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1; + } + var shearY = bone.ashearY; + if (shearMix != 0) + shearY += (target.ashearY + this.data.offsetShearY) * shearMix; + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.getOrder = function () { + return this.data.order; + }; + return TransformConstraint; + }()); + spine.TransformConstraint = TransformConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraintData = (function () { + function TransformConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.offsetRotation = 0; + this.offsetX = 0; + this.offsetY = 0; + this.offsetScaleX = 0; + this.offsetScaleY = 0; + this.offsetShearY = 0; + this.relative = false; + this.local = false; + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return TransformConstraintData; + }()); + spine.TransformConstraintData = TransformConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Triangulator = (function () { + function Triangulator() { + this.convexPolygons = new Array(); + this.convexPolygonsIndices = new Array(); + this.indicesArray = new Array(); + this.isConcaveArray = new Array(); + this.triangles = new Array(); + this.polygonPool = new spine.Pool(function () { + return new Array(); + }); + this.polygonIndicesPool = new spine.Pool(function () { + return new Array(); + }); + } + Triangulator.prototype.triangulate = function (verticesArray) { + var vertices = verticesArray; + var vertexCount = verticesArray.length >> 1; + var indices = this.indicesArray; + indices.length = 0; + for (var i = 0; i < vertexCount; i++) + indices[i] = i; + var isConcave = this.isConcaveArray; + isConcave.length = 0; + for (var i = 0, n = vertexCount; i < n; ++i) + isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices); + var triangles = this.triangles; + triangles.length = 0; + while (vertexCount > 3) { + var previous = vertexCount - 1, i = 0, next = 1; + while (true) { + outer: if (!isConcave[i]) { + var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; + var p1x = vertices[p1], p1y = vertices[p1 + 1]; + var p2x = vertices[p2], p2y = vertices[p2 + 1]; + var p3x = vertices[p3], p3y = vertices[p3 + 1]; + for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { + if (!isConcave[ii]) + continue; + var v = indices[ii] << 1; + var vx = vertices[v], vy = vertices[v + 1]; + if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { + if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { + if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) + break outer; + } + } + } + break; + } + if (next == 0) { + do { + if (!isConcave[i]) + break; + i--; + } while (i > 0); + break; + } + previous = i; + i = next; + next = (next + 1) % vertexCount; + } + triangles.push(indices[(vertexCount + i - 1) % vertexCount]); + triangles.push(indices[i]); + triangles.push(indices[(i + 1) % vertexCount]); + indices.splice(i, 1); + isConcave.splice(i, 1); + vertexCount--; + var previousIndex = (vertexCount + i - 1) % vertexCount; + var nextIndex = i == vertexCount ? 0 : i; + isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices); + isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices); + } + if (vertexCount == 3) { + triangles.push(indices[2]); + triangles.push(indices[0]); + triangles.push(indices[1]); + } + return triangles; + }; + Triangulator.prototype.decompose = function (verticesArray, triangles) { + var vertices = verticesArray; + var convexPolygons = this.convexPolygons; + this.polygonPool.freeAll(convexPolygons); + convexPolygons.length = 0; + var convexPolygonsIndices = this.convexPolygonsIndices; + this.polygonIndicesPool.freeAll(convexPolygonsIndices); + convexPolygonsIndices.length = 0; + var polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + var polygon = this.polygonPool.obtain(); + polygon.length = 0; + var fanBaseIndex = -1, lastWinding = 0; + for (var i = 0, n = triangles.length; i < n; i += 3) { + var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; + var x1 = vertices[t1], y1 = vertices[t1 + 1]; + var x2 = vertices[t2], y2 = vertices[t2 + 1]; + var x3 = vertices[t3], y3 = vertices[t3 + 1]; + var merged = false; + if (fanBaseIndex == t1) { + var o = polygon.length - 4; + var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); + var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]); + if (winding1 == lastWinding && winding2 == lastWinding) { + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(t3); + merged = true; + } + } + if (!merged) { + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + else { + this.polygonPool.free(polygon); + this.polygonIndicesPool.free(polygonIndices); + } + polygon = this.polygonPool.obtain(); + polygon.length = 0; + polygon.push(x1); + polygon.push(y1); + polygon.push(x2); + polygon.push(y2); + polygon.push(x3); + polygon.push(y3); + polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + polygonIndices.push(t1); + polygonIndices.push(t2); + polygonIndices.push(t3); + lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3); + fanBaseIndex = t1; + } + } + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + for (var i = 0, n = convexPolygons.length; i < n; i++) { + polygonIndices = convexPolygonsIndices[i]; + if (polygonIndices.length == 0) + continue; + var firstIndex = polygonIndices[0]; + var lastIndex = polygonIndices[polygonIndices.length - 1]; + polygon = convexPolygons[i]; + var o = polygon.length - 4; + var prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; + var prevX = polygon[o + 2], prevY = polygon[o + 3]; + var firstX = polygon[0], firstY = polygon[1]; + var secondX = polygon[2], secondY = polygon[3]; + var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); + for (var ii = 0; ii < n; ii++) { + if (ii == i) + continue; + var otherIndices = convexPolygonsIndices[ii]; + if (otherIndices.length != 3) + continue; + var otherFirstIndex = otherIndices[0]; + var otherSecondIndex = otherIndices[1]; + var otherLastIndex = otherIndices[2]; + var otherPoly = convexPolygons[ii]; + var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; + if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) + continue; + var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); + var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY); + if (winding1 == winding && winding2 == winding) { + otherPoly.length = 0; + otherIndices.length = 0; + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(otherLastIndex); + prevPrevX = prevX; + prevPrevY = prevY; + prevX = x3; + prevY = y3; + ii = 0; + } + } + } + for (var i = convexPolygons.length - 1; i >= 0; i--) { + polygon = convexPolygons[i]; + if (polygon.length == 0) { + convexPolygons.splice(i, 1); + this.polygonPool.free(polygon); + polygonIndices = convexPolygonsIndices[i]; + convexPolygonsIndices.splice(i, 1); + this.polygonIndicesPool.free(polygonIndices); + } + } + return convexPolygons; + }; + Triangulator.isConcave = function (index, vertexCount, vertices, indices) { + var previous = indices[(vertexCount + index - 1) % vertexCount] << 1; + var current = indices[index] << 1; + var next = indices[(index + 1) % vertexCount] << 1; + return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); + }; + Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) { + return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; + }; + Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) { + var px = p2x - p1x, py = p2y - p1y; + return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; + }; + return Triangulator; + }()); + spine.Triangulator = Triangulator; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IntSet = (function () { + function IntSet() { + this.array = new Array(); + } + IntSet.prototype.add = function (value) { + var contains = this.contains(value); + this.array[value | 0] = value | 0; + return !contains; + }; + IntSet.prototype.contains = function (value) { + return this.array[value | 0] != undefined; + }; + IntSet.prototype.remove = function (value) { + this.array[value | 0] = undefined; + }; + IntSet.prototype.clear = function () { + this.array.length = 0; + }; + return IntSet; + }()); + spine.IntSet = IntSet; + var Color = (function () { + function Color(r, g, b, a) { + if (r === void 0) { r = 0; } + if (g === void 0) { g = 0; } + if (b === void 0) { b = 0; } + if (a === void 0) { a = 0; } + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + Color.prototype.set = function (r, g, b, a) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + this.clamp(); + return this; + }; + Color.prototype.setFromColor = function (c) { + this.r = c.r; + this.g = c.g; + this.b = c.b; + this.a = c.a; + return this; + }; + Color.prototype.setFromString = function (hex) { + hex = hex.charAt(0) == '#' ? hex.substr(1) : hex; + this.r = parseInt(hex.substr(0, 2), 16) / 255.0; + this.g = parseInt(hex.substr(2, 2), 16) / 255.0; + this.b = parseInt(hex.substr(4, 2), 16) / 255.0; + this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0; + return this; + }; + Color.prototype.add = function (r, g, b, a) { + this.r += r; + this.g += g; + this.b += b; + this.a += a; + this.clamp(); + return this; + }; + Color.prototype.clamp = function () { + if (this.r < 0) + this.r = 0; + else if (this.r > 1) + this.r = 1; + if (this.g < 0) + this.g = 0; + else if (this.g > 1) + this.g = 1; + if (this.b < 0) + this.b = 0; + else if (this.b > 1) + this.b = 1; + if (this.a < 0) + this.a = 0; + else if (this.a > 1) + this.a = 1; + return this; + }; + Color.WHITE = new Color(1, 1, 1, 1); + Color.RED = new Color(1, 0, 0, 1); + Color.GREEN = new Color(0, 1, 0, 1); + Color.BLUE = new Color(0, 0, 1, 1); + Color.MAGENTA = new Color(1, 0, 1, 1); + return Color; + }()); + spine.Color = Color; + var MathUtils = (function () { + function MathUtils() { + } + MathUtils.clamp = function (value, min, max) { + if (value < min) + return min; + if (value > max) + return max; + return value; + }; + MathUtils.cosDeg = function (degrees) { + return Math.cos(degrees * MathUtils.degRad); + }; + MathUtils.sinDeg = function (degrees) { + return Math.sin(degrees * MathUtils.degRad); + }; + MathUtils.signum = function (value) { + return value > 0 ? 1 : value < 0 ? -1 : 0; + }; + MathUtils.toInt = function (x) { + return x > 0 ? Math.floor(x) : Math.ceil(x); + }; + MathUtils.cbrt = function (x) { + var y = Math.pow(Math.abs(x), 1 / 3); + return x < 0 ? -y : y; + }; + MathUtils.randomTriangular = function (min, max) { + return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); + }; + MathUtils.randomTriangularWith = function (min, max, mode) { + var u = Math.random(); + var d = max - min; + if (u <= (mode - min) / d) + return min + Math.sqrt(u * d * (mode - min)); + return max - Math.sqrt((1 - u) * d * (max - mode)); + }; + MathUtils.PI = 3.1415927; + MathUtils.PI2 = MathUtils.PI * 2; + MathUtils.radiansToDegrees = 180 / MathUtils.PI; + MathUtils.radDeg = MathUtils.radiansToDegrees; + MathUtils.degreesToRadians = MathUtils.PI / 180; + MathUtils.degRad = MathUtils.degreesToRadians; + return MathUtils; + }()); + spine.MathUtils = MathUtils; + var Interpolation = (function () { + function Interpolation() { + } + Interpolation.prototype.apply = function (start, end, a) { + return start + (end - start) * this.applyInternal(a); + }; + return Interpolation; + }()); + spine.Interpolation = Interpolation; + var Pow = (function (_super) { + __extends(Pow, _super); + function Pow(power) { + var _this = _super.call(this) || this; + _this.power = 2; + _this.power = power; + return _this; + } + Pow.prototype.applyInternal = function (a) { + if (a <= 0.5) + return Math.pow(a * 2, this.power) / 2; + return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1; + }; + return Pow; + }(Interpolation)); + spine.Pow = Pow; + var PowOut = (function (_super) { + __extends(PowOut, _super); + function PowOut(power) { + return _super.call(this, power) || this; + } + PowOut.prototype.applyInternal = function (a) { + return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1; + }; + return PowOut; + }(Pow)); + spine.PowOut = PowOut; + var Utils = (function () { + function Utils() { + } + Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) { + for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { + dest[j] = source[i]; + } + }; + Utils.setArraySize = function (array, size, value) { + if (value === void 0) { value = 0; } + var oldSize = array.length; + if (oldSize == size) + return array; + array.length = size; + if (oldSize < size) { + for (var i = oldSize; i < size; i++) + array[i] = value; + } + return array; + }; + Utils.ensureArrayCapacity = function (array, size, value) { + if (value === void 0) { value = 0; } + if (array.length >= size) + return array; + return Utils.setArraySize(array, size, value); + }; + Utils.newArray = function (size, defaultValue) { + var array = new Array(size); + for (var i = 0; i < size; i++) + array[i] = defaultValue; + return array; + }; + Utils.newFloatArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Float32Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.newShortArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Int16Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.toFloatArray = function (array) { + return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; + }; + Utils.toSinglePrecision = function (value) { + return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; + }; + Utils.webkit602BugfixHelper = function (alpha, blend) { + }; + Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== "undefined"; + return Utils; + }()); + spine.Utils = Utils; + var DebugUtils = (function () { + function DebugUtils() { + } + DebugUtils.logBones = function (skeleton) { + for (var i = 0; i < skeleton.bones.length; i++) { + var bone = skeleton.bones[i]; + console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY); + } + }; + return DebugUtils; + }()); + spine.DebugUtils = DebugUtils; + var Pool = (function () { + function Pool(instantiator) { + this.items = new Array(); + this.instantiator = instantiator; + } + Pool.prototype.obtain = function () { + return this.items.length > 0 ? this.items.pop() : this.instantiator(); + }; + Pool.prototype.free = function (item) { + if (item.reset) + item.reset(); + this.items.push(item); + }; + Pool.prototype.freeAll = function (items) { + for (var i = 0; i < items.length; i++) { + if (items[i].reset) + items[i].reset(); + this.items[i] = items[i]; + } + }; + Pool.prototype.clear = function () { + this.items.length = 0; + }; + return Pool; + }()); + spine.Pool = Pool; + var Vector2 = (function () { + function Vector2(x, y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + this.x = x; + this.y = y; + } + Vector2.prototype.set = function (x, y) { + this.x = x; + this.y = y; + return this; + }; + Vector2.prototype.length = function () { + var x = this.x; + var y = this.y; + return Math.sqrt(x * x + y * y); + }; + Vector2.prototype.normalize = function () { + var len = this.length(); + if (len != 0) { + this.x /= len; + this.y /= len; + } + return this; + }; + return Vector2; + }()); + spine.Vector2 = Vector2; + var TimeKeeper = (function () { + function TimeKeeper() { + this.maxDelta = 0.064; + this.framesPerSecond = 0; + this.delta = 0; + this.totalTime = 0; + this.lastTime = Date.now() / 1000; + this.frameCount = 0; + this.frameTime = 0; + } + TimeKeeper.prototype.update = function () { + var now = Date.now() / 1000; + this.delta = now - this.lastTime; + this.frameTime += this.delta; + this.totalTime += this.delta; + if (this.delta > this.maxDelta) + this.delta = this.maxDelta; + this.lastTime = now; + this.frameCount++; + if (this.frameTime > 1) { + this.framesPerSecond = this.frameCount / this.frameTime; + this.frameTime = 0; + this.frameCount = 0; + } + }; + return TimeKeeper; + }()); + spine.TimeKeeper = TimeKeeper; + var WindowedMean = (function () { + function WindowedMean(windowSize) { + if (windowSize === void 0) { windowSize = 32; } + this.addedValues = 0; + this.lastValue = 0; + this.mean = 0; + this.dirty = true; + this.values = new Array(windowSize); + } + WindowedMean.prototype.hasEnoughData = function () { + return this.addedValues >= this.values.length; + }; + WindowedMean.prototype.addValue = function (value) { + if (this.addedValues < this.values.length) + this.addedValues++; + this.values[this.lastValue++] = value; + if (this.lastValue > this.values.length - 1) + this.lastValue = 0; + this.dirty = true; + }; + WindowedMean.prototype.getMean = function () { + if (this.hasEnoughData()) { + if (this.dirty) { + var mean = 0; + for (var i = 0; i < this.values.length; i++) { + mean += this.values[i]; + } + this.mean = mean / this.values.length; + this.dirty = false; + } + return this.mean; + } + else { + return 0; + } + }; + return WindowedMean; + }()); + spine.WindowedMean = WindowedMean; +})(spine || (spine = {})); +(function () { + if (!Math.fround) { + Math.fround = (function (array) { + return function (x) { + return array[0] = x, array[0]; + }; + })(new Float32Array(1)); + } +})(); +var spine; +(function (spine) { + var Attachment = (function () { + function Attachment(name) { + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return Attachment; + }()); + spine.Attachment = Attachment; + var VertexAttachment = (function (_super) { + __extends(VertexAttachment, _super); + function VertexAttachment(name) { + var _this = _super.call(this, name) || this; + _this.id = (VertexAttachment.nextID++ & 65535) << 11; + _this.worldVerticesLength = 0; + return _this; + } + VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) { + count = offset + (count >> 1) * stride; + var skeleton = slot.bone.skeleton; + var deformArray = slot.attachmentVertices; + var vertices = this.vertices; + var bones = this.bones; + if (bones == null) { + if (deformArray.length > 0) + vertices = deformArray; + var bone = slot.bone; + var x = bone.worldX; + var y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) { + var vx = vertices[v_1], vy = vertices[v_1 + 1]; + worldVertices[w] = vx * a + vy * b + x; + worldVertices[w + 1] = vx * c + vy * d + y; + } + return; + } + var v = 0, skip = 0; + for (var i = 0; i < start; i += 2) { + var n = bones[v]; + v += n + 1; + skip += n; + } + var skeletonBones = skeleton.bones; + if (deformArray.length == 0) { + for (var w = offset, b = skip * 3; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + else { + var deform = deformArray; + for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3, f += 2) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + }; + VertexAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment; + }; + VertexAttachment.nextID = 0; + return VertexAttachment; + }(Attachment)); + spine.VertexAttachment = VertexAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AttachmentType; + (function (AttachmentType) { + AttachmentType[AttachmentType["Region"] = 0] = "Region"; + AttachmentType[AttachmentType["BoundingBox"] = 1] = "BoundingBox"; + AttachmentType[AttachmentType["Mesh"] = 2] = "Mesh"; + AttachmentType[AttachmentType["LinkedMesh"] = 3] = "LinkedMesh"; + AttachmentType[AttachmentType["Path"] = 4] = "Path"; + AttachmentType[AttachmentType["Point"] = 5] = "Point"; + })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoundingBoxAttachment = (function (_super) { + __extends(BoundingBoxAttachment, _super); + function BoundingBoxAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return BoundingBoxAttachment; + }(spine.VertexAttachment)); + spine.BoundingBoxAttachment = BoundingBoxAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var ClippingAttachment = (function (_super) { + __extends(ClippingAttachment, _super); + function ClippingAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1); + return _this; + } + return ClippingAttachment; + }(spine.VertexAttachment)); + spine.ClippingAttachment = ClippingAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var MeshAttachment = (function (_super) { + __extends(MeshAttachment, _super); + function MeshAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + _this.inheritDeform = false; + _this.tempColor = new spine.Color(0, 0, 0, 0); + return _this; + } + MeshAttachment.prototype.updateUVs = function () { + var regionUVs = this.regionUVs; + if (this.uvs == null || this.uvs.length != regionUVs.length) + this.uvs = spine.Utils.newFloatArray(regionUVs.length); + var uvs = this.uvs; + var u = 0, v = 0, width = 0, height = 0; + if (this.region instanceof spine.TextureAtlasRegion) { + var region = this.region; + var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height; + if (region.rotate) { + u = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth; + v = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight; + width = region.originalHeight / textureWidth; + height = region.originalWidth / textureHeight; + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i + 1] * width; + uvs[i + 1] = v + height - regionUVs[i] * height; + } + return; + } + u = region.u - region.offsetX / textureWidth; + v = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight; + width = region.originalWidth / textureWidth; + height = region.originalHeight / textureHeight; + } + else if (this.region == null) { + u = v = 0; + width = height = 1; + } + else { + u = this.region.u; + v = this.region.v; + width = this.region.u2 - u; + height = this.region.v2 - v; + } + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i] * width; + uvs[i + 1] = v + regionUVs[i + 1] * height; + } + }; + MeshAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment); + }; + MeshAttachment.prototype.getParentMesh = function () { + return this.parentMesh; + }; + MeshAttachment.prototype.setParentMesh = function (parentMesh) { + this.parentMesh = parentMesh; + if (parentMesh != null) { + this.bones = parentMesh.bones; + this.vertices = parentMesh.vertices; + this.worldVerticesLength = parentMesh.worldVerticesLength; + this.regionUVs = parentMesh.regionUVs; + this.triangles = parentMesh.triangles; + this.hullLength = parentMesh.hullLength; + this.worldVerticesLength = parentMesh.worldVerticesLength; + } + }; + return MeshAttachment; + }(spine.VertexAttachment)); + spine.MeshAttachment = MeshAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathAttachment = (function (_super) { + __extends(PathAttachment, _super); + function PathAttachment(name) { + var _this = _super.call(this, name) || this; + _this.closed = false; + _this.constantSpeed = false; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return PathAttachment; + }(spine.VertexAttachment)); + spine.PathAttachment = PathAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PointAttachment = (function (_super) { + __extends(PointAttachment, _super); + function PointAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.38, 0.94, 0, 1); + return _this; + } + PointAttachment.prototype.computeWorldPosition = function (bone, point) { + point.x = this.x * bone.a + this.y * bone.b + bone.worldX; + point.y = this.x * bone.c + this.y * bone.d + bone.worldY; + return point; + }; + PointAttachment.prototype.computeWorldRotation = function (bone) { + var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation); + var x = cos * bone.a + sin * bone.b; + var y = cos * bone.c + sin * bone.d; + return Math.atan2(y, x) * spine.MathUtils.radDeg; + }; + return PointAttachment; + }(spine.VertexAttachment)); + spine.PointAttachment = PointAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var RegionAttachment = (function (_super) { + __extends(RegionAttachment, _super); + function RegionAttachment(name) { + var _this = _super.call(this, name) || this; + _this.x = 0; + _this.y = 0; + _this.scaleX = 1; + _this.scaleY = 1; + _this.rotation = 0; + _this.width = 0; + _this.height = 0; + _this.color = new spine.Color(1, 1, 1, 1); + _this.offset = spine.Utils.newFloatArray(8); + _this.uvs = spine.Utils.newFloatArray(8); + _this.tempColor = new spine.Color(1, 1, 1, 1); + return _this; + } + RegionAttachment.prototype.updateOffset = function () { + var regionScaleX = this.width / this.region.originalWidth * this.scaleX; + var regionScaleY = this.height / this.region.originalHeight * this.scaleY; + var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; + var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; + var localX2 = localX + this.region.width * regionScaleX; + var localY2 = localY + this.region.height * regionScaleY; + var radians = this.rotation * Math.PI / 180; + var cos = Math.cos(radians); + var sin = Math.sin(radians); + var localXCos = localX * cos + this.x; + var localXSin = localX * sin; + var localYCos = localY * cos + this.y; + var localYSin = localY * sin; + var localX2Cos = localX2 * cos + this.x; + var localX2Sin = localX2 * sin; + var localY2Cos = localY2 * cos + this.y; + var localY2Sin = localY2 * sin; + var offset = this.offset; + offset[RegionAttachment.OX1] = localXCos - localYSin; + offset[RegionAttachment.OY1] = localYCos + localXSin; + offset[RegionAttachment.OX2] = localXCos - localY2Sin; + offset[RegionAttachment.OY2] = localY2Cos + localXSin; + offset[RegionAttachment.OX3] = localX2Cos - localY2Sin; + offset[RegionAttachment.OY3] = localY2Cos + localX2Sin; + offset[RegionAttachment.OX4] = localX2Cos - localYSin; + offset[RegionAttachment.OY4] = localYCos + localX2Sin; + }; + RegionAttachment.prototype.setRegion = function (region) { + this.region = region; + var uvs = this.uvs; + if (region.rotate) { + uvs[2] = region.u; + uvs[3] = region.v2; + uvs[4] = region.u; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v; + uvs[0] = region.u2; + uvs[1] = region.v2; + } + else { + uvs[0] = region.u; + uvs[1] = region.v2; + uvs[2] = region.u; + uvs[3] = region.v; + uvs[4] = region.u2; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v2; + } + }; + RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) { + var vertexOffset = this.offset; + var x = bone.worldX, y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var offsetX = 0, offsetY = 0; + offsetX = vertexOffset[RegionAttachment.OX1]; + offsetY = vertexOffset[RegionAttachment.OY1]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX2]; + offsetY = vertexOffset[RegionAttachment.OY2]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX3]; + offsetY = vertexOffset[RegionAttachment.OY3]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX4]; + offsetY = vertexOffset[RegionAttachment.OY4]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + }; + RegionAttachment.OX1 = 0; + RegionAttachment.OY1 = 1; + RegionAttachment.OX2 = 2; + RegionAttachment.OY2 = 3; + RegionAttachment.OX3 = 4; + RegionAttachment.OY3 = 5; + RegionAttachment.OX4 = 6; + RegionAttachment.OY4 = 7; + RegionAttachment.X1 = 0; + RegionAttachment.Y1 = 1; + RegionAttachment.C1R = 2; + RegionAttachment.C1G = 3; + RegionAttachment.C1B = 4; + RegionAttachment.C1A = 5; + RegionAttachment.U1 = 6; + RegionAttachment.V1 = 7; + RegionAttachment.X2 = 8; + RegionAttachment.Y2 = 9; + RegionAttachment.C2R = 10; + RegionAttachment.C2G = 11; + RegionAttachment.C2B = 12; + RegionAttachment.C2A = 13; + RegionAttachment.U2 = 14; + RegionAttachment.V2 = 15; + RegionAttachment.X3 = 16; + RegionAttachment.Y3 = 17; + RegionAttachment.C3R = 18; + RegionAttachment.C3G = 19; + RegionAttachment.C3B = 20; + RegionAttachment.C3A = 21; + RegionAttachment.U3 = 22; + RegionAttachment.V3 = 23; + RegionAttachment.X4 = 24; + RegionAttachment.Y4 = 25; + RegionAttachment.C4R = 26; + RegionAttachment.C4G = 27; + RegionAttachment.C4B = 28; + RegionAttachment.C4A = 29; + RegionAttachment.U4 = 30; + RegionAttachment.V4 = 31; + return RegionAttachment; + }(spine.Attachment)); + spine.RegionAttachment = RegionAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var JitterEffect = (function () { + function JitterEffect(jitterX, jitterY) { + this.jitterX = 0; + this.jitterY = 0; + this.jitterX = jitterX; + this.jitterY = jitterY; + } + JitterEffect.prototype.begin = function (skeleton) { + }; + JitterEffect.prototype.transform = function (position, uv, light, dark) { + position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + }; + JitterEffect.prototype.end = function () { + }; + return JitterEffect; + }()); + spine.JitterEffect = JitterEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SwirlEffect = (function () { + function SwirlEffect(radius) { + this.centerX = 0; + this.centerY = 0; + this.radius = 0; + this.angle = 0; + this.worldX = 0; + this.worldY = 0; + this.radius = radius; + } + SwirlEffect.prototype.begin = function (skeleton) { + this.worldX = skeleton.x + this.centerX; + this.worldY = skeleton.y + this.centerY; + }; + SwirlEffect.prototype.transform = function (position, uv, light, dark) { + var radAngle = this.angle * spine.MathUtils.degreesToRadians; + var x = position.x - this.worldX; + var y = position.y - this.worldY; + var dist = Math.sqrt(x * x + y * y); + if (dist < this.radius) { + var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius); + var cos = Math.cos(theta); + var sin = Math.sin(theta); + position.x = cos * x - sin * y + this.worldX; + position.y = sin * x + cos * y + this.worldY; + } + }; + SwirlEffect.prototype.end = function () { + }; + SwirlEffect.interpolation = new spine.PowOut(2); + return SwirlEffect; + }()); + spine.SwirlEffect = SwirlEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var AssetManager = (function (_super) { + __extends(AssetManager, _super); + function AssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + return _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this; + } + return AssetManager; + }(spine.AssetManager)); + canvas.AssetManager = AssetManager; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var CanvasTexture = (function (_super) { + __extends(CanvasTexture, _super); + function CanvasTexture(image) { + return _super.call(this, image) || this; + } + CanvasTexture.prototype.setFilters = function (minFilter, magFilter) { }; + CanvasTexture.prototype.setWraps = function (uWrap, vWrap) { }; + CanvasTexture.prototype.dispose = function () { }; + return CanvasTexture; + }(spine.Texture)); + canvas.CanvasTexture = CanvasTexture; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var SkeletonRenderer = (function () { + function SkeletonRenderer(context) { + this.triangleRendering = false; + this.debugRendering = false; + this.vertices = spine.Utils.newFloatArray(8 * 1024); + this.tempColor = new spine.Color(); + this.ctx = context; + } + SkeletonRenderer.prototype.draw = function (skeleton) { + if (this.triangleRendering) + this.drawTriangles(skeleton); + else + this.drawImages(skeleton); + }; + SkeletonRenderer.prototype.drawImages = function (skeleton) { + var ctx = this.ctx; + var drawOrder = skeleton.drawOrder; + if (this.debugRendering) + ctx.strokeStyle = "green"; + ctx.save(); + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var attachment = slot.getAttachment(); + var regionAttachment = null; + var region = null; + var image = null; + if (attachment instanceof spine.RegionAttachment) { + regionAttachment = attachment; + region = regionAttachment.region; + image = region.texture.getImage(); + } + else + continue; + var skeleton_1 = slot.bone.skeleton; + var skeletonColor = skeleton_1.color; + var slotColor = slot.color; + var regionColor = regionAttachment.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha); + var att = attachment; + var bone = slot.bone; + var w = region.width; + var h = region.height; + ctx.save(); + ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY); + ctx.translate(attachment.offset[0], attachment.offset[1]); + ctx.rotate(attachment.rotation * Math.PI / 180); + var atlasScale = att.width / w; + ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY); + ctx.translate(w / 2, h / 2); + if (attachment.region.rotate) { + var t = w; + w = h; + h = t; + ctx.rotate(-Math.PI / 2); + } + ctx.scale(1, -1); + ctx.translate(-w / 2, -h / 2); + if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { + ctx.globalAlpha = color.a; + } + ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h); + if (this.debugRendering) + ctx.strokeRect(0, 0, w, h); + ctx.restore(); + } + ctx.restore(); + }; + SkeletonRenderer.prototype.drawTriangles = function (skeleton) { + var blendMode = null; + var vertices = this.vertices; + var triangles = null; + var drawOrder = skeleton.drawOrder; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var attachment = slot.getAttachment(); + var texture = null; + var region = null; + if (attachment instanceof spine.RegionAttachment) { + var regionAttachment = attachment; + vertices = this.computeRegionVertices(slot, regionAttachment, false); + triangles = SkeletonRenderer.QUAD_TRIANGLES; + region = regionAttachment.region; + texture = region.texture.getImage(); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + vertices = this.computeMeshVertices(slot, mesh, false); + triangles = mesh.triangles; + texture = mesh.region.renderObject.texture.getImage(); + } + else + continue; + if (texture != null) { + var slotBlendMode = slot.data.blendMode; + if (slotBlendMode != blendMode) { + blendMode = slotBlendMode; + } + var skeleton_2 = slot.bone.skeleton; + var skeletonColor = skeleton_2.color; + var slotColor = slot.color; + var attachmentColor = attachment.color; + var alpha = skeletonColor.a * slotColor.a * attachmentColor.a; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha); + var ctx = this.ctx; + if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { + ctx.globalAlpha = color.a; + } + for (var j = 0; j < triangles.length; j += 3) { + var t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8; + var x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7]; + var x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7]; + var x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7]; + this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2); + if (this.debugRendering) { + ctx.strokeStyle = "green"; + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.lineTo(x0, y0); + ctx.stroke(); + } + } + } + } + this.ctx.globalAlpha = 1; + }; + SkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) { + var ctx = this.ctx; + u0 *= img.width; + v0 *= img.height; + u1 *= img.width; + v1 *= img.height; + u2 *= img.width; + v2 *= img.height; + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.closePath(); + x1 -= x0; + y1 -= y0; + x2 -= x0; + y2 -= y0; + u1 -= u0; + v1 -= v0; + u2 -= u0; + v2 -= v0; + var det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0; + ctx.save(); + ctx.transform(a, b, c, d, e, f); + ctx.clip(); + ctx.drawImage(img, 0, 0); + ctx.restore(); + }; + SkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) { + var skeleton = slot.bone.skeleton; + var skeletonColor = skeleton.color; + var slotColor = slot.color; + var regionColor = region.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var multiplier = pma ? alpha : 1; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); + region.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE); + var vertices = this.vertices; + var uvs = region.uvs; + vertices[spine.RegionAttachment.C1R] = color.r; + vertices[spine.RegionAttachment.C1G] = color.g; + vertices[spine.RegionAttachment.C1B] = color.b; + vertices[spine.RegionAttachment.C1A] = color.a; + vertices[spine.RegionAttachment.U1] = uvs[0]; + vertices[spine.RegionAttachment.V1] = uvs[1]; + vertices[spine.RegionAttachment.C2R] = color.r; + vertices[spine.RegionAttachment.C2G] = color.g; + vertices[spine.RegionAttachment.C2B] = color.b; + vertices[spine.RegionAttachment.C2A] = color.a; + vertices[spine.RegionAttachment.U2] = uvs[2]; + vertices[spine.RegionAttachment.V2] = uvs[3]; + vertices[spine.RegionAttachment.C3R] = color.r; + vertices[spine.RegionAttachment.C3G] = color.g; + vertices[spine.RegionAttachment.C3B] = color.b; + vertices[spine.RegionAttachment.C3A] = color.a; + vertices[spine.RegionAttachment.U3] = uvs[4]; + vertices[spine.RegionAttachment.V3] = uvs[5]; + vertices[spine.RegionAttachment.C4R] = color.r; + vertices[spine.RegionAttachment.C4G] = color.g; + vertices[spine.RegionAttachment.C4B] = color.b; + vertices[spine.RegionAttachment.C4A] = color.a; + vertices[spine.RegionAttachment.U4] = uvs[6]; + vertices[spine.RegionAttachment.V4] = uvs[7]; + return vertices; + }; + SkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) { + var skeleton = slot.bone.skeleton; + var skeletonColor = skeleton.color; + var slotColor = slot.color; + var regionColor = mesh.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var multiplier = pma ? alpha : 1; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); + var numVertices = mesh.worldVerticesLength / 2; + if (this.vertices.length < mesh.worldVerticesLength) { + this.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength); + } + var vertices = this.vertices; + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE); + var uvs = mesh.uvs; + for (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) { + vertices[v++] = color.r; + vertices[v++] = color.g; + vertices[v++] = color.b; + vertices[v++] = color.a; + vertices[v++] = uvs[u++]; + vertices[v++] = uvs[u++]; + v += 2; + } + return vertices; + }; + SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; + SkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4; + return SkeletonRenderer; + }()); + canvas.SkeletonRenderer = SkeletonRenderer; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +//# sourceMappingURL=spine-canvas.js.map + +/*** EXPORTS FROM exports-loader ***/ +module.exports = spine; +}.call(window)); + +/***/ }) + +/******/ }); +//# sourceMappingURL=SpineCanvasPluginDebug.js.map \ No newline at end of file diff --git a/plugins/spine/dist/SpineCanvasPluginDebug.js.map b/plugins/spine/dist/SpineCanvasPluginDebug.js.map new file mode 100644 index 000000000..5ed3c9ce1 --- /dev/null +++ b/plugins/spine/dist/SpineCanvasPluginDebug.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///D:/wamp/www/phaser/node_modules/eventemitter3/index.js","webpack:///D:/wamp/www/phaser/src/data/DataManager.js","webpack:///D:/wamp/www/phaser/src/data/events/CHANGE_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/REMOVE_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/SET_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/index.js","webpack:///D:/wamp/www/phaser/src/gameobjects/BuildGameObject.js","webpack:///D:/wamp/www/phaser/src/gameobjects/GameObject.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ComputedSize.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Depth.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Flip.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ScrollFactor.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ToJSON.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Transform.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/TransformMatrix.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Visible.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/index.js","webpack:///D:/wamp/www/phaser/src/loader/File.js","webpack:///D:/wamp/www/phaser/src/loader/FileTypesManager.js","webpack:///D:/wamp/www/phaser/src/loader/GetURL.js","webpack:///D:/wamp/www/phaser/src/loader/MergeXHRSettings.js","webpack:///D:/wamp/www/phaser/src/loader/MultiFile.js","webpack:///D:/wamp/www/phaser/src/loader/XHRLoader.js","webpack:///D:/wamp/www/phaser/src/loader/XHRSettings.js","webpack:///D:/wamp/www/phaser/src/loader/const.js","webpack:///D:/wamp/www/phaser/src/loader/events/ADD_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_LOAD_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_PROGRESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/POST_PROCESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/PROGRESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/START_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/index.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/ImageFile.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/JSONFile.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/TextFile.js","webpack:///D:/wamp/www/phaser/src/math/Average.js","webpack:///D:/wamp/www/phaser/src/math/Bernstein.js","webpack:///D:/wamp/www/phaser/src/math/Between.js","webpack:///D:/wamp/www/phaser/src/math/CatmullRom.js","webpack:///D:/wamp/www/phaser/src/math/CeilTo.js","webpack:///D:/wamp/www/phaser/src/math/Clamp.js","webpack:///D:/wamp/www/phaser/src/math/DegToRad.js","webpack:///D:/wamp/www/phaser/src/math/Difference.js","webpack:///D:/wamp/www/phaser/src/math/Factorial.js","webpack:///D:/wamp/www/phaser/src/math/FloatBetween.js","webpack:///D:/wamp/www/phaser/src/math/FloorTo.js","webpack:///D:/wamp/www/phaser/src/math/FromPercent.js","webpack:///D:/wamp/www/phaser/src/math/GetSpeed.js","webpack:///D:/wamp/www/phaser/src/math/IsEven.js","webpack:///D:/wamp/www/phaser/src/math/IsEvenStrict.js","webpack:///D:/wamp/www/phaser/src/math/Linear.js","webpack:///D:/wamp/www/phaser/src/math/Matrix3.js","webpack:///D:/wamp/www/phaser/src/math/Matrix4.js","webpack:///D:/wamp/www/phaser/src/math/MaxAdd.js","webpack:///D:/wamp/www/phaser/src/math/MinSub.js","webpack:///D:/wamp/www/phaser/src/math/Percent.js","webpack:///D:/wamp/www/phaser/src/math/Quaternion.js","webpack:///D:/wamp/www/phaser/src/math/RadToDeg.js","webpack:///D:/wamp/www/phaser/src/math/RandomXY.js","webpack:///D:/wamp/www/phaser/src/math/RandomXYZ.js","webpack:///D:/wamp/www/phaser/src/math/RandomXYZW.js","webpack:///D:/wamp/www/phaser/src/math/Rotate.js","webpack:///D:/wamp/www/phaser/src/math/RotateAround.js","webpack:///D:/wamp/www/phaser/src/math/RotateAroundDistance.js","webpack:///D:/wamp/www/phaser/src/math/RotateVec3.js","webpack:///D:/wamp/www/phaser/src/math/RoundAwayFromZero.js","webpack:///D:/wamp/www/phaser/src/math/RoundTo.js","webpack:///D:/wamp/www/phaser/src/math/SinCosTableGenerator.js","webpack:///D:/wamp/www/phaser/src/math/SmoothStep.js","webpack:///D:/wamp/www/phaser/src/math/SmootherStep.js","webpack:///D:/wamp/www/phaser/src/math/ToXY.js","webpack:///D:/wamp/www/phaser/src/math/TransformXY.js","webpack:///D:/wamp/www/phaser/src/math/Vector2.js","webpack:///D:/wamp/www/phaser/src/math/Vector3.js","webpack:///D:/wamp/www/phaser/src/math/Vector4.js","webpack:///D:/wamp/www/phaser/src/math/Within.js","webpack:///D:/wamp/www/phaser/src/math/Wrap.js","webpack:///D:/wamp/www/phaser/src/math/angle/Between.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenPoints.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenPointsY.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenY.js","webpack:///D:/wamp/www/phaser/src/math/angle/CounterClockwise.js","webpack:///D:/wamp/www/phaser/src/math/angle/Normalize.js","webpack:///D:/wamp/www/phaser/src/math/angle/Reverse.js","webpack:///D:/wamp/www/phaser/src/math/angle/RotateTo.js","webpack:///D:/wamp/www/phaser/src/math/angle/ShortestBetween.js","webpack:///D:/wamp/www/phaser/src/math/angle/Wrap.js","webpack:///D:/wamp/www/phaser/src/math/angle/WrapDegrees.js","webpack:///D:/wamp/www/phaser/src/math/angle/index.js","webpack:///D:/wamp/www/phaser/src/math/const.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceBetween.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistancePower.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceSquared.js","webpack:///D:/wamp/www/phaser/src/math/distance/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/linear/Linear.js","webpack:///D:/wamp/www/phaser/src/math/easing/linear/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/stepped/Stepped.js","webpack:///D:/wamp/www/phaser/src/math/easing/stepped/index.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Ceil.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Equal.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Floor.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/GreaterThan.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/LessThan.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/index.js","webpack:///D:/wamp/www/phaser/src/math/index.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/BezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/CatmullRomInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/CubicBezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/LinearInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/QuadraticBezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/SmoothStepInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/SmootherStepInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/index.js","webpack:///D:/wamp/www/phaser/src/math/pow2/GetPowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/IsSizePowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/IsValuePowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/index.js","webpack:///D:/wamp/www/phaser/src/math/random-data-generator/RandomDataGenerator.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapCeil.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapFloor.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapTo.js","webpack:///D:/wamp/www/phaser/src/math/snap/index.js","webpack:///D:/wamp/www/phaser/src/plugins/BasePlugin.js","webpack:///D:/wamp/www/phaser/src/plugins/ScenePlugin.js","webpack:///D:/wamp/www/phaser/src/renderer/BlendModes.js","webpack:///D:/wamp/www/phaser/src/renderer/ScaleModes.js","webpack:///D:/wamp/www/phaser/src/scale/events/RESIZE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/BOOT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/CREATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/PAUSE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/POST_UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/PRE_UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/READY_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/RENDER_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/RESUME_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/SHUTDOWN_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/SLEEP_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/START_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_INIT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_OUT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_START_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/WAKE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/index.js","webpack:///D:/wamp/www/phaser/src/utils/Class.js","webpack:///D:/wamp/www/phaser/src/utils/NOOP.js","webpack:///D:/wamp/www/phaser/src/utils/object/Extend.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetAdvancedValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetFastValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/IsPlainObject.js","webpack:///./SpineFile.js","webpack:///./SpinePlugin.js","webpack:///./events/COMPLETE_EVENT.js","webpack:///./events/DISPOSE_EVENT.js","webpack:///./events/END_EVENT.js","webpack:///./events/EVENT_EVENT.js","webpack:///./events/INTERRUPTED_EVENT.js","webpack:///./events/START_EVENT.js","webpack:///./events/index.js","webpack:///./gameobject/SpineGameObject.js","webpack:///./gameobject/SpineGameObjectCanvasRenderer.js","webpack:///./gameobject/SpineGameObjectRender.js","webpack:///./runtimes/spine-canvas.js"],"names":[],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yDAAyD,OAAO;AAChE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yCAAyC,SAAS;AAClD;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA,eAAe,YAAY;AAC3B;;AAEA;AACA,2DAA2D;AAC3D,+DAA+D;AAC/D,mEAAmE;AACnE,uEAAuE;AACvE;AACA,0DAA0D,SAAS;AACnE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,2DAA2D,YAAY;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI,IAA6B;AACjC;AACA;;;;;;;;;;;;AC/UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,aAAa,mBAAO,CAAC,mDAAU;;AAE/B;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,KAAK;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2DAA2D;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa;;AAEb;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,EAAE;AACjB,eAAe,KAAK;AACpB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,QAAQ;AACvB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA,sCAAsC,kBAAkB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1nBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,qBAAqB,mBAAO,CAAC,kFAAyB;AACtD,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,cAAc,mBAAO,CAAC,o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;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2DAA2D;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,mCAAmC;AAClD,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wCAAwC;AACxD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,sCAAsC,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1nBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9IA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACtFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC7JA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpGA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA,YAAY,wCAAwC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,oDAAkB;AAC3C,sBAAsB,mBAAO,CAAC,iFAAmB;AACjD,gBAAgB,mBAAO,CAAC,8DAAuB;AAC/C,uBAAuB,mBAAO,CAAC,4EAA8B;;AAE7D;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,kCAAkC,oCAAoC;AACtE,mCAAmC,sCAAsC;;AAEzE;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;;AAE3E;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;AAC3E,yCAAyC,sCAAsC;;AAE/E;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC/gBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,iBAAiB,mBAAO,CAAC,oDAAkB;AAC3C,cAAc,mBAAO,CAAC,wDAAoB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;;AAEvC;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,+CAA+C;AAC9D;AACA,gBAAgB,+CAA+C;AAC/D;AACA;AACA;AACA,kCAAkC,UAAU,cAAc;;AAE1D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,mCAAmC,wBAAwB;;AAE3D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACj8BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AClFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA,kBAAkB,UAAU,mBAAO,CAAC,yEAAiB;;;;;;;;;;;;ACVrD;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,YAAY,mBAAO,CAAC,6CAAS;AAC7B,aAAa,mBAAO,CAAC,qDAAU;AAC/B,mBAAmB,mBAAO,CAAC,+EAA8B;AACzD,aAAa,mBAAO,CAAC,+CAAU;AAC/B,uBAAuB,mBAAO,CAAC,mEAAoB;AACnD,gBAAgB,mBAAO,CAAC,qDAAa;AACrC,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,+BAA+B;AAC1C;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA,4GAA4G;AAC5G;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,2DAA2D;;AAE3D;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kBAAkB;;AAEnD;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iEAAiE;AACjE;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACthBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AClCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,mEAAwB;AAC7C,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,sCAAsC;AACjD;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,mEAAmE;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC3LA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,mEAAoB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,sCAAsC;AACjD;AACA,YAAY,eAAe;AAC3B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC7DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,qCAAqC,mBAAmB;AACxD,8BAA8B,cAAc;AAC5C,6BAA6B,WAAW;AACxC,iCAAiC,eAAe;AAChD,gCAAgC,aAAa;;AAE7C;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACjJA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,2BAA2B;AACtC,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,uDAAuD;AACjJ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,oFAAoF,mDAAmD;AACvI;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,uDAAuD;AAClE,WAAW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD,WAAW,+CAA+C;AAC1D;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uGAAuG;AAClH,WAAW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC3QA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,eAAe,mBAAO,CAAC,0EAA6B;AACpD,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,QAAQ;AACR,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC/NA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;ACxKA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,mDAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1kBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;;AAEA;;;;;;;;;;;;AC/6CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,4BAA4B,eAAe;;AAE3C;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,cAAc,mBAAO,CAAC,+CAAW;AACjC,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C;;AAE5C;;AAEA,gCAAgC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC7vBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,+BAA+B,YAAY;;AAE3C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC,2BAA2B;AAC3B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,qDAAiB;AACvC,cAAc,mBAAO,CAAC,qDAAiB;AACvC,iBAAiB,mBAAO,CAAC,2DAAoB;;AAE7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC7CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA,+BAA+B,YAAY;AAC3C,+BAA+B,YAAY;AAC3C,kCAAkC,eAAe;;AAEjD;;AAEA;AACA;;AAEA,mBAAmB,YAAY;AAC/B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,6BAA6B;AAC9E;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,oBAAoB;AAC/B;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,4BAA4B,qBAAqB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+CAA+C;AAC1D;AACA,YAAY,+CAA+C;AAC3D;AACA;AACA;AACA,+BAA+B,wBAAwB;;AAEvD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO;;AAEzC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,6BAA6B,YAAY;;AAEzC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;;;;;;;;;;;ACxnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;;;;;;;;;;;ACnyBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1hBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,2BAA2B;AACtC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA,2CAA2C,sCAAsC;AACjF;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,2BAA2B;AACtC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA,2CAA2C,gCAAgC;AAC3E;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,4CAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,yDAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,4CAAU;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,6BAA6B,aAAa;;AAE1C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;AC1CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,0CAAS;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,WAAW,mBAAO,CAAC,0CAAS;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA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ACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,4BAA4B,SAAS;;AAErC;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,aAAa,mBAAO,CAAC,wEAAmB;AACxC,WAAW,mBAAO,CAAC,oEAAiB;AACpC,aAAa,mBAAO,CAAC,wEAAmB;;AAExC;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,iDAAM;AACtB,SAAS,mBAAO,CAAC,mDAAO;AACxB,WAAW,mBAAO,CAAC,uDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,mDAAM;AACtB,SAAS,mBAAO,CAAC,qDAAO;AACxB,WAAW,mBAAO,CAAC,yDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,qDAAM;AACtB,SAAS,mBAAO,CAAC,uDAAO;AACxB,WAAW,mBAAO,CAAC,2DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,kDAAM;AACtB,SAAS,mBAAO,CAAC,oDAAO;AACxB,WAAW,mBAAO,CAAC,wDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;A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AAEA;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,2DAAU;;;;;;;;;;;;ACVnC;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,sDAAM;AACtB,SAAS,mBAAO,CAAC,wDAAO;AACxB,WAAW,mBAAO,CAAC,4DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,iDAAM;AACtB,SAAS,mBAAO,CAAC,mDAAO;AACxB,WAAW,mBAAO,CAAC,uDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,8DAAW;;;;;;;;;;;;ACVpC;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA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AE1B;AACA,aAAa,mBAAO,CAAC,+CAAW;AAChC,aAAa,mBAAO,CAAC,+CAAW;AAChC,aAAa,mBAAO,CAAC,+CAAW;AAChC,aAAa,mBAAO,CAAC,+CAAW;AAChC,aAAa,mBAAO,CAAC,+CAAW;AAChC,gBAAgB,mBAAO,CAAC,qDAAc;AACtC,gBAAgB,mBAAO,CAAC,qDAAc;;AAEtC;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;ACjFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,oDAAc;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,QAAQ;AAC3B;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sDAAe;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AClDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC/DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,8CAAW;;AAEhC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sDAAe;;AAExC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,0DAAiB;;AAE5C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,YAAY,mBAAO,CAAC,qFAAuB;AAC3C,gBAAgB,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B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,oEAAoE;;AAEpE;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;;AAEA;;AAEA,kDAAkD;AAClD,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,wCAAwC;AAC/D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA,wBAAwB,UAAU;AAClC;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;;AAEA,yBAAyB,OAAO;AAChC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC5eA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,UAAU,mBAAO,CAAC,sDAAY;AAC9B,WAAW,mBAAO,CAAC,wDAAa;AAChC,QAAQ,mBAAO,CAAC,kDAAU;;AAE1B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC9KA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,iBAAiB,mBAAO,CAAC,wDAAc;AACvC,YAAY,mBAAO,CAAC,mDAAgB;AACpC,kBAAkB,mBAAO,CAAC,2DAAiB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AClFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4EAA4E;AACvF;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,6CAA6C;AACpF;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvPA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,oBAAoB,mBAAO,CAAC,mEAAiB;;AAE7C,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,YAAY,OAAO;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5FA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,WAAW,mBAAO,CAAC,8CAAY;AAC/B,eAAe,mBAAO,CAAC,yDAAY;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,8CAA8C,aAAa,qBAAqB;AAChF;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE,oBAAoB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;;AAEA;;;;;;;;;;;;ACjDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,6DAA0B;AAC9C,mBAAmB,mBAAO,CAAC,yFAAwC;AACnE,gBAAgB,mBAAO,CAAC,8FAA4C;AACpE,oBAAoB,mBAAO,CAAC,2FAAyC;AACrE,eAAe,mBAAO,CAAC,4FAA2C;AAClE,gBAAgB,mBAAO,CAAC,0EAAkC;AAC1D,eAAe,mBAAO,CAAC,4FAA2C;;AAElE;AACA,aAAa,OAAO;AACpB;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,kBAAkB;AAChC,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,kBAAkB;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,iDAAiD;AAC5D,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,kBAAkB;AAC7B,WAAW,kBAAkB;AAC7B;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+BAA+B,oBAAoB;AACnD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B,qBAAqB;AACpD;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,2BAA2B,uBAAuB;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,sCAAsC,mEAAmE;;AAEzG;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACtPA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,sBAAsB,mBAAO,CAAC,6FAA0C;AACxE,YAAY,mBAAO,CAAC,6DAA0B;AAC9C,eAAe,mBAAO,CAAC,iFAAoC;AAC3D,kBAAkB,mBAAO,CAAC,yFAAwC;AAClE,kBAAkB,mBAAO,CAAC,6EAAkC;AAC5D,YAAY,mBAAO,CAAC,yCAAO;AAC3B,gBAAgB,mBAAO,CAAC,mCAAa;AACrC,sBAAsB,mBAAO,CAAC,qEAA8B;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qGAAqG;AACpH,eAAe,OAAO;AACtB,eAAe,gBAAgB;AAC/B,eAAe,QAAQ;AACvB,eAAe,sCAAsC;AACrD,eAAe,sCAAsC;AACrD;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,QAAQ;AACvB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA,mCAAmC,aAAa;;AAEhD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,eAAe;AAC9B,eAAe,WAAW;AAC1B;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACnmCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,cAAc,mBAAO,CAAC,oDAAkB;AACxC,aAAa,mB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ACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,kBAAkB;;AAEpD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,kCAAkC,6BAA6B;AAC/D,mCAAmC,+BAA+B;AAClE,oCAAoC,aAAa;AACjD,oCAAoC,aAAa;;AAEjD;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,oCAAoC,aAAa;AACjD,oCAAoC,aAAa;;AAEjD;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,2BAA2B;AAClD;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,oCAAoC;AAC/D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,uCAAuC,gBAAgB;;AAEvD;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,4CAA4C,yBAAyB;;AAErE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,YAAY;AAC/C,qCAAqC,cAAc;AACnD,qCAAqC,gBAAgB;;AAErD;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,8BAA8B;AAC9C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACnjDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,gGAA6C;AAC5E,eAAe,mBAAO,CAAC,oEAA+B;AACtD,WAAW,mBAAO,CAAC,4DAA2B;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5HA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,kBAAkB,mBAAO,CAAC,8DAA4B;AACtD,mBAAmB,mBAAO,CAAC,8DAA4B;;AAEvD,IAAI,KAAqB;AACzB,EAEC;;AAED,IAAI,IAAsB;AAC1B;AACA,mBAAmB,mBAAO,CAAC,sFAAiC;AAC5D;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;;AAEA;AACA;AACA,IAAI,gBAAgB,sCAAsC,iBAAiB,EAAE;AAC7E,mBAAmB,uDAAuD;AAC1E;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA,yBAAyB,UAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,WAAW;AAC1D;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,mDAAmD;AACrD;AACA;AACA;AACA;AACA,EAAE,+DAA+D;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,+DAA+D;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,OAAO;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,6CAA6C;AACtD;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,yBAAyB,EAAE;AAChF;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,sDAAsD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF;AACjF;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,+CAA+C,0BAA0B;AACzE;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,sDAAsD;AACxD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,kEAAkE;AACpE,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,eAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA,qCAAqC,iBAAiB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE,+DAA+D;AACjE;AACA;AACA;AACA;AACA;AACA,EAAE,4DAA4D;AAC9D;AACA;AACA;AACA;AACA;AACA,EAAE,yDAAyD;AAC3D,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,+BAA+B;AACjD;AACA;AACA;AACA;AACA,kBAAkB,sCAAsC;AACxD;AACA;AACA;AACA;AACA,kBAAkB,iCAAiC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA,kBAAkB,eAAe;AACjC;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,OAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,OAAO;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,sBAAsB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,OAAO;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2BAA2B;AAC9C;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,OAAO;AAClE;AACA;AACA;AACA,yBAAyB,kBAAkB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,kEAAkE;AACpE;AACA;AACA;AACA;AACA;AACA,EAAE,4DAA4D;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;AACtE,4DAA4D;AAC5D,+CAA+C;AAC/C;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,gBAAgB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,2CAA2C,+BAA+B;AAC1E;AACA;AACA;AACA;AACA,0BAA0B,WAAW;AACrC;AACA;AACA;AACA;AACA;AACA,yBAAyB,UAAU;AACnC;AACA;AACA;AACA;AACA;AACA,0BAA0B,WAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,WAAW;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,WAAW;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,WAAW;AACjD;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,WAAW;AAChE;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,qEAAqE;AACvE,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iBAAiB;AACjD,+CAA+C,8CAA8C,EAAE;AAC/F;AACA;AACA,GAAG;AACH;AACA,EAAE,6CAA6C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE,+DAA+D;AAC/D,kDAAkD;AAClD;AACA,GAAG;AACH;AACA,EAAE,6CAA6C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,6CAA6C;AAC/C,CAAC,sBAAsB;AACvB;;AAEA;AACA;AACA,CAAC,e","file":"SpineCanvasPluginDebug.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./SpinePlugin.js\");\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar Events = require('./events');\r\n\r\n/**\r\n * @callback DataEachCallback\r\n *\r\n * @param {*} parent - The parent object of the DataManager.\r\n * @param {string} key - The key of the value.\r\n * @param {*} value - The value.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin.\r\n * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter,\r\n * or have a property called `events` that is an instance of it.\r\n *\r\n * @class DataManager\r\n * @memberof Phaser.Data\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {object} parent - The object that this DataManager belongs to.\r\n * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter.\r\n */\r\nvar DataManager = new Class({\r\n\r\n initialize:\r\n\r\n function DataManager (parent, eventEmitter)\r\n {\r\n /**\r\n * The object that this DataManager belongs to.\r\n *\r\n * @name Phaser.Data.DataManager#parent\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.parent = parent;\r\n\r\n /**\r\n * The DataManager's event emitter.\r\n *\r\n * @name Phaser.Data.DataManager#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events = eventEmitter;\r\n\r\n if (!eventEmitter)\r\n {\r\n this.events = (parent.events) ? parent.events : parent;\r\n }\r\n\r\n /**\r\n * The data list.\r\n *\r\n * @name Phaser.Data.DataManager#list\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.0.0\r\n */\r\n this.list = {};\r\n\r\n /**\r\n * The public values list. You can use this to access anything you have stored\r\n * in this Data Manager. For example, if you set a value called `gold` you can\r\n * access it via:\r\n *\r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also modify it directly:\r\n * \r\n * ```javascript\r\n * this.data.values.gold += 1000;\r\n * ```\r\n *\r\n * Doing so will emit a `setdata` event from the parent of this Data Manager.\r\n * \r\n * Do not modify this object directly. Adding properties directly to this object will not\r\n * emit any events. Always use `DataManager.set` to create new items the first time around.\r\n *\r\n * @name Phaser.Data.DataManager#values\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.10.0\r\n */\r\n this.values = {};\r\n\r\n /**\r\n * Whether setting data is frozen for this DataManager.\r\n *\r\n * @name Phaser.Data.DataManager#_frozen\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._frozen = false;\r\n\r\n if (!parent.hasOwnProperty('sys') && this.events)\r\n {\r\n this.events.once('destroy', this.destroy, this);\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves the value for the given key, or undefined if it doesn't exist.\r\n *\r\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\r\n * \r\n * ```javascript\r\n * this.data.get('gold');\r\n * ```\r\n *\r\n * Or access the value directly:\r\n * \r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also pass in an array of keys, in which case an array of values will be returned:\r\n * \r\n * ```javascript\r\n * this.data.get([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * This approach is useful for destructuring arrays in ES6.\r\n *\r\n * @method Phaser.Data.DataManager#get\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\r\n *\r\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\r\n */\r\n get: function (key)\r\n {\r\n var list = this.list;\r\n\r\n if (Array.isArray(key))\r\n {\r\n var output = [];\r\n\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n output.push(list[key[i]]);\r\n }\r\n\r\n return output;\r\n }\r\n else\r\n {\r\n return list[key];\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves all data values in a new object.\r\n *\r\n * @method Phaser.Data.DataManager#getAll\r\n * @since 3.0.0\r\n *\r\n * @return {Object.} All data values.\r\n */\r\n getAll: function ()\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Queries the DataManager for the values of keys matching the given regular expression.\r\n *\r\n * @method Phaser.Data.DataManager#query\r\n * @since 3.0.0\r\n *\r\n * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj).\r\n *\r\n * @return {Object.} The values of the keys matching the search string.\r\n */\r\n query: function (search)\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key) && key.match(search))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created.\r\n * \r\n * ```javascript\r\n * data.set('name', 'Red Gem Stone');\r\n * ```\r\n *\r\n * You can also pass in an object of key value pairs as the first argument:\r\n *\r\n * ```javascript\r\n * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\r\n * ```\r\n *\r\n * To get a value back again you can call `get`:\r\n * \r\n * ```javascript\r\n * data.get('gold');\r\n * ```\r\n * \r\n * Or you can access the value directly via the `values` property, where it works like any other variable:\r\n * \r\n * ```javascript\r\n * data.values.gold += 50;\r\n * ```\r\n *\r\n * When the value is first set, a `setdata` event is emitted.\r\n *\r\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\r\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\r\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\r\n *\r\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#set\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n set: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (typeof key === 'string')\r\n {\r\n return this.setValue(key, data);\r\n }\r\n else\r\n {\r\n for (var entry in key)\r\n {\r\n this.setValue(entry, key[entry]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value setter, called automatically by the `set` method.\r\n *\r\n * @method Phaser.Data.DataManager#setValue\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @private\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n * @param {*} data - The value to set.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n setValue: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (this.has(key))\r\n {\r\n // Hit the key getter, which will in turn emit the events.\r\n this.values[key] = data;\r\n }\r\n else\r\n {\r\n var _this = this;\r\n var list = this.list;\r\n var events = this.events;\r\n var parent = this.parent;\r\n\r\n Object.defineProperty(this.values, key, {\r\n\r\n enumerable: true,\r\n \r\n configurable: true,\r\n\r\n get: function ()\r\n {\r\n return list[key];\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (!_this._frozen)\r\n {\r\n var previousValue = list[key];\r\n list[key] = value;\r\n\r\n events.emit(Events.CHANGE_DATA, parent, key, value, previousValue);\r\n events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue);\r\n }\r\n }\r\n\r\n });\r\n\r\n list[key] = data;\r\n\r\n events.emit(Events.SET_DATA, parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes all data entries to the given callback.\r\n *\r\n * @method Phaser.Data.DataManager#each\r\n * @since 3.0.0\r\n *\r\n * @param {DataEachCallback} callback - The function to call.\r\n * @param {*} [context] - Value to use as `this` when executing callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n each: function (callback, context)\r\n {\r\n var args = [ this.parent, null, undefined ];\r\n\r\n for (var i = 1; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (var key in this.list)\r\n {\r\n args[1] = key;\r\n args[2] = this.list[key];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Merge the given object of key value pairs into this DataManager.\r\n *\r\n * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument)\r\n * will emit a `changedata` event.\r\n *\r\n * @method Phaser.Data.DataManager#merge\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @param {Object.} data - The data to merge.\r\n * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n merge: function (data, overwrite)\r\n {\r\n if (overwrite === undefined) { overwrite = true; }\r\n\r\n // Merge data from another component into this one\r\n for (var key in data)\r\n {\r\n if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key))))\r\n {\r\n this.setValue(key, data[key]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Remove the value for the given key.\r\n *\r\n * If the key is found in this Data Manager it is removed from the internal lists and a\r\n * `removedata` event is emitted.\r\n * \r\n * You can also pass in an array of keys, in which case all keys in the array will be removed:\r\n * \r\n * ```javascript\r\n * this.data.remove([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * @method Phaser.Data.DataManager#remove\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key to remove, or an array of keys to remove.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n remove: function (key)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n this.removeValue(key[i]);\r\n }\r\n }\r\n else\r\n {\r\n return this.removeValue(key);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value remover, called automatically by the `remove` method.\r\n *\r\n * @method Phaser.Data.DataManager#removeValue\r\n * @private\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n removeValue: function (key)\r\n {\r\n if (this.has(key))\r\n {\r\n var data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it.\r\n *\r\n * @method Phaser.Data.DataManager#pop\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the value to retrieve and delete.\r\n *\r\n * @return {*} The value of the given key.\r\n */\r\n pop: function (key)\r\n {\r\n var data = undefined;\r\n\r\n if (!this._frozen && this.has(key))\r\n {\r\n data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return data;\r\n },\r\n\r\n /**\r\n * Determines whether the given key is set in this Data Manager.\r\n * \r\n * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#has\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key to check.\r\n *\r\n * @return {boolean} Returns `true` if the key exists, otherwise `false`.\r\n */\r\n has: function (key)\r\n {\r\n return this.list.hasOwnProperty(key);\r\n },\r\n\r\n /**\r\n * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts\r\n * to create new values or update existing ones.\r\n *\r\n * @method Phaser.Data.DataManager#setFreeze\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - Whether to freeze or unfreeze the Data Manager.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n setFreeze: function (value)\r\n {\r\n this._frozen = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Delete all data in this Data Manager and unfreeze it.\r\n *\r\n * @method Phaser.Data.DataManager#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n reset: function ()\r\n {\r\n for (var key in this.list)\r\n {\r\n delete this.list[key];\r\n delete this.values[key];\r\n }\r\n\r\n this._frozen = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Destroy this data manager.\r\n *\r\n * @method Phaser.Data.DataManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.reset();\r\n\r\n this.events.off(Events.CHANGE_DATA);\r\n this.events.off(Events.SET_DATA);\r\n this.events.off(Events.REMOVE_DATA);\r\n\r\n this.parent = null;\r\n },\r\n\r\n /**\r\n * Gets or sets the frozen state of this Data Manager.\r\n * A frozen Data Manager will block all attempts to create new values or update existing ones.\r\n *\r\n * @name Phaser.Data.DataManager#freeze\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n freeze: {\r\n\r\n get: function ()\r\n {\r\n return this._frozen;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._frozen = (value) ? true : false;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Return the total number of entries in this Data Manager.\r\n *\r\n * @name Phaser.Data.DataManager#count\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n count: {\r\n\r\n get: function ()\r\n {\r\n var i = 0;\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list[key] !== undefined)\r\n {\r\n i++;\r\n }\r\n }\r\n\r\n return i;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = DataManager;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`.\r\n * \r\n * This event is dispatched for all items that change in the Data Manager.\r\n * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} value - The new value of the item in the Data Manager.\r\n * @param {any} previousValue - The previous value of the item in the Data Manager.\r\n */\r\nmodule.exports = 'changedata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Key Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`,\r\n * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold`\r\n * then you can listen for `sprite.data.on('changedata-gold')`.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.16.1\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'changedata-';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Remove Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item is removed from it.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'removedata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Set Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when a new item is added to the data store.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#SET_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'setdata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Data.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CHANGE_DATA: require('./CHANGE_DATA_EVENT'),\r\n CHANGE_DATA_KEY: require('./CHANGE_DATA_KEY_EVENT'),\r\n REMOVE_DATA: require('./REMOVE_DATA_EVENT'),\r\n SET_DATA: require('./SET_DATA_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlendModes = require('../renderer/BlendModes');\r\nvar GetAdvancedValue = require('../utils/object/GetAdvancedValue');\r\nvar ScaleModes = require('../renderer/ScaleModes');\r\n\r\n/**\r\n * Builds a Game Object using the provided configuration object.\r\n *\r\n * @function Phaser.GameObjects.BuildGameObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject.\r\n * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The built Game Object.\r\n */\r\nvar BuildGameObject = function (scene, gameObject, config)\r\n{\r\n // Position\r\n\r\n gameObject.x = GetAdvancedValue(config, 'x', 0);\r\n gameObject.y = GetAdvancedValue(config, 'y', 0);\r\n gameObject.depth = GetAdvancedValue(config, 'depth', 0);\r\n\r\n // Flip\r\n\r\n gameObject.flipX = GetAdvancedValue(config, 'flipX', false);\r\n gameObject.flipY = GetAdvancedValue(config, 'flipY', false);\r\n\r\n // Scale\r\n // Either: { scale: 2 } or { scale: { x: 2, y: 2 }}\r\n\r\n var scale = GetAdvancedValue(config, 'scale', null);\r\n\r\n if (typeof scale === 'number')\r\n {\r\n gameObject.setScale(scale);\r\n }\r\n else if (scale !== null)\r\n {\r\n gameObject.scaleX = GetAdvancedValue(scale, 'x', 1);\r\n gameObject.scaleY = GetAdvancedValue(scale, 'y', 1);\r\n }\r\n\r\n // ScrollFactor\r\n // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }}\r\n\r\n var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null);\r\n\r\n if (typeof scrollFactor === 'number')\r\n {\r\n gameObject.setScrollFactor(scrollFactor);\r\n }\r\n else if (scrollFactor !== null)\r\n {\r\n gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1);\r\n gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1);\r\n }\r\n\r\n // Rotation\r\n\r\n gameObject.rotation = GetAdvancedValue(config, 'rotation', 0);\r\n\r\n var angle = GetAdvancedValue(config, 'angle', null);\r\n\r\n if (angle !== null)\r\n {\r\n gameObject.angle = angle;\r\n }\r\n\r\n // Alpha\r\n\r\n gameObject.alpha = GetAdvancedValue(config, 'alpha', 1);\r\n\r\n // Origin\r\n // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }}\r\n\r\n var origin = GetAdvancedValue(config, 'origin', null);\r\n\r\n if (typeof origin === 'number')\r\n {\r\n gameObject.setOrigin(origin);\r\n }\r\n else if (origin !== null)\r\n {\r\n var ox = GetAdvancedValue(origin, 'x', 0.5);\r\n var oy = GetAdvancedValue(origin, 'y', 0.5);\r\n\r\n gameObject.setOrigin(ox, oy);\r\n }\r\n\r\n // ScaleMode\r\n\r\n gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT);\r\n\r\n // BlendMode\r\n\r\n gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL);\r\n\r\n // Visible\r\n\r\n gameObject.visible = GetAdvancedValue(config, 'visible', true);\r\n\r\n // Add to Scene\r\n\r\n var add = GetAdvancedValue(config, 'add', true);\r\n\r\n if (add)\r\n {\r\n scene.sys.displayList.add(gameObject);\r\n }\r\n\r\n if (gameObject.preUpdate)\r\n {\r\n scene.sys.updateList.add(gameObject);\r\n }\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = BuildGameObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar ComponentsToJSON = require('./components/ToJSON');\r\nvar DataManager = require('../data/DataManager');\r\nvar EventEmitter = require('eventemitter3');\r\nvar Events = require('./events');\r\n\r\n/**\r\n * @classdesc\r\n * The base class that all Game Objects extend.\r\n * You don't create GameObjects directly and they cannot be added to the display list.\r\n * Instead, use them as the base for your own custom classes.\r\n *\r\n * @class GameObject\r\n * @memberof Phaser.GameObjects\r\n * @extends Phaser.Events.EventEmitter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs.\r\n * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`.\r\n */\r\nvar GameObject = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function GameObject (scene, type)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The Scene to which this Game Object belongs.\r\n * Game Objects can only belong to one Scene.\r\n *\r\n * @name Phaser.GameObjects.GameObject#scene\r\n * @type {Phaser.Scene}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A textual representation of this Game Object, i.e. `sprite`.\r\n * Used internally by Phaser but is available for your own custom classes to populate.\r\n *\r\n * @name Phaser.GameObjects.GameObject#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * The current state of this Game Object.\r\n * \r\n * Phaser itself will never modify this value, although plugins may do so.\r\n * \r\n * Use this property to track the state of a Game Object during its lifetime. For example, it could move from\r\n * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant\r\n * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons.\r\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\r\n *\r\n * @name Phaser.GameObjects.GameObject#state\r\n * @type {(integer|string)}\r\n * @since 3.16.0\r\n */\r\n this.state = 0;\r\n\r\n /**\r\n * The parent Container of this Game Object, if it has one.\r\n *\r\n * @name Phaser.GameObjects.GameObject#parentContainer\r\n * @type {Phaser.GameObjects.Container}\r\n * @since 3.4.0\r\n */\r\n this.parentContainer = null;\r\n\r\n /**\r\n * The name of this Game Object.\r\n * Empty by default and never populated by Phaser, this is left for developers to use.\r\n *\r\n * @name Phaser.GameObjects.GameObject#name\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.name = '';\r\n\r\n /**\r\n * The active state of this Game Object.\r\n * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it.\r\n * An active object is one which is having its logic and internal systems updated.\r\n *\r\n * @name Phaser.GameObjects.GameObject#active\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.active = true;\r\n\r\n /**\r\n * The Tab Index of the Game Object.\r\n * Reserved for future use by plugins and the Input Manager.\r\n *\r\n * @name Phaser.GameObjects.GameObject#tabIndex\r\n * @type {integer}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.tabIndex = -1;\r\n\r\n /**\r\n * A Data Manager.\r\n * It allows you to store, query and get key/value paired information specific to this Game Object.\r\n * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`.\r\n *\r\n * @name Phaser.GameObjects.GameObject#data\r\n * @type {Phaser.Data.DataManager}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.data = null;\r\n\r\n /**\r\n * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not.\r\n * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively.\r\n * If those components are not used by your custom class then you can use this bitmask as you wish.\r\n *\r\n * @name Phaser.GameObjects.GameObject#renderFlags\r\n * @type {integer}\r\n * @default 15\r\n * @since 3.0.0\r\n */\r\n this.renderFlags = 15;\r\n\r\n /**\r\n * A bitmask that controls if this Game Object is drawn by a Camera or not.\r\n * Not usually set directly, instead call `Camera.ignore`, however you can\r\n * set this property directly using the Camera.id property:\r\n *\r\n * @example\r\n * this.cameraFilter |= camera.id\r\n *\r\n * @name Phaser.GameObjects.GameObject#cameraFilter\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.cameraFilter = 0;\r\n\r\n /**\r\n * If this Game Object is enabled for input then this property will contain an InteractiveObject instance.\r\n * Not usually set directly. Instead call `GameObject.setInteractive()`.\r\n *\r\n * @name Phaser.GameObjects.GameObject#input\r\n * @type {?Phaser.Types.Input.InteractiveObject}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.input = null;\r\n\r\n /**\r\n * If this Game Object is enabled for physics then this property will contain a reference to a Physics Body.\r\n *\r\n * @name Phaser.GameObjects.GameObject#body\r\n * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.body = null;\r\n\r\n /**\r\n * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`.\r\n * This includes calls that may come from a Group, Container or the Scene itself.\r\n * While it allows you to persist a Game Object across Scenes, please understand you are entirely\r\n * responsible for managing references to and from this Game Object.\r\n *\r\n * @name Phaser.GameObjects.GameObject#ignoreDestroy\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.5.0\r\n */\r\n this.ignoreDestroy = false;\r\n\r\n // Tell the Scene to re-sort the children\r\n scene.sys.queueDepthSort();\r\n },\r\n\r\n /**\r\n * Sets the `active` property of this Game Object and returns this Game Object for further chaining.\r\n * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setActive\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - True if this Game Object should be set as active, false if not.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setActive: function (value)\r\n {\r\n this.active = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the `name` property of this Game Object and returns this Game Object for further chaining.\r\n * The `name` property is not populated by Phaser and is presented for your own use.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setName\r\n * @since 3.0.0\r\n *\r\n * @param {string} value - The name to be given to this Game Object.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setName: function (value)\r\n {\r\n this.name = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current state of this Game Object.\r\n * \r\n * Phaser itself will never modify the State of a Game Object, although plugins may do so.\r\n * \r\n * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'.\r\n * The state value should typically be an integer (ideally mapped to a constant\r\n * in your game code), but could also be a string. It is recommended to keep it light and simple.\r\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setState\r\n * @since 3.16.0\r\n *\r\n * @param {(integer|string)} value - The state of the Game Object.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setState: function (value)\r\n {\r\n this.state = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds a Data Manager component to this Game Object.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setDataEnabled\r\n * @since 3.0.0\r\n * @see Phaser.Data.DataManager\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setDataEnabled: function ()\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Allows you to store a key value pair within this Game Objects Data Manager.\r\n *\r\n * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled\r\n * before setting the value.\r\n *\r\n * If the key doesn't already exist in the Data Manager then it is created.\r\n *\r\n * ```javascript\r\n * sprite.setData('name', 'Red Gem Stone');\r\n * ```\r\n *\r\n * You can also pass in an object of key value pairs as the first argument:\r\n *\r\n * ```javascript\r\n * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\r\n * ```\r\n *\r\n * To get a value back again you can call `getData`:\r\n *\r\n * ```javascript\r\n * sprite.getData('gold');\r\n * ```\r\n *\r\n * Or you can access the value directly via the `values` property, where it works like any other variable:\r\n *\r\n * ```javascript\r\n * sprite.data.values.gold += 50;\r\n * ```\r\n *\r\n * When the value is first set, a `setdata` event is emitted from this Game Object.\r\n *\r\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\r\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\r\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\r\n *\r\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setData\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setData: function (key, value)\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n this.data.set(key, value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist.\r\n *\r\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\r\n *\r\n * ```javascript\r\n * sprite.getData('gold');\r\n * ```\r\n *\r\n * Or access the value directly:\r\n *\r\n * ```javascript\r\n * sprite.data.values.gold;\r\n * ```\r\n *\r\n * You can also pass in an array of keys, in which case an array of values will be returned:\r\n *\r\n * ```javascript\r\n * sprite.getData([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * This approach is useful for destructuring arrays in ES6.\r\n *\r\n * @method Phaser.GameObjects.GameObject#getData\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\r\n *\r\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\r\n */\r\n getData: function (key)\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n return this.data.get(key);\r\n },\r\n\r\n /**\r\n * Pass this Game Object to the Input Manager to enable it for Input.\r\n *\r\n * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area\r\n * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced\r\n * input detection.\r\n *\r\n * 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\r\n * 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\r\n * shape for it to use.\r\n *\r\n * You can also provide an Input Configuration Object as the only argument to this method.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setInteractive\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback.\r\n * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target?\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setInteractive: function (shape, callback, dropZone)\r\n {\r\n this.scene.sys.input.enable(this, shape, callback, dropZone);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Game Object has previously been enabled for input, this will disable it.\r\n *\r\n * An object that is disabled for input stops processing or being considered for\r\n * input events, but can be turned back on again at any time by simply calling\r\n * `setInteractive()` with no arguments provided.\r\n *\r\n * If want to completely remove interaction from this Game Object then use `removeInteractive` instead.\r\n *\r\n * @method Phaser.GameObjects.GameObject#disableInteractive\r\n * @since 3.7.0\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n disableInteractive: function ()\r\n {\r\n if (this.input)\r\n {\r\n this.input.enabled = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Game Object has previously been enabled for input, this will queue it\r\n * for removal, causing it to no longer be interactive. The removal happens on\r\n * the next game step, it is not immediate.\r\n *\r\n * The Interactive Object that was assigned to this Game Object will be destroyed,\r\n * removed from the Input Manager and cleared from this Game Object.\r\n *\r\n * If you wish to re-enable this Game Object at a later date you will need to\r\n * re-create its InteractiveObject by calling `setInteractive` again.\r\n *\r\n * If you wish to only temporarily stop an object from receiving input then use\r\n * `disableInteractive` instead, as that toggles the interactive state, where-as\r\n * this erases it completely.\r\n * \r\n * If you wish to resize a hit area, don't remove and then set it as being\r\n * interactive. Instead, access the hitarea object directly and resize the shape\r\n * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the\r\n * shape is a Rectangle, which it is by default.)\r\n *\r\n * @method Phaser.GameObjects.GameObject#removeInteractive\r\n * @since 3.7.0\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n removeInteractive: function ()\r\n {\r\n this.scene.sys.input.clear(this);\r\n\r\n this.input = undefined;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * To be overridden by custom GameObjects. Allows base objects to be used in a Pool.\r\n *\r\n * @method Phaser.GameObjects.GameObject#update\r\n * @since 3.0.0\r\n *\r\n * @param {...*} [args] - args\r\n */\r\n update: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Returns a JSON representation of the Game Object.\r\n *\r\n * @method Phaser.GameObjects.GameObject#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\n toJSON: function ()\r\n {\r\n return ComponentsToJSON(this);\r\n },\r\n\r\n /**\r\n * Compares the renderMask with the renderFlags to see if this Game Object will render or not.\r\n * Also checks the Game Object against the given Cameras exclusion list.\r\n *\r\n * @method Phaser.GameObjects.GameObject#willRender\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object.\r\n *\r\n * @return {boolean} True if the Game Object should be rendered, otherwise false.\r\n */\r\n willRender: function (camera)\r\n {\r\n return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)));\r\n },\r\n\r\n /**\r\n * Returns an array containing the display list index of either this Game Object, or if it has one,\r\n * its parent Container. It then iterates up through all of the parent containers until it hits the\r\n * root of the display list (which is index 0 in the returned array).\r\n *\r\n * Used internally by the InputPlugin but also useful if you wish to find out the display depth of\r\n * this Game Object and all of its ancestors.\r\n *\r\n * @method Phaser.GameObjects.GameObject#getIndexList\r\n * @since 3.4.0\r\n *\r\n * @return {integer[]} An array of display list position indexes.\r\n */\r\n getIndexList: function ()\r\n {\r\n // eslint-disable-next-line consistent-this\r\n var child = this;\r\n var parent = this.parentContainer;\r\n\r\n var indexes = [];\r\n\r\n while (parent)\r\n {\r\n // indexes.unshift([parent.getIndex(child), parent.name]);\r\n indexes.unshift(parent.getIndex(child));\r\n\r\n child = parent;\r\n\r\n if (!parent.parentContainer)\r\n {\r\n break;\r\n }\r\n else\r\n {\r\n parent = parent.parentContainer;\r\n }\r\n }\r\n\r\n // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']);\r\n indexes.unshift(this.scene.sys.displayList.getIndex(child));\r\n\r\n return indexes;\r\n },\r\n\r\n /**\r\n * Destroys this Game Object removing it from the Display List and Update List and\r\n * severing all ties to parent resources.\r\n *\r\n * Also removes itself from the Input Manager and Physics Manager if previously enabled.\r\n *\r\n * Use this to remove a Game Object from your game if you don't ever plan to use it again.\r\n * As long as no reference to it exists within your own code it should become free for\r\n * garbage collection by the browser.\r\n *\r\n * If you just want to temporarily disable an object then look at using the\r\n * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected.\r\n *\r\n * @method Phaser.GameObjects.GameObject#destroy\r\n * @fires Phaser.GameObjects.Events#DESTROY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [fromScene=false] - Is this Game Object being destroyed as the result of a Scene shutdown?\r\n */\r\n destroy: function (fromScene)\r\n {\r\n if (fromScene === undefined) { fromScene = false; }\r\n\r\n // This Game Object has already been destroyed\r\n if (!this.scene || this.ignoreDestroy)\r\n {\r\n return;\r\n }\r\n\r\n if (this.preDestroy)\r\n {\r\n this.preDestroy.call(this);\r\n }\r\n\r\n this.emit(Events.DESTROY, this);\r\n\r\n var sys = this.scene.sys;\r\n\r\n if (!fromScene)\r\n {\r\n sys.displayList.remove(this);\r\n sys.updateList.remove(this);\r\n }\r\n\r\n if (this.input)\r\n {\r\n sys.input.clear(this);\r\n this.input = undefined;\r\n }\r\n\r\n if (this.data)\r\n {\r\n this.data.destroy();\r\n\r\n this.data = undefined;\r\n }\r\n\r\n if (this.body)\r\n {\r\n this.body.destroy();\r\n this.body = undefined;\r\n }\r\n\r\n // Tell the Scene to re-sort the children\r\n if (!fromScene)\r\n {\r\n sys.queueDepthSort();\r\n }\r\n\r\n this.active = false;\r\n this.visible = false;\r\n\r\n this.scene = undefined;\r\n\r\n this.parentContainer = undefined;\r\n\r\n this.removeAllListeners();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not.\r\n *\r\n * @constant {integer} RENDER_MASK\r\n * @memberof Phaser.GameObjects.GameObject\r\n * @default\r\n */\r\nGameObject.RENDER_MASK = 15;\r\n\r\nmodule.exports = GameObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for calculating and setting the size of a non-Frame based Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.ComputedSize\r\n * @since 3.0.0\r\n */\r\n\r\nvar ComputedSize = {\r\n\r\n /**\r\n * The native (un-scaled) width of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayWidth` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n width: 0,\r\n\r\n /**\r\n * The native (un-scaled) height of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayHeight` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n height: 0,\r\n\r\n /**\r\n * The displayed width of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayWidth: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleX * this.width;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleX = value / this.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The displayed height of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayHeight: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleY * this.height;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleY = value / this.height;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the internal size of this Game Object, as used for frame or physics body creation.\r\n * \r\n * This will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\r\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\r\n * to do so by giving pixel values.\r\n * \r\n * If you have enabled this Game Object for input, changing the size will _not_ change the\r\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setSize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the display size of this Game Object.\r\n * \r\n * Calling this will adjust the scale.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDisplaySize: function (width, height)\r\n {\r\n this.displayWidth = width;\r\n this.displayHeight = height;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ComputedSize;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the depth of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Depth\r\n * @since 3.0.0\r\n */\r\n\r\nvar Depth = {\r\n\r\n /**\r\n * Private internal value. Holds the depth of the Game Object.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#_depth\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _depth: 0,\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#depth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n depth: {\r\n\r\n get: function ()\r\n {\r\n return this._depth;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scene.sys.queueDepthSort();\r\n this._depth = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @method Phaser.GameObjects.Components.Depth#setDepth\r\n * @since 3.0.0\r\n *\r\n * @param {integer} value - The depth of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDepth: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.depth = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Depth;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for visually flipping a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Flip\r\n * @since 3.0.0\r\n */\r\n\r\nvar Flip = {\r\n\r\n /**\r\n * The horizontally flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipX\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipX: false,\r\n\r\n /**\r\n * The vertically flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down)\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipY\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipY: false,\r\n\r\n /**\r\n * Toggles the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipX\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipX: function ()\r\n {\r\n this.flipX = !this.flipX;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Toggles the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipY\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipY: function ()\r\n {\r\n this.flipY = !this.flipY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipX\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipX: function (value)\r\n {\r\n this.flipX = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipY: function (value)\r\n {\r\n this.flipY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal and vertical flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped will render inversed on the flipped axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlip\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlip: function (x, y)\r\n {\r\n this.flipX = x;\r\n this.flipY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#resetFlip\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n resetFlip: function ()\r\n {\r\n this.flipX = false;\r\n this.flipY = false;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Flip;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the Scroll Factor of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.ScrollFactor\r\n * @since 3.0.0\r\n */\r\n\r\nvar ScrollFactor = {\r\n\r\n /**\r\n * The horizontal scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorX: 1,\r\n\r\n /**\r\n * The vertical scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorY: 1,\r\n\r\n /**\r\n * Sets the scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scroll factor of this Game Object.\r\n * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScrollFactor: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.scrollFactorX = x;\r\n this.scrollFactorY = y;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ScrollFactor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Build a JSON representation of the given Game Object.\r\n *\r\n * This is typically extended further by Game Object specific implementations.\r\n *\r\n * @method Phaser.GameObjects.Components.ToJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON.\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\nvar ToJSON = function (gameObject)\r\n{\r\n var out = {\r\n name: gameObject.name,\r\n type: gameObject.type,\r\n x: gameObject.x,\r\n y: gameObject.y,\r\n depth: gameObject.depth,\r\n scale: {\r\n x: gameObject.scaleX,\r\n y: gameObject.scaleY\r\n },\r\n origin: {\r\n x: gameObject.originX,\r\n y: gameObject.originY\r\n },\r\n flipX: gameObject.flipX,\r\n flipY: gameObject.flipY,\r\n rotation: gameObject.rotation,\r\n alpha: gameObject.alpha,\r\n visible: gameObject.visible,\r\n scaleMode: gameObject.scaleMode,\r\n blendMode: gameObject.blendMode,\r\n textureKey: '',\r\n frameKey: '',\r\n data: {}\r\n };\r\n\r\n if (gameObject.texture)\r\n {\r\n out.textureKey = gameObject.texture.key;\r\n out.frameKey = gameObject.frame.name;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ToJSON;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = require('../../math/const');\r\nvar TransformMatrix = require('./TransformMatrix');\r\nvar WrapAngle = require('../../math/angle/Wrap');\r\nvar WrapAngleDegrees = require('../../math/angle/WrapDegrees');\r\n\r\n// global bitmask flag for GameObject.renderMask (used by Scale)\r\nvar _FLAG = 4; // 0100\r\n\r\n/**\r\n * Provides methods used for getting and setting the position, scale and rotation of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Transform\r\n * @since 3.0.0\r\n */\r\n\r\nvar Transform = {\r\n\r\n /**\r\n * Private internal value. Holds the horizontal scale value.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_scaleX\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _scaleX: 1,\r\n\r\n /**\r\n * Private internal value. Holds the vertical scale value.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_scaleY\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _scaleY: 1,\r\n\r\n /**\r\n * Private internal value. Holds the rotation value in radians.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_rotation\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _rotation: 0,\r\n\r\n /**\r\n * The x position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n x: 0,\r\n\r\n /**\r\n * The y position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n y: 0,\r\n\r\n /**\r\n * The z position of this Game Object.\r\n * Note: Do not use this value to set the z-index, instead see the `depth` property.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n z: 0,\r\n\r\n /**\r\n * The w position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n w: 0,\r\n\r\n /**\r\n * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object\r\n * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`.\r\n * \r\n * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this\r\n * isn't the case, use the `scaleX` or `scaleY` properties instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.18.0\r\n */\r\n scale: {\r\n\r\n get: function ()\r\n {\r\n return (this._scaleX + this._scaleY) / 2;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n this._scaleY = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The horizontal scale of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scaleX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scaleY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleY = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The angle of this Game Object as expressed in degrees.\r\n * \r\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left\r\n * and -90 is up.\r\n *\r\n * If you prefer to work in radians, see the `rotation` property instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#angle\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n angle: {\r\n\r\n get: function ()\r\n {\r\n return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG);\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in degrees\r\n this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD;\r\n }\r\n },\r\n\r\n /**\r\n * The angle of this Game Object in radians.\r\n * \r\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left\r\n * and -90 is up.\r\n *\r\n * If you prefer to work in degrees, see the `angle` property instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#rotation\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return this._rotation;\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in radians\r\n this._rotation = WrapAngle(value);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x position of this Game Object.\r\n * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value.\r\n * @param {number} [z=0] - The z position of this Game Object.\r\n * @param {number} [w=0] - The w position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setPosition: function (x, y, z, w)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n if (z === undefined) { z = 0; }\r\n if (w === undefined) { w = 0; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n this.w = w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the position of this Game Object to be a random position within the confines of\r\n * the given area.\r\n * \r\n * If no area is specified a random position between 0 x 0 and the game width x height is used instead.\r\n *\r\n * The position does not factor in the size of this Game Object, meaning that only the origin is\r\n * guaranteed to be within the area.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setRandomPosition\r\n * @since 3.8.0\r\n *\r\n * @param {number} [x=0] - The x position of the top-left of the random area.\r\n * @param {number} [y=0] - The y position of the top-left of the random area.\r\n * @param {number} [width] - The width of the random area.\r\n * @param {number} [height] - The height of the random area.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setRandomPosition: function (x, y, width, height)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.scene.sys.scale.width; }\r\n if (height === undefined) { height = this.scene.sys.scale.height; }\r\n\r\n this.x = x + (Math.random() * width);\r\n this.y = y + (Math.random() * height);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the rotation of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setRotation\r\n * @since 3.0.0\r\n *\r\n * @param {number} [radians=0] - The rotation of this Game Object, in radians.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setRotation: function (radians)\r\n {\r\n if (radians === undefined) { radians = 0; }\r\n\r\n this.rotation = radians;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the angle of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setAngle\r\n * @since 3.0.0\r\n *\r\n * @param {number} [degrees=0] - The rotation of this Game Object, in degrees.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAngle: function (degrees)\r\n {\r\n if (degrees === undefined) { degrees = 0; }\r\n\r\n this.angle = degrees;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scale of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale of this Game Object.\r\n * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScale: function (x, y)\r\n {\r\n if (x === undefined) { x = 1; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.scaleX = x;\r\n this.scaleY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the x position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setX\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The x position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setX: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the y position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setY\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The y position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setY: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the z position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The z position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setZ: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.z = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the w position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setW\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The w position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setW: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.w = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the local transform matrix for this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\r\n */\r\n getLocalTransformMatrix: function (tempMatrix)\r\n {\r\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\r\n\r\n return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\r\n },\r\n\r\n /**\r\n * Gets the world transform matrix for this Game Object, factoring in any parent Containers.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\r\n */\r\n getWorldTransformMatrix: function (tempMatrix, parentMatrix)\r\n {\r\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\r\n if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); }\r\n\r\n var parent = this.parentContainer;\r\n\r\n if (!parent)\r\n {\r\n return this.getLocalTransformMatrix(tempMatrix);\r\n }\r\n\r\n tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\r\n\r\n while (parent)\r\n {\r\n parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY);\r\n\r\n parentMatrix.multiply(tempMatrix, tempMatrix);\r\n\r\n parent = parent.parentContainer;\r\n }\r\n\r\n return tempMatrix;\r\n },\r\n\r\n /**\r\n * Gets the sum total rotation of all of this Game Objects parent Containers.\r\n * \r\n * The returned value is in radians and will be zero if this Game Object has no parent container.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getParentRotation\r\n * @since 3.18.0\r\n *\r\n * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object.\r\n */\r\n getParentRotation: function ()\r\n {\r\n var rotation = 0;\r\n\r\n var parent = this.parentContainer;\r\n\r\n while (parent)\r\n {\r\n rotation += parent.rotation;\r\n\r\n parent = parent.parentContainer;\r\n }\r\n\r\n return rotation;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Transform;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar MATH_CONST = require('../../math/const');\r\nvar Vector2 = require('../../math/Vector2');\r\n\r\n/**\r\n * @classdesc\r\n * A Matrix used for display transformations for rendering.\r\n *\r\n * It is represented like so:\r\n *\r\n * ```\r\n * | a | c | tx |\r\n * | b | d | ty |\r\n * | 0 | 0 | 1 |\r\n * ```\r\n *\r\n * @class TransformMatrix\r\n * @memberof Phaser.GameObjects.Components\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [a=1] - The Scale X value.\r\n * @param {number} [b=0] - The Skew Y value.\r\n * @param {number} [c=0] - The Skew X value.\r\n * @param {number} [d=1] - The Scale Y value.\r\n * @param {number} [tx=0] - The Translate X value.\r\n * @param {number} [ty=0] - The Translate Y value.\r\n */\r\nvar TransformMatrix = new Class({\r\n\r\n initialize:\r\n\r\n function TransformMatrix (a, b, c, d, tx, ty)\r\n {\r\n if (a === undefined) { a = 1; }\r\n if (b === undefined) { b = 0; }\r\n if (c === undefined) { c = 0; }\r\n if (d === undefined) { d = 1; }\r\n if (tx === undefined) { tx = 0; }\r\n if (ty === undefined) { ty = 0; }\r\n\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#matrix\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]);\r\n\r\n /**\r\n * The decomposed matrix.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.decomposedMatrix = {\r\n translateX: 0,\r\n translateY: 0,\r\n scaleX: 1,\r\n scaleY: 1,\r\n rotation: 0\r\n };\r\n },\r\n\r\n /**\r\n * The Scale X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#a\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n a: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[0];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[0] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Skew Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#b\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n b: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[1];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[1] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Skew X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#c\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n c: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[2];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[2] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Scale Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#d\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n d: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[3];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[3] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#e\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n e: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#f\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n f: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#tx\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n tx: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#ty\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n ty: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Matrix. Value is in radians.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#rotation\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Matrix, normalized to be within the Phaser right-handed\r\n * clockwise rotation space. Value is in radians.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized\r\n * @type {number}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n rotationNormalized: {\r\n\r\n get: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n if (a || b)\r\n {\r\n // var r = Math.sqrt(a * a + b * b);\r\n \r\n return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX);\r\n }\r\n else if (c || d)\r\n {\r\n // var s = Math.sqrt(c * c + d * d);\r\n \r\n return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY));\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The decomposed horizontal scale of the Matrix. This value is always positive.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleX\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.a * this.a) + (this.b * this.b));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The decomposed vertical scale of the Matrix. This value is always positive.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleY\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.c * this.c) + (this.d * this.d));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Reset the Matrix to an identity matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n loadIdentity: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = 1;\r\n matrix[1] = 0;\r\n matrix[2] = 0;\r\n matrix[3] = 1;\r\n matrix[4] = 0;\r\n matrix[5] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#translate\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation value.\r\n * @param {number} y - The vertical translation value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n translate: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4];\r\n matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale value.\r\n * @param {number} y - The vertical scale value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n scale: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] *= x;\r\n matrix[1] *= x;\r\n matrix[2] *= y;\r\n matrix[3] *= y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n rotate: function (angle)\r\n {\r\n var sin = Math.sin(angle);\r\n var cos = Math.cos(angle);\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n matrix[0] = a * cos + c * sin;\r\n matrix[1] = b * cos + d * sin;\r\n matrix[2] = a * -sin + c * cos;\r\n matrix[3] = b * -sin + d * cos;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n * \r\n * If an `out` Matrix is given then the results will be stored in it.\r\n * If it is not given, this matrix will be updated in place instead.\r\n * Use an `out` Matrix if you do not wish to mutate this matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} Either this TransformMatrix, or the `out` Matrix, if given in the arguments.\r\n */\r\n multiply: function (rhs, out)\r\n {\r\n var matrix = this.matrix;\r\n var source = rhs.matrix;\r\n\r\n var localA = matrix[0];\r\n var localB = matrix[1];\r\n var localC = matrix[2];\r\n var localD = matrix[3];\r\n var localE = matrix[4];\r\n var localF = matrix[5];\r\n\r\n var sourceA = source[0];\r\n var sourceB = source[1];\r\n var sourceC = source[2];\r\n var sourceD = source[3];\r\n var sourceE = source[4];\r\n var sourceF = source[5];\r\n\r\n var destinationMatrix = (out === undefined) ? this : out;\r\n\r\n destinationMatrix.a = (sourceA * localA) + (sourceB * localC);\r\n destinationMatrix.b = (sourceA * localB) + (sourceB * localD);\r\n destinationMatrix.c = (sourceC * localA) + (sourceD * localC);\r\n destinationMatrix.d = (sourceC * localB) + (sourceD * localD);\r\n destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE;\r\n destinationMatrix.f = (sourceE * localB) + (sourceF * localD) + localF;\r\n\r\n return destinationMatrix;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the matrix given, including the offset.\r\n * \r\n * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`.\r\n * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n * @param {number} offsetX - Horizontal offset to factor in to the multiplication.\r\n * @param {number} offsetY - Vertical offset to factor in to the multiplication.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n multiplyWithOffset: function (src, offsetX, offsetY)\r\n {\r\n var matrix = this.matrix;\r\n var otherMatrix = src.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n var pse = offsetX * a0 + offsetY * c0 + tx0;\r\n var psf = offsetX * b0 + offsetY * d0 + ty0;\r\n\r\n var a1 = otherMatrix[0];\r\n var b1 = otherMatrix[1];\r\n var c1 = otherMatrix[2];\r\n var d1 = otherMatrix[3];\r\n var tx1 = otherMatrix[4];\r\n var ty1 = otherMatrix[5];\r\n\r\n matrix[0] = a1 * a0 + b1 * c0;\r\n matrix[1] = a1 * b0 + b1 * d0;\r\n matrix[2] = c1 * a0 + d1 * c0;\r\n matrix[3] = c1 * b0 + d1 * d0;\r\n matrix[4] = tx1 * a0 + ty1 * c0 + pse;\r\n matrix[5] = tx1 * b0 + ty1 * d0 + psf;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n transform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n matrix[0] = a * a0 + b * c0;\r\n matrix[1] = a * b0 + b * d0;\r\n matrix[2] = c * a0 + d * c0;\r\n matrix[3] = c * b0 + d * d0;\r\n matrix[4] = tx * a0 + ty * c0 + tx0;\r\n matrix[5] = tx * b0 + ty * d0 + ty0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform a point using this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the point to transform.\r\n * @param {number} y - The y coordinate of the point to transform.\r\n * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates.\r\n *\r\n * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates.\r\n */\r\n transformPoint: function (x, y, point)\r\n {\r\n if (point === undefined) { point = { x: 0, y: 0 }; }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n point.x = x * a + y * c + tx;\r\n point.y = x * b + y * d + ty;\r\n\r\n return point;\r\n },\r\n\r\n /**\r\n * Invert the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#invert\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n invert: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var n = a * d - b * c;\r\n\r\n matrix[0] = d / n;\r\n matrix[1] = -b / n;\r\n matrix[2] = -c / n;\r\n matrix[3] = a / n;\r\n matrix[4] = (c * ty - d * tx) / n;\r\n matrix[5] = -(a * ty - b * tx) / n;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the matrix given.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFrom: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src.a;\r\n matrix[1] = src.b;\r\n matrix[2] = src.c;\r\n matrix[3] = src.d;\r\n matrix[4] = src.e;\r\n matrix[5] = src.f;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the array given.\r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray\r\n * @since 3.11.0\r\n *\r\n * @param {array} src - The array of values to set into this matrix.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFromArray: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src[0];\r\n matrix[1] = src[1];\r\n matrix[2] = src[2];\r\n matrix[3] = src[3];\r\n matrix[4] = src[4];\r\n matrix[5] = src[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.transform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n copyToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.setTransform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n setToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values in this Matrix to the array given.\r\n * \r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray\r\n * @since 3.12.0\r\n *\r\n * @param {array} [out] - The array to copy the matrix values in to.\r\n *\r\n * @return {array} An array where elements 0 to 5 contain the values from this matrix.\r\n */\r\n copyToArray: function (out)\r\n {\r\n var matrix = this.matrix;\r\n\r\n if (out === undefined)\r\n {\r\n out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ];\r\n }\r\n else\r\n {\r\n out[0] = matrix[0];\r\n out[1] = matrix[1];\r\n out[2] = matrix[2];\r\n out[3] = matrix[3];\r\n out[4] = matrix[4];\r\n out[5] = matrix[5];\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setTransform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n setTransform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = a;\r\n matrix[1] = b;\r\n matrix[2] = c;\r\n matrix[3] = d;\r\n matrix[4] = tx;\r\n matrix[5] = ty;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Decompose this Matrix into its translation, scale and rotation values using QR decomposition.\r\n * \r\n * The result must be applied in the following order to reproduce the current matrix:\r\n * \r\n * translate -> rotate -> scale\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix\r\n * @since 3.0.0\r\n *\r\n * @return {object} The decomposed Matrix.\r\n */\r\n decomposeMatrix: function ()\r\n {\r\n var decomposedMatrix = this.decomposedMatrix;\r\n\r\n var matrix = this.matrix;\r\n\r\n // a = scale X (1)\r\n // b = shear Y (0)\r\n // c = shear X (0)\r\n // d = scale Y (1)\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n var determ = a * d - b * c;\r\n\r\n decomposedMatrix.translateX = matrix[4];\r\n decomposedMatrix.translateY = matrix[5];\r\n\r\n if (a || b)\r\n {\r\n var r = Math.sqrt(a * a + b * b);\r\n\r\n decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r);\r\n decomposedMatrix.scaleX = r;\r\n decomposedMatrix.scaleY = determ / r;\r\n }\r\n else if (c || d)\r\n {\r\n var s = Math.sqrt(c * c + d * d);\r\n\r\n decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s));\r\n decomposedMatrix.scaleX = determ / s;\r\n decomposedMatrix.scaleY = s;\r\n }\r\n else\r\n {\r\n decomposedMatrix.rotation = 0;\r\n decomposedMatrix.scaleX = 0;\r\n decomposedMatrix.scaleY = 0;\r\n }\r\n\r\n return decomposedMatrix;\r\n },\r\n\r\n /**\r\n * Apply the identity, translate, rotate and scale operations on the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation.\r\n * @param {number} y - The vertical translation.\r\n * @param {number} rotation - The angle of rotation in radians.\r\n * @param {number} scaleX - The horizontal scale.\r\n * @param {number} scaleY - The vertical scale.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n applyITRS: function (x, y, rotation, scaleX, scaleY)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var radianSin = Math.sin(rotation);\r\n var radianCos = Math.cos(rotation);\r\n\r\n // Translate\r\n matrix[4] = x;\r\n matrix[5] = y;\r\n\r\n // Rotate and Scale\r\n matrix[0] = radianCos * scaleX;\r\n matrix[1] = radianSin * scaleX;\r\n matrix[2] = -radianSin * scaleY;\r\n matrix[3] = radianCos * scaleY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of\r\n * the current matrix with its transformation applied.\r\n * \r\n * Can be used to translate points from world to local space.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse\r\n * @since 3.12.0\r\n *\r\n * @param {number} x - The x position to translate.\r\n * @param {number} y - The y position to translate.\r\n * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix.\r\n */\r\n applyInverse: function (x, y, output)\r\n {\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var id = 1 / ((a * d) + (c * -b));\r\n\r\n output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id);\r\n output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id);\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the X component of this matrix multiplied by the given values.\r\n * This is the same as `x * a + y * c + e`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getX\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated x value.\r\n */\r\n getX: function (x, y)\r\n {\r\n return x * this.a + y * this.c + this.e;\r\n },\r\n\r\n /**\r\n * Returns the Y component of this matrix multiplied by the given values.\r\n * This is the same as `x * b + y * d + f`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getY\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated y value.\r\n */\r\n getY: function (x, y)\r\n {\r\n return x * this.b + y * this.d + this.f;\r\n },\r\n\r\n /**\r\n * Returns a string that can be used in a CSS Transform call as a `matrix` property.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix\r\n * @since 3.12.0\r\n *\r\n * @return {string} A string containing the CSS Transform matrix values.\r\n */\r\n getCSSMatrix: function ()\r\n {\r\n var m = this.matrix;\r\n\r\n return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')';\r\n },\r\n\r\n /**\r\n * Destroys this Transform Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#destroy\r\n * @since 3.4.0\r\n */\r\n destroy: function ()\r\n {\r\n this.matrix = null;\r\n this.decomposedMatrix = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TransformMatrix;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 1; // 0001\r\n\r\n/**\r\n * Provides methods used for setting the visibility of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Visible\r\n * @since 3.0.0\r\n */\r\n\r\nvar Visible = {\r\n\r\n /**\r\n * Private internal value. Holds the visible value.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#_visible\r\n * @type {boolean}\r\n * @private\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n _visible: true,\r\n\r\n /**\r\n * The visible state of the Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#visible\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n visible: {\r\n\r\n get: function ()\r\n {\r\n return this._visible;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value)\r\n {\r\n this._visible = true;\r\n this.renderFlags |= _FLAG;\r\n }\r\n else\r\n {\r\n this._visible = false;\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the visibility of this Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n *\r\n * @method Phaser.GameObjects.Components.Visible#setVisible\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The visible state of the Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setVisible: function (value)\r\n {\r\n this.visible = value;\r\n\r\n return this;\r\n }\r\n};\r\n\r\nmodule.exports = Visible;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Destroy Event.\r\n * \r\n * This event is dispatched when a Game Object instance is being destroyed.\r\n * \r\n * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed.\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.GameObjects.Events\r\n */\r\n\r\nmodule.exports = { DESTROY: require('./DESTROY_EVENT') };\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar CONST = require('./const');\r\nvar Events = require('./events');\r\nvar GetFastValue = require('../utils/object/GetFastValue');\r\nvar GetURL = require('./GetURL');\r\nvar MergeXHRSettings = require('./MergeXHRSettings');\r\nvar XHRLoader = require('./XHRLoader');\r\nvar XHRSettings = require('./XHRSettings');\r\n\r\n/**\r\n * @classdesc\r\n * The base File class used by all File Types that the Loader can support.\r\n * 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.\r\n *\r\n * @class File\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\r\n * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type.\r\n */\r\nvar File = new Class({\r\n\r\n initialize:\r\n\r\n function File (loader, fileConfig)\r\n {\r\n /**\r\n * A reference to the Loader that is going to load this file.\r\n *\r\n * @name Phaser.Loader.File#loader\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.0.0\r\n */\r\n this.loader = loader;\r\n\r\n /**\r\n * A reference to the Cache, or Texture Manager, that is going to store this file if it loads.\r\n *\r\n * @name Phaser.Loader.File#cache\r\n * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)}\r\n * @since 3.7.0\r\n */\r\n this.cache = GetFastValue(fileConfig, 'cache', false);\r\n\r\n /**\r\n * The file type string (image, json, etc) for sorting within the Loader.\r\n *\r\n * @name Phaser.Loader.File#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = GetFastValue(fileConfig, 'type', false);\r\n\r\n /**\r\n * Unique cache key (unique within its file type)\r\n *\r\n * @name Phaser.Loader.File#key\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.key = GetFastValue(fileConfig, 'key', false);\r\n\r\n var loadKey = this.key;\r\n\r\n if (loader.prefix && loader.prefix !== '')\r\n {\r\n this.key = loader.prefix + loadKey;\r\n }\r\n\r\n if (!this.type || !this.key)\r\n {\r\n throw new Error('Error calling \\'Loader.' + this.type + '\\' invalid key provided.');\r\n }\r\n\r\n /**\r\n * The URL of the file, not including baseURL.\r\n * Automatically has Loader.path prepended to it.\r\n *\r\n * @name Phaser.Loader.File#url\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.url = GetFastValue(fileConfig, 'url');\r\n\r\n if (this.url === undefined)\r\n {\r\n this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', '');\r\n }\r\n else if (typeof(this.url) !== 'function')\r\n {\r\n this.url = loader.path + this.url;\r\n }\r\n\r\n /**\r\n * The final URL this file will load from, including baseURL and path.\r\n * Set automatically when the Loader calls 'load' on this file.\r\n *\r\n * @name Phaser.Loader.File#src\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.src = '';\r\n\r\n /**\r\n * The merged XHRSettings for this file.\r\n *\r\n * @name Phaser.Loader.File#xhrSettings\r\n * @type {Phaser.Types.Loader.XHRSettingsObject}\r\n * @since 3.0.0\r\n */\r\n this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined));\r\n\r\n if (GetFastValue(fileConfig, 'xhrSettings', false))\r\n {\r\n this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {}));\r\n }\r\n\r\n /**\r\n * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File.\r\n *\r\n * @name Phaser.Loader.File#xhrLoader\r\n * @type {?XMLHttpRequest}\r\n * @since 3.0.0\r\n */\r\n this.xhrLoader = null;\r\n\r\n /**\r\n * The current state of the file. One of the FILE_CONST values.\r\n *\r\n * @name Phaser.Loader.File#state\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING;\r\n\r\n /**\r\n * The total size of this file.\r\n * Set by onProgress and only if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#bytesTotal\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.bytesTotal = 0;\r\n\r\n /**\r\n * Updated as the file loads.\r\n * Only set if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#bytesLoaded\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.bytesLoaded = -1;\r\n\r\n /**\r\n * A percentage value between 0 and 1 indicating how much of this file has loaded.\r\n * Only set if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#percentComplete\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.percentComplete = -1;\r\n\r\n /**\r\n * For CORs based loading.\r\n * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set)\r\n *\r\n * @name Phaser.Loader.File#crossOrigin\r\n * @type {(string|undefined)}\r\n * @since 3.0.0\r\n */\r\n this.crossOrigin = undefined;\r\n\r\n /**\r\n * The processed file data, stored here after the file has loaded.\r\n *\r\n * @name Phaser.Loader.File#data\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.data = undefined;\r\n\r\n /**\r\n * A config object that can be used by file types to store transitional data.\r\n *\r\n * @name Phaser.Loader.File#config\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.config = GetFastValue(fileConfig, 'config', {});\r\n\r\n /**\r\n * If this is a multipart file, i.e. an atlas and its json together, then this is a reference\r\n * to the parent MultiFile. Set and used internally by the Loader or specific file types.\r\n *\r\n * @name Phaser.Loader.File#multiFile\r\n * @type {?Phaser.Loader.MultiFile}\r\n * @since 3.7.0\r\n */\r\n this.multiFile;\r\n\r\n /**\r\n * Does this file have an associated linked file? Such as an image and a normal map.\r\n * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't\r\n * actually bound by data, where-as a linkFile is.\r\n *\r\n * @name Phaser.Loader.File#linkFile\r\n * @type {?Phaser.Loader.File}\r\n * @since 3.7.0\r\n */\r\n this.linkFile;\r\n },\r\n\r\n /**\r\n * Links this File with another, so they depend upon each other for loading and processing.\r\n *\r\n * @method Phaser.Loader.File#setLink\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} fileB - The file to link to this one.\r\n */\r\n setLink: function (fileB)\r\n {\r\n this.linkFile = fileB;\r\n\r\n fileB.linkFile = this;\r\n },\r\n\r\n /**\r\n * Resets the XHRLoader instance this file is using.\r\n *\r\n * @method Phaser.Loader.File#resetXHR\r\n * @since 3.0.0\r\n */\r\n resetXHR: function ()\r\n {\r\n if (this.xhrLoader)\r\n {\r\n this.xhrLoader.onload = undefined;\r\n this.xhrLoader.onerror = undefined;\r\n this.xhrLoader.onprogress = undefined;\r\n }\r\n },\r\n\r\n /**\r\n * Called by the Loader, starts the actual file downloading.\r\n * During the load the methods onLoad, onError and onProgress are called, based on the XHR events.\r\n * You shouldn't normally call this method directly, it's meant to be invoked by the Loader.\r\n *\r\n * @method Phaser.Loader.File#load\r\n * @since 3.0.0\r\n */\r\n load: function ()\r\n {\r\n if (this.state === CONST.FILE_POPULATED)\r\n {\r\n // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL\r\n this.loader.nextFile(this, true);\r\n }\r\n else\r\n {\r\n this.src = GetURL(this, this.loader.baseURL);\r\n\r\n if (this.src.indexOf('data:') === 0)\r\n {\r\n console.warn('Local data URIs are not supported: ' + this.key);\r\n }\r\n else\r\n {\r\n // The creation of this XHRLoader starts the load process going.\r\n // It will automatically call the following, based on the load outcome:\r\n // \r\n // xhr.onload = this.onLoad\r\n // xhr.onerror = this.onError\r\n // xhr.onprogress = this.onProgress\r\n\r\n this.xhrLoader = XHRLoader(this, this.loader.xhr);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Called when the file finishes loading, is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onLoad\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load.\r\n */\r\n onLoad: function (xhr, event)\r\n {\r\n var localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && event.target.status === 0));\r\n\r\n var success = !(event.target && event.target.status !== 200) || localFileOk;\r\n\r\n // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.\r\n if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599)\r\n {\r\n success = false;\r\n }\r\n\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, success);\r\n },\r\n\r\n /**\r\n * Called if the file errors while loading, is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onError\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error.\r\n */\r\n onError: function ()\r\n {\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, false);\r\n },\r\n\r\n /**\r\n * Called during the file load progress. Is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onProgress\r\n * @fires Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n *\r\n * @param {ProgressEvent} event - The DOM ProgressEvent.\r\n */\r\n onProgress: function (event)\r\n {\r\n if (event.lengthComputable)\r\n {\r\n this.bytesLoaded = event.loaded;\r\n this.bytesTotal = event.total;\r\n\r\n this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1);\r\n\r\n this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete);\r\n }\r\n },\r\n\r\n /**\r\n * Usually overridden by the FileTypes and is called by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage.\r\n *\r\n * @method Phaser.Loader.File#onProcess\r\n * @since 3.0.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.onProcessComplete();\r\n },\r\n\r\n /**\r\n * Called when the File has completed processing.\r\n * Checks on the state of its multifile, if set.\r\n *\r\n * @method Phaser.Loader.File#onProcessComplete\r\n * @since 3.7.0\r\n */\r\n onProcessComplete: function ()\r\n {\r\n this.state = CONST.FILE_COMPLETE;\r\n\r\n if (this.multiFile)\r\n {\r\n this.multiFile.onFileComplete(this);\r\n }\r\n\r\n this.loader.fileProcessComplete(this);\r\n },\r\n\r\n /**\r\n * Called when the File has completed processing but it generated an error.\r\n * Checks on the state of its multifile, if set.\r\n *\r\n * @method Phaser.Loader.File#onProcessError\r\n * @since 3.7.0\r\n */\r\n onProcessError: function ()\r\n {\r\n this.state = CONST.FILE_ERRORED;\r\n\r\n if (this.multiFile)\r\n {\r\n this.multiFile.onFileFailed(this);\r\n }\r\n\r\n this.loader.fileProcessComplete(this);\r\n },\r\n\r\n /**\r\n * Checks if a key matching the one used by this file exists in the target Cache or not.\r\n * This is called automatically by the LoaderPlugin to decide if the file can be safely\r\n * loaded or will conflict.\r\n *\r\n * @method Phaser.Loader.File#hasCacheConflict\r\n * @since 3.7.0\r\n *\r\n * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`.\r\n */\r\n hasCacheConflict: function ()\r\n {\r\n return (this.cache && this.cache.exists(this.key));\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n * This method is often overridden by specific file types.\r\n *\r\n * @method Phaser.Loader.File#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.cache)\r\n {\r\n this.cache.add(this.key, this.data);\r\n }\r\n\r\n this.pendingDestroy();\r\n },\r\n\r\n /**\r\n * Called once the file has been added to its cache and is now ready for deletion from the Loader.\r\n * It will emit a `filecomplete` event from the LoaderPlugin.\r\n *\r\n * @method Phaser.Loader.File#pendingDestroy\r\n * @fires Phaser.Loader.Events#FILE_COMPLETE\r\n * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE\r\n * @since 3.7.0\r\n */\r\n pendingDestroy: function (data)\r\n {\r\n if (data === undefined) { data = this.data; }\r\n\r\n var key = this.key;\r\n var type = this.type;\r\n\r\n this.loader.emit(Events.FILE_COMPLETE, key, type, data);\r\n this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data);\r\n\r\n this.loader.flagForRemoval(this);\r\n },\r\n\r\n /**\r\n * Destroy this File and any references it holds.\r\n *\r\n * @method Phaser.Loader.File#destroy\r\n * @since 3.7.0\r\n */\r\n destroy: function ()\r\n {\r\n this.loader = null;\r\n this.cache = null;\r\n this.xhrSettings = null;\r\n this.multiFile = null;\r\n this.linkFile = null;\r\n this.data = null;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Static method for creating object URL using URL API and setting it as image 'src' attribute.\r\n * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader.\r\n *\r\n * @method Phaser.Loader.File.createObjectURL\r\n * @static\r\n * @since 3.7.0\r\n * \r\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL.\r\n * @param {Blob} blob - A Blob object to create an object URL for.\r\n * @param {string} defaultType - Default mime type used if blob type is not available.\r\n */\r\nFile.createObjectURL = function (image, blob, defaultType)\r\n{\r\n if (typeof URL === 'function')\r\n {\r\n image.src = URL.createObjectURL(blob);\r\n }\r\n else\r\n {\r\n var reader = new FileReader();\r\n\r\n reader.onload = function ()\r\n {\r\n image.removeAttribute('crossOrigin');\r\n image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1];\r\n };\r\n\r\n reader.onerror = image.onerror;\r\n\r\n reader.readAsDataURL(blob);\r\n }\r\n};\r\n\r\n/**\r\n * Static method for releasing an existing object URL which was previously created\r\n * by calling {@link File#createObjectURL} method.\r\n *\r\n * @method Phaser.Loader.File.revokeObjectURL\r\n * @static\r\n * @since 3.7.0\r\n * \r\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked.\r\n */\r\nFile.revokeObjectURL = function (image)\r\n{\r\n if (typeof URL === 'function')\r\n {\r\n URL.revokeObjectURL(image.src);\r\n }\r\n};\r\n\r\nmodule.exports = File;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar types = {};\r\n\r\n/**\r\n * @namespace Phaser.Loader.FileTypesManager\r\n */\r\n\r\nvar FileTypesManager = {\r\n\r\n /**\r\n * Static method called when a LoaderPlugin is created.\r\n * \r\n * Loops through the local types object and injects all of them as\r\n * properties into the LoaderPlugin instance.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.install\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into.\r\n */\r\n install: function (loader)\r\n {\r\n for (var key in types)\r\n {\r\n loader[key] = types[key];\r\n }\r\n },\r\n\r\n /**\r\n * Static method called directly by the File Types.\r\n * \r\n * The key is a reference to the function used to load the files via the Loader, i.e. `image`.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.register\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key that will be used as the method name in the LoaderPlugin.\r\n * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked.\r\n */\r\n register: function (key, factoryFunction)\r\n {\r\n types[key] = factoryFunction;\r\n },\r\n\r\n /**\r\n * Removed all associated file types.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n types = {};\r\n }\r\n\r\n};\r\n\r\nmodule.exports = FileTypesManager;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Given a File and a baseURL value this returns the URL the File will use to download from.\r\n *\r\n * @function Phaser.Loader.GetURL\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File object.\r\n * @param {string} baseURL - A default base URL.\r\n *\r\n * @return {string} The URL the File will use.\r\n */\r\nvar GetURL = function (file, baseURL)\r\n{\r\n if (!file.url)\r\n {\r\n return false;\r\n }\r\n\r\n if (file.url.match(/^(?:blob:|data:|http:\\/\\/|https:\\/\\/|\\/\\/)/))\r\n {\r\n return file.url;\r\n }\r\n else\r\n {\r\n return baseURL + file.url;\r\n }\r\n};\r\n\r\nmodule.exports = GetURL;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Extend = require('../utils/object/Extend');\r\nvar XHRSettings = require('./XHRSettings');\r\n\r\n/**\r\n * Takes two XHRSettings Objects and creates a new XHRSettings object from them.\r\n *\r\n * The new object is seeded by the values given in the global settings, but any setting in\r\n * the local object overrides the global ones.\r\n *\r\n * @function Phaser.Loader.MergeXHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object.\r\n */\r\nvar MergeXHRSettings = function (global, local)\r\n{\r\n var output = (global === undefined) ? XHRSettings() : Extend({}, global);\r\n\r\n if (local)\r\n {\r\n for (var setting in local)\r\n {\r\n if (local[setting] !== undefined)\r\n {\r\n output[setting] = local[setting];\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = MergeXHRSettings;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after\r\n * 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.\r\n * \r\n * 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.\r\n *\r\n * @class MultiFile\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\r\n * @param {string} type - The file type string for sorting within the Loader.\r\n * @param {string} key - The key of the file within the loader.\r\n * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile.\r\n */\r\nvar MultiFile = new Class({\r\n\r\n initialize:\r\n\r\n function MultiFile (loader, type, key, files)\r\n {\r\n /**\r\n * A reference to the Loader that is going to load this file.\r\n *\r\n * @name Phaser.Loader.MultiFile#loader\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.7.0\r\n */\r\n this.loader = loader;\r\n\r\n /**\r\n * The file type string for sorting within the Loader.\r\n *\r\n * @name Phaser.Loader.MultiFile#type\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * Unique cache key (unique within its file type)\r\n *\r\n * @name Phaser.Loader.MultiFile#key\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.key = key;\r\n\r\n /**\r\n * Array of files that make up this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#files\r\n * @type {Phaser.Loader.File[]}\r\n * @since 3.7.0\r\n */\r\n this.files = files;\r\n\r\n /**\r\n * The completion status of this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#complete\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.7.0\r\n */\r\n this.complete = false;\r\n\r\n /**\r\n * The number of files to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#pending\r\n * @type {integer}\r\n * @since 3.7.0\r\n */\r\n\r\n this.pending = files.length;\r\n\r\n /**\r\n * The number of files that failed to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#failed\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.7.0\r\n */\r\n this.failed = 0;\r\n\r\n /**\r\n * A storage container for transient data that the loading files need.\r\n *\r\n * @name Phaser.Loader.MultiFile#config\r\n * @type {any}\r\n * @since 3.7.0\r\n */\r\n this.config = {};\r\n\r\n // Link the files\r\n for (var i = 0; i < files.length; i++)\r\n {\r\n files[i].multiFile = this;\r\n }\r\n },\r\n\r\n /**\r\n * Checks if this MultiFile is ready to process its children or not.\r\n *\r\n * @method Phaser.Loader.MultiFile#isReadyToProcess\r\n * @since 3.7.0\r\n *\r\n * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`.\r\n */\r\n isReadyToProcess: function ()\r\n {\r\n return (this.pending === 0 && this.failed === 0 && !this.complete);\r\n },\r\n\r\n /**\r\n * Adds another child to this MultiFile, increases the pending count and resets the completion status.\r\n *\r\n * @method Phaser.Loader.MultiFile#addToMultiFile\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} files - The File to add to this MultiFile.\r\n *\r\n * @return {Phaser.Loader.MultiFile} This MultiFile instance.\r\n */\r\n addToMultiFile: function (file)\r\n {\r\n this.files.push(file);\r\n\r\n file.multiFile = this;\r\n\r\n this.pending++;\r\n\r\n this.complete = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileComplete\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n }\r\n },\r\n\r\n /**\r\n * Called by each File that fails to load.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileFailed\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has failed to load.\r\n */\r\n onFileFailed: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.failed++;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MultiFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MergeXHRSettings = require('./MergeXHRSettings');\r\n\r\n/**\r\n * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings\r\n * and starts the download of it. It uses the Files own XHRSettings and merges them\r\n * with the global XHRSettings object to set the xhr values before download.\r\n *\r\n * @function Phaser.Loader.XHRLoader\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File to download.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object.\r\n *\r\n * @return {XMLHttpRequest} The XHR object.\r\n */\r\nvar XHRLoader = function (file, globalXHRSettings)\r\n{\r\n var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings);\r\n\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', file.src, config.async, config.user, config.password);\r\n\r\n xhr.responseType = file.xhrSettings.responseType;\r\n xhr.timeout = config.timeout;\r\n\r\n if (config.header && config.headerValue)\r\n {\r\n xhr.setRequestHeader(config.header, config.headerValue);\r\n }\r\n\r\n if (config.requestedWith)\r\n {\r\n xhr.setRequestHeader('X-Requested-With', config.requestedWith);\r\n }\r\n\r\n if (config.overrideMimeType)\r\n {\r\n xhr.overrideMimeType(config.overrideMimeType);\r\n }\r\n\r\n // 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.)\r\n\r\n xhr.onload = file.onLoad.bind(file, xhr);\r\n xhr.onerror = file.onError.bind(file, xhr);\r\n xhr.onprogress = file.onProgress.bind(file);\r\n\r\n // This is the only standard method, the ones above are browser additions (maybe not universal?)\r\n // xhr.onreadystatechange\r\n\r\n xhr.send();\r\n\r\n return xhr;\r\n};\r\n\r\nmodule.exports = XHRLoader;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Creates an XHRSettings Object with default values.\r\n *\r\n * @function Phaser.Loader.XHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'.\r\n * @param {boolean} [async=true] - Should the XHR request use async or not?\r\n * @param {string} [user=''] - Optional username for the XHR request.\r\n * @param {string} [password=''] - Optional password for the XHR request.\r\n * @param {integer} [timeout=0] - Optional XHR timeout value.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader.\r\n */\r\nvar XHRSettings = function (responseType, async, user, password, timeout)\r\n{\r\n if (responseType === undefined) { responseType = ''; }\r\n if (async === undefined) { async = true; }\r\n if (user === undefined) { user = ''; }\r\n if (password === undefined) { password = ''; }\r\n if (timeout === undefined) { timeout = 0; }\r\n\r\n // Before sending a request, set the xhr.responseType to \"text\",\r\n // \"arraybuffer\", \"blob\", or \"document\", depending on your data needs.\r\n // Note, setting xhr.responseType = '' (or omitting) will default the response to \"text\".\r\n\r\n return {\r\n\r\n // Ignored by the Loader, only used by File.\r\n responseType: responseType,\r\n\r\n async: async,\r\n\r\n // credentials\r\n user: user,\r\n password: password,\r\n\r\n // timeout in ms (0 = no timeout)\r\n timeout: timeout,\r\n\r\n // setRequestHeader\r\n header: undefined,\r\n headerValue: undefined,\r\n requestedWith: false,\r\n\r\n // overrideMimeType\r\n overrideMimeType: undefined\r\n\r\n };\r\n};\r\n\r\nmodule.exports = XHRSettings;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FILE_CONST = {\r\n\r\n /**\r\n * The Loader is idle.\r\n * \r\n * @name Phaser.Loader.LOADER_IDLE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_IDLE: 0,\r\n\r\n /**\r\n * The Loader is actively loading.\r\n * \r\n * @name Phaser.Loader.LOADER_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_LOADING: 1,\r\n\r\n /**\r\n * The Loader is processing files is has loaded.\r\n * \r\n * @name Phaser.Loader.LOADER_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_PROCESSING: 2,\r\n\r\n /**\r\n * The Loader has completed loading and processing.\r\n * \r\n * @name Phaser.Loader.LOADER_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_COMPLETE: 3,\r\n\r\n /**\r\n * The Loader is shutting down.\r\n * \r\n * @name Phaser.Loader.LOADER_SHUTDOWN\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_SHUTDOWN: 4,\r\n\r\n /**\r\n * The Loader has been destroyed.\r\n * \r\n * @name Phaser.Loader.LOADER_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_DESTROYED: 5,\r\n\r\n /**\r\n * File is in the load queue but not yet started\r\n * \r\n * @name Phaser.Loader.FILE_PENDING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PENDING: 10,\r\n\r\n /**\r\n * File has been started to load by the loader (onLoad called)\r\n * \r\n * @name Phaser.Loader.FILE_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADING: 11,\r\n\r\n /**\r\n * File has loaded successfully, awaiting processing \r\n * \r\n * @name Phaser.Loader.FILE_LOADED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADED: 12,\r\n\r\n /**\r\n * File failed to load\r\n * \r\n * @name Phaser.Loader.FILE_FAILED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_FAILED: 13,\r\n\r\n /**\r\n * File is being processed (onProcess callback)\r\n * \r\n * @name Phaser.Loader.FILE_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PROCESSING: 14,\r\n\r\n /**\r\n * The File has errored somehow during processing.\r\n * \r\n * @name Phaser.Loader.FILE_ERRORED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_ERRORED: 16,\r\n\r\n /**\r\n * File has finished processing.\r\n * \r\n * @name Phaser.Loader.FILE_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_COMPLETE: 17,\r\n\r\n /**\r\n * File has been destroyed\r\n * \r\n * @name Phaser.Loader.FILE_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_DESTROYED: 18,\r\n\r\n /**\r\n * File was populated from local data and doesn't need an HTTP request\r\n * \r\n * @name Phaser.Loader.FILE_POPULATED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_POPULATED: 19\r\n\r\n};\r\n\r\nmodule.exports = FILE_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Add File Event.\r\n * \r\n * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('addfile', listener)`.\r\n * \r\n * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them.\r\n *\r\n * @event Phaser.Loader.Events#ADD\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The unique key of the file that was added to the Loader.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`.\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader.\r\n */\r\nmodule.exports = 'addfile';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Complete Event.\r\n * \r\n * This event is dispatched when the Loader has fully processed everything in the load queue.\r\n * By this point every loaded file will now be in its associated cache and ready for use.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('complete', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {integer} totalComplete - The total number of files that successfully loaded.\r\n * @param {integer} totalFailed - The total number of files that failed to load.\r\n */\r\nmodule.exports = 'complete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`.\r\n * \r\n * 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.\r\n *\r\n * @event Phaser.Loader.Events#FILE_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * It uses a special dynamic event name constructed from the key and type of the file.\r\n * \r\n * For example, if you have loaded an `image` with a key of `monster`, you can listen for it\r\n * using the following:\r\n *\r\n * ```javascript\r\n * this.load.on('filecomplete-image-monster', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n *\r\n * Or, if you have loaded a texture `atlas` with a key of `Level1`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-atlas-Level1', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event.\r\n *\r\n * @event Phaser.Loader.Events#FILE_KEY_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete-';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Error Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file fails to load.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('loaderror', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD_ERROR\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n */\r\nmodule.exports = 'loaderror';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file finishes loading,\r\n * but _before_ it is processed and added to the internal Phaser caches.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('load', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which just finished loading.\r\n */\r\nmodule.exports = 'load';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Progress Event.\r\n * \r\n * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and\r\n * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is.\r\n */\r\nmodule.exports = 'fileprogress';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Post Process Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue.\r\n * It is dispatched before the internal lists are cleared and each File is destroyed.\r\n * \r\n * Use this hook to perform any last minute processing of files that can only happen once the\r\n * Loader has completed, but prior to it emitting the `complete` event.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('postprocess', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#POST_PROCESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'postprocess';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Progress Event.\r\n * \r\n * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('progress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {number} progress - The current progress of the load. A value between 0 and 1.\r\n */\r\nmodule.exports = 'progress';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Start Event.\r\n * \r\n * This event is dispatched when the Loader starts running. At this point load progress is zero.\r\n * \r\n * This event is dispatched even if there aren't any files in the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('start', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Loader.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ADD: require('./ADD_EVENT'),\r\n COMPLETE: require('./COMPLETE_EVENT'),\r\n FILE_COMPLETE: require('./FILE_COMPLETE_EVENT'),\r\n FILE_KEY_COMPLETE: require('./FILE_KEY_COMPLETE_EVENT'),\r\n FILE_LOAD_ERROR: require('./FILE_LOAD_ERROR_EVENT'),\r\n FILE_LOAD: require('./FILE_LOAD_EVENT'),\r\n FILE_PROGRESS: require('./FILE_PROGRESS_EVENT'),\r\n POST_PROCESS: require('./POST_PROCESS_EVENT'),\r\n PROGRESS: require('./PROGRESS_EVENT'),\r\n START: require('./START_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single Image File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image.\r\n *\r\n * @class ImageFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets.\r\n */\r\nvar ImageFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function ImageFile (loader, key, url, xhrSettings, frameConfig)\r\n {\r\n var extension = 'png';\r\n var normalMapURL;\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n normalMapURL = GetFastValue(config, 'normalMap');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n frameConfig = GetFastValue(config, 'frameConfig');\r\n }\r\n\r\n if (Array.isArray(url))\r\n {\r\n normalMapURL = url[1];\r\n url = url[0];\r\n }\r\n\r\n var fileConfig = {\r\n type: 'image',\r\n cache: loader.textureManager,\r\n extension: extension,\r\n responseType: 'blob',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: frameConfig\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n // Do we have a normal map to load as well?\r\n if (normalMapURL)\r\n {\r\n var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig);\r\n\r\n normalMap.type = 'normalMap';\r\n\r\n this.setLink(normalMap);\r\n\r\n loader.addFile(normalMap);\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = new Image();\r\n\r\n this.data.crossOrigin = this.crossOrigin;\r\n\r\n var _this = this;\r\n\r\n this.data.onload = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessComplete();\r\n };\r\n\r\n this.data.onerror = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessError();\r\n };\r\n\r\n File.createObjectURL(this.data, this.xhrLoader.response, 'image/png');\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var texture;\r\n var linkFile = this.linkFile;\r\n\r\n if (linkFile && linkFile.state === CONST.FILE_COMPLETE)\r\n {\r\n if (this.type === 'image')\r\n {\r\n texture = this.cache.addImage(this.key, this.data, linkFile.data);\r\n }\r\n else\r\n {\r\n texture = this.cache.addImage(linkFile.key, linkFile.data, this.data);\r\n }\r\n\r\n this.pendingDestroy(texture);\r\n\r\n linkFile.pendingDestroy(texture);\r\n }\r\n else if (!linkFile)\r\n {\r\n texture = this.cache.addImage(this.key, this.data);\r\n\r\n this.pendingDestroy(texture);\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an Image, or array of Images, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.image('logo', 'images/phaserLogo.png');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback\r\n * of animated gifs to Canvas elements.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.image('logo', 'images/AtariLogo.png');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'logo');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n * \r\n * ```javascript\r\n * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]);\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n * \r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png',\r\n * normalMap: 'images/AtariLogo-n.png'\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#image\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('image', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new ImageFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new ImageFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = ImageFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar GetValue = require('../../utils/object/GetValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single JSON File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json.\r\n *\r\n * @class JSONFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n */\r\nvar JSONFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n // 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\r\n // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing\r\n\r\n function JSONFile (loader, key, url, xhrSettings, dataKey)\r\n {\r\n var extension = 'json';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n dataKey = GetFastValue(config, 'dataKey', dataKey);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'json',\r\n cache: loader.cacheManager.json,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: dataKey\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n if (IsPlainObject(url))\r\n {\r\n // Object provided instead of a URL, so no need to actually load it (populate data with value)\r\n if (dataKey)\r\n {\r\n this.data = GetValue(url, dataKey);\r\n }\r\n else\r\n {\r\n this.data = url;\r\n }\r\n\r\n this.state = CONST.FILE_POPULATED;\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.JSONFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n if (this.state !== CONST.FILE_POPULATED)\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n var json = JSON.parse(this.xhrLoader.responseText);\r\n\r\n var key = this.config;\r\n\r\n if (typeof key === 'string')\r\n {\r\n this.data = GetValue(json, key, json);\r\n }\r\n else\r\n {\r\n this.data = json;\r\n }\r\n }\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a JSON file, or array of JSON files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.json('wavedata', 'files/AlienWaveData.json');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the JSON Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the JSON Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.json({\r\n * key: 'wavedata',\r\n * url: 'files/AlienWaveData.json'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n * \r\n * ```javascript\r\n * this.load.json('wavedata', 'files/AlienWaveData.json');\r\n * // and later in your game ...\r\n * var data = this.cache.json.get('wavedata');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and\r\n * this is what you would use to retrieve the text from the JSON Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * 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,\r\n * rather than the whole file. For example, if your JSON data had a structure like this:\r\n * \r\n * ```json\r\n * {\r\n * \"level1\": {\r\n * \"baddies\": {\r\n * \"aliens\": {},\r\n * \"boss\": {}\r\n * }\r\n * },\r\n * \"level2\": {},\r\n * \"level3\": {}\r\n * }\r\n * ```\r\n *\r\n * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`.\r\n *\r\n * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#json\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {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\".\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('json', function (key, url, dataKey, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new JSONFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = JSONFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single Text File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text.\r\n *\r\n * @class TextFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar TextFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function TextFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'txt';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'text',\r\n cache: loader.cacheManager.text,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.TextFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = this.xhrLoader.responseText;\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Text file, or array of Text files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Text Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Text Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.text({\r\n * key: 'story',\r\n * url: 'files/IntroStory.txt'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n *\r\n * ```javascript\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * // and later in your game ...\r\n * var data = this.cache.text.get('story');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and\r\n * this is what you would use to retrieve the text from the Text Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#text\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('text', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new TextFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new TextFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = TextFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the mean average of the given values.\r\n *\r\n * @function Phaser.Math.Average\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} values - The values to average.\r\n *\r\n * @return {number} The average value.\r\n */\r\nvar Average = function (values)\r\n{\r\n var sum = 0;\r\n\r\n for (var i = 0; i < values.length; i++)\r\n {\r\n sum += (+values[i]);\r\n }\r\n\r\n return sum / values.length;\r\n};\r\n\r\nmodule.exports = Average;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Factorial = require('./Factorial');\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Math.Bernstein\r\n * @since 3.0.0\r\n *\r\n * @param {number} n - [description]\r\n * @param {number} i - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\nvar Bernstein = function (n, i)\r\n{\r\n return Factorial(n) / Factorial(i) / Factorial(n - i);\r\n};\r\n\r\nmodule.exports = Bernstein;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random integer between the `min` and `max` values, inclusive.\r\n *\r\n * @function Phaser.Math.Between\r\n * @since 3.0.0\r\n *\r\n * @param {integer} min - The minimum value.\r\n * @param {integer} max - The maximum value.\r\n *\r\n * @return {integer} The random integer.\r\n */\r\nvar Between = function (min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n};\r\n\r\nmodule.exports = Between;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates a Catmull-Rom value.\r\n *\r\n * @function Phaser.Math.CatmullRom\r\n * @since 3.0.0\r\n *\r\n * @param {number} t - [description]\r\n * @param {number} p0 - [description]\r\n * @param {number} p1 - [description]\r\n * @param {number} p2 - [description]\r\n * @param {number} p3 - [description]\r\n *\r\n * @return {number} The Catmull-Rom value.\r\n */\r\nvar CatmullRom = function (t, p0, p1, p2, p3)\r\n{\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n var t2 = t * t;\r\n var t3 = t * t2;\r\n\r\n return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\r\n};\r\n\r\nmodule.exports = CatmullRom;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Ceils to some place comparative to a `base`, default is 10 for decimal place.\r\n *\r\n * The `place` is represented by the power applied to `base` to get that place.\r\n *\r\n * @function Phaser.Math.CeilTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {number} [place=0] - The place to round to.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar CeilTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.ceil(value * p) / p;\r\n};\r\n\r\nmodule.exports = CeilTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Force a value within the boundaries by clamping it to the range `min`, `max`.\r\n *\r\n * @function Phaser.Math.Clamp\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to be clamped.\r\n * @param {number} min - The minimum bounds.\r\n * @param {number} max - The maximum bounds.\r\n *\r\n * @return {number} The clamped value.\r\n */\r\nvar Clamp = function (value, min, max)\r\n{\r\n return Math.max(min, Math.min(max, value));\r\n};\r\n\r\nmodule.exports = Clamp;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\n\r\n/**\r\n * Convert the given angle from degrees, to the equivalent angle in radians.\r\n *\r\n * @function Phaser.Math.DegToRad\r\n * @since 3.0.0\r\n *\r\n * @param {integer} degrees - The angle (in degrees) to convert to radians.\r\n *\r\n * @return {number} The given angle converted to radians.\r\n */\r\nvar DegToRad = function (degrees)\r\n{\r\n return degrees * CONST.DEG_TO_RAD;\r\n};\r\n\r\nmodule.exports = DegToRad;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the positive difference of two given numbers.\r\n *\r\n * @function Phaser.Math.Difference\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first number in the calculation.\r\n * @param {number} b - The second number in the calculation.\r\n *\r\n * @return {number} The positive difference of the two given numbers.\r\n */\r\nvar Difference = function (a, b)\r\n{\r\n return Math.abs(a - b);\r\n};\r\n\r\nmodule.exports = Difference;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the factorial of a given number for integer values greater than 0.\r\n *\r\n * @function Phaser.Math.Factorial\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - A positive integer to calculate the factorial of.\r\n *\r\n * @return {number} The factorial of the given number.\r\n */\r\nvar Factorial = function (value)\r\n{\r\n if (value === 0)\r\n {\r\n return 1;\r\n }\r\n\r\n var res = value;\r\n\r\n while (--value)\r\n {\r\n res *= value;\r\n }\r\n\r\n return res;\r\n};\r\n\r\nmodule.exports = Factorial;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive.\r\n *\r\n * @function Phaser.Math.FloatBetween\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The lower bound for the float, inclusive.\r\n * @param {number} max - The upper bound for the float exclusive.\r\n *\r\n * @return {number} A random float within the given range.\r\n */\r\nvar FloatBetween = function (min, max)\r\n{\r\n return Math.random() * (max - min) + min;\r\n};\r\n\r\nmodule.exports = FloatBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Floors to some place comparative to a `base`, default is 10 for decimal place.\r\n *\r\n * The `place` is represented by the power applied to `base` to get that place.\r\n *\r\n * @function Phaser.Math.FloorTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {integer} [place=0] - The place to round to.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar FloorTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.floor(value * p) / p;\r\n};\r\n\r\nmodule.exports = FloorTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = require('./Clamp');\r\n\r\n/**\r\n * Return a value based on the range between `min` and `max` and the percentage given.\r\n *\r\n * @function Phaser.Math.FromPercent\r\n * @since 3.0.0\r\n *\r\n * @param {number} percent - A value between 0 and 1 representing the percentage.\r\n * @param {number} min - The minimum value.\r\n * @param {number} [max] - The maximum value.\r\n *\r\n * @return {number} The value that is `percent` percent between `min` and `max`.\r\n */\r\nvar FromPercent = function (percent, min, max)\r\n{\r\n percent = Clamp(percent, 0, 1);\r\n\r\n return (max - min) * percent;\r\n};\r\n\r\nmodule.exports = FromPercent;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the speed required to cover a distance in the time given.\r\n *\r\n * @function Phaser.Math.GetSpeed\r\n * @since 3.0.0\r\n *\r\n * @param {number} distance - The distance to travel in pixels.\r\n * @param {integer} time - The time, in ms, to cover the distance in.\r\n *\r\n * @return {number} The amount you will need to increment the position by each step in order to cover the distance in the time given.\r\n */\r\nvar GetSpeed = function (distance, time)\r\n{\r\n return (distance / time) / 1000;\r\n};\r\n\r\nmodule.exports = GetSpeed;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check if a given value is an even number.\r\n *\r\n * @function Phaser.Math.IsEven\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to perform the check with.\r\n *\r\n * @return {boolean} Whether the number is even or not.\r\n */\r\nvar IsEven = function (value)\r\n{\r\n // Use abstract equality == for \"is number\" test\r\n\r\n // eslint-disable-next-line eqeqeq\r\n return (value == parseFloat(value)) ? !(value % 2) : void 0;\r\n};\r\n\r\nmodule.exports = IsEven;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check if a given value is an even number using a strict type check.\r\n *\r\n * @function Phaser.Math.IsEvenStrict\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to perform the check with.\r\n *\r\n * @return {boolean} Whether the number is even or not.\r\n */\r\nvar IsEvenStrict = function (value)\r\n{\r\n // Use strict equality === for \"is number\" test\r\n return (value === parseFloat(value)) ? !(value % 2) : void 0;\r\n};\r\n\r\nmodule.exports = IsEvenStrict;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates a linear (interpolation) value over t.\r\n *\r\n * @function Phaser.Math.Linear\r\n * @since 3.0.0\r\n *\r\n * @param {number} p0 - The first point.\r\n * @param {number} p1 - The second point.\r\n * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1.\r\n *\r\n * @return {number} The step t% of the way between p0 and p1.\r\n */\r\nvar Linear = function (p0, p1, t)\r\n{\r\n return (p1 - p0) * t + p0;\r\n};\r\n\r\nmodule.exports = Linear;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A three-dimensional matrix.\r\n *\r\n * Defaults to the identity matrix when instantiated.\r\n *\r\n * @class Matrix3\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from.\r\n */\r\nvar Matrix3 = new Class({\r\n\r\n initialize:\r\n\r\n function Matrix3 (m)\r\n {\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.Math.Matrix3#val\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.val = new Float32Array(9);\r\n\r\n if (m)\r\n {\r\n // Assume Matrix3 with val:\r\n this.copy(m);\r\n }\r\n else\r\n {\r\n // Default to identity\r\n this.identity();\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Matrix3.\r\n *\r\n * @method Phaser.Math.Matrix3#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} A clone of this Matrix3.\r\n */\r\n clone: function ()\r\n {\r\n return new Matrix3(this);\r\n },\r\n\r\n /**\r\n * This method is an alias for `Matrix3.copy`.\r\n *\r\n * @method Phaser.Math.Matrix3#set\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n set: function (src)\r\n {\r\n return this.copy(src);\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix into this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n copy: function (src)\r\n {\r\n var out = this.val;\r\n var a = src.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix4 into this Matrix3.\r\n *\r\n * @method Phaser.Math.Matrix3#fromMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromMat4: function (m)\r\n {\r\n var a = m.val;\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given array.\r\n *\r\n * @method Phaser.Math.Matrix3#fromArray\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The array to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromArray: function (a)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n identity: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transpose this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#transpose\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n transpose: function ()\r\n {\r\n var a = this.val;\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a12 = a[5];\r\n\r\n a[1] = a[3];\r\n a[2] = a[6];\r\n a[3] = a01;\r\n a[5] = a[7];\r\n a[6] = a02;\r\n a[7] = a12;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n invert: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n var b01 = a22 * a11 - a12 * a21;\r\n var b11 = -a22 * a10 + a12 * a20;\r\n var b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n var det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n a[0] = b01 * det;\r\n a[1] = (-a22 * a01 + a02 * a21) * det;\r\n a[2] = (a12 * a01 - a02 * a11) * det;\r\n a[3] = b11 * det;\r\n a[4] = (a22 * a00 - a02 * a20) * det;\r\n a[5] = (-a12 * a00 + a02 * a10) * det;\r\n a[6] = b21 * det;\r\n a[7] = (-a21 * a00 + a01 * a20) * det;\r\n a[8] = (a11 * a00 - a01 * a10) * det;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the adjoint, or adjugate, of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#adjoint\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n adjoint: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n a[0] = (a11 * a22 - a12 * a21);\r\n a[1] = (a02 * a21 - a01 * a22);\r\n a[2] = (a01 * a12 - a02 * a11);\r\n a[3] = (a12 * a20 - a10 * a22);\r\n a[4] = (a00 * a22 - a02 * a20);\r\n a[5] = (a02 * a10 - a00 * a12);\r\n a[6] = (a10 * a21 - a11 * a20);\r\n a[7] = (a01 * a20 - a00 * a21);\r\n a[8] = (a00 * a11 - a01 * a10);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the determinant of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#determinant\r\n * @since 3.0.0\r\n *\r\n * @return {number} The determinant of this Matrix.\r\n */\r\n determinant: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n multiply: function (src)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n var b = src.val;\r\n\r\n var b00 = b[0];\r\n var b01 = b[1];\r\n var b02 = b[2];\r\n var b10 = b[3];\r\n var b11 = b[4];\r\n var b12 = b[5];\r\n var b20 = b[6];\r\n var b21 = b[7];\r\n var b22 = b[8];\r\n\r\n a[0] = b00 * a00 + b01 * a10 + b02 * a20;\r\n a[1] = b00 * a01 + b01 * a11 + b02 * a21;\r\n a[2] = b00 * a02 + b01 * a12 + b02 * a22;\r\n\r\n a[3] = b10 * a00 + b11 * a10 + b12 * a20;\r\n a[4] = b10 * a01 + b11 * a11 + b12 * a21;\r\n a[5] = b10 * a02 + b11 * a12 + b12 * a22;\r\n\r\n a[6] = b20 * a00 + b21 * a10 + b22 * a20;\r\n a[7] = b20 * a01 + b21 * a11 + b22 * a21;\r\n a[8] = b20 * a02 + b21 * a12 + b22 * a22;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given Vector.\r\n *\r\n * @method Phaser.Math.Matrix3#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n translate: function (v)\r\n {\r\n var a = this.val;\r\n var x = v.x;\r\n var y = v.y;\r\n\r\n a[6] = x * a[0] + y * a[3] + a[6];\r\n a[7] = x * a[1] + y * a[4] + a[7];\r\n a[8] = x * a[2] + y * a[5] + a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a rotation transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n rotate: function (rad)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n a[0] = c * a00 + s * a10;\r\n a[1] = c * a01 + s * a11;\r\n a[2] = c * a02 + s * a12;\r\n\r\n a[3] = c * a10 - s * a00;\r\n a[4] = c * a11 - s * a01;\r\n a[5] = c * a12 - s * a02;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * Uses the `x` and `y` components of the given Vector to scale the Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#scale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n scale: function (v)\r\n {\r\n var a = this.val;\r\n var x = v.x;\r\n var y = v.y;\r\n\r\n a[0] = x * a[0];\r\n a[1] = x * a[1];\r\n a[2] = x * a[2];\r\n\r\n a[3] = y * a[3];\r\n a[4] = y * a[4];\r\n a[5] = y * a[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given Quaternion.\r\n *\r\n * @method Phaser.Math.Matrix3#fromQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromQuat: function (q)\r\n {\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n var out = this.val;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[3] = xy + wz;\r\n out[6] = xz - wy;\r\n\r\n out[1] = xy - wz;\r\n out[4] = 1 - (xx + zz);\r\n out[7] = yz + wx;\r\n\r\n out[2] = xz + wy;\r\n out[5] = yz - wx;\r\n out[8] = 1 - (xx + yy);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Matrix3#normalFromMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} m - [description]\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n normalFromMat4: function (m)\r\n {\r\n var a = m.val;\r\n var out = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Matrix3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\nvar EPSILON = 0.000001;\r\n\r\n/**\r\n * @classdesc\r\n * A four-dimensional matrix.\r\n *\r\n * @class Matrix4\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from.\r\n */\r\nvar Matrix4 = new Class({\r\n\r\n initialize:\r\n\r\n function Matrix4 (m)\r\n {\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.Math.Matrix4#val\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.val = new Float32Array(16);\r\n\r\n if (m)\r\n {\r\n // Assume Matrix4 with val:\r\n this.copy(m);\r\n }\r\n else\r\n {\r\n // Default to identity\r\n this.identity();\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Matrix4.\r\n *\r\n * @method Phaser.Math.Matrix4#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} A clone of this Matrix4.\r\n */\r\n clone: function ()\r\n {\r\n return new Matrix4(this);\r\n },\r\n\r\n // TODO - Should work with basic values\r\n\r\n /**\r\n * This method is an alias for `Matrix4.copy`.\r\n *\r\n * @method Phaser.Math.Matrix4#set\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n set: function (src)\r\n {\r\n return this.copy(src);\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix into this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n copy: function (src)\r\n {\r\n var out = this.val;\r\n var a = src.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given array.\r\n *\r\n * @method Phaser.Math.Matrix4#fromArray\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The array to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromArray: function (a)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix.\r\n *\r\n * Sets all values to `0`.\r\n *\r\n * @method Phaser.Math.Matrix4#zero\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n zero: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 0;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x`, `y` and `z` values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#xyz\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n * @param {number} z - The z value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n xyz: function (x, y, z)\r\n {\r\n this.identity();\r\n\r\n var out = this.val;\r\n\r\n out[12] = x;\r\n out[13] = y;\r\n out[14] = z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the scaling values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaling\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x scaling value.\r\n * @param {number} y - The y scaling value.\r\n * @param {number} z - The z scaling value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaling: function (x, y, z)\r\n {\r\n this.zero();\r\n\r\n var out = this.val;\r\n\r\n out[0] = x;\r\n out[5] = y;\r\n out[10] = z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n identity: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transpose this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#transpose\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n transpose: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n var a23 = a[11];\r\n\r\n a[1] = a[4];\r\n a[2] = a[8];\r\n a[3] = a[12];\r\n a[4] = a01;\r\n a[6] = a[9];\r\n a[7] = a[13];\r\n a[8] = a02;\r\n a[9] = a12;\r\n a[11] = a[14];\r\n a[12] = a03;\r\n a[13] = a13;\r\n a[14] = a23;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n invert: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the adjoint, or adjugate, of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#adjoint\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n adjoint: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22));\r\n a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\r\n a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12));\r\n a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\r\n a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\r\n a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22));\r\n a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\r\n a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12));\r\n a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21));\r\n a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\r\n a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11));\r\n a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\r\n a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\r\n a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21));\r\n a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\r\n a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11));\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the determinant of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#determinant\r\n * @since 3.0.0\r\n *\r\n * @return {number} The determinant of this Matrix.\r\n */\r\n determinant: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiply: function (src)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b = src.val;\r\n\r\n // Cache only the current line of the second matrix\r\n var b0 = b[0];\r\n var b1 = b[1];\r\n var b2 = b[2];\r\n var b3 = b[3];\r\n\r\n a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n\r\n a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n\r\n a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n\r\n a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Matrix4#multiplyLocal\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - [description]\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiplyLocal: function (src)\r\n {\r\n var a = [];\r\n var m1 = this.val;\r\n var m2 = src.val;\r\n\r\n a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12];\r\n a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13];\r\n a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14];\r\n a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15];\r\n\r\n a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12];\r\n a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13];\r\n a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14];\r\n a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15];\r\n\r\n a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12];\r\n a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13];\r\n a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14];\r\n a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15];\r\n\r\n a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12];\r\n a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13];\r\n a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14];\r\n a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15];\r\n\r\n return this.fromArray(a);\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translate: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given values.\r\n *\r\n * @method Phaser.Math.Matrix4#translateXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translateXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scale: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaleXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaleXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Derive a rotation matrix around the given axis.\r\n *\r\n * @method Phaser.Math.Matrix4#makeRotationAxis\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis.\r\n * @param {number} angle - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n makeRotationAxis: function (axis, angle)\r\n {\r\n // Based on http://www.gamedev.net/reference/articles/article1199.asp\r\n\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n var t = 1 - c;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var tx = t * x;\r\n var ty = t * y;\r\n\r\n this.fromArray([\r\n tx * x + c, tx * y - s * z, tx * z + s * y, 0,\r\n tx * y + s * z, ty * y + c, ty * z - s * x, 0,\r\n tx * z - s * y, ty * z + s * x, t * z * z + c, 0,\r\n 0, 0, 0, 1\r\n ]);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a rotation transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n * @param {Phaser.Math.Vector3} axis - The axis to rotate upon.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotate: function (rad, axis)\r\n {\r\n var a = this.val;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (Math.abs(len) < EPSILON)\r\n {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n var t = 1 - c;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n var b00 = x * x * t + c;\r\n var b01 = y * x * t + z * s;\r\n var b02 = z * x * t - y * s;\r\n\r\n var b10 = x * y * t - z * s;\r\n var b11 = y * y * t + c;\r\n var b12 = z * y * t + x * s;\r\n\r\n var b20 = x * z * t + y * s;\r\n var b21 = y * z * t - x * s;\r\n var b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n a[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n a[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n a[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n a[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n a[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n a[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n a[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n a[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n a[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n a[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n a[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n a[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its X axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateX: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[4] = a10 * c + a20 * s;\r\n a[5] = a11 * c + a21 * s;\r\n a[6] = a12 * c + a22 * s;\r\n a[7] = a13 * c + a23 * s;\r\n a[8] = a20 * c - a10 * s;\r\n a[9] = a21 * c - a11 * s;\r\n a[10] = a22 * c - a12 * s;\r\n a[11] = a23 * c - a13 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Y axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateY: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c - a20 * s;\r\n a[1] = a01 * c - a21 * s;\r\n a[2] = a02 * c - a22 * s;\r\n a[3] = a03 * c - a23 * s;\r\n a[8] = a00 * s + a20 * c;\r\n a[9] = a01 * s + a21 * c;\r\n a[10] = a02 * s + a22 * c;\r\n a[11] = a03 * s + a23 * c;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Z axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateZ: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c + a10 * s;\r\n a[1] = a01 * c + a11 * s;\r\n a[2] = a02 * c + a12 * s;\r\n a[3] = a03 * c + a13 * s;\r\n a[4] = a10 * c - a00 * s;\r\n a[5] = a11 * c - a01 * s;\r\n a[6] = a12 * c - a02 * s;\r\n a[7] = a13 * c - a03 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given rotation Quaternion and translation Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#fromRotationTranslation\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from.\r\n * @param {Phaser.Math.Vector3} v - The Vector to set translation from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromRotationTranslation: function (q, v)\r\n {\r\n // Quaternion math\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = v.x;\r\n out[13] = v.y;\r\n out[14] = v.z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given Quaternion.\r\n *\r\n * @method Phaser.Math.Matrix4#fromQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromQuat: function (q)\r\n {\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a frustum matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#frustum\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n frustum: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n\r\n var rl = 1 / (right - left);\r\n var tb = 1 / (top - bottom);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = (near * 2) * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (near * 2) * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (far * near * 2) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspective\r\n * @since 3.0.0\r\n *\r\n * @param {number} fovy - Vertical field of view in radians\r\n * @param {number} aspect - Aspect ratio. Typically viewport width /height.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspective: function (fovy, aspect, near, far)\r\n {\r\n var out = this.val;\r\n var f = 1.0 / Math.tan(fovy / 2);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (2 * far * near) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspectiveLH\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of the frustum.\r\n * @param {number} height - The height of the frustum.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspectiveLH: function (width, height, near, far)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = (2 * near) / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (2 * near) / height;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = -far / (near - far);\r\n out[11] = 1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (near * far) / (near - far);\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate an orthogonal projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#ortho\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n ortho: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n var lr = left - right;\r\n var bt = bottom - top;\r\n var nf = near - far;\r\n\r\n // Avoid division by zero\r\n lr = (lr === 0) ? lr : 1 / lr;\r\n bt = (bt === 0) ? bt : 1 / bt;\r\n nf = (nf === 0) ? nf : 1 / nf;\r\n\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a look-at matrix with the given eye position, focal point, and up axis.\r\n *\r\n * @method Phaser.Math.Matrix4#lookAt\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} eye - Position of the viewer\r\n * @param {Phaser.Math.Vector3} center - Point the viewer is looking at\r\n * @param {Phaser.Math.Vector3} up - vec3 pointing up.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n lookAt: function (eye, center, up)\r\n {\r\n var out = this.val;\r\n\r\n var eyex = eye.x;\r\n var eyey = eye.y;\r\n var eyez = eye.z;\r\n\r\n var upx = up.x;\r\n var upy = up.y;\r\n var upz = up.z;\r\n\r\n var centerx = center.x;\r\n var centery = center.y;\r\n var centerz = center.z;\r\n\r\n if (Math.abs(eyex - centerx) < EPSILON &&\r\n Math.abs(eyey - centery) < EPSILON &&\r\n Math.abs(eyez - centerz) < EPSILON)\r\n {\r\n return this.identity();\r\n }\r\n\r\n var z0 = eyex - centerx;\r\n var z1 = eyey - centery;\r\n var z2 = eyez - centerz;\r\n\r\n var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n var x0 = upy * z2 - upz * z1;\r\n var x1 = upz * z0 - upx * z2;\r\n var x2 = upx * z1 - upy * z0;\r\n\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n\r\n if (!len)\r\n {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n var y0 = z1 * x2 - z2 * x1;\r\n var y1 = z2 * x0 - z0 * x2;\r\n var y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n\r\n if (!len)\r\n {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values.\r\n *\r\n * @method Phaser.Math.Matrix4#yawPitchRoll\r\n * @since 3.0.0\r\n *\r\n * @param {number} yaw - [description]\r\n * @param {number} pitch - [description]\r\n * @param {number} roll - [description]\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n yawPitchRoll: function (yaw, pitch, roll)\r\n {\r\n this.zero();\r\n _tempMat1.zero();\r\n _tempMat2.zero();\r\n\r\n var m0 = this.val;\r\n var m1 = _tempMat1.val;\r\n var m2 = _tempMat2.val;\r\n\r\n // Rotate Z\r\n var s = Math.sin(roll);\r\n var c = Math.cos(roll);\r\n\r\n m0[10] = 1;\r\n m0[15] = 1;\r\n m0[0] = c;\r\n m0[1] = s;\r\n m0[4] = -s;\r\n m0[5] = c;\r\n\r\n // Rotate X\r\n s = Math.sin(pitch);\r\n c = Math.cos(pitch);\r\n\r\n m1[0] = 1;\r\n m1[15] = 1;\r\n m1[5] = c;\r\n m1[10] = c;\r\n m1[9] = -s;\r\n m1[6] = s;\r\n\r\n // Rotate Y\r\n s = Math.sin(yaw);\r\n c = Math.cos(yaw);\r\n\r\n m2[5] = 1;\r\n m2[15] = 1;\r\n m2[0] = c;\r\n m2[2] = -s;\r\n m2[8] = s;\r\n m2[10] = c;\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#setWorldMatrix\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix.\r\n * @param {Phaser.Math.Vector3} position - The position of the world matrix.\r\n * @param {Phaser.Math.Vector3} scale - The scale of the world matrix.\r\n * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix.\r\n * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix)\r\n {\r\n this.yawPitchRoll(rotation.y, rotation.x, rotation.z);\r\n\r\n _tempMat1.scaling(scale.x, scale.y, scale.z);\r\n _tempMat2.xyz(position.x, position.y, position.z);\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n if (viewMatrix !== undefined)\r\n {\r\n this.multiplyLocal(viewMatrix);\r\n }\r\n\r\n if (projectionMatrix !== undefined)\r\n {\r\n this.multiplyLocal(projectionMatrix);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nvar _tempMat1 = new Matrix4();\r\nvar _tempMat2 = new Matrix4();\r\n\r\nmodule.exports = Matrix4;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Add an `amount` to a `value`, limiting the maximum result to `max`.\r\n *\r\n * @function Phaser.Math.MaxAdd\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to add to.\r\n * @param {number} amount - The amount to add.\r\n * @param {number} max - The maximum value to return.\r\n *\r\n * @return {number} The resulting value.\r\n */\r\nvar MaxAdd = function (value, amount, max)\r\n{\r\n return Math.min(value + amount, max);\r\n};\r\n\r\nmodule.exports = MaxAdd;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Subtract an `amount` from `value`, limiting the minimum result to `min`.\r\n *\r\n * @function Phaser.Math.MinSub\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to subtract from.\r\n * @param {number} amount - The amount to subtract.\r\n * @param {number} min - The minimum value to return.\r\n *\r\n * @return {number} The resulting value.\r\n */\r\nvar MinSub = function (value, amount, min)\r\n{\r\n return Math.max(value - amount, min);\r\n};\r\n\r\nmodule.exports = MinSub;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Work out what percentage `value` is of the range between `min` and `max`.\r\n * If `max` isn't given then it will return the percentage of `value` to `min`.\r\n *\r\n * 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.\r\n *\r\n * @function Phaser.Math.Percent\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to determine the percentage of.\r\n * @param {number} min - The minimum value.\r\n * @param {number} [max] - The maximum value.\r\n * @param {number} [upperMax] - The mid-way point in the range that represents 100%.\r\n *\r\n * @return {number} A value between 0 and 1 representing the percentage.\r\n */\r\nvar Percent = function (value, min, max, upperMax)\r\n{\r\n if (max === undefined) { max = min + 1; }\r\n\r\n var percentage = (value - min) / (max - min);\r\n\r\n if (percentage > 1)\r\n {\r\n if (upperMax !== undefined)\r\n {\r\n percentage = ((upperMax - value)) / (upperMax - max);\r\n\r\n if (percentage < 0)\r\n {\r\n percentage = 0;\r\n }\r\n }\r\n else\r\n {\r\n percentage = 1;\r\n }\r\n }\r\n else if (percentage < 0)\r\n {\r\n percentage = 0;\r\n }\r\n\r\n return percentage;\r\n};\r\n\r\nmodule.exports = Percent;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\nvar Vector3 = require('./Vector3');\r\nvar Matrix3 = require('./Matrix3');\r\n\r\nvar EPSILON = 0.000001;\r\n\r\n// Some shared 'private' arrays\r\nvar siNext = new Int8Array([ 1, 2, 0 ]);\r\nvar tmp = new Float32Array([ 0, 0, 0 ]);\r\n\r\nvar xUnitVec3 = new Vector3(1, 0, 0);\r\nvar yUnitVec3 = new Vector3(0, 1, 0);\r\n\r\nvar tmpvec = new Vector3();\r\nvar tmpMat3 = new Matrix3();\r\n\r\n/**\r\n * @classdesc\r\n * A quaternion.\r\n *\r\n * @class Quaternion\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n * @param {number} [w] - The w component.\r\n */\r\nvar Quaternion = new Class({\r\n\r\n initialize:\r\n\r\n function Quaternion (x, y, z, w)\r\n {\r\n /**\r\n * The x component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The y component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The z component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The w component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Copy the components of a given Quaternion or Vector into this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#copy\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z;\r\n this.w = src.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the components of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components.\r\n * @param {number} [y=0] - The y component.\r\n * @param {number} [z=0] - The z component.\r\n * @param {number} [w=0] - The w component.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n set: function (x, y, z, w)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Quaternion#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z;\r\n this.w += v.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Quaternion#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z;\r\n this.w -= v.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Quaternion by the given value.\r\n *\r\n * @method Phaser.Math.Quaternion#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Quaternion by.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n scale: function (scale)\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the length of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Quaternion.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Quaternion squared.\r\n *\r\n * @method Phaser.Math.Quaternion#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Quaternion, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n },\r\n\r\n /**\r\n * Normalize this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var len = x * x + y * y + z * z + w * w;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n this.w = w * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Quaternion and the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#dot\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion.\r\n *\r\n * @return {number} The dot product of this Quaternion and the given Quaternion or Vector.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\r\n },\r\n\r\n /**\r\n * Linearly interpolate this Quaternion towards the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards.\r\n * @param {number} [t=0] - The percentage of interpolation.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n this.w = aw + t * (v.w - aw);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Quaternion#rotationTo\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} a - [description]\r\n * @param {Phaser.Math.Vector3} b - [description]\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotationTo: function (a, b)\r\n {\r\n var dot = a.x * b.x + a.y * b.y + a.z * b.z;\r\n\r\n if (dot < -0.999999)\r\n {\r\n if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON)\r\n {\r\n tmpvec.copy(yUnitVec3).cross(a);\r\n }\r\n\r\n tmpvec.normalize();\r\n\r\n return this.setAxisAngle(tmpvec, Math.PI);\r\n\r\n }\r\n else if (dot > 0.999999)\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 1;\r\n\r\n return this;\r\n }\r\n else\r\n {\r\n tmpvec.copy(a).cross(b);\r\n\r\n this.x = tmpvec.x;\r\n this.y = tmpvec.y;\r\n this.z = tmpvec.z;\r\n this.w = 1 + dot;\r\n\r\n return this.normalize();\r\n }\r\n },\r\n\r\n /**\r\n * Set the axes of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#setAxes\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} view - The view axis.\r\n * @param {Phaser.Math.Vector3} right - The right axis.\r\n * @param {Phaser.Math.Vector3} up - The upwards axis.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n setAxes: function (view, right, up)\r\n {\r\n var m = tmpMat3.val;\r\n\r\n m[0] = right.x;\r\n m[3] = right.y;\r\n m[6] = right.z;\r\n\r\n m[1] = up.x;\r\n m[4] = up.y;\r\n m[7] = up.z;\r\n\r\n m[2] = -view.x;\r\n m[5] = -view.y;\r\n m[8] = -view.z;\r\n\r\n return this.fromMat3(tmpMat3).normalize();\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n identity: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the axis angle of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#setAxisAngle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} axis - The axis.\r\n * @param {number} rad - The angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n setAxisAngle: function (axis, rad)\r\n {\r\n rad = rad * 0.5;\r\n\r\n var s = Math.sin(rad);\r\n\r\n this.x = s * axis.x;\r\n this.y = s * axis.y;\r\n this.z = s * axis.z;\r\n this.w = Math.cos(rad);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply this Quaternion by the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n multiply: function (b)\r\n {\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n var bw = b.w;\r\n\r\n this.x = ax * bw + aw * bx + ay * bz - az * by;\r\n this.y = ay * bw + aw * by + az * bx - ax * bz;\r\n this.z = az * bw + aw * bz + ax * by - ay * bx;\r\n this.w = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#slerp\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards.\r\n * @param {number} t - The percentage of interpolation.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n slerp: function (b, t)\r\n {\r\n // benchmarks: http://jsperf.com/quaternion-slerp-implementations\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n var bw = b.w;\r\n\r\n // calc cosine\r\n var cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n\r\n // adjust signs (if necessary)\r\n if (cosom < 0)\r\n {\r\n cosom = -cosom;\r\n bx = - bx;\r\n by = - by;\r\n bz = - bz;\r\n bw = - bw;\r\n }\r\n\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n var scale0 = 1 - t;\r\n var scale1 = t;\r\n\r\n // calculate coefficients\r\n if ((1 - cosom) > EPSILON)\r\n {\r\n // standard case (slerp)\r\n var omega = Math.acos(cosom);\r\n var sinom = Math.sin(omega);\r\n\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n }\r\n\r\n // calculate final values\r\n this.x = scale0 * ax + scale1 * bx;\r\n this.y = scale0 * ay + scale1 * by;\r\n this.z = scale0 * az + scale1 * bz;\r\n this.w = scale0 * aw + scale1 * bw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n invert: function ()\r\n {\r\n var a0 = this.x;\r\n var a1 = this.y;\r\n var a2 = this.z;\r\n var a3 = this.w;\r\n\r\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n var invDot = (dot) ? 1 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n this.x = -a0 * invDot;\r\n this.y = -a1 * invDot;\r\n this.z = -a2 * invDot;\r\n this.w = a3 * invDot;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Convert this Quaternion into its conjugate.\r\n *\r\n * Sets the x, y and z components.\r\n *\r\n * @method Phaser.Math.Quaternion#conjugate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n conjugate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the X axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateX: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw + aw * bx;\r\n this.y = ay * bw + az * bx;\r\n this.z = az * bw - ay * bx;\r\n this.w = aw * bw - ax * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the Y axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateY: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var by = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw - az * by;\r\n this.y = ay * bw + aw * by;\r\n this.z = az * bw + ax * by;\r\n this.w = aw * bw - ay * by;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the Z axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateZ: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bz = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw + ay * bz;\r\n this.y = ay * bw - ax * bz;\r\n this.z = az * bw + aw * bz;\r\n this.w = aw * bw - az * bz;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Create a unit (or rotation) Quaternion from its x, y, and z components.\r\n *\r\n * Sets the w component.\r\n *\r\n * @method Phaser.Math.Quaternion#calculateW\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n calculateW: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n this.w = -Math.sqrt(1.0 - x * x - y * y - z * z);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Convert the given Matrix into this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#fromMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n fromMat3: function (mat)\r\n {\r\n // benchmarks:\r\n // http://jsperf.com/typed-array-access-speed\r\n // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion\r\n\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n var m = mat.val;\r\n var fTrace = m[0] + m[4] + m[8];\r\n var fRoot;\r\n\r\n if (fTrace > 0)\r\n {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n\r\n this.w = 0.5 * fRoot;\r\n\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n\r\n this.x = (m[7] - m[5]) * fRoot;\r\n this.y = (m[2] - m[6]) * fRoot;\r\n this.z = (m[3] - m[1]) * fRoot;\r\n }\r\n else\r\n {\r\n // |w| <= 1/2\r\n var i = 0;\r\n\r\n if (m[4] > m[0])\r\n {\r\n i = 1;\r\n }\r\n\r\n if (m[8] > m[i * 3 + i])\r\n {\r\n i = 2;\r\n }\r\n\r\n var j = siNext[i];\r\n var k = siNext[j];\r\n\r\n // This isn't quite as clean without array access\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\r\n tmp[i] = 0.5 * fRoot;\r\n\r\n fRoot = 0.5 / fRoot;\r\n\r\n tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n\r\n this.x = tmp[0];\r\n this.y = tmp[1];\r\n this.z = tmp[2];\r\n this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Quaternion;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\n\r\n/**\r\n * Convert the given angle in radians, to the equivalent angle in degrees.\r\n *\r\n * @function Phaser.Math.RadToDeg\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The angle in radians to convert ot degrees.\r\n *\r\n * @return {integer} The given angle converted to degrees.\r\n */\r\nvar RadToDeg = function (radians)\r\n{\r\n return radians * CONST.RAD_TO_DEG;\r\n};\r\n\r\nmodule.exports = RadToDeg;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random unit vector.\r\n *\r\n * Computes random values for the given vector between -1 and 1 that can be used to represent a direction.\r\n *\r\n * Optionally accepts a scale value to scale the resulting vector by.\r\n *\r\n * @function Phaser.Math.RandomXY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for.\r\n * @param {number} [scale=1] - The scale of the random values.\r\n *\r\n * @return {Phaser.Math.Vector2} The given Vector.\r\n */\r\nvar RandomXY = function (vector, scale)\r\n{\r\n if (scale === undefined) { scale = 1; }\r\n\r\n var r = Math.random() * 2 * Math.PI;\r\n\r\n vector.x = Math.cos(r) * scale;\r\n vector.y = Math.sin(r) * scale;\r\n\r\n return vector;\r\n};\r\n\r\nmodule.exports = RandomXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random position vector in a spherical area, optionally defined by the given radius.\r\n *\r\n * @function Phaser.Math.RandomXYZ\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for.\r\n * @param {number} [radius=1] - The radius.\r\n *\r\n * @return {Phaser.Math.Vector3} The given Vector.\r\n */\r\nvar RandomXYZ = function (vec3, radius)\r\n{\r\n if (radius === undefined) { radius = 1; }\r\n\r\n var r = Math.random() * 2 * Math.PI;\r\n var z = (Math.random() * 2) - 1;\r\n var zScale = Math.sqrt(1 - z * z) * radius;\r\n\r\n vec3.x = Math.cos(r) * zScale;\r\n vec3.y = Math.sin(r) * zScale;\r\n vec3.z = z * radius;\r\n\r\n return vec3;\r\n};\r\n\r\nmodule.exports = RandomXYZ;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random four-dimensional vector.\r\n *\r\n * @function Phaser.Math.RandomXYZW\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for.\r\n * @param {number} [scale=1] - The scale of the random values.\r\n *\r\n * @return {Phaser.Math.Vector4} The given Vector.\r\n */\r\nvar RandomXYZW = function (vec4, scale)\r\n{\r\n if (scale === undefined) { scale = 1; }\r\n\r\n // TODO: Not spherical; should fix this for more uniform distribution\r\n vec4.x = (Math.random() * 2 - 1) * scale;\r\n vec4.y = (Math.random() * 2 - 1) * scale;\r\n vec4.z = (Math.random() * 2 - 1) * scale;\r\n vec4.w = (Math.random() * 2 - 1) * scale;\r\n\r\n return vec4;\r\n};\r\n\r\nmodule.exports = RandomXYZW;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction.\r\n *\r\n * @function Phaser.Math.Rotate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} angle - The angle to be rotated by in an anticlockwise direction.\r\n *\r\n * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction.\r\n */\r\nvar Rotate = function (point, angle)\r\n{\r\n var x = point.x;\r\n var y = point.y;\r\n\r\n point.x = (x * Math.cos(angle)) - (y * Math.sin(angle));\r\n point.y = (x * Math.sin(angle)) + (y * Math.cos(angle));\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = Rotate;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a `point` around `x` and `y` by the given `angle`.\r\n *\r\n * @function Phaser.Math.RotateAround\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} x - The horizontal coordinate to rotate around.\r\n * @param {number} y - The vertical coordinate to rotate around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Geom.Point} The given point, rotated by the given angle around the given coordinates.\r\n */\r\nvar RotateAround = function (point, x, y, angle)\r\n{\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n\r\n var tx = point.x - x;\r\n var ty = point.y - y;\r\n\r\n point.x = tx * c - ty * s + x;\r\n point.y = tx * s + ty * c + y;\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = RotateAround;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a `point` around `x` and `y` by the given `angle` and `distance`.\r\n *\r\n * @function Phaser.Math.RotateAroundDistance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} x - The horizontal coordinate to rotate around.\r\n * @param {number} y - The vertical coordinate to rotate around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n * @param {number} distance - The distance from (x, y) to place the point at.\r\n *\r\n * @return {Phaser.Geom.Point} The given point.\r\n */\r\nvar RotateAroundDistance = function (point, x, y, angle, distance)\r\n{\r\n var t = angle + Math.atan2(point.y - y, point.x - x);\r\n\r\n point.x = x + (distance * Math.cos(t));\r\n point.y = y + (distance * Math.sin(t));\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = RotateAroundDistance;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector3 = require('../math/Vector3');\r\nvar Matrix4 = require('../math/Matrix4');\r\nvar Quaternion = require('../math/Quaternion');\r\n\r\nvar tmpMat4 = new Matrix4();\r\nvar tmpQuat = new Quaternion();\r\nvar tmpVec3 = new Vector3();\r\n\r\n/**\r\n * Rotates a vector in place by axis angle.\r\n *\r\n * This is the same as transforming a point by an\r\n * axis-angle quaternion, but it has higher precision.\r\n *\r\n * @function Phaser.Math.RotateVec3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec - The vector to be rotated.\r\n * @param {Phaser.Math.Vector3} axis - The axis to rotate around.\r\n * @param {number} radians - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Math.Vector3} The given vector.\r\n */\r\nvar RotateVec3 = function (vec, axis, radians)\r\n{\r\n // Set the quaternion to our axis angle\r\n tmpQuat.setAxisAngle(axis, radians);\r\n\r\n // Create a rotation matrix from the axis angle\r\n tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0));\r\n\r\n // Multiply our vector by the rotation matrix\r\n return vec.transformMat4(tmpMat4);\r\n};\r\n\r\nmodule.exports = RotateVec3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down.\r\n *\r\n * @function Phaser.Math.RoundAwayFromZero\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to round.\r\n *\r\n * @return {number} The rounded number, rounded away from zero.\r\n */\r\nvar RoundAwayFromZero = function (value)\r\n{\r\n // \"Opposite\" of truncate.\r\n return (value > 0) ? Math.ceil(value) : Math.floor(value);\r\n};\r\n\r\nmodule.exports = RoundAwayFromZero;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Round a value to the given precision.\r\n * \r\n * For example:\r\n * \r\n * ```javascript\r\n * RoundTo(123.456, 0) = 123\r\n * RoundTo(123.456, 1) = 120\r\n * RoundTo(123.456, 2) = 100\r\n * ```\r\n * \r\n * To round the decimal, i.e. to round to precision, pass in a negative `place`:\r\n * \r\n * ```javascript\r\n * RoundTo(123.456789, 0) = 123\r\n * RoundTo(123.456789, -1) = 123.5\r\n * RoundTo(123.456789, -2) = 123.46\r\n * RoundTo(123.456789, -3) = 123.457\r\n * ```\r\n *\r\n * @function Phaser.Math.RoundTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar RoundTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.round(value * p) / p;\r\n};\r\n\r\nmodule.exports = RoundTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Generate a series of sine and cosine values.\r\n *\r\n * @function Phaser.Math.SinCosTableGenerator\r\n * @since 3.0.0\r\n *\r\n * @param {number} length - The number of values to generate.\r\n * @param {number} [sinAmp=1] - The sine value amplitude.\r\n * @param {number} [cosAmp=1] - The cosine value amplitude.\r\n * @param {number} [frequency=1] - The frequency of the values.\r\n *\r\n * @return {Phaser.Types.Math.SinCosTable} The generated values.\r\n */\r\nvar SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency)\r\n{\r\n if (sinAmp === undefined) { sinAmp = 1; }\r\n if (cosAmp === undefined) { cosAmp = 1; }\r\n if (frequency === undefined) { frequency = 1; }\r\n\r\n frequency *= Math.PI / length;\r\n\r\n var cos = [];\r\n var sin = [];\r\n\r\n for (var c = 0; c < length; c++)\r\n {\r\n cosAmp -= sinAmp * frequency;\r\n sinAmp += cosAmp * frequency;\r\n\r\n cos[c] = cosAmp;\r\n sin[c] = sinAmp;\r\n }\r\n\r\n return {\r\n sin: sin,\r\n cos: cos,\r\n length: length\r\n };\r\n};\r\n\r\nmodule.exports = SinCosTableGenerator;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a smooth interpolation percentage of `x` between `min` and `max`.\r\n *\r\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\r\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\r\n * between 0 and 1 otherwise.\r\n *\r\n * @function Phaser.Math.SmoothStep\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\r\n *\r\n * @param {number} x - The input value.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The percentage of interpolation, between 0 and 1.\r\n */\r\nvar SmoothStep = function (x, min, max)\r\n{\r\n if (x <= min)\r\n {\r\n return 0;\r\n }\r\n\r\n if (x >= max)\r\n {\r\n return 1;\r\n }\r\n\r\n x = (x - min) / (max - min);\r\n\r\n return x * x * (3 - 2 * x);\r\n};\r\n\r\nmodule.exports = SmoothStep;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a smoother interpolation percentage of `x` between `min` and `max`.\r\n *\r\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\r\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\r\n * between 0 and 1 otherwise.\r\n *\r\n * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}.\r\n *\r\n * @function Phaser.Math.SmootherStep\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\r\n *\r\n * @param {number} x - The input value.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The percentage of interpolation, between 0 and 1.\r\n */\r\nvar SmootherStep = function (x, min, max)\r\n{\r\n x = Math.max(0, Math.min(1, (x - min) / (max - min)));\r\n\r\n return x * x * x * (x * (x * 6 - 15) + 10);\r\n};\r\n\r\nmodule.exports = SmootherStep;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = require('./Vector2');\r\n\r\n/**\r\n * Returns a Vec2 containing the x and y position of the given index in a `width` x `height` sized grid.\r\n * \r\n * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2.\r\n * \r\n * If the given index is out of range an empty Vec2 is returned.\r\n *\r\n * @function Phaser.Math.ToXY\r\n * @since 3.19.0\r\n *\r\n * @param {integer} index - The position within the grid to get the x/y value for.\r\n * @param {integer} width - The width of the grid.\r\n * @param {integer} height - The height of the grid.\r\n * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index.\r\n */\r\nvar ToXY = function (index, width, height, out)\r\n{\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var x = 0;\r\n var y = 0;\r\n var total = width * height;\r\n\r\n if (index > 0 && index <= total)\r\n {\r\n if (index > width - 1)\r\n {\r\n y = Math.floor(index / width);\r\n x = index - (y * width);\r\n }\r\n else\r\n {\r\n x = index;\r\n }\r\n\r\n out.set(x, y);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ToXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = require('./Vector2');\r\n\r\n/**\r\n * Takes the `x` and `y` coordinates and transforms them into the same space as\r\n * defined by the position, rotation and scale values.\r\n *\r\n * @function Phaser.Math.TransformXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to be transformed.\r\n * @param {number} y - The y coordinate to be transformed.\r\n * @param {number} positionX - Horizontal position of the transform point.\r\n * @param {number} positionY - Vertical position of the transform point.\r\n * @param {number} rotation - Rotation of the transform point, in radians.\r\n * @param {number} scaleX - Horizontal scale of the transform point.\r\n * @param {number} scaleY - Vertical scale of the transform point.\r\n * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point.\r\n */\r\nvar TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output)\r\n{\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var radianSin = Math.sin(rotation);\r\n var radianCos = Math.cos(rotation);\r\n\r\n // Rotate and Scale\r\n var a = radianCos * scaleX;\r\n var b = radianSin * scaleX;\r\n var c = -radianSin * scaleY;\r\n var d = radianCos * scaleY;\r\n\r\n // Invert\r\n var id = 1 / ((a * d) + (c * -b));\r\n\r\n output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id);\r\n output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id);\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = TransformXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 2D space.\r\n *\r\n * A two-component vector.\r\n *\r\n * @class Vector2\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties.\r\n * @param {number} [y] - The y component.\r\n */\r\nvar Vector2 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector2 (x, y)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n }\r\n else\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector2.\r\n *\r\n * @method Phaser.Math.Vector2#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} A clone of this Vector2.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector2(this.x, this.y);\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x || 0;\r\n this.y = src.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the component values of this Vector from a given Vector2Like object.\r\n *\r\n * @method Phaser.Math.Vector2#setFromObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setFromObject: function (obj)\r\n {\r\n this.x = obj.x || 0;\r\n this.y = obj.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x` and `y` components of the this Vector to the given `x` and `y` values.\r\n *\r\n * @method Phaser.Math.Vector2#set\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n set: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This method is an alias for `Vector2.set`.\r\n *\r\n * @method Phaser.Math.Vector2#setTo\r\n * @since 3.4.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setTo: function (x, y)\r\n {\r\n return this.set(x, y);\r\n },\r\n\r\n /**\r\n * Sets the `x` and `y` values of this object from a given polar coordinate.\r\n *\r\n * @method Phaser.Math.Vector2#setToPolar\r\n * @since 3.0.0\r\n *\r\n * @param {number} azimuth - The angular coordinate, in radians.\r\n * @param {number} [radius=1] - The radial coordinate (length).\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setToPolar: function (azimuth, radius)\r\n {\r\n if (radius == null) { radius = 1; }\r\n\r\n this.x = Math.cos(azimuth) * radius;\r\n this.y = Math.sin(azimuth) * radius;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict equality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector2#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} v - The vector to compare with this Vector.\r\n *\r\n * @return {boolean} Whether the given Vector is equal to this Vector.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y));\r\n },\r\n\r\n /**\r\n * Calculate the angle between this Vector and the positive x-axis, in radians.\r\n *\r\n * @method Phaser.Math.Vector2#angle\r\n * @since 3.0.0\r\n *\r\n * @return {number} The angle between this Vector, and the positive x-axis, given in radians.\r\n */\r\n angle: function ()\r\n {\r\n // computes the angle in radians with respect to the positive x-axis\r\n\r\n var angle = Math.atan2(this.y, this.x);\r\n\r\n if (angle < 0)\r\n {\r\n angle += 2 * Math.PI;\r\n }\r\n\r\n return angle;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#add\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n add: function (src)\r\n {\r\n this.x += src.x;\r\n this.y += src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n subtract: function (src)\r\n {\r\n this.x -= src.x;\r\n this.y -= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n multiply: function (src)\r\n {\r\n this.x *= src.x;\r\n this.y *= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector2#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n scale: function (value)\r\n {\r\n if (isFinite(value))\r\n {\r\n this.x *= value;\r\n this.y *= value;\r\n }\r\n else\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#divide\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n divide: function (src)\r\n {\r\n this.x /= src.x;\r\n this.y /= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Negate the `x` and `y` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#distance\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector2#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return dx * dx + dy * dy;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return Math.sqrt(x * x + y * y);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector2#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return x * x + y * y;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector2#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var len = x * x + y * y;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Right-hand normalize (make unit length) this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#normalizeRightHand\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalizeRightHand: function ()\r\n {\r\n var x = this.x;\r\n\r\n this.x = this.y * -1;\r\n this.y = x;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to dot product with this Vector2.\r\n *\r\n * @return {number} The dot product of this Vector and the given Vector.\r\n */\r\n dot: function (src)\r\n {\r\n return this.x * src.x + this.y * src.y;\r\n },\r\n\r\n /**\r\n * Calculate the cross product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#cross\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to cross with this Vector2.\r\n *\r\n * @return {number} The cross product of this Vector and the given Vector.\r\n */\r\n cross: function (src)\r\n {\r\n return this.x * src.y - this.y * src.x;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n lerp: function (src, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n\r\n this.x = ax + t * (src.x - ax);\r\n this.y = ay + t * (src.y - ay);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat3: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[3] * y + m[6];\r\n this.y = m[1] * x + m[4] * y + m[7];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[12];\r\n this.y = m[1] * x + m[5] * y + m[13];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0).\r\n *\r\n * @method Phaser.Math.Vector2#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A static zero Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ZERO\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.1.0\r\n */\r\nVector2.ZERO = new Vector2();\r\n\r\n/**\r\n * A static right Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.RIGHT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.RIGHT = new Vector2(1, 0);\r\n\r\n/**\r\n * A static left Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.LEFT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.LEFT = new Vector2(-1, 0);\r\n\r\n/**\r\n * A static up Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.UP\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.UP = new Vector2(0, -1);\r\n\r\n/**\r\n * A static down Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.DOWN\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.DOWN = new Vector2(0, 1);\r\n\r\n/**\r\n * A static one Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ONE\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.ONE = new Vector2(1, 1);\r\n\r\nmodule.exports = Vector2;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 3D space.\r\n *\r\n * A three-component vector.\r\n *\r\n * @class Vector3\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n */\r\nvar Vector3 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector3 (x, y, z)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The z component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.z = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Set this Vector to point up.\r\n *\r\n * Sets the y component of the vector to 1, and the others to 0.\r\n *\r\n * @method Phaser.Math.Vector3#up\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n up: function ()\r\n {\r\n this.x = 0;\r\n this.y = 1;\r\n this.z = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector3.\r\n *\r\n * @method Phaser.Math.Vector3#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector3(this.x, this.y, this.z);\r\n },\r\n\r\n /**\r\n * Calculate the cross (vector) product of two given Vectors.\r\n *\r\n * @method Phaser.Math.Vector3#crossVectors\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} a - The first Vector to multiply.\r\n * @param {Phaser.Math.Vector3} b - The second Vector to multiply.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n crossVectors: function (a, b)\r\n {\r\n var ax = a.x;\r\n var ay = a.y;\r\n var az = a.z;\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n\r\n this.x = ay * bz - az * by;\r\n this.y = az * bx - ax * bz;\r\n this.z = ax * by - ay * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict equality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector3#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to compare against.\r\n *\r\n * @return {boolean} True if the two vectors strictly match, otherwise false.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z));\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#copy\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values.\r\n *\r\n * @method Phaser.Math.Vector3#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components.\r\n * @param {number} [y] - The y value to set for this Vector.\r\n * @param {number} [z] - The z value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n set: function (x, y, z)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector3#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector3#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n multiply: function (v)\r\n {\r\n this.x *= v.x;\r\n this.y *= v.y;\r\n this.z *= v.z || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector3#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n scale: function (scale)\r\n {\r\n if (isFinite(scale))\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n }\r\n else\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#divide\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n divide: function (v)\r\n {\r\n this.x /= v.x;\r\n this.y /= v.y;\r\n this.z /= v.z || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Negate the `x`, `y` and `z` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#distance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n\r\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector3#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n\r\n return dx * dx + dy * dy + dz * dz;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n return Math.sqrt(x * x + y * y + z * z);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector3#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n return x * x + y * y + z * z;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector3#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var len = x * x + y * y + z * z;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3.\r\n *\r\n * @return {number} The dot product of this Vector and `v`.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z;\r\n },\r\n\r\n /**\r\n * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#cross\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector to cross product with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n cross: function (v)\r\n {\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var bx = v.x;\r\n var by = v.y;\r\n var bz = v.z;\r\n\r\n this.x = ay * bz - az * by;\r\n this.y = az * bx - ax * bz;\r\n this.z = ax * by - ay * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector3#transformMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformMat3: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n this.x = x * m[0] + y * m[3] + z * m[6];\r\n this.y = x * m[1] + y * m[4] + z * m[7];\r\n this.z = x * m[2] + y * m[5] + z * m[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector3#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12];\r\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13];\r\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transforms the coordinates of this Vector3 with the given Matrix4.\r\n *\r\n * @method Phaser.Math.Vector3#transformCoordinates\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformCoordinates: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12];\r\n var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13];\r\n var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14];\r\n var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15];\r\n\r\n this.x = tx / tw;\r\n this.y = ty / tw;\r\n this.z = tz / tw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Quaternion.\r\n *\r\n * @method Phaser.Math.Vector3#transformQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformQuat: function (q)\r\n {\r\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var qx = q.x;\r\n var qy = q.y;\r\n var qz = q.z;\r\n var qw = q.w;\r\n\r\n // calculate quat * vec\r\n var ix = qw * x + qy * z - qz * y;\r\n var iy = qw * y + qz * x - qx * z;\r\n var iz = qw * z + qx * y - qy * x;\r\n var iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection,\r\n * e.g. unprojecting a 2D point into 3D space.\r\n *\r\n * @method Phaser.Math.Vector3#project\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n project: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n var a00 = m[0];\r\n var a01 = m[1];\r\n var a02 = m[2];\r\n var a03 = m[3];\r\n var a10 = m[4];\r\n var a11 = m[5];\r\n var a12 = m[6];\r\n var a13 = m[7];\r\n var a20 = m[8];\r\n var a21 = m[9];\r\n var a22 = m[10];\r\n var a23 = m[11];\r\n var a30 = m[12];\r\n var a31 = m[13];\r\n var a32 = m[14];\r\n var a33 = m[15];\r\n\r\n var lw = 1 / (x * a03 + y * a13 + z * a23 + a33);\r\n\r\n this.x = (x * a00 + y * a10 + z * a20 + a30) * lw;\r\n this.y = (x * a01 + y * a11 + z * a21 + a31) * lw;\r\n this.z = (x * a02 + y * a12 + z * a22 + a32) * lw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Unproject this point from 2D space to 3D space.\r\n * The point should have its x and y properties set to\r\n * 2D screen space, and the z either at 0 (near plane)\r\n * or 1 (far plane). The provided matrix is assumed to already\r\n * be combined, i.e. projection * view * model.\r\n *\r\n * After this operation, this vector's (x, y, z) components will\r\n * represent the unprojected 3D coordinate.\r\n *\r\n * @method Phaser.Math.Vector3#unproject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels.\r\n * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n unproject: function (viewport, invProjectionView)\r\n {\r\n var viewX = viewport.x;\r\n var viewY = viewport.y;\r\n var viewWidth = viewport.z;\r\n var viewHeight = viewport.w;\r\n\r\n var x = this.x - viewX;\r\n var y = (viewHeight - this.y - 1) - viewY;\r\n var z = this.z;\r\n\r\n this.x = (2 * x) / viewWidth - 1;\r\n this.y = (2 * y) / viewHeight - 1;\r\n this.z = 2 * z - 1;\r\n\r\n return this.project(invProjectionView);\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0, 0).\r\n *\r\n * @method Phaser.Math.Vector3#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A static zero Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.ZERO\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.ZERO = new Vector3();\r\n\r\n/**\r\n * A static right Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.RIGHT\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.RIGHT = new Vector3(1, 0, 0);\r\n\r\n/**\r\n * A static left Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.LEFT\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.LEFT = new Vector3(-1, 0, 0);\r\n\r\n/**\r\n * A static up Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.UP\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.UP = new Vector3(0, -1, 0);\r\n\r\n/**\r\n * A static down Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.DOWN\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.DOWN = new Vector3(0, 1, 0);\r\n\r\n/**\r\n * A static forward Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.FORWARD\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.FORWARD = new Vector3(0, 0, 1);\r\n\r\n/**\r\n * A static back Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.BACK\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.BACK = new Vector3(0, 0, -1);\r\n\r\n/**\r\n * A static one Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.ONE\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.ONE = new Vector3(1, 1, 1);\r\n\r\nmodule.exports = Vector3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 4D space.\r\n *\r\n * A four-component vector.\r\n *\r\n * @class Vector4\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n * @param {number} [w] - The w component.\r\n */\r\nvar Vector4 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector4 (x, y, z, w)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The z component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.z = 0;\r\n\r\n /**\r\n * The w component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.w = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector4.\r\n *\r\n * @method Phaser.Math.Vector4#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} A clone of this Vector4.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector4(this.x, this.y, this.z, this.w);\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z || 0;\r\n this.w = src.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict quality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector4#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The vector to check equality with.\r\n *\r\n * @return {boolean} A boolean indicating whether the two Vectors are equal or not.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w));\r\n },\r\n\r\n /**\r\n * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values.\r\n *\r\n * @method Phaser.Math.Vector4#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components.\r\n * @param {number} y - The y value to set for this Vector.\r\n * @param {number} z - The z value to set for this Vector.\r\n * @param {number} w - The z value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n set: function (x, y, z, w)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector4#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z || 0;\r\n this.w += v.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector4#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z || 0;\r\n this.w -= v.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector4#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n scale: function (scale)\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector4#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector4#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var len = x * x + y * y + z * z + w * w;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n this.w = w * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4.\r\n *\r\n * @return {number} The dot product of this Vector and the given Vector.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n this.w = aw + t * (v.w - aw);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n multiply: function (v)\r\n {\r\n this.x *= v.x;\r\n this.y *= v.y;\r\n this.z *= v.z || 1;\r\n this.w *= v.w || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#divide\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n divide: function (v)\r\n {\r\n this.x /= v.x;\r\n this.y /= v.y;\r\n this.z /= v.z || 1;\r\n this.w /= v.w || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#distance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n var dw = v.w - this.w || 0;\r\n\r\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector4#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n var dw = v.w - this.w || 0;\r\n\r\n return dx * dx + dy * dy + dz * dz + dw * dw;\r\n },\r\n\r\n /**\r\n * Negate the `x`, `y`, `z` and `w` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n this.w = -this.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector4#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Quaternion.\r\n *\r\n * @method Phaser.Math.Vector4#transformQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n transformQuat: function (q)\r\n {\r\n // TODO: is this really the same as Vector3?\r\n // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/\r\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var qx = q.x;\r\n var qy = q.y;\r\n var qz = q.z;\r\n var qw = q.w;\r\n\r\n // calculate quat * vec\r\n var ix = qw * x + qy * z - qz * y;\r\n var iy = qw * y + qz * x - qx * z;\r\n var iz = qw * z + qx * y - qy * x;\r\n var iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0, 0, 0).\r\n *\r\n * @method Phaser.Math.Vector4#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n// TODO: Check if these are required internally, if not, remove.\r\nVector4.prototype.sub = Vector4.prototype.subtract;\r\nVector4.prototype.mul = Vector4.prototype.multiply;\r\nVector4.prototype.div = Vector4.prototype.divide;\r\nVector4.prototype.dist = Vector4.prototype.distance;\r\nVector4.prototype.distSq = Vector4.prototype.distanceSq;\r\nVector4.prototype.len = Vector4.prototype.length;\r\nVector4.prototype.lenSq = Vector4.prototype.lengthSq;\r\n\r\nmodule.exports = Vector4;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the two values are within the given `tolerance` of each other.\r\n *\r\n * @function Phaser.Math.Within\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value to use in the calculation.\r\n * @param {number} b - The second value to use in the calculation.\r\n * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range.\r\n *\r\n * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`.\r\n */\r\nvar Within = function (a, b, tolerance)\r\n{\r\n return (Math.abs(a - b) <= tolerance);\r\n};\r\n\r\nmodule.exports = Within;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Wrap the given `value` between `min` and `max.\r\n *\r\n * @function Phaser.Math.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to wrap.\r\n * @param {number} min - The minimum value.\r\n * @param {number} max - The maximum value.\r\n *\r\n * @return {number} The wrapped value.\r\n */\r\nvar Wrap = function (value, min, max)\r\n{\r\n var range = max - min;\r\n\r\n return (min + ((((value - min) % range) + range) % range));\r\n};\r\n\r\nmodule.exports = Wrap;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\r\n *\r\n * @function Phaser.Math.Angle.Between\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar Between = function (x1, y1, x2, y2)\r\n{\r\n return Math.atan2(y2 - y1, x2 - x1);\r\n};\r\n\r\nmodule.exports = Between;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\r\n *\r\n * Calculates the angle of the vector from the first point to the second point.\r\n *\r\n * @function Phaser.Math.Angle.BetweenPoints\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point1 - The first point.\r\n * @param {(Phaser.Geom.Point|object)} point2 - The second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenPoints = function (point1, point2)\r\n{\r\n return Math.atan2(point2.y - point1.y, point2.x - point1.x);\r\n};\r\n\r\nmodule.exports = BetweenPoints;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\r\n *\r\n * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate\r\n * travels down the screen.\r\n *\r\n * @function Phaser.Math.Angle.BetweenPointsY\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point1 - The first point.\r\n * @param {(Phaser.Geom.Point|object)} point2 - The second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenPointsY = function (point1, point2)\r\n{\r\n return Math.atan2(point2.x - point1.x, point2.y - point1.y);\r\n};\r\n\r\nmodule.exports = BetweenPointsY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\r\n *\r\n * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate\r\n * travels down the screen.\r\n *\r\n * @function Phaser.Math.Angle.BetweenY\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenY = function (x1, y1, x2, y2)\r\n{\r\n return Math.atan2(x2 - x1, y2 - y1);\r\n};\r\n\r\nmodule.exports = BetweenY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('../const');\r\n\r\n/**\r\n * Takes an angle in Phasers default clockwise format and converts it so that\r\n * 0 is North, 90 is West, 180 is South and 270 is East,\r\n * therefore running counter-clockwise instead of clockwise.\r\n * \r\n * You can pass in the angle from a Game Object using:\r\n * \r\n * ```javascript\r\n * var converted = CounterClockwise(gameobject.rotation);\r\n * ```\r\n * \r\n * All values for this function are in radians.\r\n *\r\n * @function Phaser.Math.Angle.CounterClockwise\r\n * @since 3.16.0\r\n *\r\n * @param {number} angle - The angle to convert, in radians.\r\n *\r\n * @return {number} The converted angle, in radians.\r\n */\r\nvar CounterClockwise = function (angle)\r\n{\r\n if (angle > Math.PI)\r\n {\r\n angle -= CONST.PI2;\r\n }\r\n\r\n return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2);\r\n};\r\n\r\nmodule.exports = CounterClockwise;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Normalize an angle to the [0, 2pi] range.\r\n *\r\n * @function Phaser.Math.Angle.Normalize\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to normalize, in radians.\r\n *\r\n * @return {number} The normalized angle, in radians.\r\n */\r\nvar Normalize = function (angle)\r\n{\r\n angle = angle % (2 * Math.PI);\r\n\r\n if (angle >= 0)\r\n {\r\n return angle;\r\n }\r\n else\r\n {\r\n return angle + 2 * Math.PI;\r\n }\r\n};\r\n\r\nmodule.exports = Normalize;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Normalize = require('./Normalize');\r\n\r\n/**\r\n * Reverse the given angle.\r\n *\r\n * @function Phaser.Math.Angle.Reverse\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to reverse, in radians.\r\n *\r\n * @return {number} The reversed angle, in radians.\r\n */\r\nvar Reverse = function (angle)\r\n{\r\n return Normalize(angle + Math.PI);\r\n};\r\n\r\nmodule.exports = Reverse;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = require('../const');\r\n\r\n/**\r\n * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call.\r\n *\r\n * @function Phaser.Math.Angle.RotateTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} currentAngle - The current angle, in radians.\r\n * @param {number} targetAngle - The target angle to rotate to, in radians.\r\n * @param {number} [lerp=0.05] - The lerp value to add to the current angle.\r\n *\r\n * @return {number} The adjusted angle.\r\n */\r\nvar RotateTo = function (currentAngle, targetAngle, lerp)\r\n{\r\n if (lerp === undefined) { lerp = 0.05; }\r\n\r\n if (currentAngle === targetAngle)\r\n {\r\n return currentAngle;\r\n }\r\n\r\n if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp))\r\n {\r\n currentAngle = targetAngle;\r\n }\r\n else\r\n {\r\n if (Math.abs(targetAngle - currentAngle) > Math.PI)\r\n {\r\n if (targetAngle < currentAngle)\r\n {\r\n targetAngle += MATH_CONST.PI2;\r\n }\r\n else\r\n {\r\n targetAngle -= MATH_CONST.PI2;\r\n }\r\n }\r\n\r\n if (targetAngle > currentAngle)\r\n {\r\n currentAngle += lerp;\r\n }\r\n else if (targetAngle < currentAngle)\r\n {\r\n currentAngle -= lerp;\r\n }\r\n }\r\n\r\n return currentAngle;\r\n};\r\n\r\nmodule.exports = RotateTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Gets the shortest angle between `angle1` and `angle2`.\r\n *\r\n * Both angles must be in the range -180 to 180, which is the same clamped\r\n * range that `sprite.angle` uses, so you can pass in two sprite angles to\r\n * this method and get the shortest angle back between the two of them.\r\n *\r\n * The angle returned will be in the same range. If the returned angle is\r\n * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's\r\n * a clockwise rotation.\r\n *\r\n * TODO: Wrap the angles in this function?\r\n *\r\n * @function Phaser.Math.Angle.ShortestBetween\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle1 - The first angle in the range -180 to 180.\r\n * @param {number} angle2 - The second angle in the range -180 to 180.\r\n *\r\n * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation.\r\n */\r\nvar ShortestBetween = function (angle1, angle2)\r\n{\r\n var difference = angle2 - angle1;\r\n\r\n if (difference === 0)\r\n {\r\n return 0;\r\n }\r\n\r\n var times = Math.floor((difference - (-180)) / 360);\r\n\r\n return difference - (times * 360);\r\n\r\n};\r\n\r\nmodule.exports = ShortestBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MathWrap = require('../Wrap');\r\n\r\n/**\r\n * Wrap an angle.\r\n *\r\n * Wraps the angle to a value in the range of -PI to PI.\r\n *\r\n * @function Phaser.Math.Angle.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in radians.\r\n *\r\n * @return {number} The wrapped angle, in radians.\r\n */\r\nvar Wrap = function (angle)\r\n{\r\n return MathWrap(angle, -Math.PI, Math.PI);\r\n};\r\n\r\nmodule.exports = Wrap;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Wrap = require('../Wrap');\r\n\r\n/**\r\n * Wrap an angle in degrees.\r\n *\r\n * Wraps the angle to a value in the range of -180 to 180.\r\n *\r\n * @function Phaser.Math.Angle.WrapDegrees\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in degrees.\r\n *\r\n * @return {number} The wrapped angle, in degrees.\r\n */\r\nvar WrapDegrees = function (angle)\r\n{\r\n return Wrap(angle, -180, 180);\r\n};\r\n\r\nmodule.exports = WrapDegrees;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Angle\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Between: require('./Between'),\r\n BetweenPoints: require('./BetweenPoints'),\r\n BetweenPointsY: require('./BetweenPointsY'),\r\n BetweenY: require('./BetweenY'),\r\n CounterClockwise: require('./CounterClockwise'),\r\n Normalize: require('./Normalize'),\r\n Reverse: require('./Reverse'),\r\n RotateTo: require('./RotateTo'),\r\n ShortestBetween: require('./ShortestBetween'),\r\n Wrap: require('./Wrap'),\r\n WrapDegrees: require('./WrapDegrees')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = {\r\n\r\n /**\r\n * The value of PI * 2.\r\n * \r\n * @name Phaser.Math.PI2\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n PI2: Math.PI * 2,\r\n\r\n /**\r\n * The value of PI * 0.5.\r\n * \r\n * @name Phaser.Math.TAU\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n TAU: Math.PI * 0.5,\r\n\r\n /**\r\n * An epsilon value (1.0e-6)\r\n * \r\n * @name Phaser.Math.EPSILON\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n EPSILON: 1.0e-6,\r\n\r\n /**\r\n * For converting degrees to radians (PI / 180)\r\n * \r\n * @name Phaser.Math.DEG_TO_RAD\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n DEG_TO_RAD: Math.PI / 180,\r\n\r\n /**\r\n * For converting radians to degrees (180 / PI)\r\n * \r\n * @name Phaser.Math.RAD_TO_DEG\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n RAD_TO_DEG: 180 / Math.PI,\r\n\r\n /**\r\n * An instance of the Random Number Generator.\r\n * This is not set until the Game boots.\r\n * \r\n * @name Phaser.Math.RND\r\n * @type {Phaser.Math.RandomDataGenerator}\r\n * @since 3.0.0\r\n */\r\n RND: null\r\n\r\n};\r\n\r\nmodule.exports = MATH_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points).\r\n *\r\n * @function Phaser.Math.Distance.Between\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar DistanceBetween = function (x1, y1, x2, y2)\r\n{\r\n var dx = x1 - x2;\r\n var dy = y1 - y2;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n};\r\n\r\nmodule.exports = DistanceBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points) to the power of `pow`.\r\n *\r\n * @function Phaser.Math.Distance.Power\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n * @param {number} pow - The exponent.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar DistancePower = function (x1, y1, x2, y2, pow)\r\n{\r\n if (pow === undefined) { pow = 2; }\r\n\r\n return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow));\r\n};\r\n\r\nmodule.exports = DistancePower;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points), squared.\r\n *\r\n * @function Phaser.Math.Distance.Squared\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point, squared.\r\n */\r\nvar DistanceSquared = function (x1, y1, x2, y2)\r\n{\r\n var dx = x1 - x2;\r\n var dy = y1 - y2;\r\n\r\n return dx * dx + dy * dy;\r\n};\r\n\r\nmodule.exports = DistanceSquared;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Distance\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Between: require('./DistanceBetween'),\r\n Power: require('./DistancePower'),\r\n Squared: require('./DistanceSquared')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Back.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n return v * v * ((overshoot + 1) * v - overshoot);\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Back.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n var s = overshoot * 1.525;\r\n\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * (v * v * ((s + 1) * v - s));\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Back.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n return --v * v * ((overshoot + 1) * v + overshoot) + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Back\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n v = 1 - v;\r\n\r\n if (v < 1 / 2.75)\r\n {\r\n return 1 - (7.5625 * v * v);\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75);\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375);\r\n }\r\n else\r\n {\r\n return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375);\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n var reverse = false;\r\n\r\n if (v < 0.5)\r\n {\r\n v = 1 - (v * 2);\r\n reverse = true;\r\n }\r\n else\r\n {\r\n v = (v * 2) - 1;\r\n }\r\n\r\n if (v < 1 / 2.75)\r\n {\r\n v = 7.5625 * v * v;\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\r\n }\r\n else\r\n {\r\n v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\r\n }\r\n\r\n if (reverse)\r\n {\r\n return (1 - v) * 0.5;\r\n }\r\n else\r\n {\r\n return v * 0.5 + 0.5;\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n if (v < 1 / 2.75)\r\n {\r\n return 7.5625 * v * v;\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\r\n }\r\n else\r\n {\r\n return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Bounce\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Circular.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return 1 - Math.sqrt(1 - v * v);\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Circular.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return -0.5 * (Math.sqrt(1 - v * v) - 1);\r\n }\r\n else\r\n {\r\n return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Circular.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return Math.sqrt(1 - (--v * v));\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Circular\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v;\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * v + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return --v * v * v + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Cubic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n if ((v *= 2) < 1)\r\n {\r\n return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\r\n }\r\n else\r\n {\r\n return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1);\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Elastic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Expo.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return Math.pow(2, 10 * (v - 1)) - 0.001;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Expo.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * Math.pow(2, 10 * (v - 1));\r\n }\r\n else\r\n {\r\n return 0.5 * (2 - Math.pow(2, -10 * (v - 1)));\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Expo.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return 1 - Math.pow(2, -10 * v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Expo\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Back: require('./back'),\r\n Bounce: require('./bounce'),\r\n Circular: require('./circular'),\r\n Cubic: require('./cubic'),\r\n Elastic: require('./elastic'),\r\n Expo: require('./expo'),\r\n Linear: require('./linear'),\r\n Quadratic: require('./quadratic'),\r\n Quartic: require('./quartic'),\r\n Quintic: require('./quintic'),\r\n Sine: require('./sine'),\r\n Stepped: require('./stepped')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Linear easing (no variation).\r\n *\r\n * @function Phaser.Math.Easing.Linear.Linear\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Linear = function (v)\r\n{\r\n return v;\r\n};\r\n\r\nmodule.exports = Linear;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Linear\r\n */\r\n\r\nmodule.exports = require('./Linear');\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v;\r\n }\r\n else\r\n {\r\n return -0.5 * (--v * (v - 2) - 1);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return v * (2 - v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quadratic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v * v;\r\n }\r\n else\r\n {\r\n return -0.5 * ((v -= 2) * v * v * v - 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return 1 - (--v * v * v * v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quartic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v * v * v;\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * v * v * v + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return --v * v * v * v * v + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quintic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Sine.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 1 - Math.cos(v * Math.PI / 2);\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Sine.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 0.5 * (1 - Math.cos(Math.PI * v));\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Sine.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return Math.sin(v * Math.PI / 2);\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Sine\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Stepped easing.\r\n *\r\n * @function Phaser.Math.Easing.Stepped.Stepped\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [steps=1] - The number of steps in the ease.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Stepped = function (v, steps)\r\n{\r\n if (steps === undefined) { steps = 1; }\r\n\r\n if (v <= 0)\r\n {\r\n return 0;\r\n }\r\n else if (v >= 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return (((steps * v) | 0) + 1) * (1 / steps);\r\n }\r\n};\r\n\r\nmodule.exports = Stepped;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Stepped\r\n */\r\n\r\nmodule.exports = require('./Stepped');\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the fuzzy ceiling of the given value.\r\n *\r\n * @function Phaser.Math.Fuzzy.Ceil\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {number} The fuzzy ceiling of the value.\r\n */\r\nvar Ceil = function (value, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.ceil(value - epsilon);\r\n};\r\n\r\nmodule.exports = Ceil;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether the given values are fuzzily equal.\r\n *\r\n * Two numbers are fuzzily equal if their difference is less than `epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.Equal\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`.\r\n */\r\nvar Equal = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.abs(a - b) < epsilon;\r\n};\r\n\r\nmodule.exports = Equal;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the fuzzy floor of the given value.\r\n *\r\n * @function Phaser.Math.Fuzzy.Floor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {number} The floor of the value.\r\n */\r\nvar Floor = function (value, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.floor(value + epsilon);\r\n};\r\n\r\nmodule.exports = Floor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether `a` is fuzzily greater than `b`.\r\n *\r\n * `a` is fuzzily greater than `b` if it is more than `b - epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.GreaterThan\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`.\r\n */\r\nvar GreaterThan = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return a > b - epsilon;\r\n};\r\n\r\nmodule.exports = GreaterThan;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether `a` is fuzzily less than `b`.\r\n *\r\n * `a` is fuzzily less than `b` if it is less than `b + epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.LessThan\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`.\r\n */\r\nvar LessThan = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return a < b + epsilon;\r\n};\r\n\r\nmodule.exports = LessThan;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Fuzzy\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Ceil: require('./Ceil'),\r\n Equal: require('./Equal'),\r\n Floor: require('./Floor'),\r\n GreaterThan: require('./GreaterThan'),\r\n LessThan: require('./LessThan')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\nvar Extend = require('../utils/object/Extend');\r\n\r\n/**\r\n * @namespace Phaser.Math\r\n */\r\n\r\nvar PhaserMath = {\r\n\r\n // Collections of functions\r\n Angle: require('./angle/'),\r\n Distance: require('./distance/'),\r\n Easing: require('./easing/'),\r\n Fuzzy: require('./fuzzy/'),\r\n Interpolation: require('./interpolation/'),\r\n Pow2: require('./pow2/'),\r\n Snap: require('./snap/'),\r\n\r\n // Expose the RNG Class\r\n RandomDataGenerator: require('./random-data-generator/RandomDataGenerator'),\r\n\r\n // Single functions\r\n Average: require('./Average'),\r\n Bernstein: require('./Bernstein'),\r\n Between: require('./Between'),\r\n CatmullRom: require('./CatmullRom'),\r\n CeilTo: require('./CeilTo'),\r\n Clamp: require('./Clamp'),\r\n DegToRad: require('./DegToRad'),\r\n Difference: require('./Difference'),\r\n Factorial: require('./Factorial'),\r\n FloatBetween: require('./FloatBetween'),\r\n FloorTo: require('./FloorTo'),\r\n FromPercent: require('./FromPercent'),\r\n GetSpeed: require('./GetSpeed'),\r\n IsEven: require('./IsEven'),\r\n IsEvenStrict: require('./IsEvenStrict'),\r\n Linear: require('./Linear'),\r\n MaxAdd: require('./MaxAdd'),\r\n MinSub: require('./MinSub'),\r\n Percent: require('./Percent'),\r\n RadToDeg: require('./RadToDeg'),\r\n RandomXY: require('./RandomXY'),\r\n RandomXYZ: require('./RandomXYZ'),\r\n RandomXYZW: require('./RandomXYZW'),\r\n Rotate: require('./Rotate'),\r\n RotateAround: require('./RotateAround'),\r\n RotateAroundDistance: require('./RotateAroundDistance'),\r\n RoundAwayFromZero: require('./RoundAwayFromZero'),\r\n RoundTo: require('./RoundTo'),\r\n SinCosTableGenerator: require('./SinCosTableGenerator'),\r\n SmootherStep: require('./SmootherStep'),\r\n SmoothStep: require('./SmoothStep'),\r\n ToXY: require('./ToXY'),\r\n TransformXY: require('./TransformXY'),\r\n Within: require('./Within'),\r\n Wrap: require('./Wrap'),\r\n\r\n // Vector classes\r\n Vector2: require('./Vector2'),\r\n Vector3: require('./Vector3'),\r\n Vector4: require('./Vector4'),\r\n Matrix3: require('./Matrix3'),\r\n Matrix4: require('./Matrix4'),\r\n Quaternion: require('./Quaternion'),\r\n RotateVec3: require('./RotateVec3')\r\n\r\n};\r\n\r\n// Merge in the consts\r\n\r\nPhaserMath = Extend(false, PhaserMath, CONST);\r\n\r\n// Export it\r\n\r\nmodule.exports = PhaserMath;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bernstein = require('../Bernstein');\r\n\r\n/**\r\n * A bezier interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.Bezier\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar BezierInterpolation = function (v, k)\r\n{\r\n var b = 0;\r\n var n = v.length - 1;\r\n\r\n for (var i = 0; i <= n; i++)\r\n {\r\n b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i);\r\n }\r\n\r\n return b;\r\n};\r\n\r\nmodule.exports = BezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CatmullRom = require('../CatmullRom');\r\n\r\n/**\r\n * A Catmull-Rom interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.CatmullRom\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar CatmullRomInterpolation = function (v, k)\r\n{\r\n var m = v.length - 1;\r\n var f = m * k;\r\n var i = Math.floor(f);\r\n\r\n if (v[0] === v[m])\r\n {\r\n if (k < 0)\r\n {\r\n i = Math.floor(f = m * (1 + k));\r\n }\r\n\r\n return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]);\r\n }\r\n else\r\n {\r\n if (k < 0)\r\n {\r\n return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]);\r\n }\r\n\r\n if (k > 1)\r\n {\r\n return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]);\r\n }\r\n\r\n 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]);\r\n }\r\n};\r\n\r\nmodule.exports = CatmullRomInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P0 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return k * k * k * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P1 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return 3 * k * k * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P2 (t, p)\r\n{\r\n return 3 * (1 - t) * t * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P3 (t, p)\r\n{\r\n return t * t * t * p;\r\n}\r\n\r\n/**\r\n * A cubic bezier interpolation method.\r\n *\r\n * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a\r\n *\r\n * @function Phaser.Math.Interpolation.CubicBezier\r\n * @since 3.0.0\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} p0 - The start point.\r\n * @param {number} p1 - The first control point.\r\n * @param {number} p2 - The second control point.\r\n * @param {number} p3 - The end point.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar CubicBezierInterpolation = function (t, p0, p1, p2, p3)\r\n{\r\n return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3);\r\n};\r\n\r\nmodule.exports = CubicBezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Linear = require('../Linear');\r\n\r\n/**\r\n * A linear interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.Linear\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation}\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {!number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {!number} The interpolated value.\r\n */\r\nvar LinearInterpolation = function (v, k)\r\n{\r\n var m = v.length - 1;\r\n var f = m * k;\r\n var i = Math.floor(f);\r\n\r\n if (k < 0)\r\n {\r\n return Linear(v[0], v[1], f);\r\n }\r\n else if (k > 1)\r\n {\r\n return Linear(v[m], v[m - 1], m - f);\r\n }\r\n else\r\n {\r\n return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i);\r\n }\r\n};\r\n\r\nmodule.exports = LinearInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P0 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return k * k * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P1 (t, p)\r\n{\r\n return 2 * (1 - t) * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P2 (t, p)\r\n{\r\n return t * t * p;\r\n}\r\n\r\n// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js\r\n\r\n/**\r\n * A quadratic bezier interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.QuadraticBezier\r\n * @since 3.2.0\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} p0 - The start point.\r\n * @param {number} p1 - The control point.\r\n * @param {number} p2 - The end point.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar QuadraticBezierInterpolation = function (t, p0, p1, p2)\r\n{\r\n return P0(t, p0) + P1(t, p1) + P2(t, p2);\r\n};\r\n\r\nmodule.exports = QuadraticBezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SmoothStep = require('../SmoothStep');\r\n\r\n/**\r\n * A Smooth Step interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.SmoothStep\r\n * @since 3.9.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar SmoothStepInterpolation = function (t, min, max)\r\n{\r\n return min + (max - min) * SmoothStep(t, 0, 1);\r\n};\r\n\r\nmodule.exports = SmoothStepInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SmootherStep = require('../SmootherStep');\r\n\r\n/**\r\n * A Smoother Step interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.SmootherStep\r\n * @since 3.9.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar SmootherStepInterpolation = function (t, min, max)\r\n{\r\n return min + (max - min) * SmootherStep(t, 0, 1);\r\n};\r\n\r\nmodule.exports = SmootherStepInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Interpolation\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Bezier: require('./BezierInterpolation'),\r\n CatmullRom: require('./CatmullRomInterpolation'),\r\n CubicBezier: require('./CubicBezierInterpolation'),\r\n Linear: require('./LinearInterpolation'),\r\n QuadraticBezier: require('./QuadraticBezierInterpolation'),\r\n SmoothStep: require('./SmoothStepInterpolation'),\r\n SmootherStep: require('./SmootherStepInterpolation')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the nearest power of 2 to the given `value`.\r\n *\r\n * @function Phaser.Math.Pow2.GetPowerOfTwo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n *\r\n * @return {integer} The nearest power of 2 to `value`.\r\n */\r\nvar GetPowerOfTwo = function (value)\r\n{\r\n var index = Math.log(value) / 0.6931471805599453;\r\n\r\n return (1 << Math.ceil(index));\r\n};\r\n\r\nmodule.exports = GetPowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the given `width` and `height` are a power of two.\r\n * Useful for checking texture dimensions.\r\n *\r\n * @function Phaser.Math.Pow2.IsSizePowerOfTwo\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width.\r\n * @param {number} height - The height.\r\n *\r\n * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`.\r\n */\r\nvar IsSizePowerOfTwo = function (width, height)\r\n{\r\n return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0);\r\n};\r\n\r\nmodule.exports = IsSizePowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Tests the value and returns `true` if it is a power of two.\r\n *\r\n * @function Phaser.Math.Pow2.IsValuePowerOfTwo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to check if it's a power of two.\r\n *\r\n * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`.\r\n */\r\nvar IsValuePowerOfTwo = function (value)\r\n{\r\n return (value > 0 && (value & (value - 1)) === 0);\r\n};\r\n\r\nmodule.exports = IsValuePowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Pow2\r\n */\r\n\r\nmodule.exports = {\r\n\r\n GetNext: require('./GetPowerOfTwo'),\r\n IsSize: require('./IsSizePowerOfTwo'),\r\n IsValue: require('./IsValuePowerOfTwo')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A seeded Random Data Generator.\r\n * \r\n * Access via `Phaser.Math.RND` which is an instance of this class pre-defined\r\n * by Phaser. Or, create your own instance to use as you require.\r\n * \r\n * The `Math.RND` generator is seeded by the Game Config property value `seed`.\r\n * If no such config property exists, a random number is used.\r\n * \r\n * If you create your own instance of this class you should provide a seed for it.\r\n * If no seed is given it will use a 'random' one based on Date.now.\r\n *\r\n * @class RandomDataGenerator\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} [seeds] - The seeds to use for the random number generator.\r\n */\r\nvar RandomDataGenerator = new Class({\r\n\r\n initialize:\r\n\r\n function RandomDataGenerator (seeds)\r\n {\r\n if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; }\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#c\r\n * @type {number}\r\n * @default 1\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.c = 1;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s0\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s0 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s1\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s1 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s2\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s2 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#n\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.2.0\r\n */\r\n this.n = 0;\r\n\r\n /**\r\n * Signs to choose from.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#signs\r\n * @type {number[]}\r\n * @since 3.0.0\r\n */\r\n this.signs = [ -1, 1 ];\r\n\r\n if (seeds)\r\n {\r\n this.init(seeds);\r\n }\r\n },\r\n\r\n /**\r\n * Private random helper.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#rnd\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @return {number} A random number.\r\n */\r\n rnd: function ()\r\n {\r\n var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32\r\n\r\n this.c = t | 0;\r\n this.s0 = this.s1;\r\n this.s1 = this.s2;\r\n this.s2 = t - this.c;\r\n\r\n return this.s2;\r\n },\r\n\r\n /**\r\n * Internal method that creates a seed hash.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#hash\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {string} data - The value to hash.\r\n *\r\n * @return {number} The hashed value.\r\n */\r\n hash: function (data)\r\n {\r\n var h;\r\n var n = this.n;\r\n\r\n data = data.toString();\r\n\r\n for (var i = 0; i < data.length; i++)\r\n {\r\n n += data.charCodeAt(i);\r\n h = 0.02519603282416938 * n;\r\n n = h >>> 0;\r\n h -= n;\r\n h *= n;\r\n n = h >>> 0;\r\n h -= n;\r\n n += h * 0x100000000;// 2^32\r\n }\r\n\r\n this.n = n;\r\n\r\n return (n >>> 0) * 2.3283064365386963e-10;// 2^-32\r\n },\r\n\r\n /**\r\n * Initialize the state of the random data generator.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#init\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} seeds - The seeds to initialize the random data generator with.\r\n */\r\n init: function (seeds)\r\n {\r\n if (typeof seeds === 'string')\r\n {\r\n this.state(seeds);\r\n }\r\n else\r\n {\r\n this.sow(seeds);\r\n }\r\n },\r\n\r\n /**\r\n * Reset the seed of the random data generator.\r\n *\r\n * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#sow\r\n * @since 3.0.0\r\n *\r\n * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used.\r\n */\r\n sow: function (seeds)\r\n {\r\n // Always reset to default seed\r\n this.n = 0xefc8249d;\r\n this.s0 = this.hash(' ');\r\n this.s1 = this.hash(' ');\r\n this.s2 = this.hash(' ');\r\n this.c = 1;\r\n\r\n if (!seeds)\r\n {\r\n return;\r\n }\r\n\r\n // Apply any seeds\r\n for (var i = 0; i < seeds.length && (seeds[i] != null); i++)\r\n {\r\n var seed = seeds[i];\r\n\r\n this.s0 -= this.hash(seed);\r\n this.s0 += ~~(this.s0 < 0);\r\n this.s1 -= this.hash(seed);\r\n this.s1 += ~~(this.s1 < 0);\r\n this.s2 -= this.hash(seed);\r\n this.s2 += ~~(this.s2 < 0);\r\n }\r\n },\r\n\r\n /**\r\n * Returns a random integer between 0 and 2^32.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#integer\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random integer between 0 and 2^32.\r\n */\r\n integer: function ()\r\n {\r\n // 2^32\r\n return this.rnd() * 0x100000000;\r\n },\r\n\r\n /**\r\n * Returns a random real number between 0 and 1.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#frac\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between 0 and 1.\r\n */\r\n frac: function ()\r\n {\r\n // 2^-53\r\n return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16;\r\n },\r\n\r\n /**\r\n * Returns a random real number between 0 and 2^32.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#real\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between 0 and 2^32.\r\n */\r\n real: function ()\r\n {\r\n return this.integer() + this.frac();\r\n },\r\n\r\n /**\r\n * Returns a random integer between and including min and max.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#integerInRange\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n integerInRange: function (min, max)\r\n {\r\n return Math.floor(this.realInRange(0, max - min + 1) + min);\r\n },\r\n\r\n /**\r\n * Returns a random integer between and including min and max.\r\n * This method is an alias for RandomDataGenerator.integerInRange.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#between\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n between: function (min, max)\r\n {\r\n return Math.floor(this.realInRange(0, max - min + 1) + min);\r\n },\r\n\r\n /**\r\n * Returns a random real number between min and max.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#realInRange\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n realInRange: function (min, max)\r\n {\r\n return this.frac() * (max - min) + min;\r\n },\r\n\r\n /**\r\n * Returns a random real number between -1 and 1.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#normal\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between -1 and 1.\r\n */\r\n normal: function ()\r\n {\r\n return 1 - (2 * this.frac());\r\n },\r\n\r\n /**\r\n * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#uuid\r\n * @since 3.0.0\r\n *\r\n * @return {string} A valid RFC4122 version4 ID hex string\r\n */\r\n uuid: function ()\r\n {\r\n var a = '';\r\n var b = '';\r\n\r\n for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-')\r\n {\r\n // eslint-disable-next-line no-empty\r\n }\r\n\r\n return b;\r\n },\r\n\r\n /**\r\n * Returns a random element from within the given array.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#pick\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to pick a random element from.\r\n *\r\n * @return {*} A random member of the array.\r\n */\r\n pick: function (array)\r\n {\r\n return array[this.integerInRange(0, array.length - 1)];\r\n },\r\n\r\n /**\r\n * Returns a sign to be used with multiplication operator.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#sign\r\n * @since 3.0.0\r\n *\r\n * @return {number} -1 or +1.\r\n */\r\n sign: function ()\r\n {\r\n return this.pick(this.signs);\r\n },\r\n\r\n /**\r\n * Returns a random element from within the given array, favoring the earlier entries.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#weightedPick\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to pick a random element from.\r\n *\r\n * @return {*} A random member of the array.\r\n */\r\n weightedPick: function (array)\r\n {\r\n return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)];\r\n },\r\n\r\n /**\r\n * 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.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#timestamp\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random timestamp between min and max.\r\n */\r\n timestamp: function (min, max)\r\n {\r\n return this.realInRange(min || 946684800000, max || 1577862000000);\r\n },\r\n\r\n /**\r\n * Returns a random angle between -180 and 180.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#angle\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random number between -180 and 180.\r\n */\r\n angle: function ()\r\n {\r\n return this.integerInRange(-180, 180);\r\n },\r\n\r\n /**\r\n * Returns a random rotation in radians, between -3.141 and 3.141\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#rotation\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random number between -3.141 and 3.141\r\n */\r\n rotation: function ()\r\n {\r\n return this.realInRange(-3.1415926, 3.1415926);\r\n },\r\n\r\n /**\r\n * Gets or Sets the state of the generator. This allows you to retain the values\r\n * that the generator is using between games, i.e. in a game save file.\r\n *\r\n * To seed this generator with a previously saved state you can pass it as the\r\n * `seed` value in your game config, or call this method directly after Phaser has booted.\r\n *\r\n * Call this method with no parameters to return the current state.\r\n *\r\n * If providing a state it should match the same format that this method\r\n * returns, which is a string with a header `!rnd` followed by the `c`,\r\n * `s0`, `s1` and `s2` values respectively, each comma-delimited.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#state\r\n * @since 3.0.0\r\n *\r\n * @param {string} [state] - Generator state to be set.\r\n *\r\n * @return {string} The current state of the generator.\r\n */\r\n state: function (state)\r\n {\r\n if (typeof state === 'string' && state.match(/^!rnd/))\r\n {\r\n state = state.split(',');\r\n\r\n this.c = parseFloat(state[1]);\r\n this.s0 = parseFloat(state[2]);\r\n this.s1 = parseFloat(state[3]);\r\n this.s2 = parseFloat(state[4]);\r\n }\r\n\r\n return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(',');\r\n },\r\n\r\n /**\r\n * Shuffles the given array, using the current seed.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#shuffle\r\n * @since 3.7.0\r\n *\r\n * @param {array} [array] - The array to be shuffled.\r\n *\r\n * @return {array} The shuffled array.\r\n */\r\n shuffle: function (array)\r\n {\r\n var len = array.length - 1;\r\n\r\n for (var i = len; i > 0; i--)\r\n {\r\n var randomIndex = Math.floor(this.frac() * (i + 1));\r\n var itemAtIndex = array[randomIndex];\r\n\r\n array[randomIndex] = array[i];\r\n array[i] = itemAtIndex;\r\n }\r\n\r\n return array;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = RandomDataGenerator;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using ceil.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`.\r\n * As will `14` snap to `15`... but `16` will snap to `20`.\r\n *\r\n * @function Phaser.Math.Snap.Ceil\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapCeil = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.ceil(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapCeil;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using floor.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`.\r\n * As will `14` snap to `10`... but `16` will snap to `15`.\r\n *\r\n * @function Phaser.Math.Snap.Floor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapFloor = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.floor(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapFloor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using rounding.\r\n *\r\n * 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`.\r\n *\r\n * @function Phaser.Math.Snap.To\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapTo = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.round(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Snap\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Ceil: require('./SnapCeil'),\r\n Floor: require('./SnapFloor'),\r\n To: require('./SnapTo')\r\n\r\n};\r\n","/**\r\n* @author Richard Davey \r\n* @copyright 2019 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A Global Plugin is installed just once into the Game owned Plugin Manager.\r\n * It can listen for Game events and respond to them.\r\n *\r\n * @class BasePlugin\r\n * @memberof Phaser.Plugins\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar BasePlugin = new Class({\r\n\r\n initialize:\r\n\r\n function BasePlugin (pluginManager)\r\n {\r\n /**\r\n * A handy reference to the Plugin Manager that is responsible for this plugin.\r\n * Can be used as a route to gain access to game systems and events.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#pluginManager\r\n * @type {Phaser.Plugins.PluginManager}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.pluginManager = pluginManager;\r\n\r\n /**\r\n * A reference to the Game instance this plugin is running under.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#game\r\n * @type {Phaser.Game}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.game = pluginManager.game;\r\n\r\n /**\r\n * A reference to the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You cannot use it during the `init` method, but you can during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#scene\r\n * @type {?Phaser.Scene}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.scene;\r\n\r\n /**\r\n * A reference to the Scene Systems of the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You cannot use it during the `init` method, but you can during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#systems\r\n * @type {?Phaser.Scenes.Systems}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.systems;\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is first instantiated.\r\n * It will never be called again on this instance.\r\n * In here you can set-up whatever you need for this plugin to run.\r\n * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#init\r\n * @since 3.8.0\r\n *\r\n * @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).\r\n */\r\n init: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is started.\r\n * If a plugin is stopped, and then started again, this will get called again.\r\n * Typically called immediately after `BasePlugin.init`.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#start\r\n * @since 3.8.0\r\n */\r\n start: function ()\r\n {\r\n // Here are the game-level events you can listen to.\r\n // At the very least you should offer a destroy handler for when the game closes down.\r\n\r\n // var eventEmitter = this.game.events;\r\n\r\n // eventEmitter.once('destroy', this.gameDestroy, this);\r\n // eventEmitter.on('pause', this.gamePause, this);\r\n // eventEmitter.on('resume', this.gameResume, this);\r\n // eventEmitter.on('resize', this.gameResize, this);\r\n // eventEmitter.on('prestep', this.gamePreStep, this);\r\n // eventEmitter.on('step', this.gameStep, this);\r\n // eventEmitter.on('poststep', this.gamePostStep, this);\r\n // eventEmitter.on('prerender', this.gamePreRender, this);\r\n // eventEmitter.on('postrender', this.gamePostRender, this);\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is stopped.\r\n * The game code has requested that your plugin stop doing whatever it does.\r\n * It is now considered as 'inactive' by the PluginManager.\r\n * Handle that process here (i.e. stop listening for events, etc)\r\n * If the plugin is started again then `BasePlugin.start` will be called again.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#stop\r\n * @since 3.8.0\r\n */\r\n stop: function ()\r\n {\r\n },\r\n\r\n /**\r\n * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots.\r\n * By this point the plugin properties `scene` and `systems` will have already been set.\r\n * In here you can listen for Scene events and set-up whatever you need for this plugin to run.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#boot\r\n * @since 3.8.0\r\n */\r\n boot: function ()\r\n {\r\n // Here are the Scene events you can listen to.\r\n // At the very least you should offer a destroy handler for when the Scene closes down.\r\n\r\n // var eventEmitter = this.systems.events;\r\n\r\n // eventEmitter.once('destroy', this.sceneDestroy, this);\r\n // eventEmitter.on('start', this.sceneStart, this);\r\n // eventEmitter.on('preupdate', this.scenePreUpdate, this);\r\n // eventEmitter.on('update', this.sceneUpdate, this);\r\n // eventEmitter.on('postupdate', this.scenePostUpdate, this);\r\n // eventEmitter.on('pause', this.scenePause, this);\r\n // eventEmitter.on('resume', this.sceneResume, this);\r\n // eventEmitter.on('sleep', this.sceneSleep, this);\r\n // eventEmitter.on('wake', this.sceneWake, this);\r\n // eventEmitter.on('shutdown', this.sceneShutdown, this);\r\n // eventEmitter.on('destroy', this.sceneDestroy, this);\r\n },\r\n\r\n /**\r\n * Game instance has been destroyed.\r\n * You must release everything in here, all references, all objects, free it all up.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#destroy\r\n * @since 3.8.0\r\n */\r\n destroy: function ()\r\n {\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BasePlugin;\r\n","/**\r\n* @author Richard Davey \r\n* @copyright 2019 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar BasePlugin = require('./BasePlugin');\r\nvar Class = require('../utils/Class');\r\nvar SceneEvents = require('../scene/events');\r\n\r\n/**\r\n * @classdesc\r\n * A Scene Level Plugin is installed into every Scene and belongs to that Scene.\r\n * It can listen for Scene events and respond to them.\r\n * It can map itself to a Scene property, or into the Scene Systems, or both.\r\n *\r\n * @class ScenePlugin\r\n * @memberof Phaser.Plugins\r\n * @extends Phaser.Plugins.BasePlugin\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar ScenePlugin = new Class({\r\n\r\n Extends: BasePlugin,\r\n\r\n initialize:\r\n\r\n function ScenePlugin (scene, pluginManager)\r\n {\r\n BasePlugin.call(this, pluginManager);\r\n\r\n this.scene = scene;\r\n this.systems = scene.sys;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * This method is called when the Scene boots. It is only ever called once.\r\n * \r\n * By this point the plugin properties `scene` and `systems` will have already been set.\r\n * \r\n * In here you can listen for Scene events and set-up whatever you need for this plugin to run.\r\n * Here are the Scene events you can listen to:\r\n * \r\n * start\r\n * ready\r\n * preupdate\r\n * update\r\n * postupdate\r\n * resize\r\n * pause\r\n * resume\r\n * sleep\r\n * wake\r\n * transitioninit\r\n * transitionstart\r\n * transitioncomplete\r\n * transitionout\r\n * shutdown\r\n * destroy\r\n * \r\n * At the very least you should offer a destroy handler for when the Scene closes down, i.e:\r\n *\r\n * ```javascript\r\n * var eventEmitter = this.systems.events;\r\n * eventEmitter.once('destroy', this.sceneDestroy, this);\r\n * ```\r\n *\r\n * @method Phaser.Plugins.ScenePlugin#boot\r\n * @since 3.8.0\r\n */\r\n boot: function ()\r\n {\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ScenePlugin;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Blend Modes.\r\n * \r\n * @namespace Phaser.BlendModes\r\n * @since 3.0.0\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * Skips the Blend Mode check in the renderer.\r\n * \r\n * @name Phaser.BlendModes.SKIP_CHECK\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SKIP_CHECK: -1,\r\n\r\n /**\r\n * Normal blend mode. For Canvas and WebGL.\r\n * This is the default setting and draws new shapes on top of the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.NORMAL\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n NORMAL: 0,\r\n\r\n /**\r\n * Add blend mode. For Canvas and WebGL.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.ADD\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ADD: 1,\r\n\r\n /**\r\n * Multiply blend mode. For Canvas and WebGL.\r\n * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result.\r\n * \r\n * @name Phaser.BlendModes.MULTIPLY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n MULTIPLY: 2,\r\n\r\n /**\r\n * Screen blend mode. For Canvas and WebGL.\r\n * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply)\r\n * \r\n * @name Phaser.BlendModes.SCREEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SCREEN: 3,\r\n\r\n /**\r\n * Overlay blend mode. For Canvas only.\r\n * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter.\r\n * \r\n * @name Phaser.BlendModes.OVERLAY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n OVERLAY: 4,\r\n\r\n /**\r\n * Darken blend mode. For Canvas only.\r\n * Retains the darkest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.DARKEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DARKEN: 5,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Retains the lightest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.LIGHTEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTEN: 6,\r\n\r\n /**\r\n * Color Dodge blend mode. For Canvas only.\r\n * Divides the bottom layer by the inverted top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR_DODGE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_DODGE: 7,\r\n\r\n /**\r\n * Color Burn blend mode. For Canvas only.\r\n * Divides the inverted bottom layer by the top layer, and then inverts the result.\r\n * \r\n * @name Phaser.BlendModes.COLOR_BURN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_BURN: 8,\r\n\r\n /**\r\n * Hard Light blend mode. For Canvas only.\r\n * A combination of multiply and screen like overlay, but with top and bottom layer swapped.\r\n * \r\n * @name Phaser.BlendModes.HARD_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HARD_LIGHT: 9,\r\n\r\n /**\r\n * Soft Light blend mode. For Canvas only.\r\n * A softer version of hard-light. Pure black or white does not result in pure black or white.\r\n * \r\n * @name Phaser.BlendModes.SOFT_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOFT_LIGHT: 10,\r\n\r\n /**\r\n * Difference blend mode. For Canvas only.\r\n * Subtracts the bottom layer from the top layer or the other way round to always get a positive value.\r\n * \r\n * @name Phaser.BlendModes.DIFFERENCE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DIFFERENCE: 11,\r\n\r\n /**\r\n * Exclusion blend mode. For Canvas only.\r\n * Like difference, but with lower contrast.\r\n * \r\n * @name Phaser.BlendModes.EXCLUSION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n EXCLUSION: 12,\r\n\r\n /**\r\n * Hue blend mode. For Canvas only.\r\n * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.\r\n * \r\n * @name Phaser.BlendModes.HUE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HUE: 13,\r\n\r\n /**\r\n * Saturation blend mode. For Canvas only.\r\n * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.SATURATION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SATURATION: 14,\r\n\r\n /**\r\n * Color blend mode. For Canvas only.\r\n * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR: 15,\r\n\r\n /**\r\n * Luminosity blend mode. For Canvas only.\r\n * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.LUMINOSITY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LUMINOSITY: 16,\r\n\r\n /**\r\n * Alpha erase blend mode. For Canvas and WebGL.\r\n * \r\n * @name Phaser.BlendModes.ERASE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ERASE: 17,\r\n\r\n /**\r\n * Source-in blend mode. For Canvas only.\r\n * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_IN: 18,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is drawn where it doesn't overlap the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_OUT: 19,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is only drawn where it overlaps the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_ATOP: 20,\r\n\r\n /**\r\n * Destination-over blend mode. For Canvas only.\r\n * New shapes are drawn behind the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OVER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OVER: 21,\r\n\r\n /**\r\n * Destination-in blend mode. For Canvas only.\r\n * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_IN: 22,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing content is kept where it doesn't overlap the new shape.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OUT: 23,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_ATOP: 24,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.LIGHTER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTER: 25,\r\n\r\n /**\r\n * Copy blend mode. For Canvas only.\r\n * Only the new shape is shown.\r\n * \r\n * @name Phaser.BlendModes.COPY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COPY: 26,\r\n\r\n /**\r\n * Xor blend mode. For Canvas only.\r\n * Shapes are made transparent where both overlap and drawn normal everywhere else.\r\n * \r\n * @name Phaser.BlendModes.XOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n XOR: 27\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Scale Modes.\r\n * \r\n * @namespace Phaser.ScaleModes\r\n * @since 3.0.0\r\n */\r\n\r\nvar ScaleModes = {\r\n\r\n /**\r\n * Default Scale Mode (Linear).\r\n * \r\n * @name Phaser.ScaleModes.DEFAULT\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n DEFAULT: 0,\r\n\r\n /**\r\n * Linear Scale Mode.\r\n * \r\n * @name Phaser.ScaleModes.LINEAR\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n LINEAR: 0,\r\n\r\n /**\r\n * Nearest Scale Mode.\r\n * \r\n * @name Phaser.ScaleModes.NEAREST\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n NEAREST: 1\r\n\r\n};\r\n\r\nmodule.exports = ScaleModes;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scale Manager Resize Event.\r\n * \r\n * This event is dispatched whenever the Scale Manager detects a resize event from the browser.\r\n * It sends three parameters to the callback, each of them being Size components. You can read\r\n * the `width`, `height`, `aspectRatio` and other properties of these components to help with\r\n * scaling your own game content.\r\n *\r\n * @event Phaser.Scale.Events#RESIZE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas.\r\n * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution.\r\n * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode.\r\n * @param {number} resolution - The current resolution. Defaults to 1 at the moment.\r\n * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width.\r\n * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height.\r\n */\r\nmodule.exports = 'resize';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Boot Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('boot', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#BOOT\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'boot';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Create Event.\r\n * \r\n * This event is dispatched by a Scene after it has been created by the Scene Manager.\r\n * \r\n * If a Scene has a `create` method then this event is emitted _after_ that has run.\r\n * \r\n * If there is a transition, this event will be fired after the `TRANSITION_START` event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('create', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#CREATE\r\n * @since 3.17.0\r\n * \r\n * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event.\r\n */\r\nmodule.exports = 'create';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Destroy Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems destroy process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('destroy', listener)`.\r\n * \r\n * You should destroy any resources that may be in use by your Scene in this event handler.\r\n * \r\n * @event Phaser.Scenes.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pause Event.\r\n * \r\n * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an\r\n * action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('pause', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#PAUSE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was paused.\r\n */\r\nmodule.exports = 'pause';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Post Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#POST_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'postupdate';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pre Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#PRE_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'preupdate';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Ready Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process.\r\n * By this point in the process the Scene is now fully active and rendering.\r\n * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('ready', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#READY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was started.\r\n */\r\nmodule.exports = 'ready';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Render Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('render', listener)`.\r\n * \r\n * A Scene will only render if it is visible and active.\r\n * By the time this event is dispatched, the Scene will have already been rendered.\r\n * \r\n * @event Phaser.Scenes.Events#RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene.\r\n */\r\nmodule.exports = 'render';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Resume Event.\r\n * \r\n * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('resume', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#RESUME\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed.\r\n */\r\nmodule.exports = 'resume';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Shutdown Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems shutdown process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('shutdown', listener)`.\r\n * \r\n * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding\r\n * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not\r\n * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources.\r\n * \r\n * @event Phaser.Scenes.Events#SHUTDOWN\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown.\r\n */\r\nmodule.exports = 'shutdown';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Sleep Event.\r\n * \r\n * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('sleep', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#SLEEP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep.\r\n */\r\nmodule.exports = 'sleep';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Start Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('start', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Complete Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration\r\n * of the transition.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioncomplete', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_COMPLETE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} scene -The Scene on which the transitioned completed.\r\n */\r\nmodule.exports = 'transitioncomplete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Init Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method,\r\n * this event is not dispatched.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioninit', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_INIT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitioninit';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Out Event.\r\n * \r\n * This event is dispatched by a Scene when it initiates a transition to another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionout', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_OUT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionout';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Start Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep.\r\n * \r\n * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method,\r\n * this event is dispatched anyway.\r\n * \r\n * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is\r\n * dispatched instead of this event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionstart', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_START\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionstart';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Wake Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before\r\n * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionwake', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_WAKE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionwake';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('update', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'update';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Wake Event.\r\n * \r\n * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('wake', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#WAKE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up.\r\n */\r\nmodule.exports = 'wake';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Scenes.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BOOT: require('./BOOT_EVENT'),\r\n CREATE: require('./CREATE_EVENT'),\r\n DESTROY: require('./DESTROY_EVENT'),\r\n PAUSE: require('./PAUSE_EVENT'),\r\n POST_UPDATE: require('./POST_UPDATE_EVENT'),\r\n PRE_UPDATE: require('./PRE_UPDATE_EVENT'),\r\n READY: require('./READY_EVENT'),\r\n RENDER: require('./RENDER_EVENT'),\r\n RESUME: require('./RESUME_EVENT'),\r\n SHUTDOWN: require('./SHUTDOWN_EVENT'),\r\n SLEEP: require('./SLEEP_EVENT'),\r\n START: require('./START_EVENT'),\r\n TRANSITION_COMPLETE: require('./TRANSITION_COMPLETE_EVENT'),\r\n TRANSITION_INIT: require('./TRANSITION_INIT_EVENT'),\r\n TRANSITION_OUT: require('./TRANSITION_OUT_EVENT'),\r\n TRANSITION_START: require('./TRANSITION_START_EVENT'),\r\n TRANSITION_WAKE: require('./TRANSITION_WAKE_EVENT'),\r\n UPDATE: require('./UPDATE_EVENT'),\r\n WAKE: require('./WAKE_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Taken from klasse by mattdesl https://github.com/mattdesl/klasse\r\n\r\nfunction hasGetterOrSetter (def)\r\n{\r\n return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function');\r\n}\r\n\r\nfunction getProperty (definition, k, isClassDescriptor)\r\n{\r\n // This may be a lightweight object, OR it might be a property that was defined previously.\r\n\r\n // For simple class descriptors we can just assume its NOT previously defined.\r\n var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k);\r\n\r\n if (!isClassDescriptor && def.value && typeof def.value === 'object')\r\n {\r\n def = def.value;\r\n }\r\n\r\n // This might be a regular property, or it may be a getter/setter the user defined in a class.\r\n if (def && hasGetterOrSetter(def))\r\n {\r\n if (typeof def.enumerable === 'undefined')\r\n {\r\n def.enumerable = true;\r\n }\r\n\r\n if (typeof def.configurable === 'undefined')\r\n {\r\n def.configurable = true;\r\n }\r\n\r\n return def;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n}\r\n\r\nfunction hasNonConfigurable (obj, k)\r\n{\r\n var prop = Object.getOwnPropertyDescriptor(obj, k);\r\n\r\n if (!prop)\r\n {\r\n return false;\r\n }\r\n\r\n if (prop.value && typeof prop.value === 'object')\r\n {\r\n prop = prop.value;\r\n }\r\n\r\n if (prop.configurable === false)\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Extends the given `myClass` object's prototype with the properties of `definition`.\r\n *\r\n * @function extend\r\n * @param {Object} ctor The constructor object to mix into.\r\n * @param {Object} definition A dictionary of functions for the class.\r\n * @param {boolean} isClassDescriptor Is the definition a class descriptor?\r\n * @param {Object} [extend] The parent constructor object.\r\n */\r\nfunction extend (ctor, definition, isClassDescriptor, extend)\r\n{\r\n for (var k in definition)\r\n {\r\n if (!definition.hasOwnProperty(k))\r\n {\r\n continue;\r\n }\r\n\r\n var def = getProperty(definition, k, isClassDescriptor);\r\n\r\n if (def !== false)\r\n {\r\n // If Extends is used, we will check its prototype to see if the final variable exists.\r\n\r\n var parent = extend || ctor;\r\n\r\n if (hasNonConfigurable(parent.prototype, k))\r\n {\r\n // Just skip the final property\r\n if (Class.ignoreFinals)\r\n {\r\n continue;\r\n }\r\n\r\n // We cannot re-define a property that is configurable=false.\r\n // So we will consider them final and throw an error. This is by\r\n // default so it is clear to the developer what is happening.\r\n // You can set ignoreFinals to true if you need to extend a class\r\n // which has configurable=false; it will simply not re-define final properties.\r\n throw new Error('cannot override final property \\'' + k + '\\', set Class.ignoreFinals = true to skip');\r\n }\r\n\r\n Object.defineProperty(ctor.prototype, k, def);\r\n }\r\n else\r\n {\r\n ctor.prototype[k] = definition[k];\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Applies the given `mixins` to the prototype of `myClass`.\r\n *\r\n * @function mixin\r\n * @param {Object} myClass The constructor object to mix into.\r\n * @param {Object|Array} mixins The mixins to apply to the constructor.\r\n */\r\nfunction mixin (myClass, mixins)\r\n{\r\n if (!mixins)\r\n {\r\n return;\r\n }\r\n\r\n if (!Array.isArray(mixins))\r\n {\r\n mixins = [ mixins ];\r\n }\r\n\r\n for (var i = 0; i < mixins.length; i++)\r\n {\r\n extend(myClass, mixins[i].prototype || mixins[i]);\r\n }\r\n}\r\n\r\n/**\r\n * Creates a new class with the given descriptor.\r\n * The constructor, defined by the name `initialize`,\r\n * is an optional function. If unspecified, an anonymous\r\n * function will be used which calls the parent class (if\r\n * one exists).\r\n *\r\n * You can also use `Extends` and `Mixins` to provide subclassing\r\n * and inheritance.\r\n *\r\n * @class Phaser.Class\r\n * @constructor\r\n * @param {Object} definition a dictionary of functions for the class\r\n * @example\r\n *\r\n * var MyClass = new Phaser.Class({\r\n *\r\n * initialize: function() {\r\n * this.foo = 2.0;\r\n * },\r\n *\r\n * bar: function() {\r\n * return this.foo + 5;\r\n * }\r\n * });\r\n */\r\nfunction Class (definition)\r\n{\r\n if (!definition)\r\n {\r\n definition = {};\r\n }\r\n\r\n // The variable name here dictates what we see in Chrome debugger\r\n var initialize;\r\n var Extends;\r\n\r\n if (definition.initialize)\r\n {\r\n if (typeof definition.initialize !== 'function')\r\n {\r\n throw new Error('initialize must be a function');\r\n }\r\n\r\n initialize = definition.initialize;\r\n\r\n // Usually we should avoid 'delete' in V8 at all costs.\r\n // However, its unlikely to make any performance difference\r\n // here since we only call this on class creation (i.e. not object creation).\r\n delete definition.initialize;\r\n }\r\n else if (definition.Extends)\r\n {\r\n var base = definition.Extends;\r\n\r\n initialize = function ()\r\n {\r\n base.apply(this, arguments);\r\n };\r\n }\r\n else\r\n {\r\n initialize = function () {};\r\n }\r\n\r\n if (definition.Extends)\r\n {\r\n initialize.prototype = Object.create(definition.Extends.prototype);\r\n initialize.prototype.constructor = initialize;\r\n\r\n // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin)\r\n\r\n Extends = definition.Extends;\r\n\r\n delete definition.Extends;\r\n }\r\n else\r\n {\r\n initialize.prototype.constructor = initialize;\r\n }\r\n\r\n // Grab the mixins, if they are specified...\r\n var mixins = null;\r\n\r\n if (definition.Mixins)\r\n {\r\n mixins = definition.Mixins;\r\n delete definition.Mixins;\r\n }\r\n\r\n // First, mixin if we can.\r\n mixin(initialize, mixins);\r\n\r\n // Now we grab the actual definition which defines the overrides.\r\n extend(initialize, definition, true, Extends);\r\n\r\n return initialize;\r\n}\r\n\r\nClass.extend = extend;\r\nClass.mixin = mixin;\r\nClass.ignoreFinals = false;\r\n\r\nmodule.exports = Class;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A NOOP (No Operation) callback function.\r\n *\r\n * Used internally by Phaser when it's more expensive to determine if a callback exists\r\n * than it is to just invoke an empty function.\r\n *\r\n * @function Phaser.Utils.NOOP\r\n * @since 3.0.0\r\n */\r\nvar NOOP = function ()\r\n{\r\n // NOOP\r\n};\r\n\r\nmodule.exports = NOOP;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar IsPlainObject = require('./IsPlainObject');\r\n\r\n// @param {boolean} deep - Perform a deep copy?\r\n// @param {object} target - The target object to copy to.\r\n// @return {object} The extended object.\r\n\r\n/**\r\n * This is a slightly modified version of http://api.jquery.com/jQuery.extend/\r\n *\r\n * @function Phaser.Utils.Objects.Extend\r\n * @since 3.0.0\r\n *\r\n * @return {object} The extended object.\r\n */\r\nvar Extend = function ()\r\n{\r\n var options, name, src, copy, copyIsArray, clone,\r\n target = arguments[0] || {},\r\n i = 1,\r\n length = arguments.length,\r\n deep = false;\r\n\r\n // Handle a deep copy situation\r\n if (typeof target === 'boolean')\r\n {\r\n deep = target;\r\n target = arguments[1] || {};\r\n\r\n // skip the boolean and the target\r\n i = 2;\r\n }\r\n\r\n // extend Phaser if only one argument is passed\r\n if (length === i)\r\n {\r\n target = this;\r\n --i;\r\n }\r\n\r\n for (; i < length; i++)\r\n {\r\n // Only deal with non-null/undefined values\r\n if ((options = arguments[i]) != null)\r\n {\r\n // Extend the base object\r\n for (name in options)\r\n {\r\n src = target[name];\r\n copy = options[name];\r\n\r\n // Prevent never-ending loop\r\n if (target === copy)\r\n {\r\n continue;\r\n }\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy))))\r\n {\r\n if (copyIsArray)\r\n {\r\n copyIsArray = false;\r\n clone = src && Array.isArray(src) ? src : [];\r\n }\r\n else\r\n {\r\n clone = src && IsPlainObject(src) ? src : {};\r\n }\r\n\r\n // Never move original objects, clone them\r\n target[name] = Extend(deep, clone, copy);\r\n\r\n // Don't bring in undefined values\r\n }\r\n else if (copy !== undefined)\r\n {\r\n target[name] = copy;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Return the modified object\r\n return target;\r\n};\r\n\r\nmodule.exports = Extend;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH = require('../../math');\r\nvar GetValue = require('./GetValue');\r\n\r\n/**\r\n * Retrieves a value from an object. Allows for more advanced selection options, including:\r\n *\r\n * Allowed types:\r\n * \r\n * Implicit\r\n * {\r\n * x: 4\r\n * }\r\n *\r\n * From function\r\n * {\r\n * x: function ()\r\n * }\r\n *\r\n * Randomly pick one element from the array\r\n * {\r\n * x: [a, b, c, d, e, f]\r\n * }\r\n *\r\n * Random integer between min and max:\r\n * {\r\n * x: { randInt: [min, max] }\r\n * }\r\n *\r\n * Random float between min and max:\r\n * {\r\n * x: { randFloat: [min, max] }\r\n * }\r\n * \r\n *\r\n * @function Phaser.Utils.Objects.GetAdvancedValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @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.\r\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\r\n *\r\n * @return {*} The value of the requested key.\r\n */\r\nvar GetAdvancedValue = function (source, key, defaultValue)\r\n{\r\n var value = GetValue(source, key, null);\r\n\r\n if (value === null)\r\n {\r\n return defaultValue;\r\n }\r\n else if (Array.isArray(value))\r\n {\r\n return MATH.RND.pick(value);\r\n }\r\n else if (typeof value === 'object')\r\n {\r\n if (value.hasOwnProperty('randInt'))\r\n {\r\n return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]);\r\n }\r\n else if (value.hasOwnProperty('randFloat'))\r\n {\r\n return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]);\r\n }\r\n }\r\n else if (typeof value === 'function')\r\n {\r\n return value(key);\r\n }\r\n\r\n return value;\r\n};\r\n\r\nmodule.exports = GetAdvancedValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue}\r\n *\r\n * @function Phaser.Utils.Objects.GetFastValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to search\r\n * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods)\r\n * @param {*} [defaultValue] - The default value to use if the key does not exist.\r\n *\r\n * @return {*} The value if found; otherwise, defaultValue (null if none provided)\r\n */\r\nvar GetFastValue = function (source, key, defaultValue)\r\n{\r\n var t = typeof(source);\r\n\r\n if (!source || t === 'number' || t === 'string')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key) && source[key] !== undefined)\r\n {\r\n return source[key];\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetFastValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Source object\r\n// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner'\r\n// The default value to use if the key doesn't exist\r\n\r\n/**\r\n * Retrieves a value from an object.\r\n *\r\n * @function Phaser.Utils.Objects.GetValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @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.\r\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\r\n *\r\n * @return {*} The value of the requested key.\r\n */\r\nvar GetValue = function (source, key, defaultValue)\r\n{\r\n if (!source || typeof source === 'number')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key))\r\n {\r\n return source[key];\r\n }\r\n else if (key.indexOf('.') !== -1)\r\n {\r\n var keys = key.split('.');\r\n var parent = source;\r\n var value = defaultValue;\r\n\r\n // Use for loop here so we can break early\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n if (parent.hasOwnProperty(keys[i]))\r\n {\r\n // Yes it has a key property, let's carry on down\r\n value = parent[keys[i]];\r\n\r\n parent = parent[keys[i]];\r\n }\r\n else\r\n {\r\n // Can't go any further, so reset to default\r\n value = defaultValue;\r\n break;\r\n }\r\n }\r\n\r\n return value;\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * This is a slightly modified version of jQuery.isPlainObject.\r\n * A plain object is an object whose internal class property is [object Object].\r\n *\r\n * @function Phaser.Utils.Objects.IsPlainObject\r\n * @since 3.0.0\r\n *\r\n * @param {object} obj - The object to inspect.\r\n *\r\n * @return {boolean} `true` if the object is plain, otherwise `false`.\r\n */\r\nvar IsPlainObject = function (obj)\r\n{\r\n // Not plain objects:\r\n // - Any object or value whose internal [[Class]] property is not \"[object Object]\"\r\n // - DOM nodes\r\n // - window\r\n if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window)\r\n {\r\n return false;\r\n }\r\n\r\n // Support: Firefox <20\r\n // The try/catch suppresses exceptions thrown when attempting to access\r\n // the \"constructor\" property of certain host objects, ie. |window.location|\r\n // https://bugzilla.mozilla.org/show_bug.cgi?id=814622\r\n try\r\n {\r\n if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf'))\r\n {\r\n return false;\r\n }\r\n }\r\n catch (e)\r\n {\r\n return false;\r\n }\r\n\r\n // If the function hasn't returned already, we're confident that\r\n // |obj| is a plain object, created by {} or constructed with new Object\r\n return true;\r\n};\r\n\r\nmodule.exports = IsPlainObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = require('../../../src/utils/Class');\r\nvar GetFastValue = require('../../../src/utils/object/GetFastValue');\r\nvar ImageFile = require('../../../src/loader/filetypes/ImageFile.js');\r\nvar IsPlainObject = require('../../../src/utils/object/IsPlainObject');\r\nvar JSONFile = require('../../../src/loader/filetypes/JSONFile.js');\r\nvar MultiFile = require('../../../src/loader/MultiFile.js');\r\nvar TextFile = require('../../../src/loader/filetypes/TextFile.js');\r\n\r\n/**\r\n * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig\r\n *\r\n * @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager.\r\n * @property {string} [textureURL] - The absolute or relative URL to load the texture image file from.\r\n * @property {string} [textureExtension='png'] - The default file extension to use for the image texture if no url is provided.\r\n * @property {XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture image file.\r\n * @property {string} [normalMap] - The filename of an associated normal map. It uses the same path and url to load as the texture image.\r\n * @property {string} [atlasURL] - The absolute or relative URL to load the atlas data file from.\r\n * @property {string} [atlasExtension='txt'] - The default file extension to use for the atlas data if no url is provided.\r\n * @property {XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas data file.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * A Spine File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#spine method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spine.\r\n *\r\n * @class SpineFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @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\".\r\n * @param {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not?\r\n * @param {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.\r\n */\r\nvar SpineFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function SpineFile (loader, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)\r\n {\r\n var i;\r\n var json;\r\n var atlas;\r\n var files = [];\r\n var cache = loader.cacheManager.custom.spine;\r\n\r\n // atlas can be an array of atlas files, not just a single one\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n\r\n json = new JSONFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'jsonURL'),\r\n extension: GetFastValue(config, 'jsonExtension', 'json'),\r\n xhrSettings: GetFastValue(config, 'jsonXhrSettings')\r\n });\r\n\r\n atlasURL = GetFastValue(config, 'atlasURL');\r\n preMultipliedAlpha = GetFastValue(config, 'preMultipliedAlpha');\r\n\r\n if (!Array.isArray(atlasURL))\r\n {\r\n atlasURL = [ atlasURL ];\r\n }\r\n\r\n for (i = 0; i < atlasURL.length; i++)\r\n {\r\n atlas = new TextFile(loader, {\r\n key: key,\r\n url: atlasURL[i],\r\n extension: GetFastValue(config, 'atlasExtension', 'atlas'),\r\n xhrSettings: GetFastValue(config, 'atlasXhrSettings')\r\n });\r\n\r\n atlas.cache = cache;\r\n\r\n files.push(atlas);\r\n }\r\n }\r\n else\r\n {\r\n json = new JSONFile(loader, key, jsonURL, jsonXhrSettings);\r\n\r\n if (!Array.isArray(atlasURL))\r\n {\r\n atlasURL = [ atlasURL ];\r\n }\r\n\r\n for (i = 0; i < atlasURL.length; i++)\r\n {\r\n atlas = new TextFile(loader, key + '_' + i, atlasURL[i], atlasXhrSettings);\r\n atlas.cache = cache;\r\n\r\n files.push(atlas);\r\n }\r\n }\r\n\r\n files.unshift(json);\r\n\r\n MultiFile.call(this, loader, 'spine', key, files);\r\n\r\n this.config.preMultipliedAlpha = preMultipliedAlpha;\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.FileTypes.SpineFile#onFileComplete\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n\r\n if (file.type === 'text')\r\n {\r\n // Inspect the data for the files to now load\r\n var content = file.data.split('\\n');\r\n\r\n // Extract the textures\r\n var textures = [];\r\n\r\n for (var t = 0; t < content.length; t++)\r\n {\r\n var line = content[t];\r\n\r\n if (line.trim() === '' && t < content.length - 1)\r\n {\r\n line = content[t + 1];\r\n\r\n textures.push(line);\r\n }\r\n }\r\n\r\n var config = this.config;\r\n var loader = this.loader;\r\n\r\n var currentBaseURL = loader.baseURL;\r\n var currentPath = loader.path;\r\n var currentPrefix = loader.prefix;\r\n\r\n var baseURL = GetFastValue(config, 'baseURL', currentBaseURL);\r\n var path = GetFastValue(config, 'path', currentPath);\r\n var prefix = GetFastValue(config, 'prefix', currentPrefix);\r\n var textureXhrSettings = GetFastValue(config, 'textureXhrSettings');\r\n\r\n loader.setBaseURL(baseURL);\r\n loader.setPath(path);\r\n loader.setPrefix(prefix);\r\n\r\n for (var i = 0; i < textures.length; i++)\r\n {\r\n var textureURL = textures[i];\r\n\r\n var key = '_SP_' + textureURL;\r\n\r\n var image = new ImageFile(loader, key, textureURL, textureXhrSettings);\r\n\r\n this.addToMultiFile(image);\r\n\r\n loader.addFile(image);\r\n }\r\n\r\n // Reset the loader settings\r\n loader.setBaseURL(currentBaseURL);\r\n loader.setPath(currentPath);\r\n loader.setPrefix(currentPrefix);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.SpineFile#addToCache\r\n * @since 3.19.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n var fileJSON = this.files[0];\r\n\r\n fileJSON.addToCache();\r\n\r\n var atlasCache;\r\n var atlasKey = '';\r\n var combinedAtlastData = '';\r\n var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false;\r\n\r\n for (var i = 1; i < this.files.length; i++)\r\n {\r\n var file = this.files[i];\r\n\r\n if (file.type === 'text')\r\n {\r\n atlasKey = file.key.substr(0, file.key.length - 2);\r\n\r\n atlasCache = file.cache;\r\n\r\n combinedAtlastData = combinedAtlastData.concat(file.data);\r\n }\r\n else\r\n {\r\n var key = file.key.substr(4).trim();\r\n \r\n this.loader.textureManager.addImage(key, file.data);\r\n }\r\n\r\n file.pendingDestroy();\r\n }\r\n\r\n atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlastData });\r\n\r\n this.complete = true;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpineFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar BuildGameObject = require('../../../src/gameobjects/BuildGameObject');\r\nvar Class = require('../../../src/utils/Class');\r\nvar GetValue = require('../../../src/utils/object/GetValue');\r\nvar ResizeEvent = require('../../../src/scale/events/RESIZE_EVENT');\r\nvar ScenePlugin = require('../../../src/plugins/ScenePlugin');\r\nvar Spine = require('Spine');\r\nvar SpineFile = require('./SpineFile');\r\nvar SpineGameObject = require('./gameobject/SpineGameObject');\r\n\r\n/**\r\n * @classdesc\r\n * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game objects.\r\n * \r\n * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin\r\n * uses the Spine 3.7 runtimes. Files created in a more recent version of Spine may not work as a result.\r\n * \r\n * You can find more details about Spine at http://esotericsoftware.com/.\r\n * \r\n * Please note that you require a Spine license in order to use Spine Runtimes in your games.\r\n * \r\n * You can install this plugin into your Phaser game by either importing it, if you're using ES6:\r\n * \r\n * ```javascript\r\n * import * as SpinePlugin from './SpinePlugin.js';\r\n * ```\r\n * \r\n * and then adding it to your Phaser Game configuration:\r\n * \r\n * ```javascript\r\n * plugins: {\r\n * scene: [\r\n * { key: 'SpinePlugin', plugin: window.SpinePlugin, mapping: 'spine' }\r\n * ]\r\n * }\r\n * ```\r\n * \r\n * If you're using ES5 then you can load the Spine Plugin in a Scene files payload, _within_ your\r\n * Game Configuration object, like this:\r\n * \r\n * ```javascript\r\n * scene: {\r\n * preload: preload,\r\n * create: create,\r\n * pack: {\r\n * files: [\r\n * { type: 'scenePlugin', key: 'SpinePlugin', url: 'plugins/SpinePlugin.js', sceneKey: 'spine' }\r\n * ]\r\n * }\r\n * }\r\n * ```\r\n * \r\n * Loading it like this allows you to then use commands such as `this.load.spine` from within the\r\n * same Scene. Alternatively, you can use the method `this.load.plugin` to load the plugin via the normal\r\n * Phaser Loader. However, doing so will not add it to the current Scene. It will be available from any\r\n * subsequent Scenes.\r\n * \r\n * Assuming a default environment you access it from within a Scene by using the `this.spine` reference.\r\n * \r\n * When this plugin is installed into a Scene it will add a Loader File Type, allowing you to load\r\n * Spine files directly, i.e.:\r\n * \r\n * ```javascript\r\n * this.load.spine('stretchyman', 'stretchyman-pro.json', [ 'stretchyman-pma.atlas' ], true);\r\n * ```\r\n * \r\n * It also installs a Game Object Factory method, allowin you to create Spine Game Objects:\r\n * \r\n * ```javascript\r\n * this.add.spine(512, 650, 'stretchyman')\r\n * ```\r\n * \r\n * The first argument is the key which you used when importing the Spine data. There are lots of\r\n * things you can specify, such as the animation name, skeleton, slot attachments and more. Please\r\n * see the respective documentation and examples for further details.\r\n * \r\n * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary.\r\n * The associated atlas files are scanned for any texture files present in them, which are then loaded.\r\n * If you have exported your Spine data with preMultipiedAlpha set, then you should enable this in the\r\n * load arguments, or you may see black outlines around skeleton textures.\r\n * \r\n * The Spine plugin is local to the Scene in which it is installed. This means a change to something,\r\n * such as the Skeleton Debug Renderer, in this Scene, will not impact the renderer in any other Scene.\r\n * The only exception to this is with the caches this plugin creates. Spine atlas and texture data are\r\n * stored in their own caches, which are global, meaning they're accessible from any Scene in your\r\n * game, regardless if the Scene loaded the Spine data or not.\r\n * \r\n * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference\r\n *\r\n * @class SpinePlugin\r\n * @memberOf Phaser\r\n * @extends Phaser.Plugins.ScenePlugin\r\n * @constructor\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Phaser Plugin Manager.\r\n */\r\nvar SpinePlugin = new Class({\r\n\r\n Extends: ScenePlugin,\r\n\r\n initialize:\r\n\r\n function SpinePlugin (scene, pluginManager)\r\n {\r\n ScenePlugin.call(this, scene, pluginManager);\r\n\r\n var game = pluginManager.game;\r\n\r\n /**\r\n * A read-only flag that indicates if the game is running under WebGL or Canvas.\r\n *\r\n * @name SpinePlugin#isWebGL\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.isWebGL = (game.config.renderType === 2);\r\n\r\n /**\r\n * A custom cache that stores the Spine atlas data.\r\n * \r\n * This cache is global across your game, allowing you to access Spine data loaded from other Scenes,\r\n * no matter which Scene you are in.\r\n *\r\n * @name SpinePlugin#cache\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.cache = game.cache.addCustom('spine');\r\n\r\n /**\r\n * A custom cache that stores the Spine Textures.\r\n * \r\n * This cache is global across your game, allowing you to access Spine data loaded from other Scenes,\r\n * no matter which Scene you are in.\r\n *\r\n * @name SpinePlugin#spineTextures\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.spineTextures = game.cache.addCustom('spineTextures');\r\n\r\n /**\r\n * A reference to the global JSON Cache.\r\n *\r\n * @name SpinePlugin#json\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.json = game.cache.json;\r\n\r\n /**\r\n * A reference to the global Texture Manager.\r\n *\r\n * @name SpinePlugin#textures\r\n * @type {Phaser.Textures.TextureManager}\r\n * @since 3.19.0\r\n */\r\n this.textures = game.textures;\r\n\r\n /**\r\n * A flag that sets if the Skeleton Renderers will render debug information over the top\r\n * of the skeleton or not.\r\n *\r\n * @name SpinePlugin#drawDebug\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.drawDebug = false;\r\n\r\n /**\r\n * The underlying WebGL context of the Phaser renderer.\r\n * \r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#gl\r\n * @type {WebGLRenderingContext}\r\n * @since 3.19.0\r\n */\r\n this.gl;\r\n\r\n /**\r\n * A reference to either the Canvas or WebGL Renderer that this Game is using.\r\n *\r\n * @name SpinePlugin#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.19.0\r\n */\r\n this.renderer;\r\n\r\n /**\r\n * An instance of the Spine WebGL Scene Renderer.\r\n * \r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#sceneRenderer\r\n * @type {spine.webgl.SceneRenderer}\r\n * @since 3.19.0\r\n */\r\n this.sceneRenderer;\r\n\r\n /**\r\n * An instance of the Spine Skeleton Renderer.\r\n *\r\n * @name SpinePlugin#skeletonRenderer\r\n * @type {(spine.canvas.SkeletonRenderer|spine.webgl.SkeletonRenderer)}\r\n * @since 3.19.0\r\n */\r\n this.skeletonRenderer;\r\n\r\n /**\r\n * An instance of the Spine Skeleton Debug Renderer.\r\n * \r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#skeletonDebugRenderer\r\n * @type {spine.webgl.skeletonDebugRenderer}\r\n * @since 3.19.0\r\n */\r\n this.skeletonDebugRenderer;\r\n\r\n /**\r\n * A reference to the Spine runtime.\r\n * This is the runtime created by Esoteric Software\r\n *\r\n * @name SpinePlugin#plugin\r\n * @type {spine}\r\n * @since 3.19.0\r\n */\r\n this.plugin = Spine;\r\n\r\n /**\r\n * An internal vector3 used by the screen to world method.\r\n *\r\n * @name SpinePlugin#temp1\r\n * @private\r\n * @type {spine.webgl.Vector3}\r\n * @since 3.19.0\r\n */\r\n this.temp1;\r\n\r\n /**\r\n * An internal vector3 used by the screen to world method.\r\n *\r\n * @name SpinePlugin#temp2\r\n * @private\r\n * @type {spine.webgl.Vector3}\r\n * @since 3.19.0\r\n */\r\n this.temp2;\r\n\r\n if (this.isWebGL)\r\n {\r\n this.runtime = Spine.webgl;\r\n\r\n this.renderer = game.renderer;\r\n this.gl = game.renderer.gl;\r\n\r\n this.getAtlas = this.getAtlasWebGL;\r\n }\r\n else\r\n {\r\n this.runtime = Spine.canvas;\r\n\r\n this.renderer = game.renderer;\r\n\r\n this.getAtlas = this.getAtlasCanvas;\r\n }\r\n\r\n pluginManager.registerFileType('spine', this.spineFileCallback, scene);\r\n\r\n pluginManager.registerGameObject('spine', this.add.bind(this), this.make.bind(this));\r\n },\r\n\r\n /**\r\n * Internal boot handler.\r\n *\r\n * @method SpinePlugin#boot\r\n * @private\r\n * @since 3.19.0\r\n */\r\n boot: function ()\r\n {\r\n if (this.isWebGL)\r\n {\r\n this.bootWebGL();\r\n this.onResize();\r\n this.game.scale.on(ResizeEvent, this.onResize, this);\r\n }\r\n else\r\n {\r\n this.bootCanvas();\r\n }\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.once('shutdown', this.shutdown, this);\r\n eventEmitter.once('destroy', this.destroy, this);\r\n },\r\n\r\n /**\r\n * Internal boot handler for the Canvas Renderer.\r\n *\r\n * @method SpinePlugin#bootCanvas\r\n * @private\r\n * @since 3.19.0\r\n */\r\n bootCanvas: function ()\r\n {\r\n this.skeletonRenderer = new Spine.canvas.SkeletonRenderer(this.scene.sys.context);\r\n },\r\n\r\n /**\r\n * Internal boot handler for the WebGL Renderer.\r\n *\r\n * @method SpinePlugin#bootWebGL\r\n * @private\r\n * @since 3.19.0\r\n */\r\n bootWebGL: function ()\r\n {\r\n this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true);\r\n\r\n // Monkeypatch the Spine setBlendMode functions, or batching is destroyed\r\n\r\n var setBlendMode = function (srcBlend, dstBlend)\r\n {\r\n if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend)\r\n {\r\n var gl = this.context.gl;\r\n\r\n this.srcBlend = srcBlend;\r\n this.dstBlend = dstBlend;\r\n\r\n if (this.isDrawing)\r\n {\r\n this.flush();\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n }\r\n }\r\n };\r\n\r\n this.sceneRenderer.batcher.setBlendMode = setBlendMode;\r\n this.sceneRenderer.shapes.setBlendMode = setBlendMode;\r\n\r\n this.skeletonRenderer = this.sceneRenderer.skeletonRenderer;\r\n this.skeletonDebugRenderer = this.sceneRenderer.skeletonDebugRenderer;\r\n\r\n this.temp1 = new Spine.webgl.Vector3(0, 0, 0);\r\n this.temp2 = new Spine.webgl.Vector3(0, 0, 0);\r\n },\r\n\r\n /**\r\n * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas,\r\n * then returns it. You do not normally need to invoke this method directly.\r\n *\r\n * @method SpinePlugin#getAtlasCanvas\r\n * @since 3.19.0\r\n * \r\n * @param {string} key - The key of the Spine Atlas to create.\r\n * \r\n * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.\r\n */\r\n getAtlasCanvas: function (key)\r\n {\r\n var atlasEntry = this.cache.get(key);\r\n\r\n if (!atlasEntry)\r\n {\r\n console.warn('No atlas data for: ' + key);\r\n return;\r\n }\r\n\r\n var atlas;\r\n var spineTextures = this.spineTextures;\r\n\r\n if (spineTextures.has(key))\r\n {\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function ()\r\n {\r\n return spineTextures.get(key);\r\n });\r\n }\r\n else\r\n {\r\n var textures = this.textures;\r\n\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)\r\n {\r\n var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage());\r\n\r\n spineTextures.add(key, canvasTexture);\r\n\r\n return canvasTexture;\r\n });\r\n }\r\n\r\n return atlas;\r\n },\r\n\r\n /**\r\n * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas,\r\n * then returns it. You do not normally need to invoke this method directly.\r\n *\r\n * @method SpinePlugin#getAtlasWebGL\r\n * @since 3.19.0\r\n * \r\n * @param {string} key - The key of the Spine Atlas to create.\r\n * \r\n * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.\r\n */\r\n getAtlasWebGL: function (key)\r\n {\r\n var atlasEntry = this.cache.get(key);\r\n\r\n if (!atlasEntry)\r\n {\r\n console.warn('No atlas data for: ' + key);\r\n return;\r\n }\r\n\r\n var atlas;\r\n var spineTextures = this.spineTextures;\r\n\r\n if (spineTextures.has(key))\r\n {\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function ()\r\n {\r\n return spineTextures.get(key);\r\n });\r\n }\r\n else\r\n {\r\n var textures = this.textures;\r\n\r\n var gl = this.sceneRenderer.context.gl;\r\n\r\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\r\n\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)\r\n {\r\n var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage(), false);\r\n\r\n spineTextures.add(key, glTexture);\r\n\r\n return glTexture;\r\n });\r\n }\r\n\r\n return atlas;\r\n },\r\n\r\n /**\r\n * Adds a Spine Skeleton and Atlas file, or array of files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.spine('spineBoy', 'boy.json', 'boy.atlas', true);\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n * \r\n * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary. The associated\r\n * atlas files are scanned for any texture files present in them, which are then loaded. If you have exported\r\n * your Spine data with preMultipiedAlpha set, then you should enable this in the arguments, or you may see black\r\n * outlines around skeleton textures.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global Spine cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Spine cache.\r\n * Loading a file using a key that is already taken will result in a warning.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.spine({\r\n * key: 'mainmenu',\r\n * jsonURL: 'boy.json',\r\n * atlasURL: 'boy.atlas',\r\n * preMultipliedAlpha: true\r\n * });\r\n * ```\r\n * \r\n * If you need to load multiple Spine atlas files, provide them as an array:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.spine('demos', 'demos.json', [ 'atlas1.atlas', 'atlas2.atlas' ], true);\r\n * }\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.SpineFileConfig` for more details.\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the data from the Spine plugin.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Spine Plugin has been built or loaded into Phaser.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#spine\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.19.0\r\n *\r\n * @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.\r\n * @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\".\r\n * @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\".\r\n * @param {boolean} [preMultipiedAlpha=false] - Do the texture files include pre-multiplied alpha or not?\r\n * @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.\r\n * @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.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\n spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)\r\n {\r\n var multifile;\r\n \r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new SpineFile(this, key[i]);\r\n \r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n \r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a new Spine Game Object and adds it to the Scene.\r\n * \r\n * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from\r\n * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects\r\n * do not have a Phaser origin.\r\n * \r\n * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period\r\n * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains\r\n * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference\r\n * that.\r\n * \r\n * ```javascript\r\n * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);\r\n * ```\r\n * \r\n * The key is optional. If not passed here, you need to call `SpineGameObject.setSkeleton()` to use it.\r\n * \r\n * The animation name is also optional and can be set later via `SpineGameObject.setAnimation`.\r\n * \r\n * Should you wish for more control over the object creation, such as setting a slot attachment or skin\r\n * name, then use `SpinePlugin.make` instead.\r\n *\r\n * @method SpinePlugin#add\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin.\r\n * @param {string} [animationName] - The name of the animation to set on this Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation playback be looped or not?\r\n *\r\n * @return {SpineGameObject} The Game Object that was created.\r\n */\r\n add: function (x, y, key, animationName, loop)\r\n {\r\n var spineGO = new SpineGameObject(this.scene, this, x, y, key, animationName, loop);\r\n\r\n this.scene.sys.displayList.add(spineGO);\r\n this.scene.sys.updateList.add(spineGO);\r\n \r\n return spineGO;\r\n },\r\n\r\n /**\r\n * Creates a new Spine Game Object from the given configuration file and optionally adds it to the Scene.\r\n * \r\n * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from\r\n * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects\r\n * do not have a Phaser origin.\r\n * \r\n * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period\r\n * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains\r\n * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference\r\n * that.\r\n * \r\n * ```javascript\r\n * let jelly = this.make.spine({\r\n * x: 500, y: 500, key: 'jelly',\r\n * scale: 1.5,\r\n * skinName: 'square_Green',\r\n * animationName: 'jelly-idle', loop: true,\r\n * slotName: 'hat', attachmentName: 'images/La_14'\r\n * });\r\n * ```\r\n *\r\n * @method SpinePlugin#make\r\n * @since 3.19.0\r\n *\r\n * @param {any} config - The configuration object this Game Object will use to create itself.\r\n * @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.\r\n *\r\n * @return {SpineGameObject} The Game Object that was created.\r\n */\r\n make: function (config, addToScene)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetValue(config, 'key', null);\r\n var animationName = GetValue(config, 'animationName', null);\r\n var loop = GetValue(config, 'loop', false);\r\n\r\n var spineGO = new SpineGameObject(this.scene, this, 0, 0, key, animationName, loop);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, spineGO, config);\r\n\r\n // Spine specific\r\n var skinName = GetValue(config, 'skinName', false);\r\n\r\n if (skinName)\r\n {\r\n spineGO.setSkinByName(skinName);\r\n }\r\n\r\n var slotName = GetValue(config, 'slotName', false);\r\n var attachmentName = GetValue(config, 'attachmentName', null);\r\n\r\n if (slotName)\r\n {\r\n spineGO.setAttachment(slotName, attachmentName);\r\n }\r\n\r\n return spineGO.refresh();\r\n },\r\n\r\n /**\r\n * Converts the given x and y screen coordinates into the world space of the given Skeleton.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#worldToLocal\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The screen space x coordinate to convert.\r\n * @param {number} y - The screen space y coordinate to convert.\r\n * @param {spine.Skeleton} skeleton - The Spine Skeleton to convert into.\r\n * @param {spine.Bone} [bone] - Optional bone of the Skeleton to convert into.\r\n * \r\n * @return {spine.Vector2} A Vector2 containing the translated point.\r\n */\r\n worldToLocal: function (x, y, skeleton, bone)\r\n {\r\n var temp1 = this.temp1;\r\n var temp2 = this.temp2;\r\n var camera = this.sceneRenderer.camera;\r\n\r\n temp1.set(x + skeleton.x, y - skeleton.y, 0);\r\n\r\n var width = camera.viewportWidth;\r\n var height = camera.viewportHeight;\r\n\r\n camera.screenToWorld(temp1, width, height);\r\n\r\n if (bone && bone.parent !== null)\r\n {\r\n bone.parent.worldToLocal(temp2.set(temp1.x - skeleton.x, temp1.y - skeleton.y, 0));\r\n\r\n return new Spine.Vector2(temp2.x, temp2.y);\r\n }\r\n else if (bone)\r\n {\r\n return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y);\r\n }\r\n else\r\n {\r\n return new Spine.Vector2(temp1.x, temp1.y);\r\n }\r\n },\r\n\r\n /**\r\n * Returns a Spine Vector2 based on the given x and y values.\r\n *\r\n * @method SpinePlugin#getVector2\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The Vector x value.\r\n * @param {number} y - The Vector y value.\r\n * \r\n * @return {spine.Vector2} A Spine Vector2 based on the given values.\r\n */\r\n getVector2: function (x, y)\r\n {\r\n return new Spine.Vector2(x, y);\r\n },\r\n\r\n /**\r\n * Returns a Spine Vector2 based on the given x, y and z values.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#getVector3\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The Vector x value.\r\n * @param {number} y - The Vector y value.\r\n * @param {number} z - The Vector z value.\r\n * \r\n * @return {spine.Vector2} A Spine Vector2 based on the given values.\r\n */\r\n getVector3: function (x, y, z)\r\n {\r\n return new Spine.webgl.Vector3(x, y, z);\r\n },\r\n\r\n /**\r\n * Sets `drawBones` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugBones\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugBones: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawBones = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawRegionAttachments` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugRegionAttachments\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugRegionAttachments: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawRegionAttachments = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawBoundingBoxes` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugBoundingBoxes\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugBoundingBoxes: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawBoundingBoxes = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawMeshHull` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugMeshHull\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugMeshHull: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawMeshHull = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawMeshTriangles` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugMeshTriangles\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugMeshTriangles: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawMeshTriangles = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawPaths` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugPaths\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugPaths: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawPaths = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawSkeletonXY` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugSkeletonXY\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugSkeletonXY: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawSkeletonXY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawClipping` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugClipping\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugClipping: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawClipping = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the given vertex effect on the Spine Skeleton Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setEffect\r\n * @since 3.19.0\r\n * \r\n * @param {spine.VertexEffect} [effect] - The vertex effect to set on the Skeleton Renderer.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setEffect: function (effect)\r\n {\r\n this.sceneRenderer.skeletonRenderer.vertexEffect = effect;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a Spine Skeleton based on the given key and optional Skeleton JSON data.\r\n * \r\n * The Skeleton data should have already been loaded before calling this method.\r\n *\r\n * @method SpinePlugin#createSkeleton\r\n * @since 3.19.0\r\n * \r\n * @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`.\r\n * @param {object} [skeletonJSON] - Optional Skeleton JSON data to use, instead of getting it from the cache.\r\n * \r\n * @return {(any|null)} This Spine Skeleton data object, or `null` if the key was invalid.\r\n */\r\n createSkeleton: function (key, skeletonJSON)\r\n {\r\n var atlasKey = key;\r\n var jsonKey = key;\r\n var split = (key.indexOf('.') !== -1);\r\n\r\n if (split)\r\n {\r\n var parts = key.split('.');\r\n\r\n atlasKey = parts.shift();\r\n jsonKey = parts.join('.');\r\n }\r\n\r\n var atlasData = this.cache.get(atlasKey);\r\n var atlas = this.getAtlas(atlasKey);\r\n\r\n if (!atlas)\r\n {\r\n return null;\r\n }\r\n\r\n var preMultipliedAlpha = atlasData.preMultipliedAlpha;\r\n\r\n var atlasLoader = new Spine.AtlasAttachmentLoader(atlas);\r\n \r\n var skeletonJson = new Spine.SkeletonJson(atlasLoader);\r\n\r\n var data;\r\n\r\n if (skeletonJSON)\r\n {\r\n data = skeletonJSON;\r\n }\r\n else\r\n {\r\n var json = this.json.get(atlasKey);\r\n\r\n data = (split) ? GetValue(json, jsonKey) : json;\r\n }\r\n\r\n if (data)\r\n {\r\n var skeletonData = skeletonJson.readSkeletonData(data);\r\n\r\n var skeleton = new Spine.Skeleton(skeletonData);\r\n \r\n return { skeletonData: skeletonData, skeleton: skeleton, preMultipliedAlpha: preMultipliedAlpha };\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n },\r\n\r\n /**\r\n * Creates a new Animation State and Animation State Data for the given skeleton.\r\n * \r\n * The returned object contains two properties: `state` and `stateData` respectively.\r\n *\r\n * @method SpinePlugin#createAnimationState\r\n * @since 3.19.0\r\n * \r\n * @param {spine.Skeleton} skeleton - The Skeleton to create the Animation State for.\r\n * \r\n * @return {any} An object containing the Animation State and Animation State Data instances.\r\n */\r\n createAnimationState: function (skeleton)\r\n {\r\n var stateData = new Spine.AnimationStateData(skeleton.data);\r\n\r\n var state = new Spine.AnimationState(stateData);\r\n\r\n return { stateData: stateData, state: state };\r\n },\r\n\r\n /**\r\n * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * \r\n * The returned object contains two properties: `offset` and `size`:\r\n * \r\n * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * `size` - The width and height of the AABB.\r\n *\r\n * @method SpinePlugin#getBounds\r\n * @since 3.19.0\r\n * \r\n * @param {spine.Skeleton} skeleton - The Skeleton to get the bounds from.\r\n * \r\n * @return {any} The bounds object.\r\n */\r\n getBounds: function (skeleton)\r\n {\r\n var offset = new Spine.Vector2();\r\n var size = new Spine.Vector2();\r\n\r\n skeleton.getBounds(offset, size, []);\r\n\r\n return { offset: offset, size: size };\r\n },\r\n\r\n /**\r\n * Internal handler for when the renderer resizes.\r\n * \r\n * Only called if running in WebGL.\r\n *\r\n * @method SpinePlugin#onResize\r\n * @since 3.19.0\r\n */\r\n onResize: function ()\r\n {\r\n var renderer = this.renderer;\r\n var sceneRenderer = this.sceneRenderer;\r\n\r\n var viewportWidth = renderer.width;\r\n var viewportHeight = renderer.height;\r\n\r\n sceneRenderer.camera.position.x = viewportWidth / 2;\r\n sceneRenderer.camera.position.y = viewportHeight / 2;\r\n \r\n sceneRenderer.camera.viewportWidth = viewportWidth;\r\n sceneRenderer.camera.viewportHeight = viewportHeight;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * \r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method SpinePlugin#shutdown\r\n * @private\r\n * @since 3.19.0\r\n */\r\n shutdown: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off('shutdown', this.shutdown, this);\r\n\r\n this.sceneRenderer.dispose();\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * \r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method SpinePlugin#destroy\r\n * @private\r\n * @since 3.19.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.pluginManager.removeGameObject('spine', true, true);\r\n\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n\r\n this.cache = null;\r\n this.spineTextures = null;\r\n this.json = null;\r\n this.textures = null;\r\n this.sceneRenderer = null;\r\n this.skeletonRenderer = null;\r\n this.gl = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpinePlugin;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#COMPLETE\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'complete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#DISPOSE\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'dispose';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#END\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'end';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#EVENT\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'event';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#INTERRUPTED\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'interrupted';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#START\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace SpinePluginEvents\r\n */\r\n\r\nmodule.exports = {\r\n\r\n COMPLETE: require('./COMPLETE_EVENT'),\r\n DISPOSE: require('./DISPOSE_EVENT'),\r\n END: require('./END_EVENT'),\r\n EVENT: require('./EVENT_EVENT'),\r\n INTERRUPTED: require('./INTERRUPTED_EVENT'),\r\n START: require('./START_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar AngleBetween = require('../../../../src/math/angle/Between');\r\nvar Clamp = require('../../../../src/math/Clamp');\r\nvar Class = require('../../../../src/utils/Class');\r\nvar ComponentsComputedSize = require('../../../../src/gameobjects/components/ComputedSize');\r\nvar ComponentsDepth = require('../../../../src/gameobjects/components/Depth');\r\nvar ComponentsFlip = require('../../../../src/gameobjects/components/Flip');\r\nvar ComponentsScrollFactor = require('../../../../src/gameobjects/components/ScrollFactor');\r\nvar ComponentsTransform = require('../../../../src/gameobjects/components/Transform');\r\nvar ComponentsVisible = require('../../../../src/gameobjects/components/Visible');\r\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\r\nvar DegToRad = require('../../../../src/math/DegToRad');\r\nvar GameObject = require('../../../../src/gameobjects/GameObject');\r\nvar RadToDeg = require('../../../../src/math/RadToDeg');\r\nvar SpineEvents = require('../events/');\r\nvar SpineGameObjectRender = require('./SpineGameObjectRender');\r\n\r\n/**\r\n * @classdesc\r\n * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates\r\n * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to\r\n * easily change the skin, slot attachment, bone positions and more.\r\n * \r\n * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly.\r\n * You can only create them if the Spine plugin has been loaded into Phaser.\r\n * \r\n * The quickest way is the Game Object Factory:\r\n * \r\n * ```javascript\r\n * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);\r\n * ```\r\n * \r\n * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly`\r\n * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is\r\n * an optional animation to start playing on the skeleton. The final argument `true` sets the\r\n * animation to loop. Look at the documentation for further details on each of these options.\r\n * \r\n * For more control, you can use the Game Object Creator, passing in a Spine Game Object\r\n * Configuration object:\r\n * \r\n * ```javascript\r\n * let jelly = this.make.spine({\r\n * x: 512, y: 550, key: 'jelly',\r\n * scale: 1.5,\r\n * skinName: 'square_Green',\r\n * animationName: 'jelly-think', loop: true,\r\n * slotName: 'hat', attachmentName: 'images/La_14'\r\n * });\r\n * ```\r\n * \r\n * Here, you've got the ability to specify extra details, such as the slot name, attachments or\r\n * overall scale.\r\n * \r\n * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to\r\n * update and render, it must be added to the display and update lists of your Scene:\r\n * \r\n * ```javascript\r\n * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true);\r\n * this.sys.displayList.add(jelly);\r\n * this.sys.updateList.add(jelly);\r\n * ```\r\n * \r\n * It's possible to enable Spine Game Objects for input, but you should be aware that it will use\r\n * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but\r\n * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created.\r\n * If it's not suitable, provide your own shape to the `setInteractive` method.\r\n * \r\n * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for\r\n * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game\r\n * Object position with it. See the examples for further details.\r\n * \r\n * If your Spine Game Object has black outlines around the different parts of the texture when it\r\n * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have\r\n * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details.\r\n *\r\n * @class SpineGameObject\r\n * @constructor\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to.\r\n * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin.\r\n * @param {string} [animationName] - The name of the animation to set on this Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation playback be looped or not?\r\n */\r\nvar SpineGameObject = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n ComponentsComputedSize,\r\n ComponentsDepth,\r\n ComponentsFlip,\r\n ComponentsScrollFactor,\r\n ComponentsTransform,\r\n ComponentsVisible,\r\n SpineGameObjectRender\r\n ],\r\n\r\n initialize:\r\n\r\n function SpineGameObject (scene, plugin, x, y, key, animationName, loop)\r\n {\r\n GameObject.call(this, scene, 'Spine');\r\n\r\n /**\r\n * A reference to the Spine Plugin.\r\n *\r\n * @name SpineGameObject#plugin\r\n * @type {SpinePlugin}\r\n * @since 3.19.0\r\n */\r\n this.plugin = plugin;\r\n\r\n /**\r\n * The Spine Skeleton this Game Object is using.\r\n *\r\n * @name SpineGameObject#skeleton\r\n * @type {spine.Skeleton}\r\n * @since 3.19.0\r\n */\r\n this.skeleton = null;\r\n\r\n /**\r\n * The Spine Skeleton Data associated with the Skeleton this Game Object is using.\r\n *\r\n * @name SpineGameObject#skeletonData\r\n * @type {spine.SkeletonData}\r\n * @since 3.19.0\r\n */\r\n this.skeletonData = null;\r\n\r\n /**\r\n * The Spine Animation State this Game Object is using.\r\n *\r\n * @name SpineGameObject#state\r\n * @type {spine.AnimationState}\r\n * @since 3.19.0\r\n */\r\n this.state = null;\r\n\r\n /**\r\n * The Spine Animation State Data associated with the Animation State this Game Object is using.\r\n *\r\n * @name SpineGameObject#stateData\r\n * @type {spine.AnimationStateData}\r\n * @since 3.19.0\r\n */\r\n this.stateData = null;\r\n\r\n /**\r\n * A reference to the root bone of the Skeleton.\r\n *\r\n * @name SpineGameObject#root\r\n * @type {spine.Bone}\r\n * @since 3.19.0\r\n */\r\n this.root = null;\r\n\r\n /**\r\n * This object holds the calculated bounds of the current\r\n * pose, as set when a new Skeleton is applied.\r\n *\r\n * @name SpineGameObject#bounds\r\n * @type {any}\r\n * @since 3.19.0\r\n */\r\n this.bounds = null;\r\n \r\n /**\r\n * A Game Object level flag that allows you to enable debug drawing\r\n * to the Skeleton Debug Renderer by toggling it.\r\n *\r\n * @name SpineGameObject#drawDebug\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.drawDebug = false;\r\n\r\n /**\r\n * The factor to scale the Animation update time by.\r\n *\r\n * @name SpineGameObject#timeScale\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.timeScale = 1;\r\n\r\n /**\r\n * The calculated Display Origin of this Game Object.\r\n *\r\n * @name SpineGameObject#displayOriginX\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.displayOriginX = 0;\r\n\r\n /**\r\n * The calculated Display Origin of this Game Object.\r\n *\r\n * @name SpineGameObject#displayOriginY\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.displayOriginY = 0;\r\n\r\n /**\r\n * A flag that stores if the texture associated with the current\r\n * Skin being used by this Game Object, has its alpha pre-multiplied\r\n * into it, or not.\r\n *\r\n * @name SpineGameObject#preMultipliedAlpha\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.preMultipliedAlpha = false;\r\n\r\n /**\r\n * A default Blend Mode. You cannot change the blend mode of a\r\n * Spine Game Object.\r\n *\r\n * @name SpineGameObject#blendMode\r\n * @type {number}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.blendMode = 0;\r\n\r\n this.setPosition(x, y);\r\n\r\n if (key)\r\n {\r\n this.setSkeleton(key, animationName, loop);\r\n }\r\n },\r\n\r\n /**\r\n * Overrides the default Game Object method and always returns true.\r\n * Rendering is decided in the renderer functions.\r\n *\r\n * @method SpineGameObject#willRender\r\n * @since 3.19.0\r\n *\r\n * @return {boolean} Always returns `true`.\r\n */\r\n willRender: function ()\r\n {\r\n return true;\r\n },\r\n\r\n /**\r\n * Set the Alpha level for the whole Skeleton of this Game Object.\r\n * \r\n * The alpha controls the opacity of the Game Object as it renders.\r\n * \r\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\r\n *\r\n * @method SpineGameObject#setAlpha\r\n * @since 3.19.0\r\n *\r\n * @param {number} [value=1] - The alpha value used for the whole Skeleton.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAlpha: function (value, slotName)\r\n {\r\n if (value === undefined) { value = 1; }\r\n\r\n if (slotName)\r\n {\r\n var slot = this.findSlot(slotName);\r\n\r\n if (slot)\r\n {\r\n slot.color.a = Clamp(value, 0, 1);\r\n }\r\n }\r\n else\r\n {\r\n this.alpha = value;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The alpha value of the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#alpha\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n alpha: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.a;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.a = v;\r\n }\r\n\r\n if (v === 0)\r\n {\r\n this.renderFlags &= ~2;\r\n }\r\n else\r\n {\r\n this.renderFlags |= 2;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of red used when rendering the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#red\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n red: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.r;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.r = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of green used when rendering the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#green\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n green: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.g;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.g = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of blue used when rendering the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#blue\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n blue: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.b;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.b = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton.\r\n *\r\n * @method SpineGameObject#setColor\r\n * @since 3.19.0\r\n *\r\n * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color.\r\n * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setColor: function (color, slotName)\r\n {\r\n if (color === undefined) { color = 0xffffff; }\r\n\r\n var red = (color >> 16 & 0xFF) / 255;\r\n var green = (color >> 8 & 0xFF) / 255;\r\n var blue = (color & 0xFF) / 255;\r\n var alpha = (color > 16777215) ? (color >>> 24) / 255 : null;\r\n\r\n var target = this.skeleton;\r\n\r\n if (slotName)\r\n {\r\n var slot = this.findSlot(slotName);\r\n\r\n if (slot)\r\n {\r\n target = slot;\r\n }\r\n }\r\n\r\n target.color.r = red;\r\n target.color.g = green;\r\n target.color.b = blue;\r\n\r\n if (alpha !== null)\r\n {\r\n target.color.a = alpha;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object\r\n * that contains the Skeleton data.\r\n *\r\n * @method SpineGameObject#setSkeletonFromJSON\r\n * @since 3.19.0\r\n * \r\n * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton.\r\n * @param {object} skeletonJSON - The JSON data for the Skeleton.\r\n * @param {string} [animationName] - Optional name of the animation to set on the Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation, if set, loop or not?\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop)\r\n {\r\n return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop);\r\n },\r\n\r\n /**\r\n * Sets this Game Object to use the given Skeleton based on its cache key.\r\n * \r\n * Typically, once set, the Skeleton doesn't change. Instead, you change the skin,\r\n * or slot attachment, or any other property to adjust it.\r\n *\r\n * @method SpineGameObject#setSkeleton\r\n * @since 3.19.0\r\n * \r\n * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton.\r\n * @param {object} skeletonJSON - The JSON data for the Skeleton.\r\n * @param {string} [animationName] - Optional name of the animation to set on the Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation, if set, loop or not?\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON)\r\n {\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON);\r\n\r\n this.skeletonData = data.skeletonData;\r\n\r\n this.preMultipliedAlpha = data.preMultipliedAlpha;\r\n\r\n var skeleton = data.skeleton;\r\n\r\n skeleton.setSkinByName('default');\r\n skeleton.setToSetupPose();\r\n\r\n this.skeleton = skeleton;\r\n\r\n // AnimationState\r\n data = this.plugin.createAnimationState(skeleton);\r\n\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n this.state = data.state;\r\n this.stateData = data.stateData;\r\n\r\n this.state.addListener({\r\n event: this.onEvent.bind(this),\r\n complete: this.onComplete.bind(this),\r\n start: this.onStart.bind(this),\r\n end: this.onEnd.bind(this),\r\n dispose: this.onDispose.bind(this),\r\n interrupted: this.onInterrupted.bind(this)\r\n });\r\n\r\n if (animationName)\r\n {\r\n this.setAnimation(0, animationName, loop);\r\n }\r\n\r\n this.root = this.getRootBone();\r\n\r\n if (this.root)\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90;\r\n }\r\n\r\n this.state.apply(skeleton);\r\n\r\n skeleton.updateCache();\r\n\r\n return this.updateSize();\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onComplete event via this Game Object.\r\n *\r\n * @method SpineGameObject#onComplete\r\n * @fires SpinePluginEvents#COMPLETE\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onComplete: function (entry)\r\n {\r\n this.emit(SpineEvents.COMPLETE, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onDispose event via this Game Object.\r\n *\r\n * @method SpineGameObject#onDispose\r\n * @fires SpinePluginEvents#DISPOSE\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onDispose: function (entry)\r\n {\r\n this.emit(SpineEvents.DISPOSE, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onEnd event via this Game Object.\r\n *\r\n * @method SpineGameObject#onEnd\r\n * @fires SpinePluginEvents#END\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onEnd: function (entry)\r\n {\r\n this.emit(SpineEvents.END, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine Event event via this Game Object.\r\n *\r\n * @method SpineGameObject#onEvent\r\n * @fires SpinePluginEvents#EVENT\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n * @param {spine.Event} event - The Spine event.\r\n */\r\n onEvent: function (entry, event)\r\n {\r\n this.emit(SpineEvents.EVENT, entry, event);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onInterrupted event via this Game Object.\r\n *\r\n * @method SpineGameObject#onInterrupted\r\n * @fires SpinePluginEvents#INTERRUPTED\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onInterrupted: function (entry)\r\n {\r\n this.emit(SpineEvents.INTERRUPTED, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onStart event via this Game Object.\r\n *\r\n * @method SpineGameObject#onStart\r\n * @fires SpinePluginEvents#START\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onStart: function (entry)\r\n {\r\n this.emit(SpineEvents.START, entry);\r\n },\r\n\r\n /**\r\n * Refreshes the data about the current Skeleton.\r\n * \r\n * This will reset the rotation, position and size of the Skeleton to match this Game Object.\r\n * \r\n * Call this method if you need to access the Skeleton data directly, and it may have changed\r\n * recently.\r\n *\r\n * @method SpineGameObject#refresh\r\n * @since 3.19.0\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n refresh: function ()\r\n {\r\n if (this.root)\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90;\r\n }\r\n\r\n this.updateSize();\r\n\r\n this.skeleton.updateCache();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the size of this Game Object.\r\n * \r\n * If no arguments are given it uses the current skeleton data dimensions.\r\n * \r\n * You can use this method to set a fixed size of this Game Object, such as for input detection,\r\n * when the skeleton data doesn't match what is required in-game.\r\n *\r\n * @method SpineGameObject#setSize\r\n * @since 3.19.0\r\n * \r\n * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width.\r\n * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height.\r\n * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate.\r\n * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate.\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n setSize: function (width, height, offsetX, offsetY)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n if (width === undefined) { width = skeleton.data.width; }\r\n if (height === undefined) { height = skeleton.data.height; }\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n this.displayOriginX = skeleton.x - offsetX;\r\n this.displayOriginY = skeleton.y - offsetY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the offset of this Game Object from the Skeleton position.\r\n * \r\n * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using.\r\n *\r\n * @method SpineGameObject#setOffset\r\n * @since 3.19.0\r\n * \r\n * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate.\r\n * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate.\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n setOffset: function (offsetX, offsetY)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n this.displayOriginX = skeleton.x - offsetX;\r\n this.displayOriginY = skeleton.y - offsetY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that syncs all of the Game Object position and scale data to the Skeleton.\r\n * It then syncs the skeleton bounds back to this Game Object.\r\n * \r\n * This method is called automatically as needed internally, however, it's also exposed should\r\n * you require overriding the size settings.\r\n *\r\n * @method SpineGameObject#updateSize\r\n * @since 3.19.0\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n updateSize: function ()\r\n {\r\n var skeleton = this.skeleton;\r\n var renderer = this.plugin.renderer;\r\n\r\n var height = renderer.height;\r\n\r\n var oldScaleX = this.scaleX;\r\n var oldScaleY = this.scaleY;\r\n\r\n skeleton.x = this.x;\r\n skeleton.y = height - this.y;\r\n skeleton.scaleX = 1;\r\n skeleton.scaleY = 1;\r\n\r\n skeleton.updateWorldTransform();\r\n\r\n var bounds = this.getBounds();\r\n\r\n this.width = bounds.size.x;\r\n this.height = bounds.size.y;\r\n\r\n this.displayOriginX = this.x - bounds.offset.x;\r\n this.displayOriginY = this.y - (height - (this.height + bounds.offset.y));\r\n\r\n skeleton.scaleX = oldScaleX;\r\n skeleton.scaleY = oldScaleY;\r\n\r\n skeleton.updateWorldTransform();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The horizontal scale of this Game Object, as applied to the Skeleton it is using.\r\n *\r\n * @name SpineGameObject#scaleX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.19.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n\r\n this.refresh();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of this Game Object, as applied to the Skeleton it is using.\r\n *\r\n * @name SpineGameObject#scaleY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.19.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleY = value;\r\n\r\n this.refresh();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the bones in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getBoneList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the bones in the Skeleton Data.\r\n */\r\n getBoneList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.bones.length; i++)\r\n {\r\n output.push(skeletonData.bones[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the skins in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getSkinList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the skins in the Skeleton Data.\r\n */\r\n getSkinList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.skins.length; i++)\r\n {\r\n output.push(skeletonData.skins[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the slots in the Skeleton.\r\n *\r\n * @method SpineGameObject#getSlotList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the slots in the Skeleton.\r\n */\r\n getSlotList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeleton = this.skeleton;\r\n\r\n for (var i = 0; i < skeleton.slots.length; i++)\r\n {\r\n output.push(skeleton.slots[i].data.name);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the animations in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getAnimationList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the animations in the Skeleton Data.\r\n */\r\n getAnimationList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.animations.length; i++)\r\n {\r\n output.push(skeletonData.animations[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the current animation being played on the given track, if any.\r\n *\r\n * @method SpineGameObject#getCurrentAnimation\r\n * @since 3.19.0\r\n * \r\n * @param {integer} [trackIndex=0] - The track to return the current animation on.\r\n * \r\n * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation.\r\n */\r\n getCurrentAnimation: function (trackIndex)\r\n {\r\n if (trackIndex === undefined) { trackIndex = 0; }\r\n\r\n var current = this.state.getCurrent(trackIndex);\r\n\r\n if (current)\r\n {\r\n return current.animation;\r\n }\r\n },\r\n\r\n /**\r\n * Sets the current animation for a track, discarding any queued animations.\r\n * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from).\r\n * \r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n *\r\n * @method SpineGameObject#play\r\n * @fires SpinePluginEvents#START\r\n * @since 3.19.0\r\n *\r\n * @param {string} animationName - The string-based key of the animation to play.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call.\r\n *\r\n * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead.\r\n */\r\n play: function (animationName, loop, ignoreIfPlaying)\r\n {\r\n this.setAnimation(0, animationName, loop, ignoreIfPlaying);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current animation for a track, discarding any queued animations.\r\n * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from).\r\n * \r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n *\r\n * @method SpineGameObject#setAnimation\r\n * @fires SpinePluginEvents#START\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to play the animation on.\r\n * @param {string} animationName - The string-based key of the animation to play.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call.\r\n *\r\n * @return {spine.TrackEntry} A track entry to allow further customization of animation playback.\r\n */\r\n setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying)\r\n {\r\n if (loop === undefined) { loop = false; }\r\n if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; }\r\n\r\n if (ignoreIfPlaying && this.state)\r\n {\r\n var currentTrack = this.state.getCurrent(0);\r\n \r\n if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete())\r\n {\r\n return;\r\n }\r\n }\r\n\r\n if (this.findAnimation(animationName))\r\n {\r\n return this.state.setAnimation(trackIndex, animationName, loop);\r\n }\r\n },\r\n\r\n /**\r\n * Adds an animation to be played after the current or last queued animation for a track.\r\n * If the track is empty, it is equivalent to calling setAnimation.\r\n * \r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n * \r\n * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous\r\n * track entry minus any mix duration (from the AnimationStateData) plus the specified delay\r\n * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration).\r\n * If the previous entry is looping, its next loop completion is used instead of its duration.\r\n *\r\n * @method SpineGameObject#addAnimation\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n * @param {string} animationName - The string-based key of the animation to add.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played.\r\n *\r\n * @return {spine.TrackEntry} A track entry to allow further customization of animation playback.\r\n */\r\n addAnimation: function (trackIndex, animationName, loop, delay)\r\n {\r\n return this.state.addAnimation(trackIndex, animationName, loop, delay);\r\n },\r\n\r\n /**\r\n * Sets an empty animation for a track, discarding any queued animations, and sets the track\r\n * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out.\r\n * \r\n * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation,\r\n * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be\r\n * applied less and less over the mix duration. Properties keyed in the previous animation transition to\r\n * the value from lower tracks or to the setup pose value if no lower tracks key the property.\r\n * A mix duration of 0 still mixes out over one frame.\r\n * \r\n * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation\r\n * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new\r\n * animation to be applied more and more over the mix duration. Properties keyed in the new animation\r\n * transition from the value from lower tracks or from the setup pose value if no lower tracks key the\r\n * property to the value keyed in the new animation.\r\n *\r\n * @method SpineGameObject#setEmptyAnimation\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any).\r\n *\r\n * @return {spine.TrackEntry} The returned Track Entry.\r\n */\r\n setEmptyAnimation: function (trackIndex, mixDuration)\r\n {\r\n return this.state.setEmptyAnimation(trackIndex, mixDuration);\r\n },\r\n\r\n /**\r\n * Removes all animations from the track, leaving skeletons in their current pose.\r\n * \r\n * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose.\r\n *\r\n * @method SpineGameObject#clearTrack\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n clearTrack: function (trackIndex)\r\n {\r\n this.state.clearTrack(trackIndex);\r\n\r\n return this;\r\n },\r\n \r\n /**\r\n * Removes all animations from all tracks, leaving skeletons in their current pose.\r\n * \r\n * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose.\r\n *\r\n * @method SpineGameObject#clearTracks\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n clearTracks: function ()\r\n {\r\n this.state.clearTracks();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the skin used to look up attachments before looking in the defaultSkin.\r\n * \r\n * Attachments from the new skin are attached if the corresponding attachment from the\r\n * old skin was attached. If there was no old skin, each slot's setup mode attachment is\r\n * attached from the new skin.\r\n * \r\n * After changing the skin, the visible attachments can be reset to those attached in the\r\n * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time\r\n * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide\r\n * or show attachments from the new skin.\r\n *\r\n * @method SpineGameObject#setSkinByName\r\n * @since 3.19.0\r\n * \r\n * @param {string} skinName - The name of the skin to set.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkinByName: function (skinName)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n skeleton.setSkinByName(skinName);\r\n\r\n skeleton.setSlotsToSetupPose();\r\n\r\n this.state.apply(skeleton);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the skin used to look up attachments before looking in the defaultSkin.\r\n * \r\n * Attachments from the new skin are attached if the corresponding attachment from the\r\n * old skin was attached. If there was no old skin, each slot's setup mode attachment is\r\n * attached from the new skin.\r\n * \r\n * After changing the skin, the visible attachments can be reset to those attached in the\r\n * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time\r\n * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide\r\n * or show attachments from the new skin.\r\n *\r\n * @method SpineGameObject#setSkin\r\n * @since 3.19.0\r\n * \r\n * @param {?spine.Skin} newSkin - The Skin to set. May be `null`.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkin: function (newSkin)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n skeleton.setSkin(newSkin);\r\n\r\n skeleton.setSlotsToSetupPose();\r\n\r\n this.state.apply(skeleton);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the mix duration when changing from the specified animation to the other.\r\n *\r\n * @method SpineGameObject#setMix\r\n * @since 3.19.0\r\n * \r\n * @param {string} fromName - The animation to mix from.\r\n * @param {string} toName - The animation to mix to.\r\n * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any).\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setMix: function (fromName, toName, duration)\r\n {\r\n this.stateData.setMix(fromName, toName, duration);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Finds an attachment by looking in the skin and defaultSkin using the slot\r\n * index and attachment name. First the skin is checked and if the attachment was not found,\r\n * the default skin is checked.\r\n *\r\n * @method SpineGameObject#getAttachment\r\n * @since 3.19.0\r\n * \r\n * @param {integer} slotIndex - The slot index to search.\r\n * @param {string} attachmentName - The attachment name to look for.\r\n *\r\n * @return {?spine.Attachment} The Attachment, if found. May be null.\r\n */\r\n getAttachment: function (slotIndex, attachmentName)\r\n {\r\n return this.skeleton.getAttachment(slotIndex, attachmentName);\r\n },\r\n\r\n /**\r\n * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name.\r\n *\r\n * @method SpineGameObject#getAttachmentByName\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The slot name to search.\r\n * @param {string} attachmentName - The attachment name to look for.\r\n *\r\n * @return {?spine.Attachment} The Attachment, if found. May be null.\r\n */\r\n getAttachmentByName: function (slotName, attachmentName)\r\n {\r\n return this.skeleton.getAttachmentByName(slotName, attachmentName);\r\n },\r\n\r\n /**\r\n * A convenience method to set an attachment by finding the slot with findSlot,\r\n * finding the attachment with getAttachment, then setting the slot's attachment.\r\n *\r\n * @method SpineGameObject#setAttachment\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The slot name to add the attachment to.\r\n * @param {string} attachmentName - The attachment name to add.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAttachment: function (slotName, attachmentName)\r\n {\r\n if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length)\r\n {\r\n for (var i = 0; i < slotName.length; i++)\r\n {\r\n this.skeleton.setAttachment(slotName[i], attachmentName[i]);\r\n }\r\n }\r\n else\r\n {\r\n this.skeleton.setAttachment(slotName, attachmentName);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the bones, constraints, slots, and draw order to their setup pose values.\r\n *\r\n * @method SpineGameObject#setToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setToSetupPose: function ()\r\n {\r\n this.skeleton.setToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the slots and draw order to their setup pose values.\r\n *\r\n * @method SpineGameObject#setSlotsToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSlotsToSetupPose: function ()\r\n {\r\n this.skeleton.setSlotsToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the bones and constraints to their setup pose values.\r\n *\r\n * @method SpineGameObject#setBonesToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setBonesToSetupPose: function ()\r\n {\r\n this.skeleton.setBonesToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the root bone, or null.\r\n *\r\n * @method SpineGameObject#getRootBone\r\n * @since 3.19.0\r\n *\r\n * @return {spine.Bone} The root bone, or null.\r\n */\r\n getRootBone: function ()\r\n {\r\n return this.skeleton.getRootBone();\r\n },\r\n\r\n /**\r\n * Takes a Bone object and a position in world space and rotates the Bone so it is angled\r\n * towards the given position. You can set an optional angle offset, should the bone be\r\n * designed at a specific angle already. You can also set a minimum and maximum range for the angle.\r\n *\r\n * @method SpineGameObject#angleBoneToXY\r\n * @since 3.19.0\r\n * \r\n * @param {spine.Bone} bone - The bone to rotate towards the world position.\r\n * @param {number} worldX - The world x coordinate to rotate the bone towards.\r\n * @param {number} worldY - The world y coordinate to rotate the bone towards.\r\n * @param {number} [offset=0] - An offset to add to the rotation angle.\r\n * @param {number} [minAngle=0] - The minimum range of the rotation angle.\r\n * @param {number} [maxAngle=360] - The maximum range of the rotation angle.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle)\r\n {\r\n if (offset === undefined) { offset = 0; }\r\n if (minAngle === undefined) { minAngle = 0; }\r\n if (maxAngle === undefined) { maxAngle = 360; }\r\n\r\n var renderer = this.plugin.renderer;\r\n var height = renderer.height;\r\n\r\n var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset));\r\n\r\n bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Finds a bone by comparing each bone's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findBone\r\n * @since 3.19.0\r\n * \r\n * @param {string} boneName - The name of the bone to find.\r\n *\r\n * @return {spine.Bone} The bone, or null.\r\n */\r\n findBone: function (boneName)\r\n {\r\n return this.skeleton.findBone(boneName);\r\n },\r\n\r\n /**\r\n * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findBoneIndex\r\n * @since 3.19.0\r\n * \r\n * @param {string} boneName - The name of the bone to find.\r\n *\r\n * @return {integer} The bone index. Or -1 if the bone was not found.\r\n */\r\n findBoneIndex: function (boneName)\r\n {\r\n return this.skeleton.findBoneIndex(boneName);\r\n },\r\n\r\n /**\r\n * Finds a slot by comparing each slot's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSlot\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The name of the slot to find.\r\n *\r\n * @return {spine.Slot} The Slot. May be null.\r\n */\r\n findSlot: function (slotName)\r\n {\r\n return this.skeleton.findSlot(slotName);\r\n },\r\n\r\n /**\r\n * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSlotIndex\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The name of the slot to find.\r\n *\r\n * @return {integer} The slot index. Or -1 if the Slot was not found.\r\n */\r\n findSlotIndex: function (slotName)\r\n {\r\n return this.skeleton.findSlotIndex(slotName);\r\n },\r\n\r\n /**\r\n * Finds a skin by comparing each skin's name. It is more efficient to cache the results of\r\n * this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSkin\r\n * @since 3.19.0\r\n * \r\n * @param {string} skinName - The name of the skin to find.\r\n *\r\n * @return {spine.Skin} The Skin. May be null.\r\n */\r\n findSkin: function (skinName)\r\n {\r\n return this.skeletonData.findSkin(skinName);\r\n },\r\n\r\n /**\r\n * Finds an event by comparing each events's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findEvent\r\n * @since 3.19.0\r\n * \r\n * @param {string} eventDataName - The name of the event to find.\r\n *\r\n * @return {spine.EventData} The Event Data. May be null.\r\n */\r\n findEvent: function (eventDataName)\r\n {\r\n return this.skeletonData.findEvent(eventDataName);\r\n },\r\n\r\n /**\r\n * Finds an animation by comparing each animation's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findAnimation\r\n * @since 3.19.0\r\n * \r\n * @param {string} animationName - The name of the animation to find.\r\n *\r\n * @return {spine.Animation} The Animation. May be null.\r\n */\r\n findAnimation: function (animationName)\r\n {\r\n return this.skeletonData.findAnimation(animationName);\r\n },\r\n\r\n /**\r\n * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findIkConstraint\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.IkConstraintData} The IK constraint. May be null.\r\n */\r\n findIkConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findIkConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds an transform constraint by comparing each transform constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findTransformConstraint\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.TransformConstraintData} The transform constraint. May be null.\r\n */\r\n findTransformConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findTransformConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds a path constraint by comparing each path constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findPathConstraint\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.PathConstraintData} The path constraint. May be null.\r\n */\r\n findPathConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findPathConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds the index of a path constraint by comparing each path constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findPathConstraintIndex\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {integer} The constraint index. Or -1 if the constraint was not found.\r\n */\r\n findPathConstraintIndex: function (constraintName)\r\n {\r\n return this.skeletonData.findPathConstraintIndex(constraintName);\r\n },\r\n\r\n /**\r\n * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * \r\n * The returned object contains two properties: `offset` and `size`:\r\n * \r\n * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * `size` - The width and height of the AABB.\r\n *\r\n * @method SpineGameObject#getBounds\r\n * @since 3.19.0\r\n * \r\n * @return {any} The bounds object.\r\n */\r\n getBounds: function ()\r\n {\r\n return this.plugin.getBounds(this.skeleton);\r\n },\r\n\r\n /**\r\n * Internal update handler.\r\n *\r\n * @method SpineGameObject#preUpdate\r\n * @protected\r\n * @since 3.19.0\r\n * \r\n * @param {number} time - The current timestamp.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n preUpdate: function (time, delta)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n this.state.update((delta / 1000) * this.timeScale);\r\n\r\n this.state.apply(skeleton);\r\n\r\n // this.emit('spine.update', skeleton);\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method SpineGameObject#preDestroy\r\n * @protected\r\n * @since 3.19.0\r\n */\r\n preDestroy: function ()\r\n {\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n this.plugin = null;\r\n\r\n this.skeleton = null;\r\n this.skeletonData = null;\r\n\r\n this.state = null;\r\n this.stateData = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpineGameObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\r\nvar RadToDeg = require('../../../../src/math/RadToDeg');\r\nvar Wrap = require('../../../../src/math/Wrap');\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method SpineGameObject#renderCanvas\r\n * @since 3.19.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {SpineGameObject} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var context = renderer.currentContext;\r\n\r\n var plugin = src.plugin;\r\n var skeleton = src.skeleton;\r\n var skeletonRenderer = plugin.skeletonRenderer;\r\n\r\n var GameObjectRenderMask = 15;\r\n\r\n var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)));\r\n\r\n if (!skeleton || !willRender)\r\n {\r\n return;\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1;\r\n var spriteMatrix = renderer._tempMatrix2;\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY));\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = src.x;\r\n spriteMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n skeleton.x = calcMatrix.tx;\r\n skeleton.y = calcMatrix.ty;\r\n\r\n skeleton.scaleX = calcMatrix.scaleX;\r\n\r\n // Inverse or we get upside-down skeletons\r\n skeleton.scaleY = calcMatrix.scaleY * -1;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n skeleton.scaleX *= -1;\r\n\r\n src.root.rotation = RadToDeg(calcMatrix.rotationNormalized);\r\n }\r\n else\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360);\r\n }\r\n\r\n if (src.scaleY < 0)\r\n {\r\n skeleton.scaleY *= -1;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n else\r\n {\r\n src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n }\r\n\r\n if (camera.renderToTexture)\r\n {\r\n skeleton.y = calcMatrix.ty;\r\n skeleton.scaleY *= -1;\r\n }\r\n\r\n // Add autoUpdate option\r\n skeleton.updateWorldTransform();\r\n\r\n skeletonRenderer.ctx = context;\r\n skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug);\r\n\r\n context.save();\r\n\r\n skeletonRenderer.draw(skeleton);\r\n\r\n context.restore();\r\n};\r\n\r\nmodule.exports = SpineGameObjectCanvasRenderer;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar renderWebGL = require('../../../../src/utils/NOOP');\r\nvar renderCanvas = require('../../../../src/utils/NOOP');\r\n\r\nif (typeof WEBGL_RENDERER)\r\n{\r\n renderWebGL = require('./SpineGameObjectWebGLRenderer');\r\n}\r\n\r\nif (typeof CANVAS_RENDERER)\r\n{\r\n renderCanvas = require('./SpineGameObjectCanvasRenderer');\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n","/*** IMPORTS FROM imports-loader ***/\n(function() {\n\nvar __extends = (this && this.__extends) || (function () {\r\n\tvar extendStatics = Object.setPrototypeOf ||\r\n\t\t({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n\t\tfunction (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\treturn function (d, b) {\r\n\t\textendStatics(d, b);\r\n\t\tfunction __() { this.constructor = d; }\r\n\t\td.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n\t};\r\n})();\r\nvar spine;\r\n(function (spine) {\r\n\tvar Animation = (function () {\r\n\t\tfunction Animation(name, timelines, duration) {\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tif (timelines == null)\r\n\t\t\t\tthrow new Error(\"timelines cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t\tthis.timelines = timelines;\r\n\t\t\tthis.duration = duration;\r\n\t\t}\r\n\t\tAnimation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tif (loop && this.duration != 0) {\r\n\t\t\t\ttime %= this.duration;\r\n\t\t\t\tif (lastTime > 0)\r\n\t\t\t\t\tlastTime %= this.duration;\r\n\t\t\t}\r\n\t\t\tvar timelines = this.timelines;\r\n\t\t\tfor (var i = 0, n = timelines.length; i < n; i++)\r\n\t\t\t\ttimelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\r\n\t\t};\r\n\t\tAnimation.binarySearch = function (values, target, step) {\r\n\t\t\tif (step === void 0) { step = 1; }\r\n\t\t\tvar low = 0;\r\n\t\t\tvar high = values.length / step - 2;\r\n\t\t\tif (high == 0)\r\n\t\t\t\treturn step;\r\n\t\t\tvar current = high >>> 1;\r\n\t\t\twhile (true) {\r\n\t\t\t\tif (values[(current + 1) * step] <= target)\r\n\t\t\t\t\tlow = current + 1;\r\n\t\t\t\telse\r\n\t\t\t\t\thigh = current;\r\n\t\t\t\tif (low == high)\r\n\t\t\t\t\treturn (low + 1) * step;\r\n\t\t\t\tcurrent = (low + high) >>> 1;\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimation.linearSearch = function (values, target, step) {\r\n\t\t\tfor (var i = 0, last = values.length - step; i <= last; i += step)\r\n\t\t\t\tif (values[i] > target)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\treturn Animation;\r\n\t}());\r\n\tspine.Animation = Animation;\r\n\tvar MixBlend;\r\n\t(function (MixBlend) {\r\n\t\tMixBlend[MixBlend[\"setup\"] = 0] = \"setup\";\r\n\t\tMixBlend[MixBlend[\"first\"] = 1] = \"first\";\r\n\t\tMixBlend[MixBlend[\"replace\"] = 2] = \"replace\";\r\n\t\tMixBlend[MixBlend[\"add\"] = 3] = \"add\";\r\n\t})(MixBlend = spine.MixBlend || (spine.MixBlend = {}));\r\n\tvar MixDirection;\r\n\t(function (MixDirection) {\r\n\t\tMixDirection[MixDirection[\"in\"] = 0] = \"in\";\r\n\t\tMixDirection[MixDirection[\"out\"] = 1] = \"out\";\r\n\t})(MixDirection = spine.MixDirection || (spine.MixDirection = {}));\r\n\tvar TimelineType;\r\n\t(function (TimelineType) {\r\n\t\tTimelineType[TimelineType[\"rotate\"] = 0] = \"rotate\";\r\n\t\tTimelineType[TimelineType[\"translate\"] = 1] = \"translate\";\r\n\t\tTimelineType[TimelineType[\"scale\"] = 2] = \"scale\";\r\n\t\tTimelineType[TimelineType[\"shear\"] = 3] = \"shear\";\r\n\t\tTimelineType[TimelineType[\"attachment\"] = 4] = \"attachment\";\r\n\t\tTimelineType[TimelineType[\"color\"] = 5] = \"color\";\r\n\t\tTimelineType[TimelineType[\"deform\"] = 6] = \"deform\";\r\n\t\tTimelineType[TimelineType[\"event\"] = 7] = \"event\";\r\n\t\tTimelineType[TimelineType[\"drawOrder\"] = 8] = \"drawOrder\";\r\n\t\tTimelineType[TimelineType[\"ikConstraint\"] = 9] = \"ikConstraint\";\r\n\t\tTimelineType[TimelineType[\"transformConstraint\"] = 10] = \"transformConstraint\";\r\n\t\tTimelineType[TimelineType[\"pathConstraintPosition\"] = 11] = \"pathConstraintPosition\";\r\n\t\tTimelineType[TimelineType[\"pathConstraintSpacing\"] = 12] = \"pathConstraintSpacing\";\r\n\t\tTimelineType[TimelineType[\"pathConstraintMix\"] = 13] = \"pathConstraintMix\";\r\n\t\tTimelineType[TimelineType[\"twoColor\"] = 14] = \"twoColor\";\r\n\t})(TimelineType = spine.TimelineType || (spine.TimelineType = {}));\r\n\tvar CurveTimeline = (function () {\r\n\t\tfunction CurveTimeline(frameCount) {\r\n\t\t\tif (frameCount <= 0)\r\n\t\t\t\tthrow new Error(\"frameCount must be > 0: \" + frameCount);\r\n\t\t\tthis.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\r\n\t\t}\r\n\t\tCurveTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.setLinear = function (frameIndex) {\r\n\t\t\tthis.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.setStepped = function (frameIndex) {\r\n\t\t\tthis.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.getCurveType = function (frameIndex) {\r\n\t\t\tvar index = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n\t\t\tif (index == this.curves.length)\r\n\t\t\t\treturn CurveTimeline.LINEAR;\r\n\t\t\tvar type = this.curves[index];\r\n\t\t\tif (type == CurveTimeline.LINEAR)\r\n\t\t\t\treturn CurveTimeline.LINEAR;\r\n\t\t\tif (type == CurveTimeline.STEPPED)\r\n\t\t\t\treturn CurveTimeline.STEPPED;\r\n\t\t\treturn CurveTimeline.BEZIER;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) {\r\n\t\t\tvar tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n\t\t\tvar dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n\t\t\tvar ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n\t\t\tvar dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\r\n\t\t\tvar i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n\t\t\tvar curves = this.curves;\r\n\t\t\tcurves[i++] = CurveTimeline.BEZIER;\r\n\t\t\tvar x = dfx, y = dfy;\r\n\t\t\tfor (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n\t\t\t\tcurves[i] = x;\r\n\t\t\t\tcurves[i + 1] = y;\r\n\t\t\t\tdfx += ddfx;\r\n\t\t\t\tdfy += ddfy;\r\n\t\t\t\tddfx += dddfx;\r\n\t\t\t\tddfy += dddfy;\r\n\t\t\t\tx += dfx;\r\n\t\t\t\ty += dfy;\r\n\t\t\t}\r\n\t\t};\r\n\t\tCurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) {\r\n\t\t\tpercent = spine.MathUtils.clamp(percent, 0, 1);\r\n\t\t\tvar curves = this.curves;\r\n\t\t\tvar i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n\t\t\tvar type = curves[i];\r\n\t\t\tif (type == CurveTimeline.LINEAR)\r\n\t\t\t\treturn percent;\r\n\t\t\tif (type == CurveTimeline.STEPPED)\r\n\t\t\t\treturn 0;\r\n\t\t\ti++;\r\n\t\t\tvar x = 0;\r\n\t\t\tfor (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n\t\t\t\tx = curves[i];\r\n\t\t\t\tif (x >= percent) {\r\n\t\t\t\t\tvar prevX = void 0, prevY = void 0;\r\n\t\t\t\t\tif (i == start) {\r\n\t\t\t\t\t\tprevX = 0;\r\n\t\t\t\t\t\tprevY = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tprevX = curves[i - 2];\r\n\t\t\t\t\t\tprevY = curves[i - 1];\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar y = curves[i - 1];\r\n\t\t\treturn y + (1 - y) * (percent - x) / (1 - x);\r\n\t\t};\r\n\t\tCurveTimeline.LINEAR = 0;\r\n\t\tCurveTimeline.STEPPED = 1;\r\n\t\tCurveTimeline.BEZIER = 2;\r\n\t\tCurveTimeline.BEZIER_SIZE = 10 * 2 - 1;\r\n\t\treturn CurveTimeline;\r\n\t}());\r\n\tspine.CurveTimeline = CurveTimeline;\r\n\tvar RotateTimeline = (function (_super) {\r\n\t\t__extends(RotateTimeline, _super);\r\n\t\tfunction RotateTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount << 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tRotateTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.rotate << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tRotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) {\r\n\t\t\tframeIndex <<= 1;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\r\n\t\t};\r\n\t\tRotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.rotation = bone.data.rotation;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tvar r_1 = bone.data.rotation - bone.rotation;\r\n\t\t\t\t\t\tbone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (time >= frames[frames.length - RotateTimeline.ENTRIES]) {\r\n\t\t\t\tvar r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.rotation = bone.data.rotation + r_2 * alpha;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\tr_2 += bone.data.rotation - bone.rotation;\r\n\t\t\t\t\t\tr_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360;\r\n\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\tbone.rotation += r_2 * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n\t\t\tvar prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n\t\t\tvar frameTime = frames[frame];\r\n\t\t\tvar percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n\t\t\tvar r = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n\t\t\tr = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent;\r\n\t\t\tswitch (blend) {\r\n\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\tbone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.first:\r\n\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\tr += bone.data.rotation - bone.rotation;\r\n\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\tbone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tRotateTimeline.ENTRIES = 2;\r\n\t\tRotateTimeline.PREV_TIME = -2;\r\n\t\tRotateTimeline.PREV_ROTATION = -1;\r\n\t\tRotateTimeline.ROTATION = 1;\r\n\t\treturn RotateTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.RotateTimeline = RotateTimeline;\r\n\tvar TranslateTimeline = (function (_super) {\r\n\t\t__extends(TranslateTimeline, _super);\r\n\t\tfunction TranslateTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tTranslateTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.translate << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tTranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) {\r\n\t\t\tframeIndex *= TranslateTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + TranslateTimeline.X] = x;\r\n\t\t\tthis.frames[frameIndex + TranslateTimeline.Y] = y;\r\n\t\t};\r\n\t\tTranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.x = bone.data.x;\r\n\t\t\t\t\t\tbone.y = bone.data.y;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tbone.x += (bone.data.x - bone.x) * alpha;\r\n\t\t\t\t\t\tbone.y += (bone.data.y - bone.y) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar x = 0, y = 0;\r\n\t\t\tif (time >= frames[frames.length - TranslateTimeline.ENTRIES]) {\r\n\t\t\t\tx = frames[frames.length + TranslateTimeline.PREV_X];\r\n\t\t\t\ty = frames[frames.length + TranslateTimeline.PREV_Y];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\r\n\t\t\t\tx = frames[frame + TranslateTimeline.PREV_X];\r\n\t\t\t\ty = frames[frame + TranslateTimeline.PREV_Y];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tx += (frames[frame + TranslateTimeline.X] - x) * percent;\r\n\t\t\t\ty += (frames[frame + TranslateTimeline.Y] - y) * percent;\r\n\t\t\t}\r\n\t\t\tswitch (blend) {\r\n\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\tbone.x = bone.data.x + x * alpha;\r\n\t\t\t\t\tbone.y = bone.data.y + y * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.first:\r\n\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\tbone.x += (bone.data.x + x - bone.x) * alpha;\r\n\t\t\t\t\tbone.y += (bone.data.y + y - bone.y) * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\tbone.x += x * alpha;\r\n\t\t\t\t\tbone.y += y * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTranslateTimeline.ENTRIES = 3;\r\n\t\tTranslateTimeline.PREV_TIME = -3;\r\n\t\tTranslateTimeline.PREV_X = -2;\r\n\t\tTranslateTimeline.PREV_Y = -1;\r\n\t\tTranslateTimeline.X = 1;\r\n\t\tTranslateTimeline.Y = 2;\r\n\t\treturn TranslateTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.TranslateTimeline = TranslateTimeline;\r\n\tvar ScaleTimeline = (function (_super) {\r\n\t\t__extends(ScaleTimeline, _super);\r\n\t\tfunction ScaleTimeline(frameCount) {\r\n\t\t\treturn _super.call(this, frameCount) || this;\r\n\t\t}\r\n\t\tScaleTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.scale << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.scaleX = bone.data.scaleX;\r\n\t\t\t\t\t\tbone.scaleY = bone.data.scaleY;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tbone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n\t\t\t\t\t\tbone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar x = 0, y = 0;\r\n\t\t\tif (time >= frames[frames.length - ScaleTimeline.ENTRIES]) {\r\n\t\t\t\tx = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX;\r\n\t\t\t\ty = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\r\n\t\t\t\tx = frames[frame + ScaleTimeline.PREV_X];\r\n\t\t\t\ty = frames[frame + ScaleTimeline.PREV_Y];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tx = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX;\r\n\t\t\t\ty = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY;\r\n\t\t\t}\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\tif (blend == MixBlend.add) {\r\n\t\t\t\t\tbone.scaleX += x - bone.data.scaleX;\r\n\t\t\t\t\tbone.scaleY += y - bone.data.scaleY;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tbone.scaleX = x;\r\n\t\t\t\t\tbone.scaleY = y;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar bx = 0, by = 0;\r\n\t\t\t\tif (direction == MixDirection.out) {\r\n\t\t\t\t\tswitch (blend) {\r\n\t\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\t\tbx = bone.data.scaleX;\r\n\t\t\t\t\t\t\tby = bone.data.scaleY;\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\t\tbx = bone.scaleX;\r\n\t\t\t\t\t\t\tby = bone.scaleY;\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\t\tbx = bone.scaleX;\r\n\t\t\t\t\t\t\tby = bone.scaleY;\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tswitch (blend) {\r\n\t\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\t\tbx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x);\r\n\t\t\t\t\t\t\tby = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y);\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\t\tbx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x);\r\n\t\t\t\t\t\t\tby = Math.abs(bone.scaleY) * spine.MathUtils.signum(y);\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\t\tbx = spine.MathUtils.signum(x);\r\n\t\t\t\t\t\t\tby = spine.MathUtils.signum(y);\r\n\t\t\t\t\t\t\tbone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn ScaleTimeline;\r\n\t}(TranslateTimeline));\r\n\tspine.ScaleTimeline = ScaleTimeline;\r\n\tvar ShearTimeline = (function (_super) {\r\n\t\t__extends(ShearTimeline, _super);\r\n\t\tfunction ShearTimeline(frameCount) {\r\n\t\t\treturn _super.call(this, frameCount) || this;\r\n\t\t}\r\n\t\tShearTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.shear << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.shearX = bone.data.shearX;\r\n\t\t\t\t\t\tbone.shearY = bone.data.shearY;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tbone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n\t\t\t\t\t\tbone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar x = 0, y = 0;\r\n\t\t\tif (time >= frames[frames.length - ShearTimeline.ENTRIES]) {\r\n\t\t\t\tx = frames[frames.length + ShearTimeline.PREV_X];\r\n\t\t\t\ty = frames[frames.length + ShearTimeline.PREV_Y];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\r\n\t\t\t\tx = frames[frame + ShearTimeline.PREV_X];\r\n\t\t\t\ty = frames[frame + ShearTimeline.PREV_Y];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tx = x + (frames[frame + ShearTimeline.X] - x) * percent;\r\n\t\t\t\ty = y + (frames[frame + ShearTimeline.Y] - y) * percent;\r\n\t\t\t}\r\n\t\t\tswitch (blend) {\r\n\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\tbone.shearX = bone.data.shearX + x * alpha;\r\n\t\t\t\t\tbone.shearY = bone.data.shearY + y * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.first:\r\n\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\tbone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n\t\t\t\t\tbone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\tbone.shearX += x * alpha;\r\n\t\t\t\t\tbone.shearY += y * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn ShearTimeline;\r\n\t}(TranslateTimeline));\r\n\tspine.ShearTimeline = ShearTimeline;\r\n\tvar ColorTimeline = (function (_super) {\r\n\t\t__extends(ColorTimeline, _super);\r\n\t\tfunction ColorTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tColorTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.color << 24) + this.slotIndex;\r\n\t\t};\r\n\t\tColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) {\r\n\t\t\tframeIndex *= ColorTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.R] = r;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.G] = g;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.B] = b;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.A] = a;\r\n\t\t};\r\n\t\tColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tslot.color.setFromColor(slot.data.color);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tvar color = slot.color, setup = slot.data.color;\r\n\t\t\t\t\t\tcolor.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar r = 0, g = 0, b = 0, a = 0;\r\n\t\t\tif (time >= frames[frames.length - ColorTimeline.ENTRIES]) {\r\n\t\t\t\tvar i = frames.length;\r\n\t\t\t\tr = frames[i + ColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[i + ColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[i + ColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[i + ColorTimeline.PREV_A];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\r\n\t\t\t\tr = frames[frame + ColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[frame + ColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[frame + ColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[frame + ColorTimeline.PREV_A];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tr += (frames[frame + ColorTimeline.R] - r) * percent;\r\n\t\t\t\tg += (frames[frame + ColorTimeline.G] - g) * percent;\r\n\t\t\t\tb += (frames[frame + ColorTimeline.B] - b) * percent;\r\n\t\t\t\ta += (frames[frame + ColorTimeline.A] - a) * percent;\r\n\t\t\t}\r\n\t\t\tif (alpha == 1)\r\n\t\t\t\tslot.color.set(r, g, b, a);\r\n\t\t\telse {\r\n\t\t\t\tvar color = slot.color;\r\n\t\t\t\tif (blend == MixBlend.setup)\r\n\t\t\t\t\tcolor.setFromColor(slot.data.color);\r\n\t\t\t\tcolor.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n\t\t\t}\r\n\t\t};\r\n\t\tColorTimeline.ENTRIES = 5;\r\n\t\tColorTimeline.PREV_TIME = -5;\r\n\t\tColorTimeline.PREV_R = -4;\r\n\t\tColorTimeline.PREV_G = -3;\r\n\t\tColorTimeline.PREV_B = -2;\r\n\t\tColorTimeline.PREV_A = -1;\r\n\t\tColorTimeline.R = 1;\r\n\t\tColorTimeline.G = 2;\r\n\t\tColorTimeline.B = 3;\r\n\t\tColorTimeline.A = 4;\r\n\t\treturn ColorTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.ColorTimeline = ColorTimeline;\r\n\tvar TwoColorTimeline = (function (_super) {\r\n\t\t__extends(TwoColorTimeline, _super);\r\n\t\tfunction TwoColorTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tTwoColorTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.twoColor << 24) + this.slotIndex;\r\n\t\t};\r\n\t\tTwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) {\r\n\t\t\tframeIndex *= TwoColorTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.R] = r;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.G] = g;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.B] = b;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.A] = a;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.R2] = r2;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.G2] = g2;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.B2] = b2;\r\n\t\t};\r\n\t\tTwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tslot.color.setFromColor(slot.data.color);\r\n\t\t\t\t\t\tslot.darkColor.setFromColor(slot.data.darkColor);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tvar light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n\t\t\t\t\t\tlight.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\r\n\t\t\t\t\t\tdark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\r\n\t\t\tif (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) {\r\n\t\t\t\tvar i = frames.length;\r\n\t\t\t\tr = frames[i + TwoColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[i + TwoColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[i + TwoColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[i + TwoColorTimeline.PREV_A];\r\n\t\t\t\tr2 = frames[i + TwoColorTimeline.PREV_R2];\r\n\t\t\t\tg2 = frames[i + TwoColorTimeline.PREV_G2];\r\n\t\t\t\tb2 = frames[i + TwoColorTimeline.PREV_B2];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES);\r\n\t\t\t\tr = frames[frame + TwoColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[frame + TwoColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[frame + TwoColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[frame + TwoColorTimeline.PREV_A];\r\n\t\t\t\tr2 = frames[frame + TwoColorTimeline.PREV_R2];\r\n\t\t\t\tg2 = frames[frame + TwoColorTimeline.PREV_G2];\r\n\t\t\t\tb2 = frames[frame + TwoColorTimeline.PREV_B2];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tr += (frames[frame + TwoColorTimeline.R] - r) * percent;\r\n\t\t\t\tg += (frames[frame + TwoColorTimeline.G] - g) * percent;\r\n\t\t\t\tb += (frames[frame + TwoColorTimeline.B] - b) * percent;\r\n\t\t\t\ta += (frames[frame + TwoColorTimeline.A] - a) * percent;\r\n\t\t\t\tr2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent;\r\n\t\t\t\tg2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent;\r\n\t\t\t\tb2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent;\r\n\t\t\t}\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\tslot.color.set(r, g, b, a);\r\n\t\t\t\tslot.darkColor.set(r2, g2, b2, 1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar light = slot.color, dark = slot.darkColor;\r\n\t\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\t\tlight.setFromColor(slot.data.color);\r\n\t\t\t\t\tdark.setFromColor(slot.data.darkColor);\r\n\t\t\t\t}\r\n\t\t\t\tlight.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\r\n\t\t\t\tdark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTwoColorTimeline.ENTRIES = 8;\r\n\t\tTwoColorTimeline.PREV_TIME = -8;\r\n\t\tTwoColorTimeline.PREV_R = -7;\r\n\t\tTwoColorTimeline.PREV_G = -6;\r\n\t\tTwoColorTimeline.PREV_B = -5;\r\n\t\tTwoColorTimeline.PREV_A = -4;\r\n\t\tTwoColorTimeline.PREV_R2 = -3;\r\n\t\tTwoColorTimeline.PREV_G2 = -2;\r\n\t\tTwoColorTimeline.PREV_B2 = -1;\r\n\t\tTwoColorTimeline.R = 1;\r\n\t\tTwoColorTimeline.G = 2;\r\n\t\tTwoColorTimeline.B = 3;\r\n\t\tTwoColorTimeline.A = 4;\r\n\t\tTwoColorTimeline.R2 = 5;\r\n\t\tTwoColorTimeline.G2 = 6;\r\n\t\tTwoColorTimeline.B2 = 7;\r\n\t\treturn TwoColorTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.TwoColorTimeline = TwoColorTimeline;\r\n\tvar AttachmentTimeline = (function () {\r\n\t\tfunction AttachmentTimeline(frameCount) {\r\n\t\t\tthis.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\tthis.attachmentNames = new Array(frameCount);\r\n\t\t}\r\n\t\tAttachmentTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.attachment << 24) + this.slotIndex;\r\n\t\t};\r\n\t\tAttachmentTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.frames.length;\r\n\t\t};\r\n\t\tAttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) {\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.attachmentNames[frameIndex] = attachmentName;\r\n\t\t};\r\n\t\tAttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tif (direction == MixDirection.out && blend == MixBlend.setup) {\r\n\t\t\t\tvar attachmentName_1 = slot.data.attachmentName;\r\n\t\t\t\tslot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) {\r\n\t\t\t\t\tvar attachmentName_2 = slot.data.attachmentName;\r\n\t\t\t\t\tslot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2));\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frameIndex = 0;\r\n\t\t\tif (time >= frames[frames.length - 1])\r\n\t\t\t\tframeIndex = frames.length - 1;\r\n\t\t\telse\r\n\t\t\t\tframeIndex = Animation.binarySearch(frames, time, 1) - 1;\r\n\t\t\tvar attachmentName = this.attachmentNames[frameIndex];\r\n\t\t\tskeleton.slots[this.slotIndex]\r\n\t\t\t\t.setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n\t\t};\r\n\t\treturn AttachmentTimeline;\r\n\t}());\r\n\tspine.AttachmentTimeline = AttachmentTimeline;\r\n\tvar zeros = null;\r\n\tvar DeformTimeline = (function (_super) {\r\n\t\t__extends(DeformTimeline, _super);\r\n\t\tfunction DeformTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\t_this.frameVertices = new Array(frameCount);\r\n\t\t\tif (zeros == null)\r\n\t\t\t\tzeros = spine.Utils.newFloatArray(64);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tDeformTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex;\r\n\t\t};\r\n\t\tDeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) {\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frameVertices[frameIndex] = vertices;\r\n\t\t};\r\n\t\tDeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tvar slotAttachment = slot.getAttachment();\r\n\t\t\tif (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment))\r\n\t\t\t\treturn;\r\n\t\t\tvar verticesArray = slot.attachmentVertices;\r\n\t\t\tif (verticesArray.length == 0)\r\n\t\t\t\tblend = MixBlend.setup;\r\n\t\t\tvar frameVertices = this.frameVertices;\r\n\t\t\tvar vertexCount = frameVertices[0].length;\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tverticesArray.length = 0;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tif (alpha == 1) {\r\n\t\t\t\t\t\t\tverticesArray.length = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount);\r\n\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\r\n\t\t\t\t\t\t\t\tvertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\talpha = 1 - alpha;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\r\n\t\t\t\t\t\t\t\tvertices_1[i] *= alpha;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar vertices = spine.Utils.setArraySize(verticesArray, vertexCount);\r\n\t\t\tif (time >= frames[frames.length - 1]) {\r\n\t\t\t\tvar lastVertices = frameVertices[frames.length - 1];\r\n\t\t\t\tif (alpha == 1) {\r\n\t\t\t\t\tif (blend == MixBlend.add) {\r\n\t\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\tfor (var i_1 = 0; i_1 < vertexCount; i_1++) {\r\n\t\t\t\t\t\t\t\tvertices[i_1] += lastVertices[i_1] - setupVertices[i_1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i_2 = 0; i_2 < vertexCount; i_2++)\r\n\t\t\t\t\t\t\t\tvertices[i_2] += lastVertices[i_2];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tspine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tswitch (blend) {\r\n\t\t\t\t\t\tcase MixBlend.setup: {\r\n\t\t\t\t\t\t\tvar vertexAttachment_1 = slotAttachment;\r\n\t\t\t\t\t\t\tif (vertexAttachment_1.bones == null) {\r\n\t\t\t\t\t\t\t\tvar setupVertices = vertexAttachment_1.vertices;\r\n\t\t\t\t\t\t\t\tfor (var i_3 = 0; i_3 < vertexCount; i_3++) {\r\n\t\t\t\t\t\t\t\t\tvar setup = setupVertices[i_3];\r\n\t\t\t\t\t\t\t\t\tvertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tfor (var i_4 = 0; i_4 < vertexCount; i_4++)\r\n\t\t\t\t\t\t\t\t\tvertices[i_4] = lastVertices[i_4] * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\t\tfor (var i_5 = 0; i_5 < vertexCount; i_5++)\r\n\t\t\t\t\t\t\t\tvertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha;\r\n\t\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\t\tfor (var i_6 = 0; i_6 < vertexCount; i_6++) {\r\n\t\t\t\t\t\t\t\t\tvertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tfor (var i_7 = 0; i_7 < vertexCount; i_7++)\r\n\t\t\t\t\t\t\t\t\tvertices[i_7] += lastVertices[i_7] * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = Animation.binarySearch(frames, time);\r\n\t\t\tvar prevVertices = frameVertices[frame - 1];\r\n\t\t\tvar nextVertices = frameVertices[frame];\r\n\t\t\tvar frameTime = frames[frame];\r\n\t\t\tvar percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\tif (blend == MixBlend.add) {\r\n\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\tfor (var i_8 = 0; i_8 < vertexCount; i_8++) {\r\n\t\t\t\t\t\t\tvar prev = prevVertices[i_8];\r\n\t\t\t\t\t\t\tvertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tfor (var i_9 = 0; i_9 < vertexCount; i_9++) {\r\n\t\t\t\t\t\t\tvar prev = prevVertices[i_9];\r\n\t\t\t\t\t\t\tvertices[i_9] += prev + (nextVertices[i_9] - prev) * percent;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tfor (var i_10 = 0; i_10 < vertexCount; i_10++) {\r\n\t\t\t\t\t\tvar prev = prevVertices[i_10];\r\n\t\t\t\t\t\tvertices[i_10] = prev + (nextVertices[i_10] - prev) * percent;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup: {\r\n\t\t\t\t\t\tvar vertexAttachment_2 = slotAttachment;\r\n\t\t\t\t\t\tif (vertexAttachment_2.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment_2.vertices;\r\n\t\t\t\t\t\t\tfor (var i_11 = 0; i_11 < vertexCount; i_11++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_11], setup = setupVertices[i_11];\r\n\t\t\t\t\t\t\t\tvertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i_12 = 0; i_12 < vertexCount; i_12++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_12];\r\n\t\t\t\t\t\t\t\tvertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\tfor (var i_13 = 0; i_13 < vertexCount; i_13++) {\r\n\t\t\t\t\t\t\tvar prev = prevVertices[i_13];\r\n\t\t\t\t\t\t\tvertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\tfor (var i_14 = 0; i_14 < vertexCount; i_14++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_14];\r\n\t\t\t\t\t\t\t\tvertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i_15 = 0; i_15 < vertexCount; i_15++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_15];\r\n\t\t\t\t\t\t\t\tvertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn DeformTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.DeformTimeline = DeformTimeline;\r\n\tvar EventTimeline = (function () {\r\n\t\tfunction EventTimeline(frameCount) {\r\n\t\t\tthis.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\tthis.events = new Array(frameCount);\r\n\t\t}\r\n\t\tEventTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn TimelineType.event << 24;\r\n\t\t};\r\n\t\tEventTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.frames.length;\r\n\t\t};\r\n\t\tEventTimeline.prototype.setFrame = function (frameIndex, event) {\r\n\t\t\tthis.frames[frameIndex] = event.time;\r\n\t\t\tthis.events[frameIndex] = event;\r\n\t\t};\r\n\t\tEventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tif (firedEvents == null)\r\n\t\t\t\treturn;\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar frameCount = this.frames.length;\r\n\t\t\tif (lastTime > time) {\r\n\t\t\t\tthis.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\r\n\t\t\t\tlastTime = -1;\r\n\t\t\t}\r\n\t\t\telse if (lastTime >= frames[frameCount - 1])\r\n\t\t\t\treturn;\r\n\t\t\tif (time < frames[0])\r\n\t\t\t\treturn;\r\n\t\t\tvar frame = 0;\r\n\t\t\tif (lastTime < frames[0])\r\n\t\t\t\tframe = 0;\r\n\t\t\telse {\r\n\t\t\t\tframe = Animation.binarySearch(frames, lastTime);\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\twhile (frame > 0) {\r\n\t\t\t\t\tif (frames[frame - 1] != frameTime)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tframe--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (; frame < frameCount && time >= frames[frame]; frame++)\r\n\t\t\t\tfiredEvents.push(this.events[frame]);\r\n\t\t};\r\n\t\treturn EventTimeline;\r\n\t}());\r\n\tspine.EventTimeline = EventTimeline;\r\n\tvar DrawOrderTimeline = (function () {\r\n\t\tfunction DrawOrderTimeline(frameCount) {\r\n\t\t\tthis.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\tthis.drawOrders = new Array(frameCount);\r\n\t\t}\r\n\t\tDrawOrderTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn TimelineType.drawOrder << 24;\r\n\t\t};\r\n\t\tDrawOrderTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.frames.length;\r\n\t\t};\r\n\t\tDrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) {\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.drawOrders[frameIndex] = drawOrder;\r\n\t\t};\r\n\t\tDrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar drawOrder = skeleton.drawOrder;\r\n\t\t\tvar slots = skeleton.slots;\r\n\t\t\tif (direction == MixDirection.out && blend == MixBlend.setup) {\r\n\t\t\t\tspine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first)\r\n\t\t\t\t\tspine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = 0;\r\n\t\t\tif (time >= frames[frames.length - 1])\r\n\t\t\t\tframe = frames.length - 1;\r\n\t\t\telse\r\n\t\t\t\tframe = Animation.binarySearch(frames, time) - 1;\r\n\t\t\tvar drawOrderToSetupIndex = this.drawOrders[frame];\r\n\t\t\tif (drawOrderToSetupIndex == null)\r\n\t\t\t\tspine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\r\n\t\t\telse {\r\n\t\t\t\tfor (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n\t\t\t\t\tdrawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn DrawOrderTimeline;\r\n\t}());\r\n\tspine.DrawOrderTimeline = DrawOrderTimeline;\r\n\tvar IkConstraintTimeline = (function (_super) {\r\n\t\t__extends(IkConstraintTimeline, _super);\r\n\t\tfunction IkConstraintTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tIkConstraintTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;\r\n\t\t};\r\n\t\tIkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) {\r\n\t\t\tframeIndex *= IkConstraintTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0;\r\n\t\t};\r\n\t\tIkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.mix = constraint.data.mix;\r\n\t\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.mix += (constraint.data.mix - constraint.mix) * alpha;\r\n\t\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {\r\n\t\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\t\tconstraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;\r\n\t\t\t\t\tif (direction == MixDirection.out) {\r\n\t\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tconstraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\t\tconstraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\t\tconstraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconstraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\r\n\t\t\t\t\tif (direction == MixDirection[\"in\"]) {\r\n\t\t\t\t\t\tconstraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\t\tconstraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\t\tconstraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\r\n\t\t\tvar mix = frames[frame + IkConstraintTimeline.PREV_MIX];\r\n\t\t\tvar frameTime = frames[frame];\r\n\t\t\tvar percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\r\n\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\tconstraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;\r\n\t\t\t\tif (direction == MixDirection.out) {\r\n\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconstraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\tconstraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\tconstraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconstraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\r\n\t\t\t\tif (direction == MixDirection[\"in\"]) {\r\n\t\t\t\t\tconstraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\tconstraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\tconstraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tIkConstraintTimeline.ENTRIES = 5;\r\n\t\tIkConstraintTimeline.PREV_TIME = -5;\r\n\t\tIkConstraintTimeline.PREV_MIX = -4;\r\n\t\tIkConstraintTimeline.PREV_BEND_DIRECTION = -3;\r\n\t\tIkConstraintTimeline.PREV_COMPRESS = -2;\r\n\t\tIkConstraintTimeline.PREV_STRETCH = -1;\r\n\t\tIkConstraintTimeline.MIX = 1;\r\n\t\tIkConstraintTimeline.BEND_DIRECTION = 2;\r\n\t\tIkConstraintTimeline.COMPRESS = 3;\r\n\t\tIkConstraintTimeline.STRETCH = 4;\r\n\t\treturn IkConstraintTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.IkConstraintTimeline = IkConstraintTimeline;\r\n\tvar TransformConstraintTimeline = (function (_super) {\r\n\t\t__extends(TransformConstraintTimeline, _super);\r\n\t\tfunction TransformConstraintTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tTransformConstraintTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;\r\n\t\t};\r\n\t\tTransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) {\r\n\t\t\tframeIndex *= TransformConstraintTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\r\n\t\t};\r\n\t\tTransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.rotateMix = data.rotateMix;\r\n\t\t\t\t\t\tconstraint.translateMix = data.translateMix;\r\n\t\t\t\t\t\tconstraint.scaleMix = data.scaleMix;\r\n\t\t\t\t\t\tconstraint.shearMix = data.shearMix;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha;\r\n\t\t\t\t\t\tconstraint.translateMix += (data.translateMix - constraint.translateMix) * alpha;\r\n\t\t\t\t\t\tconstraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha;\r\n\t\t\t\t\t\tconstraint.shearMix += (data.shearMix - constraint.shearMix) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar rotate = 0, translate = 0, scale = 0, shear = 0;\r\n\t\t\tif (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) {\r\n\t\t\t\tvar i = frames.length;\r\n\t\t\t\trotate = frames[i + TransformConstraintTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE];\r\n\t\t\t\tscale = frames[i + TransformConstraintTimeline.PREV_SCALE];\r\n\t\t\t\tshear = frames[i + TransformConstraintTimeline.PREV_SHEAR];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\r\n\t\t\t\trotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\r\n\t\t\t\tscale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\r\n\t\t\t\tshear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\trotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent;\r\n\t\t\t\ttranslate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent;\r\n\t\t\t\tscale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent;\r\n\t\t\t\tshear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tconstraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha;\r\n\t\t\t\tconstraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha;\r\n\t\t\t\tconstraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconstraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n\t\t\t\tconstraint.scaleMix += (scale - constraint.scaleMix) * alpha;\r\n\t\t\t\tconstraint.shearMix += (shear - constraint.shearMix) * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraintTimeline.ENTRIES = 5;\r\n\t\tTransformConstraintTimeline.PREV_TIME = -5;\r\n\t\tTransformConstraintTimeline.PREV_ROTATE = -4;\r\n\t\tTransformConstraintTimeline.PREV_TRANSLATE = -3;\r\n\t\tTransformConstraintTimeline.PREV_SCALE = -2;\r\n\t\tTransformConstraintTimeline.PREV_SHEAR = -1;\r\n\t\tTransformConstraintTimeline.ROTATE = 1;\r\n\t\tTransformConstraintTimeline.TRANSLATE = 2;\r\n\t\tTransformConstraintTimeline.SCALE = 3;\r\n\t\tTransformConstraintTimeline.SHEAR = 4;\r\n\t\treturn TransformConstraintTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.TransformConstraintTimeline = TransformConstraintTimeline;\r\n\tvar PathConstraintPositionTimeline = (function (_super) {\r\n\t\t__extends(PathConstraintPositionTimeline, _super);\r\n\t\tfunction PathConstraintPositionTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPathConstraintPositionTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;\r\n\t\t};\r\n\t\tPathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) {\r\n\t\t\tframeIndex *= PathConstraintPositionTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\r\n\t\t};\r\n\t\tPathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.position = constraint.data.position;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.position += (constraint.data.position - constraint.position) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar position = 0;\r\n\t\t\tif (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES])\r\n\t\t\t\tposition = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE];\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\r\n\t\t\t\tposition = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tposition += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup)\r\n\t\t\t\tconstraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\r\n\t\t\telse\r\n\t\t\t\tconstraint.position += (position - constraint.position) * alpha;\r\n\t\t};\r\n\t\tPathConstraintPositionTimeline.ENTRIES = 2;\r\n\t\tPathConstraintPositionTimeline.PREV_TIME = -2;\r\n\t\tPathConstraintPositionTimeline.PREV_VALUE = -1;\r\n\t\tPathConstraintPositionTimeline.VALUE = 1;\r\n\t\treturn PathConstraintPositionTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.PathConstraintPositionTimeline = PathConstraintPositionTimeline;\r\n\tvar PathConstraintSpacingTimeline = (function (_super) {\r\n\t\t__extends(PathConstraintSpacingTimeline, _super);\r\n\t\tfunction PathConstraintSpacingTimeline(frameCount) {\r\n\t\t\treturn _super.call(this, frameCount) || this;\r\n\t\t}\r\n\t\tPathConstraintSpacingTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;\r\n\t\t};\r\n\t\tPathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.spacing = constraint.data.spacing;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar spacing = 0;\r\n\t\t\tif (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES])\r\n\t\t\t\tspacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE];\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\r\n\t\t\t\tspacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tspacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup)\r\n\t\t\t\tconstraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\r\n\t\t\telse\r\n\t\t\t\tconstraint.spacing += (spacing - constraint.spacing) * alpha;\r\n\t\t};\r\n\t\treturn PathConstraintSpacingTimeline;\r\n\t}(PathConstraintPositionTimeline));\r\n\tspine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline;\r\n\tvar PathConstraintMixTimeline = (function (_super) {\r\n\t\t__extends(PathConstraintMixTimeline, _super);\r\n\t\tfunction PathConstraintMixTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPathConstraintMixTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;\r\n\t\t};\r\n\t\tPathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) {\r\n\t\t\tframeIndex *= PathConstraintMixTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\r\n\t\t\tthis.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\r\n\t\t};\r\n\t\tPathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.rotateMix = constraint.data.rotateMix;\r\n\t\t\t\t\t\tconstraint.translateMix = constraint.data.translateMix;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha;\r\n\t\t\t\t\t\tconstraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar rotate = 0, translate = 0;\r\n\t\t\tif (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) {\r\n\t\t\t\trotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\r\n\t\t\t\trotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\trotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent;\r\n\t\t\t\ttranslate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\tconstraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconstraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tPathConstraintMixTimeline.ENTRIES = 3;\r\n\t\tPathConstraintMixTimeline.PREV_TIME = -3;\r\n\t\tPathConstraintMixTimeline.PREV_ROTATE = -2;\r\n\t\tPathConstraintMixTimeline.PREV_TRANSLATE = -1;\r\n\t\tPathConstraintMixTimeline.ROTATE = 1;\r\n\t\tPathConstraintMixTimeline.TRANSLATE = 2;\r\n\t\treturn PathConstraintMixTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.PathConstraintMixTimeline = PathConstraintMixTimeline;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AnimationState = (function () {\r\n\t\tfunction AnimationState(data) {\r\n\t\t\tthis.tracks = new Array();\r\n\t\t\tthis.events = new Array();\r\n\t\t\tthis.listeners = new Array();\r\n\t\t\tthis.queue = new EventQueue(this);\r\n\t\t\tthis.propertyIDs = new spine.IntSet();\r\n\t\t\tthis.animationsChanged = false;\r\n\t\t\tthis.timeScale = 1;\r\n\t\t\tthis.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); });\r\n\t\t\tthis.data = data;\r\n\t\t}\r\n\t\tAnimationState.prototype.update = function (delta) {\r\n\t\t\tdelta *= this.timeScale;\r\n\t\t\tvar tracks = this.tracks;\r\n\t\t\tfor (var i = 0, n = tracks.length; i < n; i++) {\r\n\t\t\t\tvar current = tracks[i];\r\n\t\t\t\tif (current == null)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tcurrent.animationLast = current.nextAnimationLast;\r\n\t\t\t\tcurrent.trackLast = current.nextTrackLast;\r\n\t\t\t\tvar currentDelta = delta * current.timeScale;\r\n\t\t\t\tif (current.delay > 0) {\r\n\t\t\t\t\tcurrent.delay -= currentDelta;\r\n\t\t\t\t\tif (current.delay > 0)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tcurrentDelta = -current.delay;\r\n\t\t\t\t\tcurrent.delay = 0;\r\n\t\t\t\t}\r\n\t\t\t\tvar next = current.next;\r\n\t\t\t\tif (next != null) {\r\n\t\t\t\t\tvar nextTime = current.trackLast - next.delay;\r\n\t\t\t\t\tif (nextTime >= 0) {\r\n\t\t\t\t\t\tnext.delay = 0;\r\n\t\t\t\t\t\tnext.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\r\n\t\t\t\t\t\tcurrent.trackTime += currentDelta;\r\n\t\t\t\t\t\tthis.setCurrent(i, next, true);\r\n\t\t\t\t\t\twhile (next.mixingFrom != null) {\r\n\t\t\t\t\t\t\tnext.mixTime += delta;\r\n\t\t\t\t\t\t\tnext = next.mixingFrom;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {\r\n\t\t\t\t\ttracks[i] = null;\r\n\t\t\t\t\tthis.queue.end(current);\r\n\t\t\t\t\tthis.disposeNext(current);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif (current.mixingFrom != null && this.updateMixingFrom(current, delta)) {\r\n\t\t\t\t\tvar from = current.mixingFrom;\r\n\t\t\t\t\tcurrent.mixingFrom = null;\r\n\t\t\t\t\tif (from != null)\r\n\t\t\t\t\t\tfrom.mixingTo = null;\r\n\t\t\t\t\twhile (from != null) {\r\n\t\t\t\t\t\tthis.queue.end(from);\r\n\t\t\t\t\t\tfrom = from.mixingFrom;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcurrent.trackTime += currentDelta;\r\n\t\t\t}\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.updateMixingFrom = function (to, delta) {\r\n\t\t\tvar from = to.mixingFrom;\r\n\t\t\tif (from == null)\r\n\t\t\t\treturn true;\r\n\t\t\tvar finished = this.updateMixingFrom(from, delta);\r\n\t\t\tfrom.animationLast = from.nextAnimationLast;\r\n\t\t\tfrom.trackLast = from.nextTrackLast;\r\n\t\t\tif (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\r\n\t\t\t\tif (from.totalAlpha == 0 || to.mixDuration == 0) {\r\n\t\t\t\t\tto.mixingFrom = from.mixingFrom;\r\n\t\t\t\t\tif (from.mixingFrom != null)\r\n\t\t\t\t\t\tfrom.mixingFrom.mixingTo = to;\r\n\t\t\t\t\tto.interruptAlpha = from.interruptAlpha;\r\n\t\t\t\t\tthis.queue.end(from);\r\n\t\t\t\t}\r\n\t\t\t\treturn finished;\r\n\t\t\t}\r\n\t\t\tfrom.trackTime += delta * from.timeScale;\r\n\t\t\tto.mixTime += delta;\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tAnimationState.prototype.apply = function (skeleton) {\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tif (this.animationsChanged)\r\n\t\t\t\tthis._animationsChanged();\r\n\t\t\tvar events = this.events;\r\n\t\t\tvar tracks = this.tracks;\r\n\t\t\tvar applied = false;\r\n\t\t\tfor (var i = 0, n = tracks.length; i < n; i++) {\r\n\t\t\t\tvar current = tracks[i];\r\n\t\t\t\tif (current == null || current.delay > 0)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tapplied = true;\r\n\t\t\t\tvar blend = i == 0 ? spine.MixBlend.first : current.mixBlend;\r\n\t\t\t\tvar mix = current.alpha;\r\n\t\t\t\tif (current.mixingFrom != null)\r\n\t\t\t\t\tmix *= this.applyMixingFrom(current, skeleton, blend);\r\n\t\t\t\telse if (current.trackTime >= current.trackEnd && current.next == null)\r\n\t\t\t\t\tmix = 0;\r\n\t\t\t\tvar animationLast = current.animationLast, animationTime = current.getAnimationTime();\r\n\t\t\t\tvar timelineCount = current.animation.timelines.length;\r\n\t\t\t\tvar timelines = current.animation.timelines;\r\n\t\t\t\tif ((i == 0 && mix == 1) || blend == spine.MixBlend.add) {\r\n\t\t\t\t\tfor (var ii = 0; ii < timelineCount; ii++)\r\n\t\t\t\t\t\ttimelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection[\"in\"]);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar timelineMode = current.timelineMode;\r\n\t\t\t\t\tvar firstFrame = current.timelinesRotation.length == 0;\r\n\t\t\t\t\tif (firstFrame)\r\n\t\t\t\t\t\tspine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null);\r\n\t\t\t\t\tvar timelinesRotation = current.timelinesRotation;\r\n\t\t\t\t\tfor (var ii = 0; ii < timelineCount; ii++) {\r\n\t\t\t\t\t\tvar timeline = timelines[ii];\r\n\t\t\t\t\t\tvar timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup;\r\n\t\t\t\t\t\tif (timeline instanceof spine.RotateTimeline) {\r\n\t\t\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tspine.Utils.webkit602BugfixHelper(mix, blend);\r\n\t\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection[\"in\"]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.queueEvents(current, animationTime);\r\n\t\t\t\tevents.length = 0;\r\n\t\t\t\tcurrent.nextAnimationLast = animationTime;\r\n\t\t\t\tcurrent.nextTrackLast = current.trackTime;\r\n\t\t\t}\r\n\t\t\tthis.queue.drain();\r\n\t\t\treturn applied;\r\n\t\t};\r\n\t\tAnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\r\n\t\t\tvar from = to.mixingFrom;\r\n\t\t\tif (from.mixingFrom != null)\r\n\t\t\t\tthis.applyMixingFrom(from, skeleton, blend);\r\n\t\t\tvar mix = 0;\r\n\t\t\tif (to.mixDuration == 0) {\r\n\t\t\t\tmix = 1;\r\n\t\t\t\tif (blend == spine.MixBlend.first)\r\n\t\t\t\t\tblend = spine.MixBlend.setup;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tmix = to.mixTime / to.mixDuration;\r\n\t\t\t\tif (mix > 1)\r\n\t\t\t\t\tmix = 1;\r\n\t\t\t\tif (blend != spine.MixBlend.first)\r\n\t\t\t\t\tblend = from.mixBlend;\r\n\t\t\t}\r\n\t\t\tvar events = mix < from.eventThreshold ? this.events : null;\r\n\t\t\tvar attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\r\n\t\t\tvar animationLast = from.animationLast, animationTime = from.getAnimationTime();\r\n\t\t\tvar timelineCount = from.animation.timelines.length;\r\n\t\t\tvar timelines = from.animation.timelines;\r\n\t\t\tvar alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\r\n\t\t\tif (blend == spine.MixBlend.add) {\r\n\t\t\t\tfor (var i = 0; i < timelineCount; i++)\r\n\t\t\t\t\ttimelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar timelineMode = from.timelineMode;\r\n\t\t\t\tvar timelineHoldMix = from.timelineHoldMix;\r\n\t\t\t\tvar firstFrame = from.timelinesRotation.length == 0;\r\n\t\t\t\tif (firstFrame)\r\n\t\t\t\t\tspine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);\r\n\t\t\t\tvar timelinesRotation = from.timelinesRotation;\r\n\t\t\t\tfrom.totalAlpha = 0;\r\n\t\t\t\tfor (var i = 0; i < timelineCount; i++) {\r\n\t\t\t\t\tvar timeline = timelines[i];\r\n\t\t\t\t\tvar direction = spine.MixDirection.out;\r\n\t\t\t\t\tvar timelineBlend = void 0;\r\n\t\t\t\t\tvar alpha = 0;\r\n\t\t\t\t\tswitch (timelineMode[i]) {\r\n\t\t\t\t\t\tcase AnimationState.SUBSEQUENT:\r\n\t\t\t\t\t\t\tif (!attachments && timeline instanceof spine.AttachmentTimeline)\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tif (!drawOrder && timeline instanceof spine.DrawOrderTimeline)\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\ttimelineBlend = blend;\r\n\t\t\t\t\t\t\talpha = alphaMix;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase AnimationState.FIRST:\r\n\t\t\t\t\t\t\ttimelineBlend = spine.MixBlend.setup;\r\n\t\t\t\t\t\t\talpha = alphaMix;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase AnimationState.HOLD:\r\n\t\t\t\t\t\t\ttimelineBlend = spine.MixBlend.setup;\r\n\t\t\t\t\t\t\talpha = alphaHold;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\ttimelineBlend = spine.MixBlend.setup;\r\n\t\t\t\t\t\t\tvar holdMix = timelineHoldMix[i];\r\n\t\t\t\t\t\t\talpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom.totalAlpha += alpha;\r\n\t\t\t\t\tif (timeline instanceof spine.RotateTimeline)\r\n\t\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tspine.Utils.webkit602BugfixHelper(alpha, blend);\r\n\t\t\t\t\t\tif (timelineBlend == spine.MixBlend.setup) {\r\n\t\t\t\t\t\t\tif (timeline instanceof spine.AttachmentTimeline) {\r\n\t\t\t\t\t\t\t\tif (attachments)\r\n\t\t\t\t\t\t\t\t\tdirection = spine.MixDirection.out;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if (timeline instanceof spine.DrawOrderTimeline) {\r\n\t\t\t\t\t\t\t\tif (drawOrder)\r\n\t\t\t\t\t\t\t\t\tdirection = spine.MixDirection.out;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (to.mixDuration > 0)\r\n\t\t\t\tthis.queueEvents(from, animationTime);\r\n\t\t\tthis.events.length = 0;\r\n\t\t\tfrom.nextAnimationLast = animationTime;\r\n\t\t\tfrom.nextTrackLast = from.trackTime;\r\n\t\t\treturn mix;\r\n\t\t};\r\n\t\tAnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\r\n\t\t\tif (firstFrame)\r\n\t\t\t\ttimelinesRotation[i] = 0;\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\ttimeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection[\"in\"]);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar rotateTimeline = timeline;\r\n\t\t\tvar frames = rotateTimeline.frames;\r\n\t\t\tvar bone = skeleton.bones[rotateTimeline.boneIndex];\r\n\t\t\tvar r1 = 0, r2 = 0;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase spine.MixBlend.setup:\r\n\t\t\t\t\t\tbone.rotation = bone.data.rotation;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase spine.MixBlend.first:\r\n\t\t\t\t\t\tr1 = bone.rotation;\r\n\t\t\t\t\t\tr2 = bone.data.rotation;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tr1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation;\r\n\t\t\t\tif (time >= frames[frames.length - spine.RotateTimeline.ENTRIES])\r\n\t\t\t\t\tr2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION];\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES);\r\n\t\t\t\t\tvar prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION];\r\n\t\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\t\tvar percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\t\tr2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation;\r\n\t\t\t\t\tr2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n\t\t\t\t\tr2 = prevRotation + r2 * percent + bone.data.rotation;\r\n\t\t\t\t\tr2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar total = 0, diff = r2 - r1;\r\n\t\t\tdiff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\r\n\t\t\tif (diff == 0) {\r\n\t\t\t\ttotal = timelinesRotation[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar lastTotal = 0, lastDiff = 0;\r\n\t\t\t\tif (firstFrame) {\r\n\t\t\t\t\tlastTotal = 0;\r\n\t\t\t\t\tlastDiff = diff;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlastTotal = timelinesRotation[i];\r\n\t\t\t\t\tlastDiff = timelinesRotation[i + 1];\r\n\t\t\t\t}\r\n\t\t\t\tvar current = diff > 0, dir = lastTotal >= 0;\r\n\t\t\t\tif (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\r\n\t\t\t\t\tif (Math.abs(lastTotal) > 180)\r\n\t\t\t\t\t\tlastTotal += 360 * spine.MathUtils.signum(lastTotal);\r\n\t\t\t\t\tdir = current;\r\n\t\t\t\t}\r\n\t\t\t\ttotal = diff + lastTotal - lastTotal % 360;\r\n\t\t\t\tif (dir != current)\r\n\t\t\t\t\ttotal += 360 * spine.MathUtils.signum(lastTotal);\r\n\t\t\t\ttimelinesRotation[i] = total;\r\n\t\t\t}\r\n\t\t\ttimelinesRotation[i + 1] = diff;\r\n\t\t\tr1 += total * alpha;\r\n\t\t\tbone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360;\r\n\t\t};\r\n\t\tAnimationState.prototype.queueEvents = function (entry, animationTime) {\r\n\t\t\tvar animationStart = entry.animationStart, animationEnd = entry.animationEnd;\r\n\t\t\tvar duration = animationEnd - animationStart;\r\n\t\t\tvar trackLastWrapped = entry.trackLast % duration;\r\n\t\t\tvar events = this.events;\r\n\t\t\tvar i = 0, n = events.length;\r\n\t\t\tfor (; i < n; i++) {\r\n\t\t\t\tvar event_1 = events[i];\r\n\t\t\t\tif (event_1.time < trackLastWrapped)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif (event_1.time > animationEnd)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tthis.queue.event(entry, event_1);\r\n\t\t\t}\r\n\t\t\tvar complete = false;\r\n\t\t\tif (entry.loop)\r\n\t\t\t\tcomplete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\r\n\t\t\telse\r\n\t\t\t\tcomplete = animationTime >= animationEnd && entry.animationLast < animationEnd;\r\n\t\t\tif (complete)\r\n\t\t\t\tthis.queue.complete(entry);\r\n\t\t\tfor (; i < n; i++) {\r\n\t\t\t\tvar event_2 = events[i];\r\n\t\t\t\tif (event_2.time < animationStart)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tthis.queue.event(entry, events[i]);\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimationState.prototype.clearTracks = function () {\r\n\t\t\tvar oldDrainDisabled = this.queue.drainDisabled;\r\n\t\t\tthis.queue.drainDisabled = true;\r\n\t\t\tfor (var i = 0, n = this.tracks.length; i < n; i++)\r\n\t\t\t\tthis.clearTrack(i);\r\n\t\t\tthis.tracks.length = 0;\r\n\t\t\tthis.queue.drainDisabled = oldDrainDisabled;\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.clearTrack = function (trackIndex) {\r\n\t\t\tif (trackIndex >= this.tracks.length)\r\n\t\t\t\treturn;\r\n\t\t\tvar current = this.tracks[trackIndex];\r\n\t\t\tif (current == null)\r\n\t\t\t\treturn;\r\n\t\t\tthis.queue.end(current);\r\n\t\t\tthis.disposeNext(current);\r\n\t\t\tvar entry = current;\r\n\t\t\twhile (true) {\r\n\t\t\t\tvar from = entry.mixingFrom;\r\n\t\t\t\tif (from == null)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tthis.queue.end(from);\r\n\t\t\t\tentry.mixingFrom = null;\r\n\t\t\t\tentry.mixingTo = null;\r\n\t\t\t\tentry = from;\r\n\t\t\t}\r\n\t\t\tthis.tracks[current.trackIndex] = null;\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.setCurrent = function (index, current, interrupt) {\r\n\t\t\tvar from = this.expandToIndex(index);\r\n\t\t\tthis.tracks[index] = current;\r\n\t\t\tif (from != null) {\r\n\t\t\t\tif (interrupt)\r\n\t\t\t\t\tthis.queue.interrupt(from);\r\n\t\t\t\tcurrent.mixingFrom = from;\r\n\t\t\t\tfrom.mixingTo = current;\r\n\t\t\t\tcurrent.mixTime = 0;\r\n\t\t\t\tif (from.mixingFrom != null && from.mixDuration > 0)\r\n\t\t\t\t\tcurrent.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\r\n\t\t\t\tfrom.timelinesRotation.length = 0;\r\n\t\t\t}\r\n\t\t\tthis.queue.start(current);\r\n\t\t};\r\n\t\tAnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\r\n\t\t\tvar animation = this.data.skeletonData.findAnimation(animationName);\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + animationName);\r\n\t\t\treturn this.setAnimationWith(trackIndex, animation, loop);\r\n\t\t};\r\n\t\tAnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"animation cannot be null.\");\r\n\t\t\tvar interrupt = true;\r\n\t\t\tvar current = this.expandToIndex(trackIndex);\r\n\t\t\tif (current != null) {\r\n\t\t\t\tif (current.nextTrackLast == -1) {\r\n\t\t\t\t\tthis.tracks[trackIndex] = current.mixingFrom;\r\n\t\t\t\t\tthis.queue.interrupt(current);\r\n\t\t\t\t\tthis.queue.end(current);\r\n\t\t\t\t\tthis.disposeNext(current);\r\n\t\t\t\t\tcurrent = current.mixingFrom;\r\n\t\t\t\t\tinterrupt = false;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.disposeNext(current);\r\n\t\t\t}\r\n\t\t\tvar entry = this.trackEntry(trackIndex, animation, loop, current);\r\n\t\t\tthis.setCurrent(trackIndex, entry, interrupt);\r\n\t\t\tthis.queue.drain();\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\r\n\t\t\tvar animation = this.data.skeletonData.findAnimation(animationName);\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + animationName);\r\n\t\t\treturn this.addAnimationWith(trackIndex, animation, loop, delay);\r\n\t\t};\r\n\t\tAnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"animation cannot be null.\");\r\n\t\t\tvar last = this.expandToIndex(trackIndex);\r\n\t\t\tif (last != null) {\r\n\t\t\t\twhile (last.next != null)\r\n\t\t\t\t\tlast = last.next;\r\n\t\t\t}\r\n\t\t\tvar entry = this.trackEntry(trackIndex, animation, loop, last);\r\n\t\t\tif (last == null) {\r\n\t\t\t\tthis.setCurrent(trackIndex, entry, true);\r\n\t\t\t\tthis.queue.drain();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlast.next = entry;\r\n\t\t\t\tif (delay <= 0) {\r\n\t\t\t\t\tvar duration = last.animationEnd - last.animationStart;\r\n\t\t\t\t\tif (duration != 0) {\r\n\t\t\t\t\t\tif (last.loop)\r\n\t\t\t\t\t\t\tdelay += duration * (1 + ((last.trackTime / duration) | 0));\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tdelay += Math.max(duration, last.trackTime);\r\n\t\t\t\t\t\tdelay -= this.data.getMix(last.animation, animation);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tdelay = last.trackTime;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tentry.delay = delay;\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\r\n\t\t\tvar entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false);\r\n\t\t\tentry.mixDuration = mixDuration;\r\n\t\t\tentry.trackEnd = mixDuration;\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\r\n\t\t\tif (delay <= 0)\r\n\t\t\t\tdelay -= mixDuration;\r\n\t\t\tvar entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay);\r\n\t\t\tentry.mixDuration = mixDuration;\r\n\t\t\tentry.trackEnd = mixDuration;\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.setEmptyAnimations = function (mixDuration) {\r\n\t\t\tvar oldDrainDisabled = this.queue.drainDisabled;\r\n\t\t\tthis.queue.drainDisabled = true;\r\n\t\t\tfor (var i = 0, n = this.tracks.length; i < n; i++) {\r\n\t\t\t\tvar current = this.tracks[i];\r\n\t\t\t\tif (current != null)\r\n\t\t\t\t\tthis.setEmptyAnimation(current.trackIndex, mixDuration);\r\n\t\t\t}\r\n\t\t\tthis.queue.drainDisabled = oldDrainDisabled;\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.expandToIndex = function (index) {\r\n\t\t\tif (index < this.tracks.length)\r\n\t\t\t\treturn this.tracks[index];\r\n\t\t\tspine.Utils.ensureArrayCapacity(this.tracks, index + 1, null);\r\n\t\t\tthis.tracks.length = index + 1;\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tAnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\r\n\t\t\tvar entry = this.trackEntryPool.obtain();\r\n\t\t\tentry.trackIndex = trackIndex;\r\n\t\t\tentry.animation = animation;\r\n\t\t\tentry.loop = loop;\r\n\t\t\tentry.holdPrevious = false;\r\n\t\t\tentry.eventThreshold = 0;\r\n\t\t\tentry.attachmentThreshold = 0;\r\n\t\t\tentry.drawOrderThreshold = 0;\r\n\t\t\tentry.animationStart = 0;\r\n\t\t\tentry.animationEnd = animation.duration;\r\n\t\t\tentry.animationLast = -1;\r\n\t\t\tentry.nextAnimationLast = -1;\r\n\t\t\tentry.delay = 0;\r\n\t\t\tentry.trackTime = 0;\r\n\t\t\tentry.trackLast = -1;\r\n\t\t\tentry.nextTrackLast = -1;\r\n\t\t\tentry.trackEnd = Number.MAX_VALUE;\r\n\t\t\tentry.timeScale = 1;\r\n\t\t\tentry.alpha = 1;\r\n\t\t\tentry.interruptAlpha = 1;\r\n\t\t\tentry.mixTime = 0;\r\n\t\t\tentry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.disposeNext = function (entry) {\r\n\t\t\tvar next = entry.next;\r\n\t\t\twhile (next != null) {\r\n\t\t\t\tthis.queue.dispose(next);\r\n\t\t\t\tnext = next.next;\r\n\t\t\t}\r\n\t\t\tentry.next = null;\r\n\t\t};\r\n\t\tAnimationState.prototype._animationsChanged = function () {\r\n\t\t\tthis.animationsChanged = false;\r\n\t\t\tthis.propertyIDs.clear();\r\n\t\t\tfor (var i = 0, n = this.tracks.length; i < n; i++) {\r\n\t\t\t\tvar entry = this.tracks[i];\r\n\t\t\t\tif (entry == null)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\twhile (entry.mixingFrom != null)\r\n\t\t\t\t\tentry = entry.mixingFrom;\r\n\t\t\t\tdo {\r\n\t\t\t\t\tif (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add)\r\n\t\t\t\t\t\tthis.setTimelineModes(entry);\r\n\t\t\t\t\tentry = entry.mixingTo;\r\n\t\t\t\t} while (entry != null);\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimationState.prototype.setTimelineModes = function (entry) {\r\n\t\t\tvar to = entry.mixingTo;\r\n\t\t\tvar timelines = entry.animation.timelines;\r\n\t\t\tvar timelinesCount = entry.animation.timelines.length;\r\n\t\t\tvar timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount);\r\n\t\t\tentry.timelineHoldMix.length = 0;\r\n\t\t\tvar timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount);\r\n\t\t\tvar propertyIDs = this.propertyIDs;\r\n\t\t\tif (to != null && to.holdPrevious) {\r\n\t\t\t\tfor (var i = 0; i < timelinesCount; i++) {\r\n\t\t\t\t\tpropertyIDs.add(timelines[i].getPropertyId());\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.HOLD;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\touter: for (var i = 0; i < timelinesCount; i++) {\r\n\t\t\t\tvar id = timelines[i].getPropertyId();\r\n\t\t\t\tif (!propertyIDs.add(id))\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.SUBSEQUENT;\r\n\t\t\t\telse if (to == null || !this.hasTimeline(to, id))\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.FIRST;\r\n\t\t\t\telse {\r\n\t\t\t\t\tfor (var next = to.mixingTo; next != null; next = next.mixingTo) {\r\n\t\t\t\t\t\tif (this.hasTimeline(next, id))\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tif (entry.mixDuration > 0) {\r\n\t\t\t\t\t\t\ttimelineMode[i] = AnimationState.HOLD_MIX;\r\n\t\t\t\t\t\t\ttimelineDipMix[i] = next;\r\n\t\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.HOLD;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimationState.prototype.hasTimeline = function (entry, id) {\r\n\t\t\tvar timelines = entry.animation.timelines;\r\n\t\t\tfor (var i = 0, n = timelines.length; i < n; i++)\r\n\t\t\t\tif (timelines[i].getPropertyId() == id)\r\n\t\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tAnimationState.prototype.getCurrent = function (trackIndex) {\r\n\t\t\tif (trackIndex >= this.tracks.length)\r\n\t\t\t\treturn null;\r\n\t\t\treturn this.tracks[trackIndex];\r\n\t\t};\r\n\t\tAnimationState.prototype.addListener = function (listener) {\r\n\t\t\tif (listener == null)\r\n\t\t\t\tthrow new Error(\"listener cannot be null.\");\r\n\t\t\tthis.listeners.push(listener);\r\n\t\t};\r\n\t\tAnimationState.prototype.removeListener = function (listener) {\r\n\t\t\tvar index = this.listeners.indexOf(listener);\r\n\t\t\tif (index >= 0)\r\n\t\t\t\tthis.listeners.splice(index, 1);\r\n\t\t};\r\n\t\tAnimationState.prototype.clearListeners = function () {\r\n\t\t\tthis.listeners.length = 0;\r\n\t\t};\r\n\t\tAnimationState.prototype.clearListenerNotifications = function () {\r\n\t\t\tthis.queue.clear();\r\n\t\t};\r\n\t\tAnimationState.emptyAnimation = new spine.Animation(\"\", [], 0);\r\n\t\tAnimationState.SUBSEQUENT = 0;\r\n\t\tAnimationState.FIRST = 1;\r\n\t\tAnimationState.HOLD = 2;\r\n\t\tAnimationState.HOLD_MIX = 3;\r\n\t\treturn AnimationState;\r\n\t}());\r\n\tspine.AnimationState = AnimationState;\r\n\tvar TrackEntry = (function () {\r\n\t\tfunction TrackEntry() {\r\n\t\t\tthis.mixBlend = spine.MixBlend.replace;\r\n\t\t\tthis.timelineMode = new Array();\r\n\t\t\tthis.timelineHoldMix = new Array();\r\n\t\t\tthis.timelinesRotation = new Array();\r\n\t\t}\r\n\t\tTrackEntry.prototype.reset = function () {\r\n\t\t\tthis.next = null;\r\n\t\t\tthis.mixingFrom = null;\r\n\t\t\tthis.mixingTo = null;\r\n\t\t\tthis.animation = null;\r\n\t\t\tthis.listener = null;\r\n\t\t\tthis.timelineMode.length = 0;\r\n\t\t\tthis.timelineHoldMix.length = 0;\r\n\t\t\tthis.timelinesRotation.length = 0;\r\n\t\t};\r\n\t\tTrackEntry.prototype.getAnimationTime = function () {\r\n\t\t\tif (this.loop) {\r\n\t\t\t\tvar duration = this.animationEnd - this.animationStart;\r\n\t\t\t\tif (duration == 0)\r\n\t\t\t\t\treturn this.animationStart;\r\n\t\t\t\treturn (this.trackTime % duration) + this.animationStart;\r\n\t\t\t}\r\n\t\t\treturn Math.min(this.trackTime + this.animationStart, this.animationEnd);\r\n\t\t};\r\n\t\tTrackEntry.prototype.setAnimationLast = function (animationLast) {\r\n\t\t\tthis.animationLast = animationLast;\r\n\t\t\tthis.nextAnimationLast = animationLast;\r\n\t\t};\r\n\t\tTrackEntry.prototype.isComplete = function () {\r\n\t\t\treturn this.trackTime >= this.animationEnd - this.animationStart;\r\n\t\t};\r\n\t\tTrackEntry.prototype.resetRotationDirections = function () {\r\n\t\t\tthis.timelinesRotation.length = 0;\r\n\t\t};\r\n\t\treturn TrackEntry;\r\n\t}());\r\n\tspine.TrackEntry = TrackEntry;\r\n\tvar EventQueue = (function () {\r\n\t\tfunction EventQueue(animState) {\r\n\t\t\tthis.objects = [];\r\n\t\t\tthis.drainDisabled = false;\r\n\t\t\tthis.animState = animState;\r\n\t\t}\r\n\t\tEventQueue.prototype.start = function (entry) {\r\n\t\t\tthis.objects.push(EventType.start);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t\tthis.animState.animationsChanged = true;\r\n\t\t};\r\n\t\tEventQueue.prototype.interrupt = function (entry) {\r\n\t\t\tthis.objects.push(EventType.interrupt);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t};\r\n\t\tEventQueue.prototype.end = function (entry) {\r\n\t\t\tthis.objects.push(EventType.end);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t\tthis.animState.animationsChanged = true;\r\n\t\t};\r\n\t\tEventQueue.prototype.dispose = function (entry) {\r\n\t\t\tthis.objects.push(EventType.dispose);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t};\r\n\t\tEventQueue.prototype.complete = function (entry) {\r\n\t\t\tthis.objects.push(EventType.complete);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t};\r\n\t\tEventQueue.prototype.event = function (entry, event) {\r\n\t\t\tthis.objects.push(EventType.event);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t\tthis.objects.push(event);\r\n\t\t};\r\n\t\tEventQueue.prototype.drain = function () {\r\n\t\t\tif (this.drainDisabled)\r\n\t\t\t\treturn;\r\n\t\t\tthis.drainDisabled = true;\r\n\t\t\tvar objects = this.objects;\r\n\t\t\tvar listeners = this.animState.listeners;\r\n\t\t\tfor (var i = 0; i < objects.length; i += 2) {\r\n\t\t\t\tvar type = objects[i];\r\n\t\t\t\tvar entry = objects[i + 1];\r\n\t\t\t\tswitch (type) {\r\n\t\t\t\t\tcase EventType.start:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.start)\r\n\t\t\t\t\t\t\tentry.listener.start(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].start)\r\n\t\t\t\t\t\t\t\tlisteners[ii].start(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.interrupt:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.interrupt)\r\n\t\t\t\t\t\t\tentry.listener.interrupt(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].interrupt)\r\n\t\t\t\t\t\t\t\tlisteners[ii].interrupt(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.end:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.end)\r\n\t\t\t\t\t\t\tentry.listener.end(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].end)\r\n\t\t\t\t\t\t\t\tlisteners[ii].end(entry);\r\n\t\t\t\t\tcase EventType.dispose:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.dispose)\r\n\t\t\t\t\t\t\tentry.listener.dispose(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].dispose)\r\n\t\t\t\t\t\t\t\tlisteners[ii].dispose(entry);\r\n\t\t\t\t\t\tthis.animState.trackEntryPool.free(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.complete:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.complete)\r\n\t\t\t\t\t\t\tentry.listener.complete(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].complete)\r\n\t\t\t\t\t\t\t\tlisteners[ii].complete(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.event:\r\n\t\t\t\t\t\tvar event_3 = objects[i++ + 2];\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.event)\r\n\t\t\t\t\t\t\tentry.listener.event(entry, event_3);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].event)\r\n\t\t\t\t\t\t\t\tlisteners[ii].event(entry, event_3);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.clear();\r\n\t\t\tthis.drainDisabled = false;\r\n\t\t};\r\n\t\tEventQueue.prototype.clear = function () {\r\n\t\t\tthis.objects.length = 0;\r\n\t\t};\r\n\t\treturn EventQueue;\r\n\t}());\r\n\tspine.EventQueue = EventQueue;\r\n\tvar EventType;\r\n\t(function (EventType) {\r\n\t\tEventType[EventType[\"start\"] = 0] = \"start\";\r\n\t\tEventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\r\n\t\tEventType[EventType[\"end\"] = 2] = \"end\";\r\n\t\tEventType[EventType[\"dispose\"] = 3] = \"dispose\";\r\n\t\tEventType[EventType[\"complete\"] = 4] = \"complete\";\r\n\t\tEventType[EventType[\"event\"] = 5] = \"event\";\r\n\t})(EventType = spine.EventType || (spine.EventType = {}));\r\n\tvar AnimationStateAdapter2 = (function () {\r\n\t\tfunction AnimationStateAdapter2() {\r\n\t\t}\r\n\t\tAnimationStateAdapter2.prototype.start = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.interrupt = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.end = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.dispose = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.complete = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.event = function (entry, event) {\r\n\t\t};\r\n\t\treturn AnimationStateAdapter2;\r\n\t}());\r\n\tspine.AnimationStateAdapter2 = AnimationStateAdapter2;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AnimationStateData = (function () {\r\n\t\tfunction AnimationStateData(skeletonData) {\r\n\t\t\tthis.animationToMixTime = {};\r\n\t\t\tthis.defaultMix = 0;\r\n\t\t\tif (skeletonData == null)\r\n\t\t\t\tthrow new Error(\"skeletonData cannot be null.\");\r\n\t\t\tthis.skeletonData = skeletonData;\r\n\t\t}\r\n\t\tAnimationStateData.prototype.setMix = function (fromName, toName, duration) {\r\n\t\t\tvar from = this.skeletonData.findAnimation(fromName);\r\n\t\t\tif (from == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + fromName);\r\n\t\t\tvar to = this.skeletonData.findAnimation(toName);\r\n\t\t\tif (to == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + toName);\r\n\t\t\tthis.setMixWith(from, to, duration);\r\n\t\t};\r\n\t\tAnimationStateData.prototype.setMixWith = function (from, to, duration) {\r\n\t\t\tif (from == null)\r\n\t\t\t\tthrow new Error(\"from cannot be null.\");\r\n\t\t\tif (to == null)\r\n\t\t\t\tthrow new Error(\"to cannot be null.\");\r\n\t\t\tvar key = from.name + \".\" + to.name;\r\n\t\t\tthis.animationToMixTime[key] = duration;\r\n\t\t};\r\n\t\tAnimationStateData.prototype.getMix = function (from, to) {\r\n\t\t\tvar key = from.name + \".\" + to.name;\r\n\t\t\tvar value = this.animationToMixTime[key];\r\n\t\t\treturn value === undefined ? this.defaultMix : value;\r\n\t\t};\r\n\t\treturn AnimationStateData;\r\n\t}());\r\n\tspine.AnimationStateData = AnimationStateData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AssetManager = (function () {\r\n\t\tfunction AssetManager(textureLoader, pathPrefix) {\r\n\t\t\tif (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n\t\t\tthis.assets = {};\r\n\t\t\tthis.errors = {};\r\n\t\t\tthis.toLoad = 0;\r\n\t\t\tthis.loaded = 0;\r\n\t\t\tthis.textureLoader = textureLoader;\r\n\t\t\tthis.pathPrefix = pathPrefix;\r\n\t\t}\r\n\t\tAssetManager.downloadText = function (url, success, error) {\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.open(\"GET\", url, true);\r\n\t\t\trequest.onload = function () {\r\n\t\t\t\tif (request.status == 200) {\r\n\t\t\t\t\tsuccess(request.responseText);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.onerror = function () {\r\n\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t};\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tAssetManager.downloadBinary = function (url, success, error) {\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.open(\"GET\", url, true);\r\n\t\t\trequest.responseType = \"arraybuffer\";\r\n\t\t\trequest.onload = function () {\r\n\t\t\t\tif (request.status == 200) {\r\n\t\t\t\t\tsuccess(new Uint8Array(request.response));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.onerror = function () {\r\n\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t};\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tAssetManager.prototype.loadText = function (path, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tAssetManager.downloadText(path, function (data) {\r\n\t\t\t\t_this.assets[path] = data;\r\n\t\t\t\tif (success)\r\n\t\t\t\t\tsuccess(path, data);\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t}, function (state, responseText) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText);\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t});\r\n\t\t};\r\n\t\tAssetManager.prototype.loadTexture = function (path, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tvar img = new Image();\r\n\t\t\timg.crossOrigin = \"anonymous\";\r\n\t\t\timg.onload = function (ev) {\r\n\t\t\t\tvar texture = _this.textureLoader(img);\r\n\t\t\t\t_this.assets[path] = texture;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (success)\r\n\t\t\t\t\tsuccess(path, img);\r\n\t\t\t};\r\n\t\t\timg.onerror = function (ev) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load image \" + path;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load image \" + path);\r\n\t\t\t};\r\n\t\t\timg.src = path;\r\n\t\t};\r\n\t\tAssetManager.prototype.loadTextureData = function (path, data, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tvar img = new Image();\r\n\t\t\timg.onload = function (ev) {\r\n\t\t\t\tvar texture = _this.textureLoader(img);\r\n\t\t\t\t_this.assets[path] = texture;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (success)\r\n\t\t\t\t\tsuccess(path, img);\r\n\t\t\t};\r\n\t\t\timg.onerror = function (ev) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load image \" + path;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load image \" + path);\r\n\t\t\t};\r\n\t\t\timg.src = data;\r\n\t\t};\r\n\t\tAssetManager.prototype.loadTextureAtlas = function (path, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tvar parent = path.lastIndexOf(\"/\") >= 0 ? path.substring(0, path.lastIndexOf(\"/\")) : \"\";\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tAssetManager.downloadText(path, function (atlasData) {\r\n\t\t\t\tvar pagesLoaded = { count: 0 };\r\n\t\t\t\tvar atlasPages = new Array();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar atlas = new spine.TextureAtlas(atlasData, function (path) {\r\n\t\t\t\t\t\tatlasPages.push(parent + \"/\" + path);\r\n\t\t\t\t\t\tvar image = document.createElement(\"img\");\r\n\t\t\t\t\t\timage.width = 16;\r\n\t\t\t\t\t\timage.height = 16;\r\n\t\t\t\t\t\treturn new spine.FakeTexture(image);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\tvar ex = e;\r\n\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\r\n\t\t\t\t\tif (error)\r\n\t\t\t\t\t\terror(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\r\n\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar _loop_1 = function (atlasPage) {\r\n\t\t\t\t\tvar pageLoadError = false;\r\n\t\t\t\t\t_this.loadTexture(atlasPage, function (imagePath, image) {\r\n\t\t\t\t\t\tpagesLoaded.count++;\r\n\t\t\t\t\t\tif (pagesLoaded.count == atlasPages.length) {\r\n\t\t\t\t\t\t\tif (!pageLoadError) {\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tvar atlas = new spine.TextureAtlas(atlasData, function (path) {\r\n\t\t\t\t\t\t\t\t\t\treturn _this.get(parent + \"/\" + path);\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t_this.assets[path] = atlas;\r\n\t\t\t\t\t\t\t\t\tif (success)\r\n\t\t\t\t\t\t\t\t\t\tsuccess(path, atlas);\r\n\t\t\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tcatch (e) {\r\n\t\t\t\t\t\t\t\t\tvar ex = e;\r\n\t\t\t\t\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\r\n\t\t\t\t\t\t\t\t\tif (error)\r\n\t\t\t\t\t\t\t\t\t\terror(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\r\n\t\t\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\r\n\t\t\t\t\t\t\t\tif (error)\r\n\t\t\t\t\t\t\t\t\terror(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\r\n\t\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, function (imagePath, errorMessage) {\r\n\t\t\t\t\t\tpageLoadError = true;\r\n\t\t\t\t\t\tpagesLoaded.count++;\r\n\t\t\t\t\t\tif (pagesLoaded.count == atlasPages.length) {\r\n\t\t\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\r\n\t\t\t\t\t\t\tif (error)\r\n\t\t\t\t\t\t\t\terror(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\r\n\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t};\r\n\t\t\t\tfor (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) {\r\n\t\t\t\t\tvar atlasPage = atlasPages_1[_i];\r\n\t\t\t\t\t_loop_1(atlasPage);\r\n\t\t\t\t}\r\n\t\t\t}, function (state, responseText) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText);\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t});\r\n\t\t};\r\n\t\tAssetManager.prototype.get = function (path) {\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\treturn this.assets[path];\r\n\t\t};\r\n\t\tAssetManager.prototype.remove = function (path) {\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tvar asset = this.assets[path];\r\n\t\t\tif (asset.dispose)\r\n\t\t\t\tasset.dispose();\r\n\t\t\tthis.assets[path] = null;\r\n\t\t};\r\n\t\tAssetManager.prototype.removeAll = function () {\r\n\t\t\tfor (var key in this.assets) {\r\n\t\t\t\tvar asset = this.assets[key];\r\n\t\t\t\tif (asset.dispose)\r\n\t\t\t\t\tasset.dispose();\r\n\t\t\t}\r\n\t\t\tthis.assets = {};\r\n\t\t};\r\n\t\tAssetManager.prototype.isLoadingComplete = function () {\r\n\t\t\treturn this.toLoad == 0;\r\n\t\t};\r\n\t\tAssetManager.prototype.getToLoad = function () {\r\n\t\t\treturn this.toLoad;\r\n\t\t};\r\n\t\tAssetManager.prototype.getLoaded = function () {\r\n\t\t\treturn this.loaded;\r\n\t\t};\r\n\t\tAssetManager.prototype.dispose = function () {\r\n\t\t\tthis.removeAll();\r\n\t\t};\r\n\t\tAssetManager.prototype.hasErrors = function () {\r\n\t\t\treturn Object.keys(this.errors).length > 0;\r\n\t\t};\r\n\t\tAssetManager.prototype.getErrors = function () {\r\n\t\t\treturn this.errors;\r\n\t\t};\r\n\t\treturn AssetManager;\r\n\t}());\r\n\tspine.AssetManager = AssetManager;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AtlasAttachmentLoader = (function () {\r\n\t\tfunction AtlasAttachmentLoader(atlas) {\r\n\t\t\tthis.atlas = atlas;\r\n\t\t}\r\n\t\tAtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) {\r\n\t\t\tvar region = this.atlas.findRegion(path);\r\n\t\t\tif (region == null)\r\n\t\t\t\tthrow new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n\t\t\tregion.renderObject = region;\r\n\t\t\tvar attachment = new spine.RegionAttachment(name);\r\n\t\t\tattachment.setRegion(region);\r\n\t\t\treturn attachment;\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {\r\n\t\t\tvar region = this.atlas.findRegion(path);\r\n\t\t\tif (region == null)\r\n\t\t\t\tthrow new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n\t\t\tregion.renderObject = region;\r\n\t\t\tvar attachment = new spine.MeshAttachment(name);\r\n\t\t\tattachment.region = region;\r\n\t\t\treturn attachment;\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\r\n\t\t\treturn new spine.BoundingBoxAttachment(name);\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\r\n\t\t\treturn new spine.PathAttachment(name);\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\r\n\t\t\treturn new spine.PointAttachment(name);\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\r\n\t\t\treturn new spine.ClippingAttachment(name);\r\n\t\t};\r\n\t\treturn AtlasAttachmentLoader;\r\n\t}());\r\n\tspine.AtlasAttachmentLoader = AtlasAttachmentLoader;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar BlendMode;\r\n\t(function (BlendMode) {\r\n\t\tBlendMode[BlendMode[\"Normal\"] = 0] = \"Normal\";\r\n\t\tBlendMode[BlendMode[\"Additive\"] = 1] = \"Additive\";\r\n\t\tBlendMode[BlendMode[\"Multiply\"] = 2] = \"Multiply\";\r\n\t\tBlendMode[BlendMode[\"Screen\"] = 3] = \"Screen\";\r\n\t})(BlendMode = spine.BlendMode || (spine.BlendMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Bone = (function () {\r\n\t\tfunction Bone(data, skeleton, parent) {\r\n\t\t\tthis.children = new Array();\r\n\t\t\tthis.x = 0;\r\n\t\t\tthis.y = 0;\r\n\t\t\tthis.rotation = 0;\r\n\t\t\tthis.scaleX = 0;\r\n\t\t\tthis.scaleY = 0;\r\n\t\t\tthis.shearX = 0;\r\n\t\t\tthis.shearY = 0;\r\n\t\t\tthis.ax = 0;\r\n\t\t\tthis.ay = 0;\r\n\t\t\tthis.arotation = 0;\r\n\t\t\tthis.ascaleX = 0;\r\n\t\t\tthis.ascaleY = 0;\r\n\t\t\tthis.ashearX = 0;\r\n\t\t\tthis.ashearY = 0;\r\n\t\t\tthis.appliedValid = false;\r\n\t\t\tthis.a = 0;\r\n\t\t\tthis.b = 0;\r\n\t\t\tthis.worldX = 0;\r\n\t\t\tthis.c = 0;\r\n\t\t\tthis.d = 0;\r\n\t\t\tthis.worldY = 0;\r\n\t\t\tthis.sorted = false;\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.skeleton = skeleton;\r\n\t\t\tthis.parent = parent;\r\n\t\t\tthis.setToSetupPose();\r\n\t\t}\r\n\t\tBone.prototype.update = function () {\r\n\t\t\tthis.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n\t\t};\r\n\t\tBone.prototype.updateWorldTransform = function () {\r\n\t\t\tthis.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n\t\t};\r\n\t\tBone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\r\n\t\t\tthis.ax = x;\r\n\t\t\tthis.ay = y;\r\n\t\t\tthis.arotation = rotation;\r\n\t\t\tthis.ascaleX = scaleX;\r\n\t\t\tthis.ascaleY = scaleY;\r\n\t\t\tthis.ashearX = shearX;\r\n\t\t\tthis.ashearY = shearY;\r\n\t\t\tthis.appliedValid = true;\r\n\t\t\tvar parent = this.parent;\r\n\t\t\tif (parent == null) {\r\n\t\t\t\tvar skeleton = this.skeleton;\r\n\t\t\t\tvar rotationY = rotation + 90 + shearY;\r\n\t\t\t\tvar sx = skeleton.scaleX;\r\n\t\t\t\tvar sy = skeleton.scaleY;\r\n\t\t\t\tthis.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\r\n\t\t\t\tthis.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx;\r\n\t\t\t\tthis.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\r\n\t\t\t\tthis.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;\r\n\t\t\t\tthis.worldX = x * sx + skeleton.x;\r\n\t\t\t\tthis.worldY = y * sy + skeleton.y;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\r\n\t\t\tthis.worldX = pa * x + pb * y + parent.worldX;\r\n\t\t\tthis.worldY = pc * x + pd * y + parent.worldY;\r\n\t\t\tswitch (this.data.transformMode) {\r\n\t\t\t\tcase spine.TransformMode.Normal: {\r\n\t\t\t\t\tvar rotationY = rotation + 90 + shearY;\r\n\t\t\t\t\tvar la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tvar lb = spine.MathUtils.cosDeg(rotationY) * scaleY;\r\n\t\t\t\t\tvar lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tvar ld = spine.MathUtils.sinDeg(rotationY) * scaleY;\r\n\t\t\t\t\tthis.a = pa * la + pb * lc;\r\n\t\t\t\t\tthis.b = pa * lb + pb * ld;\r\n\t\t\t\t\tthis.c = pc * la + pd * lc;\r\n\t\t\t\t\tthis.d = pc * lb + pd * ld;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcase spine.TransformMode.OnlyTranslation: {\r\n\t\t\t\t\tvar rotationY = rotation + 90 + shearY;\r\n\t\t\t\t\tthis.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tthis.b = spine.MathUtils.cosDeg(rotationY) * scaleY;\r\n\t\t\t\t\tthis.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tthis.d = spine.MathUtils.sinDeg(rotationY) * scaleY;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase spine.TransformMode.NoRotationOrReflection: {\r\n\t\t\t\t\tvar s = pa * pa + pc * pc;\r\n\t\t\t\t\tvar prx = 0;\r\n\t\t\t\t\tif (s > 0.0001) {\r\n\t\t\t\t\t\ts = Math.abs(pa * pd - pb * pc) / s;\r\n\t\t\t\t\t\tpb = pc * s;\r\n\t\t\t\t\t\tpd = pa * s;\r\n\t\t\t\t\t\tprx = Math.atan2(pc, pa) * spine.MathUtils.radDeg;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpa = 0;\r\n\t\t\t\t\t\tpc = 0;\r\n\t\t\t\t\t\tprx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar rx = rotation + shearX - prx;\r\n\t\t\t\t\tvar ry = rotation + shearY - prx + 90;\r\n\t\t\t\t\tvar la = spine.MathUtils.cosDeg(rx) * scaleX;\r\n\t\t\t\t\tvar lb = spine.MathUtils.cosDeg(ry) * scaleY;\r\n\t\t\t\t\tvar lc = spine.MathUtils.sinDeg(rx) * scaleX;\r\n\t\t\t\t\tvar ld = spine.MathUtils.sinDeg(ry) * scaleY;\r\n\t\t\t\t\tthis.a = pa * la - pb * lc;\r\n\t\t\t\t\tthis.b = pa * lb - pb * ld;\r\n\t\t\t\t\tthis.c = pc * la + pd * lc;\r\n\t\t\t\t\tthis.d = pc * lb + pd * ld;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase spine.TransformMode.NoScale:\r\n\t\t\t\tcase spine.TransformMode.NoScaleOrReflection: {\r\n\t\t\t\t\tvar cos = spine.MathUtils.cosDeg(rotation);\r\n\t\t\t\t\tvar sin = spine.MathUtils.sinDeg(rotation);\r\n\t\t\t\t\tvar za = (pa * cos + pb * sin) / this.skeleton.scaleX;\r\n\t\t\t\t\tvar zc = (pc * cos + pd * sin) / this.skeleton.scaleY;\r\n\t\t\t\t\tvar s = Math.sqrt(za * za + zc * zc);\r\n\t\t\t\t\tif (s > 0.00001)\r\n\t\t\t\t\t\ts = 1 / s;\r\n\t\t\t\t\tza *= s;\r\n\t\t\t\t\tzc *= s;\r\n\t\t\t\t\ts = Math.sqrt(za * za + zc * zc);\r\n\t\t\t\t\tif (this.data.transformMode == spine.TransformMode.NoScale\r\n\t\t\t\t\t\t&& (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0))\r\n\t\t\t\t\t\ts = -s;\r\n\t\t\t\t\tvar r = Math.PI / 2 + Math.atan2(zc, za);\r\n\t\t\t\t\tvar zb = Math.cos(r) * s;\r\n\t\t\t\t\tvar zd = Math.sin(r) * s;\r\n\t\t\t\t\tvar la = spine.MathUtils.cosDeg(shearX) * scaleX;\r\n\t\t\t\t\tvar lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;\r\n\t\t\t\t\tvar lc = spine.MathUtils.sinDeg(shearX) * scaleX;\r\n\t\t\t\t\tvar ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;\r\n\t\t\t\t\tthis.a = za * la + zb * lc;\r\n\t\t\t\t\tthis.b = za * lb + zb * ld;\r\n\t\t\t\t\tthis.c = zc * la + zd * lc;\r\n\t\t\t\t\tthis.d = zc * lb + zd * ld;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.a *= this.skeleton.scaleX;\r\n\t\t\tthis.b *= this.skeleton.scaleX;\r\n\t\t\tthis.c *= this.skeleton.scaleY;\r\n\t\t\tthis.d *= this.skeleton.scaleY;\r\n\t\t};\r\n\t\tBone.prototype.setToSetupPose = function () {\r\n\t\t\tvar data = this.data;\r\n\t\t\tthis.x = data.x;\r\n\t\t\tthis.y = data.y;\r\n\t\t\tthis.rotation = data.rotation;\r\n\t\t\tthis.scaleX = data.scaleX;\r\n\t\t\tthis.scaleY = data.scaleY;\r\n\t\t\tthis.shearX = data.shearX;\r\n\t\t\tthis.shearY = data.shearY;\r\n\t\t};\r\n\t\tBone.prototype.getWorldRotationX = function () {\r\n\t\t\treturn Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\tBone.prototype.getWorldRotationY = function () {\r\n\t\t\treturn Math.atan2(this.d, this.b) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\tBone.prototype.getWorldScaleX = function () {\r\n\t\t\treturn Math.sqrt(this.a * this.a + this.c * this.c);\r\n\t\t};\r\n\t\tBone.prototype.getWorldScaleY = function () {\r\n\t\t\treturn Math.sqrt(this.b * this.b + this.d * this.d);\r\n\t\t};\r\n\t\tBone.prototype.updateAppliedTransform = function () {\r\n\t\t\tthis.appliedValid = true;\r\n\t\t\tvar parent = this.parent;\r\n\t\t\tif (parent == null) {\r\n\t\t\t\tthis.ax = this.worldX;\r\n\t\t\t\tthis.ay = this.worldY;\r\n\t\t\t\tthis.arotation = Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\r\n\t\t\t\tthis.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);\r\n\t\t\t\tthis.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);\r\n\t\t\t\tthis.ashearX = 0;\r\n\t\t\t\tthis.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\r\n\t\t\tvar pid = 1 / (pa * pd - pb * pc);\r\n\t\t\tvar dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;\r\n\t\t\tthis.ax = (dx * pd * pid - dy * pb * pid);\r\n\t\t\tthis.ay = (dy * pa * pid - dx * pc * pid);\r\n\t\t\tvar ia = pid * pd;\r\n\t\t\tvar id = pid * pa;\r\n\t\t\tvar ib = pid * pb;\r\n\t\t\tvar ic = pid * pc;\r\n\t\t\tvar ra = ia * this.a - ib * this.c;\r\n\t\t\tvar rb = ia * this.b - ib * this.d;\r\n\t\t\tvar rc = id * this.c - ic * this.a;\r\n\t\t\tvar rd = id * this.d - ic * this.b;\r\n\t\t\tthis.ashearX = 0;\r\n\t\t\tthis.ascaleX = Math.sqrt(ra * ra + rc * rc);\r\n\t\t\tif (this.ascaleX > 0.0001) {\r\n\t\t\t\tvar det = ra * rd - rb * rc;\r\n\t\t\t\tthis.ascaleY = det / this.ascaleX;\r\n\t\t\t\tthis.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg;\r\n\t\t\t\tthis.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.ascaleX = 0;\r\n\t\t\t\tthis.ascaleY = Math.sqrt(rb * rb + rd * rd);\r\n\t\t\t\tthis.ashearY = 0;\r\n\t\t\t\tthis.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg;\r\n\t\t\t}\r\n\t\t};\r\n\t\tBone.prototype.worldToLocal = function (world) {\r\n\t\t\tvar a = this.a, b = this.b, c = this.c, d = this.d;\r\n\t\t\tvar invDet = 1 / (a * d - b * c);\r\n\t\t\tvar x = world.x - this.worldX, y = world.y - this.worldY;\r\n\t\t\tworld.x = (x * d * invDet - y * b * invDet);\r\n\t\t\tworld.y = (y * a * invDet - x * c * invDet);\r\n\t\t\treturn world;\r\n\t\t};\r\n\t\tBone.prototype.localToWorld = function (local) {\r\n\t\t\tvar x = local.x, y = local.y;\r\n\t\t\tlocal.x = x * this.a + y * this.b + this.worldX;\r\n\t\t\tlocal.y = x * this.c + y * this.d + this.worldY;\r\n\t\t\treturn local;\r\n\t\t};\r\n\t\tBone.prototype.worldToLocalRotation = function (worldRotation) {\r\n\t\t\tvar sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation);\r\n\t\t\treturn Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX;\r\n\t\t};\r\n\t\tBone.prototype.localToWorldRotation = function (localRotation) {\r\n\t\t\tlocalRotation -= this.rotation - this.shearX;\r\n\t\t\tvar sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation);\r\n\t\t\treturn Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\tBone.prototype.rotateWorld = function (degrees) {\r\n\t\t\tvar a = this.a, b = this.b, c = this.c, d = this.d;\r\n\t\t\tvar cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees);\r\n\t\t\tthis.a = cos * a - sin * c;\r\n\t\t\tthis.b = cos * b - sin * d;\r\n\t\t\tthis.c = sin * a + cos * c;\r\n\t\t\tthis.d = sin * b + cos * d;\r\n\t\t\tthis.appliedValid = false;\r\n\t\t};\r\n\t\treturn Bone;\r\n\t}());\r\n\tspine.Bone = Bone;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar BoneData = (function () {\r\n\t\tfunction BoneData(index, name, parent) {\r\n\t\t\tthis.x = 0;\r\n\t\t\tthis.y = 0;\r\n\t\t\tthis.rotation = 0;\r\n\t\t\tthis.scaleX = 1;\r\n\t\t\tthis.scaleY = 1;\r\n\t\t\tthis.shearX = 0;\r\n\t\t\tthis.shearY = 0;\r\n\t\t\tthis.transformMode = TransformMode.Normal;\r\n\t\t\tif (index < 0)\r\n\t\t\t\tthrow new Error(\"index must be >= 0.\");\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.index = index;\r\n\t\t\tthis.name = name;\r\n\t\t\tthis.parent = parent;\r\n\t\t}\r\n\t\treturn BoneData;\r\n\t}());\r\n\tspine.BoneData = BoneData;\r\n\tvar TransformMode;\r\n\t(function (TransformMode) {\r\n\t\tTransformMode[TransformMode[\"Normal\"] = 0] = \"Normal\";\r\n\t\tTransformMode[TransformMode[\"OnlyTranslation\"] = 1] = \"OnlyTranslation\";\r\n\t\tTransformMode[TransformMode[\"NoRotationOrReflection\"] = 2] = \"NoRotationOrReflection\";\r\n\t\tTransformMode[TransformMode[\"NoScale\"] = 3] = \"NoScale\";\r\n\t\tTransformMode[TransformMode[\"NoScaleOrReflection\"] = 4] = \"NoScaleOrReflection\";\r\n\t})(TransformMode = spine.TransformMode || (spine.TransformMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Event = (function () {\r\n\t\tfunction Event(time, data) {\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tthis.time = time;\r\n\t\t\tthis.data = data;\r\n\t\t}\r\n\t\treturn Event;\r\n\t}());\r\n\tspine.Event = Event;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar EventData = (function () {\r\n\t\tfunction EventData(name) {\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn EventData;\r\n\t}());\r\n\tspine.EventData = EventData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar IkConstraint = (function () {\r\n\t\tfunction IkConstraint(data, skeleton) {\r\n\t\t\tthis.bendDirection = 0;\r\n\t\t\tthis.compress = false;\r\n\t\t\tthis.stretch = false;\r\n\t\t\tthis.mix = 1;\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.mix = data.mix;\r\n\t\t\tthis.bendDirection = data.bendDirection;\r\n\t\t\tthis.compress = data.compress;\r\n\t\t\tthis.stretch = data.stretch;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0; i < data.bones.length; i++)\r\n\t\t\t\tthis.bones.push(skeleton.findBone(data.bones[i].name));\r\n\t\t\tthis.target = skeleton.findBone(data.target.name);\r\n\t\t}\r\n\t\tIkConstraint.prototype.getOrder = function () {\r\n\t\t\treturn this.data.order;\r\n\t\t};\r\n\t\tIkConstraint.prototype.apply = function () {\r\n\t\t\tthis.update();\r\n\t\t};\r\n\t\tIkConstraint.prototype.update = function () {\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tswitch (bones.length) {\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tthis.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tthis.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t};\r\n\t\tIkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\r\n\t\t\tif (!bone.appliedValid)\r\n\t\t\t\tbone.updateAppliedTransform();\r\n\t\t\tvar p = bone.parent;\r\n\t\t\tvar id = 1 / (p.a * p.d - p.b * p.c);\r\n\t\t\tvar x = targetX - p.worldX, y = targetY - p.worldY;\r\n\t\t\tvar tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay;\r\n\t\t\tvar rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation;\r\n\t\t\tif (bone.ascaleX < 0)\r\n\t\t\t\trotationIK += 180;\r\n\t\t\tif (rotationIK > 180)\r\n\t\t\t\trotationIK -= 360;\r\n\t\t\telse if (rotationIK < -180)\r\n\t\t\t\trotationIK += 360;\r\n\t\t\tvar sx = bone.ascaleX, sy = bone.ascaleY;\r\n\t\t\tif (compress || stretch) {\r\n\t\t\t\tvar b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\r\n\t\t\t\tif ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\r\n\t\t\t\t\tvar s = (dd / b - 1) * alpha + 1;\r\n\t\t\t\t\tsx *= s;\r\n\t\t\t\t\tif (uniform)\r\n\t\t\t\t\t\tsy *= s;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\r\n\t\t};\r\n\t\tIkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) {\r\n\t\t\tif (alpha == 0) {\r\n\t\t\t\tchild.updateWorldTransform();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!parent.appliedValid)\r\n\t\t\t\tparent.updateAppliedTransform();\r\n\t\t\tif (!child.appliedValid)\r\n\t\t\t\tchild.updateAppliedTransform();\r\n\t\t\tvar px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;\r\n\t\t\tvar os1 = 0, os2 = 0, s2 = 0;\r\n\t\t\tif (psx < 0) {\r\n\t\t\t\tpsx = -psx;\r\n\t\t\t\tos1 = 180;\r\n\t\t\t\ts2 = -1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tos1 = 0;\r\n\t\t\t\ts2 = 1;\r\n\t\t\t}\r\n\t\t\tif (psy < 0) {\r\n\t\t\t\tpsy = -psy;\r\n\t\t\t\ts2 = -s2;\r\n\t\t\t}\r\n\t\t\tif (csx < 0) {\r\n\t\t\t\tcsx = -csx;\r\n\t\t\t\tos2 = 180;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tos2 = 0;\r\n\t\t\tvar cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;\r\n\t\t\tvar u = Math.abs(psx - psy) <= 0.0001;\r\n\t\t\tif (!u) {\r\n\t\t\t\tcy = 0;\r\n\t\t\t\tcwx = a * cx + parent.worldX;\r\n\t\t\t\tcwy = c * cx + parent.worldY;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcy = child.ay;\r\n\t\t\t\tcwx = a * cx + b * cy + parent.worldX;\r\n\t\t\t\tcwy = c * cx + d * cy + parent.worldY;\r\n\t\t\t}\r\n\t\t\tvar pp = parent.parent;\r\n\t\t\ta = pp.a;\r\n\t\t\tb = pp.b;\r\n\t\t\tc = pp.c;\r\n\t\t\td = pp.d;\r\n\t\t\tvar id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY;\r\n\t\t\tvar tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty;\r\n\t\t\tx = cwx - pp.worldX;\r\n\t\t\ty = cwy - pp.worldY;\r\n\t\t\tvar dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n\t\t\tvar l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;\r\n\t\t\touter: if (u) {\r\n\t\t\t\tl2 *= psx;\r\n\t\t\t\tvar cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n\t\t\t\tif (cos < -1)\r\n\t\t\t\t\tcos = -1;\r\n\t\t\t\telse if (cos > 1) {\r\n\t\t\t\t\tcos = 1;\r\n\t\t\t\t\tif (stretch && l1 + l2 > 0.0001)\r\n\t\t\t\t\t\tsx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\r\n\t\t\t\t}\r\n\t\t\t\ta2 = Math.acos(cos) * bendDir;\r\n\t\t\t\ta = l1 + l2 * cos;\r\n\t\t\t\tb = l2 * Math.sin(a2);\r\n\t\t\t\ta1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ta = psx * l2;\r\n\t\t\t\tb = psy * l2;\r\n\t\t\t\tvar aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\r\n\t\t\t\tc = bb * l1 * l1 + aa * dd - aa * bb;\r\n\t\t\t\tvar c1 = -2 * bb * l1, c2 = bb - aa;\r\n\t\t\t\td = c1 * c1 - 4 * c2 * c;\r\n\t\t\t\tif (d >= 0) {\r\n\t\t\t\t\tvar q = Math.sqrt(d);\r\n\t\t\t\t\tif (c1 < 0)\r\n\t\t\t\t\t\tq = -q;\r\n\t\t\t\t\tq = -(c1 + q) / 2;\r\n\t\t\t\t\tvar r0 = q / c2, r1 = c / q;\r\n\t\t\t\t\tvar r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n\t\t\t\t\tif (r * r <= dd) {\r\n\t\t\t\t\t\ty = Math.sqrt(dd - r * r) * bendDir;\r\n\t\t\t\t\t\ta1 = ta - Math.atan2(y, r);\r\n\t\t\t\t\t\ta2 = Math.atan2(y / psy, (r - l1) / psx);\r\n\t\t\t\t\t\tbreak outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\r\n\t\t\t\tvar maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\r\n\t\t\t\tc = -a * l1 / (aa - bb);\r\n\t\t\t\tif (c >= -1 && c <= 1) {\r\n\t\t\t\t\tc = Math.acos(c);\r\n\t\t\t\t\tx = a * Math.cos(c) + l1;\r\n\t\t\t\t\ty = b * Math.sin(c);\r\n\t\t\t\t\td = x * x + y * y;\r\n\t\t\t\t\tif (d < minDist) {\r\n\t\t\t\t\t\tminAngle = c;\r\n\t\t\t\t\t\tminDist = d;\r\n\t\t\t\t\t\tminX = x;\r\n\t\t\t\t\t\tminY = y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (d > maxDist) {\r\n\t\t\t\t\t\tmaxAngle = c;\r\n\t\t\t\t\t\tmaxDist = d;\r\n\t\t\t\t\t\tmaxX = x;\r\n\t\t\t\t\t\tmaxY = y;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (dd <= (minDist + maxDist) / 2) {\r\n\t\t\t\t\ta1 = ta - Math.atan2(minY * bendDir, minX);\r\n\t\t\t\t\ta2 = minAngle * bendDir;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ta1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n\t\t\t\t\ta2 = maxAngle * bendDir;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar os = Math.atan2(cy, cx) * s2;\r\n\t\t\tvar rotation = parent.arotation;\r\n\t\t\ta1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation;\r\n\t\t\tif (a1 > 180)\r\n\t\t\t\ta1 -= 360;\r\n\t\t\telse if (a1 < -180)\r\n\t\t\t\ta1 += 360;\r\n\t\t\tparent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0);\r\n\t\t\trotation = child.arotation;\r\n\t\t\ta2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\r\n\t\t\tif (a2 > 180)\r\n\t\t\t\ta2 -= 360;\r\n\t\t\telse if (a2 < -180)\r\n\t\t\t\ta2 += 360;\r\n\t\t\tchild.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n\t\t};\r\n\t\treturn IkConstraint;\r\n\t}());\r\n\tspine.IkConstraint = IkConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar IkConstraintData = (function () {\r\n\t\tfunction IkConstraintData(name) {\r\n\t\t\tthis.order = 0;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.bendDirection = 1;\r\n\t\t\tthis.compress = false;\r\n\t\t\tthis.stretch = false;\r\n\t\t\tthis.uniform = false;\r\n\t\t\tthis.mix = 1;\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn IkConstraintData;\r\n\t}());\r\n\tspine.IkConstraintData = IkConstraintData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PathConstraint = (function () {\r\n\t\tfunction PathConstraint(data, skeleton) {\r\n\t\t\tthis.position = 0;\r\n\t\t\tthis.spacing = 0;\r\n\t\t\tthis.rotateMix = 0;\r\n\t\t\tthis.translateMix = 0;\r\n\t\t\tthis.spaces = new Array();\r\n\t\t\tthis.positions = new Array();\r\n\t\t\tthis.world = new Array();\r\n\t\t\tthis.curves = new Array();\r\n\t\t\tthis.lengths = new Array();\r\n\t\t\tthis.segments = new Array();\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0, n = data.bones.length; i < n; i++)\r\n\t\t\t\tthis.bones.push(skeleton.findBone(data.bones[i].name));\r\n\t\t\tthis.target = skeleton.findSlot(data.target.name);\r\n\t\t\tthis.position = data.position;\r\n\t\t\tthis.spacing = data.spacing;\r\n\t\t\tthis.rotateMix = data.rotateMix;\r\n\t\t\tthis.translateMix = data.translateMix;\r\n\t\t}\r\n\t\tPathConstraint.prototype.apply = function () {\r\n\t\t\tthis.update();\r\n\t\t};\r\n\t\tPathConstraint.prototype.update = function () {\r\n\t\t\tvar attachment = this.target.getAttachment();\r\n\t\t\tif (!(attachment instanceof spine.PathAttachment))\r\n\t\t\t\treturn;\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix;\r\n\t\t\tvar translate = translateMix > 0, rotate = rotateMix > 0;\r\n\t\t\tif (!translate && !rotate)\r\n\t\t\t\treturn;\r\n\t\t\tvar data = this.data;\r\n\t\t\tvar percentSpacing = data.spacingMode == spine.SpacingMode.Percent;\r\n\t\t\tvar rotateMode = data.rotateMode;\r\n\t\t\tvar tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale;\r\n\t\t\tvar boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tvar spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null;\r\n\t\t\tvar spacing = this.spacing;\r\n\t\t\tif (scale || !percentSpacing) {\r\n\t\t\t\tif (scale)\r\n\t\t\t\t\tlengths = spine.Utils.setArraySize(this.lengths, boneCount);\r\n\t\t\t\tvar lengthSpacing = data.spacingMode == spine.SpacingMode.Length;\r\n\t\t\t\tfor (var i = 0, n = spacesCount - 1; i < n;) {\r\n\t\t\t\t\tvar bone = bones[i];\r\n\t\t\t\t\tvar setupLength = bone.data.length;\r\n\t\t\t\t\tif (setupLength < PathConstraint.epsilon) {\r\n\t\t\t\t\t\tif (scale)\r\n\t\t\t\t\t\t\tlengths[i] = 0;\r\n\t\t\t\t\t\tspaces[++i] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (percentSpacing) {\r\n\t\t\t\t\t\tif (scale) {\r\n\t\t\t\t\t\t\tvar x = setupLength * bone.a, y = setupLength * bone.c;\r\n\t\t\t\t\t\t\tvar length_1 = Math.sqrt(x * x + y * y);\r\n\t\t\t\t\t\t\tlengths[i] = length_1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tspaces[++i] = spacing;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar x = setupLength * bone.a, y = setupLength * bone.c;\r\n\t\t\t\t\t\tvar length_2 = Math.sqrt(x * x + y * y);\r\n\t\t\t\t\t\tif (scale)\r\n\t\t\t\t\t\t\tlengths[i] = length_2;\r\n\t\t\t\t\t\tspaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfor (var i = 1; i < spacesCount; i++)\r\n\t\t\t\t\tspaces[i] = spacing;\r\n\t\t\t}\r\n\t\t\tvar positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing);\r\n\t\t\tvar boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n\t\t\tvar tip = false;\r\n\t\t\tif (offsetRotation == 0)\r\n\t\t\t\ttip = rotateMode == spine.RotateMode.Chain;\r\n\t\t\telse {\r\n\t\t\t\ttip = false;\r\n\t\t\t\tvar p = this.target.bone;\r\n\t\t\t\toffsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tbone.worldX += (boneX - bone.worldX) * translateMix;\r\n\t\t\t\tbone.worldY += (boneY - bone.worldY) * translateMix;\r\n\t\t\t\tvar x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n\t\t\t\tif (scale) {\r\n\t\t\t\t\tvar length_3 = lengths[i];\r\n\t\t\t\t\tif (length_3 != 0) {\r\n\t\t\t\t\t\tvar s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1;\r\n\t\t\t\t\t\tbone.a *= s;\r\n\t\t\t\t\t\tbone.c *= s;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tboneX = x;\r\n\t\t\t\tboneY = y;\r\n\t\t\t\tif (rotate) {\r\n\t\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;\r\n\t\t\t\t\tif (tangents)\r\n\t\t\t\t\t\tr = positions[p - 1];\r\n\t\t\t\t\telse if (spaces[i + 1] == 0)\r\n\t\t\t\t\t\tr = positions[p + 2];\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tr = Math.atan2(dy, dx);\r\n\t\t\t\t\tr -= Math.atan2(c, a);\r\n\t\t\t\t\tif (tip) {\r\n\t\t\t\t\t\tcos = Math.cos(r);\r\n\t\t\t\t\t\tsin = Math.sin(r);\r\n\t\t\t\t\t\tvar length_4 = bone.data.length;\r\n\t\t\t\t\t\tboneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix;\r\n\t\t\t\t\t\tboneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tr += offsetRotation;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr *= rotateMix;\r\n\t\t\t\t\tcos = Math.cos(r);\r\n\t\t\t\t\tsin = Math.sin(r);\r\n\t\t\t\t\tbone.a = cos * a - sin * c;\r\n\t\t\t\t\tbone.b = cos * b - sin * d;\r\n\t\t\t\t\tbone.c = sin * a + cos * c;\r\n\t\t\t\t\tbone.d = sin * b + cos * d;\r\n\t\t\t\t}\r\n\t\t\t\tbone.appliedValid = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tPathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar position = this.position;\r\n\t\t\tvar spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;\r\n\t\t\tvar closed = path.closed;\r\n\t\t\tvar verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n\t\t\tif (!path.constantSpeed) {\r\n\t\t\t\tvar lengths = path.lengths;\r\n\t\t\t\tcurveCount -= closed ? 1 : 2;\r\n\t\t\t\tvar pathLength_1 = lengths[curveCount];\r\n\t\t\t\tif (percentPosition)\r\n\t\t\t\t\tposition *= pathLength_1;\r\n\t\t\t\tif (percentSpacing) {\r\n\t\t\t\t\tfor (var i = 1; i < spacesCount; i++)\r\n\t\t\t\t\t\tspaces[i] *= pathLength_1;\r\n\t\t\t\t}\r\n\t\t\t\tworld = spine.Utils.setArraySize(this.world, 8);\r\n\t\t\t\tfor (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n\t\t\t\t\tvar space = spaces[i];\r\n\t\t\t\t\tposition += space;\r\n\t\t\t\t\tvar p = position;\r\n\t\t\t\t\tif (closed) {\r\n\t\t\t\t\t\tp %= pathLength_1;\r\n\t\t\t\t\t\tif (p < 0)\r\n\t\t\t\t\t\t\tp += pathLength_1;\r\n\t\t\t\t\t\tcurve = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (p < 0) {\r\n\t\t\t\t\t\tif (prevCurve != PathConstraint.BEFORE) {\r\n\t\t\t\t\t\t\tprevCurve = PathConstraint.BEFORE;\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, 2, 4, world, 0, 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (p > pathLength_1) {\r\n\t\t\t\t\t\tif (prevCurve != PathConstraint.AFTER) {\r\n\t\t\t\t\t\t\tprevCurve = PathConstraint.AFTER;\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.addAfterPosition(p - pathLength_1, world, 0, out, o);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfor (;; curve++) {\r\n\t\t\t\t\t\tvar length_5 = lengths[curve];\r\n\t\t\t\t\t\tif (p > length_5)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tif (curve == 0)\r\n\t\t\t\t\t\t\tp /= length_5;\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tvar prev = lengths[curve - 1];\r\n\t\t\t\t\t\t\tp = (p - prev) / (length_5 - prev);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (curve != prevCurve) {\r\n\t\t\t\t\t\tprevCurve = curve;\r\n\t\t\t\t\t\tif (closed && curve == curveCount) {\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, 0, 4, world, 4, 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\r\n\t\t\t\t}\r\n\t\t\t\treturn out;\r\n\t\t\t}\r\n\t\t\tif (closed) {\r\n\t\t\t\tverticesLength += 2;\r\n\t\t\t\tworld = spine.Utils.setArraySize(this.world, verticesLength);\r\n\t\t\t\tpath.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\r\n\t\t\t\tpath.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\r\n\t\t\t\tworld[verticesLength - 2] = world[0];\r\n\t\t\t\tworld[verticesLength - 1] = world[1];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcurveCount--;\r\n\t\t\t\tverticesLength -= 4;\r\n\t\t\t\tworld = spine.Utils.setArraySize(this.world, verticesLength);\r\n\t\t\t\tpath.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\r\n\t\t\t}\r\n\t\t\tvar curves = spine.Utils.setArraySize(this.curves, curveCount);\r\n\t\t\tvar pathLength = 0;\r\n\t\t\tvar x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n\t\t\tvar tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n\t\t\tfor (var i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n\t\t\t\tcx1 = world[w];\r\n\t\t\t\tcy1 = world[w + 1];\r\n\t\t\t\tcx2 = world[w + 2];\r\n\t\t\t\tcy2 = world[w + 3];\r\n\t\t\t\tx2 = world[w + 4];\r\n\t\t\t\ty2 = world[w + 5];\r\n\t\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n\t\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n\t\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n\t\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n\t\t\t\tddfx = tmpx * 2 + dddfx;\r\n\t\t\t\tddfy = tmpy * 2 + dddfy;\r\n\t\t\t\tdfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n\t\t\t\tdfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tdfx += ddfx;\r\n\t\t\t\tdfy += ddfy;\r\n\t\t\t\tddfx += dddfx;\r\n\t\t\t\tddfy += dddfy;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tdfx += ddfx;\r\n\t\t\t\tdfy += ddfy;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tdfx += ddfx + dddfx;\r\n\t\t\t\tdfy += ddfy + dddfy;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tcurves[i] = pathLength;\r\n\t\t\t\tx1 = x2;\r\n\t\t\t\ty1 = y2;\r\n\t\t\t}\r\n\t\t\tif (percentPosition)\r\n\t\t\t\tposition *= pathLength;\r\n\t\t\telse\r\n\t\t\t\tposition *= pathLength / path.lengths[curveCount - 1];\r\n\t\t\tif (percentSpacing) {\r\n\t\t\t\tfor (var i = 1; i < spacesCount; i++)\r\n\t\t\t\t\tspaces[i] *= pathLength;\r\n\t\t\t}\r\n\t\t\tvar segments = this.segments;\r\n\t\t\tvar curveLength = 0;\r\n\t\t\tfor (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n\t\t\t\tvar space = spaces[i];\r\n\t\t\t\tposition += space;\r\n\t\t\t\tvar p = position;\r\n\t\t\t\tif (closed) {\r\n\t\t\t\t\tp %= pathLength;\r\n\t\t\t\t\tif (p < 0)\r\n\t\t\t\t\t\tp += pathLength;\r\n\t\t\t\t\tcurve = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse if (p < 0) {\r\n\t\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\telse if (p > pathLength) {\r\n\t\t\t\t\tthis.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tfor (;; curve++) {\r\n\t\t\t\t\tvar length_6 = curves[curve];\r\n\t\t\t\t\tif (p > length_6)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (curve == 0)\r\n\t\t\t\t\t\tp /= length_6;\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar prev = curves[curve - 1];\r\n\t\t\t\t\t\tp = (p - prev) / (length_6 - prev);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (curve != prevCurve) {\r\n\t\t\t\t\tprevCurve = curve;\r\n\t\t\t\t\tvar ii = curve * 6;\r\n\t\t\t\t\tx1 = world[ii];\r\n\t\t\t\t\ty1 = world[ii + 1];\r\n\t\t\t\t\tcx1 = world[ii + 2];\r\n\t\t\t\t\tcy1 = world[ii + 3];\r\n\t\t\t\t\tcx2 = world[ii + 4];\r\n\t\t\t\t\tcy2 = world[ii + 5];\r\n\t\t\t\t\tx2 = world[ii + 6];\r\n\t\t\t\t\ty2 = world[ii + 7];\r\n\t\t\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n\t\t\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n\t\t\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n\t\t\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n\t\t\t\t\tddfx = tmpx * 2 + dddfx;\r\n\t\t\t\t\tddfy = tmpy * 2 + dddfy;\r\n\t\t\t\t\tdfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n\t\t\t\t\tdfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n\t\t\t\t\tcurveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\tsegments[0] = curveLength;\r\n\t\t\t\t\tfor (ii = 1; ii < 8; ii++) {\r\n\t\t\t\t\t\tdfx += ddfx;\r\n\t\t\t\t\t\tdfy += ddfy;\r\n\t\t\t\t\t\tddfx += dddfx;\r\n\t\t\t\t\t\tddfy += dddfy;\r\n\t\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\t\tsegments[ii] = curveLength;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdfx += ddfx;\r\n\t\t\t\t\tdfy += ddfy;\r\n\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\tsegments[8] = curveLength;\r\n\t\t\t\t\tdfx += ddfx + dddfx;\r\n\t\t\t\t\tdfy += ddfy + dddfy;\r\n\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\tsegments[9] = curveLength;\r\n\t\t\t\t\tsegment = 0;\r\n\t\t\t\t}\r\n\t\t\t\tp *= curveLength;\r\n\t\t\t\tfor (;; segment++) {\r\n\t\t\t\t\tvar length_7 = segments[segment];\r\n\t\t\t\t\tif (p > length_7)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (segment == 0)\r\n\t\t\t\t\t\tp /= length_7;\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar prev = segments[segment - 1];\r\n\t\t\t\t\t\tp = segment + (p - prev) / (length_7 - prev);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tthis.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n\t\t\t}\r\n\t\t\treturn out;\r\n\t\t};\r\n\t\tPathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\r\n\t\t\tvar x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n\t\t\tout[o] = x1 + p * Math.cos(r);\r\n\t\t\tout[o + 1] = y1 + p * Math.sin(r);\r\n\t\t\tout[o + 2] = r;\r\n\t\t};\r\n\t\tPathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\r\n\t\t\tvar x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n\t\t\tout[o] = x1 + p * Math.cos(r);\r\n\t\t\tout[o + 1] = y1 + p * Math.sin(r);\r\n\t\t\tout[o + 2] = r;\r\n\t\t};\r\n\t\tPathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\r\n\t\t\tif (p == 0 || isNaN(p)) {\r\n\t\t\t\tout[o] = x1;\r\n\t\t\t\tout[o + 1] = y1;\r\n\t\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n\t\t\tvar ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n\t\t\tvar x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n\t\t\tout[o] = x;\r\n\t\t\tout[o + 1] = y;\r\n\t\t\tif (tangents) {\r\n\t\t\t\tif (p < 0.001)\r\n\t\t\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n\t\t\t\telse\r\n\t\t\t\t\tout[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n\t\t\t}\r\n\t\t};\r\n\t\tPathConstraint.prototype.getOrder = function () {\r\n\t\t\treturn this.data.order;\r\n\t\t};\r\n\t\tPathConstraint.NONE = -1;\r\n\t\tPathConstraint.BEFORE = -2;\r\n\t\tPathConstraint.AFTER = -3;\r\n\t\tPathConstraint.epsilon = 0.00001;\r\n\t\treturn PathConstraint;\r\n\t}());\r\n\tspine.PathConstraint = PathConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PathConstraintData = (function () {\r\n\t\tfunction PathConstraintData(name) {\r\n\t\t\tthis.order = 0;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn PathConstraintData;\r\n\t}());\r\n\tspine.PathConstraintData = PathConstraintData;\r\n\tvar PositionMode;\r\n\t(function (PositionMode) {\r\n\t\tPositionMode[PositionMode[\"Fixed\"] = 0] = \"Fixed\";\r\n\t\tPositionMode[PositionMode[\"Percent\"] = 1] = \"Percent\";\r\n\t})(PositionMode = spine.PositionMode || (spine.PositionMode = {}));\r\n\tvar SpacingMode;\r\n\t(function (SpacingMode) {\r\n\t\tSpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\r\n\t\tSpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\r\n\t\tSpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\r\n\t})(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {}));\r\n\tvar RotateMode;\r\n\t(function (RotateMode) {\r\n\t\tRotateMode[RotateMode[\"Tangent\"] = 0] = \"Tangent\";\r\n\t\tRotateMode[RotateMode[\"Chain\"] = 1] = \"Chain\";\r\n\t\tRotateMode[RotateMode[\"ChainScale\"] = 2] = \"ChainScale\";\r\n\t})(RotateMode = spine.RotateMode || (spine.RotateMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Assets = (function () {\r\n\t\tfunction Assets(clientId) {\r\n\t\t\tthis.toLoad = new Array();\r\n\t\t\tthis.assets = {};\r\n\t\t\tthis.clientId = clientId;\r\n\t\t}\r\n\t\tAssets.prototype.loaded = function () {\r\n\t\t\tvar i = 0;\r\n\t\t\tfor (var v in this.assets)\r\n\t\t\t\ti++;\r\n\t\t\treturn i;\r\n\t\t};\r\n\t\treturn Assets;\r\n\t}());\r\n\tvar SharedAssetManager = (function () {\r\n\t\tfunction SharedAssetManager(pathPrefix) {\r\n\t\t\tif (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n\t\t\tthis.clientAssets = {};\r\n\t\t\tthis.queuedAssets = {};\r\n\t\t\tthis.rawAssets = {};\r\n\t\t\tthis.errors = {};\r\n\t\t\tthis.pathPrefix = pathPrefix;\r\n\t\t}\r\n\t\tSharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) {\r\n\t\t\tvar clientAssets = this.clientAssets[clientId];\r\n\t\t\tif (clientAssets === null || clientAssets === undefined) {\r\n\t\t\t\tclientAssets = new Assets(clientId);\r\n\t\t\t\tthis.clientAssets[clientId] = clientAssets;\r\n\t\t\t}\r\n\t\t\tif (textureLoader !== null)\r\n\t\t\t\tclientAssets.textureLoader = textureLoader;\r\n\t\t\tclientAssets.toLoad.push(path);\r\n\t\t\tif (this.queuedAssets[path] === path) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.queuedAssets[path] = path;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.loadText = function (clientId, path) {\r\n\t\t\tvar _this = this;\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tif (!this.queueAsset(clientId, null, path))\r\n\t\t\t\treturn;\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.onreadystatechange = function () {\r\n\t\t\t\tif (request.readyState == XMLHttpRequest.DONE) {\r\n\t\t\t\t\tif (request.status >= 200 && request.status < 300) {\r\n\t\t\t\t\t\t_this.rawAssets[path] = request.responseText;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t_this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.open(\"GET\", path, true);\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.loadJson = function (clientId, path) {\r\n\t\t\tvar _this = this;\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tif (!this.queueAsset(clientId, null, path))\r\n\t\t\t\treturn;\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.onreadystatechange = function () {\r\n\t\t\t\tif (request.readyState == XMLHttpRequest.DONE) {\r\n\t\t\t\t\tif (request.status >= 200 && request.status < 300) {\r\n\t\t\t\t\t\t_this.rawAssets[path] = JSON.parse(request.responseText);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t_this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.open(\"GET\", path, true);\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) {\r\n\t\t\tvar _this = this;\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tif (!this.queueAsset(clientId, textureLoader, path))\r\n\t\t\t\treturn;\r\n\t\t\tvar img = new Image();\r\n\t\t\timg.src = path;\r\n\t\t\timg.crossOrigin = \"anonymous\";\r\n\t\t\timg.onload = function (ev) {\r\n\t\t\t\t_this.rawAssets[path] = img;\r\n\t\t\t};\r\n\t\t\timg.onerror = function (ev) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load image \" + path;\r\n\t\t\t};\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.get = function (clientId, path) {\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tvar clientAssets = this.clientAssets[clientId];\r\n\t\t\tif (clientAssets === null || clientAssets === undefined)\r\n\t\t\t\treturn true;\r\n\t\t\treturn clientAssets.assets[path];\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.updateClientAssets = function (clientAssets) {\r\n\t\t\tfor (var i = 0; i < clientAssets.toLoad.length; i++) {\r\n\t\t\t\tvar path = clientAssets.toLoad[i];\r\n\t\t\t\tvar asset = clientAssets.assets[path];\r\n\t\t\t\tif (asset === null || asset === undefined) {\r\n\t\t\t\t\tvar rawAsset = this.rawAssets[path];\r\n\t\t\t\t\tif (rawAsset === null || rawAsset === undefined)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (rawAsset instanceof HTMLImageElement) {\r\n\t\t\t\t\t\tclientAssets.assets[path] = clientAssets.textureLoader(rawAsset);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tclientAssets.assets[path] = rawAsset;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.isLoadingComplete = function (clientId) {\r\n\t\t\tvar clientAssets = this.clientAssets[clientId];\r\n\t\t\tif (clientAssets === null || clientAssets === undefined)\r\n\t\t\t\treturn true;\r\n\t\t\tthis.updateClientAssets(clientAssets);\r\n\t\t\treturn clientAssets.toLoad.length == clientAssets.loaded();\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.dispose = function () {\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.hasErrors = function () {\r\n\t\t\treturn Object.keys(this.errors).length > 0;\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.getErrors = function () {\r\n\t\t\treturn this.errors;\r\n\t\t};\r\n\t\treturn SharedAssetManager;\r\n\t}());\r\n\tspine.SharedAssetManager = SharedAssetManager;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Skeleton = (function () {\r\n\t\tfunction Skeleton(data) {\r\n\t\t\tthis._updateCache = new Array();\r\n\t\t\tthis.updateCacheReset = new Array();\r\n\t\t\tthis.time = 0;\r\n\t\t\tthis.scaleX = 1;\r\n\t\t\tthis.scaleY = 1;\r\n\t\t\tthis.x = 0;\r\n\t\t\tthis.y = 0;\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0; i < data.bones.length; i++) {\r\n\t\t\t\tvar boneData = data.bones[i];\r\n\t\t\t\tvar bone = void 0;\r\n\t\t\t\tif (boneData.parent == null)\r\n\t\t\t\t\tbone = new spine.Bone(boneData, this, null);\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar parent_1 = this.bones[boneData.parent.index];\r\n\t\t\t\t\tbone = new spine.Bone(boneData, this, parent_1);\r\n\t\t\t\t\tparent_1.children.push(bone);\r\n\t\t\t\t}\r\n\t\t\t\tthis.bones.push(bone);\r\n\t\t\t}\r\n\t\t\tthis.slots = new Array();\r\n\t\t\tthis.drawOrder = new Array();\r\n\t\t\tfor (var i = 0; i < data.slots.length; i++) {\r\n\t\t\t\tvar slotData = data.slots[i];\r\n\t\t\t\tvar bone = this.bones[slotData.boneData.index];\r\n\t\t\t\tvar slot = new spine.Slot(slotData, bone);\r\n\t\t\t\tthis.slots.push(slot);\r\n\t\t\t\tthis.drawOrder.push(slot);\r\n\t\t\t}\r\n\t\t\tthis.ikConstraints = new Array();\r\n\t\t\tfor (var i = 0; i < data.ikConstraints.length; i++) {\r\n\t\t\t\tvar ikConstraintData = data.ikConstraints[i];\r\n\t\t\t\tthis.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this));\r\n\t\t\t}\r\n\t\t\tthis.transformConstraints = new Array();\r\n\t\t\tfor (var i = 0; i < data.transformConstraints.length; i++) {\r\n\t\t\t\tvar transformConstraintData = data.transformConstraints[i];\r\n\t\t\t\tthis.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this));\r\n\t\t\t}\r\n\t\t\tthis.pathConstraints = new Array();\r\n\t\t\tfor (var i = 0; i < data.pathConstraints.length; i++) {\r\n\t\t\t\tvar pathConstraintData = data.pathConstraints[i];\r\n\t\t\t\tthis.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this));\r\n\t\t\t}\r\n\t\t\tthis.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\tthis.updateCache();\r\n\t\t}\r\n\t\tSkeleton.prototype.updateCache = function () {\r\n\t\t\tvar updateCache = this._updateCache;\r\n\t\t\tupdateCache.length = 0;\r\n\t\t\tthis.updateCacheReset.length = 0;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tbones[i].sorted = false;\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tvar ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\r\n\t\t\tvar constraintCount = ikCount + transformCount + pathCount;\r\n\t\t\touter: for (var i = 0; i < constraintCount; i++) {\r\n\t\t\t\tfor (var ii = 0; ii < ikCount; ii++) {\r\n\t\t\t\t\tvar constraint = ikConstraints[ii];\r\n\t\t\t\t\tif (constraint.data.order == i) {\r\n\t\t\t\t\t\tthis.sortIkConstraint(constraint);\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor (var ii = 0; ii < transformCount; ii++) {\r\n\t\t\t\t\tvar constraint = transformConstraints[ii];\r\n\t\t\t\t\tif (constraint.data.order == i) {\r\n\t\t\t\t\t\tthis.sortTransformConstraint(constraint);\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor (var ii = 0; ii < pathCount; ii++) {\r\n\t\t\t\t\tvar constraint = pathConstraints[ii];\r\n\t\t\t\t\tif (constraint.data.order == i) {\r\n\t\t\t\t\t\tthis.sortPathConstraint(constraint);\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tthis.sortBone(bones[i]);\r\n\t\t};\r\n\t\tSkeleton.prototype.sortIkConstraint = function (constraint) {\r\n\t\t\tvar target = constraint.target;\r\n\t\t\tthis.sortBone(target);\r\n\t\t\tvar constrained = constraint.bones;\r\n\t\t\tvar parent = constrained[0];\r\n\t\t\tthis.sortBone(parent);\r\n\t\t\tif (constrained.length > 1) {\r\n\t\t\t\tvar child = constrained[constrained.length - 1];\r\n\t\t\t\tif (!(this._updateCache.indexOf(child) > -1))\r\n\t\t\t\t\tthis.updateCacheReset.push(child);\r\n\t\t\t}\r\n\t\t\tthis._updateCache.push(constraint);\r\n\t\t\tthis.sortReset(parent.children);\r\n\t\t\tconstrained[constrained.length - 1].sorted = true;\r\n\t\t};\r\n\t\tSkeleton.prototype.sortPathConstraint = function (constraint) {\r\n\t\t\tvar slot = constraint.target;\r\n\t\t\tvar slotIndex = slot.data.index;\r\n\t\t\tvar slotBone = slot.bone;\r\n\t\t\tif (this.skin != null)\r\n\t\t\t\tthis.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n\t\t\tif (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\r\n\t\t\t\tthis.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n\t\t\tfor (var i = 0, n = this.data.skins.length; i < n; i++)\r\n\t\t\t\tthis.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\r\n\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\tif (attachment instanceof spine.PathAttachment)\r\n\t\t\t\tthis.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n\t\t\tvar constrained = constraint.bones;\r\n\t\t\tvar boneCount = constrained.length;\r\n\t\t\tfor (var i = 0; i < boneCount; i++)\r\n\t\t\t\tthis.sortBone(constrained[i]);\r\n\t\t\tthis._updateCache.push(constraint);\r\n\t\t\tfor (var i = 0; i < boneCount; i++)\r\n\t\t\t\tthis.sortReset(constrained[i].children);\r\n\t\t\tfor (var i = 0; i < boneCount; i++)\r\n\t\t\t\tconstrained[i].sorted = true;\r\n\t\t};\r\n\t\tSkeleton.prototype.sortTransformConstraint = function (constraint) {\r\n\t\t\tthis.sortBone(constraint.target);\r\n\t\t\tvar constrained = constraint.bones;\r\n\t\t\tvar boneCount = constrained.length;\r\n\t\t\tif (constraint.data.local) {\r\n\t\t\t\tfor (var i = 0; i < boneCount; i++) {\r\n\t\t\t\t\tvar child = constrained[i];\r\n\t\t\t\t\tthis.sortBone(child.parent);\r\n\t\t\t\t\tif (!(this._updateCache.indexOf(child) > -1))\r\n\t\t\t\t\t\tthis.updateCacheReset.push(child);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfor (var i = 0; i < boneCount; i++) {\r\n\t\t\t\t\tthis.sortBone(constrained[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis._updateCache.push(constraint);\r\n\t\t\tfor (var ii = 0; ii < boneCount; ii++)\r\n\t\t\t\tthis.sortReset(constrained[ii].children);\r\n\t\t\tfor (var ii = 0; ii < boneCount; ii++)\r\n\t\t\t\tconstrained[ii].sorted = true;\r\n\t\t};\r\n\t\tSkeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\r\n\t\t\tvar attachments = skin.attachments[slotIndex];\r\n\t\t\tif (!attachments)\r\n\t\t\t\treturn;\r\n\t\t\tfor (var key in attachments) {\r\n\t\t\t\tthis.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\r\n\t\t\tif (!(attachment instanceof spine.PathAttachment))\r\n\t\t\t\treturn;\r\n\t\t\tvar pathBones = attachment.bones;\r\n\t\t\tif (pathBones == null)\r\n\t\t\t\tthis.sortBone(slotBone);\r\n\t\t\telse {\r\n\t\t\t\tvar bones = this.bones;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\twhile (i < pathBones.length) {\r\n\t\t\t\t\tvar boneCount = pathBones[i++];\r\n\t\t\t\t\tfor (var n = i + boneCount; i < n; i++) {\r\n\t\t\t\t\t\tvar boneIndex = pathBones[i];\r\n\t\t\t\t\t\tthis.sortBone(bones[boneIndex]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.sortBone = function (bone) {\r\n\t\t\tif (bone.sorted)\r\n\t\t\t\treturn;\r\n\t\t\tvar parent = bone.parent;\r\n\t\t\tif (parent != null)\r\n\t\t\t\tthis.sortBone(parent);\r\n\t\t\tbone.sorted = true;\r\n\t\t\tthis._updateCache.push(bone);\r\n\t\t};\r\n\t\tSkeleton.prototype.sortReset = function (bones) {\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (bone.sorted)\r\n\t\t\t\t\tthis.sortReset(bone.children);\r\n\t\t\t\tbone.sorted = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.updateWorldTransform = function () {\r\n\t\t\tvar updateCacheReset = this.updateCacheReset;\r\n\t\t\tfor (var i = 0, n = updateCacheReset.length; i < n; i++) {\r\n\t\t\t\tvar bone = updateCacheReset[i];\r\n\t\t\t\tbone.ax = bone.x;\r\n\t\t\t\tbone.ay = bone.y;\r\n\t\t\t\tbone.arotation = bone.rotation;\r\n\t\t\t\tbone.ascaleX = bone.scaleX;\r\n\t\t\t\tbone.ascaleY = bone.scaleY;\r\n\t\t\t\tbone.ashearX = bone.shearX;\r\n\t\t\t\tbone.ashearY = bone.shearY;\r\n\t\t\t\tbone.appliedValid = true;\r\n\t\t\t}\r\n\t\t\tvar updateCache = this._updateCache;\r\n\t\t\tfor (var i = 0, n = updateCache.length; i < n; i++)\r\n\t\t\t\tupdateCache[i].update();\r\n\t\t};\r\n\t\tSkeleton.prototype.setToSetupPose = function () {\r\n\t\t\tthis.setBonesToSetupPose();\r\n\t\t\tthis.setSlotsToSetupPose();\r\n\t\t};\r\n\t\tSkeleton.prototype.setBonesToSetupPose = function () {\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tbones[i].setToSetupPose();\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tfor (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = ikConstraints[i];\r\n\t\t\t\tconstraint.mix = constraint.data.mix;\r\n\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t}\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tfor (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = transformConstraints[i];\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tconstraint.rotateMix = data.rotateMix;\r\n\t\t\t\tconstraint.translateMix = data.translateMix;\r\n\t\t\t\tconstraint.scaleMix = data.scaleMix;\r\n\t\t\t\tconstraint.shearMix = data.shearMix;\r\n\t\t\t}\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = pathConstraints[i];\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tconstraint.position = data.position;\r\n\t\t\t\tconstraint.spacing = data.spacing;\r\n\t\t\t\tconstraint.rotateMix = data.rotateMix;\r\n\t\t\t\tconstraint.translateMix = data.translateMix;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.setSlotsToSetupPose = function () {\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tspine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++)\r\n\t\t\t\tslots[i].setToSetupPose();\r\n\t\t};\r\n\t\tSkeleton.prototype.getRootBone = function () {\r\n\t\t\tif (this.bones.length == 0)\r\n\t\t\t\treturn null;\r\n\t\t\treturn this.bones[0];\r\n\t\t};\r\n\t\tSkeleton.prototype.findBone = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (bone.data.name == boneName)\r\n\t\t\t\t\treturn bone;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findBoneIndex = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tif (bones[i].data.name == boneName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeleton.prototype.findSlot = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tif (slot.data.name == slotName)\r\n\t\t\t\t\treturn slot;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findSlotIndex = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++)\r\n\t\t\t\tif (slots[i].data.name == slotName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeleton.prototype.setSkinByName = function (skinName) {\r\n\t\t\tvar skin = this.data.findSkin(skinName);\r\n\t\t\tif (skin == null)\r\n\t\t\t\tthrow new Error(\"Skin not found: \" + skinName);\r\n\t\t\tthis.setSkin(skin);\r\n\t\t};\r\n\t\tSkeleton.prototype.setSkin = function (newSkin) {\r\n\t\t\tif (newSkin != null) {\r\n\t\t\t\tif (this.skin != null)\r\n\t\t\t\t\tnewSkin.attachAll(this, this.skin);\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar slots = this.slots;\r\n\t\t\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\t\t\tvar slot = slots[i];\r\n\t\t\t\t\t\tvar name_1 = slot.data.attachmentName;\r\n\t\t\t\t\t\tif (name_1 != null) {\r\n\t\t\t\t\t\t\tvar attachment = newSkin.getAttachment(i, name_1);\r\n\t\t\t\t\t\t\tif (attachment != null)\r\n\t\t\t\t\t\t\t\tslot.setAttachment(attachment);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.skin = newSkin;\r\n\t\t};\r\n\t\tSkeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\r\n\t\t\treturn this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\r\n\t\t};\r\n\t\tSkeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\r\n\t\t\tif (attachmentName == null)\r\n\t\t\t\tthrow new Error(\"attachmentName cannot be null.\");\r\n\t\t\tif (this.skin != null) {\r\n\t\t\t\tvar attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n\t\t\t\tif (attachment != null)\r\n\t\t\t\t\treturn attachment;\r\n\t\t\t}\r\n\t\t\tif (this.data.defaultSkin != null)\r\n\t\t\t\treturn this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.setAttachment = function (slotName, attachmentName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tif (slot.data.name == slotName) {\r\n\t\t\t\t\tvar attachment = null;\r\n\t\t\t\t\tif (attachmentName != null) {\r\n\t\t\t\t\t\tattachment = this.getAttachment(i, attachmentName);\r\n\t\t\t\t\t\tif (attachment == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tslot.setAttachment(attachment);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthrow new Error(\"Slot not found: \" + slotName);\r\n\t\t};\r\n\t\tSkeleton.prototype.findIkConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tfor (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n\t\t\t\tvar ikConstraint = ikConstraints[i];\r\n\t\t\t\tif (ikConstraint.data.name == constraintName)\r\n\t\t\t\t\treturn ikConstraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findTransformConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tfor (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = transformConstraints[i];\r\n\t\t\t\tif (constraint.data.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findPathConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = pathConstraints[i];\r\n\t\t\t\tif (constraint.data.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.getBounds = function (offset, size, temp) {\r\n\t\t\tif (temp === void 0) { temp = new Array(2); }\r\n\t\t\tif (offset == null)\r\n\t\t\t\tthrow new Error(\"offset cannot be null.\");\r\n\t\t\tif (size == null)\r\n\t\t\t\tthrow new Error(\"size cannot be null.\");\r\n\t\t\tvar drawOrder = this.drawOrder;\r\n\t\t\tvar minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n\t\t\tfor (var i = 0, n = drawOrder.length; i < n; i++) {\r\n\t\t\t\tvar slot = drawOrder[i];\r\n\t\t\t\tvar verticesLength = 0;\r\n\t\t\t\tvar vertices = null;\r\n\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\tif (attachment instanceof spine.RegionAttachment) {\r\n\t\t\t\t\tverticesLength = 8;\r\n\t\t\t\t\tvertices = spine.Utils.setArraySize(temp, verticesLength, 0);\r\n\t\t\t\t\tattachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n\t\t\t\t}\r\n\t\t\t\telse if (attachment instanceof spine.MeshAttachment) {\r\n\t\t\t\t\tvar mesh = attachment;\r\n\t\t\t\t\tverticesLength = mesh.worldVerticesLength;\r\n\t\t\t\t\tvertices = spine.Utils.setArraySize(temp, verticesLength, 0);\r\n\t\t\t\t\tmesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\r\n\t\t\t\t}\r\n\t\t\t\tif (vertices != null) {\r\n\t\t\t\t\tfor (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\r\n\t\t\t\t\t\tvar x = vertices[ii], y = vertices[ii + 1];\r\n\t\t\t\t\t\tminX = Math.min(minX, x);\r\n\t\t\t\t\t\tminY = Math.min(minY, y);\r\n\t\t\t\t\t\tmaxX = Math.max(maxX, x);\r\n\t\t\t\t\t\tmaxY = Math.max(maxY, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\toffset.set(minX, minY);\r\n\t\t\tsize.set(maxX - minX, maxY - minY);\r\n\t\t};\r\n\t\tSkeleton.prototype.update = function (delta) {\r\n\t\t\tthis.time += delta;\r\n\t\t};\r\n\t\treturn Skeleton;\r\n\t}());\r\n\tspine.Skeleton = Skeleton;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonBounds = (function () {\r\n\t\tfunction SkeletonBounds() {\r\n\t\t\tthis.minX = 0;\r\n\t\t\tthis.minY = 0;\r\n\t\t\tthis.maxX = 0;\r\n\t\t\tthis.maxY = 0;\r\n\t\t\tthis.boundingBoxes = new Array();\r\n\t\t\tthis.polygons = new Array();\r\n\t\t\tthis.polygonPool = new spine.Pool(function () {\r\n\t\t\t\treturn spine.Utils.newFloatArray(16);\r\n\t\t\t});\r\n\t\t}\r\n\t\tSkeletonBounds.prototype.update = function (skeleton, updateAabb) {\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tvar boundingBoxes = this.boundingBoxes;\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tvar polygonPool = this.polygonPool;\r\n\t\t\tvar slots = skeleton.slots;\r\n\t\t\tvar slotCount = slots.length;\r\n\t\t\tboundingBoxes.length = 0;\r\n\t\t\tpolygonPool.freeAll(polygons);\r\n\t\t\tpolygons.length = 0;\r\n\t\t\tfor (var i = 0; i < slotCount; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\tif (attachment instanceof spine.BoundingBoxAttachment) {\r\n\t\t\t\t\tvar boundingBox = attachment;\r\n\t\t\t\t\tboundingBoxes.push(boundingBox);\r\n\t\t\t\t\tvar polygon = polygonPool.obtain();\r\n\t\t\t\t\tif (polygon.length != boundingBox.worldVerticesLength) {\r\n\t\t\t\t\t\tpolygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpolygons.push(polygon);\r\n\t\t\t\t\tboundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (updateAabb) {\r\n\t\t\t\tthis.aabbCompute();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.minX = Number.POSITIVE_INFINITY;\r\n\t\t\t\tthis.minY = Number.POSITIVE_INFINITY;\r\n\t\t\t\tthis.maxX = Number.NEGATIVE_INFINITY;\r\n\t\t\t\tthis.maxY = Number.NEGATIVE_INFINITY;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbCompute = function () {\r\n\t\t\tvar minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tfor (var i = 0, n = polygons.length; i < n; i++) {\r\n\t\t\t\tvar polygon = polygons[i];\r\n\t\t\t\tvar vertices = polygon;\r\n\t\t\t\tfor (var ii = 0, nn = polygon.length; ii < nn; ii += 2) {\r\n\t\t\t\t\tvar x = vertices[ii];\r\n\t\t\t\t\tvar y = vertices[ii + 1];\r\n\t\t\t\t\tminX = Math.min(minX, x);\r\n\t\t\t\t\tminY = Math.min(minY, y);\r\n\t\t\t\t\tmaxX = Math.max(maxX, x);\r\n\t\t\t\t\tmaxY = Math.max(maxY, y);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.minX = minX;\r\n\t\t\tthis.minY = minY;\r\n\t\t\tthis.maxX = maxX;\r\n\t\t\tthis.maxY = maxY;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbContainsPoint = function (x, y) {\r\n\t\t\treturn x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) {\r\n\t\t\tvar minX = this.minX;\r\n\t\t\tvar minY = this.minY;\r\n\t\t\tvar maxX = this.maxX;\r\n\t\t\tvar maxY = this.maxY;\r\n\t\t\tif ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\r\n\t\t\t\treturn false;\r\n\t\t\tvar m = (y2 - y1) / (x2 - x1);\r\n\t\t\tvar y = m * (minX - x1) + y1;\r\n\t\t\tif (y > minY && y < maxY)\r\n\t\t\t\treturn true;\r\n\t\t\ty = m * (maxX - x1) + y1;\r\n\t\t\tif (y > minY && y < maxY)\r\n\t\t\t\treturn true;\r\n\t\t\tvar x = (minY - y1) / m + x1;\r\n\t\t\tif (x > minX && x < maxX)\r\n\t\t\t\treturn true;\r\n\t\t\tx = (maxY - y1) / m + x1;\r\n\t\t\tif (x > minX && x < maxX)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) {\r\n\t\t\treturn this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.containsPoint = function (x, y) {\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tfor (var i = 0, n = polygons.length; i < n; i++)\r\n\t\t\t\tif (this.containsPointPolygon(polygons[i], x, y))\r\n\t\t\t\t\treturn this.boundingBoxes[i];\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) {\r\n\t\t\tvar vertices = polygon;\r\n\t\t\tvar nn = polygon.length;\r\n\t\t\tvar prevIndex = nn - 2;\r\n\t\t\tvar inside = false;\r\n\t\t\tfor (var ii = 0; ii < nn; ii += 2) {\r\n\t\t\t\tvar vertexY = vertices[ii + 1];\r\n\t\t\t\tvar prevY = vertices[prevIndex + 1];\r\n\t\t\t\tif ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\r\n\t\t\t\t\tvar vertexX = vertices[ii];\r\n\t\t\t\t\tif (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x)\r\n\t\t\t\t\t\tinside = !inside;\r\n\t\t\t\t}\r\n\t\t\t\tprevIndex = ii;\r\n\t\t\t}\r\n\t\t\treturn inside;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) {\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tfor (var i = 0, n = polygons.length; i < n; i++)\r\n\t\t\t\tif (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2))\r\n\t\t\t\t\treturn this.boundingBoxes[i];\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) {\r\n\t\t\tvar vertices = polygon;\r\n\t\t\tvar nn = polygon.length;\r\n\t\t\tvar width12 = x1 - x2, height12 = y1 - y2;\r\n\t\t\tvar det1 = x1 * y2 - y1 * x2;\r\n\t\t\tvar x3 = vertices[nn - 2], y3 = vertices[nn - 1];\r\n\t\t\tfor (var ii = 0; ii < nn; ii += 2) {\r\n\t\t\t\tvar x4 = vertices[ii], y4 = vertices[ii + 1];\r\n\t\t\t\tvar det2 = x3 * y4 - y3 * x4;\r\n\t\t\t\tvar width34 = x3 - x4, height34 = y3 - y4;\r\n\t\t\t\tvar det3 = width12 * height34 - height12 * width34;\r\n\t\t\t\tvar x = (det1 * width34 - width12 * det2) / det3;\r\n\t\t\t\tif (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\r\n\t\t\t\t\tvar y = (det1 * height34 - height12 * det2) / det3;\r\n\t\t\t\t\tif (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1)))\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tx3 = x4;\r\n\t\t\t\ty3 = y4;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.getPolygon = function (boundingBox) {\r\n\t\t\tif (boundingBox == null)\r\n\t\t\t\tthrow new Error(\"boundingBox cannot be null.\");\r\n\t\t\tvar index = this.boundingBoxes.indexOf(boundingBox);\r\n\t\t\treturn index == -1 ? null : this.polygons[index];\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.getWidth = function () {\r\n\t\t\treturn this.maxX - this.minX;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.getHeight = function () {\r\n\t\t\treturn this.maxY - this.minY;\r\n\t\t};\r\n\t\treturn SkeletonBounds;\r\n\t}());\r\n\tspine.SkeletonBounds = SkeletonBounds;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonClipping = (function () {\r\n\t\tfunction SkeletonClipping() {\r\n\t\t\tthis.triangulator = new spine.Triangulator();\r\n\t\t\tthis.clippingPolygon = new Array();\r\n\t\t\tthis.clipOutput = new Array();\r\n\t\t\tthis.clippedVertices = new Array();\r\n\t\t\tthis.clippedTriangles = new Array();\r\n\t\t\tthis.scratch = new Array();\r\n\t\t}\r\n\t\tSkeletonClipping.prototype.clipStart = function (slot, clip) {\r\n\t\t\tif (this.clipAttachment != null)\r\n\t\t\t\treturn 0;\r\n\t\t\tthis.clipAttachment = clip;\r\n\t\t\tvar n = clip.worldVerticesLength;\r\n\t\t\tvar vertices = spine.Utils.setArraySize(this.clippingPolygon, n);\r\n\t\t\tclip.computeWorldVertices(slot, 0, n, vertices, 0, 2);\r\n\t\t\tvar clippingPolygon = this.clippingPolygon;\r\n\t\t\tSkeletonClipping.makeClockwise(clippingPolygon);\r\n\t\t\tvar clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));\r\n\t\t\tfor (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) {\r\n\t\t\t\tvar polygon = clippingPolygons[i];\r\n\t\t\t\tSkeletonClipping.makeClockwise(polygon);\r\n\t\t\t\tpolygon.push(polygon[0]);\r\n\t\t\t\tpolygon.push(polygon[1]);\r\n\t\t\t}\r\n\t\t\treturn clippingPolygons.length;\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clipEndWithSlot = function (slot) {\r\n\t\t\tif (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data)\r\n\t\t\t\tthis.clipEnd();\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clipEnd = function () {\r\n\t\t\tif (this.clipAttachment == null)\r\n\t\t\t\treturn;\r\n\t\t\tthis.clipAttachment = null;\r\n\t\t\tthis.clippingPolygons = null;\r\n\t\t\tthis.clippedVertices.length = 0;\r\n\t\t\tthis.clippedTriangles.length = 0;\r\n\t\t\tthis.clippingPolygon.length = 0;\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.isClipping = function () {\r\n\t\t\treturn this.clipAttachment != null;\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) {\r\n\t\t\tvar clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\r\n\t\t\tvar clippedTriangles = this.clippedTriangles;\r\n\t\t\tvar polygons = this.clippingPolygons;\r\n\t\t\tvar polygonsCount = this.clippingPolygons.length;\r\n\t\t\tvar vertexSize = twoColor ? 12 : 8;\r\n\t\t\tvar index = 0;\r\n\t\t\tclippedVertices.length = 0;\r\n\t\t\tclippedTriangles.length = 0;\r\n\t\t\touter: for (var i = 0; i < trianglesLength; i += 3) {\r\n\t\t\t\tvar vertexOffset = triangles[i] << 1;\r\n\t\t\t\tvar x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\r\n\t\t\t\tvar u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\r\n\t\t\t\tvertexOffset = triangles[i + 1] << 1;\r\n\t\t\t\tvar x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\r\n\t\t\t\tvar u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\r\n\t\t\t\tvertexOffset = triangles[i + 2] << 1;\r\n\t\t\t\tvar x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\r\n\t\t\t\tvar u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\r\n\t\t\t\tfor (var p = 0; p < polygonsCount; p++) {\r\n\t\t\t\t\tvar s = clippedVertices.length;\r\n\t\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\r\n\t\t\t\t\t\tvar clipOutputLength = clipOutput.length;\r\n\t\t\t\t\t\tif (clipOutputLength == 0)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tvar d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\r\n\t\t\t\t\t\tvar d = 1 / (d0 * d2 + d1 * (y1 - y3));\r\n\t\t\t\t\t\tvar clipOutputCount = clipOutputLength >> 1;\r\n\t\t\t\t\t\tvar clipOutputItems = this.clipOutput;\r\n\t\t\t\t\t\tvar clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < clipOutputLength; ii += 2) {\r\n\t\t\t\t\t\t\tvar x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\r\n\t\t\t\t\t\t\tclippedVerticesItems[s] = x;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\r\n\t\t\t\t\t\t\tvar c0 = x - x3, c1 = y - y3;\r\n\t\t\t\t\t\t\tvar a = (d0 * c0 + d1 * c1) * d;\r\n\t\t\t\t\t\t\tvar b = (d4 * c0 + d2 * c1) * d;\r\n\t\t\t\t\t\t\tvar c = 1 - a - b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;\r\n\t\t\t\t\t\t\tif (twoColor) {\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ts += vertexSize;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ts = clippedTriangles.length;\r\n\t\t\t\t\t\tvar clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\r\n\t\t\t\t\t\tclipOutputCount--;\r\n\t\t\t\t\t\tfor (var ii = 1; ii < clipOutputCount; ii++) {\r\n\t\t\t\t\t\t\tclippedTrianglesItems[s] = index;\r\n\t\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\r\n\t\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\r\n\t\t\t\t\t\t\ts += 3;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tindex += clipOutputCount + 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize);\r\n\t\t\t\t\t\tclippedVerticesItems[s] = x1;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\r\n\t\t\t\t\t\tif (!twoColor) {\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = x2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = y2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 12] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 13] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 14] = u2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 15] = v2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 16] = x3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 17] = y3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 18] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 19] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 20] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 21] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 22] = u3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 23] = v3;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 12] = x2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 13] = y2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 14] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 15] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 16] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 17] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 18] = u2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 19] = v2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 20] = dark.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 21] = dark.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 22] = dark.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 23] = dark.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 24] = x3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 25] = y3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 26] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 27] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 28] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 29] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 30] = u3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 31] = v3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 32] = dark.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 33] = dark.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 34] = dark.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 35] = dark.a;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ts = clippedTriangles.length;\r\n\t\t\t\t\t\tvar clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3);\r\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\r\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\r\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\r\n\t\t\t\t\t\tindex += 3;\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) {\r\n\t\t\tvar originalOutput = output;\r\n\t\t\tvar clipped = false;\r\n\t\t\tvar input = null;\r\n\t\t\tif (clippingArea.length % 4 >= 2) {\r\n\t\t\t\tinput = output;\r\n\t\t\t\toutput = this.scratch;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tinput = this.scratch;\r\n\t\t\tinput.length = 0;\r\n\t\t\tinput.push(x1);\r\n\t\t\tinput.push(y1);\r\n\t\t\tinput.push(x2);\r\n\t\t\tinput.push(y2);\r\n\t\t\tinput.push(x3);\r\n\t\t\tinput.push(y3);\r\n\t\t\tinput.push(x1);\r\n\t\t\tinput.push(y1);\r\n\t\t\toutput.length = 0;\r\n\t\t\tvar clippingVertices = clippingArea;\r\n\t\t\tvar clippingVerticesLast = clippingArea.length - 4;\r\n\t\t\tfor (var i = 0;; i += 2) {\r\n\t\t\t\tvar edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];\r\n\t\t\t\tvar edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3];\r\n\t\t\t\tvar deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2;\r\n\t\t\t\tvar inputVertices = input;\r\n\t\t\t\tvar inputVerticesLength = input.length - 2, outputStart = output.length;\r\n\t\t\t\tfor (var ii = 0; ii < inputVerticesLength; ii += 2) {\r\n\t\t\t\t\tvar inputX = inputVertices[ii], inputY = inputVertices[ii + 1];\r\n\t\t\t\t\tvar inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3];\r\n\t\t\t\t\tvar side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0;\r\n\t\t\t\t\tif (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) {\r\n\t\t\t\t\t\tif (side2) {\r\n\t\t\t\t\t\t\toutput.push(inputX2);\r\n\t\t\t\t\t\t\toutput.push(inputY2);\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar c0 = inputY2 - inputY, c2 = inputX2 - inputX;\r\n\t\t\t\t\t\tvar s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\r\n\t\t\t\t\t\tif (Math.abs(s) > 0.000001) {\r\n\t\t\t\t\t\t\tvar ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\r\n\t\t\t\t\t\t\toutput.push(edgeX + (edgeX2 - edgeX) * ua);\r\n\t\t\t\t\t\t\toutput.push(edgeY + (edgeY2 - edgeY) * ua);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\toutput.push(edgeX);\r\n\t\t\t\t\t\t\toutput.push(edgeY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (side2) {\r\n\t\t\t\t\t\tvar c0 = inputY2 - inputY, c2 = inputX2 - inputX;\r\n\t\t\t\t\t\tvar s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\r\n\t\t\t\t\t\tif (Math.abs(s) > 0.000001) {\r\n\t\t\t\t\t\t\tvar ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\r\n\t\t\t\t\t\t\toutput.push(edgeX + (edgeX2 - edgeX) * ua);\r\n\t\t\t\t\t\t\toutput.push(edgeY + (edgeY2 - edgeY) * ua);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\toutput.push(edgeX);\r\n\t\t\t\t\t\t\toutput.push(edgeY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\toutput.push(inputX2);\r\n\t\t\t\t\t\toutput.push(inputY2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclipped = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (outputStart == output.length) {\r\n\t\t\t\t\toriginalOutput.length = 0;\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\toutput.push(output[0]);\r\n\t\t\t\toutput.push(output[1]);\r\n\t\t\t\tif (i == clippingVerticesLast)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tvar temp = output;\r\n\t\t\t\toutput = input;\r\n\t\t\t\toutput.length = 0;\r\n\t\t\t\tinput = temp;\r\n\t\t\t}\r\n\t\t\tif (originalOutput != output) {\r\n\t\t\t\toriginalOutput.length = 0;\r\n\t\t\t\tfor (var i = 0, n = output.length - 2; i < n; i++)\r\n\t\t\t\t\toriginalOutput[i] = output[i];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\toriginalOutput.length = originalOutput.length - 2;\r\n\t\t\treturn clipped;\r\n\t\t};\r\n\t\tSkeletonClipping.makeClockwise = function (polygon) {\r\n\t\t\tvar vertices = polygon;\r\n\t\t\tvar verticeslength = polygon.length;\r\n\t\t\tvar area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;\r\n\t\t\tfor (var i = 0, n = verticeslength - 3; i < n; i += 2) {\r\n\t\t\t\tp1x = vertices[i];\r\n\t\t\t\tp1y = vertices[i + 1];\r\n\t\t\t\tp2x = vertices[i + 2];\r\n\t\t\t\tp2y = vertices[i + 3];\r\n\t\t\t\tarea += p1x * p2y - p2x * p1y;\r\n\t\t\t}\r\n\t\t\tif (area < 0)\r\n\t\t\t\treturn;\r\n\t\t\tfor (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {\r\n\t\t\t\tvar x = vertices[i], y = vertices[i + 1];\r\n\t\t\t\tvar other = lastX - i;\r\n\t\t\t\tvertices[i] = vertices[other];\r\n\t\t\t\tvertices[i + 1] = vertices[other + 1];\r\n\t\t\t\tvertices[other] = x;\r\n\t\t\t\tvertices[other + 1] = y;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn SkeletonClipping;\r\n\t}());\r\n\tspine.SkeletonClipping = SkeletonClipping;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonData = (function () {\r\n\t\tfunction SkeletonData() {\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.slots = new Array();\r\n\t\t\tthis.skins = new Array();\r\n\t\t\tthis.events = new Array();\r\n\t\t\tthis.animations = new Array();\r\n\t\t\tthis.ikConstraints = new Array();\r\n\t\t\tthis.transformConstraints = new Array();\r\n\t\t\tthis.pathConstraints = new Array();\r\n\t\t\tthis.fps = 0;\r\n\t\t}\r\n\t\tSkeletonData.prototype.findBone = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (bone.name == boneName)\r\n\t\t\t\t\treturn bone;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findBoneIndex = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tif (bones[i].name == boneName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findSlot = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tif (slot.name == slotName)\r\n\t\t\t\t\treturn slot;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findSlotIndex = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++)\r\n\t\t\t\tif (slots[i].name == slotName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findSkin = function (skinName) {\r\n\t\t\tif (skinName == null)\r\n\t\t\t\tthrow new Error(\"skinName cannot be null.\");\r\n\t\t\tvar skins = this.skins;\r\n\t\t\tfor (var i = 0, n = skins.length; i < n; i++) {\r\n\t\t\t\tvar skin = skins[i];\r\n\t\t\t\tif (skin.name == skinName)\r\n\t\t\t\t\treturn skin;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findEvent = function (eventDataName) {\r\n\t\t\tif (eventDataName == null)\r\n\t\t\t\tthrow new Error(\"eventDataName cannot be null.\");\r\n\t\t\tvar events = this.events;\r\n\t\t\tfor (var i = 0, n = events.length; i < n; i++) {\r\n\t\t\t\tvar event_4 = events[i];\r\n\t\t\t\tif (event_4.name == eventDataName)\r\n\t\t\t\t\treturn event_4;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findAnimation = function (animationName) {\r\n\t\t\tif (animationName == null)\r\n\t\t\t\tthrow new Error(\"animationName cannot be null.\");\r\n\t\t\tvar animations = this.animations;\r\n\t\t\tfor (var i = 0, n = animations.length; i < n; i++) {\r\n\t\t\t\tvar animation = animations[i];\r\n\t\t\t\tif (animation.name == animationName)\r\n\t\t\t\t\treturn animation;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findIkConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tfor (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = ikConstraints[i];\r\n\t\t\t\tif (constraint.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findTransformConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tfor (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = transformConstraints[i];\r\n\t\t\t\tif (constraint.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findPathConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = pathConstraints[i];\r\n\t\t\t\tif (constraint.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\r\n\t\t\tif (pathConstraintName == null)\r\n\t\t\t\tthrow new Error(\"pathConstraintName cannot be null.\");\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++)\r\n\t\t\t\tif (pathConstraints[i].name == pathConstraintName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\treturn SkeletonData;\r\n\t}());\r\n\tspine.SkeletonData = SkeletonData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonJson = (function () {\r\n\t\tfunction SkeletonJson(attachmentLoader) {\r\n\t\t\tthis.scale = 1;\r\n\t\t\tthis.linkedMeshes = new Array();\r\n\t\t\tthis.attachmentLoader = attachmentLoader;\r\n\t\t}\r\n\t\tSkeletonJson.prototype.readSkeletonData = function (json) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tvar skeletonData = new spine.SkeletonData();\r\n\t\t\tvar root = typeof (json) === \"string\" ? JSON.parse(json) : json;\r\n\t\t\tvar skeletonMap = root.skeleton;\r\n\t\t\tif (skeletonMap != null) {\r\n\t\t\t\tskeletonData.hash = skeletonMap.hash;\r\n\t\t\t\tskeletonData.version = skeletonMap.spine;\r\n\t\t\t\tskeletonData.width = skeletonMap.width;\r\n\t\t\t\tskeletonData.height = skeletonMap.height;\r\n\t\t\t\tskeletonData.fps = skeletonMap.fps;\r\n\t\t\t\tskeletonData.imagesPath = skeletonMap.images;\r\n\t\t\t}\r\n\t\t\tif (root.bones) {\r\n\t\t\t\tfor (var i = 0; i < root.bones.length; i++) {\r\n\t\t\t\t\tvar boneMap = root.bones[i];\r\n\t\t\t\t\tvar parent_2 = null;\r\n\t\t\t\t\tvar parentName = this.getValue(boneMap, \"parent\", null);\r\n\t\t\t\t\tif (parentName != null) {\r\n\t\t\t\t\t\tparent_2 = skeletonData.findBone(parentName);\r\n\t\t\t\t\t\tif (parent_2 == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Parent bone not found: \" + parentName);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2);\r\n\t\t\t\t\tdata.length = this.getValue(boneMap, \"length\", 0) * scale;\r\n\t\t\t\t\tdata.x = this.getValue(boneMap, \"x\", 0) * scale;\r\n\t\t\t\t\tdata.y = this.getValue(boneMap, \"y\", 0) * scale;\r\n\t\t\t\t\tdata.rotation = this.getValue(boneMap, \"rotation\", 0);\r\n\t\t\t\t\tdata.scaleX = this.getValue(boneMap, \"scaleX\", 1);\r\n\t\t\t\t\tdata.scaleY = this.getValue(boneMap, \"scaleY\", 1);\r\n\t\t\t\t\tdata.shearX = this.getValue(boneMap, \"shearX\", 0);\r\n\t\t\t\t\tdata.shearY = this.getValue(boneMap, \"shearY\", 0);\r\n\t\t\t\t\tdata.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\r\n\t\t\t\t\tskeletonData.bones.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.slots) {\r\n\t\t\t\tfor (var i = 0; i < root.slots.length; i++) {\r\n\t\t\t\t\tvar slotMap = root.slots[i];\r\n\t\t\t\t\tvar slotName = slotMap.name;\r\n\t\t\t\t\tvar boneName = slotMap.bone;\r\n\t\t\t\t\tvar boneData = skeletonData.findBone(boneName);\r\n\t\t\t\t\tif (boneData == null)\r\n\t\t\t\t\t\tthrow new Error(\"Slot bone not found: \" + boneName);\r\n\t\t\t\t\tvar data = new spine.SlotData(skeletonData.slots.length, slotName, boneData);\r\n\t\t\t\t\tvar color = this.getValue(slotMap, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tdata.color.setFromString(color);\r\n\t\t\t\t\tvar dark = this.getValue(slotMap, \"dark\", null);\r\n\t\t\t\t\tif (dark != null) {\r\n\t\t\t\t\t\tdata.darkColor = new spine.Color(1, 1, 1, 1);\r\n\t\t\t\t\t\tdata.darkColor.setFromString(dark);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata.attachmentName = this.getValue(slotMap, \"attachment\", null);\r\n\t\t\t\t\tdata.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\r\n\t\t\t\t\tskeletonData.slots.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.ik) {\r\n\t\t\t\tfor (var i = 0; i < root.ik.length; i++) {\r\n\t\t\t\t\tvar constraintMap = root.ik[i];\r\n\t\t\t\t\tvar data = new spine.IkConstraintData(constraintMap.name);\r\n\t\t\t\t\tdata.order = this.getValue(constraintMap, \"order\", 0);\r\n\t\t\t\t\tfor (var j = 0; j < constraintMap.bones.length; j++) {\r\n\t\t\t\t\t\tvar boneName = constraintMap.bones[j];\r\n\t\t\t\t\t\tvar bone = skeletonData.findBone(boneName);\r\n\t\t\t\t\t\tif (bone == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"IK bone not found: \" + boneName);\r\n\t\t\t\t\t\tdata.bones.push(bone);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar targetName = constraintMap.target;\r\n\t\t\t\t\tdata.target = skeletonData.findBone(targetName);\r\n\t\t\t\t\tif (data.target == null)\r\n\t\t\t\t\t\tthrow new Error(\"IK target bone not found: \" + targetName);\r\n\t\t\t\t\tdata.mix = this.getValue(constraintMap, \"mix\", 1);\r\n\t\t\t\t\tdata.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n\t\t\t\t\tdata.compress = this.getValue(constraintMap, \"compress\", false);\r\n\t\t\t\t\tdata.stretch = this.getValue(constraintMap, \"stretch\", false);\r\n\t\t\t\t\tdata.uniform = this.getValue(constraintMap, \"uniform\", false);\r\n\t\t\t\t\tskeletonData.ikConstraints.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.transform) {\r\n\t\t\t\tfor (var i = 0; i < root.transform.length; i++) {\r\n\t\t\t\t\tvar constraintMap = root.transform[i];\r\n\t\t\t\t\tvar data = new spine.TransformConstraintData(constraintMap.name);\r\n\t\t\t\t\tdata.order = this.getValue(constraintMap, \"order\", 0);\r\n\t\t\t\t\tfor (var j = 0; j < constraintMap.bones.length; j++) {\r\n\t\t\t\t\t\tvar boneName = constraintMap.bones[j];\r\n\t\t\t\t\t\tvar bone = skeletonData.findBone(boneName);\r\n\t\t\t\t\t\tif (bone == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Transform constraint bone not found: \" + boneName);\r\n\t\t\t\t\t\tdata.bones.push(bone);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar targetName = constraintMap.target;\r\n\t\t\t\t\tdata.target = skeletonData.findBone(targetName);\r\n\t\t\t\t\tif (data.target == null)\r\n\t\t\t\t\t\tthrow new Error(\"Transform constraint target bone not found: \" + targetName);\r\n\t\t\t\t\tdata.local = this.getValue(constraintMap, \"local\", false);\r\n\t\t\t\t\tdata.relative = this.getValue(constraintMap, \"relative\", false);\r\n\t\t\t\t\tdata.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n\t\t\t\t\tdata.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\r\n\t\t\t\t\tdata.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\r\n\t\t\t\t\tdata.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\r\n\t\t\t\t\tdata.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\r\n\t\t\t\t\tdata.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\r\n\t\t\t\t\tdata.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n\t\t\t\t\tdata.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n\t\t\t\t\tdata.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\r\n\t\t\t\t\tdata.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\r\n\t\t\t\t\tskeletonData.transformConstraints.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.path) {\r\n\t\t\t\tfor (var i = 0; i < root.path.length; i++) {\r\n\t\t\t\t\tvar constraintMap = root.path[i];\r\n\t\t\t\t\tvar data = new spine.PathConstraintData(constraintMap.name);\r\n\t\t\t\t\tdata.order = this.getValue(constraintMap, \"order\", 0);\r\n\t\t\t\t\tfor (var j = 0; j < constraintMap.bones.length; j++) {\r\n\t\t\t\t\t\tvar boneName = constraintMap.bones[j];\r\n\t\t\t\t\t\tvar bone = skeletonData.findBone(boneName);\r\n\t\t\t\t\t\tif (bone == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Transform constraint bone not found: \" + boneName);\r\n\t\t\t\t\t\tdata.bones.push(bone);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar targetName = constraintMap.target;\r\n\t\t\t\t\tdata.target = skeletonData.findSlot(targetName);\r\n\t\t\t\t\tif (data.target == null)\r\n\t\t\t\t\t\tthrow new Error(\"Path target slot not found: \" + targetName);\r\n\t\t\t\t\tdata.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\r\n\t\t\t\t\tdata.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\r\n\t\t\t\t\tdata.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\r\n\t\t\t\t\tdata.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n\t\t\t\t\tdata.position = this.getValue(constraintMap, \"position\", 0);\r\n\t\t\t\t\tif (data.positionMode == spine.PositionMode.Fixed)\r\n\t\t\t\t\t\tdata.position *= scale;\r\n\t\t\t\t\tdata.spacing = this.getValue(constraintMap, \"spacing\", 0);\r\n\t\t\t\t\tif (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n\t\t\t\t\t\tdata.spacing *= scale;\r\n\t\t\t\t\tdata.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n\t\t\t\t\tdata.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n\t\t\t\t\tskeletonData.pathConstraints.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.skins) {\r\n\t\t\t\tfor (var skinName in root.skins) {\r\n\t\t\t\t\tvar skinMap = root.skins[skinName];\r\n\t\t\t\t\tvar skin = new spine.Skin(skinName);\r\n\t\t\t\t\tfor (var slotName in skinMap) {\r\n\t\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(slotName);\r\n\t\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + slotName);\r\n\t\t\t\t\t\tvar slotMap = skinMap[slotName];\r\n\t\t\t\t\t\tfor (var entryName in slotMap) {\r\n\t\t\t\t\t\t\tvar attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData);\r\n\t\t\t\t\t\t\tif (attachment != null)\r\n\t\t\t\t\t\t\t\tskin.addAttachment(slotIndex, entryName, attachment);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tskeletonData.skins.push(skin);\r\n\t\t\t\t\tif (skin.name == \"default\")\r\n\t\t\t\t\t\tskeletonData.defaultSkin = skin;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n\t\t\t\tvar linkedMesh = this.linkedMeshes[i];\r\n\t\t\t\tvar skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n\t\t\t\tif (skin == null)\r\n\t\t\t\t\tthrow new Error(\"Skin not found: \" + linkedMesh.skin);\r\n\t\t\t\tvar parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n\t\t\t\tif (parent_3 == null)\r\n\t\t\t\t\tthrow new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n\t\t\t\tlinkedMesh.mesh.setParentMesh(parent_3);\r\n\t\t\t\tlinkedMesh.mesh.updateUVs();\r\n\t\t\t}\r\n\t\t\tthis.linkedMeshes.length = 0;\r\n\t\t\tif (root.events) {\r\n\t\t\t\tfor (var eventName in root.events) {\r\n\t\t\t\t\tvar eventMap = root.events[eventName];\r\n\t\t\t\t\tvar data = new spine.EventData(eventName);\r\n\t\t\t\t\tdata.intValue = this.getValue(eventMap, \"int\", 0);\r\n\t\t\t\t\tdata.floatValue = this.getValue(eventMap, \"float\", 0);\r\n\t\t\t\t\tdata.stringValue = this.getValue(eventMap, \"string\", \"\");\r\n\t\t\t\t\tdata.audioPath = this.getValue(eventMap, \"audio\", null);\r\n\t\t\t\t\tif (data.audioPath != null) {\r\n\t\t\t\t\t\tdata.volume = this.getValue(eventMap, \"volume\", 1);\r\n\t\t\t\t\t\tdata.balance = this.getValue(eventMap, \"balance\", 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tskeletonData.events.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.animations) {\r\n\t\t\t\tfor (var animationName in root.animations) {\r\n\t\t\t\t\tvar animationMap = root.animations[animationName];\r\n\t\t\t\t\tthis.readAnimation(animationMap, animationName, skeletonData);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn skeletonData;\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tname = this.getValue(map, \"name\", name);\r\n\t\t\tvar type = this.getValue(map, \"type\", \"region\");\r\n\t\t\tswitch (type) {\r\n\t\t\t\tcase \"region\": {\r\n\t\t\t\t\tvar path = this.getValue(map, \"path\", name);\r\n\t\t\t\t\tvar region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n\t\t\t\t\tif (region == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tregion.path = path;\r\n\t\t\t\t\tregion.x = this.getValue(map, \"x\", 0) * scale;\r\n\t\t\t\t\tregion.y = this.getValue(map, \"y\", 0) * scale;\r\n\t\t\t\t\tregion.scaleX = this.getValue(map, \"scaleX\", 1);\r\n\t\t\t\t\tregion.scaleY = this.getValue(map, \"scaleY\", 1);\r\n\t\t\t\t\tregion.rotation = this.getValue(map, \"rotation\", 0);\r\n\t\t\t\t\tregion.width = map.width * scale;\r\n\t\t\t\t\tregion.height = map.height * scale;\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tregion.color.setFromString(color);\r\n\t\t\t\t\tregion.updateOffset();\r\n\t\t\t\t\treturn region;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"boundingbox\": {\r\n\t\t\t\t\tvar box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n\t\t\t\t\tif (box == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tthis.readVertices(map, box, map.vertexCount << 1);\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tbox.color.setFromString(color);\r\n\t\t\t\t\treturn box;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"mesh\":\r\n\t\t\t\tcase \"linkedmesh\": {\r\n\t\t\t\t\tvar path = this.getValue(map, \"path\", name);\r\n\t\t\t\t\tvar mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n\t\t\t\t\tif (mesh == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tmesh.path = path;\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tmesh.color.setFromString(color);\r\n\t\t\t\t\tvar parent_4 = this.getValue(map, \"parent\", null);\r\n\t\t\t\t\tif (parent_4 != null) {\r\n\t\t\t\t\t\tmesh.inheritDeform = this.getValue(map, \"deform\", true);\r\n\t\t\t\t\t\tthis.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent_4));\r\n\t\t\t\t\t\treturn mesh;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar uvs = map.uvs;\r\n\t\t\t\t\tthis.readVertices(map, mesh, uvs.length);\r\n\t\t\t\t\tmesh.triangles = map.triangles;\r\n\t\t\t\t\tmesh.regionUVs = uvs;\r\n\t\t\t\t\tmesh.updateUVs();\r\n\t\t\t\t\tmesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\r\n\t\t\t\t\treturn mesh;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"path\": {\r\n\t\t\t\t\tvar path = this.attachmentLoader.newPathAttachment(skin, name);\r\n\t\t\t\t\tif (path == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tpath.closed = this.getValue(map, \"closed\", false);\r\n\t\t\t\t\tpath.constantSpeed = this.getValue(map, \"constantSpeed\", true);\r\n\t\t\t\t\tvar vertexCount = map.vertexCount;\r\n\t\t\t\t\tthis.readVertices(map, path, vertexCount << 1);\r\n\t\t\t\t\tvar lengths = spine.Utils.newArray(vertexCount / 3, 0);\r\n\t\t\t\t\tfor (var i = 0; i < map.lengths.length; i++)\r\n\t\t\t\t\t\tlengths[i] = map.lengths[i] * scale;\r\n\t\t\t\t\tpath.lengths = lengths;\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tpath.color.setFromString(color);\r\n\t\t\t\t\treturn path;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"point\": {\r\n\t\t\t\t\tvar point = this.attachmentLoader.newPointAttachment(skin, name);\r\n\t\t\t\t\tif (point == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tpoint.x = this.getValue(map, \"x\", 0) * scale;\r\n\t\t\t\t\tpoint.y = this.getValue(map, \"y\", 0) * scale;\r\n\t\t\t\t\tpoint.rotation = this.getValue(map, \"rotation\", 0);\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tpoint.color.setFromString(color);\r\n\t\t\t\t\treturn point;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"clipping\": {\r\n\t\t\t\t\tvar clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n\t\t\t\t\tif (clip == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tvar end = this.getValue(map, \"end\", null);\r\n\t\t\t\t\tif (end != null) {\r\n\t\t\t\t\t\tvar slot = skeletonData.findSlot(end);\r\n\t\t\t\t\t\tif (slot == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Clipping end slot not found: \" + end);\r\n\t\t\t\t\t\tclip.endSlot = slot;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar vertexCount = map.vertexCount;\r\n\t\t\t\t\tthis.readVertices(map, clip, vertexCount << 1);\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tclip.color.setFromString(color);\r\n\t\t\t\t\treturn clip;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tattachment.worldVerticesLength = verticesLength;\r\n\t\t\tvar vertices = map.vertices;\r\n\t\t\tif (verticesLength == vertices.length) {\r\n\t\t\t\tvar scaledVertices = spine.Utils.toFloatArray(vertices);\r\n\t\t\t\tif (scale != 1) {\r\n\t\t\t\t\tfor (var i = 0, n = vertices.length; i < n; i++)\r\n\t\t\t\t\t\tscaledVertices[i] *= scale;\r\n\t\t\t\t}\r\n\t\t\t\tattachment.vertices = scaledVertices;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar weights = new Array();\r\n\t\t\tvar bones = new Array();\r\n\t\t\tfor (var i = 0, n = vertices.length; i < n;) {\r\n\t\t\t\tvar boneCount = vertices[i++];\r\n\t\t\t\tbones.push(boneCount);\r\n\t\t\t\tfor (var nn = i + boneCount * 4; i < nn; i += 4) {\r\n\t\t\t\t\tbones.push(vertices[i]);\r\n\t\t\t\t\tweights.push(vertices[i + 1] * scale);\r\n\t\t\t\t\tweights.push(vertices[i + 2] * scale);\r\n\t\t\t\t\tweights.push(vertices[i + 3]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattachment.bones = bones;\r\n\t\t\tattachment.vertices = spine.Utils.toFloatArray(weights);\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tvar timelines = new Array();\r\n\t\t\tvar duration = 0;\r\n\t\t\tif (map.slots) {\r\n\t\t\t\tfor (var slotName in map.slots) {\r\n\t\t\t\t\tvar slotMap = map.slots[slotName];\r\n\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(slotName);\r\n\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + slotName);\r\n\t\t\t\t\tfor (var timelineName in slotMap) {\r\n\t\t\t\t\t\tvar timelineMap = slotMap[timelineName];\r\n\t\t\t\t\t\tif (timelineName == \"attachment\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.AttachmentTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex++, valueMap.time, valueMap.name);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName == \"color\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.ColorTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\tvar color = new spine.Color();\r\n\t\t\t\t\t\t\t\tcolor.setFromString(valueMap.color);\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName == \"twoColor\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.TwoColorTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\tvar light = new spine.Color();\r\n\t\t\t\t\t\t\t\tvar dark = new spine.Color();\r\n\t\t\t\t\t\t\t\tlight.setFromString(valueMap.light);\r\n\t\t\t\t\t\t\t\tdark.setFromString(valueMap.dark);\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.bones) {\r\n\t\t\t\tfor (var boneName in map.bones) {\r\n\t\t\t\t\tvar boneMap = map.bones[boneName];\r\n\t\t\t\t\tvar boneIndex = skeletonData.findBoneIndex(boneName);\r\n\t\t\t\t\tif (boneIndex == -1)\r\n\t\t\t\t\t\tthrow new Error(\"Bone not found: \" + boneName);\r\n\t\t\t\t\tfor (var timelineName in boneMap) {\r\n\t\t\t\t\t\tvar timelineMap = boneMap[timelineName];\r\n\t\t\t\t\t\tif (timelineName === \"rotate\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.RotateTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.boneIndex = boneIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, valueMap.angle);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\r\n\t\t\t\t\t\t\tvar timeline = null;\r\n\t\t\t\t\t\t\tvar timelineScale = 1;\r\n\t\t\t\t\t\t\tif (timelineName === \"scale\")\r\n\t\t\t\t\t\t\t\ttimeline = new spine.ScaleTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\telse if (timelineName === \"shear\")\r\n\t\t\t\t\t\t\t\ttimeline = new spine.ShearTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\ttimeline = new spine.TranslateTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\t\ttimelineScale = scale;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimeline.boneIndex = boneIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\tvar x = this.getValue(valueMap, \"x\", 0), y = this.getValue(valueMap, \"y\", 0);\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.ik) {\r\n\t\t\t\tfor (var constraintName in map.ik) {\r\n\t\t\t\t\tvar constraintMap = map.ik[constraintName];\r\n\t\t\t\t\tvar constraint = skeletonData.findIkConstraint(constraintName);\r\n\t\t\t\t\tvar timeline = new spine.IkConstraintTimeline(constraintMap.length);\r\n\t\t\t\t\ttimeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\tfor (var i = 0; i < constraintMap.length; i++) {\r\n\t\t\t\t\t\tvar valueMap = constraintMap[i];\r\n\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"mix\", 1), this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1, this.getValue(valueMap, \"compress\", false), this.getValue(valueMap, \"stretch\", false));\r\n\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.transform) {\r\n\t\t\t\tfor (var constraintName in map.transform) {\r\n\t\t\t\t\tvar constraintMap = map.transform[constraintName];\r\n\t\t\t\t\tvar constraint = skeletonData.findTransformConstraint(constraintName);\r\n\t\t\t\t\tvar timeline = new spine.TransformConstraintTimeline(constraintMap.length);\r\n\t\t\t\t\ttimeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\tfor (var i = 0; i < constraintMap.length; i++) {\r\n\t\t\t\t\t\tvar valueMap = constraintMap[i];\r\n\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\r\n\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.paths) {\r\n\t\t\t\tfor (var constraintName in map.paths) {\r\n\t\t\t\t\tvar constraintMap = map.paths[constraintName];\r\n\t\t\t\t\tvar index = skeletonData.findPathConstraintIndex(constraintName);\r\n\t\t\t\t\tif (index == -1)\r\n\t\t\t\t\t\tthrow new Error(\"Path constraint not found: \" + constraintName);\r\n\t\t\t\t\tvar data = skeletonData.pathConstraints[index];\r\n\t\t\t\t\tfor (var timelineName in constraintMap) {\r\n\t\t\t\t\t\tvar timelineMap = constraintMap[timelineName];\r\n\t\t\t\t\t\tif (timelineName === \"position\" || timelineName === \"spacing\") {\r\n\t\t\t\t\t\t\tvar timeline = null;\r\n\t\t\t\t\t\t\tvar timelineScale = 1;\r\n\t\t\t\t\t\t\tif (timelineName === \"spacing\") {\r\n\t\t\t\t\t\t\t\ttimeline = new spine.PathConstraintSpacingTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\t\tif (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n\t\t\t\t\t\t\t\t\ttimelineScale = scale;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\ttimeline = new spine.PathConstraintPositionTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\t\tif (data.positionMode == spine.PositionMode.Fixed)\r\n\t\t\t\t\t\t\t\t\ttimelineScale = scale;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimeline.pathConstraintIndex = index;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName === \"mix\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.PathConstraintMixTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.pathConstraintIndex = index;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1));\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.deform) {\r\n\t\t\t\tfor (var deformName in map.deform) {\r\n\t\t\t\t\tvar deformMap = map.deform[deformName];\r\n\t\t\t\t\tvar skin = skeletonData.findSkin(deformName);\r\n\t\t\t\t\tif (skin == null)\r\n\t\t\t\t\t\tthrow new Error(\"Skin not found: \" + deformName);\r\n\t\t\t\t\tfor (var slotName in deformMap) {\r\n\t\t\t\t\t\tvar slotMap = deformMap[slotName];\r\n\t\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(slotName);\r\n\t\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + slotMap.name);\r\n\t\t\t\t\t\tfor (var timelineName in slotMap) {\r\n\t\t\t\t\t\t\tvar timelineMap = slotMap[timelineName];\r\n\t\t\t\t\t\t\tvar attachment = skin.getAttachment(slotIndex, timelineName);\r\n\t\t\t\t\t\t\tif (attachment == null)\r\n\t\t\t\t\t\t\t\tthrow new Error(\"Deform attachment not found: \" + timelineMap.name);\r\n\t\t\t\t\t\t\tvar weighted = attachment.bones != null;\r\n\t\t\t\t\t\t\tvar vertices = attachment.vertices;\r\n\t\t\t\t\t\t\tvar deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n\t\t\t\t\t\t\tvar timeline = new spine.DeformTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\ttimeline.attachment = attachment;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var j = 0; j < timelineMap.length; j++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[j];\r\n\t\t\t\t\t\t\t\tvar deform = void 0;\r\n\t\t\t\t\t\t\t\tvar verticesValue = this.getValue(valueMap, \"vertices\", null);\r\n\t\t\t\t\t\t\t\tif (verticesValue == null)\r\n\t\t\t\t\t\t\t\t\tdeform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices;\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tdeform = spine.Utils.newFloatArray(deformLength);\r\n\t\t\t\t\t\t\t\t\tvar start = this.getValue(valueMap, \"offset\", 0);\r\n\t\t\t\t\t\t\t\t\tspine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n\t\t\t\t\t\t\t\t\tif (scale != 1) {\r\n\t\t\t\t\t\t\t\t\t\tfor (var i = start, n = i + verticesValue.length; i < n; i++)\r\n\t\t\t\t\t\t\t\t\t\t\tdeform[i] *= scale;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif (!weighted) {\r\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < deformLength; i++)\r\n\t\t\t\t\t\t\t\t\t\t\tdeform[i] += vertices[i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, deform);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar drawOrderNode = map.drawOrder;\r\n\t\t\tif (drawOrderNode == null)\r\n\t\t\t\tdrawOrderNode = map.draworder;\r\n\t\t\tif (drawOrderNode != null) {\r\n\t\t\t\tvar timeline = new spine.DrawOrderTimeline(drawOrderNode.length);\r\n\t\t\t\tvar slotCount = skeletonData.slots.length;\r\n\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\tfor (var j = 0; j < drawOrderNode.length; j++) {\r\n\t\t\t\t\tvar drawOrderMap = drawOrderNode[j];\r\n\t\t\t\t\tvar drawOrder = null;\r\n\t\t\t\t\tvar offsets = this.getValue(drawOrderMap, \"offsets\", null);\r\n\t\t\t\t\tif (offsets != null) {\r\n\t\t\t\t\t\tdrawOrder = spine.Utils.newArray(slotCount, -1);\r\n\t\t\t\t\t\tvar unchanged = spine.Utils.newArray(slotCount - offsets.length, 0);\r\n\t\t\t\t\t\tvar originalIndex = 0, unchangedIndex = 0;\r\n\t\t\t\t\t\tfor (var i = 0; i < offsets.length; i++) {\r\n\t\t\t\t\t\t\tvar offsetMap = offsets[i];\r\n\t\t\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\r\n\t\t\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + offsetMap.slot);\r\n\t\t\t\t\t\t\twhile (originalIndex != slotIndex)\r\n\t\t\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\r\n\t\t\t\t\t\t\tdrawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\twhile (originalIndex < slotCount)\r\n\t\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\r\n\t\t\t\t\t\tfor (var i = slotCount - 1; i >= 0; i--)\r\n\t\t\t\t\t\t\tif (drawOrder[i] == -1)\r\n\t\t\t\t\t\t\t\tdrawOrder[i] = unchanged[--unchangedIndex];\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);\r\n\t\t\t\t}\r\n\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t}\r\n\t\t\tif (map.events) {\r\n\t\t\t\tvar timeline = new spine.EventTimeline(map.events.length);\r\n\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\tfor (var i = 0; i < map.events.length; i++) {\r\n\t\t\t\t\tvar eventMap = map.events[i];\r\n\t\t\t\t\tvar eventData = skeletonData.findEvent(eventMap.name);\r\n\t\t\t\t\tif (eventData == null)\r\n\t\t\t\t\t\tthrow new Error(\"Event not found: \" + eventMap.name);\r\n\t\t\t\t\tvar event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData);\r\n\t\t\t\t\tevent_5.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\r\n\t\t\t\t\tevent_5.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\r\n\t\t\t\t\tevent_5.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\r\n\t\t\t\t\tif (event_5.data.audioPath != null) {\r\n\t\t\t\t\t\tevent_5.volume = this.getValue(eventMap, \"volume\", 1);\r\n\t\t\t\t\t\tevent_5.balance = this.getValue(eventMap, \"balance\", 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimeline.setFrame(frameIndex++, event_5);\r\n\t\t\t\t}\r\n\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t}\r\n\t\t\tif (isNaN(duration)) {\r\n\t\t\t\tthrow new Error(\"Error while parsing animation, duration is NaN\");\r\n\t\t\t}\r\n\t\t\tskeletonData.animations.push(new spine.Animation(name, timelines, duration));\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {\r\n\t\t\tif (!map.curve)\r\n\t\t\t\treturn;\r\n\t\t\tif (map.curve === \"stepped\")\r\n\t\t\t\ttimeline.setStepped(frameIndex);\r\n\t\t\telse if (Object.prototype.toString.call(map.curve) === '[object Array]') {\r\n\t\t\t\tvar curve = map.curve;\r\n\t\t\t\ttimeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeletonJson.prototype.getValue = function (map, prop, defaultValue) {\r\n\t\t\treturn map[prop] !== undefined ? map[prop] : defaultValue;\r\n\t\t};\r\n\t\tSkeletonJson.blendModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"normal\")\r\n\t\t\t\treturn spine.BlendMode.Normal;\r\n\t\t\tif (str == \"additive\")\r\n\t\t\t\treturn spine.BlendMode.Additive;\r\n\t\t\tif (str == \"multiply\")\r\n\t\t\t\treturn spine.BlendMode.Multiply;\r\n\t\t\tif (str == \"screen\")\r\n\t\t\t\treturn spine.BlendMode.Screen;\r\n\t\t\tthrow new Error(\"Unknown blend mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.positionModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"fixed\")\r\n\t\t\t\treturn spine.PositionMode.Fixed;\r\n\t\t\tif (str == \"percent\")\r\n\t\t\t\treturn spine.PositionMode.Percent;\r\n\t\t\tthrow new Error(\"Unknown position mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.spacingModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"length\")\r\n\t\t\t\treturn spine.SpacingMode.Length;\r\n\t\t\tif (str == \"fixed\")\r\n\t\t\t\treturn spine.SpacingMode.Fixed;\r\n\t\t\tif (str == \"percent\")\r\n\t\t\t\treturn spine.SpacingMode.Percent;\r\n\t\t\tthrow new Error(\"Unknown position mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.rotateModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"tangent\")\r\n\t\t\t\treturn spine.RotateMode.Tangent;\r\n\t\t\tif (str == \"chain\")\r\n\t\t\t\treturn spine.RotateMode.Chain;\r\n\t\t\tif (str == \"chainscale\")\r\n\t\t\t\treturn spine.RotateMode.ChainScale;\r\n\t\t\tthrow new Error(\"Unknown rotate mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.transformModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"normal\")\r\n\t\t\t\treturn spine.TransformMode.Normal;\r\n\t\t\tif (str == \"onlytranslation\")\r\n\t\t\t\treturn spine.TransformMode.OnlyTranslation;\r\n\t\t\tif (str == \"norotationorreflection\")\r\n\t\t\t\treturn spine.TransformMode.NoRotationOrReflection;\r\n\t\t\tif (str == \"noscale\")\r\n\t\t\t\treturn spine.TransformMode.NoScale;\r\n\t\t\tif (str == \"noscaleorreflection\")\r\n\t\t\t\treturn spine.TransformMode.NoScaleOrReflection;\r\n\t\t\tthrow new Error(\"Unknown transform mode: \" + str);\r\n\t\t};\r\n\t\treturn SkeletonJson;\r\n\t}());\r\n\tspine.SkeletonJson = SkeletonJson;\r\n\tvar LinkedMesh = (function () {\r\n\t\tfunction LinkedMesh(mesh, skin, slotIndex, parent) {\r\n\t\t\tthis.mesh = mesh;\r\n\t\t\tthis.skin = skin;\r\n\t\t\tthis.slotIndex = slotIndex;\r\n\t\t\tthis.parent = parent;\r\n\t\t}\r\n\t\treturn LinkedMesh;\r\n\t}());\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Skin = (function () {\r\n\t\tfunction Skin(name) {\r\n\t\t\tthis.attachments = new Array();\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\tSkin.prototype.addAttachment = function (slotIndex, name, attachment) {\r\n\t\t\tif (attachment == null)\r\n\t\t\t\tthrow new Error(\"attachment cannot be null.\");\r\n\t\t\tvar attachments = this.attachments;\r\n\t\t\tif (slotIndex >= attachments.length)\r\n\t\t\t\tattachments.length = slotIndex + 1;\r\n\t\t\tif (!attachments[slotIndex])\r\n\t\t\t\tattachments[slotIndex] = {};\r\n\t\t\tattachments[slotIndex][name] = attachment;\r\n\t\t};\r\n\t\tSkin.prototype.getAttachment = function (slotIndex, name) {\r\n\t\t\tvar dictionary = this.attachments[slotIndex];\r\n\t\t\treturn dictionary ? dictionary[name] : null;\r\n\t\t};\r\n\t\tSkin.prototype.attachAll = function (skeleton, oldSkin) {\r\n\t\t\tvar slotIndex = 0;\r\n\t\t\tfor (var i = 0; i < skeleton.slots.length; i++) {\r\n\t\t\t\tvar slot = skeleton.slots[i];\r\n\t\t\t\tvar slotAttachment = slot.getAttachment();\r\n\t\t\t\tif (slotAttachment && slotIndex < oldSkin.attachments.length) {\r\n\t\t\t\t\tvar dictionary = oldSkin.attachments[slotIndex];\r\n\t\t\t\t\tfor (var key in dictionary) {\r\n\t\t\t\t\t\tvar skinAttachment = dictionary[key];\r\n\t\t\t\t\t\tif (slotAttachment == skinAttachment) {\r\n\t\t\t\t\t\t\tvar attachment = this.getAttachment(slotIndex, key);\r\n\t\t\t\t\t\t\tif (attachment != null)\r\n\t\t\t\t\t\t\t\tslot.setAttachment(attachment);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tslotIndex++;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn Skin;\r\n\t}());\r\n\tspine.Skin = Skin;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Slot = (function () {\r\n\t\tfunction Slot(data, bone) {\r\n\t\t\tthis.attachmentVertices = new Array();\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (bone == null)\r\n\t\t\t\tthrow new Error(\"bone cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.bone = bone;\r\n\t\t\tthis.color = new spine.Color();\r\n\t\t\tthis.darkColor = data.darkColor == null ? null : new spine.Color();\r\n\t\t\tthis.setToSetupPose();\r\n\t\t}\r\n\t\tSlot.prototype.getAttachment = function () {\r\n\t\t\treturn this.attachment;\r\n\t\t};\r\n\t\tSlot.prototype.setAttachment = function (attachment) {\r\n\t\t\tif (this.attachment == attachment)\r\n\t\t\t\treturn;\r\n\t\t\tthis.attachment = attachment;\r\n\t\t\tthis.attachmentTime = this.bone.skeleton.time;\r\n\t\t\tthis.attachmentVertices.length = 0;\r\n\t\t};\r\n\t\tSlot.prototype.setAttachmentTime = function (time) {\r\n\t\t\tthis.attachmentTime = this.bone.skeleton.time - time;\r\n\t\t};\r\n\t\tSlot.prototype.getAttachmentTime = function () {\r\n\t\t\treturn this.bone.skeleton.time - this.attachmentTime;\r\n\t\t};\r\n\t\tSlot.prototype.setToSetupPose = function () {\r\n\t\t\tthis.color.setFromColor(this.data.color);\r\n\t\t\tif (this.darkColor != null)\r\n\t\t\t\tthis.darkColor.setFromColor(this.data.darkColor);\r\n\t\t\tif (this.data.attachmentName == null)\r\n\t\t\t\tthis.attachment = null;\r\n\t\t\telse {\r\n\t\t\t\tthis.attachment = null;\r\n\t\t\t\tthis.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn Slot;\r\n\t}());\r\n\tspine.Slot = Slot;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SlotData = (function () {\r\n\t\tfunction SlotData(index, name, boneData) {\r\n\t\t\tthis.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\tif (index < 0)\r\n\t\t\t\tthrow new Error(\"index must be >= 0.\");\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tif (boneData == null)\r\n\t\t\t\tthrow new Error(\"boneData cannot be null.\");\r\n\t\t\tthis.index = index;\r\n\t\t\tthis.name = name;\r\n\t\t\tthis.boneData = boneData;\r\n\t\t}\r\n\t\treturn SlotData;\r\n\t}());\r\n\tspine.SlotData = SlotData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Texture = (function () {\r\n\t\tfunction Texture(image) {\r\n\t\t\tthis._image = image;\r\n\t\t}\r\n\t\tTexture.prototype.getImage = function () {\r\n\t\t\treturn this._image;\r\n\t\t};\r\n\t\tTexture.filterFromString = function (text) {\r\n\t\t\tswitch (text.toLowerCase()) {\r\n\t\t\t\tcase \"nearest\": return TextureFilter.Nearest;\r\n\t\t\t\tcase \"linear\": return TextureFilter.Linear;\r\n\t\t\t\tcase \"mipmap\": return TextureFilter.MipMap;\r\n\t\t\t\tcase \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\r\n\t\t\t\tcase \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\r\n\t\t\t\tcase \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\r\n\t\t\t\tcase \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\r\n\t\t\t\tdefault: throw new Error(\"Unknown texture filter \" + text);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTexture.wrapFromString = function (text) {\r\n\t\t\tswitch (text.toLowerCase()) {\r\n\t\t\t\tcase \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\r\n\t\t\t\tcase \"clamptoedge\": return TextureWrap.ClampToEdge;\r\n\t\t\t\tcase \"repeat\": return TextureWrap.Repeat;\r\n\t\t\t\tdefault: throw new Error(\"Unknown texture wrap \" + text);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn Texture;\r\n\t}());\r\n\tspine.Texture = Texture;\r\n\tvar TextureFilter;\r\n\t(function (TextureFilter) {\r\n\t\tTextureFilter[TextureFilter[\"Nearest\"] = 9728] = \"Nearest\";\r\n\t\tTextureFilter[TextureFilter[\"Linear\"] = 9729] = \"Linear\";\r\n\t\tTextureFilter[TextureFilter[\"MipMap\"] = 9987] = \"MipMap\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapNearestNearest\"] = 9984] = \"MipMapNearestNearest\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapLinearNearest\"] = 9985] = \"MipMapLinearNearest\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapNearestLinear\"] = 9986] = \"MipMapNearestLinear\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapLinearLinear\"] = 9987] = \"MipMapLinearLinear\";\r\n\t})(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {}));\r\n\tvar TextureWrap;\r\n\t(function (TextureWrap) {\r\n\t\tTextureWrap[TextureWrap[\"MirroredRepeat\"] = 33648] = \"MirroredRepeat\";\r\n\t\tTextureWrap[TextureWrap[\"ClampToEdge\"] = 33071] = \"ClampToEdge\";\r\n\t\tTextureWrap[TextureWrap[\"Repeat\"] = 10497] = \"Repeat\";\r\n\t})(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {}));\r\n\tvar TextureRegion = (function () {\r\n\t\tfunction TextureRegion() {\r\n\t\t\tthis.u = 0;\r\n\t\t\tthis.v = 0;\r\n\t\t\tthis.u2 = 0;\r\n\t\t\tthis.v2 = 0;\r\n\t\t\tthis.width = 0;\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.rotate = false;\r\n\t\t\tthis.offsetX = 0;\r\n\t\t\tthis.offsetY = 0;\r\n\t\t\tthis.originalWidth = 0;\r\n\t\t\tthis.originalHeight = 0;\r\n\t\t}\r\n\t\treturn TextureRegion;\r\n\t}());\r\n\tspine.TextureRegion = TextureRegion;\r\n\tvar FakeTexture = (function (_super) {\r\n\t\t__extends(FakeTexture, _super);\r\n\t\tfunction FakeTexture() {\r\n\t\t\treturn _super !== null && _super.apply(this, arguments) || this;\r\n\t\t}\r\n\t\tFakeTexture.prototype.setFilters = function (minFilter, magFilter) { };\r\n\t\tFakeTexture.prototype.setWraps = function (uWrap, vWrap) { };\r\n\t\tFakeTexture.prototype.dispose = function () { };\r\n\t\treturn FakeTexture;\r\n\t}(Texture));\r\n\tspine.FakeTexture = FakeTexture;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar TextureAtlas = (function () {\r\n\t\tfunction TextureAtlas(atlasText, textureLoader) {\r\n\t\t\tthis.pages = new Array();\r\n\t\t\tthis.regions = new Array();\r\n\t\t\tthis.load(atlasText, textureLoader);\r\n\t\t}\r\n\t\tTextureAtlas.prototype.load = function (atlasText, textureLoader) {\r\n\t\t\tif (textureLoader == null)\r\n\t\t\t\tthrow new Error(\"textureLoader cannot be null.\");\r\n\t\t\tvar reader = new TextureAtlasReader(atlasText);\r\n\t\t\tvar tuple = new Array(4);\r\n\t\t\tvar page = null;\r\n\t\t\twhile (true) {\r\n\t\t\t\tvar line = reader.readLine();\r\n\t\t\t\tif (line == null)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tline = line.trim();\r\n\t\t\t\tif (line.length == 0)\r\n\t\t\t\t\tpage = null;\r\n\t\t\t\telse if (!page) {\r\n\t\t\t\t\tpage = new TextureAtlasPage();\r\n\t\t\t\t\tpage.name = line;\r\n\t\t\t\t\tif (reader.readTuple(tuple) == 2) {\r\n\t\t\t\t\t\tpage.width = parseInt(tuple[0]);\r\n\t\t\t\t\t\tpage.height = parseInt(tuple[1]);\r\n\t\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tpage.minFilter = spine.Texture.filterFromString(tuple[0]);\r\n\t\t\t\t\tpage.magFilter = spine.Texture.filterFromString(tuple[1]);\r\n\t\t\t\t\tvar direction = reader.readValue();\r\n\t\t\t\t\tpage.uWrap = spine.TextureWrap.ClampToEdge;\r\n\t\t\t\t\tpage.vWrap = spine.TextureWrap.ClampToEdge;\r\n\t\t\t\t\tif (direction == \"x\")\r\n\t\t\t\t\t\tpage.uWrap = spine.TextureWrap.Repeat;\r\n\t\t\t\t\telse if (direction == \"y\")\r\n\t\t\t\t\t\tpage.vWrap = spine.TextureWrap.Repeat;\r\n\t\t\t\t\telse if (direction == \"xy\")\r\n\t\t\t\t\t\tpage.uWrap = page.vWrap = spine.TextureWrap.Repeat;\r\n\t\t\t\t\tpage.texture = textureLoader(line);\r\n\t\t\t\t\tpage.texture.setFilters(page.minFilter, page.magFilter);\r\n\t\t\t\t\tpage.texture.setWraps(page.uWrap, page.vWrap);\r\n\t\t\t\t\tpage.width = page.texture.getImage().width;\r\n\t\t\t\t\tpage.height = page.texture.getImage().height;\r\n\t\t\t\t\tthis.pages.push(page);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar region = new TextureAtlasRegion();\r\n\t\t\t\t\tregion.name = line;\r\n\t\t\t\t\tregion.page = page;\r\n\t\t\t\t\tregion.rotate = reader.readValue() == \"true\";\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tvar x = parseInt(tuple[0]);\r\n\t\t\t\t\tvar y = parseInt(tuple[1]);\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tvar width = parseInt(tuple[0]);\r\n\t\t\t\t\tvar height = parseInt(tuple[1]);\r\n\t\t\t\t\tregion.u = x / page.width;\r\n\t\t\t\t\tregion.v = y / page.height;\r\n\t\t\t\t\tif (region.rotate) {\r\n\t\t\t\t\t\tregion.u2 = (x + height) / page.width;\r\n\t\t\t\t\t\tregion.v2 = (y + width) / page.height;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tregion.u2 = (x + width) / page.width;\r\n\t\t\t\t\t\tregion.v2 = (y + height) / page.height;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tregion.x = x;\r\n\t\t\t\t\tregion.y = y;\r\n\t\t\t\t\tregion.width = Math.abs(width);\r\n\t\t\t\t\tregion.height = Math.abs(height);\r\n\t\t\t\t\tif (reader.readTuple(tuple) == 4) {\r\n\t\t\t\t\t\tif (reader.readTuple(tuple) == 4) {\r\n\t\t\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tregion.originalWidth = parseInt(tuple[0]);\r\n\t\t\t\t\tregion.originalHeight = parseInt(tuple[1]);\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tregion.offsetX = parseInt(tuple[0]);\r\n\t\t\t\t\tregion.offsetY = parseInt(tuple[1]);\r\n\t\t\t\t\tregion.index = parseInt(reader.readValue());\r\n\t\t\t\t\tregion.texture = page.texture;\r\n\t\t\t\t\tthis.regions.push(region);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tTextureAtlas.prototype.findRegion = function (name) {\r\n\t\t\tfor (var i = 0; i < this.regions.length; i++) {\r\n\t\t\t\tif (this.regions[i].name == name) {\r\n\t\t\t\t\treturn this.regions[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tTextureAtlas.prototype.dispose = function () {\r\n\t\t\tfor (var i = 0; i < this.pages.length; i++) {\r\n\t\t\t\tthis.pages[i].texture.dispose();\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn TextureAtlas;\r\n\t}());\r\n\tspine.TextureAtlas = TextureAtlas;\r\n\tvar TextureAtlasReader = (function () {\r\n\t\tfunction TextureAtlasReader(text) {\r\n\t\t\tthis.index = 0;\r\n\t\t\tthis.lines = text.split(/\\r\\n|\\r|\\n/);\r\n\t\t}\r\n\t\tTextureAtlasReader.prototype.readLine = function () {\r\n\t\t\tif (this.index >= this.lines.length)\r\n\t\t\t\treturn null;\r\n\t\t\treturn this.lines[this.index++];\r\n\t\t};\r\n\t\tTextureAtlasReader.prototype.readValue = function () {\r\n\t\t\tvar line = this.readLine();\r\n\t\t\tvar colon = line.indexOf(\":\");\r\n\t\t\tif (colon == -1)\r\n\t\t\t\tthrow new Error(\"Invalid line: \" + line);\r\n\t\t\treturn line.substring(colon + 1).trim();\r\n\t\t};\r\n\t\tTextureAtlasReader.prototype.readTuple = function (tuple) {\r\n\t\t\tvar line = this.readLine();\r\n\t\t\tvar colon = line.indexOf(\":\");\r\n\t\t\tif (colon == -1)\r\n\t\t\t\tthrow new Error(\"Invalid line: \" + line);\r\n\t\t\tvar i = 0, lastMatch = colon + 1;\r\n\t\t\tfor (; i < 3; i++) {\r\n\t\t\t\tvar comma = line.indexOf(\",\", lastMatch);\r\n\t\t\t\tif (comma == -1)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\ttuple[i] = line.substr(lastMatch, comma - lastMatch).trim();\r\n\t\t\t\tlastMatch = comma + 1;\r\n\t\t\t}\r\n\t\t\ttuple[i] = line.substring(lastMatch).trim();\r\n\t\t\treturn i + 1;\r\n\t\t};\r\n\t\treturn TextureAtlasReader;\r\n\t}());\r\n\tvar TextureAtlasPage = (function () {\r\n\t\tfunction TextureAtlasPage() {\r\n\t\t}\r\n\t\treturn TextureAtlasPage;\r\n\t}());\r\n\tspine.TextureAtlasPage = TextureAtlasPage;\r\n\tvar TextureAtlasRegion = (function (_super) {\r\n\t\t__extends(TextureAtlasRegion, _super);\r\n\t\tfunction TextureAtlasRegion() {\r\n\t\t\treturn _super !== null && _super.apply(this, arguments) || this;\r\n\t\t}\r\n\t\treturn TextureAtlasRegion;\r\n\t}(spine.TextureRegion));\r\n\tspine.TextureAtlasRegion = TextureAtlasRegion;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar TransformConstraint = (function () {\r\n\t\tfunction TransformConstraint(data, skeleton) {\r\n\t\t\tthis.rotateMix = 0;\r\n\t\t\tthis.translateMix = 0;\r\n\t\t\tthis.scaleMix = 0;\r\n\t\t\tthis.shearMix = 0;\r\n\t\t\tthis.temp = new spine.Vector2();\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.rotateMix = data.rotateMix;\r\n\t\t\tthis.translateMix = data.translateMix;\r\n\t\t\tthis.scaleMix = data.scaleMix;\r\n\t\t\tthis.shearMix = data.shearMix;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0; i < data.bones.length; i++)\r\n\t\t\t\tthis.bones.push(skeleton.findBone(data.bones[i].name));\r\n\t\t\tthis.target = skeleton.findBone(data.target.name);\r\n\t\t}\r\n\t\tTransformConstraint.prototype.apply = function () {\r\n\t\t\tthis.update();\r\n\t\t};\r\n\t\tTransformConstraint.prototype.update = function () {\r\n\t\t\tif (this.data.local) {\r\n\t\t\t\tif (this.data.relative)\r\n\t\t\t\t\tthis.applyRelativeLocal();\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.applyAbsoluteLocal();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.data.relative)\r\n\t\t\t\t\tthis.applyRelativeWorld();\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.applyAbsoluteWorld();\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyAbsoluteWorld = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar ta = target.a, tb = target.b, tc = target.c, td = target.d;\r\n\t\t\tvar degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n\t\t\tvar offsetRotation = this.data.offsetRotation * degRadReflect;\r\n\t\t\tvar offsetShearY = this.data.offsetShearY * degRadReflect;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tvar modified = false;\r\n\t\t\t\tif (rotateMix != 0) {\r\n\t\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\t\t\tvar r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr *= rotateMix;\r\n\t\t\t\t\tvar cos = Math.cos(r), sin = Math.sin(r);\r\n\t\t\t\t\tbone.a = cos * a - sin * c;\r\n\t\t\t\t\tbone.b = cos * b - sin * d;\r\n\t\t\t\t\tbone.c = sin * a + cos * c;\r\n\t\t\t\t\tbone.d = sin * b + cos * d;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tvar temp = this.temp;\r\n\t\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n\t\t\t\t\tbone.worldX += (temp.x - bone.worldX) * translateMix;\r\n\t\t\t\t\tbone.worldY += (temp.y - bone.worldY) * translateMix;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (scaleMix > 0) {\r\n\t\t\t\t\tvar s = Math.sqrt(bone.a * bone.a + bone.c * bone.c);\r\n\t\t\t\t\tvar ts = Math.sqrt(ta * ta + tc * tc);\r\n\t\t\t\t\tif (s > 0.00001)\r\n\t\t\t\t\t\ts = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\r\n\t\t\t\t\tbone.a *= s;\r\n\t\t\t\t\tbone.c *= s;\r\n\t\t\t\t\ts = Math.sqrt(bone.b * bone.b + bone.d * bone.d);\r\n\t\t\t\t\tts = Math.sqrt(tb * tb + td * td);\r\n\t\t\t\t\tif (s > 0.00001)\r\n\t\t\t\t\t\ts = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\r\n\t\t\t\t\tbone.b *= s;\r\n\t\t\t\t\tbone.d *= s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (shearMix > 0) {\r\n\t\t\t\t\tvar b = bone.b, d = bone.d;\r\n\t\t\t\t\tvar by = Math.atan2(d, b);\r\n\t\t\t\t\tvar r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a));\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr = by + (r + offsetShearY) * shearMix;\r\n\t\t\t\t\tvar s = Math.sqrt(b * b + d * d);\r\n\t\t\t\t\tbone.b = Math.cos(r) * s;\r\n\t\t\t\t\tbone.d = Math.sin(r) * s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (modified)\r\n\t\t\t\t\tbone.appliedValid = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyRelativeWorld = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar ta = target.a, tb = target.b, tc = target.c, td = target.d;\r\n\t\t\tvar degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n\t\t\tvar offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tvar modified = false;\r\n\t\t\t\tif (rotateMix != 0) {\r\n\t\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\t\t\tvar r = Math.atan2(tc, ta) + offsetRotation;\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr *= rotateMix;\r\n\t\t\t\t\tvar cos = Math.cos(r), sin = Math.sin(r);\r\n\t\t\t\t\tbone.a = cos * a - sin * c;\r\n\t\t\t\t\tbone.b = cos * b - sin * d;\r\n\t\t\t\t\tbone.c = sin * a + cos * c;\r\n\t\t\t\t\tbone.d = sin * b + cos * d;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tvar temp = this.temp;\r\n\t\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n\t\t\t\t\tbone.worldX += temp.x * translateMix;\r\n\t\t\t\t\tbone.worldY += temp.y * translateMix;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (scaleMix > 0) {\r\n\t\t\t\t\tvar s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;\r\n\t\t\t\t\tbone.a *= s;\r\n\t\t\t\t\tbone.c *= s;\r\n\t\t\t\t\ts = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;\r\n\t\t\t\t\tbone.b *= s;\r\n\t\t\t\t\tbone.d *= s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (shearMix > 0) {\r\n\t\t\t\t\tvar r = Math.atan2(td, tb) - Math.atan2(tc, ta);\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tvar b = bone.b, d = bone.d;\r\n\t\t\t\t\tr = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix;\r\n\t\t\t\t\tvar s = Math.sqrt(b * b + d * d);\r\n\t\t\t\t\tbone.b = Math.cos(r) * s;\r\n\t\t\t\t\tbone.d = Math.sin(r) * s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (modified)\r\n\t\t\t\t\tbone.appliedValid = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyAbsoluteLocal = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tif (!target.appliedValid)\r\n\t\t\t\ttarget.updateAppliedTransform();\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (!bone.appliedValid)\r\n\t\t\t\t\tbone.updateAppliedTransform();\r\n\t\t\t\tvar rotation = bone.arotation;\r\n\t\t\t\tif (rotateMix != 0) {\r\n\t\t\t\t\tvar r = target.arotation - rotation + this.data.offsetRotation;\r\n\t\t\t\t\tr -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n\t\t\t\t\trotation += r * rotateMix;\r\n\t\t\t\t}\r\n\t\t\t\tvar x = bone.ax, y = bone.ay;\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tx += (target.ax - x + this.data.offsetX) * translateMix;\r\n\t\t\t\t\ty += (target.ay - y + this.data.offsetY) * translateMix;\r\n\t\t\t\t}\r\n\t\t\t\tvar scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n\t\t\t\tif (scaleMix != 0) {\r\n\t\t\t\t\tif (scaleX > 0.00001)\r\n\t\t\t\t\t\tscaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;\r\n\t\t\t\t\tif (scaleY > 0.00001)\r\n\t\t\t\t\t\tscaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;\r\n\t\t\t\t}\r\n\t\t\t\tvar shearY = bone.ashearY;\r\n\t\t\t\tif (shearMix != 0) {\r\n\t\t\t\t\tvar r = target.ashearY - shearY + this.data.offsetShearY;\r\n\t\t\t\t\tr -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n\t\t\t\t\tbone.shearY += r * shearMix;\r\n\t\t\t\t}\r\n\t\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyRelativeLocal = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tif (!target.appliedValid)\r\n\t\t\t\ttarget.updateAppliedTransform();\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (!bone.appliedValid)\r\n\t\t\t\t\tbone.updateAppliedTransform();\r\n\t\t\t\tvar rotation = bone.arotation;\r\n\t\t\t\tif (rotateMix != 0)\r\n\t\t\t\t\trotation += (target.arotation + this.data.offsetRotation) * rotateMix;\r\n\t\t\t\tvar x = bone.ax, y = bone.ay;\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tx += (target.ax + this.data.offsetX) * translateMix;\r\n\t\t\t\t\ty += (target.ay + this.data.offsetY) * translateMix;\r\n\t\t\t\t}\r\n\t\t\t\tvar scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n\t\t\t\tif (scaleMix != 0) {\r\n\t\t\t\t\tif (scaleX > 0.00001)\r\n\t\t\t\t\t\tscaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;\r\n\t\t\t\t\tif (scaleY > 0.00001)\r\n\t\t\t\t\t\tscaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;\r\n\t\t\t\t}\r\n\t\t\t\tvar shearY = bone.ashearY;\r\n\t\t\t\tif (shearMix != 0)\r\n\t\t\t\t\tshearY += (target.ashearY + this.data.offsetShearY) * shearMix;\r\n\t\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.getOrder = function () {\r\n\t\t\treturn this.data.order;\r\n\t\t};\r\n\t\treturn TransformConstraint;\r\n\t}());\r\n\tspine.TransformConstraint = TransformConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar TransformConstraintData = (function () {\r\n\t\tfunction TransformConstraintData(name) {\r\n\t\t\tthis.order = 0;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.rotateMix = 0;\r\n\t\t\tthis.translateMix = 0;\r\n\t\t\tthis.scaleMix = 0;\r\n\t\t\tthis.shearMix = 0;\r\n\t\t\tthis.offsetRotation = 0;\r\n\t\t\tthis.offsetX = 0;\r\n\t\t\tthis.offsetY = 0;\r\n\t\t\tthis.offsetScaleX = 0;\r\n\t\t\tthis.offsetScaleY = 0;\r\n\t\t\tthis.offsetShearY = 0;\r\n\t\t\tthis.relative = false;\r\n\t\t\tthis.local = false;\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn TransformConstraintData;\r\n\t}());\r\n\tspine.TransformConstraintData = TransformConstraintData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Triangulator = (function () {\r\n\t\tfunction Triangulator() {\r\n\t\t\tthis.convexPolygons = new Array();\r\n\t\t\tthis.convexPolygonsIndices = new Array();\r\n\t\t\tthis.indicesArray = new Array();\r\n\t\t\tthis.isConcaveArray = new Array();\r\n\t\t\tthis.triangles = new Array();\r\n\t\t\tthis.polygonPool = new spine.Pool(function () {\r\n\t\t\t\treturn new Array();\r\n\t\t\t});\r\n\t\t\tthis.polygonIndicesPool = new spine.Pool(function () {\r\n\t\t\t\treturn new Array();\r\n\t\t\t});\r\n\t\t}\r\n\t\tTriangulator.prototype.triangulate = function (verticesArray) {\r\n\t\t\tvar vertices = verticesArray;\r\n\t\t\tvar vertexCount = verticesArray.length >> 1;\r\n\t\t\tvar indices = this.indicesArray;\r\n\t\t\tindices.length = 0;\r\n\t\t\tfor (var i = 0; i < vertexCount; i++)\r\n\t\t\t\tindices[i] = i;\r\n\t\t\tvar isConcave = this.isConcaveArray;\r\n\t\t\tisConcave.length = 0;\r\n\t\t\tfor (var i = 0, n = vertexCount; i < n; ++i)\r\n\t\t\t\tisConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);\r\n\t\t\tvar triangles = this.triangles;\r\n\t\t\ttriangles.length = 0;\r\n\t\t\twhile (vertexCount > 3) {\r\n\t\t\t\tvar previous = vertexCount - 1, i = 0, next = 1;\r\n\t\t\t\twhile (true) {\r\n\t\t\t\t\touter: if (!isConcave[i]) {\r\n\t\t\t\t\t\tvar p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;\r\n\t\t\t\t\t\tvar p1x = vertices[p1], p1y = vertices[p1 + 1];\r\n\t\t\t\t\t\tvar p2x = vertices[p2], p2y = vertices[p2 + 1];\r\n\t\t\t\t\t\tvar p3x = vertices[p3], p3y = vertices[p3 + 1];\r\n\t\t\t\t\t\tfor (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {\r\n\t\t\t\t\t\t\tif (!isConcave[ii])\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tvar v = indices[ii] << 1;\r\n\t\t\t\t\t\t\tvar vx = vertices[v], vy = vertices[v + 1];\r\n\t\t\t\t\t\t\tif (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {\r\n\t\t\t\t\t\t\t\tif (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {\r\n\t\t\t\t\t\t\t\t\tif (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy))\r\n\t\t\t\t\t\t\t\t\t\tbreak outer;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (next == 0) {\r\n\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t\tif (!isConcave[i])\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\ti--;\r\n\t\t\t\t\t\t} while (i > 0);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tprevious = i;\r\n\t\t\t\t\ti = next;\r\n\t\t\t\t\tnext = (next + 1) % vertexCount;\r\n\t\t\t\t}\r\n\t\t\t\ttriangles.push(indices[(vertexCount + i - 1) % vertexCount]);\r\n\t\t\t\ttriangles.push(indices[i]);\r\n\t\t\t\ttriangles.push(indices[(i + 1) % vertexCount]);\r\n\t\t\t\tindices.splice(i, 1);\r\n\t\t\t\tisConcave.splice(i, 1);\r\n\t\t\t\tvertexCount--;\r\n\t\t\t\tvar previousIndex = (vertexCount + i - 1) % vertexCount;\r\n\t\t\t\tvar nextIndex = i == vertexCount ? 0 : i;\r\n\t\t\t\tisConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);\r\n\t\t\t\tisConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);\r\n\t\t\t}\r\n\t\t\tif (vertexCount == 3) {\r\n\t\t\t\ttriangles.push(indices[2]);\r\n\t\t\t\ttriangles.push(indices[0]);\r\n\t\t\t\ttriangles.push(indices[1]);\r\n\t\t\t}\r\n\t\t\treturn triangles;\r\n\t\t};\r\n\t\tTriangulator.prototype.decompose = function (verticesArray, triangles) {\r\n\t\t\tvar vertices = verticesArray;\r\n\t\t\tvar convexPolygons = this.convexPolygons;\r\n\t\t\tthis.polygonPool.freeAll(convexPolygons);\r\n\t\t\tconvexPolygons.length = 0;\r\n\t\t\tvar convexPolygonsIndices = this.convexPolygonsIndices;\r\n\t\t\tthis.polygonIndicesPool.freeAll(convexPolygonsIndices);\r\n\t\t\tconvexPolygonsIndices.length = 0;\r\n\t\t\tvar polygonIndices = this.polygonIndicesPool.obtain();\r\n\t\t\tpolygonIndices.length = 0;\r\n\t\t\tvar polygon = this.polygonPool.obtain();\r\n\t\t\tpolygon.length = 0;\r\n\t\t\tvar fanBaseIndex = -1, lastWinding = 0;\r\n\t\t\tfor (var i = 0, n = triangles.length; i < n; i += 3) {\r\n\t\t\t\tvar t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;\r\n\t\t\t\tvar x1 = vertices[t1], y1 = vertices[t1 + 1];\r\n\t\t\t\tvar x2 = vertices[t2], y2 = vertices[t2 + 1];\r\n\t\t\t\tvar x3 = vertices[t3], y3 = vertices[t3 + 1];\r\n\t\t\t\tvar merged = false;\r\n\t\t\t\tif (fanBaseIndex == t1) {\r\n\t\t\t\t\tvar o = polygon.length - 4;\r\n\t\t\t\t\tvar winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);\r\n\t\t\t\t\tvar winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);\r\n\t\t\t\t\tif (winding1 == lastWinding && winding2 == lastWinding) {\r\n\t\t\t\t\t\tpolygon.push(x3);\r\n\t\t\t\t\t\tpolygon.push(y3);\r\n\t\t\t\t\t\tpolygonIndices.push(t3);\r\n\t\t\t\t\t\tmerged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (!merged) {\r\n\t\t\t\t\tif (polygon.length > 0) {\r\n\t\t\t\t\t\tconvexPolygons.push(polygon);\r\n\t\t\t\t\t\tconvexPolygonsIndices.push(polygonIndices);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.polygonPool.free(polygon);\r\n\t\t\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpolygon = this.polygonPool.obtain();\r\n\t\t\t\t\tpolygon.length = 0;\r\n\t\t\t\t\tpolygon.push(x1);\r\n\t\t\t\t\tpolygon.push(y1);\r\n\t\t\t\t\tpolygon.push(x2);\r\n\t\t\t\t\tpolygon.push(y2);\r\n\t\t\t\t\tpolygon.push(x3);\r\n\t\t\t\t\tpolygon.push(y3);\r\n\t\t\t\t\tpolygonIndices = this.polygonIndicesPool.obtain();\r\n\t\t\t\t\tpolygonIndices.length = 0;\r\n\t\t\t\t\tpolygonIndices.push(t1);\r\n\t\t\t\t\tpolygonIndices.push(t2);\r\n\t\t\t\t\tpolygonIndices.push(t3);\r\n\t\t\t\t\tlastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);\r\n\t\t\t\t\tfanBaseIndex = t1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (polygon.length > 0) {\r\n\t\t\t\tconvexPolygons.push(polygon);\r\n\t\t\t\tconvexPolygonsIndices.push(polygonIndices);\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = convexPolygons.length; i < n; i++) {\r\n\t\t\t\tpolygonIndices = convexPolygonsIndices[i];\r\n\t\t\t\tif (polygonIndices.length == 0)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tvar firstIndex = polygonIndices[0];\r\n\t\t\t\tvar lastIndex = polygonIndices[polygonIndices.length - 1];\r\n\t\t\t\tpolygon = convexPolygons[i];\r\n\t\t\t\tvar o = polygon.length - 4;\r\n\t\t\t\tvar prevPrevX = polygon[o], prevPrevY = polygon[o + 1];\r\n\t\t\t\tvar prevX = polygon[o + 2], prevY = polygon[o + 3];\r\n\t\t\t\tvar firstX = polygon[0], firstY = polygon[1];\r\n\t\t\t\tvar secondX = polygon[2], secondY = polygon[3];\r\n\t\t\t\tvar winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);\r\n\t\t\t\tfor (var ii = 0; ii < n; ii++) {\r\n\t\t\t\t\tif (ii == i)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tvar otherIndices = convexPolygonsIndices[ii];\r\n\t\t\t\t\tif (otherIndices.length != 3)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tvar otherFirstIndex = otherIndices[0];\r\n\t\t\t\t\tvar otherSecondIndex = otherIndices[1];\r\n\t\t\t\t\tvar otherLastIndex = otherIndices[2];\r\n\t\t\t\t\tvar otherPoly = convexPolygons[ii];\r\n\t\t\t\t\tvar x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];\r\n\t\t\t\t\tif (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tvar winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);\r\n\t\t\t\t\tvar winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);\r\n\t\t\t\t\tif (winding1 == winding && winding2 == winding) {\r\n\t\t\t\t\t\totherPoly.length = 0;\r\n\t\t\t\t\t\totherIndices.length = 0;\r\n\t\t\t\t\t\tpolygon.push(x3);\r\n\t\t\t\t\t\tpolygon.push(y3);\r\n\t\t\t\t\t\tpolygonIndices.push(otherLastIndex);\r\n\t\t\t\t\t\tprevPrevX = prevX;\r\n\t\t\t\t\t\tprevPrevY = prevY;\r\n\t\t\t\t\t\tprevX = x3;\r\n\t\t\t\t\t\tprevY = y3;\r\n\t\t\t\t\t\tii = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var i = convexPolygons.length - 1; i >= 0; i--) {\r\n\t\t\t\tpolygon = convexPolygons[i];\r\n\t\t\t\tif (polygon.length == 0) {\r\n\t\t\t\t\tconvexPolygons.splice(i, 1);\r\n\t\t\t\t\tthis.polygonPool.free(polygon);\r\n\t\t\t\t\tpolygonIndices = convexPolygonsIndices[i];\r\n\t\t\t\t\tconvexPolygonsIndices.splice(i, 1);\r\n\t\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn convexPolygons;\r\n\t\t};\r\n\t\tTriangulator.isConcave = function (index, vertexCount, vertices, indices) {\r\n\t\t\tvar previous = indices[(vertexCount + index - 1) % vertexCount] << 1;\r\n\t\t\tvar current = indices[index] << 1;\r\n\t\t\tvar next = indices[(index + 1) % vertexCount] << 1;\r\n\t\t\treturn !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]);\r\n\t\t};\r\n\t\tTriangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) {\r\n\t\t\treturn p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;\r\n\t\t};\r\n\t\tTriangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) {\r\n\t\t\tvar px = p2x - p1x, py = p2y - p1y;\r\n\t\t\treturn p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;\r\n\t\t};\r\n\t\treturn Triangulator;\r\n\t}());\r\n\tspine.Triangulator = Triangulator;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar IntSet = (function () {\r\n\t\tfunction IntSet() {\r\n\t\t\tthis.array = new Array();\r\n\t\t}\r\n\t\tIntSet.prototype.add = function (value) {\r\n\t\t\tvar contains = this.contains(value);\r\n\t\t\tthis.array[value | 0] = value | 0;\r\n\t\t\treturn !contains;\r\n\t\t};\r\n\t\tIntSet.prototype.contains = function (value) {\r\n\t\t\treturn this.array[value | 0] != undefined;\r\n\t\t};\r\n\t\tIntSet.prototype.remove = function (value) {\r\n\t\t\tthis.array[value | 0] = undefined;\r\n\t\t};\r\n\t\tIntSet.prototype.clear = function () {\r\n\t\t\tthis.array.length = 0;\r\n\t\t};\r\n\t\treturn IntSet;\r\n\t}());\r\n\tspine.IntSet = IntSet;\r\n\tvar Color = (function () {\r\n\t\tfunction Color(r, g, b, a) {\r\n\t\t\tif (r === void 0) { r = 0; }\r\n\t\t\tif (g === void 0) { g = 0; }\r\n\t\t\tif (b === void 0) { b = 0; }\r\n\t\t\tif (a === void 0) { a = 0; }\r\n\t\t\tthis.r = r;\r\n\t\t\tthis.g = g;\r\n\t\t\tthis.b = b;\r\n\t\t\tthis.a = a;\r\n\t\t}\r\n\t\tColor.prototype.set = function (r, g, b, a) {\r\n\t\t\tthis.r = r;\r\n\t\t\tthis.g = g;\r\n\t\t\tthis.b = b;\r\n\t\t\tthis.a = a;\r\n\t\t\tthis.clamp();\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.setFromColor = function (c) {\r\n\t\t\tthis.r = c.r;\r\n\t\t\tthis.g = c.g;\r\n\t\t\tthis.b = c.b;\r\n\t\t\tthis.a = c.a;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.setFromString = function (hex) {\r\n\t\t\thex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\r\n\t\t\tthis.r = parseInt(hex.substr(0, 2), 16) / 255.0;\r\n\t\t\tthis.g = parseInt(hex.substr(2, 2), 16) / 255.0;\r\n\t\t\tthis.b = parseInt(hex.substr(4, 2), 16) / 255.0;\r\n\t\t\tthis.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.add = function (r, g, b, a) {\r\n\t\t\tthis.r += r;\r\n\t\t\tthis.g += g;\r\n\t\t\tthis.b += b;\r\n\t\t\tthis.a += a;\r\n\t\t\tthis.clamp();\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.clamp = function () {\r\n\t\t\tif (this.r < 0)\r\n\t\t\t\tthis.r = 0;\r\n\t\t\telse if (this.r > 1)\r\n\t\t\t\tthis.r = 1;\r\n\t\t\tif (this.g < 0)\r\n\t\t\t\tthis.g = 0;\r\n\t\t\telse if (this.g > 1)\r\n\t\t\t\tthis.g = 1;\r\n\t\t\tif (this.b < 0)\r\n\t\t\t\tthis.b = 0;\r\n\t\t\telse if (this.b > 1)\r\n\t\t\t\tthis.b = 1;\r\n\t\t\tif (this.a < 0)\r\n\t\t\t\tthis.a = 0;\r\n\t\t\telse if (this.a > 1)\r\n\t\t\t\tthis.a = 1;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.WHITE = new Color(1, 1, 1, 1);\r\n\t\tColor.RED = new Color(1, 0, 0, 1);\r\n\t\tColor.GREEN = new Color(0, 1, 0, 1);\r\n\t\tColor.BLUE = new Color(0, 0, 1, 1);\r\n\t\tColor.MAGENTA = new Color(1, 0, 1, 1);\r\n\t\treturn Color;\r\n\t}());\r\n\tspine.Color = Color;\r\n\tvar MathUtils = (function () {\r\n\t\tfunction MathUtils() {\r\n\t\t}\r\n\t\tMathUtils.clamp = function (value, min, max) {\r\n\t\t\tif (value < min)\r\n\t\t\t\treturn min;\r\n\t\t\tif (value > max)\r\n\t\t\t\treturn max;\r\n\t\t\treturn value;\r\n\t\t};\r\n\t\tMathUtils.cosDeg = function (degrees) {\r\n\t\t\treturn Math.cos(degrees * MathUtils.degRad);\r\n\t\t};\r\n\t\tMathUtils.sinDeg = function (degrees) {\r\n\t\t\treturn Math.sin(degrees * MathUtils.degRad);\r\n\t\t};\r\n\t\tMathUtils.signum = function (value) {\r\n\t\t\treturn value > 0 ? 1 : value < 0 ? -1 : 0;\r\n\t\t};\r\n\t\tMathUtils.toInt = function (x) {\r\n\t\t\treturn x > 0 ? Math.floor(x) : Math.ceil(x);\r\n\t\t};\r\n\t\tMathUtils.cbrt = function (x) {\r\n\t\t\tvar y = Math.pow(Math.abs(x), 1 / 3);\r\n\t\t\treturn x < 0 ? -y : y;\r\n\t\t};\r\n\t\tMathUtils.randomTriangular = function (min, max) {\r\n\t\t\treturn MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\r\n\t\t};\r\n\t\tMathUtils.randomTriangularWith = function (min, max, mode) {\r\n\t\t\tvar u = Math.random();\r\n\t\t\tvar d = max - min;\r\n\t\t\tif (u <= (mode - min) / d)\r\n\t\t\t\treturn min + Math.sqrt(u * d * (mode - min));\r\n\t\t\treturn max - Math.sqrt((1 - u) * d * (max - mode));\r\n\t\t};\r\n\t\tMathUtils.PI = 3.1415927;\r\n\t\tMathUtils.PI2 = MathUtils.PI * 2;\r\n\t\tMathUtils.radiansToDegrees = 180 / MathUtils.PI;\r\n\t\tMathUtils.radDeg = MathUtils.radiansToDegrees;\r\n\t\tMathUtils.degreesToRadians = MathUtils.PI / 180;\r\n\t\tMathUtils.degRad = MathUtils.degreesToRadians;\r\n\t\treturn MathUtils;\r\n\t}());\r\n\tspine.MathUtils = MathUtils;\r\n\tvar Interpolation = (function () {\r\n\t\tfunction Interpolation() {\r\n\t\t}\r\n\t\tInterpolation.prototype.apply = function (start, end, a) {\r\n\t\t\treturn start + (end - start) * this.applyInternal(a);\r\n\t\t};\r\n\t\treturn Interpolation;\r\n\t}());\r\n\tspine.Interpolation = Interpolation;\r\n\tvar Pow = (function (_super) {\r\n\t\t__extends(Pow, _super);\r\n\t\tfunction Pow(power) {\r\n\t\t\tvar _this = _super.call(this) || this;\r\n\t\t\t_this.power = 2;\r\n\t\t\t_this.power = power;\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPow.prototype.applyInternal = function (a) {\r\n\t\t\tif (a <= 0.5)\r\n\t\t\t\treturn Math.pow(a * 2, this.power) / 2;\r\n\t\t\treturn Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;\r\n\t\t};\r\n\t\treturn Pow;\r\n\t}(Interpolation));\r\n\tspine.Pow = Pow;\r\n\tvar PowOut = (function (_super) {\r\n\t\t__extends(PowOut, _super);\r\n\t\tfunction PowOut(power) {\r\n\t\t\treturn _super.call(this, power) || this;\r\n\t\t}\r\n\t\tPowOut.prototype.applyInternal = function (a) {\r\n\t\t\treturn Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;\r\n\t\t};\r\n\t\treturn PowOut;\r\n\t}(Pow));\r\n\tspine.PowOut = PowOut;\r\n\tvar Utils = (function () {\r\n\t\tfunction Utils() {\r\n\t\t}\r\n\t\tUtils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) {\r\n\t\t\tfor (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\r\n\t\t\t\tdest[j] = source[i];\r\n\t\t\t}\r\n\t\t};\r\n\t\tUtils.setArraySize = function (array, size, value) {\r\n\t\t\tif (value === void 0) { value = 0; }\r\n\t\t\tvar oldSize = array.length;\r\n\t\t\tif (oldSize == size)\r\n\t\t\t\treturn array;\r\n\t\t\tarray.length = size;\r\n\t\t\tif (oldSize < size) {\r\n\t\t\t\tfor (var i = oldSize; i < size; i++)\r\n\t\t\t\t\tarray[i] = value;\r\n\t\t\t}\r\n\t\t\treturn array;\r\n\t\t};\r\n\t\tUtils.ensureArrayCapacity = function (array, size, value) {\r\n\t\t\tif (value === void 0) { value = 0; }\r\n\t\t\tif (array.length >= size)\r\n\t\t\t\treturn array;\r\n\t\t\treturn Utils.setArraySize(array, size, value);\r\n\t\t};\r\n\t\tUtils.newArray = function (size, defaultValue) {\r\n\t\t\tvar array = new Array(size);\r\n\t\t\tfor (var i = 0; i < size; i++)\r\n\t\t\t\tarray[i] = defaultValue;\r\n\t\t\treturn array;\r\n\t\t};\r\n\t\tUtils.newFloatArray = function (size) {\r\n\t\t\tif (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n\t\t\t\treturn new Float32Array(size);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar array = new Array(size);\r\n\t\t\t\tfor (var i = 0; i < array.length; i++)\r\n\t\t\t\t\tarray[i] = 0;\r\n\t\t\t\treturn array;\r\n\t\t\t}\r\n\t\t};\r\n\t\tUtils.newShortArray = function (size) {\r\n\t\t\tif (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n\t\t\t\treturn new Int16Array(size);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar array = new Array(size);\r\n\t\t\t\tfor (var i = 0; i < array.length; i++)\r\n\t\t\t\t\tarray[i] = 0;\r\n\t\t\t\treturn array;\r\n\t\t\t}\r\n\t\t};\r\n\t\tUtils.toFloatArray = function (array) {\r\n\t\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\r\n\t\t};\r\n\t\tUtils.toSinglePrecision = function (value) {\r\n\t\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;\r\n\t\t};\r\n\t\tUtils.webkit602BugfixHelper = function (alpha, blend) {\r\n\t\t};\r\n\t\tUtils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\r\n\t\treturn Utils;\r\n\t}());\r\n\tspine.Utils = Utils;\r\n\tvar DebugUtils = (function () {\r\n\t\tfunction DebugUtils() {\r\n\t\t}\r\n\t\tDebugUtils.logBones = function (skeleton) {\r\n\t\t\tfor (var i = 0; i < skeleton.bones.length; i++) {\r\n\t\t\t\tvar bone = skeleton.bones[i];\r\n\t\t\t\tconsole.log(bone.data.name + \", \" + bone.a + \", \" + bone.b + \", \" + bone.c + \", \" + bone.d + \", \" + bone.worldX + \", \" + bone.worldY);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn DebugUtils;\r\n\t}());\r\n\tspine.DebugUtils = DebugUtils;\r\n\tvar Pool = (function () {\r\n\t\tfunction Pool(instantiator) {\r\n\t\t\tthis.items = new Array();\r\n\t\t\tthis.instantiator = instantiator;\r\n\t\t}\r\n\t\tPool.prototype.obtain = function () {\r\n\t\t\treturn this.items.length > 0 ? this.items.pop() : this.instantiator();\r\n\t\t};\r\n\t\tPool.prototype.free = function (item) {\r\n\t\t\tif (item.reset)\r\n\t\t\t\titem.reset();\r\n\t\t\tthis.items.push(item);\r\n\t\t};\r\n\t\tPool.prototype.freeAll = function (items) {\r\n\t\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\t\tif (items[i].reset)\r\n\t\t\t\t\titems[i].reset();\r\n\t\t\t\tthis.items[i] = items[i];\r\n\t\t\t}\r\n\t\t};\r\n\t\tPool.prototype.clear = function () {\r\n\t\t\tthis.items.length = 0;\r\n\t\t};\r\n\t\treturn Pool;\r\n\t}());\r\n\tspine.Pool = Pool;\r\n\tvar Vector2 = (function () {\r\n\t\tfunction Vector2(x, y) {\r\n\t\t\tif (x === void 0) { x = 0; }\r\n\t\t\tif (y === void 0) { y = 0; }\r\n\t\t\tthis.x = x;\r\n\t\t\tthis.y = y;\r\n\t\t}\r\n\t\tVector2.prototype.set = function (x, y) {\r\n\t\t\tthis.x = x;\r\n\t\t\tthis.y = y;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tVector2.prototype.length = function () {\r\n\t\t\tvar x = this.x;\r\n\t\t\tvar y = this.y;\r\n\t\t\treturn Math.sqrt(x * x + y * y);\r\n\t\t};\r\n\t\tVector2.prototype.normalize = function () {\r\n\t\t\tvar len = this.length();\r\n\t\t\tif (len != 0) {\r\n\t\t\t\tthis.x /= len;\r\n\t\t\t\tthis.y /= len;\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\treturn Vector2;\r\n\t}());\r\n\tspine.Vector2 = Vector2;\r\n\tvar TimeKeeper = (function () {\r\n\t\tfunction TimeKeeper() {\r\n\t\t\tthis.maxDelta = 0.064;\r\n\t\t\tthis.framesPerSecond = 0;\r\n\t\t\tthis.delta = 0;\r\n\t\t\tthis.totalTime = 0;\r\n\t\t\tthis.lastTime = Date.now() / 1000;\r\n\t\t\tthis.frameCount = 0;\r\n\t\t\tthis.frameTime = 0;\r\n\t\t}\r\n\t\tTimeKeeper.prototype.update = function () {\r\n\t\t\tvar now = Date.now() / 1000;\r\n\t\t\tthis.delta = now - this.lastTime;\r\n\t\t\tthis.frameTime += this.delta;\r\n\t\t\tthis.totalTime += this.delta;\r\n\t\t\tif (this.delta > this.maxDelta)\r\n\t\t\t\tthis.delta = this.maxDelta;\r\n\t\t\tthis.lastTime = now;\r\n\t\t\tthis.frameCount++;\r\n\t\t\tif (this.frameTime > 1) {\r\n\t\t\t\tthis.framesPerSecond = this.frameCount / this.frameTime;\r\n\t\t\t\tthis.frameTime = 0;\r\n\t\t\t\tthis.frameCount = 0;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn TimeKeeper;\r\n\t}());\r\n\tspine.TimeKeeper = TimeKeeper;\r\n\tvar WindowedMean = (function () {\r\n\t\tfunction WindowedMean(windowSize) {\r\n\t\t\tif (windowSize === void 0) { windowSize = 32; }\r\n\t\t\tthis.addedValues = 0;\r\n\t\t\tthis.lastValue = 0;\r\n\t\t\tthis.mean = 0;\r\n\t\t\tthis.dirty = true;\r\n\t\t\tthis.values = new Array(windowSize);\r\n\t\t}\r\n\t\tWindowedMean.prototype.hasEnoughData = function () {\r\n\t\t\treturn this.addedValues >= this.values.length;\r\n\t\t};\r\n\t\tWindowedMean.prototype.addValue = function (value) {\r\n\t\t\tif (this.addedValues < this.values.length)\r\n\t\t\t\tthis.addedValues++;\r\n\t\t\tthis.values[this.lastValue++] = value;\r\n\t\t\tif (this.lastValue > this.values.length - 1)\r\n\t\t\t\tthis.lastValue = 0;\r\n\t\t\tthis.dirty = true;\r\n\t\t};\r\n\t\tWindowedMean.prototype.getMean = function () {\r\n\t\t\tif (this.hasEnoughData()) {\r\n\t\t\t\tif (this.dirty) {\r\n\t\t\t\t\tvar mean = 0;\r\n\t\t\t\t\tfor (var i = 0; i < this.values.length; i++) {\r\n\t\t\t\t\t\tmean += this.values[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.mean = mean / this.values.length;\r\n\t\t\t\t\tthis.dirty = false;\r\n\t\t\t\t}\r\n\t\t\t\treturn this.mean;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn WindowedMean;\r\n\t}());\r\n\tspine.WindowedMean = WindowedMean;\r\n})(spine || (spine = {}));\r\n(function () {\r\n\tif (!Math.fround) {\r\n\t\tMath.fround = (function (array) {\r\n\t\t\treturn function (x) {\r\n\t\t\t\treturn array[0] = x, array[0];\r\n\t\t\t};\r\n\t\t})(new Float32Array(1));\r\n\t}\r\n})();\r\nvar spine;\r\n(function (spine) {\r\n\tvar Attachment = (function () {\r\n\t\tfunction Attachment(name) {\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn Attachment;\r\n\t}());\r\n\tspine.Attachment = Attachment;\r\n\tvar VertexAttachment = (function (_super) {\r\n\t\t__extends(VertexAttachment, _super);\r\n\t\tfunction VertexAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.id = (VertexAttachment.nextID++ & 65535) << 11;\r\n\t\t\t_this.worldVerticesLength = 0;\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tVertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n\t\t\tcount = offset + (count >> 1) * stride;\r\n\t\t\tvar skeleton = slot.bone.skeleton;\r\n\t\t\tvar deformArray = slot.attachmentVertices;\r\n\t\t\tvar vertices = this.vertices;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tif (bones == null) {\r\n\t\t\t\tif (deformArray.length > 0)\r\n\t\t\t\t\tvertices = deformArray;\r\n\t\t\t\tvar bone = slot.bone;\r\n\t\t\t\tvar x = bone.worldX;\r\n\t\t\t\tvar y = bone.worldY;\r\n\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\t\tfor (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\r\n\t\t\t\t\tvar vx = vertices[v_1], vy = vertices[v_1 + 1];\r\n\t\t\t\t\tworldVertices[w] = vx * a + vy * b + x;\r\n\t\t\t\t\tworldVertices[w + 1] = vx * c + vy * d + y;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar v = 0, skip = 0;\r\n\t\t\tfor (var i = 0; i < start; i += 2) {\r\n\t\t\t\tvar n = bones[v];\r\n\t\t\t\tv += n + 1;\r\n\t\t\t\tskip += n;\r\n\t\t\t}\r\n\t\t\tvar skeletonBones = skeleton.bones;\r\n\t\t\tif (deformArray.length == 0) {\r\n\t\t\t\tfor (var w = offset, b = skip * 3; w < count; w += stride) {\r\n\t\t\t\t\tvar wx = 0, wy = 0;\r\n\t\t\t\t\tvar n = bones[v++];\r\n\t\t\t\t\tn += v;\r\n\t\t\t\t\tfor (; v < n; v++, b += 3) {\r\n\t\t\t\t\t\tvar bone = skeletonBones[bones[v]];\r\n\t\t\t\t\t\tvar vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n\t\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\r\n\t\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tworldVertices[w] = wx;\r\n\t\t\t\t\tworldVertices[w + 1] = wy;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar deform = deformArray;\r\n\t\t\t\tfor (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\r\n\t\t\t\t\tvar wx = 0, wy = 0;\r\n\t\t\t\t\tvar n = bones[v++];\r\n\t\t\t\t\tn += v;\r\n\t\t\t\t\tfor (; v < n; v++, b += 3, f += 2) {\r\n\t\t\t\t\t\tvar bone = skeletonBones[bones[v]];\r\n\t\t\t\t\t\tvar vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n\t\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\r\n\t\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tworldVertices[w] = wx;\r\n\t\t\t\t\tworldVertices[w + 1] = wy;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tVertexAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n\t\t\treturn this == sourceAttachment;\r\n\t\t};\r\n\t\tVertexAttachment.nextID = 0;\r\n\t\treturn VertexAttachment;\r\n\t}(Attachment));\r\n\tspine.VertexAttachment = VertexAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AttachmentType;\r\n\t(function (AttachmentType) {\r\n\t\tAttachmentType[AttachmentType[\"Region\"] = 0] = \"Region\";\r\n\t\tAttachmentType[AttachmentType[\"BoundingBox\"] = 1] = \"BoundingBox\";\r\n\t\tAttachmentType[AttachmentType[\"Mesh\"] = 2] = \"Mesh\";\r\n\t\tAttachmentType[AttachmentType[\"LinkedMesh\"] = 3] = \"LinkedMesh\";\r\n\t\tAttachmentType[AttachmentType[\"Path\"] = 4] = \"Path\";\r\n\t\tAttachmentType[AttachmentType[\"Point\"] = 5] = \"Point\";\r\n\t})(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar BoundingBoxAttachment = (function (_super) {\r\n\t\t__extends(BoundingBoxAttachment, _super);\r\n\t\tfunction BoundingBoxAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\treturn BoundingBoxAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.BoundingBoxAttachment = BoundingBoxAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar ClippingAttachment = (function (_super) {\r\n\t\t__extends(ClippingAttachment, _super);\r\n\t\tfunction ClippingAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\treturn ClippingAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.ClippingAttachment = ClippingAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar MeshAttachment = (function (_super) {\r\n\t\t__extends(MeshAttachment, _super);\r\n\t\tfunction MeshAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\t_this.inheritDeform = false;\r\n\t\t\t_this.tempColor = new spine.Color(0, 0, 0, 0);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tMeshAttachment.prototype.updateUVs = function () {\r\n\t\t\tvar regionUVs = this.regionUVs;\r\n\t\t\tif (this.uvs == null || this.uvs.length != regionUVs.length)\r\n\t\t\t\tthis.uvs = spine.Utils.newFloatArray(regionUVs.length);\r\n\t\t\tvar uvs = this.uvs;\r\n\t\t\tvar u = 0, v = 0, width = 0, height = 0;\r\n\t\t\tif (this.region instanceof spine.TextureAtlasRegion) {\r\n\t\t\t\tvar region = this.region;\r\n\t\t\t\tvar textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height;\r\n\t\t\t\tif (region.rotate) {\r\n\t\t\t\t\tu = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth;\r\n\t\t\t\t\tv = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight;\r\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\r\n\t\t\t\t\theight = region.originalWidth / textureHeight;\r\n\t\t\t\t\tfor (var i = 0, n = uvs.length; i < n; i += 2) {\r\n\t\t\t\t\t\tuvs[i] = u + regionUVs[i + 1] * width;\r\n\t\t\t\t\t\tuvs[i + 1] = v + height - regionUVs[i] * height;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tu = region.u - region.offsetX / textureWidth;\r\n\t\t\t\tv = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight;\r\n\t\t\t\twidth = region.originalWidth / textureWidth;\r\n\t\t\t\theight = region.originalHeight / textureHeight;\r\n\t\t\t}\r\n\t\t\telse if (this.region == null) {\r\n\t\t\t\tu = v = 0;\r\n\t\t\t\twidth = height = 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tu = this.region.u;\r\n\t\t\t\tv = this.region.v;\r\n\t\t\t\twidth = this.region.u2 - u;\r\n\t\t\t\theight = this.region.v2 - v;\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = uvs.length; i < n; i += 2) {\r\n\t\t\t\tuvs[i] = u + regionUVs[i] * width;\r\n\t\t\t\tuvs[i + 1] = v + regionUVs[i + 1] * height;\r\n\t\t\t}\r\n\t\t};\r\n\t\tMeshAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n\t\t\treturn this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);\r\n\t\t};\r\n\t\tMeshAttachment.prototype.getParentMesh = function () {\r\n\t\t\treturn this.parentMesh;\r\n\t\t};\r\n\t\tMeshAttachment.prototype.setParentMesh = function (parentMesh) {\r\n\t\t\tthis.parentMesh = parentMesh;\r\n\t\t\tif (parentMesh != null) {\r\n\t\t\t\tthis.bones = parentMesh.bones;\r\n\t\t\t\tthis.vertices = parentMesh.vertices;\r\n\t\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength;\r\n\t\t\t\tthis.regionUVs = parentMesh.regionUVs;\r\n\t\t\t\tthis.triangles = parentMesh.triangles;\r\n\t\t\t\tthis.hullLength = parentMesh.hullLength;\r\n\t\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn MeshAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.MeshAttachment = MeshAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PathAttachment = (function (_super) {\r\n\t\t__extends(PathAttachment, _super);\r\n\t\tfunction PathAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.closed = false;\r\n\t\t\t_this.constantSpeed = false;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\treturn PathAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.PathAttachment = PathAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PointAttachment = (function (_super) {\r\n\t\t__extends(PointAttachment, _super);\r\n\t\tfunction PointAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(0.38, 0.94, 0, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPointAttachment.prototype.computeWorldPosition = function (bone, point) {\r\n\t\t\tpoint.x = this.x * bone.a + this.y * bone.b + bone.worldX;\r\n\t\t\tpoint.y = this.x * bone.c + this.y * bone.d + bone.worldY;\r\n\t\t\treturn point;\r\n\t\t};\r\n\t\tPointAttachment.prototype.computeWorldRotation = function (bone) {\r\n\t\t\tvar cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation);\r\n\t\t\tvar x = cos * bone.a + sin * bone.b;\r\n\t\t\tvar y = cos * bone.c + sin * bone.d;\r\n\t\t\treturn Math.atan2(y, x) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\treturn PointAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.PointAttachment = PointAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar RegionAttachment = (function (_super) {\r\n\t\t__extends(RegionAttachment, _super);\r\n\t\tfunction RegionAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.x = 0;\r\n\t\t\t_this.y = 0;\r\n\t\t\t_this.scaleX = 1;\r\n\t\t\t_this.scaleY = 1;\r\n\t\t\t_this.rotation = 0;\r\n\t\t\t_this.width = 0;\r\n\t\t\t_this.height = 0;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\t_this.offset = spine.Utils.newFloatArray(8);\r\n\t\t\t_this.uvs = spine.Utils.newFloatArray(8);\r\n\t\t\t_this.tempColor = new spine.Color(1, 1, 1, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tRegionAttachment.prototype.updateOffset = function () {\r\n\t\t\tvar regionScaleX = this.width / this.region.originalWidth * this.scaleX;\r\n\t\t\tvar regionScaleY = this.height / this.region.originalHeight * this.scaleY;\r\n\t\t\tvar localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\r\n\t\t\tvar localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\r\n\t\t\tvar localX2 = localX + this.region.width * regionScaleX;\r\n\t\t\tvar localY2 = localY + this.region.height * regionScaleY;\r\n\t\t\tvar radians = this.rotation * Math.PI / 180;\r\n\t\t\tvar cos = Math.cos(radians);\r\n\t\t\tvar sin = Math.sin(radians);\r\n\t\t\tvar localXCos = localX * cos + this.x;\r\n\t\t\tvar localXSin = localX * sin;\r\n\t\t\tvar localYCos = localY * cos + this.y;\r\n\t\t\tvar localYSin = localY * sin;\r\n\t\t\tvar localX2Cos = localX2 * cos + this.x;\r\n\t\t\tvar localX2Sin = localX2 * sin;\r\n\t\t\tvar localY2Cos = localY2 * cos + this.y;\r\n\t\t\tvar localY2Sin = localY2 * sin;\r\n\t\t\tvar offset = this.offset;\r\n\t\t\toffset[RegionAttachment.OX1] = localXCos - localYSin;\r\n\t\t\toffset[RegionAttachment.OY1] = localYCos + localXSin;\r\n\t\t\toffset[RegionAttachment.OX2] = localXCos - localY2Sin;\r\n\t\t\toffset[RegionAttachment.OY2] = localY2Cos + localXSin;\r\n\t\t\toffset[RegionAttachment.OX3] = localX2Cos - localY2Sin;\r\n\t\t\toffset[RegionAttachment.OY3] = localY2Cos + localX2Sin;\r\n\t\t\toffset[RegionAttachment.OX4] = localX2Cos - localYSin;\r\n\t\t\toffset[RegionAttachment.OY4] = localYCos + localX2Sin;\r\n\t\t};\r\n\t\tRegionAttachment.prototype.setRegion = function (region) {\r\n\t\t\tthis.region = region;\r\n\t\t\tvar uvs = this.uvs;\r\n\t\t\tif (region.rotate) {\r\n\t\t\t\tuvs[2] = region.u;\r\n\t\t\t\tuvs[3] = region.v2;\r\n\t\t\t\tuvs[4] = region.u;\r\n\t\t\t\tuvs[5] = region.v;\r\n\t\t\t\tuvs[6] = region.u2;\r\n\t\t\t\tuvs[7] = region.v;\r\n\t\t\t\tuvs[0] = region.u2;\r\n\t\t\t\tuvs[1] = region.v2;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tuvs[0] = region.u;\r\n\t\t\t\tuvs[1] = region.v2;\r\n\t\t\t\tuvs[2] = region.u;\r\n\t\t\t\tuvs[3] = region.v;\r\n\t\t\t\tuvs[4] = region.u2;\r\n\t\t\t\tuvs[5] = region.v;\r\n\t\t\t\tuvs[6] = region.u2;\r\n\t\t\t\tuvs[7] = region.v2;\r\n\t\t\t}\r\n\t\t};\r\n\t\tRegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {\r\n\t\t\tvar vertexOffset = this.offset;\r\n\t\t\tvar x = bone.worldX, y = bone.worldY;\r\n\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\tvar offsetX = 0, offsetY = 0;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX1];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY1];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t\toffset += stride;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX2];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY2];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t\toffset += stride;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX3];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY3];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t\toffset += stride;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX4];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY4];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t};\r\n\t\tRegionAttachment.OX1 = 0;\r\n\t\tRegionAttachment.OY1 = 1;\r\n\t\tRegionAttachment.OX2 = 2;\r\n\t\tRegionAttachment.OY2 = 3;\r\n\t\tRegionAttachment.OX3 = 4;\r\n\t\tRegionAttachment.OY3 = 5;\r\n\t\tRegionAttachment.OX4 = 6;\r\n\t\tRegionAttachment.OY4 = 7;\r\n\t\tRegionAttachment.X1 = 0;\r\n\t\tRegionAttachment.Y1 = 1;\r\n\t\tRegionAttachment.C1R = 2;\r\n\t\tRegionAttachment.C1G = 3;\r\n\t\tRegionAttachment.C1B = 4;\r\n\t\tRegionAttachment.C1A = 5;\r\n\t\tRegionAttachment.U1 = 6;\r\n\t\tRegionAttachment.V1 = 7;\r\n\t\tRegionAttachment.X2 = 8;\r\n\t\tRegionAttachment.Y2 = 9;\r\n\t\tRegionAttachment.C2R = 10;\r\n\t\tRegionAttachment.C2G = 11;\r\n\t\tRegionAttachment.C2B = 12;\r\n\t\tRegionAttachment.C2A = 13;\r\n\t\tRegionAttachment.U2 = 14;\r\n\t\tRegionAttachment.V2 = 15;\r\n\t\tRegionAttachment.X3 = 16;\r\n\t\tRegionAttachment.Y3 = 17;\r\n\t\tRegionAttachment.C3R = 18;\r\n\t\tRegionAttachment.C3G = 19;\r\n\t\tRegionAttachment.C3B = 20;\r\n\t\tRegionAttachment.C3A = 21;\r\n\t\tRegionAttachment.U3 = 22;\r\n\t\tRegionAttachment.V3 = 23;\r\n\t\tRegionAttachment.X4 = 24;\r\n\t\tRegionAttachment.Y4 = 25;\r\n\t\tRegionAttachment.C4R = 26;\r\n\t\tRegionAttachment.C4G = 27;\r\n\t\tRegionAttachment.C4B = 28;\r\n\t\tRegionAttachment.C4A = 29;\r\n\t\tRegionAttachment.U4 = 30;\r\n\t\tRegionAttachment.V4 = 31;\r\n\t\treturn RegionAttachment;\r\n\t}(spine.Attachment));\r\n\tspine.RegionAttachment = RegionAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar JitterEffect = (function () {\r\n\t\tfunction JitterEffect(jitterX, jitterY) {\r\n\t\t\tthis.jitterX = 0;\r\n\t\t\tthis.jitterY = 0;\r\n\t\t\tthis.jitterX = jitterX;\r\n\t\t\tthis.jitterY = jitterY;\r\n\t\t}\r\n\t\tJitterEffect.prototype.begin = function (skeleton) {\r\n\t\t};\r\n\t\tJitterEffect.prototype.transform = function (position, uv, light, dark) {\r\n\t\t\tposition.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n\t\t\tposition.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n\t\t};\r\n\t\tJitterEffect.prototype.end = function () {\r\n\t\t};\r\n\t\treturn JitterEffect;\r\n\t}());\r\n\tspine.JitterEffect = JitterEffect;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SwirlEffect = (function () {\r\n\t\tfunction SwirlEffect(radius) {\r\n\t\t\tthis.centerX = 0;\r\n\t\t\tthis.centerY = 0;\r\n\t\t\tthis.radius = 0;\r\n\t\t\tthis.angle = 0;\r\n\t\t\tthis.worldX = 0;\r\n\t\t\tthis.worldY = 0;\r\n\t\t\tthis.radius = radius;\r\n\t\t}\r\n\t\tSwirlEffect.prototype.begin = function (skeleton) {\r\n\t\t\tthis.worldX = skeleton.x + this.centerX;\r\n\t\t\tthis.worldY = skeleton.y + this.centerY;\r\n\t\t};\r\n\t\tSwirlEffect.prototype.transform = function (position, uv, light, dark) {\r\n\t\t\tvar radAngle = this.angle * spine.MathUtils.degreesToRadians;\r\n\t\t\tvar x = position.x - this.worldX;\r\n\t\t\tvar y = position.y - this.worldY;\r\n\t\t\tvar dist = Math.sqrt(x * x + y * y);\r\n\t\t\tif (dist < this.radius) {\r\n\t\t\t\tvar theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);\r\n\t\t\t\tvar cos = Math.cos(theta);\r\n\t\t\t\tvar sin = Math.sin(theta);\r\n\t\t\t\tposition.x = cos * x - sin * y + this.worldX;\r\n\t\t\t\tposition.y = sin * x + cos * y + this.worldY;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSwirlEffect.prototype.end = function () {\r\n\t\t};\r\n\t\tSwirlEffect.interpolation = new spine.PowOut(2);\r\n\t\treturn SwirlEffect;\r\n\t}());\r\n\tspine.SwirlEffect = SwirlEffect;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar canvas;\r\n\t(function (canvas) {\r\n\t\tvar AssetManager = (function (_super) {\r\n\t\t\t__extends(AssetManager, _super);\r\n\t\t\tfunction AssetManager(pathPrefix) {\r\n\t\t\t\tif (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n\t\t\t\treturn _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this;\r\n\t\t\t}\r\n\t\t\treturn AssetManager;\r\n\t\t}(spine.AssetManager));\r\n\t\tcanvas.AssetManager = AssetManager;\r\n\t})(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar canvas;\r\n\t(function (canvas) {\r\n\t\tvar CanvasTexture = (function (_super) {\r\n\t\t\t__extends(CanvasTexture, _super);\r\n\t\t\tfunction CanvasTexture(image) {\r\n\t\t\t\treturn _super.call(this, image) || this;\r\n\t\t\t}\r\n\t\t\tCanvasTexture.prototype.setFilters = function (minFilter, magFilter) { };\r\n\t\t\tCanvasTexture.prototype.setWraps = function (uWrap, vWrap) { };\r\n\t\t\tCanvasTexture.prototype.dispose = function () { };\r\n\t\t\treturn CanvasTexture;\r\n\t\t}(spine.Texture));\r\n\t\tcanvas.CanvasTexture = CanvasTexture;\r\n\t})(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar canvas;\r\n\t(function (canvas) {\r\n\t\tvar SkeletonRenderer = (function () {\r\n\t\t\tfunction SkeletonRenderer(context) {\r\n\t\t\t\tthis.triangleRendering = false;\r\n\t\t\t\tthis.debugRendering = false;\r\n\t\t\t\tthis.vertices = spine.Utils.newFloatArray(8 * 1024);\r\n\t\t\t\tthis.tempColor = new spine.Color();\r\n\t\t\t\tthis.ctx = context;\r\n\t\t\t}\r\n\t\t\tSkeletonRenderer.prototype.draw = function (skeleton) {\r\n\t\t\t\tif (this.triangleRendering)\r\n\t\t\t\t\tthis.drawTriangles(skeleton);\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.drawImages(skeleton);\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.prototype.drawImages = function (skeleton) {\r\n\t\t\t\tvar ctx = this.ctx;\r\n\t\t\t\tvar drawOrder = skeleton.drawOrder;\r\n\t\t\t\tif (this.debugRendering)\r\n\t\t\t\t\tctx.strokeStyle = \"green\";\r\n\t\t\t\tctx.save();\r\n\t\t\t\tfor (var i = 0, n = drawOrder.length; i < n; i++) {\r\n\t\t\t\t\tvar slot = drawOrder[i];\r\n\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\tvar regionAttachment = null;\r\n\t\t\t\t\tvar region = null;\r\n\t\t\t\t\tvar image = null;\r\n\t\t\t\t\tif (attachment instanceof spine.RegionAttachment) {\r\n\t\t\t\t\t\tregionAttachment = attachment;\r\n\t\t\t\t\t\tregion = regionAttachment.region;\r\n\t\t\t\t\t\timage = region.texture.getImage();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tvar skeleton_1 = slot.bone.skeleton;\r\n\t\t\t\t\tvar skeletonColor = skeleton_1.color;\r\n\t\t\t\t\tvar slotColor = slot.color;\r\n\t\t\t\t\tvar regionColor = regionAttachment.color;\r\n\t\t\t\t\tvar alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n\t\t\t\t\tvar color = this.tempColor;\r\n\t\t\t\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha);\r\n\t\t\t\t\tvar att = attachment;\r\n\t\t\t\t\tvar bone = slot.bone;\r\n\t\t\t\t\tvar w = region.width;\r\n\t\t\t\t\tvar h = region.height;\r\n\t\t\t\t\tctx.save();\r\n\t\t\t\t\tctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);\r\n\t\t\t\t\tctx.translate(attachment.offset[0], attachment.offset[1]);\r\n\t\t\t\t\tctx.rotate(attachment.rotation * Math.PI / 180);\r\n\t\t\t\t\tvar atlasScale = att.width / w;\r\n\t\t\t\t\tctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);\r\n\t\t\t\t\tctx.translate(w / 2, h / 2);\r\n\t\t\t\t\tif (attachment.region.rotate) {\r\n\t\t\t\t\t\tvar t = w;\r\n\t\t\t\t\t\tw = h;\r\n\t\t\t\t\t\th = t;\r\n\t\t\t\t\t\tctx.rotate(-Math.PI / 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tctx.scale(1, -1);\r\n\t\t\t\t\tctx.translate(-w / 2, -h / 2);\r\n\t\t\t\t\tif (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {\r\n\t\t\t\t\t\tctx.globalAlpha = color.a;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h);\r\n\t\t\t\t\tif (this.debugRendering)\r\n\t\t\t\t\t\tctx.strokeRect(0, 0, w, h);\r\n\t\t\t\t\tctx.restore();\r\n\t\t\t\t}\r\n\t\t\t\tctx.restore();\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.prototype.drawTriangles = function (skeleton) {\r\n\t\t\t\tvar blendMode = null;\r\n\t\t\t\tvar vertices = this.vertices;\r\n\t\t\t\tvar triangles = null;\r\n\t\t\t\tvar drawOrder = skeleton.drawOrder;\r\n\t\t\t\tfor (var i = 0, n = drawOrder.length; i < n; i++) {\r\n\t\t\t\t\tvar slot = drawOrder[i];\r\n\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\tvar texture = null;\r\n\t\t\t\t\tvar region = null;\r\n\t\t\t\t\tif (attachment instanceof spine.RegionAttachment) {\r\n\t\t\t\t\t\tvar regionAttachment = attachment;\r\n\t\t\t\t\t\tvertices = this.computeRegionVertices(slot, regionAttachment, false);\r\n\t\t\t\t\t\ttriangles = SkeletonRenderer.QUAD_TRIANGLES;\r\n\t\t\t\t\t\tregion = regionAttachment.region;\r\n\t\t\t\t\t\ttexture = region.texture.getImage();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (attachment instanceof spine.MeshAttachment) {\r\n\t\t\t\t\t\tvar mesh = attachment;\r\n\t\t\t\t\t\tvertices = this.computeMeshVertices(slot, mesh, false);\r\n\t\t\t\t\t\ttriangles = mesh.triangles;\r\n\t\t\t\t\t\ttexture = mesh.region.renderObject.texture.getImage();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (texture != null) {\r\n\t\t\t\t\t\tvar slotBlendMode = slot.data.blendMode;\r\n\t\t\t\t\t\tif (slotBlendMode != blendMode) {\r\n\t\t\t\t\t\t\tblendMode = slotBlendMode;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar skeleton_2 = slot.bone.skeleton;\r\n\t\t\t\t\t\tvar skeletonColor = skeleton_2.color;\r\n\t\t\t\t\t\tvar slotColor = slot.color;\r\n\t\t\t\t\t\tvar attachmentColor = attachment.color;\r\n\t\t\t\t\t\tvar alpha = skeletonColor.a * slotColor.a * attachmentColor.a;\r\n\t\t\t\t\t\tvar color = this.tempColor;\r\n\t\t\t\t\t\tcolor.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha);\r\n\t\t\t\t\t\tvar ctx = this.ctx;\r\n\t\t\t\t\t\tif (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {\r\n\t\t\t\t\t\t\tctx.globalAlpha = color.a;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (var j = 0; j < triangles.length; j += 3) {\r\n\t\t\t\t\t\t\tvar t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8;\r\n\t\t\t\t\t\t\tvar x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7];\r\n\t\t\t\t\t\t\tvar x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7];\r\n\t\t\t\t\t\t\tvar x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7];\r\n\t\t\t\t\t\t\tthis.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);\r\n\t\t\t\t\t\t\tif (this.debugRendering) {\r\n\t\t\t\t\t\t\t\tctx.strokeStyle = \"green\";\r\n\t\t\t\t\t\t\t\tctx.beginPath();\r\n\t\t\t\t\t\t\t\tctx.moveTo(x0, y0);\r\n\t\t\t\t\t\t\t\tctx.lineTo(x1, y1);\r\n\t\t\t\t\t\t\t\tctx.lineTo(x2, y2);\r\n\t\t\t\t\t\t\t\tctx.lineTo(x0, y0);\r\n\t\t\t\t\t\t\t\tctx.stroke();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.ctx.globalAlpha = 1;\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) {\r\n\t\t\t\tvar ctx = this.ctx;\r\n\t\t\t\tu0 *= img.width;\r\n\t\t\t\tv0 *= img.height;\r\n\t\t\t\tu1 *= img.width;\r\n\t\t\t\tv1 *= img.height;\r\n\t\t\t\tu2 *= img.width;\r\n\t\t\t\tv2 *= img.height;\r\n\t\t\t\tctx.beginPath();\r\n\t\t\t\tctx.moveTo(x0, y0);\r\n\t\t\t\tctx.lineTo(x1, y1);\r\n\t\t\t\tctx.lineTo(x2, y2);\r\n\t\t\t\tctx.closePath();\r\n\t\t\t\tx1 -= x0;\r\n\t\t\t\ty1 -= y0;\r\n\t\t\t\tx2 -= x0;\r\n\t\t\t\ty2 -= y0;\r\n\t\t\t\tu1 -= u0;\r\n\t\t\t\tv1 -= v0;\r\n\t\t\t\tu2 -= u0;\r\n\t\t\t\tv2 -= v0;\r\n\t\t\t\tvar det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0;\r\n\t\t\t\tctx.save();\r\n\t\t\t\tctx.transform(a, b, c, d, e, f);\r\n\t\t\t\tctx.clip();\r\n\t\t\t\tctx.drawImage(img, 0, 0);\r\n\t\t\t\tctx.restore();\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) {\r\n\t\t\t\tvar skeleton = slot.bone.skeleton;\r\n\t\t\t\tvar skeletonColor = skeleton.color;\r\n\t\t\t\tvar slotColor = slot.color;\r\n\t\t\t\tvar regionColor = region.color;\r\n\t\t\t\tvar alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n\t\t\t\tvar multiplier = pma ? alpha : 1;\r\n\t\t\t\tvar color = this.tempColor;\r\n\t\t\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha);\r\n\t\t\t\tregion.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE);\r\n\t\t\t\tvar vertices = this.vertices;\r\n\t\t\t\tvar uvs = region.uvs;\r\n\t\t\t\tvertices[spine.RegionAttachment.C1R] = color.r;\r\n\t\t\t\tvertices[spine.RegionAttachment.C1G] = color.g;\r\n\t\t\t\tvertices[spine.RegionAttachment.C1B] = color.b;\r\n\t\t\t\tvertices[spine.RegionAttachment.C1A] = color.a;\r\n\t\t\t\tvertices[spine.RegionAttachment.U1] = uvs[0];\r\n\t\t\t\tvertices[spine.RegionAttachment.V1] = uvs[1];\r\n\t\t\t\tvertices[spine.RegionAttachment.C2R] = color.r;\r\n\t\t\t\tvertices[spine.RegionAttachment.C2G] = color.g;\r\n\t\t\t\tvertices[spine.RegionAttachment.C2B] = color.b;\r\n\t\t\t\tvertices[spine.RegionAttachment.C2A] = color.a;\r\n\t\t\t\tvertices[spine.RegionAttachment.U2] = uvs[2];\r\n\t\t\t\tvertices[spine.RegionAttachment.V2] = uvs[3];\r\n\t\t\t\tvertices[spine.RegionAttachment.C3R] = color.r;\r\n\t\t\t\tvertices[spine.RegionAttachment.C3G] = color.g;\r\n\t\t\t\tvertices[spine.RegionAttachment.C3B] = color.b;\r\n\t\t\t\tvertices[spine.RegionAttachment.C3A] = color.a;\r\n\t\t\t\tvertices[spine.RegionAttachment.U3] = uvs[4];\r\n\t\t\t\tvertices[spine.RegionAttachment.V3] = uvs[5];\r\n\t\t\t\tvertices[spine.RegionAttachment.C4R] = color.r;\r\n\t\t\t\tvertices[spine.RegionAttachment.C4G] = color.g;\r\n\t\t\t\tvertices[spine.RegionAttachment.C4B] = color.b;\r\n\t\t\t\tvertices[spine.RegionAttachment.C4A] = color.a;\r\n\t\t\t\tvertices[spine.RegionAttachment.U4] = uvs[6];\r\n\t\t\t\tvertices[spine.RegionAttachment.V4] = uvs[7];\r\n\t\t\t\treturn vertices;\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) {\r\n\t\t\t\tvar skeleton = slot.bone.skeleton;\r\n\t\t\t\tvar skeletonColor = skeleton.color;\r\n\t\t\t\tvar slotColor = slot.color;\r\n\t\t\t\tvar regionColor = mesh.color;\r\n\t\t\t\tvar alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n\t\t\t\tvar multiplier = pma ? alpha : 1;\r\n\t\t\t\tvar color = this.tempColor;\r\n\t\t\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha);\r\n\t\t\t\tvar numVertices = mesh.worldVerticesLength / 2;\r\n\t\t\t\tif (this.vertices.length < mesh.worldVerticesLength) {\r\n\t\t\t\t\tthis.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength);\r\n\t\t\t\t}\r\n\t\t\t\tvar vertices = this.vertices;\r\n\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE);\r\n\t\t\t\tvar uvs = mesh.uvs;\r\n\t\t\t\tfor (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) {\r\n\t\t\t\t\tvertices[v++] = color.r;\r\n\t\t\t\t\tvertices[v++] = color.g;\r\n\t\t\t\t\tvertices[v++] = color.b;\r\n\t\t\t\t\tvertices[v++] = color.a;\r\n\t\t\t\t\tvertices[v++] = uvs[u++];\r\n\t\t\t\t\tvertices[v++] = uvs[u++];\r\n\t\t\t\t\tv += 2;\r\n\t\t\t\t}\r\n\t\t\t\treturn vertices;\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n\t\t\tSkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4;\r\n\t\t\treturn SkeletonRenderer;\r\n\t\t}());\r\n\t\tcanvas.SkeletonRenderer = SkeletonRenderer;\r\n\t})(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\n//# sourceMappingURL=spine-canvas.js.map\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = spine;\n}.call(window));"],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/spine/dist/SpinePlugin.js b/plugins/spine/dist/SpinePlugin.js index c70368fa7..f56848518 100644 --- a/plugins/spine/dist/SpinePlugin.js +++ b/plugins/spine/dist/SpinePlugin.js @@ -1,14 +1,5 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define("SpinePlugin", [], factory); - else if(typeof exports === 'object') - exports["SpinePlugin"] = factory(); - else - root["SpinePlugin"] = factory(); -})(window, function() { -return /******/ (function(modules) { // webpackBootstrap +window["SpinePlugin"] = +/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ @@ -91,364 +82,468 @@ return /******/ (function(modules) { // webpackBootstrap /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./SpinePlugin.js"); +/******/ return __webpack_require__(__webpack_require__.s = 32); /******/ }) /************************************************************************/ -/******/ ({ - -/***/ "../../../node_modules/eventemitter3/index.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/node_modules/eventemitter3/index.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var has = Object.prototype.hasOwnProperty - , prefix = '~'; +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { /** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// 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; +} + +/** + * Extends the given `myClass` object's prototype with the properties of `definition`. * + * @function extend + * @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. + */ +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]; + } + } +} + +/** + * Applies the given `mixins` to the prototype of `myClass`. + * + * @function mixin + * @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) + { + return; + } + + if (!Array.isArray(mixins)) + { + mixins = [ mixins ]; + } + + 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 - * @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 {Object} definition a dictionary of functions for the class + * @example * - * @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. + * var MyClass = new Phaser.Class({ * - * @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. + * initialize: function() { + * this.foo = 2.0; + * }, * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} evt The Event name. - * @private + * bar: function() { + * return this.foo + 5; + * } + * }); */ -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; +function Class (definition) +{ + if (!definition) + { + definition = {}; } - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; + // 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 () {}; } - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; + if (definition.Extends) + { + initialize.prototype = Object.create(definition.Extends.prototype); + initialize.prototype.constructor = initialize; - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin) - 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]; - } + Extends = definition.Extends; - listeners[i].fn.apply(listeners[i].context, args); - } + delete definition.Extends; } - } - - 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]); - } + else + { + initialize.prototype.constructor = initialize; } - // - // 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); - } + // Grab the mixins, if they are specified... + var mixins = null; - return this; -}; + if (definition.Mixins) + { + mixins = definition.Mixins; + delete definition.Mixins; + } -/** - * 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; + // First, mixin if we can. + mixin(initialize, mixins); - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } + // Now we grab the actual definition which defines the overrides. + extend(initialize, definition, true, Extends); - 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; + return initialize; } +Class.extend = extend; +Class.mixin = mixin; +Class.ignoreFinals = false; + +module.exports = Class; + /***/ }), +/* 1 */ +/***/ (function(module, exports) { -/***/ "../../../src/data/DataManager.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/data/DataManager.js ***! - \**************************************************/ -/*! no static exports found */ +/** + * @author Richard Davey + * @copyright 2019 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 + +}; + +module.exports = MATH_CONST; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 (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; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 5 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -457,3952 +552,712 @@ if (true) { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); -var Events = __webpack_require__(/*! ./events */ "../../../src/data/events/index.js"); +var CONST = __webpack_require__(1); /** - * @callback DataEachCallback + * 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. * - * @param {*} parent - The parent object of the DataManager. - * @param {string} key - The key of the value. - * @param {*} value - The value. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + * @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; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(1); + +/** + * 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 {integer} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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 - * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. - * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, - * or have a property called `events` that is an instance of it. + * A representation of a vector in 2D space. * - * @class DataManager - * @memberof Phaser.Data + * A two-component vector. + * + * @class Vector2 + * @memberof Phaser.Math * @constructor * @since 3.0.0 * - * @param {object} parent - The object that this DataManager belongs to. - * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter. + * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties. + * @param {number} [y] - The y component. */ -var DataManager = new Class({ +var Vector2 = new Class({ initialize: - function DataManager (parent, eventEmitter) + function Vector2 (x, y) { /** - * The object that this DataManager belongs to. + * The x component of this Vector. * - * @name Phaser.Data.DataManager#parent - * @type {*} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * The DataManager's event emitter. - * - * @name Phaser.Data.DataManager#events - * @type {Phaser.Events.EventEmitter} - * @since 3.0.0 - */ - this.events = eventEmitter; - - if (!eventEmitter) - { - this.events = (parent.events) ? parent.events : parent; - } - - /** - * The data list. - * - * @name Phaser.Data.DataManager#list - * @type {Object.} - * @default {} - * @since 3.0.0 - */ - this.list = {}; - - /** - * The public values list. You can use this to access anything you have stored - * in this Data Manager. For example, if you set a value called `gold` you can - * access it via: - * - * ```javascript - * this.data.values.gold; - * ``` - * - * You can also modify it directly: - * - * ```javascript - * this.data.values.gold += 1000; - * ``` - * - * Doing so will emit a `setdata` event from the parent of this Data Manager. - * - * Do not modify this object directly. Adding properties directly to this object will not - * emit any events. Always use `DataManager.set` to create new items the first time around. - * - * @name Phaser.Data.DataManager#values - * @type {Object.} - * @default {} - * @since 3.10.0 - */ - this.values = {}; - - /** - * Whether setting data is frozen for this DataManager. - * - * @name Phaser.Data.DataManager#_frozen - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._frozen = false; - - if (!parent.hasOwnProperty('sys') && this.events) - { - this.events.once('destroy', this.destroy, this); - } - }, - - /** - * Retrieves the value for the given key, 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 - * this.data.get('gold'); - * ``` - * - * Or access the value directly: - * - * ```javascript - * this.data.values.gold; - * ``` - * - * You can also pass in an array of keys, in which case an array of values will be returned: - * - * ```javascript - * this.data.get([ 'gold', 'armor', 'health' ]); - * ``` - * - * This approach is useful for destructuring arrays in ES6. - * - * @method Phaser.Data.DataManager#get - * @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. - */ - get: function (key) - { - var list = this.list; - - if (Array.isArray(key)) - { - var output = []; - - for (var i = 0; i < key.length; i++) - { - output.push(list[key[i]]); - } - - return output; - } - else - { - return list[key]; - } - }, - - /** - * Retrieves all data values in a new object. - * - * @method Phaser.Data.DataManager#getAll - * @since 3.0.0 - * - * @return {Object.} All data values. - */ - getAll: function () - { - var results = {}; - - for (var key in this.list) - { - if (this.list.hasOwnProperty(key)) - { - results[key] = this.list[key]; - } - } - - return results; - }, - - /** - * Queries the DataManager for the values of keys matching the given regular expression. - * - * @method Phaser.Data.DataManager#query - * @since 3.0.0 - * - * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). - * - * @return {Object.} The values of the keys matching the search string. - */ - query: function (search) - { - var results = {}; - - for (var key in this.list) - { - if (this.list.hasOwnProperty(key) && key.match(search)) - { - results[key] = this.list[key]; - } - } - - return results; - }, - - /** - * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. - * - * ```javascript - * data.set('name', 'Red Gem Stone'); - * ``` - * - * You can also pass in an object of key value pairs as the first argument: - * - * ```javascript - * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); - * ``` - * - * To get a value back again you can call `get`: - * - * ```javascript - * data.get('gold'); - * ``` - * - * Or you can access the value directly via the `values` property, where it works like any other variable: - * - * ```javascript - * data.values.gold += 50; - * ``` - * - * When the value is first set, a `setdata` event is emitted. - * - * 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.Data.DataManager#set - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @since 3.0.0 - * - * @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. - * - * @return {Phaser.Data.DataManager} This DataManager object. - */ - set: function (key, data) - { - if (this._frozen) - { - return this; - } - - if (typeof key === 'string') - { - return this.setValue(key, data); - } - else - { - for (var entry in key) - { - this.setValue(entry, key[entry]); - } - } - - return this; - }, - - /** - * Internal value setter, called automatically by the `set` method. - * - * @method Phaser.Data.DataManager#setValue - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @private - * @since 3.10.0 - * - * @param {string} key - The key to set the value for. - * @param {*} data - The value to set. - * - * @return {Phaser.Data.DataManager} This DataManager object. - */ - setValue: function (key, data) - { - if (this._frozen) - { - return this; - } - - if (this.has(key)) - { - // Hit the key getter, which will in turn emit the events. - this.values[key] = data; - } - else - { - var _this = this; - var list = this.list; - var events = this.events; - var parent = this.parent; - - Object.defineProperty(this.values, key, { - - enumerable: true, - - configurable: true, - - get: function () - { - return list[key]; - }, - - set: function (value) - { - if (!_this._frozen) - { - var previousValue = list[key]; - list[key] = value; - - events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); - events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); - } - } - - }); - - list[key] = data; - - events.emit(Events.SET_DATA, parent, key, data); - } - - return this; - }, - - /** - * Passes all data entries to the given callback. - * - * @method Phaser.Data.DataManager#each - * @since 3.0.0 - * - * @param {DataEachCallback} callback - The function to call. - * @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 {Phaser.Data.DataManager} This DataManager object. - */ - each: function (callback, context) - { - var args = [ this.parent, null, undefined ]; - - for (var i = 1; i < arguments.length; i++) - { - args.push(arguments[i]); - } - - for (var key in this.list) - { - args[1] = key; - args[2] = this.list[key]; - - callback.apply(context, args); - } - - return this; - }, - - /** - * Merge the given object of key value pairs into this DataManager. - * - * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) - * will emit a `changedata` event. - * - * @method Phaser.Data.DataManager#merge - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @since 3.0.0 - * - * @param {Object.} data - The data to merge. - * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. - * - * @return {Phaser.Data.DataManager} This DataManager object. - */ - merge: function (data, overwrite) - { - if (overwrite === undefined) { overwrite = true; } - - // Merge data from another component into this one - for (var key in data) - { - if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) - { - this.setValue(key, data[key]); - } - } - - return this; - }, - - /** - * Remove the value for the given key. - * - * If the key is found in this Data Manager it is removed from the internal lists and a - * `removedata` event is emitted. - * - * You can also pass in an array of keys, in which case all keys in the array will be removed: - * - * ```javascript - * this.data.remove([ 'gold', 'armor', 'health' ]); - * ``` - * - * @method Phaser.Data.DataManager#remove - * @fires Phaser.Data.Events#REMOVE_DATA - * @since 3.0.0 - * - * @param {(string|string[])} key - The key to remove, or an array of keys to remove. - * - * @return {Phaser.Data.DataManager} This DataManager object. - */ - remove: function (key) - { - if (this._frozen) - { - return this; - } - - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - this.removeValue(key[i]); - } - } - else - { - return this.removeValue(key); - } - - return this; - }, - - /** - * Internal value remover, called automatically by the `remove` method. - * - * @method Phaser.Data.DataManager#removeValue - * @private - * @fires Phaser.Data.Events#REMOVE_DATA - * @since 3.10.0 - * - * @param {string} key - The key to set the value for. - * - * @return {Phaser.Data.DataManager} This DataManager object. - */ - removeValue: function (key) - { - if (this.has(key)) - { - var data = this.list[key]; - - delete this.list[key]; - delete this.values[key]; - - this.events.emit(Events.REMOVE_DATA, this.parent, key, data); - } - - return this; - }, - - /** - * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. - * - * @method Phaser.Data.DataManager#pop - * @fires Phaser.Data.Events#REMOVE_DATA - * @since 3.0.0 - * - * @param {string} key - The key of the value to retrieve and delete. - * - * @return {*} The value of the given key. - */ - pop: function (key) - { - var data = undefined; - - if (!this._frozen && this.has(key)) - { - data = this.list[key]; - - delete this.list[key]; - delete this.values[key]; - - this.events.emit(Events.REMOVE_DATA, this.parent, key, data); - } - - return data; - }, - - /** - * Determines whether the given key is set in this Data Manager. - * - * Please note that the 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.Data.DataManager#has - * @since 3.0.0 - * - * @param {string} key - The key to check. - * - * @return {boolean} Returns `true` if the key exists, otherwise `false`. - */ - has: function (key) - { - return this.list.hasOwnProperty(key); - }, - - /** - * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts - * to create new values or update existing ones. - * - * @method Phaser.Data.DataManager#setFreeze - * @since 3.0.0 - * - * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. - * - * @return {Phaser.Data.DataManager} This DataManager object. - */ - setFreeze: function (value) - { - this._frozen = value; - - return this; - }, - - /** - * Delete all data in this Data Manager and unfreeze it. - * - * @method Phaser.Data.DataManager#reset - * @since 3.0.0 - * - * @return {Phaser.Data.DataManager} This DataManager object. - */ - reset: function () - { - for (var key in this.list) - { - delete this.list[key]; - delete this.values[key]; - } - - this._frozen = false; - - return this; - }, - - /** - * Destroy this data manager. - * - * @method Phaser.Data.DataManager#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.reset(); - - this.events.off(Events.CHANGE_DATA); - this.events.off(Events.SET_DATA); - this.events.off(Events.REMOVE_DATA); - - this.parent = null; - }, - - /** - * Gets or sets the frozen state of this Data Manager. - * A frozen Data Manager will block all attempts to create new values or update existing ones. - * - * @name Phaser.Data.DataManager#freeze - * @type {boolean} - * @since 3.0.0 - */ - freeze: { - - get: function () - { - return this._frozen; - }, - - set: function (value) - { - this._frozen = (value) ? true : false; - } - - }, - - /** - * Return the total number of entries in this Data Manager. - * - * @name Phaser.Data.DataManager#count - * @type {integer} - * @since 3.0.0 - */ - count: { - - get: function () - { - var i = 0; - - for (var key in this.list) - { - if (this.list[key] !== undefined) - { - i++; - } - } - - return i; - } - - } - -}); - -module.exports = DataManager; - - -/***/ }), - -/***/ "../../../src/data/events/CHANGE_DATA_EVENT.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/data/events/CHANGE_DATA_EVENT.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Change Data Event. - * - * This event is dispatched by a Data Manager when an item in the data store is changed. - * - * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for - * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`. - * - * This event is dispatched for all items that change in the Data Manager. - * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. - * - * @event Phaser.Data.Events#CHANGE_DATA - * @since 3.0.0 - * - * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to. - * @param {string} key - The unique key of the data item within the Data Manager. - * @param {any} value - The new value of the item in the Data Manager. - * @param {any} previousValue - The previous value of the item in the Data Manager. - */ -module.exports = 'changedata'; - - -/***/ }), - -/***/ "../../../src/data/events/CHANGE_DATA_KEY_EVENT.js": -/*!*******************************************************************!*\ - !*** D:/wamp/www/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Change Data Key Event. - * - * This event is dispatched by a Data Manager when an item in the data store is changed. - * - * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for - * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`, - * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` - * then you can listen for `sprite.data.on('changedata-gold')`. - * - * @event Phaser.Data.Events#CHANGE_DATA_KEY - * @since 3.16.1 - * - * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. - * @param {string} key - The unique key of the data item within the Data Manager. - * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. - * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. - */ -module.exports = 'changedata-'; - - -/***/ }), - -/***/ "../../../src/data/events/REMOVE_DATA_EVENT.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/data/events/REMOVE_DATA_EVENT.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Remove Data Event. - * - * This event is dispatched by a Data Manager when an item is removed from it. - * - * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for - * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`. - * - * @event Phaser.Data.Events#REMOVE_DATA - * @since 3.0.0 - * - * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. - * @param {string} key - The unique key of the data item within the Data Manager. - * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. - */ -module.exports = 'removedata'; - - -/***/ }), - -/***/ "../../../src/data/events/SET_DATA_EVENT.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/data/events/SET_DATA_EVENT.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Set Data Event. - * - * This event is dispatched by a Data Manager when a new item is added to the data store. - * - * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for - * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`. - * - * @event Phaser.Data.Events#SET_DATA - * @since 3.0.0 - * - * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. - * @param {string} key - The unique key of the data item within the Data Manager. - * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. - */ -module.exports = 'setdata'; - - -/***/ }), - -/***/ "../../../src/data/events/index.js": -/*!***************************************************!*\ - !*** D:/wamp/www/phaser/src/data/events/index.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Data.Events - */ - -module.exports = { - - CHANGE_DATA: __webpack_require__(/*! ./CHANGE_DATA_EVENT */ "../../../src/data/events/CHANGE_DATA_EVENT.js"), - CHANGE_DATA_KEY: __webpack_require__(/*! ./CHANGE_DATA_KEY_EVENT */ "../../../src/data/events/CHANGE_DATA_KEY_EVENT.js"), - REMOVE_DATA: __webpack_require__(/*! ./REMOVE_DATA_EVENT */ "../../../src/data/events/REMOVE_DATA_EVENT.js"), - SET_DATA: __webpack_require__(/*! ./SET_DATA_EVENT */ "../../../src/data/events/SET_DATA_EVENT.js") - -}; - - -/***/ }), - -/***/ "../../../src/gameobjects/GameObject.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/GameObject.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); -var ComponentsToJSON = __webpack_require__(/*! ./components/ToJSON */ "../../../src/gameobjects/components/ToJSON.js"); -var DataManager = __webpack_require__(/*! ../data/DataManager */ "../../../src/data/DataManager.js"); -var EventEmitter = __webpack_require__(/*! eventemitter3 */ "../../../node_modules/eventemitter3/index.js"); -var Events = __webpack_require__(/*! ./events */ "../../../src/gameobjects/events/index.js"); - -/** - * @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); - - /** - * The Scene to which this Game Object belongs. - * Game Objects can only belong to one Scene. - * - * @name Phaser.GameObjects.GameObject#scene - * @type {Phaser.Scene} - * @protected - * @since 3.0.0 - */ - this.scene = scene; - - /** - * 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 move 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 {(integer|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 {integer} - * @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 {integer} - * @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 + * @name Phaser.Math.Vector2#x * @type {number} * @default 0 * @since 3.0.0 */ - this.cameraFilter = 0; + this.x = 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()`. + * The y component of this Vector. * - * @name Phaser.GameObjects.GameObject#input - * @type {?Phaser.Types.Input.InteractiveObject} - * @default null + * @name Phaser.Math.Vector2#y + * @type {number} + * @default 0 * @since 3.0.0 */ - this.input = null; + this.y = 0; - /** - * If this Game Object is enabled for physics then this property will contain a reference to a Physics Body. - * - * @name Phaser.GameObjects.GameObject#body - * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)} - * @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; - - // 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 {(integer|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) + if (typeof x === 'object') { - 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 - * - * @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; - }, - - /** - * 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. - * - * @method Phaser.GameObjects.GameObject#setInteractive - * @since 3.0.0 - * - * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. - * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. 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 (shape, callback, dropZone) - { - this.scene.sys.input.enable(this, shape, callback, 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 () - { - if (this.input) - { - this.input.enabled = false; - } - - 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; - }, - - /** - * 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) - { - return !(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 {integer[]} 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), parent.name]); - indexes.unshift(parent.getIndex(child)); - - child = parent; - - if (!parent.parentContainer) - { - break; - } - else - { - parent = parent.parentContainer; - } - } - - // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']); - indexes.unshift(this.scene.sys.displayList.getIndex(child)); - - return indexes; - }, - - /** - * 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] - Is this Game Object being destroyed as the result of a Scene shutdown? - */ - destroy: function (fromScene) - { - if (fromScene === undefined) { fromScene = false; } - - // This Game Object has already been destroyed - if (!this.scene || this.ignoreDestroy) - { - return; - } - - if (this.preDestroy) - { - this.preDestroy.call(this); - } - - this.emit(Events.DESTROY, this); - - var sys = this.scene.sys; - - if (!fromScene) - { - sys.displayList.remove(this); - sys.updateList.remove(this); - } - - if (this.input) - { - 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; - } - - // Tell the Scene to re-sort the children - if (!fromScene) - { - sys.queueDepthSort(); - } - - this.active = false; - this.visible = false; - - this.scene = undefined; - - this.parentContainer = undefined; - - this.removeAllListeners(); - } - -}); - -/** - * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. - * - * @constant {integer} RENDER_MASK - * @memberof Phaser.GameObjects.GameObject - * @default - */ -GameObject.RENDER_MASK = 15; - -module.exports = GameObject; - - -/***/ }), - -/***/ "../../../src/gameobjects/components/Alpha.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Alpha.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(/*! ../../math/Clamp */ "../../../src/math/Clamp.js"); - -// 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; + this.x = x.x || 0; + this.y = x.y || 0; } 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); + if (y === undefined) { y = x; } + + this.x = x || 0; + this.y = y || 0; } - - return this; }, /** - * The alpha value of the Game Object. + * Make a clone of this Vector2. * - * 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; - - -/***/ }), - -/***/ "../../../src/gameobjects/components/BlendMode.js": -/*!******************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/BlendMode.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(/*! ../../renderer/BlendModes */ "../../../src/renderer/BlendModes.js"); - -/** - * 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 {integer} - * @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: - * - * * 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)} - * @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: - * - * * 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 + * @method Phaser.Math.Vector2#clone * @since 3.0.0 * - * @param {(string|Phaser.BlendModes)} value - The BlendMode value. Either a string or a CONST. - * - * @return {this} This Game Object instance. + * @return {Phaser.Math.Vector2} A clone of this Vector2. */ - setBlendMode: function (value) + clone: function () { - this.blendMode = value; - - return this; - } - -}; - -module.exports = BlendMode; - - -/***/ }), - -/***/ "../../../src/gameobjects/components/ComputedSize.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/ComputedSize.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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; - } - + return new Vector2(this.x, this.y); }, /** - * 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 + * Copy the components of a given Vector into this Vector. * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. + * @method Phaser.Math.Vector2#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector2} This Vector2. */ - setSize: function (width, height) + copy: function (src) { - this.width = width; - this.height = height; + this.x = src.x || 0; + this.y = src.y || 0; 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 + * Set the component values of this Vector from a given Vector2Like object. * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. + * @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. */ - setDisplaySize: function (width, height) + setFromObject: function (obj) { - this.displayWidth = width; - this.displayHeight = height; - - return this; - } - -}; - -module.exports = ComputedSize; - - -/***/ }), - -/***/ "../../../src/gameobjects/components/Depth.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Depth.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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 {integer} - * @private - * @default 0 - * @since 3.0.0 - */ - _depth: 0, - - /** - * 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 depth starts from zero (the default value) and increases from that point. 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) - { - this.scene.sys.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 depth starts from zero (the default value) and increases from that point. 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 {integer} value - The depth of this Game Object. - * - * @return {this} This Game Object instance. - */ - setDepth: function (value) - { - if (value === undefined) { value = 0; } - - this.depth = value; - - return this; - } - -}; - -module.exports = Depth; - - -/***/ }), - -/***/ "../../../src/gameobjects/components/Flip.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Flip.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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; + this.x = obj.x || 0; + this.y = obj.y || 0; 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 + * 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 {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. + * @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. */ - 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; - - -/***/ }), - -/***/ "../../../src/gameobjects/components/ScrollFactor.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/ScrollFactor.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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) + set: function (x, y) { if (y === undefined) { y = x; } - this.scrollFactorX = x; - this.scrollFactorY = y; - - return this; - } - -}; - -module.exports = ScrollFactor; - - -/***/ }), - -/***/ "../../../src/gameobjects/components/ToJSON.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/ToJSON.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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, - scaleMode: gameObject.scaleMode, - blendMode: gameObject.blendMode, - textureKey: '', - frameKey: '', - data: {} - }; - - if (gameObject.texture) - { - out.textureKey = gameObject.texture.key; - out.frameKey = gameObject.frame.name; - } - - return out; -}; - -module.exports = ToJSON; - - -/***/ }), - -/***/ "../../../src/gameobjects/components/Transform.js": -/*!******************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Transform.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = __webpack_require__(/*! ../../math/const */ "../../../src/math/const.js"); -var TransformMatrix = __webpack_require__(/*! ./TransformMatrix */ "../../../src/gameobjects/components/TransformMatrix.js"); -var WrapAngle = __webpack_require__(/*! ../../math/angle/Wrap */ "../../../src/math/angle/Wrap.js"); -var WrapAngleDegrees = __webpack_require__(/*! ../../math/angle/WrapDegrees */ "../../../src/math/angle/WrapDegrees.js"); - -// 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 = { - - /** - * 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: Do not use this value to set the z-index, instead see the `depth` property. - * - * @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. - * - * Where 0 is to the right, 90 is down, 180 is left. - * - * If you prefer to work in radians, see the `rotation` property instead. - * - * @name Phaser.GameObjects.Components.Transform#angle - * @type {integer} - * @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. - * - * 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; }, /** - * 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. + * This method is an alias for `Vector2.set`. * - * 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. - * - * @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 + * @method Phaser.Math.Vector2#setTo * @since 3.4.0 * - * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * @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.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + * @return {Phaser.Math.Vector2} This Vector2. */ - getLocalTransformMatrix: function (tempMatrix) + setTo: function (x, y) { - if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } - - return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + return this.set(x, y); }, /** - * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * Sets the `x` and `y` values of this object from a given polar coordinate. * - * @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; - }, - - /** - * 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; - - -/***/ }), - -/***/ "../../../src/gameobjects/components/TransformMatrix.js": -/*!************************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/TransformMatrix.js ***! - \************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); -var Vector2 = __webpack_require__(/*! ../../math/Vector2 */ "../../../src/math/Vector2.js"); - -/** - * @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 Shear Y value. - * @param {number} [c=0] - The Shear 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 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 Shear 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 Shear 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. - * - * @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 horizontal scale of the Matrix. - * - * @name Phaser.GameObjects.Components.TransformMatrix#scaleX - * @type {number} - * @readonly - * @since 3.4.0 - */ - scaleX: { - - get: function () - { - return Math.sqrt((this.a * this.a) + (this.c * this.c)); - } - - }, - - /** - * The vertical scale of the Matrix. - * - * @name Phaser.GameObjects.Components.TransformMatrix#scaleY - * @type {number} - * @readonly - * @since 3.4.0 - */ - scaleY: { - - get: function () - { - return Math.sqrt((this.b * this.b) + (this.d * this.d)); - } - - }, - - /** - * Reset the Matrix to an identity matrix. - * - * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity + * @method Phaser.Math.Vector2#setToPolar * @since 3.0.0 * - * @return {this} This TransformMatrix. + * @param {number} azimuth - The angular coordinate, in radians. + * @param {number} [radius=1] - The radial coordinate (length). + * + * @return {Phaser.Math.Vector2} This Vector2. */ - loadIdentity: function () + setToPolar: function (azimuth, radius) { - var matrix = this.matrix; + if (radius == null) { radius = 1; } - matrix[0] = 1; - matrix[1] = 0; - matrix[2] = 0; - matrix[3] = 1; - matrix[4] = 0; - matrix[5] = 0; + this.x = Math.cos(azimuth) * radius; + this.y = Math.sin(azimuth) * radius; return this; }, /** - * Translate the Matrix. + * Check whether this Vector is equal to a given Vector. * - * @method Phaser.GameObjects.Components.TransformMatrix#translate + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector2#equals * @since 3.0.0 * - * @param {number} x - The horizontal translation value. - * @param {number} y - The vertical translation value. + * @param {Phaser.Math.Vector2} v - The vector to compare with this Vector. * - * @return {this} This TransformMatrix. + * @return {boolean} Whether the given Vector is equal to this Vector. */ - translate: function (x, y) + equals: function (v) { - 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; + return ((this.x === v.x) && (this.y === v.y)); }, /** - * Scale the Matrix. + * Calculate the angle between this Vector and the positive x-axis, in radians. * - * @method Phaser.GameObjects.Components.TransformMatrix#scale + * @method Phaser.Math.Vector2#angle * @since 3.0.0 * - * @param {number} x - The horizontal scale value. - * @param {number} y - The vertical scale value. - * - * @return {this} This TransformMatrix. + * @return {number} The angle between this Vector, and the positive x-axis, given in radians. */ - scale: function (x, y) + angle: function () { - var matrix = this.matrix; + // computes the angle in radians with respect to the positive x-axis - matrix[0] *= x; - matrix[1] *= x; - matrix[2] *= y; - matrix[3] *= y; + var angle = Math.atan2(this.y, this.x); - 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 {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) ? this : out; - - destinationMatrix.a = (sourceA * localA) + (sourceB * localC); - destinationMatrix.b = (sourceA * localB) + (sourceB * localD); - destinationMatrix.c = (sourceC * localA) + (sourceD * localC); - destinationMatrix.d = (sourceC * localB) + (sourceD * localD); - destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE; - destinationMatrix.f = (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 using 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.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates. - * - * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} 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) + if (angle < 0) { - out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ]; + angle += 2 * Math.PI; + } + + return angle; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector2#add + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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 { - out[0] = matrix[0]; - out[1] = matrix[1]; - out[2] = matrix[2]; - out[3] = matrix[3]; - out[4] = matrix[4]; - out[5] = matrix[5]; + this.x = 0; + this.y = 0; } - 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 + * Perform a component-wise division between this Vector and the given Vector. * - * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector2#divide * @since 3.0.0 * - * @return {object} The decomposed Matrix. + * @param {Phaser.Math.Vector2} src - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. */ - decomposeMatrix: function () + divide: function (src) { - 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; + this.x /= src.x; + this.y /= src.y; 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. + * Negate the `x` and `y` components of this Vector. * - * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse - * @since 3.12.0 + * @method Phaser.Math.Vector2#negate + * @since 3.0.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. + * @return {Phaser.Math.Vector2} This Vector2. */ - applyInverse: function (x, y, output) + negate: function () { - if (output === undefined) { output = new Vector2(); } + this.x = -this.x; + this.y = -this.y; - 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; + return this; }, /** - * Returns the X component of this matrix multiplied by the given values. - * This is the same as `x * a + y * c + e`. + * Calculate the distance between this Vector and the given Vector. * - * @method Phaser.GameObjects.Components.TransformMatrix#getX - * @since 3.12.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. + * @method Phaser.Math.Vector2#distance + * @since 3.0.0 * - * @return {number} The calculated x value. + * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. */ - getX: function (x, y) + distance: function (src) { - return x * this.a + y * this.c + this.e; + var dx = src.x - this.x; + var dy = src.y - this.y; + + return Math.sqrt(dx * dx + dy * dy); }, /** - * Returns the Y component of this matrix multiplied by the given values. - * This is the same as `x * b + y * d + f`. + * Calculate the distance between this Vector and the given Vector, squared. * - * @method Phaser.GameObjects.Components.TransformMatrix#getY - * @since 3.12.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. + * @method Phaser.Math.Vector2#distanceSq + * @since 3.0.0 * - * @return {number} The calculated y value. + * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. */ - getY: function (x, y) + distanceSq: function (src) { - return x * this.b + y * this.d + this.f; + var dx = src.x - this.x; + var dy = src.y - this.y; + + return dx * dx + dy * dy; }, /** - * Returns a string that can be used in a CSS Transform call as a `matrix` property. + * Calculate the length (or magnitude) of this Vector. * - * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix - * @since 3.12.0 + * @method Phaser.Math.Vector2#length + * @since 3.0.0 * - * @return {string} A string containing the CSS Transform matrix values. + * @return {number} The length of this Vector. */ - getCSSMatrix: function () + length: function () { - var m = this.matrix; + var x = this.x; + var y = this.y; - return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')'; + return Math.sqrt(x * x + y * y); }, /** - * Destroys this Transform Matrix. + * Calculate the length of this Vector squared. * - * @method Phaser.GameObjects.Components.TransformMatrix#destroy - * @since 3.4.0 + * @method Phaser.Math.Vector2#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. */ - destroy: function () + lengthSq: function () { - this.matrix = null; - this.decomposedMatrix = null; + 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; + }, + + /** + * Right-hand normalize (make unit length) this Vector. + * + * @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; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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; } }); -module.exports = TransformMatrix; +/** + * 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; /***/ }), - -/***/ "../../../src/gameobjects/components/Visible.js": -/*!****************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Visible.js ***! - \****************************************************************/ -/*! no static exports found */ +/* 8 */ /***/ (function(module, exports) { /** @@ -4411,92 +1266,990 @@ module.exports = TransformMatrix; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// bitmask flag for GameObject.renderMask -var _FLAG = 1; // 0001 +var FILE_CONST = { + + /** + * The Loader is idle. + * + * @name Phaser.Loader.LOADER_IDLE + * @type {integer} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {integer} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {integer} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {integer} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started + * + * @name Phaser.Loader.FILE_PENDING + * @type {integer} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing + * + * @name Phaser.Loader.FILE_LOADED + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load + * + * @name Phaser.Loader.FILE_FAILED + * @type {integer} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {integer} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {integer} + * @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 {integer} + * @since 3.0.0 + */ + FILE_POPULATED: 19 + +}; + +module.exports = FILE_CONST; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { /** - * 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 + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Visible = { +/** + * 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)); +}; - /** - * Private internal value. Holds the visible value. - * - * @name Phaser.GameObjects.Components.Visible#_visible - * @type {boolean} - * @private - * @default true - * @since 3.0.0 - */ - _visible: true, +module.exports = Clamp; - /** - * 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 () +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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') { - return this._visible; - }, - - set: function (value) - { - if (value) - { - this._visible = true; - this.renderFlags |= _FLAG; - } - else - { - this._visible = false; - this.renderFlags &= ~_FLAG; - } + 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; } - }, /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. + * Set this Vector to point up. * - * @method Phaser.GameObjects.Components.Visible#setVisible + * Sets the y component of the vector to 1, and the others to 0. + * + * @method Phaser.Math.Vector3#up * @since 3.0.0 * - * @param {boolean} value - The visible state of the Game Object. - * - * @return {this} This Game Object instance. + * @return {Phaser.Math.Vector3} This Vector3. */ - setVisible: function (value) + up: function () { - this.visible = value; + this.x = 0; + this.y = 1; + this.z = 0; + + 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); + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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 Matrix. + * + * @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; + }, + + /** + * 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; } -}; -module.exports = Visible; +}); + +/** + * 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; /***/ }), - -/***/ "../../../src/gameobjects/events/DESTROY_EVENT.js": -/*!******************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/DESTROY_EVENT.js ***! - \******************************************************************/ -/*! no static exports found */ +/* 11 */ /***/ (function(module, exports) { /** @@ -4505,28 +2258,69 @@ module.exports = Visible; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +// Source object +// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' +// The default value to use if the key doesn't exist + /** - * The Game Object Destroy Event. - * - * 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)`. + * Retrieves a value from an object. * - * @event Phaser.GameObjects.Events#DESTROY + * @function Phaser.Utils.Objects.GetValue * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. + * + * @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. */ -module.exports = 'destroy'; +var GetValue = function (source, key, defaultValue) +{ + if (!source || typeof source === 'number') + { + return defaultValue; + } + else if (source.hasOwnProperty(key)) + { + return source[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parent = source; + var value = defaultValue; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parent.hasOwnProperty(keys[i])) + { + // Yes it has a key property, let's carry on down + value = parent[keys[i]]; + + parent = parent[keys[i]]; + } + else + { + // Can't go any further, so reset to default + value = defaultValue; + break; + } + } + + return value; + } + else + { + return defaultValue; + } +}; + +module.exports = GetValue; /***/ }), - -/***/ "../../../src/gameobjects/events/index.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/index.js ***! - \**********************************************************/ -/*! no static exports found */ +/* 12 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4535,36 +2329,14 @@ module.exports = 'destroy'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.GameObjects.Events - */ - -module.exports = { DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ "../../../src/gameobjects/events/DESTROY_EVENT.js") }; - - -/***/ }), - -/***/ "../../../src/loader/File.js": -/*!*********************************************!*\ - !*** D:/wamp/www/phaser/src/loader/File.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); -var CONST = __webpack_require__(/*! ./const */ "../../../src/loader/const.js"); -var Events = __webpack_require__(/*! ./events */ "../../../src/loader/events/index.js"); -var GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); -var GetURL = __webpack_require__(/*! ./GetURL */ "../../../src/loader/GetURL.js"); -var MergeXHRSettings = __webpack_require__(/*! ./MergeXHRSettings */ "../../../src/loader/MergeXHRSettings.js"); -var XHRLoader = __webpack_require__(/*! ./XHRLoader */ "../../../src/loader/XHRLoader.js"); -var XHRSettings = __webpack_require__(/*! ./XHRSettings */ "../../../src/loader/XHRSettings.js"); +var Class = __webpack_require__(0); +var CONST = __webpack_require__(8); +var Events = __webpack_require__(170); +var GetFastValue = __webpack_require__(4); +var GetURL = __webpack_require__(181); +var MergeXHRSettings = __webpack_require__(29); +var XHRLoader = __webpack_require__(182); +var XHRSettings = __webpack_require__(30); /** * @classdesc @@ -5089,12 +2861,7 @@ module.exports = File; /***/ }), - -/***/ "../../../src/loader/FileTypesManager.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/FileTypesManager.js ***! - \*********************************************************/ -/*! no static exports found */ +/* 13 */ /***/ (function(module, exports) { /** @@ -5163,12 +2930,106 @@ module.exports = FileTypesManager; /***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ "../../../src/loader/GetURL.js": -/*!***********************************************!*\ - !*** D:/wamp/www/phaser/src/loader/GetURL.js ***! - \***********************************************/ -/*! no static exports found */ +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsPlainObject = __webpack_require__(2); + +// @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 + * + * @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; + + +/***/ }), +/* 15 */ /***/ (function(module, exports) { /** @@ -5178,43 +3039,65 @@ module.exports = FileTypesManager; */ /** - * Given a File and a baseURL value this returns the URL the File will use to download from. + * Find the angle of a segment from (x1, y1) -> (x2, y2). * - * @function Phaser.Loader.GetURL + * @function Phaser.Math.Angle.Between * @since 3.0.0 * - * @param {Phaser.Loader.File} file - The File object. - * @param {string} baseURL - A default base URL. + * @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 {string} The URL the File will use. + * @return {number} The angle in radians. */ -var GetURL = function (file, baseURL) +var Between = function (x1, y1, x2, y2) { - if (!file.url) - { - return false; - } + return Math.atan2(y2 - y1, x2 - x1); +}; - if (file.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)) +module.exports = Between; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 file.url; + return angle; } else { - return baseURL + file.url; + return angle + 2 * Math.PI; } }; -module.exports = GetURL; +module.exports = Normalize; /***/ }), - -/***/ "../../../src/loader/MergeXHRSettings.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/MergeXHRSettings.js ***! - \*********************************************************/ -/*! no static exports found */ +/* 17 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5223,51 +3106,30 @@ module.exports = GetURL; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(/*! ../utils/object/Extend */ "../../../src/utils/object/Extend.js"); -var XHRSettings = __webpack_require__(/*! ./XHRSettings */ "../../../src/loader/XHRSettings.js"); +var MathWrap = __webpack_require__(3); /** - * Takes two XHRSettings Objects and creates a new XHRSettings object from them. + * Wrap an angle. * - * The new object is seeded by the values given in the global settings, but any setting in - * the local object overrides the global ones. + * Wraps the angle to a value in the range of -PI to PI. * - * @function Phaser.Loader.MergeXHRSettings + * @function Phaser.Math.Angle.Wrap * @since 3.0.0 * - * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. - * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. + * @param {number} angle - The angle to wrap, in radians. * - * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. + * @return {number} The wrapped angle, in radians. */ -var MergeXHRSettings = function (global, local) +var Wrap = function (angle) { - var output = (global === undefined) ? XHRSettings() : Extend({}, global); - - if (local) - { - for (var setting in local) - { - if (local[setting] !== undefined) - { - output[setting] = local[setting]; - } - } - } - - return output; + return MathWrap(angle, -Math.PI, Math.PI); }; -module.exports = MergeXHRSettings; +module.exports = Wrap; /***/ }), - -/***/ "../../../src/loader/MultiFile.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/MultiFile.js ***! - \**************************************************/ -/*! no static exports found */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5276,197 +3138,30 @@ module.exports = MergeXHRSettings; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var Wrap = __webpack_require__(3); /** - * @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. + * Wrap an angle in degrees. * - * @class MultiFile - * @memberof Phaser.Loader - * @constructor - * @since 3.7.0 + * Wraps the angle to a value in the range of -180 to 180. * - * @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. + * @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 MultiFile = new Class({ +var WrapDegrees = function (angle) +{ + return Wrap(angle, -180, 180); +}; - initialize: - - function MultiFile (loader, type, key, files) - { - /** - * 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; - - /** - * Array of files that make up this MultiFile. - * - * @name Phaser.Loader.MultiFile#files - * @type {Phaser.Loader.File[]} - * @since 3.7.0 - */ - this.files = files; - - /** - * 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 {integer} - * @since 3.7.0 - */ - - this.pending = files.length; - - /** - * The number of files that failed to load. - * - * @name Phaser.Loader.MultiFile#failed - * @type {integer} - * @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 = {}; - - // Link the files - for (var i = 0; i < files.length; i++) - { - files[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++; - } - } - -}); - -module.exports = MultiFile; +module.exports = WrapDegrees; /***/ }), - -/***/ "../../../src/loader/XHRLoader.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/XHRLoader.js ***! - \**************************************************/ -/*! no static exports found */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5475,71 +3170,29 @@ module.exports = MultiFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MergeXHRSettings = __webpack_require__(/*! ./MergeXHRSettings */ "../../../src/loader/MergeXHRSettings.js"); +var Factorial = __webpack_require__(20); /** - * 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. + * [description] * - * @function Phaser.Loader.XHRLoader + * @function Phaser.Math.Bernstein * @since 3.0.0 * - * @param {Phaser.Loader.File} file - The File to download. - * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object. + * @param {number} n - [description] + * @param {number} i - [description] * - * @return {XMLHttpRequest} The XHR object. + * @return {number} [description] */ -var XHRLoader = function (file, globalXHRSettings) +var Bernstein = function (n, i) { - 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.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); - } - - // 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; + return Factorial(n) / Factorial(i) / Factorial(n - i); }; -module.exports = XHRLoader; +module.exports = Bernstein; /***/ }), - -/***/ "../../../src/loader/XHRSettings.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/XHRSettings.js ***! - \****************************************************/ -/*! no static exports found */ +/* 20 */ /***/ (function(module, exports) { /** @@ -5549,66 +3202,37 @@ module.exports = XHRLoader; */ /** - * Creates an XHRSettings Object with default values. + * Calculates the factorial of a given number for integer values greater than 0. * - * @function Phaser.Loader.XHRSettings + * @function Phaser.Math.Factorial * @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 {integer} [timeout=0] - Optional XHR timeout value. + * @param {number} value - A positive integer to calculate the factorial of. * - * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + * @return {number} The factorial of the given number. */ -var XHRSettings = function (responseType, async, user, password, timeout) +var Factorial = function (value) { - if (responseType === undefined) { responseType = ''; } - if (async === undefined) { async = true; } - if (user === undefined) { user = ''; } - if (password === undefined) { password = ''; } - if (timeout === undefined) { timeout = 0; } + if (value === 0) + { + return 1; + } - // 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". + var res = value; - return { + while (--value) + { + res *= value; + } - // 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 - header: undefined, - headerValue: undefined, - requestedWith: false, - - // overrideMimeType - overrideMimeType: undefined - - }; + return res; }; -module.exports = XHRSettings; +module.exports = Factorial; /***/ }), - -/***/ "../../../src/loader/const.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/loader/const.js ***! - \**********************************************/ -/*! no static exports found */ +/* 21 */ /***/ (function(module, exports) { /** @@ -5617,155 +3241,35 @@ module.exports = XHRSettings; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FILE_CONST = { - - /** - * The Loader is idle. - * - * @name Phaser.Loader.LOADER_IDLE - * @type {integer} - * @since 3.0.0 - */ - LOADER_IDLE: 0, - - /** - * The Loader is actively loading. - * - * @name Phaser.Loader.LOADER_LOADING - * @type {integer} - * @since 3.0.0 - */ - LOADER_LOADING: 1, - - /** - * The Loader is processing files is has loaded. - * - * @name Phaser.Loader.LOADER_PROCESSING - * @type {integer} - * @since 3.0.0 - */ - LOADER_PROCESSING: 2, - - /** - * The Loader has completed loading and processing. - * - * @name Phaser.Loader.LOADER_COMPLETE - * @type {integer} - * @since 3.0.0 - */ - LOADER_COMPLETE: 3, - - /** - * The Loader is shutting down. - * - * @name Phaser.Loader.LOADER_SHUTDOWN - * @type {integer} - * @since 3.0.0 - */ - LOADER_SHUTDOWN: 4, - - /** - * The Loader has been destroyed. - * - * @name Phaser.Loader.LOADER_DESTROYED - * @type {integer} - * @since 3.0.0 - */ - LOADER_DESTROYED: 5, - - /** - * File is in the load queue but not yet started - * - * @name Phaser.Loader.FILE_PENDING - * @type {integer} - * @since 3.0.0 - */ - FILE_PENDING: 10, - - /** - * File has been started to load by the loader (onLoad called) - * - * @name Phaser.Loader.FILE_LOADING - * @type {integer} - * @since 3.0.0 - */ - FILE_LOADING: 11, - - /** - * File has loaded successfully, awaiting processing - * - * @name Phaser.Loader.FILE_LOADED - * @type {integer} - * @since 3.0.0 - */ - FILE_LOADED: 12, - - /** - * File failed to load - * - * @name Phaser.Loader.FILE_FAILED - * @type {integer} - * @since 3.0.0 - */ - FILE_FAILED: 13, - - /** - * File is being processed (onProcess callback) - * - * @name Phaser.Loader.FILE_PROCESSING - * @type {integer} - * @since 3.0.0 - */ - FILE_PROCESSING: 14, - - /** - * The File has errored somehow during processing. - * - * @name Phaser.Loader.FILE_ERRORED - * @type {integer} - * @since 3.0.0 - */ - FILE_ERRORED: 16, - - /** - * File has finished processing. - * - * @name Phaser.Loader.FILE_COMPLETE - * @type {integer} - * @since 3.0.0 - */ - FILE_COMPLETE: 17, - - /** - * File has been destroyed - * - * @name Phaser.Loader.FILE_DESTROYED - * @type {integer} - * @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 {integer} - * @since 3.0.0 - */ - FILE_POPULATED: 19 +/** + * Calculates a Catmull-Rom value. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - [description] + * @param {number} p0 - [description] + * @param {number} p1 - [description] + * @param {number} p2 - [description] + * @param {number} p3 - [description] + * + * @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 = FILE_CONST; +module.exports = CatmullRom; /***/ }), - -/***/ "../../../src/loader/events/ADD_EVENT.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/ADD_EVENT.js ***! - \*********************************************************/ -/*! no static exports found */ +/* 22 */ /***/ (function(module, exports) { /** @@ -5775,32 +3279,27 @@ module.exports = FILE_CONST; */ /** - * 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. + * Calculates a linear (interpolation) value over t. * - * @event Phaser.Loader.Events#ADD + * @function Phaser.Math.Linear * @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. + * + * @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. */ -module.exports = 'addfile'; +var Linear = function (p0, p1, t) +{ + return (p1 - p0) * t + p0; +}; + +module.exports = Linear; /***/ }), - -/***/ "../../../src/loader/events/COMPLETE_EVENT.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/COMPLETE_EVENT.js ***! - \**************************************************************/ -/*! no static exports found */ +/* 23 */ /***/ (function(module, exports) { /** @@ -5810,30 +3309,44 @@ module.exports = 'addfile'; */ /** - * 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)`. + * Calculate a smooth interpolation percentage of `x` between `min` and `max`. * - * @event Phaser.Loader.Events#COMPLETE + * 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 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - * @param {integer} totalComplete - The total number of files that successfully loaded. - * @param {integer} totalFailed - The total number of files that failed to load. + * @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. */ -module.exports = 'complete'; +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; /***/ }), - -/***/ "../../../src/loader/events/FILE_COMPLETE_EVENT.js": -/*!*******************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/FILE_COMPLETE_EVENT.js ***! - \*******************************************************************/ -/*! no static exports found */ +/* 24 */ /***/ (function(module, exports) { /** @@ -5843,279 +3356,36 @@ module.exports = 'complete'; */ /** - * 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)`. - * - * 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. + * Calculate a smoother interpolation percentage of `x` between `min` and `max`. * - * @event Phaser.Loader.Events#FILE_COMPLETE + * 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 - * - * @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. + * @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. */ -module.exports = 'filecomplete'; +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; /***/ }), - -/***/ "../../../src/loader/events/FILE_KEY_COMPLETE_EVENT.js": -/*!***********************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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-atlas-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 - * }); - * ``` - * - * 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 - * @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. - */ -module.exports = 'filecomplete-'; - - -/***/ }), - -/***/ "../../../src/loader/events/FILE_LOAD_ERROR_EVENT.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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 - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - A reference to the File which errored during load. - */ -module.exports = 'loaderror'; - - -/***/ }), - -/***/ "../../../src/loader/events/FILE_LOAD_EVENT.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/FILE_LOAD_EVENT.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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 - * @since 3.0.0 - * - * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. - */ -module.exports = 'load'; - - -/***/ }), - -/***/ "../../../src/loader/events/FILE_PROGRESS_EVENT.js": -/*!*******************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/FILE_PROGRESS_EVENT.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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 - * @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'; - - -/***/ }), - -/***/ "../../../src/loader/events/POST_PROCESS_EVENT.js": -/*!******************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/POST_PROCESS_EVENT.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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 - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - */ -module.exports = 'postprocess'; - - -/***/ }), - -/***/ "../../../src/loader/events/PROGRESS_EVENT.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/PROGRESS_EVENT.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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 - * @since 3.0.0 - * - * @param {number} progress - The current progress of the load. A value between 0 and 1. - */ -module.exports = 'progress'; - - -/***/ }), - -/***/ "../../../src/loader/events/START_EVENT.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/START_EVENT.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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 - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - */ -module.exports = 'start'; - - -/***/ }), - -/***/ "../../../src/loader/events/index.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/index.js ***! - \*****************************************************/ -/*! no static exports found */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -6124,762 +3394,28 @@ module.exports = 'start'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var CONST = __webpack_require__(1); + /** - * @namespace Phaser.Loader.Events + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {integer} degrees - The angle (in degrees) to convert to radians. + * + * @return {number} The given angle converted to radians. */ - -module.exports = { - - ADD: __webpack_require__(/*! ./ADD_EVENT */ "../../../src/loader/events/ADD_EVENT.js"), - COMPLETE: __webpack_require__(/*! ./COMPLETE_EVENT */ "../../../src/loader/events/COMPLETE_EVENT.js"), - FILE_COMPLETE: __webpack_require__(/*! ./FILE_COMPLETE_EVENT */ "../../../src/loader/events/FILE_COMPLETE_EVENT.js"), - FILE_KEY_COMPLETE: __webpack_require__(/*! ./FILE_KEY_COMPLETE_EVENT */ "../../../src/loader/events/FILE_KEY_COMPLETE_EVENT.js"), - FILE_LOAD_ERROR: __webpack_require__(/*! ./FILE_LOAD_ERROR_EVENT */ "../../../src/loader/events/FILE_LOAD_ERROR_EVENT.js"), - FILE_LOAD: __webpack_require__(/*! ./FILE_LOAD_EVENT */ "../../../src/loader/events/FILE_LOAD_EVENT.js"), - FILE_PROGRESS: __webpack_require__(/*! ./FILE_PROGRESS_EVENT */ "../../../src/loader/events/FILE_PROGRESS_EVENT.js"), - POST_PROCESS: __webpack_require__(/*! ./POST_PROCESS_EVENT */ "../../../src/loader/events/POST_PROCESS_EVENT.js"), - PROGRESS: __webpack_require__(/*! ./PROGRESS_EVENT */ "../../../src/loader/events/PROGRESS_EVENT.js"), - START: __webpack_require__(/*! ./START_EVENT */ "../../../src/loader/events/START_EVENT.js") - +var DegToRad = function (degrees) +{ + return degrees * CONST.DEG_TO_RAD; }; - -/***/ }), - -/***/ "../../../src/loader/filetypes/ImageFile.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/filetypes/ImageFile.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); -var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); -var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); -var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); -var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); -var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); - -/** - * @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); - } - }, - - /** - * 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'); - }, - - /** - * Adds this file to its target cache upon successful loading and processing. - * - * @method Phaser.Loader.FileTypes.ImageFile#addToCache - * @since 3.7.0 - */ - addToCache: function () - { - var texture; - var linkFile = this.linkFile; - - if (linkFile && linkFile.state === CONST.FILE_COMPLETE) - { - if (this.type === 'image') - { - texture = this.cache.addImage(this.key, this.data, linkFile.data); - } - else - { - texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); - } - - this.pendingDestroy(texture); - - linkFile.pendingDestroy(texture); - } - else if (!linkFile) - { - texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); - } - } - -}); - -/** - * 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. - * - * 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#addFileEvent - * @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 {Phaser.Loader.LoaderPlugin} 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; +module.exports = DegToRad; /***/ }), - -/***/ "../../../src/loader/filetypes/JSONFile.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/filetypes/JSONFile.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); -var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); -var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); -var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); -var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); -var GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ "../../../src/utils/object/GetValue.js"); -var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); - -/** - * @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 {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". - * @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); - - if (IsPlainObject(url)) - { - // Object provided instead of a URL, so no need to actually load it (populate data with value) - 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; - - var json = JSON.parse(this.xhrLoader.responseText); - - 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#addFileEvent - * @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 {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". - * @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 {Phaser.Loader.LoaderPlugin} 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; - - -/***/ }), - -/***/ "../../../src/loader/filetypes/TextFile.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/filetypes/TextFile.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); -var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); -var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); -var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); -var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); -var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); - -/** - * @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 extension = 'txt'; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - } - - var fileConfig = { - type: 'text', - cache: loader.cacheManager.text, - 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#addFileEvent - * @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 {Phaser.Loader.LoaderPlugin} 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; - - -/***/ }), - -/***/ "../../../src/math/Clamp.js": -/*!********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Clamp.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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; - - -/***/ }), - -/***/ "../../../src/math/Matrix4.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Matrix4.js ***! - \**********************************************/ -/*! no static exports found */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -6891,7 +3427,600 @@ module.exports = Clamp; // 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +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; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - [description] + * + * @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; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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 EPSILON = 0.000001; @@ -8341,47 +5470,7 @@ module.exports = Matrix4; /***/ }), - -/***/ "../../../src/math/RadToDeg.js": -/*!***********************************************!*\ - !*** D:/wamp/www/phaser/src/math/RadToDeg.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); - -/** - * 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 {integer} The given angle converted to degrees. - */ -var RadToDeg = function (radians) -{ - return radians * CONST.RAD_TO_DEG; -}; - -module.exports = RadToDeg; - - -/***/ }), - -/***/ "../../../src/math/Vector2.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Vector2.js ***! - \**********************************************/ -/*! no static exports found */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8393,409 +5482,258 @@ module.exports = RadToDeg; // 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var Class = __webpack_require__(0); +var Vector3 = __webpack_require__(10); +var Matrix3 = __webpack_require__(26); + +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 representation of a vector in 2D space. + * A quaternion. * - * A two-component vector. - * - * @class Vector2 + * @class Quaternion * @memberof Phaser.Math * @constructor * @since 3.0.0 * - * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties. + * @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 Vector2 = new Class({ +var Quaternion = new Class({ initialize: - function Vector2 (x, y) + function Quaternion (x, y, z, w) { /** - * The x component of this Vector. + * The x component of this Quaternion. * - * @name Phaser.Math.Vector2#x + * @name Phaser.Math.Quaternion#x * @type {number} * @default 0 * @since 3.0.0 */ - this.x = 0; /** - * The y component of this Vector. + * The y component of this Quaternion. * - * @name Phaser.Math.Vector2#y + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w * @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; + this.z = x.z || 0; + this.w = x.w || 0; } else { - if (y === undefined) { y = x; } - this.x = x || 0; this.y = y || 0; + this.z = z || 0; + this.w = w || 0; } }, /** - * Make a clone of this Vector2. + * Copy the components of a given Quaternion or Vector into this Quaternion. * - * @method Phaser.Math.Vector2#clone + * @method Phaser.Math.Quaternion#copy * @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. + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. * - * @method Phaser.Math.Vector2#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Vector2} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector2} This Vector2. + * @return {Phaser.Math.Quaternion} This Quaternion. */ copy: function (src) { - this.x = src.x || 0; - this.y = src.y || 0; + this.x = src.x; + this.y = src.y; + this.z = src.z; + this.w = src.w; return this; }, /** - * Set the component values of this Vector from a given Vector2Like object. + * Set the components of this Quaternion. * - * @method Phaser.Math.Vector2#setFromObject + * @method Phaser.Math.Quaternion#set * @since 3.0.0 * - * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. + * @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. * - * @return {Phaser.Math.Vector2} This Vector2. + * @return {Phaser.Math.Quaternion} This Quaternion. */ - setFromObject: function (obj) + set: function (x, y, z, w) { - 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.Math.Vector2} 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)); - }, - - /** - * 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) + if (typeof x === 'object') { - angle += 2 * Math.PI; - } - - return angle; - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector2#add - * @since 3.0.0 - * - * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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; + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + this.w = x.w || 0; } else { - this.x = 0; - this.y = 0; + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = w || 0; } return this; }, /** - * Perform a component-wise division between this Vector and the given Vector. + * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector2#divide + * @method Phaser.Math.Quaternion#add * @since 3.0.0 * - * @param {Phaser.Math.Vector2} src - The Vector to divide this Vector by. + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. * - * @return {Phaser.Math.Vector2} This Vector2. + * @return {Phaser.Math.Quaternion} This Quaternion. */ - divide: function (src) + add: function (v) { - this.x /= src.x; - this.y /= src.y; + this.x += v.x; + this.y += v.y; + this.z += v.z; + this.w += v.w; return this; }, /** - * Negate the `x` and `y` components of this Vector. + * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. * - * @method Phaser.Math.Vector2#negate + * @method Phaser.Math.Quaternion#subtract * @since 3.0.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. */ - negate: function () + subtract: function (v) { - this.x = -this.x; - this.y = -this.y; + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + this.w -= v.w; return this; }, /** - * Calculate the distance between this Vector and the given Vector. + * Scale this Quaternion by the given value. * - * @method Phaser.Math.Vector2#distance + * @method Phaser.Math.Quaternion#scale * @since 3.0.0 * - * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to. + * @param {number} scale - The value to scale this Quaternion by. * - * @return {number} The distance from this Vector to the given Vector. + * @return {Phaser.Math.Quaternion} This Quaternion. */ - distance: function (src) + scale: function (scale) { - var dx = src.x - this.x; - var dy = src.y - this.y; + this.x *= scale; + this.y *= scale; + this.z *= scale; + this.w *= scale; - return Math.sqrt(dx * dx + dy * dy); + return this; }, /** - * Calculate the distance between this Vector and the given Vector, squared. + * Calculate the length of this Quaternion. * - * @method Phaser.Math.Vector2#distanceSq + * @method Phaser.Math.Quaternion#length * @since 3.0.0 * - * @param {Phaser.Math.Vector2} 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. + * @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); + return Math.sqrt(x * x + y * y + z * z + w * w); }, /** - * Calculate the length of this Vector squared. + * Calculate the length of this Quaternion squared. * - * @method Phaser.Math.Vector2#lengthSq + * @method Phaser.Math.Quaternion#lengthSq * @since 3.0.0 * - * @return {number} The length of this Vector, squared. + * @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; + return x * x + y * y + z * z + w * w; }, /** - * Normalize this Vector. + * Normalize this Quaternion. * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector2#normalize + * @method Phaser.Math.Quaternion#normalize * @since 3.0.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @return {Phaser.Math.Quaternion} This Quaternion. */ normalize: function () { var x = this.x; var y = this.y; - var len = x * x + y * y; + var z = this.z; + var w = this.w; + var len = x * x + y * y + z * z + w * w; if (len > 0) { @@ -8803,229 +5741,556 @@ var Vector2 = new Class({ this.x = x * len; this.y = y * len; + this.z = z * len; + this.w = w * len; } return this; }, /** - * Right-hand normalize (make unit length) this Vector. + * Calculate the dot product of this Quaternion and the given Quaternion or Vector. * - * @method Phaser.Math.Vector2#normalizeRightHand + * @method Phaser.Math.Quaternion#dot * @since 3.0.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @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. */ - normalizeRightHand: function () + dot: function (v) { - var x = this.x; - - this.x = this.y * -1; - this.y = x; - - return this; + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; }, /** - * Calculate the dot product of this Vector and the given Vector. + * Linearly interpolate this Quaternion towards the given Quaternion or Vector. * - * @method Phaser.Math.Vector2#dot + * @method Phaser.Math.Quaternion#lerp * @since 3.0.0 * - * @param {Phaser.Math.Vector2} src - The Vector2 to dot product with this Vector2. + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. + * @param {number} [t=0] - The percentage of interpolation. * - * @return {number} The dot product of this Vector and the given Vector. + * @return {Phaser.Math.Quaternion} This Quaternion. */ - 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.Math.Vector2} 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.Math.Vector2} 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) + 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 * (src.x - ax); - this.y = ay + t * (src.y - ay); + 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; }, /** - * Transform this Vector with the given Matrix. + * [description] * - * @method Phaser.Math.Vector2#transformMat3 + * @method Phaser.Math.Quaternion#rotationTo * @since 3.0.0 * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. + * @param {Phaser.Math.Vector3} a - [description] + * @param {Phaser.Math.Vector3} b - [description] * - * @return {Phaser.Math.Vector2} This Vector2. + * @return {Phaser.Math.Quaternion} This Quaternion. */ - transformMat3: function (mat) + rotationTo: function (a, b) { - var x = this.x; - var y = this.y; - var m = mat.val; + var dot = a.x * b.x + a.y * b.y + a.z * b.z; - this.x = m[0] * x + m[3] * y + m[6]; - this.y = m[1] * x + m[4] * y + m[7]; + if (dot < -0.999999) + { + if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) + { + tmpvec.copy(yUnitVec3).cross(a); + } - return this; + tmpvec.normalize(); + + return this.setAxisAngle(tmpvec, Math.PI); + + } + else if (dot > 0.999999) + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + } + 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(); + } }, /** - * Transform this Vector with the given Matrix. + * Set the axes of this Quaternion. * - * @method Phaser.Math.Vector2#transformMat4 + * @method Phaser.Math.Quaternion#setAxes * @since 3.0.0 * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. + * @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.Vector2} This Vector2. + * @return {Phaser.Math.Quaternion} This Quaternion. */ - transformMat4: function (mat) + setAxes: function (view, right, up) { - var x = this.x; - var y = this.y; - var m = mat.val; + var m = tmpMat3.val; - this.x = m[0] * x + m[4] * y + m[12]; - this.y = m[1] * x + m[5] * y + m[13]; + m[0] = right.x; + m[3] = right.y; + m[6] = right.z; - return this; + 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(); }, /** - * Make this Vector the zero vector (0, 0). + * Reset this Matrix to an identity (default) Quaternion. * - * @method Phaser.Math.Vector2#reset + * @method Phaser.Math.Quaternion#identity * @since 3.0.0 * - * @return {Phaser.Math.Vector2} This Vector2. + * @return {Phaser.Math.Quaternion} This Quaternion. */ - reset: function () + identity: function () { this.x = 0; this.y = 0; + this.z = 0; + this.w = 1; + + return this; + }, + + /** + * 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); + + this.x = s * axis.x; + this.y = s * axis.y; + this.z = s * axis.z; + this.w = Math.cos(rad); + + return this; + }, + + /** + * 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; + + this.x = ax * bw + aw * bx + ay * bz - az * by; + this.y = ay * bw + aw * by + az * bx - ax * bz; + this.z = az * bw + aw * bz + ax * by - ay * bx; + this.w = aw * bw - ax * bx - ay * by - az * bz; + + return this; + }, + + /** + * 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 + this.x = scale0 * ax + scale1 * bx; + this.y = scale0 * ay + scale1 * by; + this.z = scale0 * az + scale1 * bz; + this.w = scale0 * aw + scale1 * bw; + + return this; + }, + + /** + * 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; + + // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + this.x = -a0 * invDot; + this.y = -a1 * invDot; + this.z = -a2 * invDot; + this.w = a3 * invDot; + + return this; + }, + + /** + * 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; + + 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); + + this.x = ax * bw + aw * bx; + this.y = ay * bw + az * bx; + this.z = az * bw - ay * bx; + this.w = aw * bw - ax * bx; + + return this; + }, + + /** + * 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); + + this.x = ax * bw - az * by; + this.y = ay * bw + aw * by; + this.z = az * bw + ax * by; + this.w = aw * bw - ay * by; + + return this; + }, + + /** + * 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); + + this.x = ax * bw + ay * bz; + this.y = ay * bw - ax * bz; + this.z = az * bw + aw * bz; + this.w = aw * bw - az * bz; + + return this; + }, + + /** + * 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; + }, + + /** + * 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; + } return this; } }); -/** - * 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; +module.exports = Quaternion; /***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ "../../../src/math/Wrap.js": -/*!*******************************************!*\ - !*** D:/wamp/www/phaser/src/math/Wrap.js ***! - \*******************************************/ -/*! no static exports found */ +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(14); +var XHRSettings = __webpack_require__(30); + +/** + * 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; + + +/***/ }), +/* 30 */ /***/ (function(module, exports) { /** @@ -9035,153 +6300,61 @@ module.exports = Vector2; */ /** - * Wrap the given `value` between `min` and `max. + * Creates an XHRSettings Object with default values. * - * @function Phaser.Math.Wrap + * @function Phaser.Loader.XHRSettings * @since 3.0.0 * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum value. - * @param {number} max - The maximum value. + * @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 {integer} [timeout=0] - Optional XHR timeout value. * - * @return {number} The wrapped value. + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. */ -var Wrap = function (value, min, max) +var XHRSettings = function (responseType, async, user, password, timeout) { - var range = max - min; + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } - return (min + ((((value - min) % range) + range) % range)); + // 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 + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined + + }; }; -module.exports = Wrap; +module.exports = XHRSettings; /***/ }), - -/***/ "../../../src/math/angle/CounterClockwise.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/CounterClockwise.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(/*! ../const */ "../../../src/math/const.js"); - -/** - * 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) -{ - return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); -}; - -module.exports = CounterClockwise; - - -/***/ }), - -/***/ "../../../src/math/angle/Wrap.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/Wrap.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MathWrap = __webpack_require__(/*! ../Wrap */ "../../../src/math/Wrap.js"); - -/** - * 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; - - -/***/ }), - -/***/ "../../../src/math/angle/WrapDegrees.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/WrapDegrees.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Wrap = __webpack_require__(/*! ../Wrap */ "../../../src/math/Wrap.js"); - -/** - * 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; - - -/***/ }), - -/***/ "../../../src/math/const.js": -/*!********************************************!*\ - !*** D:/wamp/www/phaser/src/math/const.js ***! - \********************************************/ -/*! no static exports found */ +/* 31 */ /***/ (function(module, exports) { /** @@ -9190,355 +6363,1288 @@ module.exports = WrapDegrees; * @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 - +/** + * 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 = MATH_CONST; +module.exports = NOOP; /***/ }), - -/***/ "../../../src/plugins/BasePlugin.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/plugins/BasePlugin.js ***! - \****************************************************/ -/*! no static exports found */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { /** -* @author Richard Davey -* @copyright 2019 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ -var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var BuildGameObject = __webpack_require__(33); +var Class = __webpack_require__(0); +var GetValue = __webpack_require__(11); +var ResizeEvent = __webpack_require__(144); +var ScenePlugin = __webpack_require__(145); +var Spine = __webpack_require__(167); +var SpineFile = __webpack_require__(168); +var SpineGameObject = __webpack_require__(186); /** * @classdesc - * A Global Plugin is installed just once into the Game owned Plugin Manager. - * It can listen for Game events and respond to them. + * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game objects. + * + * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin + * uses the Spine 3.7 runtimes. Files created in a more recent version of Spine may not work as a result. + * + * You can find more details about Spine at http://esotericsoftware.com/. + * + * 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. + * + * 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 a Game Object Factory method, allowin you to create Spine Game Objects: + * + * ```javascript + * this.add.spine(512, 650, 'stretchyman') + * ``` + * + * 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 preMultipiedAlpha 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. + * + * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference * - * @class BasePlugin - * @memberof Phaser.Plugins + * @class SpinePlugin + * @memberOf Phaser + * @extends Phaser.Plugins.ScenePlugin * @constructor - * @since 3.8.0 + * @since 3.19.0 * - * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. + * @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. */ -var BasePlugin = new Class({ +var SpinePlugin = new Class({ + + Extends: ScenePlugin, initialize: - function BasePlugin (pluginManager) + function SpinePlugin (scene, 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; + ScenePlugin.call(this, scene, pluginManager); + + var game = pluginManager.game; /** - * A reference to the Game instance this plugin is running under. + * A read-only flag that indicates if the game is running under WebGL or Canvas. * - * @name Phaser.Plugins.BasePlugin#game - * @type {Phaser.Game} - * @protected - * @since 3.8.0 + * @name SpinePlugin#isWebGL + * @type {boolean} + * @readonly + * @since 3.19.0 */ - this.game = pluginManager.game; + this.isWebGL = (game.config.renderType === 2); /** - * 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 cannot use it during the `init` method, but you can during the `boot` method. + * 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 Phaser.Plugins.BasePlugin#scene - * @type {?Phaser.Scene} - * @protected - * @since 3.8.0 + * @name SpinePlugin#cache + * @type {Phaser.Cache.BaseCache} + * @since 3.19.0 */ - this.scene; + this.cache = game.cache.addCustom('spine'); /** - * 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 cannot use it during the `init` method, but you can during the `boot` method. + * 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 Phaser.Plugins.BasePlugin#systems - * @type {?Phaser.Scenes.Systems} - * @protected - * @since 3.8.0 + * @name SpinePlugin#spineTextures + * @type {Phaser.Cache.BaseCache} + * @since 3.19.0 */ - this.systems; + 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. + * + * 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; + } + + pluginManager.registerFileType('spine', this.spineFileCallback, scene); + + pluginManager.registerGameObject('spine', this.add.bind(this), this.make.bind(this)); }, /** - * Called by the PluginManager when this 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. + * Internal boot handler. * - * @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 () - { - }, - - /** - * Called by the PluginManager when this plugin is started. - * If a plugin is stopped, and then started again, this will get called again. - * Typically called immediately after `BasePlugin.init`. - * - * @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); - }, - - /** - * Called by the PluginManager when this 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. - * - * @method Phaser.Plugins.BasePlugin#stop - * @since 3.8.0 - */ - stop: function () - { - }, - - /** - * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots. - * By this point the plugin properties `scene` and `systems` will have already been set. - * In here you can listen for Scene events and set-up whatever you need for this plugin to run. - * - * @method Phaser.Plugins.BasePlugin#boot - * @since 3.8.0 + * @method SpinePlugin#boot + * @private + * @since 3.19.0 */ boot: function () { - // Here are the Scene events you can listen to. - // At the very least you should offer a destroy handler for when the Scene closes down. + if (this.isWebGL) + { + this.bootWebGL(); + this.onResize(); + this.game.scale.on(ResizeEvent, this.onResize, this); + } + else + { + this.bootCanvas(); + } - // var eventEmitter = this.systems.events; + var eventEmitter = this.systems.events; - // eventEmitter.once('destroy', this.sceneDestroy, this); - // eventEmitter.on('start', this.sceneStart, this); - // eventEmitter.on('preupdate', this.scenePreUpdate, this); - // eventEmitter.on('update', this.sceneUpdate, this); - // eventEmitter.on('postupdate', this.scenePostUpdate, this); - // eventEmitter.on('pause', this.scenePause, this); - // eventEmitter.on('resume', this.sceneResume, this); - // eventEmitter.on('sleep', this.sceneSleep, this); - // eventEmitter.on('wake', this.sceneWake, this); - // eventEmitter.on('shutdown', this.sceneShutdown, this); - // eventEmitter.on('destroy', this.sceneDestroy, this); + eventEmitter.once('shutdown', this.shutdown, this); + eventEmitter.once('destroy', this.destroy, this); }, /** - * Game instance has been destroyed. - * You must release everything in here, all references, all objects, free it all up. + * Internal boot handler for the Canvas Renderer. * - * @method Phaser.Plugins.BasePlugin#destroy - * @since 3.8.0 + * @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 () + { + this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + + // Monkeypatch the Spine setBlendMode functions, or batching is destroyed + + var setBlendMode = function (srcBlend, dstBlend) + { + if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend) + { + var gl = this.context.gl; + + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + + if (this.isDrawing) + { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + } + }; + + this.sceneRenderer.batcher.setBlendMode = setBlendMode; + this.sceneRenderer.shapes.setBlendMode = setBlendMode; + + this.skeletonRenderer = this.sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = this.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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage()); + + spineTextures.add(key, canvasTexture); + + return canvasTexture; + }); + } + + 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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + var gl = this.sceneRenderer.context.gl; + + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage(), false); + + spineTextures.add(key, glTexture); + + return glTexture; + }); + } + + 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 preMultipiedAlpha 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#addFileEvent + * @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} [preMultipiedAlpha=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. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ + spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings) + { + var multifile; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new SpineFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; + }, + + /** + * 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. + */ + add: function (x, y, key, animationName, loop) + { + var spineGO = new SpineGameObject(this.scene, this, x, y, key, animationName, loop); + + this.scene.sys.displayList.add(spineGO); + this.scene.sys.updateList.add(spineGO); + + return spineGO; + }, + + /** + * 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. + */ + 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 spineGO = new SpineGameObject(this.scene, this, 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(); + }, + + /** + * 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 Spine.Vector2(temp2.x, temp2.y); + } + else if (bone) + { + return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y); + } + else + { + return new Spine.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 Spine.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; + } + + var preMultipliedAlpha = atlasData.preMultipliedAlpha; + + var atlasLoader = new Spine.AtlasAttachmentLoader(atlas); + + var skeletonJson = new Spine.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 Spine.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 Spine.AnimationStateData(skeleton.data); + + var state = new Spine.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 Spine.Vector2(); + var size = new Spine.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.viewportWidth = viewportWidth; + sceneRenderer.camera.viewportHeight = 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); + + this.sceneRenderer.dispose(); + }, + + /** + * 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.pluginManager.removeGameObject('spine', true, true); + this.pluginManager = null; this.game = null; this.scene = null; this.systems = null; + + this.cache = null; + this.spineTextures = null; + this.json = null; + this.textures = null; + this.sceneRenderer = null; + this.skeletonRenderer = null; + this.gl = null; } }); -module.exports = BasePlugin; +module.exports = SpinePlugin; /***/ }), - -/***/ "../../../src/plugins/ScenePlugin.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/plugins/ScenePlugin.js ***! - \*****************************************************/ -/*! no static exports found */ +/* 33 */ /***/ (function(module, exports, __webpack_require__) { /** -* @author Richard Davey -* @copyright 2019 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/ + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ -var BasePlugin = __webpack_require__(/*! ./BasePlugin */ "../../../src/plugins/BasePlugin.js"); -var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); -var SceneEvents = __webpack_require__(/*! ../scene/events */ "../../../src/scene/events/index.js"); +var BlendModes = __webpack_require__(34); +var GetAdvancedValue = __webpack_require__(35); +var ScaleModes = __webpack_require__(143); /** - * @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. + * Builds a Game Object using the provided configuration object. * - * @class ScenePlugin - * @memberof Phaser.Plugins - * @extends Phaser.Plugins.BasePlugin - * @constructor - * @since 3.8.0 + * @function Phaser.GameObjects.BuildGameObject + * @since 3.0.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 {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 ScenePlugin = new Class({ +var BuildGameObject = function (scene, gameObject, config) +{ + // Position - Extends: BasePlugin, + gameObject.x = GetAdvancedValue(config, 'x', 0); + gameObject.y = GetAdvancedValue(config, 'y', 0); + gameObject.depth = GetAdvancedValue(config, 'depth', 0); - initialize: + // Flip - function ScenePlugin (scene, pluginManager) + 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') { - BasePlugin.call(this, pluginManager); - - this.scene = scene; - this.systems = scene.sys; - - 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 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 () + 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 }} -module.exports = ScenePlugin; + 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); + } + + // ScaleMode + + gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT); + + // 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; /***/ }), - -/***/ "../../../src/renderer/BlendModes.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/renderer/BlendModes.js ***! - \*****************************************************/ -/*! no static exports found */ +/* 34 */ /***/ (function(module, exports) { /** @@ -9877,12 +7983,213 @@ module.exports = { /***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ "../../../src/renderer/canvas/utils/SetTransform.js": -/*!********************************************************************!*\ - !*** D:/wamp/www/phaser/src/renderer/canvas/utils/SetTransform.js ***! - \********************************************************************/ -/*! no static exports found */ +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH = __webpack_require__(36); +var GetValue = __webpack_require__(11); + +/** + * 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; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(1); +var Extend = __webpack_require__(14); + +/** + * @namespace Phaser.Math + */ + +var PhaserMath = { + + // Collections of functions + Angle: __webpack_require__(37), + Distance: __webpack_require__(44), + Easing: __webpack_require__(48), + Fuzzy: __webpack_require__(93), + Interpolation: __webpack_require__(99), + Pow2: __webpack_require__(107), + Snap: __webpack_require__(111), + + // Expose the RNG Class + RandomDataGenerator: __webpack_require__(115), + + // Single functions + Average: __webpack_require__(116), + Bernstein: __webpack_require__(19), + Between: __webpack_require__(117), + CatmullRom: __webpack_require__(21), + CeilTo: __webpack_require__(118), + Clamp: __webpack_require__(9), + DegToRad: __webpack_require__(25), + Difference: __webpack_require__(119), + Factorial: __webpack_require__(20), + FloatBetween: __webpack_require__(120), + FloorTo: __webpack_require__(121), + FromPercent: __webpack_require__(122), + GetSpeed: __webpack_require__(123), + IsEven: __webpack_require__(124), + IsEvenStrict: __webpack_require__(125), + Linear: __webpack_require__(22), + MaxAdd: __webpack_require__(126), + MinSub: __webpack_require__(127), + Percent: __webpack_require__(128), + RadToDeg: __webpack_require__(6), + RandomXY: __webpack_require__(129), + RandomXYZ: __webpack_require__(130), + RandomXYZW: __webpack_require__(131), + Rotate: __webpack_require__(132), + RotateAround: __webpack_require__(133), + RotateAroundDistance: __webpack_require__(134), + RoundAwayFromZero: __webpack_require__(135), + RoundTo: __webpack_require__(136), + SinCosTableGenerator: __webpack_require__(137), + SmootherStep: __webpack_require__(24), + SmoothStep: __webpack_require__(23), + ToXY: __webpack_require__(138), + TransformXY: __webpack_require__(139), + Within: __webpack_require__(140), + Wrap: __webpack_require__(3), + + // Vector classes + Vector2: __webpack_require__(7), + Vector3: __webpack_require__(10), + Vector4: __webpack_require__(141), + Matrix3: __webpack_require__(26), + Matrix4: __webpack_require__(27), + Quaternion: __webpack_require__(28), + RotateVec3: __webpack_require__(142) + +}; + +// Merge in the consts + +PhaserMath = Extend(false, PhaserMath, CONST); + +// Export it + +module.exports = PhaserMath; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Angle + */ + +module.exports = { + + Between: __webpack_require__(15), + BetweenPoints: __webpack_require__(38), + BetweenPointsY: __webpack_require__(39), + BetweenY: __webpack_require__(40), + CounterClockwise: __webpack_require__(5), + Normalize: __webpack_require__(16), + Reverse: __webpack_require__(41), + RotateTo: __webpack_require__(42), + ShortestBetween: __webpack_require__(43), + Wrap: __webpack_require__(17), + WrapDegrees: __webpack_require__(18) + +}; + + +/***/ }), +/* 38 */ /***/ (function(module, exports) { /** @@ -9892,87 +8199,5068 @@ module.exports = { */ /** - * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix - * and then performs the following steps: - * - * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts. - * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given. - * 3. Sets the blend mode of the context to be that used by the Game Object. - * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera. - * 5. Saves the context state. - * 6. Sets the final matrix values into the context via setTransform. - * - * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). * - * @function Phaser.Renderer.Canvas.SetTransform - * @since 3.12.0 + * Calculates the angle of the vector from the first point to the second point. * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {CanvasRenderingContext2D} ctx - The canvas context to set the transform on. - * @param {Phaser.GameObjects.GameObject} src - The Game Object being rendered. Can be any type that extends the base class. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A parent transform matrix to apply to the Game Object before rendering. - * - * @return {boolean} `true` if the Game Object context was set, otherwise `false`. + * @function Phaser.Math.Angle.BetweenPoints + * @since 3.0.0 + * + * @param {(Phaser.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} point2 - The second point. + * + * @return {number} The angle in radians. */ -var SetTransform = function (renderer, ctx, src, camera, parentMatrix) +var BetweenPoints = function (point1, point2) { - var alpha = camera.alpha * src.alpha; - - if (alpha <= 0) - { - // Nothing to see, so don't waste time calculating stuff - return false; - } - - var camMatrix = renderer._tempMatrix1.copyFromArray(camera.matrix.matrix); - var gameObjectMatrix = renderer._tempMatrix2.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - var calcMatrix = renderer._tempMatrix3; - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - gameObjectMatrix.e = src.x; - gameObjectMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(gameObjectMatrix, calcMatrix); - } - else - { - gameObjectMatrix.e -= camera.scrollX * src.scrollFactorX; - gameObjectMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(gameObjectMatrix, calcMatrix); - } - - // Blend Mode - ctx.globalCompositeOperation = renderer.blendModes[src.blendMode]; - - // Alpha - ctx.globalAlpha = alpha; - - ctx.save(); - - calcMatrix.setToContext(ctx); - - return true; + return Math.atan2(point2.y - point1.y, point2.x - point1.x); }; -module.exports = SetTransform; +module.exports = BetweenPoints; /***/ }), +/* 39 */ +/***/ (function(module, exports) { -/***/ "../../../src/scene/events/BOOT_EVENT.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/BOOT_EVENT.js ***! - \*********************************************************/ -/*! no static exports found */ +/** + * @author Richard Davey + * @copyright 2019 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.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} 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; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Normalize = __webpack_require__(16); + +/** + * 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; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(1); + +/** + * 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; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. + * + * TODO: Wrap the angles in this function? + * + * @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; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Distance + */ + +module.exports = { + + Between: __webpack_require__(45), + Power: __webpack_require__(46), + Squared: __webpack_require__(47) + +}; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing + */ + +module.exports = { + + Back: __webpack_require__(49), + Bounce: __webpack_require__(53), + Circular: __webpack_require__(57), + Cubic: __webpack_require__(61), + Elastic: __webpack_require__(65), + Expo: __webpack_require__(69), + Linear: __webpack_require__(73), + Quadratic: __webpack_require__(75), + Quartic: __webpack_require__(79), + Quintic: __webpack_require__(83), + Sine: __webpack_require__(87), + Stepped: __webpack_require__(91) + +}; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Back + */ + +module.exports = { + + In: __webpack_require__(50), + Out: __webpack_require__(51), + InOut: __webpack_require__(52) + +}; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(54), + Out: __webpack_require__(55), + InOut: __webpack_require__(56) + +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 56 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(58), + Out: __webpack_require__(59), + InOut: __webpack_require__(60) + +}; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 60 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(62), + Out: __webpack_require__(63), + InOut: __webpack_require__(64) + +}; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 64 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(66), + Out: __webpack_require__(67), + InOut: __webpack_require__(68) + +}; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 67 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(70), + Out: __webpack_require__(71), + InOut: __webpack_require__(72) + +}; + + +/***/ }), +/* 70 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 71 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Linear + */ + +module.exports = __webpack_require__(74); + + +/***/ }), +/* 74 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Linear easing (no variation). + * + * @function Phaser.Math.Easing.Linear.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; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(76), + Out: __webpack_require__(77), + InOut: __webpack_require__(78) + +}; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 77 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(80), + Out: __webpack_require__(81), + InOut: __webpack_require__(82) + +}; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(84), + Out: __webpack_require__(85), + InOut: __webpack_require__(86) + +}; + + +/***/ }), +/* 84 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 86 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(88), + Out: __webpack_require__(89), + InOut: __webpack_require__(90) + +}; + + +/***/ }), +/* 88 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(92); + + +/***/ }), +/* 92 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Stepped easing. + * + * @function Phaser.Math.Easing.Stepped.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; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Fuzzy + */ + +module.exports = { + + Ceil: __webpack_require__(94), + Equal: __webpack_require__(95), + Floor: __webpack_require__(96), + GreaterThan: __webpack_require__(97), + LessThan: __webpack_require__(98) + +}; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 95 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 96 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Interpolation + */ + +module.exports = { + + Bezier: __webpack_require__(100), + CatmullRom: __webpack_require__(101), + CubicBezier: __webpack_require__(102), + Linear: __webpack_require__(103), + QuadraticBezier: __webpack_require__(104), + SmoothStep: __webpack_require__(105), + SmootherStep: __webpack_require__(106) + +}; + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bernstein = __webpack_require__(19); + +/** + * 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; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CatmullRom = __webpack_require__(21); + +/** + * 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; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Linear = __webpack_require__(22); + +/** + * 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; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmoothStep = __webpack_require__(23); + +/** + * 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; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmootherStep = __webpack_require__(24); + +/** + * 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; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Pow2 + */ + +module.exports = { + + GetNext: __webpack_require__(108), + IsSize: __webpack_require__(109), + IsValue: __webpack_require__(110) + +}; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.GetPowerOfTwo + * @since 3.0.0 + * + * @param {number} value - The value. + * + * @return {integer} 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; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsSizePowerOfTwo + * @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; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsValuePowerOfTwo + * @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; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Snap + */ + +module.exports = { + + Ceil: __webpack_require__(112), + Floor: __webpack_require__(113), + To: __webpack_require__(114) + +}; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} [array] - The array to be shuffled. + * + * @return {array} 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; + + +/***/ }), +/* 116 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 117 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} min - The minimum value. + * @param {integer} max - The maximum value. + * + * @return {integer} The random integer. + */ +var Between = function (min, max) +{ + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +module.exports = Between; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [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; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. + * @param {integer} [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; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(9); + +/** + * 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; +}; + +module.exports = FromPercent; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the speed required to cover a distance in the time given. + * + * @function Phaser.Math.GetSpeed + * @since 3.0.0 + * + * @param {number} distance - The distance to travel in pixels. + * @param {integer} time - The time, in ms, to cover the distance in. + * + * @return {number} The amount you will need to increment the position by each step in order to cover the distance in the time given. + */ +var GetSpeed = function (distance, time) +{ + return (distance / time) / 1000; +}; + +module.exports = GetSpeed; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 128 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 130 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 131 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; } + + // TODO: Not spherical; should fix this for more uniform distribution + 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; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 133 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` by the given `angle`. + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @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.Geom.Point} The given point, rotated by the given angle around the given coordinates. + */ +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; + + +/***/ }), +/* 134 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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`. + * + * @function Phaser.Math.RotateAroundDistance + * @since 3.0.0 + * + * @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.Geom.Point} 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; + + +/***/ }), +/* 135 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {integer} [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; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(7); + +/** + * Returns a Vec2 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 Vec2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {integer} index - The position within the grid to get the x/y value for. + * @param {integer} width - The width of the grid. + * @param {integer} 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; + } + + out.set(x, y); + } + + return out; +}; + +module.exports = ToXY; + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(7); + +/** + * 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; + + +/***/ }), +/* 140 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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) + { + // TODO: is this really the same as Vector3? + // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/ + // 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; + }, + + /** + * 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; + } + +}); + +// TODO: Check if these are required internally, if not, remove. +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; + + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector3 = __webpack_require__(10); +var Matrix4 = __webpack_require__(27); +var Quaternion = __webpack_require__(28); + +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; + + +/***/ }), +/* 143 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @readonly + * @since 3.0.0 + */ + DEFAULT: 0, + + /** + * Linear Scale Mode. + * + * @name Phaser.ScaleModes.LINEAR + * @type {integer} + * @readonly + * @since 3.0.0 + */ + LINEAR: 0, + + /** + * Nearest Scale Mode. + * + * @name Phaser.ScaleModes.NEAREST + * @type {integer} + * @readonly + * @since 3.0.0 + */ + NEAREST: 1 + +}; + +module.exports = ScaleModes; + + +/***/ }), +/* 144 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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 multiplied by resolution. + * @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} resolution - The current resolution. Defaults to 1 at the moment. + * @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'; + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var BasePlugin = __webpack_require__(146); +var Class = __webpack_require__(0); +var SceneEvents = __webpack_require__(147); + +/** + * @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. + */ +var ScenePlugin = new Class({ + + Extends: BasePlugin, + + initialize: + + function ScenePlugin (scene, pluginManager) + { + BasePlugin.call(this, pluginManager); + + this.scene = scene; + this.systems = scene.sys; + + 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 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 () + { + } + +}); + +module.exports = ScenePlugin; + + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 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; + + /** + * 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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#scene + * @type {?Phaser.Scene} + * @protected + * @since 3.8.0 + */ + this.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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#systems + * @type {?Phaser.Scenes.Systems} + * @protected + * @since 3.8.0 + */ + this.systems; + }, + + /** + * Called by the PluginManager when this 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. + * + * @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 () + { + }, + + /** + * Called by the PluginManager when this plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + * + * @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); + }, + + /** + * Called by the PluginManager when this 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. + * + * @method Phaser.Plugins.BasePlugin#stop + * @since 3.8.0 + */ + stop: function () + { + }, + + /** + * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots. + * By this point the plugin properties `scene` and `systems` will have already been set. + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + * + * @method Phaser.Plugins.BasePlugin#boot + * @since 3.8.0 + */ + boot: function () + { + // Here are the Scene events you can listen to. + // At the very least you should offer a destroy handler for when the Scene closes down. + + // var eventEmitter = this.systems.events; + + // eventEmitter.once('destroy', this.sceneDestroy, this); + // eventEmitter.on('start', this.sceneStart, this); + // eventEmitter.on('preupdate', this.scenePreUpdate, this); + // eventEmitter.on('update', this.sceneUpdate, this); + // eventEmitter.on('postupdate', this.scenePostUpdate, this); + // eventEmitter.on('pause', this.scenePause, this); + // eventEmitter.on('resume', this.sceneResume, this); + // eventEmitter.on('sleep', this.sceneSleep, this); + // eventEmitter.on('wake', this.sceneWake, this); + // eventEmitter.on('shutdown', this.sceneShutdown, this); + // eventEmitter.on('destroy', this.sceneDestroy, this); + }, + + /** + * 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; + + +/***/ }), +/* 147 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Scenes.Events + */ + +module.exports = { + + BOOT: __webpack_require__(148), + CREATE: __webpack_require__(149), + DESTROY: __webpack_require__(150), + PAUSE: __webpack_require__(151), + POST_UPDATE: __webpack_require__(152), + PRE_UPDATE: __webpack_require__(153), + READY: __webpack_require__(154), + RENDER: __webpack_require__(155), + RESUME: __webpack_require__(156), + SHUTDOWN: __webpack_require__(157), + SLEEP: __webpack_require__(158), + START: __webpack_require__(159), + TRANSITION_COMPLETE: __webpack_require__(160), + TRANSITION_INIT: __webpack_require__(161), + TRANSITION_OUT: __webpack_require__(162), + TRANSITION_START: __webpack_require__(163), + TRANSITION_WAKE: __webpack_require__(164), + UPDATE: __webpack_require__(165), + WAKE: __webpack_require__(166) + +}; + + +/***/ }), +/* 148 */ /***/ (function(module, exports) { /** @@ -9997,12 +13285,7 @@ module.exports = 'boot'; /***/ }), - -/***/ "../../../src/scene/events/CREATE_EVENT.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/CREATE_EVENT.js ***! - \***********************************************************/ -/*! no static exports found */ +/* 149 */ /***/ (function(module, exports) { /** @@ -10031,12 +13314,7 @@ module.exports = 'create'; /***/ }), - -/***/ "../../../src/scene/events/DESTROY_EVENT.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/DESTROY_EVENT.js ***! - \************************************************************/ -/*! no static exports found */ +/* 150 */ /***/ (function(module, exports) { /** @@ -10063,12 +13341,7 @@ module.exports = 'destroy'; /***/ }), - -/***/ "../../../src/scene/events/PAUSE_EVENT.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/PAUSE_EVENT.js ***! - \**********************************************************/ -/*! no static exports found */ +/* 151 */ /***/ (function(module, exports) { /** @@ -10095,12 +13368,7 @@ module.exports = 'pause'; /***/ }), - -/***/ "../../../src/scene/events/POST_UPDATE_EVENT.js": -/*!****************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/POST_UPDATE_EVENT.js ***! - \****************************************************************/ -/*! no static exports found */ +/* 152 */ /***/ (function(module, exports) { /** @@ -10137,12 +13405,7 @@ module.exports = 'postupdate'; /***/ }), - -/***/ "../../../src/scene/events/PRE_UPDATE_EVENT.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/PRE_UPDATE_EVENT.js ***! - \***************************************************************/ -/*! no static exports found */ +/* 153 */ /***/ (function(module, exports) { /** @@ -10179,12 +13442,7 @@ module.exports = 'preupdate'; /***/ }), - -/***/ "../../../src/scene/events/READY_EVENT.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/READY_EVENT.js ***! - \**********************************************************/ -/*! no static exports found */ +/* 154 */ /***/ (function(module, exports) { /** @@ -10212,12 +13470,7 @@ module.exports = 'ready'; /***/ }), - -/***/ "../../../src/scene/events/RENDER_EVENT.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/RENDER_EVENT.js ***! - \***********************************************************/ -/*! no static exports found */ +/* 155 */ /***/ (function(module, exports) { /** @@ -10253,12 +13506,7 @@ module.exports = 'render'; /***/ }), - -/***/ "../../../src/scene/events/RESUME_EVENT.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/RESUME_EVENT.js ***! - \***********************************************************/ -/*! no static exports found */ +/* 156 */ /***/ (function(module, exports) { /** @@ -10285,12 +13533,7 @@ module.exports = 'resume'; /***/ }), - -/***/ "../../../src/scene/events/SHUTDOWN_EVENT.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/SHUTDOWN_EVENT.js ***! - \*************************************************************/ -/*! no static exports found */ +/* 157 */ /***/ (function(module, exports) { /** @@ -10320,12 +13563,7 @@ module.exports = 'shutdown'; /***/ }), - -/***/ "../../../src/scene/events/SLEEP_EVENT.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/SLEEP_EVENT.js ***! - \**********************************************************/ -/*! no static exports found */ +/* 158 */ /***/ (function(module, exports) { /** @@ -10352,12 +13590,7 @@ module.exports = 'sleep'; /***/ }), - -/***/ "../../../src/scene/events/START_EVENT.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/START_EVENT.js ***! - \**********************************************************/ -/*! no static exports found */ +/* 159 */ /***/ (function(module, exports) { /** @@ -10382,12 +13615,7 @@ module.exports = 'start'; /***/ }), - -/***/ "../../../src/scene/events/TRANSITION_COMPLETE_EVENT.js": -/*!************************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js ***! - \************************************************************************/ -/*! no static exports found */ +/* 160 */ /***/ (function(module, exports) { /** @@ -10423,12 +13651,7 @@ module.exports = 'transitioncomplete'; /***/ }), - -/***/ "../../../src/scene/events/TRANSITION_INIT_EVENT.js": -/*!********************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_INIT_EVENT.js ***! - \********************************************************************/ -/*! no static exports found */ +/* 161 */ /***/ (function(module, exports) { /** @@ -10465,12 +13688,7 @@ module.exports = 'transitioninit'; /***/ }), - -/***/ "../../../src/scene/events/TRANSITION_OUT_EVENT.js": -/*!*******************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_OUT_EVENT.js ***! - \*******************************************************************/ -/*! no static exports found */ +/* 162 */ /***/ (function(module, exports) { /** @@ -10504,12 +13722,7 @@ module.exports = 'transitionout'; /***/ }), - -/***/ "../../../src/scene/events/TRANSITION_START_EVENT.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_START_EVENT.js ***! - \*********************************************************************/ -/*! no static exports found */ +/* 163 */ /***/ (function(module, exports) { /** @@ -10549,12 +13762,7 @@ module.exports = 'transitionstart'; /***/ }), - -/***/ "../../../src/scene/events/TRANSITION_WAKE_EVENT.js": -/*!********************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js ***! - \********************************************************************/ -/*! no static exports found */ +/* 164 */ /***/ (function(module, exports) { /** @@ -10589,12 +13797,7 @@ module.exports = 'transitionwake'; /***/ }), - -/***/ "../../../src/scene/events/UPDATE_EVENT.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/UPDATE_EVENT.js ***! - \***********************************************************/ -/*! no static exports found */ +/* 165 */ /***/ (function(module, exports) { /** @@ -10631,12 +13834,7 @@ module.exports = 'update'; /***/ }), - -/***/ "../../../src/scene/events/WAKE_EVENT.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/WAKE_EVENT.js ***! - \*********************************************************/ -/*! no static exports found */ +/* 166 */ /***/ (function(module, exports) { /** @@ -10663,636 +13861,9452 @@ module.exports = 'wake'; /***/ }), - -/***/ "../../../src/scene/events/index.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/index.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Scenes.Events - */ - -module.exports = { - - BOOT: __webpack_require__(/*! ./BOOT_EVENT */ "../../../src/scene/events/BOOT_EVENT.js"), - CREATE: __webpack_require__(/*! ./CREATE_EVENT */ "../../../src/scene/events/CREATE_EVENT.js"), - DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ "../../../src/scene/events/DESTROY_EVENT.js"), - PAUSE: __webpack_require__(/*! ./PAUSE_EVENT */ "../../../src/scene/events/PAUSE_EVENT.js"), - POST_UPDATE: __webpack_require__(/*! ./POST_UPDATE_EVENT */ "../../../src/scene/events/POST_UPDATE_EVENT.js"), - PRE_UPDATE: __webpack_require__(/*! ./PRE_UPDATE_EVENT */ "../../../src/scene/events/PRE_UPDATE_EVENT.js"), - READY: __webpack_require__(/*! ./READY_EVENT */ "../../../src/scene/events/READY_EVENT.js"), - RENDER: __webpack_require__(/*! ./RENDER_EVENT */ "../../../src/scene/events/RENDER_EVENT.js"), - RESUME: __webpack_require__(/*! ./RESUME_EVENT */ "../../../src/scene/events/RESUME_EVENT.js"), - SHUTDOWN: __webpack_require__(/*! ./SHUTDOWN_EVENT */ "../../../src/scene/events/SHUTDOWN_EVENT.js"), - SLEEP: __webpack_require__(/*! ./SLEEP_EVENT */ "../../../src/scene/events/SLEEP_EVENT.js"), - START: __webpack_require__(/*! ./START_EVENT */ "../../../src/scene/events/START_EVENT.js"), - TRANSITION_COMPLETE: __webpack_require__(/*! ./TRANSITION_COMPLETE_EVENT */ "../../../src/scene/events/TRANSITION_COMPLETE_EVENT.js"), - TRANSITION_INIT: __webpack_require__(/*! ./TRANSITION_INIT_EVENT */ "../../../src/scene/events/TRANSITION_INIT_EVENT.js"), - TRANSITION_OUT: __webpack_require__(/*! ./TRANSITION_OUT_EVENT */ "../../../src/scene/events/TRANSITION_OUT_EVENT.js"), - TRANSITION_START: __webpack_require__(/*! ./TRANSITION_START_EVENT */ "../../../src/scene/events/TRANSITION_START_EVENT.js"), - TRANSITION_WAKE: __webpack_require__(/*! ./TRANSITION_WAKE_EVENT */ "../../../src/scene/events/TRANSITION_WAKE_EVENT.js"), - UPDATE: __webpack_require__(/*! ./UPDATE_EVENT */ "../../../src/scene/events/UPDATE_EVENT.js"), - WAKE: __webpack_require__(/*! ./WAKE_EVENT */ "../../../src/scene/events/WAKE_EVENT.js") - -}; - - -/***/ }), - -/***/ "../../../src/utils/Class.js": -/*!*********************************************!*\ - !*** D:/wamp/www/phaser/src/utils/Class.js ***! - \*********************************************/ -/*! no static exports found */ +/* 167 */ /***/ (function(module, exports) { -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ +/*** IMPORTS FROM imports-loader ***/ +(function() { -// 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; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var spine; +(function (spine) { + var Animation = (function () { + function Animation(name, timelines, duration) { + if (name == null) + throw new Error("name cannot be null."); + if (timelines == null) + throw new Error("timelines cannot be null."); + this.name = name; + this.timelines = timelines; + this.duration = duration; } - - 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; -} - -/** - * Extends the given `myClass` object's prototype with the properties of `definition`. - * - * @function extend - * @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. - */ -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'); + Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (loop && this.duration != 0) { + time %= this.duration; + if (lastTime > 0) + lastTime %= this.duration; } - - Object.defineProperty(ctor.prototype, k, def); - } - else - { - ctor.prototype[k] = definition[k]; - } - } -} - -/** - * Applies the given `mixins` to the prototype of `myClass`. - * - * @function mixin - * @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) - { - return; - } - - if (!Array.isArray(mixins)) - { - mixins = [ mixins ]; - } - - 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); + var timelines = this.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction); }; - } - 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; - - -/***/ }), - -/***/ "../../../src/utils/NOOP.js": -/*!********************************************!*\ - !*** D:/wamp/www/phaser/src/utils/NOOP.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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; - - -/***/ }), - -/***/ "../../../src/utils/object/Extend.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/object/Extend.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var IsPlainObject = __webpack_require__(/*! ./IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); - -// @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 - * - * @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) - { + Animation.binarySearch = function (values, target, step) { + if (step === void 0) { step = 1; } + var low = 0; + var high = values.length / step - 2; + if (high == 0) + return step; + var current = high >>> 1; + while (true) { + if (values[(current + 1) * step] <= target) + low = current + 1; + else + high = current; + if (low == high) + return (low + 1) * step; + current = (low + high) >>> 1; + } + }; + Animation.linearSearch = function (values, target, step) { + for (var i = 0, last = values.length - step; i <= last; i += step) + if (values[i] > target) + return i; + return -1; + }; + return Animation; + }()); + spine.Animation = Animation; + var MixBlend; + (function (MixBlend) { + MixBlend[MixBlend["setup"] = 0] = "setup"; + MixBlend[MixBlend["first"] = 1] = "first"; + MixBlend[MixBlend["replace"] = 2] = "replace"; + MixBlend[MixBlend["add"] = 3] = "add"; + })(MixBlend = spine.MixBlend || (spine.MixBlend = {})); + var MixDirection; + (function (MixDirection) { + MixDirection[MixDirection["in"] = 0] = "in"; + MixDirection[MixDirection["out"] = 1] = "out"; + })(MixDirection = spine.MixDirection || (spine.MixDirection = {})); + var TimelineType; + (function (TimelineType) { + TimelineType[TimelineType["rotate"] = 0] = "rotate"; + TimelineType[TimelineType["translate"] = 1] = "translate"; + TimelineType[TimelineType["scale"] = 2] = "scale"; + TimelineType[TimelineType["shear"] = 3] = "shear"; + TimelineType[TimelineType["attachment"] = 4] = "attachment"; + TimelineType[TimelineType["color"] = 5] = "color"; + TimelineType[TimelineType["deform"] = 6] = "deform"; + TimelineType[TimelineType["event"] = 7] = "event"; + TimelineType[TimelineType["drawOrder"] = 8] = "drawOrder"; + TimelineType[TimelineType["ikConstraint"] = 9] = "ikConstraint"; + TimelineType[TimelineType["transformConstraint"] = 10] = "transformConstraint"; + TimelineType[TimelineType["pathConstraintPosition"] = 11] = "pathConstraintPosition"; + TimelineType[TimelineType["pathConstraintSpacing"] = 12] = "pathConstraintSpacing"; + TimelineType[TimelineType["pathConstraintMix"] = 13] = "pathConstraintMix"; + TimelineType[TimelineType["twoColor"] = 14] = "twoColor"; + })(TimelineType = spine.TimelineType || (spine.TimelineType = {})); + var CurveTimeline = (function () { + function CurveTimeline(frameCount) { + if (frameCount <= 0) + throw new Error("frameCount must be > 0: " + frameCount); + this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE); + } + CurveTimeline.prototype.getFrameCount = function () { + return this.curves.length / CurveTimeline.BEZIER_SIZE + 1; + }; + CurveTimeline.prototype.setLinear = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR; + }; + CurveTimeline.prototype.setStepped = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED; + }; + CurveTimeline.prototype.getCurveType = function (frameIndex) { + var index = frameIndex * CurveTimeline.BEZIER_SIZE; + if (index == this.curves.length) + return CurveTimeline.LINEAR; + var type = this.curves[index]; + if (type == CurveTimeline.LINEAR) + return CurveTimeline.LINEAR; + if (type == CurveTimeline.STEPPED) + return CurveTimeline.STEPPED; + return CurveTimeline.BEZIER; + }; + CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) { + var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03; + var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006; + var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy; + var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var curves = this.curves; + curves[i++] = CurveTimeline.BEZIER; + var x = dfx, y = dfy; + for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + curves[i] = x; + curves[i + 1] = y; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + x += dfx; + y += dfy; + } + }; + CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) { + percent = spine.MathUtils.clamp(percent, 0, 1); + var curves = this.curves; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var type = curves[i]; + if (type == CurveTimeline.LINEAR) + return percent; + if (type == CurveTimeline.STEPPED) + return 0; + i++; + var x = 0; + for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + x = curves[i]; + if (x >= percent) { + var prevX = void 0, prevY = void 0; + if (i == start) { + prevX = 0; + prevY = 0; + } + else { + prevX = curves[i - 2]; + prevY = curves[i - 1]; + } + return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); + } + } + var y = curves[i - 1]; + return y + (1 - y) * (percent - x) / (1 - x); + }; + CurveTimeline.LINEAR = 0; + CurveTimeline.STEPPED = 1; + CurveTimeline.BEZIER = 2; + CurveTimeline.BEZIER_SIZE = 10 * 2 - 1; + return CurveTimeline; + }()); + spine.CurveTimeline = CurveTimeline; + var RotateTimeline = (function (_super) { + __extends(RotateTimeline, _super); + function RotateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount << 1); + return _this; + } + RotateTimeline.prototype.getPropertyId = function () { + return (TimelineType.rotate << 24) + this.boneIndex; + }; + RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) { + frameIndex <<= 1; + this.frames[frameIndex] = time; + this.frames[frameIndex + RotateTimeline.ROTATION] = degrees; + }; + RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation; + return; + case MixBlend.first: + var r_1 = bone.data.rotation - bone.rotation; + bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha; + } + return; + } + if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { + var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION]; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + r_2 * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r_2 += bone.data.rotation - bone.rotation; + r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; + case MixBlend.add: + bone.rotation += r_2 * alpha; + } + return; + } + var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES); + var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime)); + var r = frames[frame + RotateTimeline.ROTATION] - prevRotation; + r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r += bone.data.rotation - bone.rotation; + case MixBlend.add: + bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + } + }; + RotateTimeline.ENTRIES = 2; + RotateTimeline.PREV_TIME = -2; + RotateTimeline.PREV_ROTATION = -1; + RotateTimeline.ROTATION = 1; + return RotateTimeline; + }(CurveTimeline)); + spine.RotateTimeline = RotateTimeline; + var TranslateTimeline = (function (_super) { + __extends(TranslateTimeline, _super); + function TranslateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES); + return _this; + } + TranslateTimeline.prototype.getPropertyId = function () { + return (TimelineType.translate << 24) + this.boneIndex; + }; + TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) { + frameIndex *= TranslateTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TranslateTimeline.X] = x; + this.frames[frameIndex + TranslateTimeline.Y] = y; + }; + TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x; + bone.y = bone.data.y; + return; + case MixBlend.first: + bone.x += (bone.data.x - bone.x) * alpha; + bone.y += (bone.data.y - bone.y) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { + x = frames[frames.length + TranslateTimeline.PREV_X]; + y = frames[frames.length + TranslateTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES); + x = frames[frame + TranslateTimeline.PREV_X]; + y = frames[frame + TranslateTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime)); + x += (frames[frame + TranslateTimeline.X] - x) * percent; + y += (frames[frame + TranslateTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x + x * alpha; + bone.y = bone.data.y + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.x += (bone.data.x + x - bone.x) * alpha; + bone.y += (bone.data.y + y - bone.y) * alpha; + break; + case MixBlend.add: + bone.x += x * alpha; + bone.y += y * alpha; + } + }; + TranslateTimeline.ENTRIES = 3; + TranslateTimeline.PREV_TIME = -3; + TranslateTimeline.PREV_X = -2; + TranslateTimeline.PREV_Y = -1; + TranslateTimeline.X = 1; + TranslateTimeline.Y = 2; + return TranslateTimeline; + }(CurveTimeline)); + spine.TranslateTimeline = TranslateTimeline; + var ScaleTimeline = (function (_super) { + __extends(ScaleTimeline, _super); + function ScaleTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ScaleTimeline.prototype.getPropertyId = function () { + return (TimelineType.scale << 24) + this.boneIndex; + }; + ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.scaleX = bone.data.scaleX; + bone.scaleY = bone.data.scaleY; + return; + case MixBlend.first: + bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha; + bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { + x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX; + y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY; + } + else { + var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES); + x = frames[frame + ScaleTimeline.PREV_X]; + y = frames[frame + ScaleTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime)); + x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX; + y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY; + } + if (alpha == 1) { + if (blend == MixBlend.add) { + bone.scaleX += x - bone.data.scaleX; + bone.scaleY += y - bone.data.scaleY; + } + else { + bone.scaleX = x; + bone.scaleY = y; + } + } + else { + var bx = 0, by = 0; + if (direction == MixDirection.out) { + switch (blend) { + case MixBlend.setup: + bx = bone.data.scaleX; + by = bone.data.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.add: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha; + } + } + else { + switch (blend) { + case MixBlend.setup: + bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.add: + bx = spine.MathUtils.signum(x); + by = spine.MathUtils.signum(y); + bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha; + bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha; + } + } + } + }; + return ScaleTimeline; + }(TranslateTimeline)); + spine.ScaleTimeline = ScaleTimeline; + var ShearTimeline = (function (_super) { + __extends(ShearTimeline, _super); + function ShearTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ShearTimeline.prototype.getPropertyId = function () { + return (TimelineType.shear << 24) + this.boneIndex; + }; + ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX; + bone.shearY = bone.data.shearY; + return; + case MixBlend.first: + bone.shearX += (bone.data.shearX - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY - bone.shearY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { + x = frames[frames.length + ShearTimeline.PREV_X]; + y = frames[frames.length + ShearTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES); + x = frames[frame + ShearTimeline.PREV_X]; + y = frames[frame + ShearTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime)); + x = x + (frames[frame + ShearTimeline.X] - x) * percent; + y = y + (frames[frame + ShearTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX + x * alpha; + bone.shearY = bone.data.shearY + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha; + break; + case MixBlend.add: + bone.shearX += x * alpha; + bone.shearY += y * alpha; + } + }; + return ShearTimeline; + }(TranslateTimeline)); + spine.ShearTimeline = ShearTimeline; + var ColorTimeline = (function (_super) { + __extends(ColorTimeline, _super); + function ColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES); + return _this; + } + ColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.color << 24) + this.slotIndex; + }; + ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) { + frameIndex *= ColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + ColorTimeline.R] = r; + this.frames[frameIndex + ColorTimeline.G] = g; + this.frames[frameIndex + ColorTimeline.B] = b; + this.frames[frameIndex + ColorTimeline.A] = a; + }; + ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + return; + case MixBlend.first: + var color = slot.color, setup = slot.data.color; + color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha); + } + return; + } + var r = 0, g = 0, b = 0, a = 0; + if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + ColorTimeline.PREV_R]; + g = frames[i + ColorTimeline.PREV_G]; + b = frames[i + ColorTimeline.PREV_B]; + a = frames[i + ColorTimeline.PREV_A]; + } + else { + var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES); + r = frames[frame + ColorTimeline.PREV_R]; + g = frames[frame + ColorTimeline.PREV_G]; + b = frames[frame + ColorTimeline.PREV_B]; + a = frames[frame + ColorTimeline.PREV_A]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + ColorTimeline.R] - r) * percent; + g += (frames[frame + ColorTimeline.G] - g) * percent; + b += (frames[frame + ColorTimeline.B] - b) * percent; + a += (frames[frame + ColorTimeline.A] - a) * percent; + } + if (alpha == 1) + slot.color.set(r, g, b, a); + else { + var color = slot.color; + if (blend == MixBlend.setup) + color.setFromColor(slot.data.color); + color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); + } + }; + ColorTimeline.ENTRIES = 5; + ColorTimeline.PREV_TIME = -5; + ColorTimeline.PREV_R = -4; + ColorTimeline.PREV_G = -3; + ColorTimeline.PREV_B = -2; + ColorTimeline.PREV_A = -1; + ColorTimeline.R = 1; + ColorTimeline.G = 2; + ColorTimeline.B = 3; + ColorTimeline.A = 4; + return ColorTimeline; + }(CurveTimeline)); + spine.ColorTimeline = ColorTimeline; + var TwoColorTimeline = (function (_super) { + __extends(TwoColorTimeline, _super); + function TwoColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES); + return _this; + } + TwoColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.twoColor << 24) + this.slotIndex; + }; + TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) { + frameIndex *= TwoColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TwoColorTimeline.R] = r; + this.frames[frameIndex + TwoColorTimeline.G] = g; + this.frames[frameIndex + TwoColorTimeline.B] = b; + this.frames[frameIndex + TwoColorTimeline.A] = a; + this.frames[frameIndex + TwoColorTimeline.R2] = r2; + this.frames[frameIndex + TwoColorTimeline.G2] = g2; + this.frames[frameIndex + TwoColorTimeline.B2] = b2; + }; + TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + slot.darkColor.setFromColor(slot.data.darkColor); + return; + case MixBlend.first: + var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor; + light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha); + dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0); + } + return; + } + var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; + if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + TwoColorTimeline.PREV_R]; + g = frames[i + TwoColorTimeline.PREV_G]; + b = frames[i + TwoColorTimeline.PREV_B]; + a = frames[i + TwoColorTimeline.PREV_A]; + r2 = frames[i + TwoColorTimeline.PREV_R2]; + g2 = frames[i + TwoColorTimeline.PREV_G2]; + b2 = frames[i + TwoColorTimeline.PREV_B2]; + } + else { + var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES); + r = frames[frame + TwoColorTimeline.PREV_R]; + g = frames[frame + TwoColorTimeline.PREV_G]; + b = frames[frame + TwoColorTimeline.PREV_B]; + a = frames[frame + TwoColorTimeline.PREV_A]; + r2 = frames[frame + TwoColorTimeline.PREV_R2]; + g2 = frames[frame + TwoColorTimeline.PREV_G2]; + b2 = frames[frame + TwoColorTimeline.PREV_B2]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + TwoColorTimeline.R] - r) * percent; + g += (frames[frame + TwoColorTimeline.G] - g) * percent; + b += (frames[frame + TwoColorTimeline.B] - b) * percent; + a += (frames[frame + TwoColorTimeline.A] - a) * percent; + r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent; + g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent; + b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent; + } + if (alpha == 1) { + slot.color.set(r, g, b, a); + slot.darkColor.set(r2, g2, b2, 1); + } + else { + var light = slot.color, dark = slot.darkColor; + if (blend == MixBlend.setup) { + light.setFromColor(slot.data.color); + dark.setFromColor(slot.data.darkColor); + } + light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); + dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0); + } + }; + TwoColorTimeline.ENTRIES = 8; + TwoColorTimeline.PREV_TIME = -8; + TwoColorTimeline.PREV_R = -7; + TwoColorTimeline.PREV_G = -6; + TwoColorTimeline.PREV_B = -5; + TwoColorTimeline.PREV_A = -4; + TwoColorTimeline.PREV_R2 = -3; + TwoColorTimeline.PREV_G2 = -2; + TwoColorTimeline.PREV_B2 = -1; + TwoColorTimeline.R = 1; + TwoColorTimeline.G = 2; + TwoColorTimeline.B = 3; + TwoColorTimeline.A = 4; + TwoColorTimeline.R2 = 5; + TwoColorTimeline.G2 = 6; + TwoColorTimeline.B2 = 7; + return TwoColorTimeline; + }(CurveTimeline)); + spine.TwoColorTimeline = TwoColorTimeline; + var AttachmentTimeline = (function () { + function AttachmentTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.attachmentNames = new Array(frameCount); + } + AttachmentTimeline.prototype.getPropertyId = function () { + return (TimelineType.attachment << 24) + this.slotIndex; + }; + AttachmentTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) { + this.frames[frameIndex] = time; + this.attachmentNames[frameIndex] = attachmentName; + }; + AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + if (direction == MixDirection.out && blend == MixBlend.setup) { + var attachmentName_1 = slot.data.attachmentName; + slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1)); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) { + var attachmentName_2 = slot.data.attachmentName; + slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2)); + } + return; + } + var frameIndex = 0; + if (time >= frames[frames.length - 1]) + frameIndex = frames.length - 1; + else + frameIndex = Animation.binarySearch(frames, time, 1) - 1; + var attachmentName = this.attachmentNames[frameIndex]; + skeleton.slots[this.slotIndex] + .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); + }; + return AttachmentTimeline; + }()); + spine.AttachmentTimeline = AttachmentTimeline; + var zeros = null; + var DeformTimeline = (function (_super) { + __extends(DeformTimeline, _super); + function DeformTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount); + _this.frameVertices = new Array(frameCount); + if (zeros == null) + zeros = spine.Utils.newFloatArray(64); + return _this; + } + DeformTimeline.prototype.getPropertyId = function () { + return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex; + }; + DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) { + this.frames[frameIndex] = time; + this.frameVertices[frameIndex] = vertices; + }; + DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var slotAttachment = slot.getAttachment(); + if (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment)) + return; + var verticesArray = slot.attachmentVertices; + if (verticesArray.length == 0) + blend = MixBlend.setup; + var frameVertices = this.frameVertices; + var vertexCount = frameVertices[0].length; + var frames = this.frames; + if (time < frames[0]) { + var vertexAttachment = slotAttachment; + switch (blend) { + case MixBlend.setup: + verticesArray.length = 0; + return; + case MixBlend.first: + if (alpha == 1) { + verticesArray.length = 0; + break; + } + var vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount); + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha; + } + else { + alpha = 1 - alpha; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] *= alpha; + } + } + return; + } + var vertices = spine.Utils.setArraySize(verticesArray, vertexCount); + if (time >= frames[frames.length - 1]) { + var lastVertices = frameVertices[frames.length - 1]; + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_1 = 0; i_1 < vertexCount; i_1++) { + vertices[i_1] += lastVertices[i_1] - setupVertices[i_1]; + } + } + else { + for (var i_2 = 0; i_2 < vertexCount; i_2++) + vertices[i_2] += lastVertices[i_2]; + } + } + else { + spine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount); + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_1 = slotAttachment; + if (vertexAttachment_1.bones == null) { + var setupVertices = vertexAttachment_1.vertices; + for (var i_3 = 0; i_3 < vertexCount; i_3++) { + var setup = setupVertices[i_3]; + vertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha; + } + } + else { + for (var i_4 = 0; i_4 < vertexCount; i_4++) + vertices[i_4] = lastVertices[i_4] * alpha; + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_5 = 0; i_5 < vertexCount; i_5++) + vertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_6 = 0; i_6 < vertexCount; i_6++) { + vertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha; + } + } + else { + for (var i_7 = 0; i_7 < vertexCount; i_7++) + vertices[i_7] += lastVertices[i_7] * alpha; + } + } + } + return; + } + var frame = Animation.binarySearch(frames, time); + var prevVertices = frameVertices[frame - 1]; + var nextVertices = frameVertices[frame]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime)); + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_8 = 0; i_8 < vertexCount; i_8++) { + var prev = prevVertices[i_8]; + vertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8]; + } + } + else { + for (var i_9 = 0; i_9 < vertexCount; i_9++) { + var prev = prevVertices[i_9]; + vertices[i_9] += prev + (nextVertices[i_9] - prev) * percent; + } + } + } + else { + for (var i_10 = 0; i_10 < vertexCount; i_10++) { + var prev = prevVertices[i_10]; + vertices[i_10] = prev + (nextVertices[i_10] - prev) * percent; + } + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_2 = slotAttachment; + if (vertexAttachment_2.bones == null) { + var setupVertices = vertexAttachment_2.vertices; + for (var i_11 = 0; i_11 < vertexCount; i_11++) { + var prev = prevVertices[i_11], setup = setupVertices[i_11]; + vertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha; + } + } + else { + for (var i_12 = 0; i_12 < vertexCount; i_12++) { + var prev = prevVertices[i_12]; + vertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha; + } + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_13 = 0; i_13 < vertexCount; i_13++) { + var prev = prevVertices[i_13]; + vertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha; + } + break; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_14 = 0; i_14 < vertexCount; i_14++) { + var prev = prevVertices[i_14]; + vertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha; + } + } + else { + for (var i_15 = 0; i_15 < vertexCount; i_15++) { + var prev = prevVertices[i_15]; + vertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha; + } + } + } + } + }; + return DeformTimeline; + }(CurveTimeline)); + spine.DeformTimeline = DeformTimeline; + var EventTimeline = (function () { + function EventTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.events = new Array(frameCount); + } + EventTimeline.prototype.getPropertyId = function () { + return TimelineType.event << 24; + }; + EventTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + EventTimeline.prototype.setFrame = function (frameIndex, event) { + this.frames[frameIndex] = event.time; + this.events[frameIndex] = event; + }; + EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + if (firedEvents == null) + return; + var frames = this.frames; + var frameCount = this.frames.length; + if (lastTime > time) { + this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction); + lastTime = -1; + } + else if (lastTime >= frames[frameCount - 1]) + return; + if (time < frames[0]) + return; + var frame = 0; + if (lastTime < frames[0]) + frame = 0; + else { + frame = Animation.binarySearch(frames, lastTime); + var frameTime = frames[frame]; + while (frame > 0) { + if (frames[frame - 1] != frameTime) + break; + frame--; + } + } + for (; frame < frameCount && time >= frames[frame]; frame++) + firedEvents.push(this.events[frame]); + }; + return EventTimeline; + }()); + spine.EventTimeline = EventTimeline; + var DrawOrderTimeline = (function () { + function DrawOrderTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.drawOrders = new Array(frameCount); + } + DrawOrderTimeline.prototype.getPropertyId = function () { + return TimelineType.drawOrder << 24; + }; + DrawOrderTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) { + this.frames[frameIndex] = time; + this.drawOrders[frameIndex] = drawOrder; + }; + DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var drawOrder = skeleton.drawOrder; + var slots = skeleton.slots; + if (direction == MixDirection.out && blend == MixBlend.setup) { + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frame = 0; + if (time >= frames[frames.length - 1]) + frame = frames.length - 1; + else + frame = Animation.binarySearch(frames, time) - 1; + var drawOrderToSetupIndex = this.drawOrders[frame]; + if (drawOrderToSetupIndex == null) + spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length); + else { + for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) + drawOrder[i] = slots[drawOrderToSetupIndex[i]]; + } + }; + return DrawOrderTimeline; + }()); + spine.DrawOrderTimeline = DrawOrderTimeline; + var IkConstraintTimeline = (function (_super) { + __extends(IkConstraintTimeline, _super); + function IkConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES); + return _this; + } + IkConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex; + }; + IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) { + frameIndex *= IkConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + IkConstraintTimeline.MIX] = mix; + this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection; + this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0; + this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0; + }; + IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.ikConstraints[this.ikConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + return; + case MixBlend.first: + constraint.mix += (constraint.data.mix - constraint.mix) * alpha; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + return; + } + if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + return; + } + var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES); + var mix = frames[frame + IkConstraintTimeline.PREV_MIX]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime)); + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + }; + IkConstraintTimeline.ENTRIES = 5; + IkConstraintTimeline.PREV_TIME = -5; + IkConstraintTimeline.PREV_MIX = -4; + IkConstraintTimeline.PREV_BEND_DIRECTION = -3; + IkConstraintTimeline.PREV_COMPRESS = -2; + IkConstraintTimeline.PREV_STRETCH = -1; + IkConstraintTimeline.MIX = 1; + IkConstraintTimeline.BEND_DIRECTION = 2; + IkConstraintTimeline.COMPRESS = 3; + IkConstraintTimeline.STRETCH = 4; + return IkConstraintTimeline; + }(CurveTimeline)); + spine.IkConstraintTimeline = IkConstraintTimeline; + var TransformConstraintTimeline = (function (_super) { + __extends(TransformConstraintTimeline, _super); + function TransformConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES); + return _this; + } + TransformConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex; + }; + TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) { + frameIndex *= TransformConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix; + this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix; + this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix; + }; + TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.transformConstraints[this.transformConstraintIndex]; + if (time < frames[0]) { + var data = constraint.data; + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + return; + case MixBlend.first: + constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha; + constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha; + constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha; + } + return; + } + var rotate = 0, translate = 0, scale = 0, shear = 0; + if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { + var i = frames.length; + rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[i + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[i + TransformConstraintTimeline.PREV_SHEAR]; + } + else { + var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES); + rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[frame + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent; + scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent; + shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent; + } + if (blend == MixBlend.setup) { + var data = constraint.data; + constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha; + constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha; + constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha; + constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + constraint.scaleMix += (scale - constraint.scaleMix) * alpha; + constraint.shearMix += (shear - constraint.shearMix) * alpha; + } + }; + TransformConstraintTimeline.ENTRIES = 5; + TransformConstraintTimeline.PREV_TIME = -5; + TransformConstraintTimeline.PREV_ROTATE = -4; + TransformConstraintTimeline.PREV_TRANSLATE = -3; + TransformConstraintTimeline.PREV_SCALE = -2; + TransformConstraintTimeline.PREV_SHEAR = -1; + TransformConstraintTimeline.ROTATE = 1; + TransformConstraintTimeline.TRANSLATE = 2; + TransformConstraintTimeline.SCALE = 3; + TransformConstraintTimeline.SHEAR = 4; + return TransformConstraintTimeline; + }(CurveTimeline)); + spine.TransformConstraintTimeline = TransformConstraintTimeline; + var PathConstraintPositionTimeline = (function (_super) { + __extends(PathConstraintPositionTimeline, _super); + function PathConstraintPositionTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES); + return _this; + } + PathConstraintPositionTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex; + }; + PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) { + frameIndex *= PathConstraintPositionTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value; + }; + PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.position = constraint.data.position; + return; + case MixBlend.first: + constraint.position += (constraint.data.position - constraint.position) * alpha; + } + return; + } + var position = 0; + if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) + position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES); + position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime)); + position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent; + } + if (blend == MixBlend.setup) + constraint.position = constraint.data.position + (position - constraint.data.position) * alpha; + else + constraint.position += (position - constraint.position) * alpha; + }; + PathConstraintPositionTimeline.ENTRIES = 2; + PathConstraintPositionTimeline.PREV_TIME = -2; + PathConstraintPositionTimeline.PREV_VALUE = -1; + PathConstraintPositionTimeline.VALUE = 1; + return PathConstraintPositionTimeline; + }(CurveTimeline)); + spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline; + var PathConstraintSpacingTimeline = (function (_super) { + __extends(PathConstraintSpacingTimeline, _super); + function PathConstraintSpacingTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + PathConstraintSpacingTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex; + }; + PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.spacing = constraint.data.spacing; + return; + case MixBlend.first: + constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha; + } + return; + } + var spacing = 0; + if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) + spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES); + spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime)); + spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent; + } + if (blend == MixBlend.setup) + constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha; + else + constraint.spacing += (spacing - constraint.spacing) * alpha; + }; + return PathConstraintSpacingTimeline; + }(PathConstraintPositionTimeline)); + spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline; + var PathConstraintMixTimeline = (function (_super) { + __extends(PathConstraintMixTimeline, _super); + function PathConstraintMixTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES); + return _this; + } + PathConstraintMixTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex; + }; + PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) { + frameIndex *= PathConstraintMixTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix; + }; + PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = constraint.data.rotateMix; + constraint.translateMix = constraint.data.translateMix; + return; + case MixBlend.first: + constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha; + } + return; + } + var rotate = 0, translate = 0; + if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { + rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE]; + } + else { + var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES); + rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent; + } + if (blend == MixBlend.setup) { + constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha; + constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + } + }; + PathConstraintMixTimeline.ENTRIES = 3; + PathConstraintMixTimeline.PREV_TIME = -3; + PathConstraintMixTimeline.PREV_ROTATE = -2; + PathConstraintMixTimeline.PREV_TRANSLATE = -1; + PathConstraintMixTimeline.ROTATE = 1; + PathConstraintMixTimeline.TRANSLATE = 2; + return PathConstraintMixTimeline; + }(CurveTimeline)); + spine.PathConstraintMixTimeline = PathConstraintMixTimeline; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationState = (function () { + function AnimationState(data) { + this.tracks = new Array(); + this.events = new Array(); + this.listeners = new Array(); + this.queue = new EventQueue(this); + this.propertyIDs = new spine.IntSet(); + this.animationsChanged = false; + this.timeScale = 1; + this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); }); + this.data = data; + } + AnimationState.prototype.update = function (delta) { + delta *= this.timeScale; + var tracks = this.tracks; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null) + continue; + current.animationLast = current.nextAnimationLast; + current.trackLast = current.nextTrackLast; + var currentDelta = delta * current.timeScale; + if (current.delay > 0) { + current.delay -= currentDelta; + if (current.delay > 0) + continue; + currentDelta = -current.delay; + current.delay = 0; + } + var next = current.next; + if (next != null) { + var nextTime = current.trackLast - next.delay; + if (nextTime >= 0) { + next.delay = 0; + next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; + current.trackTime += currentDelta; + this.setCurrent(i, next, true); + while (next.mixingFrom != null) { + next.mixTime += delta; + next = next.mixingFrom; + } + continue; + } + } + else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) { + tracks[i] = null; + this.queue.end(current); + this.disposeNext(current); 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 : []; + if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) { + var from = current.mixingFrom; + current.mixingFrom = null; + if (from != null) + from.mixingTo = null; + while (from != null) { + this.queue.end(from); + from = from.mixingFrom; + } + } + current.trackTime += currentDelta; + } + this.queue.drain(); + }; + AnimationState.prototype.updateMixingFrom = function (to, delta) { + var from = to.mixingFrom; + if (from == null) + return true; + var finished = this.updateMixingFrom(from, delta); + from.animationLast = from.nextAnimationLast; + from.trackLast = from.nextTrackLast; + if (to.mixTime > 0 && to.mixTime >= to.mixDuration) { + if (from.totalAlpha == 0 || to.mixDuration == 0) { + to.mixingFrom = from.mixingFrom; + if (from.mixingFrom != null) + from.mixingFrom.mixingTo = to; + to.interruptAlpha = from.interruptAlpha; + this.queue.end(from); + } + return finished; + } + from.trackTime += delta * from.timeScale; + to.mixTime += delta; + return false; + }; + AnimationState.prototype.apply = function (skeleton) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (this.animationsChanged) + this._animationsChanged(); + var events = this.events; + var tracks = this.tracks; + var applied = false; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null || current.delay > 0) + continue; + applied = true; + var blend = i == 0 ? spine.MixBlend.first : current.mixBlend; + var mix = current.alpha; + if (current.mixingFrom != null) + mix *= this.applyMixingFrom(current, skeleton, blend); + else if (current.trackTime >= current.trackEnd && current.next == null) + mix = 0; + var animationLast = current.animationLast, animationTime = current.getAnimationTime(); + var timelineCount = current.animation.timelines.length; + var timelines = current.animation.timelines; + if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) { + for (var ii = 0; ii < timelineCount; ii++) + timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]); + } + else { + var timelineMode = current.timelineMode; + var firstFrame = current.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = current.timelinesRotation; + for (var ii = 0; ii < timelineCount; ii++) { + var timeline = timelines[ii]; + var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup; + if (timeline instanceof spine.RotateTimeline) { + this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame); + } + else { + spine.Utils.webkit602BugfixHelper(mix, blend); + timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]); + } + } + } + this.queueEvents(current, animationTime); + events.length = 0; + current.nextAnimationLast = animationTime; + current.nextTrackLast = current.trackTime; + } + this.queue.drain(); + return applied; + }; + AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) { + var from = to.mixingFrom; + if (from.mixingFrom != null) + this.applyMixingFrom(from, skeleton, blend); + var mix = 0; + if (to.mixDuration == 0) { + mix = 1; + if (blend == spine.MixBlend.first) + blend = spine.MixBlend.setup; + } + else { + mix = to.mixTime / to.mixDuration; + if (mix > 1) + mix = 1; + if (blend != spine.MixBlend.first) + blend = from.mixBlend; + } + var events = mix < from.eventThreshold ? this.events : null; + var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold; + var animationLast = from.animationLast, animationTime = from.getAnimationTime(); + var timelineCount = from.animation.timelines.length; + var timelines = from.animation.timelines; + var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); + if (blend == spine.MixBlend.add) { + for (var i = 0; i < timelineCount; i++) + timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out); + } + else { + var timelineMode = from.timelineMode; + var timelineHoldMix = from.timelineHoldMix; + var firstFrame = from.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = from.timelinesRotation; + from.totalAlpha = 0; + for (var i = 0; i < timelineCount; i++) { + var timeline = timelines[i]; + var direction = spine.MixDirection.out; + var timelineBlend = void 0; + var alpha = 0; + switch (timelineMode[i]) { + case AnimationState.SUBSEQUENT: + if (!attachments && timeline instanceof spine.AttachmentTimeline) + continue; + if (!drawOrder && timeline instanceof spine.DrawOrderTimeline) + continue; + timelineBlend = blend; + alpha = alphaMix; + break; + case AnimationState.FIRST: + timelineBlend = spine.MixBlend.setup; + alpha = alphaMix; + break; + case AnimationState.HOLD: + timelineBlend = spine.MixBlend.setup; + alpha = alphaHold; + break; + default: + timelineBlend = spine.MixBlend.setup; + var holdMix = timelineHoldMix[i]; + alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); + break; + } + from.totalAlpha += alpha; + if (timeline instanceof spine.RotateTimeline) + this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame); + else { + spine.Utils.webkit602BugfixHelper(alpha, blend); + if (timelineBlend == spine.MixBlend.setup) { + if (timeline instanceof spine.AttachmentTimeline) { + if (attachments) + direction = spine.MixDirection.out; + } + else if (timeline instanceof spine.DrawOrderTimeline) { + if (drawOrder) + direction = spine.MixDirection.out; + } + } + timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction); + } + } + } + if (to.mixDuration > 0) + this.queueEvents(from, animationTime); + this.events.length = 0; + from.nextAnimationLast = animationTime; + from.nextTrackLast = from.trackTime; + return mix; + }; + AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { + if (firstFrame) + timelinesRotation[i] = 0; + if (alpha == 1) { + timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]); + return; + } + var rotateTimeline = timeline; + var frames = rotateTimeline.frames; + var bone = skeleton.bones[rotateTimeline.boneIndex]; + var r1 = 0, r2 = 0; + if (time < frames[0]) { + switch (blend) { + case spine.MixBlend.setup: + bone.rotation = bone.data.rotation; + default: + return; + case spine.MixBlend.first: + r1 = bone.rotation; + r2 = bone.data.rotation; + } + } + else { + r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation; + if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES]) + r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION]; + else { + var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES); + var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime)); + r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + r2 = prevRotation + r2 * percent + bone.data.rotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + } + } + var total = 0, diff = r2 - r1; + diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360; + if (diff == 0) { + total = timelinesRotation[i]; + } + else { + var lastTotal = 0, lastDiff = 0; + if (firstFrame) { + lastTotal = 0; + lastDiff = diff; + } + else { + lastTotal = timelinesRotation[i]; + lastDiff = timelinesRotation[i + 1]; + } + var current = diff > 0, dir = lastTotal >= 0; + if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) { + if (Math.abs(lastTotal) > 180) + lastTotal += 360 * spine.MathUtils.signum(lastTotal); + dir = current; + } + total = diff + lastTotal - lastTotal % 360; + if (dir != current) + total += 360 * spine.MathUtils.signum(lastTotal); + timelinesRotation[i] = total; + } + timelinesRotation[i + 1] = diff; + r1 += total * alpha; + bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360; + }; + AnimationState.prototype.queueEvents = function (entry, animationTime) { + var animationStart = entry.animationStart, animationEnd = entry.animationEnd; + var duration = animationEnd - animationStart; + var trackLastWrapped = entry.trackLast % duration; + var events = this.events; + var i = 0, n = events.length; + for (; i < n; i++) { + var event_1 = events[i]; + if (event_1.time < trackLastWrapped) + break; + if (event_1.time > animationEnd) + continue; + this.queue.event(entry, event_1); + } + var complete = false; + if (entry.loop) + complete = duration == 0 || trackLastWrapped > entry.trackTime % duration; + else + complete = animationTime >= animationEnd && entry.animationLast < animationEnd; + if (complete) + this.queue.complete(entry); + for (; i < n; i++) { + var event_2 = events[i]; + if (event_2.time < animationStart) + continue; + this.queue.event(entry, events[i]); + } + }; + AnimationState.prototype.clearTracks = function () { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) + this.clearTrack(i); + this.tracks.length = 0; + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.clearTrack = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return; + var current = this.tracks[trackIndex]; + if (current == null) + return; + this.queue.end(current); + this.disposeNext(current); + var entry = current; + while (true) { + var from = entry.mixingFrom; + if (from == null) + break; + this.queue.end(from); + entry.mixingFrom = null; + entry.mixingTo = null; + entry = from; + } + this.tracks[current.trackIndex] = null; + this.queue.drain(); + }; + AnimationState.prototype.setCurrent = function (index, current, interrupt) { + var from = this.expandToIndex(index); + this.tracks[index] = current; + if (from != null) { + if (interrupt) + this.queue.interrupt(from); + current.mixingFrom = from; + from.mixingTo = current; + current.mixTime = 0; + if (from.mixingFrom != null && from.mixDuration > 0) + current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); + from.timelinesRotation.length = 0; + } + this.queue.start(current); + }; + AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.setAnimationWith(trackIndex, animation, loop); + }; + AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) { + if (animation == null) + throw new Error("animation cannot be null."); + var interrupt = true; + var current = this.expandToIndex(trackIndex); + if (current != null) { + if (current.nextTrackLast == -1) { + this.tracks[trackIndex] = current.mixingFrom; + this.queue.interrupt(current); + this.queue.end(current); + this.disposeNext(current); + current = current.mixingFrom; + interrupt = false; + } + else + this.disposeNext(current); + } + var entry = this.trackEntry(trackIndex, animation, loop, current); + this.setCurrent(trackIndex, entry, interrupt); + this.queue.drain(); + return entry; + }; + AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.addAnimationWith(trackIndex, animation, loop, delay); + }; + AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) { + if (animation == null) + throw new Error("animation cannot be null."); + var last = this.expandToIndex(trackIndex); + if (last != null) { + while (last.next != null) + last = last.next; + } + var entry = this.trackEntry(trackIndex, animation, loop, last); + if (last == null) { + this.setCurrent(trackIndex, entry, true); + this.queue.drain(); + } + else { + last.next = entry; + if (delay <= 0) { + var duration = last.animationEnd - last.animationStart; + if (duration != 0) { + if (last.loop) + delay += duration * (1 + ((last.trackTime / duration) | 0)); + else + delay += Math.max(duration, last.trackTime); + delay -= this.data.getMix(last.animation, animation); } 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; + delay = last.trackTime; } } + entry.delay = delay; + return entry; + }; + AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) { + var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) { + if (delay <= 0) + delay -= mixDuration; + var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.setEmptyAnimations = function (mixDuration) { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) { + var current = this.tracks[i]; + if (current != null) + this.setEmptyAnimation(current.trackIndex, mixDuration); + } + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.expandToIndex = function (index) { + if (index < this.tracks.length) + return this.tracks[index]; + spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null); + this.tracks.length = index + 1; + return null; + }; + AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) { + var entry = this.trackEntryPool.obtain(); + entry.trackIndex = trackIndex; + entry.animation = animation; + entry.loop = loop; + entry.holdPrevious = false; + entry.eventThreshold = 0; + entry.attachmentThreshold = 0; + entry.drawOrderThreshold = 0; + entry.animationStart = 0; + entry.animationEnd = animation.duration; + entry.animationLast = -1; + entry.nextAnimationLast = -1; + entry.delay = 0; + entry.trackTime = 0; + entry.trackLast = -1; + entry.nextTrackLast = -1; + entry.trackEnd = Number.MAX_VALUE; + entry.timeScale = 1; + entry.alpha = 1; + entry.interruptAlpha = 1; + entry.mixTime = 0; + entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); + return entry; + }; + AnimationState.prototype.disposeNext = function (entry) { + var next = entry.next; + while (next != null) { + this.queue.dispose(next); + next = next.next; + } + entry.next = null; + }; + AnimationState.prototype._animationsChanged = function () { + this.animationsChanged = false; + this.propertyIDs.clear(); + for (var i = 0, n = this.tracks.length; i < n; i++) { + var entry = this.tracks[i]; + if (entry == null) + continue; + while (entry.mixingFrom != null) + entry = entry.mixingFrom; + do { + if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add) + this.setTimelineModes(entry); + entry = entry.mixingTo; + } while (entry != null); + } + }; + AnimationState.prototype.setTimelineModes = function (entry) { + var to = entry.mixingTo; + var timelines = entry.animation.timelines; + var timelinesCount = entry.animation.timelines.length; + var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount); + entry.timelineHoldMix.length = 0; + var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount); + var propertyIDs = this.propertyIDs; + if (to != null && to.holdPrevious) { + for (var i = 0; i < timelinesCount; i++) { + propertyIDs.add(timelines[i].getPropertyId()); + timelineMode[i] = AnimationState.HOLD; + } + return; + } + outer: for (var i = 0; i < timelinesCount; i++) { + var id = timelines[i].getPropertyId(); + if (!propertyIDs.add(id)) + timelineMode[i] = AnimationState.SUBSEQUENT; + else if (to == null || !this.hasTimeline(to, id)) + timelineMode[i] = AnimationState.FIRST; + else { + for (var next = to.mixingTo; next != null; next = next.mixingTo) { + if (this.hasTimeline(next, id)) + continue; + if (entry.mixDuration > 0) { + timelineMode[i] = AnimationState.HOLD_MIX; + timelineDipMix[i] = next; + continue outer; + } + break; + } + timelineMode[i] = AnimationState.HOLD; + } + } + }; + AnimationState.prototype.hasTimeline = function (entry, id) { + var timelines = entry.animation.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + if (timelines[i].getPropertyId() == id) + return true; + return false; + }; + AnimationState.prototype.getCurrent = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return null; + return this.tracks[trackIndex]; + }; + AnimationState.prototype.addListener = function (listener) { + if (listener == null) + throw new Error("listener cannot be null."); + this.listeners.push(listener); + }; + AnimationState.prototype.removeListener = function (listener) { + var index = this.listeners.indexOf(listener); + if (index >= 0) + this.listeners.splice(index, 1); + }; + AnimationState.prototype.clearListeners = function () { + this.listeners.length = 0; + }; + AnimationState.prototype.clearListenerNotifications = function () { + this.queue.clear(); + }; + AnimationState.emptyAnimation = new spine.Animation("", [], 0); + AnimationState.SUBSEQUENT = 0; + AnimationState.FIRST = 1; + AnimationState.HOLD = 2; + AnimationState.HOLD_MIX = 3; + return AnimationState; + }()); + spine.AnimationState = AnimationState; + var TrackEntry = (function () { + function TrackEntry() { + this.mixBlend = spine.MixBlend.replace; + this.timelineMode = new Array(); + this.timelineHoldMix = new Array(); + this.timelinesRotation = new Array(); } - } - - // Return the modified object - return target; -}; - -module.exports = Extend; - - -/***/ }), - -/***/ "../../../src/utils/object/GetFastValue.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/object/GetFastValue.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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; - - -/***/ }), - -/***/ "../../../src/utils/object/GetValue.js": -/*!*******************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/object/GetValue.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Source object -// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' -// The default value to use if the key doesn't exist - -/** - * Retrieves a value from an object. - * - * @function Phaser.Utils.Objects.GetValue - * @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 GetValue = function (source, key, defaultValue) -{ - if (!source || typeof source === 'number') - { - return defaultValue; - } - else if (source.hasOwnProperty(key)) - { - return source[key]; - } - else if (key.indexOf('.') !== -1) - { - var keys = key.split('.'); - var parent = source; - var value = defaultValue; - - // Use for loop here so we can break early - for (var i = 0; i < keys.length; i++) - { - if (parent.hasOwnProperty(keys[i])) - { - // Yes it has a key property, let's carry on down - value = parent[keys[i]]; - - parent = parent[keys[i]]; + TrackEntry.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; + }; + TrackEntry.prototype.getAnimationTime = function () { + if (this.loop) { + var duration = this.animationEnd - this.animationStart; + if (duration == 0) + return this.animationStart; + return (this.trackTime % duration) + this.animationStart; + } + return Math.min(this.trackTime + this.animationStart, this.animationEnd); + }; + TrackEntry.prototype.setAnimationLast = function (animationLast) { + this.animationLast = animationLast; + this.nextAnimationLast = animationLast; + }; + TrackEntry.prototype.isComplete = function () { + return this.trackTime >= this.animationEnd - this.animationStart; + }; + TrackEntry.prototype.resetRotationDirections = function () { + this.timelinesRotation.length = 0; + }; + return TrackEntry; + }()); + spine.TrackEntry = TrackEntry; + var EventQueue = (function () { + function EventQueue(animState) { + this.objects = []; + this.drainDisabled = false; + this.animState = animState; + } + EventQueue.prototype.start = function (entry) { + this.objects.push(EventType.start); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.interrupt = function (entry) { + this.objects.push(EventType.interrupt); + this.objects.push(entry); + }; + EventQueue.prototype.end = function (entry) { + this.objects.push(EventType.end); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.dispose = function (entry) { + this.objects.push(EventType.dispose); + this.objects.push(entry); + }; + EventQueue.prototype.complete = function (entry) { + this.objects.push(EventType.complete); + this.objects.push(entry); + }; + EventQueue.prototype.event = function (entry, event) { + this.objects.push(EventType.event); + this.objects.push(entry); + this.objects.push(event); + }; + EventQueue.prototype.drain = function () { + if (this.drainDisabled) + return; + this.drainDisabled = true; + var objects = this.objects; + var listeners = this.animState.listeners; + for (var i = 0; i < objects.length; i += 2) { + var type = objects[i]; + var entry = objects[i + 1]; + switch (type) { + case EventType.start: + if (entry.listener != null && entry.listener.start) + entry.listener.start(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].start) + listeners[ii].start(entry); + break; + case EventType.interrupt: + if (entry.listener != null && entry.listener.interrupt) + entry.listener.interrupt(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].interrupt) + listeners[ii].interrupt(entry); + break; + case EventType.end: + if (entry.listener != null && entry.listener.end) + entry.listener.end(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].end) + listeners[ii].end(entry); + case EventType.dispose: + if (entry.listener != null && entry.listener.dispose) + entry.listener.dispose(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].dispose) + listeners[ii].dispose(entry); + this.animState.trackEntryPool.free(entry); + break; + case EventType.complete: + if (entry.listener != null && entry.listener.complete) + entry.listener.complete(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].complete) + listeners[ii].complete(entry); + break; + case EventType.event: + var event_3 = objects[i++ + 2]; + if (entry.listener != null && entry.listener.event) + entry.listener.event(entry, event_3); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].event) + listeners[ii].event(entry, event_3); + break; + } + } + this.clear(); + this.drainDisabled = false; + }; + EventQueue.prototype.clear = function () { + this.objects.length = 0; + }; + return EventQueue; + }()); + spine.EventQueue = EventQueue; + var EventType; + (function (EventType) { + EventType[EventType["start"] = 0] = "start"; + EventType[EventType["interrupt"] = 1] = "interrupt"; + EventType[EventType["end"] = 2] = "end"; + EventType[EventType["dispose"] = 3] = "dispose"; + EventType[EventType["complete"] = 4] = "complete"; + EventType[EventType["event"] = 5] = "event"; + })(EventType = spine.EventType || (spine.EventType = {})); + var AnimationStateAdapter2 = (function () { + function AnimationStateAdapter2() { + } + AnimationStateAdapter2.prototype.start = function (entry) { + }; + AnimationStateAdapter2.prototype.interrupt = function (entry) { + }; + AnimationStateAdapter2.prototype.end = function (entry) { + }; + AnimationStateAdapter2.prototype.dispose = function (entry) { + }; + AnimationStateAdapter2.prototype.complete = function (entry) { + }; + AnimationStateAdapter2.prototype.event = function (entry, event) { + }; + return AnimationStateAdapter2; + }()); + spine.AnimationStateAdapter2 = AnimationStateAdapter2; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationStateData = (function () { + function AnimationStateData(skeletonData) { + this.animationToMixTime = {}; + this.defaultMix = 0; + if (skeletonData == null) + throw new Error("skeletonData cannot be null."); + this.skeletonData = skeletonData; + } + AnimationStateData.prototype.setMix = function (fromName, toName, duration) { + var from = this.skeletonData.findAnimation(fromName); + if (from == null) + throw new Error("Animation not found: " + fromName); + var to = this.skeletonData.findAnimation(toName); + if (to == null) + throw new Error("Animation not found: " + toName); + this.setMixWith(from, to, duration); + }; + AnimationStateData.prototype.setMixWith = function (from, to, duration) { + if (from == null) + throw new Error("from cannot be null."); + if (to == null) + throw new Error("to cannot be null."); + var key = from.name + "." + to.name; + this.animationToMixTime[key] = duration; + }; + AnimationStateData.prototype.getMix = function (from, to) { + var key = from.name + "." + to.name; + var value = this.animationToMixTime[key]; + return value === undefined ? this.defaultMix : value; + }; + return AnimationStateData; + }()); + spine.AnimationStateData = AnimationStateData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AssetManager = (function () { + function AssetManager(textureLoader, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.assets = {}; + this.errors = {}; + this.toLoad = 0; + this.loaded = 0; + this.textureLoader = textureLoader; + this.pathPrefix = pathPrefix; + } + AssetManager.downloadText = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.onload = function () { + if (request.status == 200) { + success(request.responseText); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.downloadBinary = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.responseType = "arraybuffer"; + request.onload = function () { + if (request.status == 200) { + success(new Uint8Array(request.response)); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.prototype.loadText = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (data) { + _this.assets[path] = data; + if (success) + success(path, data); + _this.toLoad--; + _this.loaded++; + }, function (state, responseText) { + _this.errors[path] = "Couldn't load text " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load text " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.loadTexture = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = path; + }; + AssetManager.prototype.loadTextureData = function (path, data, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = data; + }; + AssetManager.prototype.loadTextureAtlas = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + var parent = path.lastIndexOf("/") >= 0 ? path.substring(0, path.lastIndexOf("/")) : ""; + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (atlasData) { + var pagesLoaded = { count: 0 }; + var atlasPages = new Array(); + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + atlasPages.push(parent + "/" + path); + var image = document.createElement("img"); + image.width = 16; + image.height = 16; + return new spine.FakeTexture(image); + }); + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + return; + } + var _loop_1 = function (atlasPage) { + var pageLoadError = false; + _this.loadTexture(atlasPage, function (imagePath, image) { + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + if (!pageLoadError) { + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + return _this.get(parent + "/" + path); + }); + _this.assets[path] = atlas; + if (success) + success(path, atlas); + _this.toLoad--; + _this.loaded++; + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + } + } + else { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + } + }, function (imagePath, errorMessage) { + pageLoadError = true; + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + }); + }; + for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) { + var atlasPage = atlasPages_1[_i]; + _loop_1(atlasPage); + } + }, function (state, responseText) { + _this.errors[path] = "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.get = function (path) { + path = this.pathPrefix + path; + return this.assets[path]; + }; + AssetManager.prototype.remove = function (path) { + path = this.pathPrefix + path; + var asset = this.assets[path]; + if (asset.dispose) + asset.dispose(); + this.assets[path] = null; + }; + AssetManager.prototype.removeAll = function () { + for (var key in this.assets) { + var asset = this.assets[key]; + if (asset.dispose) + asset.dispose(); + } + this.assets = {}; + }; + AssetManager.prototype.isLoadingComplete = function () { + return this.toLoad == 0; + }; + AssetManager.prototype.getToLoad = function () { + return this.toLoad; + }; + AssetManager.prototype.getLoaded = function () { + return this.loaded; + }; + AssetManager.prototype.dispose = function () { + this.removeAll(); + }; + AssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + AssetManager.prototype.getErrors = function () { + return this.errors; + }; + return AssetManager; + }()); + spine.AssetManager = AssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AtlasAttachmentLoader = (function () { + function AtlasAttachmentLoader(atlas) { + this.atlas = atlas; + } + AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.RegionAttachment(name); + attachment.setRegion(region); + return attachment; + }; + AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.MeshAttachment(name); + attachment.region = region; + return attachment; + }; + AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) { + return new spine.BoundingBoxAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) { + return new spine.PathAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) { + return new spine.PointAttachment(name); + }; + AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) { + return new spine.ClippingAttachment(name); + }; + return AtlasAttachmentLoader; + }()); + spine.AtlasAttachmentLoader = AtlasAttachmentLoader; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BlendMode; + (function (BlendMode) { + BlendMode[BlendMode["Normal"] = 0] = "Normal"; + BlendMode[BlendMode["Additive"] = 1] = "Additive"; + BlendMode[BlendMode["Multiply"] = 2] = "Multiply"; + BlendMode[BlendMode["Screen"] = 3] = "Screen"; + })(BlendMode = spine.BlendMode || (spine.BlendMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Bone = (function () { + function Bone(data, skeleton, parent) { + 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 = false; + this.a = 0; + this.b = 0; + this.worldX = 0; + this.c = 0; + this.d = 0; + this.worldY = 0; + this.sorted = false; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.skeleton = skeleton; + this.parent = parent; + this.setToSetupPose(); + } + Bone.prototype.update = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransform = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) { + this.ax = x; + this.ay = y; + this.arotation = rotation; + this.ascaleX = scaleX; + this.ascaleY = scaleY; + this.ashearX = shearX; + this.ashearY = shearY; + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + var skeleton = this.skeleton; + var rotationY = rotation + 90 + shearY; + var sx = skeleton.scaleX; + var sy = skeleton.scaleY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy; + this.worldX = x * sx + skeleton.x; + this.worldY = y * sy + skeleton.y; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + this.worldX = pa * x + pb * y + parent.worldX; + this.worldY = pc * x + pd * y + parent.worldY; + switch (this.data.transformMode) { + case spine.TransformMode.Normal: { + var rotationY = rotation + 90 + shearY; + var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(rotationY) * scaleY; + var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(rotationY) * scaleY; + this.a = pa * la + pb * lc; + this.b = pa * lb + pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + return; + } + case spine.TransformMode.OnlyTranslation: { + var rotationY = rotation + 90 + shearY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY; + break; + } + case spine.TransformMode.NoRotationOrReflection: { + var s = pa * pa + pc * pc; + var prx = 0; + if (s > 0.0001) { + s = Math.abs(pa * pd - pb * pc) / s; + pb = pc * s; + pd = pa * s; + prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg; + } + else { + pa = 0; + pc = 0; + prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg; + } + var rx = rotation + shearX - prx; + var ry = rotation + shearY - prx + 90; + var la = spine.MathUtils.cosDeg(rx) * scaleX; + var lb = spine.MathUtils.cosDeg(ry) * scaleY; + var lc = spine.MathUtils.sinDeg(rx) * scaleX; + var ld = spine.MathUtils.sinDeg(ry) * scaleY; + this.a = pa * la - pb * lc; + this.b = pa * lb - pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + break; + } + case spine.TransformMode.NoScale: + case spine.TransformMode.NoScaleOrReflection: { + var cos = spine.MathUtils.cosDeg(rotation); + var sin = spine.MathUtils.sinDeg(rotation); + var za = (pa * cos + pb * sin) / this.skeleton.scaleX; + var zc = (pc * cos + pd * sin) / this.skeleton.scaleY; + var s = Math.sqrt(za * za + zc * zc); + if (s > 0.00001) + s = 1 / s; + za *= s; + zc *= s; + s = Math.sqrt(za * za + zc * zc); + if (this.data.transformMode == spine.TransformMode.NoScale + && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) + s = -s; + var r = Math.PI / 2 + Math.atan2(zc, za); + var zb = Math.cos(r) * s; + var zd = Math.sin(r) * s; + var la = spine.MathUtils.cosDeg(shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY; + var lc = spine.MathUtils.sinDeg(shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY; + this.a = za * la + zb * lc; + this.b = za * lb + zb * ld; + this.c = zc * la + zd * lc; + this.d = zc * lb + zd * ld; + break; + } + } + this.a *= this.skeleton.scaleX; + this.b *= this.skeleton.scaleX; + this.c *= this.skeleton.scaleY; + this.d *= this.skeleton.scaleY; + }; + Bone.prototype.setToSetupPose = function () { + var data = this.data; + this.x = data.x; + this.y = data.y; + this.rotation = data.rotation; + this.scaleX = data.scaleX; + this.scaleY = data.scaleY; + this.shearX = data.shearX; + this.shearY = data.shearY; + }; + Bone.prototype.getWorldRotationX = function () { + return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldRotationY = function () { + return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldScaleX = function () { + return Math.sqrt(this.a * this.a + this.c * this.c); + }; + Bone.prototype.getWorldScaleY = function () { + return Math.sqrt(this.b * this.b + this.d * this.d); + }; + Bone.prototype.updateAppliedTransform = function () { + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + this.ax = this.worldX; + this.ay = this.worldY; + this.arotation = Math.atan2(this.c, this.a) * spine.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; + this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + var pid = 1 / (pa * pd - pb * pc); + var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; + this.ax = (dx * pd * pid - dy * pb * pid); + this.ay = (dy * pa * pid - dx * pc * pid); + var ia = pid * pd; + var id = pid * pa; + var ib = pid * pb; + var ic = pid * pc; + var ra = ia * this.a - ib * this.c; + var rb = ia * this.b - ib * this.d; + var rc = id * this.c - ic * this.a; + var rd = id * this.d - ic * this.b; + this.ashearX = 0; + this.ascaleX = Math.sqrt(ra * ra + rc * rc); + if (this.ascaleX > 0.0001) { + var det = ra * rd - rb * rc; + this.ascaleY = det / this.ascaleX; + this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg; + this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg; + } + else { + this.ascaleX = 0; + this.ascaleY = Math.sqrt(rb * rb + rd * rd); + this.ashearY = 0; + this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg; + } + }; + Bone.prototype.worldToLocal = function (world) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var invDet = 1 / (a * d - b * c); + var x = world.x - this.worldX, y = world.y - this.worldY; + world.x = (x * d * invDet - y * b * invDet); + world.y = (y * a * invDet - x * c * invDet); + return world; + }; + Bone.prototype.localToWorld = function (local) { + var x = local.x, y = local.y; + local.x = x * this.a + y * this.b + this.worldX; + local.y = x * this.c + y * this.d + this.worldY; + return local; + }; + Bone.prototype.worldToLocalRotation = function (worldRotation) { + var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation); + return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX; + }; + Bone.prototype.localToWorldRotation = function (localRotation) { + localRotation -= this.rotation - this.shearX; + var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation); + return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.rotateWorld = function (degrees) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees); + this.a = cos * a - sin * c; + this.b = cos * b - sin * d; + this.c = sin * a + cos * c; + this.d = sin * b + cos * d; + this.appliedValid = false; + }; + return Bone; + }()); + spine.Bone = Bone; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoneData = (function () { + function BoneData(index, name, parent) { + this.x = 0; + this.y = 0; + this.rotation = 0; + this.scaleX = 1; + this.scaleY = 1; + this.shearX = 0; + this.shearY = 0; + this.transformMode = TransformMode.Normal; + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + this.index = index; + this.name = name; + this.parent = parent; + } + return BoneData; + }()); + spine.BoneData = BoneData; + var TransformMode; + (function (TransformMode) { + TransformMode[TransformMode["Normal"] = 0] = "Normal"; + TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation"; + TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; + TransformMode[TransformMode["NoScale"] = 3] = "NoScale"; + TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; + })(TransformMode = spine.TransformMode || (spine.TransformMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Event = (function () { + function Event(time, data) { + if (data == null) + throw new Error("data cannot be null."); + this.time = time; + this.data = data; + } + return Event; + }()); + spine.Event = Event; +})(spine || (spine = {})); +var spine; +(function (spine) { + var EventData = (function () { + function EventData(name) { + this.name = name; + } + return EventData; + }()); + spine.EventData = EventData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraint = (function () { + function IkConstraint(data, skeleton) { + this.bendDirection = 0; + this.compress = false; + this.stretch = false; + this.mix = 1; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.mix = data.mix; + this.bendDirection = data.bendDirection; + this.compress = data.compress; + this.stretch = data.stretch; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + IkConstraint.prototype.getOrder = function () { + return this.data.order; + }; + IkConstraint.prototype.apply = function () { + this.update(); + }; + IkConstraint.prototype.update = function () { + var target = this.target; + var bones = this.bones; + switch (bones.length) { + case 1: + this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix); + break; + case 2: + this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix); + break; + } + }; + IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) { + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var p = bone.parent; + var id = 1 / (p.a * p.d - p.b * p.c); + var x = targetX - p.worldX, y = targetY - p.worldY; + var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay; + var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation; + if (bone.ascaleX < 0) + rotationIK += 180; + if (rotationIK > 180) + rotationIK -= 360; + else if (rotationIK < -180) + rotationIK += 360; + var sx = bone.ascaleX, sy = bone.ascaleY; + if (compress || stretch) { + var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty); + if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) { + var s = (dd / b - 1) * alpha + 1; + sx *= s; + if (uniform) + sy *= s; + } + } + bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY); + }; + IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) { + if (alpha == 0) { + child.updateWorldTransform(); + return; + } + if (!parent.appliedValid) + parent.updateAppliedTransform(); + if (!child.appliedValid) + child.updateAppliedTransform(); + var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX; + var os1 = 0, os2 = 0, s2 = 0; + if (psx < 0) { + psx = -psx; + os1 = 180; + s2 = -1; + } + else { + os1 = 0; + s2 = 1; + } + if (psy < 0) { + psy = -psy; + s2 = -s2; + } + if (csx < 0) { + csx = -csx; + os2 = 180; } else - { - // Can't go any further, so reset to default - value = defaultValue; - break; + os2 = 0; + var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; + var u = Math.abs(psx - psy) <= 0.0001; + if (!u) { + cy = 0; + cwx = a * cx + parent.worldX; + cwy = c * cx + parent.worldY; } + else { + cy = child.ay; + cwx = a * cx + b * cy + parent.worldX; + cwy = c * cx + d * cy + parent.worldY; + } + var pp = parent.parent; + a = pp.a; + b = pp.b; + c = pp.c; + d = pp.d; + var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY; + var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty; + x = cwx - pp.worldX; + y = cwy - pp.worldY; + var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; + var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0; + outer: if (u) { + l2 *= psx; + var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); + if (cos < -1) + cos = -1; + else if (cos > 1) { + cos = 1; + if (stretch && l1 + l2 > 0.0001) + sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1; + } + a2 = Math.acos(cos) * bendDir; + a = l1 + l2 * cos; + b = l2 * Math.sin(a2); + a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b); + } + else { + a = psx * l2; + b = psy * l2; + var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); + c = bb * l1 * l1 + aa * dd - aa * bb; + var c1 = -2 * bb * l1, c2 = bb - aa; + d = c1 * c1 - 4 * c2 * c; + if (d >= 0) { + var q = Math.sqrt(d); + if (c1 < 0) + q = -q; + q = -(c1 + q) / 2; + var r0 = q / c2, r1 = c / q; + var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; + if (r * r <= dd) { + y = Math.sqrt(dd - r * r) * bendDir; + a1 = ta - Math.atan2(y, r); + a2 = Math.atan2(y / psy, (r - l1) / psx); + break outer; + } + } + var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; + var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; + c = -a * l1 / (aa - bb); + if (c >= -1 && c <= 1) { + c = Math.acos(c); + x = a * Math.cos(c) + l1; + y = b * Math.sin(c); + d = x * x + y * y; + if (d < minDist) { + minAngle = c; + minDist = d; + minX = x; + minY = y; + } + if (d > maxDist) { + maxAngle = c; + maxDist = d; + maxX = x; + maxY = y; + } + } + if (dd <= (minDist + maxDist) / 2) { + a1 = ta - Math.atan2(minY * bendDir, minX); + a2 = minAngle * bendDir; + } + else { + a1 = ta - Math.atan2(maxY * bendDir, maxX); + a2 = maxAngle * bendDir; + } + } + var os = Math.atan2(cy, cx) * s2; + var rotation = parent.arotation; + a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation; + if (a1 > 180) + a1 -= 360; + else if (a1 < -180) + a1 += 360; + parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0); + rotation = child.arotation; + a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; + if (a2 > 180) + a2 -= 360; + else if (a2 < -180) + a2 += 360; + child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); + }; + return IkConstraint; + }()); + spine.IkConstraint = IkConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraintData = (function () { + function IkConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.bendDirection = 1; + this.compress = false; + this.stretch = false; + this.uniform = false; + this.mix = 1; + this.name = name; } - - return value; - } - else - { - return defaultValue; - } -}; - -module.exports = GetValue; - - -/***/ }), - -/***/ "../../../src/utils/object/IsPlainObject.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/object/IsPlainObject.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2019 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 (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 IkConstraintData; + }()); + spine.IkConstraintData = IkConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraint = (function () { + function PathConstraint(data, skeleton) { + 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(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0, n = data.bones.length; i < n; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findSlot(data.target.name); + this.position = data.position; + this.spacing = data.spacing; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + } + PathConstraint.prototype.apply = function () { + this.update(); + }; + PathConstraint.prototype.update = function () { + var attachment = this.target.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + return; + var rotateMix = this.rotateMix, translateMix = this.translateMix; + var translate = translateMix > 0, rotate = rotateMix > 0; + if (!translate && !rotate) + return; + var data = this.data; + var percentSpacing = data.spacingMode == spine.SpacingMode.Percent; + var rotateMode = data.rotateMode; + var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale; + var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1; + var bones = this.bones; + var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null; + var spacing = this.spacing; + if (scale || !percentSpacing) { + if (scale) + lengths = spine.Utils.setArraySize(this.lengths, boneCount); + var lengthSpacing = data.spacingMode == spine.SpacingMode.Length; + for (var i = 0, n = spacesCount - 1; i < n;) { + var bone = bones[i]; + var setupLength = bone.data.length; + if (setupLength < PathConstraint.epsilon) { + if (scale) + lengths[i] = 0; + spaces[++i] = 0; + } + else if (percentSpacing) { + if (scale) { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_1 = Math.sqrt(x * x + y * y); + lengths[i] = length_1; + } + spaces[++i] = spacing; + } + else { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_2 = Math.sqrt(x * x + y * y); + if (scale) + lengths[i] = length_2; + spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength; + } + } + } + else { + for (var i = 1; i < spacesCount; i++) + spaces[i] = spacing; + } + var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing); + var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; + var tip = false; + if (offsetRotation == 0) + tip = rotateMode == spine.RotateMode.Chain; + else { + tip = false; + var p = this.target.bone; + offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + } + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.worldX += (boneX - bone.worldX) * translateMix; + bone.worldY += (boneY - bone.worldY) * translateMix; + var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; + if (scale) { + var length_3 = lengths[i]; + if (length_3 != 0) { + var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1; + bone.a *= s; + bone.c *= s; + } + } + boneX = x; + boneY = y; + if (rotate) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; + if (tangents) + r = positions[p - 1]; + else if (spaces[i + 1] == 0) + r = positions[p + 2]; + else + r = Math.atan2(dy, dx); + r -= Math.atan2(c, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_4 = bone.data.length; + boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix; + boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix; + } + else { + r += offsetRotation; + } + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + } + bone.appliedValid = false; + } + }; + PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) { + var target = this.target; + var position = this.position; + var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null; + var closed = path.closed; + var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE; + if (!path.constantSpeed) { + var lengths = path.lengths; + curveCount -= closed ? 1 : 2; + var pathLength_1 = lengths[curveCount]; + if (percentPosition) + position *= pathLength_1; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength_1; + } + world = spine.Utils.setArraySize(this.world, 8); + for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength_1; + if (p < 0) + p += pathLength_1; + curve = 0; + } + else if (p < 0) { + if (prevCurve != PathConstraint.BEFORE) { + prevCurve = PathConstraint.BEFORE; + path.computeWorldVertices(target, 2, 4, world, 0, 2); + } + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength_1) { + if (prevCurve != PathConstraint.AFTER) { + prevCurve = PathConstraint.AFTER; + path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2); + } + this.addAfterPosition(p - pathLength_1, world, 0, out, o); + continue; + } + for (;; curve++) { + var length_5 = lengths[curve]; + if (p > length_5) + continue; + if (curve == 0) + p /= length_5; + else { + var prev = lengths[curve - 1]; + p = (p - prev) / (length_5 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + if (closed && curve == curveCount) { + path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2); + path.computeWorldVertices(target, 0, 4, world, 4, 2); + } + else + path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2); + } + this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0)); + } + return out; + } + if (closed) { + verticesLength += 2; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2); + path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2); + world[verticesLength - 2] = world[0]; + world[verticesLength - 1] = world[1]; + } + else { + curveCount--; + verticesLength -= 4; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength, world, 0, 2); + } + var curves = spine.Utils.setArraySize(this.curves, curveCount); + var pathLength = 0; + var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = world[w]; + cy1 = world[w + 1]; + cx2 = world[w + 2]; + cy2 = world[w + 3]; + x2 = world[w + 4]; + y2 = world[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) + position *= pathLength; + else + position *= pathLength / path.lengths[curveCount - 1]; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength; + } + var segments = this.segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength) { + this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); + continue; + } + for (;; curve++) { + var length_6 = curves[curve]; + if (p > length_6) + continue; + if (curve == 0) + p /= length_6; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_6 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + var ii = curve * 6; + x1 = world[ii]; + y1 = world[ii + 1]; + cx1 = world[ii + 2]; + cy1 = world[ii + 3]; + cx2 = world[ii + 4]; + cy2 = world[ii + 5]; + x2 = world[ii + 6]; + y2 = world[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + p *= curveLength; + for (;; segment++) { + var length_7 = segments[segment]; + if (p > length_7) + continue; + if (segment == 0) + p /= length_7; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_7 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0)); + } + return out; + }; + PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) { + var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) { + var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { + if (p == 0 || isNaN(p)) { + out[o] = x1; + out[o + 1] = y1; + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + return; + } + var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; + var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; + var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; + out[o] = x; + out[o + 1] = y; + if (tangents) { + if (p < 0.001) + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + else + out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); + } + }; + PathConstraint.prototype.getOrder = function () { + return this.data.order; + }; + PathConstraint.NONE = -1; + PathConstraint.BEFORE = -2; + PathConstraint.AFTER = -3; + PathConstraint.epsilon = 0.00001; + return PathConstraint; + }()); + spine.PathConstraint = PathConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraintData = (function () { + function PathConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.name = name; + } + return PathConstraintData; + }()); + spine.PathConstraintData = PathConstraintData; + var PositionMode; + (function (PositionMode) { + PositionMode[PositionMode["Fixed"] = 0] = "Fixed"; + PositionMode[PositionMode["Percent"] = 1] = "Percent"; + })(PositionMode = spine.PositionMode || (spine.PositionMode = {})); + var SpacingMode; + (function (SpacingMode) { + SpacingMode[SpacingMode["Length"] = 0] = "Length"; + SpacingMode[SpacingMode["Fixed"] = 1] = "Fixed"; + SpacingMode[SpacingMode["Percent"] = 2] = "Percent"; + })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {})); + var RotateMode; + (function (RotateMode) { + RotateMode[RotateMode["Tangent"] = 0] = "Tangent"; + RotateMode[RotateMode["Chain"] = 1] = "Chain"; + RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale"; + })(RotateMode = spine.RotateMode || (spine.RotateMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Assets = (function () { + function Assets(clientId) { + this.toLoad = new Array(); + this.assets = {}; + this.clientId = clientId; + } + Assets.prototype.loaded = function () { + var i = 0; + for (var v in this.assets) + i++; + return i; + }; + return Assets; + }()); + var SharedAssetManager = (function () { + function SharedAssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.clientAssets = {}; + this.queuedAssets = {}; + this.rawAssets = {}; + this.errors = {}; + this.pathPrefix = pathPrefix; + } + SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) { + clientAssets = new Assets(clientId); + this.clientAssets[clientId] = clientAssets; + } + if (textureLoader !== null) + clientAssets.textureLoader = textureLoader; + clientAssets.toLoad.push(path); + if (this.queuedAssets[path] === path) { + return false; + } + else { + this.queuedAssets[path] = path; + return true; + } + }; + SharedAssetManager.prototype.loadText = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = request.responseText; + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadJson = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = JSON.parse(request.responseText); + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, textureLoader, path)) + return; + var img = new Image(); + img.src = path; + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + _this.rawAssets[path] = img; + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + }; + }; + SharedAssetManager.prototype.get = function (clientId, path) { + path = this.pathPrefix + path; + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + return clientAssets.assets[path]; + }; + SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { + for (var i = 0; i < clientAssets.toLoad.length; i++) { + var path = clientAssets.toLoad[i]; + var asset = clientAssets.assets[path]; + if (asset === null || asset === undefined) { + var rawAsset = this.rawAssets[path]; + if (rawAsset === null || rawAsset === undefined) + continue; + if (rawAsset instanceof HTMLImageElement) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } + } + } + }; + SharedAssetManager.prototype.isLoadingComplete = function (clientId) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + this.updateClientAssets(clientAssets); + return clientAssets.toLoad.length == clientAssets.loaded(); + }; + SharedAssetManager.prototype.dispose = function () { + }; + SharedAssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + SharedAssetManager.prototype.getErrors = function () { + return this.errors; + }; + return SharedAssetManager; + }()); + spine.SharedAssetManager = SharedAssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skeleton = (function () { + function Skeleton(data) { + this._updateCache = new Array(); + this.updateCacheReset = new Array(); + this.time = 0; + this.scaleX = 1; + this.scaleY = 1; + this.x = 0; + this.y = 0; + if (data == null) + throw new Error("data cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) { + var boneData = data.bones[i]; + var bone = void 0; + if (boneData.parent == null) + bone = new spine.Bone(boneData, this, null); + else { + var parent_1 = this.bones[boneData.parent.index]; + bone = new spine.Bone(boneData, this, parent_1); + parent_1.children.push(bone); + } + this.bones.push(bone); + } + this.slots = new Array(); + this.drawOrder = new Array(); + for (var i = 0; i < data.slots.length; i++) { + var slotData = data.slots[i]; + var bone = this.bones[slotData.boneData.index]; + var slot = new spine.Slot(slotData, bone); + this.slots.push(slot); + this.drawOrder.push(slot); + } + this.ikConstraints = new Array(); + for (var i = 0; i < data.ikConstraints.length; i++) { + var ikConstraintData = data.ikConstraints[i]; + this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this)); + } + this.transformConstraints = new Array(); + for (var i = 0; i < data.transformConstraints.length; i++) { + var transformConstraintData = data.transformConstraints[i]; + this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this)); + } + this.pathConstraints = new Array(); + for (var i = 0; i < data.pathConstraints.length; i++) { + var pathConstraintData = data.pathConstraints[i]; + this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this)); + } + this.color = new spine.Color(1, 1, 1, 1); + this.updateCache(); + } + Skeleton.prototype.updateCache = function () { + var updateCache = this._updateCache; + updateCache.length = 0; + this.updateCacheReset.length = 0; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].sorted = false; + var ikConstraints = this.ikConstraints; + var transformConstraints = this.transformConstraints; + var pathConstraints = this.pathConstraints; + var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length; + var constraintCount = ikCount + transformCount + pathCount; + outer: for (var i = 0; i < constraintCount; i++) { + for (var ii = 0; ii < ikCount; ii++) { + var constraint = ikConstraints[ii]; + if (constraint.data.order == i) { + this.sortIkConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < transformCount; ii++) { + var constraint = transformConstraints[ii]; + if (constraint.data.order == i) { + this.sortTransformConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < pathCount; ii++) { + var constraint = pathConstraints[ii]; + if (constraint.data.order == i) { + this.sortPathConstraint(constraint); + continue outer; + } + } + } + for (var i = 0, n = bones.length; i < n; i++) + this.sortBone(bones[i]); + }; + Skeleton.prototype.sortIkConstraint = function (constraint) { + var target = constraint.target; + this.sortBone(target); + var constrained = constraint.bones; + var parent = constrained[0]; + this.sortBone(parent); + if (constrained.length > 1) { + var child = constrained[constrained.length - 1]; + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + this._updateCache.push(constraint); + this.sortReset(parent.children); + constrained[constrained.length - 1].sorted = true; + }; + Skeleton.prototype.sortPathConstraint = function (constraint) { + var slot = constraint.target; + var slotIndex = slot.data.index; + var slotBone = slot.bone; + if (this.skin != null) + this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); + if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin) + this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); + for (var i = 0, n = this.data.skins.length; i < n; i++) + this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone); + var attachment = slot.getAttachment(); + if (attachment instanceof spine.PathAttachment) + this.sortPathConstraintAttachmentWith(attachment, slotBone); + var constrained = constraint.bones; + var boneCount = constrained.length; + for (var i = 0; i < boneCount; i++) + this.sortBone(constrained[i]); + this._updateCache.push(constraint); + for (var i = 0; i < boneCount; i++) + this.sortReset(constrained[i].children); + for (var i = 0; i < boneCount; i++) + constrained[i].sorted = true; + }; + Skeleton.prototype.sortTransformConstraint = function (constraint) { + this.sortBone(constraint.target); + var constrained = constraint.bones; + var boneCount = constrained.length; + if (constraint.data.local) { + for (var i = 0; i < boneCount; i++) { + var child = constrained[i]; + this.sortBone(child.parent); + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + } + else { + for (var i = 0; i < boneCount; i++) { + this.sortBone(constrained[i]); + } + } + this._updateCache.push(constraint); + for (var ii = 0; ii < boneCount; ii++) + this.sortReset(constrained[ii].children); + for (var ii = 0; ii < boneCount; ii++) + constrained[ii].sorted = true; + }; + Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) { + var attachments = skin.attachments[slotIndex]; + if (!attachments) + return; + for (var key in attachments) { + this.sortPathConstraintAttachmentWith(attachments[key], slotBone); + } + }; + Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) { + if (!(attachment instanceof spine.PathAttachment)) + return; + var pathBones = attachment.bones; + if (pathBones == null) + this.sortBone(slotBone); + else { + var bones = this.bones; + var i = 0; + while (i < pathBones.length) { + var boneCount = pathBones[i++]; + for (var n = i + boneCount; i < n; i++) { + var boneIndex = pathBones[i]; + this.sortBone(bones[boneIndex]); + } + } + } + }; + Skeleton.prototype.sortBone = function (bone) { + if (bone.sorted) + return; + var parent = bone.parent; + if (parent != null) + this.sortBone(parent); + bone.sorted = true; + this._updateCache.push(bone); + }; + Skeleton.prototype.sortReset = function (bones) { + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.sorted) + this.sortReset(bone.children); + bone.sorted = false; + } + }; + Skeleton.prototype.updateWorldTransform = function () { + var updateCacheReset = this.updateCacheReset; + for (var i = 0, n = updateCacheReset.length; i < n; i++) { + var bone = updateCacheReset[i]; + bone.ax = bone.x; + bone.ay = bone.y; + bone.arotation = bone.rotation; + bone.ascaleX = bone.scaleX; + bone.ascaleY = bone.scaleY; + bone.ashearX = bone.shearX; + bone.ashearY = bone.shearY; + bone.appliedValid = true; + } + var updateCache = this._updateCache; + for (var i = 0, n = updateCache.length; i < n; i++) + updateCache[i].update(); + }; + Skeleton.prototype.setToSetupPose = function () { + this.setBonesToSetupPose(); + this.setSlotsToSetupPose(); + }; + Skeleton.prototype.setBonesToSetupPose = function () { + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].setToSetupPose(); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + var data = constraint.data; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + } + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + var data = constraint.data; + constraint.position = data.position; + constraint.spacing = data.spacing; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + } + }; + Skeleton.prototype.setSlotsToSetupPose = function () { + var slots = this.slots; + spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); + for (var i = 0, n = slots.length; i < n; i++) + slots[i].setToSetupPose(); + }; + Skeleton.prototype.getRootBone = function () { + if (this.bones.length == 0) + return null; + return this.bones[0]; + }; + Skeleton.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.data.name == boneName) + return bone; + } + return null; + }; + Skeleton.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].data.name == boneName) + return i; + return -1; + }; + Skeleton.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) + return slot; + } + return null; + }; + Skeleton.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].data.name == slotName) + return i; + return -1; + }; + Skeleton.prototype.setSkinByName = function (skinName) { + var skin = this.data.findSkin(skinName); + if (skin == null) + throw new Error("Skin not found: " + skinName); + this.setSkin(skin); + }; + Skeleton.prototype.setSkin = function (newSkin) { + if (newSkin != null) { + if (this.skin != null) + newSkin.attachAll(this, this.skin); + else { + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var name_1 = slot.data.attachmentName; + if (name_1 != null) { + var attachment = newSkin.getAttachment(i, name_1); + if (attachment != null) + slot.setAttachment(attachment); + } + } + } + } + this.skin = newSkin; + }; + Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) { + return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName); + }; + Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) { + if (attachmentName == null) + throw new Error("attachmentName cannot be null."); + if (this.skin != null) { + var attachment = this.skin.getAttachment(slotIndex, attachmentName); + if (attachment != null) + return attachment; + } + if (this.data.defaultSkin != null) + return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); + return null; + }; + Skeleton.prototype.setAttachment = function (slotName, attachmentName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) { + var attachment = null; + if (attachmentName != null) { + attachment = this.getAttachment(i, attachmentName); + if (attachment == null) + throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName); + } + slot.setAttachment(attachment); + return; + } + } + throw new Error("Slot not found: " + slotName); + }; + Skeleton.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var ikConstraint = ikConstraints[i]; + if (ikConstraint.data.name == constraintName) + return ikConstraint; + } + return null; + }; + Skeleton.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.getBounds = function (offset, size, temp) { + if (temp === void 0) { temp = new Array(2); } + if (offset == null) + throw new Error("offset cannot be null."); + if (size == null) + throw new Error("size cannot be null."); + var drawOrder = this.drawOrder; + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var verticesLength = 0; + var vertices = null; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + verticesLength = 8; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + attachment.computeWorldVertices(slot.bone, vertices, 0, 2); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + verticesLength = mesh.worldVerticesLength; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2); + } + if (vertices != null) { + for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + } + offset.set(minX, minY); + size.set(maxX - minX, maxY - minY); + }; + Skeleton.prototype.update = function (delta) { + this.time += delta; + }; + return Skeleton; + }()); + spine.Skeleton = Skeleton; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonBounds = (function () { + function SkeletonBounds() { + this.minX = 0; + this.minY = 0; + this.maxX = 0; + this.maxY = 0; + this.boundingBoxes = new Array(); + this.polygons = new Array(); + this.polygonPool = new spine.Pool(function () { + return spine.Utils.newFloatArray(16); + }); + } + SkeletonBounds.prototype.update = function (skeleton, updateAabb) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + var boundingBoxes = this.boundingBoxes; + var polygons = this.polygons; + var polygonPool = this.polygonPool; + var slots = skeleton.slots; + var slotCount = slots.length; + boundingBoxes.length = 0; + polygonPool.freeAll(polygons); + polygons.length = 0; + for (var i = 0; i < slotCount; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.BoundingBoxAttachment) { + var boundingBox = attachment; + boundingBoxes.push(boundingBox); + var polygon = polygonPool.obtain(); + if (polygon.length != boundingBox.worldVerticesLength) { + polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength); + } + polygons.push(polygon); + boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2); + } + } + if (updateAabb) { + this.aabbCompute(); + } + else { + this.minX = Number.POSITIVE_INFINITY; + this.minY = Number.POSITIVE_INFINITY; + this.maxX = Number.NEGATIVE_INFINITY; + this.maxY = Number.NEGATIVE_INFINITY; + } + }; + SkeletonBounds.prototype.aabbCompute = function () { + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + var vertices = polygon; + for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) { + var x = vertices[ii]; + var y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + this.minX = minX; + this.minY = minY; + this.maxX = maxX; + this.maxY = maxY; + }; + SkeletonBounds.prototype.aabbContainsPoint = function (x, y) { + return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; + }; + SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) { + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) + return false; + var m = (y2 - y1) / (x2 - x1); + var y = m * (minX - x1) + y1; + if (y > minY && y < maxY) + return true; + y = m * (maxX - x1) + y1; + if (y > minY && y < maxY) + return true; + var x = (minY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + x = (maxY - y1) / m + x1; + if (x > minX && x < maxX) + return true; return false; + }; + SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) { + return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; + }; + SkeletonBounds.prototype.containsPoint = function (x, y) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.containsPointPolygon(polygons[i], x, y)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) { + var vertices = polygon; + var nn = polygon.length; + var prevIndex = nn - 2; + var inside = false; + for (var ii = 0; ii < nn; ii += 2) { + var vertexY = vertices[ii + 1]; + var prevY = vertices[prevIndex + 1]; + if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { + var vertexX = vertices[ii]; + if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) + inside = !inside; + } + prevIndex = ii; + } + return inside; + }; + SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) { + var vertices = polygon; + var nn = polygon.length; + var width12 = x1 - x2, height12 = y1 - y2; + var det1 = x1 * y2 - y1 * x2; + var x3 = vertices[nn - 2], y3 = vertices[nn - 1]; + for (var ii = 0; ii < nn; ii += 2) { + var x4 = vertices[ii], y4 = vertices[ii + 1]; + var det2 = x3 * y4 - y3 * x4; + var width34 = x3 - x4, height34 = y3 - y4; + var det3 = width12 * height34 - height12 * width34; + var x = (det1 * width34 - width12 * det2) / det3; + if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { + var y = (det1 * height34 - height12 * det2) / det3; + if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) + return true; + } + x3 = x4; + y3 = y4; + } + return false; + }; + SkeletonBounds.prototype.getPolygon = function (boundingBox) { + if (boundingBox == null) + throw new Error("boundingBox cannot be null."); + var index = this.boundingBoxes.indexOf(boundingBox); + return index == -1 ? null : this.polygons[index]; + }; + SkeletonBounds.prototype.getWidth = function () { + return this.maxX - this.minX; + }; + SkeletonBounds.prototype.getHeight = function () { + return this.maxY - this.minY; + }; + return SkeletonBounds; + }()); + spine.SkeletonBounds = SkeletonBounds; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonClipping = (function () { + function SkeletonClipping() { + this.triangulator = new spine.Triangulator(); + this.clippingPolygon = new Array(); + this.clipOutput = new Array(); + this.clippedVertices = new Array(); + this.clippedTriangles = new Array(); + this.scratch = new Array(); } + SkeletonClipping.prototype.clipStart = function (slot, clip) { + if (this.clipAttachment != null) + return 0; + this.clipAttachment = clip; + var n = clip.worldVerticesLength; + var vertices = spine.Utils.setArraySize(this.clippingPolygon, n); + clip.computeWorldVertices(slot, 0, n, vertices, 0, 2); + var clippingPolygon = this.clippingPolygon; + SkeletonClipping.makeClockwise(clippingPolygon); + var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); + for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) { + var polygon = clippingPolygons[i]; + SkeletonClipping.makeClockwise(polygon); + polygon.push(polygon[0]); + polygon.push(polygon[1]); + } + return clippingPolygons.length; + }; + SkeletonClipping.prototype.clipEndWithSlot = function (slot) { + if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data) + this.clipEnd(); + }; + SkeletonClipping.prototype.clipEnd = function () { + if (this.clipAttachment == null) + return; + this.clipAttachment = null; + this.clippingPolygons = null; + this.clippedVertices.length = 0; + this.clippedTriangles.length = 0; + this.clippingPolygon.length = 0; + }; + SkeletonClipping.prototype.isClipping = function () { + return this.clipAttachment != null; + }; + SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) { + var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; + var clippedTriangles = this.clippedTriangles; + var polygons = this.clippingPolygons; + var polygonsCount = this.clippingPolygons.length; + var vertexSize = twoColor ? 12 : 8; + var index = 0; + clippedVertices.length = 0; + clippedTriangles.length = 0; + outer: for (var i = 0; i < trianglesLength; i += 3) { + var vertexOffset = triangles[i] << 1; + var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; + var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 1] << 1; + var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; + var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 2] << 1; + var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; + var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; + for (var p = 0; p < polygonsCount; p++) { + var s = clippedVertices.length; + if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { + var clipOutputLength = clipOutput.length; + if (clipOutputLength == 0) + continue; + var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; + var d = 1 / (d0 * d2 + d1 * (y1 - y3)); + var clipOutputCount = clipOutputLength >> 1; + var clipOutputItems = this.clipOutput; + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize); + for (var ii = 0; ii < clipOutputLength; ii += 2) { + var x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; + clippedVerticesItems[s] = x; + clippedVerticesItems[s + 1] = y; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + var c0 = x - x3, c1 = y - y3; + var a = (d0 * c0 + d1 * c1) * d; + var b = (d4 * c0 + d2 * c1) * d; + var c = 1 - a - b; + clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c; + clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c; + if (twoColor) { + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + } + s += vertexSize; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); + clipOutputCount--; + for (var ii = 1; ii < clipOutputCount; ii++) { + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + ii); + clippedTrianglesItems[s + 2] = (index + ii + 1); + s += 3; + } + index += clipOutputCount + 1; + } + else { + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize); + clippedVerticesItems[s] = x1; + clippedVerticesItems[s + 1] = y1; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + if (!twoColor) { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = x2; + clippedVerticesItems[s + 9] = y2; + clippedVerticesItems[s + 10] = light.r; + clippedVerticesItems[s + 11] = light.g; + clippedVerticesItems[s + 12] = light.b; + clippedVerticesItems[s + 13] = light.a; + clippedVerticesItems[s + 14] = u2; + clippedVerticesItems[s + 15] = v2; + clippedVerticesItems[s + 16] = x3; + clippedVerticesItems[s + 17] = y3; + clippedVerticesItems[s + 18] = light.r; + clippedVerticesItems[s + 19] = light.g; + clippedVerticesItems[s + 20] = light.b; + clippedVerticesItems[s + 21] = light.a; + clippedVerticesItems[s + 22] = u3; + clippedVerticesItems[s + 23] = v3; + } + else { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + clippedVerticesItems[s + 12] = x2; + clippedVerticesItems[s + 13] = y2; + clippedVerticesItems[s + 14] = light.r; + clippedVerticesItems[s + 15] = light.g; + clippedVerticesItems[s + 16] = light.b; + clippedVerticesItems[s + 17] = light.a; + clippedVerticesItems[s + 18] = u2; + clippedVerticesItems[s + 19] = v2; + clippedVerticesItems[s + 20] = dark.r; + clippedVerticesItems[s + 21] = dark.g; + clippedVerticesItems[s + 22] = dark.b; + clippedVerticesItems[s + 23] = dark.a; + clippedVerticesItems[s + 24] = x3; + clippedVerticesItems[s + 25] = y3; + clippedVerticesItems[s + 26] = light.r; + clippedVerticesItems[s + 27] = light.g; + clippedVerticesItems[s + 28] = light.b; + clippedVerticesItems[s + 29] = light.a; + clippedVerticesItems[s + 30] = u3; + clippedVerticesItems[s + 31] = v3; + clippedVerticesItems[s + 32] = dark.r; + clippedVerticesItems[s + 33] = dark.g; + clippedVerticesItems[s + 34] = dark.b; + clippedVerticesItems[s + 35] = dark.a; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3); + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + 1); + clippedTrianglesItems[s + 2] = (index + 2); + index += 3; + continue outer; + } + } + } + }; + SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) { + var originalOutput = output; + var clipped = false; + var input = null; + if (clippingArea.length % 4 >= 2) { + input = output; + output = this.scratch; + } + else + input = this.scratch; + input.length = 0; + input.push(x1); + input.push(y1); + input.push(x2); + input.push(y2); + input.push(x3); + input.push(y3); + input.push(x1); + input.push(y1); + output.length = 0; + var clippingVertices = clippingArea; + var clippingVerticesLast = clippingArea.length - 4; + for (var i = 0;; i += 2) { + var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; + var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3]; + var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2; + var inputVertices = input; + var inputVerticesLength = input.length - 2, outputStart = output.length; + for (var ii = 0; ii < inputVerticesLength; ii += 2) { + var inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; + var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3]; + var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0; + if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) { + if (side2) { + output.push(inputX2); + output.push(inputY2); + continue; + } + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + } + else if (side2) { + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + output.push(inputX2); + output.push(inputY2); + } + clipped = true; + } + if (outputStart == output.length) { + originalOutput.length = 0; + return true; + } + output.push(output[0]); + output.push(output[1]); + if (i == clippingVerticesLast) + break; + var temp = output; + output = input; + output.length = 0; + input = temp; + } + if (originalOutput != output) { + originalOutput.length = 0; + for (var i = 0, n = output.length - 2; i < n; i++) + originalOutput[i] = output[i]; + } + else + originalOutput.length = originalOutput.length - 2; + return clipped; + }; + SkeletonClipping.makeClockwise = function (polygon) { + var vertices = polygon; + var verticeslength = polygon.length; + var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; + for (var i = 0, n = verticeslength - 3; i < n; i += 2) { + p1x = vertices[i]; + p1y = vertices[i + 1]; + p2x = vertices[i + 2]; + p2y = vertices[i + 3]; + area += p1x * p2y - p2x * p1y; + } + if (area < 0) + return; + for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { + var x = vertices[i], y = vertices[i + 1]; + var other = lastX - i; + vertices[i] = vertices[other]; + vertices[i + 1] = vertices[other + 1]; + vertices[other] = x; + vertices[other + 1] = y; + } + }; + return SkeletonClipping; + }()); + spine.SkeletonClipping = SkeletonClipping; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonData = (function () { + function SkeletonData() { + this.bones = new Array(); + this.slots = new Array(); + this.skins = new Array(); + this.events = new Array(); + this.animations = new Array(); + this.ikConstraints = new Array(); + this.transformConstraints = new Array(); + this.pathConstraints = new Array(); + this.fps = 0; + } + SkeletonData.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.name == boneName) + return bone; + } + return null; + }; + SkeletonData.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].name == boneName) + return i; + return -1; + }; + SkeletonData.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.name == slotName) + return slot; + } + return null; + }; + SkeletonData.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].name == slotName) + return i; + return -1; + }; + SkeletonData.prototype.findSkin = function (skinName) { + if (skinName == null) + throw new Error("skinName cannot be null."); + var skins = this.skins; + for (var i = 0, n = skins.length; i < n; i++) { + var skin = skins[i]; + if (skin.name == skinName) + return skin; + } + return null; + }; + SkeletonData.prototype.findEvent = function (eventDataName) { + if (eventDataName == null) + throw new Error("eventDataName cannot be null."); + var events = this.events; + for (var i = 0, n = events.length; i < n; i++) { + var event_4 = events[i]; + if (event_4.name == eventDataName) + return event_4; + } + return null; + }; + SkeletonData.prototype.findAnimation = function (animationName) { + if (animationName == null) + throw new Error("animationName cannot be null."); + var animations = this.animations; + for (var i = 0, n = animations.length; i < n; i++) { + var animation = animations[i]; + if (animation.name == animationName) + return animation; + } + return null; + }; + SkeletonData.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) { + if (pathConstraintName == null) + throw new Error("pathConstraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) + if (pathConstraints[i].name == pathConstraintName) + return i; + return -1; + }; + return SkeletonData; + }()); + spine.SkeletonData = SkeletonData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonJson = (function () { + function SkeletonJson(attachmentLoader) { + this.scale = 1; + this.linkedMeshes = new Array(); + this.attachmentLoader = attachmentLoader; + } + SkeletonJson.prototype.readSkeletonData = function (json) { + var scale = this.scale; + var skeletonData = new spine.SkeletonData(); + var root = typeof (json) === "string" ? JSON.parse(json) : json; + var skeletonMap = root.skeleton; + if (skeletonMap != null) { + skeletonData.hash = skeletonMap.hash; + skeletonData.version = skeletonMap.spine; + skeletonData.width = skeletonMap.width; + skeletonData.height = skeletonMap.height; + skeletonData.fps = skeletonMap.fps; + skeletonData.imagesPath = skeletonMap.images; + } + if (root.bones) { + for (var i = 0; i < root.bones.length; i++) { + var boneMap = root.bones[i]; + var parent_2 = null; + var parentName = this.getValue(boneMap, "parent", null); + if (parentName != null) { + parent_2 = skeletonData.findBone(parentName); + if (parent_2 == null) + throw new Error("Parent bone not found: " + parentName); + } + var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2); + data.length = this.getValue(boneMap, "length", 0) * scale; + data.x = this.getValue(boneMap, "x", 0) * scale; + data.y = this.getValue(boneMap, "y", 0) * scale; + data.rotation = this.getValue(boneMap, "rotation", 0); + data.scaleX = this.getValue(boneMap, "scaleX", 1); + data.scaleY = this.getValue(boneMap, "scaleY", 1); + data.shearX = this.getValue(boneMap, "shearX", 0); + data.shearY = this.getValue(boneMap, "shearY", 0); + data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal")); + skeletonData.bones.push(data); + } + } + if (root.slots) { + for (var i = 0; i < root.slots.length; i++) { + var slotMap = root.slots[i]; + var slotName = slotMap.name; + var boneName = slotMap.bone; + var boneData = skeletonData.findBone(boneName); + if (boneData == null) + throw new Error("Slot bone not found: " + boneName); + var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData); + var color = this.getValue(slotMap, "color", null); + if (color != null) + data.color.setFromString(color); + var dark = this.getValue(slotMap, "dark", null); + if (dark != null) { + data.darkColor = new spine.Color(1, 1, 1, 1); + data.darkColor.setFromString(dark); + } + data.attachmentName = this.getValue(slotMap, "attachment", null); + data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, "blend", "normal")); + skeletonData.slots.push(data); + } + } + if (root.ik) { + for (var i = 0; i < root.ik.length; i++) { + var constraintMap = root.ik[i]; + var data = new spine.IkConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("IK bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("IK target bone not found: " + targetName); + data.mix = this.getValue(constraintMap, "mix", 1); + data.bendDirection = this.getValue(constraintMap, "bendPositive", true) ? 1 : -1; + data.compress = this.getValue(constraintMap, "compress", false); + data.stretch = this.getValue(constraintMap, "stretch", false); + data.uniform = this.getValue(constraintMap, "uniform", false); + skeletonData.ikConstraints.push(data); + } + } + if (root.transform) { + for (var i = 0; i < root.transform.length; i++) { + var constraintMap = root.transform[i]; + var data = new spine.TransformConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("Transform constraint target bone not found: " + targetName); + data.local = this.getValue(constraintMap, "local", false); + data.relative = this.getValue(constraintMap, "relative", false); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.offsetX = this.getValue(constraintMap, "x", 0) * scale; + data.offsetY = this.getValue(constraintMap, "y", 0) * scale; + data.offsetScaleX = this.getValue(constraintMap, "scaleX", 0); + data.offsetScaleY = this.getValue(constraintMap, "scaleY", 0); + data.offsetShearY = this.getValue(constraintMap, "shearY", 0); + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + data.scaleMix = this.getValue(constraintMap, "scaleMix", 1); + data.shearMix = this.getValue(constraintMap, "shearMix", 1); + skeletonData.transformConstraints.push(data); + } + } + if (root.path) { + for (var i = 0; i < root.path.length; i++) { + var constraintMap = root.path[i]; + var data = new spine.PathConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findSlot(targetName); + if (data.target == null) + throw new Error("Path target slot not found: " + targetName); + data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, "positionMode", "percent")); + data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, "spacingMode", "length")); + data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, "rotateMode", "tangent")); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.position = this.getValue(constraintMap, "position", 0); + if (data.positionMode == spine.PositionMode.Fixed) + data.position *= scale; + data.spacing = this.getValue(constraintMap, "spacing", 0); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + data.spacing *= scale; + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + skeletonData.pathConstraints.push(data); + } + } + if (root.skins) { + for (var skinName in root.skins) { + var skinMap = root.skins[skinName]; + var skin = new spine.Skin(skinName); + for (var slotName in skinMap) { + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + var slotMap = skinMap[slotName]; + for (var entryName in slotMap) { + var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData); + if (attachment != null) + skin.addAttachment(slotIndex, entryName, attachment); + } + } + skeletonData.skins.push(skin); + if (skin.name == "default") + skeletonData.defaultSkin = skin; + } + } + for (var i = 0, n = this.linkedMeshes.length; i < n; i++) { + var linkedMesh = this.linkedMeshes[i]; + var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); + if (skin == null) + throw new Error("Skin not found: " + linkedMesh.skin); + var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); + if (parent_3 == null) + throw new Error("Parent mesh not found: " + linkedMesh.parent); + linkedMesh.mesh.setParentMesh(parent_3); + linkedMesh.mesh.updateUVs(); + } + this.linkedMeshes.length = 0; + if (root.events) { + for (var eventName in root.events) { + var eventMap = root.events[eventName]; + var data = new spine.EventData(eventName); + data.intValue = this.getValue(eventMap, "int", 0); + data.floatValue = this.getValue(eventMap, "float", 0); + data.stringValue = this.getValue(eventMap, "string", ""); + data.audioPath = this.getValue(eventMap, "audio", null); + if (data.audioPath != null) { + data.volume = this.getValue(eventMap, "volume", 1); + data.balance = this.getValue(eventMap, "balance", 0); + } + skeletonData.events.push(data); + } + } + if (root.animations) { + for (var animationName in root.animations) { + var animationMap = root.animations[animationName]; + this.readAnimation(animationMap, animationName, skeletonData); + } + } + return skeletonData; + }; + SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) { + var scale = this.scale; + name = this.getValue(map, "name", name); + var type = this.getValue(map, "type", "region"); + switch (type) { + case "region": { + var path = this.getValue(map, "path", name); + var region = this.attachmentLoader.newRegionAttachment(skin, name, path); + if (region == null) + return null; + region.path = path; + region.x = this.getValue(map, "x", 0) * scale; + region.y = this.getValue(map, "y", 0) * scale; + region.scaleX = this.getValue(map, "scaleX", 1); + region.scaleY = this.getValue(map, "scaleY", 1); + region.rotation = this.getValue(map, "rotation", 0); + region.width = map.width * scale; + region.height = map.height * scale; + var color = this.getValue(map, "color", null); + if (color != null) + region.color.setFromString(color); + region.updateOffset(); + return region; + } + case "boundingbox": { + var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); + if (box == null) + return null; + this.readVertices(map, box, map.vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + box.color.setFromString(color); + return box; + } + case "mesh": + case "linkedmesh": { + var path = this.getValue(map, "path", name); + var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); + if (mesh == null) + return null; + mesh.path = path; + var color = this.getValue(map, "color", null); + if (color != null) + mesh.color.setFromString(color); + var parent_4 = this.getValue(map, "parent", null); + if (parent_4 != null) { + mesh.inheritDeform = this.getValue(map, "deform", true); + this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, "skin", null), slotIndex, parent_4)); + return mesh; + } + var uvs = map.uvs; + this.readVertices(map, mesh, uvs.length); + mesh.triangles = map.triangles; + mesh.regionUVs = uvs; + mesh.updateUVs(); + mesh.hullLength = this.getValue(map, "hull", 0) * 2; + return mesh; + } + case "path": { + var path = this.attachmentLoader.newPathAttachment(skin, name); + if (path == null) + return null; + path.closed = this.getValue(map, "closed", false); + path.constantSpeed = this.getValue(map, "constantSpeed", true); + var vertexCount = map.vertexCount; + this.readVertices(map, path, vertexCount << 1); + var lengths = spine.Utils.newArray(vertexCount / 3, 0); + for (var i = 0; i < map.lengths.length; i++) + lengths[i] = map.lengths[i] * scale; + path.lengths = lengths; + var color = this.getValue(map, "color", null); + if (color != null) + path.color.setFromString(color); + return path; + } + case "point": { + var point = this.attachmentLoader.newPointAttachment(skin, name); + if (point == null) + return null; + point.x = this.getValue(map, "x", 0) * scale; + point.y = this.getValue(map, "y", 0) * scale; + point.rotation = this.getValue(map, "rotation", 0); + var color = this.getValue(map, "color", null); + if (color != null) + point.color.setFromString(color); + return point; + } + case "clipping": { + var clip = this.attachmentLoader.newClippingAttachment(skin, name); + if (clip == null) + return null; + var end = this.getValue(map, "end", null); + if (end != null) { + var slot = skeletonData.findSlot(end); + if (slot == null) + throw new Error("Clipping end slot not found: " + end); + clip.endSlot = slot; + } + var vertexCount = map.vertexCount; + this.readVertices(map, clip, vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + clip.color.setFromString(color); + return clip; + } + } + return null; + }; + SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) { + var scale = this.scale; + attachment.worldVerticesLength = verticesLength; + var vertices = map.vertices; + if (verticesLength == vertices.length) { + var scaledVertices = spine.Utils.toFloatArray(vertices); + if (scale != 1) { + for (var i = 0, n = vertices.length; i < n; i++) + scaledVertices[i] *= scale; + } + attachment.vertices = scaledVertices; + return; + } + var weights = new Array(); + var bones = new Array(); + for (var i = 0, n = vertices.length; i < n;) { + var boneCount = vertices[i++]; + bones.push(boneCount); + for (var nn = i + boneCount * 4; i < nn; i += 4) { + bones.push(vertices[i]); + weights.push(vertices[i + 1] * scale); + weights.push(vertices[i + 2] * scale); + weights.push(vertices[i + 3]); + } + } + attachment.bones = bones; + attachment.vertices = spine.Utils.toFloatArray(weights); + }; + SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) { + var scale = this.scale; + var timelines = new Array(); + var duration = 0; + if (map.slots) { + for (var slotName in map.slots) { + var slotMap = map.slots[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + if (timelineName == "attachment") { + var timeline = new spine.AttachmentTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex++, valueMap.time, valueMap.name); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + else if (timelineName == "color") { + var timeline = new spine.ColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var color = new spine.Color(); + color.setFromString(valueMap.color); + timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]); + } + else if (timelineName == "twoColor") { + var timeline = new spine.TwoColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var light = new spine.Color(); + var dark = new spine.Color(); + light.setFromString(valueMap.light); + dark.setFromString(valueMap.dark); + timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"); + } + } + } + if (map.bones) { + for (var boneName in map.bones) { + var boneMap = map.bones[boneName]; + var boneIndex = skeletonData.findBoneIndex(boneName); + if (boneIndex == -1) + throw new Error("Bone not found: " + boneName); + for (var timelineName in boneMap) { + var timelineMap = boneMap[timelineName]; + if (timelineName === "rotate") { + var timeline = new spine.RotateTimeline(timelineMap.length); + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, valueMap.angle); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]); + } + else if (timelineName === "translate" || timelineName === "scale" || timelineName === "shear") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "scale") + timeline = new spine.ScaleTimeline(timelineMap.length); + else if (timelineName === "shear") + timeline = new spine.ShearTimeline(timelineMap.length); + else { + timeline = new spine.TranslateTimeline(timelineMap.length); + timelineScale = scale; + } + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var x = this.getValue(valueMap, "x", 0), y = this.getValue(valueMap, "y", 0); + timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"); + } + } + } + if (map.ik) { + for (var constraintName in map.ik) { + var constraintMap = map.ik[constraintName]; + var constraint = skeletonData.findIkConstraint(constraintName); + var timeline = new spine.IkConstraintTimeline(constraintMap.length); + timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "mix", 1), this.getValue(valueMap, "bendPositive", true) ? 1 : -1, this.getValue(valueMap, "compress", false), this.getValue(valueMap, "stretch", false)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]); + } + } + if (map.transform) { + for (var constraintName in map.transform) { + var constraintMap = map.transform[constraintName]; + var constraint = skeletonData.findTransformConstraint(constraintName); + var timeline = new spine.TransformConstraintTimeline(constraintMap.length); + timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1), this.getValue(valueMap, "scaleMix", 1), this.getValue(valueMap, "shearMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]); + } + } + if (map.paths) { + for (var constraintName in map.paths) { + var constraintMap = map.paths[constraintName]; + var index = skeletonData.findPathConstraintIndex(constraintName); + if (index == -1) + throw new Error("Path constraint not found: " + constraintName); + var data = skeletonData.pathConstraints[index]; + for (var timelineName in constraintMap) { + var timelineMap = constraintMap[timelineName]; + if (timelineName === "position" || timelineName === "spacing") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "spacing") { + timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + timelineScale = scale; + } + else { + timeline = new spine.PathConstraintPositionTimeline(timelineMap.length); + if (data.positionMode == spine.PositionMode.Fixed) + timelineScale = scale; + } + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]); + } + else if (timelineName === "mix") { + var timeline = new spine.PathConstraintMixTimeline(timelineMap.length); + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]); + } + } + } + } + if (map.deform) { + for (var deformName in map.deform) { + var deformMap = map.deform[deformName]; + var skin = skeletonData.findSkin(deformName); + if (skin == null) + throw new Error("Skin not found: " + deformName); + for (var slotName in deformMap) { + var slotMap = deformMap[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotMap.name); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + var attachment = skin.getAttachment(slotIndex, timelineName); + if (attachment == null) + throw new Error("Deform attachment not found: " + timelineMap.name); + var weighted = attachment.bones != null; + var vertices = attachment.vertices; + var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; + var timeline = new spine.DeformTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + timeline.attachment = attachment; + var frameIndex = 0; + for (var j = 0; j < timelineMap.length; j++) { + var valueMap = timelineMap[j]; + var deform = void 0; + var verticesValue = this.getValue(valueMap, "vertices", null); + if (verticesValue == null) + deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices; + else { + deform = spine.Utils.newFloatArray(deformLength); + var start = this.getValue(valueMap, "offset", 0); + spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); + if (scale != 1) { + for (var i = start, n = i + verticesValue.length; i < n; i++) + deform[i] *= scale; + } + if (!weighted) { + for (var i = 0; i < deformLength; i++) + deform[i] += vertices[i]; + } + } + timeline.setFrame(frameIndex, valueMap.time, deform); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + } + } + } + var drawOrderNode = map.drawOrder; + if (drawOrderNode == null) + drawOrderNode = map.draworder; + if (drawOrderNode != null) { + var timeline = new spine.DrawOrderTimeline(drawOrderNode.length); + var slotCount = skeletonData.slots.length; + var frameIndex = 0; + for (var j = 0; j < drawOrderNode.length; j++) { + var drawOrderMap = drawOrderNode[j]; + var drawOrder = null; + var offsets = this.getValue(drawOrderMap, "offsets", null); + if (offsets != null) { + drawOrder = spine.Utils.newArray(slotCount, -1); + var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0); + var originalIndex = 0, unchangedIndex = 0; + for (var i = 0; i < offsets.length; i++) { + var offsetMap = offsets[i]; + var slotIndex = skeletonData.findSlotIndex(offsetMap.slot); + if (slotIndex == -1) + throw new Error("Slot not found: " + offsetMap.slot); + while (originalIndex != slotIndex) + unchanged[unchangedIndex++] = originalIndex++; + drawOrder[originalIndex + offsetMap.offset] = originalIndex++; + } + while (originalIndex < slotCount) + unchanged[unchangedIndex++] = originalIndex++; + for (var i = slotCount - 1; i >= 0; i--) + if (drawOrder[i] == -1) + drawOrder[i] = unchanged[--unchangedIndex]; + } + timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (map.events) { + var timeline = new spine.EventTimeline(map.events.length); + var frameIndex = 0; + for (var i = 0; i < map.events.length; i++) { + var eventMap = map.events[i]; + var eventData = skeletonData.findEvent(eventMap.name); + if (eventData == null) + throw new Error("Event not found: " + eventMap.name); + var event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData); + event_5.intValue = this.getValue(eventMap, "int", eventData.intValue); + event_5.floatValue = this.getValue(eventMap, "float", eventData.floatValue); + event_5.stringValue = this.getValue(eventMap, "string", eventData.stringValue); + if (event_5.data.audioPath != null) { + event_5.volume = this.getValue(eventMap, "volume", 1); + event_5.balance = this.getValue(eventMap, "balance", 0); + } + timeline.setFrame(frameIndex++, event_5); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (isNaN(duration)) { + throw new Error("Error while parsing animation, duration is NaN"); + } + skeletonData.animations.push(new spine.Animation(name, timelines, duration)); + }; + SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) { + if (!map.curve) + return; + if (map.curve === "stepped") + timeline.setStepped(frameIndex); + else if (Object.prototype.toString.call(map.curve) === '[object Array]') { + var curve = map.curve; + timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); + } + }; + SkeletonJson.prototype.getValue = function (map, prop, defaultValue) { + return map[prop] !== undefined ? map[prop] : defaultValue; + }; + SkeletonJson.blendModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.BlendMode.Normal; + if (str == "additive") + return spine.BlendMode.Additive; + if (str == "multiply") + return spine.BlendMode.Multiply; + if (str == "screen") + return spine.BlendMode.Screen; + throw new Error("Unknown blend mode: " + str); + }; + SkeletonJson.positionModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "fixed") + return spine.PositionMode.Fixed; + if (str == "percent") + return spine.PositionMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.spacingModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "length") + return spine.SpacingMode.Length; + if (str == "fixed") + return spine.SpacingMode.Fixed; + if (str == "percent") + return spine.SpacingMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.rotateModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "tangent") + return spine.RotateMode.Tangent; + if (str == "chain") + return spine.RotateMode.Chain; + if (str == "chainscale") + return spine.RotateMode.ChainScale; + throw new Error("Unknown rotate mode: " + str); + }; + SkeletonJson.transformModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.TransformMode.Normal; + if (str == "onlytranslation") + return spine.TransformMode.OnlyTranslation; + if (str == "norotationorreflection") + return spine.TransformMode.NoRotationOrReflection; + if (str == "noscale") + return spine.TransformMode.NoScale; + if (str == "noscaleorreflection") + return spine.TransformMode.NoScaleOrReflection; + throw new Error("Unknown transform mode: " + str); + }; + return SkeletonJson; + }()); + spine.SkeletonJson = SkeletonJson; + var LinkedMesh = (function () { + function LinkedMesh(mesh, skin, slotIndex, parent) { + this.mesh = mesh; + this.skin = skin; + this.slotIndex = slotIndex; + this.parent = parent; + } + return LinkedMesh; + }()); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skin = (function () { + function Skin(name) { + this.attachments = new Array(); + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + Skin.prototype.addAttachment = function (slotIndex, name, attachment) { + if (attachment == null) + throw new Error("attachment cannot be null."); + var attachments = this.attachments; + if (slotIndex >= attachments.length) + attachments.length = slotIndex + 1; + if (!attachments[slotIndex]) + attachments[slotIndex] = {}; + attachments[slotIndex][name] = attachment; + }; + Skin.prototype.getAttachment = function (slotIndex, name) { + var dictionary = this.attachments[slotIndex]; + return dictionary ? dictionary[name] : null; + }; + Skin.prototype.attachAll = function (skeleton, oldSkin) { + var slotIndex = 0; + for (var i = 0; i < skeleton.slots.length; i++) { + var slot = skeleton.slots[i]; + var slotAttachment = slot.getAttachment(); + if (slotAttachment && slotIndex < oldSkin.attachments.length) { + var dictionary = oldSkin.attachments[slotIndex]; + for (var key in dictionary) { + var skinAttachment = dictionary[key]; + if (slotAttachment == skinAttachment) { + var attachment = this.getAttachment(slotIndex, key); + if (attachment != null) + slot.setAttachment(attachment); + break; + } + } + } + slotIndex++; + } + }; + return Skin; + }()); + spine.Skin = Skin; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Slot = (function () { + function Slot(data, bone) { + this.attachmentVertices = new Array(); + if (data == null) + throw new Error("data cannot be null."); + if (bone == null) + throw new Error("bone cannot be null."); + this.data = data; + this.bone = bone; + this.color = new spine.Color(); + this.darkColor = data.darkColor == null ? null : new spine.Color(); + this.setToSetupPose(); + } + Slot.prototype.getAttachment = function () { + return this.attachment; + }; + Slot.prototype.setAttachment = function (attachment) { + if (this.attachment == attachment) + return; + this.attachment = attachment; + this.attachmentTime = this.bone.skeleton.time; + this.attachmentVertices.length = 0; + }; + Slot.prototype.setAttachmentTime = function (time) { + this.attachmentTime = this.bone.skeleton.time - time; + }; + Slot.prototype.getAttachmentTime = function () { + return this.bone.skeleton.time - this.attachmentTime; + }; + Slot.prototype.setToSetupPose = function () { + this.color.setFromColor(this.data.color); + if (this.darkColor != null) + this.darkColor.setFromColor(this.data.darkColor); + if (this.data.attachmentName == null) + this.attachment = null; + else { + this.attachment = null; + this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)); + } + }; + return Slot; + }()); + spine.Slot = Slot; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SlotData = (function () { + function SlotData(index, name, boneData) { + this.color = new spine.Color(1, 1, 1, 1); + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + if (boneData == null) + throw new Error("boneData cannot be null."); + this.index = index; + this.name = name; + this.boneData = boneData; + } + return SlotData; + }()); + spine.SlotData = SlotData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Texture = (function () { + function Texture(image) { + this._image = image; + } + Texture.prototype.getImage = function () { + return this._image; + }; + Texture.filterFromString = function (text) { + switch (text.toLowerCase()) { + case "nearest": return TextureFilter.Nearest; + case "linear": return TextureFilter.Linear; + case "mipmap": return TextureFilter.MipMap; + case "mipmapnearestnearest": return TextureFilter.MipMapNearestNearest; + case "mipmaplinearnearest": return TextureFilter.MipMapLinearNearest; + case "mipmapnearestlinear": return TextureFilter.MipMapNearestLinear; + case "mipmaplinearlinear": return TextureFilter.MipMapLinearLinear; + default: throw new Error("Unknown texture filter " + text); + } + }; + Texture.wrapFromString = function (text) { + switch (text.toLowerCase()) { + case "mirroredtepeat": return TextureWrap.MirroredRepeat; + case "clamptoedge": return TextureWrap.ClampToEdge; + case "repeat": return TextureWrap.Repeat; + default: throw new Error("Unknown texture wrap " + text); + } + }; + return Texture; + }()); + spine.Texture = Texture; + var TextureFilter; + (function (TextureFilter) { + TextureFilter[TextureFilter["Nearest"] = 9728] = "Nearest"; + TextureFilter[TextureFilter["Linear"] = 9729] = "Linear"; + TextureFilter[TextureFilter["MipMap"] = 9987] = "MipMap"; + TextureFilter[TextureFilter["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; + TextureFilter[TextureFilter["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; + TextureFilter[TextureFilter["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; + TextureFilter[TextureFilter["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; + })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {})); + var TextureWrap; + (function (TextureWrap) { + TextureWrap[TextureWrap["MirroredRepeat"] = 33648] = "MirroredRepeat"; + TextureWrap[TextureWrap["ClampToEdge"] = 33071] = "ClampToEdge"; + TextureWrap[TextureWrap["Repeat"] = 10497] = "Repeat"; + })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {})); + var TextureRegion = (function () { + function TextureRegion() { + this.u = 0; + this.v = 0; + this.u2 = 0; + this.v2 = 0; + this.width = 0; + this.height = 0; + this.rotate = false; + this.offsetX = 0; + this.offsetY = 0; + this.originalWidth = 0; + this.originalHeight = 0; + } + return TextureRegion; + }()); + spine.TextureRegion = TextureRegion; + var FakeTexture = (function (_super) { + __extends(FakeTexture, _super); + function FakeTexture() { + return _super !== null && _super.apply(this, arguments) || this; + } + FakeTexture.prototype.setFilters = function (minFilter, magFilter) { }; + FakeTexture.prototype.setWraps = function (uWrap, vWrap) { }; + FakeTexture.prototype.dispose = function () { }; + return FakeTexture; + }(Texture)); + spine.FakeTexture = FakeTexture; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TextureAtlas = (function () { + function TextureAtlas(atlasText, textureLoader) { + this.pages = new Array(); + this.regions = new Array(); + this.load(atlasText, textureLoader); + } + TextureAtlas.prototype.load = function (atlasText, textureLoader) { + if (textureLoader == null) + throw new Error("textureLoader cannot be null."); + var reader = new TextureAtlasReader(atlasText); + var tuple = new Array(4); + var page = null; + while (true) { + var line = reader.readLine(); + if (line == null) + break; + line = line.trim(); + if (line.length == 0) + page = null; + else if (!page) { + page = new TextureAtlasPage(); + page.name = line; + if (reader.readTuple(tuple) == 2) { + page.width = parseInt(tuple[0]); + page.height = parseInt(tuple[1]); + reader.readTuple(tuple); + } + reader.readTuple(tuple); + page.minFilter = spine.Texture.filterFromString(tuple[0]); + page.magFilter = spine.Texture.filterFromString(tuple[1]); + var direction = reader.readValue(); + page.uWrap = spine.TextureWrap.ClampToEdge; + page.vWrap = spine.TextureWrap.ClampToEdge; + if (direction == "x") + page.uWrap = spine.TextureWrap.Repeat; + else if (direction == "y") + page.vWrap = spine.TextureWrap.Repeat; + else if (direction == "xy") + page.uWrap = page.vWrap = spine.TextureWrap.Repeat; + page.texture = textureLoader(line); + page.texture.setFilters(page.minFilter, page.magFilter); + page.texture.setWraps(page.uWrap, page.vWrap); + page.width = page.texture.getImage().width; + page.height = page.texture.getImage().height; + this.pages.push(page); + } + else { + var region = new TextureAtlasRegion(); + region.name = line; + region.page = page; + region.rotate = reader.readValue() == "true"; + reader.readTuple(tuple); + var x = parseInt(tuple[0]); + var y = parseInt(tuple[1]); + reader.readTuple(tuple); + var width = parseInt(tuple[0]); + var height = parseInt(tuple[1]); + region.u = x / page.width; + region.v = y / page.height; + if (region.rotate) { + region.u2 = (x + height) / page.width; + region.v2 = (y + width) / page.height; + } + else { + region.u2 = (x + width) / page.width; + region.v2 = (y + height) / page.height; + } + region.x = x; + region.y = y; + region.width = Math.abs(width); + region.height = Math.abs(height); + if (reader.readTuple(tuple) == 4) { + if (reader.readTuple(tuple) == 4) { + reader.readTuple(tuple); + } + } + region.originalWidth = parseInt(tuple[0]); + region.originalHeight = parseInt(tuple[1]); + reader.readTuple(tuple); + region.offsetX = parseInt(tuple[0]); + region.offsetY = parseInt(tuple[1]); + region.index = parseInt(reader.readValue()); + region.texture = page.texture; + this.regions.push(region); + } + } + }; + TextureAtlas.prototype.findRegion = function (name) { + for (var i = 0; i < this.regions.length; i++) { + if (this.regions[i].name == name) { + return this.regions[i]; + } + } + return null; + }; + TextureAtlas.prototype.dispose = function () { + for (var i = 0; i < this.pages.length; i++) { + this.pages[i].texture.dispose(); + } + }; + return TextureAtlas; + }()); + spine.TextureAtlas = TextureAtlas; + var TextureAtlasReader = (function () { + function TextureAtlasReader(text) { + this.index = 0; + this.lines = text.split(/\r\n|\r|\n/); + } + TextureAtlasReader.prototype.readLine = function () { + if (this.index >= this.lines.length) + return null; + return this.lines[this.index++]; + }; + TextureAtlasReader.prototype.readValue = function () { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + return line.substring(colon + 1).trim(); + }; + TextureAtlasReader.prototype.readTuple = function (tuple) { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + var i = 0, lastMatch = colon + 1; + for (; i < 3; i++) { + var comma = line.indexOf(",", lastMatch); + if (comma == -1) + break; + tuple[i] = line.substr(lastMatch, comma - lastMatch).trim(); + lastMatch = comma + 1; + } + tuple[i] = line.substring(lastMatch).trim(); + return i + 1; + }; + return TextureAtlasReader; + }()); + var TextureAtlasPage = (function () { + function TextureAtlasPage() { + } + return TextureAtlasPage; + }()); + spine.TextureAtlasPage = TextureAtlasPage; + var TextureAtlasRegion = (function (_super) { + __extends(TextureAtlasRegion, _super); + function TextureAtlasRegion() { + return _super !== null && _super.apply(this, arguments) || this; + } + return TextureAtlasRegion; + }(spine.TextureRegion)); + spine.TextureAtlasRegion = TextureAtlasRegion; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraint = (function () { + function TransformConstraint(data, skeleton) { + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.temp = new spine.Vector2(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + this.scaleMix = data.scaleMix; + this.shearMix = data.shearMix; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + TransformConstraint.prototype.apply = function () { + this.update(); + }; + TransformConstraint.prototype.update = function () { + if (this.data.local) { + if (this.data.relative) + this.applyRelativeLocal(); + else + this.applyAbsoluteLocal(); + } + else { + if (this.data.relative) + this.applyRelativeWorld(); + else + this.applyAbsoluteWorld(); + } + }; + TransformConstraint.prototype.applyAbsoluteWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect; + var offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += (temp.x - bone.worldX) * translateMix; + bone.worldY += (temp.y - bone.worldY) * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c); + var ts = Math.sqrt(ta * ta + tc * tc); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s; + bone.a *= s; + bone.c *= s; + s = Math.sqrt(bone.b * bone.b + bone.d * bone.d); + ts = Math.sqrt(tb * tb + td * td); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var b = bone.b, d = bone.d; + var by = Math.atan2(d, b); + var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a)); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r = by + (r + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyRelativeWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += temp.x * translateMix; + bone.worldY += temp.y * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1; + bone.a *= s; + bone.c *= s; + s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var r = Math.atan2(td, tb) - Math.atan2(tc, ta); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + var b = bone.b, d = bone.d; + r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyAbsoluteLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) { + var r = target.arotation - rotation + this.data.offsetRotation; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + rotation += r * rotateMix; + } + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax - x + this.data.offsetX) * translateMix; + y += (target.ay - y + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX; + if (scaleY > 0.00001) + scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY; + } + var shearY = bone.ashearY; + if (shearMix != 0) { + var r = target.ashearY - shearY + this.data.offsetShearY; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + bone.shearY += r * shearMix; + } + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.applyRelativeLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) + rotation += (target.arotation + this.data.offsetRotation) * rotateMix; + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax + this.data.offsetX) * translateMix; + y += (target.ay + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1; + if (scaleY > 0.00001) + scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1; + } + var shearY = bone.ashearY; + if (shearMix != 0) + shearY += (target.ashearY + this.data.offsetShearY) * shearMix; + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.getOrder = function () { + return this.data.order; + }; + return TransformConstraint; + }()); + spine.TransformConstraint = TransformConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraintData = (function () { + function TransformConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.offsetRotation = 0; + this.offsetX = 0; + this.offsetY = 0; + this.offsetScaleX = 0; + this.offsetScaleY = 0; + this.offsetShearY = 0; + this.relative = false; + this.local = false; + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return TransformConstraintData; + }()); + spine.TransformConstraintData = TransformConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Triangulator = (function () { + function Triangulator() { + this.convexPolygons = new Array(); + this.convexPolygonsIndices = new Array(); + this.indicesArray = new Array(); + this.isConcaveArray = new Array(); + this.triangles = new Array(); + this.polygonPool = new spine.Pool(function () { + return new Array(); + }); + this.polygonIndicesPool = new spine.Pool(function () { + return new Array(); + }); + } + Triangulator.prototype.triangulate = function (verticesArray) { + var vertices = verticesArray; + var vertexCount = verticesArray.length >> 1; + var indices = this.indicesArray; + indices.length = 0; + for (var i = 0; i < vertexCount; i++) + indices[i] = i; + var isConcave = this.isConcaveArray; + isConcave.length = 0; + for (var i = 0, n = vertexCount; i < n; ++i) + isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices); + var triangles = this.triangles; + triangles.length = 0; + while (vertexCount > 3) { + var previous = vertexCount - 1, i = 0, next = 1; + while (true) { + outer: if (!isConcave[i]) { + var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; + var p1x = vertices[p1], p1y = vertices[p1 + 1]; + var p2x = vertices[p2], p2y = vertices[p2 + 1]; + var p3x = vertices[p3], p3y = vertices[p3 + 1]; + for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { + if (!isConcave[ii]) + continue; + var v = indices[ii] << 1; + var vx = vertices[v], vy = vertices[v + 1]; + if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { + if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { + if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) + break outer; + } + } + } + break; + } + if (next == 0) { + do { + if (!isConcave[i]) + break; + i--; + } while (i > 0); + break; + } + previous = i; + i = next; + next = (next + 1) % vertexCount; + } + triangles.push(indices[(vertexCount + i - 1) % vertexCount]); + triangles.push(indices[i]); + triangles.push(indices[(i + 1) % vertexCount]); + indices.splice(i, 1); + isConcave.splice(i, 1); + vertexCount--; + var previousIndex = (vertexCount + i - 1) % vertexCount; + var nextIndex = i == vertexCount ? 0 : i; + isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices); + isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices); + } + if (vertexCount == 3) { + triangles.push(indices[2]); + triangles.push(indices[0]); + triangles.push(indices[1]); + } + return triangles; + }; + Triangulator.prototype.decompose = function (verticesArray, triangles) { + var vertices = verticesArray; + var convexPolygons = this.convexPolygons; + this.polygonPool.freeAll(convexPolygons); + convexPolygons.length = 0; + var convexPolygonsIndices = this.convexPolygonsIndices; + this.polygonIndicesPool.freeAll(convexPolygonsIndices); + convexPolygonsIndices.length = 0; + var polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + var polygon = this.polygonPool.obtain(); + polygon.length = 0; + var fanBaseIndex = -1, lastWinding = 0; + for (var i = 0, n = triangles.length; i < n; i += 3) { + var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; + var x1 = vertices[t1], y1 = vertices[t1 + 1]; + var x2 = vertices[t2], y2 = vertices[t2 + 1]; + var x3 = vertices[t3], y3 = vertices[t3 + 1]; + var merged = false; + if (fanBaseIndex == t1) { + var o = polygon.length - 4; + var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); + var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]); + if (winding1 == lastWinding && winding2 == lastWinding) { + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(t3); + merged = true; + } + } + if (!merged) { + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + else { + this.polygonPool.free(polygon); + this.polygonIndicesPool.free(polygonIndices); + } + polygon = this.polygonPool.obtain(); + polygon.length = 0; + polygon.push(x1); + polygon.push(y1); + polygon.push(x2); + polygon.push(y2); + polygon.push(x3); + polygon.push(y3); + polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + polygonIndices.push(t1); + polygonIndices.push(t2); + polygonIndices.push(t3); + lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3); + fanBaseIndex = t1; + } + } + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + for (var i = 0, n = convexPolygons.length; i < n; i++) { + polygonIndices = convexPolygonsIndices[i]; + if (polygonIndices.length == 0) + continue; + var firstIndex = polygonIndices[0]; + var lastIndex = polygonIndices[polygonIndices.length - 1]; + polygon = convexPolygons[i]; + var o = polygon.length - 4; + var prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; + var prevX = polygon[o + 2], prevY = polygon[o + 3]; + var firstX = polygon[0], firstY = polygon[1]; + var secondX = polygon[2], secondY = polygon[3]; + var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); + for (var ii = 0; ii < n; ii++) { + if (ii == i) + continue; + var otherIndices = convexPolygonsIndices[ii]; + if (otherIndices.length != 3) + continue; + var otherFirstIndex = otherIndices[0]; + var otherSecondIndex = otherIndices[1]; + var otherLastIndex = otherIndices[2]; + var otherPoly = convexPolygons[ii]; + var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; + if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) + continue; + var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); + var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY); + if (winding1 == winding && winding2 == winding) { + otherPoly.length = 0; + otherIndices.length = 0; + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(otherLastIndex); + prevPrevX = prevX; + prevPrevY = prevY; + prevX = x3; + prevY = y3; + ii = 0; + } + } + } + for (var i = convexPolygons.length - 1; i >= 0; i--) { + polygon = convexPolygons[i]; + if (polygon.length == 0) { + convexPolygons.splice(i, 1); + this.polygonPool.free(polygon); + polygonIndices = convexPolygonsIndices[i]; + convexPolygonsIndices.splice(i, 1); + this.polygonIndicesPool.free(polygonIndices); + } + } + return convexPolygons; + }; + Triangulator.isConcave = function (index, vertexCount, vertices, indices) { + var previous = indices[(vertexCount + index - 1) % vertexCount] << 1; + var current = indices[index] << 1; + var next = indices[(index + 1) % vertexCount] << 1; + return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); + }; + Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) { + return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; + }; + Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) { + var px = p2x - p1x, py = p2y - p1y; + return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; + }; + return Triangulator; + }()); + spine.Triangulator = Triangulator; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IntSet = (function () { + function IntSet() { + this.array = new Array(); + } + IntSet.prototype.add = function (value) { + var contains = this.contains(value); + this.array[value | 0] = value | 0; + return !contains; + }; + IntSet.prototype.contains = function (value) { + return this.array[value | 0] != undefined; + }; + IntSet.prototype.remove = function (value) { + this.array[value | 0] = undefined; + }; + IntSet.prototype.clear = function () { + this.array.length = 0; + }; + return IntSet; + }()); + spine.IntSet = IntSet; + var Color = (function () { + function Color(r, g, b, a) { + if (r === void 0) { r = 0; } + if (g === void 0) { g = 0; } + if (b === void 0) { b = 0; } + if (a === void 0) { a = 0; } + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + Color.prototype.set = function (r, g, b, a) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + this.clamp(); + return this; + }; + Color.prototype.setFromColor = function (c) { + this.r = c.r; + this.g = c.g; + this.b = c.b; + this.a = c.a; + return this; + }; + Color.prototype.setFromString = function (hex) { + hex = hex.charAt(0) == '#' ? hex.substr(1) : hex; + this.r = parseInt(hex.substr(0, 2), 16) / 255.0; + this.g = parseInt(hex.substr(2, 2), 16) / 255.0; + this.b = parseInt(hex.substr(4, 2), 16) / 255.0; + this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0; + return this; + }; + Color.prototype.add = function (r, g, b, a) { + this.r += r; + this.g += g; + this.b += b; + this.a += a; + this.clamp(); + return this; + }; + Color.prototype.clamp = function () { + if (this.r < 0) + this.r = 0; + else if (this.r > 1) + this.r = 1; + if (this.g < 0) + this.g = 0; + else if (this.g > 1) + this.g = 1; + if (this.b < 0) + this.b = 0; + else if (this.b > 1) + this.b = 1; + if (this.a < 0) + this.a = 0; + else if (this.a > 1) + this.a = 1; + return this; + }; + Color.WHITE = new Color(1, 1, 1, 1); + Color.RED = new Color(1, 0, 0, 1); + Color.GREEN = new Color(0, 1, 0, 1); + Color.BLUE = new Color(0, 0, 1, 1); + Color.MAGENTA = new Color(1, 0, 1, 1); + return Color; + }()); + spine.Color = Color; + var MathUtils = (function () { + function MathUtils() { + } + MathUtils.clamp = function (value, min, max) { + if (value < min) + return min; + if (value > max) + return max; + return value; + }; + MathUtils.cosDeg = function (degrees) { + return Math.cos(degrees * MathUtils.degRad); + }; + MathUtils.sinDeg = function (degrees) { + return Math.sin(degrees * MathUtils.degRad); + }; + MathUtils.signum = function (value) { + return value > 0 ? 1 : value < 0 ? -1 : 0; + }; + MathUtils.toInt = function (x) { + return x > 0 ? Math.floor(x) : Math.ceil(x); + }; + MathUtils.cbrt = function (x) { + var y = Math.pow(Math.abs(x), 1 / 3); + return x < 0 ? -y : y; + }; + MathUtils.randomTriangular = function (min, max) { + return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); + }; + MathUtils.randomTriangularWith = function (min, max, mode) { + var u = Math.random(); + var d = max - min; + if (u <= (mode - min) / d) + return min + Math.sqrt(u * d * (mode - min)); + return max - Math.sqrt((1 - u) * d * (max - mode)); + }; + MathUtils.PI = 3.1415927; + MathUtils.PI2 = MathUtils.PI * 2; + MathUtils.radiansToDegrees = 180 / MathUtils.PI; + MathUtils.radDeg = MathUtils.radiansToDegrees; + MathUtils.degreesToRadians = MathUtils.PI / 180; + MathUtils.degRad = MathUtils.degreesToRadians; + return MathUtils; + }()); + spine.MathUtils = MathUtils; + var Interpolation = (function () { + function Interpolation() { + } + Interpolation.prototype.apply = function (start, end, a) { + return start + (end - start) * this.applyInternal(a); + }; + return Interpolation; + }()); + spine.Interpolation = Interpolation; + var Pow = (function (_super) { + __extends(Pow, _super); + function Pow(power) { + var _this = _super.call(this) || this; + _this.power = 2; + _this.power = power; + return _this; + } + Pow.prototype.applyInternal = function (a) { + if (a <= 0.5) + return Math.pow(a * 2, this.power) / 2; + return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1; + }; + return Pow; + }(Interpolation)); + spine.Pow = Pow; + var PowOut = (function (_super) { + __extends(PowOut, _super); + function PowOut(power) { + return _super.call(this, power) || this; + } + PowOut.prototype.applyInternal = function (a) { + return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1; + }; + return PowOut; + }(Pow)); + spine.PowOut = PowOut; + var Utils = (function () { + function Utils() { + } + Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) { + for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { + dest[j] = source[i]; + } + }; + Utils.setArraySize = function (array, size, value) { + if (value === void 0) { value = 0; } + var oldSize = array.length; + if (oldSize == size) + return array; + array.length = size; + if (oldSize < size) { + for (var i = oldSize; i < size; i++) + array[i] = value; + } + return array; + }; + Utils.ensureArrayCapacity = function (array, size, value) { + if (value === void 0) { value = 0; } + if (array.length >= size) + return array; + return Utils.setArraySize(array, size, value); + }; + Utils.newArray = function (size, defaultValue) { + var array = new Array(size); + for (var i = 0; i < size; i++) + array[i] = defaultValue; + return array; + }; + Utils.newFloatArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Float32Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.newShortArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Int16Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.toFloatArray = function (array) { + return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; + }; + Utils.toSinglePrecision = function (value) { + return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; + }; + Utils.webkit602BugfixHelper = function (alpha, blend) { + }; + Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== "undefined"; + return Utils; + }()); + spine.Utils = Utils; + var DebugUtils = (function () { + function DebugUtils() { + } + DebugUtils.logBones = function (skeleton) { + for (var i = 0; i < skeleton.bones.length; i++) { + var bone = skeleton.bones[i]; + console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY); + } + }; + return DebugUtils; + }()); + spine.DebugUtils = DebugUtils; + var Pool = (function () { + function Pool(instantiator) { + this.items = new Array(); + this.instantiator = instantiator; + } + Pool.prototype.obtain = function () { + return this.items.length > 0 ? this.items.pop() : this.instantiator(); + }; + Pool.prototype.free = function (item) { + if (item.reset) + item.reset(); + this.items.push(item); + }; + Pool.prototype.freeAll = function (items) { + for (var i = 0; i < items.length; i++) { + if (items[i].reset) + items[i].reset(); + this.items[i] = items[i]; + } + }; + Pool.prototype.clear = function () { + this.items.length = 0; + }; + return Pool; + }()); + spine.Pool = Pool; + var Vector2 = (function () { + function Vector2(x, y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + this.x = x; + this.y = y; + } + Vector2.prototype.set = function (x, y) { + this.x = x; + this.y = y; + return this; + }; + Vector2.prototype.length = function () { + var x = this.x; + var y = this.y; + return Math.sqrt(x * x + y * y); + }; + Vector2.prototype.normalize = function () { + var len = this.length(); + if (len != 0) { + this.x /= len; + this.y /= len; + } + return this; + }; + return Vector2; + }()); + spine.Vector2 = Vector2; + var TimeKeeper = (function () { + function TimeKeeper() { + this.maxDelta = 0.064; + this.framesPerSecond = 0; + this.delta = 0; + this.totalTime = 0; + this.lastTime = Date.now() / 1000; + this.frameCount = 0; + this.frameTime = 0; + } + TimeKeeper.prototype.update = function () { + var now = Date.now() / 1000; + this.delta = now - this.lastTime; + this.frameTime += this.delta; + this.totalTime += this.delta; + if (this.delta > this.maxDelta) + this.delta = this.maxDelta; + this.lastTime = now; + this.frameCount++; + if (this.frameTime > 1) { + this.framesPerSecond = this.frameCount / this.frameTime; + this.frameTime = 0; + this.frameCount = 0; + } + }; + return TimeKeeper; + }()); + spine.TimeKeeper = TimeKeeper; + var WindowedMean = (function () { + function WindowedMean(windowSize) { + if (windowSize === void 0) { windowSize = 32; } + this.addedValues = 0; + this.lastValue = 0; + this.mean = 0; + this.dirty = true; + this.values = new Array(windowSize); + } + WindowedMean.prototype.hasEnoughData = function () { + return this.addedValues >= this.values.length; + }; + WindowedMean.prototype.addValue = function (value) { + if (this.addedValues < this.values.length) + this.addedValues++; + this.values[this.lastValue++] = value; + if (this.lastValue > this.values.length - 1) + this.lastValue = 0; + this.dirty = true; + }; + WindowedMean.prototype.getMean = function () { + if (this.hasEnoughData()) { + if (this.dirty) { + var mean = 0; + for (var i = 0; i < this.values.length; i++) { + mean += this.values[i]; + } + this.mean = mean / this.values.length; + this.dirty = false; + } + return this.mean; + } + else { + return 0; + } + }; + return WindowedMean; + }()); + spine.WindowedMean = WindowedMean; +})(spine || (spine = {})); +(function () { + if (!Math.fround) { + Math.fround = (function (array) { + return function (x) { + return array[0] = x, array[0]; + }; + })(new Float32Array(1)); } - 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; +})(); +var spine; +(function (spine) { + var Attachment = (function () { + function Attachment(name) { + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return Attachment; + }()); + spine.Attachment = Attachment; + var VertexAttachment = (function (_super) { + __extends(VertexAttachment, _super); + function VertexAttachment(name) { + var _this = _super.call(this, name) || this; + _this.id = (VertexAttachment.nextID++ & 65535) << 11; + _this.worldVerticesLength = 0; + return _this; + } + VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) { + count = offset + (count >> 1) * stride; + var skeleton = slot.bone.skeleton; + var deformArray = slot.attachmentVertices; + var vertices = this.vertices; + var bones = this.bones; + if (bones == null) { + if (deformArray.length > 0) + vertices = deformArray; + var bone = slot.bone; + var x = bone.worldX; + var y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) { + var vx = vertices[v_1], vy = vertices[v_1 + 1]; + worldVertices[w] = vx * a + vy * b + x; + worldVertices[w + 1] = vx * c + vy * d + y; + } + return; + } + var v = 0, skip = 0; + for (var i = 0; i < start; i += 2) { + var n = bones[v]; + v += n + 1; + skip += n; + } + var skeletonBones = skeleton.bones; + if (deformArray.length == 0) { + for (var w = offset, b = skip * 3; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + else { + var deform = deformArray; + for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3, f += 2) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + }; + VertexAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment; + }; + VertexAttachment.nextID = 0; + return VertexAttachment; + }(Attachment)); + spine.VertexAttachment = VertexAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AttachmentType; + (function (AttachmentType) { + AttachmentType[AttachmentType["Region"] = 0] = "Region"; + AttachmentType[AttachmentType["BoundingBox"] = 1] = "BoundingBox"; + AttachmentType[AttachmentType["Mesh"] = 2] = "Mesh"; + AttachmentType[AttachmentType["LinkedMesh"] = 3] = "LinkedMesh"; + AttachmentType[AttachmentType["Path"] = 4] = "Path"; + AttachmentType[AttachmentType["Point"] = 5] = "Point"; + })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoundingBoxAttachment = (function (_super) { + __extends(BoundingBoxAttachment, _super); + function BoundingBoxAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return BoundingBoxAttachment; + }(spine.VertexAttachment)); + spine.BoundingBoxAttachment = BoundingBoxAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var ClippingAttachment = (function (_super) { + __extends(ClippingAttachment, _super); + function ClippingAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1); + return _this; + } + return ClippingAttachment; + }(spine.VertexAttachment)); + spine.ClippingAttachment = ClippingAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var MeshAttachment = (function (_super) { + __extends(MeshAttachment, _super); + function MeshAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + _this.inheritDeform = false; + _this.tempColor = new spine.Color(0, 0, 0, 0); + return _this; + } + MeshAttachment.prototype.updateUVs = function () { + var regionUVs = this.regionUVs; + if (this.uvs == null || this.uvs.length != regionUVs.length) + this.uvs = spine.Utils.newFloatArray(regionUVs.length); + var uvs = this.uvs; + var u = 0, v = 0, width = 0, height = 0; + if (this.region instanceof spine.TextureAtlasRegion) { + var region = this.region; + var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height; + if (region.rotate) { + u = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth; + v = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight; + width = region.originalHeight / textureWidth; + height = region.originalWidth / textureHeight; + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i + 1] * width; + uvs[i + 1] = v + height - regionUVs[i] * height; + } + return; + } + u = region.u - region.offsetX / textureWidth; + v = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight; + width = region.originalWidth / textureWidth; + height = region.originalHeight / textureHeight; + } + else if (this.region == null) { + u = v = 0; + width = height = 1; + } + else { + u = this.region.u; + v = this.region.v; + width = this.region.u2 - u; + height = this.region.v2 - v; + } + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i] * width; + uvs[i + 1] = v + regionUVs[i + 1] * height; + } + }; + MeshAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment); + }; + MeshAttachment.prototype.getParentMesh = function () { + return this.parentMesh; + }; + MeshAttachment.prototype.setParentMesh = function (parentMesh) { + this.parentMesh = parentMesh; + if (parentMesh != null) { + this.bones = parentMesh.bones; + this.vertices = parentMesh.vertices; + this.worldVerticesLength = parentMesh.worldVerticesLength; + this.regionUVs = parentMesh.regionUVs; + this.triangles = parentMesh.triangles; + this.hullLength = parentMesh.hullLength; + this.worldVerticesLength = parentMesh.worldVerticesLength; + } + }; + return MeshAttachment; + }(spine.VertexAttachment)); + spine.MeshAttachment = MeshAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathAttachment = (function (_super) { + __extends(PathAttachment, _super); + function PathAttachment(name) { + var _this = _super.call(this, name) || this; + _this.closed = false; + _this.constantSpeed = false; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return PathAttachment; + }(spine.VertexAttachment)); + spine.PathAttachment = PathAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PointAttachment = (function (_super) { + __extends(PointAttachment, _super); + function PointAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.38, 0.94, 0, 1); + return _this; + } + PointAttachment.prototype.computeWorldPosition = function (bone, point) { + point.x = this.x * bone.a + this.y * bone.b + bone.worldX; + point.y = this.x * bone.c + this.y * bone.d + bone.worldY; + return point; + }; + PointAttachment.prototype.computeWorldRotation = function (bone) { + var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation); + var x = cos * bone.a + sin * bone.b; + var y = cos * bone.c + sin * bone.d; + return Math.atan2(y, x) * spine.MathUtils.radDeg; + }; + return PointAttachment; + }(spine.VertexAttachment)); + spine.PointAttachment = PointAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var RegionAttachment = (function (_super) { + __extends(RegionAttachment, _super); + function RegionAttachment(name) { + var _this = _super.call(this, name) || this; + _this.x = 0; + _this.y = 0; + _this.scaleX = 1; + _this.scaleY = 1; + _this.rotation = 0; + _this.width = 0; + _this.height = 0; + _this.color = new spine.Color(1, 1, 1, 1); + _this.offset = spine.Utils.newFloatArray(8); + _this.uvs = spine.Utils.newFloatArray(8); + _this.tempColor = new spine.Color(1, 1, 1, 1); + return _this; + } + RegionAttachment.prototype.updateOffset = function () { + var regionScaleX = this.width / this.region.originalWidth * this.scaleX; + var regionScaleY = this.height / this.region.originalHeight * this.scaleY; + var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; + var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; + var localX2 = localX + this.region.width * regionScaleX; + var localY2 = localY + this.region.height * regionScaleY; + var radians = this.rotation * Math.PI / 180; + var cos = Math.cos(radians); + var sin = Math.sin(radians); + var localXCos = localX * cos + this.x; + var localXSin = localX * sin; + var localYCos = localY * cos + this.y; + var localYSin = localY * sin; + var localX2Cos = localX2 * cos + this.x; + var localX2Sin = localX2 * sin; + var localY2Cos = localY2 * cos + this.y; + var localY2Sin = localY2 * sin; + var offset = this.offset; + offset[RegionAttachment.OX1] = localXCos - localYSin; + offset[RegionAttachment.OY1] = localYCos + localXSin; + offset[RegionAttachment.OX2] = localXCos - localY2Sin; + offset[RegionAttachment.OY2] = localY2Cos + localXSin; + offset[RegionAttachment.OX3] = localX2Cos - localY2Sin; + offset[RegionAttachment.OY3] = localY2Cos + localX2Sin; + offset[RegionAttachment.OX4] = localX2Cos - localYSin; + offset[RegionAttachment.OY4] = localYCos + localX2Sin; + }; + RegionAttachment.prototype.setRegion = function (region) { + this.region = region; + var uvs = this.uvs; + if (region.rotate) { + uvs[2] = region.u; + uvs[3] = region.v2; + uvs[4] = region.u; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v; + uvs[0] = region.u2; + uvs[1] = region.v2; + } + else { + uvs[0] = region.u; + uvs[1] = region.v2; + uvs[2] = region.u; + uvs[3] = region.v; + uvs[4] = region.u2; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v2; + } + }; + RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) { + var vertexOffset = this.offset; + var x = bone.worldX, y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var offsetX = 0, offsetY = 0; + offsetX = vertexOffset[RegionAttachment.OX1]; + offsetY = vertexOffset[RegionAttachment.OY1]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX2]; + offsetY = vertexOffset[RegionAttachment.OY2]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX3]; + offsetY = vertexOffset[RegionAttachment.OY3]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX4]; + offsetY = vertexOffset[RegionAttachment.OY4]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + }; + RegionAttachment.OX1 = 0; + RegionAttachment.OY1 = 1; + RegionAttachment.OX2 = 2; + RegionAttachment.OY2 = 3; + RegionAttachment.OX3 = 4; + RegionAttachment.OY3 = 5; + RegionAttachment.OX4 = 6; + RegionAttachment.OY4 = 7; + RegionAttachment.X1 = 0; + RegionAttachment.Y1 = 1; + RegionAttachment.C1R = 2; + RegionAttachment.C1G = 3; + RegionAttachment.C1B = 4; + RegionAttachment.C1A = 5; + RegionAttachment.U1 = 6; + RegionAttachment.V1 = 7; + RegionAttachment.X2 = 8; + RegionAttachment.Y2 = 9; + RegionAttachment.C2R = 10; + RegionAttachment.C2G = 11; + RegionAttachment.C2B = 12; + RegionAttachment.C2A = 13; + RegionAttachment.U2 = 14; + RegionAttachment.V2 = 15; + RegionAttachment.X3 = 16; + RegionAttachment.Y3 = 17; + RegionAttachment.C3R = 18; + RegionAttachment.C3G = 19; + RegionAttachment.C3B = 20; + RegionAttachment.C3A = 21; + RegionAttachment.U3 = 22; + RegionAttachment.V3 = 23; + RegionAttachment.X4 = 24; + RegionAttachment.Y4 = 25; + RegionAttachment.C4R = 26; + RegionAttachment.C4G = 27; + RegionAttachment.C4B = 28; + RegionAttachment.C4A = 29; + RegionAttachment.U4 = 30; + RegionAttachment.V4 = 31; + return RegionAttachment; + }(spine.Attachment)); + spine.RegionAttachment = RegionAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var JitterEffect = (function () { + function JitterEffect(jitterX, jitterY) { + this.jitterX = 0; + this.jitterY = 0; + this.jitterX = jitterX; + this.jitterY = jitterY; + } + JitterEffect.prototype.begin = function (skeleton) { + }; + JitterEffect.prototype.transform = function (position, uv, light, dark) { + position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + }; + JitterEffect.prototype.end = function () { + }; + return JitterEffect; + }()); + spine.JitterEffect = JitterEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SwirlEffect = (function () { + function SwirlEffect(radius) { + this.centerX = 0; + this.centerY = 0; + this.radius = 0; + this.angle = 0; + this.worldX = 0; + this.worldY = 0; + this.radius = radius; + } + SwirlEffect.prototype.begin = function (skeleton) { + this.worldX = skeleton.x + this.centerX; + this.worldY = skeleton.y + this.centerY; + }; + SwirlEffect.prototype.transform = function (position, uv, light, dark) { + var radAngle = this.angle * spine.MathUtils.degreesToRadians; + var x = position.x - this.worldX; + var y = position.y - this.worldY; + var dist = Math.sqrt(x * x + y * y); + if (dist < this.radius) { + var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius); + var cos = Math.cos(theta); + var sin = Math.sin(theta); + position.x = cos * x - sin * y + this.worldX; + position.y = sin * x + cos * y + this.worldY; + } + }; + SwirlEffect.prototype.end = function () { + }; + SwirlEffect.interpolation = new spine.PowOut(2); + return SwirlEffect; + }()); + spine.SwirlEffect = SwirlEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var AssetManager = (function (_super) { + __extends(AssetManager, _super); + function AssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + return _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this; + } + return AssetManager; + }(spine.AssetManager)); + canvas.AssetManager = AssetManager; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var CanvasTexture = (function (_super) { + __extends(CanvasTexture, _super); + function CanvasTexture(image) { + return _super.call(this, image) || this; + } + CanvasTexture.prototype.setFilters = function (minFilter, magFilter) { }; + CanvasTexture.prototype.setWraps = function (uWrap, vWrap) { }; + CanvasTexture.prototype.dispose = function () { }; + return CanvasTexture; + }(spine.Texture)); + canvas.CanvasTexture = CanvasTexture; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var SkeletonRenderer = (function () { + function SkeletonRenderer(context) { + this.triangleRendering = false; + this.debugRendering = false; + this.vertices = spine.Utils.newFloatArray(8 * 1024); + this.tempColor = new spine.Color(); + this.ctx = context; + } + SkeletonRenderer.prototype.draw = function (skeleton) { + if (this.triangleRendering) + this.drawTriangles(skeleton); + else + this.drawImages(skeleton); + }; + SkeletonRenderer.prototype.drawImages = function (skeleton) { + var ctx = this.ctx; + var drawOrder = skeleton.drawOrder; + if (this.debugRendering) + ctx.strokeStyle = "green"; + ctx.save(); + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var attachment = slot.getAttachment(); + var regionAttachment = null; + var region = null; + var image = null; + if (attachment instanceof spine.RegionAttachment) { + regionAttachment = attachment; + region = regionAttachment.region; + image = region.texture.getImage(); + } + else + continue; + var skeleton_1 = slot.bone.skeleton; + var skeletonColor = skeleton_1.color; + var slotColor = slot.color; + var regionColor = regionAttachment.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha); + var att = attachment; + var bone = slot.bone; + var w = region.width; + var h = region.height; + ctx.save(); + ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY); + ctx.translate(attachment.offset[0], attachment.offset[1]); + ctx.rotate(attachment.rotation * Math.PI / 180); + var atlasScale = att.width / w; + ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY); + ctx.translate(w / 2, h / 2); + if (attachment.region.rotate) { + var t = w; + w = h; + h = t; + ctx.rotate(-Math.PI / 2); + } + ctx.scale(1, -1); + ctx.translate(-w / 2, -h / 2); + if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { + ctx.globalAlpha = color.a; + } + ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h); + if (this.debugRendering) + ctx.strokeRect(0, 0, w, h); + ctx.restore(); + } + ctx.restore(); + }; + SkeletonRenderer.prototype.drawTriangles = function (skeleton) { + var blendMode = null; + var vertices = this.vertices; + var triangles = null; + var drawOrder = skeleton.drawOrder; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var attachment = slot.getAttachment(); + var texture = null; + var region = null; + if (attachment instanceof spine.RegionAttachment) { + var regionAttachment = attachment; + vertices = this.computeRegionVertices(slot, regionAttachment, false); + triangles = SkeletonRenderer.QUAD_TRIANGLES; + region = regionAttachment.region; + texture = region.texture.getImage(); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + vertices = this.computeMeshVertices(slot, mesh, false); + triangles = mesh.triangles; + texture = mesh.region.renderObject.texture.getImage(); + } + else + continue; + if (texture != null) { + var slotBlendMode = slot.data.blendMode; + if (slotBlendMode != blendMode) { + blendMode = slotBlendMode; + } + var skeleton_2 = slot.bone.skeleton; + var skeletonColor = skeleton_2.color; + var slotColor = slot.color; + var attachmentColor = attachment.color; + var alpha = skeletonColor.a * slotColor.a * attachmentColor.a; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha); + var ctx = this.ctx; + if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { + ctx.globalAlpha = color.a; + } + for (var j = 0; j < triangles.length; j += 3) { + var t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8; + var x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7]; + var x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7]; + var x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7]; + this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2); + if (this.debugRendering) { + ctx.strokeStyle = "green"; + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.lineTo(x0, y0); + ctx.stroke(); + } + } + } + } + this.ctx.globalAlpha = 1; + }; + SkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) { + var ctx = this.ctx; + u0 *= img.width; + v0 *= img.height; + u1 *= img.width; + v1 *= img.height; + u2 *= img.width; + v2 *= img.height; + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.closePath(); + x1 -= x0; + y1 -= y0; + x2 -= x0; + y2 -= y0; + u1 -= u0; + v1 -= v0; + u2 -= u0; + v2 -= v0; + var det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0; + ctx.save(); + ctx.transform(a, b, c, d, e, f); + ctx.clip(); + ctx.drawImage(img, 0, 0); + ctx.restore(); + }; + SkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) { + var skeleton = slot.bone.skeleton; + var skeletonColor = skeleton.color; + var slotColor = slot.color; + var regionColor = region.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var multiplier = pma ? alpha : 1; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); + region.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE); + var vertices = this.vertices; + var uvs = region.uvs; + vertices[spine.RegionAttachment.C1R] = color.r; + vertices[spine.RegionAttachment.C1G] = color.g; + vertices[spine.RegionAttachment.C1B] = color.b; + vertices[spine.RegionAttachment.C1A] = color.a; + vertices[spine.RegionAttachment.U1] = uvs[0]; + vertices[spine.RegionAttachment.V1] = uvs[1]; + vertices[spine.RegionAttachment.C2R] = color.r; + vertices[spine.RegionAttachment.C2G] = color.g; + vertices[spine.RegionAttachment.C2B] = color.b; + vertices[spine.RegionAttachment.C2A] = color.a; + vertices[spine.RegionAttachment.U2] = uvs[2]; + vertices[spine.RegionAttachment.V2] = uvs[3]; + vertices[spine.RegionAttachment.C3R] = color.r; + vertices[spine.RegionAttachment.C3G] = color.g; + vertices[spine.RegionAttachment.C3B] = color.b; + vertices[spine.RegionAttachment.C3A] = color.a; + vertices[spine.RegionAttachment.U3] = uvs[4]; + vertices[spine.RegionAttachment.V3] = uvs[5]; + vertices[spine.RegionAttachment.C4R] = color.r; + vertices[spine.RegionAttachment.C4G] = color.g; + vertices[spine.RegionAttachment.C4B] = color.b; + vertices[spine.RegionAttachment.C4A] = color.a; + vertices[spine.RegionAttachment.U4] = uvs[6]; + vertices[spine.RegionAttachment.V4] = uvs[7]; + return vertices; + }; + SkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) { + var skeleton = slot.bone.skeleton; + var skeletonColor = skeleton.color; + var slotColor = slot.color; + var regionColor = mesh.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var multiplier = pma ? alpha : 1; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); + var numVertices = mesh.worldVerticesLength / 2; + if (this.vertices.length < mesh.worldVerticesLength) { + this.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength); + } + var vertices = this.vertices; + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE); + var uvs = mesh.uvs; + for (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) { + vertices[v++] = color.r; + vertices[v++] = color.g; + vertices[v++] = color.b; + vertices[v++] = color.a; + vertices[v++] = uvs[u++]; + vertices[v++] = uvs[u++]; + v += 2; + } + return vertices; + }; + SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; + SkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4; + return SkeletonRenderer; + }()); + canvas.SkeletonRenderer = SkeletonRenderer; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var AssetManager = (function (_super) { + __extends(AssetManager, _super); + function AssetManager(context, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + return _super.call(this, function (image) { + return new spine.webgl.GLTexture(context, image); + }, pathPrefix) || this; + } + return AssetManager; + }(spine.AssetManager)); + webgl.AssetManager = AssetManager; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var OrthoCamera = (function () { + function OrthoCamera(viewportWidth, viewportHeight) { + this.position = new webgl.Vector3(0, 0, 0); + this.direction = new webgl.Vector3(0, 0, -1); + this.up = new webgl.Vector3(0, 1, 0); + this.near = 0; + this.far = 100; + this.zoom = 1; + this.viewportWidth = 0; + this.viewportHeight = 0; + this.projectionView = new webgl.Matrix4(); + this.inverseProjectionView = new webgl.Matrix4(); + this.projection = new webgl.Matrix4(); + this.view = new webgl.Matrix4(); + this.tmp = new webgl.Vector3(); + this.viewportWidth = viewportWidth; + this.viewportHeight = viewportHeight; + this.update(); + } + OrthoCamera.prototype.update = function () { + var projection = this.projection; + var view = this.view; + var projectionView = this.projectionView; + var inverseProjectionView = this.inverseProjectionView; + var zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight; + projection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far); + view.lookAt(this.position, this.direction, this.up); + projectionView.set(projection.values); + projectionView.multiply(view); + inverseProjectionView.set(projectionView.values).invert(); + }; + OrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) { + var x = screenCoords.x, y = screenHeight - screenCoords.y - 1; + var tmp = this.tmp; + tmp.x = (2 * x) / screenWidth - 1; + tmp.y = (2 * y) / screenHeight - 1; + tmp.z = (2 * screenCoords.z) - 1; + tmp.project(this.inverseProjectionView); + screenCoords.set(tmp.x, tmp.y, tmp.z); + return screenCoords; + }; + OrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) { + this.viewportWidth = viewportWidth; + this.viewportHeight = viewportHeight; + }; + return OrthoCamera; + }()); + webgl.OrthoCamera = OrthoCamera; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var GLTexture = (function (_super) { + __extends(GLTexture, _super); + function GLTexture(context, image, useMipMaps) { + if (useMipMaps === void 0) { useMipMaps = false; } + var _this = _super.call(this, image) || this; + _this.texture = null; + _this.boundUnit = 0; + _this.useMipMaps = false; + _this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + _this.useMipMaps = useMipMaps; + _this.restore(); + _this.context.addRestorable(_this); + return _this; + } + GLTexture.prototype.setFilters = function (minFilter, magFilter) { + var gl = this.context.gl; + this.bind(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); + }; + GLTexture.prototype.setWraps = function (uWrap, vWrap) { + var gl = this.context.gl; + this.bind(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap); + }; + GLTexture.prototype.update = function (useMipMaps) { + var gl = this.context.gl; + if (!this.texture) { + this.texture = this.context.gl.createTexture(); + } + this.bind(); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + if (useMipMaps) + gl.generateMipmap(gl.TEXTURE_2D); + }; + GLTexture.prototype.restore = function () { + this.texture = null; + this.update(this.useMipMaps); + }; + GLTexture.prototype.bind = function (unit) { + if (unit === void 0) { unit = 0; } + var gl = this.context.gl; + this.boundUnit = unit; + gl.activeTexture(gl.TEXTURE0 + unit); + gl.bindTexture(gl.TEXTURE_2D, this.texture); + }; + GLTexture.prototype.unbind = function () { + var gl = this.context.gl; + gl.activeTexture(gl.TEXTURE0 + this.boundUnit); + gl.bindTexture(gl.TEXTURE_2D, null); + }; + GLTexture.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + gl.deleteTexture(this.texture); + }; + return GLTexture; + }(spine.Texture)); + webgl.GLTexture = GLTexture; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + webgl.M00 = 0; + webgl.M01 = 4; + webgl.M02 = 8; + webgl.M03 = 12; + webgl.M10 = 1; + webgl.M11 = 5; + webgl.M12 = 9; + webgl.M13 = 13; + webgl.M20 = 2; + webgl.M21 = 6; + webgl.M22 = 10; + webgl.M23 = 14; + webgl.M30 = 3; + webgl.M31 = 7; + webgl.M32 = 11; + webgl.M33 = 15; + var Matrix4 = (function () { + function Matrix4() { + this.temp = new Float32Array(16); + this.values = new Float32Array(16); + var v = this.values; + v[webgl.M00] = 1; + v[webgl.M11] = 1; + v[webgl.M22] = 1; + v[webgl.M33] = 1; + } + Matrix4.prototype.set = function (values) { + this.values.set(values); + return this; + }; + Matrix4.prototype.transpose = function () { + var t = this.temp; + var v = this.values; + t[webgl.M00] = v[webgl.M00]; + t[webgl.M01] = v[webgl.M10]; + t[webgl.M02] = v[webgl.M20]; + t[webgl.M03] = v[webgl.M30]; + t[webgl.M10] = v[webgl.M01]; + t[webgl.M11] = v[webgl.M11]; + t[webgl.M12] = v[webgl.M21]; + t[webgl.M13] = v[webgl.M31]; + t[webgl.M20] = v[webgl.M02]; + t[webgl.M21] = v[webgl.M12]; + t[webgl.M22] = v[webgl.M22]; + t[webgl.M23] = v[webgl.M32]; + t[webgl.M30] = v[webgl.M03]; + t[webgl.M31] = v[webgl.M13]; + t[webgl.M32] = v[webgl.M23]; + t[webgl.M33] = v[webgl.M33]; + return this.set(t); + }; + Matrix4.prototype.identity = function () { + var v = this.values; + v[webgl.M00] = 1; + v[webgl.M01] = 0; + v[webgl.M02] = 0; + v[webgl.M03] = 0; + v[webgl.M10] = 0; + v[webgl.M11] = 1; + v[webgl.M12] = 0; + v[webgl.M13] = 0; + v[webgl.M20] = 0; + v[webgl.M21] = 0; + v[webgl.M22] = 1; + v[webgl.M23] = 0; + v[webgl.M30] = 0; + v[webgl.M31] = 0; + v[webgl.M32] = 0; + v[webgl.M33] = 1; + return this; + }; + Matrix4.prototype.invert = function () { + var v = this.values; + var t = this.temp; + var l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] + + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] + - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] + - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] + + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] + + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] + - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] + - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + if (l_det == 0) + throw new Error("non-invertible matrix"); + var inv_det = 1.0 / l_det; + t[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32] + - v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32] + + v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32] + - v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33]; + t[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22] + + v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23]; + t[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32] + + v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32] + - v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32] + + v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33]; + t[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22] + - v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23]; + t[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31] + - v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33]; + t[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31] + + v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33]; + t[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31] + - v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33]; + t[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21] + + v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23]; + t[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31] + + v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32]; + t[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31] + - v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32]; + t[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31] + + v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32]; + t[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21] + - v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22]; + v[webgl.M00] = t[webgl.M00] * inv_det; + v[webgl.M01] = t[webgl.M01] * inv_det; + v[webgl.M02] = t[webgl.M02] * inv_det; + v[webgl.M03] = t[webgl.M03] * inv_det; + v[webgl.M10] = t[webgl.M10] * inv_det; + v[webgl.M11] = t[webgl.M11] * inv_det; + v[webgl.M12] = t[webgl.M12] * inv_det; + v[webgl.M13] = t[webgl.M13] * inv_det; + v[webgl.M20] = t[webgl.M20] * inv_det; + v[webgl.M21] = t[webgl.M21] * inv_det; + v[webgl.M22] = t[webgl.M22] * inv_det; + v[webgl.M23] = t[webgl.M23] * inv_det; + v[webgl.M30] = t[webgl.M30] * inv_det; + v[webgl.M31] = t[webgl.M31] * inv_det; + v[webgl.M32] = t[webgl.M32] * inv_det; + v[webgl.M33] = t[webgl.M33] * inv_det; + return this; + }; + Matrix4.prototype.determinant = function () { + var v = this.values; + return v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] + + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] + - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] + - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] + + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] + + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] + - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] + - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + }; + Matrix4.prototype.translate = function (x, y, z) { + var v = this.values; + v[webgl.M03] += x; + v[webgl.M13] += y; + v[webgl.M23] += z; + return this; + }; + Matrix4.prototype.copy = function () { + return new Matrix4().set(this.values); + }; + Matrix4.prototype.projection = function (near, far, fovy, aspectRatio) { + this.identity(); + var l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0)); + var l_a1 = (far + near) / (near - far); + var l_a2 = (2 * far * near) / (near - far); + var v = this.values; + v[webgl.M00] = l_fd / aspectRatio; + v[webgl.M10] = 0; + v[webgl.M20] = 0; + v[webgl.M30] = 0; + v[webgl.M01] = 0; + v[webgl.M11] = l_fd; + v[webgl.M21] = 0; + v[webgl.M31] = 0; + v[webgl.M02] = 0; + v[webgl.M12] = 0; + v[webgl.M22] = l_a1; + v[webgl.M32] = -1; + v[webgl.M03] = 0; + v[webgl.M13] = 0; + v[webgl.M23] = l_a2; + v[webgl.M33] = 0; + return this; + }; + Matrix4.prototype.ortho2d = function (x, y, width, height) { + return this.ortho(x, x + width, y, y + height, 0, 1); + }; + Matrix4.prototype.ortho = function (left, right, bottom, top, near, far) { + this.identity(); + var x_orth = 2 / (right - left); + var y_orth = 2 / (top - bottom); + var z_orth = -2 / (far - near); + var tx = -(right + left) / (right - left); + var ty = -(top + bottom) / (top - bottom); + var tz = -(far + near) / (far - near); + var v = this.values; + v[webgl.M00] = x_orth; + v[webgl.M10] = 0; + v[webgl.M20] = 0; + v[webgl.M30] = 0; + v[webgl.M01] = 0; + v[webgl.M11] = y_orth; + v[webgl.M21] = 0; + v[webgl.M31] = 0; + v[webgl.M02] = 0; + v[webgl.M12] = 0; + v[webgl.M22] = z_orth; + v[webgl.M32] = 0; + v[webgl.M03] = tx; + v[webgl.M13] = ty; + v[webgl.M23] = tz; + v[webgl.M33] = 1; + return this; + }; + Matrix4.prototype.multiply = function (matrix) { + var t = this.temp; + var v = this.values; + var m = matrix.values; + t[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30]; + t[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31]; + t[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32]; + t[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33]; + t[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30]; + t[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31]; + t[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32]; + t[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33]; + t[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30]; + t[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31]; + t[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32]; + t[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33]; + t[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30]; + t[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31]; + t[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32]; + t[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33]; + return this.set(this.temp); + }; + Matrix4.prototype.multiplyLeft = function (matrix) { + var t = this.temp; + var v = this.values; + var m = matrix.values; + t[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30]; + t[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31]; + t[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32]; + t[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33]; + t[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30]; + t[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31]; + t[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32]; + t[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33]; + t[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30]; + t[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31]; + t[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32]; + t[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33]; + t[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30]; + t[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31]; + t[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32]; + t[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33]; + return this.set(this.temp); + }; + Matrix4.prototype.lookAt = function (position, direction, up) { + Matrix4.initTemps(); + var xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis; + zAxis.setFrom(direction).normalize(); + xAxis.setFrom(direction).normalize(); + xAxis.cross(up).normalize(); + yAxis.setFrom(xAxis).cross(zAxis).normalize(); + this.identity(); + var val = this.values; + val[webgl.M00] = xAxis.x; + val[webgl.M01] = xAxis.y; + val[webgl.M02] = xAxis.z; + val[webgl.M10] = yAxis.x; + val[webgl.M11] = yAxis.y; + val[webgl.M12] = yAxis.z; + val[webgl.M20] = -zAxis.x; + val[webgl.M21] = -zAxis.y; + val[webgl.M22] = -zAxis.z; + Matrix4.tmpMatrix.identity(); + Matrix4.tmpMatrix.values[webgl.M03] = -position.x; + Matrix4.tmpMatrix.values[webgl.M13] = -position.y; + Matrix4.tmpMatrix.values[webgl.M23] = -position.z; + this.multiply(Matrix4.tmpMatrix); + return this; + }; + Matrix4.initTemps = function () { + if (Matrix4.xAxis === null) + Matrix4.xAxis = new webgl.Vector3(); + if (Matrix4.yAxis === null) + Matrix4.yAxis = new webgl.Vector3(); + if (Matrix4.zAxis === null) + Matrix4.zAxis = new webgl.Vector3(); + }; + Matrix4.xAxis = null; + Matrix4.yAxis = null; + Matrix4.zAxis = null; + Matrix4.tmpMatrix = new Matrix4(); + return Matrix4; + }()); + webgl.Matrix4 = Matrix4; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Mesh = (function () { + function Mesh(context, attributes, maxVertices, maxIndices) { + this.attributes = attributes; + this.verticesLength = 0; + this.dirtyVertices = false; + this.indicesLength = 0; + this.dirtyIndices = false; + this.elementsPerVertex = 0; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.elementsPerVertex = 0; + for (var i = 0; i < attributes.length; i++) { + this.elementsPerVertex += attributes[i].numElements; + } + this.vertices = new Float32Array(maxVertices * this.elementsPerVertex); + this.indices = new Uint16Array(maxIndices); + this.context.addRestorable(this); + } + Mesh.prototype.getAttributes = function () { return this.attributes; }; + Mesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; }; + Mesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; }; + Mesh.prototype.setVerticesLength = function (length) { + this.dirtyVertices = true; + this.verticesLength = length; + }; + Mesh.prototype.getVertices = function () { return this.vertices; }; + Mesh.prototype.maxIndices = function () { return this.indices.length; }; + Mesh.prototype.numIndices = function () { return this.indicesLength; }; + Mesh.prototype.setIndicesLength = function (length) { + this.dirtyIndices = true; + this.indicesLength = length; + }; + Mesh.prototype.getIndices = function () { return this.indices; }; + ; + Mesh.prototype.getVertexSizeInFloats = function () { + var size = 0; + for (var i = 0; i < this.attributes.length; i++) { + var attribute = this.attributes[i]; + size += attribute.numElements; + } + return size; + }; + Mesh.prototype.setVertices = function (vertices) { + this.dirtyVertices = true; + if (vertices.length > this.vertices.length) + throw Error("Mesh can't store more than " + this.maxVertices() + " vertices"); + this.vertices.set(vertices, 0); + this.verticesLength = vertices.length; + }; + Mesh.prototype.setIndices = function (indices) { + this.dirtyIndices = true; + if (indices.length > this.indices.length) + throw Error("Mesh can't store more than " + this.maxIndices() + " indices"); + this.indices.set(indices, 0); + this.indicesLength = indices.length; + }; + Mesh.prototype.draw = function (shader, primitiveType) { + this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex); + }; + Mesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) { + var gl = this.context.gl; + if (this.dirtyVertices || this.dirtyIndices) + this.update(); + this.bind(shader); + if (this.indicesLength > 0) { + gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2); + } + else { + gl.drawArrays(primitiveType, offset, count); + } + this.unbind(shader); + }; + Mesh.prototype.bind = function (shader) { + var gl = this.context.gl; + gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); + var offset = 0; + for (var i = 0; i < this.attributes.length; i++) { + var attrib = this.attributes[i]; + var location_1 = shader.getAttributeLocation(attrib.name); + gl.enableVertexAttribArray(location_1); + gl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4); + offset += attrib.numElements; + } + if (this.indicesLength > 0) + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); + }; + Mesh.prototype.unbind = function (shader) { + var gl = this.context.gl; + for (var i = 0; i < this.attributes.length; i++) { + var attrib = this.attributes[i]; + var location_2 = shader.getAttributeLocation(attrib.name); + gl.disableVertexAttribArray(location_2); + } + gl.bindBuffer(gl.ARRAY_BUFFER, null); + if (this.indicesLength > 0) + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); + }; + Mesh.prototype.update = function () { + var gl = this.context.gl; + if (this.dirtyVertices) { + if (!this.verticesBuffer) { + this.verticesBuffer = gl.createBuffer(); + } + gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); + gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW); + this.dirtyVertices = false; + } + if (this.dirtyIndices) { + if (!this.indicesBuffer) { + this.indicesBuffer = gl.createBuffer(); + } + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW); + this.dirtyIndices = false; + } + }; + Mesh.prototype.restore = function () { + this.verticesBuffer = null; + this.indicesBuffer = null; + this.update(); + }; + Mesh.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + gl.deleteBuffer(this.verticesBuffer); + gl.deleteBuffer(this.indicesBuffer); + }; + return Mesh; + }()); + webgl.Mesh = Mesh; + var VertexAttribute = (function () { + function VertexAttribute(name, type, numElements) { + this.name = name; + this.type = type; + this.numElements = numElements; + } + return VertexAttribute; + }()); + webgl.VertexAttribute = VertexAttribute; + var Position2Attribute = (function (_super) { + __extends(Position2Attribute, _super); + function Position2Attribute() { + return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this; + } + return Position2Attribute; + }(VertexAttribute)); + webgl.Position2Attribute = Position2Attribute; + var Position3Attribute = (function (_super) { + __extends(Position3Attribute, _super); + function Position3Attribute() { + return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this; + } + return Position3Attribute; + }(VertexAttribute)); + webgl.Position3Attribute = Position3Attribute; + var TexCoordAttribute = (function (_super) { + __extends(TexCoordAttribute, _super); + function TexCoordAttribute(unit) { + if (unit === void 0) { unit = 0; } + return _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? "" : unit), VertexAttributeType.Float, 2) || this; + } + return TexCoordAttribute; + }(VertexAttribute)); + webgl.TexCoordAttribute = TexCoordAttribute; + var ColorAttribute = (function (_super) { + __extends(ColorAttribute, _super); + function ColorAttribute() { + return _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this; + } + return ColorAttribute; + }(VertexAttribute)); + webgl.ColorAttribute = ColorAttribute; + var Color2Attribute = (function (_super) { + __extends(Color2Attribute, _super); + function Color2Attribute() { + return _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this; + } + return Color2Attribute; + }(VertexAttribute)); + webgl.Color2Attribute = Color2Attribute; + var VertexAttributeType; + (function (VertexAttributeType) { + VertexAttributeType[VertexAttributeType["Float"] = 0] = "Float"; + })(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var PolygonBatcher = (function () { + function PolygonBatcher(context, twoColorTint, maxVertices) { + if (twoColorTint === void 0) { twoColorTint = true; } + if (maxVertices === void 0) { maxVertices = 10920; } + this.isDrawing = false; + this.shader = null; + this.lastTexture = null; + this.verticesLength = 0; + this.indicesLength = 0; + if (maxVertices > 10920) + throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + var attributes = twoColorTint ? + [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] : + [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()]; + this.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3); + this.srcBlend = this.context.gl.SRC_ALPHA; + this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; + } + PolygonBatcher.prototype.begin = function (shader) { + var gl = 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 = shader; + this.lastTexture = null; + this.isDrawing = true; + gl.enable(gl.BLEND); + gl.blendFunc(this.srcBlend, this.dstBlend); + }; + PolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) { + var gl = this.context.gl; + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + if (this.isDrawing) { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + }; + PolygonBatcher.prototype.draw = function (texture, vertices, indices) { + if (texture != this.lastTexture) { + this.flush(); + this.lastTexture = texture; + } + else if (this.verticesLength + vertices.length > this.mesh.getVertices().length || + this.indicesLength + indices.length > this.mesh.getIndices().length) { + this.flush(); + } + var indexStart = this.mesh.numVertices(); + this.mesh.getVertices().set(vertices, this.verticesLength); + this.verticesLength += vertices.length; + this.mesh.setVerticesLength(this.verticesLength); + var indicesArray = this.mesh.getIndices(); + for (var i = this.indicesLength, j = 0; j < indices.length; i++, j++) + indicesArray[i] = indices[j] + indexStart; + this.indicesLength += indices.length; + this.mesh.setIndicesLength(this.indicesLength); + }; + PolygonBatcher.prototype.flush = function () { + var gl = this.context.gl; + if (this.verticesLength == 0) + return; + this.lastTexture.bind(); + this.mesh.draw(this.shader, gl.TRIANGLES); + this.verticesLength = 0; + this.indicesLength = 0; + this.mesh.setVerticesLength(0); + this.mesh.setIndicesLength(0); + this.drawCalls++; + }; + PolygonBatcher.prototype.end = function () { + var gl = this.context.gl; + if (!this.isDrawing) + throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()"); + if (this.verticesLength > 0 || this.indicesLength > 0) + this.flush(); + this.shader = null; + this.lastTexture = null; + this.isDrawing = false; + gl.disable(gl.BLEND); + }; + PolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; }; + PolygonBatcher.prototype.dispose = function () { + this.mesh.dispose(); + }; + return PolygonBatcher; + }()); + webgl.PolygonBatcher = PolygonBatcher; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var SceneRenderer = (function () { + function SceneRenderer(canvas, context, twoColorTint) { + if (twoColorTint === void 0) { twoColorTint = true; } + this.twoColorTint = false; + 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 spine.Color(1, 1, 1, 1); + this.canvas = canvas; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.twoColorTint = twoColorTint; + this.camera = new webgl.OrthoCamera(canvas.width, canvas.height); + this.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context); + this.batcher = new webgl.PolygonBatcher(this.context, twoColorTint); + this.shapesShader = webgl.Shader.newColored(this.context); + this.shapes = new webgl.ShapeRenderer(this.context); + this.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint); + this.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context); + } + SceneRenderer.prototype.begin = function () { + this.camera.update(); + this.enableRenderer(this.batcher); + }; + SceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + if (slotRangeStart === void 0) { slotRangeStart = -1; } + if (slotRangeEnd === void 0) { slotRangeEnd = -1; } + this.enableRenderer(this.batcher); + this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha; + this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd); + }; + SceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + if (ignoredBones === void 0) { ignoredBones = null; } + this.enableRenderer(this.shapes); + this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha; + this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones); + }; + SceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u; + quad[i++] = v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u2; + quad[i++] = v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u2; + quad[i++] = v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u; + quad[i++] = v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) { + if (color === void 0) { color = null; } + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var worldOriginX = x + pivotX; + var worldOriginY = y + pivotY; + var fx = -pivotX; + var fy = -pivotY; + var fx2 = width - pivotX; + var fy2 = height - pivotY; + var p1x = fx; + var p1y = fy; + var p2x = fx; + var p2y = fy2; + var p3x = fx2; + var p3y = fy2; + var p4x = fx2; + var p4y = fy; + var x1 = 0; + var y1 = 0; + var x2 = 0; + var y2 = 0; + var x3 = 0; + var y3 = 0; + var x4 = 0; + var y4 = 0; + if (angle != 0) { + var cos = spine.MathUtils.cosDeg(angle); + var sin = spine.MathUtils.sinDeg(angle); + x1 = cos * p1x - sin * p1y; + y1 = sin * p1x + cos * p1y; + x4 = cos * p2x - sin * p2y; + y4 = sin * p2x + cos * p2y; + x3 = cos * p3x - sin * p3y; + y3 = sin * p3x + cos * p3y; + x2 = x3 + (x1 - x4); + y2 = y3 + (y1 - y4); + } + else { + x1 = p1x; + y1 = p1y; + x4 = p2x; + y4 = p2y; + x3 = p3x; + y3 = p3y; + x2 = p4x; + y2 = p4y; + } + x1 += worldOriginX; + y1 += worldOriginY; + x2 += worldOriginX; + y2 += worldOriginY; + x3 += worldOriginX; + y3 += worldOriginY; + x4 += worldOriginX; + y4 += worldOriginY; + var i = 0; + quad[i++] = x1; + quad[i++] = y1; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x2; + quad[i++] = y2; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x3; + quad[i++] = y3; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x4; + quad[i++] = y4; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) { + if (color === void 0) { color = null; } + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u; + quad[i++] = region.v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u2; + quad[i++] = region.v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u2; + quad[i++] = region.v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u; + quad[i++] = region.v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + this.enableRenderer(this.shapes); + this.shapes.line(x, y, x2, y2, color); + }; + SceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + this.enableRenderer(this.shapes); + this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3); + }; + SceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + if (color4 === void 0) { color4 = null; } + this.enableRenderer(this.shapes); + this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4); + }; + SceneRenderer.prototype.rect = function (filled, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.rect(filled, x, y, width, height, color); + }; + SceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.rectLine(filled, x1, y1, x2, y2, width, color); + }; + SceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.polygon(polygonVertices, offset, count, color); + }; + SceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { + if (color === void 0) { color = null; } + if (segments === void 0) { segments = 0; } + this.enableRenderer(this.shapes); + this.shapes.circle(filled, x, y, radius, color, segments); + }; + SceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color); + }; + SceneRenderer.prototype.end = function () { + if (this.activeRenderer === this.batcher) + this.batcher.end(); + else if (this.activeRenderer === this.shapes) + this.shapes.end(); + this.activeRenderer = null; + }; + SceneRenderer.prototype.resize = function (resizeMode) { + var canvas = this.canvas; + var w = canvas.clientWidth; + var h = canvas.clientHeight; + if (canvas.width != w || canvas.height != h) { + canvas.width = w; + canvas.height = h; + } + this.context.gl.viewport(0, 0, canvas.width, canvas.height); + if (resizeMode === ResizeMode.Stretch) { + } + else if (resizeMode === ResizeMode.Expand) { + this.camera.setViewport(w, h); + } + else if (resizeMode === ResizeMode.Fit) { + var sourceWidth = canvas.width, sourceHeight = canvas.height; + var targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight; + var targetRatio = targetHeight / targetWidth; + var sourceRatio = sourceHeight / sourceWidth; + var scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight; + this.camera.viewportWidth = sourceWidth * scale; + this.camera.viewportHeight = sourceHeight * scale; + } + this.camera.update(); + }; + SceneRenderer.prototype.enableRenderer = function (renderer) { + if (this.activeRenderer === renderer) + return; + this.end(); + if (renderer instanceof webgl.PolygonBatcher) { + this.batcherShader.bind(); + this.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); + this.batcherShader.setUniformi("u_texture", 0); + this.batcher.begin(this.batcherShader); + this.activeRenderer = this.batcher; + } + else if (renderer instanceof webgl.ShapeRenderer) { + this.shapesShader.bind(); + this.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); + this.shapes.begin(this.shapesShader); + this.activeRenderer = this.shapes; + } + else { + this.activeRenderer = this.skeletonDebugRenderer; + } + }; + SceneRenderer.prototype.dispose = function () { + this.batcher.dispose(); + this.batcherShader.dispose(); + this.shapes.dispose(); + this.shapesShader.dispose(); + this.skeletonDebugRenderer.dispose(); + }; + return SceneRenderer; + }()); + webgl.SceneRenderer = SceneRenderer; + var ResizeMode; + (function (ResizeMode) { + ResizeMode[ResizeMode["Stretch"] = 0] = "Stretch"; + ResizeMode[ResizeMode["Expand"] = 1] = "Expand"; + ResizeMode[ResizeMode["Fit"] = 2] = "Fit"; + })(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Shader = (function () { + function Shader(context, vertexShader, fragmentShader) { + this.vertexShader = vertexShader; + this.fragmentShader = fragmentShader; + this.vs = null; + this.fs = null; + this.program = null; + this.tmp2x2 = new Float32Array(2 * 2); + this.tmp3x3 = new Float32Array(3 * 3); + this.tmp4x4 = new Float32Array(4 * 4); + this.vsSource = vertexShader; + this.fsSource = fragmentShader; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.context.addRestorable(this); + this.compile(); + } + Shader.prototype.getProgram = function () { return this.program; }; + Shader.prototype.getVertexShader = function () { return this.vertexShader; }; + Shader.prototype.getFragmentShader = function () { return this.fragmentShader; }; + Shader.prototype.getVertexShaderSource = function () { return this.vsSource; }; + Shader.prototype.getFragmentSource = function () { return this.fsSource; }; + Shader.prototype.compile = function () { + var gl = this.context.gl; + try { + this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader); + this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader); + this.program = this.compileProgram(this.vs, this.fs); + } + catch (e) { + this.dispose(); + throw e; + } + }; + Shader.prototype.compileShader = function (type, source) { + var gl = this.context.gl; + var shader = gl.createShader(type); + gl.shaderSource(shader, source); + gl.compileShader(shader); + if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { + var error = "Couldn't compile shader: " + gl.getShaderInfoLog(shader); + gl.deleteShader(shader); + if (!gl.isContextLost()) + throw new Error(error); + } + return shader; + }; + Shader.prototype.compileProgram = function (vs, fs) { + var gl = this.context.gl; + var program = gl.createProgram(); + gl.attachShader(program, vs); + gl.attachShader(program, fs); + gl.linkProgram(program); + if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { + var error = "Couldn't compile shader program: " + gl.getProgramInfoLog(program); + gl.deleteProgram(program); + if (!gl.isContextLost()) + throw new Error(error); + } + return program; + }; + Shader.prototype.restore = function () { + this.compile(); + }; + Shader.prototype.bind = function () { + this.context.gl.useProgram(this.program); + }; + Shader.prototype.unbind = function () { + this.context.gl.useProgram(null); + }; + Shader.prototype.setUniformi = function (uniform, value) { + this.context.gl.uniform1i(this.getUniformLocation(uniform), value); + }; + Shader.prototype.setUniformf = function (uniform, value) { + this.context.gl.uniform1f(this.getUniformLocation(uniform), value); + }; + Shader.prototype.setUniform2f = function (uniform, value, value2) { + this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2); + }; + Shader.prototype.setUniform3f = function (uniform, value, value2, value3) { + this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3); + }; + Shader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) { + this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4); + }; + Shader.prototype.setUniform2x2f = function (uniform, value) { + var gl = this.context.gl; + this.tmp2x2.set(value); + gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2); + }; + Shader.prototype.setUniform3x3f = function (uniform, value) { + var gl = this.context.gl; + this.tmp3x3.set(value); + gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3); + }; + Shader.prototype.setUniform4x4f = function (uniform, value) { + var gl = this.context.gl; + this.tmp4x4.set(value); + gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4); + }; + Shader.prototype.getUniformLocation = function (uniform) { + var gl = this.context.gl; + var location = gl.getUniformLocation(this.program, uniform); + if (!location && !gl.isContextLost()) + throw new Error("Couldn't find location for uniform " + uniform); + return location; + }; + Shader.prototype.getAttributeLocation = function (attribute) { + var gl = this.context.gl; + var location = gl.getAttribLocation(this.program, attribute); + if (location == -1 && !gl.isContextLost()) + throw new Error("Couldn't find location for attribute " + attribute); + return location; + }; + Shader.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + if (this.vs) { + gl.deleteShader(this.vs); + this.vs = null; + } + if (this.fs) { + gl.deleteShader(this.fs); + this.fs = null; + } + if (this.program) { + gl.deleteProgram(this.program); + this.program = null; + } + }; + Shader.newColoredTextured = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.newTwoColoredTextured = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR2 + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_dark = " + Shader.COLOR2 + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.newColored = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tuniform mat4 " + Shader.MVP_MATRIX + ";\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = " + Shader.COLOR + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.MVP_MATRIX = "u_projTrans"; + Shader.POSITION = "a_position"; + Shader.COLOR = "a_color"; + Shader.COLOR2 = "a_color2"; + Shader.TEXCOORDS = "a_texCoords"; + Shader.SAMPLER = "u_texture"; + return Shader; + }()); + webgl.Shader = Shader; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var ShapeRenderer = (function () { + function ShapeRenderer(context, maxVertices) { + if (maxVertices === void 0) { maxVertices = 10920; } + this.isDrawing = false; + this.shapeType = ShapeType.Filled; + this.color = new spine.Color(1, 1, 1, 1); + this.vertexIndex = 0; + this.tmp = new spine.Vector2(); + if (maxVertices > 10920) + throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0); + this.srcBlend = this.context.gl.SRC_ALPHA; + this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; + } + ShapeRenderer.prototype.begin = function (shader) { + if (this.isDrawing) + throw new Error("ShapeRenderer.begin() has already been called"); + this.shader = shader; + this.vertexIndex = 0; + this.isDrawing = true; + var gl = this.context.gl; + gl.enable(gl.BLEND); + gl.blendFunc(this.srcBlend, this.dstBlend); + }; + ShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) { + var gl = this.context.gl; + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + if (this.isDrawing) { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + }; + ShapeRenderer.prototype.setColor = function (color) { + this.color.setFromColor(color); + }; + ShapeRenderer.prototype.setColorWith = function (r, g, b, a) { + this.color.set(r, g, b, a); + }; + ShapeRenderer.prototype.point = function (x, y, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Point, 1); + if (color === null) + color = this.color; + this.vertex(x, y, color); + }; + ShapeRenderer.prototype.line = function (x, y, x2, y2, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Line, 2); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + this.vertex(x, y, color); + this.vertex(x2, y2, color); + }; + ShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + if (color2 === null) + color2 = this.color; + if (color3 === null) + color3 = this.color; + if (filled) { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + } + else { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x2, y2, color); + this.vertex(x3, y3, color2); + this.vertex(x3, y3, color); + this.vertex(x, y, color2); + } + }; + ShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + if (color4 === void 0) { color4 = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + if (color2 === null) + color2 = this.color; + if (color3 === null) + color3 = this.color; + if (color4 === null) + color4 = this.color; + if (filled) { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + this.vertex(x3, y3, color3); + this.vertex(x4, y4, color4); + this.vertex(x, y, color); + } + else { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + this.vertex(x3, y3, color3); + this.vertex(x4, y4, color4); + this.vertex(x4, y4, color4); + this.vertex(x, y, color); + } + }; + ShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color); + }; + ShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { + if (color === void 0) { color = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 8); + if (color === null) + color = this.color; + var t = this.tmp.set(y2 - y1, x1 - x2); + t.normalize(); + width *= 0.5; + var tx = t.x * width; + var ty = t.y * width; + if (!filled) { + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x1 - tx, y1 - ty, color); + } + else { + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + } + }; + ShapeRenderer.prototype.x = function (x, y, size) { + this.line(x - size, y - size, x + size, y + size); + this.line(x - size, y + size, x + size, y - size); + }; + ShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { + if (color === void 0) { color = null; } + if (count < 3) + throw new Error("Polygon must contain at least 3 vertices"); + this.check(ShapeType.Line, count * 2); + if (color === null) + color = this.color; + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + offset <<= 1; + count <<= 1; + var firstX = polygonVertices[offset]; + var firstY = polygonVertices[offset + 1]; + var last = offset + count; + for (var i = offset, n = offset + count - 2; i < n; i += 2) { + var x1 = polygonVertices[i]; + var y1 = polygonVertices[i + 1]; + var x2 = 0; + var y2 = 0; + if (i + 2 >= last) { + x2 = firstX; + y2 = firstY; + } + else { + x2 = polygonVertices[i + 2]; + y2 = polygonVertices[i + 3]; + } + this.vertex(x1, y1, color); + this.vertex(x2, y2, color); + } + }; + ShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { + if (color === void 0) { color = null; } + if (segments === void 0) { segments = 0; } + if (segments === 0) + segments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0); + if (segments <= 0) + throw new Error("segments must be > 0."); + if (color === null) + color = this.color; + var angle = 2 * spine.MathUtils.PI / segments; + var cos = Math.cos(angle); + var sin = Math.sin(angle); + var cx = radius, cy = 0; + if (!filled) { + this.check(ShapeType.Line, segments * 2 + 2); + for (var i = 0; i < segments; i++) { + this.vertex(x + cx, y + cy, color); + var temp_1 = cx; + cx = cos * cx - sin * cy; + cy = sin * temp_1 + cos * cy; + this.vertex(x + cx, y + cy, color); + } + this.vertex(x + cx, y + cy, color); + } + else { + this.check(ShapeType.Filled, segments * 3 + 3); + segments--; + for (var i = 0; i < segments; i++) { + this.vertex(x, y, color); + this.vertex(x + cx, y + cy, color); + var temp_2 = cx; + cx = cos * cx - sin * cy; + cy = sin * temp_2 + cos * cy; + this.vertex(x + cx, y + cy, color); + } + this.vertex(x, y, color); + this.vertex(x + cx, y + cy, color); + } + var temp = cx; + cx = radius; + cy = 0; + this.vertex(x + cx, y + cy, color); + }; + ShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Line, segments * 2 + 2); + if (color === null) + color = this.color; + var subdiv_step = 1 / segments; + var subdiv_step2 = subdiv_step * subdiv_step; + var subdiv_step3 = subdiv_step * subdiv_step * subdiv_step; + var pre1 = 3 * subdiv_step; + var pre2 = 3 * subdiv_step2; + var pre4 = 6 * subdiv_step2; + var pre5 = 6 * subdiv_step3; + var tmp1x = x1 - cx1 * 2 + cx2; + var tmp1y = y1 - cy1 * 2 + cy2; + var tmp2x = (cx1 - cx2) * 3 - x1 + x2; + var tmp2y = (cy1 - cy2) * 3 - y1 + y2; + var fx = x1; + var fy = y1; + var dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3; + var dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3; + var ddfx = tmp1x * pre4 + tmp2x * pre5; + var ddfy = tmp1y * pre4 + tmp2y * pre5; + var dddfx = tmp2x * pre5; + var dddfy = tmp2y * pre5; + while (segments-- > 0) { + this.vertex(fx, fy, color); + fx += dfx; + fy += dfy; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + this.vertex(fx, fy, color); + } + this.vertex(fx, fy, color); + this.vertex(x2, y2, color); + }; + ShapeRenderer.prototype.vertex = function (x, y, color) { + var idx = this.vertexIndex; + var vertices = this.mesh.getVertices(); + vertices[idx++] = x; + vertices[idx++] = y; + vertices[idx++] = color.r; + vertices[idx++] = color.g; + vertices[idx++] = color.b; + vertices[idx++] = color.a; + this.vertexIndex = idx; + }; + ShapeRenderer.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 = false; + }; + ShapeRenderer.prototype.flush = function () { + if (this.vertexIndex == 0) + return; + this.mesh.setVerticesLength(this.vertexIndex); + this.mesh.draw(this.shader, this.shapeType); + this.vertexIndex = 0; + }; + ShapeRenderer.prototype.check = function (shapeType, numVertices) { + if (!this.isDrawing) + throw new Error("ShapeRenderer.begin() has not been called"); + if (this.shapeType == shapeType) { + if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) + this.flush(); + else + return; + } + else { + this.flush(); + this.shapeType = shapeType; + } + }; + ShapeRenderer.prototype.dispose = function () { + this.mesh.dispose(); + }; + return ShapeRenderer; + }()); + webgl.ShapeRenderer = ShapeRenderer; + var ShapeType; + (function (ShapeType) { + ShapeType[ShapeType["Point"] = 0] = "Point"; + ShapeType[ShapeType["Line"] = 1] = "Line"; + ShapeType[ShapeType["Filled"] = 4] = "Filled"; + })(ShapeType = webgl.ShapeType || (webgl.ShapeType = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var SkeletonDebugRenderer = (function () { + function SkeletonDebugRenderer(context) { + this.boneLineColor = new spine.Color(1, 0, 0, 1); + this.boneOriginColor = new spine.Color(0, 1, 0, 1); + this.attachmentLineColor = new spine.Color(0, 0, 1, 0.5); + this.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5); + this.pathColor = new spine.Color().setFromString("FF7F00"); + this.clipColor = new spine.Color(0.8, 0, 0, 2); + this.aabbColor = new spine.Color(0, 1, 0, 0.5); + this.drawBones = true; + this.drawRegionAttachments = true; + this.drawBoundingBoxes = true; + this.drawMeshHull = true; + this.drawMeshTriangles = true; + this.drawPaths = true; + this.drawSkeletonXY = false; + this.drawClipping = true; + this.premultipliedAlpha = false; + this.scale = 1; + this.boneWidth = 2; + this.bounds = new spine.SkeletonBounds(); + this.temp = new Array(); + this.vertices = spine.Utils.newFloatArray(2 * 1024); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + } + SkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) { + if (ignoredBones === void 0) { ignoredBones = null; } + var skeletonX = skeleton.x; + var skeletonY = skeleton.y; + var gl = this.context.gl; + var srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA; + shapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA); + var bones = skeleton.bones; + if (this.drawBones) { + shapes.setColor(this.boneLineColor); + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) + continue; + if (bone.parent == null) + continue; + var x = skeletonX + bone.data.length * bone.a + bone.worldX; + var y = skeletonY + bone.data.length * bone.c + bone.worldY; + shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale); + } + if (this.drawSkeletonXY) + shapes.x(skeletonX, skeletonY, 4 * this.scale); + } + if (this.drawRegionAttachments) { + shapes.setColor(this.attachmentLineColor); + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + var regionAttachment = attachment; + var vertices = this.vertices; + regionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2); + shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]); + shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]); + shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]); + shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]); + } + } + } + if (this.drawMeshHull || this.drawMeshTriangles) { + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.MeshAttachment)) + continue; + var mesh = attachment; + var vertices = this.vertices; + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2); + var triangles = mesh.triangles; + var hullLength = mesh.hullLength; + if (this.drawMeshTriangles) { + shapes.setColor(this.triangleLineColor); + for (var ii = 0, nn = triangles.length; ii < nn; ii += 3) { + var v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2; + shapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]); + } + } + if (this.drawMeshHull && hullLength > 0) { + shapes.setColor(this.attachmentLineColor); + hullLength = (hullLength >> 1) * 2; + var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1]; + for (var ii = 0, nn = hullLength; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + shapes.line(x, y, lastX, lastY); + lastX = x; + lastY = y; + } + } + } + } + if (this.drawBoundingBoxes) { + var bounds = this.bounds; + bounds.update(skeleton, true); + shapes.setColor(this.aabbColor); + shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight()); + var polygons = bounds.polygons; + var boxes = bounds.boundingBoxes; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + shapes.setColor(boxes[i].color); + shapes.polygon(polygon, 0, polygon.length); + } + } + if (this.drawPaths) { + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + continue; + var path = attachment; + var nn = path.worldVerticesLength; + var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); + path.computeWorldVertices(slot, 0, nn, world, 0, 2); + var color = this.pathColor; + var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0; + if (path.closed) { + shapes.setColor(color); + var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1]; + x2 = world[nn - 4]; + y2 = world[nn - 3]; + shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); + shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); + shapes.line(x1, y1, cx1, cy1); + shapes.line(x2, y2, cx2, cy2); + } + nn -= 4; + for (var ii = 4; ii < nn; ii += 6) { + var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3]; + x2 = world[ii + 4]; + y2 = world[ii + 5]; + shapes.setColor(color); + shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); + shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); + shapes.line(x1, y1, cx1, cy1); + shapes.line(x2, y2, cx2, cy2); + x1 = x2; + y1 = y2; + } + } + } + if (this.drawBones) { + shapes.setColor(this.boneOriginColor); + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) + continue; + shapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8); + } + } + if (this.drawClipping) { + var slots = skeleton.slots; + shapes.setColor(this.clipColor); + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.ClippingAttachment)) + continue; + var clip = attachment; + var nn = clip.worldVerticesLength; + var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); + clip.computeWorldVertices(slot, 0, nn, world, 0, 2); + for (var i_16 = 0, n_2 = world.length; i_16 < n_2; i_16 += 2) { + var x = world[i_16]; + var y = world[i_16 + 1]; + var x2 = world[(i_16 + 2) % world.length]; + var y2 = world[(i_16 + 3) % world.length]; + shapes.line(x, y, x2, y2); + } + } + } + }; + SkeletonDebugRenderer.prototype.dispose = function () { + }; + SkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1); + SkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1); + return SkeletonDebugRenderer; + }()); + webgl.SkeletonDebugRenderer = SkeletonDebugRenderer; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Renderable = (function () { + function Renderable(vertices, numVertices, numFloats) { + this.vertices = vertices; + this.numVertices = numVertices; + this.numFloats = numFloats; + } + return Renderable; + }()); + ; + var SkeletonRenderer = (function () { + function SkeletonRenderer(context, twoColorTint) { + if (twoColorTint === void 0) { twoColorTint = true; } + this.premultipliedAlpha = false; + this.vertexEffect = null; + this.tempColor = new spine.Color(); + this.tempColor2 = new spine.Color(); + this.vertexSize = 2 + 2 + 4; + this.twoColorTint = false; + this.renderable = new Renderable(null, 0, 0); + this.clipper = new spine.SkeletonClipping(); + this.temp = new spine.Vector2(); + this.temp2 = new spine.Vector2(); + this.temp3 = new spine.Color(); + this.temp4 = new spine.Color(); + this.twoColorTint = twoColorTint; + if (twoColorTint) + this.vertexSize += 4; + this.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024); + } + SkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) { + if (slotRangeStart === void 0) { slotRangeStart = -1; } + if (slotRangeEnd === void 0) { slotRangeEnd = -1; } + var clipper = this.clipper; + var premultipliedAlpha = this.premultipliedAlpha; + var twoColorTint = this.twoColorTint; + var blendMode = null; + var tempPos = this.temp; + var tempUv = this.temp2; + var tempLight = this.temp3; + var tempDark = this.temp4; + var renderable = this.renderable; + var uvs = null; + var triangles = null; + var drawOrder = skeleton.drawOrder; + var attachmentColor = null; + var skeletonColor = skeleton.color; + var vertexSize = twoColorTint ? 12 : 8; + var inRange = false; + if (slotRangeStart == -1) + inRange = true; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var clippedVertexSize = clipper.isClipping() ? 2 : vertexSize; + var slot = drawOrder[i]; + if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) { + inRange = true; + } + if (!inRange) { + clipper.clipEndWithSlot(slot); + continue; + } + if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) { + inRange = false; + } + var attachment = slot.getAttachment(); + var texture = null; + if (attachment instanceof spine.RegionAttachment) { + var region = attachment; + renderable.vertices = this.vertices; + renderable.numVertices = 4; + renderable.numFloats = clippedVertexSize << 2; + region.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize); + triangles = SkeletonRenderer.QUAD_TRIANGLES; + uvs = region.uvs; + texture = region.region.renderObject.texture; + attachmentColor = region.color; + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + renderable.vertices = this.vertices; + renderable.numVertices = (mesh.worldVerticesLength >> 1); + renderable.numFloats = renderable.numVertices * clippedVertexSize; + if (renderable.numFloats > renderable.vertices.length) { + renderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats); + } + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize); + triangles = mesh.triangles; + texture = mesh.region.renderObject.texture; + uvs = mesh.uvs; + attachmentColor = mesh.color; + } + else if (attachment instanceof spine.ClippingAttachment) { + var clip = (attachment); + clipper.clipStart(slot, clip); + continue; + } + else { + clipper.clipEndWithSlot(slot); + continue; + } + if (texture != null) { + var slotColor = slot.color; + var finalColor = this.tempColor; + finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r; + finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g; + finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b; + finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a; + if (premultipliedAlpha) { + finalColor.r *= finalColor.a; + finalColor.g *= finalColor.a; + finalColor.b *= finalColor.a; + } + var darkColor = this.tempColor2; + if (slot.darkColor == null) + darkColor.set(0, 0, 0, 1.0); + else { + if (premultipliedAlpha) { + darkColor.r = slot.darkColor.r * finalColor.a; + darkColor.g = slot.darkColor.g * finalColor.a; + darkColor.b = slot.darkColor.b * finalColor.a; + } + else { + darkColor.setFromColor(slot.darkColor); + } + darkColor.a = premultipliedAlpha ? 1.0 : 0.0; + } + var slotBlendMode = slot.data.blendMode; + if (slotBlendMode != blendMode) { + blendMode = slotBlendMode; + batcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode)); + } + if (clipper.isClipping()) { + clipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint); + var clippedVertices = new Float32Array(clipper.clippedVertices); + var clippedTriangles = clipper.clippedTriangles; + if (this.vertexEffect != null) { + var vertexEffect = this.vertexEffect; + var verts = clippedVertices; + if (!twoColorTint) { + for (var v = 0, n_3 = clippedVertices.length; v < n_3; v += vertexSize) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); + tempUv.x = verts[v + 6]; + tempUv.y = verts[v + 7]; + tempDark.set(0, 0, 0, 0); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + } + } + else { + for (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); + tempUv.x = verts[v + 6]; + tempUv.y = verts[v + 7]; + tempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + verts[v + 8] = tempDark.r; + verts[v + 9] = tempDark.g; + verts[v + 10] = tempDark.b; + verts[v + 11] = tempDark.a; + } + } + } + batcher.draw(texture, clippedVertices, clippedTriangles); + } + else { + var verts = renderable.vertices; + if (this.vertexEffect != null) { + var vertexEffect = this.vertexEffect; + if (!twoColorTint) { + for (var v = 0, u = 0, n_5 = renderable.numFloats; v < n_5; v += vertexSize, u += 2) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempUv.x = uvs[u]; + tempUv.y = uvs[u + 1]; + tempLight.setFromColor(finalColor); + tempDark.set(0, 0, 0, 0); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + } + } + else { + for (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempUv.x = uvs[u]; + tempUv.y = uvs[u + 1]; + tempLight.setFromColor(finalColor); + tempDark.setFromColor(darkColor); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + verts[v + 8] = tempDark.r; + verts[v + 9] = tempDark.g; + verts[v + 10] = tempDark.b; + verts[v + 11] = tempDark.a; + } + } + } + else { + if (!twoColorTint) { + for (var v = 2, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) { + verts[v] = finalColor.r; + verts[v + 1] = finalColor.g; + verts[v + 2] = finalColor.b; + verts[v + 3] = finalColor.a; + verts[v + 4] = uvs[u]; + verts[v + 5] = uvs[u + 1]; + } + } + else { + for (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) { + verts[v] = finalColor.r; + verts[v + 1] = finalColor.g; + verts[v + 2] = finalColor.b; + verts[v + 3] = finalColor.a; + verts[v + 4] = uvs[u]; + verts[v + 5] = uvs[u + 1]; + verts[v + 6] = darkColor.r; + verts[v + 7] = darkColor.g; + verts[v + 8] = darkColor.b; + verts[v + 9] = darkColor.a; + } + } + } + var view = renderable.vertices.subarray(0, renderable.numFloats); + batcher.draw(texture, view, triangles); + } + } + clipper.clipEndWithSlot(slot); + } + clipper.clipEnd(); + }; + SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; + return SkeletonRenderer; + }()); + webgl.SkeletonRenderer = SkeletonRenderer; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Vector3 = (function () { + function Vector3(x, y, z) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (z === void 0) { z = 0; } + this.x = 0; + this.y = 0; + this.z = 0; + this.x = x; + this.y = y; + this.z = z; + } + Vector3.prototype.setFrom = function (v) { + this.x = v.x; + this.y = v.y; + this.z = v.z; + return this; + }; + Vector3.prototype.set = function (x, y, z) { + this.x = x; + this.y = y; + this.z = z; + return this; + }; + Vector3.prototype.add = function (v) { + this.x += v.x; + this.y += v.y; + this.z += v.z; + return this; + }; + Vector3.prototype.sub = function (v) { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + return this; + }; + Vector3.prototype.scale = function (s) { + this.x *= s; + this.y *= s; + this.z *= s; + return this; + }; + Vector3.prototype.normalize = function () { + var len = this.length(); + if (len == 0) + return this; + len = 1 / len; + this.x *= len; + this.y *= len; + this.z *= len; + return this; + }; + Vector3.prototype.cross = function (v) { + return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x); + }; + Vector3.prototype.multiply = function (matrix) { + var l_mat = matrix.values; + return this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]); + }; + Vector3.prototype.project = function (matrix) { + var l_mat = matrix.values; + var l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]); + return this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w); + }; + Vector3.prototype.dot = function (v) { + return this.x * v.x + this.y * v.y + this.z * v.z; + }; + Vector3.prototype.length = function () { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + }; + Vector3.prototype.distance = function (v) { + var a = v.x - this.x; + var b = v.y - this.y; + var c = v.z - this.z; + return Math.sqrt(a * a + b * b + c * c); + }; + return Vector3; + }()); + webgl.Vector3 = Vector3; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var ManagedWebGLRenderingContext = (function () { + function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) { + var _this = this; + if (contextConfig === void 0) { contextConfig = { alpha: "true" }; } + this.restorables = new Array(); + if (canvasOrContext instanceof HTMLCanvasElement) { + var canvas_1 = canvasOrContext; + this.gl = (canvas_1.getContext("webgl", contextConfig) || canvas_1.getContext("experimental-webgl", contextConfig)); + this.canvas = canvas_1; + canvas_1.addEventListener("webglcontextlost", function (e) { + var event = e; + if (e) { + e.preventDefault(); + } + }); + canvas_1.addEventListener("webglcontextrestored", function (e) { + for (var i = 0, n = _this.restorables.length; i < n; i++) { + _this.restorables[i].restore(); + } + }); + } + else { + this.gl = canvasOrContext; + this.canvas = this.gl.canvas; + } + } + ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) { + this.restorables.push(restorable); + }; + ManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) { + var index = this.restorables.indexOf(restorable); + if (index > -1) + this.restorables.splice(index, 1); + }; + return ManagedWebGLRenderingContext; + }()); + webgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext; + var WebGLBlendModeConverter = (function () { + function WebGLBlendModeConverter() { + } + WebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) { + switch (blendMode) { + case spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + case spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE; + case spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + default: throw new Error("Unknown blend mode: " + blendMode); + } + }; + WebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + switch (blendMode) { + case spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; + case spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; + case spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR; + case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE; + default: throw new Error("Unknown blend mode: " + blendMode); + } + }; + WebGLBlendModeConverter.ZERO = 0; + WebGLBlendModeConverter.ONE = 1; + WebGLBlendModeConverter.SRC_COLOR = 0x0300; + WebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301; + WebGLBlendModeConverter.SRC_ALPHA = 0x0302; + WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303; + WebGLBlendModeConverter.DST_ALPHA = 0x0304; + WebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305; + WebGLBlendModeConverter.DST_COLOR = 0x0306; + return WebGLBlendModeConverter; + }()); + webgl.WebGLBlendModeConverter = WebGLBlendModeConverter; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +//# sourceMappingURL=spine-both.js.map +/*** EXPORTS FROM exports-loader ***/ +module.exports = spine; +}.call(window)); /***/ }), - -/***/ "./SpineFile.js": -/*!**********************!*\ - !*** ./SpineFile.js ***! - \**********************/ -/*! no static exports found */ +/* 168 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11301,13 +23315,13 @@ module.exports = IsPlainObject; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Class = __webpack_require__(/*! ../../../src/utils/Class */ "../../../src/utils/Class.js"); -var GetFastValue = __webpack_require__(/*! ../../../src/utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); -var ImageFile = __webpack_require__(/*! ../../../src/loader/filetypes/ImageFile.js */ "../../../src/loader/filetypes/ImageFile.js"); -var IsPlainObject = __webpack_require__(/*! ../../../src/utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); -var JSONFile = __webpack_require__(/*! ../../../src/loader/filetypes/JSONFile.js */ "../../../src/loader/filetypes/JSONFile.js"); -var MultiFile = __webpack_require__(/*! ../../../src/loader/MultiFile.js */ "../../../src/loader/MultiFile.js"); -var TextFile = __webpack_require__(/*! ../../../src/loader/filetypes/TextFile.js */ "../../../src/loader/filetypes/TextFile.js"); +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(4); +var ImageFile = __webpack_require__(169); +var IsPlainObject = __webpack_require__(2); +var JSONFile = __webpack_require__(183); +var MultiFile = __webpack_require__(184); +var TextFile = __webpack_require__(185); /** * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig @@ -11336,10 +23350,11 @@ var TextFile = __webpack_require__(/*! ../../../src/loader/filetypes/TextFile.js * @constructor * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Loader.FileTypes.UnityAtlasFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image 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 {(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 {XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @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({ @@ -11348,10 +23363,15 @@ var SpineFile = new Class({ initialize: - function SpineFile (loader, key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings) + 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)) { @@ -11366,29 +23386,58 @@ var SpineFile = new Class({ xhrSettings: GetFastValue(config, 'jsonXhrSettings') }); - atlas = new TextFile(loader, { - key: key, - url: GetFastValue(config, 'atlasURL'), - extension: GetFastValue(config, 'atlasExtension', 'atlas'), - xhrSettings: GetFastValue(config, 'atlasXhrSettings') - }); + 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, + 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); - atlas = new TextFile(loader, key, atlasURL, atlasXhrSettings); - } - - atlas.cache = loader.cacheManager.custom.spine; - MultiFile.call(this, loader, 'spine', key, [ json, atlas ]); + 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.MultiFile#onFileComplete - * @since 3.7.0 + * @method Phaser.Loader.FileTypes.SpineFile#onFileComplete + * @since 3.19.0 * * @param {Phaser.Loader.File} file - The File that has completed processing. */ @@ -11461,7 +23510,7 @@ var SpineFile = new Class({ * Adds this file to its target cache upon successful loading and processing. * * @method Phaser.Loader.FileTypes.SpineFile#addToCache - * @since 3.16.0 + * @since 3.19.0 */ addToCache: function () { @@ -11471,36 +23520,215 @@ var SpineFile = new Class({ fileJSON.addToCache(); - var fileText = this.files[1]; + var atlasCache; + var atlasKey = ''; + var combinedAtlastData = ''; + var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; - fileText.addToCache(); - - for (var i = 2; i < this.files.length; i++) + for (var i = 1; i < this.files.length; i++) { var file = this.files[i]; - var key = file.key.substr(4).trim(); + if (file.type === 'text') + { + atlasKey = file.key.substr(0, file.key.length - 2); - this.loader.textureManager.addImage(key, file.data); + atlasCache = file.cache; + + combinedAtlastData = combinedAtlastData.concat(file.data); + } + else + { + var key = file.key.substr(4).trim(); + + this.loader.textureManager.addImage(key, file.data); + } file.pendingDestroy(); } + atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlastData }); + this.complete = true; } } }); +module.exports = SpineFile; + + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + /** - * Adds a Unity YAML based Texture Atlas, or array of atlases, to the current load queue. + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(8); +var File = __webpack_require__(12); +var FileTypesManager = __webpack_require__(13); +var GetFastValue = __webpack_require__(4); +var IsPlainObject = __webpack_require__(2); + +/** + * @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); + } + }, + + /** + * 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'); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture; + var linkFile = this.linkFile; + + if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + { + if (this.type === 'image') + { + texture = this.cache.addImage(this.key, this.data, linkFile.data); + } + else + { + texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); + } + + this.pendingDestroy(texture); + + linkFile.pendingDestroy(texture); + } + else if (!linkFile) + { + texture = this.cache.addImage(this.key, this.data); + + this.pendingDestroy(texture); + } + } + +}); + +/** + * 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.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.txt'); + * this.load.image('logo', 'images/phaserLogo.png'); * } * ``` * @@ -11512,12 +23740,9 @@ var SpineFile = new Class({ * 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 atlas data to be provided in a YAML formatted text file as exported from Unity. - * * 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. @@ -11527,25 +23752,22 @@ var SpineFile = new Class({ * Instead of passing arguments you can pass a configuration object, such as: * * ```javascript - * this.load.unityAtlas({ - * key: 'mainmenu', - * textureURL: 'images/MainMenu.png', - * atlasURL: 'images/MainMenu.txt' + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png' * }); * ``` * - * See the documentation for `Phaser.Loader.FileTypes.SpineFileConfig` for more details. + * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. * - * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: * * ```javascript - * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json'); + * this.load.image('logo', 'images/AtariLogo.png'); * // and later in your game ... - * this.add.image(x, y, 'mainmenu', 'background'); + * this.add.image(x, y, 'logo'); * ``` * - * To get a list of all available frames within an atlas please consult your Texture Atlas software. - * * 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. @@ -11560,491 +23782,1195 @@ var SpineFile = new Class({ * then you can specify it by providing an array as the `url` where the second element is the normal map: * * ```javascript - * this.load.unityAtlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.txt'); + * 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.unityAtlas({ - * key: 'mainmenu', - * textureURL: 'images/MainMenu.png', - * normalMap: 'images/MainMenu-n.png', - * atlasURL: 'images/MainMenu.txt' + * 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. * - * Note: The ability to load this type of file will only be available if the Unity Atlas File type has been built into Phaser. + * 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#spine + * @method Phaser.Loader.LoaderPlugin#image * @fires Phaser.Loader.LoaderPlugin#addFileEvent - * @since 3.16.0 + * @since 3.0.0 * - * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig|Phaser.Loader.FileTypes.SpineFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image 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 {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 {XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image 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 {(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 {Phaser.Loader.LoaderPlugin} The Loader instance. -FileTypesManager.register('spine', function (key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings) + */ +FileTypesManager.register('image', function (key, url, xhrSettings) { - var multifile; - - // Supports an Object file definition in the key argument - // Or an array of objects in the key argument - // Or a single entry where all arguments have been defined - if (Array.isArray(key)) { for (var i = 0; i < key.length; i++) { - multifile = new SpineFile(this, key[i]); - - this.addFile(multifile.files); + // 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 { - multifile = new SpineFile(this, key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings); - - this.addFile(multifile.files); + this.addFile(new ImageFile(this, key, url, xhrSettings)); } return this; }); - */ -module.exports = SpineFile; +module.exports = ImageFile; /***/ }), - -/***/ "./SpinePlugin.js": -/*!************************!*\ - !*** ./SpinePlugin.js ***! - \************************/ -/*! no static exports found */ +/* 170 */ /***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(/*! ../../../src/utils/Class */ "../../../src/utils/Class.js"); -var GetValue = __webpack_require__(/*! ../../../src/utils/object/GetValue */ "../../../src/utils/object/GetValue.js"); -var ScenePlugin = __webpack_require__(/*! ../../../src/plugins/ScenePlugin */ "../../../src/plugins/ScenePlugin.js"); -var SpineFile = __webpack_require__(/*! ./SpineFile */ "./SpineFile.js"); -var Spine = __webpack_require__(/*! Spine */ "./runtimes/spine-both.js"); -var SpineGameObject = __webpack_require__(/*! ./gameobject/SpineGameObject */ "./gameobject/SpineGameObject.js"); -var Matrix4 = __webpack_require__(/*! ../../../src/math/Matrix4 */ "../../../src/math/Matrix4.js"); +/** + * @namespace Phaser.Loader.Events + */ + +module.exports = { + + ADD: __webpack_require__(171), + COMPLETE: __webpack_require__(172), + FILE_COMPLETE: __webpack_require__(173), + FILE_KEY_COMPLETE: __webpack_require__(174), + FILE_LOAD_ERROR: __webpack_require__(175), + FILE_LOAD: __webpack_require__(176), + FILE_PROGRESS: __webpack_require__(177), + POST_PROCESS: __webpack_require__(178), + PROGRESS: __webpack_require__(179), + START: __webpack_require__(180) + +}; + + +/***/ }), +/* 171 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), +/* 172 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {integer} totalComplete - The total number of files that successfully loaded. + * @param {integer} totalFailed - The total number of files that failed to load. + */ +module.exports = 'complete'; + + +/***/ }), +/* 173 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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)`. + * + * 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 + * @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. + */ +module.exports = 'filecomplete'; + + +/***/ }), +/* 174 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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-atlas-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 + * }); + * ``` + * + * 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 + * @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. + */ +module.exports = 'filecomplete-'; + + +/***/ }), +/* 175 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + */ +module.exports = 'loaderror'; + + +/***/ }), +/* 176 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + */ +module.exports = 'load'; + + +/***/ }), +/* 177 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), +/* 178 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'postprocess'; + + +/***/ }), +/* 179 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {number} progress - The current progress of the load. A value between 0 and 1. + */ +module.exports = 'progress'; + + +/***/ }), +/* 180 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'start'; + + +/***/ }), +/* 181 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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:|http:\/\/|https:\/\/|\/\/)/)) + { + return file.url; + } + else + { + return baseURL + file.url; + } +}; + +module.exports = GetURL; + + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(29); + +/** + * 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.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); + } + + // 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; + + +/***/ }), +/* 183 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(8); +var File = __webpack_require__(12); +var FileTypesManager = __webpack_require__(13); +var GetFastValue = __webpack_require__(4); +var GetValue = __webpack_require__(11); +var IsPlainObject = __webpack_require__(2); /** * @classdesc - * TODO + * A single JSON File suitable for loading by the Loader. * - * @class SpinePlugin - * @extends Phaser.Plugins.ScenePlugin + * 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.19.0 + * @since 3.0.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 {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 {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". + * @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 SpinePlugin = new Class({ +var JSONFile = new Class({ - Extends: ScenePlugin, + Extends: File, initialize: - function SpinePlugin (scene, pluginManager) + // 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) { - ScenePlugin.call(this, scene, pluginManager); + var extension = 'json'; - var game = pluginManager.game; - - this.isWebGL = (game.config.renderType === 2); - - // Create a custom cache to store the spine data (.atlas files) - this.cache = game.cache.addCustom('spine'); - - this.spineTextures = game.cache.addCustom('spineTextures'); - - this.json = game.cache.json; - - this.textures = game.textures; - - this.skeletonRenderer; - - this.drawDebug = false; - - this.gl; - this.mvp; - this.shader; - this.batcher; - this.debugRenderer; - this.debugShader; - - console.log('SpinePlugin created', '- WebGL:', this.isWebGL); - - if (this.isWebGL) + if (IsPlainObject(key)) { - this.runtime = Spine.webgl; + var config = key; - this.gl = game.renderer.gl; - - this.getAtlas = this.getAtlasWebGL; - } - else - { - this.runtime = Spine.canvas; - - this.getAtlas = this.getAtlasCanvas; + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + dataKey = GetFastValue(config, 'dataKey', dataKey); } - // Register our file type - pluginManager.registerFileType('spine', this.spineFileCallback, scene); - - // Register our game object - pluginManager.registerGameObject('spine', this.createSpineFactory(this)); - }, - - boot: function () - { - if (this.isWebGL) - { - this.bootWebGL(); - } - else - { - this.bootCanvas(); - } - - var eventEmitter = this.systems.events; - - eventEmitter.once('shutdown', this.shutdown, this); - eventEmitter.once('destroy', this.destroy, this); - }, - - bootCanvas: function () - { - this.skeletonRenderer = new this.runtime.SkeletonRenderer(this.scene.sys.context); - }, - - getAtlasCanvas: function (key) - { - var atlasData = this.cache.get(key); - - if (!atlasData) - { - console.warn('No atlas data for: ' + key); - return; - } - - var atlas; - var spineTextures = this.spineTextures; - - if (spineTextures.has(key)) - { - atlas = new Spine.TextureAtlas(atlasData, function () - { - return spineTextures.get(key); - }); - } - else - { - var textures = this.textures; - - atlas = new Spine.TextureAtlas(atlasData, function (path) - { - var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage()); - - spineTextures.add(key, canvasTexture); - - return canvasTexture; - }); - } - - return atlas; - }, - - bootWebGL: function () - { - var gl = this.gl; - var runtime = this.runtime; - - this.mvp = new Matrix4(); - - // Create a simple shader, mesh, model-view-projection matrix and SkeletonRenderer. - this.shader = runtime.Shader.newTwoColoredTextured(gl); - this.batcher = new runtime.PolygonBatcher(gl); - - this.skeletonRenderer = new runtime.SkeletonRenderer(gl); - - this.shapes = new runtime.ShapeRenderer(gl); - - this.debugRenderer = new runtime.SkeletonDebugRenderer(gl); - - this.debugShader = runtime.Shader.newColored(gl); - }, - - getAtlasWebGL: function (key) - { - var atlasData = this.cache.get(key); - - if (!atlasData) - { - console.warn('No atlas data for: ' + key); - return; - } - - var atlas; - var spineTextures = this.spineTextures; - - if (spineTextures.has(key)) - { - atlas = new Spine.TextureAtlas(atlasData, function () - { - return spineTextures.get(key); - }); - } - else - { - var textures = this.textures; - - var gl = this.gl; - - atlas = new Spine.TextureAtlas(atlasData, function (path) - { - var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage()); - - spineTextures.add(key, glTexture); - - return glTexture; - }); - } - - return atlas; - }, - - spineFileCallback: function (key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings) - { - var multifile; - - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - multifile = new SpineFile(this, key[i]); - - this.addFile(multifile.files); - } - } - else - { - multifile = new SpineFile(this, key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings); - - this.addFile(multifile.files); - } - - return this; - }, - - /** - * Creates a new Spine Game Object and adds it to the Scene. - * - * @method Phaser.GameObjects.GameObjectFactory#spineFactory - * @since 3.16.0 - * - * @param {number} x - The horizontal position of this Game Object. - * @param {number} y - The vertical position of this Game Object. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.GameObjects.Spine} The Game Object that was created. - */ - createSpineFactory: function (plugin) - { - var callback = function (x, y, key, animationName, loop) - { - var spineGO = new SpineGameObject(this.scene, plugin, x, y, key, animationName, loop); - - this.displayList.add(spineGO); - this.updateList.add(spineGO); - - return spineGO; + var fileConfig = { + type: 'json', + cache: loader.cacheManager.json, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: dataKey }; - return callback; - }, + File.call(this, loader, fileConfig); - getRuntime: function () - { - return this.runtime; - }, - - createSkeleton: function (key, skeletonJSON) - { - var atlasKey = key; - var jsonKey = key; - - if (key.indexOf('.')) + if (IsPlainObject(url)) { - var parts = key.split('.'); + // Object provided instead of a URL, so no need to actually load it (populate data with value) + if (dataKey) + { + this.data = GetValue(url, dataKey); + } + else + { + this.data = url; + } - atlasKey = parts.shift(); - jsonKey = parts.join('.'); + this.state = CONST.FILE_POPULATED; } - - var atlas = this.getAtlas(atlasKey); - - var atlasLoader = new Spine.AtlasAttachmentLoader(atlas); - - var skeletonJson = new Spine.SkeletonJson(atlasLoader); - - var data; - - if (skeletonJSON) - { - data = skeletonJSON; - } - else - { - var json = this.json.get(atlasKey); - - data = GetValue(json, jsonKey); - } - - var skeletonData = skeletonJson.readSkeletonData(data); - - var skeleton = new Spine.Skeleton(skeletonData); - - return { skeletonData: skeletonData, skeleton: skeleton }; - }, - - getBounds: function (skeleton) - { - var offset = new Spine.Vector2(); - var size = new Spine.Vector2(); - - skeleton.getBounds(offset, size, []); - - return { offset: offset, size: size }; - }, - - createAnimationState: function (skeleton) - { - var stateData = new Spine.AnimationStateData(skeleton.data); - - var state = new Spine.AnimationState(stateData); - - return { stateData: stateData, state: state }; }, /** - * 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. + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. * - * @method Camera3DPlugin#shutdown - * @private - * @since 3.0.0 + * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @since 3.7.0 */ - shutdown: function () + onProcess: function () { - var eventEmitter = this.systems.events; + if (this.state !== CONST.FILE_POPULATED) + { + this.state = CONST.FILE_PROCESSING; - eventEmitter.off('shutdown', this.shutdown, this); - }, + var json = JSON.parse(this.xhrLoader.responseText); - /** - * The Scene that owns this plugin is being destroyed. - * We need to shutdown and then kill off all external references. - * - * @method Camera3DPlugin#destroy - * @private - * @since 3.0.0 - */ - destroy: function () - { - this.shutdown(); + var key = this.config; - this.pluginManager.removeGameObject('spine', true, true); + if (typeof key === 'string') + { + this.data = GetValue(json, key, json); + } + else + { + this.data = json; + } + } - this.pluginManager = null; - this.game = null; - this.scene = null; - this.systems = null; - - // Create a custom cache to store the spine data (.atlas files) - this.cache = null; - this.spineTextures = null; - this.json = null; - this.textures = null; - this.skeletonRenderer = null; - this.gl = null; - this.mvp = null; - this.shader = null; - this.batcher = null; - this.debugRenderer = null; - this.debugShader = null; + this.onProcessComplete(); } }); -module.exports = SpinePlugin; +/** + * 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#addFileEvent + * @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 {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". + * @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 {Phaser.Loader.LoaderPlugin} 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; /***/ }), - -/***/ "./gameobject/SpineGameObject.js": -/*!***************************************!*\ - !*** ./gameobject/SpineGameObject.js ***! - \***************************************/ -/*! no static exports found */ +/* 184 */ /***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(/*! ../../../../src/utils/Class */ "../../../src/utils/Class.js"); -var ComponentsAlpha = __webpack_require__(/*! ../../../../src/gameobjects/components/Alpha */ "../../../src/gameobjects/components/Alpha.js"); -var ComponentsBlendMode = __webpack_require__(/*! ../../../../src/gameobjects/components/BlendMode */ "../../../src/gameobjects/components/BlendMode.js"); -var ComponentsComputedSize = __webpack_require__(/*! ../../../../src/gameobjects/components/ComputedSize */ "../../../src/gameobjects/components/ComputedSize.js"); -var ComponentsDepth = __webpack_require__(/*! ../../../../src/gameobjects/components/Depth */ "../../../src/gameobjects/components/Depth.js"); -var ComponentsFlip = __webpack_require__(/*! ../../../../src/gameobjects/components/Flip */ "../../../src/gameobjects/components/Flip.js"); -var ComponentsScrollFactor = __webpack_require__(/*! ../../../../src/gameobjects/components/ScrollFactor */ "../../../src/gameobjects/components/ScrollFactor.js"); -var ComponentsTransform = __webpack_require__(/*! ../../../../src/gameobjects/components/Transform */ "../../../src/gameobjects/components/Transform.js"); -var ComponentsVisible = __webpack_require__(/*! ../../../../src/gameobjects/components/Visible */ "../../../src/gameobjects/components/Visible.js"); -var GameObject = __webpack_require__(/*! ../../../../src/gameobjects/GameObject */ "../../../src/gameobjects/GameObject.js"); -var SpineGameObjectRender = __webpack_require__(/*! ./SpineGameObjectRender */ "./gameobject/SpineGameObjectRender.js"); +var Class = __webpack_require__(0); /** * @classdesc - * TODO + * 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) + { + /** + * 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; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = files; + + /** + * 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 {integer} + * @since 3.7.0 + */ + + this.pending = files.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {integer} + * @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 = {}; + + // Link the files + for (var i = 0; i < files.length; i++) + { + files[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++; + } + } + +}); + +module.exports = MultiFile; + + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(8); +var File = __webpack_require__(12); +var FileTypesManager = __webpack_require__(13); +var GetFastValue = __webpack_require__(4); +var IsPlainObject = __webpack_require__(2); + +/** + * @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 extension = 'txt'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'text', + cache: loader.cacheManager.text, + 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#addFileEvent + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), +/* 186 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var AngleBetween = __webpack_require__(15); +var Clamp = __webpack_require__(9); +var Class = __webpack_require__(0); +var ComponentsComputedSize = __webpack_require__(187); +var ComponentsDepth = __webpack_require__(188); +var ComponentsFlip = __webpack_require__(189); +var ComponentsScrollFactor = __webpack_require__(190); +var ComponentsTransform = __webpack_require__(191); +var ComponentsVisible = __webpack_require__(193); +var CounterClockwise = __webpack_require__(5); +var DegToRad = __webpack_require__(25); +var GameObject = __webpack_require__(194); +var RadToDeg = __webpack_require__(6); +var SpineEvents = __webpack_require__(205); +var SpineGameObjectRender = __webpack_require__(212); + +/** + * @classdesc + * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates + * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to + * easily change the skin, slot attachment, bone positions and more. + * + * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly. + * You can only create them if the Spine plugin has been loaded into Phaser. + * + * The quickest way is the Game Object Factory: + * + * ```javascript + * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true); + * ``` + * + * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly` + * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is + * an optional animation to start playing on the skeleton. The final argument `true` sets the + * animation to loop. Look at the documentation for further details on each of these options. + * + * For more control, you can use the Game Object Creator, passing in a Spine Game Object + * Configuration object: + * + * ```javascript + * let jelly = this.make.spine({ + * x: 512, y: 550, key: 'jelly', + * scale: 1.5, + * skinName: 'square_Green', + * animationName: 'jelly-think', loop: true, + * slotName: 'hat', attachmentName: 'images/La_14' + * }); + * ``` + * + * Here, you've got the ability to specify extra details, such as the slot name, attachments or + * overall scale. + * + * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to + * update and render, it must be added to the display and update lists of your Scene: + * + * ```javascript + * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true); + * this.sys.displayList.add(jelly); + * this.sys.updateList.add(jelly); + * ``` + * + * It's possible to enable Spine Game Objects for input, but you should be aware that it will use + * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but + * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created. + * If it's not suitable, provide your own shape to the `setInteractive` method. + * + * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for + * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game + * Object position with it. See the examples for further details. + * + * If your Spine Game Object has black outlines around the different parts of the texture when it + * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have + * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details. * * @class SpineGameObject * @constructor - * @since 3.16.0 + * @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 {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 {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? */ var SpineGameObject = new Class({ Extends: GameObject, Mixins: [ - ComponentsAlpha, - ComponentsBlendMode, ComponentsComputedSize, ComponentsDepth, ComponentsFlip, @@ -12060,22 +24986,129 @@ var SpineGameObject = new Class({ { GameObject.call(this, scene, 'Spine'); + /** + * A reference to the Spine Plugin. + * + * @name SpineGameObject#plugin + * @type {SpinePlugin} + * @since 3.19.0 + */ this.plugin = plugin; - this.root = null; + /** + * The Spine Skeleton this Game Object is using. + * + * @name SpineGameObject#skeleton + * @type {spine.Skeleton} + * @since 3.19.0 + */ this.skeleton = null; + + /** + * The Spine Skeleton Data associated with the Skeleton this Game Object is using. + * + * @name SpineGameObject#skeletonData + * @type {spine.SkeletonData} + * @since 3.19.0 + */ this.skeletonData = null; + /** + * The Spine Animation State this Game Object is using. + * + * @name SpineGameObject#state + * @type {spine.AnimationState} + * @since 3.19.0 + */ this.state = null; + + /** + * The Spine Animation State Data associated with the Animation State this Game Object is using. + * + * @name SpineGameObject#stateData + * @type {spine.AnimationStateData} + * @since 3.19.0 + */ this.stateData = null; + /** + * A reference to the root bone of the Skeleton. + * + * @name SpineGameObject#root + * @type {spine.Bone} + * @since 3.19.0 + */ + this.root = null; + + /** + * This object holds the calculated bounds of the current + * pose, as set when a new Skeleton is applied. + * + * @name SpineGameObject#bounds + * @type {any} + * @since 3.19.0 + */ + this.bounds = null; + + /** + * A Game Object level flag that allows you to enable debug drawing + * to the Skeleton Debug Renderer by toggling it. + * + * @name SpineGameObject#drawDebug + * @type {boolean} + * @since 3.19.0 + */ this.drawDebug = false; + /** + * The factor to scale the Animation update time by. + * + * @name SpineGameObject#timeScale + * @type {number} + * @since 3.19.0 + */ this.timeScale = 1; + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginX + * @type {number} + * @since 3.19.0 + */ this.displayOriginX = 0; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginY + * @type {number} + * @since 3.19.0 + */ this.displayOriginY = 0; + /** + * A flag that stores if the texture associated with the current + * Skin being used by this Game Object, has its alpha pre-multiplied + * into it, or not. + * + * @name SpineGameObject#preMultipliedAlpha + * @type {boolean} + * @since 3.19.0 + */ + this.preMultipliedAlpha = false; + + /** + * A default Blend Mode. You cannot change the blend mode of a + * Spine Game Object. + * + * @name SpineGameObject#blendMode + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.blendMode = 0; + this.setPosition(x, y); if (key) @@ -12084,24 +25117,281 @@ var SpineGameObject = new Class({ } }, + /** + * Overrides the default Game Object method and always returns true. + * Rendering is decided in the renderer functions. + * + * @method SpineGameObject#willRender + * @since 3.19.0 + * + * @return {boolean} Always returns `true`. + */ + willRender: function () + { + return true; + }, + + /** + * Set the Alpha level for the whole Skeleton 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 SpineGameObject#setAlpha + * @since 3.19.0 + * + * @param {number} [value=1] - The alpha value used for the whole Skeleton. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (value, slotName) + { + if (value === undefined) { value = 1; } + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + slot.color.a = Clamp(value, 0, 1); + } + } + else + { + this.alpha = value; + } + + return this; + }, + + /** + * The alpha value of the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#alpha + * @type {number} + * @since 3.19.0 + */ + alpha: { + + get: function () + { + return this.skeleton.color.a; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.a = v; + } + + if (v === 0) + { + this.renderFlags &= ~2; + } + else + { + this.renderFlags |= 2; + } + } + + }, + + /** + * The amount of red used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#red + * @type {number} + * @since 3.19.0 + */ + red: { + + get: function () + { + return this.skeleton.color.r; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.r = v; + } + } + + }, + + /** + * The amount of green used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#green + * @type {number} + * @since 3.19.0 + */ + green: { + + get: function () + { + return this.skeleton.color.g; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.g = v; + } + } + + }, + + /** + * The amount of blue used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#blue + * @type {number} + * @since 3.19.0 + */ + blue: { + + get: function () + { + return this.skeleton.color.b; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.b = v; + } + } + + }, + + /** + * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton. + * + * @method SpineGameObject#setColor + * @since 3.19.0 + * + * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color. + * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton. + * + * @return {this} This Game Object instance. + */ + setColor: function (color, slotName) + { + if (color === undefined) { color = 0xffffff; } + + var red = (color >> 16 & 0xFF) / 255; + var green = (color >> 8 & 0xFF) / 255; + var blue = (color & 0xFF) / 255; + var alpha = (color > 16777215) ? (color >>> 24) / 255 : null; + + var target = this.skeleton; + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + target = slot; + } + } + + target.color.r = red; + target.color.g = green; + target.color.b = blue; + + if (alpha !== null) + { + target.color.a = alpha; + } + + return this; + }, + + /** + * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object + * that contains the Skeleton data. + * + * @method SpineGameObject#setSkeletonFromJSON + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop) { return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop); }, + /** + * Sets this Game Object to use the given Skeleton based on its cache key. + * + * Typically, once set, the Skeleton doesn't change. Instead, you change the skin, + * or slot attachment, or any other property to adjust it. + * + * @method SpineGameObject#setSkeleton + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON) { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON); this.skeletonData = data.skeletonData; + this.preMultipliedAlpha = data.preMultipliedAlpha; + var skeleton = data.skeleton; - skeleton.setToSetupPose(); - - skeleton.updateWorldTransform(); - skeleton.setSkinByName('default'); + skeleton.setToSetupPose(); this.skeleton = skeleton; @@ -12115,32 +25405,15 @@ var SpineGameObject = new Class({ } this.state = data.state; - this.stateData = data.stateData; - var _this = this; - this.state.addListener({ - event: function (trackIndex, event) - { - // Event on a Track - _this.emit('spine.event', _this, trackIndex, event); - }, - complete: function (trackIndex, loopCount) - { - // Animation on Track x completed, loop count - _this.emit('spine.complete', _this, trackIndex, loopCount); - }, - start: function (trackIndex) - { - // Animation on Track x started - _this.emit('spine.start', _this, trackIndex); - }, - end: function (trackIndex) - { - // Animation on Track x ended - _this.emit('spine.end', _this, trackIndex); - } + 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) }); if (animationName) @@ -12150,25 +25423,373 @@ var SpineGameObject = new Class({ this.root = this.getRootBone(); - this.skeleton.scaleX = this.scaleX; - this.skeleton.scaleY = this.scaleY; + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } - this.skeleton.updateWorldTransform(); + this.state.apply(skeleton); - var w = this.skeletonData.width; - var h = this.skeletonData.height; + skeleton.updateCache(); - this.width = w; - this.height = h; + return this.updateSize(); + }, - this.displayOriginX = w / 2; - this.displayOriginY = h / 2; + /** + * Internal event handler that emits the Spine onComplete event via this Game Object. + * + * @method SpineGameObject#onComplete + * @fires SpinePluginEvents#COMPLETE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onComplete: function (entry) + { + this.emit(SpineEvents.COMPLETE, entry); + }, + + /** + * Internal event handler that emits the Spine onDispose event via this Game Object. + * + * @method SpineGameObject#onDispose + * @fires SpinePluginEvents#DISPOSE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onDispose: function (entry) + { + this.emit(SpineEvents.DISPOSE, entry); + }, + + /** + * Internal event handler that emits the Spine onEnd event via this Game Object. + * + * @method SpineGameObject#onEnd + * @fires SpinePluginEvents#END + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onEnd: function (entry) + { + this.emit(SpineEvents.END, entry); + }, + + /** + * Internal event handler that emits the Spine Event event via this Game Object. + * + * @method SpineGameObject#onEvent + * @fires SpinePluginEvents#EVENT + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + * @param {spine.Event} event - The Spine event. + */ + onEvent: function (entry, event) + { + this.emit(SpineEvents.EVENT, entry, event); + }, + + /** + * Internal event handler that emits the Spine onInterrupted event via this Game Object. + * + * @method SpineGameObject#onInterrupted + * @fires SpinePluginEvents#INTERRUPTED + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onInterrupted: function (entry) + { + this.emit(SpineEvents.INTERRUPTED, entry); + }, + + /** + * Internal event handler that emits the Spine onStart event via this Game Object. + * + * @method SpineGameObject#onStart + * @fires SpinePluginEvents#START + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onStart: function (entry) + { + this.emit(SpineEvents.START, entry); + }, + + /** + * Refreshes the data about the current Skeleton. + * + * This will reset the rotation, position and size of the Skeleton to match this Game Object. + * + * Call this method if you need to access the Skeleton data directly, and it may have changed + * recently. + * + * @method SpineGameObject#refresh + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + refresh: function () + { + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.updateSize(); + + this.skeleton.updateCache(); return this; }, - // http://esotericsoftware.com/spine-runtimes-guide + /** + * Sets the size of this Game Object. + * + * If no arguments are given it uses the current skeleton data dimensions. + * + * You can use this method to set a fixed size of this Game Object, such as for input detection, + * when the skeleton data doesn't match what is required in-game. + * + * @method SpineGameObject#setSize + * @since 3.19.0 + * + * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width. + * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height. + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setSize: function (width, height, offsetX, offsetY) + { + var skeleton = this.skeleton; + if (width === undefined) { width = skeleton.data.width; } + if (height === undefined) { height = skeleton.data.height; } + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.width = width; + this.height = height; + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Sets the offset of this Game Object from the Skeleton position. + * + * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using. + * + * @method SpineGameObject#setOffset + * @since 3.19.0 + * + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setOffset: function (offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Internal method that syncs all of the Game Object position and scale data to the Skeleton. + * It then syncs the skeleton bounds back to this Game Object. + * + * This method is called automatically as needed internally, however, it's also exposed should + * you require overriding the size settings. + * + * @method SpineGameObject#updateSize + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + updateSize: function () + { + var skeleton = this.skeleton; + var renderer = this.plugin.renderer; + + var height = renderer.height; + + var oldScaleX = this.scaleX; + var oldScaleY = this.scaleY; + + skeleton.x = this.x; + skeleton.y = height - this.y; + skeleton.scaleX = 1; + skeleton.scaleY = 1; + + skeleton.updateWorldTransform(); + + var bounds = this.getBounds(); + + this.width = bounds.size.x; + this.height = bounds.size.y; + + this.displayOriginX = this.x - bounds.offset.x; + this.displayOriginY = this.y - (height - (this.height + bounds.offset.y)); + + skeleton.scaleX = oldScaleX; + skeleton.scaleY = oldScaleY; + + skeleton.updateWorldTransform(); + + return this; + }, + + /** + * The horizontal scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleX + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + this.refresh(); + } + + }, + + /** + * The vertical scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleY + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + this.refresh(); + } + + }, + + /** + * Returns an array containing the names of all the bones in the Skeleton Data. + * + * @method SpineGameObject#getBoneList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the bones in the Skeleton Data. + */ + getBoneList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.bones.length; i++) + { + output.push(skeletonData.bones[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the skins in the Skeleton Data. + * + * @method SpineGameObject#getSkinList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the skins in the Skeleton Data. + */ + getSkinList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.skins.length; i++) + { + output.push(skeletonData.skins[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the slots in the Skeleton. + * + * @method SpineGameObject#getSlotList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the slots in the Skeleton. + */ + getSlotList: function () + { + var output = []; + + var skeleton = this.skeleton; + + for (var i = 0; i < skeleton.slots.length; i++) + { + output.push(skeleton.slots[i].data.name); + } + + return output; + }, + + /** + * Returns an array containing the names of all the animations in the Skeleton Data. + * + * @method SpineGameObject#getAnimationList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the animations in the Skeleton Data. + */ getAnimationList: function () { var output = []; @@ -12186,35 +25807,157 @@ var SpineGameObject = new Class({ return output; }, - play: function (animationName, loop) + /** + * Returns the current animation being played on the given track, if any. + * + * @method SpineGameObject#getCurrentAnimation + * @since 3.19.0 + * + * @param {integer} [trackIndex=0] - The track to return the current animation on. + * + * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation. + */ + getCurrentAnimation: function (trackIndex) { - if (loop === undefined) - { - loop = false; - } + if (trackIndex === undefined) { trackIndex = 0; } - return this.setAnimation(0, animationName, loop); + var current = this.state.getCurrent(trackIndex); + + if (current) + { + return current.animation; + } }, - setAnimation: function (trackIndex, animationName, loop) + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#play + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead. + */ + play: function (animationName, loop, ignoreIfPlaying) { - this.state.setAnimation(trackIndex, animationName, loop); + this.setAnimation(0, animationName, loop, ignoreIfPlaying); return this; }, + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#setAnimation + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to play the animation on. + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying) + { + if (loop === undefined) { loop = false; } + if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } + + if (ignoreIfPlaying && this.state) + { + var currentTrack = this.state.getCurrent(0); + + if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete()) + { + return; + } + } + + if (this.findAnimation(animationName)) + { + return this.state.setAnimation(trackIndex, animationName, loop); + } + }, + + /** + * Adds an animation to be played after the current or last queued animation for a track. + * If the track is empty, it is equivalent to calling setAnimation. + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous + * track entry minus any mix duration (from the AnimationStateData) plus the specified delay + * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration). + * If the previous entry is looping, its next loop completion is used instead of its duration. + * + * @method SpineGameObject#addAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {string} animationName - The string-based key of the animation to add. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ addAnimation: function (trackIndex, animationName, loop, delay) { return this.state.addAnimation(trackIndex, animationName, loop, delay); }, + /** + * Sets an empty animation for a track, discarding any queued animations, and sets the track + * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out. + * + * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation, + * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be + * applied less and less over the mix duration. Properties keyed in the previous animation transition to + * the value from lower tracks or to the setup pose value if no lower tracks key the property. + * A mix duration of 0 still mixes out over one frame. + * + * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation + * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new + * animation to be applied more and more over the mix duration. Properties keyed in the new animation + * transition from the value from lower tracks or from the setup pose value if no lower tracks key the + * property to the value keyed in the new animation. + * + * @method SpineGameObject#setEmptyAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {spine.TrackEntry} The returned Track Entry. + */ setEmptyAnimation: function (trackIndex, mixDuration) { - this.state.setEmptyAnimation(trackIndex, mixDuration); - - return this; + return this.state.setEmptyAnimation(trackIndex, mixDuration); }, + /** + * Removes all animations from the track, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTrack + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * + * @return {this} This Game Object. + */ clearTrack: function (trackIndex) { this.state.clearTrack(trackIndex); @@ -12222,6 +25965,17 @@ var SpineGameObject = new Class({ return this; }, + /** + * Removes all animations from all tracks, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTracks + * @since 3.19.0 + * + * @return {this} This Game Object. + */ clearTracks: function () { this.state.clearTracks(); @@ -12229,13 +25983,57 @@ var SpineGameObject = new Class({ return this; }, + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkinByName + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to set. + * + * @return {this} This Game Object. + */ setSkinByName: function (skinName) { - this.skeleton.setSkinByName(skinName); + var skeleton = this.skeleton; + + skeleton.setSkinByName(skinName); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); return this; }, + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkin + * @since 3.19.0 + * + * @param {?spine.Skin} newSkin - The Skin to set. May be `null`. + * + * @return {this} This Game Object. + */ setSkin: function (newSkin) { var skeleton = this.skeleton; @@ -12249,6 +26047,18 @@ var SpineGameObject = new Class({ return this; }, + /** + * Sets the mix duration when changing from the specified animation to the other. + * + * @method SpineGameObject#setMix + * @since 3.19.0 + * + * @param {string} fromName - The animation to mix from. + * @param {string} toName - The animation to mix to. + * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {this} This Game Object. + */ setMix: function (fromName, toName, duration) { this.stateData.setMix(fromName, toName, duration); @@ -12256,36 +26066,364 @@ var SpineGameObject = new Class({ return this; }, + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot + * index and attachment name. First the skin is checked and if the attachment was not found, + * the default skin is checked. + * + * @method SpineGameObject#getAttachment + * @since 3.19.0 + * + * @param {integer} slotIndex - The slot index to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachment: function (slotIndex, attachmentName) + { + return this.skeleton.getAttachment(slotIndex, attachmentName); + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name. + * + * @method SpineGameObject#getAttachmentByName + * @since 3.19.0 + * + * @param {string} slotName - The slot name to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachmentByName: function (slotName, attachmentName) + { + return this.skeleton.getAttachmentByName(slotName, attachmentName); + }, + + /** + * A convenience method to set an attachment by finding the slot with findSlot, + * finding the attachment with getAttachment, then setting the slot's attachment. + * + * @method SpineGameObject#setAttachment + * @since 3.19.0 + * + * @param {string} slotName - The slot name to add the attachment to. + * @param {string} attachmentName - The attachment name to add. + * + * @return {this} This Game Object. + */ + setAttachment: function (slotName, attachmentName) + { + if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length) + { + for (var i = 0; i < slotName.length; i++) + { + this.skeleton.setAttachment(slotName[i], attachmentName[i]); + } + } + else + { + this.skeleton.setAttachment(slotName, attachmentName); + } + + return this; + }, + + /** + * Sets the bones, constraints, slots, and draw order to their setup pose values. + * + * @method SpineGameObject#setToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setToSetupPose: function () + { + this.skeleton.setToSetupPose(); + + return this; + }, + + /** + * Sets the slots and draw order to their setup pose values. + * + * @method SpineGameObject#setSlotsToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setSlotsToSetupPose: function () + { + this.skeleton.setSlotsToSetupPose(); + + return this; + }, + + /** + * Sets the bones and constraints to their setup pose values. + * + * @method SpineGameObject#setBonesToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setBonesToSetupPose: function () + { + this.skeleton.setBonesToSetupPose(); + + return this; + }, + + /** + * Gets the root bone, or null. + * + * @method SpineGameObject#getRootBone + * @since 3.19.0 + * + * @return {spine.Bone} The root bone, or null. + */ getRootBone: function () { return this.skeleton.getRootBone(); }, + /** + * Takes a Bone object and a position in world space and rotates the Bone so it is angled + * towards the given position. You can set an optional angle offset, should the bone be + * designed at a specific angle already. You can also set a minimum and maximum range for the angle. + * + * @method SpineGameObject#angleBoneToXY + * @since 3.19.0 + * + * @param {spine.Bone} bone - The bone to rotate towards the world position. + * @param {number} worldX - The world x coordinate to rotate the bone towards. + * @param {number} worldY - The world y coordinate to rotate the bone towards. + * @param {number} [offset=0] - An offset to add to the rotation angle. + * @param {number} [minAngle=0] - The minimum range of the rotation angle. + * @param {number} [maxAngle=360] - The maximum range of the rotation angle. + * + * @return {this} This Game Object. + */ + angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle) + { + if (offset === undefined) { offset = 0; } + if (minAngle === undefined) { minAngle = 0; } + if (maxAngle === undefined) { maxAngle = 360; } + + var renderer = this.plugin.renderer; + var height = renderer.height; + + var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset)); + + bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle); + + return this; + }, + + /** + * Finds a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBone + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {spine.Bone} The bone, or null. + */ findBone: function (boneName) { return this.skeleton.findBone(boneName); }, + /** + * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBoneIndex + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {integer} The bone index. Or -1 if the bone was not found. + */ findBoneIndex: function (boneName) { return this.skeleton.findBoneIndex(boneName); }, + /** + * Finds a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlot + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {spine.Slot} The Slot. May be null. + */ findSlot: function (slotName) { return this.skeleton.findSlot(slotName); }, + /** + * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlotIndex + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {integer} The slot index. Or -1 if the Slot was not found. + */ findSlotIndex: function (slotName) { return this.skeleton.findSlotIndex(slotName); }, + /** + * Finds a skin by comparing each skin's name. It is more efficient to cache the results of + * this method than to call it multiple times. + * + * @method SpineGameObject#findSkin + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to find. + * + * @return {spine.Skin} The Skin. May be null. + */ + findSkin: function (skinName) + { + return this.skeletonData.findSkin(skinName); + }, + + /** + * Finds an event by comparing each events's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findEvent + * @since 3.19.0 + * + * @param {string} eventDataName - The name of the event to find. + * + * @return {spine.EventData} The Event Data. May be null. + */ + findEvent: function (eventDataName) + { + return this.skeletonData.findEvent(eventDataName); + }, + + /** + * Finds an animation by comparing each animation's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findAnimation + * @since 3.19.0 + * + * @param {string} animationName - The name of the animation to find. + * + * @return {spine.Animation} The Animation. May be null. + */ + findAnimation: function (animationName) + { + return this.skeletonData.findAnimation(animationName); + }, + + /** + * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findIkConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.IkConstraintData} The IK constraint. May be null. + */ + findIkConstraint: function (constraintName) + { + return this.skeletonData.findIkConstraint(constraintName); + }, + + /** + * Finds an transform constraint by comparing each transform constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findTransformConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.TransformConstraintData} The transform constraint. May be null. + */ + findTransformConstraint: function (constraintName) + { + return this.skeletonData.findTransformConstraint(constraintName); + }, + + /** + * Finds a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.PathConstraintData} The path constraint. May be null. + */ + findPathConstraint: function (constraintName) + { + return this.skeletonData.findPathConstraint(constraintName); + }, + + /** + * Finds the index of a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraintIndex + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {integer} The constraint index. Or -1 if the constraint was not found. + */ + findPathConstraintIndex: function (constraintName) + { + return this.skeletonData.findPathConstraintIndex(constraintName); + }, + + /** + * 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 SpineGameObject#getBounds + * @since 3.19.0 + * + * @return {any} The bounds object. + */ getBounds: function () { return this.plugin.getBounds(this.skeleton); }, + /** + * Internal update handler. + * + * @method SpineGameObject#preUpdate + * @protected + * @since 3.19.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ preUpdate: function (time, delta) { var skeleton = this.skeleton; @@ -12294,17 +26432,15 @@ var SpineGameObject = new Class({ this.state.apply(skeleton); - this.emit('spine.update', skeleton); - - skeleton.updateWorldTransform(); + // this.emit('spine.update', skeleton); }, /** * Internal destroy handler, called as part of the destroy process. * - * @method Phaser.GameObjects.RenderTexture#preDestroy + * @method SpineGameObject#preDestroy * @protected - * @since 3.16.0 + * @since 3.19.0 */ preDestroy: function () { @@ -12329,99 +26465,4142 @@ module.exports = SpineGameObject; /***/ }), - -/***/ "./gameobject/SpineGameObjectCanvasRenderer.js": -/*!*****************************************************!*\ - !*** ./gameobject/SpineGameObjectCanvasRenderer.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/* 187 */ +/***/ (function(module, exports) { /** * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTransform = __webpack_require__(/*! ../../../../src/renderer/canvas/utils/SetTransform */ "../../../src/renderer/canvas/utils/SetTransform.js"); - /** - * 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.SpineGameObject#renderCanvas - * @since 3.16.0 - * @private - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.SpineGameObject} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. - * @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 + * 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 SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) -{ - var context = renderer.currentContext; - var plugin = src.plugin; - var skeleton = src.skeleton; - var skeletonRenderer = plugin.skeletonRenderer; +var ComputedSize = { - if (!skeleton || !SetTransform(renderer, context, src, camera, parentMatrix)) + /** + * 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) { - return; + 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; } - skeletonRenderer.ctx = context; - - context.save(); - - skeletonRenderer.draw(skeleton); - - if (plugin.drawDebug || src.drawDebug) - { - context.strokeStyle = '#00ff00'; - context.beginPath(); - context.moveTo(-1000, 0); - context.lineTo(1000, 0); - context.moveTo(0, -1000); - context.lineTo(0, 1000); - context.stroke(); - } - - context.restore(); }; -module.exports = SpineGameObjectCanvasRenderer; +module.exports = ComputedSize; /***/ }), +/* 188 */ +/***/ (function(module, exports) { -/***/ "./gameobject/SpineGameObjectRender.js": -/*!*********************************************!*\ - !*** ./gameobject/SpineGameObjectRender.js ***! - \*********************************************/ -/*! no static exports found */ +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * 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 depth starts from zero (the default value) and increases from that point. 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) + { + this.scene.sys.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 depth starts from zero (the default value) and increases from that point. 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 {integer} value - The depth of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), +/* 189 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 190 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 191 */ /***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(1); +var TransformMatrix = __webpack_require__(192); +var WrapAngle = __webpack_require__(17); +var WrapAngleDegrees = __webpack_require__(18); + +// 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 = { + + /** + * 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: Do not use this value to set the z-index, instead see the `depth` property. + * + * @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 {integer} + * @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, 90 is down, 180/-180 is left + * and -90 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; + }, + + /** + * 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. + * + * @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; + }, + + /** + * 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; + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var MATH_CONST = __webpack_require__(1); +var Vector2 = __webpack_require__(7); + +/** + * @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 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 {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) ? this : out; + + destinationMatrix.a = (sourceA * localA) + (sourceB * localC); + destinationMatrix.b = (sourceA * localB) + (sourceB * localD); + destinationMatrix.c = (sourceC * localA) + (sourceD * localC); + destinationMatrix.d = (sourceC * localB) + (sourceD * localD); + destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE; + destinationMatrix.f = (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 using 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.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates. + * + * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} 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; + }, + + /** + * 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 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.decomposedMatrix = null; + } + +}); + +module.exports = TransformMatrix; + + +/***/ }), +/* 193 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 194 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var ComponentsToJSON = __webpack_require__(195); +var DataManager = __webpack_require__(196); +var EventEmitter = __webpack_require__(202); +var Events = __webpack_require__(203); + +/** + * @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); + + /** + * The Scene to which this Game Object belongs. + * Game Objects can only belong to one Scene. + * + * @name Phaser.GameObjects.GameObject#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * 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 move 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 {(integer|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 {integer} + * @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 {integer} + * @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 physics then this property will contain a reference to a Physics Body. + * + * @name Phaser.GameObjects.GameObject#body + * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)} + * @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; + + // 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 {(integer|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 + * + * @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; + }, + + /** + * 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. + * + * @method Phaser.GameObjects.GameObject#setInteractive + * @since 3.0.0 + * + * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. 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 (shape, callback, dropZone) + { + this.scene.sys.input.enable(this, shape, callback, 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 () + { + if (this.input) + { + this.input.enabled = false; + } + + 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; + }, + + /** + * 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) + { + return !(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 {integer[]} 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), parent.name]); + indexes.unshift(parent.getIndex(child)); + + child = parent; + + if (!parent.parentContainer) + { + break; + } + else + { + parent = parent.parentContainer; + } + } + + // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']); + indexes.unshift(this.scene.sys.displayList.getIndex(child)); + + return indexes; + }, + + /** + * 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] - Is this Game Object being destroyed as the result of a Scene shutdown? + */ + destroy: function (fromScene) + { + if (fromScene === undefined) { fromScene = false; } + + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + if (this.preDestroy) + { + this.preDestroy.call(this); + } + + this.emit(Events.DESTROY, this); + + var sys = this.scene.sys; + + if (!fromScene) + { + sys.displayList.remove(this); + sys.updateList.remove(this); + } + + if (this.input) + { + 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; + } + + // Tell the Scene to re-sort the children + if (!fromScene) + { + sys.queueDepthSort(); + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + + this.parentContainer = undefined; + + this.removeAllListeners(); + } + +}); + +/** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + * + * @constant {integer} RENDER_MASK + * @memberof Phaser.GameObjects.GameObject + * @default + */ +GameObject.RENDER_MASK = 15; + +module.exports = GameObject; + + +/***/ }), +/* 195 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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, + scaleMode: gameObject.scaleMode, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Events = __webpack_require__(197); + +/** + * @callback DataEachCallback + * + * @param {*} parent - The parent object of the DataManager. + * @param {string} key - The key of the value. + * @param {*} value - The value. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + */ + +/** + * @classdesc + * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + * + * @class DataManager + * @memberof Phaser.Data + * @constructor + * @since 3.0.0 + * + * @param {object} parent - The object that this DataManager belongs to. + * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter. + */ +var DataManager = new Class({ + + initialize: + + function DataManager (parent, eventEmitter) + { + /** + * The object that this DataManager belongs to. + * + * @name Phaser.Data.DataManager#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The DataManager's event emitter. + * + * @name Phaser.Data.DataManager#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = eventEmitter; + + if (!eventEmitter) + { + this.events = (parent.events) ? parent.events : parent; + } + + /** + * The data list. + * + * @name Phaser.Data.DataManager#list + * @type {Object.} + * @default {} + * @since 3.0.0 + */ + this.list = {}; + + /** + * The public values list. You can use this to access anything you have stored + * in this Data Manager. For example, if you set a value called `gold` you can + * access it via: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also modify it directly: + * + * ```javascript + * this.data.values.gold += 1000; + * ``` + * + * Doing so will emit a `setdata` event from the parent of this Data Manager. + * + * Do not modify this object directly. Adding properties directly to this object will not + * emit any events. Always use `DataManager.set` to create new items the first time around. + * + * @name Phaser.Data.DataManager#values + * @type {Object.} + * @default {} + * @since 3.10.0 + */ + this.values = {}; + + /** + * Whether setting data is frozen for this DataManager. + * + * @name Phaser.Data.DataManager#_frozen + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._frozen = false; + + if (!parent.hasOwnProperty('sys') && this.events) + { + this.events.once('destroy', this.destroy, this); + } + }, + + /** + * Retrieves the value for the given key, 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 + * this.data.get('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * this.data.get([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.Data.DataManager#get + * @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. + */ + get: function (key) + { + var list = this.list; + + if (Array.isArray(key)) + { + var output = []; + + for (var i = 0; i < key.length; i++) + { + output.push(list[key[i]]); + } + + return output; + } + else + { + return list[key]; + } + }, + + /** + * Retrieves all data values in a new object. + * + * @method Phaser.Data.DataManager#getAll + * @since 3.0.0 + * + * @return {Object.} All data values. + */ + getAll: function () + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Queries the DataManager for the values of keys matching the given regular expression. + * + * @method Phaser.Data.DataManager#query + * @since 3.0.0 + * + * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). + * + * @return {Object.} The values of the keys matching the search string. + */ + query: function (search) + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key) && key.match(search)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * data.set('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `get`: + * + * ```javascript + * data.get('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted. + * + * 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.Data.DataManager#set + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @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. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + set: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (typeof key === 'string') + { + return this.setValue(key, data); + } + else + { + for (var entry in key) + { + this.setValue(entry, key[entry]); + } + } + + return this; + }, + + /** + * Internal value setter, called automatically by the `set` method. + * + * @method Phaser.Data.DataManager#setValue + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @private + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * @param {*} data - The value to set. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setValue: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (this.has(key)) + { + // Hit the key getter, which will in turn emit the events. + this.values[key] = data; + } + else + { + var _this = this; + var list = this.list; + var events = this.events; + var parent = this.parent; + + Object.defineProperty(this.values, key, { + + enumerable: true, + + configurable: true, + + get: function () + { + return list[key]; + }, + + set: function (value) + { + if (!_this._frozen) + { + var previousValue = list[key]; + list[key] = value; + + events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); + events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); + } + } + + }); + + list[key] = data; + + events.emit(Events.SET_DATA, parent, key, data); + } + + return this; + }, + + /** + * Passes all data entries to the given callback. + * + * @method Phaser.Data.DataManager#each + * @since 3.0.0 + * + * @param {DataEachCallback} callback - The function to call. + * @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 {Phaser.Data.DataManager} This DataManager object. + */ + each: function (callback, context) + { + var args = [ this.parent, null, undefined ]; + + for (var i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (var key in this.list) + { + args[1] = key; + args[2] = this.list[key]; + + callback.apply(context, args); + } + + return this; + }, + + /** + * Merge the given object of key value pairs into this DataManager. + * + * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) + * will emit a `changedata` event. + * + * @method Phaser.Data.DataManager#merge + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {Object.} data - The data to merge. + * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + merge: function (data, overwrite) + { + if (overwrite === undefined) { overwrite = true; } + + // Merge data from another component into this one + for (var key in data) + { + if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) + { + this.setValue(key, data[key]); + } + } + + return this; + }, + + /** + * Remove the value for the given key. + * + * If the key is found in this Data Manager it is removed from the internal lists and a + * `removedata` event is emitted. + * + * You can also pass in an array of keys, in which case all keys in the array will be removed: + * + * ```javascript + * this.data.remove([ 'gold', 'armor', 'health' ]); + * ``` + * + * @method Phaser.Data.DataManager#remove + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {(string|string[])} key - The key to remove, or an array of keys to remove. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + remove: function (key) + { + if (this._frozen) + { + return this; + } + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + this.removeValue(key[i]); + } + } + else + { + return this.removeValue(key); + } + + return this; + }, + + /** + * Internal value remover, called automatically by the `remove` method. + * + * @method Phaser.Data.DataManager#removeValue + * @private + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + removeValue: function (key) + { + if (this.has(key)) + { + var data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return this; + }, + + /** + * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. + * + * @method Phaser.Data.DataManager#pop + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {string} key - The key of the value to retrieve and delete. + * + * @return {*} The value of the given key. + */ + pop: function (key) + { + var data = undefined; + + if (!this._frozen && this.has(key)) + { + data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return data; + }, + + /** + * Determines whether the given key is set in this Data Manager. + * + * Please note that the 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.Data.DataManager#has + * @since 3.0.0 + * + * @param {string} key - The key to check. + * + * @return {boolean} Returns `true` if the key exists, otherwise `false`. + */ + has: function (key) + { + return this.list.hasOwnProperty(key); + }, + + /** + * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts + * to create new values or update existing ones. + * + * @method Phaser.Data.DataManager#setFreeze + * @since 3.0.0 + * + * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setFreeze: function (value) + { + this._frozen = value; + + return this; + }, + + /** + * Delete all data in this Data Manager and unfreeze it. + * + * @method Phaser.Data.DataManager#reset + * @since 3.0.0 + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + reset: function () + { + for (var key in this.list) + { + delete this.list[key]; + delete this.values[key]; + } + + this._frozen = false; + + return this; + }, + + /** + * Destroy this data manager. + * + * @method Phaser.Data.DataManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.reset(); + + this.events.off(Events.CHANGE_DATA); + this.events.off(Events.SET_DATA); + this.events.off(Events.REMOVE_DATA); + + this.parent = null; + }, + + /** + * Gets or sets the frozen state of this Data Manager. + * A frozen Data Manager will block all attempts to create new values or update existing ones. + * + * @name Phaser.Data.DataManager#freeze + * @type {boolean} + * @since 3.0.0 + */ + freeze: { + + get: function () + { + return this._frozen; + }, + + set: function (value) + { + this._frozen = (value) ? true : false; + } + + }, + + /** + * Return the total number of entries in this Data Manager. + * + * @name Phaser.Data.DataManager#count + * @type {integer} + * @since 3.0.0 + */ + count: { + + get: function () + { + var i = 0; + + for (var key in this.list) + { + if (this.list[key] !== undefined) + { + i++; + } + } + + return i; + } + + } + +}); + +module.exports = DataManager; + + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Data.Events + */ + +module.exports = { + + CHANGE_DATA: __webpack_require__(198), + CHANGE_DATA_KEY: __webpack_require__(199), + REMOVE_DATA: __webpack_require__(200), + SET_DATA: __webpack_require__(201) + +}; + + +/***/ }), +/* 198 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`. + * + * This event is dispatched for all items that change in the Data Manager. + * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. + * + * @event Phaser.Data.Events#CHANGE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The new value of the item in the Data Manager. + * @param {any} previousValue - The previous value of the item in the Data Manager. + */ +module.exports = 'changedata'; + + +/***/ }), +/* 199 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Key Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`, + * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` + * then you can listen for `sprite.data.on('changedata-gold')`. + * + * @event Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.16.1 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'changedata-'; + + +/***/ }), +/* 200 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Remove Data Event. + * + * This event is dispatched by a Data Manager when an item is removed from it. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`. + * + * @event Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'removedata'; + + +/***/ }), +/* 201 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Set Data Event. + * + * This event is dispatched by a Data Manager when a new item is added to the data store. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`. + * + * @event Phaser.Data.Events#SET_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'setdata'; + + +/***/ }), +/* 202 */ +/***/ (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; +} + + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { DESTROY: __webpack_require__(204) }; + + +/***/ }), +/* 204 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Destroy Event. + * + * 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 + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. + */ +module.exports = 'destroy'; + + +/***/ }), +/* 205 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace SpinePluginEvents + */ + +module.exports = { + + COMPLETE: __webpack_require__(206), + DISPOSE: __webpack_require__(207), + END: __webpack_require__(208), + EVENT: __webpack_require__(209), + INTERRUPTED: __webpack_require__(210), + START: __webpack_require__(211) + +}; + + +/***/ }), +/* 206 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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'; + + +/***/ }), +/* 207 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#DISPOSE + * @since 3.19.0 + */ +module.exports = 'dispose'; + + +/***/ }), +/* 208 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#END + * @since 3.19.0 + */ +module.exports = 'end'; + + +/***/ }), +/* 209 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#EVENT + * @since 3.19.0 + */ +module.exports = 'event'; + + +/***/ }), +/* 210 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#INTERRUPTED + * @since 3.19.0 + */ +module.exports = 'interrupted'; + + +/***/ }), +/* 211 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#START + * @since 3.19.0 + */ +module.exports = 'start'; + + +/***/ }), +/* 212 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var renderWebGL = __webpack_require__(/*! ../../../../src/utils/NOOP */ "../../../src/utils/NOOP.js"); -var renderCanvas = __webpack_require__(/*! ../../../../src/utils/NOOP */ "../../../src/utils/NOOP.js"); +var renderWebGL = __webpack_require__(31); +var renderCanvas = __webpack_require__(31); if (true) { - renderWebGL = __webpack_require__(/*! ./SpineGameObjectWebGLRenderer */ "./gameobject/SpineGameObjectWebGLRenderer.js"); + renderWebGL = __webpack_require__(213); } if (true) { - renderCanvas = __webpack_require__(/*! ./SpineGameObjectCanvasRenderer */ "./gameobject/SpineGameObjectCanvasRenderer.js"); + renderCanvas = __webpack_require__(214); } module.exports = { @@ -12433,34 +30612,30 @@ module.exports = { /***/ }), - -/***/ "./gameobject/SpineGameObjectWebGLRenderer.js": -/*!****************************************************!*\ - !*** ./gameobject/SpineGameObjectWebGLRenderer.js ***! - \****************************************************/ -/*! no static exports found */ +/* 213 */ /***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. + * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CounterClockwise = __webpack_require__(/*! ../../../../src/math/angle/CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"); -var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../../src/math/RadToDeg.js"); +var CounterClockwise = __webpack_require__(5); +var RadToDeg = __webpack_require__(6); +var Wrap = __webpack_require__(3); /** - * Renders this Game Object with the Canvas Renderer to the given Camera. + * 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.SpineGameObject#renderCanvas - * @since 3.16.0 + * @method SpineGameObject#renderWebGL + * @since 3.19.0 * @private * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.SpineGameObject} src - The Game Object being rendered in this call. + * @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 {number} interpolationPercentage - Reserved for future use and custom pipelines. * @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 @@ -12468,16 +30643,27 @@ var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../. var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) { var plugin = src.plugin; - var mvp = plugin.mvp; - - var shader = plugin.shader; - var batcher = plugin.batcher; - var runtime = plugin.runtime; var skeleton = src.skeleton; - var skeletonRenderer = plugin.skeletonRenderer; + var sceneRenderer = plugin.sceneRenderer; - if (!skeleton) + var GameObjectRenderMask = 15; + + var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); + + if (!skeleton || !willRender) { + // Reset the current type + renderer.currentType = ''; + + // If there is already a batch running, we need to close it + if (!renderer.nextTypeMatch) + { + // The next object in the display list is not a Spine object, so we end the batch + sceneRenderer.end(); + + renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline); + } + return; } @@ -12490,8 +30676,7 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent var spriteMatrix = renderer._tempMatrix2; var calcMatrix = renderer._tempMatrix3; - // - 90 degrees to account for the difference in Spine vs. Phaser rotation - spriteMatrix.applyITRS(src.x, src.y, src.rotation - 1.5707963267948966, src.scaleX, src.scaleY); + spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); camMatrix.copyFrom(camera.matrix); @@ -12516,9823 +30701,214 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent camMatrix.multiply(spriteMatrix, calcMatrix); } - var width = renderer.width; - var height = renderer.height; + 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; + + 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 = calcMatrix.scaleY * -1; + skeleton.scaleY *= -1; } - else - { - skeleton.y = height - calcMatrix.ty; - skeleton.scaleY = calcMatrix.scaleY; - } - - src.root.rotation = RadToDeg(CounterClockwise(calcMatrix.rotation)); // Add autoUpdate option skeleton.updateWorldTransform(); if (renderer.newType) { - mvp.ortho(0, width, 0, height, 0, 1); - - shader.bind(); - shader.setUniformi(runtime.Shader.SAMPLER, 0); - shader.setUniform4x4f(runtime.Shader.MVP_MATRIX, mvp.val); - - batcher.begin(shader); - - skeletonRenderer.premultipliedAlpha = true; - } - - if (renderer.nextTypeMatch) - { - batcher.isDrawing = false; + sceneRenderer.begin(); } // Draw the current skeleton - skeletonRenderer.draw(batcher, skeleton); + sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + + 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 object, so we end the batch - batcher.isDrawing = true; - - batcher.end(); - - shader.unbind(); + sceneRenderer.end(); renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline); } - - /* - var drawDebug = (plugin.drawDebug || src.drawDebug); - - if (drawDebug) - { - var debugShader = plugin.debugShader; - var debugRenderer = plugin.debugRenderer; - var shapes = plugin.shapes; - - debugShader.bind(); - debugShader.setUniform4x4f(runtime.Shader.MVP_MATRIX, mvp.val); - - shapes.begin(debugShader); - - debugRenderer.draw(shapes, skeleton); - - shapes.end(); - - debugShader.unbind(); - } - */ }; module.exports = SpineGameObjectWebGLRenderer; /***/ }), +/* 214 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ "./runtimes/spine-both.js": -/*!********************************!*\ - !*** ./runtimes/spine-both.js ***! - \********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ -/*** IMPORTS FROM imports-loader ***/ -(function() { +var CounterClockwise = __webpack_require__(5); +var RadToDeg = __webpack_require__(6); +var Wrap = __webpack_require__(3); -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var spine; -(function (spine) { - var Animation = (function () { - function Animation(name, timelines, duration) { - if (name == null) - throw new Error("name cannot be null."); - if (timelines == null) - throw new Error("timelines cannot be null."); - this.name = name; - this.timelines = timelines; - this.duration = duration; - } - Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) { - if (skeleton == null) - throw new Error("skeleton cannot be null."); - if (loop && this.duration != 0) { - time %= this.duration; - if (lastTime > 0) - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction); - }; - Animation.binarySearch = function (values, target, step) { - if (step === void 0) { step = 1; } - var low = 0; - var high = values.length / step - 2; - if (high == 0) - return step; - var current = high >>> 1; - while (true) { - if (values[(current + 1) * step] <= target) - low = current + 1; - else - high = current; - if (low == high) - return (low + 1) * step; - current = (low + high) >>> 1; - } - }; - Animation.linearSearch = function (values, target, step) { - for (var i = 0, last = values.length - step; i <= last; i += step) - if (values[i] > target) - return i; - return -1; - }; - return Animation; - }()); - spine.Animation = Animation; - var MixBlend; - (function (MixBlend) { - MixBlend[MixBlend["setup"] = 0] = "setup"; - MixBlend[MixBlend["first"] = 1] = "first"; - MixBlend[MixBlend["replace"] = 2] = "replace"; - MixBlend[MixBlend["add"] = 3] = "add"; - })(MixBlend = spine.MixBlend || (spine.MixBlend = {})); - var MixDirection; - (function (MixDirection) { - MixDirection[MixDirection["in"] = 0] = "in"; - MixDirection[MixDirection["out"] = 1] = "out"; - })(MixDirection = spine.MixDirection || (spine.MixDirection = {})); - var TimelineType; - (function (TimelineType) { - TimelineType[TimelineType["rotate"] = 0] = "rotate"; - TimelineType[TimelineType["translate"] = 1] = "translate"; - TimelineType[TimelineType["scale"] = 2] = "scale"; - TimelineType[TimelineType["shear"] = 3] = "shear"; - TimelineType[TimelineType["attachment"] = 4] = "attachment"; - TimelineType[TimelineType["color"] = 5] = "color"; - TimelineType[TimelineType["deform"] = 6] = "deform"; - TimelineType[TimelineType["event"] = 7] = "event"; - TimelineType[TimelineType["drawOrder"] = 8] = "drawOrder"; - TimelineType[TimelineType["ikConstraint"] = 9] = "ikConstraint"; - TimelineType[TimelineType["transformConstraint"] = 10] = "transformConstraint"; - TimelineType[TimelineType["pathConstraintPosition"] = 11] = "pathConstraintPosition"; - TimelineType[TimelineType["pathConstraintSpacing"] = 12] = "pathConstraintSpacing"; - TimelineType[TimelineType["pathConstraintMix"] = 13] = "pathConstraintMix"; - TimelineType[TimelineType["twoColor"] = 14] = "twoColor"; - })(TimelineType = spine.TimelineType || (spine.TimelineType = {})); - var CurveTimeline = (function () { - function CurveTimeline(frameCount) { - if (frameCount <= 0) - throw new Error("frameCount must be > 0: " + frameCount); - this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE); - } - CurveTimeline.prototype.getFrameCount = function () { - return this.curves.length / CurveTimeline.BEZIER_SIZE + 1; - }; - CurveTimeline.prototype.setLinear = function (frameIndex) { - this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR; - }; - CurveTimeline.prototype.setStepped = function (frameIndex) { - this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED; - }; - CurveTimeline.prototype.getCurveType = function (frameIndex) { - var index = frameIndex * CurveTimeline.BEZIER_SIZE; - if (index == this.curves.length) - return CurveTimeline.LINEAR; - var type = this.curves[index]; - if (type == CurveTimeline.LINEAR) - return CurveTimeline.LINEAR; - if (type == CurveTimeline.STEPPED) - return CurveTimeline.STEPPED; - return CurveTimeline.BEZIER; - }; - CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) { - var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03; - var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006; - var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy; - var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667; - var i = frameIndex * CurveTimeline.BEZIER_SIZE; - var curves = this.curves; - curves[i++] = CurveTimeline.BEZIER; - var x = dfx, y = dfy; - for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - x += dfx; - y += dfy; - } - }; - CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) { - percent = spine.MathUtils.clamp(percent, 0, 1); - var curves = this.curves; - var i = frameIndex * CurveTimeline.BEZIER_SIZE; - var type = curves[i]; - if (type == CurveTimeline.LINEAR) - return percent; - if (type == CurveTimeline.STEPPED) - return 0; - i++; - var x = 0; - for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { - x = curves[i]; - if (x >= percent) { - var prevX = void 0, prevY = void 0; - if (i == start) { - prevX = 0; - prevY = 0; - } - else { - prevX = curves[i - 2]; - prevY = curves[i - 1]; - } - return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); - } - } - var y = curves[i - 1]; - return y + (1 - y) * (percent - x) / (1 - x); - }; - CurveTimeline.LINEAR = 0; - CurveTimeline.STEPPED = 1; - CurveTimeline.BEZIER = 2; - CurveTimeline.BEZIER_SIZE = 10 * 2 - 1; - return CurveTimeline; - }()); - spine.CurveTimeline = CurveTimeline; - var RotateTimeline = (function (_super) { - __extends(RotateTimeline, _super); - function RotateTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount << 1); - return _this; - } - RotateTimeline.prototype.getPropertyId = function () { - return (TimelineType.rotate << 24) + this.boneIndex; - }; - RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) { - frameIndex <<= 1; - this.frames[frameIndex] = time; - this.frames[frameIndex + RotateTimeline.ROTATION] = degrees; - }; - RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var frames = this.frames; - var bone = skeleton.bones[this.boneIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - bone.rotation = bone.data.rotation; - return; - case MixBlend.first: - var r_1 = bone.data.rotation - bone.rotation; - bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha; - } - return; - } - if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { - var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION]; - switch (blend) { - case MixBlend.setup: - bone.rotation = bone.data.rotation + r_2 * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - r_2 += bone.data.rotation - bone.rotation; - r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; - case MixBlend.add: - bone.rotation += r_2 * alpha; - } - return; - } - var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES); - var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime)); - var r = frames[frame + RotateTimeline.ROTATION] - prevRotation; - r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent; - switch (blend) { - case MixBlend.setup: - bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - r += bone.data.rotation - bone.rotation; - case MixBlend.add: - bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; - } - }; - RotateTimeline.ENTRIES = 2; - RotateTimeline.PREV_TIME = -2; - RotateTimeline.PREV_ROTATION = -1; - RotateTimeline.ROTATION = 1; - return RotateTimeline; - }(CurveTimeline)); - spine.RotateTimeline = RotateTimeline; - var TranslateTimeline = (function (_super) { - __extends(TranslateTimeline, _super); - function TranslateTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES); - return _this; - } - TranslateTimeline.prototype.getPropertyId = function () { - return (TimelineType.translate << 24) + this.boneIndex; - }; - TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) { - frameIndex *= TranslateTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + TranslateTimeline.X] = x; - this.frames[frameIndex + TranslateTimeline.Y] = y; - }; - TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var frames = this.frames; - var bone = skeleton.bones[this.boneIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - bone.x = bone.data.x; - bone.y = bone.data.y; - return; - case MixBlend.first: - bone.x += (bone.data.x - bone.x) * alpha; - bone.y += (bone.data.y - bone.y) * alpha; - } - return; - } - var x = 0, y = 0; - if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { - x = frames[frames.length + TranslateTimeline.PREV_X]; - y = frames[frames.length + TranslateTimeline.PREV_Y]; - } - else { - var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES); - x = frames[frame + TranslateTimeline.PREV_X]; - y = frames[frame + TranslateTimeline.PREV_Y]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime)); - x += (frames[frame + TranslateTimeline.X] - x) * percent; - y += (frames[frame + TranslateTimeline.Y] - y) * percent; - } - switch (blend) { - case MixBlend.setup: - bone.x = bone.data.x + x * alpha; - bone.y = bone.data.y + y * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - bone.x += (bone.data.x + x - bone.x) * alpha; - bone.y += (bone.data.y + y - bone.y) * alpha; - break; - case MixBlend.add: - bone.x += x * alpha; - bone.y += y * alpha; - } - }; - TranslateTimeline.ENTRIES = 3; - TranslateTimeline.PREV_TIME = -3; - TranslateTimeline.PREV_X = -2; - TranslateTimeline.PREV_Y = -1; - TranslateTimeline.X = 1; - TranslateTimeline.Y = 2; - return TranslateTimeline; - }(CurveTimeline)); - spine.TranslateTimeline = TranslateTimeline; - var ScaleTimeline = (function (_super) { - __extends(ScaleTimeline, _super); - function ScaleTimeline(frameCount) { - return _super.call(this, frameCount) || this; - } - ScaleTimeline.prototype.getPropertyId = function () { - return (TimelineType.scale << 24) + this.boneIndex; - }; - ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var frames = this.frames; - var bone = skeleton.bones[this.boneIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - bone.scaleX = bone.data.scaleX; - bone.scaleY = bone.data.scaleY; - return; - case MixBlend.first: - bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha; - } - return; - } - var x = 0, y = 0; - if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { - x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX; - y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY; - } - else { - var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES); - x = frames[frame + ScaleTimeline.PREV_X]; - y = frames[frame + ScaleTimeline.PREV_Y]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime)); - x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX; - y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY; - } - if (alpha == 1) { - if (blend == MixBlend.add) { - bone.scaleX += x - bone.data.scaleX; - bone.scaleY += y - bone.data.scaleY; - } - else { - bone.scaleX = x; - bone.scaleY = y; - } - } - else { - var bx = 0, by = 0; - if (direction == MixDirection.out) { - switch (blend) { - case MixBlend.setup: - bx = bone.data.scaleX; - by = bone.data.scaleY; - bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; - bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - bx = bone.scaleX; - by = bone.scaleY; - bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; - bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; - break; - case MixBlend.add: - bx = bone.scaleX; - by = bone.scaleY; - bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha; - bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha; - } - } - else { - switch (blend) { - case MixBlend.setup: - bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x); - by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y); - bone.scaleX = bx + (x - bx) * alpha; - bone.scaleY = by + (y - by) * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x); - by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y); - bone.scaleX = bx + (x - bx) * alpha; - bone.scaleY = by + (y - by) * alpha; - break; - case MixBlend.add: - bx = spine.MathUtils.signum(x); - by = spine.MathUtils.signum(y); - bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha; - bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha; - } - } - } - }; - return ScaleTimeline; - }(TranslateTimeline)); - spine.ScaleTimeline = ScaleTimeline; - var ShearTimeline = (function (_super) { - __extends(ShearTimeline, _super); - function ShearTimeline(frameCount) { - return _super.call(this, frameCount) || this; - } - ShearTimeline.prototype.getPropertyId = function () { - return (TimelineType.shear << 24) + this.boneIndex; - }; - ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var frames = this.frames; - var bone = skeleton.bones[this.boneIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - bone.shearX = bone.data.shearX; - bone.shearY = bone.data.shearY; - return; - case MixBlend.first: - bone.shearX += (bone.data.shearX - bone.shearX) * alpha; - bone.shearY += (bone.data.shearY - bone.shearY) * alpha; - } - return; - } - var x = 0, y = 0; - if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { - x = frames[frames.length + ShearTimeline.PREV_X]; - y = frames[frames.length + ShearTimeline.PREV_Y]; - } - else { - var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES); - x = frames[frame + ShearTimeline.PREV_X]; - y = frames[frame + ShearTimeline.PREV_Y]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime)); - x = x + (frames[frame + ShearTimeline.X] - x) * percent; - y = y + (frames[frame + ShearTimeline.Y] - y) * percent; - } - switch (blend) { - case MixBlend.setup: - bone.shearX = bone.data.shearX + x * alpha; - bone.shearY = bone.data.shearY + y * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha; - bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha; - break; - case MixBlend.add: - bone.shearX += x * alpha; - bone.shearY += y * alpha; - } - }; - return ShearTimeline; - }(TranslateTimeline)); - spine.ShearTimeline = ShearTimeline; - var ColorTimeline = (function (_super) { - __extends(ColorTimeline, _super); - function ColorTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES); - return _this; - } - ColorTimeline.prototype.getPropertyId = function () { - return (TimelineType.color << 24) + this.slotIndex; - }; - ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) { - frameIndex *= ColorTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + ColorTimeline.R] = r; - this.frames[frameIndex + ColorTimeline.G] = g; - this.frames[frameIndex + ColorTimeline.B] = b; - this.frames[frameIndex + ColorTimeline.A] = a; - }; - ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var slot = skeleton.slots[this.slotIndex]; - var frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - slot.color.setFromColor(slot.data.color); - return; - case MixBlend.first: - var color = slot.color, setup = slot.data.color; - color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha); - } - return; - } - var r = 0, g = 0, b = 0, a = 0; - if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { - var i = frames.length; - r = frames[i + ColorTimeline.PREV_R]; - g = frames[i + ColorTimeline.PREV_G]; - b = frames[i + ColorTimeline.PREV_B]; - a = frames[i + ColorTimeline.PREV_A]; - } - else { - var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES); - r = frames[frame + ColorTimeline.PREV_R]; - g = frames[frame + ColorTimeline.PREV_G]; - b = frames[frame + ColorTimeline.PREV_B]; - a = frames[frame + ColorTimeline.PREV_A]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime)); - r += (frames[frame + ColorTimeline.R] - r) * percent; - g += (frames[frame + ColorTimeline.G] - g) * percent; - b += (frames[frame + ColorTimeline.B] - b) * percent; - a += (frames[frame + ColorTimeline.A] - a) * percent; - } - if (alpha == 1) - slot.color.set(r, g, b, a); - else { - var color = slot.color; - if (blend == MixBlend.setup) - color.setFromColor(slot.data.color); - color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); - } - }; - ColorTimeline.ENTRIES = 5; - ColorTimeline.PREV_TIME = -5; - ColorTimeline.PREV_R = -4; - ColorTimeline.PREV_G = -3; - ColorTimeline.PREV_B = -2; - ColorTimeline.PREV_A = -1; - ColorTimeline.R = 1; - ColorTimeline.G = 2; - ColorTimeline.B = 3; - ColorTimeline.A = 4; - return ColorTimeline; - }(CurveTimeline)); - spine.ColorTimeline = ColorTimeline; - var TwoColorTimeline = (function (_super) { - __extends(TwoColorTimeline, _super); - function TwoColorTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES); - return _this; - } - TwoColorTimeline.prototype.getPropertyId = function () { - return (TimelineType.twoColor << 24) + this.slotIndex; - }; - TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) { - frameIndex *= TwoColorTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + TwoColorTimeline.R] = r; - this.frames[frameIndex + TwoColorTimeline.G] = g; - this.frames[frameIndex + TwoColorTimeline.B] = b; - this.frames[frameIndex + TwoColorTimeline.A] = a; - this.frames[frameIndex + TwoColorTimeline.R2] = r2; - this.frames[frameIndex + TwoColorTimeline.G2] = g2; - this.frames[frameIndex + TwoColorTimeline.B2] = b2; - }; - TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var slot = skeleton.slots[this.slotIndex]; - var frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - slot.color.setFromColor(slot.data.color); - slot.darkColor.setFromColor(slot.data.darkColor); - return; - case MixBlend.first: - var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor; - light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha); - dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0); - } - return; - } - var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; - if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { - var i = frames.length; - r = frames[i + TwoColorTimeline.PREV_R]; - g = frames[i + TwoColorTimeline.PREV_G]; - b = frames[i + TwoColorTimeline.PREV_B]; - a = frames[i + TwoColorTimeline.PREV_A]; - r2 = frames[i + TwoColorTimeline.PREV_R2]; - g2 = frames[i + TwoColorTimeline.PREV_G2]; - b2 = frames[i + TwoColorTimeline.PREV_B2]; - } - else { - var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES); - r = frames[frame + TwoColorTimeline.PREV_R]; - g = frames[frame + TwoColorTimeline.PREV_G]; - b = frames[frame + TwoColorTimeline.PREV_B]; - a = frames[frame + TwoColorTimeline.PREV_A]; - r2 = frames[frame + TwoColorTimeline.PREV_R2]; - g2 = frames[frame + TwoColorTimeline.PREV_G2]; - b2 = frames[frame + TwoColorTimeline.PREV_B2]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime)); - r += (frames[frame + TwoColorTimeline.R] - r) * percent; - g += (frames[frame + TwoColorTimeline.G] - g) * percent; - b += (frames[frame + TwoColorTimeline.B] - b) * percent; - a += (frames[frame + TwoColorTimeline.A] - a) * percent; - r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent; - g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent; - b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent; - } - if (alpha == 1) { - slot.color.set(r, g, b, a); - slot.darkColor.set(r2, g2, b2, 1); - } - else { - var light = slot.color, dark = slot.darkColor; - if (blend == MixBlend.setup) { - light.setFromColor(slot.data.color); - dark.setFromColor(slot.data.darkColor); - } - light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); - dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0); - } - }; - TwoColorTimeline.ENTRIES = 8; - TwoColorTimeline.PREV_TIME = -8; - TwoColorTimeline.PREV_R = -7; - TwoColorTimeline.PREV_G = -6; - TwoColorTimeline.PREV_B = -5; - TwoColorTimeline.PREV_A = -4; - TwoColorTimeline.PREV_R2 = -3; - TwoColorTimeline.PREV_G2 = -2; - TwoColorTimeline.PREV_B2 = -1; - TwoColorTimeline.R = 1; - TwoColorTimeline.G = 2; - TwoColorTimeline.B = 3; - TwoColorTimeline.A = 4; - TwoColorTimeline.R2 = 5; - TwoColorTimeline.G2 = 6; - TwoColorTimeline.B2 = 7; - return TwoColorTimeline; - }(CurveTimeline)); - spine.TwoColorTimeline = TwoColorTimeline; - var AttachmentTimeline = (function () { - function AttachmentTimeline(frameCount) { - this.frames = spine.Utils.newFloatArray(frameCount); - this.attachmentNames = new Array(frameCount); - } - AttachmentTimeline.prototype.getPropertyId = function () { - return (TimelineType.attachment << 24) + this.slotIndex; - }; - AttachmentTimeline.prototype.getFrameCount = function () { - return this.frames.length; - }; - AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) { - this.frames[frameIndex] = time; - this.attachmentNames[frameIndex] = attachmentName; - }; - AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var slot = skeleton.slots[this.slotIndex]; - if (direction == MixDirection.out && blend == MixBlend.setup) { - var attachmentName_1 = slot.data.attachmentName; - slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1)); - return; - } - var frames = this.frames; - if (time < frames[0]) { - if (blend == MixBlend.setup || blend == MixBlend.first) { - var attachmentName_2 = slot.data.attachmentName; - slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2)); - } - return; - } - var frameIndex = 0; - if (time >= frames[frames.length - 1]) - frameIndex = frames.length - 1; - else - frameIndex = Animation.binarySearch(frames, time, 1) - 1; - var attachmentName = this.attachmentNames[frameIndex]; - skeleton.slots[this.slotIndex] - .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); - }; - return AttachmentTimeline; - }()); - spine.AttachmentTimeline = AttachmentTimeline; - var zeros = null; - var DeformTimeline = (function (_super) { - __extends(DeformTimeline, _super); - function DeformTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount); - _this.frameVertices = new Array(frameCount); - if (zeros == null) - zeros = spine.Utils.newFloatArray(64); - return _this; - } - DeformTimeline.prototype.getPropertyId = function () { - return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex; - }; - DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) { - this.frames[frameIndex] = time; - this.frameVertices[frameIndex] = vertices; - }; - DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var slot = skeleton.slots[this.slotIndex]; - var slotAttachment = slot.getAttachment(); - if (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment)) - return; - var verticesArray = slot.attachmentVertices; - if (verticesArray.length == 0) - blend = MixBlend.setup; - var frameVertices = this.frameVertices; - var vertexCount = frameVertices[0].length; - var frames = this.frames; - if (time < frames[0]) { - var vertexAttachment = slotAttachment; - switch (blend) { - case MixBlend.setup: - verticesArray.length = 0; - return; - case MixBlend.first: - if (alpha == 1) { - verticesArray.length = 0; - break; - } - var vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount); - if (vertexAttachment.bones == null) { - var setupVertices = vertexAttachment.vertices; - for (var i = 0; i < vertexCount; i++) - vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha; - } - else { - alpha = 1 - alpha; - for (var i = 0; i < vertexCount; i++) - vertices_1[i] *= alpha; - } - } - return; - } - var vertices = spine.Utils.setArraySize(verticesArray, vertexCount); - if (time >= frames[frames.length - 1]) { - var lastVertices = frameVertices[frames.length - 1]; - if (alpha == 1) { - if (blend == MixBlend.add) { - var vertexAttachment = slotAttachment; - if (vertexAttachment.bones == null) { - var setupVertices = vertexAttachment.vertices; - for (var i_1 = 0; i_1 < vertexCount; i_1++) { - vertices[i_1] += lastVertices[i_1] - setupVertices[i_1]; - } - } - else { - for (var i_2 = 0; i_2 < vertexCount; i_2++) - vertices[i_2] += lastVertices[i_2]; - } - } - else { - spine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount); - } - } - else { - switch (blend) { - case MixBlend.setup: { - var vertexAttachment_1 = slotAttachment; - if (vertexAttachment_1.bones == null) { - var setupVertices = vertexAttachment_1.vertices; - for (var i_3 = 0; i_3 < vertexCount; i_3++) { - var setup = setupVertices[i_3]; - vertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha; - } - } - else { - for (var i_4 = 0; i_4 < vertexCount; i_4++) - vertices[i_4] = lastVertices[i_4] * alpha; - } - break; - } - case MixBlend.first: - case MixBlend.replace: - for (var i_5 = 0; i_5 < vertexCount; i_5++) - vertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha; - case MixBlend.add: - var vertexAttachment = slotAttachment; - if (vertexAttachment.bones == null) { - var setupVertices = vertexAttachment.vertices; - for (var i_6 = 0; i_6 < vertexCount; i_6++) { - vertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha; - } - } - else { - for (var i_7 = 0; i_7 < vertexCount; i_7++) - vertices[i_7] += lastVertices[i_7] * alpha; - } - } - } - return; - } - var frame = Animation.binarySearch(frames, time); - var prevVertices = frameVertices[frame - 1]; - var nextVertices = frameVertices[frame]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime)); - if (alpha == 1) { - if (blend == MixBlend.add) { - var vertexAttachment = slotAttachment; - if (vertexAttachment.bones == null) { - var setupVertices = vertexAttachment.vertices; - for (var i_8 = 0; i_8 < vertexCount; i_8++) { - var prev = prevVertices[i_8]; - vertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8]; - } - } - else { - for (var i_9 = 0; i_9 < vertexCount; i_9++) { - var prev = prevVertices[i_9]; - vertices[i_9] += prev + (nextVertices[i_9] - prev) * percent; - } - } - } - else { - for (var i_10 = 0; i_10 < vertexCount; i_10++) { - var prev = prevVertices[i_10]; - vertices[i_10] = prev + (nextVertices[i_10] - prev) * percent; - } - } - } - else { - switch (blend) { - case MixBlend.setup: { - var vertexAttachment_2 = slotAttachment; - if (vertexAttachment_2.bones == null) { - var setupVertices = vertexAttachment_2.vertices; - for (var i_11 = 0; i_11 < vertexCount; i_11++) { - var prev = prevVertices[i_11], setup = setupVertices[i_11]; - vertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha; - } - } - else { - for (var i_12 = 0; i_12 < vertexCount; i_12++) { - var prev = prevVertices[i_12]; - vertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha; - } - } - break; - } - case MixBlend.first: - case MixBlend.replace: - for (var i_13 = 0; i_13 < vertexCount; i_13++) { - var prev = prevVertices[i_13]; - vertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha; - } - break; - case MixBlend.add: - var vertexAttachment = slotAttachment; - if (vertexAttachment.bones == null) { - var setupVertices = vertexAttachment.vertices; - for (var i_14 = 0; i_14 < vertexCount; i_14++) { - var prev = prevVertices[i_14]; - vertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha; - } - } - else { - for (var i_15 = 0; i_15 < vertexCount; i_15++) { - var prev = prevVertices[i_15]; - vertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha; - } - } - } - } - }; - return DeformTimeline; - }(CurveTimeline)); - spine.DeformTimeline = DeformTimeline; - var EventTimeline = (function () { - function EventTimeline(frameCount) { - this.frames = spine.Utils.newFloatArray(frameCount); - this.events = new Array(frameCount); - } - EventTimeline.prototype.getPropertyId = function () { - return TimelineType.event << 24; - }; - EventTimeline.prototype.getFrameCount = function () { - return this.frames.length; - }; - EventTimeline.prototype.setFrame = function (frameIndex, event) { - this.frames[frameIndex] = event.time; - this.events[frameIndex] = event; - }; - EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - if (firedEvents == null) - return; - var frames = this.frames; - var frameCount = this.frames.length; - if (lastTime > time) { - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction); - lastTime = -1; - } - else if (lastTime >= frames[frameCount - 1]) - return; - if (time < frames[0]) - return; - var frame = 0; - if (lastTime < frames[0]) - frame = 0; - else { - frame = Animation.binarySearch(frames, lastTime); - var frameTime = frames[frame]; - while (frame > 0) { - if (frames[frame - 1] != frameTime) - break; - frame--; - } - } - for (; frame < frameCount && time >= frames[frame]; frame++) - firedEvents.push(this.events[frame]); - }; - return EventTimeline; - }()); - spine.EventTimeline = EventTimeline; - var DrawOrderTimeline = (function () { - function DrawOrderTimeline(frameCount) { - this.frames = spine.Utils.newFloatArray(frameCount); - this.drawOrders = new Array(frameCount); - } - DrawOrderTimeline.prototype.getPropertyId = function () { - return TimelineType.drawOrder << 24; - }; - DrawOrderTimeline.prototype.getFrameCount = function () { - return this.frames.length; - }; - DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) { - this.frames[frameIndex] = time; - this.drawOrders[frameIndex] = drawOrder; - }; - DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var drawOrder = skeleton.drawOrder; - var slots = skeleton.slots; - if (direction == MixDirection.out && blend == MixBlend.setup) { - spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - return; - } - var frames = this.frames; - if (time < frames[0]) { - if (blend == MixBlend.setup || blend == MixBlend.first) - spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - return; - } - var frame = 0; - if (time >= frames[frames.length - 1]) - frame = frames.length - 1; - else - frame = Animation.binarySearch(frames, time) - 1; - var drawOrderToSetupIndex = this.drawOrders[frame]; - if (drawOrderToSetupIndex == null) - spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length); - else { - for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = slots[drawOrderToSetupIndex[i]]; - } - }; - return DrawOrderTimeline; - }()); - spine.DrawOrderTimeline = DrawOrderTimeline; - var IkConstraintTimeline = (function (_super) { - __extends(IkConstraintTimeline, _super); - function IkConstraintTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES); - return _this; - } - IkConstraintTimeline.prototype.getPropertyId = function () { - return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex; - }; - IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) { - frameIndex *= IkConstraintTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + IkConstraintTimeline.MIX] = mix; - this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection; - this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0; - this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0; - }; - IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var frames = this.frames; - var constraint = skeleton.ikConstraints[this.ikConstraintIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - constraint.mix = constraint.data.mix; - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - return; - case MixBlend.first: - constraint.mix += (constraint.data.mix - constraint.mix) * alpha; - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } - return; - } - if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { - if (blend == MixBlend.setup) { - constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha; - if (direction == MixDirection.out) { - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } - else { - constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; - constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; - constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; - } - } - else { - constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha; - if (direction == MixDirection["in"]) { - constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; - constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; - constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; - } - } - return; - } - var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES); - var mix = frames[frame + IkConstraintTimeline.PREV_MIX]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime)); - if (blend == MixBlend.setup) { - constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha; - if (direction == MixDirection.out) { - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } - else { - constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; - constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; - constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; - } - } - else { - constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha; - if (direction == MixDirection["in"]) { - constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; - constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; - constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; - } - } - }; - IkConstraintTimeline.ENTRIES = 5; - IkConstraintTimeline.PREV_TIME = -5; - IkConstraintTimeline.PREV_MIX = -4; - IkConstraintTimeline.PREV_BEND_DIRECTION = -3; - IkConstraintTimeline.PREV_COMPRESS = -2; - IkConstraintTimeline.PREV_STRETCH = -1; - IkConstraintTimeline.MIX = 1; - IkConstraintTimeline.BEND_DIRECTION = 2; - IkConstraintTimeline.COMPRESS = 3; - IkConstraintTimeline.STRETCH = 4; - return IkConstraintTimeline; - }(CurveTimeline)); - spine.IkConstraintTimeline = IkConstraintTimeline; - var TransformConstraintTimeline = (function (_super) { - __extends(TransformConstraintTimeline, _super); - function TransformConstraintTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES); - return _this; - } - TransformConstraintTimeline.prototype.getPropertyId = function () { - return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex; - }; - TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) { - frameIndex *= TransformConstraintTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix; - this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix; - this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix; - this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix; - }; - TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var frames = this.frames; - var constraint = skeleton.transformConstraints[this.transformConstraintIndex]; - if (time < frames[0]) { - var data = constraint.data; - switch (blend) { - case MixBlend.setup: - constraint.rotateMix = data.rotateMix; - constraint.translateMix = data.translateMix; - constraint.scaleMix = data.scaleMix; - constraint.shearMix = data.shearMix; - return; - case MixBlend.first: - constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha; - constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha; - constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha; - constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha; - } - return; - } - var rotate = 0, translate = 0, scale = 0, shear = 0; - if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { - var i = frames.length; - rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE]; - translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE]; - scale = frames[i + TransformConstraintTimeline.PREV_SCALE]; - shear = frames[i + TransformConstraintTimeline.PREV_SHEAR]; - } - else { - var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES); - rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE]; - translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE]; - scale = frames[frame + TransformConstraintTimeline.PREV_SCALE]; - shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime)); - rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent; - translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent; - scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent; - shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent; - } - if (blend == MixBlend.setup) { - var data = constraint.data; - constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha; - constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha; - constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha; - constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha; - } - else { - constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; - constraint.translateMix += (translate - constraint.translateMix) * alpha; - constraint.scaleMix += (scale - constraint.scaleMix) * alpha; - constraint.shearMix += (shear - constraint.shearMix) * alpha; - } - }; - TransformConstraintTimeline.ENTRIES = 5; - TransformConstraintTimeline.PREV_TIME = -5; - TransformConstraintTimeline.PREV_ROTATE = -4; - TransformConstraintTimeline.PREV_TRANSLATE = -3; - TransformConstraintTimeline.PREV_SCALE = -2; - TransformConstraintTimeline.PREV_SHEAR = -1; - TransformConstraintTimeline.ROTATE = 1; - TransformConstraintTimeline.TRANSLATE = 2; - TransformConstraintTimeline.SCALE = 3; - TransformConstraintTimeline.SHEAR = 4; - return TransformConstraintTimeline; - }(CurveTimeline)); - spine.TransformConstraintTimeline = TransformConstraintTimeline; - var PathConstraintPositionTimeline = (function (_super) { - __extends(PathConstraintPositionTimeline, _super); - function PathConstraintPositionTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES); - return _this; - } - PathConstraintPositionTimeline.prototype.getPropertyId = function () { - return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex; - }; - PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) { - frameIndex *= PathConstraintPositionTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value; - }; - PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var frames = this.frames; - var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - constraint.position = constraint.data.position; - return; - case MixBlend.first: - constraint.position += (constraint.data.position - constraint.position) * alpha; - } - return; - } - var position = 0; - if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) - position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE]; - else { - var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES); - position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime)); - position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent; - } - if (blend == MixBlend.setup) - constraint.position = constraint.data.position + (position - constraint.data.position) * alpha; - else - constraint.position += (position - constraint.position) * alpha; - }; - PathConstraintPositionTimeline.ENTRIES = 2; - PathConstraintPositionTimeline.PREV_TIME = -2; - PathConstraintPositionTimeline.PREV_VALUE = -1; - PathConstraintPositionTimeline.VALUE = 1; - return PathConstraintPositionTimeline; - }(CurveTimeline)); - spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline; - var PathConstraintSpacingTimeline = (function (_super) { - __extends(PathConstraintSpacingTimeline, _super); - function PathConstraintSpacingTimeline(frameCount) { - return _super.call(this, frameCount) || this; - } - PathConstraintSpacingTimeline.prototype.getPropertyId = function () { - return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex; - }; - PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var frames = this.frames; - var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - constraint.spacing = constraint.data.spacing; - return; - case MixBlend.first: - constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha; - } - return; - } - var spacing = 0; - if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) - spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE]; - else { - var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES); - spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime)); - spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent; - } - if (blend == MixBlend.setup) - constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha; - else - constraint.spacing += (spacing - constraint.spacing) * alpha; - }; - return PathConstraintSpacingTimeline; - }(PathConstraintPositionTimeline)); - spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline; - var PathConstraintMixTimeline = (function (_super) { - __extends(PathConstraintMixTimeline, _super); - function PathConstraintMixTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES); - return _this; - } - PathConstraintMixTimeline.prototype.getPropertyId = function () { - return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex; - }; - PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) { - frameIndex *= PathConstraintMixTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix; - this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix; - }; - PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var frames = this.frames; - var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - constraint.rotateMix = constraint.data.rotateMix; - constraint.translateMix = constraint.data.translateMix; - return; - case MixBlend.first: - constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha; - constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha; - } - return; - } - var rotate = 0, translate = 0; - if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { - rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE]; - translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE]; - } - else { - var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES); - rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE]; - translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime)); - rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent; - translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent; - } - if (blend == MixBlend.setup) { - constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha; - constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha; - } - else { - constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; - constraint.translateMix += (translate - constraint.translateMix) * alpha; - } - }; - PathConstraintMixTimeline.ENTRIES = 3; - PathConstraintMixTimeline.PREV_TIME = -3; - PathConstraintMixTimeline.PREV_ROTATE = -2; - PathConstraintMixTimeline.PREV_TRANSLATE = -1; - PathConstraintMixTimeline.ROTATE = 1; - PathConstraintMixTimeline.TRANSLATE = 2; - return PathConstraintMixTimeline; - }(CurveTimeline)); - spine.PathConstraintMixTimeline = PathConstraintMixTimeline; -})(spine || (spine = {})); -var spine; -(function (spine) { - var AnimationState = (function () { - function AnimationState(data) { - this.tracks = new Array(); - this.events = new Array(); - this.listeners = new Array(); - this.queue = new EventQueue(this); - this.propertyIDs = new spine.IntSet(); - this.animationsChanged = false; - this.timeScale = 1; - this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); }); - this.data = data; - } - AnimationState.prototype.update = function (delta) { - delta *= this.timeScale; - var tracks = this.tracks; - for (var i = 0, n = tracks.length; i < n; i++) { - var current = tracks[i]; - if (current == null) - continue; - current.animationLast = current.nextAnimationLast; - current.trackLast = current.nextTrackLast; - var currentDelta = delta * current.timeScale; - if (current.delay > 0) { - current.delay -= currentDelta; - if (current.delay > 0) - continue; - currentDelta = -current.delay; - current.delay = 0; - } - var next = current.next; - if (next != null) { - var nextTime = current.trackLast - next.delay; - if (nextTime >= 0) { - next.delay = 0; - next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; - current.trackTime += currentDelta; - this.setCurrent(i, next, true); - while (next.mixingFrom != null) { - next.mixTime += delta; - next = next.mixingFrom; - } - continue; - } - } - else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) { - tracks[i] = null; - this.queue.end(current); - this.disposeNext(current); - continue; - } - if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) { - var from = current.mixingFrom; - current.mixingFrom = null; - if (from != null) - from.mixingTo = null; - while (from != null) { - this.queue.end(from); - from = from.mixingFrom; - } - } - current.trackTime += currentDelta; - } - this.queue.drain(); - }; - AnimationState.prototype.updateMixingFrom = function (to, delta) { - var from = to.mixingFrom; - if (from == null) - return true; - var finished = this.updateMixingFrom(from, delta); - from.animationLast = from.nextAnimationLast; - from.trackLast = from.nextTrackLast; - if (to.mixTime > 0 && to.mixTime >= to.mixDuration) { - if (from.totalAlpha == 0 || to.mixDuration == 0) { - to.mixingFrom = from.mixingFrom; - if (from.mixingFrom != null) - from.mixingFrom.mixingTo = to; - to.interruptAlpha = from.interruptAlpha; - this.queue.end(from); - } - return finished; - } - from.trackTime += delta * from.timeScale; - to.mixTime += delta; - return false; - }; - AnimationState.prototype.apply = function (skeleton) { - if (skeleton == null) - throw new Error("skeleton cannot be null."); - if (this.animationsChanged) - this._animationsChanged(); - var events = this.events; - var tracks = this.tracks; - var applied = false; - for (var i = 0, n = tracks.length; i < n; i++) { - var current = tracks[i]; - if (current == null || current.delay > 0) - continue; - applied = true; - var blend = i == 0 ? spine.MixBlend.first : current.mixBlend; - var mix = current.alpha; - if (current.mixingFrom != null) - mix *= this.applyMixingFrom(current, skeleton, blend); - else if (current.trackTime >= current.trackEnd && current.next == null) - mix = 0; - var animationLast = current.animationLast, animationTime = current.getAnimationTime(); - var timelineCount = current.animation.timelines.length; - var timelines = current.animation.timelines; - if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) { - for (var ii = 0; ii < timelineCount; ii++) - timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]); - } - else { - var timelineMode = current.timelineMode; - var firstFrame = current.timelinesRotation.length == 0; - if (firstFrame) - spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null); - var timelinesRotation = current.timelinesRotation; - for (var ii = 0; ii < timelineCount; ii++) { - var timeline = timelines[ii]; - var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup; - if (timeline instanceof spine.RotateTimeline) { - this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame); - } - else { - spine.Utils.webkit602BugfixHelper(mix, blend); - timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]); - } - } - } - this.queueEvents(current, animationTime); - events.length = 0; - current.nextAnimationLast = animationTime; - current.nextTrackLast = current.trackTime; - } - this.queue.drain(); - return applied; - }; - AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) { - var from = to.mixingFrom; - if (from.mixingFrom != null) - this.applyMixingFrom(from, skeleton, blend); - var mix = 0; - if (to.mixDuration == 0) { - mix = 1; - if (blend == spine.MixBlend.first) - blend = spine.MixBlend.setup; - } - else { - mix = to.mixTime / to.mixDuration; - if (mix > 1) - mix = 1; - if (blend != spine.MixBlend.first) - blend = from.mixBlend; - } - var events = mix < from.eventThreshold ? this.events : null; - var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold; - var animationLast = from.animationLast, animationTime = from.getAnimationTime(); - var timelineCount = from.animation.timelines.length; - var timelines = from.animation.timelines; - var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); - if (blend == spine.MixBlend.add) { - for (var i = 0; i < timelineCount; i++) - timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out); - } - else { - var timelineMode = from.timelineMode; - var timelineHoldMix = from.timelineHoldMix; - var firstFrame = from.timelinesRotation.length == 0; - if (firstFrame) - spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null); - var timelinesRotation = from.timelinesRotation; - from.totalAlpha = 0; - for (var i = 0; i < timelineCount; i++) { - var timeline = timelines[i]; - var direction = spine.MixDirection.out; - var timelineBlend = void 0; - var alpha = 0; - switch (timelineMode[i]) { - case AnimationState.SUBSEQUENT: - if (!attachments && timeline instanceof spine.AttachmentTimeline) - continue; - if (!drawOrder && timeline instanceof spine.DrawOrderTimeline) - continue; - timelineBlend = blend; - alpha = alphaMix; - break; - case AnimationState.FIRST: - timelineBlend = spine.MixBlend.setup; - alpha = alphaMix; - break; - case AnimationState.HOLD: - timelineBlend = spine.MixBlend.setup; - alpha = alphaHold; - break; - default: - timelineBlend = spine.MixBlend.setup; - var holdMix = timelineHoldMix[i]; - alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); - break; - } - from.totalAlpha += alpha; - if (timeline instanceof spine.RotateTimeline) - this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame); - else { - spine.Utils.webkit602BugfixHelper(alpha, blend); - if (timelineBlend == spine.MixBlend.setup) { - if (timeline instanceof spine.AttachmentTimeline) { - if (attachments) - direction = spine.MixDirection.out; - } - else if (timeline instanceof spine.DrawOrderTimeline) { - if (drawOrder) - direction = spine.MixDirection.out; - } - } - timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction); - } - } - } - if (to.mixDuration > 0) - this.queueEvents(from, animationTime); - this.events.length = 0; - from.nextAnimationLast = animationTime; - from.nextTrackLast = from.trackTime; - return mix; - }; - AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { - if (firstFrame) - timelinesRotation[i] = 0; - if (alpha == 1) { - timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]); - return; - } - var rotateTimeline = timeline; - var frames = rotateTimeline.frames; - var bone = skeleton.bones[rotateTimeline.boneIndex]; - var r1 = 0, r2 = 0; - if (time < frames[0]) { - switch (blend) { - case spine.MixBlend.setup: - bone.rotation = bone.data.rotation; - default: - return; - case spine.MixBlend.first: - r1 = bone.rotation; - r2 = bone.data.rotation; - } - } - else { - r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation; - if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES]) - r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION]; - else { - var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES); - var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION]; - var frameTime = frames[frame]; - var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime)); - r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation; - r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; - r2 = prevRotation + r2 * percent + bone.data.rotation; - r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; - } - } - var total = 0, diff = r2 - r1; - diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360; - if (diff == 0) { - total = timelinesRotation[i]; - } - else { - var lastTotal = 0, lastDiff = 0; - if (firstFrame) { - lastTotal = 0; - lastDiff = diff; - } - else { - lastTotal = timelinesRotation[i]; - lastDiff = timelinesRotation[i + 1]; - } - var current = diff > 0, dir = lastTotal >= 0; - if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) { - if (Math.abs(lastTotal) > 180) - lastTotal += 360 * spine.MathUtils.signum(lastTotal); - dir = current; - } - total = diff + lastTotal - lastTotal % 360; - if (dir != current) - total += 360 * spine.MathUtils.signum(lastTotal); - timelinesRotation[i] = total; - } - timelinesRotation[i + 1] = diff; - r1 += total * alpha; - bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360; - }; - AnimationState.prototype.queueEvents = function (entry, animationTime) { - var animationStart = entry.animationStart, animationEnd = entry.animationEnd; - var duration = animationEnd - animationStart; - var trackLastWrapped = entry.trackLast % duration; - var events = this.events; - var i = 0, n = events.length; - for (; i < n; i++) { - var event_1 = events[i]; - if (event_1.time < trackLastWrapped) - break; - if (event_1.time > animationEnd) - continue; - this.queue.event(entry, event_1); - } - var complete = false; - if (entry.loop) - complete = duration == 0 || trackLastWrapped > entry.trackTime % duration; - else - complete = animationTime >= animationEnd && entry.animationLast < animationEnd; - if (complete) - this.queue.complete(entry); - for (; i < n; i++) { - var event_2 = events[i]; - if (event_2.time < animationStart) - continue; - this.queue.event(entry, events[i]); - } - }; - AnimationState.prototype.clearTracks = function () { - var oldDrainDisabled = this.queue.drainDisabled; - this.queue.drainDisabled = true; - for (var i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - this.queue.drainDisabled = oldDrainDisabled; - this.queue.drain(); - }; - AnimationState.prototype.clearTrack = function (trackIndex) { - if (trackIndex >= this.tracks.length) - return; - var current = this.tracks[trackIndex]; - if (current == null) - return; - this.queue.end(current); - this.disposeNext(current); - var entry = current; - while (true) { - var from = entry.mixingFrom; - if (from == null) - break; - this.queue.end(from); - entry.mixingFrom = null; - entry.mixingTo = null; - entry = from; - } - this.tracks[current.trackIndex] = null; - this.queue.drain(); - }; - AnimationState.prototype.setCurrent = function (index, current, interrupt) { - var from = this.expandToIndex(index); - this.tracks[index] = current; - if (from != null) { - if (interrupt) - this.queue.interrupt(from); - current.mixingFrom = from; - from.mixingTo = current; - current.mixTime = 0; - if (from.mixingFrom != null && from.mixDuration > 0) - current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); - from.timelinesRotation.length = 0; - } - this.queue.start(current); - }; - AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (animation == null) - throw new Error("Animation not found: " + animationName); - return this.setAnimationWith(trackIndex, animation, loop); - }; - AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) { - if (animation == null) - throw new Error("animation cannot be null."); - var interrupt = true; - var current = this.expandToIndex(trackIndex); - if (current != null) { - if (current.nextTrackLast == -1) { - this.tracks[trackIndex] = current.mixingFrom; - this.queue.interrupt(current); - this.queue.end(current); - this.disposeNext(current); - current = current.mixingFrom; - interrupt = false; - } - else - this.disposeNext(current); - } - var entry = this.trackEntry(trackIndex, animation, loop, current); - this.setCurrent(trackIndex, entry, interrupt); - this.queue.drain(); - return entry; - }; - AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (animation == null) - throw new Error("Animation not found: " + animationName); - return this.addAnimationWith(trackIndex, animation, loop, delay); - }; - AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) { - if (animation == null) - throw new Error("animation cannot be null."); - var last = this.expandToIndex(trackIndex); - if (last != null) { - while (last.next != null) - last = last.next; - } - var entry = this.trackEntry(trackIndex, animation, loop, last); - if (last == null) { - this.setCurrent(trackIndex, entry, true); - this.queue.drain(); - } - else { - last.next = entry; - if (delay <= 0) { - var duration = last.animationEnd - last.animationStart; - if (duration != 0) { - if (last.loop) - delay += duration * (1 + ((last.trackTime / duration) | 0)); - else - delay += Math.max(duration, last.trackTime); - delay -= this.data.getMix(last.animation, animation); - } - else - delay = last.trackTime; - } - } - entry.delay = delay; - return entry; - }; - AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) { - var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false); - entry.mixDuration = mixDuration; - entry.trackEnd = mixDuration; - return entry; - }; - AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) { - if (delay <= 0) - delay -= mixDuration; - var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay); - entry.mixDuration = mixDuration; - entry.trackEnd = mixDuration; - return entry; - }; - AnimationState.prototype.setEmptyAnimations = function (mixDuration) { - var oldDrainDisabled = this.queue.drainDisabled; - this.queue.drainDisabled = true; - for (var i = 0, n = this.tracks.length; i < n; i++) { - var current = this.tracks[i]; - if (current != null) - this.setEmptyAnimation(current.trackIndex, mixDuration); - } - this.queue.drainDisabled = oldDrainDisabled; - this.queue.drain(); - }; - AnimationState.prototype.expandToIndex = function (index) { - if (index < this.tracks.length) - return this.tracks[index]; - spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null); - this.tracks.length = index + 1; - return null; - }; - AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) { - var entry = this.trackEntryPool.obtain(); - entry.trackIndex = trackIndex; - entry.animation = animation; - entry.loop = loop; - entry.holdPrevious = false; - entry.eventThreshold = 0; - entry.attachmentThreshold = 0; - entry.drawOrderThreshold = 0; - entry.animationStart = 0; - entry.animationEnd = animation.duration; - entry.animationLast = -1; - entry.nextAnimationLast = -1; - entry.delay = 0; - entry.trackTime = 0; - entry.trackLast = -1; - entry.nextTrackLast = -1; - entry.trackEnd = Number.MAX_VALUE; - entry.timeScale = 1; - entry.alpha = 1; - entry.interruptAlpha = 1; - entry.mixTime = 0; - entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); - return entry; - }; - AnimationState.prototype.disposeNext = function (entry) { - var next = entry.next; - while (next != null) { - this.queue.dispose(next); - next = next.next; - } - entry.next = null; - }; - AnimationState.prototype._animationsChanged = function () { - this.animationsChanged = false; - this.propertyIDs.clear(); - for (var i = 0, n = this.tracks.length; i < n; i++) { - var entry = this.tracks[i]; - if (entry == null) - continue; - while (entry.mixingFrom != null) - entry = entry.mixingFrom; - do { - if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add) - this.setTimelineModes(entry); - entry = entry.mixingTo; - } while (entry != null); - } - }; - AnimationState.prototype.setTimelineModes = function (entry) { - var to = entry.mixingTo; - var timelines = entry.animation.timelines; - var timelinesCount = entry.animation.timelines.length; - var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount); - entry.timelineHoldMix.length = 0; - var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount); - var propertyIDs = this.propertyIDs; - if (to != null && to.holdPrevious) { - for (var i = 0; i < timelinesCount; i++) { - propertyIDs.add(timelines[i].getPropertyId()); - timelineMode[i] = AnimationState.HOLD; - } - return; - } - outer: for (var i = 0; i < timelinesCount; i++) { - var id = timelines[i].getPropertyId(); - if (!propertyIDs.add(id)) - timelineMode[i] = AnimationState.SUBSEQUENT; - else if (to == null || !this.hasTimeline(to, id)) - timelineMode[i] = AnimationState.FIRST; - else { - for (var next = to.mixingTo; next != null; next = next.mixingTo) { - if (this.hasTimeline(next, id)) - continue; - if (entry.mixDuration > 0) { - timelineMode[i] = AnimationState.HOLD_MIX; - timelineDipMix[i] = next; - continue outer; - } - break; - } - timelineMode[i] = AnimationState.HOLD; - } - } - }; - AnimationState.prototype.hasTimeline = function (entry, id) { - var timelines = entry.animation.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - if (timelines[i].getPropertyId() == id) - return true; - return false; - }; - AnimationState.prototype.getCurrent = function (trackIndex) { - if (trackIndex >= this.tracks.length) - return null; - return this.tracks[trackIndex]; - }; - AnimationState.prototype.addListener = function (listener) { - if (listener == null) - throw new Error("listener cannot be null."); - this.listeners.push(listener); - }; - AnimationState.prototype.removeListener = function (listener) { - var index = this.listeners.indexOf(listener); - if (index >= 0) - this.listeners.splice(index, 1); - }; - AnimationState.prototype.clearListeners = function () { - this.listeners.length = 0; - }; - AnimationState.prototype.clearListenerNotifications = function () { - this.queue.clear(); - }; - AnimationState.emptyAnimation = new spine.Animation("", [], 0); - AnimationState.SUBSEQUENT = 0; - AnimationState.FIRST = 1; - AnimationState.HOLD = 2; - AnimationState.HOLD_MIX = 3; - return AnimationState; - }()); - spine.AnimationState = AnimationState; - var TrackEntry = (function () { - function TrackEntry() { - this.mixBlend = spine.MixBlend.replace; - this.timelineMode = new Array(); - this.timelineHoldMix = new Array(); - this.timelinesRotation = new Array(); - } - TrackEntry.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; - }; - TrackEntry.prototype.getAnimationTime = function () { - if (this.loop) { - var duration = this.animationEnd - this.animationStart; - if (duration == 0) - return this.animationStart; - return (this.trackTime % duration) + this.animationStart; - } - return Math.min(this.trackTime + this.animationStart, this.animationEnd); - }; - TrackEntry.prototype.setAnimationLast = function (animationLast) { - this.animationLast = animationLast; - this.nextAnimationLast = animationLast; - }; - TrackEntry.prototype.isComplete = function () { - return this.trackTime >= this.animationEnd - this.animationStart; - }; - TrackEntry.prototype.resetRotationDirections = function () { - this.timelinesRotation.length = 0; - }; - return TrackEntry; - }()); - spine.TrackEntry = TrackEntry; - var EventQueue = (function () { - function EventQueue(animState) { - this.objects = []; - this.drainDisabled = false; - this.animState = animState; - } - EventQueue.prototype.start = function (entry) { - this.objects.push(EventType.start); - this.objects.push(entry); - this.animState.animationsChanged = true; - }; - EventQueue.prototype.interrupt = function (entry) { - this.objects.push(EventType.interrupt); - this.objects.push(entry); - }; - EventQueue.prototype.end = function (entry) { - this.objects.push(EventType.end); - this.objects.push(entry); - this.animState.animationsChanged = true; - }; - EventQueue.prototype.dispose = function (entry) { - this.objects.push(EventType.dispose); - this.objects.push(entry); - }; - EventQueue.prototype.complete = function (entry) { - this.objects.push(EventType.complete); - this.objects.push(entry); - }; - EventQueue.prototype.event = function (entry, event) { - this.objects.push(EventType.event); - this.objects.push(entry); - this.objects.push(event); - }; - EventQueue.prototype.drain = function () { - if (this.drainDisabled) - return; - this.drainDisabled = true; - var objects = this.objects; - var listeners = this.animState.listeners; - for (var i = 0; i < objects.length; i += 2) { - var type = objects[i]; - var entry = objects[i + 1]; - switch (type) { - case EventType.start: - if (entry.listener != null && entry.listener.start) - entry.listener.start(entry); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].start) - listeners[ii].start(entry); - break; - case EventType.interrupt: - if (entry.listener != null && entry.listener.interrupt) - entry.listener.interrupt(entry); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].interrupt) - listeners[ii].interrupt(entry); - break; - case EventType.end: - if (entry.listener != null && entry.listener.end) - entry.listener.end(entry); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].end) - listeners[ii].end(entry); - case EventType.dispose: - if (entry.listener != null && entry.listener.dispose) - entry.listener.dispose(entry); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].dispose) - listeners[ii].dispose(entry); - this.animState.trackEntryPool.free(entry); - break; - case EventType.complete: - if (entry.listener != null && entry.listener.complete) - entry.listener.complete(entry); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].complete) - listeners[ii].complete(entry); - break; - case EventType.event: - var event_3 = objects[i++ + 2]; - if (entry.listener != null && entry.listener.event) - entry.listener.event(entry, event_3); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].event) - listeners[ii].event(entry, event_3); - break; - } - } - this.clear(); - this.drainDisabled = false; - }; - EventQueue.prototype.clear = function () { - this.objects.length = 0; - }; - return EventQueue; - }()); - spine.EventQueue = EventQueue; - var EventType; - (function (EventType) { - EventType[EventType["start"] = 0] = "start"; - EventType[EventType["interrupt"] = 1] = "interrupt"; - EventType[EventType["end"] = 2] = "end"; - EventType[EventType["dispose"] = 3] = "dispose"; - EventType[EventType["complete"] = 4] = "complete"; - EventType[EventType["event"] = 5] = "event"; - })(EventType = spine.EventType || (spine.EventType = {})); - var AnimationStateAdapter2 = (function () { - function AnimationStateAdapter2() { - } - AnimationStateAdapter2.prototype.start = function (entry) { - }; - AnimationStateAdapter2.prototype.interrupt = function (entry) { - }; - AnimationStateAdapter2.prototype.end = function (entry) { - }; - AnimationStateAdapter2.prototype.dispose = function (entry) { - }; - AnimationStateAdapter2.prototype.complete = function (entry) { - }; - AnimationStateAdapter2.prototype.event = function (entry, event) { - }; - return AnimationStateAdapter2; - }()); - spine.AnimationStateAdapter2 = AnimationStateAdapter2; -})(spine || (spine = {})); -var spine; -(function (spine) { - var AnimationStateData = (function () { - function AnimationStateData(skeletonData) { - this.animationToMixTime = {}; - this.defaultMix = 0; - if (skeletonData == null) - throw new Error("skeletonData cannot be null."); - this.skeletonData = skeletonData; - } - AnimationStateData.prototype.setMix = function (fromName, toName, duration) { - var from = this.skeletonData.findAnimation(fromName); - if (from == null) - throw new Error("Animation not found: " + fromName); - var to = this.skeletonData.findAnimation(toName); - if (to == null) - throw new Error("Animation not found: " + toName); - this.setMixWith(from, to, duration); - }; - AnimationStateData.prototype.setMixWith = function (from, to, duration) { - if (from == null) - throw new Error("from cannot be null."); - if (to == null) - throw new Error("to cannot be null."); - var key = from.name + "." + to.name; - this.animationToMixTime[key] = duration; - }; - AnimationStateData.prototype.getMix = function (from, to) { - var key = from.name + "." + to.name; - var value = this.animationToMixTime[key]; - return value === undefined ? this.defaultMix : value; - }; - return AnimationStateData; - }()); - spine.AnimationStateData = AnimationStateData; -})(spine || (spine = {})); -var spine; -(function (spine) { - var AssetManager = (function () { - function AssetManager(textureLoader, pathPrefix) { - if (pathPrefix === void 0) { pathPrefix = ""; } - this.assets = {}; - this.errors = {}; - this.toLoad = 0; - this.loaded = 0; - this.textureLoader = textureLoader; - this.pathPrefix = pathPrefix; - } - AssetManager.downloadText = function (url, success, error) { - var request = new XMLHttpRequest(); - request.open("GET", url, true); - request.onload = function () { - if (request.status == 200) { - success(request.responseText); - } - else { - error(request.status, request.responseText); - } - }; - request.onerror = function () { - error(request.status, request.responseText); - }; - request.send(); - }; - AssetManager.downloadBinary = function (url, success, error) { - var request = new XMLHttpRequest(); - request.open("GET", url, true); - request.responseType = "arraybuffer"; - request.onload = function () { - if (request.status == 200) { - success(new Uint8Array(request.response)); - } - else { - error(request.status, request.responseText); - } - }; - request.onerror = function () { - error(request.status, request.responseText); - }; - request.send(); - }; - AssetManager.prototype.loadText = function (path, success, error) { - var _this = this; - if (success === void 0) { success = null; } - if (error === void 0) { error = null; } - path = this.pathPrefix + path; - this.toLoad++; - AssetManager.downloadText(path, function (data) { - _this.assets[path] = data; - if (success) - success(path, data); - _this.toLoad--; - _this.loaded++; - }, function (state, responseText) { - _this.errors[path] = "Couldn't load text " + path + ": status " + status + ", " + responseText; - if (error) - error(path, "Couldn't load text " + path + ": status " + status + ", " + responseText); - _this.toLoad--; - _this.loaded++; - }); - }; - AssetManager.prototype.loadTexture = function (path, success, error) { - var _this = this; - if (success === void 0) { success = null; } - if (error === void 0) { error = null; } - path = this.pathPrefix + path; - this.toLoad++; - var img = new Image(); - img.crossOrigin = "anonymous"; - img.onload = function (ev) { - var texture = _this.textureLoader(img); - _this.assets[path] = texture; - _this.toLoad--; - _this.loaded++; - if (success) - success(path, img); - }; - img.onerror = function (ev) { - _this.errors[path] = "Couldn't load image " + path; - _this.toLoad--; - _this.loaded++; - if (error) - error(path, "Couldn't load image " + path); - }; - img.src = path; - }; - AssetManager.prototype.loadTextureData = function (path, data, success, error) { - var _this = this; - if (success === void 0) { success = null; } - if (error === void 0) { error = null; } - path = this.pathPrefix + path; - this.toLoad++; - var img = new Image(); - img.onload = function (ev) { - var texture = _this.textureLoader(img); - _this.assets[path] = texture; - _this.toLoad--; - _this.loaded++; - if (success) - success(path, img); - }; - img.onerror = function (ev) { - _this.errors[path] = "Couldn't load image " + path; - _this.toLoad--; - _this.loaded++; - if (error) - error(path, "Couldn't load image " + path); - }; - img.src = data; - }; - AssetManager.prototype.loadTextureAtlas = function (path, success, error) { - var _this = this; - if (success === void 0) { success = null; } - if (error === void 0) { error = null; } - var parent = path.lastIndexOf("/") >= 0 ? path.substring(0, path.lastIndexOf("/")) : ""; - path = this.pathPrefix + path; - this.toLoad++; - AssetManager.downloadText(path, function (atlasData) { - var pagesLoaded = { count: 0 }; - var atlasPages = new Array(); - try { - var atlas = new spine.TextureAtlas(atlasData, function (path) { - atlasPages.push(parent + "/" + path); - var image = document.createElement("img"); - image.width = 16; - image.height = 16; - return new spine.FakeTexture(image); - }); - } - catch (e) { - var ex = e; - _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; - if (error) - error(path, "Couldn't load texture atlas " + path + ": " + ex.message); - _this.toLoad--; - _this.loaded++; - return; - } - var _loop_1 = function (atlasPage) { - var pageLoadError = false; - _this.loadTexture(atlasPage, function (imagePath, image) { - pagesLoaded.count++; - if (pagesLoaded.count == atlasPages.length) { - if (!pageLoadError) { - try { - var atlas = new spine.TextureAtlas(atlasData, function (path) { - return _this.get(parent + "/" + path); - }); - _this.assets[path] = atlas; - if (success) - success(path, atlas); - _this.toLoad--; - _this.loaded++; - } - catch (e) { - var ex = e; - _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; - if (error) - error(path, "Couldn't load texture atlas " + path + ": " + ex.message); - _this.toLoad--; - _this.loaded++; - } - } - else { - _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; - if (error) - error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); - _this.toLoad--; - _this.loaded++; - } - } - }, function (imagePath, errorMessage) { - pageLoadError = true; - pagesLoaded.count++; - if (pagesLoaded.count == atlasPages.length) { - _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; - if (error) - error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); - _this.toLoad--; - _this.loaded++; - } - }); - }; - for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) { - var atlasPage = atlasPages_1[_i]; - _loop_1(atlasPage); - } - }, function (state, responseText) { - _this.errors[path] = "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText; - if (error) - error(path, "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText); - _this.toLoad--; - _this.loaded++; - }); - }; - AssetManager.prototype.get = function (path) { - path = this.pathPrefix + path; - return this.assets[path]; - }; - AssetManager.prototype.remove = function (path) { - path = this.pathPrefix + path; - var asset = this.assets[path]; - if (asset.dispose) - asset.dispose(); - this.assets[path] = null; - }; - AssetManager.prototype.removeAll = function () { - for (var key in this.assets) { - var asset = this.assets[key]; - if (asset.dispose) - asset.dispose(); - } - this.assets = {}; - }; - AssetManager.prototype.isLoadingComplete = function () { - return this.toLoad == 0; - }; - AssetManager.prototype.getToLoad = function () { - return this.toLoad; - }; - AssetManager.prototype.getLoaded = function () { - return this.loaded; - }; - AssetManager.prototype.dispose = function () { - this.removeAll(); - }; - AssetManager.prototype.hasErrors = function () { - return Object.keys(this.errors).length > 0; - }; - AssetManager.prototype.getErrors = function () { - return this.errors; - }; - return AssetManager; - }()); - spine.AssetManager = AssetManager; -})(spine || (spine = {})); -var spine; -(function (spine) { - var AtlasAttachmentLoader = (function () { - function AtlasAttachmentLoader(atlas) { - this.atlas = atlas; - } - AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (region == null) - throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); - region.renderObject = region; - var attachment = new spine.RegionAttachment(name); - attachment.setRegion(region); - return attachment; - }; - AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (region == null) - throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); - region.renderObject = region; - var attachment = new spine.MeshAttachment(name); - attachment.region = region; - return attachment; - }; - AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) { - return new spine.BoundingBoxAttachment(name); - }; - AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) { - return new spine.PathAttachment(name); - }; - AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) { - return new spine.PointAttachment(name); - }; - AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) { - return new spine.ClippingAttachment(name); - }; - return AtlasAttachmentLoader; - }()); - spine.AtlasAttachmentLoader = AtlasAttachmentLoader; -})(spine || (spine = {})); -var spine; -(function (spine) { - var BlendMode; - (function (BlendMode) { - BlendMode[BlendMode["Normal"] = 0] = "Normal"; - BlendMode[BlendMode["Additive"] = 1] = "Additive"; - BlendMode[BlendMode["Multiply"] = 2] = "Multiply"; - BlendMode[BlendMode["Screen"] = 3] = "Screen"; - })(BlendMode = spine.BlendMode || (spine.BlendMode = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var Bone = (function () { - function Bone(data, skeleton, parent) { - 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 = false; - this.a = 0; - this.b = 0; - this.worldX = 0; - this.c = 0; - this.d = 0; - this.worldY = 0; - this.sorted = false; - if (data == null) - throw new Error("data cannot be null."); - if (skeleton == null) - throw new Error("skeleton cannot be null."); - this.data = data; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); - } - Bone.prototype.update = function () { - this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); - }; - Bone.prototype.updateWorldTransform = function () { - this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); - }; - Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) { - this.ax = x; - this.ay = y; - this.arotation = rotation; - this.ascaleX = scaleX; - this.ascaleY = scaleY; - this.ashearX = shearX; - this.ashearY = shearY; - this.appliedValid = true; - var parent = this.parent; - if (parent == null) { - var skeleton = this.skeleton; - var rotationY = rotation + 90 + shearY; - var sx = skeleton.scaleX; - var sy = skeleton.scaleY; - this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx; - this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx; - this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy; - this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy; - this.worldX = x * sx + skeleton.x; - this.worldY = y * sy + skeleton.y; - return; - } - var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - this.worldX = pa * x + pb * y + parent.worldX; - this.worldY = pc * x + pd * y + parent.worldY; - switch (this.data.transformMode) { - case spine.TransformMode.Normal: { - var rotationY = rotation + 90 + shearY; - var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; - var lb = spine.MathUtils.cosDeg(rotationY) * scaleY; - var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; - var ld = spine.MathUtils.sinDeg(rotationY) * scaleY; - this.a = pa * la + pb * lc; - this.b = pa * lb + pb * ld; - this.c = pc * la + pd * lc; - this.d = pc * lb + pd * ld; - return; - } - case spine.TransformMode.OnlyTranslation: { - var rotationY = rotation + 90 + shearY; - this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; - this.b = spine.MathUtils.cosDeg(rotationY) * scaleY; - this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; - this.d = spine.MathUtils.sinDeg(rotationY) * scaleY; - break; - } - case spine.TransformMode.NoRotationOrReflection: { - var s = pa * pa + pc * pc; - var prx = 0; - if (s > 0.0001) { - s = Math.abs(pa * pd - pb * pc) / s; - pb = pc * s; - pd = pa * s; - prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg; - } - else { - pa = 0; - pc = 0; - prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg; - } - var rx = rotation + shearX - prx; - var ry = rotation + shearY - prx + 90; - var la = spine.MathUtils.cosDeg(rx) * scaleX; - var lb = spine.MathUtils.cosDeg(ry) * scaleY; - var lc = spine.MathUtils.sinDeg(rx) * scaleX; - var ld = spine.MathUtils.sinDeg(ry) * scaleY; - this.a = pa * la - pb * lc; - this.b = pa * lb - pb * ld; - this.c = pc * la + pd * lc; - this.d = pc * lb + pd * ld; - break; - } - case spine.TransformMode.NoScale: - case spine.TransformMode.NoScaleOrReflection: { - var cos = spine.MathUtils.cosDeg(rotation); - var sin = spine.MathUtils.sinDeg(rotation); - var za = (pa * cos + pb * sin) / this.skeleton.scaleX; - var zc = (pc * cos + pd * sin) / this.skeleton.scaleY; - var s = Math.sqrt(za * za + zc * zc); - if (s > 0.00001) - s = 1 / s; - za *= s; - zc *= s; - s = Math.sqrt(za * za + zc * zc); - if (this.data.transformMode == spine.TransformMode.NoScale - && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) - s = -s; - var r = Math.PI / 2 + Math.atan2(zc, za); - var zb = Math.cos(r) * s; - var zd = Math.sin(r) * s; - var la = spine.MathUtils.cosDeg(shearX) * scaleX; - var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY; - var lc = spine.MathUtils.sinDeg(shearX) * scaleX; - var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY; - this.a = za * la + zb * lc; - this.b = za * lb + zb * ld; - this.c = zc * la + zd * lc; - this.d = zc * lb + zd * ld; - break; - } - } - this.a *= this.skeleton.scaleX; - this.b *= this.skeleton.scaleX; - this.c *= this.skeleton.scaleY; - this.d *= this.skeleton.scaleY; - }; - Bone.prototype.setToSetupPose = function () { - var data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.shearX = data.shearX; - this.shearY = data.shearY; - }; - Bone.prototype.getWorldRotationX = function () { - return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg; - }; - Bone.prototype.getWorldRotationY = function () { - return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg; - }; - Bone.prototype.getWorldScaleX = function () { - return Math.sqrt(this.a * this.a + this.c * this.c); - }; - Bone.prototype.getWorldScaleY = function () { - return Math.sqrt(this.b * this.b + this.d * this.d); - }; - Bone.prototype.updateAppliedTransform = function () { - this.appliedValid = true; - var parent = this.parent; - if (parent == null) { - this.ax = this.worldX; - this.ay = this.worldY; - this.arotation = Math.atan2(this.c, this.a) * spine.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; - this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg; - return; - } - var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - var pid = 1 / (pa * pd - pb * pc); - var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; - this.ax = (dx * pd * pid - dy * pb * pid); - this.ay = (dy * pa * pid - dx * pc * pid); - var ia = pid * pd; - var id = pid * pa; - var ib = pid * pb; - var ic = pid * pc; - var ra = ia * this.a - ib * this.c; - var rb = ia * this.b - ib * this.d; - var rc = id * this.c - ic * this.a; - var rd = id * this.d - ic * this.b; - this.ashearX = 0; - this.ascaleX = Math.sqrt(ra * ra + rc * rc); - if (this.ascaleX > 0.0001) { - var det = ra * rd - rb * rc; - this.ascaleY = det / this.ascaleX; - this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg; - this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg; - } - else { - this.ascaleX = 0; - this.ascaleY = Math.sqrt(rb * rb + rd * rd); - this.ashearY = 0; - this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg; - } - }; - Bone.prototype.worldToLocal = function (world) { - var a = this.a, b = this.b, c = this.c, d = this.d; - var invDet = 1 / (a * d - b * c); - var x = world.x - this.worldX, y = world.y - this.worldY; - world.x = (x * d * invDet - y * b * invDet); - world.y = (y * a * invDet - x * c * invDet); - return world; - }; - Bone.prototype.localToWorld = function (local) { - var x = local.x, y = local.y; - local.x = x * this.a + y * this.b + this.worldX; - local.y = x * this.c + y * this.d + this.worldY; - return local; - }; - Bone.prototype.worldToLocalRotation = function (worldRotation) { - var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation); - return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX; - }; - Bone.prototype.localToWorldRotation = function (localRotation) { - localRotation -= this.rotation - this.shearX; - var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation); - return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg; - }; - Bone.prototype.rotateWorld = function (degrees) { - var a = this.a, b = this.b, c = this.c, d = this.d; - var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees); - this.a = cos * a - sin * c; - this.b = cos * b - sin * d; - this.c = sin * a + cos * c; - this.d = sin * b + cos * d; - this.appliedValid = false; - }; - return Bone; - }()); - spine.Bone = Bone; -})(spine || (spine = {})); -var spine; -(function (spine) { - var BoneData = (function () { - function BoneData(index, name, parent) { - this.x = 0; - this.y = 0; - this.rotation = 0; - this.scaleX = 1; - this.scaleY = 1; - this.shearX = 0; - this.shearY = 0; - this.transformMode = TransformMode.Normal; - if (index < 0) - throw new Error("index must be >= 0."); - if (name == null) - throw new Error("name cannot be null."); - this.index = index; - this.name = name; - this.parent = parent; - } - return BoneData; - }()); - spine.BoneData = BoneData; - var TransformMode; - (function (TransformMode) { - TransformMode[TransformMode["Normal"] = 0] = "Normal"; - TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation"; - TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; - TransformMode[TransformMode["NoScale"] = 3] = "NoScale"; - TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; - })(TransformMode = spine.TransformMode || (spine.TransformMode = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var Event = (function () { - function Event(time, data) { - if (data == null) - throw new Error("data cannot be null."); - this.time = time; - this.data = data; - } - return Event; - }()); - spine.Event = Event; -})(spine || (spine = {})); -var spine; -(function (spine) { - var EventData = (function () { - function EventData(name) { - this.name = name; - } - return EventData; - }()); - spine.EventData = EventData; -})(spine || (spine = {})); -var spine; -(function (spine) { - var IkConstraint = (function () { - function IkConstraint(data, skeleton) { - this.bendDirection = 0; - this.compress = false; - this.stretch = false; - this.mix = 1; - if (data == null) - throw new Error("data cannot be null."); - if (skeleton == null) - throw new Error("skeleton cannot be null."); - this.data = data; - this.mix = data.mix; - this.bendDirection = data.bendDirection; - this.compress = data.compress; - this.stretch = data.stretch; - this.bones = new Array(); - for (var i = 0; i < data.bones.length; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); - } - IkConstraint.prototype.getOrder = function () { - return this.data.order; - }; - IkConstraint.prototype.apply = function () { - this.update(); - }; - IkConstraint.prototype.update = function () { - var target = this.target; - var bones = this.bones; - switch (bones.length) { - case 1: - this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix); - break; - case 2: - this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix); - break; - } - }; - IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) { - if (!bone.appliedValid) - bone.updateAppliedTransform(); - var p = bone.parent; - var id = 1 / (p.a * p.d - p.b * p.c); - var x = targetX - p.worldX, y = targetY - p.worldY; - var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay; - var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation; - if (bone.ascaleX < 0) - rotationIK += 180; - if (rotationIK > 180) - rotationIK -= 360; - else if (rotationIK < -180) - rotationIK += 360; - var sx = bone.ascaleX, sy = bone.ascaleY; - if (compress || stretch) { - var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty); - if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) { - var s = (dd / b - 1) * alpha + 1; - sx *= s; - if (uniform) - sy *= s; - } - } - bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY); - }; - IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) { - if (alpha == 0) { - child.updateWorldTransform(); - return; - } - if (!parent.appliedValid) - parent.updateAppliedTransform(); - if (!child.appliedValid) - child.updateAppliedTransform(); - var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX; - var os1 = 0, os2 = 0, s2 = 0; - if (psx < 0) { - psx = -psx; - os1 = 180; - s2 = -1; - } - else { - os1 = 0; - s2 = 1; - } - if (psy < 0) { - psy = -psy; - s2 = -s2; - } - if (csx < 0) { - csx = -csx; - os2 = 180; - } - else - os2 = 0; - var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; - var u = Math.abs(psx - psy) <= 0.0001; - if (!u) { - cy = 0; - cwx = a * cx + parent.worldX; - cwy = c * cx + parent.worldY; - } - else { - cy = child.ay; - cwx = a * cx + b * cy + parent.worldX; - cwy = c * cx + d * cy + parent.worldY; - } - var pp = parent.parent; - a = pp.a; - b = pp.b; - c = pp.c; - d = pp.d; - var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY; - var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty; - x = cwx - pp.worldX; - y = cwy - pp.worldY; - var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; - var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0; - outer: if (u) { - l2 *= psx; - var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); - if (cos < -1) - cos = -1; - else if (cos > 1) { - cos = 1; - if (stretch && l1 + l2 > 0.0001) - sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1; - } - a2 = Math.acos(cos) * bendDir; - a = l1 + l2 * cos; - b = l2 * Math.sin(a2); - a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b); - } - else { - a = psx * l2; - b = psy * l2; - var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); - c = bb * l1 * l1 + aa * dd - aa * bb; - var c1 = -2 * bb * l1, c2 = bb - aa; - d = c1 * c1 - 4 * c2 * c; - if (d >= 0) { - var q = Math.sqrt(d); - if (c1 < 0) - q = -q; - q = -(c1 + q) / 2; - var r0 = q / c2, r1 = c / q; - var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; - if (r * r <= dd) { - y = Math.sqrt(dd - r * r) * bendDir; - a1 = ta - Math.atan2(y, r); - a2 = Math.atan2(y / psy, (r - l1) / psx); - break outer; - } - } - var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; - var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; - c = -a * l1 / (aa - bb); - if (c >= -1 && c <= 1) { - c = Math.acos(c); - x = a * Math.cos(c) + l1; - y = b * Math.sin(c); - d = x * x + y * y; - if (d < minDist) { - minAngle = c; - minDist = d; - minX = x; - minY = y; - } - if (d > maxDist) { - maxAngle = c; - maxDist = d; - maxX = x; - maxY = y; - } - } - if (dd <= (minDist + maxDist) / 2) { - a1 = ta - Math.atan2(minY * bendDir, minX); - a2 = minAngle * bendDir; - } - else { - a1 = ta - Math.atan2(maxY * bendDir, maxX); - a2 = maxAngle * bendDir; - } - } - var os = Math.atan2(cy, cx) * s2; - var rotation = parent.arotation; - a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation; - if (a1 > 180) - a1 -= 360; - else if (a1 < -180) - a1 += 360; - parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0); - rotation = child.arotation; - a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; - if (a2 > 180) - a2 -= 360; - else if (a2 < -180) - a2 += 360; - child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); - }; - return IkConstraint; - }()); - spine.IkConstraint = IkConstraint; -})(spine || (spine = {})); -var spine; -(function (spine) { - var IkConstraintData = (function () { - function IkConstraintData(name) { - this.order = 0; - this.bones = new Array(); - this.bendDirection = 1; - this.compress = false; - this.stretch = false; - this.uniform = false; - this.mix = 1; - this.name = name; - } - return IkConstraintData; - }()); - spine.IkConstraintData = IkConstraintData; -})(spine || (spine = {})); -var spine; -(function (spine) { - var PathConstraint = (function () { - function PathConstraint(data, skeleton) { - 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(); - if (data == null) - throw new Error("data cannot be null."); - if (skeleton == null) - throw new Error("skeleton cannot be null."); - this.data = data; - this.bones = new Array(); - for (var i = 0, n = data.bones.length; i < n; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findSlot(data.target.name); - this.position = data.position; - this.spacing = data.spacing; - this.rotateMix = data.rotateMix; - this.translateMix = data.translateMix; - } - PathConstraint.prototype.apply = function () { - this.update(); - }; - PathConstraint.prototype.update = function () { - var attachment = this.target.getAttachment(); - if (!(attachment instanceof spine.PathAttachment)) - return; - var rotateMix = this.rotateMix, translateMix = this.translateMix; - var translate = translateMix > 0, rotate = rotateMix > 0; - if (!translate && !rotate) - return; - var data = this.data; - var percentSpacing = data.spacingMode == spine.SpacingMode.Percent; - var rotateMode = data.rotateMode; - var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale; - var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1; - var bones = this.bones; - var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null; - var spacing = this.spacing; - if (scale || !percentSpacing) { - if (scale) - lengths = spine.Utils.setArraySize(this.lengths, boneCount); - var lengthSpacing = data.spacingMode == spine.SpacingMode.Length; - for (var i = 0, n = spacesCount - 1; i < n;) { - var bone = bones[i]; - var setupLength = bone.data.length; - if (setupLength < PathConstraint.epsilon) { - if (scale) - lengths[i] = 0; - spaces[++i] = 0; - } - else if (percentSpacing) { - if (scale) { - var x = setupLength * bone.a, y = setupLength * bone.c; - var length_1 = Math.sqrt(x * x + y * y); - lengths[i] = length_1; - } - spaces[++i] = spacing; - } - else { - var x = setupLength * bone.a, y = setupLength * bone.c; - var length_2 = Math.sqrt(x * x + y * y); - if (scale) - lengths[i] = length_2; - spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength; - } - } - } - else { - for (var i = 1; i < spacesCount; i++) - spaces[i] = spacing; - } - var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing); - var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; - var tip = false; - if (offsetRotation == 0) - tip = rotateMode == spine.RotateMode.Chain; - else { - tip = false; - var p = this.target.bone; - offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; - } - for (var i = 0, p = 3; i < boneCount; i++, p += 3) { - var bone = bones[i]; - bone.worldX += (boneX - bone.worldX) * translateMix; - bone.worldY += (boneY - bone.worldY) * translateMix; - var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; - if (scale) { - var length_3 = lengths[i]; - if (length_3 != 0) { - var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1; - bone.a *= s; - bone.c *= s; - } - } - boneX = x; - boneY = y; - if (rotate) { - var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; - if (tangents) - r = positions[p - 1]; - else if (spaces[i + 1] == 0) - r = positions[p + 2]; - else - r = Math.atan2(dy, dx); - r -= Math.atan2(c, a); - if (tip) { - cos = Math.cos(r); - sin = Math.sin(r); - var length_4 = bone.data.length; - boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix; - boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix; - } - else { - r += offsetRotation; - } - if (r > spine.MathUtils.PI) - r -= spine.MathUtils.PI2; - else if (r < -spine.MathUtils.PI) - r += spine.MathUtils.PI2; - r *= rotateMix; - cos = Math.cos(r); - sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - } - bone.appliedValid = false; - } - }; - PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) { - var target = this.target; - var position = this.position; - var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null; - var closed = path.closed; - var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE; - if (!path.constantSpeed) { - var lengths = path.lengths; - curveCount -= closed ? 1 : 2; - var pathLength_1 = lengths[curveCount]; - if (percentPosition) - position *= pathLength_1; - if (percentSpacing) { - for (var i = 1; i < spacesCount; i++) - spaces[i] *= pathLength_1; - } - world = spine.Utils.setArraySize(this.world, 8); - for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { - var space = spaces[i]; - position += space; - var p = position; - if (closed) { - p %= pathLength_1; - if (p < 0) - p += pathLength_1; - curve = 0; - } - else if (p < 0) { - if (prevCurve != PathConstraint.BEFORE) { - prevCurve = PathConstraint.BEFORE; - path.computeWorldVertices(target, 2, 4, world, 0, 2); - } - this.addBeforePosition(p, world, 0, out, o); - continue; - } - else if (p > pathLength_1) { - if (prevCurve != PathConstraint.AFTER) { - prevCurve = PathConstraint.AFTER; - path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2); - } - this.addAfterPosition(p - pathLength_1, world, 0, out, o); - continue; - } - for (;; curve++) { - var length_5 = lengths[curve]; - if (p > length_5) - continue; - if (curve == 0) - p /= length_5; - else { - var prev = lengths[curve - 1]; - p = (p - prev) / (length_5 - prev); - } - break; - } - if (curve != prevCurve) { - prevCurve = curve; - if (closed && curve == curveCount) { - path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2); - path.computeWorldVertices(target, 0, 4, world, 4, 2); - } - else - path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2); - } - this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0)); - } - return out; - } - if (closed) { - verticesLength += 2; - world = spine.Utils.setArraySize(this.world, verticesLength); - path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2); - path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2); - world[verticesLength - 2] = world[0]; - world[verticesLength - 1] = world[1]; - } - else { - curveCount--; - verticesLength -= 4; - world = spine.Utils.setArraySize(this.world, verticesLength); - path.computeWorldVertices(target, 2, verticesLength, world, 0, 2); - } - var curves = spine.Utils.setArraySize(this.curves, curveCount); - var pathLength = 0; - var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; - var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; - for (var i = 0, w = 2; i < curveCount; i++, w += 6) { - cx1 = world[w]; - cy1 = world[w + 1]; - cx2 = world[w + 2]; - cy2 = world[w + 3]; - x2 = world[w + 4]; - y2 = world[w + 5]; - tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; - tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; - dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; - dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; - ddfx = tmpx * 2 + dddfx; - ddfy = tmpy * 2 + dddfy; - dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; - dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx; - dfy += ddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx + dddfx; - dfy += ddfy + dddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - curves[i] = pathLength; - x1 = x2; - y1 = y2; - } - if (percentPosition) - position *= pathLength; - else - position *= pathLength / path.lengths[curveCount - 1]; - if (percentSpacing) { - for (var i = 1; i < spacesCount; i++) - spaces[i] *= pathLength; - } - var segments = this.segments; - var curveLength = 0; - for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { - var space = spaces[i]; - position += space; - var p = position; - if (closed) { - p %= pathLength; - if (p < 0) - p += pathLength; - curve = 0; - } - else if (p < 0) { - this.addBeforePosition(p, world, 0, out, o); - continue; - } - else if (p > pathLength) { - this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); - continue; - } - for (;; curve++) { - var length_6 = curves[curve]; - if (p > length_6) - continue; - if (curve == 0) - p /= length_6; - else { - var prev = curves[curve - 1]; - p = (p - prev) / (length_6 - prev); - } - break; - } - if (curve != prevCurve) { - prevCurve = curve; - var ii = curve * 6; - x1 = world[ii]; - y1 = world[ii + 1]; - cx1 = world[ii + 2]; - cy1 = world[ii + 3]; - cx2 = world[ii + 4]; - cy2 = world[ii + 5]; - x2 = world[ii + 6]; - y2 = world[ii + 7]; - tmpx = (x1 - cx1 * 2 + cx2) * 0.03; - tmpy = (y1 - cy1 * 2 + cy2) * 0.03; - dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; - dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; - ddfx = tmpx * 2 + dddfx; - ddfy = tmpy * 2 + dddfy; - dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; - dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; - curveLength = Math.sqrt(dfx * dfx + dfy * dfy); - segments[0] = curveLength; - for (ii = 1; ii < 8; ii++) { - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[ii] = curveLength; - } - dfx += ddfx; - dfy += ddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[8] = curveLength; - dfx += ddfx + dddfx; - dfy += ddfy + dddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[9] = curveLength; - segment = 0; - } - p *= curveLength; - for (;; segment++) { - var length_7 = segments[segment]; - if (p > length_7) - continue; - if (segment == 0) - p /= length_7; - else { - var prev = segments[segment - 1]; - p = segment + (p - prev) / (length_7 - prev); - } - break; - } - this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0)); - } - return out; - }; - PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) { - var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx); - out[o] = x1 + p * Math.cos(r); - out[o + 1] = y1 + p * Math.sin(r); - out[o + 2] = r; - }; - PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) { - var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx); - out[o] = x1 + p * Math.cos(r); - out[o + 1] = y1 + p * Math.sin(r); - out[o + 2] = r; - }; - PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { - if (p == 0 || isNaN(p)) { - out[o] = x1; - out[o + 1] = y1; - out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); - return; - } - var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; - var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; - var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; - out[o] = x; - out[o + 1] = y; - if (tangents) { - if (p < 0.001) - out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); - else - out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); - } - }; - PathConstraint.prototype.getOrder = function () { - return this.data.order; - }; - PathConstraint.NONE = -1; - PathConstraint.BEFORE = -2; - PathConstraint.AFTER = -3; - PathConstraint.epsilon = 0.00001; - return PathConstraint; - }()); - spine.PathConstraint = PathConstraint; -})(spine || (spine = {})); -var spine; -(function (spine) { - var PathConstraintData = (function () { - function PathConstraintData(name) { - this.order = 0; - this.bones = new Array(); - this.name = name; - } - return PathConstraintData; - }()); - spine.PathConstraintData = PathConstraintData; - var PositionMode; - (function (PositionMode) { - PositionMode[PositionMode["Fixed"] = 0] = "Fixed"; - PositionMode[PositionMode["Percent"] = 1] = "Percent"; - })(PositionMode = spine.PositionMode || (spine.PositionMode = {})); - var SpacingMode; - (function (SpacingMode) { - SpacingMode[SpacingMode["Length"] = 0] = "Length"; - SpacingMode[SpacingMode["Fixed"] = 1] = "Fixed"; - SpacingMode[SpacingMode["Percent"] = 2] = "Percent"; - })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {})); - var RotateMode; - (function (RotateMode) { - RotateMode[RotateMode["Tangent"] = 0] = "Tangent"; - RotateMode[RotateMode["Chain"] = 1] = "Chain"; - RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale"; - })(RotateMode = spine.RotateMode || (spine.RotateMode = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var Assets = (function () { - function Assets(clientId) { - this.toLoad = new Array(); - this.assets = {}; - this.clientId = clientId; - } - Assets.prototype.loaded = function () { - var i = 0; - for (var v in this.assets) - i++; - return i; - }; - return Assets; - }()); - var SharedAssetManager = (function () { - function SharedAssetManager(pathPrefix) { - if (pathPrefix === void 0) { pathPrefix = ""; } - this.clientAssets = {}; - this.queuedAssets = {}; - this.rawAssets = {}; - this.errors = {}; - this.pathPrefix = pathPrefix; - } - SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) { - var clientAssets = this.clientAssets[clientId]; - if (clientAssets === null || clientAssets === undefined) { - clientAssets = new Assets(clientId); - this.clientAssets[clientId] = clientAssets; - } - if (textureLoader !== null) - clientAssets.textureLoader = textureLoader; - clientAssets.toLoad.push(path); - if (this.queuedAssets[path] === path) { - return false; - } - else { - this.queuedAssets[path] = path; - return true; - } - }; - SharedAssetManager.prototype.loadText = function (clientId, path) { - var _this = this; - path = this.pathPrefix + path; - if (!this.queueAsset(clientId, null, path)) - return; - var request = new XMLHttpRequest(); - request.onreadystatechange = function () { - if (request.readyState == XMLHttpRequest.DONE) { - if (request.status >= 200 && request.status < 300) { - _this.rawAssets[path] = request.responseText; - } - else { - _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; - } - } - }; - request.open("GET", path, true); - request.send(); - }; - SharedAssetManager.prototype.loadJson = function (clientId, path) { - var _this = this; - path = this.pathPrefix + path; - if (!this.queueAsset(clientId, null, path)) - return; - var request = new XMLHttpRequest(); - request.onreadystatechange = function () { - if (request.readyState == XMLHttpRequest.DONE) { - if (request.status >= 200 && request.status < 300) { - _this.rawAssets[path] = JSON.parse(request.responseText); - } - else { - _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; - } - } - }; - request.open("GET", path, true); - request.send(); - }; - SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) { - var _this = this; - path = this.pathPrefix + path; - if (!this.queueAsset(clientId, textureLoader, path)) - return; - var img = new Image(); - img.src = path; - img.crossOrigin = "anonymous"; - img.onload = function (ev) { - _this.rawAssets[path] = img; - }; - img.onerror = function (ev) { - _this.errors[path] = "Couldn't load image " + path; - }; - }; - SharedAssetManager.prototype.get = function (clientId, path) { - path = this.pathPrefix + path; - var clientAssets = this.clientAssets[clientId]; - if (clientAssets === null || clientAssets === undefined) - return true; - return clientAssets.assets[path]; - }; - SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { - for (var i = 0; i < clientAssets.toLoad.length; i++) { - var path = clientAssets.toLoad[i]; - var asset = clientAssets.assets[path]; - if (asset === null || asset === undefined) { - var rawAsset = this.rawAssets[path]; - if (rawAsset === null || rawAsset === undefined) - continue; - if (rawAsset instanceof HTMLImageElement) { - clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); - } - else { - clientAssets.assets[path] = rawAsset; - } - } - } - }; - SharedAssetManager.prototype.isLoadingComplete = function (clientId) { - var clientAssets = this.clientAssets[clientId]; - if (clientAssets === null || clientAssets === undefined) - return true; - this.updateClientAssets(clientAssets); - return clientAssets.toLoad.length == clientAssets.loaded(); - }; - SharedAssetManager.prototype.dispose = function () { - }; - SharedAssetManager.prototype.hasErrors = function () { - return Object.keys(this.errors).length > 0; - }; - SharedAssetManager.prototype.getErrors = function () { - return this.errors; - }; - return SharedAssetManager; - }()); - spine.SharedAssetManager = SharedAssetManager; -})(spine || (spine = {})); -var spine; -(function (spine) { - var Skeleton = (function () { - function Skeleton(data) { - this._updateCache = new Array(); - this.updateCacheReset = new Array(); - this.time = 0; - this.scaleX = 1; - this.scaleY = 1; - this.x = 0; - this.y = 0; - if (data == null) - throw new Error("data cannot be null."); - this.data = data; - this.bones = new Array(); - for (var i = 0; i < data.bones.length; i++) { - var boneData = data.bones[i]; - var bone = void 0; - if (boneData.parent == null) - bone = new spine.Bone(boneData, this, null); - else { - var parent_1 = this.bones[boneData.parent.index]; - bone = new spine.Bone(boneData, this, parent_1); - parent_1.children.push(bone); - } - this.bones.push(bone); - } - this.slots = new Array(); - this.drawOrder = new Array(); - for (var i = 0; i < data.slots.length; i++) { - var slotData = data.slots[i]; - var bone = this.bones[slotData.boneData.index]; - var slot = new spine.Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - this.ikConstraints = new Array(); - for (var i = 0; i < data.ikConstraints.length; i++) { - var ikConstraintData = data.ikConstraints[i]; - this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this)); - } - this.transformConstraints = new Array(); - for (var i = 0; i < data.transformConstraints.length; i++) { - var transformConstraintData = data.transformConstraints[i]; - this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this)); - } - this.pathConstraints = new Array(); - for (var i = 0; i < data.pathConstraints.length; i++) { - var pathConstraintData = data.pathConstraints[i]; - this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this)); - } - this.color = new spine.Color(1, 1, 1, 1); - this.updateCache(); - } - Skeleton.prototype.updateCache = function () { - var updateCache = this._updateCache; - updateCache.length = 0; - this.updateCacheReset.length = 0; - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].sorted = false; - var ikConstraints = this.ikConstraints; - var transformConstraints = this.transformConstraints; - var pathConstraints = this.pathConstraints; - var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length; - var constraintCount = ikCount + transformCount + pathCount; - outer: for (var i = 0; i < constraintCount; i++) { - for (var ii = 0; ii < ikCount; ii++) { - var constraint = ikConstraints[ii]; - if (constraint.data.order == i) { - this.sortIkConstraint(constraint); - continue outer; - } - } - for (var ii = 0; ii < transformCount; ii++) { - var constraint = transformConstraints[ii]; - if (constraint.data.order == i) { - this.sortTransformConstraint(constraint); - continue outer; - } - } - for (var ii = 0; ii < pathCount; ii++) { - var constraint = pathConstraints[ii]; - if (constraint.data.order == i) { - this.sortPathConstraint(constraint); - continue outer; - } - } - } - for (var i = 0, n = bones.length; i < n; i++) - this.sortBone(bones[i]); - }; - Skeleton.prototype.sortIkConstraint = function (constraint) { - var target = constraint.target; - this.sortBone(target); - var constrained = constraint.bones; - var parent = constrained[0]; - this.sortBone(parent); - if (constrained.length > 1) { - var child = constrained[constrained.length - 1]; - if (!(this._updateCache.indexOf(child) > -1)) - this.updateCacheReset.push(child); - } - this._updateCache.push(constraint); - this.sortReset(parent.children); - constrained[constrained.length - 1].sorted = true; - }; - Skeleton.prototype.sortPathConstraint = function (constraint) { - var slot = constraint.target; - var slotIndex = slot.data.index; - var slotBone = slot.bone; - if (this.skin != null) - this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); - if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin) - this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); - for (var i = 0, n = this.data.skins.length; i < n; i++) - this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone); - var attachment = slot.getAttachment(); - if (attachment instanceof spine.PathAttachment) - this.sortPathConstraintAttachmentWith(attachment, slotBone); - var constrained = constraint.bones; - var boneCount = constrained.length; - for (var i = 0; i < boneCount; i++) - this.sortBone(constrained[i]); - this._updateCache.push(constraint); - for (var i = 0; i < boneCount; i++) - this.sortReset(constrained[i].children); - for (var i = 0; i < boneCount; i++) - constrained[i].sorted = true; - }; - Skeleton.prototype.sortTransformConstraint = function (constraint) { - this.sortBone(constraint.target); - var constrained = constraint.bones; - var boneCount = constrained.length; - if (constraint.data.local) { - for (var i = 0; i < boneCount; i++) { - var child = constrained[i]; - this.sortBone(child.parent); - if (!(this._updateCache.indexOf(child) > -1)) - this.updateCacheReset.push(child); - } - } - else { - for (var i = 0; i < boneCount; i++) { - this.sortBone(constrained[i]); - } - } - this._updateCache.push(constraint); - for (var ii = 0; ii < boneCount; ii++) - this.sortReset(constrained[ii].children); - for (var ii = 0; ii < boneCount; ii++) - constrained[ii].sorted = true; - }; - Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) { - var attachments = skin.attachments[slotIndex]; - if (!attachments) - return; - for (var key in attachments) { - this.sortPathConstraintAttachmentWith(attachments[key], slotBone); - } - }; - Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) { - if (!(attachment instanceof spine.PathAttachment)) - return; - var pathBones = attachment.bones; - if (pathBones == null) - this.sortBone(slotBone); - else { - var bones = this.bones; - var i = 0; - while (i < pathBones.length) { - var boneCount = pathBones[i++]; - for (var n = i + boneCount; i < n; i++) { - var boneIndex = pathBones[i]; - this.sortBone(bones[boneIndex]); - } - } - } - }; - Skeleton.prototype.sortBone = function (bone) { - if (bone.sorted) - return; - var parent = bone.parent; - if (parent != null) - this.sortBone(parent); - bone.sorted = true; - this._updateCache.push(bone); - }; - Skeleton.prototype.sortReset = function (bones) { - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (bone.sorted) - this.sortReset(bone.children); - bone.sorted = false; - } - }; - Skeleton.prototype.updateWorldTransform = function () { - var updateCacheReset = this.updateCacheReset; - for (var i = 0, n = updateCacheReset.length; i < n; i++) { - var bone = updateCacheReset[i]; - bone.ax = bone.x; - bone.ay = bone.y; - bone.arotation = bone.rotation; - bone.ascaleX = bone.scaleX; - bone.ascaleY = bone.scaleY; - bone.ashearX = bone.shearX; - bone.ashearY = bone.shearY; - bone.appliedValid = true; - } - var updateCache = this._updateCache; - for (var i = 0, n = updateCache.length; i < n; i++) - updateCache[i].update(); - }; - Skeleton.prototype.setToSetupPose = function () { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - }; - Skeleton.prototype.setBonesToSetupPose = function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].setToSetupPose(); - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var constraint = ikConstraints[i]; - constraint.mix = constraint.data.mix; - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } - var transformConstraints = this.transformConstraints; - for (var i = 0, n = transformConstraints.length; i < n; i++) { - var constraint = transformConstraints[i]; - var data = constraint.data; - constraint.rotateMix = data.rotateMix; - constraint.translateMix = data.translateMix; - constraint.scaleMix = data.scaleMix; - constraint.shearMix = data.shearMix; - } - var pathConstraints = this.pathConstraints; - for (var i = 0, n = pathConstraints.length; i < n; i++) { - var constraint = pathConstraints[i]; - var data = constraint.data; - constraint.position = data.position; - constraint.spacing = data.spacing; - constraint.rotateMix = data.rotateMix; - constraint.translateMix = data.translateMix; - } - }; - Skeleton.prototype.setSlotsToSetupPose = function () { - var slots = this.slots; - spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); - for (var i = 0, n = slots.length; i < n; i++) - slots[i].setToSetupPose(); - }; - Skeleton.prototype.getRootBone = function () { - if (this.bones.length == 0) - return null; - return this.bones[0]; - }; - Skeleton.prototype.findBone = function (boneName) { - if (boneName == null) - throw new Error("boneName cannot be null."); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (bone.data.name == boneName) - return bone; - } - return null; - }; - Skeleton.prototype.findBoneIndex = function (boneName) { - if (boneName == null) - throw new Error("boneName cannot be null."); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) - return i; - return -1; - }; - Skeleton.prototype.findSlot = function (slotName) { - if (slotName == null) - throw new Error("slotName cannot be null."); - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) - return slot; - } - return null; - }; - Skeleton.prototype.findSlotIndex = function (slotName) { - if (slotName == null) - throw new Error("slotName cannot be null."); - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) - return i; - return -1; - }; - Skeleton.prototype.setSkinByName = function (skinName) { - var skin = this.data.findSkin(skinName); - if (skin == null) - throw new Error("Skin not found: " + skinName); - this.setSkin(skin); - }; - Skeleton.prototype.setSkin = function (newSkin) { - if (newSkin != null) { - if (this.skin != null) - newSkin.attachAll(this, this.skin); - else { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var name_1 = slot.data.attachmentName; - if (name_1 != null) { - var attachment = newSkin.getAttachment(i, name_1); - if (attachment != null) - slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - }; - Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) { - return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName); - }; - Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) { - if (attachmentName == null) - throw new Error("attachmentName cannot be null."); - if (this.skin != null) { - var attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment != null) - return attachment; - } - if (this.data.defaultSkin != null) - return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - }; - Skeleton.prototype.setAttachment = function (slotName, attachmentName) { - if (slotName == null) - throw new Error("slotName cannot be null."); - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) { - var attachment = null; - if (attachmentName != null) { - attachment = this.getAttachment(i, attachmentName); - if (attachment == null) - throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName); - } - slot.setAttachment(attachment); - return; - } - } - throw new Error("Slot not found: " + slotName); - }; - Skeleton.prototype.findIkConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var ikConstraint = ikConstraints[i]; - if (ikConstraint.data.name == constraintName) - return ikConstraint; - } - return null; - }; - Skeleton.prototype.findTransformConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var transformConstraints = this.transformConstraints; - for (var i = 0, n = transformConstraints.length; i < n; i++) { - var constraint = transformConstraints[i]; - if (constraint.data.name == constraintName) - return constraint; - } - return null; - }; - Skeleton.prototype.findPathConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var pathConstraints = this.pathConstraints; - for (var i = 0, n = pathConstraints.length; i < n; i++) { - var constraint = pathConstraints[i]; - if (constraint.data.name == constraintName) - return constraint; - } - return null; - }; - Skeleton.prototype.getBounds = function (offset, size, temp) { - if (temp === void 0) { temp = new Array(2); } - if (offset == null) - throw new Error("offset cannot be null."); - if (size == null) - throw new Error("size cannot be null."); - var drawOrder = this.drawOrder; - var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - for (var i = 0, n = drawOrder.length; i < n; i++) { - var slot = drawOrder[i]; - var verticesLength = 0; - var vertices = null; - var attachment = slot.getAttachment(); - if (attachment instanceof spine.RegionAttachment) { - verticesLength = 8; - vertices = spine.Utils.setArraySize(temp, verticesLength, 0); - attachment.computeWorldVertices(slot.bone, vertices, 0, 2); - } - else if (attachment instanceof spine.MeshAttachment) { - var mesh = attachment; - verticesLength = mesh.worldVerticesLength; - vertices = spine.Utils.setArraySize(temp, verticesLength, 0); - mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2); - } - if (vertices != null) { - for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { - var x = vertices[ii], y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - } - offset.set(minX, minY); - size.set(maxX - minX, maxY - minY); - }; - Skeleton.prototype.update = function (delta) { - this.time += delta; - }; - return Skeleton; - }()); - spine.Skeleton = Skeleton; -})(spine || (spine = {})); -var spine; -(function (spine) { - var SkeletonBounds = (function () { - function SkeletonBounds() { - this.minX = 0; - this.minY = 0; - this.maxX = 0; - this.maxY = 0; - this.boundingBoxes = new Array(); - this.polygons = new Array(); - this.polygonPool = new spine.Pool(function () { - return spine.Utils.newFloatArray(16); - }); - } - SkeletonBounds.prototype.update = function (skeleton, updateAabb) { - if (skeleton == null) - throw new Error("skeleton cannot be null."); - var boundingBoxes = this.boundingBoxes; - var polygons = this.polygons; - var polygonPool = this.polygonPool; - var slots = skeleton.slots; - var slotCount = slots.length; - boundingBoxes.length = 0; - polygonPool.freeAll(polygons); - polygons.length = 0; - for (var i = 0; i < slotCount; i++) { - var slot = slots[i]; - var attachment = slot.getAttachment(); - if (attachment instanceof spine.BoundingBoxAttachment) { - var boundingBox = attachment; - boundingBoxes.push(boundingBox); - var polygon = polygonPool.obtain(); - if (polygon.length != boundingBox.worldVerticesLength) { - polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength); - } - polygons.push(polygon); - boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2); - } - } - if (updateAabb) { - this.aabbCompute(); - } - else { - this.minX = Number.POSITIVE_INFINITY; - this.minY = Number.POSITIVE_INFINITY; - this.maxX = Number.NEGATIVE_INFINITY; - this.maxY = Number.NEGATIVE_INFINITY; - } - }; - SkeletonBounds.prototype.aabbCompute = function () { - var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) { - var polygon = polygons[i]; - var vertices = polygon; - for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) { - var x = vertices[ii]; - var y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - }; - SkeletonBounds.prototype.aabbContainsPoint = function (x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - }; - SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) { - var minX = this.minX; - var minY = this.minY; - var maxX = this.maxX; - var maxY = this.maxY; - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) - return false; - var m = (y2 - y1) / (x2 - x1); - var y = m * (minX - x1) + y1; - if (y > minY && y < maxY) - return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) - return true; - var x = (minY - y1) / m + x1; - if (x > minX && x < maxX) - return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) - return true; - return false; - }; - SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - }; - SkeletonBounds.prototype.containsPoint = function (x, y) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.containsPointPolygon(polygons[i], x, y)) - return this.boundingBoxes[i]; - return null; - }; - SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) { - var vertices = polygon; - var nn = polygon.length; - var prevIndex = nn - 2; - var inside = false; - for (var ii = 0; ii < nn; ii += 2) { - var vertexY = vertices[ii + 1]; - var prevY = vertices[prevIndex + 1]; - if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { - var vertexX = vertices[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) - inside = !inside; - } - prevIndex = ii; - } - return inside; - }; - SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) - return this.boundingBoxes[i]; - return null; - }; - SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) { - var vertices = polygon; - var nn = polygon.length; - var width12 = x1 - x2, height12 = y1 - y2; - var det1 = x1 * y2 - y1 * x2; - var x3 = vertices[nn - 2], y3 = vertices[nn - 1]; - for (var ii = 0; ii < nn; ii += 2) { - var x4 = vertices[ii], y4 = vertices[ii + 1]; - var det2 = x3 * y4 - y3 * x4; - var width34 = x3 - x4, height34 = y3 - y4; - var det3 = width12 * height34 - height12 * width34; - var x = (det1 * width34 - width12 * det2) / det3; - if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { - var y = (det1 * height34 - height12 * det2) / det3; - if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) - return true; - } - x3 = x4; - y3 = y4; - } - return false; - }; - SkeletonBounds.prototype.getPolygon = function (boundingBox) { - if (boundingBox == null) - throw new Error("boundingBox cannot be null."); - var index = this.boundingBoxes.indexOf(boundingBox); - return index == -1 ? null : this.polygons[index]; - }; - SkeletonBounds.prototype.getWidth = function () { - return this.maxX - this.minX; - }; - SkeletonBounds.prototype.getHeight = function () { - return this.maxY - this.minY; - }; - return SkeletonBounds; - }()); - spine.SkeletonBounds = SkeletonBounds; -})(spine || (spine = {})); -var spine; -(function (spine) { - var SkeletonClipping = (function () { - function SkeletonClipping() { - this.triangulator = new spine.Triangulator(); - this.clippingPolygon = new Array(); - this.clipOutput = new Array(); - this.clippedVertices = new Array(); - this.clippedTriangles = new Array(); - this.scratch = new Array(); - } - SkeletonClipping.prototype.clipStart = function (slot, clip) { - if (this.clipAttachment != null) - return 0; - this.clipAttachment = clip; - var n = clip.worldVerticesLength; - var vertices = spine.Utils.setArraySize(this.clippingPolygon, n); - clip.computeWorldVertices(slot, 0, n, vertices, 0, 2); - var clippingPolygon = this.clippingPolygon; - SkeletonClipping.makeClockwise(clippingPolygon); - var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); - for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) { - var polygon = clippingPolygons[i]; - SkeletonClipping.makeClockwise(polygon); - polygon.push(polygon[0]); - polygon.push(polygon[1]); - } - return clippingPolygons.length; - }; - SkeletonClipping.prototype.clipEndWithSlot = function (slot) { - if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data) - this.clipEnd(); - }; - SkeletonClipping.prototype.clipEnd = function () { - if (this.clipAttachment == null) - return; - this.clipAttachment = null; - this.clippingPolygons = null; - this.clippedVertices.length = 0; - this.clippedTriangles.length = 0; - this.clippingPolygon.length = 0; - }; - SkeletonClipping.prototype.isClipping = function () { - return this.clipAttachment != null; - }; - SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) { - var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; - var clippedTriangles = this.clippedTriangles; - var polygons = this.clippingPolygons; - var polygonsCount = this.clippingPolygons.length; - var vertexSize = twoColor ? 12 : 8; - var index = 0; - clippedVertices.length = 0; - clippedTriangles.length = 0; - outer: for (var i = 0; i < trianglesLength; i += 3) { - var vertexOffset = triangles[i] << 1; - var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; - var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 1] << 1; - var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; - var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 2] << 1; - var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; - var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; - for (var p = 0; p < polygonsCount; p++) { - var s = clippedVertices.length; - if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { - var clipOutputLength = clipOutput.length; - if (clipOutputLength == 0) - continue; - var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; - var d = 1 / (d0 * d2 + d1 * (y1 - y3)); - var clipOutputCount = clipOutputLength >> 1; - var clipOutputItems = this.clipOutput; - var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize); - for (var ii = 0; ii < clipOutputLength; ii += 2) { - var x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; - clippedVerticesItems[s] = x; - clippedVerticesItems[s + 1] = y; - clippedVerticesItems[s + 2] = light.r; - clippedVerticesItems[s + 3] = light.g; - clippedVerticesItems[s + 4] = light.b; - clippedVerticesItems[s + 5] = light.a; - var c0 = x - x3, c1 = y - y3; - var a = (d0 * c0 + d1 * c1) * d; - var b = (d4 * c0 + d2 * c1) * d; - var c = 1 - a - b; - clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c; - clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c; - if (twoColor) { - clippedVerticesItems[s + 8] = dark.r; - clippedVerticesItems[s + 9] = dark.g; - clippedVerticesItems[s + 10] = dark.b; - clippedVerticesItems[s + 11] = dark.a; - } - s += vertexSize; - } - s = clippedTriangles.length; - var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); - clipOutputCount--; - for (var ii = 1; ii < clipOutputCount; ii++) { - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = (index + ii); - clippedTrianglesItems[s + 2] = (index + ii + 1); - s += 3; - } - index += clipOutputCount + 1; - } - else { - var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize); - clippedVerticesItems[s] = x1; - clippedVerticesItems[s + 1] = y1; - clippedVerticesItems[s + 2] = light.r; - clippedVerticesItems[s + 3] = light.g; - clippedVerticesItems[s + 4] = light.b; - clippedVerticesItems[s + 5] = light.a; - if (!twoColor) { - clippedVerticesItems[s + 6] = u1; - clippedVerticesItems[s + 7] = v1; - clippedVerticesItems[s + 8] = x2; - clippedVerticesItems[s + 9] = y2; - clippedVerticesItems[s + 10] = light.r; - clippedVerticesItems[s + 11] = light.g; - clippedVerticesItems[s + 12] = light.b; - clippedVerticesItems[s + 13] = light.a; - clippedVerticesItems[s + 14] = u2; - clippedVerticesItems[s + 15] = v2; - clippedVerticesItems[s + 16] = x3; - clippedVerticesItems[s + 17] = y3; - clippedVerticesItems[s + 18] = light.r; - clippedVerticesItems[s + 19] = light.g; - clippedVerticesItems[s + 20] = light.b; - clippedVerticesItems[s + 21] = light.a; - clippedVerticesItems[s + 22] = u3; - clippedVerticesItems[s + 23] = v3; - } - else { - clippedVerticesItems[s + 6] = u1; - clippedVerticesItems[s + 7] = v1; - clippedVerticesItems[s + 8] = dark.r; - clippedVerticesItems[s + 9] = dark.g; - clippedVerticesItems[s + 10] = dark.b; - clippedVerticesItems[s + 11] = dark.a; - clippedVerticesItems[s + 12] = x2; - clippedVerticesItems[s + 13] = y2; - clippedVerticesItems[s + 14] = light.r; - clippedVerticesItems[s + 15] = light.g; - clippedVerticesItems[s + 16] = light.b; - clippedVerticesItems[s + 17] = light.a; - clippedVerticesItems[s + 18] = u2; - clippedVerticesItems[s + 19] = v2; - clippedVerticesItems[s + 20] = dark.r; - clippedVerticesItems[s + 21] = dark.g; - clippedVerticesItems[s + 22] = dark.b; - clippedVerticesItems[s + 23] = dark.a; - clippedVerticesItems[s + 24] = x3; - clippedVerticesItems[s + 25] = y3; - clippedVerticesItems[s + 26] = light.r; - clippedVerticesItems[s + 27] = light.g; - clippedVerticesItems[s + 28] = light.b; - clippedVerticesItems[s + 29] = light.a; - clippedVerticesItems[s + 30] = u3; - clippedVerticesItems[s + 31] = v3; - clippedVerticesItems[s + 32] = dark.r; - clippedVerticesItems[s + 33] = dark.g; - clippedVerticesItems[s + 34] = dark.b; - clippedVerticesItems[s + 35] = dark.a; - } - s = clippedTriangles.length; - var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3); - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = (index + 1); - clippedTrianglesItems[s + 2] = (index + 2); - index += 3; - continue outer; - } - } - } - }; - SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) { - var originalOutput = output; - var clipped = false; - var input = null; - if (clippingArea.length % 4 >= 2) { - input = output; - output = this.scratch; - } - else - input = this.scratch; - input.length = 0; - input.push(x1); - input.push(y1); - input.push(x2); - input.push(y2); - input.push(x3); - input.push(y3); - input.push(x1); - input.push(y1); - output.length = 0; - var clippingVertices = clippingArea; - var clippingVerticesLast = clippingArea.length - 4; - for (var i = 0;; i += 2) { - var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; - var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3]; - var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2; - var inputVertices = input; - var inputVerticesLength = input.length - 2, outputStart = output.length; - for (var ii = 0; ii < inputVerticesLength; ii += 2) { - var inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; - var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3]; - var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0; - if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) { - if (side2) { - output.push(inputX2); - output.push(inputY2); - continue; - } - var c0 = inputY2 - inputY, c2 = inputX2 - inputX; - var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); - if (Math.abs(s) > 0.000001) { - var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; - output.push(edgeX + (edgeX2 - edgeX) * ua); - output.push(edgeY + (edgeY2 - edgeY) * ua); - } - else { - output.push(edgeX); - output.push(edgeY); - } - } - else if (side2) { - var c0 = inputY2 - inputY, c2 = inputX2 - inputX; - var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); - if (Math.abs(s) > 0.000001) { - var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; - output.push(edgeX + (edgeX2 - edgeX) * ua); - output.push(edgeY + (edgeY2 - edgeY) * ua); - } - else { - output.push(edgeX); - output.push(edgeY); - } - output.push(inputX2); - output.push(inputY2); - } - clipped = true; - } - if (outputStart == output.length) { - originalOutput.length = 0; - return true; - } - output.push(output[0]); - output.push(output[1]); - if (i == clippingVerticesLast) - break; - var temp = output; - output = input; - output.length = 0; - input = temp; - } - if (originalOutput != output) { - originalOutput.length = 0; - for (var i = 0, n = output.length - 2; i < n; i++) - originalOutput[i] = output[i]; - } - else - originalOutput.length = originalOutput.length - 2; - return clipped; - }; - SkeletonClipping.makeClockwise = function (polygon) { - var vertices = polygon; - var verticeslength = polygon.length; - var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; - for (var i = 0, n = verticeslength - 3; i < n; i += 2) { - p1x = vertices[i]; - p1y = vertices[i + 1]; - p2x = vertices[i + 2]; - p2y = vertices[i + 3]; - area += p1x * p2y - p2x * p1y; - } - if (area < 0) - return; - for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { - var x = vertices[i], y = vertices[i + 1]; - var other = lastX - i; - vertices[i] = vertices[other]; - vertices[i + 1] = vertices[other + 1]; - vertices[other] = x; - vertices[other + 1] = y; - } - }; - return SkeletonClipping; - }()); - spine.SkeletonClipping = SkeletonClipping; -})(spine || (spine = {})); -var spine; -(function (spine) { - var SkeletonData = (function () { - function SkeletonData() { - this.bones = new Array(); - this.slots = new Array(); - this.skins = new Array(); - this.events = new Array(); - this.animations = new Array(); - this.ikConstraints = new Array(); - this.transformConstraints = new Array(); - this.pathConstraints = new Array(); - this.fps = 0; - } - SkeletonData.prototype.findBone = function (boneName) { - if (boneName == null) - throw new Error("boneName cannot be null."); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (bone.name == boneName) - return bone; - } - return null; - }; - SkeletonData.prototype.findBoneIndex = function (boneName) { - if (boneName == null) - throw new Error("boneName cannot be null."); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) - return i; - return -1; - }; - SkeletonData.prototype.findSlot = function (slotName) { - if (slotName == null) - throw new Error("slotName cannot be null."); - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.name == slotName) - return slot; - } - return null; - }; - SkeletonData.prototype.findSlotIndex = function (slotName) { - if (slotName == null) - throw new Error("slotName cannot be null."); - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].name == slotName) - return i; - return -1; - }; - SkeletonData.prototype.findSkin = function (skinName) { - if (skinName == null) - throw new Error("skinName cannot be null."); - var skins = this.skins; - for (var i = 0, n = skins.length; i < n; i++) { - var skin = skins[i]; - if (skin.name == skinName) - return skin; - } - return null; - }; - SkeletonData.prototype.findEvent = function (eventDataName) { - if (eventDataName == null) - throw new Error("eventDataName cannot be null."); - var events = this.events; - for (var i = 0, n = events.length; i < n; i++) { - var event_4 = events[i]; - if (event_4.name == eventDataName) - return event_4; - } - return null; - }; - SkeletonData.prototype.findAnimation = function (animationName) { - if (animationName == null) - throw new Error("animationName cannot be null."); - var animations = this.animations; - for (var i = 0, n = animations.length; i < n; i++) { - var animation = animations[i]; - if (animation.name == animationName) - return animation; - } - return null; - }; - SkeletonData.prototype.findIkConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var constraint = ikConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - }; - SkeletonData.prototype.findTransformConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var transformConstraints = this.transformConstraints; - for (var i = 0, n = transformConstraints.length; i < n; i++) { - var constraint = transformConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - }; - SkeletonData.prototype.findPathConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var pathConstraints = this.pathConstraints; - for (var i = 0, n = pathConstraints.length; i < n; i++) { - var constraint = pathConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - }; - SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) { - if (pathConstraintName == null) - throw new Error("pathConstraintName cannot be null."); - var pathConstraints = this.pathConstraints; - for (var i = 0, n = pathConstraints.length; i < n; i++) - if (pathConstraints[i].name == pathConstraintName) - return i; - return -1; - }; - return SkeletonData; - }()); - spine.SkeletonData = SkeletonData; -})(spine || (spine = {})); -var spine; -(function (spine) { - var SkeletonJson = (function () { - function SkeletonJson(attachmentLoader) { - this.scale = 1; - this.linkedMeshes = new Array(); - this.attachmentLoader = attachmentLoader; - } - SkeletonJson.prototype.readSkeletonData = function (json) { - var scale = this.scale; - var skeletonData = new spine.SkeletonData(); - var root = typeof (json) === "string" ? JSON.parse(json) : json; - var skeletonMap = root.skeleton; - if (skeletonMap != null) { - skeletonData.hash = skeletonMap.hash; - skeletonData.version = skeletonMap.spine; - skeletonData.width = skeletonMap.width; - skeletonData.height = skeletonMap.height; - skeletonData.fps = skeletonMap.fps; - skeletonData.imagesPath = skeletonMap.images; - } - if (root.bones) { - for (var i = 0; i < root.bones.length; i++) { - var boneMap = root.bones[i]; - var parent_2 = null; - var parentName = this.getValue(boneMap, "parent", null); - if (parentName != null) { - parent_2 = skeletonData.findBone(parentName); - if (parent_2 == null) - throw new Error("Parent bone not found: " + parentName); - } - var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2); - data.length = this.getValue(boneMap, "length", 0) * scale; - data.x = this.getValue(boneMap, "x", 0) * scale; - data.y = this.getValue(boneMap, "y", 0) * scale; - data.rotation = this.getValue(boneMap, "rotation", 0); - data.scaleX = this.getValue(boneMap, "scaleX", 1); - data.scaleY = this.getValue(boneMap, "scaleY", 1); - data.shearX = this.getValue(boneMap, "shearX", 0); - data.shearY = this.getValue(boneMap, "shearY", 0); - data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal")); - skeletonData.bones.push(data); - } - } - if (root.slots) { - for (var i = 0; i < root.slots.length; i++) { - var slotMap = root.slots[i]; - var slotName = slotMap.name; - var boneName = slotMap.bone; - var boneData = skeletonData.findBone(boneName); - if (boneData == null) - throw new Error("Slot bone not found: " + boneName); - var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData); - var color = this.getValue(slotMap, "color", null); - if (color != null) - data.color.setFromString(color); - var dark = this.getValue(slotMap, "dark", null); - if (dark != null) { - data.darkColor = new spine.Color(1, 1, 1, 1); - data.darkColor.setFromString(dark); - } - data.attachmentName = this.getValue(slotMap, "attachment", null); - data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, "blend", "normal")); - skeletonData.slots.push(data); - } - } - if (root.ik) { - for (var i = 0; i < root.ik.length; i++) { - var constraintMap = root.ik[i]; - var data = new spine.IkConstraintData(constraintMap.name); - data.order = this.getValue(constraintMap, "order", 0); - for (var j = 0; j < constraintMap.bones.length; j++) { - var boneName = constraintMap.bones[j]; - var bone = skeletonData.findBone(boneName); - if (bone == null) - throw new Error("IK bone not found: " + boneName); - data.bones.push(bone); - } - var targetName = constraintMap.target; - data.target = skeletonData.findBone(targetName); - if (data.target == null) - throw new Error("IK target bone not found: " + targetName); - data.mix = this.getValue(constraintMap, "mix", 1); - data.bendDirection = this.getValue(constraintMap, "bendPositive", true) ? 1 : -1; - data.compress = this.getValue(constraintMap, "compress", false); - data.stretch = this.getValue(constraintMap, "stretch", false); - data.uniform = this.getValue(constraintMap, "uniform", false); - skeletonData.ikConstraints.push(data); - } - } - if (root.transform) { - for (var i = 0; i < root.transform.length; i++) { - var constraintMap = root.transform[i]; - var data = new spine.TransformConstraintData(constraintMap.name); - data.order = this.getValue(constraintMap, "order", 0); - for (var j = 0; j < constraintMap.bones.length; j++) { - var boneName = constraintMap.bones[j]; - var bone = skeletonData.findBone(boneName); - if (bone == null) - throw new Error("Transform constraint bone not found: " + boneName); - data.bones.push(bone); - } - var targetName = constraintMap.target; - data.target = skeletonData.findBone(targetName); - if (data.target == null) - throw new Error("Transform constraint target bone not found: " + targetName); - data.local = this.getValue(constraintMap, "local", false); - data.relative = this.getValue(constraintMap, "relative", false); - data.offsetRotation = this.getValue(constraintMap, "rotation", 0); - data.offsetX = this.getValue(constraintMap, "x", 0) * scale; - data.offsetY = this.getValue(constraintMap, "y", 0) * scale; - data.offsetScaleX = this.getValue(constraintMap, "scaleX", 0); - data.offsetScaleY = this.getValue(constraintMap, "scaleY", 0); - data.offsetShearY = this.getValue(constraintMap, "shearY", 0); - data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); - data.translateMix = this.getValue(constraintMap, "translateMix", 1); - data.scaleMix = this.getValue(constraintMap, "scaleMix", 1); - data.shearMix = this.getValue(constraintMap, "shearMix", 1); - skeletonData.transformConstraints.push(data); - } - } - if (root.path) { - for (var i = 0; i < root.path.length; i++) { - var constraintMap = root.path[i]; - var data = new spine.PathConstraintData(constraintMap.name); - data.order = this.getValue(constraintMap, "order", 0); - for (var j = 0; j < constraintMap.bones.length; j++) { - var boneName = constraintMap.bones[j]; - var bone = skeletonData.findBone(boneName); - if (bone == null) - throw new Error("Transform constraint bone not found: " + boneName); - data.bones.push(bone); - } - var targetName = constraintMap.target; - data.target = skeletonData.findSlot(targetName); - if (data.target == null) - throw new Error("Path target slot not found: " + targetName); - data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, "positionMode", "percent")); - data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, "spacingMode", "length")); - data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, "rotateMode", "tangent")); - data.offsetRotation = this.getValue(constraintMap, "rotation", 0); - data.position = this.getValue(constraintMap, "position", 0); - if (data.positionMode == spine.PositionMode.Fixed) - data.position *= scale; - data.spacing = this.getValue(constraintMap, "spacing", 0); - if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) - data.spacing *= scale; - data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); - data.translateMix = this.getValue(constraintMap, "translateMix", 1); - skeletonData.pathConstraints.push(data); - } - } - if (root.skins) { - for (var skinName in root.skins) { - var skinMap = root.skins[skinName]; - var skin = new spine.Skin(skinName); - for (var slotName in skinMap) { - var slotIndex = skeletonData.findSlotIndex(slotName); - if (slotIndex == -1) - throw new Error("Slot not found: " + slotName); - var slotMap = skinMap[slotName]; - for (var entryName in slotMap) { - var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData); - if (attachment != null) - skin.addAttachment(slotIndex, entryName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") - skeletonData.defaultSkin = skin; - } - } - for (var i = 0, n = this.linkedMeshes.length; i < n; i++) { - var linkedMesh = this.linkedMeshes[i]; - var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); - if (skin == null) - throw new Error("Skin not found: " + linkedMesh.skin); - var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); - if (parent_3 == null) - throw new Error("Parent mesh not found: " + linkedMesh.parent); - linkedMesh.mesh.setParentMesh(parent_3); - linkedMesh.mesh.updateUVs(); - } - this.linkedMeshes.length = 0; - if (root.events) { - for (var eventName in root.events) { - var eventMap = root.events[eventName]; - var data = new spine.EventData(eventName); - data.intValue = this.getValue(eventMap, "int", 0); - data.floatValue = this.getValue(eventMap, "float", 0); - data.stringValue = this.getValue(eventMap, "string", ""); - data.audioPath = this.getValue(eventMap, "audio", null); - if (data.audioPath != null) { - data.volume = this.getValue(eventMap, "volume", 1); - data.balance = this.getValue(eventMap, "balance", 0); - } - skeletonData.events.push(data); - } - } - if (root.animations) { - for (var animationName in root.animations) { - var animationMap = root.animations[animationName]; - this.readAnimation(animationMap, animationName, skeletonData); - } - } - return skeletonData; - }; - SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) { - var scale = this.scale; - name = this.getValue(map, "name", name); - var type = this.getValue(map, "type", "region"); - switch (type) { - case "region": { - var path = this.getValue(map, "path", name); - var region = this.attachmentLoader.newRegionAttachment(skin, name, path); - if (region == null) - return null; - region.path = path; - region.x = this.getValue(map, "x", 0) * scale; - region.y = this.getValue(map, "y", 0) * scale; - region.scaleX = this.getValue(map, "scaleX", 1); - region.scaleY = this.getValue(map, "scaleY", 1); - region.rotation = this.getValue(map, "rotation", 0); - region.width = map.width * scale; - region.height = map.height * scale; - var color = this.getValue(map, "color", null); - if (color != null) - region.color.setFromString(color); - region.updateOffset(); - return region; - } - case "boundingbox": { - var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - if (box == null) - return null; - this.readVertices(map, box, map.vertexCount << 1); - var color = this.getValue(map, "color", null); - if (color != null) - box.color.setFromString(color); - return box; - } - case "mesh": - case "linkedmesh": { - var path = this.getValue(map, "path", name); - var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); - if (mesh == null) - return null; - mesh.path = path; - var color = this.getValue(map, "color", null); - if (color != null) - mesh.color.setFromString(color); - var parent_4 = this.getValue(map, "parent", null); - if (parent_4 != null) { - mesh.inheritDeform = this.getValue(map, "deform", true); - this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, "skin", null), slotIndex, parent_4)); - return mesh; - } - var uvs = map.uvs; - this.readVertices(map, mesh, uvs.length); - mesh.triangles = map.triangles; - mesh.regionUVs = uvs; - mesh.updateUVs(); - mesh.hullLength = this.getValue(map, "hull", 0) * 2; - return mesh; - } - case "path": { - var path = this.attachmentLoader.newPathAttachment(skin, name); - if (path == null) - return null; - path.closed = this.getValue(map, "closed", false); - path.constantSpeed = this.getValue(map, "constantSpeed", true); - var vertexCount = map.vertexCount; - this.readVertices(map, path, vertexCount << 1); - var lengths = spine.Utils.newArray(vertexCount / 3, 0); - for (var i = 0; i < map.lengths.length; i++) - lengths[i] = map.lengths[i] * scale; - path.lengths = lengths; - var color = this.getValue(map, "color", null); - if (color != null) - path.color.setFromString(color); - return path; - } - case "point": { - var point = this.attachmentLoader.newPointAttachment(skin, name); - if (point == null) - return null; - point.x = this.getValue(map, "x", 0) * scale; - point.y = this.getValue(map, "y", 0) * scale; - point.rotation = this.getValue(map, "rotation", 0); - var color = this.getValue(map, "color", null); - if (color != null) - point.color.setFromString(color); - return point; - } - case "clipping": { - var clip = this.attachmentLoader.newClippingAttachment(skin, name); - if (clip == null) - return null; - var end = this.getValue(map, "end", null); - if (end != null) { - var slot = skeletonData.findSlot(end); - if (slot == null) - throw new Error("Clipping end slot not found: " + end); - clip.endSlot = slot; - } - var vertexCount = map.vertexCount; - this.readVertices(map, clip, vertexCount << 1); - var color = this.getValue(map, "color", null); - if (color != null) - clip.color.setFromString(color); - return clip; - } - } - return null; - }; - SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) { - var scale = this.scale; - attachment.worldVerticesLength = verticesLength; - var vertices = map.vertices; - if (verticesLength == vertices.length) { - var scaledVertices = spine.Utils.toFloatArray(vertices); - if (scale != 1) { - for (var i = 0, n = vertices.length; i < n; i++) - scaledVertices[i] *= scale; - } - attachment.vertices = scaledVertices; - return; - } - var weights = new Array(); - var bones = new Array(); - for (var i = 0, n = vertices.length; i < n;) { - var boneCount = vertices[i++]; - bones.push(boneCount); - for (var nn = i + boneCount * 4; i < nn; i += 4) { - bones.push(vertices[i]); - weights.push(vertices[i + 1] * scale); - weights.push(vertices[i + 2] * scale); - weights.push(vertices[i + 3]); - } - } - attachment.bones = bones; - attachment.vertices = spine.Utils.toFloatArray(weights); - }; - SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) { - var scale = this.scale; - var timelines = new Array(); - var duration = 0; - if (map.slots) { - for (var slotName in map.slots) { - var slotMap = map.slots[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - if (slotIndex == -1) - throw new Error("Slot not found: " + slotName); - for (var timelineName in slotMap) { - var timelineMap = slotMap[timelineName]; - if (timelineName == "attachment") { - var timeline = new spine.AttachmentTimeline(timelineMap.length); - timeline.slotIndex = slotIndex; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - timeline.setFrame(frameIndex++, valueMap.time, valueMap.name); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - else if (timelineName == "color") { - var timeline = new spine.ColorTimeline(timelineMap.length); - timeline.slotIndex = slotIndex; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - var color = new spine.Color(); - color.setFromString(valueMap.color); - timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]); - } - else if (timelineName == "twoColor") { - var timeline = new spine.TwoColorTimeline(timelineMap.length); - timeline.slotIndex = slotIndex; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - var light = new spine.Color(); - var dark = new spine.Color(); - light.setFromString(valueMap.light); - dark.setFromString(valueMap.dark); - timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]); - } - else - throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"); - } - } - } - if (map.bones) { - for (var boneName in map.bones) { - var boneMap = map.bones[boneName]; - var boneIndex = skeletonData.findBoneIndex(boneName); - if (boneIndex == -1) - throw new Error("Bone not found: " + boneName); - for (var timelineName in boneMap) { - var timelineMap = boneMap[timelineName]; - if (timelineName === "rotate") { - var timeline = new spine.RotateTimeline(timelineMap.length); - timeline.boneIndex = boneIndex; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - timeline.setFrame(frameIndex, valueMap.time, valueMap.angle); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]); - } - else if (timelineName === "translate" || timelineName === "scale" || timelineName === "shear") { - var timeline = null; - var timelineScale = 1; - if (timelineName === "scale") - timeline = new spine.ScaleTimeline(timelineMap.length); - else if (timelineName === "shear") - timeline = new spine.ShearTimeline(timelineMap.length); - else { - timeline = new spine.TranslateTimeline(timelineMap.length); - timelineScale = scale; - } - timeline.boneIndex = boneIndex; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - var x = this.getValue(valueMap, "x", 0), y = this.getValue(valueMap, "y", 0); - timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]); - } - else - throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"); - } - } - } - if (map.ik) { - for (var constraintName in map.ik) { - var constraintMap = map.ik[constraintName]; - var constraint = skeletonData.findIkConstraint(constraintName); - var timeline = new spine.IkConstraintTimeline(constraintMap.length); - timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint); - var frameIndex = 0; - for (var i = 0; i < constraintMap.length; i++) { - var valueMap = constraintMap[i]; - timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "mix", 1), this.getValue(valueMap, "bendPositive", true) ? 1 : -1, this.getValue(valueMap, "compress", false), this.getValue(valueMap, "stretch", false)); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]); - } - } - if (map.transform) { - for (var constraintName in map.transform) { - var constraintMap = map.transform[constraintName]; - var constraint = skeletonData.findTransformConstraint(constraintName); - var timeline = new spine.TransformConstraintTimeline(constraintMap.length); - timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint); - var frameIndex = 0; - for (var i = 0; i < constraintMap.length; i++) { - var valueMap = constraintMap[i]; - timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1), this.getValue(valueMap, "scaleMix", 1), this.getValue(valueMap, "shearMix", 1)); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]); - } - } - if (map.paths) { - for (var constraintName in map.paths) { - var constraintMap = map.paths[constraintName]; - var index = skeletonData.findPathConstraintIndex(constraintName); - if (index == -1) - throw new Error("Path constraint not found: " + constraintName); - var data = skeletonData.pathConstraints[index]; - for (var timelineName in constraintMap) { - var timelineMap = constraintMap[timelineName]; - if (timelineName === "position" || timelineName === "spacing") { - var timeline = null; - var timelineScale = 1; - if (timelineName === "spacing") { - timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length); - if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) - timelineScale = scale; - } - else { - timeline = new spine.PathConstraintPositionTimeline(timelineMap.length); - if (data.positionMode == spine.PositionMode.Fixed) - timelineScale = scale; - } - timeline.pathConstraintIndex = index; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]); - } - else if (timelineName === "mix") { - var timeline = new spine.PathConstraintMixTimeline(timelineMap.length); - timeline.pathConstraintIndex = index; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1)); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]); - } - } - } - } - if (map.deform) { - for (var deformName in map.deform) { - var deformMap = map.deform[deformName]; - var skin = skeletonData.findSkin(deformName); - if (skin == null) - throw new Error("Skin not found: " + deformName); - for (var slotName in deformMap) { - var slotMap = deformMap[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - if (slotIndex == -1) - throw new Error("Slot not found: " + slotMap.name); - for (var timelineName in slotMap) { - var timelineMap = slotMap[timelineName]; - var attachment = skin.getAttachment(slotIndex, timelineName); - if (attachment == null) - throw new Error("Deform attachment not found: " + timelineMap.name); - var weighted = attachment.bones != null; - var vertices = attachment.vertices; - var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; - var timeline = new spine.DeformTimeline(timelineMap.length); - timeline.slotIndex = slotIndex; - timeline.attachment = attachment; - var frameIndex = 0; - for (var j = 0; j < timelineMap.length; j++) { - var valueMap = timelineMap[j]; - var deform = void 0; - var verticesValue = this.getValue(valueMap, "vertices", null); - if (verticesValue == null) - deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices; - else { - deform = spine.Utils.newFloatArray(deformLength); - var start = this.getValue(valueMap, "offset", 0); - spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); - if (scale != 1) { - for (var i = start, n = i + verticesValue.length; i < n; i++) - deform[i] *= scale; - } - if (!weighted) { - for (var i = 0; i < deformLength; i++) - deform[i] += vertices[i]; - } - } - timeline.setFrame(frameIndex, valueMap.time, deform); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - } - } - } - var drawOrderNode = map.drawOrder; - if (drawOrderNode == null) - drawOrderNode = map.draworder; - if (drawOrderNode != null) { - var timeline = new spine.DrawOrderTimeline(drawOrderNode.length); - var slotCount = skeletonData.slots.length; - var frameIndex = 0; - for (var j = 0; j < drawOrderNode.length; j++) { - var drawOrderMap = drawOrderNode[j]; - var drawOrder = null; - var offsets = this.getValue(drawOrderMap, "offsets", null); - if (offsets != null) { - drawOrder = spine.Utils.newArray(slotCount, -1); - var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0); - var originalIndex = 0, unchangedIndex = 0; - for (var i = 0; i < offsets.length; i++) { - var offsetMap = offsets[i]; - var slotIndex = skeletonData.findSlotIndex(offsetMap.slot); - if (slotIndex == -1) - throw new Error("Slot not found: " + offsetMap.slot); - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - drawOrder[originalIndex + offsetMap.offset] = originalIndex++; - } - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - for (var i = slotCount - 1; i >= 0; i--) - if (drawOrder[i] == -1) - drawOrder[i] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - if (map.events) { - var timeline = new spine.EventTimeline(map.events.length); - var frameIndex = 0; - for (var i = 0; i < map.events.length; i++) { - var eventMap = map.events[i]; - var eventData = skeletonData.findEvent(eventMap.name); - if (eventData == null) - throw new Error("Event not found: " + eventMap.name); - var event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData); - event_5.intValue = this.getValue(eventMap, "int", eventData.intValue); - event_5.floatValue = this.getValue(eventMap, "float", eventData.floatValue); - event_5.stringValue = this.getValue(eventMap, "string", eventData.stringValue); - if (event_5.data.audioPath != null) { - event_5.volume = this.getValue(eventMap, "volume", 1); - event_5.balance = this.getValue(eventMap, "balance", 0); - } - timeline.setFrame(frameIndex++, event_5); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - if (isNaN(duration)) { - throw new Error("Error while parsing animation, duration is NaN"); - } - skeletonData.animations.push(new spine.Animation(name, timelines, duration)); - }; - SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) { - if (!map.curve) - return; - if (map.curve === "stepped") - timeline.setStepped(frameIndex); - else if (Object.prototype.toString.call(map.curve) === '[object Array]') { - var curve = map.curve; - timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); - } - }; - SkeletonJson.prototype.getValue = function (map, prop, defaultValue) { - return map[prop] !== undefined ? map[prop] : defaultValue; - }; - SkeletonJson.blendModeFromString = function (str) { - str = str.toLowerCase(); - if (str == "normal") - return spine.BlendMode.Normal; - if (str == "additive") - return spine.BlendMode.Additive; - if (str == "multiply") - return spine.BlendMode.Multiply; - if (str == "screen") - return spine.BlendMode.Screen; - throw new Error("Unknown blend mode: " + str); - }; - SkeletonJson.positionModeFromString = function (str) { - str = str.toLowerCase(); - if (str == "fixed") - return spine.PositionMode.Fixed; - if (str == "percent") - return spine.PositionMode.Percent; - throw new Error("Unknown position mode: " + str); - }; - SkeletonJson.spacingModeFromString = function (str) { - str = str.toLowerCase(); - if (str == "length") - return spine.SpacingMode.Length; - if (str == "fixed") - return spine.SpacingMode.Fixed; - if (str == "percent") - return spine.SpacingMode.Percent; - throw new Error("Unknown position mode: " + str); - }; - SkeletonJson.rotateModeFromString = function (str) { - str = str.toLowerCase(); - if (str == "tangent") - return spine.RotateMode.Tangent; - if (str == "chain") - return spine.RotateMode.Chain; - if (str == "chainscale") - return spine.RotateMode.ChainScale; - throw new Error("Unknown rotate mode: " + str); - }; - SkeletonJson.transformModeFromString = function (str) { - str = str.toLowerCase(); - if (str == "normal") - return spine.TransformMode.Normal; - if (str == "onlytranslation") - return spine.TransformMode.OnlyTranslation; - if (str == "norotationorreflection") - return spine.TransformMode.NoRotationOrReflection; - if (str == "noscale") - return spine.TransformMode.NoScale; - if (str == "noscaleorreflection") - return spine.TransformMode.NoScaleOrReflection; - throw new Error("Unknown transform mode: " + str); - }; - return SkeletonJson; - }()); - spine.SkeletonJson = SkeletonJson; - var LinkedMesh = (function () { - function LinkedMesh(mesh, skin, slotIndex, parent) { - this.mesh = mesh; - this.skin = skin; - this.slotIndex = slotIndex; - this.parent = parent; - } - return LinkedMesh; - }()); -})(spine || (spine = {})); -var spine; -(function (spine) { - var Skin = (function () { - function Skin(name) { - this.attachments = new Array(); - if (name == null) - throw new Error("name cannot be null."); - this.name = name; - } - Skin.prototype.addAttachment = function (slotIndex, name, attachment) { - if (attachment == null) - throw new Error("attachment cannot be null."); - var attachments = this.attachments; - if (slotIndex >= attachments.length) - attachments.length = slotIndex + 1; - if (!attachments[slotIndex]) - attachments[slotIndex] = {}; - attachments[slotIndex][name] = attachment; - }; - Skin.prototype.getAttachment = function (slotIndex, name) { - var dictionary = this.attachments[slotIndex]; - return dictionary ? dictionary[name] : null; - }; - Skin.prototype.attachAll = function (skeleton, oldSkin) { - var slotIndex = 0; - for (var i = 0; i < skeleton.slots.length; i++) { - var slot = skeleton.slots[i]; - var slotAttachment = slot.getAttachment(); - if (slotAttachment && slotIndex < oldSkin.attachments.length) { - var dictionary = oldSkin.attachments[slotIndex]; - for (var key in dictionary) { - var skinAttachment = dictionary[key]; - if (slotAttachment == skinAttachment) { - var attachment = this.getAttachment(slotIndex, key); - if (attachment != null) - slot.setAttachment(attachment); - break; - } - } - } - slotIndex++; - } - }; - return Skin; - }()); - spine.Skin = Skin; -})(spine || (spine = {})); -var spine; -(function (spine) { - var Slot = (function () { - function Slot(data, bone) { - this.attachmentVertices = new Array(); - if (data == null) - throw new Error("data cannot be null."); - if (bone == null) - throw new Error("bone cannot be null."); - this.data = data; - this.bone = bone; - this.color = new spine.Color(); - this.darkColor = data.darkColor == null ? null : new spine.Color(); - this.setToSetupPose(); - } - Slot.prototype.getAttachment = function () { - return this.attachment; - }; - Slot.prototype.setAttachment = function (attachment) { - if (this.attachment == attachment) - return; - this.attachment = attachment; - this.attachmentTime = this.bone.skeleton.time; - this.attachmentVertices.length = 0; - }; - Slot.prototype.setAttachmentTime = function (time) { - this.attachmentTime = this.bone.skeleton.time - time; - }; - Slot.prototype.getAttachmentTime = function () { - return this.bone.skeleton.time - this.attachmentTime; - }; - Slot.prototype.setToSetupPose = function () { - this.color.setFromColor(this.data.color); - if (this.darkColor != null) - this.darkColor.setFromColor(this.data.darkColor); - if (this.data.attachmentName == null) - this.attachment = null; - else { - this.attachment = null; - this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)); - } - }; - return Slot; - }()); - spine.Slot = Slot; -})(spine || (spine = {})); -var spine; -(function (spine) { - var SlotData = (function () { - function SlotData(index, name, boneData) { - this.color = new spine.Color(1, 1, 1, 1); - if (index < 0) - throw new Error("index must be >= 0."); - if (name == null) - throw new Error("name cannot be null."); - if (boneData == null) - throw new Error("boneData cannot be null."); - this.index = index; - this.name = name; - this.boneData = boneData; - } - return SlotData; - }()); - spine.SlotData = SlotData; -})(spine || (spine = {})); -var spine; -(function (spine) { - var Texture = (function () { - function Texture(image) { - this._image = image; - } - Texture.prototype.getImage = function () { - return this._image; - }; - Texture.filterFromString = function (text) { - switch (text.toLowerCase()) { - case "nearest": return TextureFilter.Nearest; - case "linear": return TextureFilter.Linear; - case "mipmap": return TextureFilter.MipMap; - case "mipmapnearestnearest": return TextureFilter.MipMapNearestNearest; - case "mipmaplinearnearest": return TextureFilter.MipMapLinearNearest; - case "mipmapnearestlinear": return TextureFilter.MipMapNearestLinear; - case "mipmaplinearlinear": return TextureFilter.MipMapLinearLinear; - default: throw new Error("Unknown texture filter " + text); - } - }; - Texture.wrapFromString = function (text) { - switch (text.toLowerCase()) { - case "mirroredtepeat": return TextureWrap.MirroredRepeat; - case "clamptoedge": return TextureWrap.ClampToEdge; - case "repeat": return TextureWrap.Repeat; - default: throw new Error("Unknown texture wrap " + text); - } - }; - return Texture; - }()); - spine.Texture = Texture; - var TextureFilter; - (function (TextureFilter) { - TextureFilter[TextureFilter["Nearest"] = 9728] = "Nearest"; - TextureFilter[TextureFilter["Linear"] = 9729] = "Linear"; - TextureFilter[TextureFilter["MipMap"] = 9987] = "MipMap"; - TextureFilter[TextureFilter["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; - TextureFilter[TextureFilter["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; - TextureFilter[TextureFilter["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; - TextureFilter[TextureFilter["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; - })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {})); - var TextureWrap; - (function (TextureWrap) { - TextureWrap[TextureWrap["MirroredRepeat"] = 33648] = "MirroredRepeat"; - TextureWrap[TextureWrap["ClampToEdge"] = 33071] = "ClampToEdge"; - TextureWrap[TextureWrap["Repeat"] = 10497] = "Repeat"; - })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {})); - var TextureRegion = (function () { - function TextureRegion() { - this.u = 0; - this.v = 0; - this.u2 = 0; - this.v2 = 0; - this.width = 0; - this.height = 0; - this.rotate = false; - this.offsetX = 0; - this.offsetY = 0; - this.originalWidth = 0; - this.originalHeight = 0; - } - return TextureRegion; - }()); - spine.TextureRegion = TextureRegion; - var FakeTexture = (function (_super) { - __extends(FakeTexture, _super); - function FakeTexture() { - return _super !== null && _super.apply(this, arguments) || this; - } - FakeTexture.prototype.setFilters = function (minFilter, magFilter) { }; - FakeTexture.prototype.setWraps = function (uWrap, vWrap) { }; - FakeTexture.prototype.dispose = function () { }; - return FakeTexture; - }(Texture)); - spine.FakeTexture = FakeTexture; -})(spine || (spine = {})); -var spine; -(function (spine) { - var TextureAtlas = (function () { - function TextureAtlas(atlasText, textureLoader) { - this.pages = new Array(); - this.regions = new Array(); - this.load(atlasText, textureLoader); - } - TextureAtlas.prototype.load = function (atlasText, textureLoader) { - if (textureLoader == null) - throw new Error("textureLoader cannot be null."); - var reader = new TextureAtlasReader(atlasText); - var tuple = new Array(4); - var page = null; - while (true) { - var line = reader.readLine(); - if (line == null) - break; - line = line.trim(); - if (line.length == 0) - page = null; - else if (!page) { - page = new TextureAtlasPage(); - page.name = line; - if (reader.readTuple(tuple) == 2) { - page.width = parseInt(tuple[0]); - page.height = parseInt(tuple[1]); - reader.readTuple(tuple); - } - reader.readTuple(tuple); - page.minFilter = spine.Texture.filterFromString(tuple[0]); - page.magFilter = spine.Texture.filterFromString(tuple[1]); - var direction = reader.readValue(); - page.uWrap = spine.TextureWrap.ClampToEdge; - page.vWrap = spine.TextureWrap.ClampToEdge; - if (direction == "x") - page.uWrap = spine.TextureWrap.Repeat; - else if (direction == "y") - page.vWrap = spine.TextureWrap.Repeat; - else if (direction == "xy") - page.uWrap = page.vWrap = spine.TextureWrap.Repeat; - page.texture = textureLoader(line); - page.texture.setFilters(page.minFilter, page.magFilter); - page.texture.setWraps(page.uWrap, page.vWrap); - page.width = page.texture.getImage().width; - page.height = page.texture.getImage().height; - this.pages.push(page); - } - else { - var region = new TextureAtlasRegion(); - region.name = line; - region.page = page; - region.rotate = reader.readValue() == "true"; - reader.readTuple(tuple); - var x = parseInt(tuple[0]); - var y = parseInt(tuple[1]); - reader.readTuple(tuple); - var width = parseInt(tuple[0]); - var height = parseInt(tuple[1]); - region.u = x / page.width; - region.v = y / page.height; - if (region.rotate) { - region.u2 = (x + height) / page.width; - region.v2 = (y + width) / page.height; - } - else { - region.u2 = (x + width) / page.width; - region.v2 = (y + height) / page.height; - } - region.x = x; - region.y = y; - region.width = Math.abs(width); - region.height = Math.abs(height); - if (reader.readTuple(tuple) == 4) { - if (reader.readTuple(tuple) == 4) { - reader.readTuple(tuple); - } - } - region.originalWidth = parseInt(tuple[0]); - region.originalHeight = parseInt(tuple[1]); - reader.readTuple(tuple); - region.offsetX = parseInt(tuple[0]); - region.offsetY = parseInt(tuple[1]); - region.index = parseInt(reader.readValue()); - region.texture = page.texture; - this.regions.push(region); - } - } - }; - TextureAtlas.prototype.findRegion = function (name) { - for (var i = 0; i < this.regions.length; i++) { - if (this.regions[i].name == name) { - return this.regions[i]; - } - } - return null; - }; - TextureAtlas.prototype.dispose = function () { - for (var i = 0; i < this.pages.length; i++) { - this.pages[i].texture.dispose(); - } - }; - return TextureAtlas; - }()); - spine.TextureAtlas = TextureAtlas; - var TextureAtlasReader = (function () { - function TextureAtlasReader(text) { - this.index = 0; - this.lines = text.split(/\r\n|\r|\n/); - } - TextureAtlasReader.prototype.readLine = function () { - if (this.index >= this.lines.length) - return null; - return this.lines[this.index++]; - }; - TextureAtlasReader.prototype.readValue = function () { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) - throw new Error("Invalid line: " + line); - return line.substring(colon + 1).trim(); - }; - TextureAtlasReader.prototype.readTuple = function (tuple) { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) - throw new Error("Invalid line: " + line); - var i = 0, lastMatch = colon + 1; - for (; i < 3; i++) { - var comma = line.indexOf(",", lastMatch); - if (comma == -1) - break; - tuple[i] = line.substr(lastMatch, comma - lastMatch).trim(); - lastMatch = comma + 1; - } - tuple[i] = line.substring(lastMatch).trim(); - return i + 1; - }; - return TextureAtlasReader; - }()); - var TextureAtlasPage = (function () { - function TextureAtlasPage() { - } - return TextureAtlasPage; - }()); - spine.TextureAtlasPage = TextureAtlasPage; - var TextureAtlasRegion = (function (_super) { - __extends(TextureAtlasRegion, _super); - function TextureAtlasRegion() { - return _super !== null && _super.apply(this, arguments) || this; - } - return TextureAtlasRegion; - }(spine.TextureRegion)); - spine.TextureAtlasRegion = TextureAtlasRegion; -})(spine || (spine = {})); -var spine; -(function (spine) { - var TransformConstraint = (function () { - function TransformConstraint(data, skeleton) { - this.rotateMix = 0; - this.translateMix = 0; - this.scaleMix = 0; - this.shearMix = 0; - this.temp = new spine.Vector2(); - if (data == null) - throw new Error("data cannot be null."); - if (skeleton == null) - throw new Error("skeleton cannot be null."); - this.data = data; - this.rotateMix = data.rotateMix; - this.translateMix = data.translateMix; - this.scaleMix = data.scaleMix; - this.shearMix = data.shearMix; - this.bones = new Array(); - for (var i = 0; i < data.bones.length; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); - } - TransformConstraint.prototype.apply = function () { - this.update(); - }; - TransformConstraint.prototype.update = function () { - if (this.data.local) { - if (this.data.relative) - this.applyRelativeLocal(); - else - this.applyAbsoluteLocal(); - } - else { - if (this.data.relative) - this.applyRelativeWorld(); - else - this.applyAbsoluteWorld(); - } - }; - TransformConstraint.prototype.applyAbsoluteWorld = function () { - var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; - var target = this.target; - var ta = target.a, tb = target.b, tc = target.c, td = target.d; - var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; - var offsetRotation = this.data.offsetRotation * degRadReflect; - var offsetShearY = this.data.offsetShearY * degRadReflect; - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var modified = false; - if (rotateMix != 0) { - var a = bone.a, b = bone.b, c = bone.c, d = bone.d; - var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation; - if (r > spine.MathUtils.PI) - r -= spine.MathUtils.PI2; - else if (r < -spine.MathUtils.PI) - r += spine.MathUtils.PI2; - r *= rotateMix; - var cos = Math.cos(r), sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - modified = true; - } - if (translateMix != 0) { - var temp = this.temp; - target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); - bone.worldX += (temp.x - bone.worldX) * translateMix; - bone.worldY += (temp.y - bone.worldY) * translateMix; - modified = true; - } - if (scaleMix > 0) { - var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c); - var ts = Math.sqrt(ta * ta + tc * tc); - if (s > 0.00001) - s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s; - bone.a *= s; - bone.c *= s; - s = Math.sqrt(bone.b * bone.b + bone.d * bone.d); - ts = Math.sqrt(tb * tb + td * td); - if (s > 0.00001) - s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s; - bone.b *= s; - bone.d *= s; - modified = true; - } - if (shearMix > 0) { - var b = bone.b, d = bone.d; - var by = Math.atan2(d, b); - var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a)); - if (r > spine.MathUtils.PI) - r -= spine.MathUtils.PI2; - else if (r < -spine.MathUtils.PI) - r += spine.MathUtils.PI2; - r = by + (r + offsetShearY) * shearMix; - var s = Math.sqrt(b * b + d * d); - bone.b = Math.cos(r) * s; - bone.d = Math.sin(r) * s; - modified = true; - } - if (modified) - bone.appliedValid = false; - } - }; - TransformConstraint.prototype.applyRelativeWorld = function () { - var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; - var target = this.target; - var ta = target.a, tb = target.b, tc = target.c, td = target.d; - var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; - var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect; - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var modified = false; - if (rotateMix != 0) { - var a = bone.a, b = bone.b, c = bone.c, d = bone.d; - var r = Math.atan2(tc, ta) + offsetRotation; - if (r > spine.MathUtils.PI) - r -= spine.MathUtils.PI2; - else if (r < -spine.MathUtils.PI) - r += spine.MathUtils.PI2; - r *= rotateMix; - var cos = Math.cos(r), sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - modified = true; - } - if (translateMix != 0) { - var temp = this.temp; - target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); - bone.worldX += temp.x * translateMix; - bone.worldY += temp.y * translateMix; - modified = true; - } - if (scaleMix > 0) { - var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1; - bone.a *= s; - bone.c *= s; - s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1; - bone.b *= s; - bone.d *= s; - modified = true; - } - if (shearMix > 0) { - var r = Math.atan2(td, tb) - Math.atan2(tc, ta); - if (r > spine.MathUtils.PI) - r -= spine.MathUtils.PI2; - else if (r < -spine.MathUtils.PI) - r += spine.MathUtils.PI2; - var b = bone.b, d = bone.d; - r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix; - var s = Math.sqrt(b * b + d * d); - bone.b = Math.cos(r) * s; - bone.d = Math.sin(r) * s; - modified = true; - } - if (modified) - bone.appliedValid = false; - } - }; - TransformConstraint.prototype.applyAbsoluteLocal = function () { - var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; - var target = this.target; - if (!target.appliedValid) - target.updateAppliedTransform(); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (!bone.appliedValid) - bone.updateAppliedTransform(); - var rotation = bone.arotation; - if (rotateMix != 0) { - var r = target.arotation - rotation + this.data.offsetRotation; - r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; - rotation += r * rotateMix; - } - var x = bone.ax, y = bone.ay; - if (translateMix != 0) { - x += (target.ax - x + this.data.offsetX) * translateMix; - y += (target.ay - y + this.data.offsetY) * translateMix; - } - var scaleX = bone.ascaleX, scaleY = bone.ascaleY; - if (scaleMix != 0) { - if (scaleX > 0.00001) - scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX; - if (scaleY > 0.00001) - scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY; - } - var shearY = bone.ashearY; - if (shearMix != 0) { - var r = target.ashearY - shearY + this.data.offsetShearY; - r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; - bone.shearY += r * shearMix; - } - bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); - } - }; - TransformConstraint.prototype.applyRelativeLocal = function () { - var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; - var target = this.target; - if (!target.appliedValid) - target.updateAppliedTransform(); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (!bone.appliedValid) - bone.updateAppliedTransform(); - var rotation = bone.arotation; - if (rotateMix != 0) - rotation += (target.arotation + this.data.offsetRotation) * rotateMix; - var x = bone.ax, y = bone.ay; - if (translateMix != 0) { - x += (target.ax + this.data.offsetX) * translateMix; - y += (target.ay + this.data.offsetY) * translateMix; - } - var scaleX = bone.ascaleX, scaleY = bone.ascaleY; - if (scaleMix != 0) { - if (scaleX > 0.00001) - scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1; - if (scaleY > 0.00001) - scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1; - } - var shearY = bone.ashearY; - if (shearMix != 0) - shearY += (target.ashearY + this.data.offsetShearY) * shearMix; - bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); - } - }; - TransformConstraint.prototype.getOrder = function () { - return this.data.order; - }; - return TransformConstraint; - }()); - spine.TransformConstraint = TransformConstraint; -})(spine || (spine = {})); -var spine; -(function (spine) { - var TransformConstraintData = (function () { - function TransformConstraintData(name) { - this.order = 0; - this.bones = new Array(); - this.rotateMix = 0; - this.translateMix = 0; - this.scaleMix = 0; - this.shearMix = 0; - this.offsetRotation = 0; - this.offsetX = 0; - this.offsetY = 0; - this.offsetScaleX = 0; - this.offsetScaleY = 0; - this.offsetShearY = 0; - this.relative = false; - this.local = false; - if (name == null) - throw new Error("name cannot be null."); - this.name = name; - } - return TransformConstraintData; - }()); - spine.TransformConstraintData = TransformConstraintData; -})(spine || (spine = {})); -var spine; -(function (spine) { - var Triangulator = (function () { - function Triangulator() { - this.convexPolygons = new Array(); - this.convexPolygonsIndices = new Array(); - this.indicesArray = new Array(); - this.isConcaveArray = new Array(); - this.triangles = new Array(); - this.polygonPool = new spine.Pool(function () { - return new Array(); - }); - this.polygonIndicesPool = new spine.Pool(function () { - return new Array(); - }); - } - Triangulator.prototype.triangulate = function (verticesArray) { - var vertices = verticesArray; - var vertexCount = verticesArray.length >> 1; - var indices = this.indicesArray; - indices.length = 0; - for (var i = 0; i < vertexCount; i++) - indices[i] = i; - var isConcave = this.isConcaveArray; - isConcave.length = 0; - for (var i = 0, n = vertexCount; i < n; ++i) - isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices); - var triangles = this.triangles; - triangles.length = 0; - while (vertexCount > 3) { - var previous = vertexCount - 1, i = 0, next = 1; - while (true) { - outer: if (!isConcave[i]) { - var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; - var p1x = vertices[p1], p1y = vertices[p1 + 1]; - var p2x = vertices[p2], p2y = vertices[p2 + 1]; - var p3x = vertices[p3], p3y = vertices[p3 + 1]; - for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { - if (!isConcave[ii]) - continue; - var v = indices[ii] << 1; - var vx = vertices[v], vy = vertices[v + 1]; - if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { - if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { - if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) - break outer; - } - } - } - break; - } - if (next == 0) { - do { - if (!isConcave[i]) - break; - i--; - } while (i > 0); - break; - } - previous = i; - i = next; - next = (next + 1) % vertexCount; - } - triangles.push(indices[(vertexCount + i - 1) % vertexCount]); - triangles.push(indices[i]); - triangles.push(indices[(i + 1) % vertexCount]); - indices.splice(i, 1); - isConcave.splice(i, 1); - vertexCount--; - var previousIndex = (vertexCount + i - 1) % vertexCount; - var nextIndex = i == vertexCount ? 0 : i; - isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices); - isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices); - } - if (vertexCount == 3) { - triangles.push(indices[2]); - triangles.push(indices[0]); - triangles.push(indices[1]); - } - return triangles; - }; - Triangulator.prototype.decompose = function (verticesArray, triangles) { - var vertices = verticesArray; - var convexPolygons = this.convexPolygons; - this.polygonPool.freeAll(convexPolygons); - convexPolygons.length = 0; - var convexPolygonsIndices = this.convexPolygonsIndices; - this.polygonIndicesPool.freeAll(convexPolygonsIndices); - convexPolygonsIndices.length = 0; - var polygonIndices = this.polygonIndicesPool.obtain(); - polygonIndices.length = 0; - var polygon = this.polygonPool.obtain(); - polygon.length = 0; - var fanBaseIndex = -1, lastWinding = 0; - for (var i = 0, n = triangles.length; i < n; i += 3) { - var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; - var x1 = vertices[t1], y1 = vertices[t1 + 1]; - var x2 = vertices[t2], y2 = vertices[t2 + 1]; - var x3 = vertices[t3], y3 = vertices[t3 + 1]; - var merged = false; - if (fanBaseIndex == t1) { - var o = polygon.length - 4; - var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); - var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]); - if (winding1 == lastWinding && winding2 == lastWinding) { - polygon.push(x3); - polygon.push(y3); - polygonIndices.push(t3); - merged = true; - } - } - if (!merged) { - if (polygon.length > 0) { - convexPolygons.push(polygon); - convexPolygonsIndices.push(polygonIndices); - } - else { - this.polygonPool.free(polygon); - this.polygonIndicesPool.free(polygonIndices); - } - polygon = this.polygonPool.obtain(); - polygon.length = 0; - polygon.push(x1); - polygon.push(y1); - polygon.push(x2); - polygon.push(y2); - polygon.push(x3); - polygon.push(y3); - polygonIndices = this.polygonIndicesPool.obtain(); - polygonIndices.length = 0; - polygonIndices.push(t1); - polygonIndices.push(t2); - polygonIndices.push(t3); - lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3); - fanBaseIndex = t1; - } - } - if (polygon.length > 0) { - convexPolygons.push(polygon); - convexPolygonsIndices.push(polygonIndices); - } - for (var i = 0, n = convexPolygons.length; i < n; i++) { - polygonIndices = convexPolygonsIndices[i]; - if (polygonIndices.length == 0) - continue; - var firstIndex = polygonIndices[0]; - var lastIndex = polygonIndices[polygonIndices.length - 1]; - polygon = convexPolygons[i]; - var o = polygon.length - 4; - var prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; - var prevX = polygon[o + 2], prevY = polygon[o + 3]; - var firstX = polygon[0], firstY = polygon[1]; - var secondX = polygon[2], secondY = polygon[3]; - var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); - for (var ii = 0; ii < n; ii++) { - if (ii == i) - continue; - var otherIndices = convexPolygonsIndices[ii]; - if (otherIndices.length != 3) - continue; - var otherFirstIndex = otherIndices[0]; - var otherSecondIndex = otherIndices[1]; - var otherLastIndex = otherIndices[2]; - var otherPoly = convexPolygons[ii]; - var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; - if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) - continue; - var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); - var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY); - if (winding1 == winding && winding2 == winding) { - otherPoly.length = 0; - otherIndices.length = 0; - polygon.push(x3); - polygon.push(y3); - polygonIndices.push(otherLastIndex); - prevPrevX = prevX; - prevPrevY = prevY; - prevX = x3; - prevY = y3; - ii = 0; - } - } - } - for (var i = convexPolygons.length - 1; i >= 0; i--) { - polygon = convexPolygons[i]; - if (polygon.length == 0) { - convexPolygons.splice(i, 1); - this.polygonPool.free(polygon); - polygonIndices = convexPolygonsIndices[i]; - convexPolygonsIndices.splice(i, 1); - this.polygonIndicesPool.free(polygonIndices); - } - } - return convexPolygons; - }; - Triangulator.isConcave = function (index, vertexCount, vertices, indices) { - var previous = indices[(vertexCount + index - 1) % vertexCount] << 1; - var current = indices[index] << 1; - var next = indices[(index + 1) % vertexCount] << 1; - return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); - }; - Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) { - return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; - }; - Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) { - var px = p2x - p1x, py = p2y - p1y; - return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; - }; - return Triangulator; - }()); - spine.Triangulator = Triangulator; -})(spine || (spine = {})); -var spine; -(function (spine) { - var IntSet = (function () { - function IntSet() { - this.array = new Array(); - } - IntSet.prototype.add = function (value) { - var contains = this.contains(value); - this.array[value | 0] = value | 0; - return !contains; - }; - IntSet.prototype.contains = function (value) { - return this.array[value | 0] != undefined; - }; - IntSet.prototype.remove = function (value) { - this.array[value | 0] = undefined; - }; - IntSet.prototype.clear = function () { - this.array.length = 0; - }; - return IntSet; - }()); - spine.IntSet = IntSet; - var Color = (function () { - function Color(r, g, b, a) { - if (r === void 0) { r = 0; } - if (g === void 0) { g = 0; } - if (b === void 0) { b = 0; } - if (a === void 0) { a = 0; } - this.r = r; - this.g = g; - this.b = b; - this.a = a; - } - Color.prototype.set = function (r, g, b, a) { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - this.clamp(); - return this; - }; - Color.prototype.setFromColor = function (c) { - this.r = c.r; - this.g = c.g; - this.b = c.b; - this.a = c.a; - return this; - }; - Color.prototype.setFromString = function (hex) { - hex = hex.charAt(0) == '#' ? hex.substr(1) : hex; - this.r = parseInt(hex.substr(0, 2), 16) / 255.0; - this.g = parseInt(hex.substr(2, 2), 16) / 255.0; - this.b = parseInt(hex.substr(4, 2), 16) / 255.0; - this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0; - return this; - }; - Color.prototype.add = function (r, g, b, a) { - this.r += r; - this.g += g; - this.b += b; - this.a += a; - this.clamp(); - return this; - }; - Color.prototype.clamp = function () { - if (this.r < 0) - this.r = 0; - else if (this.r > 1) - this.r = 1; - if (this.g < 0) - this.g = 0; - else if (this.g > 1) - this.g = 1; - if (this.b < 0) - this.b = 0; - else if (this.b > 1) - this.b = 1; - if (this.a < 0) - this.a = 0; - else if (this.a > 1) - this.a = 1; - return this; - }; - Color.WHITE = new Color(1, 1, 1, 1); - Color.RED = new Color(1, 0, 0, 1); - Color.GREEN = new Color(0, 1, 0, 1); - Color.BLUE = new Color(0, 0, 1, 1); - Color.MAGENTA = new Color(1, 0, 1, 1); - return Color; - }()); - spine.Color = Color; - var MathUtils = (function () { - function MathUtils() { - } - MathUtils.clamp = function (value, min, max) { - if (value < min) - return min; - if (value > max) - return max; - return value; - }; - MathUtils.cosDeg = function (degrees) { - return Math.cos(degrees * MathUtils.degRad); - }; - MathUtils.sinDeg = function (degrees) { - return Math.sin(degrees * MathUtils.degRad); - }; - MathUtils.signum = function (value) { - return value > 0 ? 1 : value < 0 ? -1 : 0; - }; - MathUtils.toInt = function (x) { - return x > 0 ? Math.floor(x) : Math.ceil(x); - }; - MathUtils.cbrt = function (x) { - var y = Math.pow(Math.abs(x), 1 / 3); - return x < 0 ? -y : y; - }; - MathUtils.randomTriangular = function (min, max) { - return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); - }; - MathUtils.randomTriangularWith = function (min, max, mode) { - var u = Math.random(); - var d = max - min; - if (u <= (mode - min) / d) - return min + Math.sqrt(u * d * (mode - min)); - return max - Math.sqrt((1 - u) * d * (max - mode)); - }; - MathUtils.PI = 3.1415927; - MathUtils.PI2 = MathUtils.PI * 2; - MathUtils.radiansToDegrees = 180 / MathUtils.PI; - MathUtils.radDeg = MathUtils.radiansToDegrees; - MathUtils.degreesToRadians = MathUtils.PI / 180; - MathUtils.degRad = MathUtils.degreesToRadians; - return MathUtils; - }()); - spine.MathUtils = MathUtils; - var Interpolation = (function () { - function Interpolation() { - } - Interpolation.prototype.apply = function (start, end, a) { - return start + (end - start) * this.applyInternal(a); - }; - return Interpolation; - }()); - spine.Interpolation = Interpolation; - var Pow = (function (_super) { - __extends(Pow, _super); - function Pow(power) { - var _this = _super.call(this) || this; - _this.power = 2; - _this.power = power; - return _this; - } - Pow.prototype.applyInternal = function (a) { - if (a <= 0.5) - return Math.pow(a * 2, this.power) / 2; - return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1; - }; - return Pow; - }(Interpolation)); - spine.Pow = Pow; - var PowOut = (function (_super) { - __extends(PowOut, _super); - function PowOut(power) { - return _super.call(this, power) || this; - } - PowOut.prototype.applyInternal = function (a) { - return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1; - }; - return PowOut; - }(Pow)); - spine.PowOut = PowOut; - var Utils = (function () { - function Utils() { - } - Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) { - for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { - dest[j] = source[i]; - } - }; - Utils.setArraySize = function (array, size, value) { - if (value === void 0) { value = 0; } - var oldSize = array.length; - if (oldSize == size) - return array; - array.length = size; - if (oldSize < size) { - for (var i = oldSize; i < size; i++) - array[i] = value; - } - return array; - }; - Utils.ensureArrayCapacity = function (array, size, value) { - if (value === void 0) { value = 0; } - if (array.length >= size) - return array; - return Utils.setArraySize(array, size, value); - }; - Utils.newArray = function (size, defaultValue) { - var array = new Array(size); - for (var i = 0; i < size; i++) - array[i] = defaultValue; - return array; - }; - Utils.newFloatArray = function (size) { - if (Utils.SUPPORTS_TYPED_ARRAYS) { - return new Float32Array(size); - } - else { - var array = new Array(size); - for (var i = 0; i < array.length; i++) - array[i] = 0; - return array; - } - }; - Utils.newShortArray = function (size) { - if (Utils.SUPPORTS_TYPED_ARRAYS) { - return new Int16Array(size); - } - else { - var array = new Array(size); - for (var i = 0; i < array.length; i++) - array[i] = 0; - return array; - } - }; - Utils.toFloatArray = function (array) { - return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; - }; - Utils.toSinglePrecision = function (value) { - return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; - }; - Utils.webkit602BugfixHelper = function (alpha, blend) { - }; - Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== "undefined"; - return Utils; - }()); - spine.Utils = Utils; - var DebugUtils = (function () { - function DebugUtils() { - } - DebugUtils.logBones = function (skeleton) { - for (var i = 0; i < skeleton.bones.length; i++) { - var bone = skeleton.bones[i]; - console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY); - } - }; - return DebugUtils; - }()); - spine.DebugUtils = DebugUtils; - var Pool = (function () { - function Pool(instantiator) { - this.items = new Array(); - this.instantiator = instantiator; - } - Pool.prototype.obtain = function () { - return this.items.length > 0 ? this.items.pop() : this.instantiator(); - }; - Pool.prototype.free = function (item) { - if (item.reset) - item.reset(); - this.items.push(item); - }; - Pool.prototype.freeAll = function (items) { - for (var i = 0; i < items.length; i++) { - if (items[i].reset) - items[i].reset(); - this.items[i] = items[i]; - } - }; - Pool.prototype.clear = function () { - this.items.length = 0; - }; - return Pool; - }()); - spine.Pool = Pool; - var Vector2 = (function () { - function Vector2(x, y) { - if (x === void 0) { x = 0; } - if (y === void 0) { y = 0; } - this.x = x; - this.y = y; - } - Vector2.prototype.set = function (x, y) { - this.x = x; - this.y = y; - return this; - }; - Vector2.prototype.length = function () { - var x = this.x; - var y = this.y; - return Math.sqrt(x * x + y * y); - }; - Vector2.prototype.normalize = function () { - var len = this.length(); - if (len != 0) { - this.x /= len; - this.y /= len; - } - return this; - }; - return Vector2; - }()); - spine.Vector2 = Vector2; - var TimeKeeper = (function () { - function TimeKeeper() { - this.maxDelta = 0.064; - this.framesPerSecond = 0; - this.delta = 0; - this.totalTime = 0; - this.lastTime = Date.now() / 1000; - this.frameCount = 0; - this.frameTime = 0; - } - TimeKeeper.prototype.update = function () { - var now = Date.now() / 1000; - this.delta = now - this.lastTime; - this.frameTime += this.delta; - this.totalTime += this.delta; - if (this.delta > this.maxDelta) - this.delta = this.maxDelta; - this.lastTime = now; - this.frameCount++; - if (this.frameTime > 1) { - this.framesPerSecond = this.frameCount / this.frameTime; - this.frameTime = 0; - this.frameCount = 0; - } - }; - return TimeKeeper; - }()); - spine.TimeKeeper = TimeKeeper; - var WindowedMean = (function () { - function WindowedMean(windowSize) { - if (windowSize === void 0) { windowSize = 32; } - this.addedValues = 0; - this.lastValue = 0; - this.mean = 0; - this.dirty = true; - this.values = new Array(windowSize); - } - WindowedMean.prototype.hasEnoughData = function () { - return this.addedValues >= this.values.length; - }; - WindowedMean.prototype.addValue = function (value) { - if (this.addedValues < this.values.length) - this.addedValues++; - this.values[this.lastValue++] = value; - if (this.lastValue > this.values.length - 1) - this.lastValue = 0; - this.dirty = true; - }; - WindowedMean.prototype.getMean = function () { - if (this.hasEnoughData()) { - if (this.dirty) { - var mean = 0; - for (var i = 0; i < this.values.length; i++) { - mean += this.values[i]; - } - this.mean = mean / this.values.length; - this.dirty = false; - } - return this.mean; - } - else { - return 0; - } - }; - return WindowedMean; - }()); - spine.WindowedMean = WindowedMean; -})(spine || (spine = {})); -(function () { - if (!Math.fround) { - Math.fround = (function (array) { - return function (x) { - return array[0] = x, array[0]; - }; - })(new Float32Array(1)); - } -})(); -var spine; -(function (spine) { - var Attachment = (function () { - function Attachment(name) { - if (name == null) - throw new Error("name cannot be null."); - this.name = name; - } - return Attachment; - }()); - spine.Attachment = Attachment; - var VertexAttachment = (function (_super) { - __extends(VertexAttachment, _super); - function VertexAttachment(name) { - var _this = _super.call(this, name) || this; - _this.id = (VertexAttachment.nextID++ & 65535) << 11; - _this.worldVerticesLength = 0; - return _this; - } - VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) { - count = offset + (count >> 1) * stride; - var skeleton = slot.bone.skeleton; - var deformArray = slot.attachmentVertices; - var vertices = this.vertices; - var bones = this.bones; - if (bones == null) { - if (deformArray.length > 0) - vertices = deformArray; - var bone = slot.bone; - var x = bone.worldX; - var y = bone.worldY; - var a = bone.a, b = bone.b, c = bone.c, d = bone.d; - for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) { - var vx = vertices[v_1], vy = vertices[v_1 + 1]; - worldVertices[w] = vx * a + vy * b + x; - worldVertices[w + 1] = vx * c + vy * d + y; - } - return; - } - var v = 0, skip = 0; - for (var i = 0; i < start; i += 2) { - var n = bones[v]; - v += n + 1; - skip += n; - } - var skeletonBones = skeleton.bones; - if (deformArray.length == 0) { - for (var w = offset, b = skip * 3; w < count; w += stride) { - var wx = 0, wy = 0; - var n = bones[v++]; - n += v; - for (; v < n; v++, b += 3) { - var bone = skeletonBones[bones[v]]; - var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; - wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; - wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; - } - worldVertices[w] = wx; - worldVertices[w + 1] = wy; - } - } - else { - var deform = deformArray; - for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { - var wx = 0, wy = 0; - var n = bones[v++]; - n += v; - for (; v < n; v++, b += 3, f += 2) { - var bone = skeletonBones[bones[v]]; - var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; - wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; - wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; - } - worldVertices[w] = wx; - worldVertices[w + 1] = wy; - } - } - }; - VertexAttachment.prototype.applyDeform = function (sourceAttachment) { - return this == sourceAttachment; - }; - VertexAttachment.nextID = 0; - return VertexAttachment; - }(Attachment)); - spine.VertexAttachment = VertexAttachment; -})(spine || (spine = {})); -var spine; -(function (spine) { - var AttachmentType; - (function (AttachmentType) { - AttachmentType[AttachmentType["Region"] = 0] = "Region"; - AttachmentType[AttachmentType["BoundingBox"] = 1] = "BoundingBox"; - AttachmentType[AttachmentType["Mesh"] = 2] = "Mesh"; - AttachmentType[AttachmentType["LinkedMesh"] = 3] = "LinkedMesh"; - AttachmentType[AttachmentType["Path"] = 4] = "Path"; - AttachmentType[AttachmentType["Point"] = 5] = "Point"; - })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var BoundingBoxAttachment = (function (_super) { - __extends(BoundingBoxAttachment, _super); - function BoundingBoxAttachment(name) { - var _this = _super.call(this, name) || this; - _this.color = new spine.Color(1, 1, 1, 1); - return _this; - } - return BoundingBoxAttachment; - }(spine.VertexAttachment)); - spine.BoundingBoxAttachment = BoundingBoxAttachment; -})(spine || (spine = {})); -var spine; -(function (spine) { - var ClippingAttachment = (function (_super) { - __extends(ClippingAttachment, _super); - function ClippingAttachment(name) { - var _this = _super.call(this, name) || this; - _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1); - return _this; - } - return ClippingAttachment; - }(spine.VertexAttachment)); - spine.ClippingAttachment = ClippingAttachment; -})(spine || (spine = {})); -var spine; -(function (spine) { - var MeshAttachment = (function (_super) { - __extends(MeshAttachment, _super); - function MeshAttachment(name) { - var _this = _super.call(this, name) || this; - _this.color = new spine.Color(1, 1, 1, 1); - _this.inheritDeform = false; - _this.tempColor = new spine.Color(0, 0, 0, 0); - return _this; - } - MeshAttachment.prototype.updateUVs = function () { - var regionUVs = this.regionUVs; - if (this.uvs == null || this.uvs.length != regionUVs.length) - this.uvs = spine.Utils.newFloatArray(regionUVs.length); - var uvs = this.uvs; - var u = 0, v = 0, width = 0, height = 0; - if (this.region instanceof spine.TextureAtlasRegion) { - var region = this.region; - var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height; - if (region.rotate) { - u = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth; - v = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight; - width = region.originalHeight / textureWidth; - height = region.originalWidth / textureHeight; - for (var i = 0, n = uvs.length; i < n; i += 2) { - uvs[i] = u + regionUVs[i + 1] * width; - uvs[i + 1] = v + height - regionUVs[i] * height; - } - return; - } - u = region.u - region.offsetX / textureWidth; - v = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight; - width = region.originalWidth / textureWidth; - height = region.originalHeight / textureHeight; - } - else if (this.region == null) { - u = v = 0; - width = height = 1; - } - else { - u = this.region.u; - v = this.region.v; - width = this.region.u2 - u; - height = this.region.v2 - v; - } - for (var i = 0, n = uvs.length; i < n; i += 2) { - uvs[i] = u + regionUVs[i] * width; - uvs[i + 1] = v + regionUVs[i + 1] * height; - } - }; - MeshAttachment.prototype.applyDeform = function (sourceAttachment) { - return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment); - }; - MeshAttachment.prototype.getParentMesh = function () { - return this.parentMesh; - }; - MeshAttachment.prototype.setParentMesh = function (parentMesh) { - this.parentMesh = parentMesh; - if (parentMesh != null) { - this.bones = parentMesh.bones; - this.vertices = parentMesh.vertices; - this.worldVerticesLength = parentMesh.worldVerticesLength; - this.regionUVs = parentMesh.regionUVs; - this.triangles = parentMesh.triangles; - this.hullLength = parentMesh.hullLength; - this.worldVerticesLength = parentMesh.worldVerticesLength; - } - }; - return MeshAttachment; - }(spine.VertexAttachment)); - spine.MeshAttachment = MeshAttachment; -})(spine || (spine = {})); -var spine; -(function (spine) { - var PathAttachment = (function (_super) { - __extends(PathAttachment, _super); - function PathAttachment(name) { - var _this = _super.call(this, name) || this; - _this.closed = false; - _this.constantSpeed = false; - _this.color = new spine.Color(1, 1, 1, 1); - return _this; - } - return PathAttachment; - }(spine.VertexAttachment)); - spine.PathAttachment = PathAttachment; -})(spine || (spine = {})); -var spine; -(function (spine) { - var PointAttachment = (function (_super) { - __extends(PointAttachment, _super); - function PointAttachment(name) { - var _this = _super.call(this, name) || this; - _this.color = new spine.Color(0.38, 0.94, 0, 1); - return _this; - } - PointAttachment.prototype.computeWorldPosition = function (bone, point) { - point.x = this.x * bone.a + this.y * bone.b + bone.worldX; - point.y = this.x * bone.c + this.y * bone.d + bone.worldY; - return point; - }; - PointAttachment.prototype.computeWorldRotation = function (bone) { - var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation); - var x = cos * bone.a + sin * bone.b; - var y = cos * bone.c + sin * bone.d; - return Math.atan2(y, x) * spine.MathUtils.radDeg; - }; - return PointAttachment; - }(spine.VertexAttachment)); - spine.PointAttachment = PointAttachment; -})(spine || (spine = {})); -var spine; -(function (spine) { - var RegionAttachment = (function (_super) { - __extends(RegionAttachment, _super); - function RegionAttachment(name) { - var _this = _super.call(this, name) || this; - _this.x = 0; - _this.y = 0; - _this.scaleX = 1; - _this.scaleY = 1; - _this.rotation = 0; - _this.width = 0; - _this.height = 0; - _this.color = new spine.Color(1, 1, 1, 1); - _this.offset = spine.Utils.newFloatArray(8); - _this.uvs = spine.Utils.newFloatArray(8); - _this.tempColor = new spine.Color(1, 1, 1, 1); - return _this; - } - RegionAttachment.prototype.updateOffset = function () { - var regionScaleX = this.width / this.region.originalWidth * this.scaleX; - var regionScaleY = this.height / this.region.originalHeight * this.scaleY; - var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; - var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; - var localX2 = localX + this.region.width * regionScaleX; - var localY2 = localY + this.region.height * regionScaleY; - var radians = this.rotation * Math.PI / 180; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - var localXCos = localX * cos + this.x; - var localXSin = localX * sin; - var localYCos = localY * cos + this.y; - var localYSin = localY * sin; - var localX2Cos = localX2 * cos + this.x; - var localX2Sin = localX2 * sin; - var localY2Cos = localY2 * cos + this.y; - var localY2Sin = localY2 * sin; - var offset = this.offset; - offset[RegionAttachment.OX1] = localXCos - localYSin; - offset[RegionAttachment.OY1] = localYCos + localXSin; - offset[RegionAttachment.OX2] = localXCos - localY2Sin; - offset[RegionAttachment.OY2] = localY2Cos + localXSin; - offset[RegionAttachment.OX3] = localX2Cos - localY2Sin; - offset[RegionAttachment.OY3] = localY2Cos + localX2Sin; - offset[RegionAttachment.OX4] = localX2Cos - localYSin; - offset[RegionAttachment.OY4] = localYCos + localX2Sin; - }; - RegionAttachment.prototype.setRegion = function (region) { - this.region = region; - var uvs = this.uvs; - if (region.rotate) { - uvs[2] = region.u; - uvs[3] = region.v2; - uvs[4] = region.u; - uvs[5] = region.v; - uvs[6] = region.u2; - uvs[7] = region.v; - uvs[0] = region.u2; - uvs[1] = region.v2; - } - else { - uvs[0] = region.u; - uvs[1] = region.v2; - uvs[2] = region.u; - uvs[3] = region.v; - uvs[4] = region.u2; - uvs[5] = region.v; - uvs[6] = region.u2; - uvs[7] = region.v2; - } - }; - RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) { - var vertexOffset = this.offset; - var x = bone.worldX, y = bone.worldY; - var a = bone.a, b = bone.b, c = bone.c, d = bone.d; - var offsetX = 0, offsetY = 0; - offsetX = vertexOffset[RegionAttachment.OX1]; - offsetY = vertexOffset[RegionAttachment.OY1]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[RegionAttachment.OX2]; - offsetY = vertexOffset[RegionAttachment.OY2]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[RegionAttachment.OX3]; - offsetY = vertexOffset[RegionAttachment.OY3]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[RegionAttachment.OX4]; - offsetY = vertexOffset[RegionAttachment.OY4]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - }; - RegionAttachment.OX1 = 0; - RegionAttachment.OY1 = 1; - RegionAttachment.OX2 = 2; - RegionAttachment.OY2 = 3; - RegionAttachment.OX3 = 4; - RegionAttachment.OY3 = 5; - RegionAttachment.OX4 = 6; - RegionAttachment.OY4 = 7; - RegionAttachment.X1 = 0; - RegionAttachment.Y1 = 1; - RegionAttachment.C1R = 2; - RegionAttachment.C1G = 3; - RegionAttachment.C1B = 4; - RegionAttachment.C1A = 5; - RegionAttachment.U1 = 6; - RegionAttachment.V1 = 7; - RegionAttachment.X2 = 8; - RegionAttachment.Y2 = 9; - RegionAttachment.C2R = 10; - RegionAttachment.C2G = 11; - RegionAttachment.C2B = 12; - RegionAttachment.C2A = 13; - RegionAttachment.U2 = 14; - RegionAttachment.V2 = 15; - RegionAttachment.X3 = 16; - RegionAttachment.Y3 = 17; - RegionAttachment.C3R = 18; - RegionAttachment.C3G = 19; - RegionAttachment.C3B = 20; - RegionAttachment.C3A = 21; - RegionAttachment.U3 = 22; - RegionAttachment.V3 = 23; - RegionAttachment.X4 = 24; - RegionAttachment.Y4 = 25; - RegionAttachment.C4R = 26; - RegionAttachment.C4G = 27; - RegionAttachment.C4B = 28; - RegionAttachment.C4A = 29; - RegionAttachment.U4 = 30; - RegionAttachment.V4 = 31; - return RegionAttachment; - }(spine.Attachment)); - spine.RegionAttachment = RegionAttachment; -})(spine || (spine = {})); -var spine; -(function (spine) { - var JitterEffect = (function () { - function JitterEffect(jitterX, jitterY) { - this.jitterX = 0; - this.jitterY = 0; - this.jitterX = jitterX; - this.jitterY = jitterY; - } - JitterEffect.prototype.begin = function (skeleton) { - }; - JitterEffect.prototype.transform = function (position, uv, light, dark) { - position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); - position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); - }; - JitterEffect.prototype.end = function () { - }; - return JitterEffect; - }()); - spine.JitterEffect = JitterEffect; -})(spine || (spine = {})); -var spine; -(function (spine) { - var SwirlEffect = (function () { - function SwirlEffect(radius) { - this.centerX = 0; - this.centerY = 0; - this.radius = 0; - this.angle = 0; - this.worldX = 0; - this.worldY = 0; - this.radius = radius; - } - SwirlEffect.prototype.begin = function (skeleton) { - this.worldX = skeleton.x + this.centerX; - this.worldY = skeleton.y + this.centerY; - }; - SwirlEffect.prototype.transform = function (position, uv, light, dark) { - var radAngle = this.angle * spine.MathUtils.degreesToRadians; - var x = position.x - this.worldX; - var y = position.y - this.worldY; - var dist = Math.sqrt(x * x + y * y); - if (dist < this.radius) { - var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius); - var cos = Math.cos(theta); - var sin = Math.sin(theta); - position.x = cos * x - sin * y + this.worldX; - position.y = sin * x + cos * y + this.worldY; - } - }; - SwirlEffect.prototype.end = function () { - }; - SwirlEffect.interpolation = new spine.PowOut(2); - return SwirlEffect; - }()); - spine.SwirlEffect = SwirlEffect; -})(spine || (spine = {})); -var spine; -(function (spine) { - var canvas; - (function (canvas) { - var AssetManager = (function (_super) { - __extends(AssetManager, _super); - function AssetManager(pathPrefix) { - if (pathPrefix === void 0) { pathPrefix = ""; } - return _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this; - } - return AssetManager; - }(spine.AssetManager)); - canvas.AssetManager = AssetManager; - })(canvas = spine.canvas || (spine.canvas = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var canvas; - (function (canvas) { - var CanvasTexture = (function (_super) { - __extends(CanvasTexture, _super); - function CanvasTexture(image) { - return _super.call(this, image) || this; - } - CanvasTexture.prototype.setFilters = function (minFilter, magFilter) { }; - CanvasTexture.prototype.setWraps = function (uWrap, vWrap) { }; - CanvasTexture.prototype.dispose = function () { }; - return CanvasTexture; - }(spine.Texture)); - canvas.CanvasTexture = CanvasTexture; - })(canvas = spine.canvas || (spine.canvas = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var canvas; - (function (canvas) { - var SkeletonRenderer = (function () { - function SkeletonRenderer(context) { - this.triangleRendering = false; - this.debugRendering = false; - this.vertices = spine.Utils.newFloatArray(8 * 1024); - this.tempColor = new spine.Color(); - this.ctx = context; - } - SkeletonRenderer.prototype.draw = function (skeleton) { - if (this.triangleRendering) - this.drawTriangles(skeleton); - else - this.drawImages(skeleton); - }; - SkeletonRenderer.prototype.drawImages = function (skeleton) { - var ctx = this.ctx; - var drawOrder = skeleton.drawOrder; - if (this.debugRendering) - ctx.strokeStyle = "green"; - ctx.save(); - for (var i = 0, n = drawOrder.length; i < n; i++) { - var slot = drawOrder[i]; - var attachment = slot.getAttachment(); - var regionAttachment = null; - var region = null; - var image = null; - if (attachment instanceof spine.RegionAttachment) { - regionAttachment = attachment; - region = regionAttachment.region; - image = region.texture.getImage(); - } - else - continue; - var skeleton_1 = slot.bone.skeleton; - var skeletonColor = skeleton_1.color; - var slotColor = slot.color; - var regionColor = regionAttachment.color; - var alpha = skeletonColor.a * slotColor.a * regionColor.a; - var color = this.tempColor; - color.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha); - var att = attachment; - var bone = slot.bone; - var w = region.width; - var h = region.height; - ctx.save(); - ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY); - ctx.translate(attachment.offset[0], attachment.offset[1]); - ctx.rotate(attachment.rotation * Math.PI / 180); - var atlasScale = att.width / w; - ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY); - ctx.translate(w / 2, h / 2); - if (attachment.region.rotate) { - var t = w; - w = h; - h = t; - ctx.rotate(-Math.PI / 2); - } - ctx.scale(1, -1); - ctx.translate(-w / 2, -h / 2); - if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { - ctx.globalAlpha = color.a; - } - ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h); - if (this.debugRendering) - ctx.strokeRect(0, 0, w, h); - ctx.restore(); - } - ctx.restore(); - }; - SkeletonRenderer.prototype.drawTriangles = function (skeleton) { - var blendMode = null; - var vertices = this.vertices; - var triangles = null; - var drawOrder = skeleton.drawOrder; - for (var i = 0, n = drawOrder.length; i < n; i++) { - var slot = drawOrder[i]; - var attachment = slot.getAttachment(); - var texture = null; - var region = null; - if (attachment instanceof spine.RegionAttachment) { - var regionAttachment = attachment; - vertices = this.computeRegionVertices(slot, regionAttachment, false); - triangles = SkeletonRenderer.QUAD_TRIANGLES; - region = regionAttachment.region; - texture = region.texture.getImage(); - } - else if (attachment instanceof spine.MeshAttachment) { - var mesh = attachment; - vertices = this.computeMeshVertices(slot, mesh, false); - triangles = mesh.triangles; - texture = mesh.region.renderObject.texture.getImage(); - } - else - continue; - if (texture != null) { - var slotBlendMode = slot.data.blendMode; - if (slotBlendMode != blendMode) { - blendMode = slotBlendMode; - } - var skeleton_2 = slot.bone.skeleton; - var skeletonColor = skeleton_2.color; - var slotColor = slot.color; - var attachmentColor = attachment.color; - var alpha = skeletonColor.a * slotColor.a * attachmentColor.a; - var color = this.tempColor; - color.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha); - var ctx = this.ctx; - if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { - ctx.globalAlpha = color.a; - } - for (var j = 0; j < triangles.length; j += 3) { - var t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8; - var x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7]; - var x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7]; - var x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7]; - this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2); - if (this.debugRendering) { - ctx.strokeStyle = "green"; - ctx.beginPath(); - ctx.moveTo(x0, y0); - ctx.lineTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.lineTo(x0, y0); - ctx.stroke(); - } - } - } - } - this.ctx.globalAlpha = 1; - }; - SkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) { - var ctx = this.ctx; - u0 *= img.width; - v0 *= img.height; - u1 *= img.width; - v1 *= img.height; - u2 *= img.width; - v2 *= img.height; - ctx.beginPath(); - ctx.moveTo(x0, y0); - ctx.lineTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.closePath(); - x1 -= x0; - y1 -= y0; - x2 -= x0; - y2 -= y0; - u1 -= u0; - v1 -= v0; - u2 -= u0; - v2 -= v0; - var det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0; - ctx.save(); - ctx.transform(a, b, c, d, e, f); - ctx.clip(); - ctx.drawImage(img, 0, 0); - ctx.restore(); - }; - SkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) { - var skeleton = slot.bone.skeleton; - var skeletonColor = skeleton.color; - var slotColor = slot.color; - var regionColor = region.color; - var alpha = skeletonColor.a * slotColor.a * regionColor.a; - var multiplier = pma ? alpha : 1; - var color = this.tempColor; - color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); - region.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE); - var vertices = this.vertices; - var uvs = region.uvs; - vertices[spine.RegionAttachment.C1R] = color.r; - vertices[spine.RegionAttachment.C1G] = color.g; - vertices[spine.RegionAttachment.C1B] = color.b; - vertices[spine.RegionAttachment.C1A] = color.a; - vertices[spine.RegionAttachment.U1] = uvs[0]; - vertices[spine.RegionAttachment.V1] = uvs[1]; - vertices[spine.RegionAttachment.C2R] = color.r; - vertices[spine.RegionAttachment.C2G] = color.g; - vertices[spine.RegionAttachment.C2B] = color.b; - vertices[spine.RegionAttachment.C2A] = color.a; - vertices[spine.RegionAttachment.U2] = uvs[2]; - vertices[spine.RegionAttachment.V2] = uvs[3]; - vertices[spine.RegionAttachment.C3R] = color.r; - vertices[spine.RegionAttachment.C3G] = color.g; - vertices[spine.RegionAttachment.C3B] = color.b; - vertices[spine.RegionAttachment.C3A] = color.a; - vertices[spine.RegionAttachment.U3] = uvs[4]; - vertices[spine.RegionAttachment.V3] = uvs[5]; - vertices[spine.RegionAttachment.C4R] = color.r; - vertices[spine.RegionAttachment.C4G] = color.g; - vertices[spine.RegionAttachment.C4B] = color.b; - vertices[spine.RegionAttachment.C4A] = color.a; - vertices[spine.RegionAttachment.U4] = uvs[6]; - vertices[spine.RegionAttachment.V4] = uvs[7]; - return vertices; - }; - SkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) { - var skeleton = slot.bone.skeleton; - var skeletonColor = skeleton.color; - var slotColor = slot.color; - var regionColor = mesh.color; - var alpha = skeletonColor.a * slotColor.a * regionColor.a; - var multiplier = pma ? alpha : 1; - var color = this.tempColor; - color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); - var numVertices = mesh.worldVerticesLength / 2; - if (this.vertices.length < mesh.worldVerticesLength) { - this.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength); - } - var vertices = this.vertices; - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE); - var uvs = mesh.uvs; - for (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) { - vertices[v++] = color.r; - vertices[v++] = color.g; - vertices[v++] = color.b; - vertices[v++] = color.a; - vertices[v++] = uvs[u++]; - vertices[v++] = uvs[u++]; - v += 2; - } - return vertices; - }; - SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; - SkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4; - return SkeletonRenderer; - }()); - canvas.SkeletonRenderer = SkeletonRenderer; - })(canvas = spine.canvas || (spine.canvas = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var AssetManager = (function (_super) { - __extends(AssetManager, _super); - function AssetManager(context, pathPrefix) { - if (pathPrefix === void 0) { pathPrefix = ""; } - return _super.call(this, function (image) { - return new spine.webgl.GLTexture(context, image); - }, pathPrefix) || this; - } - return AssetManager; - }(spine.AssetManager)); - webgl.AssetManager = AssetManager; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var OrthoCamera = (function () { - function OrthoCamera(viewportWidth, viewportHeight) { - this.position = new webgl.Vector3(0, 0, 0); - this.direction = new webgl.Vector3(0, 0, -1); - this.up = new webgl.Vector3(0, 1, 0); - this.near = 0; - this.far = 100; - this.zoom = 1; - this.viewportWidth = 0; - this.viewportHeight = 0; - this.projectionView = new webgl.Matrix4(); - this.inverseProjectionView = new webgl.Matrix4(); - this.projection = new webgl.Matrix4(); - this.view = new webgl.Matrix4(); - this.tmp = new webgl.Vector3(); - this.viewportWidth = viewportWidth; - this.viewportHeight = viewportHeight; - this.update(); - } - OrthoCamera.prototype.update = function () { - var projection = this.projection; - var view = this.view; - var projectionView = this.projectionView; - var inverseProjectionView = this.inverseProjectionView; - var zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight; - projection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far); - view.lookAt(this.position, this.direction, this.up); - projectionView.set(projection.values); - projectionView.multiply(view); - inverseProjectionView.set(projectionView.values).invert(); - }; - OrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) { - var x = screenCoords.x, y = screenHeight - screenCoords.y - 1; - var tmp = this.tmp; - tmp.x = (2 * x) / screenWidth - 1; - tmp.y = (2 * y) / screenHeight - 1; - tmp.z = (2 * screenCoords.z) - 1; - tmp.project(this.inverseProjectionView); - screenCoords.set(tmp.x, tmp.y, tmp.z); - return screenCoords; - }; - OrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) { - this.viewportWidth = viewportWidth; - this.viewportHeight = viewportHeight; - }; - return OrthoCamera; - }()); - webgl.OrthoCamera = OrthoCamera; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var GLTexture = (function (_super) { - __extends(GLTexture, _super); - function GLTexture(context, image, useMipMaps) { - if (useMipMaps === void 0) { useMipMaps = false; } - var _this = _super.call(this, image) || this; - _this.texture = null; - _this.boundUnit = 0; - _this.useMipMaps = false; - _this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - _this.useMipMaps = useMipMaps; - _this.restore(); - _this.context.addRestorable(_this); - return _this; - } - GLTexture.prototype.setFilters = function (minFilter, magFilter) { - var gl = this.context.gl; - this.bind(); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); - }; - GLTexture.prototype.setWraps = function (uWrap, vWrap) { - var gl = this.context.gl; - this.bind(); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap); - }; - GLTexture.prototype.update = function (useMipMaps) { - var gl = this.context.gl; - if (!this.texture) { - this.texture = this.context.gl.createTexture(); - } - this.bind(); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - if (useMipMaps) - gl.generateMipmap(gl.TEXTURE_2D); - }; - GLTexture.prototype.restore = function () { - this.texture = null; - this.update(this.useMipMaps); - }; - GLTexture.prototype.bind = function (unit) { - if (unit === void 0) { unit = 0; } - var gl = this.context.gl; - this.boundUnit = unit; - gl.activeTexture(gl.TEXTURE0 + unit); - gl.bindTexture(gl.TEXTURE_2D, this.texture); - }; - GLTexture.prototype.unbind = function () { - var gl = this.context.gl; - gl.activeTexture(gl.TEXTURE0 + this.boundUnit); - gl.bindTexture(gl.TEXTURE_2D, null); - }; - GLTexture.prototype.dispose = function () { - this.context.removeRestorable(this); - var gl = this.context.gl; - gl.deleteTexture(this.texture); - }; - return GLTexture; - }(spine.Texture)); - webgl.GLTexture = GLTexture; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var Input = (function () { - function Input(element) { - this.lastX = 0; - this.lastY = 0; - this.buttonDown = false; - this.currTouch = null; - this.touchesPool = new spine.Pool(function () { - return new spine.webgl.Touch(0, 0, 0); - }); - this.listeners = new Array(); - this.element = element; - this.setupCallbacks(element); - } - Input.prototype.setupCallbacks = function (element) { - var _this = this; - var mouseDown = function (ev) { - if (ev instanceof MouseEvent) { - var rect = element.getBoundingClientRect(); - var x = ev.clientX - rect.left; - var y = ev.clientY - rect.top; - var listeners = _this.listeners; - for (var i = 0; i < listeners.length; i++) { - listeners[i].down(x, y); - } - _this.lastX = x; - _this.lastY = y; - _this.buttonDown = true; - document.addEventListener("mousemove", mouseMove); - document.addEventListener("mouseup", mouseUp); - } - }; - var mouseMove = function (ev) { - if (ev instanceof MouseEvent) { - var rect = element.getBoundingClientRect(); - var x = ev.clientX - rect.left; - var y = ev.clientY - rect.top; - var listeners = _this.listeners; - for (var i = 0; i < listeners.length; i++) { - if (_this.buttonDown) { - listeners[i].dragged(x, y); - } - else { - listeners[i].moved(x, y); - } - } - _this.lastX = x; - _this.lastY = y; - } - }; - var mouseUp = function (ev) { - if (ev instanceof MouseEvent) { - var rect = element.getBoundingClientRect(); - var x = ev.clientX - rect.left; - var y = ev.clientY - rect.top; - var listeners = _this.listeners; - for (var i = 0; i < listeners.length; i++) { - listeners[i].up(x, y); - } - _this.lastX = x; - _this.lastY = y; - _this.buttonDown = false; - document.removeEventListener("mousemove", mouseMove); - document.removeEventListener("mouseup", mouseUp); - } - }; - element.addEventListener("mousedown", mouseDown, true); - element.addEventListener("mousemove", mouseMove, true); - element.addEventListener("mouseup", mouseUp, true); - element.addEventListener("touchstart", function (ev) { - if (_this.currTouch != null) - return; - var touches = ev.changedTouches; - for (var i = 0; i < touches.length; i++) { - var touch = touches[i]; - var rect = element.getBoundingClientRect(); - var x = touch.clientX - rect.left; - var y = touch.clientY - rect.top; - _this.currTouch = _this.touchesPool.obtain(); - _this.currTouch.identifier = touch.identifier; - _this.currTouch.x = x; - _this.currTouch.y = y; - break; - } - var listeners = _this.listeners; - for (var i_16 = 0; i_16 < listeners.length; i_16++) { - listeners[i_16].down(_this.currTouch.x, _this.currTouch.y); - } - console.log("Start " + _this.currTouch.x + ", " + _this.currTouch.y); - _this.lastX = _this.currTouch.x; - _this.lastY = _this.currTouch.y; - _this.buttonDown = true; - ev.preventDefault(); - }, false); - element.addEventListener("touchend", function (ev) { - var touches = ev.changedTouches; - for (var i = 0; i < touches.length; i++) { - var touch = touches[i]; - if (_this.currTouch.identifier === touch.identifier) { - var rect = element.getBoundingClientRect(); - var x = _this.currTouch.x = touch.clientX - rect.left; - var y = _this.currTouch.y = touch.clientY - rect.top; - _this.touchesPool.free(_this.currTouch); - var listeners = _this.listeners; - for (var i_17 = 0; i_17 < listeners.length; i_17++) { - listeners[i_17].up(x, y); - } - console.log("End " + x + ", " + y); - _this.lastX = x; - _this.lastY = y; - _this.buttonDown = false; - _this.currTouch = null; - break; - } - } - ev.preventDefault(); - }, false); - element.addEventListener("touchcancel", function (ev) { - var touches = ev.changedTouches; - for (var i = 0; i < touches.length; i++) { - var touch = touches[i]; - if (_this.currTouch.identifier === touch.identifier) { - var rect = element.getBoundingClientRect(); - var x = _this.currTouch.x = touch.clientX - rect.left; - var y = _this.currTouch.y = touch.clientY - rect.top; - _this.touchesPool.free(_this.currTouch); - var listeners = _this.listeners; - for (var i_18 = 0; i_18 < listeners.length; i_18++) { - listeners[i_18].up(x, y); - } - console.log("End " + x + ", " + y); - _this.lastX = x; - _this.lastY = y; - _this.buttonDown = false; - _this.currTouch = null; - break; - } - } - ev.preventDefault(); - }, false); - element.addEventListener("touchmove", function (ev) { - if (_this.currTouch == null) - return; - var touches = ev.changedTouches; - for (var i = 0; i < touches.length; i++) { - var touch = touches[i]; - if (_this.currTouch.identifier === touch.identifier) { - var rect = element.getBoundingClientRect(); - var x = touch.clientX - rect.left; - var y = touch.clientY - rect.top; - var listeners = _this.listeners; - for (var i_19 = 0; i_19 < listeners.length; i_19++) { - listeners[i_19].dragged(x, y); - } - console.log("Drag " + x + ", " + y); - _this.lastX = _this.currTouch.x = x; - _this.lastY = _this.currTouch.y = y; - break; - } - } - ev.preventDefault(); - }, false); - }; - Input.prototype.addListener = function (listener) { - this.listeners.push(listener); - }; - Input.prototype.removeListener = function (listener) { - var idx = this.listeners.indexOf(listener); - if (idx > -1) { - this.listeners.splice(idx, 1); - } - }; - return Input; - }()); - webgl.Input = Input; - var Touch = (function () { - function Touch(identifier, x, y) { - this.identifier = identifier; - this.x = x; - this.y = y; - } - return Touch; - }()); - webgl.Touch = Touch; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var LoadingScreen = (function () { - function LoadingScreen(renderer) { - this.logo = null; - this.spinner = null; - this.angle = 0; - this.fadeOut = 0; - this.timeKeeper = new spine.TimeKeeper(); - this.backgroundColor = new spine.Color(0.135, 0.135, 0.135, 1); - this.tempColor = new spine.Color(); - this.firstDraw = 0; - this.renderer = renderer; - this.timeKeeper.maxDelta = 9; - if (LoadingScreen.logoImg === null) { - var isSafari = navigator.userAgent.indexOf("Safari") > -1; - LoadingScreen.logoImg = new Image(); - LoadingScreen.logoImg.src = LoadingScreen.SPINE_LOGO_DATA; - if (!isSafari) - LoadingScreen.logoImg.crossOrigin = "anonymous"; - LoadingScreen.logoImg.onload = function (ev) { - LoadingScreen.loaded++; - }; - LoadingScreen.spinnerImg = new Image(); - LoadingScreen.spinnerImg.src = LoadingScreen.SPINNER_DATA; - if (!isSafari) - LoadingScreen.spinnerImg.crossOrigin = "anonymous"; - LoadingScreen.spinnerImg.onload = function (ev) { - LoadingScreen.loaded++; - }; - } - } - LoadingScreen.prototype.draw = function (complete) { - if (complete === void 0) { complete = false; } - if (complete && this.fadeOut > LoadingScreen.FADE_SECONDS) - return; - this.timeKeeper.update(); - var a = Math.abs(Math.sin(this.timeKeeper.totalTime + 0.75)); - this.angle -= this.timeKeeper.delta / 1.4 * 360 * (1 + 1.5 * Math.pow(a, 5)); - var renderer = this.renderer; - var canvas = renderer.canvas; - var gl = renderer.context.gl; - renderer.resize(webgl.ResizeMode.Stretch); - var oldX = renderer.camera.position.x, oldY = renderer.camera.position.y; - renderer.camera.position.set(canvas.width / 2, canvas.height / 2, 0); - renderer.camera.viewportWidth = canvas.width; - renderer.camera.viewportHeight = canvas.height; - if (!complete) { - gl.clearColor(this.backgroundColor.r, this.backgroundColor.g, this.backgroundColor.b, this.backgroundColor.a); - gl.clear(gl.COLOR_BUFFER_BIT); - this.tempColor.a = 1; - } - else { - this.fadeOut += this.timeKeeper.delta * (this.timeKeeper.totalTime < 1 ? 2 : 1); - if (this.fadeOut > LoadingScreen.FADE_SECONDS) { - renderer.camera.position.set(oldX, oldY, 0); - return; - } - a = 1 - this.fadeOut / LoadingScreen.FADE_SECONDS; - this.tempColor.setFromColor(this.backgroundColor); - this.tempColor.a = 1 - (a - 1) * (a - 1); - renderer.begin(); - renderer.quad(true, 0, 0, canvas.width, 0, canvas.width, canvas.height, 0, canvas.height, this.tempColor, this.tempColor, this.tempColor, this.tempColor); - renderer.end(); - } - this.tempColor.set(1, 1, 1, this.tempColor.a); - if (LoadingScreen.loaded != 2) - return; - if (this.logo === null) { - this.logo = new webgl.GLTexture(renderer.context, LoadingScreen.logoImg); - this.spinner = new webgl.GLTexture(renderer.context, LoadingScreen.spinnerImg); - } - this.logo.update(false); - this.spinner.update(false); - var logoWidth = this.logo.getImage().width; - var logoHeight = this.logo.getImage().height; - var spinnerWidth = this.spinner.getImage().width; - var spinnerHeight = this.spinner.getImage().height; - renderer.batcher.setBlendMode(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); - renderer.begin(); - renderer.drawTexture(this.logo, (canvas.width - logoWidth) / 2, (canvas.height - logoHeight) / 2, logoWidth, logoHeight, this.tempColor); - renderer.drawTextureRotated(this.spinner, (canvas.width - spinnerWidth) / 2, (canvas.height - spinnerHeight) / 2, spinnerWidth, spinnerHeight, spinnerWidth / 2, spinnerHeight / 2, this.angle, this.tempColor); - renderer.end(); - renderer.camera.position.set(oldX, oldY, 0); - }; - LoadingScreen.FADE_SECONDS = 1; - LoadingScreen.loaded = 0; - LoadingScreen.spinnerImg = null; - LoadingScreen.logoImg = null; - LoadingScreen.SPINNER_DATA = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAAACXBIWXMAAAsTAAALEwEAmpwYAAALB2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9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5CYII="; - return LoadingScreen; - }()); - webgl.LoadingScreen = LoadingScreen; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - webgl.M00 = 0; - webgl.M01 = 4; - webgl.M02 = 8; - webgl.M03 = 12; - webgl.M10 = 1; - webgl.M11 = 5; - webgl.M12 = 9; - webgl.M13 = 13; - webgl.M20 = 2; - webgl.M21 = 6; - webgl.M22 = 10; - webgl.M23 = 14; - webgl.M30 = 3; - webgl.M31 = 7; - webgl.M32 = 11; - webgl.M33 = 15; - var Matrix4 = (function () { - function Matrix4() { - this.temp = new Float32Array(16); - this.values = new Float32Array(16); - var v = this.values; - v[webgl.M00] = 1; - v[webgl.M11] = 1; - v[webgl.M22] = 1; - v[webgl.M33] = 1; - } - Matrix4.prototype.set = function (values) { - this.values.set(values); - return this; - }; - Matrix4.prototype.transpose = function () { - var t = this.temp; - var v = this.values; - t[webgl.M00] = v[webgl.M00]; - t[webgl.M01] = v[webgl.M10]; - t[webgl.M02] = v[webgl.M20]; - t[webgl.M03] = v[webgl.M30]; - t[webgl.M10] = v[webgl.M01]; - t[webgl.M11] = v[webgl.M11]; - t[webgl.M12] = v[webgl.M21]; - t[webgl.M13] = v[webgl.M31]; - t[webgl.M20] = v[webgl.M02]; - t[webgl.M21] = v[webgl.M12]; - t[webgl.M22] = v[webgl.M22]; - t[webgl.M23] = v[webgl.M32]; - t[webgl.M30] = v[webgl.M03]; - t[webgl.M31] = v[webgl.M13]; - t[webgl.M32] = v[webgl.M23]; - t[webgl.M33] = v[webgl.M33]; - return this.set(t); - }; - Matrix4.prototype.identity = function () { - var v = this.values; - v[webgl.M00] = 1; - v[webgl.M01] = 0; - v[webgl.M02] = 0; - v[webgl.M03] = 0; - v[webgl.M10] = 0; - v[webgl.M11] = 1; - v[webgl.M12] = 0; - v[webgl.M13] = 0; - v[webgl.M20] = 0; - v[webgl.M21] = 0; - v[webgl.M22] = 1; - v[webgl.M23] = 0; - v[webgl.M30] = 0; - v[webgl.M31] = 0; - v[webgl.M32] = 0; - v[webgl.M33] = 1; - return this; - }; - Matrix4.prototype.invert = function () { - var v = this.values; - var t = this.temp; - var l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] - + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] - - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] - - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] - + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] - + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] - - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] - - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; - if (l_det == 0) - throw new Error("non-invertible matrix"); - var inv_det = 1.0 / l_det; - t[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32] - - v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; - t[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32] - + v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33]; - t[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32] - - v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33]; - t[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22] - + v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23]; - t[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32] - + v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33]; - t[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32] - - v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33]; - t[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32] - + v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33]; - t[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22] - - v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23]; - t[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31] - - v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33]; - t[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31] - + v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33]; - t[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31] - - v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33]; - t[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21] - + v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23]; - t[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31] - + v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32]; - t[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31] - - v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32]; - t[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31] - + v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32]; - t[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21] - - v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22]; - v[webgl.M00] = t[webgl.M00] * inv_det; - v[webgl.M01] = t[webgl.M01] * inv_det; - v[webgl.M02] = t[webgl.M02] * inv_det; - v[webgl.M03] = t[webgl.M03] * inv_det; - v[webgl.M10] = t[webgl.M10] * inv_det; - v[webgl.M11] = t[webgl.M11] * inv_det; - v[webgl.M12] = t[webgl.M12] * inv_det; - v[webgl.M13] = t[webgl.M13] * inv_det; - v[webgl.M20] = t[webgl.M20] * inv_det; - v[webgl.M21] = t[webgl.M21] * inv_det; - v[webgl.M22] = t[webgl.M22] * inv_det; - v[webgl.M23] = t[webgl.M23] * inv_det; - v[webgl.M30] = t[webgl.M30] * inv_det; - v[webgl.M31] = t[webgl.M31] * inv_det; - v[webgl.M32] = t[webgl.M32] * inv_det; - v[webgl.M33] = t[webgl.M33] * inv_det; - return this; - }; - Matrix4.prototype.determinant = function () { - var v = this.values; - return v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] - + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] - - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] - - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] - + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] - + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] - - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] - - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; - }; - Matrix4.prototype.translate = function (x, y, z) { - var v = this.values; - v[webgl.M03] += x; - v[webgl.M13] += y; - v[webgl.M23] += z; - return this; - }; - Matrix4.prototype.copy = function () { - return new Matrix4().set(this.values); - }; - Matrix4.prototype.projection = function (near, far, fovy, aspectRatio) { - this.identity(); - var l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0)); - var l_a1 = (far + near) / (near - far); - var l_a2 = (2 * far * near) / (near - far); - var v = this.values; - v[webgl.M00] = l_fd / aspectRatio; - v[webgl.M10] = 0; - v[webgl.M20] = 0; - v[webgl.M30] = 0; - v[webgl.M01] = 0; - v[webgl.M11] = l_fd; - v[webgl.M21] = 0; - v[webgl.M31] = 0; - v[webgl.M02] = 0; - v[webgl.M12] = 0; - v[webgl.M22] = l_a1; - v[webgl.M32] = -1; - v[webgl.M03] = 0; - v[webgl.M13] = 0; - v[webgl.M23] = l_a2; - v[webgl.M33] = 0; - return this; - }; - Matrix4.prototype.ortho2d = function (x, y, width, height) { - return this.ortho(x, x + width, y, y + height, 0, 1); - }; - Matrix4.prototype.ortho = function (left, right, bottom, top, near, far) { - this.identity(); - var x_orth = 2 / (right - left); - var y_orth = 2 / (top - bottom); - var z_orth = -2 / (far - near); - var tx = -(right + left) / (right - left); - var ty = -(top + bottom) / (top - bottom); - var tz = -(far + near) / (far - near); - var v = this.values; - v[webgl.M00] = x_orth; - v[webgl.M10] = 0; - v[webgl.M20] = 0; - v[webgl.M30] = 0; - v[webgl.M01] = 0; - v[webgl.M11] = y_orth; - v[webgl.M21] = 0; - v[webgl.M31] = 0; - v[webgl.M02] = 0; - v[webgl.M12] = 0; - v[webgl.M22] = z_orth; - v[webgl.M32] = 0; - v[webgl.M03] = tx; - v[webgl.M13] = ty; - v[webgl.M23] = tz; - v[webgl.M33] = 1; - return this; - }; - Matrix4.prototype.multiply = function (matrix) { - var t = this.temp; - var v = this.values; - var m = matrix.values; - t[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30]; - t[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31]; - t[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32]; - t[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33]; - t[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30]; - t[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31]; - t[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32]; - t[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33]; - t[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30]; - t[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31]; - t[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32]; - t[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33]; - t[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30]; - t[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31]; - t[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32]; - t[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33]; - return this.set(this.temp); - }; - Matrix4.prototype.multiplyLeft = function (matrix) { - var t = this.temp; - var v = this.values; - var m = matrix.values; - t[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30]; - t[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31]; - t[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32]; - t[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33]; - t[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30]; - t[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31]; - t[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32]; - t[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33]; - t[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30]; - t[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31]; - t[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32]; - t[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33]; - t[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30]; - t[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31]; - t[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32]; - t[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33]; - return this.set(this.temp); - }; - Matrix4.prototype.lookAt = function (position, direction, up) { - Matrix4.initTemps(); - var xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis; - zAxis.setFrom(direction).normalize(); - xAxis.setFrom(direction).normalize(); - xAxis.cross(up).normalize(); - yAxis.setFrom(xAxis).cross(zAxis).normalize(); - this.identity(); - var val = this.values; - val[webgl.M00] = xAxis.x; - val[webgl.M01] = xAxis.y; - val[webgl.M02] = xAxis.z; - val[webgl.M10] = yAxis.x; - val[webgl.M11] = yAxis.y; - val[webgl.M12] = yAxis.z; - val[webgl.M20] = -zAxis.x; - val[webgl.M21] = -zAxis.y; - val[webgl.M22] = -zAxis.z; - Matrix4.tmpMatrix.identity(); - Matrix4.tmpMatrix.values[webgl.M03] = -position.x; - Matrix4.tmpMatrix.values[webgl.M13] = -position.y; - Matrix4.tmpMatrix.values[webgl.M23] = -position.z; - this.multiply(Matrix4.tmpMatrix); - return this; - }; - Matrix4.initTemps = function () { - if (Matrix4.xAxis === null) - Matrix4.xAxis = new webgl.Vector3(); - if (Matrix4.yAxis === null) - Matrix4.yAxis = new webgl.Vector3(); - if (Matrix4.zAxis === null) - Matrix4.zAxis = new webgl.Vector3(); - }; - Matrix4.xAxis = null; - Matrix4.yAxis = null; - Matrix4.zAxis = null; - Matrix4.tmpMatrix = new Matrix4(); - return Matrix4; - }()); - webgl.Matrix4 = Matrix4; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var Mesh = (function () { - function Mesh(context, attributes, maxVertices, maxIndices) { - this.attributes = attributes; - this.verticesLength = 0; - this.dirtyVertices = false; - this.indicesLength = 0; - this.dirtyIndices = false; - this.elementsPerVertex = 0; - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - this.elementsPerVertex = 0; - for (var i = 0; i < attributes.length; i++) { - this.elementsPerVertex += attributes[i].numElements; - } - this.vertices = new Float32Array(maxVertices * this.elementsPerVertex); - this.indices = new Uint16Array(maxIndices); - this.context.addRestorable(this); - } - Mesh.prototype.getAttributes = function () { return this.attributes; }; - Mesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; }; - Mesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; }; - Mesh.prototype.setVerticesLength = function (length) { - this.dirtyVertices = true; - this.verticesLength = length; - }; - Mesh.prototype.getVertices = function () { return this.vertices; }; - Mesh.prototype.maxIndices = function () { return this.indices.length; }; - Mesh.prototype.numIndices = function () { return this.indicesLength; }; - Mesh.prototype.setIndicesLength = function (length) { - this.dirtyIndices = true; - this.indicesLength = length; - }; - Mesh.prototype.getIndices = function () { return this.indices; }; - ; - Mesh.prototype.getVertexSizeInFloats = function () { - var size = 0; - for (var i = 0; i < this.attributes.length; i++) { - var attribute = this.attributes[i]; - size += attribute.numElements; - } - return size; - }; - Mesh.prototype.setVertices = function (vertices) { - this.dirtyVertices = true; - if (vertices.length > this.vertices.length) - throw Error("Mesh can't store more than " + this.maxVertices() + " vertices"); - this.vertices.set(vertices, 0); - this.verticesLength = vertices.length; - }; - Mesh.prototype.setIndices = function (indices) { - this.dirtyIndices = true; - if (indices.length > this.indices.length) - throw Error("Mesh can't store more than " + this.maxIndices() + " indices"); - this.indices.set(indices, 0); - this.indicesLength = indices.length; - }; - Mesh.prototype.draw = function (shader, primitiveType) { - this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex); - }; - Mesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) { - var gl = this.context.gl; - if (this.dirtyVertices || this.dirtyIndices) - this.update(); - this.bind(shader); - if (this.indicesLength > 0) { - gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2); - } - else { - gl.drawArrays(primitiveType, offset, count); - } - this.unbind(shader); - }; - Mesh.prototype.bind = function (shader) { - var gl = this.context.gl; - gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); - var offset = 0; - for (var i = 0; i < this.attributes.length; i++) { - var attrib = this.attributes[i]; - var location_1 = shader.getAttributeLocation(attrib.name); - gl.enableVertexAttribArray(location_1); - gl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4); - offset += attrib.numElements; - } - if (this.indicesLength > 0) - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); - }; - Mesh.prototype.unbind = function (shader) { - var gl = this.context.gl; - for (var i = 0; i < this.attributes.length; i++) { - var attrib = this.attributes[i]; - var location_2 = shader.getAttributeLocation(attrib.name); - gl.disableVertexAttribArray(location_2); - } - gl.bindBuffer(gl.ARRAY_BUFFER, null); - if (this.indicesLength > 0) - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); - }; - Mesh.prototype.update = function () { - var gl = this.context.gl; - if (this.dirtyVertices) { - if (!this.verticesBuffer) { - this.verticesBuffer = gl.createBuffer(); - } - gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW); - this.dirtyVertices = false; - } - if (this.dirtyIndices) { - if (!this.indicesBuffer) { - this.indicesBuffer = gl.createBuffer(); - } - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW); - this.dirtyIndices = false; - } - }; - Mesh.prototype.restore = function () { - this.verticesBuffer = null; - this.indicesBuffer = null; - this.update(); - }; - Mesh.prototype.dispose = function () { - this.context.removeRestorable(this); - var gl = this.context.gl; - gl.deleteBuffer(this.verticesBuffer); - gl.deleteBuffer(this.indicesBuffer); - }; - return Mesh; - }()); - webgl.Mesh = Mesh; - var VertexAttribute = (function () { - function VertexAttribute(name, type, numElements) { - this.name = name; - this.type = type; - this.numElements = numElements; - } - return VertexAttribute; - }()); - webgl.VertexAttribute = VertexAttribute; - var Position2Attribute = (function (_super) { - __extends(Position2Attribute, _super); - function Position2Attribute() { - return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this; - } - return Position2Attribute; - }(VertexAttribute)); - webgl.Position2Attribute = Position2Attribute; - var Position3Attribute = (function (_super) { - __extends(Position3Attribute, _super); - function Position3Attribute() { - return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this; - } - return Position3Attribute; - }(VertexAttribute)); - webgl.Position3Attribute = Position3Attribute; - var TexCoordAttribute = (function (_super) { - __extends(TexCoordAttribute, _super); - function TexCoordAttribute(unit) { - if (unit === void 0) { unit = 0; } - return _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? "" : unit), VertexAttributeType.Float, 2) || this; - } - return TexCoordAttribute; - }(VertexAttribute)); - webgl.TexCoordAttribute = TexCoordAttribute; - var ColorAttribute = (function (_super) { - __extends(ColorAttribute, _super); - function ColorAttribute() { - return _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this; - } - return ColorAttribute; - }(VertexAttribute)); - webgl.ColorAttribute = ColorAttribute; - var Color2Attribute = (function (_super) { - __extends(Color2Attribute, _super); - function Color2Attribute() { - return _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this; - } - return Color2Attribute; - }(VertexAttribute)); - webgl.Color2Attribute = Color2Attribute; - var VertexAttributeType; - (function (VertexAttributeType) { - VertexAttributeType[VertexAttributeType["Float"] = 0] = "Float"; - })(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {})); - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var PolygonBatcher = (function () { - function PolygonBatcher(context, twoColorTint, maxVertices) { - if (twoColorTint === void 0) { twoColorTint = true; } - if (maxVertices === void 0) { maxVertices = 10920; } - this.isDrawing = false; - this.shader = null; - this.lastTexture = null; - this.verticesLength = 0; - this.indicesLength = 0; - if (maxVertices > 10920) - throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - var attributes = twoColorTint ? - [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] : - [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()]; - this.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3); - this.srcBlend = this.context.gl.SRC_ALPHA; - this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; - } - PolygonBatcher.prototype.begin = function (shader) { - var gl = 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 = shader; - this.lastTexture = null; - this.isDrawing = true; - gl.enable(gl.BLEND); - gl.blendFunc(this.srcBlend, this.dstBlend); - }; - PolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) { - var gl = this.context.gl; - this.srcBlend = srcBlend; - this.dstBlend = dstBlend; - if (this.isDrawing) { - this.flush(); - gl.blendFunc(this.srcBlend, this.dstBlend); - } - }; - PolygonBatcher.prototype.draw = function (texture, vertices, indices) { - if (texture != this.lastTexture) { - this.flush(); - this.lastTexture = texture; - } - else if (this.verticesLength + vertices.length > this.mesh.getVertices().length || - this.indicesLength + indices.length > this.mesh.getIndices().length) { - this.flush(); - } - var indexStart = this.mesh.numVertices(); - this.mesh.getVertices().set(vertices, this.verticesLength); - this.verticesLength += vertices.length; - this.mesh.setVerticesLength(this.verticesLength); - var indicesArray = this.mesh.getIndices(); - for (var i = this.indicesLength, j = 0; j < indices.length; i++, j++) - indicesArray[i] = indices[j] + indexStart; - this.indicesLength += indices.length; - this.mesh.setIndicesLength(this.indicesLength); - }; - PolygonBatcher.prototype.flush = function () { - var gl = this.context.gl; - if (this.verticesLength == 0) - return; - this.lastTexture.bind(); - this.mesh.draw(this.shader, gl.TRIANGLES); - this.verticesLength = 0; - this.indicesLength = 0; - this.mesh.setVerticesLength(0); - this.mesh.setIndicesLength(0); - this.drawCalls++; - }; - PolygonBatcher.prototype.end = function () { - var gl = this.context.gl; - if (!this.isDrawing) - throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()"); - if (this.verticesLength > 0 || this.indicesLength > 0) - this.flush(); - this.shader = null; - this.lastTexture = null; - this.isDrawing = false; - gl.disable(gl.BLEND); - }; - PolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; }; - PolygonBatcher.prototype.dispose = function () { - this.mesh.dispose(); - }; - return PolygonBatcher; - }()); - webgl.PolygonBatcher = PolygonBatcher; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var SceneRenderer = (function () { - function SceneRenderer(canvas, context, twoColorTint) { - if (twoColorTint === void 0) { twoColorTint = true; } - this.twoColorTint = false; - 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 spine.Color(1, 1, 1, 1); - this.canvas = canvas; - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - this.twoColorTint = twoColorTint; - this.camera = new webgl.OrthoCamera(canvas.width, canvas.height); - this.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context); - this.batcher = new webgl.PolygonBatcher(this.context, twoColorTint); - this.shapesShader = webgl.Shader.newColored(this.context); - this.shapes = new webgl.ShapeRenderer(this.context); - this.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint); - this.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context); - } - SceneRenderer.prototype.begin = function () { - this.camera.update(); - this.enableRenderer(this.batcher); - }; - SceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) { - if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } - if (slotRangeStart === void 0) { slotRangeStart = -1; } - if (slotRangeEnd === void 0) { slotRangeEnd = -1; } - this.enableRenderer(this.batcher); - this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha; - this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd); - }; - SceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) { - if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } - if (ignoredBones === void 0) { ignoredBones = null; } - this.enableRenderer(this.shapes); - this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha; - this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones); - }; - SceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.batcher); - if (color === null) - color = this.WHITE; - var quad = this.QUAD; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); - }; - SceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.batcher); - if (color === null) - color = this.WHITE; - var quad = this.QUAD; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u; - quad[i++] = v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u2; - quad[i++] = v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u2; - quad[i++] = v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u; - quad[i++] = v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); - }; - SceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) { - if (color === void 0) { color = null; } - if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } - this.enableRenderer(this.batcher); - if (color === null) - color = this.WHITE; - var quad = this.QUAD; - var worldOriginX = x + pivotX; - var worldOriginY = y + pivotY; - var fx = -pivotX; - var fy = -pivotY; - var fx2 = width - pivotX; - var fy2 = height - pivotY; - var p1x = fx; - var p1y = fy; - var p2x = fx; - var p2y = fy2; - var p3x = fx2; - var p3y = fy2; - var p4x = fx2; - var p4y = fy; - var x1 = 0; - var y1 = 0; - var x2 = 0; - var y2 = 0; - var x3 = 0; - var y3 = 0; - var x4 = 0; - var y4 = 0; - if (angle != 0) { - var cos = spine.MathUtils.cosDeg(angle); - var sin = spine.MathUtils.sinDeg(angle); - x1 = cos * p1x - sin * p1y; - y1 = sin * p1x + cos * p1y; - x4 = cos * p2x - sin * p2y; - y4 = sin * p2x + cos * p2y; - x3 = cos * p3x - sin * p3y; - y3 = sin * p3x + cos * p3y; - x2 = x3 + (x1 - x4); - y2 = y3 + (y1 - y4); - } - else { - x1 = p1x; - y1 = p1y; - x4 = p2x; - y4 = p2y; - x3 = p3x; - y3 = p3y; - x2 = p4x; - y2 = p4y; - } - x1 += worldOriginX; - y1 += worldOriginY; - x2 += worldOriginX; - y2 += worldOriginY; - x3 += worldOriginX; - y3 += worldOriginY; - x4 += worldOriginX; - y4 += worldOriginY; - var i = 0; - quad[i++] = x1; - quad[i++] = y1; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x2; - quad[i++] = y2; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x3; - quad[i++] = y3; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x4; - quad[i++] = y4; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); - }; - SceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) { - if (color === void 0) { color = null; } - if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } - this.enableRenderer(this.batcher); - if (color === null) - color = this.WHITE; - var quad = this.QUAD; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u; - quad[i++] = region.v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u2; - quad[i++] = region.v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u2; - quad[i++] = region.v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u; - quad[i++] = region.v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - this.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES); - }; - SceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) { - if (color === void 0) { color = null; } - if (color2 === void 0) { color2 = null; } - this.enableRenderer(this.shapes); - this.shapes.line(x, y, x2, y2, color); - }; - SceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { - if (color === void 0) { color = null; } - if (color2 === void 0) { color2 = null; } - if (color3 === void 0) { color3 = null; } - this.enableRenderer(this.shapes); - this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3); - }; - SceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { - if (color === void 0) { color = null; } - if (color2 === void 0) { color2 = null; } - if (color3 === void 0) { color3 = null; } - if (color4 === void 0) { color4 = null; } - this.enableRenderer(this.shapes); - this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4); - }; - SceneRenderer.prototype.rect = function (filled, x, y, width, height, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.shapes); - this.shapes.rect(filled, x, y, width, height, color); - }; - SceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.shapes); - this.shapes.rectLine(filled, x1, y1, x2, y2, width, color); - }; - SceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.shapes); - this.shapes.polygon(polygonVertices, offset, count, color); - }; - SceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { - if (color === void 0) { color = null; } - if (segments === void 0) { segments = 0; } - this.enableRenderer(this.shapes); - this.shapes.circle(filled, x, y, radius, color, segments); - }; - SceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.shapes); - this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color); - }; - SceneRenderer.prototype.end = function () { - if (this.activeRenderer === this.batcher) - this.batcher.end(); - else if (this.activeRenderer === this.shapes) - this.shapes.end(); - this.activeRenderer = null; - }; - SceneRenderer.prototype.resize = function (resizeMode) { - var canvas = this.canvas; - var w = canvas.clientWidth; - var h = canvas.clientHeight; - if (canvas.width != w || canvas.height != h) { - canvas.width = w; - canvas.height = h; - } - this.context.gl.viewport(0, 0, canvas.width, canvas.height); - if (resizeMode === ResizeMode.Stretch) { - } - else if (resizeMode === ResizeMode.Expand) { - this.camera.setViewport(w, h); - } - else if (resizeMode === ResizeMode.Fit) { - var sourceWidth = canvas.width, sourceHeight = canvas.height; - var targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight; - var targetRatio = targetHeight / targetWidth; - var sourceRatio = sourceHeight / sourceWidth; - var scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight; - this.camera.viewportWidth = sourceWidth * scale; - this.camera.viewportHeight = sourceHeight * scale; - } - this.camera.update(); - }; - SceneRenderer.prototype.enableRenderer = function (renderer) { - if (this.activeRenderer === renderer) - return; - this.end(); - if (renderer instanceof webgl.PolygonBatcher) { - this.batcherShader.bind(); - this.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); - this.batcherShader.setUniformi("u_texture", 0); - this.batcher.begin(this.batcherShader); - this.activeRenderer = this.batcher; - } - else if (renderer instanceof webgl.ShapeRenderer) { - this.shapesShader.bind(); - this.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); - this.shapes.begin(this.shapesShader); - this.activeRenderer = this.shapes; - } - else { - this.activeRenderer = this.skeletonDebugRenderer; - } - }; - SceneRenderer.prototype.dispose = function () { - this.batcher.dispose(); - this.batcherShader.dispose(); - this.shapes.dispose(); - this.shapesShader.dispose(); - this.skeletonDebugRenderer.dispose(); - }; - return SceneRenderer; - }()); - webgl.SceneRenderer = SceneRenderer; - var ResizeMode; - (function (ResizeMode) { - ResizeMode[ResizeMode["Stretch"] = 0] = "Stretch"; - ResizeMode[ResizeMode["Expand"] = 1] = "Expand"; - ResizeMode[ResizeMode["Fit"] = 2] = "Fit"; - })(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {})); - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var Shader = (function () { - function Shader(context, vertexShader, fragmentShader) { - this.vertexShader = vertexShader; - this.fragmentShader = fragmentShader; - this.vs = null; - this.fs = null; - this.program = null; - this.tmp2x2 = new Float32Array(2 * 2); - this.tmp3x3 = new Float32Array(3 * 3); - this.tmp4x4 = new Float32Array(4 * 4); - this.vsSource = vertexShader; - this.fsSource = fragmentShader; - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - this.context.addRestorable(this); - this.compile(); - } - Shader.prototype.getProgram = function () { return this.program; }; - Shader.prototype.getVertexShader = function () { return this.vertexShader; }; - Shader.prototype.getFragmentShader = function () { return this.fragmentShader; }; - Shader.prototype.getVertexShaderSource = function () { return this.vsSource; }; - Shader.prototype.getFragmentSource = function () { return this.fsSource; }; - Shader.prototype.compile = function () { - var gl = this.context.gl; - try { - this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader); - this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader); - this.program = this.compileProgram(this.vs, this.fs); - } - catch (e) { - this.dispose(); - throw e; - } - }; - Shader.prototype.compileShader = function (type, source) { - var gl = this.context.gl; - var shader = gl.createShader(type); - gl.shaderSource(shader, source); - gl.compileShader(shader); - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { - var error = "Couldn't compile shader: " + gl.getShaderInfoLog(shader); - gl.deleteShader(shader); - if (!gl.isContextLost()) - throw new Error(error); - } - return shader; - }; - Shader.prototype.compileProgram = function (vs, fs) { - var gl = this.context.gl; - var program = gl.createProgram(); - gl.attachShader(program, vs); - gl.attachShader(program, fs); - gl.linkProgram(program); - if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { - var error = "Couldn't compile shader program: " + gl.getProgramInfoLog(program); - gl.deleteProgram(program); - if (!gl.isContextLost()) - throw new Error(error); - } - return program; - }; - Shader.prototype.restore = function () { - this.compile(); - }; - Shader.prototype.bind = function () { - this.context.gl.useProgram(this.program); - }; - Shader.prototype.unbind = function () { - this.context.gl.useProgram(null); - }; - Shader.prototype.setUniformi = function (uniform, value) { - this.context.gl.uniform1i(this.getUniformLocation(uniform), value); - }; - Shader.prototype.setUniformf = function (uniform, value) { - this.context.gl.uniform1f(this.getUniformLocation(uniform), value); - }; - Shader.prototype.setUniform2f = function (uniform, value, value2) { - this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2); - }; - Shader.prototype.setUniform3f = function (uniform, value, value2, value3) { - this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3); - }; - Shader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) { - this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4); - }; - Shader.prototype.setUniform2x2f = function (uniform, value) { - var gl = this.context.gl; - this.tmp2x2.set(value); - gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2); - }; - Shader.prototype.setUniform3x3f = function (uniform, value) { - var gl = this.context.gl; - this.tmp3x3.set(value); - gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3); - }; - Shader.prototype.setUniform4x4f = function (uniform, value) { - var gl = this.context.gl; - this.tmp4x4.set(value); - gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4); - }; - Shader.prototype.getUniformLocation = function (uniform) { - var gl = this.context.gl; - var location = gl.getUniformLocation(this.program, uniform); - if (!location && !gl.isContextLost()) - throw new Error("Couldn't find location for uniform " + uniform); - return location; - }; - Shader.prototype.getAttributeLocation = function (attribute) { - var gl = this.context.gl; - var location = gl.getAttribLocation(this.program, attribute); - if (location == -1 && !gl.isContextLost()) - throw new Error("Couldn't find location for attribute " + attribute); - return location; - }; - Shader.prototype.dispose = function () { - this.context.removeRestorable(this); - var gl = this.context.gl; - if (this.vs) { - gl.deleteShader(this.vs); - this.vs = null; - } - if (this.fs) { - gl.deleteShader(this.fs); - this.fs = null; - } - if (this.program) { - gl.deleteProgram(this.program); - this.program = null; - } - }; - Shader.newColoredTextured = function (context) { - var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; - var fs = "\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"; - return new Shader(context, vs, fs); - }; - Shader.newTwoColoredTextured = function (context) { - var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR2 + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_dark = " + Shader.COLOR2 + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; - var fs = "\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"; - return new Shader(context, vs, fs); - }; - Shader.newColored = function (context) { - var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tuniform mat4 " + Shader.MVP_MATRIX + ";\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = " + Shader.COLOR + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; - var fs = "\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"; - return new Shader(context, vs, fs); - }; - Shader.MVP_MATRIX = "u_projTrans"; - Shader.POSITION = "a_position"; - Shader.COLOR = "a_color"; - Shader.COLOR2 = "a_color2"; - Shader.TEXCOORDS = "a_texCoords"; - Shader.SAMPLER = "u_texture"; - return Shader; - }()); - webgl.Shader = Shader; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var ShapeRenderer = (function () { - function ShapeRenderer(context, maxVertices) { - if (maxVertices === void 0) { maxVertices = 10920; } - this.isDrawing = false; - this.shapeType = ShapeType.Filled; - this.color = new spine.Color(1, 1, 1, 1); - this.vertexIndex = 0; - this.tmp = new spine.Vector2(); - if (maxVertices > 10920) - throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - this.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0); - this.srcBlend = this.context.gl.SRC_ALPHA; - this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; - } - ShapeRenderer.prototype.begin = function (shader) { - if (this.isDrawing) - throw new Error("ShapeRenderer.begin() has already been called"); - this.shader = shader; - this.vertexIndex = 0; - this.isDrawing = true; - var gl = this.context.gl; - gl.enable(gl.BLEND); - gl.blendFunc(this.srcBlend, this.dstBlend); - }; - ShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) { - var gl = this.context.gl; - this.srcBlend = srcBlend; - this.dstBlend = dstBlend; - if (this.isDrawing) { - this.flush(); - gl.blendFunc(this.srcBlend, this.dstBlend); - } - }; - ShapeRenderer.prototype.setColor = function (color) { - this.color.setFromColor(color); - }; - ShapeRenderer.prototype.setColorWith = function (r, g, b, a) { - this.color.set(r, g, b, a); - }; - ShapeRenderer.prototype.point = function (x, y, color) { - if (color === void 0) { color = null; } - this.check(ShapeType.Point, 1); - if (color === null) - color = this.color; - this.vertex(x, y, color); - }; - ShapeRenderer.prototype.line = function (x, y, x2, y2, color) { - if (color === void 0) { color = null; } - this.check(ShapeType.Line, 2); - var vertices = this.mesh.getVertices(); - var idx = this.vertexIndex; - if (color === null) - color = this.color; - this.vertex(x, y, color); - this.vertex(x2, y2, color); - }; - ShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { - if (color === void 0) { color = null; } - if (color2 === void 0) { color2 = null; } - if (color3 === void 0) { color3 = null; } - this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); - var vertices = this.mesh.getVertices(); - var idx = this.vertexIndex; - if (color === null) - color = this.color; - if (color2 === null) - color2 = this.color; - if (color3 === null) - color3 = this.color; - if (filled) { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - } - else { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x2, y2, color); - this.vertex(x3, y3, color2); - this.vertex(x3, y3, color); - this.vertex(x, y, color2); - } - }; - ShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { - if (color === void 0) { color = null; } - if (color2 === void 0) { color2 = null; } - if (color3 === void 0) { color3 = null; } - if (color4 === void 0) { color4 = null; } - this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); - var vertices = this.mesh.getVertices(); - var idx = this.vertexIndex; - if (color === null) - color = this.color; - if (color2 === null) - color2 = this.color; - if (color3 === null) - color3 = this.color; - if (color4 === null) - color4 = this.color; - if (filled) { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - this.vertex(x3, y3, color3); - this.vertex(x4, y4, color4); - this.vertex(x, y, color); - } - else { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - this.vertex(x3, y3, color3); - this.vertex(x4, y4, color4); - this.vertex(x4, y4, color4); - this.vertex(x, y, color); - } - }; - ShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) { - if (color === void 0) { color = null; } - this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color); - }; - ShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { - if (color === void 0) { color = null; } - this.check(filled ? ShapeType.Filled : ShapeType.Line, 8); - if (color === null) - color = this.color; - var t = this.tmp.set(y2 - y1, x1 - x2); - t.normalize(); - width *= 0.5; - var tx = t.x * width; - var ty = t.y * width; - if (!filled) { - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x1 - tx, y1 - ty, color); - } - else { - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - } - }; - ShapeRenderer.prototype.x = function (x, y, size) { - this.line(x - size, y - size, x + size, y + size); - this.line(x - size, y + size, x + size, y - size); - }; - ShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { - if (color === void 0) { color = null; } - if (count < 3) - throw new Error("Polygon must contain at least 3 vertices"); - this.check(ShapeType.Line, count * 2); - if (color === null) - color = this.color; - var vertices = this.mesh.getVertices(); - var idx = this.vertexIndex; - offset <<= 1; - count <<= 1; - var firstX = polygonVertices[offset]; - var firstY = polygonVertices[offset + 1]; - var last = offset + count; - for (var i = offset, n = offset + count - 2; i < n; i += 2) { - var x1 = polygonVertices[i]; - var y1 = polygonVertices[i + 1]; - var x2 = 0; - var y2 = 0; - if (i + 2 >= last) { - x2 = firstX; - y2 = firstY; - } - else { - x2 = polygonVertices[i + 2]; - y2 = polygonVertices[i + 3]; - } - this.vertex(x1, y1, color); - this.vertex(x2, y2, color); - } - }; - ShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { - if (color === void 0) { color = null; } - if (segments === void 0) { segments = 0; } - if (segments === 0) - segments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0); - if (segments <= 0) - throw new Error("segments must be > 0."); - if (color === null) - color = this.color; - var angle = 2 * spine.MathUtils.PI / segments; - var cos = Math.cos(angle); - var sin = Math.sin(angle); - var cx = radius, cy = 0; - if (!filled) { - this.check(ShapeType.Line, segments * 2 + 2); - for (var i = 0; i < segments; i++) { - this.vertex(x + cx, y + cy, color); - var temp_1 = cx; - cx = cos * cx - sin * cy; - cy = sin * temp_1 + cos * cy; - this.vertex(x + cx, y + cy, color); - } - this.vertex(x + cx, y + cy, color); - } - else { - this.check(ShapeType.Filled, segments * 3 + 3); - segments--; - for (var i = 0; i < segments; i++) { - this.vertex(x, y, color); - this.vertex(x + cx, y + cy, color); - var temp_2 = cx; - cx = cos * cx - sin * cy; - cy = sin * temp_2 + cos * cy; - this.vertex(x + cx, y + cy, color); - } - this.vertex(x, y, color); - this.vertex(x + cx, y + cy, color); - } - var temp = cx; - cx = radius; - cy = 0; - this.vertex(x + cx, y + cy, color); - }; - ShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { - if (color === void 0) { color = null; } - this.check(ShapeType.Line, segments * 2 + 2); - if (color === null) - color = this.color; - var subdiv_step = 1 / segments; - var subdiv_step2 = subdiv_step * subdiv_step; - var subdiv_step3 = subdiv_step * subdiv_step * subdiv_step; - var pre1 = 3 * subdiv_step; - var pre2 = 3 * subdiv_step2; - var pre4 = 6 * subdiv_step2; - var pre5 = 6 * subdiv_step3; - var tmp1x = x1 - cx1 * 2 + cx2; - var tmp1y = y1 - cy1 * 2 + cy2; - var tmp2x = (cx1 - cx2) * 3 - x1 + x2; - var tmp2y = (cy1 - cy2) * 3 - y1 + y2; - var fx = x1; - var fy = y1; - var dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3; - var dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3; - var ddfx = tmp1x * pre4 + tmp2x * pre5; - var ddfy = tmp1y * pre4 + tmp2y * pre5; - var dddfx = tmp2x * pre5; - var dddfy = tmp2y * pre5; - while (segments-- > 0) { - this.vertex(fx, fy, color); - fx += dfx; - fy += dfy; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - this.vertex(fx, fy, color); - } - this.vertex(fx, fy, color); - this.vertex(x2, y2, color); - }; - ShapeRenderer.prototype.vertex = function (x, y, color) { - var idx = this.vertexIndex; - var vertices = this.mesh.getVertices(); - vertices[idx++] = x; - vertices[idx++] = y; - vertices[idx++] = color.r; - vertices[idx++] = color.g; - vertices[idx++] = color.b; - vertices[idx++] = color.a; - this.vertexIndex = idx; - }; - ShapeRenderer.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 = false; - }; - ShapeRenderer.prototype.flush = function () { - if (this.vertexIndex == 0) - return; - this.mesh.setVerticesLength(this.vertexIndex); - this.mesh.draw(this.shader, this.shapeType); - this.vertexIndex = 0; - }; - ShapeRenderer.prototype.check = function (shapeType, numVertices) { - if (!this.isDrawing) - throw new Error("ShapeRenderer.begin() has not been called"); - if (this.shapeType == shapeType) { - if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) - this.flush(); - else - return; - } - else { - this.flush(); - this.shapeType = shapeType; - } - }; - ShapeRenderer.prototype.dispose = function () { - this.mesh.dispose(); - }; - return ShapeRenderer; - }()); - webgl.ShapeRenderer = ShapeRenderer; - var ShapeType; - (function (ShapeType) { - ShapeType[ShapeType["Point"] = 0] = "Point"; - ShapeType[ShapeType["Line"] = 1] = "Line"; - ShapeType[ShapeType["Filled"] = 4] = "Filled"; - })(ShapeType = webgl.ShapeType || (webgl.ShapeType = {})); - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var SkeletonDebugRenderer = (function () { - function SkeletonDebugRenderer(context) { - this.boneLineColor = new spine.Color(1, 0, 0, 1); - this.boneOriginColor = new spine.Color(0, 1, 0, 1); - this.attachmentLineColor = new spine.Color(0, 0, 1, 0.5); - this.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5); - this.pathColor = new spine.Color().setFromString("FF7F00"); - this.clipColor = new spine.Color(0.8, 0, 0, 2); - this.aabbColor = new spine.Color(0, 1, 0, 0.5); - this.drawBones = true; - this.drawRegionAttachments = true; - this.drawBoundingBoxes = true; - this.drawMeshHull = true; - this.drawMeshTriangles = true; - this.drawPaths = true; - this.drawSkeletonXY = false; - this.drawClipping = true; - this.premultipliedAlpha = false; - this.scale = 1; - this.boneWidth = 2; - this.bounds = new spine.SkeletonBounds(); - this.temp = new Array(); - this.vertices = spine.Utils.newFloatArray(2 * 1024); - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - } - SkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) { - if (ignoredBones === void 0) { ignoredBones = null; } - var skeletonX = skeleton.x; - var skeletonY = skeleton.y; - var gl = this.context.gl; - var srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA; - shapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA); - var bones = skeleton.bones; - if (this.drawBones) { - shapes.setColor(this.boneLineColor); - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) - continue; - if (bone.parent == null) - continue; - var x = skeletonX + bone.data.length * bone.a + bone.worldX; - var y = skeletonY + bone.data.length * bone.c + bone.worldY; - shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale); - } - if (this.drawSkeletonXY) - shapes.x(skeletonX, skeletonY, 4 * this.scale); - } - if (this.drawRegionAttachments) { - shapes.setColor(this.attachmentLineColor); - var slots = skeleton.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var attachment = slot.getAttachment(); - if (attachment instanceof spine.RegionAttachment) { - var regionAttachment = attachment; - var vertices = this.vertices; - regionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2); - shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]); - shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]); - shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]); - shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]); - } - } - } - if (this.drawMeshHull || this.drawMeshTriangles) { - var slots = skeleton.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var attachment = slot.getAttachment(); - if (!(attachment instanceof spine.MeshAttachment)) - continue; - var mesh = attachment; - var vertices = this.vertices; - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2); - var triangles = mesh.triangles; - var hullLength = mesh.hullLength; - if (this.drawMeshTriangles) { - shapes.setColor(this.triangleLineColor); - for (var ii = 0, nn = triangles.length; ii < nn; ii += 3) { - var v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2; - shapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]); - } - } - if (this.drawMeshHull && hullLength > 0) { - shapes.setColor(this.attachmentLineColor); - hullLength = (hullLength >> 1) * 2; - var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1]; - for (var ii = 0, nn = hullLength; ii < nn; ii += 2) { - var x = vertices[ii], y = vertices[ii + 1]; - shapes.line(x, y, lastX, lastY); - lastX = x; - lastY = y; - } - } - } - } - if (this.drawBoundingBoxes) { - var bounds = this.bounds; - bounds.update(skeleton, true); - shapes.setColor(this.aabbColor); - shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight()); - var polygons = bounds.polygons; - var boxes = bounds.boundingBoxes; - for (var i = 0, n = polygons.length; i < n; i++) { - var polygon = polygons[i]; - shapes.setColor(boxes[i].color); - shapes.polygon(polygon, 0, polygon.length); - } - } - if (this.drawPaths) { - var slots = skeleton.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var attachment = slot.getAttachment(); - if (!(attachment instanceof spine.PathAttachment)) - continue; - var path = attachment; - var nn = path.worldVerticesLength; - var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); - path.computeWorldVertices(slot, 0, nn, world, 0, 2); - var color = this.pathColor; - var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0; - if (path.closed) { - shapes.setColor(color); - var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1]; - x2 = world[nn - 4]; - y2 = world[nn - 3]; - shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); - shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); - shapes.line(x1, y1, cx1, cy1); - shapes.line(x2, y2, cx2, cy2); - } - nn -= 4; - for (var ii = 4; ii < nn; ii += 6) { - var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3]; - x2 = world[ii + 4]; - y2 = world[ii + 5]; - shapes.setColor(color); - shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); - shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); - shapes.line(x1, y1, cx1, cy1); - shapes.line(x2, y2, cx2, cy2); - x1 = x2; - y1 = y2; - } - } - } - if (this.drawBones) { - shapes.setColor(this.boneOriginColor); - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) - continue; - shapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8); - } - } - if (this.drawClipping) { - var slots = skeleton.slots; - shapes.setColor(this.clipColor); - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var attachment = slot.getAttachment(); - if (!(attachment instanceof spine.ClippingAttachment)) - continue; - var clip = attachment; - var nn = clip.worldVerticesLength; - var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); - clip.computeWorldVertices(slot, 0, nn, world, 0, 2); - for (var i_20 = 0, n_2 = world.length; i_20 < n_2; i_20 += 2) { - var x = world[i_20]; - var y = world[i_20 + 1]; - var x2 = world[(i_20 + 2) % world.length]; - var y2 = world[(i_20 + 3) % world.length]; - shapes.line(x, y, x2, y2); - } - } - } - }; - SkeletonDebugRenderer.prototype.dispose = function () { - }; - SkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1); - SkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1); - return SkeletonDebugRenderer; - }()); - webgl.SkeletonDebugRenderer = SkeletonDebugRenderer; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var Renderable = (function () { - function Renderable(vertices, numVertices, numFloats) { - this.vertices = vertices; - this.numVertices = numVertices; - this.numFloats = numFloats; - } - return Renderable; - }()); - ; - var SkeletonRenderer = (function () { - function SkeletonRenderer(context, twoColorTint) { - if (twoColorTint === void 0) { twoColorTint = true; } - this.premultipliedAlpha = false; - this.vertexEffect = null; - this.tempColor = new spine.Color(); - this.tempColor2 = new spine.Color(); - this.vertexSize = 2 + 2 + 4; - this.twoColorTint = false; - this.renderable = new Renderable(null, 0, 0); - this.clipper = new spine.SkeletonClipping(); - this.temp = new spine.Vector2(); - this.temp2 = new spine.Vector2(); - this.temp3 = new spine.Color(); - this.temp4 = new spine.Color(); - this.twoColorTint = twoColorTint; - if (twoColorTint) - this.vertexSize += 4; - this.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024); - } - SkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) { - if (slotRangeStart === void 0) { slotRangeStart = -1; } - if (slotRangeEnd === void 0) { slotRangeEnd = -1; } - var clipper = this.clipper; - var premultipliedAlpha = this.premultipliedAlpha; - var twoColorTint = this.twoColorTint; - var blendMode = null; - var tempPos = this.temp; - var tempUv = this.temp2; - var tempLight = this.temp3; - var tempDark = this.temp4; - var renderable = this.renderable; - var uvs = null; - var triangles = null; - var drawOrder = skeleton.drawOrder; - var attachmentColor = null; - var skeletonColor = skeleton.color; - var vertexSize = twoColorTint ? 12 : 8; - var inRange = false; - if (slotRangeStart == -1) - inRange = true; - for (var i = 0, n = drawOrder.length; i < n; i++) { - var clippedVertexSize = clipper.isClipping() ? 2 : vertexSize; - var slot = drawOrder[i]; - if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) { - inRange = true; - } - if (!inRange) { - clipper.clipEndWithSlot(slot); - continue; - } - if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) { - inRange = false; - } - var attachment = slot.getAttachment(); - var texture = null; - if (attachment instanceof spine.RegionAttachment) { - var region = attachment; - renderable.vertices = this.vertices; - renderable.numVertices = 4; - renderable.numFloats = clippedVertexSize << 2; - region.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize); - triangles = SkeletonRenderer.QUAD_TRIANGLES; - uvs = region.uvs; - texture = region.region.renderObject.texture; - attachmentColor = region.color; - } - else if (attachment instanceof spine.MeshAttachment) { - var mesh = attachment; - renderable.vertices = this.vertices; - renderable.numVertices = (mesh.worldVerticesLength >> 1); - renderable.numFloats = renderable.numVertices * clippedVertexSize; - if (renderable.numFloats > renderable.vertices.length) { - renderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats); - } - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize); - triangles = mesh.triangles; - texture = mesh.region.renderObject.texture; - uvs = mesh.uvs; - attachmentColor = mesh.color; - } - else if (attachment instanceof spine.ClippingAttachment) { - var clip = (attachment); - clipper.clipStart(slot, clip); - continue; - } - else { - clipper.clipEndWithSlot(slot); - continue; - } - if (texture != null) { - var slotColor = slot.color; - var finalColor = this.tempColor; - finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r; - finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g; - finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b; - finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a; - if (premultipliedAlpha) { - finalColor.r *= finalColor.a; - finalColor.g *= finalColor.a; - finalColor.b *= finalColor.a; - } - var darkColor = this.tempColor2; - if (slot.darkColor == null) - darkColor.set(0, 0, 0, 1.0); - else { - if (premultipliedAlpha) { - darkColor.r = slot.darkColor.r * finalColor.a; - darkColor.g = slot.darkColor.g * finalColor.a; - darkColor.b = slot.darkColor.b * finalColor.a; - } - else { - darkColor.setFromColor(slot.darkColor); - } - darkColor.a = premultipliedAlpha ? 1.0 : 0.0; - } - var slotBlendMode = slot.data.blendMode; - if (slotBlendMode != blendMode) { - blendMode = slotBlendMode; - batcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode)); - } - if (clipper.isClipping()) { - clipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint); - var clippedVertices = new Float32Array(clipper.clippedVertices); - var clippedTriangles = clipper.clippedTriangles; - if (this.vertexEffect != null) { - var vertexEffect = this.vertexEffect; - var verts = clippedVertices; - if (!twoColorTint) { - for (var v = 0, n_3 = clippedVertices.length; v < n_3; v += vertexSize) { - tempPos.x = verts[v]; - tempPos.y = verts[v + 1]; - tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); - tempUv.x = verts[v + 6]; - tempUv.y = verts[v + 7]; - tempDark.set(0, 0, 0, 0); - vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); - verts[v] = tempPos.x; - verts[v + 1] = tempPos.y; - verts[v + 2] = tempLight.r; - verts[v + 3] = tempLight.g; - verts[v + 4] = tempLight.b; - verts[v + 5] = tempLight.a; - verts[v + 6] = tempUv.x; - verts[v + 7] = tempUv.y; - } - } - else { - for (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) { - tempPos.x = verts[v]; - tempPos.y = verts[v + 1]; - tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); - tempUv.x = verts[v + 6]; - tempUv.y = verts[v + 7]; - tempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]); - vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); - verts[v] = tempPos.x; - verts[v + 1] = tempPos.y; - verts[v + 2] = tempLight.r; - verts[v + 3] = tempLight.g; - verts[v + 4] = tempLight.b; - verts[v + 5] = tempLight.a; - verts[v + 6] = tempUv.x; - verts[v + 7] = tempUv.y; - verts[v + 8] = tempDark.r; - verts[v + 9] = tempDark.g; - verts[v + 10] = tempDark.b; - verts[v + 11] = tempDark.a; - } - } - } - batcher.draw(texture, clippedVertices, clippedTriangles); - } - else { - var verts = renderable.vertices; - if (this.vertexEffect != null) { - var vertexEffect = this.vertexEffect; - if (!twoColorTint) { - for (var v = 0, u = 0, n_5 = renderable.numFloats; v < n_5; v += vertexSize, u += 2) { - tempPos.x = verts[v]; - tempPos.y = verts[v + 1]; - tempUv.x = uvs[u]; - tempUv.y = uvs[u + 1]; - tempLight.setFromColor(finalColor); - tempDark.set(0, 0, 0, 0); - vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); - verts[v] = tempPos.x; - verts[v + 1] = tempPos.y; - verts[v + 2] = tempLight.r; - verts[v + 3] = tempLight.g; - verts[v + 4] = tempLight.b; - verts[v + 5] = tempLight.a; - verts[v + 6] = tempUv.x; - verts[v + 7] = tempUv.y; - } - } - else { - for (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) { - tempPos.x = verts[v]; - tempPos.y = verts[v + 1]; - tempUv.x = uvs[u]; - tempUv.y = uvs[u + 1]; - tempLight.setFromColor(finalColor); - tempDark.setFromColor(darkColor); - vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); - verts[v] = tempPos.x; - verts[v + 1] = tempPos.y; - verts[v + 2] = tempLight.r; - verts[v + 3] = tempLight.g; - verts[v + 4] = tempLight.b; - verts[v + 5] = tempLight.a; - verts[v + 6] = tempUv.x; - verts[v + 7] = tempUv.y; - verts[v + 8] = tempDark.r; - verts[v + 9] = tempDark.g; - verts[v + 10] = tempDark.b; - verts[v + 11] = tempDark.a; - } - } - } - else { - if (!twoColorTint) { - for (var v = 2, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) { - verts[v] = finalColor.r; - verts[v + 1] = finalColor.g; - verts[v + 2] = finalColor.b; - verts[v + 3] = finalColor.a; - verts[v + 4] = uvs[u]; - verts[v + 5] = uvs[u + 1]; - } - } - else { - for (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) { - verts[v] = finalColor.r; - verts[v + 1] = finalColor.g; - verts[v + 2] = finalColor.b; - verts[v + 3] = finalColor.a; - verts[v + 4] = uvs[u]; - verts[v + 5] = uvs[u + 1]; - verts[v + 6] = darkColor.r; - verts[v + 7] = darkColor.g; - verts[v + 8] = darkColor.b; - verts[v + 9] = darkColor.a; - } - } - } - var view = renderable.vertices.subarray(0, renderable.numFloats); - batcher.draw(texture, view, triangles); - } - } - clipper.clipEndWithSlot(slot); - } - clipper.clipEnd(); - }; - SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; - return SkeletonRenderer; - }()); - webgl.SkeletonRenderer = SkeletonRenderer; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var Vector3 = (function () { - function Vector3(x, y, z) { - if (x === void 0) { x = 0; } - if (y === void 0) { y = 0; } - if (z === void 0) { z = 0; } - this.x = 0; - this.y = 0; - this.z = 0; - this.x = x; - this.y = y; - this.z = z; - } - Vector3.prototype.setFrom = function (v) { - this.x = v.x; - this.y = v.y; - this.z = v.z; - return this; - }; - Vector3.prototype.set = function (x, y, z) { - this.x = x; - this.y = y; - this.z = z; - return this; - }; - Vector3.prototype.add = function (v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - return this; - }; - Vector3.prototype.sub = function (v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - return this; - }; - Vector3.prototype.scale = function (s) { - this.x *= s; - this.y *= s; - this.z *= s; - return this; - }; - Vector3.prototype.normalize = function () { - var len = this.length(); - if (len == 0) - return this; - len = 1 / len; - this.x *= len; - this.y *= len; - this.z *= len; - return this; - }; - Vector3.prototype.cross = function (v) { - return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x); - }; - Vector3.prototype.multiply = function (matrix) { - var l_mat = matrix.values; - return this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]); - }; - Vector3.prototype.project = function (matrix) { - var l_mat = matrix.values; - var l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]); - return this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w); - }; - Vector3.prototype.dot = function (v) { - return this.x * v.x + this.y * v.y + this.z * v.z; - }; - Vector3.prototype.length = function () { - return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); - }; - Vector3.prototype.distance = function (v) { - var a = v.x - this.x; - var b = v.y - this.y; - var c = v.z - this.z; - return Math.sqrt(a * a + b * b + c * c); - }; - return Vector3; - }()); - webgl.Vector3 = Vector3; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var ManagedWebGLRenderingContext = (function () { - function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) { - if (contextConfig === void 0) { contextConfig = { alpha: "true" }; } - var _this = this; - this.restorables = new Array(); - if (canvasOrContext instanceof HTMLCanvasElement) { - var canvas_1 = canvasOrContext; - this.gl = (canvas_1.getContext("webgl", contextConfig) || canvas_1.getContext("experimental-webgl", contextConfig)); - this.canvas = canvas_1; - canvas_1.addEventListener("webglcontextlost", function (e) { - var event = e; - if (e) { - e.preventDefault(); - } - }); - canvas_1.addEventListener("webglcontextrestored", function (e) { - for (var i = 0, n = _this.restorables.length; i < n; i++) { - _this.restorables[i].restore(); - } - }); - } - else { - this.gl = canvasOrContext; - this.canvas = this.gl.canvas; - } - } - ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) { - this.restorables.push(restorable); - }; - ManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) { - var index = this.restorables.indexOf(restorable); - if (index > -1) - this.restorables.splice(index, 1); - }; - return ManagedWebGLRenderingContext; - }()); - webgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext; - var WebGLBlendModeConverter = (function () { - function WebGLBlendModeConverter() { - } - WebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) { - switch (blendMode) { - case spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; - case spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE; - case spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; - case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; - default: throw new Error("Unknown blend mode: " + blendMode); - } - }; - WebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) { - if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } - switch (blendMode) { - case spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; - case spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; - case spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR; - case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE; - default: throw new Error("Unknown blend mode: " + blendMode); - } - }; - WebGLBlendModeConverter.ZERO = 0; - WebGLBlendModeConverter.ONE = 1; - WebGLBlendModeConverter.SRC_COLOR = 0x0300; - WebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301; - WebGLBlendModeConverter.SRC_ALPHA = 0x0302; - WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303; - WebGLBlendModeConverter.DST_ALPHA = 0x0304; - WebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305; - WebGLBlendModeConverter.DST_COLOR = 0x0306; - return WebGLBlendModeConverter; - }()); - webgl.WebGLBlendModeConverter = WebGLBlendModeConverter; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); +/** + * 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 {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @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, interpolationPercentage, camera, parentMatrix) +{ + var context = renderer.currentContext; + var plugin = src.plugin; + var skeleton = src.skeleton; + var skeletonRenderer = plugin.skeletonRenderer; + + var GameObjectRenderMask = 15; + + var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); + + if (!skeleton || !willRender) + { + return; + } + + var camMatrix = renderer._tempMatrix1; + var spriteMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + 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; + } + + // Add autoUpdate option + skeleton.updateWorldTransform(); + + skeletonRenderer.ctx = context; + skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug); + + context.save(); + + skeletonRenderer.draw(skeleton); + + context.restore(); +}; + +module.exports = SpineGameObjectCanvasRenderer; -/*** EXPORTS FROM exports-loader ***/ -module.exports = spine; -}.call(window)); /***/ }) - -/******/ }); -}); -//# sourceMappingURL=SpinePlugin.js.map \ No newline at end of file +/******/ ]); \ No newline at end of file diff --git a/plugins/spine/dist/SpinePlugin.js.map b/plugins/spine/dist/SpinePlugin.js.map deleted file mode 100644 index f248a2a89..000000000 --- a/plugins/spine/dist/SpinePlugin.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///D:/wamp/www/phaser/node_modules/eventemitter3/index.js","webpack:///D:/wamp/www/phaser/src/data/DataManager.js","webpack:///D:/wamp/www/phaser/src/data/events/CHANGE_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/REMOVE_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/SET_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/index.js","webpack:///D:/wamp/www/phaser/src/gameobjects/GameObject.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Alpha.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/BlendMode.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ComputedSize.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Depth.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Flip.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ScrollFactor.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ToJSON.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Transform.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/TransformMatrix.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Visible.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/index.js","webpack:///D:/wamp/www/phaser/src/loader/File.js","webpack:///D:/wamp/www/phaser/src/loader/FileTypesManager.js","webpack:///D:/wamp/www/phaser/src/loader/GetURL.js","webpack:///D:/wamp/www/phaser/src/loader/MergeXHRSettings.js","webpack:///D:/wamp/www/phaser/src/loader/MultiFile.js","webpack:///D:/wamp/www/phaser/src/loader/XHRLoader.js","webpack:///D:/wamp/www/phaser/src/loader/XHRSettings.js","webpack:///D:/wamp/www/phaser/src/loader/const.js","webpack:///D:/wamp/www/phaser/src/loader/events/ADD_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_LOAD_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_PROGRESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/POST_PROCESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/PROGRESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/START_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/index.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/ImageFile.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/JSONFile.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/TextFile.js","webpack:///D:/wamp/www/phaser/src/math/Clamp.js","webpack:///D:/wamp/www/phaser/src/math/Matrix4.js","webpack:///D:/wamp/www/phaser/src/math/RadToDeg.js","webpack:///D:/wamp/www/phaser/src/math/Vector2.js","webpack:///D:/wamp/www/phaser/src/math/Wrap.js","webpack:///D:/wamp/www/phaser/src/math/angle/CounterClockwise.js","webpack:///D:/wamp/www/phaser/src/math/angle/Wrap.js","webpack:///D:/wamp/www/phaser/src/math/angle/WrapDegrees.js","webpack:///D:/wamp/www/phaser/src/math/const.js","webpack:///D:/wamp/www/phaser/src/plugins/BasePlugin.js","webpack:///D:/wamp/www/phaser/src/plugins/ScenePlugin.js","webpack:///D:/wamp/www/phaser/src/renderer/BlendModes.js","webpack:///D:/wamp/www/phaser/src/renderer/canvas/utils/SetTransform.js","webpack:///D:/wamp/www/phaser/src/scene/events/BOOT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/CREATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/PAUSE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/POST_UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/PRE_UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/READY_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/RENDER_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/RESUME_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/SHUTDOWN_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/SLEEP_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/START_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_INIT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_OUT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_START_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/WAKE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/index.js","webpack:///D:/wamp/www/phaser/src/utils/Class.js","webpack:///D:/wamp/www/phaser/src/utils/NOOP.js","webpack:///D:/wamp/www/phaser/src/utils/object/Extend.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetFastValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/IsPlainObject.js","webpack:///./SpineFile.js","webpack:///./SpinePlugin.js","webpack:///./gameobject/SpineGameObject.js","webpack:///./gameobject/SpineGameObjectCanvasRenderer.js","webpack:///./gameobject/SpineGameObjectRender.js","webpack:///./gameobject/SpineGameObjectWebGLRenderer.js","webpack:///./runtimes/spine-both.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yDAAyD,OAAO;AAChE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yCAAyC,SAAS;AAClD;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA,eAAe,YAAY;AAC3B;;AAEA;AACA,2DAA2D;AAC3D,+DAA+D;AAC/D,mEAAmE;AACnE,uEAAuE;AACvE;AACA,0DAA0D,SAAS;AACnE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,2DAA2D,YAAY;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI,IAA6B;AACjC;AACA;;;;;;;;;;;;AC/UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,aAAa,mBAAO,CAAC,mDAAU;;AAE/B;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,KAAK;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2DAA2D;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa;;AAEb;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,EAAE;AACjB,eAAe,KAAK;AACpB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,QAAQ;AACvB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA,sCAAsC,kBAAkB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1nBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,qBAAqB,mBAAO,CAAC,kFAAyB;AACtD,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,cAAc,mBAAO,CAAC,oEAAkB;;AAExC;;;;;;;;;;;;ACjBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,uBAAuB,mBAAO,CAAC,0EAAqB;AACpD,kBAAkB,mBAAO,CAAC,6DAAqB;AAC/C,mBAAmB,mBAAO,CAAC,mEAAe;AAC1C,aAAa,mBAAO,CAAC,0DAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2DAA2D;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,mCAAmC;AAClD,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wCAAwC;AACxD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,sCAAsC,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1nBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,oDAAkB;;AAEtC;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;AChSA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sEAA2B;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACnHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9IA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACtFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC7JA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpGA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA,YAAY,wCAAwC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,oDAAkB;AAC3C,sBAAsB,mBAAO,CAAC,iFAAmB;AACjD,gBAAgB,mBAAO,CAAC,8DAAuB;AAC/C,uBAAuB,mBAAO,CAAC,4EAA8B;;AAE7D;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,kCAAkC,oCAAoC;AACtE,mCAAmC,sCAAsC;;AAEzE;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;;AAE3E;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;AAC3E,yCAAyC,sCAAsC;;AAE/E;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC3gBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,cAAc,mBAAO,CAAC,wDAAoB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;;AAEvC;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,+CAA+C;AAC9D;AACA,gBAAgB,+CAA+C;AAC/D;AACA;AACA;AACA,kCAAkC,UAAU,cAAc;;AAE1D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,mCAAmC,wBAAwB;;AAE3D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACx5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AClFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA,kBAAkB,UAAU,mBAAO,CAAC,yEAAiB;;;;;;;;;;;;ACVrD;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,YAAY,mBAAO,CAAC,6CAAS;AAC7B,aAAa,mBAAO,CAAC,qDAAU;AAC/B,mBAAmB,mBAAO,CAAC,+EAA8B;AACzD,aAAa,mBAAO,CAAC,+CAAU;AAC/B,uBAAuB,mBAAO,CAAC,mEAAoB;AACnD,gBAAgB,mBAAO,CAAC,qDAAa;AACrC,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,+BAA+B;AAC1C;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA,4GAA4G;AAC5G;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,2DAA2D;;AAE3D;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kBAAkB;;AAEnD;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iEAAiE;AACjE;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACthBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AClCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,mEAAwB;AAC7C,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,sCAAsC;AACjD;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,mEAAmE;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC3LA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,mEAAoB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,sCAAsC;AACjD;AACA,YAAY,eAAe;AAC3B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC7DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,qCAAqC,mBAAmB;AACxD,8BAA8B,cAAc;AAC5C,6BAA6B,WAAW;AACxC,iCAAiC,eAAe;AAChD,gCAAgC,aAAa;;AAE7C;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACjJA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,2BAA2B;AACtC,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,uDAAuD;AACjJ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,oFAAoF,mDAAmD;AACvI;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB;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AW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD,WAAW,+CAA+C;AAC1D;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uGAAuG;AAClH,WAAW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC3QA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,eAAe,mBAAO,CAAC,0EAA6B;AACpD,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,QAAQ;AACR,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC/NA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;ACxKA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;;AAEA;;;;;;;;;;;;AC/6CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO;;AAEzC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,6BAA6B,YAAY;;AAEzC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;;;;;;;;;;;ACxnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,4CAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,0CAAS;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,WAAW,mBAAO,CAAC,0CAAS;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACjEA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC9KA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,iBAAiB,mBAAO,CAAC,wDAAc;AACvC,YAAY,mBAAO,CAAC,mDAAgB;AACpC,kBAAkB,mBAAO,CAAC,2DAAiB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AClFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,yBAAyB;AACpC,WAAW,8BAA8B;AACzC,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9EA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4EAA4E;AACvF;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,6CAA6C;AACpF;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;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,YAAY,mBAAO,CAAC,iEAAgB;AACpC,UAAU,mBAAO,CAAC,6DAAc;;AAEhC;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvPA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,oBAAoB,mBAAO,CAAC,mEAAiB;;AAE7C,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,YAAY,OAAO;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5FA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,8CAA8C,aAAa,qBAAqB;AAChF;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE,oBAAoB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;;AAEA;;;;;;;;;;;;ACjDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,6DAA0B;AAC9C,mBAAmB,mBAAO,CAAC,yFAAwC;AACnE,gBAAgB,mBAAO,CAAC,8FAA4C;AACpE,oBAAoB,mBAAO,CAAC,2FAAyC;AACrE,eAAe,mBAAO,CAAC,4FAA2C;AAClE,gBAAgB,mBAAO,CAAC,0EAAkC;AAC1D,eAAe,mBAAO,CAAC,4FAA2C;;AAElE;AACA,aAAa,OAAO;AACpB;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,kBAAkB;AAChC,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,kBAAkB;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,kBAAkB;AAC7B,WAAW,kBAAkB;AAC7B;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+BAA+B,oBAAoB;AACnD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B,qBAAqB;AACpD;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,2BAA2B,uBAAuB;AAClD;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2FAA2F;AACtG,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,kBAAkB;AAC7B,WA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AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,iBAAiB;AAChC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC9WA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,gEAA6B;AACjD,sBAAsB,mBAAO,CAAC,kGAA8C;AAC5E,0BAA0B,mBAAO,CAAC,0GAAkD;AACpF,6BAA6B,mBAAO,CAAC,gHAAqD;AAC1F,sBAAsB,mBAAO,CAAC,kGAA8C;AAC5E,qBAAqB,mBAAO,CAAC,gGAA6C;AAC1E,6BAA6B,mBAAO,CAAC,gHAAqD;AAC1F,0BAA0B,mBAAO,CAAC,0GAAkD;AACpF,wBAAwB,mBAAO,CAAC,sGAAgD;AAChF,iBAAiB,mBAAO,CAAC,sFAAwC;AACjE,4BAA4B,mBAAO,CAAC,sEAAyB;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,oCAAoC;AAC/D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;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AAO,CAAC,oEAA+B;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,mCAAmC;AAC9C,WAAW,OAAO;AAClB,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzJA;AACA;;AAEA;AACA;AACA,IAAI,gBAAgB,sCAAsC,iBAAiB,EAAE;AAC7E,mBAAmB,uDAAuD;AAC1E;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA,yBAAyB,UAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,WAAW;AAC1D;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,mDAAmD;AACrD;AACA;AACA;AACA;AACA,EAAE,+DAA+D;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,+DAA+D;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,OAAO;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,6CAA6C;AACtD;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,yBAAyB,EAAE;AAChF;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,sDAAsD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF;AACjF;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,+CAA+C,0BAA0B;AACzE;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,sDAAsD;AACxD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,kEAAkE;AACpE,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,eAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA,qCAAqC,iBAAiB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE,+DAA+D;AACjE;AACA;AACA;AACA;AACA;AACA,EAAE,4DAA4D;AAC9D;AACA;AACA;AACA;AACA;AACA,EAAE,yDAAyD;AAC3D,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,+BAA+B;AACjD;AACA;AACA;AACA;AACA,kBAAkB,sCAAsC;AACxD;AACA;AACA;AACA;AACA,kBAAkB,iCAAiC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA,kBAAkB,eAAe;AACjC;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,OAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,OAAO;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,sBAAsB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,OAAO;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2BAA2B;AAC9C;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,OAAO;AAClE;AACA;AACA;AACA,yBAAyB,kBAAkB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,kEAAkE;AACpE;AACA;AACA;AACA;AACA;AACA,EAAE,4DAA4D;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;AACtE,4DAA4D;AAC5D,+CAA+C;AAC/C;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,gBAAgB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,2CAA2C,+BAA+B;AAC1E;AACA;AACA;AACA;AACA,0BAA0B,WAAW;AACrC;AACA;AACA;AACA;AACA;AACA,yBAAyB,UAAU;AACnC;AACA;AACA;AACA;AACA;AACA,0BAA0B,WAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,WAAW;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,WAAW;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,WAAW;AACjD;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,WAAW;AAChE;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,qEAAqE;AACvE,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iBAAiB;AACjD,+CAA+C,8CAA8C,EAAE;AAC/F;AACA;AACA,GAAG;AACH;AACA,EAAE,6CAA6C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE,+DAA+D;AAC/D,kDAAkD;AAClD;AACA,GAAG;AACH;AACA,EAAE,6CAA6C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,6CAA6C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iBAAiB;AACjD;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,UAAU;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,yBAAyB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,yBAAyB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,yBAAyB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,yBAAyB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD,mDAAmD;AACnD;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,wBAAwB;AACvE,6CAA6C,sDAAsD;AACnG,6CAA6C,qDAAqD;AAClG;AACA;AACA;AACA;AACA,6CAA6C,sBAAsB;AACnE,4CAA4C,4BAA4B;AACxE,4CAA4C,2BAA2B;AACvE;AACA;AACA;AACA;AACA,4CAA4C,qBAAqB;AACjE;AACA;AACA;AACA,mBAAmB,4BAA4B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,4BAA4B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,4BAA4B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,0BAA0B,UAAU;AACpC;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG,oFAAoF;AACvF,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD,iCAAiC,qBAAqB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,oBAAoB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,uBAAuB;AAC/E;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,4BAA4B;AACpE,oCAAoC,qBAAqB;AACzD,kCAAkC,mBAAmB;AACrD;AACA;AACA;AACA;AACA;AACA,wCAAwC,4BAA4B;AACpE,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,wCAAwC,4BAA4B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,wCAAwC,4BAA4B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,yDAAyD;AAC5D,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE,mDAAmD,0BAA0B;AAC7E,qDAAqD,4BAA4B;AACjF,yDAAyD,sBAAsB;AAC/E,qDAAqD,sBAAsB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,8CAA8C,kDAAkD,iDAAiD,+BAA+B,mCAAmC,0BAA0B,2CAA2C,mDAAmD,8EAA8E,WAAW;AACne,qGAAqG,2FAA2F,mCAAmC,sCAAsC,0BAA0B,uEAAuE,WAAW;AACrX;AACA;AACA;AACA,+DAA+D,8CAA8C,+CAA+C,kDAAkD,iDAAiD,+BAA+B,8BAA8B,mCAAmC,0BAA0B,2CAA2C,2CAA2C,mDAAmD,8EAA8E,WAAW;AAC3lB,qGAAqG,2FAA2F,mCAAmC,mCAAmC,sCAAsC,0BAA0B,8DAA8D,oDAAoD,8HAA8H,WAAW;AACjkB;AACA;AACA;AACA,+DAA+D,8CAA8C,iDAAiD,+BAA+B,0BAA0B,2CAA2C,8EAA8E,WAAW;AAC3V,qGAAqG,2FAA2F,0BAA0B,mCAAmC,WAAW;AACxQ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,qBAAqB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,sDAAsD;AACzD,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,YAAY;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,qBAAqB;AACzD,kCAAkC,mBAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,SAAS;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,SAAS;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B,uBAAuB,OAAO;AAC9B,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,kBAAkB,iBAAiB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,4BAA4B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;;;AAGvB;AACA;AACA,CAAC,e","file":"SpinePlugin.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"SpinePlugin\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SpinePlugin\"] = factory();\n\telse\n\t\troot[\"SpinePlugin\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./SpinePlugin.js\");\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar Events = require('./events');\r\n\r\n/**\r\n * @callback DataEachCallback\r\n *\r\n * @param {*} parent - The parent object of the DataManager.\r\n * @param {string} key - The key of the value.\r\n * @param {*} value - The value.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin.\r\n * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter,\r\n * or have a property called `events` that is an instance of it.\r\n *\r\n * @class DataManager\r\n * @memberof Phaser.Data\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {object} parent - The object that this DataManager belongs to.\r\n * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter.\r\n */\r\nvar DataManager = new Class({\r\n\r\n initialize:\r\n\r\n function DataManager (parent, eventEmitter)\r\n {\r\n /**\r\n * The object that this DataManager belongs to.\r\n *\r\n * @name Phaser.Data.DataManager#parent\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.parent = parent;\r\n\r\n /**\r\n * The DataManager's event emitter.\r\n *\r\n * @name Phaser.Data.DataManager#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events = eventEmitter;\r\n\r\n if (!eventEmitter)\r\n {\r\n this.events = (parent.events) ? parent.events : parent;\r\n }\r\n\r\n /**\r\n * The data list.\r\n *\r\n * @name Phaser.Data.DataManager#list\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.0.0\r\n */\r\n this.list = {};\r\n\r\n /**\r\n * The public values list. You can use this to access anything you have stored\r\n * in this Data Manager. For example, if you set a value called `gold` you can\r\n * access it via:\r\n *\r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also modify it directly:\r\n * \r\n * ```javascript\r\n * this.data.values.gold += 1000;\r\n * ```\r\n *\r\n * Doing so will emit a `setdata` event from the parent of this Data Manager.\r\n * \r\n * Do not modify this object directly. Adding properties directly to this object will not\r\n * emit any events. Always use `DataManager.set` to create new items the first time around.\r\n *\r\n * @name Phaser.Data.DataManager#values\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.10.0\r\n */\r\n this.values = {};\r\n\r\n /**\r\n * Whether setting data is frozen for this DataManager.\r\n *\r\n * @name Phaser.Data.DataManager#_frozen\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._frozen = false;\r\n\r\n if (!parent.hasOwnProperty('sys') && this.events)\r\n {\r\n this.events.once('destroy', this.destroy, this);\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves the value for the given key, or undefined if it doesn't exist.\r\n *\r\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\r\n * \r\n * ```javascript\r\n * this.data.get('gold');\r\n * ```\r\n *\r\n * Or access the value directly:\r\n * \r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also pass in an array of keys, in which case an array of values will be returned:\r\n * \r\n * ```javascript\r\n * this.data.get([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * This approach is useful for destructuring arrays in ES6.\r\n *\r\n * @method Phaser.Data.DataManager#get\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\r\n *\r\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\r\n */\r\n get: function (key)\r\n {\r\n var list = this.list;\r\n\r\n if (Array.isArray(key))\r\n {\r\n var output = [];\r\n\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n output.push(list[key[i]]);\r\n }\r\n\r\n return output;\r\n }\r\n else\r\n {\r\n return list[key];\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves all data values in a new object.\r\n *\r\n * @method Phaser.Data.DataManager#getAll\r\n * @since 3.0.0\r\n *\r\n * @return {Object.} All data values.\r\n */\r\n getAll: function ()\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Queries the DataManager for the values of keys matching the given regular expression.\r\n *\r\n * @method Phaser.Data.DataManager#query\r\n * @since 3.0.0\r\n *\r\n * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj).\r\n *\r\n * @return {Object.} The values of the keys matching the search string.\r\n */\r\n query: function (search)\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key) && key.match(search))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created.\r\n * \r\n * ```javascript\r\n * data.set('name', 'Red Gem Stone');\r\n * ```\r\n *\r\n * You can also pass in an object of key value pairs as the first argument:\r\n *\r\n * ```javascript\r\n * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\r\n * ```\r\n *\r\n * To get a value back again you can call `get`:\r\n * \r\n * ```javascript\r\n * data.get('gold');\r\n * ```\r\n * \r\n * Or you can access the value directly via the `values` property, where it works like any other variable:\r\n * \r\n * ```javascript\r\n * data.values.gold += 50;\r\n * ```\r\n *\r\n * When the value is first set, a `setdata` event is emitted.\r\n *\r\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\r\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\r\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\r\n *\r\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#set\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n set: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (typeof key === 'string')\r\n {\r\n return this.setValue(key, data);\r\n }\r\n else\r\n {\r\n for (var entry in key)\r\n {\r\n this.setValue(entry, key[entry]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value setter, called automatically by the `set` method.\r\n *\r\n * @method Phaser.Data.DataManager#setValue\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @private\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n * @param {*} data - The value to set.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n setValue: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (this.has(key))\r\n {\r\n // Hit the key getter, which will in turn emit the events.\r\n this.values[key] = data;\r\n }\r\n else\r\n {\r\n var _this = this;\r\n var list = this.list;\r\n var events = this.events;\r\n var parent = this.parent;\r\n\r\n Object.defineProperty(this.values, key, {\r\n\r\n enumerable: true,\r\n \r\n configurable: true,\r\n\r\n get: function ()\r\n {\r\n return list[key];\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (!_this._frozen)\r\n {\r\n var previousValue = list[key];\r\n list[key] = value;\r\n\r\n events.emit(Events.CHANGE_DATA, parent, key, value, previousValue);\r\n events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue);\r\n }\r\n }\r\n\r\n });\r\n\r\n list[key] = data;\r\n\r\n events.emit(Events.SET_DATA, parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes all data entries to the given callback.\r\n *\r\n * @method Phaser.Data.DataManager#each\r\n * @since 3.0.0\r\n *\r\n * @param {DataEachCallback} callback - The function to call.\r\n * @param {*} [context] - Value to use as `this` when executing callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n each: function (callback, context)\r\n {\r\n var args = [ this.parent, null, undefined ];\r\n\r\n for (var i = 1; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (var key in this.list)\r\n {\r\n args[1] = key;\r\n args[2] = this.list[key];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Merge the given object of key value pairs into this DataManager.\r\n *\r\n * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument)\r\n * will emit a `changedata` event.\r\n *\r\n * @method Phaser.Data.DataManager#merge\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @param {Object.} data - The data to merge.\r\n * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n merge: function (data, overwrite)\r\n {\r\n if (overwrite === undefined) { overwrite = true; }\r\n\r\n // Merge data from another component into this one\r\n for (var key in data)\r\n {\r\n if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key))))\r\n {\r\n this.setValue(key, data[key]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Remove the value for the given key.\r\n *\r\n * If the key is found in this Data Manager it is removed from the internal lists and a\r\n * `removedata` event is emitted.\r\n * \r\n * You can also pass in an array of keys, in which case all keys in the array will be removed:\r\n * \r\n * ```javascript\r\n * this.data.remove([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * @method Phaser.Data.DataManager#remove\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key to remove, or an array of keys to remove.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n remove: function (key)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n this.removeValue(key[i]);\r\n }\r\n }\r\n else\r\n {\r\n return this.removeValue(key);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value remover, called automatically by the `remove` method.\r\n *\r\n * @method Phaser.Data.DataManager#removeValue\r\n * @private\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n removeValue: function (key)\r\n {\r\n if (this.has(key))\r\n {\r\n var data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it.\r\n *\r\n * @method Phaser.Data.DataManager#pop\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the value to retrieve and delete.\r\n *\r\n * @return {*} The value of the given key.\r\n */\r\n pop: function (key)\r\n {\r\n var data = undefined;\r\n\r\n if (!this._frozen && this.has(key))\r\n {\r\n data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return data;\r\n },\r\n\r\n /**\r\n * Determines whether the given key is set in this Data Manager.\r\n * \r\n * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#has\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key to check.\r\n *\r\n * @return {boolean} Returns `true` if the key exists, otherwise `false`.\r\n */\r\n has: function (key)\r\n {\r\n return this.list.hasOwnProperty(key);\r\n },\r\n\r\n /**\r\n * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts\r\n * to create new values or update existing ones.\r\n *\r\n * @method Phaser.Data.DataManager#setFreeze\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - Whether to freeze or unfreeze the Data Manager.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n setFreeze: function (value)\r\n {\r\n this._frozen = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Delete all data in this Data Manager and unfreeze it.\r\n *\r\n * @method Phaser.Data.DataManager#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n reset: function ()\r\n {\r\n for (var key in this.list)\r\n {\r\n delete this.list[key];\r\n delete this.values[key];\r\n }\r\n\r\n this._frozen = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Destroy this data manager.\r\n *\r\n * @method Phaser.Data.DataManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.reset();\r\n\r\n this.events.off(Events.CHANGE_DATA);\r\n this.events.off(Events.SET_DATA);\r\n this.events.off(Events.REMOVE_DATA);\r\n\r\n this.parent = null;\r\n },\r\n\r\n /**\r\n * Gets or sets the frozen state of this Data Manager.\r\n * A frozen Data Manager will block all attempts to create new values or update existing ones.\r\n *\r\n * @name Phaser.Data.DataManager#freeze\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n freeze: {\r\n\r\n get: function ()\r\n {\r\n return this._frozen;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._frozen = (value) ? true : false;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Return the total number of entries in this Data Manager.\r\n *\r\n * @name Phaser.Data.DataManager#count\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n count: {\r\n\r\n get: function ()\r\n {\r\n var i = 0;\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list[key] !== undefined)\r\n {\r\n i++;\r\n }\r\n }\r\n\r\n return i;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = DataManager;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`.\r\n * \r\n * This event is dispatched for all items that change in the Data Manager.\r\n * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} value - The new value of the item in the Data Manager.\r\n * @param {any} previousValue - The previous value of the item in the Data Manager.\r\n */\r\nmodule.exports = 'changedata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Key Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`,\r\n * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold`\r\n * then you can listen for `sprite.data.on('changedata-gold')`.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.16.1\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'changedata-';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Remove Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item is removed from it.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'removedata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Set Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when a new item is added to the data store.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#SET_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'setdata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Data.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CHANGE_DATA: require('./CHANGE_DATA_EVENT'),\r\n CHANGE_DATA_KEY: require('./CHANGE_DATA_KEY_EVENT'),\r\n REMOVE_DATA: require('./REMOVE_DATA_EVENT'),\r\n SET_DATA: require('./SET_DATA_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar ComponentsToJSON = require('./components/ToJSON');\r\nvar DataManager = require('../data/DataManager');\r\nvar EventEmitter = require('eventemitter3');\r\nvar Events = require('./events');\r\n\r\n/**\r\n * @classdesc\r\n * The base class that all Game Objects extend.\r\n * You don't create GameObjects directly and they cannot be added to the display list.\r\n * Instead, use them as the base for your own custom classes.\r\n *\r\n * @class GameObject\r\n * @memberof Phaser.GameObjects\r\n * @extends Phaser.Events.EventEmitter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs.\r\n * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`.\r\n */\r\nvar GameObject = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function GameObject (scene, type)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The Scene to which this Game Object belongs.\r\n * Game Objects can only belong to one Scene.\r\n *\r\n * @name Phaser.GameObjects.GameObject#scene\r\n * @type {Phaser.Scene}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A textual representation of this Game Object, i.e. `sprite`.\r\n * Used internally by Phaser but is available for your own custom classes to populate.\r\n *\r\n * @name Phaser.GameObjects.GameObject#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * The current state of this Game Object.\r\n * \r\n * Phaser itself will never modify this value, although plugins may do so.\r\n * \r\n * Use this property to track the state of a Game Object during its lifetime. For example, it could move from\r\n * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant\r\n * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons.\r\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\r\n *\r\n * @name Phaser.GameObjects.GameObject#state\r\n * @type {(integer|string)}\r\n * @since 3.16.0\r\n */\r\n this.state = 0;\r\n\r\n /**\r\n * The parent Container of this Game Object, if it has one.\r\n *\r\n * @name Phaser.GameObjects.GameObject#parentContainer\r\n * @type {Phaser.GameObjects.Container}\r\n * @since 3.4.0\r\n */\r\n this.parentContainer = null;\r\n\r\n /**\r\n * The name of this Game Object.\r\n * Empty by default and never populated by Phaser, this is left for developers to use.\r\n *\r\n * @name Phaser.GameObjects.GameObject#name\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.name = '';\r\n\r\n /**\r\n * The active state of this Game Object.\r\n * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it.\r\n * An active object is one which is having its logic and internal systems updated.\r\n *\r\n * @name Phaser.GameObjects.GameObject#active\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.active = true;\r\n\r\n /**\r\n * The Tab Index of the Game Object.\r\n * Reserved for future use by plugins and the Input Manager.\r\n *\r\n * @name Phaser.GameObjects.GameObject#tabIndex\r\n * @type {integer}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.tabIndex = -1;\r\n\r\n /**\r\n * A Data Manager.\r\n * It allows you to store, query and get key/value paired information specific to this Game Object.\r\n * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`.\r\n *\r\n * @name Phaser.GameObjects.GameObject#data\r\n * @type {Phaser.Data.DataManager}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.data = null;\r\n\r\n /**\r\n * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not.\r\n * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively.\r\n * If those components are not used by your custom class then you can use this bitmask as you wish.\r\n *\r\n * @name Phaser.GameObjects.GameObject#renderFlags\r\n * @type {integer}\r\n * @default 15\r\n * @since 3.0.0\r\n */\r\n this.renderFlags = 15;\r\n\r\n /**\r\n * A bitmask that controls if this Game Object is drawn by a Camera or not.\r\n * Not usually set directly, instead call `Camera.ignore`, however you can\r\n * set this property directly using the Camera.id property:\r\n *\r\n * @example\r\n * this.cameraFilter |= camera.id\r\n *\r\n * @name Phaser.GameObjects.GameObject#cameraFilter\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.cameraFilter = 0;\r\n\r\n /**\r\n * If this Game Object is enabled for input then this property will contain an InteractiveObject instance.\r\n * Not usually set directly. Instead call `GameObject.setInteractive()`.\r\n *\r\n * @name Phaser.GameObjects.GameObject#input\r\n * @type {?Phaser.Types.Input.InteractiveObject}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.input = null;\r\n\r\n /**\r\n * If this Game Object is enabled for physics then this property will contain a reference to a Physics Body.\r\n *\r\n * @name Phaser.GameObjects.GameObject#body\r\n * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.body = null;\r\n\r\n /**\r\n * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`.\r\n * This includes calls that may come from a Group, Container or the Scene itself.\r\n * While it allows you to persist a Game Object across Scenes, please understand you are entirely\r\n * responsible for managing references to and from this Game Object.\r\n *\r\n * @name Phaser.GameObjects.GameObject#ignoreDestroy\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.5.0\r\n */\r\n this.ignoreDestroy = false;\r\n\r\n // Tell the Scene to re-sort the children\r\n scene.sys.queueDepthSort();\r\n },\r\n\r\n /**\r\n * Sets the `active` property of this Game Object and returns this Game Object for further chaining.\r\n * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setActive\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - True if this Game Object should be set as active, false if not.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setActive: function (value)\r\n {\r\n this.active = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the `name` property of this Game Object and returns this Game Object for further chaining.\r\n * The `name` property is not populated by Phaser and is presented for your own use.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setName\r\n * @since 3.0.0\r\n *\r\n * @param {string} value - The name to be given to this Game Object.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setName: function (value)\r\n {\r\n this.name = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current state of this Game Object.\r\n * \r\n * Phaser itself will never modify the State of a Game Object, although plugins may do so.\r\n * \r\n * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'.\r\n * The state value should typically be an integer (ideally mapped to a constant\r\n * in your game code), but could also be a string. It is recommended to keep it light and simple.\r\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setState\r\n * @since 3.16.0\r\n *\r\n * @param {(integer|string)} value - The state of the Game Object.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setState: function (value)\r\n {\r\n this.state = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds a Data Manager component to this Game Object.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setDataEnabled\r\n * @since 3.0.0\r\n * @see Phaser.Data.DataManager\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setDataEnabled: function ()\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Allows you to store a key value pair within this Game Objects Data Manager.\r\n *\r\n * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled\r\n * before setting the value.\r\n *\r\n * If the key doesn't already exist in the Data Manager then it is created.\r\n *\r\n * ```javascript\r\n * sprite.setData('name', 'Red Gem Stone');\r\n * ```\r\n *\r\n * You can also pass in an object of key value pairs as the first argument:\r\n *\r\n * ```javascript\r\n * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\r\n * ```\r\n *\r\n * To get a value back again you can call `getData`:\r\n *\r\n * ```javascript\r\n * sprite.getData('gold');\r\n * ```\r\n *\r\n * Or you can access the value directly via the `values` property, where it works like any other variable:\r\n *\r\n * ```javascript\r\n * sprite.data.values.gold += 50;\r\n * ```\r\n *\r\n * When the value is first set, a `setdata` event is emitted from this Game Object.\r\n *\r\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\r\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\r\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\r\n *\r\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setData\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setData: function (key, value)\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n this.data.set(key, value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist.\r\n *\r\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\r\n *\r\n * ```javascript\r\n * sprite.getData('gold');\r\n * ```\r\n *\r\n * Or access the value directly:\r\n *\r\n * ```javascript\r\n * sprite.data.values.gold;\r\n * ```\r\n *\r\n * You can also pass in an array of keys, in which case an array of values will be returned:\r\n *\r\n * ```javascript\r\n * sprite.getData([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * This approach is useful for destructuring arrays in ES6.\r\n *\r\n * @method Phaser.GameObjects.GameObject#getData\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\r\n *\r\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\r\n */\r\n getData: function (key)\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n return this.data.get(key);\r\n },\r\n\r\n /**\r\n * Pass this Game Object to the Input Manager to enable it for Input.\r\n *\r\n * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area\r\n * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced\r\n * input detection.\r\n *\r\n * 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\r\n * 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\r\n * shape for it to use.\r\n *\r\n * You can also provide an Input Configuration Object as the only argument to this method.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setInteractive\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback.\r\n * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target?\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setInteractive: function (shape, callback, dropZone)\r\n {\r\n this.scene.sys.input.enable(this, shape, callback, dropZone);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Game Object has previously been enabled for input, this will disable it.\r\n *\r\n * An object that is disabled for input stops processing or being considered for\r\n * input events, but can be turned back on again at any time by simply calling\r\n * `setInteractive()` with no arguments provided.\r\n *\r\n * If want to completely remove interaction from this Game Object then use `removeInteractive` instead.\r\n *\r\n * @method Phaser.GameObjects.GameObject#disableInteractive\r\n * @since 3.7.0\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n disableInteractive: function ()\r\n {\r\n if (this.input)\r\n {\r\n this.input.enabled = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Game Object has previously been enabled for input, this will queue it\r\n * for removal, causing it to no longer be interactive. The removal happens on\r\n * the next game step, it is not immediate.\r\n *\r\n * The Interactive Object that was assigned to this Game Object will be destroyed,\r\n * removed from the Input Manager and cleared from this Game Object.\r\n *\r\n * If you wish to re-enable this Game Object at a later date you will need to\r\n * re-create its InteractiveObject by calling `setInteractive` again.\r\n *\r\n * If you wish to only temporarily stop an object from receiving input then use\r\n * `disableInteractive` instead, as that toggles the interactive state, where-as\r\n * this erases it completely.\r\n * \r\n * If you wish to resize a hit area, don't remove and then set it as being\r\n * interactive. Instead, access the hitarea object directly and resize the shape\r\n * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the\r\n * shape is a Rectangle, which it is by default.)\r\n *\r\n * @method Phaser.GameObjects.GameObject#removeInteractive\r\n * @since 3.7.0\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n removeInteractive: function ()\r\n {\r\n this.scene.sys.input.clear(this);\r\n\r\n this.input = undefined;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * To be overridden by custom GameObjects. Allows base objects to be used in a Pool.\r\n *\r\n * @method Phaser.GameObjects.GameObject#update\r\n * @since 3.0.0\r\n *\r\n * @param {...*} [args] - args\r\n */\r\n update: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Returns a JSON representation of the Game Object.\r\n *\r\n * @method Phaser.GameObjects.GameObject#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\n toJSON: function ()\r\n {\r\n return ComponentsToJSON(this);\r\n },\r\n\r\n /**\r\n * Compares the renderMask with the renderFlags to see if this Game Object will render or not.\r\n * Also checks the Game Object against the given Cameras exclusion list.\r\n *\r\n * @method Phaser.GameObjects.GameObject#willRender\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object.\r\n *\r\n * @return {boolean} True if the Game Object should be rendered, otherwise false.\r\n */\r\n willRender: function (camera)\r\n {\r\n return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)));\r\n },\r\n\r\n /**\r\n * Returns an array containing the display list index of either this Game Object, or if it has one,\r\n * its parent Container. It then iterates up through all of the parent containers until it hits the\r\n * root of the display list (which is index 0 in the returned array).\r\n *\r\n * Used internally by the InputPlugin but also useful if you wish to find out the display depth of\r\n * this Game Object and all of its ancestors.\r\n *\r\n * @method Phaser.GameObjects.GameObject#getIndexList\r\n * @since 3.4.0\r\n *\r\n * @return {integer[]} An array of display list position indexes.\r\n */\r\n getIndexList: function ()\r\n {\r\n // eslint-disable-next-line consistent-this\r\n var child = this;\r\n var parent = this.parentContainer;\r\n\r\n var indexes = [];\r\n\r\n while (parent)\r\n {\r\n // indexes.unshift([parent.getIndex(child), parent.name]);\r\n indexes.unshift(parent.getIndex(child));\r\n\r\n child = parent;\r\n\r\n if (!parent.parentContainer)\r\n {\r\n break;\r\n }\r\n else\r\n {\r\n parent = parent.parentContainer;\r\n }\r\n }\r\n\r\n // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']);\r\n indexes.unshift(this.scene.sys.displayList.getIndex(child));\r\n\r\n return indexes;\r\n },\r\n\r\n /**\r\n * Destroys this Game Object removing it from the Display List and Update List and\r\n * severing all ties to parent resources.\r\n *\r\n * Also removes itself from the Input Manager and Physics Manager if previously enabled.\r\n *\r\n * Use this to remove a Game Object from your game if you don't ever plan to use it again.\r\n * As long as no reference to it exists within your own code it should become free for\r\n * garbage collection by the browser.\r\n *\r\n * If you just want to temporarily disable an object then look at using the\r\n * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected.\r\n *\r\n * @method Phaser.GameObjects.GameObject#destroy\r\n * @fires Phaser.GameObjects.Events#DESTROY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [fromScene=false] - Is this Game Object being destroyed as the result of a Scene shutdown?\r\n */\r\n destroy: function (fromScene)\r\n {\r\n if (fromScene === undefined) { fromScene = false; }\r\n\r\n // This Game Object has already been destroyed\r\n if (!this.scene || this.ignoreDestroy)\r\n {\r\n return;\r\n }\r\n\r\n if (this.preDestroy)\r\n {\r\n this.preDestroy.call(this);\r\n }\r\n\r\n this.emit(Events.DESTROY, this);\r\n\r\n var sys = this.scene.sys;\r\n\r\n if (!fromScene)\r\n {\r\n sys.displayList.remove(this);\r\n sys.updateList.remove(this);\r\n }\r\n\r\n if (this.input)\r\n {\r\n sys.input.clear(this);\r\n this.input = undefined;\r\n }\r\n\r\n if (this.data)\r\n {\r\n this.data.destroy();\r\n\r\n this.data = undefined;\r\n }\r\n\r\n if (this.body)\r\n {\r\n this.body.destroy();\r\n this.body = undefined;\r\n }\r\n\r\n // Tell the Scene to re-sort the children\r\n if (!fromScene)\r\n {\r\n sys.queueDepthSort();\r\n }\r\n\r\n this.active = false;\r\n this.visible = false;\r\n\r\n this.scene = undefined;\r\n\r\n this.parentContainer = undefined;\r\n\r\n this.removeAllListeners();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not.\r\n *\r\n * @constant {integer} RENDER_MASK\r\n * @memberof Phaser.GameObjects.GameObject\r\n * @default\r\n */\r\nGameObject.RENDER_MASK = 15;\r\n\r\nmodule.exports = GameObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = require('../../math/Clamp');\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 2; // 0010\r\n\r\n/**\r\n * Provides methods used for setting the alpha properties of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Alpha\r\n * @since 3.0.0\r\n */\r\n\r\nvar Alpha = {\r\n\r\n /**\r\n * Private internal value. Holds the global alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alpha\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alpha: 1,\r\n\r\n /**\r\n * Private internal value. Holds the top-left alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaTL\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaTL: 1,\r\n\r\n /**\r\n * Private internal value. Holds the top-right alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaTR\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaTR: 1,\r\n\r\n /**\r\n * Private internal value. Holds the bottom-left alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaBL\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaBL: 1,\r\n\r\n /**\r\n * Private internal value. Holds the bottom-right alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaBR\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaBR: 1,\r\n\r\n /**\r\n * Clears all alpha values associated with this Game Object.\r\n *\r\n * Immediately sets the alpha levels back to 1 (fully opaque).\r\n *\r\n * @method Phaser.GameObjects.Components.Alpha#clearAlpha\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n clearAlpha: function ()\r\n {\r\n return this.setAlpha(1);\r\n },\r\n\r\n /**\r\n * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders.\r\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\r\n *\r\n * If your game is running under WebGL you can optionally specify four different alpha values, each of which\r\n * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used.\r\n *\r\n * @method Phaser.GameObjects.Components.Alpha#setAlpha\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {number} [topRight] - The alpha value used for the top-right of the Game Object. WebGL only.\r\n * @param {number} [bottomLeft] - The alpha value used for the bottom-left of the Game Object. WebGL only.\r\n * @param {number} [bottomRight] - The alpha value used for the bottom-right of the Game Object. WebGL only.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAlpha: function (topLeft, topRight, bottomLeft, bottomRight)\r\n {\r\n if (topLeft === undefined) { topLeft = 1; }\r\n\r\n // Treat as if there is only one alpha value for the whole Game Object\r\n if (topRight === undefined)\r\n {\r\n this.alpha = topLeft;\r\n }\r\n else\r\n {\r\n this._alphaTL = Clamp(topLeft, 0, 1);\r\n this._alphaTR = Clamp(topRight, 0, 1);\r\n this._alphaBL = Clamp(bottomLeft, 0, 1);\r\n this._alphaBR = Clamp(bottomRight, 0, 1);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The alpha value of the Game Object.\r\n *\r\n * This is a global value, impacting the entire Game Object, not just a region of it.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n alpha: {\r\n\r\n get: function ()\r\n {\r\n return this._alpha;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alpha = v;\r\n this._alphaTL = v;\r\n this._alphaTR = v;\r\n this._alphaBL = v;\r\n this._alphaBR = v;\r\n\r\n if (v === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the top-left of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaTopLeft\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaTopLeft: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaTL;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaTL = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the top-right of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaTopRight\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaTopRight: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaTR;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaTR = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the bottom-left of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaBottomLeft\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaBottomLeft: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaBL;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaBL = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the bottom-right of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaBottomRight\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaBottomRight: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaBR;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaBR = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Alpha;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlendModes = require('../../renderer/BlendModes');\r\n\r\n/**\r\n * Provides methods used for setting the blend mode of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.BlendMode\r\n * @since 3.0.0\r\n */\r\n\r\nvar BlendMode = {\r\n\r\n /**\r\n * Private internal value. Holds the current blend mode.\r\n * \r\n * @name Phaser.GameObjects.Components.BlendMode#_blendMode\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _blendMode: BlendModes.NORMAL,\r\n\r\n /**\r\n * Sets the Blend Mode being used by this Game Object.\r\n *\r\n * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay)\r\n *\r\n * Under WebGL only the following Blend Modes are available:\r\n *\r\n * * ADD\r\n * * MULTIPLY\r\n * * SCREEN\r\n * * ERASE\r\n *\r\n * Canvas has more available depending on browser support.\r\n *\r\n * You can also create your own custom Blend Modes in WebGL.\r\n *\r\n * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending\r\n * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these\r\n * reasons try to be careful about the construction of your Scene and the frequency of which blend modes\r\n * are used.\r\n *\r\n * @name Phaser.GameObjects.Components.BlendMode#blendMode\r\n * @type {(Phaser.BlendModes|string)}\r\n * @since 3.0.0\r\n */\r\n blendMode: {\r\n\r\n get: function ()\r\n {\r\n return this._blendMode;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (typeof value === 'string')\r\n {\r\n value = BlendModes[value];\r\n }\r\n\r\n value |= 0;\r\n\r\n if (value >= -1)\r\n {\r\n this._blendMode = value;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the Blend Mode being used by this Game Object.\r\n *\r\n * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay)\r\n *\r\n * Under WebGL only the following Blend Modes are available:\r\n *\r\n * * ADD\r\n * * MULTIPLY\r\n * * SCREEN\r\n * * ERASE (only works when rendering to a framebuffer, like a Render Texture)\r\n *\r\n * Canvas has more available depending on browser support.\r\n *\r\n * You can also create your own custom Blend Modes in WebGL.\r\n *\r\n * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending\r\n * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these\r\n * reasons try to be careful about the construction of your Scene and the frequency in which blend modes\r\n * are used.\r\n *\r\n * @method Phaser.GameObjects.Components.BlendMode#setBlendMode\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.BlendModes)} value - The BlendMode value. Either a string or a CONST.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setBlendMode: function (value)\r\n {\r\n this.blendMode = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = BlendMode;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for calculating and setting the size of a non-Frame based Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.ComputedSize\r\n * @since 3.0.0\r\n */\r\n\r\nvar ComputedSize = {\r\n\r\n /**\r\n * The native (un-scaled) width of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayWidth` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n width: 0,\r\n\r\n /**\r\n * The native (un-scaled) height of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayHeight` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n height: 0,\r\n\r\n /**\r\n * The displayed width of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayWidth: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleX * this.width;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleX = value / this.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The displayed height of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayHeight: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleY * this.height;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleY = value / this.height;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the internal size of this Game Object, as used for frame or physics body creation.\r\n * \r\n * This will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\r\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\r\n * to do so by giving pixel values.\r\n * \r\n * If you have enabled this Game Object for input, changing the size will _not_ change the\r\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setSize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the display size of this Game Object.\r\n * \r\n * Calling this will adjust the scale.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDisplaySize: function (width, height)\r\n {\r\n this.displayWidth = width;\r\n this.displayHeight = height;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ComputedSize;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the depth of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Depth\r\n * @since 3.0.0\r\n */\r\n\r\nvar Depth = {\r\n\r\n /**\r\n * Private internal value. Holds the depth of the Game Object.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#_depth\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _depth: 0,\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#depth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n depth: {\r\n\r\n get: function ()\r\n {\r\n return this._depth;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scene.sys.queueDepthSort();\r\n this._depth = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @method Phaser.GameObjects.Components.Depth#setDepth\r\n * @since 3.0.0\r\n *\r\n * @param {integer} value - The depth of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDepth: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.depth = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Depth;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for visually flipping a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Flip\r\n * @since 3.0.0\r\n */\r\n\r\nvar Flip = {\r\n\r\n /**\r\n * The horizontally flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipX\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipX: false,\r\n\r\n /**\r\n * The vertically flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down)\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipY\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipY: false,\r\n\r\n /**\r\n * Toggles the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipX\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipX: function ()\r\n {\r\n this.flipX = !this.flipX;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Toggles the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipY\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipY: function ()\r\n {\r\n this.flipY = !this.flipY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipX\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipX: function (value)\r\n {\r\n this.flipX = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipY: function (value)\r\n {\r\n this.flipY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal and vertical flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped will render inversed on the flipped axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlip\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlip: function (x, y)\r\n {\r\n this.flipX = x;\r\n this.flipY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#resetFlip\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n resetFlip: function ()\r\n {\r\n this.flipX = false;\r\n this.flipY = false;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Flip;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the Scroll Factor of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.ScrollFactor\r\n * @since 3.0.0\r\n */\r\n\r\nvar ScrollFactor = {\r\n\r\n /**\r\n * The horizontal scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorX: 1,\r\n\r\n /**\r\n * The vertical scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorY: 1,\r\n\r\n /**\r\n * Sets the scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scroll factor of this Game Object.\r\n * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScrollFactor: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.scrollFactorX = x;\r\n this.scrollFactorY = y;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ScrollFactor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Build a JSON representation of the given Game Object.\r\n *\r\n * This is typically extended further by Game Object specific implementations.\r\n *\r\n * @method Phaser.GameObjects.Components.ToJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON.\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\nvar ToJSON = function (gameObject)\r\n{\r\n var out = {\r\n name: gameObject.name,\r\n type: gameObject.type,\r\n x: gameObject.x,\r\n y: gameObject.y,\r\n depth: gameObject.depth,\r\n scale: {\r\n x: gameObject.scaleX,\r\n y: gameObject.scaleY\r\n },\r\n origin: {\r\n x: gameObject.originX,\r\n y: gameObject.originY\r\n },\r\n flipX: gameObject.flipX,\r\n flipY: gameObject.flipY,\r\n rotation: gameObject.rotation,\r\n alpha: gameObject.alpha,\r\n visible: gameObject.visible,\r\n scaleMode: gameObject.scaleMode,\r\n blendMode: gameObject.blendMode,\r\n textureKey: '',\r\n frameKey: '',\r\n data: {}\r\n };\r\n\r\n if (gameObject.texture)\r\n {\r\n out.textureKey = gameObject.texture.key;\r\n out.frameKey = gameObject.frame.name;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ToJSON;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = require('../../math/const');\r\nvar TransformMatrix = require('./TransformMatrix');\r\nvar WrapAngle = require('../../math/angle/Wrap');\r\nvar WrapAngleDegrees = require('../../math/angle/WrapDegrees');\r\n\r\n// global bitmask flag for GameObject.renderMask (used by Scale)\r\nvar _FLAG = 4; // 0100\r\n\r\n/**\r\n * Provides methods used for getting and setting the position, scale and rotation of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Transform\r\n * @since 3.0.0\r\n */\r\n\r\nvar Transform = {\r\n\r\n /**\r\n * Private internal value. Holds the horizontal scale value.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_scaleX\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _scaleX: 1,\r\n\r\n /**\r\n * Private internal value. Holds the vertical scale value.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_scaleY\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _scaleY: 1,\r\n\r\n /**\r\n * Private internal value. Holds the rotation value in radians.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_rotation\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _rotation: 0,\r\n\r\n /**\r\n * The x position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n x: 0,\r\n\r\n /**\r\n * The y position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n y: 0,\r\n\r\n /**\r\n * The z position of this Game Object.\r\n * Note: Do not use this value to set the z-index, instead see the `depth` property.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n z: 0,\r\n\r\n /**\r\n * The w position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n w: 0,\r\n\r\n /**\r\n * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object\r\n * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`.\r\n * \r\n * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this\r\n * isn't the case, use the `scaleX` or `scaleY` properties instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.18.0\r\n */\r\n scale: {\r\n\r\n get: function ()\r\n {\r\n return (this._scaleX + this._scaleY) / 2;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n this._scaleY = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The horizontal scale of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scaleX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scaleY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleY = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The angle of this Game Object as expressed in degrees.\r\n *\r\n * Where 0 is to the right, 90 is down, 180 is left.\r\n *\r\n * If you prefer to work in radians, see the `rotation` property instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#angle\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n angle: {\r\n\r\n get: function ()\r\n {\r\n return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG);\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in degrees\r\n this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD;\r\n }\r\n },\r\n\r\n /**\r\n * The angle of this Game Object in radians.\r\n *\r\n * If you prefer to work in degrees, see the `angle` property instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#rotation\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return this._rotation;\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in radians\r\n this._rotation = WrapAngle(value);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x position of this Game Object.\r\n * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value.\r\n * @param {number} [z=0] - The z position of this Game Object.\r\n * @param {number} [w=0] - The w position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setPosition: function (x, y, z, w)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n if (z === undefined) { z = 0; }\r\n if (w === undefined) { w = 0; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n this.w = w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the position of this Game Object to be a random position within the confines of\r\n * the given area.\r\n * \r\n * If no area is specified a random position between 0 x 0 and the game width x height is used instead.\r\n *\r\n * The position does not factor in the size of this Game Object, meaning that only the origin is\r\n * guaranteed to be within the area.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setRandomPosition\r\n * @since 3.8.0\r\n *\r\n * @param {number} [x=0] - The x position of the top-left of the random area.\r\n * @param {number} [y=0] - The y position of the top-left of the random area.\r\n * @param {number} [width] - The width of the random area.\r\n * @param {number} [height] - The height of the random area.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setRandomPosition: function (x, y, width, height)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.scene.sys.scale.width; }\r\n if (height === undefined) { height = this.scene.sys.scale.height; }\r\n\r\n this.x = x + (Math.random() * width);\r\n this.y = y + (Math.random() * height);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the rotation of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setRotation\r\n * @since 3.0.0\r\n *\r\n * @param {number} [radians=0] - The rotation of this Game Object, in radians.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setRotation: function (radians)\r\n {\r\n if (radians === undefined) { radians = 0; }\r\n\r\n this.rotation = radians;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the angle of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setAngle\r\n * @since 3.0.0\r\n *\r\n * @param {number} [degrees=0] - The rotation of this Game Object, in degrees.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAngle: function (degrees)\r\n {\r\n if (degrees === undefined) { degrees = 0; }\r\n\r\n this.angle = degrees;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scale of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale of this Game Object.\r\n * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScale: function (x, y)\r\n {\r\n if (x === undefined) { x = 1; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.scaleX = x;\r\n this.scaleY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the x position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setX\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The x position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setX: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the y position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setY\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The y position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setY: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the z position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The z position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setZ: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.z = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the w position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setW\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The w position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setW: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.w = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the local transform matrix for this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\r\n */\r\n getLocalTransformMatrix: function (tempMatrix)\r\n {\r\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\r\n\r\n return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\r\n },\r\n\r\n /**\r\n * Gets the world transform matrix for this Game Object, factoring in any parent Containers.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\r\n */\r\n getWorldTransformMatrix: function (tempMatrix, parentMatrix)\r\n {\r\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\r\n if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); }\r\n\r\n var parent = this.parentContainer;\r\n\r\n if (!parent)\r\n {\r\n return this.getLocalTransformMatrix(tempMatrix);\r\n }\r\n\r\n tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\r\n\r\n while (parent)\r\n {\r\n parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY);\r\n\r\n parentMatrix.multiply(tempMatrix, tempMatrix);\r\n\r\n parent = parent.parentContainer;\r\n }\r\n\r\n return tempMatrix;\r\n },\r\n\r\n /**\r\n * Gets the sum total rotation of all of this Game Objects parent Containers.\r\n * \r\n * The returned value is in radians and will be zero if this Game Object has no parent container.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getParentRotation\r\n * @since 3.18.0\r\n *\r\n * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object.\r\n */\r\n getParentRotation: function ()\r\n {\r\n var rotation = 0;\r\n\r\n var parent = this.parentContainer;\r\n\r\n while (parent)\r\n {\r\n rotation += parent.rotation;\r\n\r\n parent = parent.parentContainer;\r\n }\r\n\r\n return rotation;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Transform;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar Vector2 = require('../../math/Vector2');\r\n\r\n/**\r\n * @classdesc\r\n * A Matrix used for display transformations for rendering.\r\n *\r\n * It is represented like so:\r\n *\r\n * ```\r\n * | a | c | tx |\r\n * | b | d | ty |\r\n * | 0 | 0 | 1 |\r\n * ```\r\n *\r\n * @class TransformMatrix\r\n * @memberof Phaser.GameObjects.Components\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [a=1] - The Scale X value.\r\n * @param {number} [b=0] - The Shear Y value.\r\n * @param {number} [c=0] - The Shear X value.\r\n * @param {number} [d=1] - The Scale Y value.\r\n * @param {number} [tx=0] - The Translate X value.\r\n * @param {number} [ty=0] - The Translate Y value.\r\n */\r\nvar TransformMatrix = new Class({\r\n\r\n initialize:\r\n\r\n function TransformMatrix (a, b, c, d, tx, ty)\r\n {\r\n if (a === undefined) { a = 1; }\r\n if (b === undefined) { b = 0; }\r\n if (c === undefined) { c = 0; }\r\n if (d === undefined) { d = 1; }\r\n if (tx === undefined) { tx = 0; }\r\n if (ty === undefined) { ty = 0; }\r\n\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#matrix\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]);\r\n\r\n /**\r\n * The decomposed matrix.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.decomposedMatrix = {\r\n translateX: 0,\r\n translateY: 0,\r\n scaleX: 1,\r\n scaleY: 1,\r\n rotation: 0\r\n };\r\n },\r\n\r\n /**\r\n * The Scale X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#a\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n a: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[0];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[0] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Shear Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#b\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n b: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[1];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[1] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Shear X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#c\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n c: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[2];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[2] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Scale Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#d\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n d: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[3];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[3] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#e\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n e: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#f\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n f: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#tx\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n tx: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#ty\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n ty: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Matrix.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#rotation\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return Math.acos(this.a / this.scaleX) * (Math.atan(-this.c / this.a) < 0 ? -1 : 1);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The horizontal scale of the Matrix.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleX\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.a * this.a) + (this.c * this.c));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of the Matrix.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleY\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.b * this.b) + (this.d * this.d));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Reset the Matrix to an identity matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n loadIdentity: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = 1;\r\n matrix[1] = 0;\r\n matrix[2] = 0;\r\n matrix[3] = 1;\r\n matrix[4] = 0;\r\n matrix[5] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#translate\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation value.\r\n * @param {number} y - The vertical translation value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n translate: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4];\r\n matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale value.\r\n * @param {number} y - The vertical scale value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n scale: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] *= x;\r\n matrix[1] *= x;\r\n matrix[2] *= y;\r\n matrix[3] *= y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n rotate: function (angle)\r\n {\r\n var sin = Math.sin(angle);\r\n var cos = Math.cos(angle);\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n matrix[0] = a * cos + c * sin;\r\n matrix[1] = b * cos + d * sin;\r\n matrix[2] = a * -sin + c * cos;\r\n matrix[3] = b * -sin + d * cos;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n * \r\n * If an `out` Matrix is given then the results will be stored in it.\r\n * If it is not given, this matrix will be updated in place instead.\r\n * Use an `out` Matrix if you do not wish to mutate this matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} Either this TransformMatrix, or the `out` Matrix, if given in the arguments.\r\n */\r\n multiply: function (rhs, out)\r\n {\r\n var matrix = this.matrix;\r\n var source = rhs.matrix;\r\n\r\n var localA = matrix[0];\r\n var localB = matrix[1];\r\n var localC = matrix[2];\r\n var localD = matrix[3];\r\n var localE = matrix[4];\r\n var localF = matrix[5];\r\n\r\n var sourceA = source[0];\r\n var sourceB = source[1];\r\n var sourceC = source[2];\r\n var sourceD = source[3];\r\n var sourceE = source[4];\r\n var sourceF = source[5];\r\n\r\n var destinationMatrix = (out === undefined) ? this : out;\r\n\r\n destinationMatrix.a = (sourceA * localA) + (sourceB * localC);\r\n destinationMatrix.b = (sourceA * localB) + (sourceB * localD);\r\n destinationMatrix.c = (sourceC * localA) + (sourceD * localC);\r\n destinationMatrix.d = (sourceC * localB) + (sourceD * localD);\r\n destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE;\r\n destinationMatrix.f = (sourceE * localB) + (sourceF * localD) + localF;\r\n\r\n return destinationMatrix;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the matrix given, including the offset.\r\n * \r\n * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`.\r\n * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n * @param {number} offsetX - Horizontal offset to factor in to the multiplication.\r\n * @param {number} offsetY - Vertical offset to factor in to the multiplication.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n multiplyWithOffset: function (src, offsetX, offsetY)\r\n {\r\n var matrix = this.matrix;\r\n var otherMatrix = src.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n var pse = offsetX * a0 + offsetY * c0 + tx0;\r\n var psf = offsetX * b0 + offsetY * d0 + ty0;\r\n\r\n var a1 = otherMatrix[0];\r\n var b1 = otherMatrix[1];\r\n var c1 = otherMatrix[2];\r\n var d1 = otherMatrix[3];\r\n var tx1 = otherMatrix[4];\r\n var ty1 = otherMatrix[5];\r\n\r\n matrix[0] = a1 * a0 + b1 * c0;\r\n matrix[1] = a1 * b0 + b1 * d0;\r\n matrix[2] = c1 * a0 + d1 * c0;\r\n matrix[3] = c1 * b0 + d1 * d0;\r\n matrix[4] = tx1 * a0 + ty1 * c0 + pse;\r\n matrix[5] = tx1 * b0 + ty1 * d0 + psf;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n transform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n matrix[0] = a * a0 + b * c0;\r\n matrix[1] = a * b0 + b * d0;\r\n matrix[2] = c * a0 + d * c0;\r\n matrix[3] = c * b0 + d * d0;\r\n matrix[4] = tx * a0 + ty * c0 + tx0;\r\n matrix[5] = tx * b0 + ty * d0 + ty0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform a point using this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the point to transform.\r\n * @param {number} y - The y coordinate of the point to transform.\r\n * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates.\r\n *\r\n * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates.\r\n */\r\n transformPoint: function (x, y, point)\r\n {\r\n if (point === undefined) { point = { x: 0, y: 0 }; }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n point.x = x * a + y * c + tx;\r\n point.y = x * b + y * d + ty;\r\n\r\n return point;\r\n },\r\n\r\n /**\r\n * Invert the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#invert\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n invert: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var n = a * d - b * c;\r\n\r\n matrix[0] = d / n;\r\n matrix[1] = -b / n;\r\n matrix[2] = -c / n;\r\n matrix[3] = a / n;\r\n matrix[4] = (c * ty - d * tx) / n;\r\n matrix[5] = -(a * ty - b * tx) / n;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the matrix given.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFrom: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src.a;\r\n matrix[1] = src.b;\r\n matrix[2] = src.c;\r\n matrix[3] = src.d;\r\n matrix[4] = src.e;\r\n matrix[5] = src.f;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the array given.\r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray\r\n * @since 3.11.0\r\n *\r\n * @param {array} src - The array of values to set into this matrix.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFromArray: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src[0];\r\n matrix[1] = src[1];\r\n matrix[2] = src[2];\r\n matrix[3] = src[3];\r\n matrix[4] = src[4];\r\n matrix[5] = src[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.transform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n copyToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.setTransform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n setToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values in this Matrix to the array given.\r\n * \r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray\r\n * @since 3.12.0\r\n *\r\n * @param {array} [out] - The array to copy the matrix values in to.\r\n *\r\n * @return {array} An array where elements 0 to 5 contain the values from this matrix.\r\n */\r\n copyToArray: function (out)\r\n {\r\n var matrix = this.matrix;\r\n\r\n if (out === undefined)\r\n {\r\n out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ];\r\n }\r\n else\r\n {\r\n out[0] = matrix[0];\r\n out[1] = matrix[1];\r\n out[2] = matrix[2];\r\n out[3] = matrix[3];\r\n out[4] = matrix[4];\r\n out[5] = matrix[5];\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setTransform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n setTransform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = a;\r\n matrix[1] = b;\r\n matrix[2] = c;\r\n matrix[3] = d;\r\n matrix[4] = tx;\r\n matrix[5] = ty;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Decompose this Matrix into its translation, scale and rotation values using QR decomposition.\r\n * \r\n * The result must be applied in the following order to reproduce the current matrix:\r\n * \r\n * translate -> rotate -> scale\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix\r\n * @since 3.0.0\r\n *\r\n * @return {object} The decomposed Matrix.\r\n */\r\n decomposeMatrix: function ()\r\n {\r\n var decomposedMatrix = this.decomposedMatrix;\r\n\r\n var matrix = this.matrix;\r\n\r\n // a = scale X (1)\r\n // b = shear Y (0)\r\n // c = shear X (0)\r\n // d = scale Y (1)\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n var determ = a * d - b * c;\r\n\r\n decomposedMatrix.translateX = matrix[4];\r\n decomposedMatrix.translateY = matrix[5];\r\n\r\n if (a || b)\r\n {\r\n var r = Math.sqrt(a * a + b * b);\r\n\r\n decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r);\r\n decomposedMatrix.scaleX = r;\r\n decomposedMatrix.scaleY = determ / r;\r\n }\r\n else if (c || d)\r\n {\r\n var s = Math.sqrt(c * c + d * d);\r\n\r\n decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s));\r\n decomposedMatrix.scaleX = determ / s;\r\n decomposedMatrix.scaleY = s;\r\n }\r\n else\r\n {\r\n decomposedMatrix.rotation = 0;\r\n decomposedMatrix.scaleX = 0;\r\n decomposedMatrix.scaleY = 0;\r\n }\r\n\r\n return decomposedMatrix;\r\n },\r\n\r\n /**\r\n * Apply the identity, translate, rotate and scale operations on the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation.\r\n * @param {number} y - The vertical translation.\r\n * @param {number} rotation - The angle of rotation in radians.\r\n * @param {number} scaleX - The horizontal scale.\r\n * @param {number} scaleY - The vertical scale.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n applyITRS: function (x, y, rotation, scaleX, scaleY)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var radianSin = Math.sin(rotation);\r\n var radianCos = Math.cos(rotation);\r\n\r\n // Translate\r\n matrix[4] = x;\r\n matrix[5] = y;\r\n\r\n // Rotate and Scale\r\n matrix[0] = radianCos * scaleX;\r\n matrix[1] = radianSin * scaleX;\r\n matrix[2] = -radianSin * scaleY;\r\n matrix[3] = radianCos * scaleY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of\r\n * the current matrix with its transformation applied.\r\n * \r\n * Can be used to translate points from world to local space.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse\r\n * @since 3.12.0\r\n *\r\n * @param {number} x - The x position to translate.\r\n * @param {number} y - The y position to translate.\r\n * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix.\r\n */\r\n applyInverse: function (x, y, output)\r\n {\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var id = 1 / ((a * d) + (c * -b));\r\n\r\n output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id);\r\n output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id);\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the X component of this matrix multiplied by the given values.\r\n * This is the same as `x * a + y * c + e`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getX\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated x value.\r\n */\r\n getX: function (x, y)\r\n {\r\n return x * this.a + y * this.c + this.e;\r\n },\r\n\r\n /**\r\n * Returns the Y component of this matrix multiplied by the given values.\r\n * This is the same as `x * b + y * d + f`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getY\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated y value.\r\n */\r\n getY: function (x, y)\r\n {\r\n return x * this.b + y * this.d + this.f;\r\n },\r\n\r\n /**\r\n * Returns a string that can be used in a CSS Transform call as a `matrix` property.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix\r\n * @since 3.12.0\r\n *\r\n * @return {string} A string containing the CSS Transform matrix values.\r\n */\r\n getCSSMatrix: function ()\r\n {\r\n var m = this.matrix;\r\n\r\n return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')';\r\n },\r\n\r\n /**\r\n * Destroys this Transform Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#destroy\r\n * @since 3.4.0\r\n */\r\n destroy: function ()\r\n {\r\n this.matrix = null;\r\n this.decomposedMatrix = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TransformMatrix;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 1; // 0001\r\n\r\n/**\r\n * Provides methods used for setting the visibility of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Visible\r\n * @since 3.0.0\r\n */\r\n\r\nvar Visible = {\r\n\r\n /**\r\n * Private internal value. Holds the visible value.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#_visible\r\n * @type {boolean}\r\n * @private\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n _visible: true,\r\n\r\n /**\r\n * The visible state of the Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#visible\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n visible: {\r\n\r\n get: function ()\r\n {\r\n return this._visible;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value)\r\n {\r\n this._visible = true;\r\n this.renderFlags |= _FLAG;\r\n }\r\n else\r\n {\r\n this._visible = false;\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the visibility of this Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n *\r\n * @method Phaser.GameObjects.Components.Visible#setVisible\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The visible state of the Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setVisible: function (value)\r\n {\r\n this.visible = value;\r\n\r\n return this;\r\n }\r\n};\r\n\r\nmodule.exports = Visible;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Destroy Event.\r\n * \r\n * This event is dispatched when a Game Object instance is being destroyed.\r\n * \r\n * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed.\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.GameObjects.Events\r\n */\r\n\r\nmodule.exports = { DESTROY: require('./DESTROY_EVENT') };\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar CONST = require('./const');\r\nvar Events = require('./events');\r\nvar GetFastValue = require('../utils/object/GetFastValue');\r\nvar GetURL = require('./GetURL');\r\nvar MergeXHRSettings = require('./MergeXHRSettings');\r\nvar XHRLoader = require('./XHRLoader');\r\nvar XHRSettings = require('./XHRSettings');\r\n\r\n/**\r\n * @classdesc\r\n * The base File class used by all File Types that the Loader can support.\r\n * 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.\r\n *\r\n * @class File\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\r\n * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type.\r\n */\r\nvar File = new Class({\r\n\r\n initialize:\r\n\r\n function File (loader, fileConfig)\r\n {\r\n /**\r\n * A reference to the Loader that is going to load this file.\r\n *\r\n * @name Phaser.Loader.File#loader\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.0.0\r\n */\r\n this.loader = loader;\r\n\r\n /**\r\n * A reference to the Cache, or Texture Manager, that is going to store this file if it loads.\r\n *\r\n * @name Phaser.Loader.File#cache\r\n * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)}\r\n * @since 3.7.0\r\n */\r\n this.cache = GetFastValue(fileConfig, 'cache', false);\r\n\r\n /**\r\n * The file type string (image, json, etc) for sorting within the Loader.\r\n *\r\n * @name Phaser.Loader.File#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = GetFastValue(fileConfig, 'type', false);\r\n\r\n /**\r\n * Unique cache key (unique within its file type)\r\n *\r\n * @name Phaser.Loader.File#key\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.key = GetFastValue(fileConfig, 'key', false);\r\n\r\n var loadKey = this.key;\r\n\r\n if (loader.prefix && loader.prefix !== '')\r\n {\r\n this.key = loader.prefix + loadKey;\r\n }\r\n\r\n if (!this.type || !this.key)\r\n {\r\n throw new Error('Error calling \\'Loader.' + this.type + '\\' invalid key provided.');\r\n }\r\n\r\n /**\r\n * The URL of the file, not including baseURL.\r\n * Automatically has Loader.path prepended to it.\r\n *\r\n * @name Phaser.Loader.File#url\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.url = GetFastValue(fileConfig, 'url');\r\n\r\n if (this.url === undefined)\r\n {\r\n this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', '');\r\n }\r\n else if (typeof(this.url) !== 'function')\r\n {\r\n this.url = loader.path + this.url;\r\n }\r\n\r\n /**\r\n * The final URL this file will load from, including baseURL and path.\r\n * Set automatically when the Loader calls 'load' on this file.\r\n *\r\n * @name Phaser.Loader.File#src\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.src = '';\r\n\r\n /**\r\n * The merged XHRSettings for this file.\r\n *\r\n * @name Phaser.Loader.File#xhrSettings\r\n * @type {Phaser.Types.Loader.XHRSettingsObject}\r\n * @since 3.0.0\r\n */\r\n this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined));\r\n\r\n if (GetFastValue(fileConfig, 'xhrSettings', false))\r\n {\r\n this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {}));\r\n }\r\n\r\n /**\r\n * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File.\r\n *\r\n * @name Phaser.Loader.File#xhrLoader\r\n * @type {?XMLHttpRequest}\r\n * @since 3.0.0\r\n */\r\n this.xhrLoader = null;\r\n\r\n /**\r\n * The current state of the file. One of the FILE_CONST values.\r\n *\r\n * @name Phaser.Loader.File#state\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING;\r\n\r\n /**\r\n * The total size of this file.\r\n * Set by onProgress and only if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#bytesTotal\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.bytesTotal = 0;\r\n\r\n /**\r\n * Updated as the file loads.\r\n * Only set if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#bytesLoaded\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.bytesLoaded = -1;\r\n\r\n /**\r\n * A percentage value between 0 and 1 indicating how much of this file has loaded.\r\n * Only set if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#percentComplete\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.percentComplete = -1;\r\n\r\n /**\r\n * For CORs based loading.\r\n * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set)\r\n *\r\n * @name Phaser.Loader.File#crossOrigin\r\n * @type {(string|undefined)}\r\n * @since 3.0.0\r\n */\r\n this.crossOrigin = undefined;\r\n\r\n /**\r\n * The processed file data, stored here after the file has loaded.\r\n *\r\n * @name Phaser.Loader.File#data\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.data = undefined;\r\n\r\n /**\r\n * A config object that can be used by file types to store transitional data.\r\n *\r\n * @name Phaser.Loader.File#config\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.config = GetFastValue(fileConfig, 'config', {});\r\n\r\n /**\r\n * If this is a multipart file, i.e. an atlas and its json together, then this is a reference\r\n * to the parent MultiFile. Set and used internally by the Loader or specific file types.\r\n *\r\n * @name Phaser.Loader.File#multiFile\r\n * @type {?Phaser.Loader.MultiFile}\r\n * @since 3.7.0\r\n */\r\n this.multiFile;\r\n\r\n /**\r\n * Does this file have an associated linked file? Such as an image and a normal map.\r\n * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't\r\n * actually bound by data, where-as a linkFile is.\r\n *\r\n * @name Phaser.Loader.File#linkFile\r\n * @type {?Phaser.Loader.File}\r\n * @since 3.7.0\r\n */\r\n this.linkFile;\r\n },\r\n\r\n /**\r\n * Links this File with another, so they depend upon each other for loading and processing.\r\n *\r\n * @method Phaser.Loader.File#setLink\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} fileB - The file to link to this one.\r\n */\r\n setLink: function (fileB)\r\n {\r\n this.linkFile = fileB;\r\n\r\n fileB.linkFile = this;\r\n },\r\n\r\n /**\r\n * Resets the XHRLoader instance this file is using.\r\n *\r\n * @method Phaser.Loader.File#resetXHR\r\n * @since 3.0.0\r\n */\r\n resetXHR: function ()\r\n {\r\n if (this.xhrLoader)\r\n {\r\n this.xhrLoader.onload = undefined;\r\n this.xhrLoader.onerror = undefined;\r\n this.xhrLoader.onprogress = undefined;\r\n }\r\n },\r\n\r\n /**\r\n * Called by the Loader, starts the actual file downloading.\r\n * During the load the methods onLoad, onError and onProgress are called, based on the XHR events.\r\n * You shouldn't normally call this method directly, it's meant to be invoked by the Loader.\r\n *\r\n * @method Phaser.Loader.File#load\r\n * @since 3.0.0\r\n */\r\n load: function ()\r\n {\r\n if (this.state === CONST.FILE_POPULATED)\r\n {\r\n // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL\r\n this.loader.nextFile(this, true);\r\n }\r\n else\r\n {\r\n this.src = GetURL(this, this.loader.baseURL);\r\n\r\n if (this.src.indexOf('data:') === 0)\r\n {\r\n console.warn('Local data URIs are not supported: ' + this.key);\r\n }\r\n else\r\n {\r\n // The creation of this XHRLoader starts the load process going.\r\n // It will automatically call the following, based on the load outcome:\r\n // \r\n // xhr.onload = this.onLoad\r\n // xhr.onerror = this.onError\r\n // xhr.onprogress = this.onProgress\r\n\r\n this.xhrLoader = XHRLoader(this, this.loader.xhr);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Called when the file finishes loading, is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onLoad\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load.\r\n */\r\n onLoad: function (xhr, event)\r\n {\r\n var localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && event.target.status === 0));\r\n\r\n var success = !(event.target && event.target.status !== 200) || localFileOk;\r\n\r\n // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.\r\n if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599)\r\n {\r\n success = false;\r\n }\r\n\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, success);\r\n },\r\n\r\n /**\r\n * Called if the file errors while loading, is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onError\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error.\r\n */\r\n onError: function ()\r\n {\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, false);\r\n },\r\n\r\n /**\r\n * Called during the file load progress. Is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onProgress\r\n * @fires Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n *\r\n * @param {ProgressEvent} event - The DOM ProgressEvent.\r\n */\r\n onProgress: function (event)\r\n {\r\n if (event.lengthComputable)\r\n {\r\n this.bytesLoaded = event.loaded;\r\n this.bytesTotal = event.total;\r\n\r\n this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1);\r\n\r\n this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete);\r\n }\r\n },\r\n\r\n /**\r\n * Usually overridden by the FileTypes and is called by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage.\r\n *\r\n * @method Phaser.Loader.File#onProcess\r\n * @since 3.0.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.onProcessComplete();\r\n },\r\n\r\n /**\r\n * Called when the File has completed processing.\r\n * Checks on the state of its multifile, if set.\r\n *\r\n * @method Phaser.Loader.File#onProcessComplete\r\n * @since 3.7.0\r\n */\r\n onProcessComplete: function ()\r\n {\r\n this.state = CONST.FILE_COMPLETE;\r\n\r\n if (this.multiFile)\r\n {\r\n this.multiFile.onFileComplete(this);\r\n }\r\n\r\n this.loader.fileProcessComplete(this);\r\n },\r\n\r\n /**\r\n * Called when the File has completed processing but it generated an error.\r\n * Checks on the state of its multifile, if set.\r\n *\r\n * @method Phaser.Loader.File#onProcessError\r\n * @since 3.7.0\r\n */\r\n onProcessError: function ()\r\n {\r\n this.state = CONST.FILE_ERRORED;\r\n\r\n if (this.multiFile)\r\n {\r\n this.multiFile.onFileFailed(this);\r\n }\r\n\r\n this.loader.fileProcessComplete(this);\r\n },\r\n\r\n /**\r\n * Checks if a key matching the one used by this file exists in the target Cache or not.\r\n * This is called automatically by the LoaderPlugin to decide if the file can be safely\r\n * loaded or will conflict.\r\n *\r\n * @method Phaser.Loader.File#hasCacheConflict\r\n * @since 3.7.0\r\n *\r\n * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`.\r\n */\r\n hasCacheConflict: function ()\r\n {\r\n return (this.cache && this.cache.exists(this.key));\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n * This method is often overridden by specific file types.\r\n *\r\n * @method Phaser.Loader.File#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.cache)\r\n {\r\n this.cache.add(this.key, this.data);\r\n }\r\n\r\n this.pendingDestroy();\r\n },\r\n\r\n /**\r\n * Called once the file has been added to its cache and is now ready for deletion from the Loader.\r\n * It will emit a `filecomplete` event from the LoaderPlugin.\r\n *\r\n * @method Phaser.Loader.File#pendingDestroy\r\n * @fires Phaser.Loader.Events#FILE_COMPLETE\r\n * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE\r\n * @since 3.7.0\r\n */\r\n pendingDestroy: function (data)\r\n {\r\n if (data === undefined) { data = this.data; }\r\n\r\n var key = this.key;\r\n var type = this.type;\r\n\r\n this.loader.emit(Events.FILE_COMPLETE, key, type, data);\r\n this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data);\r\n\r\n this.loader.flagForRemoval(this);\r\n },\r\n\r\n /**\r\n * Destroy this File and any references it holds.\r\n *\r\n * @method Phaser.Loader.File#destroy\r\n * @since 3.7.0\r\n */\r\n destroy: function ()\r\n {\r\n this.loader = null;\r\n this.cache = null;\r\n this.xhrSettings = null;\r\n this.multiFile = null;\r\n this.linkFile = null;\r\n this.data = null;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Static method for creating object URL using URL API and setting it as image 'src' attribute.\r\n * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader.\r\n *\r\n * @method Phaser.Loader.File.createObjectURL\r\n * @static\r\n * @since 3.7.0\r\n * \r\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL.\r\n * @param {Blob} blob - A Blob object to create an object URL for.\r\n * @param {string} defaultType - Default mime type used if blob type is not available.\r\n */\r\nFile.createObjectURL = function (image, blob, defaultType)\r\n{\r\n if (typeof URL === 'function')\r\n {\r\n image.src = URL.createObjectURL(blob);\r\n }\r\n else\r\n {\r\n var reader = new FileReader();\r\n\r\n reader.onload = function ()\r\n {\r\n image.removeAttribute('crossOrigin');\r\n image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1];\r\n };\r\n\r\n reader.onerror = image.onerror;\r\n\r\n reader.readAsDataURL(blob);\r\n }\r\n};\r\n\r\n/**\r\n * Static method for releasing an existing object URL which was previously created\r\n * by calling {@link File#createObjectURL} method.\r\n *\r\n * @method Phaser.Loader.File.revokeObjectURL\r\n * @static\r\n * @since 3.7.0\r\n * \r\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked.\r\n */\r\nFile.revokeObjectURL = function (image)\r\n{\r\n if (typeof URL === 'function')\r\n {\r\n URL.revokeObjectURL(image.src);\r\n }\r\n};\r\n\r\nmodule.exports = File;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar types = {};\r\n\r\n/**\r\n * @namespace Phaser.Loader.FileTypesManager\r\n */\r\n\r\nvar FileTypesManager = {\r\n\r\n /**\r\n * Static method called when a LoaderPlugin is created.\r\n * \r\n * Loops through the local types object and injects all of them as\r\n * properties into the LoaderPlugin instance.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.install\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into.\r\n */\r\n install: function (loader)\r\n {\r\n for (var key in types)\r\n {\r\n loader[key] = types[key];\r\n }\r\n },\r\n\r\n /**\r\n * Static method called directly by the File Types.\r\n * \r\n * The key is a reference to the function used to load the files via the Loader, i.e. `image`.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.register\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key that will be used as the method name in the LoaderPlugin.\r\n * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked.\r\n */\r\n register: function (key, factoryFunction)\r\n {\r\n types[key] = factoryFunction;\r\n },\r\n\r\n /**\r\n * Removed all associated file types.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n types = {};\r\n }\r\n\r\n};\r\n\r\nmodule.exports = FileTypesManager;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Given a File and a baseURL value this returns the URL the File will use to download from.\r\n *\r\n * @function Phaser.Loader.GetURL\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File object.\r\n * @param {string} baseURL - A default base URL.\r\n *\r\n * @return {string} The URL the File will use.\r\n */\r\nvar GetURL = function (file, baseURL)\r\n{\r\n if (!file.url)\r\n {\r\n return false;\r\n }\r\n\r\n if (file.url.match(/^(?:blob:|data:|http:\\/\\/|https:\\/\\/|\\/\\/)/))\r\n {\r\n return file.url;\r\n }\r\n else\r\n {\r\n return baseURL + file.url;\r\n }\r\n};\r\n\r\nmodule.exports = GetURL;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Extend = require('../utils/object/Extend');\r\nvar XHRSettings = require('./XHRSettings');\r\n\r\n/**\r\n * Takes two XHRSettings Objects and creates a new XHRSettings object from them.\r\n *\r\n * The new object is seeded by the values given in the global settings, but any setting in\r\n * the local object overrides the global ones.\r\n *\r\n * @function Phaser.Loader.MergeXHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object.\r\n */\r\nvar MergeXHRSettings = function (global, local)\r\n{\r\n var output = (global === undefined) ? XHRSettings() : Extend({}, global);\r\n\r\n if (local)\r\n {\r\n for (var setting in local)\r\n {\r\n if (local[setting] !== undefined)\r\n {\r\n output[setting] = local[setting];\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = MergeXHRSettings;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after\r\n * 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.\r\n * \r\n * 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.\r\n *\r\n * @class MultiFile\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\r\n * @param {string} type - The file type string for sorting within the Loader.\r\n * @param {string} key - The key of the file within the loader.\r\n * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile.\r\n */\r\nvar MultiFile = new Class({\r\n\r\n initialize:\r\n\r\n function MultiFile (loader, type, key, files)\r\n {\r\n /**\r\n * A reference to the Loader that is going to load this file.\r\n *\r\n * @name Phaser.Loader.MultiFile#loader\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.7.0\r\n */\r\n this.loader = loader;\r\n\r\n /**\r\n * The file type string for sorting within the Loader.\r\n *\r\n * @name Phaser.Loader.MultiFile#type\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * Unique cache key (unique within its file type)\r\n *\r\n * @name Phaser.Loader.MultiFile#key\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.key = key;\r\n\r\n /**\r\n * Array of files that make up this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#files\r\n * @type {Phaser.Loader.File[]}\r\n * @since 3.7.0\r\n */\r\n this.files = files;\r\n\r\n /**\r\n * The completion status of this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#complete\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.7.0\r\n */\r\n this.complete = false;\r\n\r\n /**\r\n * The number of files to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#pending\r\n * @type {integer}\r\n * @since 3.7.0\r\n */\r\n\r\n this.pending = files.length;\r\n\r\n /**\r\n * The number of files that failed to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#failed\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.7.0\r\n */\r\n this.failed = 0;\r\n\r\n /**\r\n * A storage container for transient data that the loading files need.\r\n *\r\n * @name Phaser.Loader.MultiFile#config\r\n * @type {any}\r\n * @since 3.7.0\r\n */\r\n this.config = {};\r\n\r\n // Link the files\r\n for (var i = 0; i < files.length; i++)\r\n {\r\n files[i].multiFile = this;\r\n }\r\n },\r\n\r\n /**\r\n * Checks if this MultiFile is ready to process its children or not.\r\n *\r\n * @method Phaser.Loader.MultiFile#isReadyToProcess\r\n * @since 3.7.0\r\n *\r\n * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`.\r\n */\r\n isReadyToProcess: function ()\r\n {\r\n return (this.pending === 0 && this.failed === 0 && !this.complete);\r\n },\r\n\r\n /**\r\n * Adds another child to this MultiFile, increases the pending count and resets the completion status.\r\n *\r\n * @method Phaser.Loader.MultiFile#addToMultiFile\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} files - The File to add to this MultiFile.\r\n *\r\n * @return {Phaser.Loader.MultiFile} This MultiFile instance.\r\n */\r\n addToMultiFile: function (file)\r\n {\r\n this.files.push(file);\r\n\r\n file.multiFile = this;\r\n\r\n this.pending++;\r\n\r\n this.complete = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileComplete\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n }\r\n },\r\n\r\n /**\r\n * Called by each File that fails to load.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileFailed\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has failed to load.\r\n */\r\n onFileFailed: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.failed++;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MultiFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MergeXHRSettings = require('./MergeXHRSettings');\r\n\r\n/**\r\n * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings\r\n * and starts the download of it. It uses the Files own XHRSettings and merges them\r\n * with the global XHRSettings object to set the xhr values before download.\r\n *\r\n * @function Phaser.Loader.XHRLoader\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File to download.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object.\r\n *\r\n * @return {XMLHttpRequest} The XHR object.\r\n */\r\nvar XHRLoader = function (file, globalXHRSettings)\r\n{\r\n var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings);\r\n\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', file.src, config.async, config.user, config.password);\r\n\r\n xhr.responseType = file.xhrSettings.responseType;\r\n xhr.timeout = config.timeout;\r\n\r\n if (config.header && config.headerValue)\r\n {\r\n xhr.setRequestHeader(config.header, config.headerValue);\r\n }\r\n\r\n if (config.requestedWith)\r\n {\r\n xhr.setRequestHeader('X-Requested-With', config.requestedWith);\r\n }\r\n\r\n if (config.overrideMimeType)\r\n {\r\n xhr.overrideMimeType(config.overrideMimeType);\r\n }\r\n\r\n // 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.)\r\n\r\n xhr.onload = file.onLoad.bind(file, xhr);\r\n xhr.onerror = file.onError.bind(file, xhr);\r\n xhr.onprogress = file.onProgress.bind(file);\r\n\r\n // This is the only standard method, the ones above are browser additions (maybe not universal?)\r\n // xhr.onreadystatechange\r\n\r\n xhr.send();\r\n\r\n return xhr;\r\n};\r\n\r\nmodule.exports = XHRLoader;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Creates an XHRSettings Object with default values.\r\n *\r\n * @function Phaser.Loader.XHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'.\r\n * @param {boolean} [async=true] - Should the XHR request use async or not?\r\n * @param {string} [user=''] - Optional username for the XHR request.\r\n * @param {string} [password=''] - Optional password for the XHR request.\r\n * @param {integer} [timeout=0] - Optional XHR timeout value.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader.\r\n */\r\nvar XHRSettings = function (responseType, async, user, password, timeout)\r\n{\r\n if (responseType === undefined) { responseType = ''; }\r\n if (async === undefined) { async = true; }\r\n if (user === undefined) { user = ''; }\r\n if (password === undefined) { password = ''; }\r\n if (timeout === undefined) { timeout = 0; }\r\n\r\n // Before sending a request, set the xhr.responseType to \"text\",\r\n // \"arraybuffer\", \"blob\", or \"document\", depending on your data needs.\r\n // Note, setting xhr.responseType = '' (or omitting) will default the response to \"text\".\r\n\r\n return {\r\n\r\n // Ignored by the Loader, only used by File.\r\n responseType: responseType,\r\n\r\n async: async,\r\n\r\n // credentials\r\n user: user,\r\n password: password,\r\n\r\n // timeout in ms (0 = no timeout)\r\n timeout: timeout,\r\n\r\n // setRequestHeader\r\n header: undefined,\r\n headerValue: undefined,\r\n requestedWith: false,\r\n\r\n // overrideMimeType\r\n overrideMimeType: undefined\r\n\r\n };\r\n};\r\n\r\nmodule.exports = XHRSettings;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FILE_CONST = {\r\n\r\n /**\r\n * The Loader is idle.\r\n * \r\n * @name Phaser.Loader.LOADER_IDLE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_IDLE: 0,\r\n\r\n /**\r\n * The Loader is actively loading.\r\n * \r\n * @name Phaser.Loader.LOADER_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_LOADING: 1,\r\n\r\n /**\r\n * The Loader is processing files is has loaded.\r\n * \r\n * @name Phaser.Loader.LOADER_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_PROCESSING: 2,\r\n\r\n /**\r\n * The Loader has completed loading and processing.\r\n * \r\n * @name Phaser.Loader.LOADER_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_COMPLETE: 3,\r\n\r\n /**\r\n * The Loader is shutting down.\r\n * \r\n * @name Phaser.Loader.LOADER_SHUTDOWN\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_SHUTDOWN: 4,\r\n\r\n /**\r\n * The Loader has been destroyed.\r\n * \r\n * @name Phaser.Loader.LOADER_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_DESTROYED: 5,\r\n\r\n /**\r\n * File is in the load queue but not yet started\r\n * \r\n * @name Phaser.Loader.FILE_PENDING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PENDING: 10,\r\n\r\n /**\r\n * File has been started to load by the loader (onLoad called)\r\n * \r\n * @name Phaser.Loader.FILE_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADING: 11,\r\n\r\n /**\r\n * File has loaded successfully, awaiting processing \r\n * \r\n * @name Phaser.Loader.FILE_LOADED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADED: 12,\r\n\r\n /**\r\n * File failed to load\r\n * \r\n * @name Phaser.Loader.FILE_FAILED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_FAILED: 13,\r\n\r\n /**\r\n * File is being processed (onProcess callback)\r\n * \r\n * @name Phaser.Loader.FILE_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PROCESSING: 14,\r\n\r\n /**\r\n * The File has errored somehow during processing.\r\n * \r\n * @name Phaser.Loader.FILE_ERRORED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_ERRORED: 16,\r\n\r\n /**\r\n * File has finished processing.\r\n * \r\n * @name Phaser.Loader.FILE_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_COMPLETE: 17,\r\n\r\n /**\r\n * File has been destroyed\r\n * \r\n * @name Phaser.Loader.FILE_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_DESTROYED: 18,\r\n\r\n /**\r\n * File was populated from local data and doesn't need an HTTP request\r\n * \r\n * @name Phaser.Loader.FILE_POPULATED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_POPULATED: 19\r\n\r\n};\r\n\r\nmodule.exports = FILE_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Add File Event.\r\n * \r\n * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('addfile', listener)`.\r\n * \r\n * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them.\r\n *\r\n * @event Phaser.Loader.Events#ADD\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The unique key of the file that was added to the Loader.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`.\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader.\r\n */\r\nmodule.exports = 'addfile';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Complete Event.\r\n * \r\n * This event is dispatched when the Loader has fully processed everything in the load queue.\r\n * By this point every loaded file will now be in its associated cache and ready for use.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('complete', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {integer} totalComplete - The total number of files that successfully loaded.\r\n * @param {integer} totalFailed - The total number of files that failed to load.\r\n */\r\nmodule.exports = 'complete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`.\r\n * \r\n * 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.\r\n *\r\n * @event Phaser.Loader.Events#FILE_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * It uses a special dynamic event name constructed from the key and type of the file.\r\n * \r\n * For example, if you have loaded an `image` with a key of `monster`, you can listen for it\r\n * using the following:\r\n *\r\n * ```javascript\r\n * this.load.on('filecomplete-image-monster', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n *\r\n * Or, if you have loaded a texture `atlas` with a key of `Level1`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-atlas-Level1', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event.\r\n *\r\n * @event Phaser.Loader.Events#FILE_KEY_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete-';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Error Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file fails to load.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('loaderror', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD_ERROR\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n */\r\nmodule.exports = 'loaderror';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file finishes loading,\r\n * but _before_ it is processed and added to the internal Phaser caches.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('load', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which just finished loading.\r\n */\r\nmodule.exports = 'load';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Progress Event.\r\n * \r\n * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and\r\n * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is.\r\n */\r\nmodule.exports = 'fileprogress';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Post Process Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue.\r\n * It is dispatched before the internal lists are cleared and each File is destroyed.\r\n * \r\n * Use this hook to perform any last minute processing of files that can only happen once the\r\n * Loader has completed, but prior to it emitting the `complete` event.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('postprocess', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#POST_PROCESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'postprocess';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Progress Event.\r\n * \r\n * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('progress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {number} progress - The current progress of the load. A value between 0 and 1.\r\n */\r\nmodule.exports = 'progress';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Start Event.\r\n * \r\n * This event is dispatched when the Loader starts running. At this point load progress is zero.\r\n * \r\n * This event is dispatched even if there aren't any files in the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('start', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Loader.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ADD: require('./ADD_EVENT'),\r\n COMPLETE: require('./COMPLETE_EVENT'),\r\n FILE_COMPLETE: require('./FILE_COMPLETE_EVENT'),\r\n FILE_KEY_COMPLETE: require('./FILE_KEY_COMPLETE_EVENT'),\r\n FILE_LOAD_ERROR: require('./FILE_LOAD_ERROR_EVENT'),\r\n FILE_LOAD: require('./FILE_LOAD_EVENT'),\r\n FILE_PROGRESS: require('./FILE_PROGRESS_EVENT'),\r\n POST_PROCESS: require('./POST_PROCESS_EVENT'),\r\n PROGRESS: require('./PROGRESS_EVENT'),\r\n START: require('./START_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single Image File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image.\r\n *\r\n * @class ImageFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets.\r\n */\r\nvar ImageFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function ImageFile (loader, key, url, xhrSettings, frameConfig)\r\n {\r\n var extension = 'png';\r\n var normalMapURL;\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n normalMapURL = GetFastValue(config, 'normalMap');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n frameConfig = GetFastValue(config, 'frameConfig');\r\n }\r\n\r\n if (Array.isArray(url))\r\n {\r\n normalMapURL = url[1];\r\n url = url[0];\r\n }\r\n\r\n var fileConfig = {\r\n type: 'image',\r\n cache: loader.textureManager,\r\n extension: extension,\r\n responseType: 'blob',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: frameConfig\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n // Do we have a normal map to load as well?\r\n if (normalMapURL)\r\n {\r\n var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig);\r\n\r\n normalMap.type = 'normalMap';\r\n\r\n this.setLink(normalMap);\r\n\r\n loader.addFile(normalMap);\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = new Image();\r\n\r\n this.data.crossOrigin = this.crossOrigin;\r\n\r\n var _this = this;\r\n\r\n this.data.onload = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessComplete();\r\n };\r\n\r\n this.data.onerror = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessError();\r\n };\r\n\r\n File.createObjectURL(this.data, this.xhrLoader.response, 'image/png');\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var texture;\r\n var linkFile = this.linkFile;\r\n\r\n if (linkFile && linkFile.state === CONST.FILE_COMPLETE)\r\n {\r\n if (this.type === 'image')\r\n {\r\n texture = this.cache.addImage(this.key, this.data, linkFile.data);\r\n }\r\n else\r\n {\r\n texture = this.cache.addImage(linkFile.key, linkFile.data, this.data);\r\n }\r\n\r\n this.pendingDestroy(texture);\r\n\r\n linkFile.pendingDestroy(texture);\r\n }\r\n else if (!linkFile)\r\n {\r\n texture = this.cache.addImage(this.key, this.data);\r\n\r\n this.pendingDestroy(texture);\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an Image, or array of Images, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.image('logo', 'images/phaserLogo.png');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback\r\n * of animated gifs to Canvas elements.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.image('logo', 'images/AtariLogo.png');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'logo');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n * \r\n * ```javascript\r\n * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]);\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n * \r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png',\r\n * normalMap: 'images/AtariLogo-n.png'\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#image\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('image', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new ImageFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new ImageFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = ImageFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar GetValue = require('../../utils/object/GetValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single JSON File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json.\r\n *\r\n * @class JSONFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n */\r\nvar JSONFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n // 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\r\n // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing\r\n\r\n function JSONFile (loader, key, url, xhrSettings, dataKey)\r\n {\r\n var extension = 'json';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n dataKey = GetFastValue(config, 'dataKey', dataKey);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'json',\r\n cache: loader.cacheManager.json,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: dataKey\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n if (IsPlainObject(url))\r\n {\r\n // Object provided instead of a URL, so no need to actually load it (populate data with value)\r\n if (dataKey)\r\n {\r\n this.data = GetValue(url, dataKey);\r\n }\r\n else\r\n {\r\n this.data = url;\r\n }\r\n\r\n this.state = CONST.FILE_POPULATED;\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.JSONFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n if (this.state !== CONST.FILE_POPULATED)\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n var json = JSON.parse(this.xhrLoader.responseText);\r\n\r\n var key = this.config;\r\n\r\n if (typeof key === 'string')\r\n {\r\n this.data = GetValue(json, key, json);\r\n }\r\n else\r\n {\r\n this.data = json;\r\n }\r\n }\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a JSON file, or array of JSON files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.json('wavedata', 'files/AlienWaveData.json');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the JSON Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the JSON Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.json({\r\n * key: 'wavedata',\r\n * url: 'files/AlienWaveData.json'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n * \r\n * ```javascript\r\n * this.load.json('wavedata', 'files/AlienWaveData.json');\r\n * // and later in your game ...\r\n * var data = this.cache.json.get('wavedata');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and\r\n * this is what you would use to retrieve the text from the JSON Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * 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,\r\n * rather than the whole file. For example, if your JSON data had a structure like this:\r\n * \r\n * ```json\r\n * {\r\n * \"level1\": {\r\n * \"baddies\": {\r\n * \"aliens\": {},\r\n * \"boss\": {}\r\n * }\r\n * },\r\n * \"level2\": {},\r\n * \"level3\": {}\r\n * }\r\n * ```\r\n *\r\n * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`.\r\n *\r\n * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#json\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {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\".\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('json', function (key, url, dataKey, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new JSONFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = JSONFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single Text File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text.\r\n *\r\n * @class TextFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar TextFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function TextFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'txt';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'text',\r\n cache: loader.cacheManager.text,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.TextFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = this.xhrLoader.responseText;\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Text file, or array of Text files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Text Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Text Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.text({\r\n * key: 'story',\r\n * url: 'files/IntroStory.txt'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n *\r\n * ```javascript\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * // and later in your game ...\r\n * var data = this.cache.text.get('story');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and\r\n * this is what you would use to retrieve the text from the Text Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#text\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('text', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new TextFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new TextFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = TextFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Force a value within the boundaries by clamping it to the range `min`, `max`.\r\n *\r\n * @function Phaser.Math.Clamp\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to be clamped.\r\n * @param {number} min - The minimum bounds.\r\n * @param {number} max - The maximum bounds.\r\n *\r\n * @return {number} The clamped value.\r\n */\r\nvar Clamp = function (value, min, max)\r\n{\r\n return Math.max(min, Math.min(max, value));\r\n};\r\n\r\nmodule.exports = Clamp;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\nvar EPSILON = 0.000001;\r\n\r\n/**\r\n * @classdesc\r\n * A four-dimensional matrix.\r\n *\r\n * @class Matrix4\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from.\r\n */\r\nvar Matrix4 = new Class({\r\n\r\n initialize:\r\n\r\n function Matrix4 (m)\r\n {\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.Math.Matrix4#val\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.val = new Float32Array(16);\r\n\r\n if (m)\r\n {\r\n // Assume Matrix4 with val:\r\n this.copy(m);\r\n }\r\n else\r\n {\r\n // Default to identity\r\n this.identity();\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Matrix4.\r\n *\r\n * @method Phaser.Math.Matrix4#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} A clone of this Matrix4.\r\n */\r\n clone: function ()\r\n {\r\n return new Matrix4(this);\r\n },\r\n\r\n // TODO - Should work with basic values\r\n\r\n /**\r\n * This method is an alias for `Matrix4.copy`.\r\n *\r\n * @method Phaser.Math.Matrix4#set\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n set: function (src)\r\n {\r\n return this.copy(src);\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix into this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n copy: function (src)\r\n {\r\n var out = this.val;\r\n var a = src.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given array.\r\n *\r\n * @method Phaser.Math.Matrix4#fromArray\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The array to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromArray: function (a)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix.\r\n *\r\n * Sets all values to `0`.\r\n *\r\n * @method Phaser.Math.Matrix4#zero\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n zero: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 0;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x`, `y` and `z` values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#xyz\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n * @param {number} z - The z value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n xyz: function (x, y, z)\r\n {\r\n this.identity();\r\n\r\n var out = this.val;\r\n\r\n out[12] = x;\r\n out[13] = y;\r\n out[14] = z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the scaling values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaling\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x scaling value.\r\n * @param {number} y - The y scaling value.\r\n * @param {number} z - The z scaling value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaling: function (x, y, z)\r\n {\r\n this.zero();\r\n\r\n var out = this.val;\r\n\r\n out[0] = x;\r\n out[5] = y;\r\n out[10] = z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n identity: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transpose this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#transpose\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n transpose: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n var a23 = a[11];\r\n\r\n a[1] = a[4];\r\n a[2] = a[8];\r\n a[3] = a[12];\r\n a[4] = a01;\r\n a[6] = a[9];\r\n a[7] = a[13];\r\n a[8] = a02;\r\n a[9] = a12;\r\n a[11] = a[14];\r\n a[12] = a03;\r\n a[13] = a13;\r\n a[14] = a23;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n invert: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the adjoint, or adjugate, of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#adjoint\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n adjoint: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22));\r\n a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\r\n a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12));\r\n a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\r\n a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\r\n a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22));\r\n a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\r\n a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12));\r\n a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21));\r\n a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\r\n a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11));\r\n a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\r\n a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\r\n a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21));\r\n a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\r\n a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11));\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the determinant of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#determinant\r\n * @since 3.0.0\r\n *\r\n * @return {number} The determinant of this Matrix.\r\n */\r\n determinant: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiply: function (src)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b = src.val;\r\n\r\n // Cache only the current line of the second matrix\r\n var b0 = b[0];\r\n var b1 = b[1];\r\n var b2 = b[2];\r\n var b3 = b[3];\r\n\r\n a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n\r\n a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n\r\n a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n\r\n a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Matrix4#multiplyLocal\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - [description]\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiplyLocal: function (src)\r\n {\r\n var a = [];\r\n var m1 = this.val;\r\n var m2 = src.val;\r\n\r\n a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12];\r\n a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13];\r\n a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14];\r\n a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15];\r\n\r\n a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12];\r\n a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13];\r\n a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14];\r\n a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15];\r\n\r\n a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12];\r\n a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13];\r\n a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14];\r\n a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15];\r\n\r\n a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12];\r\n a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13];\r\n a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14];\r\n a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15];\r\n\r\n return this.fromArray(a);\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translate: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given values.\r\n *\r\n * @method Phaser.Math.Matrix4#translateXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translateXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scale: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaleXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaleXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Derive a rotation matrix around the given axis.\r\n *\r\n * @method Phaser.Math.Matrix4#makeRotationAxis\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis.\r\n * @param {number} angle - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n makeRotationAxis: function (axis, angle)\r\n {\r\n // Based on http://www.gamedev.net/reference/articles/article1199.asp\r\n\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n var t = 1 - c;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var tx = t * x;\r\n var ty = t * y;\r\n\r\n this.fromArray([\r\n tx * x + c, tx * y - s * z, tx * z + s * y, 0,\r\n tx * y + s * z, ty * y + c, ty * z - s * x, 0,\r\n tx * z - s * y, ty * z + s * x, t * z * z + c, 0,\r\n 0, 0, 0, 1\r\n ]);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a rotation transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n * @param {Phaser.Math.Vector3} axis - The axis to rotate upon.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotate: function (rad, axis)\r\n {\r\n var a = this.val;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (Math.abs(len) < EPSILON)\r\n {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n var t = 1 - c;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n var b00 = x * x * t + c;\r\n var b01 = y * x * t + z * s;\r\n var b02 = z * x * t - y * s;\r\n\r\n var b10 = x * y * t - z * s;\r\n var b11 = y * y * t + c;\r\n var b12 = z * y * t + x * s;\r\n\r\n var b20 = x * z * t + y * s;\r\n var b21 = y * z * t - x * s;\r\n var b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n a[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n a[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n a[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n a[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n a[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n a[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n a[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n a[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n a[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n a[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n a[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n a[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its X axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateX: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[4] = a10 * c + a20 * s;\r\n a[5] = a11 * c + a21 * s;\r\n a[6] = a12 * c + a22 * s;\r\n a[7] = a13 * c + a23 * s;\r\n a[8] = a20 * c - a10 * s;\r\n a[9] = a21 * c - a11 * s;\r\n a[10] = a22 * c - a12 * s;\r\n a[11] = a23 * c - a13 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Y axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateY: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c - a20 * s;\r\n a[1] = a01 * c - a21 * s;\r\n a[2] = a02 * c - a22 * s;\r\n a[3] = a03 * c - a23 * s;\r\n a[8] = a00 * s + a20 * c;\r\n a[9] = a01 * s + a21 * c;\r\n a[10] = a02 * s + a22 * c;\r\n a[11] = a03 * s + a23 * c;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Z axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateZ: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c + a10 * s;\r\n a[1] = a01 * c + a11 * s;\r\n a[2] = a02 * c + a12 * s;\r\n a[3] = a03 * c + a13 * s;\r\n a[4] = a10 * c - a00 * s;\r\n a[5] = a11 * c - a01 * s;\r\n a[6] = a12 * c - a02 * s;\r\n a[7] = a13 * c - a03 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given rotation Quaternion and translation Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#fromRotationTranslation\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from.\r\n * @param {Phaser.Math.Vector3} v - The Vector to set translation from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromRotationTranslation: function (q, v)\r\n {\r\n // Quaternion math\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = v.x;\r\n out[13] = v.y;\r\n out[14] = v.z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given Quaternion.\r\n *\r\n * @method Phaser.Math.Matrix4#fromQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromQuat: function (q)\r\n {\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a frustum matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#frustum\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n frustum: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n\r\n var rl = 1 / (right - left);\r\n var tb = 1 / (top - bottom);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = (near * 2) * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (near * 2) * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (far * near * 2) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspective\r\n * @since 3.0.0\r\n *\r\n * @param {number} fovy - Vertical field of view in radians\r\n * @param {number} aspect - Aspect ratio. Typically viewport width /height.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspective: function (fovy, aspect, near, far)\r\n {\r\n var out = this.val;\r\n var f = 1.0 / Math.tan(fovy / 2);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (2 * far * near) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspectiveLH\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of the frustum.\r\n * @param {number} height - The height of the frustum.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspectiveLH: function (width, height, near, far)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = (2 * near) / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (2 * near) / height;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = -far / (near - far);\r\n out[11] = 1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (near * far) / (near - far);\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate an orthogonal projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#ortho\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n ortho: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n var lr = left - right;\r\n var bt = bottom - top;\r\n var nf = near - far;\r\n\r\n // Avoid division by zero\r\n lr = (lr === 0) ? lr : 1 / lr;\r\n bt = (bt === 0) ? bt : 1 / bt;\r\n nf = (nf === 0) ? nf : 1 / nf;\r\n\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a look-at matrix with the given eye position, focal point, and up axis.\r\n *\r\n * @method Phaser.Math.Matrix4#lookAt\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} eye - Position of the viewer\r\n * @param {Phaser.Math.Vector3} center - Point the viewer is looking at\r\n * @param {Phaser.Math.Vector3} up - vec3 pointing up.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n lookAt: function (eye, center, up)\r\n {\r\n var out = this.val;\r\n\r\n var eyex = eye.x;\r\n var eyey = eye.y;\r\n var eyez = eye.z;\r\n\r\n var upx = up.x;\r\n var upy = up.y;\r\n var upz = up.z;\r\n\r\n var centerx = center.x;\r\n var centery = center.y;\r\n var centerz = center.z;\r\n\r\n if (Math.abs(eyex - centerx) < EPSILON &&\r\n Math.abs(eyey - centery) < EPSILON &&\r\n Math.abs(eyez - centerz) < EPSILON)\r\n {\r\n return this.identity();\r\n }\r\n\r\n var z0 = eyex - centerx;\r\n var z1 = eyey - centery;\r\n var z2 = eyez - centerz;\r\n\r\n var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n var x0 = upy * z2 - upz * z1;\r\n var x1 = upz * z0 - upx * z2;\r\n var x2 = upx * z1 - upy * z0;\r\n\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n\r\n if (!len)\r\n {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n var y0 = z1 * x2 - z2 * x1;\r\n var y1 = z2 * x0 - z0 * x2;\r\n var y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n\r\n if (!len)\r\n {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values.\r\n *\r\n * @method Phaser.Math.Matrix4#yawPitchRoll\r\n * @since 3.0.0\r\n *\r\n * @param {number} yaw - [description]\r\n * @param {number} pitch - [description]\r\n * @param {number} roll - [description]\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n yawPitchRoll: function (yaw, pitch, roll)\r\n {\r\n this.zero();\r\n _tempMat1.zero();\r\n _tempMat2.zero();\r\n\r\n var m0 = this.val;\r\n var m1 = _tempMat1.val;\r\n var m2 = _tempMat2.val;\r\n\r\n // Rotate Z\r\n var s = Math.sin(roll);\r\n var c = Math.cos(roll);\r\n\r\n m0[10] = 1;\r\n m0[15] = 1;\r\n m0[0] = c;\r\n m0[1] = s;\r\n m0[4] = -s;\r\n m0[5] = c;\r\n\r\n // Rotate X\r\n s = Math.sin(pitch);\r\n c = Math.cos(pitch);\r\n\r\n m1[0] = 1;\r\n m1[15] = 1;\r\n m1[5] = c;\r\n m1[10] = c;\r\n m1[9] = -s;\r\n m1[6] = s;\r\n\r\n // Rotate Y\r\n s = Math.sin(yaw);\r\n c = Math.cos(yaw);\r\n\r\n m2[5] = 1;\r\n m2[15] = 1;\r\n m2[0] = c;\r\n m2[2] = -s;\r\n m2[8] = s;\r\n m2[10] = c;\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#setWorldMatrix\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix.\r\n * @param {Phaser.Math.Vector3} position - The position of the world matrix.\r\n * @param {Phaser.Math.Vector3} scale - The scale of the world matrix.\r\n * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix.\r\n * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix)\r\n {\r\n this.yawPitchRoll(rotation.y, rotation.x, rotation.z);\r\n\r\n _tempMat1.scaling(scale.x, scale.y, scale.z);\r\n _tempMat2.xyz(position.x, position.y, position.z);\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n if (viewMatrix !== undefined)\r\n {\r\n this.multiplyLocal(viewMatrix);\r\n }\r\n\r\n if (projectionMatrix !== undefined)\r\n {\r\n this.multiplyLocal(projectionMatrix);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nvar _tempMat1 = new Matrix4();\r\nvar _tempMat2 = new Matrix4();\r\n\r\nmodule.exports = Matrix4;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\n\r\n/**\r\n * Convert the given angle in radians, to the equivalent angle in degrees.\r\n *\r\n * @function Phaser.Math.RadToDeg\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The angle in radians to convert ot degrees.\r\n *\r\n * @return {integer} The given angle converted to degrees.\r\n */\r\nvar RadToDeg = function (radians)\r\n{\r\n return radians * CONST.RAD_TO_DEG;\r\n};\r\n\r\nmodule.exports = RadToDeg;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 2D space.\r\n *\r\n * A two-component vector.\r\n *\r\n * @class Vector2\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties.\r\n * @param {number} [y] - The y component.\r\n */\r\nvar Vector2 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector2 (x, y)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n }\r\n else\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector2.\r\n *\r\n * @method Phaser.Math.Vector2#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} A clone of this Vector2.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector2(this.x, this.y);\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x || 0;\r\n this.y = src.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the component values of this Vector from a given Vector2Like object.\r\n *\r\n * @method Phaser.Math.Vector2#setFromObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setFromObject: function (obj)\r\n {\r\n this.x = obj.x || 0;\r\n this.y = obj.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x` and `y` components of the this Vector to the given `x` and `y` values.\r\n *\r\n * @method Phaser.Math.Vector2#set\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n set: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This method is an alias for `Vector2.set`.\r\n *\r\n * @method Phaser.Math.Vector2#setTo\r\n * @since 3.4.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setTo: function (x, y)\r\n {\r\n return this.set(x, y);\r\n },\r\n\r\n /**\r\n * Sets the `x` and `y` values of this object from a given polar coordinate.\r\n *\r\n * @method Phaser.Math.Vector2#setToPolar\r\n * @since 3.0.0\r\n *\r\n * @param {number} azimuth - The angular coordinate, in radians.\r\n * @param {number} [radius=1] - The radial coordinate (length).\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setToPolar: function (azimuth, radius)\r\n {\r\n if (radius == null) { radius = 1; }\r\n\r\n this.x = Math.cos(azimuth) * radius;\r\n this.y = Math.sin(azimuth) * radius;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict equality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector2#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} v - The vector to compare with this Vector.\r\n *\r\n * @return {boolean} Whether the given Vector is equal to this Vector.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y));\r\n },\r\n\r\n /**\r\n * Calculate the angle between this Vector and the positive x-axis, in radians.\r\n *\r\n * @method Phaser.Math.Vector2#angle\r\n * @since 3.0.0\r\n *\r\n * @return {number} The angle between this Vector, and the positive x-axis, given in radians.\r\n */\r\n angle: function ()\r\n {\r\n // computes the angle in radians with respect to the positive x-axis\r\n\r\n var angle = Math.atan2(this.y, this.x);\r\n\r\n if (angle < 0)\r\n {\r\n angle += 2 * Math.PI;\r\n }\r\n\r\n return angle;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#add\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n add: function (src)\r\n {\r\n this.x += src.x;\r\n this.y += src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n subtract: function (src)\r\n {\r\n this.x -= src.x;\r\n this.y -= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n multiply: function (src)\r\n {\r\n this.x *= src.x;\r\n this.y *= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector2#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n scale: function (value)\r\n {\r\n if (isFinite(value))\r\n {\r\n this.x *= value;\r\n this.y *= value;\r\n }\r\n else\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#divide\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n divide: function (src)\r\n {\r\n this.x /= src.x;\r\n this.y /= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Negate the `x` and `y` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#distance\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector2#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return dx * dx + dy * dy;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return Math.sqrt(x * x + y * y);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector2#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return x * x + y * y;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector2#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var len = x * x + y * y;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Right-hand normalize (make unit length) this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#normalizeRightHand\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalizeRightHand: function ()\r\n {\r\n var x = this.x;\r\n\r\n this.x = this.y * -1;\r\n this.y = x;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to dot product with this Vector2.\r\n *\r\n * @return {number} The dot product of this Vector and the given Vector.\r\n */\r\n dot: function (src)\r\n {\r\n return this.x * src.x + this.y * src.y;\r\n },\r\n\r\n /**\r\n * Calculate the cross product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#cross\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to cross with this Vector2.\r\n *\r\n * @return {number} The cross product of this Vector and the given Vector.\r\n */\r\n cross: function (src)\r\n {\r\n return this.x * src.y - this.y * src.x;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n lerp: function (src, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n\r\n this.x = ax + t * (src.x - ax);\r\n this.y = ay + t * (src.y - ay);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat3: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[3] * y + m[6];\r\n this.y = m[1] * x + m[4] * y + m[7];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[12];\r\n this.y = m[1] * x + m[5] * y + m[13];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0).\r\n *\r\n * @method Phaser.Math.Vector2#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A static zero Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ZERO\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.1.0\r\n */\r\nVector2.ZERO = new Vector2();\r\n\r\n/**\r\n * A static right Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.RIGHT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.RIGHT = new Vector2(1, 0);\r\n\r\n/**\r\n * A static left Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.LEFT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.LEFT = new Vector2(-1, 0);\r\n\r\n/**\r\n * A static up Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.UP\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.UP = new Vector2(0, -1);\r\n\r\n/**\r\n * A static down Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.DOWN\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.DOWN = new Vector2(0, 1);\r\n\r\n/**\r\n * A static one Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ONE\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.ONE = new Vector2(1, 1);\r\n\r\nmodule.exports = Vector2;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Wrap the given `value` between `min` and `max.\r\n *\r\n * @function Phaser.Math.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to wrap.\r\n * @param {number} min - The minimum value.\r\n * @param {number} max - The maximum value.\r\n *\r\n * @return {number} The wrapped value.\r\n */\r\nvar Wrap = function (value, min, max)\r\n{\r\n var range = max - min;\r\n\r\n return (min + ((((value - min) % range) + range) % range));\r\n};\r\n\r\nmodule.exports = Wrap;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('../const');\r\n\r\n/**\r\n * Takes an angle in Phasers default clockwise format and converts it so that\r\n * 0 is North, 90 is West, 180 is South and 270 is East,\r\n * therefore running counter-clockwise instead of clockwise.\r\n * \r\n * You can pass in the angle from a Game Object using:\r\n * \r\n * ```javascript\r\n * var converted = CounterClockwise(gameobject.rotation);\r\n * ```\r\n * \r\n * All values for this function are in radians.\r\n *\r\n * @function Phaser.Math.Angle.CounterClockwise\r\n * @since 3.16.0\r\n *\r\n * @param {number} angle - The angle to convert, in radians.\r\n *\r\n * @return {number} The converted angle, in radians.\r\n */\r\nvar CounterClockwise = function (angle)\r\n{\r\n return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2);\r\n};\r\n\r\nmodule.exports = CounterClockwise;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MathWrap = require('../Wrap');\r\n\r\n/**\r\n * Wrap an angle.\r\n *\r\n * Wraps the angle to a value in the range of -PI to PI.\r\n *\r\n * @function Phaser.Math.Angle.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in radians.\r\n *\r\n * @return {number} The wrapped angle, in radians.\r\n */\r\nvar Wrap = function (angle)\r\n{\r\n return MathWrap(angle, -Math.PI, Math.PI);\r\n};\r\n\r\nmodule.exports = Wrap;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Wrap = require('../Wrap');\r\n\r\n/**\r\n * Wrap an angle in degrees.\r\n *\r\n * Wraps the angle to a value in the range of -180 to 180.\r\n *\r\n * @function Phaser.Math.Angle.WrapDegrees\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in degrees.\r\n *\r\n * @return {number} The wrapped angle, in degrees.\r\n */\r\nvar WrapDegrees = function (angle)\r\n{\r\n return Wrap(angle, -180, 180);\r\n};\r\n\r\nmodule.exports = WrapDegrees;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = {\r\n\r\n /**\r\n * The value of PI * 2.\r\n * \r\n * @name Phaser.Math.PI2\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n PI2: Math.PI * 2,\r\n\r\n /**\r\n * The value of PI * 0.5.\r\n * \r\n * @name Phaser.Math.TAU\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n TAU: Math.PI * 0.5,\r\n\r\n /**\r\n * An epsilon value (1.0e-6)\r\n * \r\n * @name Phaser.Math.EPSILON\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n EPSILON: 1.0e-6,\r\n\r\n /**\r\n * For converting degrees to radians (PI / 180)\r\n * \r\n * @name Phaser.Math.DEG_TO_RAD\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n DEG_TO_RAD: Math.PI / 180,\r\n\r\n /**\r\n * For converting radians to degrees (180 / PI)\r\n * \r\n * @name Phaser.Math.RAD_TO_DEG\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n RAD_TO_DEG: 180 / Math.PI,\r\n\r\n /**\r\n * An instance of the Random Number Generator.\r\n * This is not set until the Game boots.\r\n * \r\n * @name Phaser.Math.RND\r\n * @type {Phaser.Math.RandomDataGenerator}\r\n * @since 3.0.0\r\n */\r\n RND: null\r\n\r\n};\r\n\r\nmodule.exports = MATH_CONST;\r\n","/**\r\n* @author Richard Davey \r\n* @copyright 2019 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A Global Plugin is installed just once into the Game owned Plugin Manager.\r\n * It can listen for Game events and respond to them.\r\n *\r\n * @class BasePlugin\r\n * @memberof Phaser.Plugins\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar BasePlugin = new Class({\r\n\r\n initialize:\r\n\r\n function BasePlugin (pluginManager)\r\n {\r\n /**\r\n * A handy reference to the Plugin Manager that is responsible for this plugin.\r\n * Can be used as a route to gain access to game systems and events.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#pluginManager\r\n * @type {Phaser.Plugins.PluginManager}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.pluginManager = pluginManager;\r\n\r\n /**\r\n * A reference to the Game instance this plugin is running under.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#game\r\n * @type {Phaser.Game}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.game = pluginManager.game;\r\n\r\n /**\r\n * A reference to the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You cannot use it during the `init` method, but you can during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#scene\r\n * @type {?Phaser.Scene}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.scene;\r\n\r\n /**\r\n * A reference to the Scene Systems of the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You cannot use it during the `init` method, but you can during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#systems\r\n * @type {?Phaser.Scenes.Systems}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.systems;\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is first instantiated.\r\n * It will never be called again on this instance.\r\n * In here you can set-up whatever you need for this plugin to run.\r\n * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#init\r\n * @since 3.8.0\r\n *\r\n * @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).\r\n */\r\n init: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is started.\r\n * If a plugin is stopped, and then started again, this will get called again.\r\n * Typically called immediately after `BasePlugin.init`.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#start\r\n * @since 3.8.0\r\n */\r\n start: function ()\r\n {\r\n // Here are the game-level events you can listen to.\r\n // At the very least you should offer a destroy handler for when the game closes down.\r\n\r\n // var eventEmitter = this.game.events;\r\n\r\n // eventEmitter.once('destroy', this.gameDestroy, this);\r\n // eventEmitter.on('pause', this.gamePause, this);\r\n // eventEmitter.on('resume', this.gameResume, this);\r\n // eventEmitter.on('resize', this.gameResize, this);\r\n // eventEmitter.on('prestep', this.gamePreStep, this);\r\n // eventEmitter.on('step', this.gameStep, this);\r\n // eventEmitter.on('poststep', this.gamePostStep, this);\r\n // eventEmitter.on('prerender', this.gamePreRender, this);\r\n // eventEmitter.on('postrender', this.gamePostRender, this);\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is stopped.\r\n * The game code has requested that your plugin stop doing whatever it does.\r\n * It is now considered as 'inactive' by the PluginManager.\r\n * Handle that process here (i.e. stop listening for events, etc)\r\n * If the plugin is started again then `BasePlugin.start` will be called again.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#stop\r\n * @since 3.8.0\r\n */\r\n stop: function ()\r\n {\r\n },\r\n\r\n /**\r\n * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots.\r\n * By this point the plugin properties `scene` and `systems` will have already been set.\r\n * In here you can listen for Scene events and set-up whatever you need for this plugin to run.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#boot\r\n * @since 3.8.0\r\n */\r\n boot: function ()\r\n {\r\n // Here are the Scene events you can listen to.\r\n // At the very least you should offer a destroy handler for when the Scene closes down.\r\n\r\n // var eventEmitter = this.systems.events;\r\n\r\n // eventEmitter.once('destroy', this.sceneDestroy, this);\r\n // eventEmitter.on('start', this.sceneStart, this);\r\n // eventEmitter.on('preupdate', this.scenePreUpdate, this);\r\n // eventEmitter.on('update', this.sceneUpdate, this);\r\n // eventEmitter.on('postupdate', this.scenePostUpdate, this);\r\n // eventEmitter.on('pause', this.scenePause, this);\r\n // eventEmitter.on('resume', this.sceneResume, this);\r\n // eventEmitter.on('sleep', this.sceneSleep, this);\r\n // eventEmitter.on('wake', this.sceneWake, this);\r\n // eventEmitter.on('shutdown', this.sceneShutdown, this);\r\n // eventEmitter.on('destroy', this.sceneDestroy, this);\r\n },\r\n\r\n /**\r\n * Game instance has been destroyed.\r\n * You must release everything in here, all references, all objects, free it all up.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#destroy\r\n * @since 3.8.0\r\n */\r\n destroy: function ()\r\n {\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BasePlugin;\r\n","/**\r\n* @author Richard Davey \r\n* @copyright 2019 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar BasePlugin = require('./BasePlugin');\r\nvar Class = require('../utils/Class');\r\nvar SceneEvents = require('../scene/events');\r\n\r\n/**\r\n * @classdesc\r\n * A Scene Level Plugin is installed into every Scene and belongs to that Scene.\r\n * It can listen for Scene events and respond to them.\r\n * It can map itself to a Scene property, or into the Scene Systems, or both.\r\n *\r\n * @class ScenePlugin\r\n * @memberof Phaser.Plugins\r\n * @extends Phaser.Plugins.BasePlugin\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar ScenePlugin = new Class({\r\n\r\n Extends: BasePlugin,\r\n\r\n initialize:\r\n\r\n function ScenePlugin (scene, pluginManager)\r\n {\r\n BasePlugin.call(this, pluginManager);\r\n\r\n this.scene = scene;\r\n this.systems = scene.sys;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * This method is called when the Scene boots. It is only ever called once.\r\n * \r\n * By this point the plugin properties `scene` and `systems` will have already been set.\r\n * \r\n * In here you can listen for Scene events and set-up whatever you need for this plugin to run.\r\n * Here are the Scene events you can listen to:\r\n * \r\n * start\r\n * ready\r\n * preupdate\r\n * update\r\n * postupdate\r\n * resize\r\n * pause\r\n * resume\r\n * sleep\r\n * wake\r\n * transitioninit\r\n * transitionstart\r\n * transitioncomplete\r\n * transitionout\r\n * shutdown\r\n * destroy\r\n * \r\n * At the very least you should offer a destroy handler for when the Scene closes down, i.e:\r\n *\r\n * ```javascript\r\n * var eventEmitter = this.systems.events;\r\n * eventEmitter.once('destroy', this.sceneDestroy, this);\r\n * ```\r\n *\r\n * @method Phaser.Plugins.ScenePlugin#boot\r\n * @since 3.8.0\r\n */\r\n boot: function ()\r\n {\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ScenePlugin;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Blend Modes.\r\n * \r\n * @namespace Phaser.BlendModes\r\n * @since 3.0.0\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * Skips the Blend Mode check in the renderer.\r\n * \r\n * @name Phaser.BlendModes.SKIP_CHECK\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SKIP_CHECK: -1,\r\n\r\n /**\r\n * Normal blend mode. For Canvas and WebGL.\r\n * This is the default setting and draws new shapes on top of the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.NORMAL\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n NORMAL: 0,\r\n\r\n /**\r\n * Add blend mode. For Canvas and WebGL.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.ADD\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ADD: 1,\r\n\r\n /**\r\n * Multiply blend mode. For Canvas and WebGL.\r\n * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result.\r\n * \r\n * @name Phaser.BlendModes.MULTIPLY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n MULTIPLY: 2,\r\n\r\n /**\r\n * Screen blend mode. For Canvas and WebGL.\r\n * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply)\r\n * \r\n * @name Phaser.BlendModes.SCREEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SCREEN: 3,\r\n\r\n /**\r\n * Overlay blend mode. For Canvas only.\r\n * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter.\r\n * \r\n * @name Phaser.BlendModes.OVERLAY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n OVERLAY: 4,\r\n\r\n /**\r\n * Darken blend mode. For Canvas only.\r\n * Retains the darkest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.DARKEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DARKEN: 5,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Retains the lightest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.LIGHTEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTEN: 6,\r\n\r\n /**\r\n * Color Dodge blend mode. For Canvas only.\r\n * Divides the bottom layer by the inverted top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR_DODGE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_DODGE: 7,\r\n\r\n /**\r\n * Color Burn blend mode. For Canvas only.\r\n * Divides the inverted bottom layer by the top layer, and then inverts the result.\r\n * \r\n * @name Phaser.BlendModes.COLOR_BURN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_BURN: 8,\r\n\r\n /**\r\n * Hard Light blend mode. For Canvas only.\r\n * A combination of multiply and screen like overlay, but with top and bottom layer swapped.\r\n * \r\n * @name Phaser.BlendModes.HARD_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HARD_LIGHT: 9,\r\n\r\n /**\r\n * Soft Light blend mode. For Canvas only.\r\n * A softer version of hard-light. Pure black or white does not result in pure black or white.\r\n * \r\n * @name Phaser.BlendModes.SOFT_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOFT_LIGHT: 10,\r\n\r\n /**\r\n * Difference blend mode. For Canvas only.\r\n * Subtracts the bottom layer from the top layer or the other way round to always get a positive value.\r\n * \r\n * @name Phaser.BlendModes.DIFFERENCE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DIFFERENCE: 11,\r\n\r\n /**\r\n * Exclusion blend mode. For Canvas only.\r\n * Like difference, but with lower contrast.\r\n * \r\n * @name Phaser.BlendModes.EXCLUSION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n EXCLUSION: 12,\r\n\r\n /**\r\n * Hue blend mode. For Canvas only.\r\n * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.\r\n * \r\n * @name Phaser.BlendModes.HUE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HUE: 13,\r\n\r\n /**\r\n * Saturation blend mode. For Canvas only.\r\n * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.SATURATION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SATURATION: 14,\r\n\r\n /**\r\n * Color blend mode. For Canvas only.\r\n * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR: 15,\r\n\r\n /**\r\n * Luminosity blend mode. For Canvas only.\r\n * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.LUMINOSITY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LUMINOSITY: 16,\r\n\r\n /**\r\n * Alpha erase blend mode. For Canvas and WebGL.\r\n * \r\n * @name Phaser.BlendModes.ERASE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ERASE: 17,\r\n\r\n /**\r\n * Source-in blend mode. For Canvas only.\r\n * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_IN: 18,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is drawn where it doesn't overlap the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_OUT: 19,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is only drawn where it overlaps the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_ATOP: 20,\r\n\r\n /**\r\n * Destination-over blend mode. For Canvas only.\r\n * New shapes are drawn behind the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OVER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OVER: 21,\r\n\r\n /**\r\n * Destination-in blend mode. For Canvas only.\r\n * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_IN: 22,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing content is kept where it doesn't overlap the new shape.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OUT: 23,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_ATOP: 24,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.LIGHTER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTER: 25,\r\n\r\n /**\r\n * Copy blend mode. For Canvas only.\r\n * Only the new shape is shown.\r\n * \r\n * @name Phaser.BlendModes.COPY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COPY: 26,\r\n\r\n /**\r\n * Xor blend mode. For Canvas only.\r\n * Shapes are made transparent where both overlap and drawn normal everywhere else.\r\n * \r\n * @name Phaser.BlendModes.XOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n XOR: 27\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix\r\n * and then performs the following steps:\r\n * \r\n * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts.\r\n * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given.\r\n * 3. Sets the blend mode of the context to be that used by the Game Object.\r\n * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera.\r\n * 5. Saves the context state.\r\n * 6. Sets the final matrix values into the context via setTransform.\r\n * \r\n * This function is only meant to be used internally. Most of the Canvas Renderer classes use it.\r\n *\r\n * @function Phaser.Renderer.Canvas.SetTransform\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {CanvasRenderingContext2D} ctx - The canvas context to set the transform on.\r\n * @param {Phaser.GameObjects.GameObject} src - The Game Object being rendered. Can be any type that extends the base class.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A parent transform matrix to apply to the Game Object before rendering.\r\n * \r\n * @return {boolean} `true` if the Game Object context was set, otherwise `false`.\r\n */\r\nvar SetTransform = function (renderer, ctx, src, camera, parentMatrix)\r\n{\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (alpha <= 0)\r\n {\r\n // Nothing to see, so don't waste time calculating stuff\r\n return false;\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1.copyFromArray(camera.matrix.matrix);\r\n var gameObjectMatrix = renderer._tempMatrix2.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n gameObjectMatrix.e = src.x;\r\n gameObjectMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(gameObjectMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n gameObjectMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n gameObjectMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(gameObjectMatrix, calcMatrix);\r\n }\r\n\r\n // Blend Mode\r\n ctx.globalCompositeOperation = renderer.blendModes[src.blendMode];\r\n\r\n // Alpha\r\n ctx.globalAlpha = alpha;\r\n\r\n ctx.save();\r\n\r\n calcMatrix.setToContext(ctx);\r\n\r\n return true;\r\n};\r\n\r\nmodule.exports = SetTransform;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Boot Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('boot', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#BOOT\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'boot';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Create Event.\r\n * \r\n * This event is dispatched by a Scene after it has been created by the Scene Manager.\r\n * \r\n * If a Scene has a `create` method then this event is emitted _after_ that has run.\r\n * \r\n * If there is a transition, this event will be fired after the `TRANSITION_START` event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('create', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#CREATE\r\n * @since 3.17.0\r\n * \r\n * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event.\r\n */\r\nmodule.exports = 'create';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Destroy Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems destroy process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('destroy', listener)`.\r\n * \r\n * You should destroy any resources that may be in use by your Scene in this event handler.\r\n * \r\n * @event Phaser.Scenes.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pause Event.\r\n * \r\n * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an\r\n * action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('pause', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#PAUSE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was paused.\r\n */\r\nmodule.exports = 'pause';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Post Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#POST_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'postupdate';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pre Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#PRE_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'preupdate';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Ready Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process.\r\n * By this point in the process the Scene is now fully active and rendering.\r\n * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('ready', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#READY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was started.\r\n */\r\nmodule.exports = 'ready';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Render Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('render', listener)`.\r\n * \r\n * A Scene will only render if it is visible and active.\r\n * By the time this event is dispatched, the Scene will have already been rendered.\r\n * \r\n * @event Phaser.Scenes.Events#RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene.\r\n */\r\nmodule.exports = 'render';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Resume Event.\r\n * \r\n * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('resume', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#RESUME\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed.\r\n */\r\nmodule.exports = 'resume';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Shutdown Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems shutdown process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('shutdown', listener)`.\r\n * \r\n * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding\r\n * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not\r\n * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources.\r\n * \r\n * @event Phaser.Scenes.Events#SHUTDOWN\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown.\r\n */\r\nmodule.exports = 'shutdown';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Sleep Event.\r\n * \r\n * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('sleep', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#SLEEP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep.\r\n */\r\nmodule.exports = 'sleep';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Start Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('start', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Complete Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration\r\n * of the transition.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioncomplete', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_COMPLETE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} scene -The Scene on which the transitioned completed.\r\n */\r\nmodule.exports = 'transitioncomplete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Init Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method,\r\n * this event is not dispatched.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioninit', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_INIT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitioninit';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Out Event.\r\n * \r\n * This event is dispatched by a Scene when it initiates a transition to another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionout', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_OUT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionout';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Start Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep.\r\n * \r\n * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method,\r\n * this event is dispatched anyway.\r\n * \r\n * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is\r\n * dispatched instead of this event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionstart', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_START\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionstart';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Wake Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before\r\n * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionwake', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_WAKE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionwake';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('update', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'update';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Wake Event.\r\n * \r\n * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('wake', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#WAKE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up.\r\n */\r\nmodule.exports = 'wake';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Scenes.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BOOT: require('./BOOT_EVENT'),\r\n CREATE: require('./CREATE_EVENT'),\r\n DESTROY: require('./DESTROY_EVENT'),\r\n PAUSE: require('./PAUSE_EVENT'),\r\n POST_UPDATE: require('./POST_UPDATE_EVENT'),\r\n PRE_UPDATE: require('./PRE_UPDATE_EVENT'),\r\n READY: require('./READY_EVENT'),\r\n RENDER: require('./RENDER_EVENT'),\r\n RESUME: require('./RESUME_EVENT'),\r\n SHUTDOWN: require('./SHUTDOWN_EVENT'),\r\n SLEEP: require('./SLEEP_EVENT'),\r\n START: require('./START_EVENT'),\r\n TRANSITION_COMPLETE: require('./TRANSITION_COMPLETE_EVENT'),\r\n TRANSITION_INIT: require('./TRANSITION_INIT_EVENT'),\r\n TRANSITION_OUT: require('./TRANSITION_OUT_EVENT'),\r\n TRANSITION_START: require('./TRANSITION_START_EVENT'),\r\n TRANSITION_WAKE: require('./TRANSITION_WAKE_EVENT'),\r\n UPDATE: require('./UPDATE_EVENT'),\r\n WAKE: require('./WAKE_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Taken from klasse by mattdesl https://github.com/mattdesl/klasse\r\n\r\nfunction hasGetterOrSetter (def)\r\n{\r\n return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function');\r\n}\r\n\r\nfunction getProperty (definition, k, isClassDescriptor)\r\n{\r\n // This may be a lightweight object, OR it might be a property that was defined previously.\r\n\r\n // For simple class descriptors we can just assume its NOT previously defined.\r\n var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k);\r\n\r\n if (!isClassDescriptor && def.value && typeof def.value === 'object')\r\n {\r\n def = def.value;\r\n }\r\n\r\n // This might be a regular property, or it may be a getter/setter the user defined in a class.\r\n if (def && hasGetterOrSetter(def))\r\n {\r\n if (typeof def.enumerable === 'undefined')\r\n {\r\n def.enumerable = true;\r\n }\r\n\r\n if (typeof def.configurable === 'undefined')\r\n {\r\n def.configurable = true;\r\n }\r\n\r\n return def;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n}\r\n\r\nfunction hasNonConfigurable (obj, k)\r\n{\r\n var prop = Object.getOwnPropertyDescriptor(obj, k);\r\n\r\n if (!prop)\r\n {\r\n return false;\r\n }\r\n\r\n if (prop.value && typeof prop.value === 'object')\r\n {\r\n prop = prop.value;\r\n }\r\n\r\n if (prop.configurable === false)\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Extends the given `myClass` object's prototype with the properties of `definition`.\r\n *\r\n * @function extend\r\n * @param {Object} ctor The constructor object to mix into.\r\n * @param {Object} definition A dictionary of functions for the class.\r\n * @param {boolean} isClassDescriptor Is the definition a class descriptor?\r\n * @param {Object} [extend] The parent constructor object.\r\n */\r\nfunction extend (ctor, definition, isClassDescriptor, extend)\r\n{\r\n for (var k in definition)\r\n {\r\n if (!definition.hasOwnProperty(k))\r\n {\r\n continue;\r\n }\r\n\r\n var def = getProperty(definition, k, isClassDescriptor);\r\n\r\n if (def !== false)\r\n {\r\n // If Extends is used, we will check its prototype to see if the final variable exists.\r\n\r\n var parent = extend || ctor;\r\n\r\n if (hasNonConfigurable(parent.prototype, k))\r\n {\r\n // Just skip the final property\r\n if (Class.ignoreFinals)\r\n {\r\n continue;\r\n }\r\n\r\n // We cannot re-define a property that is configurable=false.\r\n // So we will consider them final and throw an error. This is by\r\n // default so it is clear to the developer what is happening.\r\n // You can set ignoreFinals to true if you need to extend a class\r\n // which has configurable=false; it will simply not re-define final properties.\r\n throw new Error('cannot override final property \\'' + k + '\\', set Class.ignoreFinals = true to skip');\r\n }\r\n\r\n Object.defineProperty(ctor.prototype, k, def);\r\n }\r\n else\r\n {\r\n ctor.prototype[k] = definition[k];\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Applies the given `mixins` to the prototype of `myClass`.\r\n *\r\n * @function mixin\r\n * @param {Object} myClass The constructor object to mix into.\r\n * @param {Object|Array} mixins The mixins to apply to the constructor.\r\n */\r\nfunction mixin (myClass, mixins)\r\n{\r\n if (!mixins)\r\n {\r\n return;\r\n }\r\n\r\n if (!Array.isArray(mixins))\r\n {\r\n mixins = [ mixins ];\r\n }\r\n\r\n for (var i = 0; i < mixins.length; i++)\r\n {\r\n extend(myClass, mixins[i].prototype || mixins[i]);\r\n }\r\n}\r\n\r\n/**\r\n * Creates a new class with the given descriptor.\r\n * The constructor, defined by the name `initialize`,\r\n * is an optional function. If unspecified, an anonymous\r\n * function will be used which calls the parent class (if\r\n * one exists).\r\n *\r\n * You can also use `Extends` and `Mixins` to provide subclassing\r\n * and inheritance.\r\n *\r\n * @class Phaser.Class\r\n * @constructor\r\n * @param {Object} definition a dictionary of functions for the class\r\n * @example\r\n *\r\n * var MyClass = new Phaser.Class({\r\n *\r\n * initialize: function() {\r\n * this.foo = 2.0;\r\n * },\r\n *\r\n * bar: function() {\r\n * return this.foo + 5;\r\n * }\r\n * });\r\n */\r\nfunction Class (definition)\r\n{\r\n if (!definition)\r\n {\r\n definition = {};\r\n }\r\n\r\n // The variable name here dictates what we see in Chrome debugger\r\n var initialize;\r\n var Extends;\r\n\r\n if (definition.initialize)\r\n {\r\n if (typeof definition.initialize !== 'function')\r\n {\r\n throw new Error('initialize must be a function');\r\n }\r\n\r\n initialize = definition.initialize;\r\n\r\n // Usually we should avoid 'delete' in V8 at all costs.\r\n // However, its unlikely to make any performance difference\r\n // here since we only call this on class creation (i.e. not object creation).\r\n delete definition.initialize;\r\n }\r\n else if (definition.Extends)\r\n {\r\n var base = definition.Extends;\r\n\r\n initialize = function ()\r\n {\r\n base.apply(this, arguments);\r\n };\r\n }\r\n else\r\n {\r\n initialize = function () {};\r\n }\r\n\r\n if (definition.Extends)\r\n {\r\n initialize.prototype = Object.create(definition.Extends.prototype);\r\n initialize.prototype.constructor = initialize;\r\n\r\n // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin)\r\n\r\n Extends = definition.Extends;\r\n\r\n delete definition.Extends;\r\n }\r\n else\r\n {\r\n initialize.prototype.constructor = initialize;\r\n }\r\n\r\n // Grab the mixins, if they are specified...\r\n var mixins = null;\r\n\r\n if (definition.Mixins)\r\n {\r\n mixins = definition.Mixins;\r\n delete definition.Mixins;\r\n }\r\n\r\n // First, mixin if we can.\r\n mixin(initialize, mixins);\r\n\r\n // Now we grab the actual definition which defines the overrides.\r\n extend(initialize, definition, true, Extends);\r\n\r\n return initialize;\r\n}\r\n\r\nClass.extend = extend;\r\nClass.mixin = mixin;\r\nClass.ignoreFinals = false;\r\n\r\nmodule.exports = Class;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A NOOP (No Operation) callback function.\r\n *\r\n * Used internally by Phaser when it's more expensive to determine if a callback exists\r\n * than it is to just invoke an empty function.\r\n *\r\n * @function Phaser.Utils.NOOP\r\n * @since 3.0.0\r\n */\r\nvar NOOP = function ()\r\n{\r\n // NOOP\r\n};\r\n\r\nmodule.exports = NOOP;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar IsPlainObject = require('./IsPlainObject');\r\n\r\n// @param {boolean} deep - Perform a deep copy?\r\n// @param {object} target - The target object to copy to.\r\n// @return {object} The extended object.\r\n\r\n/**\r\n * This is a slightly modified version of http://api.jquery.com/jQuery.extend/\r\n *\r\n * @function Phaser.Utils.Objects.Extend\r\n * @since 3.0.0\r\n *\r\n * @return {object} The extended object.\r\n */\r\nvar Extend = function ()\r\n{\r\n var options, name, src, copy, copyIsArray, clone,\r\n target = arguments[0] || {},\r\n i = 1,\r\n length = arguments.length,\r\n deep = false;\r\n\r\n // Handle a deep copy situation\r\n if (typeof target === 'boolean')\r\n {\r\n deep = target;\r\n target = arguments[1] || {};\r\n\r\n // skip the boolean and the target\r\n i = 2;\r\n }\r\n\r\n // extend Phaser if only one argument is passed\r\n if (length === i)\r\n {\r\n target = this;\r\n --i;\r\n }\r\n\r\n for (; i < length; i++)\r\n {\r\n // Only deal with non-null/undefined values\r\n if ((options = arguments[i]) != null)\r\n {\r\n // Extend the base object\r\n for (name in options)\r\n {\r\n src = target[name];\r\n copy = options[name];\r\n\r\n // Prevent never-ending loop\r\n if (target === copy)\r\n {\r\n continue;\r\n }\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy))))\r\n {\r\n if (copyIsArray)\r\n {\r\n copyIsArray = false;\r\n clone = src && Array.isArray(src) ? src : [];\r\n }\r\n else\r\n {\r\n clone = src && IsPlainObject(src) ? src : {};\r\n }\r\n\r\n // Never move original objects, clone them\r\n target[name] = Extend(deep, clone, copy);\r\n\r\n // Don't bring in undefined values\r\n }\r\n else if (copy !== undefined)\r\n {\r\n target[name] = copy;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Return the modified object\r\n return target;\r\n};\r\n\r\nmodule.exports = Extend;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue}\r\n *\r\n * @function Phaser.Utils.Objects.GetFastValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to search\r\n * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods)\r\n * @param {*} [defaultValue] - The default value to use if the key does not exist.\r\n *\r\n * @return {*} The value if found; otherwise, defaultValue (null if none provided)\r\n */\r\nvar GetFastValue = function (source, key, defaultValue)\r\n{\r\n var t = typeof(source);\r\n\r\n if (!source || t === 'number' || t === 'string')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key) && source[key] !== undefined)\r\n {\r\n return source[key];\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetFastValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Source object\r\n// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner'\r\n// The default value to use if the key doesn't exist\r\n\r\n/**\r\n * Retrieves a value from an object.\r\n *\r\n * @function Phaser.Utils.Objects.GetValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @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.\r\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\r\n *\r\n * @return {*} The value of the requested key.\r\n */\r\nvar GetValue = function (source, key, defaultValue)\r\n{\r\n if (!source || typeof source === 'number')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key))\r\n {\r\n return source[key];\r\n }\r\n else if (key.indexOf('.') !== -1)\r\n {\r\n var keys = key.split('.');\r\n var parent = source;\r\n var value = defaultValue;\r\n\r\n // Use for loop here so we can break early\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n if (parent.hasOwnProperty(keys[i]))\r\n {\r\n // Yes it has a key property, let's carry on down\r\n value = parent[keys[i]];\r\n\r\n parent = parent[keys[i]];\r\n }\r\n else\r\n {\r\n // Can't go any further, so reset to default\r\n value = defaultValue;\r\n break;\r\n }\r\n }\r\n\r\n return value;\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * This is a slightly modified version of jQuery.isPlainObject.\r\n * A plain object is an object whose internal class property is [object Object].\r\n *\r\n * @function Phaser.Utils.Objects.IsPlainObject\r\n * @since 3.0.0\r\n *\r\n * @param {object} obj - The object to inspect.\r\n *\r\n * @return {boolean} `true` if the object is plain, otherwise `false`.\r\n */\r\nvar IsPlainObject = function (obj)\r\n{\r\n // Not plain objects:\r\n // - Any object or value whose internal [[Class]] property is not \"[object Object]\"\r\n // - DOM nodes\r\n // - window\r\n if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window)\r\n {\r\n return false;\r\n }\r\n\r\n // Support: Firefox <20\r\n // The try/catch suppresses exceptions thrown when attempting to access\r\n // the \"constructor\" property of certain host objects, ie. |window.location|\r\n // https://bugzilla.mozilla.org/show_bug.cgi?id=814622\r\n try\r\n {\r\n if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf'))\r\n {\r\n return false;\r\n }\r\n }\r\n catch (e)\r\n {\r\n return false;\r\n }\r\n\r\n // If the function hasn't returned already, we're confident that\r\n // |obj| is a plain object, created by {} or constructed with new Object\r\n return true;\r\n};\r\n\r\nmodule.exports = IsPlainObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = require('../../../src/utils/Class');\r\nvar GetFastValue = require('../../../src/utils/object/GetFastValue');\r\nvar ImageFile = require('../../../src/loader/filetypes/ImageFile.js');\r\nvar IsPlainObject = require('../../../src/utils/object/IsPlainObject');\r\nvar JSONFile = require('../../../src/loader/filetypes/JSONFile.js');\r\nvar MultiFile = require('../../../src/loader/MultiFile.js');\r\nvar TextFile = require('../../../src/loader/filetypes/TextFile.js');\r\n\r\n/**\r\n * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig\r\n *\r\n * @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager.\r\n * @property {string} [textureURL] - The absolute or relative URL to load the texture image file from.\r\n * @property {string} [textureExtension='png'] - The default file extension to use for the image texture if no url is provided.\r\n * @property {XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture image file.\r\n * @property {string} [normalMap] - The filename of an associated normal map. It uses the same path and url to load as the texture image.\r\n * @property {string} [atlasURL] - The absolute or relative URL to load the atlas data file from.\r\n * @property {string} [atlasExtension='txt'] - The default file extension to use for the atlas data if no url is provided.\r\n * @property {XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas data file.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * A Spine File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#spine method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spine.\r\n *\r\n * @class SpineFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Loader.FileTypes.UnityAtlasFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image 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\".\r\n * @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\".\r\n * @param {XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.\r\n */\r\nvar SpineFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function SpineFile (loader, key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings)\r\n {\r\n var json;\r\n var atlas;\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n\r\n json = new JSONFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'jsonURL'),\r\n extension: GetFastValue(config, 'jsonExtension', 'json'),\r\n xhrSettings: GetFastValue(config, 'jsonXhrSettings')\r\n });\r\n\r\n atlas = new TextFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'atlasURL'),\r\n extension: GetFastValue(config, 'atlasExtension', 'atlas'),\r\n xhrSettings: GetFastValue(config, 'atlasXhrSettings')\r\n });\r\n }\r\n else\r\n {\r\n json = new JSONFile(loader, key, jsonURL, jsonXhrSettings);\r\n atlas = new TextFile(loader, key, atlasURL, atlasXhrSettings);\r\n }\r\n \r\n atlas.cache = loader.cacheManager.custom.spine;\r\n\r\n MultiFile.call(this, loader, 'spine', key, [ json, atlas ]);\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileComplete\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n\r\n if (file.type === 'text')\r\n {\r\n // Inspect the data for the files to now load\r\n var content = file.data.split('\\n');\r\n\r\n // Extract the textures\r\n var textures = [];\r\n\r\n for (var t = 0; t < content.length; t++)\r\n {\r\n var line = content[t];\r\n\r\n if (line.trim() === '' && t < content.length - 1)\r\n {\r\n line = content[t + 1];\r\n\r\n textures.push(line);\r\n }\r\n }\r\n\r\n var config = this.config;\r\n var loader = this.loader;\r\n\r\n var currentBaseURL = loader.baseURL;\r\n var currentPath = loader.path;\r\n var currentPrefix = loader.prefix;\r\n\r\n var baseURL = GetFastValue(config, 'baseURL', currentBaseURL);\r\n var path = GetFastValue(config, 'path', currentPath);\r\n var prefix = GetFastValue(config, 'prefix', currentPrefix);\r\n var textureXhrSettings = GetFastValue(config, 'textureXhrSettings');\r\n\r\n loader.setBaseURL(baseURL);\r\n loader.setPath(path);\r\n loader.setPrefix(prefix);\r\n\r\n for (var i = 0; i < textures.length; i++)\r\n {\r\n var textureURL = textures[i];\r\n\r\n var key = '_SP_' + textureURL;\r\n\r\n var image = new ImageFile(loader, key, textureURL, textureXhrSettings);\r\n\r\n this.addToMultiFile(image);\r\n\r\n loader.addFile(image);\r\n }\r\n\r\n // Reset the loader settings\r\n loader.setBaseURL(currentBaseURL);\r\n loader.setPath(currentPath);\r\n loader.setPrefix(currentPrefix);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.SpineFile#addToCache\r\n * @since 3.16.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n var fileJSON = this.files[0];\r\n\r\n fileJSON.addToCache();\r\n\r\n var fileText = this.files[1];\r\n\r\n fileText.addToCache();\r\n\r\n for (var i = 2; i < this.files.length; i++)\r\n {\r\n var file = this.files[i];\r\n\r\n var key = file.key.substr(4).trim();\r\n\r\n this.loader.textureManager.addImage(key, file.data);\r\n\r\n file.pendingDestroy();\r\n }\r\n\r\n this.complete = true;\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Unity YAML based Texture Atlas, or array of atlases, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.txt');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n *\r\n * Phaser expects the atlas data to be provided in a YAML formatted text file as exported from Unity.\r\n * \r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.unityAtlas({\r\n * key: 'mainmenu',\r\n * textureURL: 'images/MainMenu.png',\r\n * atlasURL: 'images/MainMenu.txt'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Loader.FileTypes.SpineFileConfig` for more details.\r\n *\r\n * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'mainmenu', 'background');\r\n * ```\r\n *\r\n * To get a list of all available frames within an atlas please consult your Texture Atlas software.\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n * \r\n * ```javascript\r\n * this.load.unityAtlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.txt');\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n * \r\n * ```javascript\r\n * this.load.unityAtlas({\r\n * key: 'mainmenu',\r\n * textureURL: 'images/MainMenu.png',\r\n * normalMap: 'images/MainMenu-n.png',\r\n * atlasURL: 'images/MainMenu.txt'\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Unity Atlas File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#spine\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.16.0\r\n *\r\n * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig|Phaser.Loader.FileTypes.SpineFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image 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\".\r\n * @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\".\r\n * @param {XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\nFileTypesManager.register('spine', function (key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings)\r\n{\r\n var multifile;\r\n\r\n // Supports an Object file definition in the key argument\r\n // Or an array of objects in the key argument\r\n // Or a single entry where all arguments have been defined\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new SpineFile(this, key[i]);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new SpineFile(this, key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n\r\n return this;\r\n});\r\n */\r\n\r\nmodule.exports = SpineFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = require('../../../src/utils/Class');\r\nvar GetValue = require('../../../src/utils/object/GetValue');\r\nvar ScenePlugin = require('../../../src/plugins/ScenePlugin');\r\nvar SpineFile = require('./SpineFile');\r\nvar Spine = require('Spine');\r\nvar SpineGameObject = require('./gameobject/SpineGameObject');\r\nvar Matrix4 = require('../../../src/math/Matrix4');\r\n\r\n/**\r\n * @classdesc\r\n * TODO\r\n *\r\n * @class SpinePlugin\r\n * @extends Phaser.Plugins.ScenePlugin\r\n * @constructor\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Phaser Plugin Manager.\r\n */\r\nvar SpinePlugin = new Class({\r\n\r\n Extends: ScenePlugin,\r\n\r\n initialize:\r\n\r\n function SpinePlugin (scene, pluginManager)\r\n {\r\n ScenePlugin.call(this, scene, pluginManager);\r\n\r\n var game = pluginManager.game;\r\n\r\n this.isWebGL = (game.config.renderType === 2);\r\n\r\n // Create a custom cache to store the spine data (.atlas files)\r\n this.cache = game.cache.addCustom('spine');\r\n\r\n this.spineTextures = game.cache.addCustom('spineTextures');\r\n\r\n this.json = game.cache.json;\r\n\r\n this.textures = game.textures;\r\n\r\n this.skeletonRenderer;\r\n\r\n this.drawDebug = false;\r\n\r\n this.gl;\r\n this.mvp;\r\n this.shader;\r\n this.batcher;\r\n this.debugRenderer;\r\n this.debugShader;\r\n\r\n console.log('SpinePlugin created', '- WebGL:', this.isWebGL);\r\n\r\n if (this.isWebGL)\r\n {\r\n this.runtime = Spine.webgl;\r\n\r\n this.gl = game.renderer.gl;\r\n\r\n this.getAtlas = this.getAtlasWebGL;\r\n }\r\n else\r\n {\r\n this.runtime = Spine.canvas;\r\n\r\n this.getAtlas = this.getAtlasCanvas;\r\n }\r\n\r\n // Register our file type\r\n pluginManager.registerFileType('spine', this.spineFileCallback, scene);\r\n\r\n // Register our game object\r\n pluginManager.registerGameObject('spine', this.createSpineFactory(this));\r\n },\r\n\r\n boot: function ()\r\n {\r\n if (this.isWebGL)\r\n {\r\n this.bootWebGL();\r\n }\r\n else\r\n {\r\n this.bootCanvas();\r\n }\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.once('shutdown', this.shutdown, this);\r\n eventEmitter.once('destroy', this.destroy, this);\r\n },\r\n\r\n bootCanvas: function ()\r\n {\r\n this.skeletonRenderer = new this.runtime.SkeletonRenderer(this.scene.sys.context);\r\n },\r\n\r\n getAtlasCanvas: function (key)\r\n {\r\n var atlasData = this.cache.get(key);\r\n\r\n if (!atlasData)\r\n {\r\n console.warn('No atlas data for: ' + key);\r\n return;\r\n }\r\n\r\n var atlas;\r\n var spineTextures = this.spineTextures;\r\n\r\n if (spineTextures.has(key))\r\n {\r\n atlas = new Spine.TextureAtlas(atlasData, function ()\r\n {\r\n return spineTextures.get(key);\r\n });\r\n }\r\n else\r\n {\r\n var textures = this.textures;\r\n\r\n atlas = new Spine.TextureAtlas(atlasData, function (path)\r\n {\r\n var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage());\r\n\r\n spineTextures.add(key, canvasTexture);\r\n\r\n return canvasTexture;\r\n });\r\n }\r\n\r\n return atlas;\r\n },\r\n\r\n bootWebGL: function ()\r\n {\r\n var gl = this.gl;\r\n var runtime = this.runtime;\r\n\r\n this.mvp = new Matrix4();\r\n\r\n // Create a simple shader, mesh, model-view-projection matrix and SkeletonRenderer.\r\n this.shader = runtime.Shader.newTwoColoredTextured(gl);\r\n this.batcher = new runtime.PolygonBatcher(gl);\r\n\r\n this.skeletonRenderer = new runtime.SkeletonRenderer(gl);\r\n\r\n this.shapes = new runtime.ShapeRenderer(gl);\r\n\r\n this.debugRenderer = new runtime.SkeletonDebugRenderer(gl);\r\n\r\n this.debugShader = runtime.Shader.newColored(gl);\r\n },\r\n\r\n getAtlasWebGL: function (key)\r\n {\r\n var atlasData = this.cache.get(key);\r\n\r\n if (!atlasData)\r\n {\r\n console.warn('No atlas data for: ' + key);\r\n return;\r\n }\r\n\r\n var atlas;\r\n var spineTextures = this.spineTextures;\r\n\r\n if (spineTextures.has(key))\r\n {\r\n atlas = new Spine.TextureAtlas(atlasData, function ()\r\n {\r\n return spineTextures.get(key);\r\n });\r\n }\r\n else\r\n {\r\n var textures = this.textures;\r\n\r\n var gl = this.gl;\r\n\r\n atlas = new Spine.TextureAtlas(atlasData, function (path)\r\n {\r\n var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage());\r\n\r\n spineTextures.add(key, glTexture);\r\n\r\n return glTexture;\r\n });\r\n }\r\n\r\n return atlas;\r\n },\r\n\r\n spineFileCallback: function (key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings)\r\n {\r\n var multifile;\r\n \r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new SpineFile(this, key[i]);\r\n \r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new SpineFile(this, key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n \r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a new Spine Game Object and adds it to the Scene.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#spineFactory\r\n * @since 3.16.0\r\n * \r\n * @param {number} x - The horizontal position of this Game Object.\r\n * @param {number} y - The vertical position of this Game Object.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.GameObjects.Spine} The Game Object that was created.\r\n */\r\n createSpineFactory: function (plugin)\r\n {\r\n var callback = function (x, y, key, animationName, loop)\r\n {\r\n var spineGO = new SpineGameObject(this.scene, plugin, x, y, key, animationName, loop);\r\n\r\n this.displayList.add(spineGO);\r\n this.updateList.add(spineGO);\r\n \r\n return spineGO;\r\n };\r\n\r\n return callback;\r\n },\r\n\r\n getRuntime: function ()\r\n {\r\n return this.runtime;\r\n },\r\n\r\n createSkeleton: function (key, skeletonJSON)\r\n {\r\n var atlasKey = key;\r\n var jsonKey = key;\r\n\r\n if (key.indexOf('.'))\r\n {\r\n var parts = key.split('.');\r\n\r\n atlasKey = parts.shift();\r\n jsonKey = parts.join('.');\r\n }\r\n\r\n var atlas = this.getAtlas(atlasKey);\r\n\r\n var atlasLoader = new Spine.AtlasAttachmentLoader(atlas);\r\n \r\n var skeletonJson = new Spine.SkeletonJson(atlasLoader);\r\n\r\n var data;\r\n\r\n if (skeletonJSON)\r\n {\r\n data = skeletonJSON;\r\n }\r\n else\r\n {\r\n var json = this.json.get(atlasKey);\r\n\r\n data = GetValue(json, jsonKey);\r\n }\r\n\r\n var skeletonData = skeletonJson.readSkeletonData(data);\r\n\r\n var skeleton = new Spine.Skeleton(skeletonData);\r\n \r\n return { skeletonData: skeletonData, skeleton: skeleton };\r\n },\r\n\r\n getBounds: function (skeleton)\r\n {\r\n var offset = new Spine.Vector2();\r\n var size = new Spine.Vector2();\r\n\r\n skeleton.getBounds(offset, size, []);\r\n\r\n return { offset: offset, size: size };\r\n },\r\n\r\n createAnimationState: function (skeleton)\r\n {\r\n var stateData = new Spine.AnimationStateData(skeleton.data);\r\n\r\n var state = new Spine.AnimationState(stateData);\r\n\r\n return { stateData: stateData, state: state };\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Camera3DPlugin#shutdown\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off('shutdown', this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Camera3DPlugin#destroy\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.pluginManager.removeGameObject('spine', true, true);\r\n\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n\r\n // Create a custom cache to store the spine data (.atlas files)\r\n this.cache = null;\r\n this.spineTextures = null;\r\n this.json = null;\r\n this.textures = null;\r\n this.skeletonRenderer = null;\r\n this.gl = null;\r\n this.mvp = null;\r\n this.shader = null;\r\n this.batcher = null;\r\n this.debugRenderer = null;\r\n this.debugShader = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpinePlugin;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = require('../../../../src/utils/Class');\r\nvar ComponentsAlpha = require('../../../../src/gameobjects/components/Alpha');\r\nvar ComponentsBlendMode = require('../../../../src/gameobjects/components/BlendMode');\r\nvar ComponentsComputedSize = require('../../../../src/gameobjects/components/ComputedSize');\r\nvar ComponentsDepth = require('../../../../src/gameobjects/components/Depth');\r\nvar ComponentsFlip = require('../../../../src/gameobjects/components/Flip');\r\nvar ComponentsScrollFactor = require('../../../../src/gameobjects/components/ScrollFactor');\r\nvar ComponentsTransform = require('../../../../src/gameobjects/components/Transform');\r\nvar ComponentsVisible = require('../../../../src/gameobjects/components/Visible');\r\nvar GameObject = require('../../../../src/gameobjects/GameObject');\r\nvar SpineGameObjectRender = require('./SpineGameObjectRender');\r\n\r\n/**\r\n * @classdesc\r\n * TODO\r\n *\r\n * @class SpineGameObject\r\n * @constructor\r\n * @since 3.16.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Phaser Plugin Manager.\r\n */\r\nvar SpineGameObject = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n ComponentsAlpha,\r\n ComponentsBlendMode,\r\n ComponentsComputedSize,\r\n ComponentsDepth,\r\n ComponentsFlip,\r\n ComponentsScrollFactor,\r\n ComponentsTransform,\r\n ComponentsVisible,\r\n SpineGameObjectRender\r\n ],\r\n\r\n initialize:\r\n\r\n function SpineGameObject (scene, plugin, x, y, key, animationName, loop)\r\n {\r\n GameObject.call(this, scene, 'Spine');\r\n\r\n this.plugin = plugin;\r\n\r\n this.root = null;\r\n this.skeleton = null;\r\n this.skeletonData = null;\r\n\r\n this.state = null;\r\n this.stateData = null;\r\n\r\n this.drawDebug = false;\r\n\r\n this.timeScale = 1;\r\n\r\n this.displayOriginX = 0;\r\n this.displayOriginY = 0;\r\n\r\n this.setPosition(x, y);\r\n\r\n if (key)\r\n {\r\n this.setSkeleton(key, animationName, loop);\r\n }\r\n },\r\n\r\n setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop)\r\n {\r\n return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop);\r\n },\r\n\r\n setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON)\r\n {\r\n var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON);\r\n\r\n this.skeletonData = data.skeletonData;\r\n\r\n var skeleton = data.skeleton;\r\n\r\n skeleton.setToSetupPose();\r\n\r\n skeleton.updateWorldTransform();\r\n\r\n skeleton.setSkinByName('default');\r\n\r\n this.skeleton = skeleton;\r\n\r\n // AnimationState\r\n data = this.plugin.createAnimationState(skeleton);\r\n\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n this.state = data.state;\r\n\r\n this.stateData = data.stateData;\r\n\r\n var _this = this;\r\n\r\n this.state.addListener({\r\n event: function (trackIndex, event)\r\n {\r\n // Event on a Track\r\n _this.emit('spine.event', _this, trackIndex, event);\r\n },\r\n complete: function (trackIndex, loopCount)\r\n {\r\n // Animation on Track x completed, loop count\r\n _this.emit('spine.complete', _this, trackIndex, loopCount);\r\n },\r\n start: function (trackIndex)\r\n {\r\n // Animation on Track x started\r\n _this.emit('spine.start', _this, trackIndex);\r\n },\r\n end: function (trackIndex)\r\n {\r\n // Animation on Track x ended\r\n _this.emit('spine.end', _this, trackIndex);\r\n }\r\n });\r\n\r\n if (animationName)\r\n {\r\n this.setAnimation(0, animationName, loop);\r\n }\r\n\r\n this.root = this.getRootBone();\r\n\r\n this.skeleton.scaleX = this.scaleX;\r\n this.skeleton.scaleY = this.scaleY;\r\n\r\n this.skeleton.updateWorldTransform();\r\n\r\n var w = this.skeletonData.width;\r\n var h = this.skeletonData.height;\r\n\r\n this.width = w;\r\n this.height = h;\r\n\r\n this.displayOriginX = w / 2;\r\n this.displayOriginY = h / 2;\r\n\r\n return this;\r\n },\r\n\r\n // http://esotericsoftware.com/spine-runtimes-guide\r\n\r\n getAnimationList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.animations.length; i++)\r\n {\r\n output.push(skeletonData.animations[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n play: function (animationName, loop)\r\n {\r\n if (loop === undefined)\r\n {\r\n loop = false;\r\n }\r\n\r\n return this.setAnimation(0, animationName, loop);\r\n },\r\n\r\n setAnimation: function (trackIndex, animationName, loop)\r\n {\r\n this.state.setAnimation(trackIndex, animationName, loop);\r\n\r\n return this;\r\n },\r\n\r\n addAnimation: function (trackIndex, animationName, loop, delay)\r\n {\r\n return this.state.addAnimation(trackIndex, animationName, loop, delay);\r\n },\r\n\r\n setEmptyAnimation: function (trackIndex, mixDuration)\r\n {\r\n this.state.setEmptyAnimation(trackIndex, mixDuration);\r\n\r\n return this;\r\n },\r\n\r\n clearTrack: function (trackIndex)\r\n {\r\n this.state.clearTrack(trackIndex);\r\n\r\n return this;\r\n },\r\n \r\n clearTracks: function ()\r\n {\r\n this.state.clearTracks();\r\n\r\n return this;\r\n },\r\n\r\n setSkinByName: function (skinName)\r\n {\r\n this.skeleton.setSkinByName(skinName);\r\n\r\n return this;\r\n },\r\n\r\n setSkin: function (newSkin)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n skeleton.setSkin(newSkin);\r\n\r\n skeleton.setSlotsToSetupPose();\r\n\r\n this.state.apply(skeleton);\r\n\r\n return this;\r\n },\r\n\r\n setMix: function (fromName, toName, duration)\r\n {\r\n this.stateData.setMix(fromName, toName, duration);\r\n\r\n return this;\r\n },\r\n\r\n getRootBone: function ()\r\n {\r\n return this.skeleton.getRootBone();\r\n },\r\n\r\n findBone: function (boneName)\r\n {\r\n return this.skeleton.findBone(boneName);\r\n },\r\n\r\n findBoneIndex: function (boneName)\r\n {\r\n return this.skeleton.findBoneIndex(boneName);\r\n },\r\n\r\n findSlot: function (slotName)\r\n {\r\n return this.skeleton.findSlot(slotName);\r\n },\r\n\r\n findSlotIndex: function (slotName)\r\n {\r\n return this.skeleton.findSlotIndex(slotName);\r\n },\r\n\r\n getBounds: function ()\r\n {\r\n return this.plugin.getBounds(this.skeleton);\r\n },\r\n\r\n preUpdate: function (time, delta)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n this.state.update((delta / 1000) * this.timeScale);\r\n\r\n this.state.apply(skeleton);\r\n\r\n this.emit('spine.update', skeleton);\r\n\r\n skeleton.updateWorldTransform();\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#preDestroy\r\n * @protected\r\n * @since 3.16.0\r\n */\r\n preDestroy: function ()\r\n {\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n this.plugin = null;\r\n\r\n this.skeleton = null;\r\n this.skeletonData = null;\r\n\r\n this.state = null;\r\n this.stateData = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpineGameObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar SetTransform = require('../../../../src/renderer/canvas/utils/SetTransform');\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.SpineGameObject#renderCanvas\r\n * @since 3.16.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.SpineGameObject} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var context = renderer.currentContext;\r\n\r\n var plugin = src.plugin;\r\n var skeleton = src.skeleton;\r\n var skeletonRenderer = plugin.skeletonRenderer;\r\n\r\n if (!skeleton || !SetTransform(renderer, context, src, camera, parentMatrix))\r\n {\r\n return;\r\n }\r\n\r\n skeletonRenderer.ctx = context;\r\n\r\n context.save();\r\n\r\n skeletonRenderer.draw(skeleton);\r\n\r\n if (plugin.drawDebug || src.drawDebug)\r\n {\r\n context.strokeStyle = '#00ff00';\r\n context.beginPath();\r\n context.moveTo(-1000, 0);\r\n context.lineTo(1000, 0);\r\n context.moveTo(0, -1000);\r\n context.lineTo(0, 1000);\r\n context.stroke();\r\n }\r\n\r\n context.restore();\r\n};\r\n\r\nmodule.exports = SpineGameObjectCanvasRenderer;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar renderWebGL = require('../../../../src/utils/NOOP');\r\nvar renderCanvas = require('../../../../src/utils/NOOP');\r\n\r\nif (typeof WEBGL_RENDERER)\r\n{\r\n renderWebGL = require('./SpineGameObjectWebGLRenderer');\r\n}\r\n\r\nif (typeof CANVAS_RENDERER)\r\n{\r\n renderCanvas = require('./SpineGameObjectCanvasRenderer');\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\r\nvar RadToDeg = require('../../../../src/math/RadToDeg');\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.SpineGameObject#renderCanvas\r\n * @since 3.16.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.SpineGameObject} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var plugin = src.plugin;\r\n var mvp = plugin.mvp;\r\n\r\n var shader = plugin.shader;\r\n var batcher = plugin.batcher;\r\n var runtime = plugin.runtime;\r\n var skeleton = src.skeleton;\r\n var skeletonRenderer = plugin.skeletonRenderer;\r\n\r\n if (!skeleton)\r\n {\r\n return;\r\n }\r\n\r\n if (renderer.newType)\r\n {\r\n renderer.clearPipeline();\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1;\r\n var spriteMatrix = renderer._tempMatrix2;\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n // - 90 degrees to account for the difference in Spine vs. Phaser rotation\r\n spriteMatrix.applyITRS(src.x, src.y, src.rotation - 1.5707963267948966, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = src.x;\r\n spriteMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n var width = renderer.width;\r\n var height = renderer.height;\r\n\r\n skeleton.x = calcMatrix.tx;\r\n skeleton.scaleX = calcMatrix.scaleX;\r\n\r\n if (camera.renderToTexture)\r\n {\r\n skeleton.y = calcMatrix.ty;\r\n skeleton.scaleY = calcMatrix.scaleY * -1;\r\n }\r\n else\r\n {\r\n skeleton.y = height - calcMatrix.ty;\r\n skeleton.scaleY = calcMatrix.scaleY;\r\n }\r\n\r\n src.root.rotation = RadToDeg(CounterClockwise(calcMatrix.rotation));\r\n\r\n // Add autoUpdate option\r\n skeleton.updateWorldTransform();\r\n\r\n if (renderer.newType)\r\n {\r\n mvp.ortho(0, width, 0, height, 0, 1);\r\n\r\n shader.bind();\r\n shader.setUniformi(runtime.Shader.SAMPLER, 0);\r\n shader.setUniform4x4f(runtime.Shader.MVP_MATRIX, mvp.val);\r\n\r\n batcher.begin(shader);\r\n\r\n skeletonRenderer.premultipliedAlpha = true;\r\n }\r\n\r\n if (renderer.nextTypeMatch)\r\n {\r\n batcher.isDrawing = false;\r\n }\r\n\r\n // Draw the current skeleton\r\n skeletonRenderer.draw(batcher, skeleton);\r\n\r\n if (!renderer.nextTypeMatch)\r\n {\r\n // The next object in the display list is not a Spine object, so we end the batch\r\n batcher.isDrawing = true;\r\n\r\n batcher.end();\r\n\r\n shader.unbind();\r\n\r\n renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline);\r\n }\r\n\r\n /*\r\n var drawDebug = (plugin.drawDebug || src.drawDebug);\r\n\r\n if (drawDebug)\r\n {\r\n var debugShader = plugin.debugShader;\r\n var debugRenderer = plugin.debugRenderer;\r\n var shapes = plugin.shapes;\r\n\r\n debugShader.bind();\r\n debugShader.setUniform4x4f(runtime.Shader.MVP_MATRIX, mvp.val);\r\n\r\n shapes.begin(debugShader);\r\n\r\n debugRenderer.draw(shapes, skeleton);\r\n\r\n shapes.end();\r\n\r\n debugShader.unbind();\r\n }\r\n */\r\n};\r\n\r\nmodule.exports = SpineGameObjectWebGLRenderer;\r\n","/*** IMPORTS FROM imports-loader ***/\n(function() {\n\nvar __extends = (this && this.__extends) || (function () {\r\n\tvar extendStatics = Object.setPrototypeOf ||\r\n\t\t({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n\t\tfunction (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\treturn function (d, b) {\r\n\t\textendStatics(d, b);\r\n\t\tfunction __() { this.constructor = d; }\r\n\t\td.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n\t};\r\n})();\r\nvar spine;\r\n(function (spine) {\r\n\tvar Animation = (function () {\r\n\t\tfunction Animation(name, timelines, duration) {\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tif (timelines == null)\r\n\t\t\t\tthrow new Error(\"timelines cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t\tthis.timelines = timelines;\r\n\t\t\tthis.duration = duration;\r\n\t\t}\r\n\t\tAnimation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tif (loop && this.duration != 0) {\r\n\t\t\t\ttime %= this.duration;\r\n\t\t\t\tif (lastTime > 0)\r\n\t\t\t\t\tlastTime %= this.duration;\r\n\t\t\t}\r\n\t\t\tvar timelines = this.timelines;\r\n\t\t\tfor (var i = 0, n = timelines.length; i < n; i++)\r\n\t\t\t\ttimelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\r\n\t\t};\r\n\t\tAnimation.binarySearch = function (values, target, step) {\r\n\t\t\tif (step === void 0) { step = 1; }\r\n\t\t\tvar low = 0;\r\n\t\t\tvar high = values.length / step - 2;\r\n\t\t\tif (high == 0)\r\n\t\t\t\treturn step;\r\n\t\t\tvar current = high >>> 1;\r\n\t\t\twhile (true) {\r\n\t\t\t\tif (values[(current + 1) * step] <= target)\r\n\t\t\t\t\tlow = current + 1;\r\n\t\t\t\telse\r\n\t\t\t\t\thigh = current;\r\n\t\t\t\tif (low == high)\r\n\t\t\t\t\treturn (low + 1) * step;\r\n\t\t\t\tcurrent = (low + high) >>> 1;\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimation.linearSearch = function (values, target, step) {\r\n\t\t\tfor (var i = 0, last = values.length - step; i <= last; i += step)\r\n\t\t\t\tif (values[i] > target)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\treturn Animation;\r\n\t}());\r\n\tspine.Animation = Animation;\r\n\tvar MixBlend;\r\n\t(function (MixBlend) {\r\n\t\tMixBlend[MixBlend[\"setup\"] = 0] = \"setup\";\r\n\t\tMixBlend[MixBlend[\"first\"] = 1] = \"first\";\r\n\t\tMixBlend[MixBlend[\"replace\"] = 2] = \"replace\";\r\n\t\tMixBlend[MixBlend[\"add\"] = 3] = \"add\";\r\n\t})(MixBlend = spine.MixBlend || (spine.MixBlend = {}));\r\n\tvar MixDirection;\r\n\t(function (MixDirection) {\r\n\t\tMixDirection[MixDirection[\"in\"] = 0] = \"in\";\r\n\t\tMixDirection[MixDirection[\"out\"] = 1] = \"out\";\r\n\t})(MixDirection = spine.MixDirection || (spine.MixDirection = {}));\r\n\tvar TimelineType;\r\n\t(function (TimelineType) {\r\n\t\tTimelineType[TimelineType[\"rotate\"] = 0] = \"rotate\";\r\n\t\tTimelineType[TimelineType[\"translate\"] = 1] = \"translate\";\r\n\t\tTimelineType[TimelineType[\"scale\"] = 2] = \"scale\";\r\n\t\tTimelineType[TimelineType[\"shear\"] = 3] = \"shear\";\r\n\t\tTimelineType[TimelineType[\"attachment\"] = 4] = \"attachment\";\r\n\t\tTimelineType[TimelineType[\"color\"] = 5] = \"color\";\r\n\t\tTimelineType[TimelineType[\"deform\"] = 6] = \"deform\";\r\n\t\tTimelineType[TimelineType[\"event\"] = 7] = \"event\";\r\n\t\tTimelineType[TimelineType[\"drawOrder\"] = 8] = \"drawOrder\";\r\n\t\tTimelineType[TimelineType[\"ikConstraint\"] = 9] = \"ikConstraint\";\r\n\t\tTimelineType[TimelineType[\"transformConstraint\"] = 10] = \"transformConstraint\";\r\n\t\tTimelineType[TimelineType[\"pathConstraintPosition\"] = 11] = \"pathConstraintPosition\";\r\n\t\tTimelineType[TimelineType[\"pathConstraintSpacing\"] = 12] = \"pathConstraintSpacing\";\r\n\t\tTimelineType[TimelineType[\"pathConstraintMix\"] = 13] = \"pathConstraintMix\";\r\n\t\tTimelineType[TimelineType[\"twoColor\"] = 14] = \"twoColor\";\r\n\t})(TimelineType = spine.TimelineType || (spine.TimelineType = {}));\r\n\tvar CurveTimeline = (function () {\r\n\t\tfunction CurveTimeline(frameCount) {\r\n\t\t\tif (frameCount <= 0)\r\n\t\t\t\tthrow new Error(\"frameCount must be > 0: \" + frameCount);\r\n\t\t\tthis.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\r\n\t\t}\r\n\t\tCurveTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.setLinear = function (frameIndex) {\r\n\t\t\tthis.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.setStepped = function (frameIndex) {\r\n\t\t\tthis.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.getCurveType = function (frameIndex) {\r\n\t\t\tvar index = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n\t\t\tif (index == this.curves.length)\r\n\t\t\t\treturn CurveTimeline.LINEAR;\r\n\t\t\tvar type = this.curves[index];\r\n\t\t\tif (type == CurveTimeline.LINEAR)\r\n\t\t\t\treturn CurveTimeline.LINEAR;\r\n\t\t\tif (type == CurveTimeline.STEPPED)\r\n\t\t\t\treturn CurveTimeline.STEPPED;\r\n\t\t\treturn CurveTimeline.BEZIER;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) {\r\n\t\t\tvar tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n\t\t\tvar dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n\t\t\tvar ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n\t\t\tvar dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\r\n\t\t\tvar i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n\t\t\tvar curves = this.curves;\r\n\t\t\tcurves[i++] = CurveTimeline.BEZIER;\r\n\t\t\tvar x = dfx, y = dfy;\r\n\t\t\tfor (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n\t\t\t\tcurves[i] = x;\r\n\t\t\t\tcurves[i + 1] = y;\r\n\t\t\t\tdfx += ddfx;\r\n\t\t\t\tdfy += ddfy;\r\n\t\t\t\tddfx += dddfx;\r\n\t\t\t\tddfy += dddfy;\r\n\t\t\t\tx += dfx;\r\n\t\t\t\ty += dfy;\r\n\t\t\t}\r\n\t\t};\r\n\t\tCurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) {\r\n\t\t\tpercent = spine.MathUtils.clamp(percent, 0, 1);\r\n\t\t\tvar curves = this.curves;\r\n\t\t\tvar i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n\t\t\tvar type = curves[i];\r\n\t\t\tif (type == CurveTimeline.LINEAR)\r\n\t\t\t\treturn percent;\r\n\t\t\tif (type == CurveTimeline.STEPPED)\r\n\t\t\t\treturn 0;\r\n\t\t\ti++;\r\n\t\t\tvar x = 0;\r\n\t\t\tfor (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n\t\t\t\tx = curves[i];\r\n\t\t\t\tif (x >= percent) {\r\n\t\t\t\t\tvar prevX = void 0, prevY = void 0;\r\n\t\t\t\t\tif (i == start) {\r\n\t\t\t\t\t\tprevX = 0;\r\n\t\t\t\t\t\tprevY = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tprevX = curves[i - 2];\r\n\t\t\t\t\t\tprevY = curves[i - 1];\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar y = curves[i - 1];\r\n\t\t\treturn y + (1 - y) * (percent - x) / (1 - x);\r\n\t\t};\r\n\t\tCurveTimeline.LINEAR = 0;\r\n\t\tCurveTimeline.STEPPED = 1;\r\n\t\tCurveTimeline.BEZIER = 2;\r\n\t\tCurveTimeline.BEZIER_SIZE = 10 * 2 - 1;\r\n\t\treturn CurveTimeline;\r\n\t}());\r\n\tspine.CurveTimeline = CurveTimeline;\r\n\tvar RotateTimeline = (function (_super) {\r\n\t\t__extends(RotateTimeline, _super);\r\n\t\tfunction RotateTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount << 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tRotateTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.rotate << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tRotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) {\r\n\t\t\tframeIndex <<= 1;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\r\n\t\t};\r\n\t\tRotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.rotation = bone.data.rotation;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tvar r_1 = bone.data.rotation - bone.rotation;\r\n\t\t\t\t\t\tbone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (time >= frames[frames.length - RotateTimeline.ENTRIES]) {\r\n\t\t\t\tvar r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.rotation = bone.data.rotation + r_2 * alpha;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\tr_2 += bone.data.rotation - bone.rotation;\r\n\t\t\t\t\t\tr_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360;\r\n\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\tbone.rotation += r_2 * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n\t\t\tvar prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n\t\t\tvar frameTime = frames[frame];\r\n\t\t\tvar percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n\t\t\tvar r = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n\t\t\tr = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent;\r\n\t\t\tswitch (blend) {\r\n\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\tbone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.first:\r\n\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\tr += bone.data.rotation - bone.rotation;\r\n\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\tbone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tRotateTimeline.ENTRIES = 2;\r\n\t\tRotateTimeline.PREV_TIME = -2;\r\n\t\tRotateTimeline.PREV_ROTATION = -1;\r\n\t\tRotateTimeline.ROTATION = 1;\r\n\t\treturn RotateTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.RotateTimeline = RotateTimeline;\r\n\tvar TranslateTimeline = (function (_super) {\r\n\t\t__extends(TranslateTimeline, _super);\r\n\t\tfunction TranslateTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tTranslateTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.translate << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tTranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) {\r\n\t\t\tframeIndex *= TranslateTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + TranslateTimeline.X] = x;\r\n\t\t\tthis.frames[frameIndex + TranslateTimeline.Y] = y;\r\n\t\t};\r\n\t\tTranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.x = bone.data.x;\r\n\t\t\t\t\t\tbone.y = bone.data.y;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tbone.x += (bone.data.x - bone.x) * alpha;\r\n\t\t\t\t\t\tbone.y += (bone.data.y - bone.y) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar x = 0, y = 0;\r\n\t\t\tif (time >= frames[frames.length - TranslateTimeline.ENTRIES]) {\r\n\t\t\t\tx = frames[frames.length + TranslateTimeline.PREV_X];\r\n\t\t\t\ty = frames[frames.length + TranslateTimeline.PREV_Y];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\r\n\t\t\t\tx = frames[frame + TranslateTimeline.PREV_X];\r\n\t\t\t\ty = frames[frame + TranslateTimeline.PREV_Y];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tx += (frames[frame + TranslateTimeline.X] - x) * percent;\r\n\t\t\t\ty += (frames[frame + TranslateTimeline.Y] - y) * percent;\r\n\t\t\t}\r\n\t\t\tswitch (blend) {\r\n\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\tbone.x = bone.data.x + x * alpha;\r\n\t\t\t\t\tbone.y = bone.data.y + y * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.first:\r\n\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\tbone.x += (bone.data.x + x - bone.x) * alpha;\r\n\t\t\t\t\tbone.y += (bone.data.y + y - bone.y) * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\tbone.x += x * alpha;\r\n\t\t\t\t\tbone.y += y * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTranslateTimeline.ENTRIES = 3;\r\n\t\tTranslateTimeline.PREV_TIME = -3;\r\n\t\tTranslateTimeline.PREV_X = -2;\r\n\t\tTranslateTimeline.PREV_Y = -1;\r\n\t\tTranslateTimeline.X = 1;\r\n\t\tTranslateTimeline.Y = 2;\r\n\t\treturn TranslateTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.TranslateTimeline = TranslateTimeline;\r\n\tvar ScaleTimeline = (function (_super) {\r\n\t\t__extends(ScaleTimeline, _super);\r\n\t\tfunction ScaleTimeline(frameCount) {\r\n\t\t\treturn _super.call(this, frameCount) || this;\r\n\t\t}\r\n\t\tScaleTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.scale << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.scaleX = bone.data.scaleX;\r\n\t\t\t\t\t\tbone.scaleY = bone.data.scaleY;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tbone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n\t\t\t\t\t\tbone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar x = 0, y = 0;\r\n\t\t\tif (time >= frames[frames.length - ScaleTimeline.ENTRIES]) {\r\n\t\t\t\tx = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX;\r\n\t\t\t\ty = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\r\n\t\t\t\tx = frames[frame + ScaleTimeline.PREV_X];\r\n\t\t\t\ty = frames[frame + ScaleTimeline.PREV_Y];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tx = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX;\r\n\t\t\t\ty = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY;\r\n\t\t\t}\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\tif (blend == MixBlend.add) {\r\n\t\t\t\t\tbone.scaleX += x - bone.data.scaleX;\r\n\t\t\t\t\tbone.scaleY += y - bone.data.scaleY;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tbone.scaleX = x;\r\n\t\t\t\t\tbone.scaleY = y;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar bx = 0, by = 0;\r\n\t\t\t\tif (direction == MixDirection.out) {\r\n\t\t\t\t\tswitch (blend) {\r\n\t\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\t\tbx = bone.data.scaleX;\r\n\t\t\t\t\t\t\tby = bone.data.scaleY;\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\t\tbx = bone.scaleX;\r\n\t\t\t\t\t\t\tby = bone.scaleY;\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\t\tbx = bone.scaleX;\r\n\t\t\t\t\t\t\tby = bone.scaleY;\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tswitch (blend) {\r\n\t\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\t\tbx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x);\r\n\t\t\t\t\t\t\tby = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y);\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\t\tbx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x);\r\n\t\t\t\t\t\t\tby = Math.abs(bone.scaleY) * spine.MathUtils.signum(y);\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\t\tbx = spine.MathUtils.signum(x);\r\n\t\t\t\t\t\t\tby = spine.MathUtils.signum(y);\r\n\t\t\t\t\t\t\tbone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn ScaleTimeline;\r\n\t}(TranslateTimeline));\r\n\tspine.ScaleTimeline = ScaleTimeline;\r\n\tvar ShearTimeline = (function (_super) {\r\n\t\t__extends(ShearTimeline, _super);\r\n\t\tfunction ShearTimeline(frameCount) {\r\n\t\t\treturn _super.call(this, frameCount) || this;\r\n\t\t}\r\n\t\tShearTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.shear << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.shearX = bone.data.shearX;\r\n\t\t\t\t\t\tbone.shearY = bone.data.shearY;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tbone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n\t\t\t\t\t\tbone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar x = 0, y = 0;\r\n\t\t\tif (time >= frames[frames.length - ShearTimeline.ENTRIES]) {\r\n\t\t\t\tx = frames[frames.length + ShearTimeline.PREV_X];\r\n\t\t\t\ty = frames[frames.length + ShearTimeline.PREV_Y];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\r\n\t\t\t\tx = frames[frame + ShearTimeline.PREV_X];\r\n\t\t\t\ty = frames[frame + ShearTimeline.PREV_Y];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tx = x + (frames[frame + ShearTimeline.X] - x) * percent;\r\n\t\t\t\ty = y + (frames[frame + ShearTimeline.Y] - y) * percent;\r\n\t\t\t}\r\n\t\t\tswitch (blend) {\r\n\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\tbone.shearX = bone.data.shearX + x * alpha;\r\n\t\t\t\t\tbone.shearY = bone.data.shearY + y * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.first:\r\n\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\tbone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n\t\t\t\t\tbone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\tbone.shearX += x * alpha;\r\n\t\t\t\t\tbone.shearY += y * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn ShearTimeline;\r\n\t}(TranslateTimeline));\r\n\tspine.ShearTimeline = ShearTimeline;\r\n\tvar ColorTimeline = (function (_super) {\r\n\t\t__extends(ColorTimeline, _super);\r\n\t\tfunction ColorTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tColorTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.color << 24) + this.slotIndex;\r\n\t\t};\r\n\t\tColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) {\r\n\t\t\tframeIndex *= ColorTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.R] = r;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.G] = g;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.B] = b;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.A] = a;\r\n\t\t};\r\n\t\tColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tslot.color.setFromColor(slot.data.color);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tvar color = slot.color, setup = slot.data.color;\r\n\t\t\t\t\t\tcolor.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar r = 0, g = 0, b = 0, a = 0;\r\n\t\t\tif (time >= frames[frames.length - ColorTimeline.ENTRIES]) {\r\n\t\t\t\tvar i = frames.length;\r\n\t\t\t\tr = frames[i + ColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[i + ColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[i + ColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[i + ColorTimeline.PREV_A];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\r\n\t\t\t\tr = frames[frame + ColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[frame + ColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[frame + ColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[frame + ColorTimeline.PREV_A];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tr += (frames[frame + ColorTimeline.R] - r) * percent;\r\n\t\t\t\tg += (frames[frame + ColorTimeline.G] - g) * percent;\r\n\t\t\t\tb += (frames[frame + ColorTimeline.B] - b) * percent;\r\n\t\t\t\ta += (frames[frame + ColorTimeline.A] - a) * percent;\r\n\t\t\t}\r\n\t\t\tif (alpha == 1)\r\n\t\t\t\tslot.color.set(r, g, b, a);\r\n\t\t\telse {\r\n\t\t\t\tvar color = slot.color;\r\n\t\t\t\tif (blend == MixBlend.setup)\r\n\t\t\t\t\tcolor.setFromColor(slot.data.color);\r\n\t\t\t\tcolor.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n\t\t\t}\r\n\t\t};\r\n\t\tColorTimeline.ENTRIES = 5;\r\n\t\tColorTimeline.PREV_TIME = -5;\r\n\t\tColorTimeline.PREV_R = -4;\r\n\t\tColorTimeline.PREV_G = -3;\r\n\t\tColorTimeline.PREV_B = -2;\r\n\t\tColorTimeline.PREV_A = -1;\r\n\t\tColorTimeline.R = 1;\r\n\t\tColorTimeline.G = 2;\r\n\t\tColorTimeline.B = 3;\r\n\t\tColorTimeline.A = 4;\r\n\t\treturn ColorTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.ColorTimeline = ColorTimeline;\r\n\tvar TwoColorTimeline = (function (_super) {\r\n\t\t__extends(TwoColorTimeline, _super);\r\n\t\tfunction TwoColorTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tTwoColorTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.twoColor << 24) + this.slotIndex;\r\n\t\t};\r\n\t\tTwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) {\r\n\t\t\tframeIndex *= TwoColorTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.R] = r;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.G] = g;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.B] = b;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.A] = a;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.R2] = r2;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.G2] = g2;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.B2] = b2;\r\n\t\t};\r\n\t\tTwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tslot.color.setFromColor(slot.data.color);\r\n\t\t\t\t\t\tslot.darkColor.setFromColor(slot.data.darkColor);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tvar light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n\t\t\t\t\t\tlight.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\r\n\t\t\t\t\t\tdark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\r\n\t\t\tif (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) {\r\n\t\t\t\tvar i = frames.length;\r\n\t\t\t\tr = frames[i + TwoColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[i + TwoColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[i + TwoColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[i + TwoColorTimeline.PREV_A];\r\n\t\t\t\tr2 = frames[i + TwoColorTimeline.PREV_R2];\r\n\t\t\t\tg2 = frames[i + TwoColorTimeline.PREV_G2];\r\n\t\t\t\tb2 = frames[i + TwoColorTimeline.PREV_B2];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES);\r\n\t\t\t\tr = frames[frame + TwoColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[frame + TwoColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[frame + TwoColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[frame + TwoColorTimeline.PREV_A];\r\n\t\t\t\tr2 = frames[frame + TwoColorTimeline.PREV_R2];\r\n\t\t\t\tg2 = frames[frame + TwoColorTimeline.PREV_G2];\r\n\t\t\t\tb2 = frames[frame + TwoColorTimeline.PREV_B2];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tr += (frames[frame + TwoColorTimeline.R] - r) * percent;\r\n\t\t\t\tg += (frames[frame + TwoColorTimeline.G] - g) * percent;\r\n\t\t\t\tb += (frames[frame + TwoColorTimeline.B] - b) * percent;\r\n\t\t\t\ta += (frames[frame + TwoColorTimeline.A] - a) * percent;\r\n\t\t\t\tr2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent;\r\n\t\t\t\tg2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent;\r\n\t\t\t\tb2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent;\r\n\t\t\t}\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\tslot.color.set(r, g, b, a);\r\n\t\t\t\tslot.darkColor.set(r2, g2, b2, 1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar light = slot.color, dark = slot.darkColor;\r\n\t\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\t\tlight.setFromColor(slot.data.color);\r\n\t\t\t\t\tdark.setFromColor(slot.data.darkColor);\r\n\t\t\t\t}\r\n\t\t\t\tlight.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\r\n\t\t\t\tdark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTwoColorTimeline.ENTRIES = 8;\r\n\t\tTwoColorTimeline.PREV_TIME = -8;\r\n\t\tTwoColorTimeline.PREV_R = -7;\r\n\t\tTwoColorTimeline.PREV_G = -6;\r\n\t\tTwoColorTimeline.PREV_B = -5;\r\n\t\tTwoColorTimeline.PREV_A = -4;\r\n\t\tTwoColorTimeline.PREV_R2 = -3;\r\n\t\tTwoColorTimeline.PREV_G2 = -2;\r\n\t\tTwoColorTimeline.PREV_B2 = -1;\r\n\t\tTwoColorTimeline.R = 1;\r\n\t\tTwoColorTimeline.G = 2;\r\n\t\tTwoColorTimeline.B = 3;\r\n\t\tTwoColorTimeline.A = 4;\r\n\t\tTwoColorTimeline.R2 = 5;\r\n\t\tTwoColorTimeline.G2 = 6;\r\n\t\tTwoColorTimeline.B2 = 7;\r\n\t\treturn TwoColorTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.TwoColorTimeline = TwoColorTimeline;\r\n\tvar AttachmentTimeline = (function () {\r\n\t\tfunction AttachmentTimeline(frameCount) {\r\n\t\t\tthis.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\tthis.attachmentNames = new Array(frameCount);\r\n\t\t}\r\n\t\tAttachmentTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.attachment << 24) + this.slotIndex;\r\n\t\t};\r\n\t\tAttachmentTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.frames.length;\r\n\t\t};\r\n\t\tAttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) {\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.attachmentNames[frameIndex] = attachmentName;\r\n\t\t};\r\n\t\tAttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tif (direction == MixDirection.out && blend == MixBlend.setup) {\r\n\t\t\t\tvar attachmentName_1 = slot.data.attachmentName;\r\n\t\t\t\tslot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) {\r\n\t\t\t\t\tvar attachmentName_2 = slot.data.attachmentName;\r\n\t\t\t\t\tslot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2));\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frameIndex = 0;\r\n\t\t\tif (time >= frames[frames.length - 1])\r\n\t\t\t\tframeIndex = frames.length - 1;\r\n\t\t\telse\r\n\t\t\t\tframeIndex = Animation.binarySearch(frames, time, 1) - 1;\r\n\t\t\tvar attachmentName = this.attachmentNames[frameIndex];\r\n\t\t\tskeleton.slots[this.slotIndex]\r\n\t\t\t\t.setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n\t\t};\r\n\t\treturn AttachmentTimeline;\r\n\t}());\r\n\tspine.AttachmentTimeline = AttachmentTimeline;\r\n\tvar zeros = null;\r\n\tvar DeformTimeline = (function (_super) {\r\n\t\t__extends(DeformTimeline, _super);\r\n\t\tfunction DeformTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\t_this.frameVertices = new Array(frameCount);\r\n\t\t\tif (zeros == null)\r\n\t\t\t\tzeros = spine.Utils.newFloatArray(64);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tDeformTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex;\r\n\t\t};\r\n\t\tDeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) {\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frameVertices[frameIndex] = vertices;\r\n\t\t};\r\n\t\tDeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tvar slotAttachment = slot.getAttachment();\r\n\t\t\tif (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment))\r\n\t\t\t\treturn;\r\n\t\t\tvar verticesArray = slot.attachmentVertices;\r\n\t\t\tif (verticesArray.length == 0)\r\n\t\t\t\tblend = MixBlend.setup;\r\n\t\t\tvar frameVertices = this.frameVertices;\r\n\t\t\tvar vertexCount = frameVertices[0].length;\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tverticesArray.length = 0;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tif (alpha == 1) {\r\n\t\t\t\t\t\t\tverticesArray.length = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount);\r\n\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\r\n\t\t\t\t\t\t\t\tvertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\talpha = 1 - alpha;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\r\n\t\t\t\t\t\t\t\tvertices_1[i] *= alpha;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar vertices = spine.Utils.setArraySize(verticesArray, vertexCount);\r\n\t\t\tif (time >= frames[frames.length - 1]) {\r\n\t\t\t\tvar lastVertices = frameVertices[frames.length - 1];\r\n\t\t\t\tif (alpha == 1) {\r\n\t\t\t\t\tif (blend == MixBlend.add) {\r\n\t\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\tfor (var i_1 = 0; i_1 < vertexCount; i_1++) {\r\n\t\t\t\t\t\t\t\tvertices[i_1] += lastVertices[i_1] - setupVertices[i_1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i_2 = 0; i_2 < vertexCount; i_2++)\r\n\t\t\t\t\t\t\t\tvertices[i_2] += lastVertices[i_2];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tspine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tswitch (blend) {\r\n\t\t\t\t\t\tcase MixBlend.setup: {\r\n\t\t\t\t\t\t\tvar vertexAttachment_1 = slotAttachment;\r\n\t\t\t\t\t\t\tif (vertexAttachment_1.bones == null) {\r\n\t\t\t\t\t\t\t\tvar setupVertices = vertexAttachment_1.vertices;\r\n\t\t\t\t\t\t\t\tfor (var i_3 = 0; i_3 < vertexCount; i_3++) {\r\n\t\t\t\t\t\t\t\t\tvar setup = setupVertices[i_3];\r\n\t\t\t\t\t\t\t\t\tvertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tfor (var i_4 = 0; i_4 < vertexCount; i_4++)\r\n\t\t\t\t\t\t\t\t\tvertices[i_4] = lastVertices[i_4] * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\t\tfor (var i_5 = 0; i_5 < vertexCount; i_5++)\r\n\t\t\t\t\t\t\t\tvertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha;\r\n\t\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\t\tfor (var i_6 = 0; i_6 < vertexCount; i_6++) {\r\n\t\t\t\t\t\t\t\t\tvertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tfor (var i_7 = 0; i_7 < vertexCount; i_7++)\r\n\t\t\t\t\t\t\t\t\tvertices[i_7] += lastVertices[i_7] * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = Animation.binarySearch(frames, time);\r\n\t\t\tvar prevVertices = frameVertices[frame - 1];\r\n\t\t\tvar nextVertices = frameVertices[frame];\r\n\t\t\tvar frameTime = frames[frame];\r\n\t\t\tvar percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\tif (blend == MixBlend.add) {\r\n\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\tfor (var i_8 = 0; i_8 < vertexCount; i_8++) {\r\n\t\t\t\t\t\t\tvar prev = prevVertices[i_8];\r\n\t\t\t\t\t\t\tvertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tfor (var i_9 = 0; i_9 < vertexCount; i_9++) {\r\n\t\t\t\t\t\t\tvar prev = prevVertices[i_9];\r\n\t\t\t\t\t\t\tvertices[i_9] += prev + (nextVertices[i_9] - prev) * percent;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tfor (var i_10 = 0; i_10 < vertexCount; i_10++) {\r\n\t\t\t\t\t\tvar prev = prevVertices[i_10];\r\n\t\t\t\t\t\tvertices[i_10] = prev + (nextVertices[i_10] - prev) * percent;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup: {\r\n\t\t\t\t\t\tvar vertexAttachment_2 = slotAttachment;\r\n\t\t\t\t\t\tif (vertexAttachment_2.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment_2.vertices;\r\n\t\t\t\t\t\t\tfor (var i_11 = 0; i_11 < vertexCount; i_11++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_11], setup = setupVertices[i_11];\r\n\t\t\t\t\t\t\t\tvertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i_12 = 0; i_12 < vertexCount; i_12++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_12];\r\n\t\t\t\t\t\t\t\tvertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\tfor (var i_13 = 0; i_13 < vertexCount; i_13++) {\r\n\t\t\t\t\t\t\tvar prev = prevVertices[i_13];\r\n\t\t\t\t\t\t\tvertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\tfor (var i_14 = 0; i_14 < vertexCount; i_14++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_14];\r\n\t\t\t\t\t\t\t\tvertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i_15 = 0; i_15 < vertexCount; i_15++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_15];\r\n\t\t\t\t\t\t\t\tvertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn DeformTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.DeformTimeline = DeformTimeline;\r\n\tvar EventTimeline = (function () {\r\n\t\tfunction EventTimeline(frameCount) {\r\n\t\t\tthis.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\tthis.events = new Array(frameCount);\r\n\t\t}\r\n\t\tEventTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn TimelineType.event << 24;\r\n\t\t};\r\n\t\tEventTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.frames.length;\r\n\t\t};\r\n\t\tEventTimeline.prototype.setFrame = function (frameIndex, event) {\r\n\t\t\tthis.frames[frameIndex] = event.time;\r\n\t\t\tthis.events[frameIndex] = event;\r\n\t\t};\r\n\t\tEventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tif (firedEvents == null)\r\n\t\t\t\treturn;\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar frameCount = this.frames.length;\r\n\t\t\tif (lastTime > time) {\r\n\t\t\t\tthis.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\r\n\t\t\t\tlastTime = -1;\r\n\t\t\t}\r\n\t\t\telse if (lastTime >= frames[frameCount - 1])\r\n\t\t\t\treturn;\r\n\t\t\tif (time < frames[0])\r\n\t\t\t\treturn;\r\n\t\t\tvar frame = 0;\r\n\t\t\tif (lastTime < frames[0])\r\n\t\t\t\tframe = 0;\r\n\t\t\telse {\r\n\t\t\t\tframe = Animation.binarySearch(frames, lastTime);\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\twhile (frame > 0) {\r\n\t\t\t\t\tif (frames[frame - 1] != frameTime)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tframe--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (; frame < frameCount && time >= frames[frame]; frame++)\r\n\t\t\t\tfiredEvents.push(this.events[frame]);\r\n\t\t};\r\n\t\treturn EventTimeline;\r\n\t}());\r\n\tspine.EventTimeline = EventTimeline;\r\n\tvar DrawOrderTimeline = (function () {\r\n\t\tfunction DrawOrderTimeline(frameCount) {\r\n\t\t\tthis.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\tthis.drawOrders = new Array(frameCount);\r\n\t\t}\r\n\t\tDrawOrderTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn TimelineType.drawOrder << 24;\r\n\t\t};\r\n\t\tDrawOrderTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.frames.length;\r\n\t\t};\r\n\t\tDrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) {\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.drawOrders[frameIndex] = drawOrder;\r\n\t\t};\r\n\t\tDrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar drawOrder = skeleton.drawOrder;\r\n\t\t\tvar slots = skeleton.slots;\r\n\t\t\tif (direction == MixDirection.out && blend == MixBlend.setup) {\r\n\t\t\t\tspine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first)\r\n\t\t\t\t\tspine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = 0;\r\n\t\t\tif (time >= frames[frames.length - 1])\r\n\t\t\t\tframe = frames.length - 1;\r\n\t\t\telse\r\n\t\t\t\tframe = Animation.binarySearch(frames, time) - 1;\r\n\t\t\tvar drawOrderToSetupIndex = this.drawOrders[frame];\r\n\t\t\tif (drawOrderToSetupIndex == null)\r\n\t\t\t\tspine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\r\n\t\t\telse {\r\n\t\t\t\tfor (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n\t\t\t\t\tdrawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn DrawOrderTimeline;\r\n\t}());\r\n\tspine.DrawOrderTimeline = DrawOrderTimeline;\r\n\tvar IkConstraintTimeline = (function (_super) {\r\n\t\t__extends(IkConstraintTimeline, _super);\r\n\t\tfunction IkConstraintTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tIkConstraintTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;\r\n\t\t};\r\n\t\tIkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) {\r\n\t\t\tframeIndex *= IkConstraintTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0;\r\n\t\t};\r\n\t\tIkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.mix = constraint.data.mix;\r\n\t\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.mix += (constraint.data.mix - constraint.mix) * alpha;\r\n\t\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {\r\n\t\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\t\tconstraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;\r\n\t\t\t\t\tif (direction == MixDirection.out) {\r\n\t\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tconstraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\t\tconstraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\t\tconstraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconstraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\r\n\t\t\t\t\tif (direction == MixDirection[\"in\"]) {\r\n\t\t\t\t\t\tconstraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\t\tconstraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\t\tconstraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\r\n\t\t\tvar mix = frames[frame + IkConstraintTimeline.PREV_MIX];\r\n\t\t\tvar frameTime = frames[frame];\r\n\t\t\tvar percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\r\n\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\tconstraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;\r\n\t\t\t\tif (direction == MixDirection.out) {\r\n\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconstraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\tconstraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\tconstraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconstraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\r\n\t\t\t\tif (direction == MixDirection[\"in\"]) {\r\n\t\t\t\t\tconstraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\tconstraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\tconstraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tIkConstraintTimeline.ENTRIES = 5;\r\n\t\tIkConstraintTimeline.PREV_TIME = -5;\r\n\t\tIkConstraintTimeline.PREV_MIX = -4;\r\n\t\tIkConstraintTimeline.PREV_BEND_DIRECTION = -3;\r\n\t\tIkConstraintTimeline.PREV_COMPRESS = -2;\r\n\t\tIkConstraintTimeline.PREV_STRETCH = -1;\r\n\t\tIkConstraintTimeline.MIX = 1;\r\n\t\tIkConstraintTimeline.BEND_DIRECTION = 2;\r\n\t\tIkConstraintTimeline.COMPRESS = 3;\r\n\t\tIkConstraintTimeline.STRETCH = 4;\r\n\t\treturn IkConstraintTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.IkConstraintTimeline = IkConstraintTimeline;\r\n\tvar TransformConstraintTimeline = (function (_super) {\r\n\t\t__extends(TransformConstraintTimeline, _super);\r\n\t\tfunction TransformConstraintTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tTransformConstraintTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;\r\n\t\t};\r\n\t\tTransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) {\r\n\t\t\tframeIndex *= TransformConstraintTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\r\n\t\t};\r\n\t\tTransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.rotateMix = data.rotateMix;\r\n\t\t\t\t\t\tconstraint.translateMix = data.translateMix;\r\n\t\t\t\t\t\tconstraint.scaleMix = data.scaleMix;\r\n\t\t\t\t\t\tconstraint.shearMix = data.shearMix;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha;\r\n\t\t\t\t\t\tconstraint.translateMix += (data.translateMix - constraint.translateMix) * alpha;\r\n\t\t\t\t\t\tconstraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha;\r\n\t\t\t\t\t\tconstraint.shearMix += (data.shearMix - constraint.shearMix) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar rotate = 0, translate = 0, scale = 0, shear = 0;\r\n\t\t\tif (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) {\r\n\t\t\t\tvar i = frames.length;\r\n\t\t\t\trotate = frames[i + TransformConstraintTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE];\r\n\t\t\t\tscale = frames[i + TransformConstraintTimeline.PREV_SCALE];\r\n\t\t\t\tshear = frames[i + TransformConstraintTimeline.PREV_SHEAR];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\r\n\t\t\t\trotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\r\n\t\t\t\tscale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\r\n\t\t\t\tshear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\trotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent;\r\n\t\t\t\ttranslate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent;\r\n\t\t\t\tscale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent;\r\n\t\t\t\tshear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tconstraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha;\r\n\t\t\t\tconstraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha;\r\n\t\t\t\tconstraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconstraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n\t\t\t\tconstraint.scaleMix += (scale - constraint.scaleMix) * alpha;\r\n\t\t\t\tconstraint.shearMix += (shear - constraint.shearMix) * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraintTimeline.ENTRIES = 5;\r\n\t\tTransformConstraintTimeline.PREV_TIME = -5;\r\n\t\tTransformConstraintTimeline.PREV_ROTATE = -4;\r\n\t\tTransformConstraintTimeline.PREV_TRANSLATE = -3;\r\n\t\tTransformConstraintTimeline.PREV_SCALE = -2;\r\n\t\tTransformConstraintTimeline.PREV_SHEAR = -1;\r\n\t\tTransformConstraintTimeline.ROTATE = 1;\r\n\t\tTransformConstraintTimeline.TRANSLATE = 2;\r\n\t\tTransformConstraintTimeline.SCALE = 3;\r\n\t\tTransformConstraintTimeline.SHEAR = 4;\r\n\t\treturn TransformConstraintTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.TransformConstraintTimeline = TransformConstraintTimeline;\r\n\tvar PathConstraintPositionTimeline = (function (_super) {\r\n\t\t__extends(PathConstraintPositionTimeline, _super);\r\n\t\tfunction PathConstraintPositionTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPathConstraintPositionTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;\r\n\t\t};\r\n\t\tPathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) {\r\n\t\t\tframeIndex *= PathConstraintPositionTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\r\n\t\t};\r\n\t\tPathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.position = constraint.data.position;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.position += (constraint.data.position - constraint.position) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar position = 0;\r\n\t\t\tif (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES])\r\n\t\t\t\tposition = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE];\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\r\n\t\t\t\tposition = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tposition += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup)\r\n\t\t\t\tconstraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\r\n\t\t\telse\r\n\t\t\t\tconstraint.position += (position - constraint.position) * alpha;\r\n\t\t};\r\n\t\tPathConstraintPositionTimeline.ENTRIES = 2;\r\n\t\tPathConstraintPositionTimeline.PREV_TIME = -2;\r\n\t\tPathConstraintPositionTimeline.PREV_VALUE = -1;\r\n\t\tPathConstraintPositionTimeline.VALUE = 1;\r\n\t\treturn PathConstraintPositionTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.PathConstraintPositionTimeline = PathConstraintPositionTimeline;\r\n\tvar PathConstraintSpacingTimeline = (function (_super) {\r\n\t\t__extends(PathConstraintSpacingTimeline, _super);\r\n\t\tfunction PathConstraintSpacingTimeline(frameCount) {\r\n\t\t\treturn _super.call(this, frameCount) || this;\r\n\t\t}\r\n\t\tPathConstraintSpacingTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;\r\n\t\t};\r\n\t\tPathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.spacing = constraint.data.spacing;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar spacing = 0;\r\n\t\t\tif (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES])\r\n\t\t\t\tspacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE];\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\r\n\t\t\t\tspacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tspacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup)\r\n\t\t\t\tconstraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\r\n\t\t\telse\r\n\t\t\t\tconstraint.spacing += (spacing - constraint.spacing) * alpha;\r\n\t\t};\r\n\t\treturn PathConstraintSpacingTimeline;\r\n\t}(PathConstraintPositionTimeline));\r\n\tspine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline;\r\n\tvar PathConstraintMixTimeline = (function (_super) {\r\n\t\t__extends(PathConstraintMixTimeline, _super);\r\n\t\tfunction PathConstraintMixTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPathConstraintMixTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;\r\n\t\t};\r\n\t\tPathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) {\r\n\t\t\tframeIndex *= PathConstraintMixTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\r\n\t\t\tthis.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\r\n\t\t};\r\n\t\tPathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.rotateMix = constraint.data.rotateMix;\r\n\t\t\t\t\t\tconstraint.translateMix = constraint.data.translateMix;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha;\r\n\t\t\t\t\t\tconstraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar rotate = 0, translate = 0;\r\n\t\t\tif (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) {\r\n\t\t\t\trotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\r\n\t\t\t\trotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\trotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent;\r\n\t\t\t\ttranslate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\tconstraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconstraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tPathConstraintMixTimeline.ENTRIES = 3;\r\n\t\tPathConstraintMixTimeline.PREV_TIME = -3;\r\n\t\tPathConstraintMixTimeline.PREV_ROTATE = -2;\r\n\t\tPathConstraintMixTimeline.PREV_TRANSLATE = -1;\r\n\t\tPathConstraintMixTimeline.ROTATE = 1;\r\n\t\tPathConstraintMixTimeline.TRANSLATE = 2;\r\n\t\treturn PathConstraintMixTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.PathConstraintMixTimeline = PathConstraintMixTimeline;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AnimationState = (function () {\r\n\t\tfunction AnimationState(data) {\r\n\t\t\tthis.tracks = new Array();\r\n\t\t\tthis.events = new Array();\r\n\t\t\tthis.listeners = new Array();\r\n\t\t\tthis.queue = new EventQueue(this);\r\n\t\t\tthis.propertyIDs = new spine.IntSet();\r\n\t\t\tthis.animationsChanged = false;\r\n\t\t\tthis.timeScale = 1;\r\n\t\t\tthis.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); });\r\n\t\t\tthis.data = data;\r\n\t\t}\r\n\t\tAnimationState.prototype.update = function (delta) {\r\n\t\t\tdelta *= this.timeScale;\r\n\t\t\tvar tracks = this.tracks;\r\n\t\t\tfor (var i = 0, n = tracks.length; i < n; i++) {\r\n\t\t\t\tvar current = tracks[i];\r\n\t\t\t\tif (current == null)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tcurrent.animationLast = current.nextAnimationLast;\r\n\t\t\t\tcurrent.trackLast = current.nextTrackLast;\r\n\t\t\t\tvar currentDelta = delta * current.timeScale;\r\n\t\t\t\tif (current.delay > 0) {\r\n\t\t\t\t\tcurrent.delay -= currentDelta;\r\n\t\t\t\t\tif (current.delay > 0)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tcurrentDelta = -current.delay;\r\n\t\t\t\t\tcurrent.delay = 0;\r\n\t\t\t\t}\r\n\t\t\t\tvar next = current.next;\r\n\t\t\t\tif (next != null) {\r\n\t\t\t\t\tvar nextTime = current.trackLast - next.delay;\r\n\t\t\t\t\tif (nextTime >= 0) {\r\n\t\t\t\t\t\tnext.delay = 0;\r\n\t\t\t\t\t\tnext.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\r\n\t\t\t\t\t\tcurrent.trackTime += currentDelta;\r\n\t\t\t\t\t\tthis.setCurrent(i, next, true);\r\n\t\t\t\t\t\twhile (next.mixingFrom != null) {\r\n\t\t\t\t\t\t\tnext.mixTime += delta;\r\n\t\t\t\t\t\t\tnext = next.mixingFrom;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {\r\n\t\t\t\t\ttracks[i] = null;\r\n\t\t\t\t\tthis.queue.end(current);\r\n\t\t\t\t\tthis.disposeNext(current);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif (current.mixingFrom != null && this.updateMixingFrom(current, delta)) {\r\n\t\t\t\t\tvar from = current.mixingFrom;\r\n\t\t\t\t\tcurrent.mixingFrom = null;\r\n\t\t\t\t\tif (from != null)\r\n\t\t\t\t\t\tfrom.mixingTo = null;\r\n\t\t\t\t\twhile (from != null) {\r\n\t\t\t\t\t\tthis.queue.end(from);\r\n\t\t\t\t\t\tfrom = from.mixingFrom;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcurrent.trackTime += currentDelta;\r\n\t\t\t}\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.updateMixingFrom = function (to, delta) {\r\n\t\t\tvar from = to.mixingFrom;\r\n\t\t\tif (from == null)\r\n\t\t\t\treturn true;\r\n\t\t\tvar finished = this.updateMixingFrom(from, delta);\r\n\t\t\tfrom.animationLast = from.nextAnimationLast;\r\n\t\t\tfrom.trackLast = from.nextTrackLast;\r\n\t\t\tif (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\r\n\t\t\t\tif (from.totalAlpha == 0 || to.mixDuration == 0) {\r\n\t\t\t\t\tto.mixingFrom = from.mixingFrom;\r\n\t\t\t\t\tif (from.mixingFrom != null)\r\n\t\t\t\t\t\tfrom.mixingFrom.mixingTo = to;\r\n\t\t\t\t\tto.interruptAlpha = from.interruptAlpha;\r\n\t\t\t\t\tthis.queue.end(from);\r\n\t\t\t\t}\r\n\t\t\t\treturn finished;\r\n\t\t\t}\r\n\t\t\tfrom.trackTime += delta * from.timeScale;\r\n\t\t\tto.mixTime += delta;\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tAnimationState.prototype.apply = function (skeleton) {\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tif (this.animationsChanged)\r\n\t\t\t\tthis._animationsChanged();\r\n\t\t\tvar events = this.events;\r\n\t\t\tvar tracks = this.tracks;\r\n\t\t\tvar applied = false;\r\n\t\t\tfor (var i = 0, n = tracks.length; i < n; i++) {\r\n\t\t\t\tvar current = tracks[i];\r\n\t\t\t\tif (current == null || current.delay > 0)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tapplied = true;\r\n\t\t\t\tvar blend = i == 0 ? spine.MixBlend.first : current.mixBlend;\r\n\t\t\t\tvar mix = current.alpha;\r\n\t\t\t\tif (current.mixingFrom != null)\r\n\t\t\t\t\tmix *= this.applyMixingFrom(current, skeleton, blend);\r\n\t\t\t\telse if (current.trackTime >= current.trackEnd && current.next == null)\r\n\t\t\t\t\tmix = 0;\r\n\t\t\t\tvar animationLast = current.animationLast, animationTime = current.getAnimationTime();\r\n\t\t\t\tvar timelineCount = current.animation.timelines.length;\r\n\t\t\t\tvar timelines = current.animation.timelines;\r\n\t\t\t\tif ((i == 0 && mix == 1) || blend == spine.MixBlend.add) {\r\n\t\t\t\t\tfor (var ii = 0; ii < timelineCount; ii++)\r\n\t\t\t\t\t\ttimelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection[\"in\"]);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar timelineMode = current.timelineMode;\r\n\t\t\t\t\tvar firstFrame = current.timelinesRotation.length == 0;\r\n\t\t\t\t\tif (firstFrame)\r\n\t\t\t\t\t\tspine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null);\r\n\t\t\t\t\tvar timelinesRotation = current.timelinesRotation;\r\n\t\t\t\t\tfor (var ii = 0; ii < timelineCount; ii++) {\r\n\t\t\t\t\t\tvar timeline = timelines[ii];\r\n\t\t\t\t\t\tvar timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup;\r\n\t\t\t\t\t\tif (timeline instanceof spine.RotateTimeline) {\r\n\t\t\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tspine.Utils.webkit602BugfixHelper(mix, blend);\r\n\t\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection[\"in\"]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.queueEvents(current, animationTime);\r\n\t\t\t\tevents.length = 0;\r\n\t\t\t\tcurrent.nextAnimationLast = animationTime;\r\n\t\t\t\tcurrent.nextTrackLast = current.trackTime;\r\n\t\t\t}\r\n\t\t\tthis.queue.drain();\r\n\t\t\treturn applied;\r\n\t\t};\r\n\t\tAnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\r\n\t\t\tvar from = to.mixingFrom;\r\n\t\t\tif (from.mixingFrom != null)\r\n\t\t\t\tthis.applyMixingFrom(from, skeleton, blend);\r\n\t\t\tvar mix = 0;\r\n\t\t\tif (to.mixDuration == 0) {\r\n\t\t\t\tmix = 1;\r\n\t\t\t\tif (blend == spine.MixBlend.first)\r\n\t\t\t\t\tblend = spine.MixBlend.setup;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tmix = to.mixTime / to.mixDuration;\r\n\t\t\t\tif (mix > 1)\r\n\t\t\t\t\tmix = 1;\r\n\t\t\t\tif (blend != spine.MixBlend.first)\r\n\t\t\t\t\tblend = from.mixBlend;\r\n\t\t\t}\r\n\t\t\tvar events = mix < from.eventThreshold ? this.events : null;\r\n\t\t\tvar attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\r\n\t\t\tvar animationLast = from.animationLast, animationTime = from.getAnimationTime();\r\n\t\t\tvar timelineCount = from.animation.timelines.length;\r\n\t\t\tvar timelines = from.animation.timelines;\r\n\t\t\tvar alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\r\n\t\t\tif (blend == spine.MixBlend.add) {\r\n\t\t\t\tfor (var i = 0; i < timelineCount; i++)\r\n\t\t\t\t\ttimelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar timelineMode = from.timelineMode;\r\n\t\t\t\tvar timelineHoldMix = from.timelineHoldMix;\r\n\t\t\t\tvar firstFrame = from.timelinesRotation.length == 0;\r\n\t\t\t\tif (firstFrame)\r\n\t\t\t\t\tspine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);\r\n\t\t\t\tvar timelinesRotation = from.timelinesRotation;\r\n\t\t\t\tfrom.totalAlpha = 0;\r\n\t\t\t\tfor (var i = 0; i < timelineCount; i++) {\r\n\t\t\t\t\tvar timeline = timelines[i];\r\n\t\t\t\t\tvar direction = spine.MixDirection.out;\r\n\t\t\t\t\tvar timelineBlend = void 0;\r\n\t\t\t\t\tvar alpha = 0;\r\n\t\t\t\t\tswitch (timelineMode[i]) {\r\n\t\t\t\t\t\tcase AnimationState.SUBSEQUENT:\r\n\t\t\t\t\t\t\tif (!attachments && timeline instanceof spine.AttachmentTimeline)\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tif (!drawOrder && timeline instanceof spine.DrawOrderTimeline)\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\ttimelineBlend = blend;\r\n\t\t\t\t\t\t\talpha = alphaMix;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase AnimationState.FIRST:\r\n\t\t\t\t\t\t\ttimelineBlend = spine.MixBlend.setup;\r\n\t\t\t\t\t\t\talpha = alphaMix;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase AnimationState.HOLD:\r\n\t\t\t\t\t\t\ttimelineBlend = spine.MixBlend.setup;\r\n\t\t\t\t\t\t\talpha = alphaHold;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\ttimelineBlend = spine.MixBlend.setup;\r\n\t\t\t\t\t\t\tvar holdMix = timelineHoldMix[i];\r\n\t\t\t\t\t\t\talpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom.totalAlpha += alpha;\r\n\t\t\t\t\tif (timeline instanceof spine.RotateTimeline)\r\n\t\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tspine.Utils.webkit602BugfixHelper(alpha, blend);\r\n\t\t\t\t\t\tif (timelineBlend == spine.MixBlend.setup) {\r\n\t\t\t\t\t\t\tif (timeline instanceof spine.AttachmentTimeline) {\r\n\t\t\t\t\t\t\t\tif (attachments)\r\n\t\t\t\t\t\t\t\t\tdirection = spine.MixDirection.out;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if (timeline instanceof spine.DrawOrderTimeline) {\r\n\t\t\t\t\t\t\t\tif (drawOrder)\r\n\t\t\t\t\t\t\t\t\tdirection = spine.MixDirection.out;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (to.mixDuration > 0)\r\n\t\t\t\tthis.queueEvents(from, animationTime);\r\n\t\t\tthis.events.length = 0;\r\n\t\t\tfrom.nextAnimationLast = animationTime;\r\n\t\t\tfrom.nextTrackLast = from.trackTime;\r\n\t\t\treturn mix;\r\n\t\t};\r\n\t\tAnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\r\n\t\t\tif (firstFrame)\r\n\t\t\t\ttimelinesRotation[i] = 0;\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\ttimeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection[\"in\"]);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar rotateTimeline = timeline;\r\n\t\t\tvar frames = rotateTimeline.frames;\r\n\t\t\tvar bone = skeleton.bones[rotateTimeline.boneIndex];\r\n\t\t\tvar r1 = 0, r2 = 0;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase spine.MixBlend.setup:\r\n\t\t\t\t\t\tbone.rotation = bone.data.rotation;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase spine.MixBlend.first:\r\n\t\t\t\t\t\tr1 = bone.rotation;\r\n\t\t\t\t\t\tr2 = bone.data.rotation;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tr1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation;\r\n\t\t\t\tif (time >= frames[frames.length - spine.RotateTimeline.ENTRIES])\r\n\t\t\t\t\tr2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION];\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES);\r\n\t\t\t\t\tvar prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION];\r\n\t\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\t\tvar percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\t\tr2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation;\r\n\t\t\t\t\tr2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n\t\t\t\t\tr2 = prevRotation + r2 * percent + bone.data.rotation;\r\n\t\t\t\t\tr2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar total = 0, diff = r2 - r1;\r\n\t\t\tdiff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\r\n\t\t\tif (diff == 0) {\r\n\t\t\t\ttotal = timelinesRotation[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar lastTotal = 0, lastDiff = 0;\r\n\t\t\t\tif (firstFrame) {\r\n\t\t\t\t\tlastTotal = 0;\r\n\t\t\t\t\tlastDiff = diff;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlastTotal = timelinesRotation[i];\r\n\t\t\t\t\tlastDiff = timelinesRotation[i + 1];\r\n\t\t\t\t}\r\n\t\t\t\tvar current = diff > 0, dir = lastTotal >= 0;\r\n\t\t\t\tif (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\r\n\t\t\t\t\tif (Math.abs(lastTotal) > 180)\r\n\t\t\t\t\t\tlastTotal += 360 * spine.MathUtils.signum(lastTotal);\r\n\t\t\t\t\tdir = current;\r\n\t\t\t\t}\r\n\t\t\t\ttotal = diff + lastTotal - lastTotal % 360;\r\n\t\t\t\tif (dir != current)\r\n\t\t\t\t\ttotal += 360 * spine.MathUtils.signum(lastTotal);\r\n\t\t\t\ttimelinesRotation[i] = total;\r\n\t\t\t}\r\n\t\t\ttimelinesRotation[i + 1] = diff;\r\n\t\t\tr1 += total * alpha;\r\n\t\t\tbone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360;\r\n\t\t};\r\n\t\tAnimationState.prototype.queueEvents = function (entry, animationTime) {\r\n\t\t\tvar animationStart = entry.animationStart, animationEnd = entry.animationEnd;\r\n\t\t\tvar duration = animationEnd - animationStart;\r\n\t\t\tvar trackLastWrapped = entry.trackLast % duration;\r\n\t\t\tvar events = this.events;\r\n\t\t\tvar i = 0, n = events.length;\r\n\t\t\tfor (; i < n; i++) {\r\n\t\t\t\tvar event_1 = events[i];\r\n\t\t\t\tif (event_1.time < trackLastWrapped)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif (event_1.time > animationEnd)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tthis.queue.event(entry, event_1);\r\n\t\t\t}\r\n\t\t\tvar complete = false;\r\n\t\t\tif (entry.loop)\r\n\t\t\t\tcomplete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\r\n\t\t\telse\r\n\t\t\t\tcomplete = animationTime >= animationEnd && entry.animationLast < animationEnd;\r\n\t\t\tif (complete)\r\n\t\t\t\tthis.queue.complete(entry);\r\n\t\t\tfor (; i < n; i++) {\r\n\t\t\t\tvar event_2 = events[i];\r\n\t\t\t\tif (event_2.time < animationStart)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tthis.queue.event(entry, events[i]);\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimationState.prototype.clearTracks = function () {\r\n\t\t\tvar oldDrainDisabled = this.queue.drainDisabled;\r\n\t\t\tthis.queue.drainDisabled = true;\r\n\t\t\tfor (var i = 0, n = this.tracks.length; i < n; i++)\r\n\t\t\t\tthis.clearTrack(i);\r\n\t\t\tthis.tracks.length = 0;\r\n\t\t\tthis.queue.drainDisabled = oldDrainDisabled;\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.clearTrack = function (trackIndex) {\r\n\t\t\tif (trackIndex >= this.tracks.length)\r\n\t\t\t\treturn;\r\n\t\t\tvar current = this.tracks[trackIndex];\r\n\t\t\tif (current == null)\r\n\t\t\t\treturn;\r\n\t\t\tthis.queue.end(current);\r\n\t\t\tthis.disposeNext(current);\r\n\t\t\tvar entry = current;\r\n\t\t\twhile (true) {\r\n\t\t\t\tvar from = entry.mixingFrom;\r\n\t\t\t\tif (from == null)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tthis.queue.end(from);\r\n\t\t\t\tentry.mixingFrom = null;\r\n\t\t\t\tentry.mixingTo = null;\r\n\t\t\t\tentry = from;\r\n\t\t\t}\r\n\t\t\tthis.tracks[current.trackIndex] = null;\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.setCurrent = function (index, current, interrupt) {\r\n\t\t\tvar from = this.expandToIndex(index);\r\n\t\t\tthis.tracks[index] = current;\r\n\t\t\tif (from != null) {\r\n\t\t\t\tif (interrupt)\r\n\t\t\t\t\tthis.queue.interrupt(from);\r\n\t\t\t\tcurrent.mixingFrom = from;\r\n\t\t\t\tfrom.mixingTo = current;\r\n\t\t\t\tcurrent.mixTime = 0;\r\n\t\t\t\tif (from.mixingFrom != null && from.mixDuration > 0)\r\n\t\t\t\t\tcurrent.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\r\n\t\t\t\tfrom.timelinesRotation.length = 0;\r\n\t\t\t}\r\n\t\t\tthis.queue.start(current);\r\n\t\t};\r\n\t\tAnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\r\n\t\t\tvar animation = this.data.skeletonData.findAnimation(animationName);\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + animationName);\r\n\t\t\treturn this.setAnimationWith(trackIndex, animation, loop);\r\n\t\t};\r\n\t\tAnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"animation cannot be null.\");\r\n\t\t\tvar interrupt = true;\r\n\t\t\tvar current = this.expandToIndex(trackIndex);\r\n\t\t\tif (current != null) {\r\n\t\t\t\tif (current.nextTrackLast == -1) {\r\n\t\t\t\t\tthis.tracks[trackIndex] = current.mixingFrom;\r\n\t\t\t\t\tthis.queue.interrupt(current);\r\n\t\t\t\t\tthis.queue.end(current);\r\n\t\t\t\t\tthis.disposeNext(current);\r\n\t\t\t\t\tcurrent = current.mixingFrom;\r\n\t\t\t\t\tinterrupt = false;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.disposeNext(current);\r\n\t\t\t}\r\n\t\t\tvar entry = this.trackEntry(trackIndex, animation, loop, current);\r\n\t\t\tthis.setCurrent(trackIndex, entry, interrupt);\r\n\t\t\tthis.queue.drain();\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\r\n\t\t\tvar animation = this.data.skeletonData.findAnimation(animationName);\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + animationName);\r\n\t\t\treturn this.addAnimationWith(trackIndex, animation, loop, delay);\r\n\t\t};\r\n\t\tAnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"animation cannot be null.\");\r\n\t\t\tvar last = this.expandToIndex(trackIndex);\r\n\t\t\tif (last != null) {\r\n\t\t\t\twhile (last.next != null)\r\n\t\t\t\t\tlast = last.next;\r\n\t\t\t}\r\n\t\t\tvar entry = this.trackEntry(trackIndex, animation, loop, last);\r\n\t\t\tif (last == null) {\r\n\t\t\t\tthis.setCurrent(trackIndex, entry, true);\r\n\t\t\t\tthis.queue.drain();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlast.next = entry;\r\n\t\t\t\tif (delay <= 0) {\r\n\t\t\t\t\tvar duration = last.animationEnd - last.animationStart;\r\n\t\t\t\t\tif (duration != 0) {\r\n\t\t\t\t\t\tif (last.loop)\r\n\t\t\t\t\t\t\tdelay += duration * (1 + ((last.trackTime / duration) | 0));\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tdelay += Math.max(duration, last.trackTime);\r\n\t\t\t\t\t\tdelay -= this.data.getMix(last.animation, animation);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tdelay = last.trackTime;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tentry.delay = delay;\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\r\n\t\t\tvar entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false);\r\n\t\t\tentry.mixDuration = mixDuration;\r\n\t\t\tentry.trackEnd = mixDuration;\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\r\n\t\t\tif (delay <= 0)\r\n\t\t\t\tdelay -= mixDuration;\r\n\t\t\tvar entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay);\r\n\t\t\tentry.mixDuration = mixDuration;\r\n\t\t\tentry.trackEnd = mixDuration;\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.setEmptyAnimations = function (mixDuration) {\r\n\t\t\tvar oldDrainDisabled = this.queue.drainDisabled;\r\n\t\t\tthis.queue.drainDisabled = true;\r\n\t\t\tfor (var i = 0, n = this.tracks.length; i < n; i++) {\r\n\t\t\t\tvar current = this.tracks[i];\r\n\t\t\t\tif (current != null)\r\n\t\t\t\t\tthis.setEmptyAnimation(current.trackIndex, mixDuration);\r\n\t\t\t}\r\n\t\t\tthis.queue.drainDisabled = oldDrainDisabled;\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.expandToIndex = function (index) {\r\n\t\t\tif (index < this.tracks.length)\r\n\t\t\t\treturn this.tracks[index];\r\n\t\t\tspine.Utils.ensureArrayCapacity(this.tracks, index + 1, null);\r\n\t\t\tthis.tracks.length = index + 1;\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tAnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\r\n\t\t\tvar entry = this.trackEntryPool.obtain();\r\n\t\t\tentry.trackIndex = trackIndex;\r\n\t\t\tentry.animation = animation;\r\n\t\t\tentry.loop = loop;\r\n\t\t\tentry.holdPrevious = false;\r\n\t\t\tentry.eventThreshold = 0;\r\n\t\t\tentry.attachmentThreshold = 0;\r\n\t\t\tentry.drawOrderThreshold = 0;\r\n\t\t\tentry.animationStart = 0;\r\n\t\t\tentry.animationEnd = animation.duration;\r\n\t\t\tentry.animationLast = -1;\r\n\t\t\tentry.nextAnimationLast = -1;\r\n\t\t\tentry.delay = 0;\r\n\t\t\tentry.trackTime = 0;\r\n\t\t\tentry.trackLast = -1;\r\n\t\t\tentry.nextTrackLast = -1;\r\n\t\t\tentry.trackEnd = Number.MAX_VALUE;\r\n\t\t\tentry.timeScale = 1;\r\n\t\t\tentry.alpha = 1;\r\n\t\t\tentry.interruptAlpha = 1;\r\n\t\t\tentry.mixTime = 0;\r\n\t\t\tentry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.disposeNext = function (entry) {\r\n\t\t\tvar next = entry.next;\r\n\t\t\twhile (next != null) {\r\n\t\t\t\tthis.queue.dispose(next);\r\n\t\t\t\tnext = next.next;\r\n\t\t\t}\r\n\t\t\tentry.next = null;\r\n\t\t};\r\n\t\tAnimationState.prototype._animationsChanged = function () {\r\n\t\t\tthis.animationsChanged = false;\r\n\t\t\tthis.propertyIDs.clear();\r\n\t\t\tfor (var i = 0, n = this.tracks.length; i < n; i++) {\r\n\t\t\t\tvar entry = this.tracks[i];\r\n\t\t\t\tif (entry == null)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\twhile (entry.mixingFrom != null)\r\n\t\t\t\t\tentry = entry.mixingFrom;\r\n\t\t\t\tdo {\r\n\t\t\t\t\tif (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add)\r\n\t\t\t\t\t\tthis.setTimelineModes(entry);\r\n\t\t\t\t\tentry = entry.mixingTo;\r\n\t\t\t\t} while (entry != null);\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimationState.prototype.setTimelineModes = function (entry) {\r\n\t\t\tvar to = entry.mixingTo;\r\n\t\t\tvar timelines = entry.animation.timelines;\r\n\t\t\tvar timelinesCount = entry.animation.timelines.length;\r\n\t\t\tvar timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount);\r\n\t\t\tentry.timelineHoldMix.length = 0;\r\n\t\t\tvar timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount);\r\n\t\t\tvar propertyIDs = this.propertyIDs;\r\n\t\t\tif (to != null && to.holdPrevious) {\r\n\t\t\t\tfor (var i = 0; i < timelinesCount; i++) {\r\n\t\t\t\t\tpropertyIDs.add(timelines[i].getPropertyId());\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.HOLD;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\touter: for (var i = 0; i < timelinesCount; i++) {\r\n\t\t\t\tvar id = timelines[i].getPropertyId();\r\n\t\t\t\tif (!propertyIDs.add(id))\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.SUBSEQUENT;\r\n\t\t\t\telse if (to == null || !this.hasTimeline(to, id))\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.FIRST;\r\n\t\t\t\telse {\r\n\t\t\t\t\tfor (var next = to.mixingTo; next != null; next = next.mixingTo) {\r\n\t\t\t\t\t\tif (this.hasTimeline(next, id))\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tif (entry.mixDuration > 0) {\r\n\t\t\t\t\t\t\ttimelineMode[i] = AnimationState.HOLD_MIX;\r\n\t\t\t\t\t\t\ttimelineDipMix[i] = next;\r\n\t\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.HOLD;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimationState.prototype.hasTimeline = function (entry, id) {\r\n\t\t\tvar timelines = entry.animation.timelines;\r\n\t\t\tfor (var i = 0, n = timelines.length; i < n; i++)\r\n\t\t\t\tif (timelines[i].getPropertyId() == id)\r\n\t\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tAnimationState.prototype.getCurrent = function (trackIndex) {\r\n\t\t\tif (trackIndex >= this.tracks.length)\r\n\t\t\t\treturn null;\r\n\t\t\treturn this.tracks[trackIndex];\r\n\t\t};\r\n\t\tAnimationState.prototype.addListener = function (listener) {\r\n\t\t\tif (listener == null)\r\n\t\t\t\tthrow new Error(\"listener cannot be null.\");\r\n\t\t\tthis.listeners.push(listener);\r\n\t\t};\r\n\t\tAnimationState.prototype.removeListener = function (listener) {\r\n\t\t\tvar index = this.listeners.indexOf(listener);\r\n\t\t\tif (index >= 0)\r\n\t\t\t\tthis.listeners.splice(index, 1);\r\n\t\t};\r\n\t\tAnimationState.prototype.clearListeners = function () {\r\n\t\t\tthis.listeners.length = 0;\r\n\t\t};\r\n\t\tAnimationState.prototype.clearListenerNotifications = function () {\r\n\t\t\tthis.queue.clear();\r\n\t\t};\r\n\t\tAnimationState.emptyAnimation = new spine.Animation(\"\", [], 0);\r\n\t\tAnimationState.SUBSEQUENT = 0;\r\n\t\tAnimationState.FIRST = 1;\r\n\t\tAnimationState.HOLD = 2;\r\n\t\tAnimationState.HOLD_MIX = 3;\r\n\t\treturn AnimationState;\r\n\t}());\r\n\tspine.AnimationState = AnimationState;\r\n\tvar TrackEntry = (function () {\r\n\t\tfunction TrackEntry() {\r\n\t\t\tthis.mixBlend = spine.MixBlend.replace;\r\n\t\t\tthis.timelineMode = new Array();\r\n\t\t\tthis.timelineHoldMix = new Array();\r\n\t\t\tthis.timelinesRotation = new Array();\r\n\t\t}\r\n\t\tTrackEntry.prototype.reset = function () {\r\n\t\t\tthis.next = null;\r\n\t\t\tthis.mixingFrom = null;\r\n\t\t\tthis.mixingTo = null;\r\n\t\t\tthis.animation = null;\r\n\t\t\tthis.listener = null;\r\n\t\t\tthis.timelineMode.length = 0;\r\n\t\t\tthis.timelineHoldMix.length = 0;\r\n\t\t\tthis.timelinesRotation.length = 0;\r\n\t\t};\r\n\t\tTrackEntry.prototype.getAnimationTime = function () {\r\n\t\t\tif (this.loop) {\r\n\t\t\t\tvar duration = this.animationEnd - this.animationStart;\r\n\t\t\t\tif (duration == 0)\r\n\t\t\t\t\treturn this.animationStart;\r\n\t\t\t\treturn (this.trackTime % duration) + this.animationStart;\r\n\t\t\t}\r\n\t\t\treturn Math.min(this.trackTime + this.animationStart, this.animationEnd);\r\n\t\t};\r\n\t\tTrackEntry.prototype.setAnimationLast = function (animationLast) {\r\n\t\t\tthis.animationLast = animationLast;\r\n\t\t\tthis.nextAnimationLast = animationLast;\r\n\t\t};\r\n\t\tTrackEntry.prototype.isComplete = function () {\r\n\t\t\treturn this.trackTime >= this.animationEnd - this.animationStart;\r\n\t\t};\r\n\t\tTrackEntry.prototype.resetRotationDirections = function () {\r\n\t\t\tthis.timelinesRotation.length = 0;\r\n\t\t};\r\n\t\treturn TrackEntry;\r\n\t}());\r\n\tspine.TrackEntry = TrackEntry;\r\n\tvar EventQueue = (function () {\r\n\t\tfunction EventQueue(animState) {\r\n\t\t\tthis.objects = [];\r\n\t\t\tthis.drainDisabled = false;\r\n\t\t\tthis.animState = animState;\r\n\t\t}\r\n\t\tEventQueue.prototype.start = function (entry) {\r\n\t\t\tthis.objects.push(EventType.start);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t\tthis.animState.animationsChanged = true;\r\n\t\t};\r\n\t\tEventQueue.prototype.interrupt = function (entry) {\r\n\t\t\tthis.objects.push(EventType.interrupt);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t};\r\n\t\tEventQueue.prototype.end = function (entry) {\r\n\t\t\tthis.objects.push(EventType.end);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t\tthis.animState.animationsChanged = true;\r\n\t\t};\r\n\t\tEventQueue.prototype.dispose = function (entry) {\r\n\t\t\tthis.objects.push(EventType.dispose);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t};\r\n\t\tEventQueue.prototype.complete = function (entry) {\r\n\t\t\tthis.objects.push(EventType.complete);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t};\r\n\t\tEventQueue.prototype.event = function (entry, event) {\r\n\t\t\tthis.objects.push(EventType.event);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t\tthis.objects.push(event);\r\n\t\t};\r\n\t\tEventQueue.prototype.drain = function () {\r\n\t\t\tif (this.drainDisabled)\r\n\t\t\t\treturn;\r\n\t\t\tthis.drainDisabled = true;\r\n\t\t\tvar objects = this.objects;\r\n\t\t\tvar listeners = this.animState.listeners;\r\n\t\t\tfor (var i = 0; i < objects.length; i += 2) {\r\n\t\t\t\tvar type = objects[i];\r\n\t\t\t\tvar entry = objects[i + 1];\r\n\t\t\t\tswitch (type) {\r\n\t\t\t\t\tcase EventType.start:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.start)\r\n\t\t\t\t\t\t\tentry.listener.start(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].start)\r\n\t\t\t\t\t\t\t\tlisteners[ii].start(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.interrupt:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.interrupt)\r\n\t\t\t\t\t\t\tentry.listener.interrupt(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].interrupt)\r\n\t\t\t\t\t\t\t\tlisteners[ii].interrupt(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.end:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.end)\r\n\t\t\t\t\t\t\tentry.listener.end(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].end)\r\n\t\t\t\t\t\t\t\tlisteners[ii].end(entry);\r\n\t\t\t\t\tcase EventType.dispose:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.dispose)\r\n\t\t\t\t\t\t\tentry.listener.dispose(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].dispose)\r\n\t\t\t\t\t\t\t\tlisteners[ii].dispose(entry);\r\n\t\t\t\t\t\tthis.animState.trackEntryPool.free(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.complete:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.complete)\r\n\t\t\t\t\t\t\tentry.listener.complete(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].complete)\r\n\t\t\t\t\t\t\t\tlisteners[ii].complete(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.event:\r\n\t\t\t\t\t\tvar event_3 = objects[i++ + 2];\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.event)\r\n\t\t\t\t\t\t\tentry.listener.event(entry, event_3);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].event)\r\n\t\t\t\t\t\t\t\tlisteners[ii].event(entry, event_3);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.clear();\r\n\t\t\tthis.drainDisabled = false;\r\n\t\t};\r\n\t\tEventQueue.prototype.clear = function () {\r\n\t\t\tthis.objects.length = 0;\r\n\t\t};\r\n\t\treturn EventQueue;\r\n\t}());\r\n\tspine.EventQueue = EventQueue;\r\n\tvar EventType;\r\n\t(function (EventType) {\r\n\t\tEventType[EventType[\"start\"] = 0] = \"start\";\r\n\t\tEventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\r\n\t\tEventType[EventType[\"end\"] = 2] = \"end\";\r\n\t\tEventType[EventType[\"dispose\"] = 3] = \"dispose\";\r\n\t\tEventType[EventType[\"complete\"] = 4] = \"complete\";\r\n\t\tEventType[EventType[\"event\"] = 5] = \"event\";\r\n\t})(EventType = spine.EventType || (spine.EventType = {}));\r\n\tvar AnimationStateAdapter2 = (function () {\r\n\t\tfunction AnimationStateAdapter2() {\r\n\t\t}\r\n\t\tAnimationStateAdapter2.prototype.start = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.interrupt = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.end = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.dispose = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.complete = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.event = function (entry, event) {\r\n\t\t};\r\n\t\treturn AnimationStateAdapter2;\r\n\t}());\r\n\tspine.AnimationStateAdapter2 = AnimationStateAdapter2;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AnimationStateData = (function () {\r\n\t\tfunction AnimationStateData(skeletonData) {\r\n\t\t\tthis.animationToMixTime = {};\r\n\t\t\tthis.defaultMix = 0;\r\n\t\t\tif (skeletonData == null)\r\n\t\t\t\tthrow new Error(\"skeletonData cannot be null.\");\r\n\t\t\tthis.skeletonData = skeletonData;\r\n\t\t}\r\n\t\tAnimationStateData.prototype.setMix = function (fromName, toName, duration) {\r\n\t\t\tvar from = this.skeletonData.findAnimation(fromName);\r\n\t\t\tif (from == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + fromName);\r\n\t\t\tvar to = this.skeletonData.findAnimation(toName);\r\n\t\t\tif (to == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + toName);\r\n\t\t\tthis.setMixWith(from, to, duration);\r\n\t\t};\r\n\t\tAnimationStateData.prototype.setMixWith = function (from, to, duration) {\r\n\t\t\tif (from == null)\r\n\t\t\t\tthrow new Error(\"from cannot be null.\");\r\n\t\t\tif (to == null)\r\n\t\t\t\tthrow new Error(\"to cannot be null.\");\r\n\t\t\tvar key = from.name + \".\" + to.name;\r\n\t\t\tthis.animationToMixTime[key] = duration;\r\n\t\t};\r\n\t\tAnimationStateData.prototype.getMix = function (from, to) {\r\n\t\t\tvar key = from.name + \".\" + to.name;\r\n\t\t\tvar value = this.animationToMixTime[key];\r\n\t\t\treturn value === undefined ? this.defaultMix : value;\r\n\t\t};\r\n\t\treturn AnimationStateData;\r\n\t}());\r\n\tspine.AnimationStateData = AnimationStateData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AssetManager = (function () {\r\n\t\tfunction AssetManager(textureLoader, pathPrefix) {\r\n\t\t\tif (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n\t\t\tthis.assets = {};\r\n\t\t\tthis.errors = {};\r\n\t\t\tthis.toLoad = 0;\r\n\t\t\tthis.loaded = 0;\r\n\t\t\tthis.textureLoader = textureLoader;\r\n\t\t\tthis.pathPrefix = pathPrefix;\r\n\t\t}\r\n\t\tAssetManager.downloadText = function (url, success, error) {\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.open(\"GET\", url, true);\r\n\t\t\trequest.onload = function () {\r\n\t\t\t\tif (request.status == 200) {\r\n\t\t\t\t\tsuccess(request.responseText);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.onerror = function () {\r\n\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t};\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tAssetManager.downloadBinary = function (url, success, error) {\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.open(\"GET\", url, true);\r\n\t\t\trequest.responseType = \"arraybuffer\";\r\n\t\t\trequest.onload = function () {\r\n\t\t\t\tif (request.status == 200) {\r\n\t\t\t\t\tsuccess(new Uint8Array(request.response));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.onerror = function () {\r\n\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t};\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tAssetManager.prototype.loadText = function (path, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tAssetManager.downloadText(path, function (data) {\r\n\t\t\t\t_this.assets[path] = data;\r\n\t\t\t\tif (success)\r\n\t\t\t\t\tsuccess(path, data);\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t}, function (state, responseText) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText);\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t});\r\n\t\t};\r\n\t\tAssetManager.prototype.loadTexture = function (path, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tvar img = new Image();\r\n\t\t\timg.crossOrigin = \"anonymous\";\r\n\t\t\timg.onload = function (ev) {\r\n\t\t\t\tvar texture = _this.textureLoader(img);\r\n\t\t\t\t_this.assets[path] = texture;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (success)\r\n\t\t\t\t\tsuccess(path, img);\r\n\t\t\t};\r\n\t\t\timg.onerror = function (ev) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load image \" + path;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load image \" + path);\r\n\t\t\t};\r\n\t\t\timg.src = path;\r\n\t\t};\r\n\t\tAssetManager.prototype.loadTextureData = function (path, data, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tvar img = new Image();\r\n\t\t\timg.onload = function (ev) {\r\n\t\t\t\tvar texture = _this.textureLoader(img);\r\n\t\t\t\t_this.assets[path] = texture;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (success)\r\n\t\t\t\t\tsuccess(path, img);\r\n\t\t\t};\r\n\t\t\timg.onerror = function (ev) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load image \" + path;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load image \" + path);\r\n\t\t\t};\r\n\t\t\timg.src = data;\r\n\t\t};\r\n\t\tAssetManager.prototype.loadTextureAtlas = function (path, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tvar parent = path.lastIndexOf(\"/\") >= 0 ? path.substring(0, path.lastIndexOf(\"/\")) : \"\";\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tAssetManager.downloadText(path, function (atlasData) {\r\n\t\t\t\tvar pagesLoaded = { count: 0 };\r\n\t\t\t\tvar atlasPages = new Array();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar atlas = new spine.TextureAtlas(atlasData, function (path) {\r\n\t\t\t\t\t\tatlasPages.push(parent + \"/\" + path);\r\n\t\t\t\t\t\tvar image = document.createElement(\"img\");\r\n\t\t\t\t\t\timage.width = 16;\r\n\t\t\t\t\t\timage.height = 16;\r\n\t\t\t\t\t\treturn new spine.FakeTexture(image);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\tvar ex = e;\r\n\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\r\n\t\t\t\t\tif (error)\r\n\t\t\t\t\t\terror(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\r\n\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar _loop_1 = function (atlasPage) {\r\n\t\t\t\t\tvar pageLoadError = false;\r\n\t\t\t\t\t_this.loadTexture(atlasPage, function (imagePath, image) {\r\n\t\t\t\t\t\tpagesLoaded.count++;\r\n\t\t\t\t\t\tif (pagesLoaded.count == atlasPages.length) {\r\n\t\t\t\t\t\t\tif (!pageLoadError) {\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tvar atlas = new spine.TextureAtlas(atlasData, function (path) {\r\n\t\t\t\t\t\t\t\t\t\treturn _this.get(parent + \"/\" + path);\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t_this.assets[path] = atlas;\r\n\t\t\t\t\t\t\t\t\tif (success)\r\n\t\t\t\t\t\t\t\t\t\tsuccess(path, atlas);\r\n\t\t\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tcatch (e) {\r\n\t\t\t\t\t\t\t\t\tvar ex = e;\r\n\t\t\t\t\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\r\n\t\t\t\t\t\t\t\t\tif (error)\r\n\t\t\t\t\t\t\t\t\t\terror(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\r\n\t\t\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\r\n\t\t\t\t\t\t\t\tif (error)\r\n\t\t\t\t\t\t\t\t\terror(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\r\n\t\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, function (imagePath, errorMessage) {\r\n\t\t\t\t\t\tpageLoadError = true;\r\n\t\t\t\t\t\tpagesLoaded.count++;\r\n\t\t\t\t\t\tif (pagesLoaded.count == atlasPages.length) {\r\n\t\t\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\r\n\t\t\t\t\t\t\tif (error)\r\n\t\t\t\t\t\t\t\terror(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\r\n\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t};\r\n\t\t\t\tfor (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) {\r\n\t\t\t\t\tvar atlasPage = atlasPages_1[_i];\r\n\t\t\t\t\t_loop_1(atlasPage);\r\n\t\t\t\t}\r\n\t\t\t}, function (state, responseText) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText);\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t});\r\n\t\t};\r\n\t\tAssetManager.prototype.get = function (path) {\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\treturn this.assets[path];\r\n\t\t};\r\n\t\tAssetManager.prototype.remove = function (path) {\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tvar asset = this.assets[path];\r\n\t\t\tif (asset.dispose)\r\n\t\t\t\tasset.dispose();\r\n\t\t\tthis.assets[path] = null;\r\n\t\t};\r\n\t\tAssetManager.prototype.removeAll = function () {\r\n\t\t\tfor (var key in this.assets) {\r\n\t\t\t\tvar asset = this.assets[key];\r\n\t\t\t\tif (asset.dispose)\r\n\t\t\t\t\tasset.dispose();\r\n\t\t\t}\r\n\t\t\tthis.assets = {};\r\n\t\t};\r\n\t\tAssetManager.prototype.isLoadingComplete = function () {\r\n\t\t\treturn this.toLoad == 0;\r\n\t\t};\r\n\t\tAssetManager.prototype.getToLoad = function () {\r\n\t\t\treturn this.toLoad;\r\n\t\t};\r\n\t\tAssetManager.prototype.getLoaded = function () {\r\n\t\t\treturn this.loaded;\r\n\t\t};\r\n\t\tAssetManager.prototype.dispose = function () {\r\n\t\t\tthis.removeAll();\r\n\t\t};\r\n\t\tAssetManager.prototype.hasErrors = function () {\r\n\t\t\treturn Object.keys(this.errors).length > 0;\r\n\t\t};\r\n\t\tAssetManager.prototype.getErrors = function () {\r\n\t\t\treturn this.errors;\r\n\t\t};\r\n\t\treturn AssetManager;\r\n\t}());\r\n\tspine.AssetManager = AssetManager;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AtlasAttachmentLoader = (function () {\r\n\t\tfunction AtlasAttachmentLoader(atlas) {\r\n\t\t\tthis.atlas = atlas;\r\n\t\t}\r\n\t\tAtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) {\r\n\t\t\tvar region = this.atlas.findRegion(path);\r\n\t\t\tif (region == null)\r\n\t\t\t\tthrow new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n\t\t\tregion.renderObject = region;\r\n\t\t\tvar attachment = new spine.RegionAttachment(name);\r\n\t\t\tattachment.setRegion(region);\r\n\t\t\treturn attachment;\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {\r\n\t\t\tvar region = this.atlas.findRegion(path);\r\n\t\t\tif (region == null)\r\n\t\t\t\tthrow new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n\t\t\tregion.renderObject = region;\r\n\t\t\tvar attachment = new spine.MeshAttachment(name);\r\n\t\t\tattachment.region = region;\r\n\t\t\treturn attachment;\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\r\n\t\t\treturn new spine.BoundingBoxAttachment(name);\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\r\n\t\t\treturn new spine.PathAttachment(name);\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\r\n\t\t\treturn new spine.PointAttachment(name);\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\r\n\t\t\treturn new spine.ClippingAttachment(name);\r\n\t\t};\r\n\t\treturn AtlasAttachmentLoader;\r\n\t}());\r\n\tspine.AtlasAttachmentLoader = AtlasAttachmentLoader;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar BlendMode;\r\n\t(function (BlendMode) {\r\n\t\tBlendMode[BlendMode[\"Normal\"] = 0] = \"Normal\";\r\n\t\tBlendMode[BlendMode[\"Additive\"] = 1] = \"Additive\";\r\n\t\tBlendMode[BlendMode[\"Multiply\"] = 2] = \"Multiply\";\r\n\t\tBlendMode[BlendMode[\"Screen\"] = 3] = \"Screen\";\r\n\t})(BlendMode = spine.BlendMode || (spine.BlendMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Bone = (function () {\r\n\t\tfunction Bone(data, skeleton, parent) {\r\n\t\t\tthis.children = new Array();\r\n\t\t\tthis.x = 0;\r\n\t\t\tthis.y = 0;\r\n\t\t\tthis.rotation = 0;\r\n\t\t\tthis.scaleX = 0;\r\n\t\t\tthis.scaleY = 0;\r\n\t\t\tthis.shearX = 0;\r\n\t\t\tthis.shearY = 0;\r\n\t\t\tthis.ax = 0;\r\n\t\t\tthis.ay = 0;\r\n\t\t\tthis.arotation = 0;\r\n\t\t\tthis.ascaleX = 0;\r\n\t\t\tthis.ascaleY = 0;\r\n\t\t\tthis.ashearX = 0;\r\n\t\t\tthis.ashearY = 0;\r\n\t\t\tthis.appliedValid = false;\r\n\t\t\tthis.a = 0;\r\n\t\t\tthis.b = 0;\r\n\t\t\tthis.worldX = 0;\r\n\t\t\tthis.c = 0;\r\n\t\t\tthis.d = 0;\r\n\t\t\tthis.worldY = 0;\r\n\t\t\tthis.sorted = false;\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.skeleton = skeleton;\r\n\t\t\tthis.parent = parent;\r\n\t\t\tthis.setToSetupPose();\r\n\t\t}\r\n\t\tBone.prototype.update = function () {\r\n\t\t\tthis.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n\t\t};\r\n\t\tBone.prototype.updateWorldTransform = function () {\r\n\t\t\tthis.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n\t\t};\r\n\t\tBone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\r\n\t\t\tthis.ax = x;\r\n\t\t\tthis.ay = y;\r\n\t\t\tthis.arotation = rotation;\r\n\t\t\tthis.ascaleX = scaleX;\r\n\t\t\tthis.ascaleY = scaleY;\r\n\t\t\tthis.ashearX = shearX;\r\n\t\t\tthis.ashearY = shearY;\r\n\t\t\tthis.appliedValid = true;\r\n\t\t\tvar parent = this.parent;\r\n\t\t\tif (parent == null) {\r\n\t\t\t\tvar skeleton = this.skeleton;\r\n\t\t\t\tvar rotationY = rotation + 90 + shearY;\r\n\t\t\t\tvar sx = skeleton.scaleX;\r\n\t\t\t\tvar sy = skeleton.scaleY;\r\n\t\t\t\tthis.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\r\n\t\t\t\tthis.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx;\r\n\t\t\t\tthis.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\r\n\t\t\t\tthis.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;\r\n\t\t\t\tthis.worldX = x * sx + skeleton.x;\r\n\t\t\t\tthis.worldY = y * sy + skeleton.y;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\r\n\t\t\tthis.worldX = pa * x + pb * y + parent.worldX;\r\n\t\t\tthis.worldY = pc * x + pd * y + parent.worldY;\r\n\t\t\tswitch (this.data.transformMode) {\r\n\t\t\t\tcase spine.TransformMode.Normal: {\r\n\t\t\t\t\tvar rotationY = rotation + 90 + shearY;\r\n\t\t\t\t\tvar la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tvar lb = spine.MathUtils.cosDeg(rotationY) * scaleY;\r\n\t\t\t\t\tvar lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tvar ld = spine.MathUtils.sinDeg(rotationY) * scaleY;\r\n\t\t\t\t\tthis.a = pa * la + pb * lc;\r\n\t\t\t\t\tthis.b = pa * lb + pb * ld;\r\n\t\t\t\t\tthis.c = pc * la + pd * lc;\r\n\t\t\t\t\tthis.d = pc * lb + pd * ld;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcase spine.TransformMode.OnlyTranslation: {\r\n\t\t\t\t\tvar rotationY = rotation + 90 + shearY;\r\n\t\t\t\t\tthis.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tthis.b = spine.MathUtils.cosDeg(rotationY) * scaleY;\r\n\t\t\t\t\tthis.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tthis.d = spine.MathUtils.sinDeg(rotationY) * scaleY;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase spine.TransformMode.NoRotationOrReflection: {\r\n\t\t\t\t\tvar s = pa * pa + pc * pc;\r\n\t\t\t\t\tvar prx = 0;\r\n\t\t\t\t\tif (s > 0.0001) {\r\n\t\t\t\t\t\ts = Math.abs(pa * pd - pb * pc) / s;\r\n\t\t\t\t\t\tpb = pc * s;\r\n\t\t\t\t\t\tpd = pa * s;\r\n\t\t\t\t\t\tprx = Math.atan2(pc, pa) * spine.MathUtils.radDeg;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpa = 0;\r\n\t\t\t\t\t\tpc = 0;\r\n\t\t\t\t\t\tprx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar rx = rotation + shearX - prx;\r\n\t\t\t\t\tvar ry = rotation + shearY - prx + 90;\r\n\t\t\t\t\tvar la = spine.MathUtils.cosDeg(rx) * scaleX;\r\n\t\t\t\t\tvar lb = spine.MathUtils.cosDeg(ry) * scaleY;\r\n\t\t\t\t\tvar lc = spine.MathUtils.sinDeg(rx) * scaleX;\r\n\t\t\t\t\tvar ld = spine.MathUtils.sinDeg(ry) * scaleY;\r\n\t\t\t\t\tthis.a = pa * la - pb * lc;\r\n\t\t\t\t\tthis.b = pa * lb - pb * ld;\r\n\t\t\t\t\tthis.c = pc * la + pd * lc;\r\n\t\t\t\t\tthis.d = pc * lb + pd * ld;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase spine.TransformMode.NoScale:\r\n\t\t\t\tcase spine.TransformMode.NoScaleOrReflection: {\r\n\t\t\t\t\tvar cos = spine.MathUtils.cosDeg(rotation);\r\n\t\t\t\t\tvar sin = spine.MathUtils.sinDeg(rotation);\r\n\t\t\t\t\tvar za = (pa * cos + pb * sin) / this.skeleton.scaleX;\r\n\t\t\t\t\tvar zc = (pc * cos + pd * sin) / this.skeleton.scaleY;\r\n\t\t\t\t\tvar s = Math.sqrt(za * za + zc * zc);\r\n\t\t\t\t\tif (s > 0.00001)\r\n\t\t\t\t\t\ts = 1 / s;\r\n\t\t\t\t\tza *= s;\r\n\t\t\t\t\tzc *= s;\r\n\t\t\t\t\ts = Math.sqrt(za * za + zc * zc);\r\n\t\t\t\t\tif (this.data.transformMode == spine.TransformMode.NoScale\r\n\t\t\t\t\t\t&& (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0))\r\n\t\t\t\t\t\ts = -s;\r\n\t\t\t\t\tvar r = Math.PI / 2 + Math.atan2(zc, za);\r\n\t\t\t\t\tvar zb = Math.cos(r) * s;\r\n\t\t\t\t\tvar zd = Math.sin(r) * s;\r\n\t\t\t\t\tvar la = spine.MathUtils.cosDeg(shearX) * scaleX;\r\n\t\t\t\t\tvar lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;\r\n\t\t\t\t\tvar lc = spine.MathUtils.sinDeg(shearX) * scaleX;\r\n\t\t\t\t\tvar ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;\r\n\t\t\t\t\tthis.a = za * la + zb * lc;\r\n\t\t\t\t\tthis.b = za * lb + zb * ld;\r\n\t\t\t\t\tthis.c = zc * la + zd * lc;\r\n\t\t\t\t\tthis.d = zc * lb + zd * ld;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.a *= this.skeleton.scaleX;\r\n\t\t\tthis.b *= this.skeleton.scaleX;\r\n\t\t\tthis.c *= this.skeleton.scaleY;\r\n\t\t\tthis.d *= this.skeleton.scaleY;\r\n\t\t};\r\n\t\tBone.prototype.setToSetupPose = function () {\r\n\t\t\tvar data = this.data;\r\n\t\t\tthis.x = data.x;\r\n\t\t\tthis.y = data.y;\r\n\t\t\tthis.rotation = data.rotation;\r\n\t\t\tthis.scaleX = data.scaleX;\r\n\t\t\tthis.scaleY = data.scaleY;\r\n\t\t\tthis.shearX = data.shearX;\r\n\t\t\tthis.shearY = data.shearY;\r\n\t\t};\r\n\t\tBone.prototype.getWorldRotationX = function () {\r\n\t\t\treturn Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\tBone.prototype.getWorldRotationY = function () {\r\n\t\t\treturn Math.atan2(this.d, this.b) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\tBone.prototype.getWorldScaleX = function () {\r\n\t\t\treturn Math.sqrt(this.a * this.a + this.c * this.c);\r\n\t\t};\r\n\t\tBone.prototype.getWorldScaleY = function () {\r\n\t\t\treturn Math.sqrt(this.b * this.b + this.d * this.d);\r\n\t\t};\r\n\t\tBone.prototype.updateAppliedTransform = function () {\r\n\t\t\tthis.appliedValid = true;\r\n\t\t\tvar parent = this.parent;\r\n\t\t\tif (parent == null) {\r\n\t\t\t\tthis.ax = this.worldX;\r\n\t\t\t\tthis.ay = this.worldY;\r\n\t\t\t\tthis.arotation = Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\r\n\t\t\t\tthis.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);\r\n\t\t\t\tthis.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);\r\n\t\t\t\tthis.ashearX = 0;\r\n\t\t\t\tthis.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\r\n\t\t\tvar pid = 1 / (pa * pd - pb * pc);\r\n\t\t\tvar dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;\r\n\t\t\tthis.ax = (dx * pd * pid - dy * pb * pid);\r\n\t\t\tthis.ay = (dy * pa * pid - dx * pc * pid);\r\n\t\t\tvar ia = pid * pd;\r\n\t\t\tvar id = pid * pa;\r\n\t\t\tvar ib = pid * pb;\r\n\t\t\tvar ic = pid * pc;\r\n\t\t\tvar ra = ia * this.a - ib * this.c;\r\n\t\t\tvar rb = ia * this.b - ib * this.d;\r\n\t\t\tvar rc = id * this.c - ic * this.a;\r\n\t\t\tvar rd = id * this.d - ic * this.b;\r\n\t\t\tthis.ashearX = 0;\r\n\t\t\tthis.ascaleX = Math.sqrt(ra * ra + rc * rc);\r\n\t\t\tif (this.ascaleX > 0.0001) {\r\n\t\t\t\tvar det = ra * rd - rb * rc;\r\n\t\t\t\tthis.ascaleY = det / this.ascaleX;\r\n\t\t\t\tthis.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg;\r\n\t\t\t\tthis.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.ascaleX = 0;\r\n\t\t\t\tthis.ascaleY = Math.sqrt(rb * rb + rd * rd);\r\n\t\t\t\tthis.ashearY = 0;\r\n\t\t\t\tthis.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg;\r\n\t\t\t}\r\n\t\t};\r\n\t\tBone.prototype.worldToLocal = function (world) {\r\n\t\t\tvar a = this.a, b = this.b, c = this.c, d = this.d;\r\n\t\t\tvar invDet = 1 / (a * d - b * c);\r\n\t\t\tvar x = world.x - this.worldX, y = world.y - this.worldY;\r\n\t\t\tworld.x = (x * d * invDet - y * b * invDet);\r\n\t\t\tworld.y = (y * a * invDet - x * c * invDet);\r\n\t\t\treturn world;\r\n\t\t};\r\n\t\tBone.prototype.localToWorld = function (local) {\r\n\t\t\tvar x = local.x, y = local.y;\r\n\t\t\tlocal.x = x * this.a + y * this.b + this.worldX;\r\n\t\t\tlocal.y = x * this.c + y * this.d + this.worldY;\r\n\t\t\treturn local;\r\n\t\t};\r\n\t\tBone.prototype.worldToLocalRotation = function (worldRotation) {\r\n\t\t\tvar sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation);\r\n\t\t\treturn Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX;\r\n\t\t};\r\n\t\tBone.prototype.localToWorldRotation = function (localRotation) {\r\n\t\t\tlocalRotation -= this.rotation - this.shearX;\r\n\t\t\tvar sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation);\r\n\t\t\treturn Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\tBone.prototype.rotateWorld = function (degrees) {\r\n\t\t\tvar a = this.a, b = this.b, c = this.c, d = this.d;\r\n\t\t\tvar cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees);\r\n\t\t\tthis.a = cos * a - sin * c;\r\n\t\t\tthis.b = cos * b - sin * d;\r\n\t\t\tthis.c = sin * a + cos * c;\r\n\t\t\tthis.d = sin * b + cos * d;\r\n\t\t\tthis.appliedValid = false;\r\n\t\t};\r\n\t\treturn Bone;\r\n\t}());\r\n\tspine.Bone = Bone;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar BoneData = (function () {\r\n\t\tfunction BoneData(index, name, parent) {\r\n\t\t\tthis.x = 0;\r\n\t\t\tthis.y = 0;\r\n\t\t\tthis.rotation = 0;\r\n\t\t\tthis.scaleX = 1;\r\n\t\t\tthis.scaleY = 1;\r\n\t\t\tthis.shearX = 0;\r\n\t\t\tthis.shearY = 0;\r\n\t\t\tthis.transformMode = TransformMode.Normal;\r\n\t\t\tif (index < 0)\r\n\t\t\t\tthrow new Error(\"index must be >= 0.\");\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.index = index;\r\n\t\t\tthis.name = name;\r\n\t\t\tthis.parent = parent;\r\n\t\t}\r\n\t\treturn BoneData;\r\n\t}());\r\n\tspine.BoneData = BoneData;\r\n\tvar TransformMode;\r\n\t(function (TransformMode) {\r\n\t\tTransformMode[TransformMode[\"Normal\"] = 0] = \"Normal\";\r\n\t\tTransformMode[TransformMode[\"OnlyTranslation\"] = 1] = \"OnlyTranslation\";\r\n\t\tTransformMode[TransformMode[\"NoRotationOrReflection\"] = 2] = \"NoRotationOrReflection\";\r\n\t\tTransformMode[TransformMode[\"NoScale\"] = 3] = \"NoScale\";\r\n\t\tTransformMode[TransformMode[\"NoScaleOrReflection\"] = 4] = \"NoScaleOrReflection\";\r\n\t})(TransformMode = spine.TransformMode || (spine.TransformMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Event = (function () {\r\n\t\tfunction Event(time, data) {\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tthis.time = time;\r\n\t\t\tthis.data = data;\r\n\t\t}\r\n\t\treturn Event;\r\n\t}());\r\n\tspine.Event = Event;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar EventData = (function () {\r\n\t\tfunction EventData(name) {\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn EventData;\r\n\t}());\r\n\tspine.EventData = EventData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar IkConstraint = (function () {\r\n\t\tfunction IkConstraint(data, skeleton) {\r\n\t\t\tthis.bendDirection = 0;\r\n\t\t\tthis.compress = false;\r\n\t\t\tthis.stretch = false;\r\n\t\t\tthis.mix = 1;\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.mix = data.mix;\r\n\t\t\tthis.bendDirection = data.bendDirection;\r\n\t\t\tthis.compress = data.compress;\r\n\t\t\tthis.stretch = data.stretch;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0; i < data.bones.length; i++)\r\n\t\t\t\tthis.bones.push(skeleton.findBone(data.bones[i].name));\r\n\t\t\tthis.target = skeleton.findBone(data.target.name);\r\n\t\t}\r\n\t\tIkConstraint.prototype.getOrder = function () {\r\n\t\t\treturn this.data.order;\r\n\t\t};\r\n\t\tIkConstraint.prototype.apply = function () {\r\n\t\t\tthis.update();\r\n\t\t};\r\n\t\tIkConstraint.prototype.update = function () {\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tswitch (bones.length) {\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tthis.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tthis.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t};\r\n\t\tIkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\r\n\t\t\tif (!bone.appliedValid)\r\n\t\t\t\tbone.updateAppliedTransform();\r\n\t\t\tvar p = bone.parent;\r\n\t\t\tvar id = 1 / (p.a * p.d - p.b * p.c);\r\n\t\t\tvar x = targetX - p.worldX, y = targetY - p.worldY;\r\n\t\t\tvar tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay;\r\n\t\t\tvar rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation;\r\n\t\t\tif (bone.ascaleX < 0)\r\n\t\t\t\trotationIK += 180;\r\n\t\t\tif (rotationIK > 180)\r\n\t\t\t\trotationIK -= 360;\r\n\t\t\telse if (rotationIK < -180)\r\n\t\t\t\trotationIK += 360;\r\n\t\t\tvar sx = bone.ascaleX, sy = bone.ascaleY;\r\n\t\t\tif (compress || stretch) {\r\n\t\t\t\tvar b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\r\n\t\t\t\tif ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\r\n\t\t\t\t\tvar s = (dd / b - 1) * alpha + 1;\r\n\t\t\t\t\tsx *= s;\r\n\t\t\t\t\tif (uniform)\r\n\t\t\t\t\t\tsy *= s;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\r\n\t\t};\r\n\t\tIkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) {\r\n\t\t\tif (alpha == 0) {\r\n\t\t\t\tchild.updateWorldTransform();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!parent.appliedValid)\r\n\t\t\t\tparent.updateAppliedTransform();\r\n\t\t\tif (!child.appliedValid)\r\n\t\t\t\tchild.updateAppliedTransform();\r\n\t\t\tvar px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;\r\n\t\t\tvar os1 = 0, os2 = 0, s2 = 0;\r\n\t\t\tif (psx < 0) {\r\n\t\t\t\tpsx = -psx;\r\n\t\t\t\tos1 = 180;\r\n\t\t\t\ts2 = -1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tos1 = 0;\r\n\t\t\t\ts2 = 1;\r\n\t\t\t}\r\n\t\t\tif (psy < 0) {\r\n\t\t\t\tpsy = -psy;\r\n\t\t\t\ts2 = -s2;\r\n\t\t\t}\r\n\t\t\tif (csx < 0) {\r\n\t\t\t\tcsx = -csx;\r\n\t\t\t\tos2 = 180;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tos2 = 0;\r\n\t\t\tvar cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;\r\n\t\t\tvar u = Math.abs(psx - psy) <= 0.0001;\r\n\t\t\tif (!u) {\r\n\t\t\t\tcy = 0;\r\n\t\t\t\tcwx = a * cx + parent.worldX;\r\n\t\t\t\tcwy = c * cx + parent.worldY;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcy = child.ay;\r\n\t\t\t\tcwx = a * cx + b * cy + parent.worldX;\r\n\t\t\t\tcwy = c * cx + d * cy + parent.worldY;\r\n\t\t\t}\r\n\t\t\tvar pp = parent.parent;\r\n\t\t\ta = pp.a;\r\n\t\t\tb = pp.b;\r\n\t\t\tc = pp.c;\r\n\t\t\td = pp.d;\r\n\t\t\tvar id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY;\r\n\t\t\tvar tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty;\r\n\t\t\tx = cwx - pp.worldX;\r\n\t\t\ty = cwy - pp.worldY;\r\n\t\t\tvar dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n\t\t\tvar l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;\r\n\t\t\touter: if (u) {\r\n\t\t\t\tl2 *= psx;\r\n\t\t\t\tvar cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n\t\t\t\tif (cos < -1)\r\n\t\t\t\t\tcos = -1;\r\n\t\t\t\telse if (cos > 1) {\r\n\t\t\t\t\tcos = 1;\r\n\t\t\t\t\tif (stretch && l1 + l2 > 0.0001)\r\n\t\t\t\t\t\tsx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\r\n\t\t\t\t}\r\n\t\t\t\ta2 = Math.acos(cos) * bendDir;\r\n\t\t\t\ta = l1 + l2 * cos;\r\n\t\t\t\tb = l2 * Math.sin(a2);\r\n\t\t\t\ta1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ta = psx * l2;\r\n\t\t\t\tb = psy * l2;\r\n\t\t\t\tvar aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\r\n\t\t\t\tc = bb * l1 * l1 + aa * dd - aa * bb;\r\n\t\t\t\tvar c1 = -2 * bb * l1, c2 = bb - aa;\r\n\t\t\t\td = c1 * c1 - 4 * c2 * c;\r\n\t\t\t\tif (d >= 0) {\r\n\t\t\t\t\tvar q = Math.sqrt(d);\r\n\t\t\t\t\tif (c1 < 0)\r\n\t\t\t\t\t\tq = -q;\r\n\t\t\t\t\tq = -(c1 + q) / 2;\r\n\t\t\t\t\tvar r0 = q / c2, r1 = c / q;\r\n\t\t\t\t\tvar r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n\t\t\t\t\tif (r * r <= dd) {\r\n\t\t\t\t\t\ty = Math.sqrt(dd - r * r) * bendDir;\r\n\t\t\t\t\t\ta1 = ta - Math.atan2(y, r);\r\n\t\t\t\t\t\ta2 = Math.atan2(y / psy, (r - l1) / psx);\r\n\t\t\t\t\t\tbreak outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\r\n\t\t\t\tvar maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\r\n\t\t\t\tc = -a * l1 / (aa - bb);\r\n\t\t\t\tif (c >= -1 && c <= 1) {\r\n\t\t\t\t\tc = Math.acos(c);\r\n\t\t\t\t\tx = a * Math.cos(c) + l1;\r\n\t\t\t\t\ty = b * Math.sin(c);\r\n\t\t\t\t\td = x * x + y * y;\r\n\t\t\t\t\tif (d < minDist) {\r\n\t\t\t\t\t\tminAngle = c;\r\n\t\t\t\t\t\tminDist = d;\r\n\t\t\t\t\t\tminX = x;\r\n\t\t\t\t\t\tminY = y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (d > maxDist) {\r\n\t\t\t\t\t\tmaxAngle = c;\r\n\t\t\t\t\t\tmaxDist = d;\r\n\t\t\t\t\t\tmaxX = x;\r\n\t\t\t\t\t\tmaxY = y;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (dd <= (minDist + maxDist) / 2) {\r\n\t\t\t\t\ta1 = ta - Math.atan2(minY * bendDir, minX);\r\n\t\t\t\t\ta2 = minAngle * bendDir;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ta1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n\t\t\t\t\ta2 = maxAngle * bendDir;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar os = Math.atan2(cy, cx) * s2;\r\n\t\t\tvar rotation = parent.arotation;\r\n\t\t\ta1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation;\r\n\t\t\tif (a1 > 180)\r\n\t\t\t\ta1 -= 360;\r\n\t\t\telse if (a1 < -180)\r\n\t\t\t\ta1 += 360;\r\n\t\t\tparent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0);\r\n\t\t\trotation = child.arotation;\r\n\t\t\ta2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\r\n\t\t\tif (a2 > 180)\r\n\t\t\t\ta2 -= 360;\r\n\t\t\telse if (a2 < -180)\r\n\t\t\t\ta2 += 360;\r\n\t\t\tchild.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n\t\t};\r\n\t\treturn IkConstraint;\r\n\t}());\r\n\tspine.IkConstraint = IkConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar IkConstraintData = (function () {\r\n\t\tfunction IkConstraintData(name) {\r\n\t\t\tthis.order = 0;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.bendDirection = 1;\r\n\t\t\tthis.compress = false;\r\n\t\t\tthis.stretch = false;\r\n\t\t\tthis.uniform = false;\r\n\t\t\tthis.mix = 1;\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn IkConstraintData;\r\n\t}());\r\n\tspine.IkConstraintData = IkConstraintData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PathConstraint = (function () {\r\n\t\tfunction PathConstraint(data, skeleton) {\r\n\t\t\tthis.position = 0;\r\n\t\t\tthis.spacing = 0;\r\n\t\t\tthis.rotateMix = 0;\r\n\t\t\tthis.translateMix = 0;\r\n\t\t\tthis.spaces = new Array();\r\n\t\t\tthis.positions = new Array();\r\n\t\t\tthis.world = new Array();\r\n\t\t\tthis.curves = new Array();\r\n\t\t\tthis.lengths = new Array();\r\n\t\t\tthis.segments = new Array();\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0, n = data.bones.length; i < n; i++)\r\n\t\t\t\tthis.bones.push(skeleton.findBone(data.bones[i].name));\r\n\t\t\tthis.target = skeleton.findSlot(data.target.name);\r\n\t\t\tthis.position = data.position;\r\n\t\t\tthis.spacing = data.spacing;\r\n\t\t\tthis.rotateMix = data.rotateMix;\r\n\t\t\tthis.translateMix = data.translateMix;\r\n\t\t}\r\n\t\tPathConstraint.prototype.apply = function () {\r\n\t\t\tthis.update();\r\n\t\t};\r\n\t\tPathConstraint.prototype.update = function () {\r\n\t\t\tvar attachment = this.target.getAttachment();\r\n\t\t\tif (!(attachment instanceof spine.PathAttachment))\r\n\t\t\t\treturn;\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix;\r\n\t\t\tvar translate = translateMix > 0, rotate = rotateMix > 0;\r\n\t\t\tif (!translate && !rotate)\r\n\t\t\t\treturn;\r\n\t\t\tvar data = this.data;\r\n\t\t\tvar percentSpacing = data.spacingMode == spine.SpacingMode.Percent;\r\n\t\t\tvar rotateMode = data.rotateMode;\r\n\t\t\tvar tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale;\r\n\t\t\tvar boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tvar spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null;\r\n\t\t\tvar spacing = this.spacing;\r\n\t\t\tif (scale || !percentSpacing) {\r\n\t\t\t\tif (scale)\r\n\t\t\t\t\tlengths = spine.Utils.setArraySize(this.lengths, boneCount);\r\n\t\t\t\tvar lengthSpacing = data.spacingMode == spine.SpacingMode.Length;\r\n\t\t\t\tfor (var i = 0, n = spacesCount - 1; i < n;) {\r\n\t\t\t\t\tvar bone = bones[i];\r\n\t\t\t\t\tvar setupLength = bone.data.length;\r\n\t\t\t\t\tif (setupLength < PathConstraint.epsilon) {\r\n\t\t\t\t\t\tif (scale)\r\n\t\t\t\t\t\t\tlengths[i] = 0;\r\n\t\t\t\t\t\tspaces[++i] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (percentSpacing) {\r\n\t\t\t\t\t\tif (scale) {\r\n\t\t\t\t\t\t\tvar x = setupLength * bone.a, y = setupLength * bone.c;\r\n\t\t\t\t\t\t\tvar length_1 = Math.sqrt(x * x + y * y);\r\n\t\t\t\t\t\t\tlengths[i] = length_1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tspaces[++i] = spacing;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar x = setupLength * bone.a, y = setupLength * bone.c;\r\n\t\t\t\t\t\tvar length_2 = Math.sqrt(x * x + y * y);\r\n\t\t\t\t\t\tif (scale)\r\n\t\t\t\t\t\t\tlengths[i] = length_2;\r\n\t\t\t\t\t\tspaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfor (var i = 1; i < spacesCount; i++)\r\n\t\t\t\t\tspaces[i] = spacing;\r\n\t\t\t}\r\n\t\t\tvar positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing);\r\n\t\t\tvar boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n\t\t\tvar tip = false;\r\n\t\t\tif (offsetRotation == 0)\r\n\t\t\t\ttip = rotateMode == spine.RotateMode.Chain;\r\n\t\t\telse {\r\n\t\t\t\ttip = false;\r\n\t\t\t\tvar p = this.target.bone;\r\n\t\t\t\toffsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tbone.worldX += (boneX - bone.worldX) * translateMix;\r\n\t\t\t\tbone.worldY += (boneY - bone.worldY) * translateMix;\r\n\t\t\t\tvar x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n\t\t\t\tif (scale) {\r\n\t\t\t\t\tvar length_3 = lengths[i];\r\n\t\t\t\t\tif (length_3 != 0) {\r\n\t\t\t\t\t\tvar s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1;\r\n\t\t\t\t\t\tbone.a *= s;\r\n\t\t\t\t\t\tbone.c *= s;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tboneX = x;\r\n\t\t\t\tboneY = y;\r\n\t\t\t\tif (rotate) {\r\n\t\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;\r\n\t\t\t\t\tif (tangents)\r\n\t\t\t\t\t\tr = positions[p - 1];\r\n\t\t\t\t\telse if (spaces[i + 1] == 0)\r\n\t\t\t\t\t\tr = positions[p + 2];\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tr = Math.atan2(dy, dx);\r\n\t\t\t\t\tr -= Math.atan2(c, a);\r\n\t\t\t\t\tif (tip) {\r\n\t\t\t\t\t\tcos = Math.cos(r);\r\n\t\t\t\t\t\tsin = Math.sin(r);\r\n\t\t\t\t\t\tvar length_4 = bone.data.length;\r\n\t\t\t\t\t\tboneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix;\r\n\t\t\t\t\t\tboneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tr += offsetRotation;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr *= rotateMix;\r\n\t\t\t\t\tcos = Math.cos(r);\r\n\t\t\t\t\tsin = Math.sin(r);\r\n\t\t\t\t\tbone.a = cos * a - sin * c;\r\n\t\t\t\t\tbone.b = cos * b - sin * d;\r\n\t\t\t\t\tbone.c = sin * a + cos * c;\r\n\t\t\t\t\tbone.d = sin * b + cos * d;\r\n\t\t\t\t}\r\n\t\t\t\tbone.appliedValid = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tPathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar position = this.position;\r\n\t\t\tvar spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;\r\n\t\t\tvar closed = path.closed;\r\n\t\t\tvar verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n\t\t\tif (!path.constantSpeed) {\r\n\t\t\t\tvar lengths = path.lengths;\r\n\t\t\t\tcurveCount -= closed ? 1 : 2;\r\n\t\t\t\tvar pathLength_1 = lengths[curveCount];\r\n\t\t\t\tif (percentPosition)\r\n\t\t\t\t\tposition *= pathLength_1;\r\n\t\t\t\tif (percentSpacing) {\r\n\t\t\t\t\tfor (var i = 1; i < spacesCount; i++)\r\n\t\t\t\t\t\tspaces[i] *= pathLength_1;\r\n\t\t\t\t}\r\n\t\t\t\tworld = spine.Utils.setArraySize(this.world, 8);\r\n\t\t\t\tfor (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n\t\t\t\t\tvar space = spaces[i];\r\n\t\t\t\t\tposition += space;\r\n\t\t\t\t\tvar p = position;\r\n\t\t\t\t\tif (closed) {\r\n\t\t\t\t\t\tp %= pathLength_1;\r\n\t\t\t\t\t\tif (p < 0)\r\n\t\t\t\t\t\t\tp += pathLength_1;\r\n\t\t\t\t\t\tcurve = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (p < 0) {\r\n\t\t\t\t\t\tif (prevCurve != PathConstraint.BEFORE) {\r\n\t\t\t\t\t\t\tprevCurve = PathConstraint.BEFORE;\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, 2, 4, world, 0, 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (p > pathLength_1) {\r\n\t\t\t\t\t\tif (prevCurve != PathConstraint.AFTER) {\r\n\t\t\t\t\t\t\tprevCurve = PathConstraint.AFTER;\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.addAfterPosition(p - pathLength_1, world, 0, out, o);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfor (;; curve++) {\r\n\t\t\t\t\t\tvar length_5 = lengths[curve];\r\n\t\t\t\t\t\tif (p > length_5)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tif (curve == 0)\r\n\t\t\t\t\t\t\tp /= length_5;\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tvar prev = lengths[curve - 1];\r\n\t\t\t\t\t\t\tp = (p - prev) / (length_5 - prev);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (curve != prevCurve) {\r\n\t\t\t\t\t\tprevCurve = curve;\r\n\t\t\t\t\t\tif (closed && curve == curveCount) {\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, 0, 4, world, 4, 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\r\n\t\t\t\t}\r\n\t\t\t\treturn out;\r\n\t\t\t}\r\n\t\t\tif (closed) {\r\n\t\t\t\tverticesLength += 2;\r\n\t\t\t\tworld = spine.Utils.setArraySize(this.world, verticesLength);\r\n\t\t\t\tpath.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\r\n\t\t\t\tpath.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\r\n\t\t\t\tworld[verticesLength - 2] = world[0];\r\n\t\t\t\tworld[verticesLength - 1] = world[1];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcurveCount--;\r\n\t\t\t\tverticesLength -= 4;\r\n\t\t\t\tworld = spine.Utils.setArraySize(this.world, verticesLength);\r\n\t\t\t\tpath.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\r\n\t\t\t}\r\n\t\t\tvar curves = spine.Utils.setArraySize(this.curves, curveCount);\r\n\t\t\tvar pathLength = 0;\r\n\t\t\tvar x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n\t\t\tvar tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n\t\t\tfor (var i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n\t\t\t\tcx1 = world[w];\r\n\t\t\t\tcy1 = world[w + 1];\r\n\t\t\t\tcx2 = world[w + 2];\r\n\t\t\t\tcy2 = world[w + 3];\r\n\t\t\t\tx2 = world[w + 4];\r\n\t\t\t\ty2 = world[w + 5];\r\n\t\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n\t\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n\t\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n\t\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n\t\t\t\tddfx = tmpx * 2 + dddfx;\r\n\t\t\t\tddfy = tmpy * 2 + dddfy;\r\n\t\t\t\tdfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n\t\t\t\tdfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tdfx += ddfx;\r\n\t\t\t\tdfy += ddfy;\r\n\t\t\t\tddfx += dddfx;\r\n\t\t\t\tddfy += dddfy;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tdfx += ddfx;\r\n\t\t\t\tdfy += ddfy;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tdfx += ddfx + dddfx;\r\n\t\t\t\tdfy += ddfy + dddfy;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tcurves[i] = pathLength;\r\n\t\t\t\tx1 = x2;\r\n\t\t\t\ty1 = y2;\r\n\t\t\t}\r\n\t\t\tif (percentPosition)\r\n\t\t\t\tposition *= pathLength;\r\n\t\t\telse\r\n\t\t\t\tposition *= pathLength / path.lengths[curveCount - 1];\r\n\t\t\tif (percentSpacing) {\r\n\t\t\t\tfor (var i = 1; i < spacesCount; i++)\r\n\t\t\t\t\tspaces[i] *= pathLength;\r\n\t\t\t}\r\n\t\t\tvar segments = this.segments;\r\n\t\t\tvar curveLength = 0;\r\n\t\t\tfor (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n\t\t\t\tvar space = spaces[i];\r\n\t\t\t\tposition += space;\r\n\t\t\t\tvar p = position;\r\n\t\t\t\tif (closed) {\r\n\t\t\t\t\tp %= pathLength;\r\n\t\t\t\t\tif (p < 0)\r\n\t\t\t\t\t\tp += pathLength;\r\n\t\t\t\t\tcurve = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse if (p < 0) {\r\n\t\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\telse if (p > pathLength) {\r\n\t\t\t\t\tthis.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tfor (;; curve++) {\r\n\t\t\t\t\tvar length_6 = curves[curve];\r\n\t\t\t\t\tif (p > length_6)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (curve == 0)\r\n\t\t\t\t\t\tp /= length_6;\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar prev = curves[curve - 1];\r\n\t\t\t\t\t\tp = (p - prev) / (length_6 - prev);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (curve != prevCurve) {\r\n\t\t\t\t\tprevCurve = curve;\r\n\t\t\t\t\tvar ii = curve * 6;\r\n\t\t\t\t\tx1 = world[ii];\r\n\t\t\t\t\ty1 = world[ii + 1];\r\n\t\t\t\t\tcx1 = world[ii + 2];\r\n\t\t\t\t\tcy1 = world[ii + 3];\r\n\t\t\t\t\tcx2 = world[ii + 4];\r\n\t\t\t\t\tcy2 = world[ii + 5];\r\n\t\t\t\t\tx2 = world[ii + 6];\r\n\t\t\t\t\ty2 = world[ii + 7];\r\n\t\t\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n\t\t\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n\t\t\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n\t\t\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n\t\t\t\t\tddfx = tmpx * 2 + dddfx;\r\n\t\t\t\t\tddfy = tmpy * 2 + dddfy;\r\n\t\t\t\t\tdfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n\t\t\t\t\tdfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n\t\t\t\t\tcurveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\tsegments[0] = curveLength;\r\n\t\t\t\t\tfor (ii = 1; ii < 8; ii++) {\r\n\t\t\t\t\t\tdfx += ddfx;\r\n\t\t\t\t\t\tdfy += ddfy;\r\n\t\t\t\t\t\tddfx += dddfx;\r\n\t\t\t\t\t\tddfy += dddfy;\r\n\t\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\t\tsegments[ii] = curveLength;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdfx += ddfx;\r\n\t\t\t\t\tdfy += ddfy;\r\n\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\tsegments[8] = curveLength;\r\n\t\t\t\t\tdfx += ddfx + dddfx;\r\n\t\t\t\t\tdfy += ddfy + dddfy;\r\n\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\tsegments[9] = curveLength;\r\n\t\t\t\t\tsegment = 0;\r\n\t\t\t\t}\r\n\t\t\t\tp *= curveLength;\r\n\t\t\t\tfor (;; segment++) {\r\n\t\t\t\t\tvar length_7 = segments[segment];\r\n\t\t\t\t\tif (p > length_7)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (segment == 0)\r\n\t\t\t\t\t\tp /= length_7;\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar prev = segments[segment - 1];\r\n\t\t\t\t\t\tp = segment + (p - prev) / (length_7 - prev);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tthis.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n\t\t\t}\r\n\t\t\treturn out;\r\n\t\t};\r\n\t\tPathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\r\n\t\t\tvar x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n\t\t\tout[o] = x1 + p * Math.cos(r);\r\n\t\t\tout[o + 1] = y1 + p * Math.sin(r);\r\n\t\t\tout[o + 2] = r;\r\n\t\t};\r\n\t\tPathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\r\n\t\t\tvar x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n\t\t\tout[o] = x1 + p * Math.cos(r);\r\n\t\t\tout[o + 1] = y1 + p * Math.sin(r);\r\n\t\t\tout[o + 2] = r;\r\n\t\t};\r\n\t\tPathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\r\n\t\t\tif (p == 0 || isNaN(p)) {\r\n\t\t\t\tout[o] = x1;\r\n\t\t\t\tout[o + 1] = y1;\r\n\t\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n\t\t\tvar ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n\t\t\tvar x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n\t\t\tout[o] = x;\r\n\t\t\tout[o + 1] = y;\r\n\t\t\tif (tangents) {\r\n\t\t\t\tif (p < 0.001)\r\n\t\t\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n\t\t\t\telse\r\n\t\t\t\t\tout[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n\t\t\t}\r\n\t\t};\r\n\t\tPathConstraint.prototype.getOrder = function () {\r\n\t\t\treturn this.data.order;\r\n\t\t};\r\n\t\tPathConstraint.NONE = -1;\r\n\t\tPathConstraint.BEFORE = -2;\r\n\t\tPathConstraint.AFTER = -3;\r\n\t\tPathConstraint.epsilon = 0.00001;\r\n\t\treturn PathConstraint;\r\n\t}());\r\n\tspine.PathConstraint = PathConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PathConstraintData = (function () {\r\n\t\tfunction PathConstraintData(name) {\r\n\t\t\tthis.order = 0;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn PathConstraintData;\r\n\t}());\r\n\tspine.PathConstraintData = PathConstraintData;\r\n\tvar PositionMode;\r\n\t(function (PositionMode) {\r\n\t\tPositionMode[PositionMode[\"Fixed\"] = 0] = \"Fixed\";\r\n\t\tPositionMode[PositionMode[\"Percent\"] = 1] = \"Percent\";\r\n\t})(PositionMode = spine.PositionMode || (spine.PositionMode = {}));\r\n\tvar SpacingMode;\r\n\t(function (SpacingMode) {\r\n\t\tSpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\r\n\t\tSpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\r\n\t\tSpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\r\n\t})(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {}));\r\n\tvar RotateMode;\r\n\t(function (RotateMode) {\r\n\t\tRotateMode[RotateMode[\"Tangent\"] = 0] = \"Tangent\";\r\n\t\tRotateMode[RotateMode[\"Chain\"] = 1] = \"Chain\";\r\n\t\tRotateMode[RotateMode[\"ChainScale\"] = 2] = \"ChainScale\";\r\n\t})(RotateMode = spine.RotateMode || (spine.RotateMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Assets = (function () {\r\n\t\tfunction Assets(clientId) {\r\n\t\t\tthis.toLoad = new Array();\r\n\t\t\tthis.assets = {};\r\n\t\t\tthis.clientId = clientId;\r\n\t\t}\r\n\t\tAssets.prototype.loaded = function () {\r\n\t\t\tvar i = 0;\r\n\t\t\tfor (var v in this.assets)\r\n\t\t\t\ti++;\r\n\t\t\treturn i;\r\n\t\t};\r\n\t\treturn Assets;\r\n\t}());\r\n\tvar SharedAssetManager = (function () {\r\n\t\tfunction SharedAssetManager(pathPrefix) {\r\n\t\t\tif (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n\t\t\tthis.clientAssets = {};\r\n\t\t\tthis.queuedAssets = {};\r\n\t\t\tthis.rawAssets = {};\r\n\t\t\tthis.errors = {};\r\n\t\t\tthis.pathPrefix = pathPrefix;\r\n\t\t}\r\n\t\tSharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) {\r\n\t\t\tvar clientAssets = this.clientAssets[clientId];\r\n\t\t\tif (clientAssets === null || clientAssets === undefined) {\r\n\t\t\t\tclientAssets = new Assets(clientId);\r\n\t\t\t\tthis.clientAssets[clientId] = clientAssets;\r\n\t\t\t}\r\n\t\t\tif (textureLoader !== null)\r\n\t\t\t\tclientAssets.textureLoader = textureLoader;\r\n\t\t\tclientAssets.toLoad.push(path);\r\n\t\t\tif (this.queuedAssets[path] === path) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.queuedAssets[path] = path;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.loadText = function (clientId, path) {\r\n\t\t\tvar _this = this;\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tif (!this.queueAsset(clientId, null, path))\r\n\t\t\t\treturn;\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.onreadystatechange = function () {\r\n\t\t\t\tif (request.readyState == XMLHttpRequest.DONE) {\r\n\t\t\t\t\tif (request.status >= 200 && request.status < 300) {\r\n\t\t\t\t\t\t_this.rawAssets[path] = request.responseText;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t_this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.open(\"GET\", path, true);\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.loadJson = function (clientId, path) {\r\n\t\t\tvar _this = this;\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tif (!this.queueAsset(clientId, null, path))\r\n\t\t\t\treturn;\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.onreadystatechange = function () {\r\n\t\t\t\tif (request.readyState == XMLHttpRequest.DONE) {\r\n\t\t\t\t\tif (request.status >= 200 && request.status < 300) {\r\n\t\t\t\t\t\t_this.rawAssets[path] = JSON.parse(request.responseText);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t_this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.open(\"GET\", path, true);\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) {\r\n\t\t\tvar _this = this;\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tif (!this.queueAsset(clientId, textureLoader, path))\r\n\t\t\t\treturn;\r\n\t\t\tvar img = new Image();\r\n\t\t\timg.src = path;\r\n\t\t\timg.crossOrigin = \"anonymous\";\r\n\t\t\timg.onload = function (ev) {\r\n\t\t\t\t_this.rawAssets[path] = img;\r\n\t\t\t};\r\n\t\t\timg.onerror = function (ev) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load image \" + path;\r\n\t\t\t};\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.get = function (clientId, path) {\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tvar clientAssets = this.clientAssets[clientId];\r\n\t\t\tif (clientAssets === null || clientAssets === undefined)\r\n\t\t\t\treturn true;\r\n\t\t\treturn clientAssets.assets[path];\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.updateClientAssets = function (clientAssets) {\r\n\t\t\tfor (var i = 0; i < clientAssets.toLoad.length; i++) {\r\n\t\t\t\tvar path = clientAssets.toLoad[i];\r\n\t\t\t\tvar asset = clientAssets.assets[path];\r\n\t\t\t\tif (asset === null || asset === undefined) {\r\n\t\t\t\t\tvar rawAsset = this.rawAssets[path];\r\n\t\t\t\t\tif (rawAsset === null || rawAsset === undefined)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (rawAsset instanceof HTMLImageElement) {\r\n\t\t\t\t\t\tclientAssets.assets[path] = clientAssets.textureLoader(rawAsset);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tclientAssets.assets[path] = rawAsset;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.isLoadingComplete = function (clientId) {\r\n\t\t\tvar clientAssets = this.clientAssets[clientId];\r\n\t\t\tif (clientAssets === null || clientAssets === undefined)\r\n\t\t\t\treturn true;\r\n\t\t\tthis.updateClientAssets(clientAssets);\r\n\t\t\treturn clientAssets.toLoad.length == clientAssets.loaded();\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.dispose = function () {\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.hasErrors = function () {\r\n\t\t\treturn Object.keys(this.errors).length > 0;\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.getErrors = function () {\r\n\t\t\treturn this.errors;\r\n\t\t};\r\n\t\treturn SharedAssetManager;\r\n\t}());\r\n\tspine.SharedAssetManager = SharedAssetManager;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Skeleton = (function () {\r\n\t\tfunction Skeleton(data) {\r\n\t\t\tthis._updateCache = new Array();\r\n\t\t\tthis.updateCacheReset = new Array();\r\n\t\t\tthis.time = 0;\r\n\t\t\tthis.scaleX = 1;\r\n\t\t\tthis.scaleY = 1;\r\n\t\t\tthis.x = 0;\r\n\t\t\tthis.y = 0;\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0; i < data.bones.length; i++) {\r\n\t\t\t\tvar boneData = data.bones[i];\r\n\t\t\t\tvar bone = void 0;\r\n\t\t\t\tif (boneData.parent == null)\r\n\t\t\t\t\tbone = new spine.Bone(boneData, this, null);\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar parent_1 = this.bones[boneData.parent.index];\r\n\t\t\t\t\tbone = new spine.Bone(boneData, this, parent_1);\r\n\t\t\t\t\tparent_1.children.push(bone);\r\n\t\t\t\t}\r\n\t\t\t\tthis.bones.push(bone);\r\n\t\t\t}\r\n\t\t\tthis.slots = new Array();\r\n\t\t\tthis.drawOrder = new Array();\r\n\t\t\tfor (var i = 0; i < data.slots.length; i++) {\r\n\t\t\t\tvar slotData = data.slots[i];\r\n\t\t\t\tvar bone = this.bones[slotData.boneData.index];\r\n\t\t\t\tvar slot = new spine.Slot(slotData, bone);\r\n\t\t\t\tthis.slots.push(slot);\r\n\t\t\t\tthis.drawOrder.push(slot);\r\n\t\t\t}\r\n\t\t\tthis.ikConstraints = new Array();\r\n\t\t\tfor (var i = 0; i < data.ikConstraints.length; i++) {\r\n\t\t\t\tvar ikConstraintData = data.ikConstraints[i];\r\n\t\t\t\tthis.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this));\r\n\t\t\t}\r\n\t\t\tthis.transformConstraints = new Array();\r\n\t\t\tfor (var i = 0; i < data.transformConstraints.length; i++) {\r\n\t\t\t\tvar transformConstraintData = data.transformConstraints[i];\r\n\t\t\t\tthis.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this));\r\n\t\t\t}\r\n\t\t\tthis.pathConstraints = new Array();\r\n\t\t\tfor (var i = 0; i < data.pathConstraints.length; i++) {\r\n\t\t\t\tvar pathConstraintData = data.pathConstraints[i];\r\n\t\t\t\tthis.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this));\r\n\t\t\t}\r\n\t\t\tthis.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\tthis.updateCache();\r\n\t\t}\r\n\t\tSkeleton.prototype.updateCache = function () {\r\n\t\t\tvar updateCache = this._updateCache;\r\n\t\t\tupdateCache.length = 0;\r\n\t\t\tthis.updateCacheReset.length = 0;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tbones[i].sorted = false;\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tvar ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\r\n\t\t\tvar constraintCount = ikCount + transformCount + pathCount;\r\n\t\t\touter: for (var i = 0; i < constraintCount; i++) {\r\n\t\t\t\tfor (var ii = 0; ii < ikCount; ii++) {\r\n\t\t\t\t\tvar constraint = ikConstraints[ii];\r\n\t\t\t\t\tif (constraint.data.order == i) {\r\n\t\t\t\t\t\tthis.sortIkConstraint(constraint);\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor (var ii = 0; ii < transformCount; ii++) {\r\n\t\t\t\t\tvar constraint = transformConstraints[ii];\r\n\t\t\t\t\tif (constraint.data.order == i) {\r\n\t\t\t\t\t\tthis.sortTransformConstraint(constraint);\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor (var ii = 0; ii < pathCount; ii++) {\r\n\t\t\t\t\tvar constraint = pathConstraints[ii];\r\n\t\t\t\t\tif (constraint.data.order == i) {\r\n\t\t\t\t\t\tthis.sortPathConstraint(constraint);\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tthis.sortBone(bones[i]);\r\n\t\t};\r\n\t\tSkeleton.prototype.sortIkConstraint = function (constraint) {\r\n\t\t\tvar target = constraint.target;\r\n\t\t\tthis.sortBone(target);\r\n\t\t\tvar constrained = constraint.bones;\r\n\t\t\tvar parent = constrained[0];\r\n\t\t\tthis.sortBone(parent);\r\n\t\t\tif (constrained.length > 1) {\r\n\t\t\t\tvar child = constrained[constrained.length - 1];\r\n\t\t\t\tif (!(this._updateCache.indexOf(child) > -1))\r\n\t\t\t\t\tthis.updateCacheReset.push(child);\r\n\t\t\t}\r\n\t\t\tthis._updateCache.push(constraint);\r\n\t\t\tthis.sortReset(parent.children);\r\n\t\t\tconstrained[constrained.length - 1].sorted = true;\r\n\t\t};\r\n\t\tSkeleton.prototype.sortPathConstraint = function (constraint) {\r\n\t\t\tvar slot = constraint.target;\r\n\t\t\tvar slotIndex = slot.data.index;\r\n\t\t\tvar slotBone = slot.bone;\r\n\t\t\tif (this.skin != null)\r\n\t\t\t\tthis.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n\t\t\tif (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\r\n\t\t\t\tthis.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n\t\t\tfor (var i = 0, n = this.data.skins.length; i < n; i++)\r\n\t\t\t\tthis.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\r\n\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\tif (attachment instanceof spine.PathAttachment)\r\n\t\t\t\tthis.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n\t\t\tvar constrained = constraint.bones;\r\n\t\t\tvar boneCount = constrained.length;\r\n\t\t\tfor (var i = 0; i < boneCount; i++)\r\n\t\t\t\tthis.sortBone(constrained[i]);\r\n\t\t\tthis._updateCache.push(constraint);\r\n\t\t\tfor (var i = 0; i < boneCount; i++)\r\n\t\t\t\tthis.sortReset(constrained[i].children);\r\n\t\t\tfor (var i = 0; i < boneCount; i++)\r\n\t\t\t\tconstrained[i].sorted = true;\r\n\t\t};\r\n\t\tSkeleton.prototype.sortTransformConstraint = function (constraint) {\r\n\t\t\tthis.sortBone(constraint.target);\r\n\t\t\tvar constrained = constraint.bones;\r\n\t\t\tvar boneCount = constrained.length;\r\n\t\t\tif (constraint.data.local) {\r\n\t\t\t\tfor (var i = 0; i < boneCount; i++) {\r\n\t\t\t\t\tvar child = constrained[i];\r\n\t\t\t\t\tthis.sortBone(child.parent);\r\n\t\t\t\t\tif (!(this._updateCache.indexOf(child) > -1))\r\n\t\t\t\t\t\tthis.updateCacheReset.push(child);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfor (var i = 0; i < boneCount; i++) {\r\n\t\t\t\t\tthis.sortBone(constrained[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis._updateCache.push(constraint);\r\n\t\t\tfor (var ii = 0; ii < boneCount; ii++)\r\n\t\t\t\tthis.sortReset(constrained[ii].children);\r\n\t\t\tfor (var ii = 0; ii < boneCount; ii++)\r\n\t\t\t\tconstrained[ii].sorted = true;\r\n\t\t};\r\n\t\tSkeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\r\n\t\t\tvar attachments = skin.attachments[slotIndex];\r\n\t\t\tif (!attachments)\r\n\t\t\t\treturn;\r\n\t\t\tfor (var key in attachments) {\r\n\t\t\t\tthis.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\r\n\t\t\tif (!(attachment instanceof spine.PathAttachment))\r\n\t\t\t\treturn;\r\n\t\t\tvar pathBones = attachment.bones;\r\n\t\t\tif (pathBones == null)\r\n\t\t\t\tthis.sortBone(slotBone);\r\n\t\t\telse {\r\n\t\t\t\tvar bones = this.bones;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\twhile (i < pathBones.length) {\r\n\t\t\t\t\tvar boneCount = pathBones[i++];\r\n\t\t\t\t\tfor (var n = i + boneCount; i < n; i++) {\r\n\t\t\t\t\t\tvar boneIndex = pathBones[i];\r\n\t\t\t\t\t\tthis.sortBone(bones[boneIndex]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.sortBone = function (bone) {\r\n\t\t\tif (bone.sorted)\r\n\t\t\t\treturn;\r\n\t\t\tvar parent = bone.parent;\r\n\t\t\tif (parent != null)\r\n\t\t\t\tthis.sortBone(parent);\r\n\t\t\tbone.sorted = true;\r\n\t\t\tthis._updateCache.push(bone);\r\n\t\t};\r\n\t\tSkeleton.prototype.sortReset = function (bones) {\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (bone.sorted)\r\n\t\t\t\t\tthis.sortReset(bone.children);\r\n\t\t\t\tbone.sorted = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.updateWorldTransform = function () {\r\n\t\t\tvar updateCacheReset = this.updateCacheReset;\r\n\t\t\tfor (var i = 0, n = updateCacheReset.length; i < n; i++) {\r\n\t\t\t\tvar bone = updateCacheReset[i];\r\n\t\t\t\tbone.ax = bone.x;\r\n\t\t\t\tbone.ay = bone.y;\r\n\t\t\t\tbone.arotation = bone.rotation;\r\n\t\t\t\tbone.ascaleX = bone.scaleX;\r\n\t\t\t\tbone.ascaleY = bone.scaleY;\r\n\t\t\t\tbone.ashearX = bone.shearX;\r\n\t\t\t\tbone.ashearY = bone.shearY;\r\n\t\t\t\tbone.appliedValid = true;\r\n\t\t\t}\r\n\t\t\tvar updateCache = this._updateCache;\r\n\t\t\tfor (var i = 0, n = updateCache.length; i < n; i++)\r\n\t\t\t\tupdateCache[i].update();\r\n\t\t};\r\n\t\tSkeleton.prototype.setToSetupPose = function () {\r\n\t\t\tthis.setBonesToSetupPose();\r\n\t\t\tthis.setSlotsToSetupPose();\r\n\t\t};\r\n\t\tSkeleton.prototype.setBonesToSetupPose = function () {\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tbones[i].setToSetupPose();\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tfor (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = ikConstraints[i];\r\n\t\t\t\tconstraint.mix = constraint.data.mix;\r\n\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t}\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tfor (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = transformConstraints[i];\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tconstraint.rotateMix = data.rotateMix;\r\n\t\t\t\tconstraint.translateMix = data.translateMix;\r\n\t\t\t\tconstraint.scaleMix = data.scaleMix;\r\n\t\t\t\tconstraint.shearMix = data.shearMix;\r\n\t\t\t}\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = pathConstraints[i];\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tconstraint.position = data.position;\r\n\t\t\t\tconstraint.spacing = data.spacing;\r\n\t\t\t\tconstraint.rotateMix = data.rotateMix;\r\n\t\t\t\tconstraint.translateMix = data.translateMix;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.setSlotsToSetupPose = function () {\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tspine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++)\r\n\t\t\t\tslots[i].setToSetupPose();\r\n\t\t};\r\n\t\tSkeleton.prototype.getRootBone = function () {\r\n\t\t\tif (this.bones.length == 0)\r\n\t\t\t\treturn null;\r\n\t\t\treturn this.bones[0];\r\n\t\t};\r\n\t\tSkeleton.prototype.findBone = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (bone.data.name == boneName)\r\n\t\t\t\t\treturn bone;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findBoneIndex = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tif (bones[i].data.name == boneName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeleton.prototype.findSlot = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tif (slot.data.name == slotName)\r\n\t\t\t\t\treturn slot;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findSlotIndex = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++)\r\n\t\t\t\tif (slots[i].data.name == slotName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeleton.prototype.setSkinByName = function (skinName) {\r\n\t\t\tvar skin = this.data.findSkin(skinName);\r\n\t\t\tif (skin == null)\r\n\t\t\t\tthrow new Error(\"Skin not found: \" + skinName);\r\n\t\t\tthis.setSkin(skin);\r\n\t\t};\r\n\t\tSkeleton.prototype.setSkin = function (newSkin) {\r\n\t\t\tif (newSkin != null) {\r\n\t\t\t\tif (this.skin != null)\r\n\t\t\t\t\tnewSkin.attachAll(this, this.skin);\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar slots = this.slots;\r\n\t\t\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\t\t\tvar slot = slots[i];\r\n\t\t\t\t\t\tvar name_1 = slot.data.attachmentName;\r\n\t\t\t\t\t\tif (name_1 != null) {\r\n\t\t\t\t\t\t\tvar attachment = newSkin.getAttachment(i, name_1);\r\n\t\t\t\t\t\t\tif (attachment != null)\r\n\t\t\t\t\t\t\t\tslot.setAttachment(attachment);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.skin = newSkin;\r\n\t\t};\r\n\t\tSkeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\r\n\t\t\treturn this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\r\n\t\t};\r\n\t\tSkeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\r\n\t\t\tif (attachmentName == null)\r\n\t\t\t\tthrow new Error(\"attachmentName cannot be null.\");\r\n\t\t\tif (this.skin != null) {\r\n\t\t\t\tvar attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n\t\t\t\tif (attachment != null)\r\n\t\t\t\t\treturn attachment;\r\n\t\t\t}\r\n\t\t\tif (this.data.defaultSkin != null)\r\n\t\t\t\treturn this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.setAttachment = function (slotName, attachmentName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tif (slot.data.name == slotName) {\r\n\t\t\t\t\tvar attachment = null;\r\n\t\t\t\t\tif (attachmentName != null) {\r\n\t\t\t\t\t\tattachment = this.getAttachment(i, attachmentName);\r\n\t\t\t\t\t\tif (attachment == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tslot.setAttachment(attachment);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthrow new Error(\"Slot not found: \" + slotName);\r\n\t\t};\r\n\t\tSkeleton.prototype.findIkConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tfor (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n\t\t\t\tvar ikConstraint = ikConstraints[i];\r\n\t\t\t\tif (ikConstraint.data.name == constraintName)\r\n\t\t\t\t\treturn ikConstraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findTransformConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tfor (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = transformConstraints[i];\r\n\t\t\t\tif (constraint.data.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findPathConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = pathConstraints[i];\r\n\t\t\t\tif (constraint.data.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.getBounds = function (offset, size, temp) {\r\n\t\t\tif (temp === void 0) { temp = new Array(2); }\r\n\t\t\tif (offset == null)\r\n\t\t\t\tthrow new Error(\"offset cannot be null.\");\r\n\t\t\tif (size == null)\r\n\t\t\t\tthrow new Error(\"size cannot be null.\");\r\n\t\t\tvar drawOrder = this.drawOrder;\r\n\t\t\tvar minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n\t\t\tfor (var i = 0, n = drawOrder.length; i < n; i++) {\r\n\t\t\t\tvar slot = drawOrder[i];\r\n\t\t\t\tvar verticesLength = 0;\r\n\t\t\t\tvar vertices = null;\r\n\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\tif (attachment instanceof spine.RegionAttachment) {\r\n\t\t\t\t\tverticesLength = 8;\r\n\t\t\t\t\tvertices = spine.Utils.setArraySize(temp, verticesLength, 0);\r\n\t\t\t\t\tattachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n\t\t\t\t}\r\n\t\t\t\telse if (attachment instanceof spine.MeshAttachment) {\r\n\t\t\t\t\tvar mesh = attachment;\r\n\t\t\t\t\tverticesLength = mesh.worldVerticesLength;\r\n\t\t\t\t\tvertices = spine.Utils.setArraySize(temp, verticesLength, 0);\r\n\t\t\t\t\tmesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\r\n\t\t\t\t}\r\n\t\t\t\tif (vertices != null) {\r\n\t\t\t\t\tfor (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\r\n\t\t\t\t\t\tvar x = vertices[ii], y = vertices[ii + 1];\r\n\t\t\t\t\t\tminX = Math.min(minX, x);\r\n\t\t\t\t\t\tminY = Math.min(minY, y);\r\n\t\t\t\t\t\tmaxX = Math.max(maxX, x);\r\n\t\t\t\t\t\tmaxY = Math.max(maxY, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\toffset.set(minX, minY);\r\n\t\t\tsize.set(maxX - minX, maxY - minY);\r\n\t\t};\r\n\t\tSkeleton.prototype.update = function (delta) {\r\n\t\t\tthis.time += delta;\r\n\t\t};\r\n\t\treturn Skeleton;\r\n\t}());\r\n\tspine.Skeleton = Skeleton;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonBounds = (function () {\r\n\t\tfunction SkeletonBounds() {\r\n\t\t\tthis.minX = 0;\r\n\t\t\tthis.minY = 0;\r\n\t\t\tthis.maxX = 0;\r\n\t\t\tthis.maxY = 0;\r\n\t\t\tthis.boundingBoxes = new Array();\r\n\t\t\tthis.polygons = new Array();\r\n\t\t\tthis.polygonPool = new spine.Pool(function () {\r\n\t\t\t\treturn spine.Utils.newFloatArray(16);\r\n\t\t\t});\r\n\t\t}\r\n\t\tSkeletonBounds.prototype.update = function (skeleton, updateAabb) {\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tvar boundingBoxes = this.boundingBoxes;\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tvar polygonPool = this.polygonPool;\r\n\t\t\tvar slots = skeleton.slots;\r\n\t\t\tvar slotCount = slots.length;\r\n\t\t\tboundingBoxes.length = 0;\r\n\t\t\tpolygonPool.freeAll(polygons);\r\n\t\t\tpolygons.length = 0;\r\n\t\t\tfor (var i = 0; i < slotCount; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\tif (attachment instanceof spine.BoundingBoxAttachment) {\r\n\t\t\t\t\tvar boundingBox = attachment;\r\n\t\t\t\t\tboundingBoxes.push(boundingBox);\r\n\t\t\t\t\tvar polygon = polygonPool.obtain();\r\n\t\t\t\t\tif (polygon.length != boundingBox.worldVerticesLength) {\r\n\t\t\t\t\t\tpolygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpolygons.push(polygon);\r\n\t\t\t\t\tboundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (updateAabb) {\r\n\t\t\t\tthis.aabbCompute();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.minX = Number.POSITIVE_INFINITY;\r\n\t\t\t\tthis.minY = Number.POSITIVE_INFINITY;\r\n\t\t\t\tthis.maxX = Number.NEGATIVE_INFINITY;\r\n\t\t\t\tthis.maxY = Number.NEGATIVE_INFINITY;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbCompute = function () {\r\n\t\t\tvar minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tfor (var i = 0, n = polygons.length; i < n; i++) {\r\n\t\t\t\tvar polygon = polygons[i];\r\n\t\t\t\tvar vertices = polygon;\r\n\t\t\t\tfor (var ii = 0, nn = polygon.length; ii < nn; ii += 2) {\r\n\t\t\t\t\tvar x = vertices[ii];\r\n\t\t\t\t\tvar y = vertices[ii + 1];\r\n\t\t\t\t\tminX = Math.min(minX, x);\r\n\t\t\t\t\tminY = Math.min(minY, y);\r\n\t\t\t\t\tmaxX = Math.max(maxX, x);\r\n\t\t\t\t\tmaxY = Math.max(maxY, y);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.minX = minX;\r\n\t\t\tthis.minY = minY;\r\n\t\t\tthis.maxX = maxX;\r\n\t\t\tthis.maxY = maxY;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbContainsPoint = function (x, y) {\r\n\t\t\treturn x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) {\r\n\t\t\tvar minX = this.minX;\r\n\t\t\tvar minY = this.minY;\r\n\t\t\tvar maxX = this.maxX;\r\n\t\t\tvar maxY = this.maxY;\r\n\t\t\tif ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\r\n\t\t\t\treturn false;\r\n\t\t\tvar m = (y2 - y1) / (x2 - x1);\r\n\t\t\tvar y = m * (minX - x1) + y1;\r\n\t\t\tif (y > minY && y < maxY)\r\n\t\t\t\treturn true;\r\n\t\t\ty = m * (maxX - x1) + y1;\r\n\t\t\tif (y > minY && y < maxY)\r\n\t\t\t\treturn true;\r\n\t\t\tvar x = (minY - y1) / m + x1;\r\n\t\t\tif (x > minX && x < maxX)\r\n\t\t\t\treturn true;\r\n\t\t\tx = (maxY - y1) / m + x1;\r\n\t\t\tif (x > minX && x < maxX)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) {\r\n\t\t\treturn this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.containsPoint = function (x, y) {\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tfor (var i = 0, n = polygons.length; i < n; i++)\r\n\t\t\t\tif (this.containsPointPolygon(polygons[i], x, y))\r\n\t\t\t\t\treturn this.boundingBoxes[i];\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) {\r\n\t\t\tvar vertices = polygon;\r\n\t\t\tvar nn = polygon.length;\r\n\t\t\tvar prevIndex = nn - 2;\r\n\t\t\tvar inside = false;\r\n\t\t\tfor (var ii = 0; ii < nn; ii += 2) {\r\n\t\t\t\tvar vertexY = vertices[ii + 1];\r\n\t\t\t\tvar prevY = vertices[prevIndex + 1];\r\n\t\t\t\tif ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\r\n\t\t\t\t\tvar vertexX = vertices[ii];\r\n\t\t\t\t\tif (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x)\r\n\t\t\t\t\t\tinside = !inside;\r\n\t\t\t\t}\r\n\t\t\t\tprevIndex = ii;\r\n\t\t\t}\r\n\t\t\treturn inside;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) {\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tfor (var i = 0, n = polygons.length; i < n; i++)\r\n\t\t\t\tif (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2))\r\n\t\t\t\t\treturn this.boundingBoxes[i];\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) {\r\n\t\t\tvar vertices = polygon;\r\n\t\t\tvar nn = polygon.length;\r\n\t\t\tvar width12 = x1 - x2, height12 = y1 - y2;\r\n\t\t\tvar det1 = x1 * y2 - y1 * x2;\r\n\t\t\tvar x3 = vertices[nn - 2], y3 = vertices[nn - 1];\r\n\t\t\tfor (var ii = 0; ii < nn; ii += 2) {\r\n\t\t\t\tvar x4 = vertices[ii], y4 = vertices[ii + 1];\r\n\t\t\t\tvar det2 = x3 * y4 - y3 * x4;\r\n\t\t\t\tvar width34 = x3 - x4, height34 = y3 - y4;\r\n\t\t\t\tvar det3 = width12 * height34 - height12 * width34;\r\n\t\t\t\tvar x = (det1 * width34 - width12 * det2) / det3;\r\n\t\t\t\tif (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\r\n\t\t\t\t\tvar y = (det1 * height34 - height12 * det2) / det3;\r\n\t\t\t\t\tif (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1)))\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tx3 = x4;\r\n\t\t\t\ty3 = y4;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.getPolygon = function (boundingBox) {\r\n\t\t\tif (boundingBox == null)\r\n\t\t\t\tthrow new Error(\"boundingBox cannot be null.\");\r\n\t\t\tvar index = this.boundingBoxes.indexOf(boundingBox);\r\n\t\t\treturn index == -1 ? null : this.polygons[index];\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.getWidth = function () {\r\n\t\t\treturn this.maxX - this.minX;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.getHeight = function () {\r\n\t\t\treturn this.maxY - this.minY;\r\n\t\t};\r\n\t\treturn SkeletonBounds;\r\n\t}());\r\n\tspine.SkeletonBounds = SkeletonBounds;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonClipping = (function () {\r\n\t\tfunction SkeletonClipping() {\r\n\t\t\tthis.triangulator = new spine.Triangulator();\r\n\t\t\tthis.clippingPolygon = new Array();\r\n\t\t\tthis.clipOutput = new Array();\r\n\t\t\tthis.clippedVertices = new Array();\r\n\t\t\tthis.clippedTriangles = new Array();\r\n\t\t\tthis.scratch = new Array();\r\n\t\t}\r\n\t\tSkeletonClipping.prototype.clipStart = function (slot, clip) {\r\n\t\t\tif (this.clipAttachment != null)\r\n\t\t\t\treturn 0;\r\n\t\t\tthis.clipAttachment = clip;\r\n\t\t\tvar n = clip.worldVerticesLength;\r\n\t\t\tvar vertices = spine.Utils.setArraySize(this.clippingPolygon, n);\r\n\t\t\tclip.computeWorldVertices(slot, 0, n, vertices, 0, 2);\r\n\t\t\tvar clippingPolygon = this.clippingPolygon;\r\n\t\t\tSkeletonClipping.makeClockwise(clippingPolygon);\r\n\t\t\tvar clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));\r\n\t\t\tfor (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) {\r\n\t\t\t\tvar polygon = clippingPolygons[i];\r\n\t\t\t\tSkeletonClipping.makeClockwise(polygon);\r\n\t\t\t\tpolygon.push(polygon[0]);\r\n\t\t\t\tpolygon.push(polygon[1]);\r\n\t\t\t}\r\n\t\t\treturn clippingPolygons.length;\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clipEndWithSlot = function (slot) {\r\n\t\t\tif (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data)\r\n\t\t\t\tthis.clipEnd();\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clipEnd = function () {\r\n\t\t\tif (this.clipAttachment == null)\r\n\t\t\t\treturn;\r\n\t\t\tthis.clipAttachment = null;\r\n\t\t\tthis.clippingPolygons = null;\r\n\t\t\tthis.clippedVertices.length = 0;\r\n\t\t\tthis.clippedTriangles.length = 0;\r\n\t\t\tthis.clippingPolygon.length = 0;\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.isClipping = function () {\r\n\t\t\treturn this.clipAttachment != null;\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) {\r\n\t\t\tvar clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\r\n\t\t\tvar clippedTriangles = this.clippedTriangles;\r\n\t\t\tvar polygons = this.clippingPolygons;\r\n\t\t\tvar polygonsCount = this.clippingPolygons.length;\r\n\t\t\tvar vertexSize = twoColor ? 12 : 8;\r\n\t\t\tvar index = 0;\r\n\t\t\tclippedVertices.length = 0;\r\n\t\t\tclippedTriangles.length = 0;\r\n\t\t\touter: for (var i = 0; i < trianglesLength; i += 3) {\r\n\t\t\t\tvar vertexOffset = triangles[i] << 1;\r\n\t\t\t\tvar x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\r\n\t\t\t\tvar u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\r\n\t\t\t\tvertexOffset = triangles[i + 1] << 1;\r\n\t\t\t\tvar x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\r\n\t\t\t\tvar u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\r\n\t\t\t\tvertexOffset = triangles[i + 2] << 1;\r\n\t\t\t\tvar x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\r\n\t\t\t\tvar u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\r\n\t\t\t\tfor (var p = 0; p < polygonsCount; p++) {\r\n\t\t\t\t\tvar s = clippedVertices.length;\r\n\t\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\r\n\t\t\t\t\t\tvar clipOutputLength = clipOutput.length;\r\n\t\t\t\t\t\tif (clipOutputLength == 0)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tvar d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\r\n\t\t\t\t\t\tvar d = 1 / (d0 * d2 + d1 * (y1 - y3));\r\n\t\t\t\t\t\tvar clipOutputCount = clipOutputLength >> 1;\r\n\t\t\t\t\t\tvar clipOutputItems = this.clipOutput;\r\n\t\t\t\t\t\tvar clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < clipOutputLength; ii += 2) {\r\n\t\t\t\t\t\t\tvar x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\r\n\t\t\t\t\t\t\tclippedVerticesItems[s] = x;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\r\n\t\t\t\t\t\t\tvar c0 = x - x3, c1 = y - y3;\r\n\t\t\t\t\t\t\tvar a = (d0 * c0 + d1 * c1) * d;\r\n\t\t\t\t\t\t\tvar b = (d4 * c0 + d2 * c1) * d;\r\n\t\t\t\t\t\t\tvar c = 1 - a - b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;\r\n\t\t\t\t\t\t\tif (twoColor) {\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ts += vertexSize;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ts = clippedTriangles.length;\r\n\t\t\t\t\t\tvar clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\r\n\t\t\t\t\t\tclipOutputCount--;\r\n\t\t\t\t\t\tfor (var ii = 1; ii < clipOutputCount; ii++) {\r\n\t\t\t\t\t\t\tclippedTrianglesItems[s] = index;\r\n\t\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\r\n\t\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\r\n\t\t\t\t\t\t\ts += 3;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tindex += clipOutputCount + 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize);\r\n\t\t\t\t\t\tclippedVerticesItems[s] = x1;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\r\n\t\t\t\t\t\tif (!twoColor) {\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = x2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = y2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 12] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 13] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 14] = u2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 15] = v2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 16] = x3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 17] = y3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 18] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 19] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 20] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 21] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 22] = u3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 23] = v3;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 12] = x2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 13] = y2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 14] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 15] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 16] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 17] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 18] = u2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 19] = v2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 20] = dark.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 21] = dark.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 22] = dark.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 23] = dark.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 24] = x3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 25] = y3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 26] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 27] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 28] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 29] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 30] = u3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 31] = v3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 32] = dark.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 33] = dark.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 34] = dark.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 35] = dark.a;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ts = clippedTriangles.length;\r\n\t\t\t\t\t\tvar clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3);\r\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\r\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\r\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\r\n\t\t\t\t\t\tindex += 3;\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) {\r\n\t\t\tvar originalOutput = output;\r\n\t\t\tvar clipped = false;\r\n\t\t\tvar input = null;\r\n\t\t\tif (clippingArea.length % 4 >= 2) {\r\n\t\t\t\tinput = output;\r\n\t\t\t\toutput = this.scratch;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tinput = this.scratch;\r\n\t\t\tinput.length = 0;\r\n\t\t\tinput.push(x1);\r\n\t\t\tinput.push(y1);\r\n\t\t\tinput.push(x2);\r\n\t\t\tinput.push(y2);\r\n\t\t\tinput.push(x3);\r\n\t\t\tinput.push(y3);\r\n\t\t\tinput.push(x1);\r\n\t\t\tinput.push(y1);\r\n\t\t\toutput.length = 0;\r\n\t\t\tvar clippingVertices = clippingArea;\r\n\t\t\tvar clippingVerticesLast = clippingArea.length - 4;\r\n\t\t\tfor (var i = 0;; i += 2) {\r\n\t\t\t\tvar edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];\r\n\t\t\t\tvar edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3];\r\n\t\t\t\tvar deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2;\r\n\t\t\t\tvar inputVertices = input;\r\n\t\t\t\tvar inputVerticesLength = input.length - 2, outputStart = output.length;\r\n\t\t\t\tfor (var ii = 0; ii < inputVerticesLength; ii += 2) {\r\n\t\t\t\t\tvar inputX = inputVertices[ii], inputY = inputVertices[ii + 1];\r\n\t\t\t\t\tvar inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3];\r\n\t\t\t\t\tvar side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0;\r\n\t\t\t\t\tif (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) {\r\n\t\t\t\t\t\tif (side2) {\r\n\t\t\t\t\t\t\toutput.push(inputX2);\r\n\t\t\t\t\t\t\toutput.push(inputY2);\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar c0 = inputY2 - inputY, c2 = inputX2 - inputX;\r\n\t\t\t\t\t\tvar s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\r\n\t\t\t\t\t\tif (Math.abs(s) > 0.000001) {\r\n\t\t\t\t\t\t\tvar ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\r\n\t\t\t\t\t\t\toutput.push(edgeX + (edgeX2 - edgeX) * ua);\r\n\t\t\t\t\t\t\toutput.push(edgeY + (edgeY2 - edgeY) * ua);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\toutput.push(edgeX);\r\n\t\t\t\t\t\t\toutput.push(edgeY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (side2) {\r\n\t\t\t\t\t\tvar c0 = inputY2 - inputY, c2 = inputX2 - inputX;\r\n\t\t\t\t\t\tvar s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\r\n\t\t\t\t\t\tif (Math.abs(s) > 0.000001) {\r\n\t\t\t\t\t\t\tvar ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\r\n\t\t\t\t\t\t\toutput.push(edgeX + (edgeX2 - edgeX) * ua);\r\n\t\t\t\t\t\t\toutput.push(edgeY + (edgeY2 - edgeY) * ua);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\toutput.push(edgeX);\r\n\t\t\t\t\t\t\toutput.push(edgeY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\toutput.push(inputX2);\r\n\t\t\t\t\t\toutput.push(inputY2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclipped = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (outputStart == output.length) {\r\n\t\t\t\t\toriginalOutput.length = 0;\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\toutput.push(output[0]);\r\n\t\t\t\toutput.push(output[1]);\r\n\t\t\t\tif (i == clippingVerticesLast)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tvar temp = output;\r\n\t\t\t\toutput = input;\r\n\t\t\t\toutput.length = 0;\r\n\t\t\t\tinput = temp;\r\n\t\t\t}\r\n\t\t\tif (originalOutput != output) {\r\n\t\t\t\toriginalOutput.length = 0;\r\n\t\t\t\tfor (var i = 0, n = output.length - 2; i < n; i++)\r\n\t\t\t\t\toriginalOutput[i] = output[i];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\toriginalOutput.length = originalOutput.length - 2;\r\n\t\t\treturn clipped;\r\n\t\t};\r\n\t\tSkeletonClipping.makeClockwise = function (polygon) {\r\n\t\t\tvar vertices = polygon;\r\n\t\t\tvar verticeslength = polygon.length;\r\n\t\t\tvar area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;\r\n\t\t\tfor (var i = 0, n = verticeslength - 3; i < n; i += 2) {\r\n\t\t\t\tp1x = vertices[i];\r\n\t\t\t\tp1y = vertices[i + 1];\r\n\t\t\t\tp2x = vertices[i + 2];\r\n\t\t\t\tp2y = vertices[i + 3];\r\n\t\t\t\tarea += p1x * p2y - p2x * p1y;\r\n\t\t\t}\r\n\t\t\tif (area < 0)\r\n\t\t\t\treturn;\r\n\t\t\tfor (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {\r\n\t\t\t\tvar x = vertices[i], y = vertices[i + 1];\r\n\t\t\t\tvar other = lastX - i;\r\n\t\t\t\tvertices[i] = vertices[other];\r\n\t\t\t\tvertices[i + 1] = vertices[other + 1];\r\n\t\t\t\tvertices[other] = x;\r\n\t\t\t\tvertices[other + 1] = y;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn SkeletonClipping;\r\n\t}());\r\n\tspine.SkeletonClipping = SkeletonClipping;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonData = (function () {\r\n\t\tfunction SkeletonData() {\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.slots = new Array();\r\n\t\t\tthis.skins = new Array();\r\n\t\t\tthis.events = new Array();\r\n\t\t\tthis.animations = new Array();\r\n\t\t\tthis.ikConstraints = new Array();\r\n\t\t\tthis.transformConstraints = new Array();\r\n\t\t\tthis.pathConstraints = new Array();\r\n\t\t\tthis.fps = 0;\r\n\t\t}\r\n\t\tSkeletonData.prototype.findBone = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (bone.name == boneName)\r\n\t\t\t\t\treturn bone;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findBoneIndex = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tif (bones[i].name == boneName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findSlot = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tif (slot.name == slotName)\r\n\t\t\t\t\treturn slot;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findSlotIndex = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++)\r\n\t\t\t\tif (slots[i].name == slotName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findSkin = function (skinName) {\r\n\t\t\tif (skinName == null)\r\n\t\t\t\tthrow new Error(\"skinName cannot be null.\");\r\n\t\t\tvar skins = this.skins;\r\n\t\t\tfor (var i = 0, n = skins.length; i < n; i++) {\r\n\t\t\t\tvar skin = skins[i];\r\n\t\t\t\tif (skin.name == skinName)\r\n\t\t\t\t\treturn skin;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findEvent = function (eventDataName) {\r\n\t\t\tif (eventDataName == null)\r\n\t\t\t\tthrow new Error(\"eventDataName cannot be null.\");\r\n\t\t\tvar events = this.events;\r\n\t\t\tfor (var i = 0, n = events.length; i < n; i++) {\r\n\t\t\t\tvar event_4 = events[i];\r\n\t\t\t\tif (event_4.name == eventDataName)\r\n\t\t\t\t\treturn event_4;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findAnimation = function (animationName) {\r\n\t\t\tif (animationName == null)\r\n\t\t\t\tthrow new Error(\"animationName cannot be null.\");\r\n\t\t\tvar animations = this.animations;\r\n\t\t\tfor (var i = 0, n = animations.length; i < n; i++) {\r\n\t\t\t\tvar animation = animations[i];\r\n\t\t\t\tif (animation.name == animationName)\r\n\t\t\t\t\treturn animation;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findIkConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tfor (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = ikConstraints[i];\r\n\t\t\t\tif (constraint.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findTransformConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tfor (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = transformConstraints[i];\r\n\t\t\t\tif (constraint.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findPathConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = pathConstraints[i];\r\n\t\t\t\tif (constraint.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\r\n\t\t\tif (pathConstraintName == null)\r\n\t\t\t\tthrow new Error(\"pathConstraintName cannot be null.\");\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++)\r\n\t\t\t\tif (pathConstraints[i].name == pathConstraintName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\treturn SkeletonData;\r\n\t}());\r\n\tspine.SkeletonData = SkeletonData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonJson = (function () {\r\n\t\tfunction SkeletonJson(attachmentLoader) {\r\n\t\t\tthis.scale = 1;\r\n\t\t\tthis.linkedMeshes = new Array();\r\n\t\t\tthis.attachmentLoader = attachmentLoader;\r\n\t\t}\r\n\t\tSkeletonJson.prototype.readSkeletonData = function (json) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tvar skeletonData = new spine.SkeletonData();\r\n\t\t\tvar root = typeof (json) === \"string\" ? JSON.parse(json) : json;\r\n\t\t\tvar skeletonMap = root.skeleton;\r\n\t\t\tif (skeletonMap != null) {\r\n\t\t\t\tskeletonData.hash = skeletonMap.hash;\r\n\t\t\t\tskeletonData.version = skeletonMap.spine;\r\n\t\t\t\tskeletonData.width = skeletonMap.width;\r\n\t\t\t\tskeletonData.height = skeletonMap.height;\r\n\t\t\t\tskeletonData.fps = skeletonMap.fps;\r\n\t\t\t\tskeletonData.imagesPath = skeletonMap.images;\r\n\t\t\t}\r\n\t\t\tif (root.bones) {\r\n\t\t\t\tfor (var i = 0; i < root.bones.length; i++) {\r\n\t\t\t\t\tvar boneMap = root.bones[i];\r\n\t\t\t\t\tvar parent_2 = null;\r\n\t\t\t\t\tvar parentName = this.getValue(boneMap, \"parent\", null);\r\n\t\t\t\t\tif (parentName != null) {\r\n\t\t\t\t\t\tparent_2 = skeletonData.findBone(parentName);\r\n\t\t\t\t\t\tif (parent_2 == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Parent bone not found: \" + parentName);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2);\r\n\t\t\t\t\tdata.length = this.getValue(boneMap, \"length\", 0) * scale;\r\n\t\t\t\t\tdata.x = this.getValue(boneMap, \"x\", 0) * scale;\r\n\t\t\t\t\tdata.y = this.getValue(boneMap, \"y\", 0) * scale;\r\n\t\t\t\t\tdata.rotation = this.getValue(boneMap, \"rotation\", 0);\r\n\t\t\t\t\tdata.scaleX = this.getValue(boneMap, \"scaleX\", 1);\r\n\t\t\t\t\tdata.scaleY = this.getValue(boneMap, \"scaleY\", 1);\r\n\t\t\t\t\tdata.shearX = this.getValue(boneMap, \"shearX\", 0);\r\n\t\t\t\t\tdata.shearY = this.getValue(boneMap, \"shearY\", 0);\r\n\t\t\t\t\tdata.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\r\n\t\t\t\t\tskeletonData.bones.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.slots) {\r\n\t\t\t\tfor (var i = 0; i < root.slots.length; i++) {\r\n\t\t\t\t\tvar slotMap = root.slots[i];\r\n\t\t\t\t\tvar slotName = slotMap.name;\r\n\t\t\t\t\tvar boneName = slotMap.bone;\r\n\t\t\t\t\tvar boneData = skeletonData.findBone(boneName);\r\n\t\t\t\t\tif (boneData == null)\r\n\t\t\t\t\t\tthrow new Error(\"Slot bone not found: \" + boneName);\r\n\t\t\t\t\tvar data = new spine.SlotData(skeletonData.slots.length, slotName, boneData);\r\n\t\t\t\t\tvar color = this.getValue(slotMap, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tdata.color.setFromString(color);\r\n\t\t\t\t\tvar dark = this.getValue(slotMap, \"dark\", null);\r\n\t\t\t\t\tif (dark != null) {\r\n\t\t\t\t\t\tdata.darkColor = new spine.Color(1, 1, 1, 1);\r\n\t\t\t\t\t\tdata.darkColor.setFromString(dark);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata.attachmentName = this.getValue(slotMap, \"attachment\", null);\r\n\t\t\t\t\tdata.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\r\n\t\t\t\t\tskeletonData.slots.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.ik) {\r\n\t\t\t\tfor (var i = 0; i < root.ik.length; i++) {\r\n\t\t\t\t\tvar constraintMap = root.ik[i];\r\n\t\t\t\t\tvar data = new spine.IkConstraintData(constraintMap.name);\r\n\t\t\t\t\tdata.order = this.getValue(constraintMap, \"order\", 0);\r\n\t\t\t\t\tfor (var j = 0; j < constraintMap.bones.length; j++) {\r\n\t\t\t\t\t\tvar boneName = constraintMap.bones[j];\r\n\t\t\t\t\t\tvar bone = skeletonData.findBone(boneName);\r\n\t\t\t\t\t\tif (bone == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"IK bone not found: \" + boneName);\r\n\t\t\t\t\t\tdata.bones.push(bone);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar targetName = constraintMap.target;\r\n\t\t\t\t\tdata.target = skeletonData.findBone(targetName);\r\n\t\t\t\t\tif (data.target == null)\r\n\t\t\t\t\t\tthrow new Error(\"IK target bone not found: \" + targetName);\r\n\t\t\t\t\tdata.mix = this.getValue(constraintMap, \"mix\", 1);\r\n\t\t\t\t\tdata.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n\t\t\t\t\tdata.compress = this.getValue(constraintMap, \"compress\", false);\r\n\t\t\t\t\tdata.stretch = this.getValue(constraintMap, \"stretch\", false);\r\n\t\t\t\t\tdata.uniform = this.getValue(constraintMap, \"uniform\", false);\r\n\t\t\t\t\tskeletonData.ikConstraints.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.transform) {\r\n\t\t\t\tfor (var i = 0; i < root.transform.length; i++) {\r\n\t\t\t\t\tvar constraintMap = root.transform[i];\r\n\t\t\t\t\tvar data = new spine.TransformConstraintData(constraintMap.name);\r\n\t\t\t\t\tdata.order = this.getValue(constraintMap, \"order\", 0);\r\n\t\t\t\t\tfor (var j = 0; j < constraintMap.bones.length; j++) {\r\n\t\t\t\t\t\tvar boneName = constraintMap.bones[j];\r\n\t\t\t\t\t\tvar bone = skeletonData.findBone(boneName);\r\n\t\t\t\t\t\tif (bone == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Transform constraint bone not found: \" + boneName);\r\n\t\t\t\t\t\tdata.bones.push(bone);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar targetName = constraintMap.target;\r\n\t\t\t\t\tdata.target = skeletonData.findBone(targetName);\r\n\t\t\t\t\tif (data.target == null)\r\n\t\t\t\t\t\tthrow new Error(\"Transform constraint target bone not found: \" + targetName);\r\n\t\t\t\t\tdata.local = this.getValue(constraintMap, \"local\", false);\r\n\t\t\t\t\tdata.relative = this.getValue(constraintMap, \"relative\", false);\r\n\t\t\t\t\tdata.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n\t\t\t\t\tdata.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\r\n\t\t\t\t\tdata.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\r\n\t\t\t\t\tdata.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\r\n\t\t\t\t\tdata.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\r\n\t\t\t\t\tdata.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\r\n\t\t\t\t\tdata.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n\t\t\t\t\tdata.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n\t\t\t\t\tdata.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\r\n\t\t\t\t\tdata.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\r\n\t\t\t\t\tskeletonData.transformConstraints.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.path) {\r\n\t\t\t\tfor (var i = 0; i < root.path.length; i++) {\r\n\t\t\t\t\tvar constraintMap = root.path[i];\r\n\t\t\t\t\tvar data = new spine.PathConstraintData(constraintMap.name);\r\n\t\t\t\t\tdata.order = this.getValue(constraintMap, \"order\", 0);\r\n\t\t\t\t\tfor (var j = 0; j < constraintMap.bones.length; j++) {\r\n\t\t\t\t\t\tvar boneName = constraintMap.bones[j];\r\n\t\t\t\t\t\tvar bone = skeletonData.findBone(boneName);\r\n\t\t\t\t\t\tif (bone == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Transform constraint bone not found: \" + boneName);\r\n\t\t\t\t\t\tdata.bones.push(bone);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar targetName = constraintMap.target;\r\n\t\t\t\t\tdata.target = skeletonData.findSlot(targetName);\r\n\t\t\t\t\tif (data.target == null)\r\n\t\t\t\t\t\tthrow new Error(\"Path target slot not found: \" + targetName);\r\n\t\t\t\t\tdata.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\r\n\t\t\t\t\tdata.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\r\n\t\t\t\t\tdata.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\r\n\t\t\t\t\tdata.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n\t\t\t\t\tdata.position = this.getValue(constraintMap, \"position\", 0);\r\n\t\t\t\t\tif (data.positionMode == spine.PositionMode.Fixed)\r\n\t\t\t\t\t\tdata.position *= scale;\r\n\t\t\t\t\tdata.spacing = this.getValue(constraintMap, \"spacing\", 0);\r\n\t\t\t\t\tif (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n\t\t\t\t\t\tdata.spacing *= scale;\r\n\t\t\t\t\tdata.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n\t\t\t\t\tdata.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n\t\t\t\t\tskeletonData.pathConstraints.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.skins) {\r\n\t\t\t\tfor (var skinName in root.skins) {\r\n\t\t\t\t\tvar skinMap = root.skins[skinName];\r\n\t\t\t\t\tvar skin = new spine.Skin(skinName);\r\n\t\t\t\t\tfor (var slotName in skinMap) {\r\n\t\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(slotName);\r\n\t\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + slotName);\r\n\t\t\t\t\t\tvar slotMap = skinMap[slotName];\r\n\t\t\t\t\t\tfor (var entryName in slotMap) {\r\n\t\t\t\t\t\t\tvar attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData);\r\n\t\t\t\t\t\t\tif (attachment != null)\r\n\t\t\t\t\t\t\t\tskin.addAttachment(slotIndex, entryName, attachment);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tskeletonData.skins.push(skin);\r\n\t\t\t\t\tif (skin.name == \"default\")\r\n\t\t\t\t\t\tskeletonData.defaultSkin = skin;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n\t\t\t\tvar linkedMesh = this.linkedMeshes[i];\r\n\t\t\t\tvar skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n\t\t\t\tif (skin == null)\r\n\t\t\t\t\tthrow new Error(\"Skin not found: \" + linkedMesh.skin);\r\n\t\t\t\tvar parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n\t\t\t\tif (parent_3 == null)\r\n\t\t\t\t\tthrow new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n\t\t\t\tlinkedMesh.mesh.setParentMesh(parent_3);\r\n\t\t\t\tlinkedMesh.mesh.updateUVs();\r\n\t\t\t}\r\n\t\t\tthis.linkedMeshes.length = 0;\r\n\t\t\tif (root.events) {\r\n\t\t\t\tfor (var eventName in root.events) {\r\n\t\t\t\t\tvar eventMap = root.events[eventName];\r\n\t\t\t\t\tvar data = new spine.EventData(eventName);\r\n\t\t\t\t\tdata.intValue = this.getValue(eventMap, \"int\", 0);\r\n\t\t\t\t\tdata.floatValue = this.getValue(eventMap, \"float\", 0);\r\n\t\t\t\t\tdata.stringValue = this.getValue(eventMap, \"string\", \"\");\r\n\t\t\t\t\tdata.audioPath = this.getValue(eventMap, \"audio\", null);\r\n\t\t\t\t\tif (data.audioPath != null) {\r\n\t\t\t\t\t\tdata.volume = this.getValue(eventMap, \"volume\", 1);\r\n\t\t\t\t\t\tdata.balance = this.getValue(eventMap, \"balance\", 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tskeletonData.events.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.animations) {\r\n\t\t\t\tfor (var animationName in root.animations) {\r\n\t\t\t\t\tvar animationMap = root.animations[animationName];\r\n\t\t\t\t\tthis.readAnimation(animationMap, animationName, skeletonData);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn skeletonData;\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tname = this.getValue(map, \"name\", name);\r\n\t\t\tvar type = this.getValue(map, \"type\", \"region\");\r\n\t\t\tswitch (type) {\r\n\t\t\t\tcase \"region\": {\r\n\t\t\t\t\tvar path = this.getValue(map, \"path\", name);\r\n\t\t\t\t\tvar region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n\t\t\t\t\tif (region == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tregion.path = path;\r\n\t\t\t\t\tregion.x = this.getValue(map, \"x\", 0) * scale;\r\n\t\t\t\t\tregion.y = this.getValue(map, \"y\", 0) * scale;\r\n\t\t\t\t\tregion.scaleX = this.getValue(map, \"scaleX\", 1);\r\n\t\t\t\t\tregion.scaleY = this.getValue(map, \"scaleY\", 1);\r\n\t\t\t\t\tregion.rotation = this.getValue(map, \"rotation\", 0);\r\n\t\t\t\t\tregion.width = map.width * scale;\r\n\t\t\t\t\tregion.height = map.height * scale;\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tregion.color.setFromString(color);\r\n\t\t\t\t\tregion.updateOffset();\r\n\t\t\t\t\treturn region;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"boundingbox\": {\r\n\t\t\t\t\tvar box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n\t\t\t\t\tif (box == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tthis.readVertices(map, box, map.vertexCount << 1);\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tbox.color.setFromString(color);\r\n\t\t\t\t\treturn box;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"mesh\":\r\n\t\t\t\tcase \"linkedmesh\": {\r\n\t\t\t\t\tvar path = this.getValue(map, \"path\", name);\r\n\t\t\t\t\tvar mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n\t\t\t\t\tif (mesh == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tmesh.path = path;\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tmesh.color.setFromString(color);\r\n\t\t\t\t\tvar parent_4 = this.getValue(map, \"parent\", null);\r\n\t\t\t\t\tif (parent_4 != null) {\r\n\t\t\t\t\t\tmesh.inheritDeform = this.getValue(map, \"deform\", true);\r\n\t\t\t\t\t\tthis.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent_4));\r\n\t\t\t\t\t\treturn mesh;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar uvs = map.uvs;\r\n\t\t\t\t\tthis.readVertices(map, mesh, uvs.length);\r\n\t\t\t\t\tmesh.triangles = map.triangles;\r\n\t\t\t\t\tmesh.regionUVs = uvs;\r\n\t\t\t\t\tmesh.updateUVs();\r\n\t\t\t\t\tmesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\r\n\t\t\t\t\treturn mesh;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"path\": {\r\n\t\t\t\t\tvar path = this.attachmentLoader.newPathAttachment(skin, name);\r\n\t\t\t\t\tif (path == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tpath.closed = this.getValue(map, \"closed\", false);\r\n\t\t\t\t\tpath.constantSpeed = this.getValue(map, \"constantSpeed\", true);\r\n\t\t\t\t\tvar vertexCount = map.vertexCount;\r\n\t\t\t\t\tthis.readVertices(map, path, vertexCount << 1);\r\n\t\t\t\t\tvar lengths = spine.Utils.newArray(vertexCount / 3, 0);\r\n\t\t\t\t\tfor (var i = 0; i < map.lengths.length; i++)\r\n\t\t\t\t\t\tlengths[i] = map.lengths[i] * scale;\r\n\t\t\t\t\tpath.lengths = lengths;\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tpath.color.setFromString(color);\r\n\t\t\t\t\treturn path;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"point\": {\r\n\t\t\t\t\tvar point = this.attachmentLoader.newPointAttachment(skin, name);\r\n\t\t\t\t\tif (point == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tpoint.x = this.getValue(map, \"x\", 0) * scale;\r\n\t\t\t\t\tpoint.y = this.getValue(map, \"y\", 0) * scale;\r\n\t\t\t\t\tpoint.rotation = this.getValue(map, \"rotation\", 0);\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tpoint.color.setFromString(color);\r\n\t\t\t\t\treturn point;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"clipping\": {\r\n\t\t\t\t\tvar clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n\t\t\t\t\tif (clip == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tvar end = this.getValue(map, \"end\", null);\r\n\t\t\t\t\tif (end != null) {\r\n\t\t\t\t\t\tvar slot = skeletonData.findSlot(end);\r\n\t\t\t\t\t\tif (slot == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Clipping end slot not found: \" + end);\r\n\t\t\t\t\t\tclip.endSlot = slot;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar vertexCount = map.vertexCount;\r\n\t\t\t\t\tthis.readVertices(map, clip, vertexCount << 1);\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tclip.color.setFromString(color);\r\n\t\t\t\t\treturn clip;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tattachment.worldVerticesLength = verticesLength;\r\n\t\t\tvar vertices = map.vertices;\r\n\t\t\tif (verticesLength == vertices.length) {\r\n\t\t\t\tvar scaledVertices = spine.Utils.toFloatArray(vertices);\r\n\t\t\t\tif (scale != 1) {\r\n\t\t\t\t\tfor (var i = 0, n = vertices.length; i < n; i++)\r\n\t\t\t\t\t\tscaledVertices[i] *= scale;\r\n\t\t\t\t}\r\n\t\t\t\tattachment.vertices = scaledVertices;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar weights = new Array();\r\n\t\t\tvar bones = new Array();\r\n\t\t\tfor (var i = 0, n = vertices.length; i < n;) {\r\n\t\t\t\tvar boneCount = vertices[i++];\r\n\t\t\t\tbones.push(boneCount);\r\n\t\t\t\tfor (var nn = i + boneCount * 4; i < nn; i += 4) {\r\n\t\t\t\t\tbones.push(vertices[i]);\r\n\t\t\t\t\tweights.push(vertices[i + 1] * scale);\r\n\t\t\t\t\tweights.push(vertices[i + 2] * scale);\r\n\t\t\t\t\tweights.push(vertices[i + 3]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattachment.bones = bones;\r\n\t\t\tattachment.vertices = spine.Utils.toFloatArray(weights);\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tvar timelines = new Array();\r\n\t\t\tvar duration = 0;\r\n\t\t\tif (map.slots) {\r\n\t\t\t\tfor (var slotName in map.slots) {\r\n\t\t\t\t\tvar slotMap = map.slots[slotName];\r\n\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(slotName);\r\n\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + slotName);\r\n\t\t\t\t\tfor (var timelineName in slotMap) {\r\n\t\t\t\t\t\tvar timelineMap = slotMap[timelineName];\r\n\t\t\t\t\t\tif (timelineName == \"attachment\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.AttachmentTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex++, valueMap.time, valueMap.name);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName == \"color\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.ColorTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\tvar color = new spine.Color();\r\n\t\t\t\t\t\t\t\tcolor.setFromString(valueMap.color);\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName == \"twoColor\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.TwoColorTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\tvar light = new spine.Color();\r\n\t\t\t\t\t\t\t\tvar dark = new spine.Color();\r\n\t\t\t\t\t\t\t\tlight.setFromString(valueMap.light);\r\n\t\t\t\t\t\t\t\tdark.setFromString(valueMap.dark);\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.bones) {\r\n\t\t\t\tfor (var boneName in map.bones) {\r\n\t\t\t\t\tvar boneMap = map.bones[boneName];\r\n\t\t\t\t\tvar boneIndex = skeletonData.findBoneIndex(boneName);\r\n\t\t\t\t\tif (boneIndex == -1)\r\n\t\t\t\t\t\tthrow new Error(\"Bone not found: \" + boneName);\r\n\t\t\t\t\tfor (var timelineName in boneMap) {\r\n\t\t\t\t\t\tvar timelineMap = boneMap[timelineName];\r\n\t\t\t\t\t\tif (timelineName === \"rotate\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.RotateTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.boneIndex = boneIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, valueMap.angle);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\r\n\t\t\t\t\t\t\tvar timeline = null;\r\n\t\t\t\t\t\t\tvar timelineScale = 1;\r\n\t\t\t\t\t\t\tif (timelineName === \"scale\")\r\n\t\t\t\t\t\t\t\ttimeline = new spine.ScaleTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\telse if (timelineName === \"shear\")\r\n\t\t\t\t\t\t\t\ttimeline = new spine.ShearTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\ttimeline = new spine.TranslateTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\t\ttimelineScale = scale;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimeline.boneIndex = boneIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\tvar x = this.getValue(valueMap, \"x\", 0), y = this.getValue(valueMap, \"y\", 0);\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.ik) {\r\n\t\t\t\tfor (var constraintName in map.ik) {\r\n\t\t\t\t\tvar constraintMap = map.ik[constraintName];\r\n\t\t\t\t\tvar constraint = skeletonData.findIkConstraint(constraintName);\r\n\t\t\t\t\tvar timeline = new spine.IkConstraintTimeline(constraintMap.length);\r\n\t\t\t\t\ttimeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\tfor (var i = 0; i < constraintMap.length; i++) {\r\n\t\t\t\t\t\tvar valueMap = constraintMap[i];\r\n\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"mix\", 1), this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1, this.getValue(valueMap, \"compress\", false), this.getValue(valueMap, \"stretch\", false));\r\n\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.transform) {\r\n\t\t\t\tfor (var constraintName in map.transform) {\r\n\t\t\t\t\tvar constraintMap = map.transform[constraintName];\r\n\t\t\t\t\tvar constraint = skeletonData.findTransformConstraint(constraintName);\r\n\t\t\t\t\tvar timeline = new spine.TransformConstraintTimeline(constraintMap.length);\r\n\t\t\t\t\ttimeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\tfor (var i = 0; i < constraintMap.length; i++) {\r\n\t\t\t\t\t\tvar valueMap = constraintMap[i];\r\n\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\r\n\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.paths) {\r\n\t\t\t\tfor (var constraintName in map.paths) {\r\n\t\t\t\t\tvar constraintMap = map.paths[constraintName];\r\n\t\t\t\t\tvar index = skeletonData.findPathConstraintIndex(constraintName);\r\n\t\t\t\t\tif (index == -1)\r\n\t\t\t\t\t\tthrow new Error(\"Path constraint not found: \" + constraintName);\r\n\t\t\t\t\tvar data = skeletonData.pathConstraints[index];\r\n\t\t\t\t\tfor (var timelineName in constraintMap) {\r\n\t\t\t\t\t\tvar timelineMap = constraintMap[timelineName];\r\n\t\t\t\t\t\tif (timelineName === \"position\" || timelineName === \"spacing\") {\r\n\t\t\t\t\t\t\tvar timeline = null;\r\n\t\t\t\t\t\t\tvar timelineScale = 1;\r\n\t\t\t\t\t\t\tif (timelineName === \"spacing\") {\r\n\t\t\t\t\t\t\t\ttimeline = new spine.PathConstraintSpacingTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\t\tif (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n\t\t\t\t\t\t\t\t\ttimelineScale = scale;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\ttimeline = new spine.PathConstraintPositionTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\t\tif (data.positionMode == spine.PositionMode.Fixed)\r\n\t\t\t\t\t\t\t\t\ttimelineScale = scale;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimeline.pathConstraintIndex = index;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName === \"mix\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.PathConstraintMixTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.pathConstraintIndex = index;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1));\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.deform) {\r\n\t\t\t\tfor (var deformName in map.deform) {\r\n\t\t\t\t\tvar deformMap = map.deform[deformName];\r\n\t\t\t\t\tvar skin = skeletonData.findSkin(deformName);\r\n\t\t\t\t\tif (skin == null)\r\n\t\t\t\t\t\tthrow new Error(\"Skin not found: \" + deformName);\r\n\t\t\t\t\tfor (var slotName in deformMap) {\r\n\t\t\t\t\t\tvar slotMap = deformMap[slotName];\r\n\t\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(slotName);\r\n\t\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + slotMap.name);\r\n\t\t\t\t\t\tfor (var timelineName in slotMap) {\r\n\t\t\t\t\t\t\tvar timelineMap = slotMap[timelineName];\r\n\t\t\t\t\t\t\tvar attachment = skin.getAttachment(slotIndex, timelineName);\r\n\t\t\t\t\t\t\tif (attachment == null)\r\n\t\t\t\t\t\t\t\tthrow new Error(\"Deform attachment not found: \" + timelineMap.name);\r\n\t\t\t\t\t\t\tvar weighted = attachment.bones != null;\r\n\t\t\t\t\t\t\tvar vertices = attachment.vertices;\r\n\t\t\t\t\t\t\tvar deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n\t\t\t\t\t\t\tvar timeline = new spine.DeformTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\ttimeline.attachment = attachment;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var j = 0; j < timelineMap.length; j++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[j];\r\n\t\t\t\t\t\t\t\tvar deform = void 0;\r\n\t\t\t\t\t\t\t\tvar verticesValue = this.getValue(valueMap, \"vertices\", null);\r\n\t\t\t\t\t\t\t\tif (verticesValue == null)\r\n\t\t\t\t\t\t\t\t\tdeform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices;\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tdeform = spine.Utils.newFloatArray(deformLength);\r\n\t\t\t\t\t\t\t\t\tvar start = this.getValue(valueMap, \"offset\", 0);\r\n\t\t\t\t\t\t\t\t\tspine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n\t\t\t\t\t\t\t\t\tif (scale != 1) {\r\n\t\t\t\t\t\t\t\t\t\tfor (var i = start, n = i + verticesValue.length; i < n; i++)\r\n\t\t\t\t\t\t\t\t\t\t\tdeform[i] *= scale;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif (!weighted) {\r\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < deformLength; i++)\r\n\t\t\t\t\t\t\t\t\t\t\tdeform[i] += vertices[i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, deform);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar drawOrderNode = map.drawOrder;\r\n\t\t\tif (drawOrderNode == null)\r\n\t\t\t\tdrawOrderNode = map.draworder;\r\n\t\t\tif (drawOrderNode != null) {\r\n\t\t\t\tvar timeline = new spine.DrawOrderTimeline(drawOrderNode.length);\r\n\t\t\t\tvar slotCount = skeletonData.slots.length;\r\n\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\tfor (var j = 0; j < drawOrderNode.length; j++) {\r\n\t\t\t\t\tvar drawOrderMap = drawOrderNode[j];\r\n\t\t\t\t\tvar drawOrder = null;\r\n\t\t\t\t\tvar offsets = this.getValue(drawOrderMap, \"offsets\", null);\r\n\t\t\t\t\tif (offsets != null) {\r\n\t\t\t\t\t\tdrawOrder = spine.Utils.newArray(slotCount, -1);\r\n\t\t\t\t\t\tvar unchanged = spine.Utils.newArray(slotCount - offsets.length, 0);\r\n\t\t\t\t\t\tvar originalIndex = 0, unchangedIndex = 0;\r\n\t\t\t\t\t\tfor (var i = 0; i < offsets.length; i++) {\r\n\t\t\t\t\t\t\tvar offsetMap = offsets[i];\r\n\t\t\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\r\n\t\t\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + offsetMap.slot);\r\n\t\t\t\t\t\t\twhile (originalIndex != slotIndex)\r\n\t\t\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\r\n\t\t\t\t\t\t\tdrawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\twhile (originalIndex < slotCount)\r\n\t\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\r\n\t\t\t\t\t\tfor (var i = slotCount - 1; i >= 0; i--)\r\n\t\t\t\t\t\t\tif (drawOrder[i] == -1)\r\n\t\t\t\t\t\t\t\tdrawOrder[i] = unchanged[--unchangedIndex];\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);\r\n\t\t\t\t}\r\n\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t}\r\n\t\t\tif (map.events) {\r\n\t\t\t\tvar timeline = new spine.EventTimeline(map.events.length);\r\n\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\tfor (var i = 0; i < map.events.length; i++) {\r\n\t\t\t\t\tvar eventMap = map.events[i];\r\n\t\t\t\t\tvar eventData = skeletonData.findEvent(eventMap.name);\r\n\t\t\t\t\tif (eventData == null)\r\n\t\t\t\t\t\tthrow new Error(\"Event not found: \" + eventMap.name);\r\n\t\t\t\t\tvar event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData);\r\n\t\t\t\t\tevent_5.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\r\n\t\t\t\t\tevent_5.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\r\n\t\t\t\t\tevent_5.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\r\n\t\t\t\t\tif (event_5.data.audioPath != null) {\r\n\t\t\t\t\t\tevent_5.volume = this.getValue(eventMap, \"volume\", 1);\r\n\t\t\t\t\t\tevent_5.balance = this.getValue(eventMap, \"balance\", 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimeline.setFrame(frameIndex++, event_5);\r\n\t\t\t\t}\r\n\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t}\r\n\t\t\tif (isNaN(duration)) {\r\n\t\t\t\tthrow new Error(\"Error while parsing animation, duration is NaN\");\r\n\t\t\t}\r\n\t\t\tskeletonData.animations.push(new spine.Animation(name, timelines, duration));\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {\r\n\t\t\tif (!map.curve)\r\n\t\t\t\treturn;\r\n\t\t\tif (map.curve === \"stepped\")\r\n\t\t\t\ttimeline.setStepped(frameIndex);\r\n\t\t\telse if (Object.prototype.toString.call(map.curve) === '[object Array]') {\r\n\t\t\t\tvar curve = map.curve;\r\n\t\t\t\ttimeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeletonJson.prototype.getValue = function (map, prop, defaultValue) {\r\n\t\t\treturn map[prop] !== undefined ? map[prop] : defaultValue;\r\n\t\t};\r\n\t\tSkeletonJson.blendModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"normal\")\r\n\t\t\t\treturn spine.BlendMode.Normal;\r\n\t\t\tif (str == \"additive\")\r\n\t\t\t\treturn spine.BlendMode.Additive;\r\n\t\t\tif (str == \"multiply\")\r\n\t\t\t\treturn spine.BlendMode.Multiply;\r\n\t\t\tif (str == \"screen\")\r\n\t\t\t\treturn spine.BlendMode.Screen;\r\n\t\t\tthrow new Error(\"Unknown blend mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.positionModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"fixed\")\r\n\t\t\t\treturn spine.PositionMode.Fixed;\r\n\t\t\tif (str == \"percent\")\r\n\t\t\t\treturn spine.PositionMode.Percent;\r\n\t\t\tthrow new Error(\"Unknown position mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.spacingModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"length\")\r\n\t\t\t\treturn spine.SpacingMode.Length;\r\n\t\t\tif (str == \"fixed\")\r\n\t\t\t\treturn spine.SpacingMode.Fixed;\r\n\t\t\tif (str == \"percent\")\r\n\t\t\t\treturn spine.SpacingMode.Percent;\r\n\t\t\tthrow new Error(\"Unknown position mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.rotateModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"tangent\")\r\n\t\t\t\treturn spine.RotateMode.Tangent;\r\n\t\t\tif (str == \"chain\")\r\n\t\t\t\treturn spine.RotateMode.Chain;\r\n\t\t\tif (str == \"chainscale\")\r\n\t\t\t\treturn spine.RotateMode.ChainScale;\r\n\t\t\tthrow new Error(\"Unknown rotate mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.transformModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"normal\")\r\n\t\t\t\treturn spine.TransformMode.Normal;\r\n\t\t\tif (str == \"onlytranslation\")\r\n\t\t\t\treturn spine.TransformMode.OnlyTranslation;\r\n\t\t\tif (str == \"norotationorreflection\")\r\n\t\t\t\treturn spine.TransformMode.NoRotationOrReflection;\r\n\t\t\tif (str == \"noscale\")\r\n\t\t\t\treturn spine.TransformMode.NoScale;\r\n\t\t\tif (str == \"noscaleorreflection\")\r\n\t\t\t\treturn spine.TransformMode.NoScaleOrReflection;\r\n\t\t\tthrow new Error(\"Unknown transform mode: \" + str);\r\n\t\t};\r\n\t\treturn SkeletonJson;\r\n\t}());\r\n\tspine.SkeletonJson = SkeletonJson;\r\n\tvar LinkedMesh = (function () {\r\n\t\tfunction LinkedMesh(mesh, skin, slotIndex, parent) {\r\n\t\t\tthis.mesh = mesh;\r\n\t\t\tthis.skin = skin;\r\n\t\t\tthis.slotIndex = slotIndex;\r\n\t\t\tthis.parent = parent;\r\n\t\t}\r\n\t\treturn LinkedMesh;\r\n\t}());\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Skin = (function () {\r\n\t\tfunction Skin(name) {\r\n\t\t\tthis.attachments = new Array();\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\tSkin.prototype.addAttachment = function (slotIndex, name, attachment) {\r\n\t\t\tif (attachment == null)\r\n\t\t\t\tthrow new Error(\"attachment cannot be null.\");\r\n\t\t\tvar attachments = this.attachments;\r\n\t\t\tif (slotIndex >= attachments.length)\r\n\t\t\t\tattachments.length = slotIndex + 1;\r\n\t\t\tif (!attachments[slotIndex])\r\n\t\t\t\tattachments[slotIndex] = {};\r\n\t\t\tattachments[slotIndex][name] = attachment;\r\n\t\t};\r\n\t\tSkin.prototype.getAttachment = function (slotIndex, name) {\r\n\t\t\tvar dictionary = this.attachments[slotIndex];\r\n\t\t\treturn dictionary ? dictionary[name] : null;\r\n\t\t};\r\n\t\tSkin.prototype.attachAll = function (skeleton, oldSkin) {\r\n\t\t\tvar slotIndex = 0;\r\n\t\t\tfor (var i = 0; i < skeleton.slots.length; i++) {\r\n\t\t\t\tvar slot = skeleton.slots[i];\r\n\t\t\t\tvar slotAttachment = slot.getAttachment();\r\n\t\t\t\tif (slotAttachment && slotIndex < oldSkin.attachments.length) {\r\n\t\t\t\t\tvar dictionary = oldSkin.attachments[slotIndex];\r\n\t\t\t\t\tfor (var key in dictionary) {\r\n\t\t\t\t\t\tvar skinAttachment = dictionary[key];\r\n\t\t\t\t\t\tif (slotAttachment == skinAttachment) {\r\n\t\t\t\t\t\t\tvar attachment = this.getAttachment(slotIndex, key);\r\n\t\t\t\t\t\t\tif (attachment != null)\r\n\t\t\t\t\t\t\t\tslot.setAttachment(attachment);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tslotIndex++;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn Skin;\r\n\t}());\r\n\tspine.Skin = Skin;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Slot = (function () {\r\n\t\tfunction Slot(data, bone) {\r\n\t\t\tthis.attachmentVertices = new Array();\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (bone == null)\r\n\t\t\t\tthrow new Error(\"bone cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.bone = bone;\r\n\t\t\tthis.color = new spine.Color();\r\n\t\t\tthis.darkColor = data.darkColor == null ? null : new spine.Color();\r\n\t\t\tthis.setToSetupPose();\r\n\t\t}\r\n\t\tSlot.prototype.getAttachment = function () {\r\n\t\t\treturn this.attachment;\r\n\t\t};\r\n\t\tSlot.prototype.setAttachment = function (attachment) {\r\n\t\t\tif (this.attachment == attachment)\r\n\t\t\t\treturn;\r\n\t\t\tthis.attachment = attachment;\r\n\t\t\tthis.attachmentTime = this.bone.skeleton.time;\r\n\t\t\tthis.attachmentVertices.length = 0;\r\n\t\t};\r\n\t\tSlot.prototype.setAttachmentTime = function (time) {\r\n\t\t\tthis.attachmentTime = this.bone.skeleton.time - time;\r\n\t\t};\r\n\t\tSlot.prototype.getAttachmentTime = function () {\r\n\t\t\treturn this.bone.skeleton.time - this.attachmentTime;\r\n\t\t};\r\n\t\tSlot.prototype.setToSetupPose = function () {\r\n\t\t\tthis.color.setFromColor(this.data.color);\r\n\t\t\tif (this.darkColor != null)\r\n\t\t\t\tthis.darkColor.setFromColor(this.data.darkColor);\r\n\t\t\tif (this.data.attachmentName == null)\r\n\t\t\t\tthis.attachment = null;\r\n\t\t\telse {\r\n\t\t\t\tthis.attachment = null;\r\n\t\t\t\tthis.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn Slot;\r\n\t}());\r\n\tspine.Slot = Slot;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SlotData = (function () {\r\n\t\tfunction SlotData(index, name, boneData) {\r\n\t\t\tthis.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\tif (index < 0)\r\n\t\t\t\tthrow new Error(\"index must be >= 0.\");\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tif (boneData == null)\r\n\t\t\t\tthrow new Error(\"boneData cannot be null.\");\r\n\t\t\tthis.index = index;\r\n\t\t\tthis.name = name;\r\n\t\t\tthis.boneData = boneData;\r\n\t\t}\r\n\t\treturn SlotData;\r\n\t}());\r\n\tspine.SlotData = SlotData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Texture = (function () {\r\n\t\tfunction Texture(image) {\r\n\t\t\tthis._image = image;\r\n\t\t}\r\n\t\tTexture.prototype.getImage = function () {\r\n\t\t\treturn this._image;\r\n\t\t};\r\n\t\tTexture.filterFromString = function (text) {\r\n\t\t\tswitch (text.toLowerCase()) {\r\n\t\t\t\tcase \"nearest\": return TextureFilter.Nearest;\r\n\t\t\t\tcase \"linear\": return TextureFilter.Linear;\r\n\t\t\t\tcase \"mipmap\": return TextureFilter.MipMap;\r\n\t\t\t\tcase \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\r\n\t\t\t\tcase \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\r\n\t\t\t\tcase \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\r\n\t\t\t\tcase \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\r\n\t\t\t\tdefault: throw new Error(\"Unknown texture filter \" + text);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTexture.wrapFromString = function (text) {\r\n\t\t\tswitch (text.toLowerCase()) {\r\n\t\t\t\tcase \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\r\n\t\t\t\tcase \"clamptoedge\": return TextureWrap.ClampToEdge;\r\n\t\t\t\tcase \"repeat\": return TextureWrap.Repeat;\r\n\t\t\t\tdefault: throw new Error(\"Unknown texture wrap \" + text);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn Texture;\r\n\t}());\r\n\tspine.Texture = Texture;\r\n\tvar TextureFilter;\r\n\t(function (TextureFilter) {\r\n\t\tTextureFilter[TextureFilter[\"Nearest\"] = 9728] = \"Nearest\";\r\n\t\tTextureFilter[TextureFilter[\"Linear\"] = 9729] = \"Linear\";\r\n\t\tTextureFilter[TextureFilter[\"MipMap\"] = 9987] = \"MipMap\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapNearestNearest\"] = 9984] = \"MipMapNearestNearest\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapLinearNearest\"] = 9985] = \"MipMapLinearNearest\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapNearestLinear\"] = 9986] = \"MipMapNearestLinear\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapLinearLinear\"] = 9987] = \"MipMapLinearLinear\";\r\n\t})(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {}));\r\n\tvar TextureWrap;\r\n\t(function (TextureWrap) {\r\n\t\tTextureWrap[TextureWrap[\"MirroredRepeat\"] = 33648] = \"MirroredRepeat\";\r\n\t\tTextureWrap[TextureWrap[\"ClampToEdge\"] = 33071] = \"ClampToEdge\";\r\n\t\tTextureWrap[TextureWrap[\"Repeat\"] = 10497] = \"Repeat\";\r\n\t})(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {}));\r\n\tvar TextureRegion = (function () {\r\n\t\tfunction TextureRegion() {\r\n\t\t\tthis.u = 0;\r\n\t\t\tthis.v = 0;\r\n\t\t\tthis.u2 = 0;\r\n\t\t\tthis.v2 = 0;\r\n\t\t\tthis.width = 0;\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.rotate = false;\r\n\t\t\tthis.offsetX = 0;\r\n\t\t\tthis.offsetY = 0;\r\n\t\t\tthis.originalWidth = 0;\r\n\t\t\tthis.originalHeight = 0;\r\n\t\t}\r\n\t\treturn TextureRegion;\r\n\t}());\r\n\tspine.TextureRegion = TextureRegion;\r\n\tvar FakeTexture = (function (_super) {\r\n\t\t__extends(FakeTexture, _super);\r\n\t\tfunction FakeTexture() {\r\n\t\t\treturn _super !== null && _super.apply(this, arguments) || this;\r\n\t\t}\r\n\t\tFakeTexture.prototype.setFilters = function (minFilter, magFilter) { };\r\n\t\tFakeTexture.prototype.setWraps = function (uWrap, vWrap) { };\r\n\t\tFakeTexture.prototype.dispose = function () { };\r\n\t\treturn FakeTexture;\r\n\t}(Texture));\r\n\tspine.FakeTexture = FakeTexture;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar TextureAtlas = (function () {\r\n\t\tfunction TextureAtlas(atlasText, textureLoader) {\r\n\t\t\tthis.pages = new Array();\r\n\t\t\tthis.regions = new Array();\r\n\t\t\tthis.load(atlasText, textureLoader);\r\n\t\t}\r\n\t\tTextureAtlas.prototype.load = function (atlasText, textureLoader) {\r\n\t\t\tif (textureLoader == null)\r\n\t\t\t\tthrow new Error(\"textureLoader cannot be null.\");\r\n\t\t\tvar reader = new TextureAtlasReader(atlasText);\r\n\t\t\tvar tuple = new Array(4);\r\n\t\t\tvar page = null;\r\n\t\t\twhile (true) {\r\n\t\t\t\tvar line = reader.readLine();\r\n\t\t\t\tif (line == null)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tline = line.trim();\r\n\t\t\t\tif (line.length == 0)\r\n\t\t\t\t\tpage = null;\r\n\t\t\t\telse if (!page) {\r\n\t\t\t\t\tpage = new TextureAtlasPage();\r\n\t\t\t\t\tpage.name = line;\r\n\t\t\t\t\tif (reader.readTuple(tuple) == 2) {\r\n\t\t\t\t\t\tpage.width = parseInt(tuple[0]);\r\n\t\t\t\t\t\tpage.height = parseInt(tuple[1]);\r\n\t\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tpage.minFilter = spine.Texture.filterFromString(tuple[0]);\r\n\t\t\t\t\tpage.magFilter = spine.Texture.filterFromString(tuple[1]);\r\n\t\t\t\t\tvar direction = reader.readValue();\r\n\t\t\t\t\tpage.uWrap = spine.TextureWrap.ClampToEdge;\r\n\t\t\t\t\tpage.vWrap = spine.TextureWrap.ClampToEdge;\r\n\t\t\t\t\tif (direction == \"x\")\r\n\t\t\t\t\t\tpage.uWrap = spine.TextureWrap.Repeat;\r\n\t\t\t\t\telse if (direction == \"y\")\r\n\t\t\t\t\t\tpage.vWrap = spine.TextureWrap.Repeat;\r\n\t\t\t\t\telse if (direction == \"xy\")\r\n\t\t\t\t\t\tpage.uWrap = page.vWrap = spine.TextureWrap.Repeat;\r\n\t\t\t\t\tpage.texture = textureLoader(line);\r\n\t\t\t\t\tpage.texture.setFilters(page.minFilter, page.magFilter);\r\n\t\t\t\t\tpage.texture.setWraps(page.uWrap, page.vWrap);\r\n\t\t\t\t\tpage.width = page.texture.getImage().width;\r\n\t\t\t\t\tpage.height = page.texture.getImage().height;\r\n\t\t\t\t\tthis.pages.push(page);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar region = new TextureAtlasRegion();\r\n\t\t\t\t\tregion.name = line;\r\n\t\t\t\t\tregion.page = page;\r\n\t\t\t\t\tregion.rotate = reader.readValue() == \"true\";\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tvar x = parseInt(tuple[0]);\r\n\t\t\t\t\tvar y = parseInt(tuple[1]);\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tvar width = parseInt(tuple[0]);\r\n\t\t\t\t\tvar height = parseInt(tuple[1]);\r\n\t\t\t\t\tregion.u = x / page.width;\r\n\t\t\t\t\tregion.v = y / page.height;\r\n\t\t\t\t\tif (region.rotate) {\r\n\t\t\t\t\t\tregion.u2 = (x + height) / page.width;\r\n\t\t\t\t\t\tregion.v2 = (y + width) / page.height;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tregion.u2 = (x + width) / page.width;\r\n\t\t\t\t\t\tregion.v2 = (y + height) / page.height;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tregion.x = x;\r\n\t\t\t\t\tregion.y = y;\r\n\t\t\t\t\tregion.width = Math.abs(width);\r\n\t\t\t\t\tregion.height = Math.abs(height);\r\n\t\t\t\t\tif (reader.readTuple(tuple) == 4) {\r\n\t\t\t\t\t\tif (reader.readTuple(tuple) == 4) {\r\n\t\t\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tregion.originalWidth = parseInt(tuple[0]);\r\n\t\t\t\t\tregion.originalHeight = parseInt(tuple[1]);\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tregion.offsetX = parseInt(tuple[0]);\r\n\t\t\t\t\tregion.offsetY = parseInt(tuple[1]);\r\n\t\t\t\t\tregion.index = parseInt(reader.readValue());\r\n\t\t\t\t\tregion.texture = page.texture;\r\n\t\t\t\t\tthis.regions.push(region);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tTextureAtlas.prototype.findRegion = function (name) {\r\n\t\t\tfor (var i = 0; i < this.regions.length; i++) {\r\n\t\t\t\tif (this.regions[i].name == name) {\r\n\t\t\t\t\treturn this.regions[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tTextureAtlas.prototype.dispose = function () {\r\n\t\t\tfor (var i = 0; i < this.pages.length; i++) {\r\n\t\t\t\tthis.pages[i].texture.dispose();\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn TextureAtlas;\r\n\t}());\r\n\tspine.TextureAtlas = TextureAtlas;\r\n\tvar TextureAtlasReader = (function () {\r\n\t\tfunction TextureAtlasReader(text) {\r\n\t\t\tthis.index = 0;\r\n\t\t\tthis.lines = text.split(/\\r\\n|\\r|\\n/);\r\n\t\t}\r\n\t\tTextureAtlasReader.prototype.readLine = function () {\r\n\t\t\tif (this.index >= this.lines.length)\r\n\t\t\t\treturn null;\r\n\t\t\treturn this.lines[this.index++];\r\n\t\t};\r\n\t\tTextureAtlasReader.prototype.readValue = function () {\r\n\t\t\tvar line = this.readLine();\r\n\t\t\tvar colon = line.indexOf(\":\");\r\n\t\t\tif (colon == -1)\r\n\t\t\t\tthrow new Error(\"Invalid line: \" + line);\r\n\t\t\treturn line.substring(colon + 1).trim();\r\n\t\t};\r\n\t\tTextureAtlasReader.prototype.readTuple = function (tuple) {\r\n\t\t\tvar line = this.readLine();\r\n\t\t\tvar colon = line.indexOf(\":\");\r\n\t\t\tif (colon == -1)\r\n\t\t\t\tthrow new Error(\"Invalid line: \" + line);\r\n\t\t\tvar i = 0, lastMatch = colon + 1;\r\n\t\t\tfor (; i < 3; i++) {\r\n\t\t\t\tvar comma = line.indexOf(\",\", lastMatch);\r\n\t\t\t\tif (comma == -1)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\ttuple[i] = line.substr(lastMatch, comma - lastMatch).trim();\r\n\t\t\t\tlastMatch = comma + 1;\r\n\t\t\t}\r\n\t\t\ttuple[i] = line.substring(lastMatch).trim();\r\n\t\t\treturn i + 1;\r\n\t\t};\r\n\t\treturn TextureAtlasReader;\r\n\t}());\r\n\tvar TextureAtlasPage = (function () {\r\n\t\tfunction TextureAtlasPage() {\r\n\t\t}\r\n\t\treturn TextureAtlasPage;\r\n\t}());\r\n\tspine.TextureAtlasPage = TextureAtlasPage;\r\n\tvar TextureAtlasRegion = (function (_super) {\r\n\t\t__extends(TextureAtlasRegion, _super);\r\n\t\tfunction TextureAtlasRegion() {\r\n\t\t\treturn _super !== null && _super.apply(this, arguments) || this;\r\n\t\t}\r\n\t\treturn TextureAtlasRegion;\r\n\t}(spine.TextureRegion));\r\n\tspine.TextureAtlasRegion = TextureAtlasRegion;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar TransformConstraint = (function () {\r\n\t\tfunction TransformConstraint(data, skeleton) {\r\n\t\t\tthis.rotateMix = 0;\r\n\t\t\tthis.translateMix = 0;\r\n\t\t\tthis.scaleMix = 0;\r\n\t\t\tthis.shearMix = 0;\r\n\t\t\tthis.temp = new spine.Vector2();\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.rotateMix = data.rotateMix;\r\n\t\t\tthis.translateMix = data.translateMix;\r\n\t\t\tthis.scaleMix = data.scaleMix;\r\n\t\t\tthis.shearMix = data.shearMix;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0; i < data.bones.length; i++)\r\n\t\t\t\tthis.bones.push(skeleton.findBone(data.bones[i].name));\r\n\t\t\tthis.target = skeleton.findBone(data.target.name);\r\n\t\t}\r\n\t\tTransformConstraint.prototype.apply = function () {\r\n\t\t\tthis.update();\r\n\t\t};\r\n\t\tTransformConstraint.prototype.update = function () {\r\n\t\t\tif (this.data.local) {\r\n\t\t\t\tif (this.data.relative)\r\n\t\t\t\t\tthis.applyRelativeLocal();\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.applyAbsoluteLocal();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.data.relative)\r\n\t\t\t\t\tthis.applyRelativeWorld();\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.applyAbsoluteWorld();\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyAbsoluteWorld = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar ta = target.a, tb = target.b, tc = target.c, td = target.d;\r\n\t\t\tvar degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n\t\t\tvar offsetRotation = this.data.offsetRotation * degRadReflect;\r\n\t\t\tvar offsetShearY = this.data.offsetShearY * degRadReflect;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tvar modified = false;\r\n\t\t\t\tif (rotateMix != 0) {\r\n\t\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\t\t\tvar r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr *= rotateMix;\r\n\t\t\t\t\tvar cos = Math.cos(r), sin = Math.sin(r);\r\n\t\t\t\t\tbone.a = cos * a - sin * c;\r\n\t\t\t\t\tbone.b = cos * b - sin * d;\r\n\t\t\t\t\tbone.c = sin * a + cos * c;\r\n\t\t\t\t\tbone.d = sin * b + cos * d;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tvar temp = this.temp;\r\n\t\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n\t\t\t\t\tbone.worldX += (temp.x - bone.worldX) * translateMix;\r\n\t\t\t\t\tbone.worldY += (temp.y - bone.worldY) * translateMix;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (scaleMix > 0) {\r\n\t\t\t\t\tvar s = Math.sqrt(bone.a * bone.a + bone.c * bone.c);\r\n\t\t\t\t\tvar ts = Math.sqrt(ta * ta + tc * tc);\r\n\t\t\t\t\tif (s > 0.00001)\r\n\t\t\t\t\t\ts = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\r\n\t\t\t\t\tbone.a *= s;\r\n\t\t\t\t\tbone.c *= s;\r\n\t\t\t\t\ts = Math.sqrt(bone.b * bone.b + bone.d * bone.d);\r\n\t\t\t\t\tts = Math.sqrt(tb * tb + td * td);\r\n\t\t\t\t\tif (s > 0.00001)\r\n\t\t\t\t\t\ts = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\r\n\t\t\t\t\tbone.b *= s;\r\n\t\t\t\t\tbone.d *= s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (shearMix > 0) {\r\n\t\t\t\t\tvar b = bone.b, d = bone.d;\r\n\t\t\t\t\tvar by = Math.atan2(d, b);\r\n\t\t\t\t\tvar r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a));\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr = by + (r + offsetShearY) * shearMix;\r\n\t\t\t\t\tvar s = Math.sqrt(b * b + d * d);\r\n\t\t\t\t\tbone.b = Math.cos(r) * s;\r\n\t\t\t\t\tbone.d = Math.sin(r) * s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (modified)\r\n\t\t\t\t\tbone.appliedValid = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyRelativeWorld = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar ta = target.a, tb = target.b, tc = target.c, td = target.d;\r\n\t\t\tvar degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n\t\t\tvar offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tvar modified = false;\r\n\t\t\t\tif (rotateMix != 0) {\r\n\t\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\t\t\tvar r = Math.atan2(tc, ta) + offsetRotation;\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr *= rotateMix;\r\n\t\t\t\t\tvar cos = Math.cos(r), sin = Math.sin(r);\r\n\t\t\t\t\tbone.a = cos * a - sin * c;\r\n\t\t\t\t\tbone.b = cos * b - sin * d;\r\n\t\t\t\t\tbone.c = sin * a + cos * c;\r\n\t\t\t\t\tbone.d = sin * b + cos * d;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tvar temp = this.temp;\r\n\t\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n\t\t\t\t\tbone.worldX += temp.x * translateMix;\r\n\t\t\t\t\tbone.worldY += temp.y * translateMix;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (scaleMix > 0) {\r\n\t\t\t\t\tvar s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;\r\n\t\t\t\t\tbone.a *= s;\r\n\t\t\t\t\tbone.c *= s;\r\n\t\t\t\t\ts = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;\r\n\t\t\t\t\tbone.b *= s;\r\n\t\t\t\t\tbone.d *= s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (shearMix > 0) {\r\n\t\t\t\t\tvar r = Math.atan2(td, tb) - Math.atan2(tc, ta);\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tvar b = bone.b, d = bone.d;\r\n\t\t\t\t\tr = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix;\r\n\t\t\t\t\tvar s = Math.sqrt(b * b + d * d);\r\n\t\t\t\t\tbone.b = Math.cos(r) * s;\r\n\t\t\t\t\tbone.d = Math.sin(r) * s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (modified)\r\n\t\t\t\t\tbone.appliedValid = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyAbsoluteLocal = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tif (!target.appliedValid)\r\n\t\t\t\ttarget.updateAppliedTransform();\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (!bone.appliedValid)\r\n\t\t\t\t\tbone.updateAppliedTransform();\r\n\t\t\t\tvar rotation = bone.arotation;\r\n\t\t\t\tif (rotateMix != 0) {\r\n\t\t\t\t\tvar r = target.arotation - rotation + this.data.offsetRotation;\r\n\t\t\t\t\tr -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n\t\t\t\t\trotation += r * rotateMix;\r\n\t\t\t\t}\r\n\t\t\t\tvar x = bone.ax, y = bone.ay;\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tx += (target.ax - x + this.data.offsetX) * translateMix;\r\n\t\t\t\t\ty += (target.ay - y + this.data.offsetY) * translateMix;\r\n\t\t\t\t}\r\n\t\t\t\tvar scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n\t\t\t\tif (scaleMix != 0) {\r\n\t\t\t\t\tif (scaleX > 0.00001)\r\n\t\t\t\t\t\tscaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;\r\n\t\t\t\t\tif (scaleY > 0.00001)\r\n\t\t\t\t\t\tscaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;\r\n\t\t\t\t}\r\n\t\t\t\tvar shearY = bone.ashearY;\r\n\t\t\t\tif (shearMix != 0) {\r\n\t\t\t\t\tvar r = target.ashearY - shearY + this.data.offsetShearY;\r\n\t\t\t\t\tr -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n\t\t\t\t\tbone.shearY += r * shearMix;\r\n\t\t\t\t}\r\n\t\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyRelativeLocal = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tif (!target.appliedValid)\r\n\t\t\t\ttarget.updateAppliedTransform();\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (!bone.appliedValid)\r\n\t\t\t\t\tbone.updateAppliedTransform();\r\n\t\t\t\tvar rotation = bone.arotation;\r\n\t\t\t\tif (rotateMix != 0)\r\n\t\t\t\t\trotation += (target.arotation + this.data.offsetRotation) * rotateMix;\r\n\t\t\t\tvar x = bone.ax, y = bone.ay;\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tx += (target.ax + this.data.offsetX) * translateMix;\r\n\t\t\t\t\ty += (target.ay + this.data.offsetY) * translateMix;\r\n\t\t\t\t}\r\n\t\t\t\tvar scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n\t\t\t\tif (scaleMix != 0) {\r\n\t\t\t\t\tif (scaleX > 0.00001)\r\n\t\t\t\t\t\tscaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;\r\n\t\t\t\t\tif (scaleY > 0.00001)\r\n\t\t\t\t\t\tscaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;\r\n\t\t\t\t}\r\n\t\t\t\tvar shearY = bone.ashearY;\r\n\t\t\t\tif (shearMix != 0)\r\n\t\t\t\t\tshearY += (target.ashearY + this.data.offsetShearY) * shearMix;\r\n\t\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.getOrder = function () {\r\n\t\t\treturn this.data.order;\r\n\t\t};\r\n\t\treturn TransformConstraint;\r\n\t}());\r\n\tspine.TransformConstraint = TransformConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar TransformConstraintData = (function () {\r\n\t\tfunction TransformConstraintData(name) {\r\n\t\t\tthis.order = 0;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.rotateMix = 0;\r\n\t\t\tthis.translateMix = 0;\r\n\t\t\tthis.scaleMix = 0;\r\n\t\t\tthis.shearMix = 0;\r\n\t\t\tthis.offsetRotation = 0;\r\n\t\t\tthis.offsetX = 0;\r\n\t\t\tthis.offsetY = 0;\r\n\t\t\tthis.offsetScaleX = 0;\r\n\t\t\tthis.offsetScaleY = 0;\r\n\t\t\tthis.offsetShearY = 0;\r\n\t\t\tthis.relative = false;\r\n\t\t\tthis.local = false;\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn TransformConstraintData;\r\n\t}());\r\n\tspine.TransformConstraintData = TransformConstraintData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Triangulator = (function () {\r\n\t\tfunction Triangulator() {\r\n\t\t\tthis.convexPolygons = new Array();\r\n\t\t\tthis.convexPolygonsIndices = new Array();\r\n\t\t\tthis.indicesArray = new Array();\r\n\t\t\tthis.isConcaveArray = new Array();\r\n\t\t\tthis.triangles = new Array();\r\n\t\t\tthis.polygonPool = new spine.Pool(function () {\r\n\t\t\t\treturn new Array();\r\n\t\t\t});\r\n\t\t\tthis.polygonIndicesPool = new spine.Pool(function () {\r\n\t\t\t\treturn new Array();\r\n\t\t\t});\r\n\t\t}\r\n\t\tTriangulator.prototype.triangulate = function (verticesArray) {\r\n\t\t\tvar vertices = verticesArray;\r\n\t\t\tvar vertexCount = verticesArray.length >> 1;\r\n\t\t\tvar indices = this.indicesArray;\r\n\t\t\tindices.length = 0;\r\n\t\t\tfor (var i = 0; i < vertexCount; i++)\r\n\t\t\t\tindices[i] = i;\r\n\t\t\tvar isConcave = this.isConcaveArray;\r\n\t\t\tisConcave.length = 0;\r\n\t\t\tfor (var i = 0, n = vertexCount; i < n; ++i)\r\n\t\t\t\tisConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);\r\n\t\t\tvar triangles = this.triangles;\r\n\t\t\ttriangles.length = 0;\r\n\t\t\twhile (vertexCount > 3) {\r\n\t\t\t\tvar previous = vertexCount - 1, i = 0, next = 1;\r\n\t\t\t\twhile (true) {\r\n\t\t\t\t\touter: if (!isConcave[i]) {\r\n\t\t\t\t\t\tvar p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;\r\n\t\t\t\t\t\tvar p1x = vertices[p1], p1y = vertices[p1 + 1];\r\n\t\t\t\t\t\tvar p2x = vertices[p2], p2y = vertices[p2 + 1];\r\n\t\t\t\t\t\tvar p3x = vertices[p3], p3y = vertices[p3 + 1];\r\n\t\t\t\t\t\tfor (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {\r\n\t\t\t\t\t\t\tif (!isConcave[ii])\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tvar v = indices[ii] << 1;\r\n\t\t\t\t\t\t\tvar vx = vertices[v], vy = vertices[v + 1];\r\n\t\t\t\t\t\t\tif (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {\r\n\t\t\t\t\t\t\t\tif (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {\r\n\t\t\t\t\t\t\t\t\tif (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy))\r\n\t\t\t\t\t\t\t\t\t\tbreak outer;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (next == 0) {\r\n\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t\tif (!isConcave[i])\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\ti--;\r\n\t\t\t\t\t\t} while (i > 0);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tprevious = i;\r\n\t\t\t\t\ti = next;\r\n\t\t\t\t\tnext = (next + 1) % vertexCount;\r\n\t\t\t\t}\r\n\t\t\t\ttriangles.push(indices[(vertexCount + i - 1) % vertexCount]);\r\n\t\t\t\ttriangles.push(indices[i]);\r\n\t\t\t\ttriangles.push(indices[(i + 1) % vertexCount]);\r\n\t\t\t\tindices.splice(i, 1);\r\n\t\t\t\tisConcave.splice(i, 1);\r\n\t\t\t\tvertexCount--;\r\n\t\t\t\tvar previousIndex = (vertexCount + i - 1) % vertexCount;\r\n\t\t\t\tvar nextIndex = i == vertexCount ? 0 : i;\r\n\t\t\t\tisConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);\r\n\t\t\t\tisConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);\r\n\t\t\t}\r\n\t\t\tif (vertexCount == 3) {\r\n\t\t\t\ttriangles.push(indices[2]);\r\n\t\t\t\ttriangles.push(indices[0]);\r\n\t\t\t\ttriangles.push(indices[1]);\r\n\t\t\t}\r\n\t\t\treturn triangles;\r\n\t\t};\r\n\t\tTriangulator.prototype.decompose = function (verticesArray, triangles) {\r\n\t\t\tvar vertices = verticesArray;\r\n\t\t\tvar convexPolygons = this.convexPolygons;\r\n\t\t\tthis.polygonPool.freeAll(convexPolygons);\r\n\t\t\tconvexPolygons.length = 0;\r\n\t\t\tvar convexPolygonsIndices = this.convexPolygonsIndices;\r\n\t\t\tthis.polygonIndicesPool.freeAll(convexPolygonsIndices);\r\n\t\t\tconvexPolygonsIndices.length = 0;\r\n\t\t\tvar polygonIndices = this.polygonIndicesPool.obtain();\r\n\t\t\tpolygonIndices.length = 0;\r\n\t\t\tvar polygon = this.polygonPool.obtain();\r\n\t\t\tpolygon.length = 0;\r\n\t\t\tvar fanBaseIndex = -1, lastWinding = 0;\r\n\t\t\tfor (var i = 0, n = triangles.length; i < n; i += 3) {\r\n\t\t\t\tvar t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;\r\n\t\t\t\tvar x1 = vertices[t1], y1 = vertices[t1 + 1];\r\n\t\t\t\tvar x2 = vertices[t2], y2 = vertices[t2 + 1];\r\n\t\t\t\tvar x3 = vertices[t3], y3 = vertices[t3 + 1];\r\n\t\t\t\tvar merged = false;\r\n\t\t\t\tif (fanBaseIndex == t1) {\r\n\t\t\t\t\tvar o = polygon.length - 4;\r\n\t\t\t\t\tvar winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);\r\n\t\t\t\t\tvar winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);\r\n\t\t\t\t\tif (winding1 == lastWinding && winding2 == lastWinding) {\r\n\t\t\t\t\t\tpolygon.push(x3);\r\n\t\t\t\t\t\tpolygon.push(y3);\r\n\t\t\t\t\t\tpolygonIndices.push(t3);\r\n\t\t\t\t\t\tmerged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (!merged) {\r\n\t\t\t\t\tif (polygon.length > 0) {\r\n\t\t\t\t\t\tconvexPolygons.push(polygon);\r\n\t\t\t\t\t\tconvexPolygonsIndices.push(polygonIndices);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.polygonPool.free(polygon);\r\n\t\t\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpolygon = this.polygonPool.obtain();\r\n\t\t\t\t\tpolygon.length = 0;\r\n\t\t\t\t\tpolygon.push(x1);\r\n\t\t\t\t\tpolygon.push(y1);\r\n\t\t\t\t\tpolygon.push(x2);\r\n\t\t\t\t\tpolygon.push(y2);\r\n\t\t\t\t\tpolygon.push(x3);\r\n\t\t\t\t\tpolygon.push(y3);\r\n\t\t\t\t\tpolygonIndices = this.polygonIndicesPool.obtain();\r\n\t\t\t\t\tpolygonIndices.length = 0;\r\n\t\t\t\t\tpolygonIndices.push(t1);\r\n\t\t\t\t\tpolygonIndices.push(t2);\r\n\t\t\t\t\tpolygonIndices.push(t3);\r\n\t\t\t\t\tlastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);\r\n\t\t\t\t\tfanBaseIndex = t1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (polygon.length > 0) {\r\n\t\t\t\tconvexPolygons.push(polygon);\r\n\t\t\t\tconvexPolygonsIndices.push(polygonIndices);\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = convexPolygons.length; i < n; i++) {\r\n\t\t\t\tpolygonIndices = convexPolygonsIndices[i];\r\n\t\t\t\tif (polygonIndices.length == 0)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tvar firstIndex = polygonIndices[0];\r\n\t\t\t\tvar lastIndex = polygonIndices[polygonIndices.length - 1];\r\n\t\t\t\tpolygon = convexPolygons[i];\r\n\t\t\t\tvar o = polygon.length - 4;\r\n\t\t\t\tvar prevPrevX = polygon[o], prevPrevY = polygon[o + 1];\r\n\t\t\t\tvar prevX = polygon[o + 2], prevY = polygon[o + 3];\r\n\t\t\t\tvar firstX = polygon[0], firstY = polygon[1];\r\n\t\t\t\tvar secondX = polygon[2], secondY = polygon[3];\r\n\t\t\t\tvar winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);\r\n\t\t\t\tfor (var ii = 0; ii < n; ii++) {\r\n\t\t\t\t\tif (ii == i)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tvar otherIndices = convexPolygonsIndices[ii];\r\n\t\t\t\t\tif (otherIndices.length != 3)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tvar otherFirstIndex = otherIndices[0];\r\n\t\t\t\t\tvar otherSecondIndex = otherIndices[1];\r\n\t\t\t\t\tvar otherLastIndex = otherIndices[2];\r\n\t\t\t\t\tvar otherPoly = convexPolygons[ii];\r\n\t\t\t\t\tvar x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];\r\n\t\t\t\t\tif (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tvar winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);\r\n\t\t\t\t\tvar winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);\r\n\t\t\t\t\tif (winding1 == winding && winding2 == winding) {\r\n\t\t\t\t\t\totherPoly.length = 0;\r\n\t\t\t\t\t\totherIndices.length = 0;\r\n\t\t\t\t\t\tpolygon.push(x3);\r\n\t\t\t\t\t\tpolygon.push(y3);\r\n\t\t\t\t\t\tpolygonIndices.push(otherLastIndex);\r\n\t\t\t\t\t\tprevPrevX = prevX;\r\n\t\t\t\t\t\tprevPrevY = prevY;\r\n\t\t\t\t\t\tprevX = x3;\r\n\t\t\t\t\t\tprevY = y3;\r\n\t\t\t\t\t\tii = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var i = convexPolygons.length - 1; i >= 0; i--) {\r\n\t\t\t\tpolygon = convexPolygons[i];\r\n\t\t\t\tif (polygon.length == 0) {\r\n\t\t\t\t\tconvexPolygons.splice(i, 1);\r\n\t\t\t\t\tthis.polygonPool.free(polygon);\r\n\t\t\t\t\tpolygonIndices = convexPolygonsIndices[i];\r\n\t\t\t\t\tconvexPolygonsIndices.splice(i, 1);\r\n\t\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn convexPolygons;\r\n\t\t};\r\n\t\tTriangulator.isConcave = function (index, vertexCount, vertices, indices) {\r\n\t\t\tvar previous = indices[(vertexCount + index - 1) % vertexCount] << 1;\r\n\t\t\tvar current = indices[index] << 1;\r\n\t\t\tvar next = indices[(index + 1) % vertexCount] << 1;\r\n\t\t\treturn !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]);\r\n\t\t};\r\n\t\tTriangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) {\r\n\t\t\treturn p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;\r\n\t\t};\r\n\t\tTriangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) {\r\n\t\t\tvar px = p2x - p1x, py = p2y - p1y;\r\n\t\t\treturn p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;\r\n\t\t};\r\n\t\treturn Triangulator;\r\n\t}());\r\n\tspine.Triangulator = Triangulator;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar IntSet = (function () {\r\n\t\tfunction IntSet() {\r\n\t\t\tthis.array = new Array();\r\n\t\t}\r\n\t\tIntSet.prototype.add = function (value) {\r\n\t\t\tvar contains = this.contains(value);\r\n\t\t\tthis.array[value | 0] = value | 0;\r\n\t\t\treturn !contains;\r\n\t\t};\r\n\t\tIntSet.prototype.contains = function (value) {\r\n\t\t\treturn this.array[value | 0] != undefined;\r\n\t\t};\r\n\t\tIntSet.prototype.remove = function (value) {\r\n\t\t\tthis.array[value | 0] = undefined;\r\n\t\t};\r\n\t\tIntSet.prototype.clear = function () {\r\n\t\t\tthis.array.length = 0;\r\n\t\t};\r\n\t\treturn IntSet;\r\n\t}());\r\n\tspine.IntSet = IntSet;\r\n\tvar Color = (function () {\r\n\t\tfunction Color(r, g, b, a) {\r\n\t\t\tif (r === void 0) { r = 0; }\r\n\t\t\tif (g === void 0) { g = 0; }\r\n\t\t\tif (b === void 0) { b = 0; }\r\n\t\t\tif (a === void 0) { a = 0; }\r\n\t\t\tthis.r = r;\r\n\t\t\tthis.g = g;\r\n\t\t\tthis.b = b;\r\n\t\t\tthis.a = a;\r\n\t\t}\r\n\t\tColor.prototype.set = function (r, g, b, a) {\r\n\t\t\tthis.r = r;\r\n\t\t\tthis.g = g;\r\n\t\t\tthis.b = b;\r\n\t\t\tthis.a = a;\r\n\t\t\tthis.clamp();\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.setFromColor = function (c) {\r\n\t\t\tthis.r = c.r;\r\n\t\t\tthis.g = c.g;\r\n\t\t\tthis.b = c.b;\r\n\t\t\tthis.a = c.a;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.setFromString = function (hex) {\r\n\t\t\thex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\r\n\t\t\tthis.r = parseInt(hex.substr(0, 2), 16) / 255.0;\r\n\t\t\tthis.g = parseInt(hex.substr(2, 2), 16) / 255.0;\r\n\t\t\tthis.b = parseInt(hex.substr(4, 2), 16) / 255.0;\r\n\t\t\tthis.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.add = function (r, g, b, a) {\r\n\t\t\tthis.r += r;\r\n\t\t\tthis.g += g;\r\n\t\t\tthis.b += b;\r\n\t\t\tthis.a += a;\r\n\t\t\tthis.clamp();\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.clamp = function () {\r\n\t\t\tif (this.r < 0)\r\n\t\t\t\tthis.r = 0;\r\n\t\t\telse if (this.r > 1)\r\n\t\t\t\tthis.r = 1;\r\n\t\t\tif (this.g < 0)\r\n\t\t\t\tthis.g = 0;\r\n\t\t\telse if (this.g > 1)\r\n\t\t\t\tthis.g = 1;\r\n\t\t\tif (this.b < 0)\r\n\t\t\t\tthis.b = 0;\r\n\t\t\telse if (this.b > 1)\r\n\t\t\t\tthis.b = 1;\r\n\t\t\tif (this.a < 0)\r\n\t\t\t\tthis.a = 0;\r\n\t\t\telse if (this.a > 1)\r\n\t\t\t\tthis.a = 1;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.WHITE = new Color(1, 1, 1, 1);\r\n\t\tColor.RED = new Color(1, 0, 0, 1);\r\n\t\tColor.GREEN = new Color(0, 1, 0, 1);\r\n\t\tColor.BLUE = new Color(0, 0, 1, 1);\r\n\t\tColor.MAGENTA = new Color(1, 0, 1, 1);\r\n\t\treturn Color;\r\n\t}());\r\n\tspine.Color = Color;\r\n\tvar MathUtils = (function () {\r\n\t\tfunction MathUtils() {\r\n\t\t}\r\n\t\tMathUtils.clamp = function (value, min, max) {\r\n\t\t\tif (value < min)\r\n\t\t\t\treturn min;\r\n\t\t\tif (value > max)\r\n\t\t\t\treturn max;\r\n\t\t\treturn value;\r\n\t\t};\r\n\t\tMathUtils.cosDeg = function (degrees) {\r\n\t\t\treturn Math.cos(degrees * MathUtils.degRad);\r\n\t\t};\r\n\t\tMathUtils.sinDeg = function (degrees) {\r\n\t\t\treturn Math.sin(degrees * MathUtils.degRad);\r\n\t\t};\r\n\t\tMathUtils.signum = function (value) {\r\n\t\t\treturn value > 0 ? 1 : value < 0 ? -1 : 0;\r\n\t\t};\r\n\t\tMathUtils.toInt = function (x) {\r\n\t\t\treturn x > 0 ? Math.floor(x) : Math.ceil(x);\r\n\t\t};\r\n\t\tMathUtils.cbrt = function (x) {\r\n\t\t\tvar y = Math.pow(Math.abs(x), 1 / 3);\r\n\t\t\treturn x < 0 ? -y : y;\r\n\t\t};\r\n\t\tMathUtils.randomTriangular = function (min, max) {\r\n\t\t\treturn MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\r\n\t\t};\r\n\t\tMathUtils.randomTriangularWith = function (min, max, mode) {\r\n\t\t\tvar u = Math.random();\r\n\t\t\tvar d = max - min;\r\n\t\t\tif (u <= (mode - min) / d)\r\n\t\t\t\treturn min + Math.sqrt(u * d * (mode - min));\r\n\t\t\treturn max - Math.sqrt((1 - u) * d * (max - mode));\r\n\t\t};\r\n\t\tMathUtils.PI = 3.1415927;\r\n\t\tMathUtils.PI2 = MathUtils.PI * 2;\r\n\t\tMathUtils.radiansToDegrees = 180 / MathUtils.PI;\r\n\t\tMathUtils.radDeg = MathUtils.radiansToDegrees;\r\n\t\tMathUtils.degreesToRadians = MathUtils.PI / 180;\r\n\t\tMathUtils.degRad = MathUtils.degreesToRadians;\r\n\t\treturn MathUtils;\r\n\t}());\r\n\tspine.MathUtils = MathUtils;\r\n\tvar Interpolation = (function () {\r\n\t\tfunction Interpolation() {\r\n\t\t}\r\n\t\tInterpolation.prototype.apply = function (start, end, a) {\r\n\t\t\treturn start + (end - start) * this.applyInternal(a);\r\n\t\t};\r\n\t\treturn Interpolation;\r\n\t}());\r\n\tspine.Interpolation = Interpolation;\r\n\tvar Pow = (function (_super) {\r\n\t\t__extends(Pow, _super);\r\n\t\tfunction Pow(power) {\r\n\t\t\tvar _this = _super.call(this) || this;\r\n\t\t\t_this.power = 2;\r\n\t\t\t_this.power = power;\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPow.prototype.applyInternal = function (a) {\r\n\t\t\tif (a <= 0.5)\r\n\t\t\t\treturn Math.pow(a * 2, this.power) / 2;\r\n\t\t\treturn Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;\r\n\t\t};\r\n\t\treturn Pow;\r\n\t}(Interpolation));\r\n\tspine.Pow = Pow;\r\n\tvar PowOut = (function (_super) {\r\n\t\t__extends(PowOut, _super);\r\n\t\tfunction PowOut(power) {\r\n\t\t\treturn _super.call(this, power) || this;\r\n\t\t}\r\n\t\tPowOut.prototype.applyInternal = function (a) {\r\n\t\t\treturn Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;\r\n\t\t};\r\n\t\treturn PowOut;\r\n\t}(Pow));\r\n\tspine.PowOut = PowOut;\r\n\tvar Utils = (function () {\r\n\t\tfunction Utils() {\r\n\t\t}\r\n\t\tUtils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) {\r\n\t\t\tfor (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\r\n\t\t\t\tdest[j] = source[i];\r\n\t\t\t}\r\n\t\t};\r\n\t\tUtils.setArraySize = function (array, size, value) {\r\n\t\t\tif (value === void 0) { value = 0; }\r\n\t\t\tvar oldSize = array.length;\r\n\t\t\tif (oldSize == size)\r\n\t\t\t\treturn array;\r\n\t\t\tarray.length = size;\r\n\t\t\tif (oldSize < size) {\r\n\t\t\t\tfor (var i = oldSize; i < size; i++)\r\n\t\t\t\t\tarray[i] = value;\r\n\t\t\t}\r\n\t\t\treturn array;\r\n\t\t};\r\n\t\tUtils.ensureArrayCapacity = function (array, size, value) {\r\n\t\t\tif (value === void 0) { value = 0; }\r\n\t\t\tif (array.length >= size)\r\n\t\t\t\treturn array;\r\n\t\t\treturn Utils.setArraySize(array, size, value);\r\n\t\t};\r\n\t\tUtils.newArray = function (size, defaultValue) {\r\n\t\t\tvar array = new Array(size);\r\n\t\t\tfor (var i = 0; i < size; i++)\r\n\t\t\t\tarray[i] = defaultValue;\r\n\t\t\treturn array;\r\n\t\t};\r\n\t\tUtils.newFloatArray = function (size) {\r\n\t\t\tif (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n\t\t\t\treturn new Float32Array(size);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar array = new Array(size);\r\n\t\t\t\tfor (var i = 0; i < array.length; i++)\r\n\t\t\t\t\tarray[i] = 0;\r\n\t\t\t\treturn array;\r\n\t\t\t}\r\n\t\t};\r\n\t\tUtils.newShortArray = function (size) {\r\n\t\t\tif (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n\t\t\t\treturn new Int16Array(size);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar array = new Array(size);\r\n\t\t\t\tfor (var i = 0; i < array.length; i++)\r\n\t\t\t\t\tarray[i] = 0;\r\n\t\t\t\treturn array;\r\n\t\t\t}\r\n\t\t};\r\n\t\tUtils.toFloatArray = function (array) {\r\n\t\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\r\n\t\t};\r\n\t\tUtils.toSinglePrecision = function (value) {\r\n\t\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;\r\n\t\t};\r\n\t\tUtils.webkit602BugfixHelper = function (alpha, blend) {\r\n\t\t};\r\n\t\tUtils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\r\n\t\treturn Utils;\r\n\t}());\r\n\tspine.Utils = Utils;\r\n\tvar DebugUtils = (function () {\r\n\t\tfunction DebugUtils() {\r\n\t\t}\r\n\t\tDebugUtils.logBones = function (skeleton) {\r\n\t\t\tfor (var i = 0; i < skeleton.bones.length; i++) {\r\n\t\t\t\tvar bone = skeleton.bones[i];\r\n\t\t\t\tconsole.log(bone.data.name + \", \" + bone.a + \", \" + bone.b + \", \" + bone.c + \", \" + bone.d + \", \" + bone.worldX + \", \" + bone.worldY);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn DebugUtils;\r\n\t}());\r\n\tspine.DebugUtils = DebugUtils;\r\n\tvar Pool = (function () {\r\n\t\tfunction Pool(instantiator) {\r\n\t\t\tthis.items = new Array();\r\n\t\t\tthis.instantiator = instantiator;\r\n\t\t}\r\n\t\tPool.prototype.obtain = function () {\r\n\t\t\treturn this.items.length > 0 ? this.items.pop() : this.instantiator();\r\n\t\t};\r\n\t\tPool.prototype.free = function (item) {\r\n\t\t\tif (item.reset)\r\n\t\t\t\titem.reset();\r\n\t\t\tthis.items.push(item);\r\n\t\t};\r\n\t\tPool.prototype.freeAll = function (items) {\r\n\t\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\t\tif (items[i].reset)\r\n\t\t\t\t\titems[i].reset();\r\n\t\t\t\tthis.items[i] = items[i];\r\n\t\t\t}\r\n\t\t};\r\n\t\tPool.prototype.clear = function () {\r\n\t\t\tthis.items.length = 0;\r\n\t\t};\r\n\t\treturn Pool;\r\n\t}());\r\n\tspine.Pool = Pool;\r\n\tvar Vector2 = (function () {\r\n\t\tfunction Vector2(x, y) {\r\n\t\t\tif (x === void 0) { x = 0; }\r\n\t\t\tif (y === void 0) { y = 0; }\r\n\t\t\tthis.x = x;\r\n\t\t\tthis.y = y;\r\n\t\t}\r\n\t\tVector2.prototype.set = function (x, y) {\r\n\t\t\tthis.x = x;\r\n\t\t\tthis.y = y;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tVector2.prototype.length = function () {\r\n\t\t\tvar x = this.x;\r\n\t\t\tvar y = this.y;\r\n\t\t\treturn Math.sqrt(x * x + y * y);\r\n\t\t};\r\n\t\tVector2.prototype.normalize = function () {\r\n\t\t\tvar len = this.length();\r\n\t\t\tif (len != 0) {\r\n\t\t\t\tthis.x /= len;\r\n\t\t\t\tthis.y /= len;\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\treturn Vector2;\r\n\t}());\r\n\tspine.Vector2 = Vector2;\r\n\tvar TimeKeeper = (function () {\r\n\t\tfunction TimeKeeper() {\r\n\t\t\tthis.maxDelta = 0.064;\r\n\t\t\tthis.framesPerSecond = 0;\r\n\t\t\tthis.delta = 0;\r\n\t\t\tthis.totalTime = 0;\r\n\t\t\tthis.lastTime = Date.now() / 1000;\r\n\t\t\tthis.frameCount = 0;\r\n\t\t\tthis.frameTime = 0;\r\n\t\t}\r\n\t\tTimeKeeper.prototype.update = function () {\r\n\t\t\tvar now = Date.now() / 1000;\r\n\t\t\tthis.delta = now - this.lastTime;\r\n\t\t\tthis.frameTime += this.delta;\r\n\t\t\tthis.totalTime += this.delta;\r\n\t\t\tif (this.delta > this.maxDelta)\r\n\t\t\t\tthis.delta = this.maxDelta;\r\n\t\t\tthis.lastTime = now;\r\n\t\t\tthis.frameCount++;\r\n\t\t\tif (this.frameTime > 1) {\r\n\t\t\t\tthis.framesPerSecond = this.frameCount / this.frameTime;\r\n\t\t\t\tthis.frameTime = 0;\r\n\t\t\t\tthis.frameCount = 0;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn TimeKeeper;\r\n\t}());\r\n\tspine.TimeKeeper = TimeKeeper;\r\n\tvar WindowedMean = (function () {\r\n\t\tfunction WindowedMean(windowSize) {\r\n\t\t\tif (windowSize === void 0) { windowSize = 32; }\r\n\t\t\tthis.addedValues = 0;\r\n\t\t\tthis.lastValue = 0;\r\n\t\t\tthis.mean = 0;\r\n\t\t\tthis.dirty = true;\r\n\t\t\tthis.values = new Array(windowSize);\r\n\t\t}\r\n\t\tWindowedMean.prototype.hasEnoughData = function () {\r\n\t\t\treturn this.addedValues >= this.values.length;\r\n\t\t};\r\n\t\tWindowedMean.prototype.addValue = function (value) {\r\n\t\t\tif (this.addedValues < this.values.length)\r\n\t\t\t\tthis.addedValues++;\r\n\t\t\tthis.values[this.lastValue++] = value;\r\n\t\t\tif (this.lastValue > this.values.length - 1)\r\n\t\t\t\tthis.lastValue = 0;\r\n\t\t\tthis.dirty = true;\r\n\t\t};\r\n\t\tWindowedMean.prototype.getMean = function () {\r\n\t\t\tif (this.hasEnoughData()) {\r\n\t\t\t\tif (this.dirty) {\r\n\t\t\t\t\tvar mean = 0;\r\n\t\t\t\t\tfor (var i = 0; i < this.values.length; i++) {\r\n\t\t\t\t\t\tmean += this.values[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.mean = mean / this.values.length;\r\n\t\t\t\t\tthis.dirty = false;\r\n\t\t\t\t}\r\n\t\t\t\treturn this.mean;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn WindowedMean;\r\n\t}());\r\n\tspine.WindowedMean = WindowedMean;\r\n})(spine || (spine = {}));\r\n(function () {\r\n\tif (!Math.fround) {\r\n\t\tMath.fround = (function (array) {\r\n\t\t\treturn function (x) {\r\n\t\t\t\treturn array[0] = x, array[0];\r\n\t\t\t};\r\n\t\t})(new Float32Array(1));\r\n\t}\r\n})();\r\nvar spine;\r\n(function (spine) {\r\n\tvar Attachment = (function () {\r\n\t\tfunction Attachment(name) {\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn Attachment;\r\n\t}());\r\n\tspine.Attachment = Attachment;\r\n\tvar VertexAttachment = (function (_super) {\r\n\t\t__extends(VertexAttachment, _super);\r\n\t\tfunction VertexAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.id = (VertexAttachment.nextID++ & 65535) << 11;\r\n\t\t\t_this.worldVerticesLength = 0;\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tVertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n\t\t\tcount = offset + (count >> 1) * stride;\r\n\t\t\tvar skeleton = slot.bone.skeleton;\r\n\t\t\tvar deformArray = slot.attachmentVertices;\r\n\t\t\tvar vertices = this.vertices;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tif (bones == null) {\r\n\t\t\t\tif (deformArray.length > 0)\r\n\t\t\t\t\tvertices = deformArray;\r\n\t\t\t\tvar bone = slot.bone;\r\n\t\t\t\tvar x = bone.worldX;\r\n\t\t\t\tvar y = bone.worldY;\r\n\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\t\tfor (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\r\n\t\t\t\t\tvar vx = vertices[v_1], vy = vertices[v_1 + 1];\r\n\t\t\t\t\tworldVertices[w] = vx * a + vy * b + x;\r\n\t\t\t\t\tworldVertices[w + 1] = vx * c + vy * d + y;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar v = 0, skip = 0;\r\n\t\t\tfor (var i = 0; i < start; i += 2) {\r\n\t\t\t\tvar n = bones[v];\r\n\t\t\t\tv += n + 1;\r\n\t\t\t\tskip += n;\r\n\t\t\t}\r\n\t\t\tvar skeletonBones = skeleton.bones;\r\n\t\t\tif (deformArray.length == 0) {\r\n\t\t\t\tfor (var w = offset, b = skip * 3; w < count; w += stride) {\r\n\t\t\t\t\tvar wx = 0, wy = 0;\r\n\t\t\t\t\tvar n = bones[v++];\r\n\t\t\t\t\tn += v;\r\n\t\t\t\t\tfor (; v < n; v++, b += 3) {\r\n\t\t\t\t\t\tvar bone = skeletonBones[bones[v]];\r\n\t\t\t\t\t\tvar vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n\t\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\r\n\t\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tworldVertices[w] = wx;\r\n\t\t\t\t\tworldVertices[w + 1] = wy;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar deform = deformArray;\r\n\t\t\t\tfor (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\r\n\t\t\t\t\tvar wx = 0, wy = 0;\r\n\t\t\t\t\tvar n = bones[v++];\r\n\t\t\t\t\tn += v;\r\n\t\t\t\t\tfor (; v < n; v++, b += 3, f += 2) {\r\n\t\t\t\t\t\tvar bone = skeletonBones[bones[v]];\r\n\t\t\t\t\t\tvar vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n\t\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\r\n\t\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tworldVertices[w] = wx;\r\n\t\t\t\t\tworldVertices[w + 1] = wy;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tVertexAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n\t\t\treturn this == sourceAttachment;\r\n\t\t};\r\n\t\tVertexAttachment.nextID = 0;\r\n\t\treturn VertexAttachment;\r\n\t}(Attachment));\r\n\tspine.VertexAttachment = VertexAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AttachmentType;\r\n\t(function (AttachmentType) {\r\n\t\tAttachmentType[AttachmentType[\"Region\"] = 0] = \"Region\";\r\n\t\tAttachmentType[AttachmentType[\"BoundingBox\"] = 1] = \"BoundingBox\";\r\n\t\tAttachmentType[AttachmentType[\"Mesh\"] = 2] = \"Mesh\";\r\n\t\tAttachmentType[AttachmentType[\"LinkedMesh\"] = 3] = \"LinkedMesh\";\r\n\t\tAttachmentType[AttachmentType[\"Path\"] = 4] = \"Path\";\r\n\t\tAttachmentType[AttachmentType[\"Point\"] = 5] = \"Point\";\r\n\t})(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar BoundingBoxAttachment = (function (_super) {\r\n\t\t__extends(BoundingBoxAttachment, _super);\r\n\t\tfunction BoundingBoxAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\treturn BoundingBoxAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.BoundingBoxAttachment = BoundingBoxAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar ClippingAttachment = (function (_super) {\r\n\t\t__extends(ClippingAttachment, _super);\r\n\t\tfunction ClippingAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\treturn ClippingAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.ClippingAttachment = ClippingAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar MeshAttachment = (function (_super) {\r\n\t\t__extends(MeshAttachment, _super);\r\n\t\tfunction MeshAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\t_this.inheritDeform = false;\r\n\t\t\t_this.tempColor = new spine.Color(0, 0, 0, 0);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tMeshAttachment.prototype.updateUVs = function () {\r\n\t\t\tvar regionUVs = this.regionUVs;\r\n\t\t\tif (this.uvs == null || this.uvs.length != regionUVs.length)\r\n\t\t\t\tthis.uvs = spine.Utils.newFloatArray(regionUVs.length);\r\n\t\t\tvar uvs = this.uvs;\r\n\t\t\tvar u = 0, v = 0, width = 0, height = 0;\r\n\t\t\tif (this.region instanceof spine.TextureAtlasRegion) {\r\n\t\t\t\tvar region = this.region;\r\n\t\t\t\tvar textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height;\r\n\t\t\t\tif (region.rotate) {\r\n\t\t\t\t\tu = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth;\r\n\t\t\t\t\tv = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight;\r\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\r\n\t\t\t\t\theight = region.originalWidth / textureHeight;\r\n\t\t\t\t\tfor (var i = 0, n = uvs.length; i < n; i += 2) {\r\n\t\t\t\t\t\tuvs[i] = u + regionUVs[i + 1] * width;\r\n\t\t\t\t\t\tuvs[i + 1] = v + height - regionUVs[i] * height;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tu = region.u - region.offsetX / textureWidth;\r\n\t\t\t\tv = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight;\r\n\t\t\t\twidth = region.originalWidth / textureWidth;\r\n\t\t\t\theight = region.originalHeight / textureHeight;\r\n\t\t\t}\r\n\t\t\telse if (this.region == null) {\r\n\t\t\t\tu = v = 0;\r\n\t\t\t\twidth = height = 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tu = this.region.u;\r\n\t\t\t\tv = this.region.v;\r\n\t\t\t\twidth = this.region.u2 - u;\r\n\t\t\t\theight = this.region.v2 - v;\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = uvs.length; i < n; i += 2) {\r\n\t\t\t\tuvs[i] = u + regionUVs[i] * width;\r\n\t\t\t\tuvs[i + 1] = v + regionUVs[i + 1] * height;\r\n\t\t\t}\r\n\t\t};\r\n\t\tMeshAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n\t\t\treturn this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);\r\n\t\t};\r\n\t\tMeshAttachment.prototype.getParentMesh = function () {\r\n\t\t\treturn this.parentMesh;\r\n\t\t};\r\n\t\tMeshAttachment.prototype.setParentMesh = function (parentMesh) {\r\n\t\t\tthis.parentMesh = parentMesh;\r\n\t\t\tif (parentMesh != null) {\r\n\t\t\t\tthis.bones = parentMesh.bones;\r\n\t\t\t\tthis.vertices = parentMesh.vertices;\r\n\t\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength;\r\n\t\t\t\tthis.regionUVs = parentMesh.regionUVs;\r\n\t\t\t\tthis.triangles = parentMesh.triangles;\r\n\t\t\t\tthis.hullLength = parentMesh.hullLength;\r\n\t\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn MeshAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.MeshAttachment = MeshAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PathAttachment = (function (_super) {\r\n\t\t__extends(PathAttachment, _super);\r\n\t\tfunction PathAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.closed = false;\r\n\t\t\t_this.constantSpeed = false;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\treturn PathAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.PathAttachment = PathAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PointAttachment = (function (_super) {\r\n\t\t__extends(PointAttachment, _super);\r\n\t\tfunction PointAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(0.38, 0.94, 0, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPointAttachment.prototype.computeWorldPosition = function (bone, point) {\r\n\t\t\tpoint.x = this.x * bone.a + this.y * bone.b + bone.worldX;\r\n\t\t\tpoint.y = this.x * bone.c + this.y * bone.d + bone.worldY;\r\n\t\t\treturn point;\r\n\t\t};\r\n\t\tPointAttachment.prototype.computeWorldRotation = function (bone) {\r\n\t\t\tvar cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation);\r\n\t\t\tvar x = cos * bone.a + sin * bone.b;\r\n\t\t\tvar y = cos * bone.c + sin * bone.d;\r\n\t\t\treturn Math.atan2(y, x) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\treturn PointAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.PointAttachment = PointAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar RegionAttachment = (function (_super) {\r\n\t\t__extends(RegionAttachment, _super);\r\n\t\tfunction RegionAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.x = 0;\r\n\t\t\t_this.y = 0;\r\n\t\t\t_this.scaleX = 1;\r\n\t\t\t_this.scaleY = 1;\r\n\t\t\t_this.rotation = 0;\r\n\t\t\t_this.width = 0;\r\n\t\t\t_this.height = 0;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\t_this.offset = spine.Utils.newFloatArray(8);\r\n\t\t\t_this.uvs = spine.Utils.newFloatArray(8);\r\n\t\t\t_this.tempColor = new spine.Color(1, 1, 1, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tRegionAttachment.prototype.updateOffset = function () {\r\n\t\t\tvar regionScaleX = this.width / this.region.originalWidth * this.scaleX;\r\n\t\t\tvar regionScaleY = this.height / this.region.originalHeight * this.scaleY;\r\n\t\t\tvar localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\r\n\t\t\tvar localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\r\n\t\t\tvar localX2 = localX + this.region.width * regionScaleX;\r\n\t\t\tvar localY2 = localY + this.region.height * regionScaleY;\r\n\t\t\tvar radians = this.rotation * Math.PI / 180;\r\n\t\t\tvar cos = Math.cos(radians);\r\n\t\t\tvar sin = Math.sin(radians);\r\n\t\t\tvar localXCos = localX * cos + this.x;\r\n\t\t\tvar localXSin = localX * sin;\r\n\t\t\tvar localYCos = localY * cos + this.y;\r\n\t\t\tvar localYSin = localY * sin;\r\n\t\t\tvar localX2Cos = localX2 * cos + this.x;\r\n\t\t\tvar localX2Sin = localX2 * sin;\r\n\t\t\tvar localY2Cos = localY2 * cos + this.y;\r\n\t\t\tvar localY2Sin = localY2 * sin;\r\n\t\t\tvar offset = this.offset;\r\n\t\t\toffset[RegionAttachment.OX1] = localXCos - localYSin;\r\n\t\t\toffset[RegionAttachment.OY1] = localYCos + localXSin;\r\n\t\t\toffset[RegionAttachment.OX2] = localXCos - localY2Sin;\r\n\t\t\toffset[RegionAttachment.OY2] = localY2Cos + localXSin;\r\n\t\t\toffset[RegionAttachment.OX3] = localX2Cos - localY2Sin;\r\n\t\t\toffset[RegionAttachment.OY3] = localY2Cos + localX2Sin;\r\n\t\t\toffset[RegionAttachment.OX4] = localX2Cos - localYSin;\r\n\t\t\toffset[RegionAttachment.OY4] = localYCos + localX2Sin;\r\n\t\t};\r\n\t\tRegionAttachment.prototype.setRegion = function (region) {\r\n\t\t\tthis.region = region;\r\n\t\t\tvar uvs = this.uvs;\r\n\t\t\tif (region.rotate) {\r\n\t\t\t\tuvs[2] = region.u;\r\n\t\t\t\tuvs[3] = region.v2;\r\n\t\t\t\tuvs[4] = region.u;\r\n\t\t\t\tuvs[5] = region.v;\r\n\t\t\t\tuvs[6] = region.u2;\r\n\t\t\t\tuvs[7] = region.v;\r\n\t\t\t\tuvs[0] = region.u2;\r\n\t\t\t\tuvs[1] = region.v2;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tuvs[0] = region.u;\r\n\t\t\t\tuvs[1] = region.v2;\r\n\t\t\t\tuvs[2] = region.u;\r\n\t\t\t\tuvs[3] = region.v;\r\n\t\t\t\tuvs[4] = region.u2;\r\n\t\t\t\tuvs[5] = region.v;\r\n\t\t\t\tuvs[6] = region.u2;\r\n\t\t\t\tuvs[7] = region.v2;\r\n\t\t\t}\r\n\t\t};\r\n\t\tRegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {\r\n\t\t\tvar vertexOffset = this.offset;\r\n\t\t\tvar x = bone.worldX, y = bone.worldY;\r\n\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\tvar offsetX = 0, offsetY = 0;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX1];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY1];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t\toffset += stride;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX2];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY2];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t\toffset += stride;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX3];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY3];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t\toffset += stride;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX4];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY4];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t};\r\n\t\tRegionAttachment.OX1 = 0;\r\n\t\tRegionAttachment.OY1 = 1;\r\n\t\tRegionAttachment.OX2 = 2;\r\n\t\tRegionAttachment.OY2 = 3;\r\n\t\tRegionAttachment.OX3 = 4;\r\n\t\tRegionAttachment.OY3 = 5;\r\n\t\tRegionAttachment.OX4 = 6;\r\n\t\tRegionAttachment.OY4 = 7;\r\n\t\tRegionAttachment.X1 = 0;\r\n\t\tRegionAttachment.Y1 = 1;\r\n\t\tRegionAttachment.C1R = 2;\r\n\t\tRegionAttachment.C1G = 3;\r\n\t\tRegionAttachment.C1B = 4;\r\n\t\tRegionAttachment.C1A = 5;\r\n\t\tRegionAttachment.U1 = 6;\r\n\t\tRegionAttachment.V1 = 7;\r\n\t\tRegionAttachment.X2 = 8;\r\n\t\tRegionAttachment.Y2 = 9;\r\n\t\tRegionAttachment.C2R = 10;\r\n\t\tRegionAttachment.C2G = 11;\r\n\t\tRegionAttachment.C2B = 12;\r\n\t\tRegionAttachment.C2A = 13;\r\n\t\tRegionAttachment.U2 = 14;\r\n\t\tRegionAttachment.V2 = 15;\r\n\t\tRegionAttachment.X3 = 16;\r\n\t\tRegionAttachment.Y3 = 17;\r\n\t\tRegionAttachment.C3R = 18;\r\n\t\tRegionAttachment.C3G = 19;\r\n\t\tRegionAttachment.C3B = 20;\r\n\t\tRegionAttachment.C3A = 21;\r\n\t\tRegionAttachment.U3 = 22;\r\n\t\tRegionAttachment.V3 = 23;\r\n\t\tRegionAttachment.X4 = 24;\r\n\t\tRegionAttachment.Y4 = 25;\r\n\t\tRegionAttachment.C4R = 26;\r\n\t\tRegionAttachment.C4G = 27;\r\n\t\tRegionAttachment.C4B = 28;\r\n\t\tRegionAttachment.C4A = 29;\r\n\t\tRegionAttachment.U4 = 30;\r\n\t\tRegionAttachment.V4 = 31;\r\n\t\treturn RegionAttachment;\r\n\t}(spine.Attachment));\r\n\tspine.RegionAttachment = RegionAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar JitterEffect = (function () {\r\n\t\tfunction JitterEffect(jitterX, jitterY) {\r\n\t\t\tthis.jitterX = 0;\r\n\t\t\tthis.jitterY = 0;\r\n\t\t\tthis.jitterX = jitterX;\r\n\t\t\tthis.jitterY = jitterY;\r\n\t\t}\r\n\t\tJitterEffect.prototype.begin = function (skeleton) {\r\n\t\t};\r\n\t\tJitterEffect.prototype.transform = function (position, uv, light, dark) {\r\n\t\t\tposition.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n\t\t\tposition.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n\t\t};\r\n\t\tJitterEffect.prototype.end = function () {\r\n\t\t};\r\n\t\treturn JitterEffect;\r\n\t}());\r\n\tspine.JitterEffect = JitterEffect;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SwirlEffect = (function () {\r\n\t\tfunction SwirlEffect(radius) {\r\n\t\t\tthis.centerX = 0;\r\n\t\t\tthis.centerY = 0;\r\n\t\t\tthis.radius = 0;\r\n\t\t\tthis.angle = 0;\r\n\t\t\tthis.worldX = 0;\r\n\t\t\tthis.worldY = 0;\r\n\t\t\tthis.radius = radius;\r\n\t\t}\r\n\t\tSwirlEffect.prototype.begin = function (skeleton) {\r\n\t\t\tthis.worldX = skeleton.x + this.centerX;\r\n\t\t\tthis.worldY = skeleton.y + this.centerY;\r\n\t\t};\r\n\t\tSwirlEffect.prototype.transform = function (position, uv, light, dark) {\r\n\t\t\tvar radAngle = this.angle * spine.MathUtils.degreesToRadians;\r\n\t\t\tvar x = position.x - this.worldX;\r\n\t\t\tvar y = position.y - this.worldY;\r\n\t\t\tvar dist = Math.sqrt(x * x + y * y);\r\n\t\t\tif (dist < this.radius) {\r\n\t\t\t\tvar theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);\r\n\t\t\t\tvar cos = Math.cos(theta);\r\n\t\t\t\tvar sin = Math.sin(theta);\r\n\t\t\t\tposition.x = cos * x - sin * y + this.worldX;\r\n\t\t\t\tposition.y = sin * x + cos * y + this.worldY;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSwirlEffect.prototype.end = function () {\r\n\t\t};\r\n\t\tSwirlEffect.interpolation = new spine.PowOut(2);\r\n\t\treturn SwirlEffect;\r\n\t}());\r\n\tspine.SwirlEffect = SwirlEffect;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar canvas;\r\n\t(function (canvas) {\r\n\t\tvar AssetManager = (function (_super) {\r\n\t\t\t__extends(AssetManager, _super);\r\n\t\t\tfunction AssetManager(pathPrefix) {\r\n\t\t\t\tif (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n\t\t\t\treturn _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this;\r\n\t\t\t}\r\n\t\t\treturn AssetManager;\r\n\t\t}(spine.AssetManager));\r\n\t\tcanvas.AssetManager = AssetManager;\r\n\t})(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar canvas;\r\n\t(function (canvas) {\r\n\t\tvar CanvasTexture = (function (_super) {\r\n\t\t\t__extends(CanvasTexture, _super);\r\n\t\t\tfunction CanvasTexture(image) {\r\n\t\t\t\treturn _super.call(this, image) || this;\r\n\t\t\t}\r\n\t\t\tCanvasTexture.prototype.setFilters = function (minFilter, magFilter) { };\r\n\t\t\tCanvasTexture.prototype.setWraps = function (uWrap, vWrap) { };\r\n\t\t\tCanvasTexture.prototype.dispose = function () { };\r\n\t\t\treturn CanvasTexture;\r\n\t\t}(spine.Texture));\r\n\t\tcanvas.CanvasTexture = CanvasTexture;\r\n\t})(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar canvas;\r\n\t(function (canvas) {\r\n\t\tvar SkeletonRenderer = (function () {\r\n\t\t\tfunction SkeletonRenderer(context) {\r\n\t\t\t\tthis.triangleRendering = false;\r\n\t\t\t\tthis.debugRendering = false;\r\n\t\t\t\tthis.vertices = spine.Utils.newFloatArray(8 * 1024);\r\n\t\t\t\tthis.tempColor = new spine.Color();\r\n\t\t\t\tthis.ctx = context;\r\n\t\t\t}\r\n\t\t\tSkeletonRenderer.prototype.draw = function (skeleton) {\r\n\t\t\t\tif (this.triangleRendering)\r\n\t\t\t\t\tthis.drawTriangles(skeleton);\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.drawImages(skeleton);\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.prototype.drawImages = function (skeleton) {\r\n\t\t\t\tvar ctx = this.ctx;\r\n\t\t\t\tvar drawOrder = skeleton.drawOrder;\r\n\t\t\t\tif (this.debugRendering)\r\n\t\t\t\t\tctx.strokeStyle = \"green\";\r\n\t\t\t\tctx.save();\r\n\t\t\t\tfor (var i = 0, n = drawOrder.length; i < n; i++) {\r\n\t\t\t\t\tvar slot = drawOrder[i];\r\n\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\tvar regionAttachment = null;\r\n\t\t\t\t\tvar region = null;\r\n\t\t\t\t\tvar image = null;\r\n\t\t\t\t\tif (attachment instanceof spine.RegionAttachment) {\r\n\t\t\t\t\t\tregionAttachment = attachment;\r\n\t\t\t\t\t\tregion = regionAttachment.region;\r\n\t\t\t\t\t\timage = region.texture.getImage();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tvar skeleton_1 = slot.bone.skeleton;\r\n\t\t\t\t\tvar skeletonColor = skeleton_1.color;\r\n\t\t\t\t\tvar slotColor = slot.color;\r\n\t\t\t\t\tvar regionColor = regionAttachment.color;\r\n\t\t\t\t\tvar alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n\t\t\t\t\tvar color = this.tempColor;\r\n\t\t\t\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha);\r\n\t\t\t\t\tvar att = attachment;\r\n\t\t\t\t\tvar bone = slot.bone;\r\n\t\t\t\t\tvar w = region.width;\r\n\t\t\t\t\tvar h = region.height;\r\n\t\t\t\t\tctx.save();\r\n\t\t\t\t\tctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);\r\n\t\t\t\t\tctx.translate(attachment.offset[0], attachment.offset[1]);\r\n\t\t\t\t\tctx.rotate(attachment.rotation * Math.PI / 180);\r\n\t\t\t\t\tvar atlasScale = att.width / w;\r\n\t\t\t\t\tctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);\r\n\t\t\t\t\tctx.translate(w / 2, h / 2);\r\n\t\t\t\t\tif (attachment.region.rotate) {\r\n\t\t\t\t\t\tvar t = w;\r\n\t\t\t\t\t\tw = h;\r\n\t\t\t\t\t\th = t;\r\n\t\t\t\t\t\tctx.rotate(-Math.PI / 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tctx.scale(1, -1);\r\n\t\t\t\t\tctx.translate(-w / 2, -h / 2);\r\n\t\t\t\t\tif (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {\r\n\t\t\t\t\t\tctx.globalAlpha = color.a;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h);\r\n\t\t\t\t\tif (this.debugRendering)\r\n\t\t\t\t\t\tctx.strokeRect(0, 0, w, h);\r\n\t\t\t\t\tctx.restore();\r\n\t\t\t\t}\r\n\t\t\t\tctx.restore();\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.prototype.drawTriangles = function (skeleton) {\r\n\t\t\t\tvar blendMode = null;\r\n\t\t\t\tvar vertices = this.vertices;\r\n\t\t\t\tvar triangles = null;\r\n\t\t\t\tvar drawOrder = skeleton.drawOrder;\r\n\t\t\t\tfor (var i = 0, n = drawOrder.length; i < n; i++) {\r\n\t\t\t\t\tvar slot = drawOrder[i];\r\n\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\tvar texture = null;\r\n\t\t\t\t\tvar region = null;\r\n\t\t\t\t\tif (attachment instanceof spine.RegionAttachment) {\r\n\t\t\t\t\t\tvar regionAttachment = attachment;\r\n\t\t\t\t\t\tvertices = this.computeRegionVertices(slot, regionAttachment, false);\r\n\t\t\t\t\t\ttriangles = SkeletonRenderer.QUAD_TRIANGLES;\r\n\t\t\t\t\t\tregion = regionAttachment.region;\r\n\t\t\t\t\t\ttexture = region.texture.getImage();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (attachment instanceof spine.MeshAttachment) {\r\n\t\t\t\t\t\tvar mesh = attachment;\r\n\t\t\t\t\t\tvertices = this.computeMeshVertices(slot, mesh, false);\r\n\t\t\t\t\t\ttriangles = mesh.triangles;\r\n\t\t\t\t\t\ttexture = mesh.region.renderObject.texture.getImage();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (texture != null) {\r\n\t\t\t\t\t\tvar slotBlendMode = slot.data.blendMode;\r\n\t\t\t\t\t\tif (slotBlendMode != blendMode) {\r\n\t\t\t\t\t\t\tblendMode = slotBlendMode;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar skeleton_2 = slot.bone.skeleton;\r\n\t\t\t\t\t\tvar skeletonColor = skeleton_2.color;\r\n\t\t\t\t\t\tvar slotColor = slot.color;\r\n\t\t\t\t\t\tvar attachmentColor = attachment.color;\r\n\t\t\t\t\t\tvar alpha = skeletonColor.a * slotColor.a * attachmentColor.a;\r\n\t\t\t\t\t\tvar color = this.tempColor;\r\n\t\t\t\t\t\tcolor.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha);\r\n\t\t\t\t\t\tvar ctx = this.ctx;\r\n\t\t\t\t\t\tif (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {\r\n\t\t\t\t\t\t\tctx.globalAlpha = color.a;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (var j = 0; j < triangles.length; j += 3) {\r\n\t\t\t\t\t\t\tvar t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8;\r\n\t\t\t\t\t\t\tvar x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7];\r\n\t\t\t\t\t\t\tvar x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7];\r\n\t\t\t\t\t\t\tvar x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7];\r\n\t\t\t\t\t\t\tthis.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);\r\n\t\t\t\t\t\t\tif (this.debugRendering) {\r\n\t\t\t\t\t\t\t\tctx.strokeStyle = \"green\";\r\n\t\t\t\t\t\t\t\tctx.beginPath();\r\n\t\t\t\t\t\t\t\tctx.moveTo(x0, y0);\r\n\t\t\t\t\t\t\t\tctx.lineTo(x1, y1);\r\n\t\t\t\t\t\t\t\tctx.lineTo(x2, y2);\r\n\t\t\t\t\t\t\t\tctx.lineTo(x0, y0);\r\n\t\t\t\t\t\t\t\tctx.stroke();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.ctx.globalAlpha = 1;\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) {\r\n\t\t\t\tvar ctx = this.ctx;\r\n\t\t\t\tu0 *= img.width;\r\n\t\t\t\tv0 *= img.height;\r\n\t\t\t\tu1 *= img.width;\r\n\t\t\t\tv1 *= img.height;\r\n\t\t\t\tu2 *= img.width;\r\n\t\t\t\tv2 *= img.height;\r\n\t\t\t\tctx.beginPath();\r\n\t\t\t\tctx.moveTo(x0, y0);\r\n\t\t\t\tctx.lineTo(x1, y1);\r\n\t\t\t\tctx.lineTo(x2, y2);\r\n\t\t\t\tctx.closePath();\r\n\t\t\t\tx1 -= x0;\r\n\t\t\t\ty1 -= y0;\r\n\t\t\t\tx2 -= x0;\r\n\t\t\t\ty2 -= y0;\r\n\t\t\t\tu1 -= u0;\r\n\t\t\t\tv1 -= v0;\r\n\t\t\t\tu2 -= u0;\r\n\t\t\t\tv2 -= v0;\r\n\t\t\t\tvar det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0;\r\n\t\t\t\tctx.save();\r\n\t\t\t\tctx.transform(a, b, c, d, e, f);\r\n\t\t\t\tctx.clip();\r\n\t\t\t\tctx.drawImage(img, 0, 0);\r\n\t\t\t\tctx.restore();\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) {\r\n\t\t\t\tvar skeleton = slot.bone.skeleton;\r\n\t\t\t\tvar skeletonColor = skeleton.color;\r\n\t\t\t\tvar slotColor = slot.color;\r\n\t\t\t\tvar regionColor = region.color;\r\n\t\t\t\tvar alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n\t\t\t\tvar multiplier = pma ? alpha : 1;\r\n\t\t\t\tvar color = this.tempColor;\r\n\t\t\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha);\r\n\t\t\t\tregion.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE);\r\n\t\t\t\tvar vertices = this.vertices;\r\n\t\t\t\tvar uvs = region.uvs;\r\n\t\t\t\tvertices[spine.RegionAttachment.C1R] = color.r;\r\n\t\t\t\tvertices[spine.RegionAttachment.C1G] = color.g;\r\n\t\t\t\tvertices[spine.RegionAttachment.C1B] = color.b;\r\n\t\t\t\tvertices[spine.RegionAttachment.C1A] = color.a;\r\n\t\t\t\tvertices[spine.RegionAttachment.U1] = uvs[0];\r\n\t\t\t\tvertices[spine.RegionAttachment.V1] = uvs[1];\r\n\t\t\t\tvertices[spine.RegionAttachment.C2R] = color.r;\r\n\t\t\t\tvertices[spine.RegionAttachment.C2G] = color.g;\r\n\t\t\t\tvertices[spine.RegionAttachment.C2B] = color.b;\r\n\t\t\t\tvertices[spine.RegionAttachment.C2A] = color.a;\r\n\t\t\t\tvertices[spine.RegionAttachment.U2] = uvs[2];\r\n\t\t\t\tvertices[spine.RegionAttachment.V2] = uvs[3];\r\n\t\t\t\tvertices[spine.RegionAttachment.C3R] = color.r;\r\n\t\t\t\tvertices[spine.RegionAttachment.C3G] = color.g;\r\n\t\t\t\tvertices[spine.RegionAttachment.C3B] = color.b;\r\n\t\t\t\tvertices[spine.RegionAttachment.C3A] = color.a;\r\n\t\t\t\tvertices[spine.RegionAttachment.U3] = uvs[4];\r\n\t\t\t\tvertices[spine.RegionAttachment.V3] = uvs[5];\r\n\t\t\t\tvertices[spine.RegionAttachment.C4R] = color.r;\r\n\t\t\t\tvertices[spine.RegionAttachment.C4G] = color.g;\r\n\t\t\t\tvertices[spine.RegionAttachment.C4B] = color.b;\r\n\t\t\t\tvertices[spine.RegionAttachment.C4A] = color.a;\r\n\t\t\t\tvertices[spine.RegionAttachment.U4] = uvs[6];\r\n\t\t\t\tvertices[spine.RegionAttachment.V4] = uvs[7];\r\n\t\t\t\treturn vertices;\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) {\r\n\t\t\t\tvar skeleton = slot.bone.skeleton;\r\n\t\t\t\tvar skeletonColor = skeleton.color;\r\n\t\t\t\tvar slotColor = slot.color;\r\n\t\t\t\tvar regionColor = mesh.color;\r\n\t\t\t\tvar alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n\t\t\t\tvar multiplier = pma ? alpha : 1;\r\n\t\t\t\tvar color = this.tempColor;\r\n\t\t\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha);\r\n\t\t\t\tvar numVertices = mesh.worldVerticesLength / 2;\r\n\t\t\t\tif (this.vertices.length < mesh.worldVerticesLength) {\r\n\t\t\t\t\tthis.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength);\r\n\t\t\t\t}\r\n\t\t\t\tvar vertices = this.vertices;\r\n\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE);\r\n\t\t\t\tvar uvs = mesh.uvs;\r\n\t\t\t\tfor (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) {\r\n\t\t\t\t\tvertices[v++] = color.r;\r\n\t\t\t\t\tvertices[v++] = color.g;\r\n\t\t\t\t\tvertices[v++] = color.b;\r\n\t\t\t\t\tvertices[v++] = color.a;\r\n\t\t\t\t\tvertices[v++] = uvs[u++];\r\n\t\t\t\t\tvertices[v++] = uvs[u++];\r\n\t\t\t\t\tv += 2;\r\n\t\t\t\t}\r\n\t\t\t\treturn vertices;\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n\t\t\tSkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4;\r\n\t\t\treturn SkeletonRenderer;\r\n\t\t}());\r\n\t\tcanvas.SkeletonRenderer = SkeletonRenderer;\r\n\t})(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar AssetManager = (function (_super) {\r\n\t\t\t__extends(AssetManager, _super);\r\n\t\t\tfunction AssetManager(context, pathPrefix) {\r\n\t\t\t\tif (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n\t\t\t\treturn _super.call(this, function (image) {\r\n\t\t\t\t\treturn new spine.webgl.GLTexture(context, image);\r\n\t\t\t\t}, pathPrefix) || this;\r\n\t\t\t}\r\n\t\t\treturn AssetManager;\r\n\t\t}(spine.AssetManager));\r\n\t\twebgl.AssetManager = AssetManager;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar OrthoCamera = (function () {\r\n\t\t\tfunction OrthoCamera(viewportWidth, viewportHeight) {\r\n\t\t\t\tthis.position = new webgl.Vector3(0, 0, 0);\r\n\t\t\t\tthis.direction = new webgl.Vector3(0, 0, -1);\r\n\t\t\t\tthis.up = new webgl.Vector3(0, 1, 0);\r\n\t\t\t\tthis.near = 0;\r\n\t\t\t\tthis.far = 100;\r\n\t\t\t\tthis.zoom = 1;\r\n\t\t\t\tthis.viewportWidth = 0;\r\n\t\t\t\tthis.viewportHeight = 0;\r\n\t\t\t\tthis.projectionView = new webgl.Matrix4();\r\n\t\t\t\tthis.inverseProjectionView = new webgl.Matrix4();\r\n\t\t\t\tthis.projection = new webgl.Matrix4();\r\n\t\t\t\tthis.view = new webgl.Matrix4();\r\n\t\t\t\tthis.tmp = new webgl.Vector3();\r\n\t\t\t\tthis.viewportWidth = viewportWidth;\r\n\t\t\t\tthis.viewportHeight = viewportHeight;\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t\tOrthoCamera.prototype.update = function () {\r\n\t\t\t\tvar projection = this.projection;\r\n\t\t\t\tvar view = this.view;\r\n\t\t\t\tvar projectionView = this.projectionView;\r\n\t\t\t\tvar inverseProjectionView = this.inverseProjectionView;\r\n\t\t\t\tvar zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight;\r\n\t\t\t\tprojection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far);\r\n\t\t\t\tview.lookAt(this.position, this.direction, this.up);\r\n\t\t\t\tprojectionView.set(projection.values);\r\n\t\t\t\tprojectionView.multiply(view);\r\n\t\t\t\tinverseProjectionView.set(projectionView.values).invert();\r\n\t\t\t};\r\n\t\t\tOrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) {\r\n\t\t\t\tvar x = screenCoords.x, y = screenHeight - screenCoords.y - 1;\r\n\t\t\t\tvar tmp = this.tmp;\r\n\t\t\t\ttmp.x = (2 * x) / screenWidth - 1;\r\n\t\t\t\ttmp.y = (2 * y) / screenHeight - 1;\r\n\t\t\t\ttmp.z = (2 * screenCoords.z) - 1;\r\n\t\t\t\ttmp.project(this.inverseProjectionView);\r\n\t\t\t\tscreenCoords.set(tmp.x, tmp.y, tmp.z);\r\n\t\t\t\treturn screenCoords;\r\n\t\t\t};\r\n\t\t\tOrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) {\r\n\t\t\t\tthis.viewportWidth = viewportWidth;\r\n\t\t\t\tthis.viewportHeight = viewportHeight;\r\n\t\t\t};\r\n\t\t\treturn OrthoCamera;\r\n\t\t}());\r\n\t\twebgl.OrthoCamera = OrthoCamera;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar GLTexture = (function (_super) {\r\n\t\t\t__extends(GLTexture, _super);\r\n\t\t\tfunction GLTexture(context, image, useMipMaps) {\r\n\t\t\t\tif (useMipMaps === void 0) { useMipMaps = false; }\r\n\t\t\t\tvar _this = _super.call(this, image) || this;\r\n\t\t\t\t_this.texture = null;\r\n\t\t\t\t_this.boundUnit = 0;\r\n\t\t\t\t_this.useMipMaps = false;\r\n\t\t\t\t_this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\t_this.useMipMaps = useMipMaps;\r\n\t\t\t\t_this.restore();\r\n\t\t\t\t_this.context.addRestorable(_this);\r\n\t\t\t\treturn _this;\r\n\t\t\t}\r\n\t\t\tGLTexture.prototype.setFilters = function (minFilter, magFilter) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.bind();\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.setWraps = function (uWrap, vWrap) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.bind();\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.update = function (useMipMaps) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (!this.texture) {\r\n\t\t\t\t\tthis.texture = this.context.gl.createTexture();\r\n\t\t\t\t}\r\n\t\t\t\tthis.bind();\r\n\t\t\t\tgl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n\t\t\t\tif (useMipMaps)\r\n\t\t\t\t\tgl.generateMipmap(gl.TEXTURE_2D);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.restore = function () {\r\n\t\t\t\tthis.texture = null;\r\n\t\t\t\tthis.update(this.useMipMaps);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.bind = function (unit) {\r\n\t\t\t\tif (unit === void 0) { unit = 0; }\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.boundUnit = unit;\r\n\t\t\t\tgl.activeTexture(gl.TEXTURE0 + unit);\r\n\t\t\t\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.unbind = function () {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tgl.activeTexture(gl.TEXTURE0 + this.boundUnit);\r\n\t\t\t\tgl.bindTexture(gl.TEXTURE_2D, null);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.dispose = function () {\r\n\t\t\t\tthis.context.removeRestorable(this);\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tgl.deleteTexture(this.texture);\r\n\t\t\t};\r\n\t\t\treturn GLTexture;\r\n\t\t}(spine.Texture));\r\n\t\twebgl.GLTexture = GLTexture;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar Input = (function () {\r\n\t\t\tfunction Input(element) {\r\n\t\t\t\tthis.lastX = 0;\r\n\t\t\t\tthis.lastY = 0;\r\n\t\t\t\tthis.buttonDown = false;\r\n\t\t\t\tthis.currTouch = null;\r\n\t\t\t\tthis.touchesPool = new spine.Pool(function () {\r\n\t\t\t\t\treturn new spine.webgl.Touch(0, 0, 0);\r\n\t\t\t\t});\r\n\t\t\t\tthis.listeners = new Array();\r\n\t\t\t\tthis.element = element;\r\n\t\t\t\tthis.setupCallbacks(element);\r\n\t\t\t}\r\n\t\t\tInput.prototype.setupCallbacks = function (element) {\r\n\t\t\t\tvar _this = this;\r\n\t\t\t\tvar mouseDown = function (ev) {\r\n\t\t\t\t\tif (ev instanceof MouseEvent) {\r\n\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\tvar x = ev.clientX - rect.left;\r\n\t\t\t\t\t\tvar y = ev.clientY - rect.top;\r\n\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\tfor (var i = 0; i < listeners.length; i++) {\r\n\t\t\t\t\t\t\tlisteners[i].down(x, y);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t_this.lastX = x;\r\n\t\t\t\t\t\t_this.lastY = y;\r\n\t\t\t\t\t\t_this.buttonDown = true;\r\n\t\t\t\t\t\tdocument.addEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\t\t\tdocument.addEventListener(\"mouseup\", mouseUp);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\tvar mouseMove = function (ev) {\r\n\t\t\t\t\tif (ev instanceof MouseEvent) {\r\n\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\tvar x = ev.clientX - rect.left;\r\n\t\t\t\t\t\tvar y = ev.clientY - rect.top;\r\n\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\tfor (var i = 0; i < listeners.length; i++) {\r\n\t\t\t\t\t\t\tif (_this.buttonDown) {\r\n\t\t\t\t\t\t\t\tlisteners[i].dragged(x, y);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tlisteners[i].moved(x, y);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t_this.lastX = x;\r\n\t\t\t\t\t\t_this.lastY = y;\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\tvar mouseUp = function (ev) {\r\n\t\t\t\t\tif (ev instanceof MouseEvent) {\r\n\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\tvar x = ev.clientX - rect.left;\r\n\t\t\t\t\t\tvar y = ev.clientY - rect.top;\r\n\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\tfor (var i = 0; i < listeners.length; i++) {\r\n\t\t\t\t\t\t\tlisteners[i].up(x, y);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t_this.lastX = x;\r\n\t\t\t\t\t\t_this.lastY = y;\r\n\t\t\t\t\t\t_this.buttonDown = false;\r\n\t\t\t\t\t\tdocument.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\t\t\tdocument.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\telement.addEventListener(\"mousedown\", mouseDown, true);\r\n\t\t\t\telement.addEventListener(\"mousemove\", mouseMove, true);\r\n\t\t\t\telement.addEventListener(\"mouseup\", mouseUp, true);\r\n\t\t\t\telement.addEventListener(\"touchstart\", function (ev) {\r\n\t\t\t\t\tif (_this.currTouch != null)\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tvar touches = ev.changedTouches;\r\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\r\n\t\t\t\t\t\tvar touch = touches[i];\r\n\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\tvar x = touch.clientX - rect.left;\r\n\t\t\t\t\t\tvar y = touch.clientY - rect.top;\r\n\t\t\t\t\t\t_this.currTouch = _this.touchesPool.obtain();\r\n\t\t\t\t\t\t_this.currTouch.identifier = touch.identifier;\r\n\t\t\t\t\t\t_this.currTouch.x = x;\r\n\t\t\t\t\t\t_this.currTouch.y = y;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\tfor (var i_16 = 0; i_16 < listeners.length; i_16++) {\r\n\t\t\t\t\t\tlisteners[i_16].down(_this.currTouch.x, _this.currTouch.y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconsole.log(\"Start \" + _this.currTouch.x + \", \" + _this.currTouch.y);\r\n\t\t\t\t\t_this.lastX = _this.currTouch.x;\r\n\t\t\t\t\t_this.lastY = _this.currTouch.y;\r\n\t\t\t\t\t_this.buttonDown = true;\r\n\t\t\t\t\tev.preventDefault();\r\n\t\t\t\t}, false);\r\n\t\t\t\telement.addEventListener(\"touchend\", function (ev) {\r\n\t\t\t\t\tvar touches = ev.changedTouches;\r\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\r\n\t\t\t\t\t\tvar touch = touches[i];\r\n\t\t\t\t\t\tif (_this.currTouch.identifier === touch.identifier) {\r\n\t\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\t\tvar x = _this.currTouch.x = touch.clientX - rect.left;\r\n\t\t\t\t\t\t\tvar y = _this.currTouch.y = touch.clientY - rect.top;\r\n\t\t\t\t\t\t\t_this.touchesPool.free(_this.currTouch);\r\n\t\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\t\tfor (var i_17 = 0; i_17 < listeners.length; i_17++) {\r\n\t\t\t\t\t\t\t\tlisteners[i_17].up(x, y);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconsole.log(\"End \" + x + \", \" + y);\r\n\t\t\t\t\t\t\t_this.lastX = x;\r\n\t\t\t\t\t\t\t_this.lastY = y;\r\n\t\t\t\t\t\t\t_this.buttonDown = false;\r\n\t\t\t\t\t\t\t_this.currTouch = null;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tev.preventDefault();\r\n\t\t\t\t}, false);\r\n\t\t\t\telement.addEventListener(\"touchcancel\", function (ev) {\r\n\t\t\t\t\tvar touches = ev.changedTouches;\r\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\r\n\t\t\t\t\t\tvar touch = touches[i];\r\n\t\t\t\t\t\tif (_this.currTouch.identifier === touch.identifier) {\r\n\t\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\t\tvar x = _this.currTouch.x = touch.clientX - rect.left;\r\n\t\t\t\t\t\t\tvar y = _this.currTouch.y = touch.clientY - rect.top;\r\n\t\t\t\t\t\t\t_this.touchesPool.free(_this.currTouch);\r\n\t\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\t\tfor (var i_18 = 0; i_18 < listeners.length; i_18++) {\r\n\t\t\t\t\t\t\t\tlisteners[i_18].up(x, y);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconsole.log(\"End \" + x + \", \" + y);\r\n\t\t\t\t\t\t\t_this.lastX = x;\r\n\t\t\t\t\t\t\t_this.lastY = y;\r\n\t\t\t\t\t\t\t_this.buttonDown = false;\r\n\t\t\t\t\t\t\t_this.currTouch = null;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tev.preventDefault();\r\n\t\t\t\t}, false);\r\n\t\t\t\telement.addEventListener(\"touchmove\", function (ev) {\r\n\t\t\t\t\tif (_this.currTouch == null)\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tvar touches = ev.changedTouches;\r\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\r\n\t\t\t\t\t\tvar touch = touches[i];\r\n\t\t\t\t\t\tif (_this.currTouch.identifier === touch.identifier) {\r\n\t\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\t\tvar x = touch.clientX - rect.left;\r\n\t\t\t\t\t\t\tvar y = touch.clientY - rect.top;\r\n\t\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\t\tfor (var i_19 = 0; i_19 < listeners.length; i_19++) {\r\n\t\t\t\t\t\t\t\tlisteners[i_19].dragged(x, y);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconsole.log(\"Drag \" + x + \", \" + y);\r\n\t\t\t\t\t\t\t_this.lastX = _this.currTouch.x = x;\r\n\t\t\t\t\t\t\t_this.lastY = _this.currTouch.y = y;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tev.preventDefault();\r\n\t\t\t\t}, false);\r\n\t\t\t};\r\n\t\t\tInput.prototype.addListener = function (listener) {\r\n\t\t\t\tthis.listeners.push(listener);\r\n\t\t\t};\r\n\t\t\tInput.prototype.removeListener = function (listener) {\r\n\t\t\t\tvar idx = this.listeners.indexOf(listener);\r\n\t\t\t\tif (idx > -1) {\r\n\t\t\t\t\tthis.listeners.splice(idx, 1);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\treturn Input;\r\n\t\t}());\r\n\t\twebgl.Input = Input;\r\n\t\tvar Touch = (function () {\r\n\t\t\tfunction Touch(identifier, x, y) {\r\n\t\t\t\tthis.identifier = identifier;\r\n\t\t\t\tthis.x = x;\r\n\t\t\t\tthis.y = y;\r\n\t\t\t}\r\n\t\t\treturn Touch;\r\n\t\t}());\r\n\t\twebgl.Touch = Touch;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar LoadingScreen = (function () {\r\n\t\t\tfunction LoadingScreen(renderer) {\r\n\t\t\t\tthis.logo = null;\r\n\t\t\t\tthis.spinner = null;\r\n\t\t\t\tthis.angle = 0;\r\n\t\t\t\tthis.fadeOut = 0;\r\n\t\t\t\tthis.timeKeeper = new spine.TimeKeeper();\r\n\t\t\t\tthis.backgroundColor = new spine.Color(0.135, 0.135, 0.135, 1);\r\n\t\t\t\tthis.tempColor = new spine.Color();\r\n\t\t\t\tthis.firstDraw = 0;\r\n\t\t\t\tthis.renderer = renderer;\r\n\t\t\t\tthis.timeKeeper.maxDelta = 9;\r\n\t\t\t\tif (LoadingScreen.logoImg === null) {\r\n\t\t\t\t\tvar isSafari = navigator.userAgent.indexOf(\"Safari\") > -1;\r\n\t\t\t\t\tLoadingScreen.logoImg = new Image();\r\n\t\t\t\t\tLoadingScreen.logoImg.src = LoadingScreen.SPINE_LOGO_DATA;\r\n\t\t\t\t\tif (!isSafari)\r\n\t\t\t\t\t\tLoadingScreen.logoImg.crossOrigin = \"anonymous\";\r\n\t\t\t\t\tLoadingScreen.logoImg.onload = function (ev) {\r\n\t\t\t\t\t\tLoadingScreen.loaded++;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tLoadingScreen.spinnerImg = new Image();\r\n\t\t\t\t\tLoadingScreen.spinnerImg.src = LoadingScreen.SPINNER_DATA;\r\n\t\t\t\t\tif (!isSafari)\r\n\t\t\t\t\t\tLoadingScreen.spinnerImg.crossOrigin = \"anonymous\";\r\n\t\t\t\t\tLoadingScreen.spinnerImg.onload = function (ev) {\r\n\t\t\t\t\t\tLoadingScreen.loaded++;\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tLoadingScreen.prototype.draw = function (complete) {\r\n\t\t\t\tif (complete === void 0) { complete = false; }\r\n\t\t\t\tif (complete && this.fadeOut > LoadingScreen.FADE_SECONDS)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tthis.timeKeeper.update();\r\n\t\t\t\tvar a = Math.abs(Math.sin(this.timeKeeper.totalTime + 0.75));\r\n\t\t\t\tthis.angle -= this.timeKeeper.delta / 1.4 * 360 * (1 + 1.5 * Math.pow(a, 5));\r\n\t\t\t\tvar renderer = this.renderer;\r\n\t\t\t\tvar canvas = renderer.canvas;\r\n\t\t\t\tvar gl = renderer.context.gl;\r\n\t\t\t\trenderer.resize(webgl.ResizeMode.Stretch);\r\n\t\t\t\tvar oldX = renderer.camera.position.x, oldY = renderer.camera.position.y;\r\n\t\t\t\trenderer.camera.position.set(canvas.width / 2, canvas.height / 2, 0);\r\n\t\t\t\trenderer.camera.viewportWidth = canvas.width;\r\n\t\t\t\trenderer.camera.viewportHeight = canvas.height;\r\n\t\t\t\tif (!complete) {\r\n\t\t\t\t\tgl.clearColor(this.backgroundColor.r, this.backgroundColor.g, this.backgroundColor.b, this.backgroundColor.a);\r\n\t\t\t\t\tgl.clear(gl.COLOR_BUFFER_BIT);\r\n\t\t\t\t\tthis.tempColor.a = 1;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.fadeOut += this.timeKeeper.delta * (this.timeKeeper.totalTime < 1 ? 2 : 1);\r\n\t\t\t\t\tif (this.fadeOut > LoadingScreen.FADE_SECONDS) {\r\n\t\t\t\t\t\trenderer.camera.position.set(oldX, oldY, 0);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ta = 1 - this.fadeOut / LoadingScreen.FADE_SECONDS;\r\n\t\t\t\t\tthis.tempColor.setFromColor(this.backgroundColor);\r\n\t\t\t\t\tthis.tempColor.a = 1 - (a - 1) * (a - 1);\r\n\t\t\t\t\trenderer.begin();\r\n\t\t\t\t\trenderer.quad(true, 0, 0, canvas.width, 0, canvas.width, canvas.height, 0, canvas.height, this.tempColor, this.tempColor, this.tempColor, this.tempColor);\r\n\t\t\t\t\trenderer.end();\r\n\t\t\t\t}\r\n\t\t\t\tthis.tempColor.set(1, 1, 1, this.tempColor.a);\r\n\t\t\t\tif (LoadingScreen.loaded != 2)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tif (this.logo === null) {\r\n\t\t\t\t\tthis.logo = new webgl.GLTexture(renderer.context, LoadingScreen.logoImg);\r\n\t\t\t\t\tthis.spinner = new webgl.GLTexture(renderer.context, LoadingScreen.spinnerImg);\r\n\t\t\t\t}\r\n\t\t\t\tthis.logo.update(false);\r\n\t\t\t\tthis.spinner.update(false);\r\n\t\t\t\tvar logoWidth = this.logo.getImage().width;\r\n\t\t\t\tvar logoHeight = this.logo.getImage().height;\r\n\t\t\t\tvar spinnerWidth = this.spinner.getImage().width;\r\n\t\t\t\tvar spinnerHeight = this.spinner.getImage().height;\r\n\t\t\t\trenderer.batcher.setBlendMode(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\r\n\t\t\t\trenderer.begin();\r\n\t\t\t\trenderer.drawTexture(this.logo, (canvas.width - logoWidth) / 2, (canvas.height - logoHeight) / 2, logoWidth, logoHeight, this.tempColor);\r\n\t\t\t\trenderer.drawTextureRotated(this.spinner, (canvas.width - spinnerWidth) / 2, (canvas.height - spinnerHeight) / 2, spinnerWidth, spinnerHeight, spinnerWidth / 2, spinnerHeight / 2, this.angle, this.tempColor);\r\n\t\t\t\trenderer.end();\r\n\t\t\t\trenderer.camera.position.set(oldX, oldY, 0);\r\n\t\t\t};\r\n\t\t\tLoadingScreen.FADE_SECONDS = 1;\r\n\t\t\tLoadingScreen.loaded = 0;\r\n\t\t\tLoadingScreen.spinnerImg = null;\r\n\t\t\tLoadingScreen.logoImg = null;\r\n\t\t\tLoadingScreen.SPINNER_DATA = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAAACXBIWXMAAAsTAAALEwEAmpwYAAALB2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tb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Z1BlMr6uq6Vjhf2owGvozDKmG9dyiQCeTSAiwXVdNIP1A2uls7QkYhW/fgzVgIeXVOe6ISFOnSOjjn+uuHsK5F2NM1hLG/jSGfpjoSdjLSJg7Cp7FjaR7ZzXEGcinBJDF8DnZ1Ho7wPrYNadHdINGCLdVMdrU6nMdimqHYgiaF2kn4IXJ8FMJY6iPRxsPqTksbc55ZJP2vHgOnuYwD2tU4k/eycaT891g0F5YDZ7qfQ3SidTAZgG4By4FwHgBtYBpYbZ/l/2EJnC9N0gaQAAAAASUVORK5CYII=\";\r\n\t\t\treturn LoadingScreen;\r\n\t\t}());\r\n\t\twebgl.LoadingScreen = LoadingScreen;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\twebgl.M00 = 0;\r\n\t\twebgl.M01 = 4;\r\n\t\twebgl.M02 = 8;\r\n\t\twebgl.M03 = 12;\r\n\t\twebgl.M10 = 1;\r\n\t\twebgl.M11 = 5;\r\n\t\twebgl.M12 = 9;\r\n\t\twebgl.M13 = 13;\r\n\t\twebgl.M20 = 2;\r\n\t\twebgl.M21 = 6;\r\n\t\twebgl.M22 = 10;\r\n\t\twebgl.M23 = 14;\r\n\t\twebgl.M30 = 3;\r\n\t\twebgl.M31 = 7;\r\n\t\twebgl.M32 = 11;\r\n\t\twebgl.M33 = 15;\r\n\t\tvar Matrix4 = (function () {\r\n\t\t\tfunction Matrix4() {\r\n\t\t\t\tthis.temp = new Float32Array(16);\r\n\t\t\t\tthis.values = new Float32Array(16);\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tv[webgl.M00] = 1;\r\n\t\t\t\tv[webgl.M11] = 1;\r\n\t\t\t\tv[webgl.M22] = 1;\r\n\t\t\t\tv[webgl.M33] = 1;\r\n\t\t\t}\r\n\t\t\tMatrix4.prototype.set = function (values) {\r\n\t\t\t\tthis.values.set(values);\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.transpose = function () {\r\n\t\t\t\tvar t = this.temp;\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tt[webgl.M00] = v[webgl.M00];\r\n\t\t\t\tt[webgl.M01] = v[webgl.M10];\r\n\t\t\t\tt[webgl.M02] = v[webgl.M20];\r\n\t\t\t\tt[webgl.M03] = v[webgl.M30];\r\n\t\t\t\tt[webgl.M10] = v[webgl.M01];\r\n\t\t\t\tt[webgl.M11] = v[webgl.M11];\r\n\t\t\t\tt[webgl.M12] = v[webgl.M21];\r\n\t\t\t\tt[webgl.M13] = v[webgl.M31];\r\n\t\t\t\tt[webgl.M20] = v[webgl.M02];\r\n\t\t\t\tt[webgl.M21] = v[webgl.M12];\r\n\t\t\t\tt[webgl.M22] = v[webgl.M22];\r\n\t\t\t\tt[webgl.M23] = v[webgl.M32];\r\n\t\t\t\tt[webgl.M30] = v[webgl.M03];\r\n\t\t\t\tt[webgl.M31] = v[webgl.M13];\r\n\t\t\t\tt[webgl.M32] = v[webgl.M23];\r\n\t\t\t\tt[webgl.M33] = v[webgl.M33];\r\n\t\t\t\treturn this.set(t);\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.identity = function () {\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tv[webgl.M00] = 1;\r\n\t\t\t\tv[webgl.M01] = 0;\r\n\t\t\t\tv[webgl.M02] = 0;\r\n\t\t\t\tv[webgl.M03] = 0;\r\n\t\t\t\tv[webgl.M10] = 0;\r\n\t\t\t\tv[webgl.M11] = 1;\r\n\t\t\t\tv[webgl.M12] = 0;\r\n\t\t\t\tv[webgl.M13] = 0;\r\n\t\t\t\tv[webgl.M20] = 0;\r\n\t\t\t\tv[webgl.M21] = 0;\r\n\t\t\t\tv[webgl.M22] = 1;\r\n\t\t\t\tv[webgl.M23] = 0;\r\n\t\t\t\tv[webgl.M30] = 0;\r\n\t\t\t\tv[webgl.M31] = 0;\r\n\t\t\t\tv[webgl.M32] = 0;\r\n\t\t\t\tv[webgl.M33] = 1;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.invert = function () {\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tvar t = this.temp;\r\n\t\t\t\tvar l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03]\r\n\t\t\t\t\t+ v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03]\r\n\t\t\t\t\t- v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13]\r\n\t\t\t\t\t+ v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23]\r\n\t\t\t\t\t- v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t\tif (l_det == 0)\r\n\t\t\t\t\tthrow new Error(\"non-invertible matrix\");\r\n\t\t\t\tvar inv_det = 1.0 / l_det;\r\n\t\t\t\tt[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32]\r\n\t\t\t\t\t- v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32]\r\n\t\t\t\t\t+ v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32]\r\n\t\t\t\t\t- v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22]\r\n\t\t\t\t\t+ v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23];\r\n\t\t\t\tt[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32]\r\n\t\t\t\t\t+ v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23];\r\n\t\t\t\tt[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31]\r\n\t\t\t\t\t- v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23];\r\n\t\t\t\tt[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31]\r\n\t\t\t\t\t+ v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22];\r\n\t\t\t\tv[webgl.M00] = t[webgl.M00] * inv_det;\r\n\t\t\t\tv[webgl.M01] = t[webgl.M01] * inv_det;\r\n\t\t\t\tv[webgl.M02] = t[webgl.M02] * inv_det;\r\n\t\t\t\tv[webgl.M03] = t[webgl.M03] * inv_det;\r\n\t\t\t\tv[webgl.M10] = t[webgl.M10] * inv_det;\r\n\t\t\t\tv[webgl.M11] = t[webgl.M11] * inv_det;\r\n\t\t\t\tv[webgl.M12] = t[webgl.M12] * inv_det;\r\n\t\t\t\tv[webgl.M13] = t[webgl.M13] * inv_det;\r\n\t\t\t\tv[webgl.M20] = t[webgl.M20] * inv_det;\r\n\t\t\t\tv[webgl.M21] = t[webgl.M21] * inv_det;\r\n\t\t\t\tv[webgl.M22] = t[webgl.M22] * inv_det;\r\n\t\t\t\tv[webgl.M23] = t[webgl.M23] * inv_det;\r\n\t\t\t\tv[webgl.M30] = t[webgl.M30] * inv_det;\r\n\t\t\t\tv[webgl.M31] = t[webgl.M31] * inv_det;\r\n\t\t\t\tv[webgl.M32] = t[webgl.M32] * inv_det;\r\n\t\t\t\tv[webgl.M33] = t[webgl.M33] * inv_det;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.determinant = function () {\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\treturn v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03]\r\n\t\t\t\t\t+ v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03]\r\n\t\t\t\t\t- v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13]\r\n\t\t\t\t\t+ v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23]\r\n\t\t\t\t\t- v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.translate = function (x, y, z) {\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tv[webgl.M03] += x;\r\n\t\t\t\tv[webgl.M13] += y;\r\n\t\t\t\tv[webgl.M23] += z;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.copy = function () {\r\n\t\t\t\treturn new Matrix4().set(this.values);\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.projection = function (near, far, fovy, aspectRatio) {\r\n\t\t\t\tthis.identity();\r\n\t\t\t\tvar l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0));\r\n\t\t\t\tvar l_a1 = (far + near) / (near - far);\r\n\t\t\t\tvar l_a2 = (2 * far * near) / (near - far);\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tv[webgl.M00] = l_fd / aspectRatio;\r\n\t\t\t\tv[webgl.M10] = 0;\r\n\t\t\t\tv[webgl.M20] = 0;\r\n\t\t\t\tv[webgl.M30] = 0;\r\n\t\t\t\tv[webgl.M01] = 0;\r\n\t\t\t\tv[webgl.M11] = l_fd;\r\n\t\t\t\tv[webgl.M21] = 0;\r\n\t\t\t\tv[webgl.M31] = 0;\r\n\t\t\t\tv[webgl.M02] = 0;\r\n\t\t\t\tv[webgl.M12] = 0;\r\n\t\t\t\tv[webgl.M22] = l_a1;\r\n\t\t\t\tv[webgl.M32] = -1;\r\n\t\t\t\tv[webgl.M03] = 0;\r\n\t\t\t\tv[webgl.M13] = 0;\r\n\t\t\t\tv[webgl.M23] = l_a2;\r\n\t\t\t\tv[webgl.M33] = 0;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.ortho2d = function (x, y, width, height) {\r\n\t\t\t\treturn this.ortho(x, x + width, y, y + height, 0, 1);\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.ortho = function (left, right, bottom, top, near, far) {\r\n\t\t\t\tthis.identity();\r\n\t\t\t\tvar x_orth = 2 / (right - left);\r\n\t\t\t\tvar y_orth = 2 / (top - bottom);\r\n\t\t\t\tvar z_orth = -2 / (far - near);\r\n\t\t\t\tvar tx = -(right + left) / (right - left);\r\n\t\t\t\tvar ty = -(top + bottom) / (top - bottom);\r\n\t\t\t\tvar tz = -(far + near) / (far - near);\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tv[webgl.M00] = x_orth;\r\n\t\t\t\tv[webgl.M10] = 0;\r\n\t\t\t\tv[webgl.M20] = 0;\r\n\t\t\t\tv[webgl.M30] = 0;\r\n\t\t\t\tv[webgl.M01] = 0;\r\n\t\t\t\tv[webgl.M11] = y_orth;\r\n\t\t\t\tv[webgl.M21] = 0;\r\n\t\t\t\tv[webgl.M31] = 0;\r\n\t\t\t\tv[webgl.M02] = 0;\r\n\t\t\t\tv[webgl.M12] = 0;\r\n\t\t\t\tv[webgl.M22] = z_orth;\r\n\t\t\t\tv[webgl.M32] = 0;\r\n\t\t\t\tv[webgl.M03] = tx;\r\n\t\t\t\tv[webgl.M13] = ty;\r\n\t\t\t\tv[webgl.M23] = tz;\r\n\t\t\t\tv[webgl.M33] = 1;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.multiply = function (matrix) {\r\n\t\t\t\tvar t = this.temp;\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tvar m = matrix.values;\r\n\t\t\t\tt[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30];\r\n\t\t\t\tt[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31];\r\n\t\t\t\tt[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32];\r\n\t\t\t\tt[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33];\r\n\t\t\t\tt[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30];\r\n\t\t\t\tt[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31];\r\n\t\t\t\tt[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32];\r\n\t\t\t\tt[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33];\r\n\t\t\t\tt[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30];\r\n\t\t\t\tt[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31];\r\n\t\t\t\tt[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32];\r\n\t\t\t\tt[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33];\r\n\t\t\t\tt[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30];\r\n\t\t\t\tt[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31];\r\n\t\t\t\tt[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32];\r\n\t\t\t\tt[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33];\r\n\t\t\t\treturn this.set(this.temp);\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.multiplyLeft = function (matrix) {\r\n\t\t\t\tvar t = this.temp;\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tvar m = matrix.values;\r\n\t\t\t\tt[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30];\r\n\t\t\t\tt[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31];\r\n\t\t\t\tt[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30];\r\n\t\t\t\tt[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31];\r\n\t\t\t\tt[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30];\r\n\t\t\t\tt[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31];\r\n\t\t\t\tt[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30];\r\n\t\t\t\tt[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31];\r\n\t\t\t\tt[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33];\r\n\t\t\t\treturn this.set(this.temp);\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.lookAt = function (position, direction, up) {\r\n\t\t\t\tMatrix4.initTemps();\r\n\t\t\t\tvar xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis;\r\n\t\t\t\tzAxis.setFrom(direction).normalize();\r\n\t\t\t\txAxis.setFrom(direction).normalize();\r\n\t\t\t\txAxis.cross(up).normalize();\r\n\t\t\t\tyAxis.setFrom(xAxis).cross(zAxis).normalize();\r\n\t\t\t\tthis.identity();\r\n\t\t\t\tvar val = this.values;\r\n\t\t\t\tval[webgl.M00] = xAxis.x;\r\n\t\t\t\tval[webgl.M01] = xAxis.y;\r\n\t\t\t\tval[webgl.M02] = xAxis.z;\r\n\t\t\t\tval[webgl.M10] = yAxis.x;\r\n\t\t\t\tval[webgl.M11] = yAxis.y;\r\n\t\t\t\tval[webgl.M12] = yAxis.z;\r\n\t\t\t\tval[webgl.M20] = -zAxis.x;\r\n\t\t\t\tval[webgl.M21] = -zAxis.y;\r\n\t\t\t\tval[webgl.M22] = -zAxis.z;\r\n\t\t\t\tMatrix4.tmpMatrix.identity();\r\n\t\t\t\tMatrix4.tmpMatrix.values[webgl.M03] = -position.x;\r\n\t\t\t\tMatrix4.tmpMatrix.values[webgl.M13] = -position.y;\r\n\t\t\t\tMatrix4.tmpMatrix.values[webgl.M23] = -position.z;\r\n\t\t\t\tthis.multiply(Matrix4.tmpMatrix);\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.initTemps = function () {\r\n\t\t\t\tif (Matrix4.xAxis === null)\r\n\t\t\t\t\tMatrix4.xAxis = new webgl.Vector3();\r\n\t\t\t\tif (Matrix4.yAxis === null)\r\n\t\t\t\t\tMatrix4.yAxis = new webgl.Vector3();\r\n\t\t\t\tif (Matrix4.zAxis === null)\r\n\t\t\t\t\tMatrix4.zAxis = new webgl.Vector3();\r\n\t\t\t};\r\n\t\t\tMatrix4.xAxis = null;\r\n\t\t\tMatrix4.yAxis = null;\r\n\t\t\tMatrix4.zAxis = null;\r\n\t\t\tMatrix4.tmpMatrix = new Matrix4();\r\n\t\t\treturn Matrix4;\r\n\t\t}());\r\n\t\twebgl.Matrix4 = Matrix4;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar Mesh = (function () {\r\n\t\t\tfunction Mesh(context, attributes, maxVertices, maxIndices) {\r\n\t\t\t\tthis.attributes = attributes;\r\n\t\t\t\tthis.verticesLength = 0;\r\n\t\t\t\tthis.dirtyVertices = false;\r\n\t\t\t\tthis.indicesLength = 0;\r\n\t\t\t\tthis.dirtyIndices = false;\r\n\t\t\t\tthis.elementsPerVertex = 0;\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\tthis.elementsPerVertex = 0;\r\n\t\t\t\tfor (var i = 0; i < attributes.length; i++) {\r\n\t\t\t\t\tthis.elementsPerVertex += attributes[i].numElements;\r\n\t\t\t\t}\r\n\t\t\t\tthis.vertices = new Float32Array(maxVertices * this.elementsPerVertex);\r\n\t\t\t\tthis.indices = new Uint16Array(maxIndices);\r\n\t\t\t\tthis.context.addRestorable(this);\r\n\t\t\t}\r\n\t\t\tMesh.prototype.getAttributes = function () { return this.attributes; };\r\n\t\t\tMesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; };\r\n\t\t\tMesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; };\r\n\t\t\tMesh.prototype.setVerticesLength = function (length) {\r\n\t\t\t\tthis.dirtyVertices = true;\r\n\t\t\t\tthis.verticesLength = length;\r\n\t\t\t};\r\n\t\t\tMesh.prototype.getVertices = function () { return this.vertices; };\r\n\t\t\tMesh.prototype.maxIndices = function () { return this.indices.length; };\r\n\t\t\tMesh.prototype.numIndices = function () { return this.indicesLength; };\r\n\t\t\tMesh.prototype.setIndicesLength = function (length) {\r\n\t\t\t\tthis.dirtyIndices = true;\r\n\t\t\t\tthis.indicesLength = length;\r\n\t\t\t};\r\n\t\t\tMesh.prototype.getIndices = function () { return this.indices; };\r\n\t\t\t;\r\n\t\t\tMesh.prototype.getVertexSizeInFloats = function () {\r\n\t\t\t\tvar size = 0;\r\n\t\t\t\tfor (var i = 0; i < this.attributes.length; i++) {\r\n\t\t\t\t\tvar attribute = this.attributes[i];\r\n\t\t\t\t\tsize += attribute.numElements;\r\n\t\t\t\t}\r\n\t\t\t\treturn size;\r\n\t\t\t};\r\n\t\t\tMesh.prototype.setVertices = function (vertices) {\r\n\t\t\t\tthis.dirtyVertices = true;\r\n\t\t\t\tif (vertices.length > this.vertices.length)\r\n\t\t\t\t\tthrow Error(\"Mesh can't store more than \" + this.maxVertices() + \" vertices\");\r\n\t\t\t\tthis.vertices.set(vertices, 0);\r\n\t\t\t\tthis.verticesLength = vertices.length;\r\n\t\t\t};\r\n\t\t\tMesh.prototype.setIndices = function (indices) {\r\n\t\t\t\tthis.dirtyIndices = true;\r\n\t\t\t\tif (indices.length > this.indices.length)\r\n\t\t\t\t\tthrow Error(\"Mesh can't store more than \" + this.maxIndices() + \" indices\");\r\n\t\t\t\tthis.indices.set(indices, 0);\r\n\t\t\t\tthis.indicesLength = indices.length;\r\n\t\t\t};\r\n\t\t\tMesh.prototype.draw = function (shader, primitiveType) {\r\n\t\t\t\tthis.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex);\r\n\t\t\t};\r\n\t\t\tMesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (this.dirtyVertices || this.dirtyIndices)\r\n\t\t\t\t\tthis.update();\r\n\t\t\t\tthis.bind(shader);\r\n\t\t\t\tif (this.indicesLength > 0) {\r\n\t\t\t\t\tgl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tgl.drawArrays(primitiveType, offset, count);\r\n\t\t\t\t}\r\n\t\t\t\tthis.unbind(shader);\r\n\t\t\t};\r\n\t\t\tMesh.prototype.bind = function (shader) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\r\n\t\t\t\tvar offset = 0;\r\n\t\t\t\tfor (var i = 0; i < this.attributes.length; i++) {\r\n\t\t\t\t\tvar attrib = this.attributes[i];\r\n\t\t\t\t\tvar location_1 = shader.getAttributeLocation(attrib.name);\r\n\t\t\t\t\tgl.enableVertexAttribArray(location_1);\r\n\t\t\t\t\tgl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4);\r\n\t\t\t\t\toffset += attrib.numElements;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.indicesLength > 0)\r\n\t\t\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\r\n\t\t\t};\r\n\t\t\tMesh.prototype.unbind = function (shader) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tfor (var i = 0; i < this.attributes.length; i++) {\r\n\t\t\t\t\tvar attrib = this.attributes[i];\r\n\t\t\t\t\tvar location_2 = shader.getAttributeLocation(attrib.name);\r\n\t\t\t\t\tgl.disableVertexAttribArray(location_2);\r\n\t\t\t\t}\r\n\t\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, null);\r\n\t\t\t\tif (this.indicesLength > 0)\r\n\t\t\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\r\n\t\t\t};\r\n\t\t\tMesh.prototype.update = function () {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (this.dirtyVertices) {\r\n\t\t\t\t\tif (!this.verticesBuffer) {\r\n\t\t\t\t\t\tthis.verticesBuffer = gl.createBuffer();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\r\n\t\t\t\t\tgl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW);\r\n\t\t\t\t\tthis.dirtyVertices = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.dirtyIndices) {\r\n\t\t\t\t\tif (!this.indicesBuffer) {\r\n\t\t\t\t\t\tthis.indicesBuffer = gl.createBuffer();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\r\n\t\t\t\t\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW);\r\n\t\t\t\t\tthis.dirtyIndices = false;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tMesh.prototype.restore = function () {\r\n\t\t\t\tthis.verticesBuffer = null;\r\n\t\t\t\tthis.indicesBuffer = null;\r\n\t\t\t\tthis.update();\r\n\t\t\t};\r\n\t\t\tMesh.prototype.dispose = function () {\r\n\t\t\t\tthis.context.removeRestorable(this);\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tgl.deleteBuffer(this.verticesBuffer);\r\n\t\t\t\tgl.deleteBuffer(this.indicesBuffer);\r\n\t\t\t};\r\n\t\t\treturn Mesh;\r\n\t\t}());\r\n\t\twebgl.Mesh = Mesh;\r\n\t\tvar VertexAttribute = (function () {\r\n\t\t\tfunction VertexAttribute(name, type, numElements) {\r\n\t\t\t\tthis.name = name;\r\n\t\t\t\tthis.type = type;\r\n\t\t\t\tthis.numElements = numElements;\r\n\t\t\t}\r\n\t\t\treturn VertexAttribute;\r\n\t\t}());\r\n\t\twebgl.VertexAttribute = VertexAttribute;\r\n\t\tvar Position2Attribute = (function (_super) {\r\n\t\t\t__extends(Position2Attribute, _super);\r\n\t\t\tfunction Position2Attribute() {\r\n\t\t\t\treturn _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this;\r\n\t\t\t}\r\n\t\t\treturn Position2Attribute;\r\n\t\t}(VertexAttribute));\r\n\t\twebgl.Position2Attribute = Position2Attribute;\r\n\t\tvar Position3Attribute = (function (_super) {\r\n\t\t\t__extends(Position3Attribute, _super);\r\n\t\t\tfunction Position3Attribute() {\r\n\t\t\t\treturn _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this;\r\n\t\t\t}\r\n\t\t\treturn Position3Attribute;\r\n\t\t}(VertexAttribute));\r\n\t\twebgl.Position3Attribute = Position3Attribute;\r\n\t\tvar TexCoordAttribute = (function (_super) {\r\n\t\t\t__extends(TexCoordAttribute, _super);\r\n\t\t\tfunction TexCoordAttribute(unit) {\r\n\t\t\t\tif (unit === void 0) { unit = 0; }\r\n\t\t\t\treturn _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? \"\" : unit), VertexAttributeType.Float, 2) || this;\r\n\t\t\t}\r\n\t\t\treturn TexCoordAttribute;\r\n\t\t}(VertexAttribute));\r\n\t\twebgl.TexCoordAttribute = TexCoordAttribute;\r\n\t\tvar ColorAttribute = (function (_super) {\r\n\t\t\t__extends(ColorAttribute, _super);\r\n\t\t\tfunction ColorAttribute() {\r\n\t\t\t\treturn _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this;\r\n\t\t\t}\r\n\t\t\treturn ColorAttribute;\r\n\t\t}(VertexAttribute));\r\n\t\twebgl.ColorAttribute = ColorAttribute;\r\n\t\tvar Color2Attribute = (function (_super) {\r\n\t\t\t__extends(Color2Attribute, _super);\r\n\t\t\tfunction Color2Attribute() {\r\n\t\t\t\treturn _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this;\r\n\t\t\t}\r\n\t\t\treturn Color2Attribute;\r\n\t\t}(VertexAttribute));\r\n\t\twebgl.Color2Attribute = Color2Attribute;\r\n\t\tvar VertexAttributeType;\r\n\t\t(function (VertexAttributeType) {\r\n\t\t\tVertexAttributeType[VertexAttributeType[\"Float\"] = 0] = \"Float\";\r\n\t\t})(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {}));\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar PolygonBatcher = (function () {\r\n\t\t\tfunction PolygonBatcher(context, twoColorTint, maxVertices) {\r\n\t\t\t\tif (twoColorTint === void 0) { twoColorTint = true; }\r\n\t\t\t\tif (maxVertices === void 0) { maxVertices = 10920; }\r\n\t\t\t\tthis.isDrawing = false;\r\n\t\t\t\tthis.shader = null;\r\n\t\t\t\tthis.lastTexture = null;\r\n\t\t\t\tthis.verticesLength = 0;\r\n\t\t\t\tthis.indicesLength = 0;\r\n\t\t\t\tif (maxVertices > 10920)\r\n\t\t\t\t\tthrow new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\tvar attributes = twoColorTint ?\r\n\t\t\t\t\t[new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] :\r\n\t\t\t\t\t[new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()];\r\n\t\t\t\tthis.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3);\r\n\t\t\t\tthis.srcBlend = this.context.gl.SRC_ALPHA;\r\n\t\t\t\tthis.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA;\r\n\t\t\t}\r\n\t\t\tPolygonBatcher.prototype.begin = function (shader) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (this.isDrawing)\r\n\t\t\t\t\tthrow new Error(\"PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()\");\r\n\t\t\t\tthis.drawCalls = 0;\r\n\t\t\t\tthis.shader = shader;\r\n\t\t\t\tthis.lastTexture = null;\r\n\t\t\t\tthis.isDrawing = true;\r\n\t\t\t\tgl.enable(gl.BLEND);\r\n\t\t\t\tgl.blendFunc(this.srcBlend, this.dstBlend);\r\n\t\t\t};\r\n\t\t\tPolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.srcBlend = srcBlend;\r\n\t\t\t\tthis.dstBlend = dstBlend;\r\n\t\t\t\tif (this.isDrawing) {\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\t\tgl.blendFunc(this.srcBlend, this.dstBlend);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tPolygonBatcher.prototype.draw = function (texture, vertices, indices) {\r\n\t\t\t\tif (texture != this.lastTexture) {\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\t\tthis.lastTexture = texture;\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.verticesLength + vertices.length > this.mesh.getVertices().length ||\r\n\t\t\t\t\tthis.indicesLength + indices.length > this.mesh.getIndices().length) {\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\t}\r\n\t\t\t\tvar indexStart = this.mesh.numVertices();\r\n\t\t\t\tthis.mesh.getVertices().set(vertices, this.verticesLength);\r\n\t\t\t\tthis.verticesLength += vertices.length;\r\n\t\t\t\tthis.mesh.setVerticesLength(this.verticesLength);\r\n\t\t\t\tvar indicesArray = this.mesh.getIndices();\r\n\t\t\t\tfor (var i = this.indicesLength, j = 0; j < indices.length; i++, j++)\r\n\t\t\t\t\tindicesArray[i] = indices[j] + indexStart;\r\n\t\t\t\tthis.indicesLength += indices.length;\r\n\t\t\t\tthis.mesh.setIndicesLength(this.indicesLength);\r\n\t\t\t};\r\n\t\t\tPolygonBatcher.prototype.flush = function () {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (this.verticesLength == 0)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tthis.lastTexture.bind();\r\n\t\t\t\tthis.mesh.draw(this.shader, gl.TRIANGLES);\r\n\t\t\t\tthis.verticesLength = 0;\r\n\t\t\t\tthis.indicesLength = 0;\r\n\t\t\t\tthis.mesh.setVerticesLength(0);\r\n\t\t\t\tthis.mesh.setIndicesLength(0);\r\n\t\t\t\tthis.drawCalls++;\r\n\t\t\t};\r\n\t\t\tPolygonBatcher.prototype.end = function () {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (!this.isDrawing)\r\n\t\t\t\t\tthrow new Error(\"PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()\");\r\n\t\t\t\tif (this.verticesLength > 0 || this.indicesLength > 0)\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\tthis.shader = null;\r\n\t\t\t\tthis.lastTexture = null;\r\n\t\t\t\tthis.isDrawing = false;\r\n\t\t\t\tgl.disable(gl.BLEND);\r\n\t\t\t};\r\n\t\t\tPolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; };\r\n\t\t\tPolygonBatcher.prototype.dispose = function () {\r\n\t\t\t\tthis.mesh.dispose();\r\n\t\t\t};\r\n\t\t\treturn PolygonBatcher;\r\n\t\t}());\r\n\t\twebgl.PolygonBatcher = PolygonBatcher;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar SceneRenderer = (function () {\r\n\t\t\tfunction SceneRenderer(canvas, context, twoColorTint) {\r\n\t\t\t\tif (twoColorTint === void 0) { twoColorTint = true; }\r\n\t\t\t\tthis.twoColorTint = false;\r\n\t\t\t\tthis.activeRenderer = null;\r\n\t\t\t\tthis.QUAD = [\r\n\t\t\t\t\t0, 0, 1, 1, 1, 1, 0, 0,\r\n\t\t\t\t\t0, 0, 1, 1, 1, 1, 0, 0,\r\n\t\t\t\t\t0, 0, 1, 1, 1, 1, 0, 0,\r\n\t\t\t\t\t0, 0, 1, 1, 1, 1, 0, 0,\r\n\t\t\t\t];\r\n\t\t\t\tthis.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n\t\t\t\tthis.WHITE = new spine.Color(1, 1, 1, 1);\r\n\t\t\t\tthis.canvas = canvas;\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\tthis.twoColorTint = twoColorTint;\r\n\t\t\t\tthis.camera = new webgl.OrthoCamera(canvas.width, canvas.height);\r\n\t\t\t\tthis.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context);\r\n\t\t\t\tthis.batcher = new webgl.PolygonBatcher(this.context, twoColorTint);\r\n\t\t\t\tthis.shapesShader = webgl.Shader.newColored(this.context);\r\n\t\t\t\tthis.shapes = new webgl.ShapeRenderer(this.context);\r\n\t\t\t\tthis.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint);\r\n\t\t\t\tthis.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context);\r\n\t\t\t}\r\n\t\t\tSceneRenderer.prototype.begin = function () {\r\n\t\t\t\tthis.camera.update();\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) {\r\n\t\t\t\tif (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n\t\t\t\tif (slotRangeStart === void 0) { slotRangeStart = -1; }\r\n\t\t\t\tif (slotRangeEnd === void 0) { slotRangeEnd = -1; }\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t\tthis.skeletonRenderer.premultipliedAlpha = premultipliedAlpha;\r\n\t\t\t\tthis.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) {\r\n\t\t\t\tif (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n\t\t\t\tif (ignoredBones === void 0) { ignoredBones = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha;\r\n\t\t\t\tthis.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.WHITE;\r\n\t\t\t\tvar quad = this.QUAD;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tthis.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.WHITE;\r\n\t\t\t\tvar quad = this.QUAD;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = u;\r\n\t\t\t\tquad[i++] = v;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = u2;\r\n\t\t\t\tquad[i++] = v;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = u2;\r\n\t\t\t\tquad[i++] = v2;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = u;\r\n\t\t\t\tquad[i++] = v2;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tthis.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.WHITE;\r\n\t\t\t\tvar quad = this.QUAD;\r\n\t\t\t\tvar worldOriginX = x + pivotX;\r\n\t\t\t\tvar worldOriginY = y + pivotY;\r\n\t\t\t\tvar fx = -pivotX;\r\n\t\t\t\tvar fy = -pivotY;\r\n\t\t\t\tvar fx2 = width - pivotX;\r\n\t\t\t\tvar fy2 = height - pivotY;\r\n\t\t\t\tvar p1x = fx;\r\n\t\t\t\tvar p1y = fy;\r\n\t\t\t\tvar p2x = fx;\r\n\t\t\t\tvar p2y = fy2;\r\n\t\t\t\tvar p3x = fx2;\r\n\t\t\t\tvar p3y = fy2;\r\n\t\t\t\tvar p4x = fx2;\r\n\t\t\t\tvar p4y = fy;\r\n\t\t\t\tvar x1 = 0;\r\n\t\t\t\tvar y1 = 0;\r\n\t\t\t\tvar x2 = 0;\r\n\t\t\t\tvar y2 = 0;\r\n\t\t\t\tvar x3 = 0;\r\n\t\t\t\tvar y3 = 0;\r\n\t\t\t\tvar x4 = 0;\r\n\t\t\t\tvar y4 = 0;\r\n\t\t\t\tif (angle != 0) {\r\n\t\t\t\t\tvar cos = spine.MathUtils.cosDeg(angle);\r\n\t\t\t\t\tvar sin = spine.MathUtils.sinDeg(angle);\r\n\t\t\t\t\tx1 = cos * p1x - sin * p1y;\r\n\t\t\t\t\ty1 = sin * p1x + cos * p1y;\r\n\t\t\t\t\tx4 = cos * p2x - sin * p2y;\r\n\t\t\t\t\ty4 = sin * p2x + cos * p2y;\r\n\t\t\t\t\tx3 = cos * p3x - sin * p3y;\r\n\t\t\t\t\ty3 = sin * p3x + cos * p3y;\r\n\t\t\t\t\tx2 = x3 + (x1 - x4);\r\n\t\t\t\t\ty2 = y3 + (y1 - y4);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tx1 = p1x;\r\n\t\t\t\t\ty1 = p1y;\r\n\t\t\t\t\tx4 = p2x;\r\n\t\t\t\t\ty4 = p2y;\r\n\t\t\t\t\tx3 = p3x;\r\n\t\t\t\t\ty3 = p3y;\r\n\t\t\t\t\tx2 = p4x;\r\n\t\t\t\t\ty2 = p4y;\r\n\t\t\t\t}\r\n\t\t\t\tx1 += worldOriginX;\r\n\t\t\t\ty1 += worldOriginY;\r\n\t\t\t\tx2 += worldOriginX;\r\n\t\t\t\ty2 += worldOriginY;\r\n\t\t\t\tx3 += worldOriginX;\r\n\t\t\t\ty3 += worldOriginY;\r\n\t\t\t\tx4 += worldOriginX;\r\n\t\t\t\ty4 += worldOriginY;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\tquad[i++] = x1;\r\n\t\t\t\tquad[i++] = y1;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x2;\r\n\t\t\t\tquad[i++] = y2;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x3;\r\n\t\t\t\tquad[i++] = y3;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x4;\r\n\t\t\t\tquad[i++] = y4;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tthis.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.WHITE;\r\n\t\t\t\tvar quad = this.QUAD;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = region.u;\r\n\t\t\t\tquad[i++] = region.v2;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = region.u2;\r\n\t\t\t\tquad[i++] = region.v2;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = region.u2;\r\n\t\t\t\tquad[i++] = region.v;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = region.u;\r\n\t\t\t\tquad[i++] = region.v;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tthis.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (color2 === void 0) { color2 = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.line(x, y, x2, y2, color);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (color2 === void 0) { color2 = null; }\r\n\t\t\t\tif (color3 === void 0) { color3 = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (color2 === void 0) { color2 = null; }\r\n\t\t\t\tif (color3 === void 0) { color3 = null; }\r\n\t\t\t\tif (color4 === void 0) { color4 = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.rect = function (filled, x, y, width, height, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.rect(filled, x, y, width, height, color);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.rectLine(filled, x1, y1, x2, y2, width, color);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.polygon(polygonVertices, offset, count, color);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (segments === void 0) { segments = 0; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.circle(filled, x, y, radius, color, segments);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.end = function () {\r\n\t\t\t\tif (this.activeRenderer === this.batcher)\r\n\t\t\t\t\tthis.batcher.end();\r\n\t\t\t\telse if (this.activeRenderer === this.shapes)\r\n\t\t\t\t\tthis.shapes.end();\r\n\t\t\t\tthis.activeRenderer = null;\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.resize = function (resizeMode) {\r\n\t\t\t\tvar canvas = this.canvas;\r\n\t\t\t\tvar w = canvas.clientWidth;\r\n\t\t\t\tvar h = canvas.clientHeight;\r\n\t\t\t\tif (canvas.width != w || canvas.height != h) {\r\n\t\t\t\t\tcanvas.width = w;\r\n\t\t\t\t\tcanvas.height = h;\r\n\t\t\t\t}\r\n\t\t\t\tthis.context.gl.viewport(0, 0, canvas.width, canvas.height);\r\n\t\t\t\tif (resizeMode === ResizeMode.Stretch) {\r\n\t\t\t\t}\r\n\t\t\t\telse if (resizeMode === ResizeMode.Expand) {\r\n\t\t\t\t\tthis.camera.setViewport(w, h);\r\n\t\t\t\t}\r\n\t\t\t\telse if (resizeMode === ResizeMode.Fit) {\r\n\t\t\t\t\tvar sourceWidth = canvas.width, sourceHeight = canvas.height;\r\n\t\t\t\t\tvar targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight;\r\n\t\t\t\t\tvar targetRatio = targetHeight / targetWidth;\r\n\t\t\t\t\tvar sourceRatio = sourceHeight / sourceWidth;\r\n\t\t\t\t\tvar scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight;\r\n\t\t\t\t\tthis.camera.viewportWidth = sourceWidth * scale;\r\n\t\t\t\t\tthis.camera.viewportHeight = sourceHeight * scale;\r\n\t\t\t\t}\r\n\t\t\t\tthis.camera.update();\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.enableRenderer = function (renderer) {\r\n\t\t\t\tif (this.activeRenderer === renderer)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tthis.end();\r\n\t\t\t\tif (renderer instanceof webgl.PolygonBatcher) {\r\n\t\t\t\t\tthis.batcherShader.bind();\r\n\t\t\t\t\tthis.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values);\r\n\t\t\t\t\tthis.batcherShader.setUniformi(\"u_texture\", 0);\r\n\t\t\t\t\tthis.batcher.begin(this.batcherShader);\r\n\t\t\t\t\tthis.activeRenderer = this.batcher;\r\n\t\t\t\t}\r\n\t\t\t\telse if (renderer instanceof webgl.ShapeRenderer) {\r\n\t\t\t\t\tthis.shapesShader.bind();\r\n\t\t\t\t\tthis.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values);\r\n\t\t\t\t\tthis.shapes.begin(this.shapesShader);\r\n\t\t\t\t\tthis.activeRenderer = this.shapes;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.activeRenderer = this.skeletonDebugRenderer;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.dispose = function () {\r\n\t\t\t\tthis.batcher.dispose();\r\n\t\t\t\tthis.batcherShader.dispose();\r\n\t\t\t\tthis.shapes.dispose();\r\n\t\t\t\tthis.shapesShader.dispose();\r\n\t\t\t\tthis.skeletonDebugRenderer.dispose();\r\n\t\t\t};\r\n\t\t\treturn SceneRenderer;\r\n\t\t}());\r\n\t\twebgl.SceneRenderer = SceneRenderer;\r\n\t\tvar ResizeMode;\r\n\t\t(function (ResizeMode) {\r\n\t\t\tResizeMode[ResizeMode[\"Stretch\"] = 0] = \"Stretch\";\r\n\t\t\tResizeMode[ResizeMode[\"Expand\"] = 1] = \"Expand\";\r\n\t\t\tResizeMode[ResizeMode[\"Fit\"] = 2] = \"Fit\";\r\n\t\t})(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {}));\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar Shader = (function () {\r\n\t\t\tfunction Shader(context, vertexShader, fragmentShader) {\r\n\t\t\t\tthis.vertexShader = vertexShader;\r\n\t\t\t\tthis.fragmentShader = fragmentShader;\r\n\t\t\t\tthis.vs = null;\r\n\t\t\t\tthis.fs = null;\r\n\t\t\t\tthis.program = null;\r\n\t\t\t\tthis.tmp2x2 = new Float32Array(2 * 2);\r\n\t\t\t\tthis.tmp3x3 = new Float32Array(3 * 3);\r\n\t\t\t\tthis.tmp4x4 = new Float32Array(4 * 4);\r\n\t\t\t\tthis.vsSource = vertexShader;\r\n\t\t\t\tthis.fsSource = fragmentShader;\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\tthis.context.addRestorable(this);\r\n\t\t\t\tthis.compile();\r\n\t\t\t}\r\n\t\t\tShader.prototype.getProgram = function () { return this.program; };\r\n\t\t\tShader.prototype.getVertexShader = function () { return this.vertexShader; };\r\n\t\t\tShader.prototype.getFragmentShader = function () { return this.fragmentShader; };\r\n\t\t\tShader.prototype.getVertexShaderSource = function () { return this.vsSource; };\r\n\t\t\tShader.prototype.getFragmentSource = function () { return this.fsSource; };\r\n\t\t\tShader.prototype.compile = function () {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader);\r\n\t\t\t\t\tthis.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader);\r\n\t\t\t\t\tthis.program = this.compileProgram(this.vs, this.fs);\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\tthis.dispose();\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShader.prototype.compileShader = function (type, source) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tvar shader = gl.createShader(type);\r\n\t\t\t\tgl.shaderSource(shader, source);\r\n\t\t\t\tgl.compileShader(shader);\r\n\t\t\t\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n\t\t\t\t\tvar error = \"Couldn't compile shader: \" + gl.getShaderInfoLog(shader);\r\n\t\t\t\t\tgl.deleteShader(shader);\r\n\t\t\t\t\tif (!gl.isContextLost())\r\n\t\t\t\t\t\tthrow new Error(error);\r\n\t\t\t\t}\r\n\t\t\t\treturn shader;\r\n\t\t\t};\r\n\t\t\tShader.prototype.compileProgram = function (vs, fs) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tvar program = gl.createProgram();\r\n\t\t\t\tgl.attachShader(program, vs);\r\n\t\t\t\tgl.attachShader(program, fs);\r\n\t\t\t\tgl.linkProgram(program);\r\n\t\t\t\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\r\n\t\t\t\t\tvar error = \"Couldn't compile shader program: \" + gl.getProgramInfoLog(program);\r\n\t\t\t\t\tgl.deleteProgram(program);\r\n\t\t\t\t\tif (!gl.isContextLost())\r\n\t\t\t\t\t\tthrow new Error(error);\r\n\t\t\t\t}\r\n\t\t\t\treturn program;\r\n\t\t\t};\r\n\t\t\tShader.prototype.restore = function () {\r\n\t\t\t\tthis.compile();\r\n\t\t\t};\r\n\t\t\tShader.prototype.bind = function () {\r\n\t\t\t\tthis.context.gl.useProgram(this.program);\r\n\t\t\t};\r\n\t\t\tShader.prototype.unbind = function () {\r\n\t\t\t\tthis.context.gl.useProgram(null);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniformi = function (uniform, value) {\r\n\t\t\t\tthis.context.gl.uniform1i(this.getUniformLocation(uniform), value);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniformf = function (uniform, value) {\r\n\t\t\t\tthis.context.gl.uniform1f(this.getUniformLocation(uniform), value);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform2f = function (uniform, value, value2) {\r\n\t\t\t\tthis.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform3f = function (uniform, value, value2, value3) {\r\n\t\t\t\tthis.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) {\r\n\t\t\t\tthis.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform2x2f = function (uniform, value) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.tmp2x2.set(value);\r\n\t\t\t\tgl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform3x3f = function (uniform, value) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.tmp3x3.set(value);\r\n\t\t\t\tgl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform4x4f = function (uniform, value) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.tmp4x4.set(value);\r\n\t\t\t\tgl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4);\r\n\t\t\t};\r\n\t\t\tShader.prototype.getUniformLocation = function (uniform) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tvar location = gl.getUniformLocation(this.program, uniform);\r\n\t\t\t\tif (!location && !gl.isContextLost())\r\n\t\t\t\t\tthrow new Error(\"Couldn't find location for uniform \" + uniform);\r\n\t\t\t\treturn location;\r\n\t\t\t};\r\n\t\t\tShader.prototype.getAttributeLocation = function (attribute) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tvar location = gl.getAttribLocation(this.program, attribute);\r\n\t\t\t\tif (location == -1 && !gl.isContextLost())\r\n\t\t\t\t\tthrow new Error(\"Couldn't find location for attribute \" + attribute);\r\n\t\t\t\treturn location;\r\n\t\t\t};\r\n\t\t\tShader.prototype.dispose = function () {\r\n\t\t\t\tthis.context.removeRestorable(this);\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (this.vs) {\r\n\t\t\t\t\tgl.deleteShader(this.vs);\r\n\t\t\t\t\tthis.vs = null;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.fs) {\r\n\t\t\t\t\tgl.deleteShader(this.fs);\r\n\t\t\t\t\tthis.fs = null;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.program) {\r\n\t\t\t\t\tgl.deleteProgram(this.program);\r\n\t\t\t\t\tthis.program = null;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShader.newColoredTextured = function (context) {\r\n\t\t\t\tvar vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tattribute vec2 \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.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 = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tv_texCoords = \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n\t\t\t\tvar fs = \"\\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\";\r\n\t\t\t\treturn new Shader(context, vs, fs);\r\n\t\t\t};\r\n\t\t\tShader.newTwoColoredTextured = function (context) {\r\n\t\t\t\tvar vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR2 + \";\\n\\t\\t\\t\\tattribute vec2 \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.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 = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tv_dark = \" + Shader.COLOR2 + \";\\n\\t\\t\\t\\t\\tv_texCoords = \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n\t\t\t\tvar fs = \"\\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\";\r\n\t\t\t\treturn new Shader(context, vs, fs);\r\n\t\t\t};\r\n\t\t\tShader.newColored = function (context) {\r\n\t\t\t\tvar vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.MVP_MATRIX + \";\\n\\t\\t\\t\\tvarying vec4 v_color;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tv_color = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n\t\t\t\tvar fs = \"\\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\";\r\n\t\t\t\treturn new Shader(context, vs, fs);\r\n\t\t\t};\r\n\t\t\tShader.MVP_MATRIX = \"u_projTrans\";\r\n\t\t\tShader.POSITION = \"a_position\";\r\n\t\t\tShader.COLOR = \"a_color\";\r\n\t\t\tShader.COLOR2 = \"a_color2\";\r\n\t\t\tShader.TEXCOORDS = \"a_texCoords\";\r\n\t\t\tShader.SAMPLER = \"u_texture\";\r\n\t\t\treturn Shader;\r\n\t\t}());\r\n\t\twebgl.Shader = Shader;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar ShapeRenderer = (function () {\r\n\t\t\tfunction ShapeRenderer(context, maxVertices) {\r\n\t\t\t\tif (maxVertices === void 0) { maxVertices = 10920; }\r\n\t\t\t\tthis.isDrawing = false;\r\n\t\t\t\tthis.shapeType = ShapeType.Filled;\r\n\t\t\t\tthis.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\t\tthis.vertexIndex = 0;\r\n\t\t\t\tthis.tmp = new spine.Vector2();\r\n\t\t\t\tif (maxVertices > 10920)\r\n\t\t\t\t\tthrow new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\tthis.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0);\r\n\t\t\t\tthis.srcBlend = this.context.gl.SRC_ALPHA;\r\n\t\t\t\tthis.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA;\r\n\t\t\t}\r\n\t\t\tShapeRenderer.prototype.begin = function (shader) {\r\n\t\t\t\tif (this.isDrawing)\r\n\t\t\t\t\tthrow new Error(\"ShapeRenderer.begin() has already been called\");\r\n\t\t\t\tthis.shader = shader;\r\n\t\t\t\tthis.vertexIndex = 0;\r\n\t\t\t\tthis.isDrawing = true;\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tgl.enable(gl.BLEND);\r\n\t\t\t\tgl.blendFunc(this.srcBlend, this.dstBlend);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.srcBlend = srcBlend;\r\n\t\t\t\tthis.dstBlend = dstBlend;\r\n\t\t\t\tif (this.isDrawing) {\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\t\tgl.blendFunc(this.srcBlend, this.dstBlend);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.setColor = function (color) {\r\n\t\t\t\tthis.color.setFromColor(color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.setColorWith = function (r, g, b, a) {\r\n\t\t\t\tthis.color.set(r, g, b, a);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.point = function (x, y, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.check(ShapeType.Point, 1);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.line = function (x, y, x2, y2, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.check(ShapeType.Line, 2);\r\n\t\t\t\tvar vertices = this.mesh.getVertices();\r\n\t\t\t\tvar idx = this.vertexIndex;\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\tthis.vertex(x2, y2, color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (color2 === void 0) { color2 = null; }\r\n\t\t\t\tif (color3 === void 0) { color3 = null; }\r\n\t\t\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\r\n\t\t\t\tvar vertices = this.mesh.getVertices();\r\n\t\t\t\tvar idx = this.vertexIndex;\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tif (color2 === null)\r\n\t\t\t\t\tcolor2 = this.color;\r\n\t\t\t\tif (color3 === null)\r\n\t\t\t\t\tcolor3 = this.color;\r\n\t\t\t\tif (filled) {\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\tthis.vertex(x2, y2, color2);\r\n\t\t\t\t\tthis.vertex(x3, y3, color3);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\tthis.vertex(x2, y2, color2);\r\n\t\t\t\t\tthis.vertex(x2, y2, color);\r\n\t\t\t\t\tthis.vertex(x3, y3, color2);\r\n\t\t\t\t\tthis.vertex(x3, y3, color);\r\n\t\t\t\t\tthis.vertex(x, y, color2);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (color2 === void 0) { color2 = null; }\r\n\t\t\t\tif (color3 === void 0) { color3 = null; }\r\n\t\t\t\tif (color4 === void 0) { color4 = null; }\r\n\t\t\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\r\n\t\t\t\tvar vertices = this.mesh.getVertices();\r\n\t\t\t\tvar idx = this.vertexIndex;\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tif (color2 === null)\r\n\t\t\t\t\tcolor2 = this.color;\r\n\t\t\t\tif (color3 === null)\r\n\t\t\t\t\tcolor3 = this.color;\r\n\t\t\t\tif (color4 === null)\r\n\t\t\t\t\tcolor4 = this.color;\r\n\t\t\t\tif (filled) {\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\tthis.vertex(x2, y2, color2);\r\n\t\t\t\t\tthis.vertex(x3, y3, color3);\r\n\t\t\t\t\tthis.vertex(x3, y3, color3);\r\n\t\t\t\t\tthis.vertex(x4, y4, color4);\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\tthis.vertex(x2, y2, color2);\r\n\t\t\t\t\tthis.vertex(x2, y2, color2);\r\n\t\t\t\t\tthis.vertex(x3, y3, color3);\r\n\t\t\t\t\tthis.vertex(x3, y3, color3);\r\n\t\t\t\t\tthis.vertex(x4, y4, color4);\r\n\t\t\t\t\tthis.vertex(x4, y4, color4);\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 8);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tvar t = this.tmp.set(y2 - y1, x1 - x2);\r\n\t\t\t\tt.normalize();\r\n\t\t\t\twidth *= 0.5;\r\n\t\t\t\tvar tx = t.x * width;\r\n\t\t\t\tvar ty = t.y * width;\r\n\t\t\t\tif (!filled) {\r\n\t\t\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\r\n\t\t\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\r\n\t\t\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\r\n\t\t\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\r\n\t\t\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\r\n\t\t\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\r\n\t\t\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\r\n\t\t\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\r\n\t\t\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\r\n\t\t\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\r\n\t\t\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\r\n\t\t\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\r\n\t\t\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.x = function (x, y, size) {\r\n\t\t\t\tthis.line(x - size, y - size, x + size, y + size);\r\n\t\t\t\tthis.line(x - size, y + size, x + size, y - size);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (count < 3)\r\n\t\t\t\t\tthrow new Error(\"Polygon must contain at least 3 vertices\");\r\n\t\t\t\tthis.check(ShapeType.Line, count * 2);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tvar vertices = this.mesh.getVertices();\r\n\t\t\t\tvar idx = this.vertexIndex;\r\n\t\t\t\toffset <<= 1;\r\n\t\t\t\tcount <<= 1;\r\n\t\t\t\tvar firstX = polygonVertices[offset];\r\n\t\t\t\tvar firstY = polygonVertices[offset + 1];\r\n\t\t\t\tvar last = offset + count;\r\n\t\t\t\tfor (var i = offset, n = offset + count - 2; i < n; i += 2) {\r\n\t\t\t\t\tvar x1 = polygonVertices[i];\r\n\t\t\t\t\tvar y1 = polygonVertices[i + 1];\r\n\t\t\t\t\tvar x2 = 0;\r\n\t\t\t\t\tvar y2 = 0;\r\n\t\t\t\t\tif (i + 2 >= last) {\r\n\t\t\t\t\t\tx2 = firstX;\r\n\t\t\t\t\t\ty2 = firstY;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tx2 = polygonVertices[i + 2];\r\n\t\t\t\t\t\ty2 = polygonVertices[i + 3];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.vertex(x1, y1, color);\r\n\t\t\t\t\tthis.vertex(x2, y2, color);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (segments === void 0) { segments = 0; }\r\n\t\t\t\tif (segments === 0)\r\n\t\t\t\t\tsegments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0);\r\n\t\t\t\tif (segments <= 0)\r\n\t\t\t\t\tthrow new Error(\"segments must be > 0.\");\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tvar angle = 2 * spine.MathUtils.PI / segments;\r\n\t\t\t\tvar cos = Math.cos(angle);\r\n\t\t\t\tvar sin = Math.sin(angle);\r\n\t\t\t\tvar cx = radius, cy = 0;\r\n\t\t\t\tif (!filled) {\r\n\t\t\t\t\tthis.check(ShapeType.Line, segments * 2 + 2);\r\n\t\t\t\t\tfor (var i = 0; i < segments; i++) {\r\n\t\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t\t\tvar temp_1 = cx;\r\n\t\t\t\t\t\tcx = cos * cx - sin * cy;\r\n\t\t\t\t\t\tcy = sin * temp_1 + cos * cy;\r\n\t\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.check(ShapeType.Filled, segments * 3 + 3);\r\n\t\t\t\t\tsegments--;\r\n\t\t\t\t\tfor (var i = 0; i < segments; i++) {\r\n\t\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t\t\tvar temp_2 = cx;\r\n\t\t\t\t\t\tcx = cos * cx - sin * cy;\r\n\t\t\t\t\t\tcy = sin * temp_2 + cos * cy;\r\n\t\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t}\r\n\t\t\t\tvar temp = cx;\r\n\t\t\t\tcx = radius;\r\n\t\t\t\tcy = 0;\r\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.check(ShapeType.Line, segments * 2 + 2);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tvar subdiv_step = 1 / segments;\r\n\t\t\t\tvar subdiv_step2 = subdiv_step * subdiv_step;\r\n\t\t\t\tvar subdiv_step3 = subdiv_step * subdiv_step * subdiv_step;\r\n\t\t\t\tvar pre1 = 3 * subdiv_step;\r\n\t\t\t\tvar pre2 = 3 * subdiv_step2;\r\n\t\t\t\tvar pre4 = 6 * subdiv_step2;\r\n\t\t\t\tvar pre5 = 6 * subdiv_step3;\r\n\t\t\t\tvar tmp1x = x1 - cx1 * 2 + cx2;\r\n\t\t\t\tvar tmp1y = y1 - cy1 * 2 + cy2;\r\n\t\t\t\tvar tmp2x = (cx1 - cx2) * 3 - x1 + x2;\r\n\t\t\t\tvar tmp2y = (cy1 - cy2) * 3 - y1 + y2;\r\n\t\t\t\tvar fx = x1;\r\n\t\t\t\tvar fy = y1;\r\n\t\t\t\tvar dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;\r\n\t\t\t\tvar dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;\r\n\t\t\t\tvar ddfx = tmp1x * pre4 + tmp2x * pre5;\r\n\t\t\t\tvar ddfy = tmp1y * pre4 + tmp2y * pre5;\r\n\t\t\t\tvar dddfx = tmp2x * pre5;\r\n\t\t\t\tvar dddfy = tmp2y * pre5;\r\n\t\t\t\twhile (segments-- > 0) {\r\n\t\t\t\t\tthis.vertex(fx, fy, color);\r\n\t\t\t\t\tfx += dfx;\r\n\t\t\t\t\tfy += dfy;\r\n\t\t\t\t\tdfx += ddfx;\r\n\t\t\t\t\tdfy += ddfy;\r\n\t\t\t\t\tddfx += dddfx;\r\n\t\t\t\t\tddfy += dddfy;\r\n\t\t\t\t\tthis.vertex(fx, fy, color);\r\n\t\t\t\t}\r\n\t\t\t\tthis.vertex(fx, fy, color);\r\n\t\t\t\tthis.vertex(x2, y2, color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.vertex = function (x, y, color) {\r\n\t\t\t\tvar idx = this.vertexIndex;\r\n\t\t\t\tvar vertices = this.mesh.getVertices();\r\n\t\t\t\tvertices[idx++] = x;\r\n\t\t\t\tvertices[idx++] = y;\r\n\t\t\t\tvertices[idx++] = color.r;\r\n\t\t\t\tvertices[idx++] = color.g;\r\n\t\t\t\tvertices[idx++] = color.b;\r\n\t\t\t\tvertices[idx++] = color.a;\r\n\t\t\t\tthis.vertexIndex = idx;\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.end = function () {\r\n\t\t\t\tif (!this.isDrawing)\r\n\t\t\t\t\tthrow new Error(\"ShapeRenderer.begin() has not been called\");\r\n\t\t\t\tthis.flush();\r\n\t\t\t\tthis.context.gl.disable(this.context.gl.BLEND);\r\n\t\t\t\tthis.isDrawing = false;\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.flush = function () {\r\n\t\t\t\tif (this.vertexIndex == 0)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tthis.mesh.setVerticesLength(this.vertexIndex);\r\n\t\t\t\tthis.mesh.draw(this.shader, this.shapeType);\r\n\t\t\t\tthis.vertexIndex = 0;\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.check = function (shapeType, numVertices) {\r\n\t\t\t\tif (!this.isDrawing)\r\n\t\t\t\t\tthrow new Error(\"ShapeRenderer.begin() has not been called\");\r\n\t\t\t\tif (this.shapeType == shapeType) {\r\n\t\t\t\t\tif (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices)\r\n\t\t\t\t\t\tthis.flush();\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\t\tthis.shapeType = shapeType;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.dispose = function () {\r\n\t\t\t\tthis.mesh.dispose();\r\n\t\t\t};\r\n\t\t\treturn ShapeRenderer;\r\n\t\t}());\r\n\t\twebgl.ShapeRenderer = ShapeRenderer;\r\n\t\tvar ShapeType;\r\n\t\t(function (ShapeType) {\r\n\t\t\tShapeType[ShapeType[\"Point\"] = 0] = \"Point\";\r\n\t\t\tShapeType[ShapeType[\"Line\"] = 1] = \"Line\";\r\n\t\t\tShapeType[ShapeType[\"Filled\"] = 4] = \"Filled\";\r\n\t\t})(ShapeType = webgl.ShapeType || (webgl.ShapeType = {}));\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar SkeletonDebugRenderer = (function () {\r\n\t\t\tfunction SkeletonDebugRenderer(context) {\r\n\t\t\t\tthis.boneLineColor = new spine.Color(1, 0, 0, 1);\r\n\t\t\t\tthis.boneOriginColor = new spine.Color(0, 1, 0, 1);\r\n\t\t\t\tthis.attachmentLineColor = new spine.Color(0, 0, 1, 0.5);\r\n\t\t\t\tthis.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5);\r\n\t\t\t\tthis.pathColor = new spine.Color().setFromString(\"FF7F00\");\r\n\t\t\t\tthis.clipColor = new spine.Color(0.8, 0, 0, 2);\r\n\t\t\t\tthis.aabbColor = new spine.Color(0, 1, 0, 0.5);\r\n\t\t\t\tthis.drawBones = true;\r\n\t\t\t\tthis.drawRegionAttachments = true;\r\n\t\t\t\tthis.drawBoundingBoxes = true;\r\n\t\t\t\tthis.drawMeshHull = true;\r\n\t\t\t\tthis.drawMeshTriangles = true;\r\n\t\t\t\tthis.drawPaths = true;\r\n\t\t\t\tthis.drawSkeletonXY = false;\r\n\t\t\t\tthis.drawClipping = true;\r\n\t\t\t\tthis.premultipliedAlpha = false;\r\n\t\t\t\tthis.scale = 1;\r\n\t\t\t\tthis.boneWidth = 2;\r\n\t\t\t\tthis.bounds = new spine.SkeletonBounds();\r\n\t\t\t\tthis.temp = new Array();\r\n\t\t\t\tthis.vertices = spine.Utils.newFloatArray(2 * 1024);\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t}\r\n\t\t\tSkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) {\r\n\t\t\t\tif (ignoredBones === void 0) { ignoredBones = null; }\r\n\t\t\t\tvar skeletonX = skeleton.x;\r\n\t\t\t\tvar skeletonY = skeleton.y;\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tvar srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA;\r\n\t\t\t\tshapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA);\r\n\t\t\t\tvar bones = skeleton.bones;\r\n\t\t\t\tif (this.drawBones) {\r\n\t\t\t\t\tshapes.setColor(this.boneLineColor);\r\n\t\t\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\t\t\tvar bone = bones[i];\r\n\t\t\t\t\t\tif (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tif (bone.parent == null)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tvar x = skeletonX + bone.data.length * bone.a + bone.worldX;\r\n\t\t\t\t\t\tvar y = skeletonY + bone.data.length * bone.c + bone.worldY;\r\n\t\t\t\t\t\tshapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.drawSkeletonXY)\r\n\t\t\t\t\t\tshapes.x(skeletonX, skeletonY, 4 * this.scale);\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawRegionAttachments) {\r\n\t\t\t\t\tshapes.setColor(this.attachmentLineColor);\r\n\t\t\t\t\tvar slots = skeleton.slots;\r\n\t\t\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\t\t\tvar slot = slots[i];\r\n\t\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\t\tif (attachment instanceof spine.RegionAttachment) {\r\n\t\t\t\t\t\t\tvar regionAttachment = attachment;\r\n\t\t\t\t\t\t\tvar vertices = this.vertices;\r\n\t\t\t\t\t\t\tregionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n\t\t\t\t\t\t\tshapes.line(vertices[0], vertices[1], vertices[2], vertices[3]);\r\n\t\t\t\t\t\t\tshapes.line(vertices[2], vertices[3], vertices[4], vertices[5]);\r\n\t\t\t\t\t\t\tshapes.line(vertices[4], vertices[5], vertices[6], vertices[7]);\r\n\t\t\t\t\t\t\tshapes.line(vertices[6], vertices[7], vertices[0], vertices[1]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawMeshHull || this.drawMeshTriangles) {\r\n\t\t\t\t\tvar slots = skeleton.slots;\r\n\t\t\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\t\t\tvar slot = slots[i];\r\n\t\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\t\tif (!(attachment instanceof spine.MeshAttachment))\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tvar mesh = attachment;\r\n\t\t\t\t\t\tvar vertices = this.vertices;\r\n\t\t\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2);\r\n\t\t\t\t\t\tvar triangles = mesh.triangles;\r\n\t\t\t\t\t\tvar hullLength = mesh.hullLength;\r\n\t\t\t\t\t\tif (this.drawMeshTriangles) {\r\n\t\t\t\t\t\t\tshapes.setColor(this.triangleLineColor);\r\n\t\t\t\t\t\t\tfor (var ii = 0, nn = triangles.length; ii < nn; ii += 3) {\r\n\t\t\t\t\t\t\t\tvar v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2;\r\n\t\t\t\t\t\t\t\tshapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.drawMeshHull && hullLength > 0) {\r\n\t\t\t\t\t\t\tshapes.setColor(this.attachmentLineColor);\r\n\t\t\t\t\t\t\thullLength = (hullLength >> 1) * 2;\r\n\t\t\t\t\t\t\tvar lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1];\r\n\t\t\t\t\t\t\tfor (var ii = 0, nn = hullLength; ii < nn; ii += 2) {\r\n\t\t\t\t\t\t\t\tvar x = vertices[ii], y = vertices[ii + 1];\r\n\t\t\t\t\t\t\t\tshapes.line(x, y, lastX, lastY);\r\n\t\t\t\t\t\t\t\tlastX = x;\r\n\t\t\t\t\t\t\t\tlastY = y;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawBoundingBoxes) {\r\n\t\t\t\t\tvar bounds = this.bounds;\r\n\t\t\t\t\tbounds.update(skeleton, true);\r\n\t\t\t\t\tshapes.setColor(this.aabbColor);\r\n\t\t\t\t\tshapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight());\r\n\t\t\t\t\tvar polygons = bounds.polygons;\r\n\t\t\t\t\tvar boxes = bounds.boundingBoxes;\r\n\t\t\t\t\tfor (var i = 0, n = polygons.length; i < n; i++) {\r\n\t\t\t\t\t\tvar polygon = polygons[i];\r\n\t\t\t\t\t\tshapes.setColor(boxes[i].color);\r\n\t\t\t\t\t\tshapes.polygon(polygon, 0, polygon.length);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawPaths) {\r\n\t\t\t\t\tvar slots = skeleton.slots;\r\n\t\t\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\t\t\tvar slot = slots[i];\r\n\t\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\t\tif (!(attachment instanceof spine.PathAttachment))\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tvar path = attachment;\r\n\t\t\t\t\t\tvar nn = path.worldVerticesLength;\r\n\t\t\t\t\t\tvar world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0);\r\n\t\t\t\t\t\tpath.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n\t\t\t\t\t\tvar color = this.pathColor;\r\n\t\t\t\t\t\tvar x1 = world[2], y1 = world[3], x2 = 0, y2 = 0;\r\n\t\t\t\t\t\tif (path.closed) {\r\n\t\t\t\t\t\t\tshapes.setColor(color);\r\n\t\t\t\t\t\t\tvar cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1];\r\n\t\t\t\t\t\t\tx2 = world[nn - 4];\r\n\t\t\t\t\t\t\ty2 = world[nn - 3];\r\n\t\t\t\t\t\t\tshapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\r\n\t\t\t\t\t\t\tshapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\r\n\t\t\t\t\t\t\tshapes.line(x1, y1, cx1, cy1);\r\n\t\t\t\t\t\t\tshapes.line(x2, y2, cx2, cy2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tnn -= 4;\r\n\t\t\t\t\t\tfor (var ii = 4; ii < nn; ii += 6) {\r\n\t\t\t\t\t\t\tvar cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3];\r\n\t\t\t\t\t\t\tx2 = world[ii + 4];\r\n\t\t\t\t\t\t\ty2 = world[ii + 5];\r\n\t\t\t\t\t\t\tshapes.setColor(color);\r\n\t\t\t\t\t\t\tshapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\r\n\t\t\t\t\t\t\tshapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\r\n\t\t\t\t\t\t\tshapes.line(x1, y1, cx1, cy1);\r\n\t\t\t\t\t\t\tshapes.line(x2, y2, cx2, cy2);\r\n\t\t\t\t\t\t\tx1 = x2;\r\n\t\t\t\t\t\t\ty1 = y2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawBones) {\r\n\t\t\t\t\tshapes.setColor(this.boneOriginColor);\r\n\t\t\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\t\t\tvar bone = bones[i];\r\n\t\t\t\t\t\tif (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tshapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawClipping) {\r\n\t\t\t\t\tvar slots = skeleton.slots;\r\n\t\t\t\t\tshapes.setColor(this.clipColor);\r\n\t\t\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\t\t\tvar slot = slots[i];\r\n\t\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\t\tif (!(attachment instanceof spine.ClippingAttachment))\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tvar clip = attachment;\r\n\t\t\t\t\t\tvar nn = clip.worldVerticesLength;\r\n\t\t\t\t\t\tvar world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0);\r\n\t\t\t\t\t\tclip.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n\t\t\t\t\t\tfor (var i_20 = 0, n_2 = world.length; i_20 < n_2; i_20 += 2) {\r\n\t\t\t\t\t\t\tvar x = world[i_20];\r\n\t\t\t\t\t\t\tvar y = world[i_20 + 1];\r\n\t\t\t\t\t\t\tvar x2 = world[(i_20 + 2) % world.length];\r\n\t\t\t\t\t\t\tvar y2 = world[(i_20 + 3) % world.length];\r\n\t\t\t\t\t\t\tshapes.line(x, y, x2, y2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tSkeletonDebugRenderer.prototype.dispose = function () {\r\n\t\t\t};\r\n\t\t\tSkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1);\r\n\t\t\tSkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1);\r\n\t\t\treturn SkeletonDebugRenderer;\r\n\t\t}());\r\n\t\twebgl.SkeletonDebugRenderer = SkeletonDebugRenderer;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar Renderable = (function () {\r\n\t\t\tfunction Renderable(vertices, numVertices, numFloats) {\r\n\t\t\t\tthis.vertices = vertices;\r\n\t\t\t\tthis.numVertices = numVertices;\r\n\t\t\t\tthis.numFloats = numFloats;\r\n\t\t\t}\r\n\t\t\treturn Renderable;\r\n\t\t}());\r\n\t\t;\r\n\t\tvar SkeletonRenderer = (function () {\r\n\t\t\tfunction SkeletonRenderer(context, twoColorTint) {\r\n\t\t\t\tif (twoColorTint === void 0) { twoColorTint = true; }\r\n\t\t\t\tthis.premultipliedAlpha = false;\r\n\t\t\t\tthis.vertexEffect = null;\r\n\t\t\t\tthis.tempColor = new spine.Color();\r\n\t\t\t\tthis.tempColor2 = new spine.Color();\r\n\t\t\t\tthis.vertexSize = 2 + 2 + 4;\r\n\t\t\t\tthis.twoColorTint = false;\r\n\t\t\t\tthis.renderable = new Renderable(null, 0, 0);\r\n\t\t\t\tthis.clipper = new spine.SkeletonClipping();\r\n\t\t\t\tthis.temp = new spine.Vector2();\r\n\t\t\t\tthis.temp2 = new spine.Vector2();\r\n\t\t\t\tthis.temp3 = new spine.Color();\r\n\t\t\t\tthis.temp4 = new spine.Color();\r\n\t\t\t\tthis.twoColorTint = twoColorTint;\r\n\t\t\t\tif (twoColorTint)\r\n\t\t\t\t\tthis.vertexSize += 4;\r\n\t\t\t\tthis.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024);\r\n\t\t\t}\r\n\t\t\tSkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) {\r\n\t\t\t\tif (slotRangeStart === void 0) { slotRangeStart = -1; }\r\n\t\t\t\tif (slotRangeEnd === void 0) { slotRangeEnd = -1; }\r\n\t\t\t\tvar clipper = this.clipper;\r\n\t\t\t\tvar premultipliedAlpha = this.premultipliedAlpha;\r\n\t\t\t\tvar twoColorTint = this.twoColorTint;\r\n\t\t\t\tvar blendMode = null;\r\n\t\t\t\tvar tempPos = this.temp;\r\n\t\t\t\tvar tempUv = this.temp2;\r\n\t\t\t\tvar tempLight = this.temp3;\r\n\t\t\t\tvar tempDark = this.temp4;\r\n\t\t\t\tvar renderable = this.renderable;\r\n\t\t\t\tvar uvs = null;\r\n\t\t\t\tvar triangles = null;\r\n\t\t\t\tvar drawOrder = skeleton.drawOrder;\r\n\t\t\t\tvar attachmentColor = null;\r\n\t\t\t\tvar skeletonColor = skeleton.color;\r\n\t\t\t\tvar vertexSize = twoColorTint ? 12 : 8;\r\n\t\t\t\tvar inRange = false;\r\n\t\t\t\tif (slotRangeStart == -1)\r\n\t\t\t\t\tinRange = true;\r\n\t\t\t\tfor (var i = 0, n = drawOrder.length; i < n; i++) {\r\n\t\t\t\t\tvar clippedVertexSize = clipper.isClipping() ? 2 : vertexSize;\r\n\t\t\t\t\tvar slot = drawOrder[i];\r\n\t\t\t\t\tif (slotRangeStart >= 0 && slotRangeStart == slot.data.index) {\r\n\t\t\t\t\t\tinRange = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!inRange) {\r\n\t\t\t\t\t\tclipper.clipEndWithSlot(slot);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) {\r\n\t\t\t\t\t\tinRange = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\tvar texture = null;\r\n\t\t\t\t\tif (attachment instanceof spine.RegionAttachment) {\r\n\t\t\t\t\t\tvar region = attachment;\r\n\t\t\t\t\t\trenderable.vertices = this.vertices;\r\n\t\t\t\t\t\trenderable.numVertices = 4;\r\n\t\t\t\t\t\trenderable.numFloats = clippedVertexSize << 2;\r\n\t\t\t\t\t\tregion.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize);\r\n\t\t\t\t\t\ttriangles = SkeletonRenderer.QUAD_TRIANGLES;\r\n\t\t\t\t\t\tuvs = region.uvs;\r\n\t\t\t\t\t\ttexture = region.region.renderObject.texture;\r\n\t\t\t\t\t\tattachmentColor = region.color;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (attachment instanceof spine.MeshAttachment) {\r\n\t\t\t\t\t\tvar mesh = attachment;\r\n\t\t\t\t\t\trenderable.vertices = this.vertices;\r\n\t\t\t\t\t\trenderable.numVertices = (mesh.worldVerticesLength >> 1);\r\n\t\t\t\t\t\trenderable.numFloats = renderable.numVertices * clippedVertexSize;\r\n\t\t\t\t\t\tif (renderable.numFloats > renderable.vertices.length) {\r\n\t\t\t\t\t\t\trenderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize);\r\n\t\t\t\t\t\ttriangles = mesh.triangles;\r\n\t\t\t\t\t\ttexture = mesh.region.renderObject.texture;\r\n\t\t\t\t\t\tuvs = mesh.uvs;\r\n\t\t\t\t\t\tattachmentColor = mesh.color;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (attachment instanceof spine.ClippingAttachment) {\r\n\t\t\t\t\t\tvar clip = (attachment);\r\n\t\t\t\t\t\tclipper.clipStart(slot, clip);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tclipper.clipEndWithSlot(slot);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (texture != null) {\r\n\t\t\t\t\t\tvar slotColor = slot.color;\r\n\t\t\t\t\t\tvar finalColor = this.tempColor;\r\n\t\t\t\t\t\tfinalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r;\r\n\t\t\t\t\t\tfinalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g;\r\n\t\t\t\t\t\tfinalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b;\r\n\t\t\t\t\t\tfinalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a;\r\n\t\t\t\t\t\tif (premultipliedAlpha) {\r\n\t\t\t\t\t\t\tfinalColor.r *= finalColor.a;\r\n\t\t\t\t\t\t\tfinalColor.g *= finalColor.a;\r\n\t\t\t\t\t\t\tfinalColor.b *= finalColor.a;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar darkColor = this.tempColor2;\r\n\t\t\t\t\t\tif (slot.darkColor == null)\r\n\t\t\t\t\t\t\tdarkColor.set(0, 0, 0, 1.0);\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (premultipliedAlpha) {\r\n\t\t\t\t\t\t\t\tdarkColor.r = slot.darkColor.r * finalColor.a;\r\n\t\t\t\t\t\t\t\tdarkColor.g = slot.darkColor.g * finalColor.a;\r\n\t\t\t\t\t\t\t\tdarkColor.b = slot.darkColor.b * finalColor.a;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tdarkColor.setFromColor(slot.darkColor);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tdarkColor.a = premultipliedAlpha ? 1.0 : 0.0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar slotBlendMode = slot.data.blendMode;\r\n\t\t\t\t\t\tif (slotBlendMode != blendMode) {\r\n\t\t\t\t\t\t\tblendMode = slotBlendMode;\r\n\t\t\t\t\t\t\tbatcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (clipper.isClipping()) {\r\n\t\t\t\t\t\t\tclipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint);\r\n\t\t\t\t\t\t\tvar clippedVertices = new Float32Array(clipper.clippedVertices);\r\n\t\t\t\t\t\t\tvar clippedTriangles = clipper.clippedTriangles;\r\n\t\t\t\t\t\t\tif (this.vertexEffect != null) {\r\n\t\t\t\t\t\t\t\tvar vertexEffect = this.vertexEffect;\r\n\t\t\t\t\t\t\t\tvar verts = clippedVertices;\r\n\t\t\t\t\t\t\t\tif (!twoColorTint) {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 0, n_3 = clippedVertices.length; v < n_3; v += vertexSize) {\r\n\t\t\t\t\t\t\t\t\t\ttempPos.x = verts[v];\r\n\t\t\t\t\t\t\t\t\t\ttempPos.y = verts[v + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]);\r\n\t\t\t\t\t\t\t\t\t\ttempUv.x = verts[v + 6];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.y = verts[v + 7];\r\n\t\t\t\t\t\t\t\t\t\ttempDark.set(0, 0, 0, 0);\r\n\t\t\t\t\t\t\t\t\t\tvertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = tempPos.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = tempPos.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = tempLight.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = tempLight.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = tempLight.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = tempLight.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 6] = tempUv.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 7] = tempUv.y;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) {\r\n\t\t\t\t\t\t\t\t\t\ttempPos.x = verts[v];\r\n\t\t\t\t\t\t\t\t\t\ttempPos.y = verts[v + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]);\r\n\t\t\t\t\t\t\t\t\t\ttempUv.x = verts[v + 6];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.y = verts[v + 7];\r\n\t\t\t\t\t\t\t\t\t\ttempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]);\r\n\t\t\t\t\t\t\t\t\t\tvertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = tempPos.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = tempPos.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = tempLight.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = tempLight.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = tempLight.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = tempLight.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 6] = tempUv.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 7] = tempUv.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 8] = tempDark.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 9] = tempDark.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 10] = tempDark.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 11] = tempDark.a;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbatcher.draw(texture, clippedVertices, clippedTriangles);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tvar verts = renderable.vertices;\r\n\t\t\t\t\t\t\tif (this.vertexEffect != null) {\r\n\t\t\t\t\t\t\t\tvar vertexEffect = this.vertexEffect;\r\n\t\t\t\t\t\t\t\tif (!twoColorTint) {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 0, u = 0, n_5 = renderable.numFloats; v < n_5; v += vertexSize, u += 2) {\r\n\t\t\t\t\t\t\t\t\t\ttempPos.x = verts[v];\r\n\t\t\t\t\t\t\t\t\t\ttempPos.y = verts[v + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.x = uvs[u];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.y = uvs[u + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempLight.setFromColor(finalColor);\r\n\t\t\t\t\t\t\t\t\t\ttempDark.set(0, 0, 0, 0);\r\n\t\t\t\t\t\t\t\t\t\tvertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = tempPos.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = tempPos.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = tempLight.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = tempLight.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = tempLight.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = tempLight.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 6] = tempUv.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 7] = tempUv.y;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) {\r\n\t\t\t\t\t\t\t\t\t\ttempPos.x = verts[v];\r\n\t\t\t\t\t\t\t\t\t\ttempPos.y = verts[v + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.x = uvs[u];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.y = uvs[u + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempLight.setFromColor(finalColor);\r\n\t\t\t\t\t\t\t\t\t\ttempDark.setFromColor(darkColor);\r\n\t\t\t\t\t\t\t\t\t\tvertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = tempPos.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = tempPos.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = tempLight.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = tempLight.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = tempLight.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = tempLight.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 6] = tempUv.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 7] = tempUv.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 8] = tempDark.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 9] = tempDark.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 10] = tempDark.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 11] = tempDark.a;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tif (!twoColorTint) {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 2, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) {\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = finalColor.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = finalColor.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = finalColor.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = finalColor.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = uvs[u];\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = uvs[u + 1];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) {\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = finalColor.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = finalColor.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = finalColor.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = finalColor.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = uvs[u];\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = uvs[u + 1];\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 6] = darkColor.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 7] = darkColor.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 8] = darkColor.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 9] = darkColor.a;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvar view = renderable.vertices.subarray(0, renderable.numFloats);\r\n\t\t\t\t\t\t\tbatcher.draw(texture, view, triangles);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclipper.clipEndWithSlot(slot);\r\n\t\t\t\t}\r\n\t\t\t\tclipper.clipEnd();\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n\t\t\treturn SkeletonRenderer;\r\n\t\t}());\r\n\t\twebgl.SkeletonRenderer = SkeletonRenderer;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar Vector3 = (function () {\r\n\t\t\tfunction Vector3(x, y, z) {\r\n\t\t\t\tif (x === void 0) { x = 0; }\r\n\t\t\t\tif (y === void 0) { y = 0; }\r\n\t\t\t\tif (z === void 0) { z = 0; }\r\n\t\t\t\tthis.x = 0;\r\n\t\t\t\tthis.y = 0;\r\n\t\t\t\tthis.z = 0;\r\n\t\t\t\tthis.x = x;\r\n\t\t\t\tthis.y = y;\r\n\t\t\t\tthis.z = z;\r\n\t\t\t}\r\n\t\t\tVector3.prototype.setFrom = function (v) {\r\n\t\t\t\tthis.x = v.x;\r\n\t\t\t\tthis.y = v.y;\r\n\t\t\t\tthis.z = v.z;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.set = function (x, y, z) {\r\n\t\t\t\tthis.x = x;\r\n\t\t\t\tthis.y = y;\r\n\t\t\t\tthis.z = z;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.add = function (v) {\r\n\t\t\t\tthis.x += v.x;\r\n\t\t\t\tthis.y += v.y;\r\n\t\t\t\tthis.z += v.z;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.sub = function (v) {\r\n\t\t\t\tthis.x -= v.x;\r\n\t\t\t\tthis.y -= v.y;\r\n\t\t\t\tthis.z -= v.z;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.scale = function (s) {\r\n\t\t\t\tthis.x *= s;\r\n\t\t\t\tthis.y *= s;\r\n\t\t\t\tthis.z *= s;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.normalize = function () {\r\n\t\t\t\tvar len = this.length();\r\n\t\t\t\tif (len == 0)\r\n\t\t\t\t\treturn this;\r\n\t\t\t\tlen = 1 / len;\r\n\t\t\t\tthis.x *= len;\r\n\t\t\t\tthis.y *= len;\r\n\t\t\t\tthis.z *= len;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.cross = function (v) {\r\n\t\t\t\treturn this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x);\r\n\t\t\t};\r\n\t\t\tVector3.prototype.multiply = function (matrix) {\r\n\t\t\t\tvar l_mat = matrix.values;\r\n\t\t\t\treturn this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]);\r\n\t\t\t};\r\n\t\t\tVector3.prototype.project = function (matrix) {\r\n\t\t\t\tvar l_mat = matrix.values;\r\n\t\t\t\tvar l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]);\r\n\t\t\t\treturn this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w);\r\n\t\t\t};\r\n\t\t\tVector3.prototype.dot = function (v) {\r\n\t\t\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.length = function () {\r\n\t\t\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\r\n\t\t\t};\r\n\t\t\tVector3.prototype.distance = function (v) {\r\n\t\t\t\tvar a = v.x - this.x;\r\n\t\t\t\tvar b = v.y - this.y;\r\n\t\t\t\tvar c = v.z - this.z;\r\n\t\t\t\treturn Math.sqrt(a * a + b * b + c * c);\r\n\t\t\t};\r\n\t\t\treturn Vector3;\r\n\t\t}());\r\n\t\twebgl.Vector3 = Vector3;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar ManagedWebGLRenderingContext = (function () {\r\n\t\t\tfunction ManagedWebGLRenderingContext(canvasOrContext, contextConfig) {\r\n\t\t\t\tif (contextConfig === void 0) { contextConfig = { alpha: \"true\" }; }\r\n\t\t\t\tvar _this = this;\r\n\t\t\t\tthis.restorables = new Array();\r\n\t\t\t\tif (canvasOrContext instanceof HTMLCanvasElement) {\r\n\t\t\t\t\tvar canvas_1 = canvasOrContext;\r\n\t\t\t\t\tthis.gl = (canvas_1.getContext(\"webgl\", contextConfig) || canvas_1.getContext(\"experimental-webgl\", contextConfig));\r\n\t\t\t\t\tthis.canvas = canvas_1;\r\n\t\t\t\t\tcanvas_1.addEventListener(\"webglcontextlost\", function (e) {\r\n\t\t\t\t\t\tvar event = e;\r\n\t\t\t\t\t\tif (e) {\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tcanvas_1.addEventListener(\"webglcontextrestored\", function (e) {\r\n\t\t\t\t\t\tfor (var i = 0, n = _this.restorables.length; i < n; i++) {\r\n\t\t\t\t\t\t\t_this.restorables[i].restore();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.gl = canvasOrContext;\r\n\t\t\t\t\tthis.canvas = this.gl.canvas;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) {\r\n\t\t\t\tthis.restorables.push(restorable);\r\n\t\t\t};\r\n\t\t\tManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) {\r\n\t\t\t\tvar index = this.restorables.indexOf(restorable);\r\n\t\t\t\tif (index > -1)\r\n\t\t\t\t\tthis.restorables.splice(index, 1);\r\n\t\t\t};\r\n\t\t\treturn ManagedWebGLRenderingContext;\r\n\t\t}());\r\n\t\twebgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext;\r\n\t\tvar WebGLBlendModeConverter = (function () {\r\n\t\t\tfunction WebGLBlendModeConverter() {\r\n\t\t\t}\r\n\t\t\tWebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) {\r\n\t\t\t\tswitch (blendMode) {\r\n\t\t\t\t\tcase spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n\t\t\t\t\tcase spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE;\r\n\t\t\t\t\tcase spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n\t\t\t\t\tcase spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n\t\t\t\t\tdefault: throw new Error(\"Unknown blend mode: \" + blendMode);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tWebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) {\r\n\t\t\t\tif (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n\t\t\t\tswitch (blendMode) {\r\n\t\t\t\t\tcase spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA;\r\n\t\t\t\t\tcase spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA;\r\n\t\t\t\t\tcase spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR;\r\n\t\t\t\t\tcase spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE;\r\n\t\t\t\t\tdefault: throw new Error(\"Unknown blend mode: \" + blendMode);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tWebGLBlendModeConverter.ZERO = 0;\r\n\t\t\tWebGLBlendModeConverter.ONE = 1;\r\n\t\t\tWebGLBlendModeConverter.SRC_COLOR = 0x0300;\r\n\t\t\tWebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301;\r\n\t\t\tWebGLBlendModeConverter.SRC_ALPHA = 0x0302;\r\n\t\t\tWebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303;\r\n\t\t\tWebGLBlendModeConverter.DST_ALPHA = 0x0304;\r\n\t\t\tWebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305;\r\n\t\t\tWebGLBlendModeConverter.DST_COLOR = 0x0306;\r\n\t\t\treturn WebGLBlendModeConverter;\r\n\t\t}());\r\n\t\twebgl.WebGLBlendModeConverter = WebGLBlendModeConverter;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = spine;\n}.call(window));"],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/spine/dist/SpinePlugin.min.js b/plugins/spine/dist/SpinePlugin.min.js new file mode 100644 index 000000000..f4b854ac2 --- /dev/null +++ b/plugins/spine/dist/SpinePlugin.min.js @@ -0,0 +1 @@ +window.SpinePlugin=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=32)}([function(t,e){function n(t,e,n){var i=n?t[e]:Object.getOwnPropertyDescriptor(t,e);return!n&&i.value&&"object"==typeof i.value&&(i=i.value),!(!i||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(i))&&(void 0===i.enumerable&&(i.enumerable=!0),void 0===i.configurable&&(i.configurable=!0),i)}function i(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!!n&&(n.value&&"object"==typeof n.value&&(n=n.value),!1===n.configurable)}function r(t,e,r,s){for(var a in e)if(e.hasOwnProperty(a)){var h=n(e,a,r);if(!1!==h){if(i((s||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var n=0;nMath.PI&&(t-=i.PI2),Math.abs(((t+i.TAU)%i.PI2-i.PI2)%i.PI2)}},function(t,e,n){var i=n(1);t.exports=function(t){return t*i.RAD_TO_DEG}},function(t,e,n){var i=new(n(0))({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 i(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},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},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,n=t.y-this.y;return Math.sqrt(e*e+n*n)},distanceSq:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,n=t*t+e*e;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=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 n=this.x,i=this.y;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this},transformMat3:function(t){var e=this.x,n=this.y,i=t.val;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},transformMat4:function(t){var e=this.x,n=this.y,i=t.val;return this.x=i[0]*e+i[4]*n+i[12],this.y=i[1]*e+i[5]*n+i[13],this},reset:function(){return this.x=0,this.y=0,this}});i.ZERO=new i,i.RIGHT=new i(1,0),i.LEFT=new i(-1,0),i.UP=new i(0,-1),i.DOWN=new i(0,1),i.ONE=new i(1,1),t.exports=i},function(t,e){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}},function(t,e){t.exports=function(t,e,n){return Math.max(e,Math.min(n,t))}},function(t,e,n){var i=new(n(0))({initialize:function(t,e,n){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=n||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},clone:function(){return new i(this.x,this.y,this.z)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=i*a-r*o,this.y=r*s-n*a,this.z=n*o-i*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,n){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=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||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,n=t.y-this.y,i=t.z-this.z||0;return Math.sqrt(e*e+n*n+i*i)},distanceSq:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0;return e*e+n*n+i*i},length:function(){var t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)},lengthSq:function(){var t=this.x,e=this.y,n=this.z;return t*t+e*e+n*n},normalize:function(){var t=this.x,e=this.y,n=this.z,i=t*t+e*e+n*n;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i,this.z=n*i),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z;return this.x=n*o-i*s,this.y=i*r-e*o,this.z=e*s-n*r,this},lerp:function(t,e){void 0===e&&(e=0);var n=this.x,i=this.y,r=this.z;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this.z=r+e*(t.z-r),this},transformMat3:function(t){var e=this.x,n=this.y,i=this.z,r=t.val;return this.x=e*r[0]+n*r[3]+i*r[6],this.y=e*r[1]+n*r[4]+i*r[7],this.z=e*r[2]+n*r[5]+i*r[8],this},transformMat4:function(t){var e=this.x,n=this.y,i=this.z,r=t.val;return this.x=r[0]*e+r[4]*n+r[8]*i+r[12],this.y=r[1]*e+r[5]*n+r[9]*i+r[13],this.z=r[2]*e+r[6]*n+r[10]*i+r[14],this},transformCoordinates:function(t){var e=this.x,n=this.y,i=this.z,r=t.val,s=e*r[0]+n*r[4]+i*r[8]+r[12],o=e*r[1]+n*r[5]+i*r[9]+r[13],a=e*r[2]+n*r[6]+i*r[10]+r[14],h=e*r[3]+n*r[7]+i*r[11]+r[15];return this.x=s/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z,a=t.w,h=a*e+s*i-o*n,l=a*n+o*e-r*i,u=a*i+r*n-s*e,c=-r*e-s*n-o*i;return this.x=h*a+c*-r+l*-o-u*-s,this.y=l*a+c*-s+u*-r-h*-o,this.z=u*a+c*-o+h*-s-l*-r,this},project:function(t){var e=this.x,n=this.y,i=this.z,r=t.val,s=r[0],o=r[1],a=r[2],h=r[3],l=r[4],u=r[5],c=r[6],f=r[7],d=r[8],p=r[9],v=r[10],M=r[11],g=r[12],m=r[13],x=r[14],y=1/(e*h+n*f+i*M+r[15]);return this.x=(e*s+n*l+i*d+g)*y,this.y=(e*o+n*u+i*p+m)*y,this.z=(e*a+n*c+i*v+x)*y,this},unproject:function(t,e){var n=t.x,i=t.y,r=t.z,s=t.w,o=this.x-n,a=s-this.y-1-i,h=this.z;return this.x=2*o/r-1,this.y=2*a/s-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});i.ZERO=new i,i.RIGHT=new i(1,0,0),i.LEFT=new i(-1,0,0),i.UP=new i(0,-1,0),i.DOWN=new i(0,1,0),i.FORWARD=new i(0,0,1),i.BACK=new i(0,0,-1),i.ONE=new i(1,1,1),t.exports=i},function(t,e){t.exports=function(t,e,n){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var i=e.split("."),r=t,s=n,o=0;o=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},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(){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.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,n=this.type;this.loader.emit(s.FILE_COMPLETE,e,n,t),this.loader.emit(s.FILE_KEY_COMPLETE+n+"-"+e,e,n,t),this.loader.flagForRemoval(this)},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,n){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var i=new FileReader;i.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||n)+";base64,"+i.result.split(",")[1]},i.onerror=t.onerror,i.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},function(t,e){var n={},i={install:function(t){for(var e in n)t[e]=n[e]},register:function(t,e){n[t]=e},destroy:function(){n={}}};t.exports=i},function(t,e,n){var i=n(2),r=function(){var t,e,n,s,o,a,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=0?t:t+2*Math.PI}},function(t,e,n){var i=n(3);t.exports=function(t){return i(t,-Math.PI,Math.PI)}},function(t,e,n){var i=n(3);t.exports=function(t){return i(t,-180,180)}},function(t,e,n){var i=n(20);t.exports=function(t,e){return i(t)/i(e)/i(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,n,i,r){var s=.5*(i-e),o=.5*(r-n),a=t*t;return(2*n-2*i+s+o)*(t*a)+(-3*n+3*i-2*s-o)*a+s*t+n}},function(t,e){t.exports=function(t,e,n){return(e-t)*n+t}},function(t,e){t.exports=function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,n){return(t=Math.max(0,Math.min(1,(t-e)/(n-e))))*t*t*(t*(6*t-15)+10)}},function(t,e,n){var i=n(1);t.exports=function(t){return t*i.DEG_TO_RAD}},function(t,e,n){var i=new(n(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new i(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,n=t.val;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},fromMat4:function(t){var e=t.val,n=this.val;return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[4],n[4]=e[5],n[5]=e[6],n[6]=e[8],n[7]=e[9],n[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],n=t[2],i=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=n,t[7]=i,this},invert:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*s-o*h,c=-l*r+o*a,f=h*r-s*a,d=e*u+n*c+i*f;return d?(d=1/d,t[0]=u*d,t[1]=(-l*n+i*h)*d,t[2]=(o*n-i*s)*d,t[3]=c*d,t[4]=(l*e-i*a)*d,t[5]=(-o*e+i*r)*d,t[6]=f*d,t[7]=(-h*e+n*a)*d,t[8]=(s*e-n*r)*d,this):null},adjoint:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=s*l-o*h,t[1]=i*h-n*l,t[2]=n*o-i*s,t[3]=o*a-r*l,t[4]=e*l-i*a,t[5]=i*r-e*o,t[6]=r*h-s*a,t[7]=n*a-e*h,t[8]=e*s-n*r,this},determinant:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*s-o*h)+n*(-l*r+o*a)+i*(h*r-s*a)},multiply:function(t){var e=this.val,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,f=c[0],d=c[1],p=c[2],v=c[3],M=c[4],g=c[5],m=c[6],x=c[7],y=c[8];return e[0]=f*n+d*s+p*h,e[1]=f*i+d*o+p*l,e[2]=f*r+d*a+p*u,e[3]=v*n+M*s+g*h,e[4]=v*i+M*o+g*l,e[5]=v*r+M*a+g*u,e[6]=m*n+x*s+y*h,e[7]=m*i+x*o+y*l,e[8]=m*r+x*a+y*u,this},translate:function(t){var e=this.val,n=t.x,i=t.y;return e[6]=n*e[0]+i*e[3]+e[6],e[7]=n*e[1]+i*e[4]+e[7],e[8]=n*e[2]+i*e[5]+e[8],this},rotate:function(t){var e=this.val,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*n+h*s,e[1]=l*i+h*o,e[2]=l*r+h*a,e[3]=l*s-h*n,e[4]=l*o-h*i,e[5]=l*a-h*r,this},scale:function(t){var e=this.val,n=t.x,i=t.y;return e[0]=n*e[0],e[1]=n*e[1],e[2]=n*e[2],e[3]=i*e[3],e[4]=i*e[4],e[5]=i*e[5],this},fromQuat:function(t){var e=t.x,n=t.y,i=t.z,r=t.w,s=e+e,o=n+n,a=i+i,h=e*s,l=e*o,u=e*a,c=n*o,f=n*a,d=i*a,p=r*s,v=r*o,M=r*a,g=this.val;return g[0]=1-(c+d),g[3]=l+M,g[6]=u-v,g[1]=l-M,g[4]=1-(h+d),g[7]=f+p,g[2]=u+v,g[5]=f-p,g[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,n=this.val,i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],f=e[9],d=e[10],p=e[11],v=e[12],M=e[13],g=e[14],m=e[15],x=i*h-r*a,y=i*l-s*a,w=i*u-o*a,E=r*l-s*h,b=r*u-o*h,T=s*u-o*l,A=c*M-f*v,R=c*g-d*v,S=c*m-p*v,C=f*g-d*M,I=f*m-p*M,P=d*m-p*g,L=x*P-y*I+w*C+E*S-b*R+T*A;return L?(L=1/L,n[0]=(h*P-l*I+u*C)*L,n[1]=(l*S-a*P-u*R)*L,n[2]=(a*I-h*S+u*A)*L,n[3]=(s*I-r*P-o*C)*L,n[4]=(i*P-s*S+o*R)*L,n[5]=(r*S-i*I-o*A)*L,n[6]=(M*T-g*b+m*E)*L,n[7]=(g*w-v*T-m*y)*L,n[8]=(v*b-M*w+m*x)*L,this):null}});t.exports=i},function(t,e,n){var i=new(n(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new i(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,n=t.val;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,n){this.identity();var i=this.val;return i[12]=t,i[13]=e,i[14]=n,this},scaling:function(t,e,n){this.zero();var i=this.val;return i[0]=t,i[5]=e,i[10]=n,i[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],n=t[2],i=t[3],r=t[6],s=t[7],o=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]=n,t[9]=r,t[11]=t[14],t[12]=i,t[13]=s,t[14]=o,this},invert:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t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-(e*(u*M-f*p)-l*(n*M-r*p)+d*(n*f-r*u)),t[10]=e*(o*M-h*p)-s*(n*M-r*p)+d*(n*h-r*o),t[11]=-(e*(o*f-h*u)-s*(n*f-r*u)+l*(n*h-r*o)),t[12]=-(s*(u*v-c*p)-l*(o*v-a*p)+d*(o*c-a*u)),t[13]=e*(u*v-c*p)-l*(n*v-i*p)+d*(n*c-i*u),t[14]=-(e*(o*v-a*p)-s*(n*v-i*p)+d*(n*a-i*o)),t[15]=e*(o*c-a*u)-s*(n*c-i*u)+l*(n*a-i*o),this},determinant:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],M=t[15];return(e*o-n*s)*(c*M-f*v)-(e*a-i*s)*(u*M-f*p)+(e*h-r*s)*(u*v-c*p)+(n*a-i*o)*(l*M-f*d)-(n*h-r*o)*(l*v-c*d)+(i*h-r*a)*(l*p-u*d)},multiply:function(t){var e=this.val,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],f=e[10],d=e[11],p=e[12],v=e[13],M=e[14],g=e[15],m=t.val,x=m[0],y=m[1],w=m[2],E=m[3];return e[0]=x*n+y*o+w*u+E*p,e[1]=x*i+y*a+w*c+E*v,e[2]=x*r+y*h+w*f+E*M,e[3]=x*s+y*l+w*d+E*g,x=m[4],y=m[5],w=m[6],E=m[7],e[4]=x*n+y*o+w*u+E*p,e[5]=x*i+y*a+w*c+E*v,e[6]=x*r+y*h+w*f+E*M,e[7]=x*s+y*l+w*d+E*g,x=m[8],y=m[9],w=m[10],E=m[11],e[8]=x*n+y*o+w*u+E*p,e[9]=x*i+y*a+w*c+E*v,e[10]=x*r+y*h+w*f+E*M,e[11]=x*s+y*l+w*d+E*g,x=m[12],y=m[13],w=m[14],E=m[15],e[12]=x*n+y*o+w*u+E*p,e[13]=x*i+y*a+w*c+E*v,e[14]=x*r+y*h+w*f+E*M,e[15]=x*s+y*l+w*d+E*g,this},multiplyLocal:function(t){var e=[],n=this.val,i=t.val;return e[0]=n[0]*i[0]+n[1]*i[4]+n[2]*i[8]+n[3]*i[12],e[1]=n[0]*i[1]+n[1]*i[5]+n[2]*i[9]+n[3]*i[13],e[2]=n[0]*i[2]+n[1]*i[6]+n[2]*i[10]+n[3]*i[14],e[3]=n[0]*i[3]+n[1]*i[7]+n[2]*i[11]+n[3]*i[15],e[4]=n[4]*i[0]+n[5]*i[4]+n[6]*i[8]+n[7]*i[12],e[5]=n[4]*i[1]+n[5]*i[5]+n[6]*i[9]+n[7]*i[13],e[6]=n[4]*i[2]+n[5]*i[6]+n[6]*i[10]+n[7]*i[14],e[7]=n[4]*i[3]+n[5]*i[7]+n[6]*i[11]+n[7]*i[15],e[8]=n[8]*i[0]+n[9]*i[4]+n[10]*i[8]+n[11]*i[12],e[9]=n[8]*i[1]+n[9]*i[5]+n[10]*i[9]+n[11]*i[13],e[10]=n[8]*i[2]+n[9]*i[6]+n[10]*i[10]+n[11]*i[14],e[11]=n[8]*i[3]+n[9]*i[7]+n[10]*i[11]+n[11]*i[15],e[12]=n[12]*i[0]+n[13]*i[4]+n[14]*i[8]+n[15]*i[12],e[13]=n[12]*i[1]+n[13]*i[5]+n[14]*i[9]+n[15]*i[13],e[14]=n[12]*i[2]+n[13]*i[6]+n[14]*i[10]+n[15]*i[14],e[15]=n[12]*i[3]+n[13]*i[7]+n[14]*i[11]+n[15]*i[15],this.fromArray(e)},translate:function(t){var e=t.x,n=t.y,i=t.z,r=this.val;return r[12]=r[0]*e+r[4]*n+r[8]*i+r[12],r[13]=r[1]*e+r[5]*n+r[9]*i+r[13],r[14]=r[2]*e+r[6]*n+r[10]*i+r[14],r[15]=r[3]*e+r[7]*n+r[11]*i+r[15],this},translateXYZ:function(t,e,n){var i=this.val;return i[12]=i[0]*t+i[4]*e+i[8]*n+i[12],i[13]=i[1]*t+i[5]*e+i[9]*n+i[13],i[14]=i[2]*t+i[6]*e+i[10]*n+i[14],i[15]=i[3]*t+i[7]*e+i[11]*n+i[15],this},scale:function(t){var e=t.x,n=t.y,i=t.z,r=this.val;return r[0]=r[0]*e,r[1]=r[1]*e,r[2]=r[2]*e,r[3]=r[3]*e,r[4]=r[4]*n,r[5]=r[5]*n,r[6]=r[6]*n,r[7]=r[7]*n,r[8]=r[8]*i,r[9]=r[9]*i,r[10]=r[10]*i,r[11]=r[11]*i,this},scaleXYZ:function(t,e,n){var i=this.val;return i[0]=i[0]*t,i[1]=i[1]*t,i[2]=i[2]*t,i[3]=i[3]*t,i[4]=i[4]*e,i[5]=i[5]*e,i[6]=i[6]*e,i[7]=i[7]*e,i[8]=i[8]*n,i[9]=i[9]*n,i[10]=i[10]*n,i[11]=i[11]*n,this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,o=t.y,a=t.z,h=r*s,l=r*o;return this.fromArray([h*s+n,h*o-i*a,h*a+i*o,0,h*o+i*a,l*o+n,l*a-i*s,0,h*a-i*o,l*a+i*s,r*a*a+n,0,0,0,0,1]),this},rotate:function(t,e){var n=this.val,i=e.x,r=e.y,s=e.z,o=Math.sqrt(i*i+r*r+s*s);if(Math.abs(o)<1e-6)return null;i*=o=1/o,r*=o,s*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=n[0],c=n[1],f=n[2],d=n[3],p=n[4],v=n[5],M=n[6],g=n[7],m=n[8],x=n[9],y=n[10],w=n[11],E=i*i*l+h,b=r*i*l+s*a,T=s*i*l-r*a,A=i*r*l-s*a,R=r*r*l+h,S=s*r*l+i*a,C=i*s*l+r*a,I=r*s*l-i*a,P=s*s*l+h;return n[0]=u*E+p*b+m*T,n[1]=c*E+v*b+x*T,n[2]=f*E+M*b+y*T,n[3]=d*E+g*b+w*T,n[4]=u*A+p*R+m*S,n[5]=c*A+v*R+x*S,n[6]=f*A+M*R+y*S,n[7]=d*A+g*R+w*S,n[8]=u*C+p*I+m*P,n[9]=c*C+v*I+x*P,n[10]=f*C+M*I+y*P,n[11]=d*C+g*I+w*P,this},rotateX:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[4],s=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=r*i+h*n,e[5]=s*i+l*n,e[6]=o*i+u*n,e[7]=a*i+c*n,e[8]=h*i-r*n,e[9]=l*i-s*n,e[10]=u*i-o*n,e[11]=c*i-a*n,this},rotateY:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=r*i-h*n,e[1]=s*i-l*n,e[2]=o*i-u*n,e[3]=a*i-c*n,e[8]=r*n+h*i,e[9]=s*n+l*i,e[10]=o*n+u*i,e[11]=a*n+c*i,this},rotateZ:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=r*i+h*n,e[1]=s*i+l*n,e[2]=o*i+u*n,e[3]=a*i+c*n,e[4]=h*i-r*n,e[5]=l*i-s*n,e[6]=u*i-o*n,e[7]=c*i-a*n,this},fromRotationTranslation:function(t,e){var n=this.val,i=t.x,r=t.y,s=t.z,o=t.w,a=i+i,h=r+r,l=s+s,u=i*a,c=i*h,f=i*l,d=r*h,p=r*l,v=s*l,M=o*a,g=o*h,m=o*l;return n[0]=1-(d+v),n[1]=c+m,n[2]=f-g,n[3]=0,n[4]=c-m,n[5]=1-(u+v),n[6]=p+M,n[7]=0,n[8]=f+g,n[9]=p-M,n[10]=1-(u+d),n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this},fromQuat:function(t){var e=this.val,n=t.x,i=t.y,r=t.z,s=t.w,o=n+n,a=i+i,h=r+r,l=n*o,u=n*a,c=n*h,f=i*a,d=i*h,p=r*h,v=s*o,M=s*a,g=s*h;return e[0]=1-(f+p),e[1]=u+g,e[2]=c-M,e[3]=0,e[4]=u-g,e[5]=1-(l+p),e[6]=d+v,e[7]=0,e[8]=c+M,e[9]=d-v,e[10]=1-(l+f),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,n,i,r,s){var o=this.val,a=1/(e-t),h=1/(i-n),l=1/(r-s);return o[0]=2*r*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*r*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(i+n)*h,o[10]=(s+r)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=s*r*2*l,o[15]=0,this},perspective:function(t,e,n,i){var r=this.val,s=1/Math.tan(t/2),o=1/(n-i);return r[0]=s/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(i+n)*o,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*i*n*o,r[15]=0,this},perspectiveLH:function(t,e,n,i){var r=this.val;return r[0]=2*n/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2*n/e,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-i/(n-i),r[11]=1,r[12]=0,r[13]=0,r[14]=n*i/(n-i),r[15]=0,this},ortho:function(t,e,n,i,r,s){var o=this.val,a=t-e,h=n-i,l=r-s;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(i+n)*h,o[14]=(s+r)*l,o[15]=1,this},lookAt:function(t,e,n){var i=this.val,r=t.x,s=t.y,o=t.z,a=n.x,h=n.y,l=n.z,u=e.x,c=e.y,f=e.z;if(Math.abs(r-u)<1e-6&&Math.abs(s-c)<1e-6&&Math.abs(o-f)<1e-6)return this.identity();var d=r-u,p=s-c,v=o-f,M=1/Math.sqrt(d*d+p*p+v*v),g=h*(v*=M)-l*(p*=M),m=l*(d*=M)-a*v,x=a*p-h*d;(M=Math.sqrt(g*g+m*m+x*x))?(g*=M=1/M,m*=M,x*=M):(g=0,m=0,x=0);var y=p*x-v*m,w=v*g-d*x,E=d*m-p*g;return(M=Math.sqrt(y*y+w*w+E*E))?(y*=M=1/M,w*=M,E*=M):(y=0,w=0,E=0),i[0]=g,i[1]=y,i[2]=d,i[3]=0,i[4]=m,i[5]=w,i[6]=p,i[7]=0,i[8]=x,i[9]=E,i[10]=v,i[11]=0,i[12]=-(g*r+m*s+x*o),i[13]=-(y*r+w*s+E*o),i[14]=-(d*r+p*s+v*o),i[15]=1,this},yawPitchRoll:function(t,e,n){this.zero(),r.zero(),s.zero();var i=this.val,o=r.val,a=s.val,h=Math.sin(n),l=Math.cos(n);return i[10]=1,i[15]=1,i[0]=l,i[1]=h,i[4]=-h,i[5]=l,h=Math.sin(e),l=Math.cos(e),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(r),this.multiplyLocal(s),this},setWorldMatrix:function(t,e,n,i,o){return this.yawPitchRoll(t.y,t.x,t.z),r.scaling(n.x,n.y,n.z),s.xyz(e.x,e.y,e.z),this.multiplyLocal(r),this.multiplyLocal(s),void 0!==i&&this.multiplyLocal(i),void 0!==o&&this.multiplyLocal(o),this}}),r=new i,s=new i;t.exports=i},function(t,e,n){var i=n(0),r=n(10),s=n(26),o=new Int8Array([1,2,0]),a=new Float32Array([0,0,0]),h=new r(1,0,0),l=new r(0,1,0),u=new r,c=new s,f=new i({initialize:function(t,e,n,i){"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=n||0,this.w=i||0)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},set:function(t,e,n,i){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=n||0,this.w=i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,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,n=this.z,i=this.w;return Math.sqrt(t*t+e*e+n*n+i*i)},lengthSq:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return t*t+e*e+n*n+i*i},normalize:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=n*r,this.w=i*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 n=this.x,i=this.y,r=this.z,s=this.w;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},rotationTo:function(t,e){var n=t.x*e.x+t.y*e.y+t.z*e.z;return n<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):n>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+n,this.normalize())},setAxes:function(t,e,n){var i=c.val;return i[0]=e.x,i[3]=e.y,i[6]=e.z,i[1]=n.x,i[4]=n.y,i[7]=n.z,i[2]=-t.x,i[5]=-t.y,i[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var n=Math.sin(e);return this.x=n*t.x,this.y=n*t.y,this.z=n*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,s=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+r*s+n*a-i*o,this.y=n*h+r*o+i*s-e*a,this.z=i*h+r*a+e*o-n*s,this.w=r*h-e*s-n*o-i*a,this},slerp:function(t,e){var n=this.x,i=this.y,r=this.z,s=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=n*o+i*a+r*h+s*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,f=e;if(1-u>1e-6){var d=Math.acos(u),p=Math.sin(d);c=Math.sin((1-e)*d)/p,f=Math.sin(e*d)/p}return this.x=c*n+f*o,this.y=c*i+f*a,this.z=c*r+f*h,this.w=c*s+f*l,this},invert:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i,s=r?1/r:0;return this.x=-t*s,this.y=-e*s,this.z=-n*s,this.w=i*s,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.x=e*o+r*s,this.y=n*o+i*s,this.z=i*o-n*s,this.w=r*o-e*s,this},rotateY:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.x=e*o-i*s,this.y=n*o+r*s,this.z=i*o+e*s,this.w=r*o-n*s,this},rotateZ:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.x=e*o+n*s,this.y=n*o-e*s,this.z=i*o+r*s,this.w=r*o-i*s,this},calculateW:function(){var t=this.x,e=this.y,n=this.z;return this.w=-Math.sqrt(1-t*t-e*e-n*n),this},fromMat3:function(t){var e,n=t.val,i=n[0]+n[4]+n[8];if(i>0)e=Math.sqrt(i+1),this.w=.5*e,e=.5/e,this.x=(n[7]-n[5])*e,this.y=(n[2]-n[6])*e,this.z=(n[3]-n[1])*e;else{var r=0;n[4]>n[0]&&(r=1),n[8]>n[3*r+r]&&(r=2);var s=o[r],h=o[s];e=Math.sqrt(n[3*r+r]-n[3*s+s]-n[3*h+h]+1),a[r]=.5*e,e=.5/e,a[s]=(n[3*s+r]+n[3*r+s])*e,a[h]=(n[3*h+r]+n[3*r+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(n[3*h+s]-n[3*s+h])*e}return this}});t.exports=f},function(t,e,n){var i=n(14),r=n(30);t.exports=function(t,e){var n=void 0===t?r():i({},t);if(e)for(var s in e)void 0!==e[s]&&(n[s]=e[s]);return n}},function(t,e){t.exports=function(t,e,n,i,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===n&&(n=""),void 0===i&&(i=""),void 0===r&&(r=0),{responseType:t,async:e,user:n,password:i,timeout:r,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e){t.exports=function(){}},function(t,e,n){var i=n(33),r=n(0),s=n(11),o=n(144),a=n(145),h=n(167),l=n(168),u=n(186),c=new r({Extends:a,initialize:function(t,e){a.call(this,t,e);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),e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",this.add.bind(this),this.make.bind(this))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(o,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){this.sceneRenderer=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0);var t=function(t,e){if(t!==this.srcBlend||e!==this.dstBlend){var n=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),n.blendFunc(this.srcBlend,this.dstBlend))}};this.sceneRenderer.batcher.setBlendMode=t,this.sceneRenderer.shapes.setBlendMode=t,this.skeletonRenderer=this.sceneRenderer.skeletonRenderer,this.skeletonDebugRenderer=this.sceneRenderer.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 n,i=this.spineTextures;if(i.has(t))n=new h.TextureAtlas(e.data,function(){return i.get(t)});else{var r=this.textures;n=new h.TextureAtlas(e.data,function(e){var n=new h.canvas.CanvasTexture(r.get(e).getSourceImage());return i.add(t,n),n})}return n}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var n,i=this.spineTextures;if(i.has(t))n=new h.TextureAtlas(e.data,function(){return i.get(t)});else{var r=this.textures,s=this.sceneRenderer.context.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n=new h.TextureAtlas(e.data,function(e){var n=new h.webgl.GLTexture(s,r.get(e).getSourceImage(),!1);return i.add(t,n),n})}return n}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,n,i,r,s){var o;if(Array.isArray(t))for(var a=0;a=i.PI2-n?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=n:e=1?1:1/e*(1+(e*t|0))}},function(t,e,n){t.exports={Ceil:n(94),Equal:n(95),Floor:n(96),GreaterThan:n(97),LessThan:n(98)}},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,n){return void 0===n&&(n=1e-4),Math.abs(t-e)e-n}},function(t,e){t.exports=function(t,e,n){return void 0===n&&(n=1e-4),t1?t[n]-(i(r-n,t[n],t[n],t[n-1],t[n-1])-t[n]):i(r-s,t[s?s-1:0],t[s],t[n1?i(t[n],t[n-1],n-r):i(t[s],t[s+1>n?n:s+1],r-s)}},function(t,e){t.exports=function(t,e,n,i){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}},function(t,e,n){var i=n(23);t.exports=function(t,e,n){return e+(n-e)*i(t,0,1)}},function(t,e,n){var i=n(24);t.exports=function(t,e,n){return e+(n-e)*i(t,0,1)}},function(t,e,n){t.exports={GetNext:n(108),IsSize:n(109),IsValue:n(110)}},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,n){t.exports={Ceil:n(112),Floor:n(113),To:n(114)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.ceil(t/e),i?(n+t)/e:n+t)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.floor(t/e),i?(n+t)/e:n+t)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.round(t/e),i?(n+t)/e:n+t)}},function(t,e,n){var i=new(n(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,n=this.n;t=t.toString();for(var i=0;i>>0,n=(e*=n)>>>0,n+=4294967296*(e-=n);return this.n=n,2.3283064365386963e-10*(n>>>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 n=Math.floor(this.frac()*(e+1)),i=t[n];t[n]=t[e],t[e]=i}return t}});t.exports=i},function(t,e){t.exports=function(t){for(var e=0,n=0;n1?void 0!==i?(r=(i-t)/(i-n))<0&&(r=0):r=1:r<0&&(r=0),r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var n=2*Math.random()*Math.PI;return t.x=Math.cos(n)*e,t.y=Math.sin(n)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var n=2*Math.random()*Math.PI,i=2*Math.random()-1,r=Math.sqrt(1-i*i)*e;return t.x=Math.cos(n)*r,t.y=Math.sin(n)*r,t.z=i*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 n=t.x,i=t.y;return t.x=n*Math.cos(e)-i*Math.sin(e),t.y=n*Math.sin(e)+i*Math.cos(e),t}},function(t,e){t.exports=function(t,e,n,i){var r=Math.cos(i),s=Math.sin(i),o=t.x-e,a=t.y-n;return t.x=o*r-a*s+e,t.y=o*s+a*r+n,t}},function(t,e){t.exports=function(t,e,n,i,r){var s=i+Math.atan2(t.y-n,t.x-e);return t.x=e+r*Math.cos(s),t.y=n+r*Math.sin(s),t}},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=10);var i=Math.pow(n,-e);return Math.round(t*i)/i}},function(t,e){t.exports=function(t,e,n,i){void 0===e&&(e=1),void 0===n&&(n=1),void 0===i&&(i=1),i*=Math.PI/t;for(var r=[],s=[],o=0;o0&&t<=e*n&&(s=t>e-1?t-(o=Math.floor(t/e))*e:t,r.set(s,o)),r}},function(t,e,n){var i=n(7);t.exports=function(t,e,n,r,s,o,a,h){void 0===h&&(h=new i);var l=Math.sin(s),u=Math.cos(s),c=u*o,f=l*o,d=-l*a,p=u*a,v=1/(c*p+d*-f);return h.x=p*v*t+-d*v*e+(r*d-n*p)*v,h.y=c*v*e+-f*v*t+(-r*c+n*f)*v,h}},function(t,e){t.exports=function(t,e,n){return Math.abs(t-e)<=n}},function(t,e,n){var i=new(n(0))({initialize:function(t,e,n,i){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=n||0,this.w=i||0)},clone:function(){return new i(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,n,i){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=n||0,this.w=i||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,n=this.z,i=this.w;return Math.sqrt(t*t+e*e+n*n+i*i)},lengthSq:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return t*t+e*e+n*n+i*i},normalize:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=n*r,this.w=i*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 n=this.x,i=this.y,r=this.z,s=this.w;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),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,n=t.y-this.y,i=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+n*n+i*i+r*r)},distanceSq:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0,r=t.w-this.w||0;return e*e+n*n+i*i+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,n=this.y,i=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this},transformQuat:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z,a=t.w,h=a*e+s*i-o*n,l=a*n+o*e-r*i,u=a*i+r*n-s*e,c=-r*e-s*n-o*i;return this.x=h*a+c*-r+l*-o-u*-s,this.y=l*a+c*-s+u*-r-h*-o,this.z=u*a+c*-o+h*-s-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.distSq=i.prototype.distanceSq,i.prototype.len=i.prototype.length,i.prototype.lenSq=i.prototype.lengthSq,t.exports=i},function(t,e,n){var i=n(10),r=n(27),s=n(28),o=new r,a=new s,h=new i;t.exports=function(t,e,n){return a.setAxisAngle(e,n),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e){t.exports="resize"},function(t,e,n){var i=n(146),r=n(0),s=n(147),o=new r({Extends:i,initialize:function(t,e){i.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){}});t.exports=o},function(t,e,n){var i=new(n(0))({initialize:function(t){this.pluginManager=t,this.game=t.game,this.scene,this.systems},init:function(){},start:function(){},stop:function(){},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=i},function(t,e,n){t.exports={BOOT:n(148),CREATE:n(149),DESTROY:n(150),PAUSE:n(151),POST_UPDATE:n(152),PRE_UPDATE:n(153),READY:n(154),RENDER:n(155),RESUME:n(156),SHUTDOWN:n(157),SLEEP:n(158),START:n(159),TRANSITION_COMPLETE:n(160),TRANSITION_INIT:n(161),TRANSITION_OUT:n(162),TRANSITION_START:n(163),TRANSITION_WAKE:n(164),UPDATE:n(165),WAKE:n(166)}},function(t,e){t.exports="boot"},function(t,e){t.exports="create"},function(t,e){t.exports="destroy"},function(t,e){t.exports="pause"},function(t,e){t.exports="postupdate"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="ready"},function(t,e){t.exports="render"},function(t,e){t.exports="resume"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="sleep"},function(t,e){t.exports="start"},function(t,e){t.exports="transitioncomplete"},function(t,e){t.exports="transitioninit"},function(t,e){t.exports="transitionout"},function(t,e){t.exports="transitionstart"},function(t,e){t.exports="transitionwake"},function(t,e){t.exports="update"},function(t,e){t.exports="wake"},function(t,e){(function(){var e,n,i,r=this&&this.__extends||(e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,n)},function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)});!function(t){var e,n,i,s=function(){function t(t,e,n){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.duration=n}return t.prototype.apply=function(t,e,n,i,r,s,o,a){if(null==t)throw new Error("skeleton cannot be null.");i&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(s+1)*n]<=e?i=s+1:r=s,i==r)return(i+1)*n;s=i+r>>>1}},t.linearSearch=function(t,e,n){for(var i=0,r=t.length-n;i<=r;i+=n)if(t[i]>e)return i;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.in=0]="in",t[t.out=1]="out"}(n=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"}(i=t.TimelineType||(t.TimelineType={}));var o=function(){function e(n){if(n<=0)throw new Error("frameCount must be > 0: "+n);this.curves=t.Utils.newFloatArray((n-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 n=t*e.BEZIER_SIZE;if(n==this.curves.length)return e.LINEAR;var i=this.curves[n];return i==e.LINEAR?e.LINEAR:i==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,i,r,s){var o=.03*(2*-n+r),a=.03*(2*-i+s),h=.006*(3*(n-r)+1),l=.006*(3*(i-s)+1),u=2*o+h,c=2*a+l,f=.3*n+o+.16666667*h,d=.3*i+a+.16666667*l,p=t*e.BEZIER_SIZE,v=this.curves;v[p++]=e.BEZIER;for(var M=f,g=d,m=p+e.BEZIER_SIZE-1;p=i){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)*(i-u)/(a-u)}var f=r[s-1];return f+(1-f)*(i-a)/(1-a)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=o;var a=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e<<1),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.rotate<<24)+this.boneIndex},o.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+o.ROTATION]=n},o.prototype.apply=function(t,n,i,r,a,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(i=u[u.length-o.ENTRIES]){var d=u[u.length+o.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+d*a;break;case e.first:case e.replace:d+=c.data.rotation-c.rotation,d-=360*(16384-(16384.499999999996-d/360|0));case e.add:c.rotation+=d*a}}else{var p=s.binarySearch(u,i,o.ENTRIES),v=u[p+o.PREV_ROTATION],M=u[p],g=this.getCurvePercent((p>>1)-1,1-(i-M)/(u[p+o.PREV_TIME]-M)),m=u[p+o.ROTATION]-v;switch(m=v+(m-360*(16384-(16384.499999999996-m/360|0)))*g,h){case e.setup:c.rotation=c.data.rotation+(m-360*(16384-(16384.499999999996-m/360|0)))*a;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)))*a}}},o.ENTRIES=2,o.PREV_TIME=-2,o.PREV_ROTATION=-1,o.ROTATION=1,o}(o);t.RotateTimeline=a;var h=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.translate<<24)+this.boneIndex},o.prototype.setFrame=function(t,e,n,i){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.X]=n,this.frames[t+o.Y]=i},o.prototype.apply=function(t,n,i,r,a,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(i=u[u.length-o.ENTRIES])f=u[u.length+o.PREV_X],d=u[u.length+o.PREV_Y];else{var p=s.binarySearch(u,i,o.ENTRIES);f=u[p+o.PREV_X],d=u[p+o.PREV_Y];var v=u[p],M=this.getCurvePercent(p/o.ENTRIES-1,1-(i-v)/(u[p+o.PREV_TIME]-v));f+=(u[p+o.X]-f)*M,d+=(u[p+o.Y]-d)*M}switch(h){case e.setup:c.x=c.data.x+f*a,c.y=c.data.y+d*a;break;case e.first:case e.replace:c.x+=(c.data.x+f-c.x)*a,c.y+=(c.data.y+d-c.y)*a;break;case e.add:c.x+=f*a,c.y+=d*a}}},o.ENTRIES=3,o.PREV_TIME=-3,o.PREV_X=-2,o.PREV_Y=-1,o.X=1,o.Y=2,o}(o);t.TranslateTimeline=h;var l=function(o){function a(t){return o.call(this,t)||this}return r(a,o),a.prototype.getPropertyId=function(){return(i.scale<<24)+this.boneIndex},a.prototype.apply=function(i,r,o,h,l,u,c){var f=this.frames,d=i.bones[this.boneIndex];if(o=f[f.length-a.ENTRIES])p=f[f.length+a.PREV_X]*d.data.scaleX,v=f[f.length+a.PREV_Y]*d.data.scaleY;else{var M=s.binarySearch(f,o,a.ENTRIES);p=f[M+a.PREV_X],v=f[M+a.PREV_Y];var g=f[M],m=this.getCurvePercent(M/a.ENTRIES-1,1-(o-g)/(f[M+a.PREV_TIME]-g));p=(p+(f[M+a.X]-p)*m)*d.data.scaleX,v=(v+(f[M+a.Y]-v)*m)*d.data.scaleY}if(1==l)u==e.add?(d.scaleX+=p-d.data.scaleX,d.scaleY+=v-d.data.scaleY):(d.scaleX=p,d.scaleY=v);else{var x=0,y=0;if(c==n.out)switch(u){case e.setup:x=d.data.scaleX,y=d.data.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,d.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.first:case e.replace:x=d.scaleX,y=d.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,d.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.add:x=d.scaleX,y=d.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-d.data.scaleX)*l,d.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-d.data.scaleY)*l}else switch(u){case e.setup:x=Math.abs(d.data.scaleX)*t.MathUtils.signum(p),y=Math.abs(d.data.scaleY)*t.MathUtils.signum(v),d.scaleX=x+(p-x)*l,d.scaleY=y+(v-y)*l;break;case e.first:case e.replace:x=Math.abs(d.scaleX)*t.MathUtils.signum(p),y=Math.abs(d.scaleY)*t.MathUtils.signum(v),d.scaleX=x+(p-x)*l,d.scaleY=y+(v-y)*l;break;case e.add:x=t.MathUtils.signum(p),y=t.MathUtils.signum(v),d.scaleX=Math.abs(d.scaleX)*x+(p-Math.abs(d.data.scaleX)*x)*l,d.scaleY=Math.abs(d.scaleY)*y+(v-Math.abs(d.data.scaleY)*y)*l}}}},a}(h);t.ScaleTimeline=l;var u=function(t){function n(e){return t.call(this,e)||this}return r(n,t),n.prototype.getPropertyId=function(){return(i.shear<<24)+this.boneIndex},n.prototype.apply=function(t,i,r,o,a,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(r=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_X],d=u[u.length+n.PREV_Y];else{var p=s.binarySearch(u,r,n.ENTRIES);f=u[p+n.PREV_X],d=u[p+n.PREV_Y];var v=u[p],M=this.getCurvePercent(p/n.ENTRIES-1,1-(r-v)/(u[p+n.PREV_TIME]-v));f+=(u[p+n.X]-f)*M,d+=(u[p+n.Y]-d)*M}switch(h){case e.setup:c.shearX=c.data.shearX+f*a,c.shearY=c.data.shearY+d*a;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+f-c.shearX)*a,c.shearY+=(c.data.shearY+d-c.shearY)*a;break;case e.add:c.shearX+=f*a,c.shearY+=d*a}}},n}(h);t.ShearTimeline=u;var c=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.color<<24)+this.slotIndex},o.prototype.setFrame=function(t,e,n,i,r,s){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.R]=n,this.frames[t+o.G]=i,this.frames[t+o.B]=r,this.frames[t+o.A]=s},o.prototype.apply=function(t,n,i,r,a,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(i=c[c.length-o.ENTRIES]){var m=c.length;p=c[m+o.PREV_R],v=c[m+o.PREV_G],M=c[m+o.PREV_B],g=c[m+o.PREV_A]}else{var x=s.binarySearch(c,i,o.ENTRIES);p=c[x+o.PREV_R],v=c[x+o.PREV_G],M=c[x+o.PREV_B],g=c[x+o.PREV_A];var y=c[x],w=this.getCurvePercent(x/o.ENTRIES-1,1-(i-y)/(c[x+o.PREV_TIME]-y));p+=(c[x+o.R]-p)*w,v+=(c[x+o.G]-v)*w,M+=(c[x+o.B]-M)*w,g+=(c[x+o.A]-g)*w}if(1==a)u.color.set(p,v,M,g);else{f=u.color;h==e.setup&&f.setFromColor(u.data.color),f.add((p-f.r)*a,(v-f.g)*a,(M-f.b)*a,(g-f.a)*a)}}},o.ENTRIES=5,o.PREV_TIME=-5,o.PREV_R=-4,o.PREV_G=-3,o.PREV_B=-2,o.PREV_A=-1,o.R=1,o.G=2,o.B=3,o.A=4,o}(o);t.ColorTimeline=c;var f=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.twoColor<<24)+this.slotIndex},o.prototype.setFrame=function(t,e,n,i,r,s,a,h,l){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.R]=n,this.frames[t+o.G]=i,this.frames[t+o.B]=r,this.frames[t+o.A]=s,this.frames[t+o.R2]=a,this.frames[t+o.G2]=h,this.frames[t+o.B2]=l},o.prototype.apply=function(t,n,i,r,a,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(i=c[c.length-o.ENTRIES]){var b=c.length;M=c[b+o.PREV_R],g=c[b+o.PREV_G],m=c[b+o.PREV_B],x=c[b+o.PREV_A],y=c[b+o.PREV_R2],w=c[b+o.PREV_G2],E=c[b+o.PREV_B2]}else{var T=s.binarySearch(c,i,o.ENTRIES);M=c[T+o.PREV_R],g=c[T+o.PREV_G],m=c[T+o.PREV_B],x=c[T+o.PREV_A],y=c[T+o.PREV_R2],w=c[T+o.PREV_G2],E=c[T+o.PREV_B2];var A=c[T],R=this.getCurvePercent(T/o.ENTRIES-1,1-(i-A)/(c[T+o.PREV_TIME]-A));M+=(c[T+o.R]-M)*R,g+=(c[T+o.G]-g)*R,m+=(c[T+o.B]-m)*R,x+=(c[T+o.A]-x)*R,y+=(c[T+o.R2]-y)*R,w+=(c[T+o.G2]-w)*R,E+=(c[T+o.B2]-E)*R}if(1==a)u.color.set(M,g,m,x),u.darkColor.set(y,w,E,1);else{f=u.color,d=u.darkColor;h==e.setup&&(f.setFromColor(u.data.color),d.setFromColor(u.data.darkColor)),f.add((M-f.r)*a,(g-f.g)*a,(m-f.b)*a,(x-f.a)*a),d.add((y-d.r)*a,(w-d.g)*a,(E-d.b)*a,0)}}},o.ENTRIES=8,o.PREV_TIME=-8,o.PREV_R=-7,o.PREV_G=-6,o.PREV_B=-5,o.PREV_A=-4,o.PREV_R2=-3,o.PREV_G2=-2,o.PREV_B2=-1,o.R=1,o.G=2,o.B=3,o.A=4,o.R2=5,o.G2=6,o.B2=7,o}(o);t.TwoColorTimeline=f;var d=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return r.prototype.getPropertyId=function(){return(i.attachment<<24)+this.slotIndex},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},r.prototype.apply=function(t,i,r,o,a,h,l){var u=t.slots[this.slotIndex];if(l!=n.out||h!=e.setup){var c=this.frames;if(r=c[c.length-1]?c.length-1:s.binarySearch(c,r,1)-1;var p=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(null==p?null:t.getAttachment(this.slotIndex,p))}}else{var v=u.data.attachmentName;u.setAttachment(null==v?null:t.getAttachment(this.slotIndex,v))}},r}();t.AttachmentTimeline=d;var p=null,v=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e),i.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.deform<<27)+ +this.attachment.id+this.slotIndex},o.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},o.prototype.apply=function(n,i,r,o,a,h,l){var u=n.slots[this.slotIndex],c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.applyDeform(this.attachment)){var f=u.attachmentVertices;0==f.length&&(h=e.setup);var d=this.frameVertices,p=d[0].length,v=this.frames;if(r=v[v.length-1]){var w=d[v.length-1];if(1==a)if(h==e.add)if(null==(M=c).bones){m=M.vertices;for(var E=0;En)this.apply(t,e,Number.MAX_VALUE,i,r,o,a),e=-1;else if(e>=h[l-1])return;if(!(n0&&h[u-1]==c;)u--;for(;u=h[u];u++)i.push(this.events[u])}}},e}();t.EventTimeline=M;var g=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return r.prototype.getPropertyId=function(){return i.drawOrder<<24},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},r.prototype.apply=function(i,r,o,a,h,l,u){var c=i.drawOrder,f=i.slots;if(u!=n.out||l!=e.setup){var d=this.frames;if(o=d[d.length-1]?d.length-1:s.binarySearch(d,o)-1;var v=this.drawOrders[p];if(null==v)t.Utils.arrayCopy(f,0,c,0,f.length);else for(var M=0,g=v.length;M=c[c.length-a.ENTRIES])l==e.setup?(f.mix=f.data.mix+(c[c.length+a.PREV_MIX]-f.data.mix)*h,u==n.out?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[c.length+a.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+a.PREV_COMPRESS],f.stretch=0!=c[c.length+a.PREV_STRETCH])):(f.mix+=(c[c.length+a.PREV_MIX]-f.mix)*h,u==n.in&&(f.bendDirection=c[c.length+a.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+a.PREV_COMPRESS],f.stretch=0!=c[c.length+a.PREV_STRETCH]));else{var d=s.binarySearch(c,r,a.ENTRIES),p=c[d+a.PREV_MIX],v=c[d],M=this.getCurvePercent(d/a.ENTRIES-1,1-(r-v)/(c[d+a.PREV_TIME]-v));l==e.setup?(f.mix=f.data.mix+(p+(c[d+a.MIX]-p)*M-f.data.mix)*h,u==n.out?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[d+a.PREV_BEND_DIRECTION],f.compress=0!=c[d+a.PREV_COMPRESS],f.stretch=0!=c[d+a.PREV_STRETCH])):(f.mix+=(p+(c[d+a.MIX]-p)*M-f.mix)*h,u==n.in&&(f.bendDirection=c[d+a.PREV_BEND_DIRECTION],f.compress=0!=c[d+a.PREV_COMPRESS],f.stretch=0!=c[d+a.PREV_STRETCH]))}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_MIX=-4,a.PREV_BEND_DIRECTION=-3,a.PREV_COMPRESS=-2,a.PREV_STRETCH=-1,a.MIX=1,a.BEND_DIRECTION=2,a.COMPRESS=3,a.STRETCH=4,a}(o);t.IkConstraintTimeline=m;var x=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.transformConstraint<<24)+this.transformConstraintIndex},o.prototype.setFrame=function(t,e,n,i,r,s){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.ROTATE]=n,this.frames[t+o.TRANSLATE]=i,this.frames[t+o.SCALE]=r,this.frames[t+o.SHEAR]=s},o.prototype.apply=function(t,n,i,r,a,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(i=u[u.length-o.ENTRIES]){var g=u.length;d=u[g+o.PREV_ROTATE],p=u[g+o.PREV_TRANSLATE],v=u[g+o.PREV_SCALE],M=u[g+o.PREV_SHEAR]}else{var m=s.binarySearch(u,i,o.ENTRIES);d=u[m+o.PREV_ROTATE],p=u[m+o.PREV_TRANSLATE],v=u[m+o.PREV_SCALE],M=u[m+o.PREV_SHEAR];var x=u[m],y=this.getCurvePercent(m/o.ENTRIES-1,1-(i-x)/(u[m+o.PREV_TIME]-x));d+=(u[m+o.ROTATE]-d)*y,p+=(u[m+o.TRANSLATE]-p)*y,v+=(u[m+o.SCALE]-v)*y,M+=(u[m+o.SHEAR]-M)*y}if(h==e.setup){f=c.data;c.rotateMix=f.rotateMix+(d-f.rotateMix)*a,c.translateMix=f.translateMix+(p-f.translateMix)*a,c.scaleMix=f.scaleMix+(v-f.scaleMix)*a,c.shearMix=f.shearMix+(M-f.shearMix)*a}else c.rotateMix+=(d-c.rotateMix)*a,c.translateMix+=(p-c.translateMix)*a,c.scaleMix+=(v-c.scaleMix)*a,c.shearMix+=(M-c.shearMix)*a}},o.ENTRIES=5,o.PREV_TIME=-5,o.PREV_ROTATE=-4,o.PREV_TRANSLATE=-3,o.PREV_SCALE=-2,o.PREV_SHEAR=-1,o.ROTATE=1,o.TRANSLATE=2,o.SCALE=3,o.SHEAR=4,o}(o);t.TransformConstraintTimeline=x;var y=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.pathConstraintPosition<<24)+this.pathConstraintIndex},o.prototype.setFrame=function(t,e,n){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.VALUE]=n},o.prototype.apply=function(t,n,i,r,a,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(i=u[u.length-o.ENTRIES])f=u[u.length+o.PREV_VALUE];else{var d=s.binarySearch(u,i,o.ENTRIES);f=u[d+o.PREV_VALUE];var p=u[d],v=this.getCurvePercent(d/o.ENTRIES-1,1-(i-p)/(u[d+o.PREV_TIME]-p));f+=(u[d+o.VALUE]-f)*v}h==e.setup?c.position=c.data.position+(f-c.data.position)*a:c.position+=(f-c.position)*a}},o.ENTRIES=2,o.PREV_TIME=-2,o.PREV_VALUE=-1,o.VALUE=1,o}(o);t.PathConstraintPositionTimeline=y;var w=function(t){function n(e){return t.call(this,e)||this}return r(n,t),n.prototype.getPropertyId=function(){return(i.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,i,r,o,a,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_VALUE];else{var d=s.binarySearch(u,r,n.ENTRIES);f=u[d+n.PREV_VALUE];var p=u[d],v=this.getCurvePercent(d/n.ENTRIES-1,1-(r-p)/(u[d+n.PREV_TIME]-p));f+=(u[d+n.VALUE]-f)*v}h==e.setup?c.spacing=c.data.spacing+(f-c.data.spacing)*a:c.spacing+=(f-c.spacing)*a}},n}(y);t.PathConstraintSpacingTimeline=w;var E=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.pathConstraintMix<<24)+this.pathConstraintIndex},o.prototype.setFrame=function(t,e,n,i){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.ROTATE]=n,this.frames[t+o.TRANSLATE]=i},o.prototype.apply=function(t,n,i,r,a,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(i=u[u.length-o.ENTRIES])f=u[u.length+o.PREV_ROTATE],d=u[u.length+o.PREV_TRANSLATE];else{var p=s.binarySearch(u,i,o.ENTRIES);f=u[p+o.PREV_ROTATE],d=u[p+o.PREV_TRANSLATE];var v=u[p],M=this.getCurvePercent(p/o.ENTRIES-1,1-(i-v)/(u[p+o.PREV_TIME]-v));f+=(u[p+o.ROTATE]-f)*M,d+=(u[p+o.TRANSLATE]-d)*M}h==e.setup?(c.rotateMix=c.data.rotateMix+(f-c.data.rotateMix)*a,c.translateMix=c.data.translateMix+(d-c.data.translateMix)*a):(c.rotateMix+=(f-c.rotateMix)*a,c.translateMix+=(d-c.translateMix)*a)}},o.ENTRIES=3,o.PREV_TIME=-3,o.PREV_ROTATE=-2,o.PREV_TRANSLATE=-1,o.ROTATE=1,o.TRANSLATE=2,o}(o);t.PathConstraintMixTimeline=E}(i||(i={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new t.Pool(function(){return new n}),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,i=e.length;n0){if(r.delay-=s,r.delay>0)continue;s=-r.delay,r.delay=0}var o=r.next;if(null!=o){var a=r.trackLast-o.delay;if(a>=0){for(o.delay=0,o.trackTime=0==r.timeScale?0:(a/r.timeScale+t)*o.timeScale,r.trackTime+=s,this.setCurrent(n,o,!0);null!=o.mixingFrom;)o.mixTime+=t,o=o.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[n]=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 n=t.mixingFrom;if(null==n)return!0;var i=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),i):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var i=this.events,r=this.tracks,s=!1,o=0,a=r.length;o0)){s=!0;var l=0==o?t.MixBlend.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,n,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,f=h.getAnimationTime(),d=h.animation.timelines.length,p=h.animation.timelines;if(0==o&&1==u||l==t.MixBlend.add)for(var v=0;v1&&(o=1),r!=t.MixBlend.first&&(r=s.mixBlend));var a=o0&&this.queueEvents(s,c),this.events.length=0,s.nextAnimationLast=c,s.nextTrackLast=s.trackTime,o},e.prototype.applyRotateTimeline=function(e,n,i,r,s,o,a,h){if(h&&(o[a]=0),1!=r){var l=e,u=l.frames,c=n.bones[l.boneIndex],f=0,d=0;if(i=u[u.length-t.RotateTimeline.ENTRIES])d=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,i,t.RotateTimeline.ENTRIES),v=u[p+t.RotateTimeline.PREV_ROTATION],M=u[p],g=l.getCurvePercent((p>>1)-1,1-(i-M)/(u[p+t.RotateTimeline.PREV_TIME]-M));d=u[p+t.RotateTimeline.ROTATION]-v,d=v+(d-=360*(16384-(16384.499999999996-d/360|0)))*g+c.data.rotation,d-=360*(16384-(16384.499999999996-d/360|0))}var m=0,x=d-f;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))m=o[a];else{var y=0,w=0;h?(y=0,w=x):(y=o[a],w=o[a+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)),o[a]=m}o[a+1]=x,f+=m*r,c.rotation=f-360*(16384-(16384.499999999996-f/360|0))}else e.apply(n,0,i,null,1,s,t.MixDirection.in)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,i=t.animationEnd,r=i-n,s=t.trackLast%r,o=this.events,a=0,h=o.length;ai||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:e>=i&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var i=n.mixingFrom;if(null==i)break;this.queue.end(i),n.mixingFrom=null,n.mixingTo=null,n=i}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var i=this.expandToIndex(t);this.tracks[t]=e,null!=i&&(n&&this.queue.interrupt(i),e.mixingFrom=i,i.mixingTo=e,e.mixTime=0,null!=i.mixingFrom&&i.mixDuration>0&&(e.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var i=this.data.skeletonData.findAnimation(e);if(null==i)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,i,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var i=!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,i=!1):this.disposeNext(r));var s=this.trackEntry(t,e,n,r);return this.setCurrent(t,s,i),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,n,i){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,n,i)},e.prototype.addAnimationWith=function(t,e,n,i){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,n,r);if(null==r)this.setCurrent(t,s,!0),this.queue.drain();else if(r.next=s,i<=0){var o=r.animationEnd-r.animationStart;0!=o?(r.loop?i+=o*(1+(r.trackTime/o|0)):i+=Math.max(o,r.trackTime),i-=this.data.getMix(r.animation,e)):i=r.trackTime}return s.delay=i,s},e.prototype.setEmptyAnimation=function(t,n){var i=this.setAnimationWith(t,e.emptyAnimation,!1);return i.mixDuration=n,i.trackEnd=n,i},e.prototype.addEmptyAnimation=function(t,n,i){i<=0&&(i-=n);var r=this.addAnimationWith(t,e.emptyAnimation,!1,i);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,i=this.tracks.length;n0){o[l]=e.HOLD_MIX,a[l]=c;continue t}break}o[l]=e.HOLD}else o[l]=e.FIRST;else o[l]=e.SUBSEQUENT}},e.prototype.hasTimeline=function(t,e){for(var n=t.animation.timelines,i=0,r=n.length;i=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=2,e.HOLD_MIX=3,e}();t.AnimationState=e;var n=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=n;var i,r=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(i.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(i.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(i.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(i.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(i.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(i.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,n=0;n=0?n.substring(0,n.lastIndexOf("/")):"";n=this.pathPrefix+n,this.toLoad++,e.downloadText(n,function(e){var a={count:0},h=new Array;try{new t.TextureAtlas(e,function(e){h.push(o+"/"+e);var n=document.createElement("img");return n.width=16,n.height=16,new t.FakeTexture(n)})}catch(t){var l=t;return s.errors[n]="Couldn't load texture atlas "+n+": "+l.message,r&&r(n,"Couldn't load texture atlas "+n+": "+l.message),s.toLoad--,void s.loaded++}for(var u=function(l){var u=!1;s.loadTexture(l,function(l,c){if(a.count++,a.count==h.length)if(u)s.errors[n]="Couldn't load texture atlas page "+l+"} of atlas "+n,r&&r(n,"Couldn't load texture atlas page "+l+" of atlas "+n),s.toLoad--,s.loaded++;else try{var f=new t.TextureAtlas(e,function(t){return s.get(o+"/"+t)});s.assets[n]=f,i&&i(n,f),s.toLoad--,s.loaded++}catch(t){var d=t;s.errors[n]="Couldn't load texture atlas "+n+": "+d.message,r&&r(n,"Couldn't load texture atlas "+n+": "+d.message),s.toLoad--,s.loaded++}},function(t,e){u=!0,a.count++,a.count==h.length&&(s.errors[n]="Couldn't load texture atlas page "+t+"} of atlas "+n,r&&r(n,"Couldn't load texture atlas page "+t+" of atlas "+n),s.toLoad--,s.loaded++)})},c=0,f=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(i||(i={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,n,i){var r=this.atlas.findRegion(i);if(null==r)throw new Error("Region not found in atlas: "+i+" (region attachment: "+n+")");r.renderObject=r;var s=new t.RegionAttachment(n);return s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,n,i){var r=this.atlas.findRegion(i);if(null==r)throw new Error("Region not found in atlas: "+i+" (mesh attachment: "+n+")");r.renderObject=r;var s=new t.MeshAttachment(n);return s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,n){return new t.BoundingBoxAttachment(n)},e.prototype.newPathAttachment=function(e,n){return new t.PathAttachment(n)},e.prototype.newPointAttachment=function(e,n){return new t.PointAttachment(n)},e.prototype.newClippingAttachment=function(e,n){return new t.ClippingAttachment(n)},e}();t.AtlasAttachmentLoader=e}(i||(i={})),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={}))}(i||(i={})),function(t){var e=function(){function e(t,e,n){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.worldX=0,this.c=0,this.d=0,this.worldY=0,this.sorted=!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=n,this.setToSetupPose()}return 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,n,i,r,s,o,a){this.ax=e,this.ay=n,this.arotation=i,this.ascaleX=r,this.ascaleY=s,this.ashearX=o,this.ashearY=a,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=i+90+a,c=l.scaleX,f=l.scaleY;return this.a=t.MathUtils.cosDeg(i+o)*r*c,this.b=t.MathUtils.cosDeg(u)*s*c,this.c=t.MathUtils.sinDeg(i+o)*r*f,this.d=t.MathUtils.sinDeg(u)*s*f,this.worldX=e*c+l.x,void(this.worldY=n*f+l.y)}var d=h.a,p=h.b,v=h.c,M=h.d;switch(this.worldX=d*e+p*n+h.worldX,this.worldY=v*e+M*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=i+90+a;var g=t.MathUtils.cosDeg(i+o)*r,m=t.MathUtils.cosDeg(u)*s,x=t.MathUtils.sinDeg(i+o)*r,y=t.MathUtils.sinDeg(u)*s;return this.a=d*g+p*x,this.b=d*m+p*y,this.c=v*g+M*x,void(this.d=v*m+M*y);case t.TransformMode.OnlyTranslation:u=i+90+a;this.a=t.MathUtils.cosDeg(i+o)*r,this.b=t.MathUtils.cosDeg(u)*s,this.c=t.MathUtils.sinDeg(i+o)*r,this.d=t.MathUtils.sinDeg(u)*s;break;case t.TransformMode.NoRotationOrReflection:var w=0;(T=d*d+v*v)>1e-4?(p=v*(T=Math.abs(d*M-p*v)/T),M=d*T,w=Math.atan2(v,d)*t.MathUtils.radDeg):(d=0,v=0,w=90-Math.atan2(M,p)*t.MathUtils.radDeg);var E=i+o-w,b=i+a-w+90;g=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=d*g-p*x,this.b=d*m-p*y,this.c=v*g+M*x,this.d=v*m+M*y;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var T,A=t.MathUtils.cosDeg(i),R=t.MathUtils.sinDeg(i),S=(d*A+p*R)/this.skeleton.scaleX,C=(v*A+M*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&&d*M-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;g=t.MathUtils.cosDeg(o)*r,m=t.MathUtils.cosDeg(90+a)*s,x=t.MathUtils.sinDeg(o)*r,y=t.MathUtils.sinDeg(90+a)*s;this.a=S*g+P*x,this.b=S*m+P*y,this.c=C*g+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 n=e.a,i=e.b,r=e.c,s=e.d,o=1/(n*s-i*r),a=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=a*s*o-h*i*o,this.ay=h*n*o-a*r*o;var l=o*s,u=o*n,c=o*i,f=o*r,d=l*this.a-c*this.c,p=l*this.b-c*this.d,v=u*this.c-f*this.a,M=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+v*v),this.ascaleX>1e-4){var g=d*M-p*v;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(d*p+v*M,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(v,d)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+M*M),this.ashearY=0,this.arotation=90-Math.atan2(M,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,i=this.c,r=this.d,s=1/(e*r-n*i),o=t.x-this.worldX,a=t.y-this.worldY;return t.x=o*r*s-a*n*s,t.y=a*e*s-o*i*s,t},e.prototype.localToWorld=function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var n=t.MathUtils.sinDeg(e),i=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*i,this.d*i-this.b*n)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var n=t.MathUtils.sinDeg(e),i=t.MathUtils.cosDeg(e);return Math.atan2(i*this.c+n*this.d,i*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,i=this.b,r=this.c,s=this.d,o=t.MathUtils.cosDeg(e),a=t.MathUtils.sinDeg(e);this.a=o*n-a*r,this.b=o*i-a*s,this.c=a*n+o*r,this.d=a*i+o*s,this.appliedValid=!1},e}();t.Bone=e}(i||(i={})),function(t){var e,n=function(){return function(t,n,i){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,t<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=t,this.name=n,this.parent=i}}();t.BoneData=n,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={}))}(i||(i={})),function(t){var e=function(){return function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e}}();t.Event=e}(i||(i={})),function(t){var e=function(){return function(t){this.name=t}}();t.EventData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=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.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var n=0;n180?p-=360:p<-180&&(p+=360);var v=e.ascaleX,M=e.ascaleY;if(r||s){var g=e.data.length*v,m=Math.sqrt(f*f+d*d);if(r&&mg&&g>1e-4){var x=(m/g-1)*a+1;v*=x,o&&(M*=x)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+p*a,v,M,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,i,r,s,o,a){if(0!=a){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var h=e.ax,l=e.ay,u=e.ascaleX,c=u,f=e.ascaleY,d=n.ascaleX,p=0,v=0,M=0;u<0?(u=-u,p=180,M=-1):(p=0,M=1),f<0&&(f=-f,M=-M),d<0?(d=-d,v=180):v=0;var g=n.ax,m=0,x=0,y=0,w=e.a,E=e.b,b=e.c,T=e.d,A=Math.abs(u-f)<=1e-4;A?(x=w*g+E*(m=n.ay)+e.worldX,y=b*g+T*m+e.worldY):(m=0,x=w*g+e.worldX,y=b*g+e.worldY);var R=e.parent;w=R.a,E=R.b,b=R.c;var S=1/(w*(T=R.d)-E*b),C=i-R.worldX,I=r-R.worldY,P=(C*T-I*E)*S-h,L=(I*w-C*b)*S-l,_=P*P+L*L,k=((C=x-R.worldX)*T-(I=y-R.worldY)*E)*S-h,V=(I*w-C*b)*S-l,O=Math.sqrt(k*k+V*V),D=n.data.length*d,F=0,N=0;t:if(A){var X=(_-O*O-(D*=u)*D)/(2*O*D);X<-1?X=-1:X>1&&(X=1,o&&O+D>1e-4&&(c*=(Math.sqrt(_)/(O+D)-1)*a+1)),N=Math.acos(X)*s,w=O+D*X,E=D*Math.sin(N),F=Math.atan2(L*w-P*E,P*w+L*E)}else{var U=(w=u*D)*w,Y=(E=f*D)*E,z=Math.atan2(L,P),B=-2*Y*O,W=Y-U;if((T=B*B-4*W*(b=Y*O*O+U*_-U*Y))>=0){var q=Math.sqrt(T);B<0&&(q=-q);var G=(q=-(B+q)/2)/W,H=b/q,j=Math.abs(G)=-1&&b<=1&&(b=Math.acos(b),(T=(C=w*Math.cos(b)+O)*C+(I=E*Math.sin(b))*I)et&&($=b,et=T,tt=C,nt=I)),_<=(K+et)/2?(F=z-Math.atan2(J*s,Q),N=Z*s):(F=z-Math.atan2(nt*s,tt),N=$*s)}var it=Math.atan2(m,g)*M,rt=e.arotation;(F=(F-it)*t.MathUtils.radDeg+p-rt)>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(h,l,rt+F*a,c,e.ascaleY,0,0),rt=n.arotation,(N=((N+it)*t.MathUtils.radDeg-n.ashearX)*M+v-rt)>180?N-=360:N<-180&&(N+=360),n.updateWorldTransformWith(g,m,rt+N*a,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(i||(i={})),function(t){var e=function(){return function(t){this.order=0,this.bones=new Array,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.name=t}}();t.IkConstraintData=e}(i||(i={})),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,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 n=0,i=t.bones.length;n0;if(r>0||s){var o=this.data,a=o.spacingMode==t.SpacingMode.Percent,h=o.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,f=l?c:c+1,d=this.bones,p=t.Utils.setArraySize(this.spaces,f),v=null,M=this.spacing;if(u||!a){u&&(v=t.Utils.setArraySize(this.lengths,c));for(var g=o.spacingMode==t.SpacingMode.Length,m=0,x=f-1;m0?t.MathUtils.degRad:-t.MathUtils.degRad;m=0;for(var P=3;mt.MathUtils.PI?U-=t.MathUtils.PI2:U<-t.MathUtils.PI&&(U+=t.MathUtils.PI2),U*=i,Y=Math.cos(U),z=Math.sin(U),L.a=Y*D-z*N,L.b=Y*F-z*X,L.c=z*D+Y*N,L.d=z*F+Y*X}L.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,i,r,s,o){var a=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*i+2),c=null,f=n.closed,d=n.worldVerticesLength,p=d/6,v=e.NONE;if(!n.constantSpeed){var M=n.lengths,g=M[p-=f?1:2];if(s&&(h*=g),o)for(var m=1;mg){v!=e.AFTER&&(v=e.AFTER,n.computeWorldVertices(a,d-6,4,c,0,2)),this.addAfterPosition(w-g,c,0,u,x);continue}}for(;;y++){var E=M[y];if(!(w>E)){if(0==y)w/=E;else w=(w-(Z=M[y-1]))/(E-Z);break}}y!=v&&(v=y,f&&y==p?(n.computeWorldVertices(a,d-4,4,c,0,2),n.computeWorldVertices(a,0,4,c,4,2)):n.computeWorldVertices(a,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==q)}return u}f?(d+=2,c=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(a,2,d-4,c,0,2),n.computeWorldVertices(a,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(p--,d-=4,c=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(a,2,d,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,_=0,k=0,V=0,O=0,D=0,F=0,N=0,X=0,U=0,Y=(m=0,2);mT){this.addAfterPosition(w-T,c,d-4,u,x);continue}}for(;;y++){var G=b[y];if(!(w>G)){if(0==y)w/=G;else w=(w-(Z=b[y-1]))/(G-Z);break}}if(y!=v){v=y;var H=6*y;for(A=c[H],R=c[H+1],S=c[H+2],C=c[H+3],I=c[H+4],P=c[H+5],L=c[H+6],_=c[H+7],F=2*(k=.03*(A-2*S+I))+(O=.006*(3*(S-I)-A+L)),N=2*(V=.03*(R-2*C+P))+(D=.006*(3*(C-P)-R+_)),X=.3*(S-A)+k+.16666667*O,U=.3*(C-R)+V+.16666667*D,B=Math.sqrt(X*X+U*U),z[0]=B,H=1;H<8;H++)X+=F,U+=N,F+=O,N+=D,B+=Math.sqrt(X*X+U*U),z[H]=B;X+=F,U+=N,B+=Math.sqrt(X*X+U*U),z[8]=B,X+=F+O,U+=N+D,B+=Math.sqrt(X*X+U*U),z[9]=B,W=0}for(w*=B;;W++){var j=z[W];if(!(w>j)){var Z;if(0==W)w/=j;else w=W+(w-(Z=z[W-1]))/(j-Z);break}}this.addCurvePosition(.1*w,A,R,S,C,I,P,L,_,u,x,r||m>0&&0==q)}return u},e.prototype.addBeforePosition=function(t,e,n,i,r){var s=e[n],o=e[n+1],a=e[n+2]-s,h=e[n+3]-o,l=Math.atan2(h,a);i[r]=s+t*Math.cos(l),i[r+1]=o+t*Math.sin(l),i[r+2]=l},e.prototype.addAfterPosition=function(t,e,n,i,r){var s=e[n+2],o=e[n+3],a=s-e[n],h=o-e[n+1],l=Math.atan2(h,a);i[r]=s+t*Math.cos(l),i[r+1]=o+t*Math.sin(l),i[r+2]=l},e.prototype.addCurvePosition=function(t,e,n,i,r,s,o,a,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=n,void(l[u+2]=Math.atan2(r-n,i-e));var f=t*t,d=f*t,p=1-t,v=p*p,M=v*p,g=p*t,m=3*g,x=p*m,y=m*t,w=e*M+i*x+s*y+a*d,E=n*M+r*x+o*y+h*d;l[u]=w,l[u+1]=E,c&&(l[u+2]=t<.001?Math.atan2(r-n,i-e):Math.atan2(E-(n*v+r*g*2+o*f),w-(e*v+i*g*2+s*f)))},e.prototype.getOrder=function(){return this.data.order},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(i||(i={})),function(t){var e=function(){return function(t){this.order=0,this.bones=new Array,this.name=t}}();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={}))}(i||(i={})),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}(),n=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,n,i){var r=this.clientAssets[t];return null!==r&&void 0!==r||(r=new e(t),this.clientAssets[t]=r),null!==n&&(r.textureLoader=n),r.toLoad.push(i),this.queuedAssets[i]!==i&&(this.queuedAssets[i]=i,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState==XMLHttpRequest.DONE&&(i.status>=200&&i.status<300?n.rawAssets[e]=i.responseText:n.errors[e]="Couldn't load text "+e+": status "+i.status+", "+i.responseText)},i.open("GET",e,!0),i.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState==XMLHttpRequest.DONE&&(i.status>=200&&i.status<300?n.rawAssets[e]=JSON.parse(i.responseText):n.errors[e]="Couldn't load text "+e+": status "+i.status+", "+i.responseText)},i.open("GET",e,!0),i.send()}},t.prototype.loadTexture=function(t,e,n){var i=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n)){var r=new Image;r.src=n,r.crossOrigin="anonymous",r.onload=function(t){i.rawAssets[n]=r},r.onerror=function(t){i.errors[n]="Couldn't load image "+n}}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var n=this.clientAssets[t];return null===n||void 0===n||n.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=0;e0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=n}(i||(i={})),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 n=0;n1){var r=n[n.length-1];this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}this._updateCache.push(t),this.sortReset(i.children),n[n.length-1].sorted=!0},e.prototype.sortPathConstraint=function(e){var n=e.target,i=n.data.index,r=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,i,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,i,r);for(var s=0,o=this.data.skins.length;s-1||this.updateCacheReset.push(r)}else for(i=0;i=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,i){var r=this.minX,s=this.minY,o=this.maxX,a=this.maxY;if(t<=r&&n<=r||e<=s&&i<=s||t>=o&&n>=o||e>=a&&i>=a)return!1;var h=(i-e)/(n-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 n=this.polygons,i=0,r=n.length;i=n||l=n){var u=i[a];u+(n-h)/(l-h)*(i[s]-u)=u&&x<=d||x>=d&&x<=u)&&(x>=e&&x<=i||x>=i&&x<=e)){var y=(l*g-h*v)/m;if((y>=c&&y<=p||y>=p&&y<=c)&&(y>=n&&y<=r||y>=r&&y<=n))return!0}u=d,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}(i||(i={})),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(n,i){if(null!=this.clipAttachment)return 0;this.clipAttachment=i;var r=i.worldVerticesLength,s=t.Utils.setArraySize(this.clippingPolygon,r);i.computeWorldVertices(n,0,r,s,0,2);var o=this.clippingPolygon;e.makeClockwise(o);for(var a=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),h=0,l=a.length;h>1,X=this.clipOutput,U=t.Utils.setArraySize(u,L+N*p),Y=0;Y<_;Y+=2){var z=X[Y],B=X[Y+1];U[L]=z,U[L+1]=B,U[L+2]=o.r,U[L+3]=o.g,U[L+4]=o.b,U[L+5]=o.a;var W=z-R,q=B-S,G=(k*W+V*q)*F,H=(D*W+O*q)*F,j=1-G-H;U[L+6]=y*G+T*H+C*j,U[L+7]=w*G+A*H+I*j,h&&(U[L+8]=a.r,U[L+9]=a.g,U[L+10]=a.b,U[L+11]=a.a),L+=p}L=c.length;var Z=t.Utils.setArraySize(c,L+3*(N-2));N--;for(Y=1;Y=2?(u=a,a=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(i),u.push(r),u.push(s),u.push(t),u.push(e),a.length=0;for(var c=o,f=o.length-4,d=0;;d+=2){for(var p=c[d],v=c[d+1],M=c[d+2],g=c[d+3],m=p-M,x=v-g,y=u,w=u.length-2,E=a.length,b=0;b0;if(m*(A-g)-x*(T-M)>0){if(C){a.push(R),a.push(S);continue}var I=(L=S-A)*(M-p)-(_=R-T)*(g-v);if(Math.abs(I)>1e-6){var P=(_*(v-A)-L*(p-T))/I;a.push(p+(M-p)*P),a.push(v+(g-v)*P)}else a.push(p),a.push(v)}else if(C){var L,_;I=(L=S-A)*(M-p)-(_=R-T)*(g-v);if(Math.abs(I)>1e-6){P=(_*(v-A)-L*(p-T))/I;a.push(p+(M-p)*P),a.push(v+(g-v)*P)}else a.push(p),a.push(v);a.push(R),a.push(S)}l=!0}if(E==a.length)return h.length=0,!0;if(a.push(a[0]),a.push(a[1]),d==f)break;var k=a;(a=u).length=0,u=k}if(h!=a){h.length=0;d=0;for(var V=a.length-2;d>1;a=0;f--)-1==W[f]&&(W[f]=G[--j])}y.setFrame(c++,B.time,W)}s.push(y),o=Math.max(o,y.frames[y.getFrameCount()-1])}if(e.events){for(y=new t.EventTimeline(e.events.length),c=0,f=0;f=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=n},t.prototype.getAttachment=function(t,e){var n=this.attachments[t];return n?n[e]:null},t.prototype.attachAll=function(t,e){for(var n=0,i=0;i= 0.");if(null==n)throw new Error("name cannot be null.");if(null==i)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=i}}();t.SlotData=e}(i||(i={})),function(t){var e,n,i=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 "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return n.MirroredRepeat;case"clamptoedge":return n.ClampToEdge;case"repeat":return n.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();t.Texture=i,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"}(n=t.TextureWrap||(t.TextureWrap={}));var s=function(){return 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 o=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}(i);t.FakeTexture=o}(i||(i={})),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 o=new n(e),a=new Array(4),h=null;;){var l=o.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,u.rotate="true"==o.readValue(),o.readTuple(a);var c=parseInt(a[0]),f=parseInt(a[1]);o.readTuple(a);var d=parseInt(a[0]),p=parseInt(a[1]);u.u=c/h.width,u.v=f/h.height,u.rotate?(u.u2=(c+p)/h.width,u.v2=(f+d)/h.height):(u.u2=(c+d)/h.width,u.v2=(f+p)/h.height),u.x=c,u.y=f,u.width=Math.abs(d),u.height=Math.abs(p),4==o.readTuple(a)&&4==o.readTuple(a)&&o.readTuple(a),u.originalWidth=parseInt(a[0]),u.originalHeight=parseInt(a[1]),o.readTuple(a),u.offsetX=parseInt(a[0]),u.offsetY=parseInt(a[1]),u.index=parseInt(o.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new i).name=l,2==o.readTuple(a)&&(h.width=parseInt(a[0]),h.height=parseInt(a[1]),o.readTuple(a)),o.readTuple(a),h.minFilter=t.Texture.filterFromString(a[0]),h.magFilter=t.Texture.filterFromString(a[1]);var v=o.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==v?h.uWrap=t.TextureWrap.Repeat:"y"==v?h.vWrap=t.TextureWrap.Repeat:"xy"==v&&(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(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var i=0,r=n+1;i<3;i++){var s=e.indexOf(",",r);if(-1==s)break;t[i]=e.substr(r,s-r).trim(),r=s+1}return t[i]=e.substring(r).trim(),i+1},t}(),i=function(){return function(){}}();t.TextureAtlasPage=i;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=s}(i||(i={})),function(t){var e=function(){function e(e,n){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,null==e)throw new Error("data cannot be null.");if(null==n)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 i=0;i0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,d=this.bones,p=0,v=d.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);M.a=E*m-b*y,M.b=E*x-b*w,M.c=b*m+E*y,M.d=b*x+E*w,g=!0}if(0!=n){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),M.worldX+=(T.x-M.worldX)*n,M.worldY+=(T.y-M.worldY)*n,g=!0}if(i>0){var A=Math.sqrt(M.a*M.a+M.c*M.c),R=Math.sqrt(o*o+h*h);A>1e-5&&(A=(A+(R-A+this.data.offsetScaleX)*i)/A),M.a*=A,M.c*=A,A=Math.sqrt(M.b*M.b+M.d*M.d),R=Math.sqrt(a*a+l*l),A>1e-5&&(A=(A+(R-A+this.data.offsetScaleY)*i)/A),M.b*=A,M.d*=A,g=!0}if(r>0){x=M.b,w=M.d;var S,C=Math.atan2(w,x);(S=Math.atan2(l,a)-Math.atan2(h,o)-(C-Math.atan2(M.c,M.a)))>t.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S=C+(S+f)*r;A=Math.sqrt(x*x+w*w);M.b=Math.cos(S)*A,M.d=Math.sin(S)*A,g=!0}g&&(M.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,i=this.scaleMix,r=this.shearMix,s=this.target,o=s.a,a=s.b,h=s.c,l=s.d,u=o*l-a*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,d=this.bones,p=0,v=d.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);M.a=E*m-b*y,M.b=E*x-b*w,M.c=b*m+E*y,M.d=b*x+E*w,g=!0}if(0!=n){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),M.worldX+=T.x*n,M.worldY+=T.y*n,g=!0}if(i>0){var A=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*i+1;M.a*=A,M.c*=A,A=(Math.sqrt(a*a+l*l)-1+this.data.offsetScaleY)*i+1,M.b*=A,M.d*=A,g=!0}if(r>0){var R;(R=Math.atan2(l,a)-Math.atan2(h,o))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2);x=M.b,w=M.d;R=Math.atan2(w,x)+(R-t.MathUtils.PI/2+f)*r;A=Math.sqrt(x*x+w*w);M.b=Math.cos(R)*A,M.d=Math.sin(R)*A,g=!0}g&&(M.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,o=0,a=s.length;o1e-5&&(d=(d+(r.ascaleX-d+this.data.offsetScaleX)*n)/d),p>1e-5&&(p=(p+(r.ascaleY-p+this.data.offsetScaleY)*n)/p));var v=h.ashearY;if(0!=i){u=r.ashearY-v+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*i}h.updateWorldTransformWith(c,f,l,d,p,h.ashearX,v)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,o=0,a=s.length;o1e-5&&(f*=(r.ascaleX-1+this.data.offsetScaleX)*n+1),d>1e-5&&(d*=(r.ascaleY-1+this.data.offsetScaleY)*n+1));var p=h.ashearY;0!=i&&(p+=(r.ashearY+this.data.offsetShearY)*i),h.updateWorldTransformWith(u,c,l,f,d,h.ashearX,p)}},e.prototype.getOrder=function(){return this.data.order},e}();t.TransformConstraint=e}(i||(i={})),function(t){var e=function(){return function(t){if(this.order=0,this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=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,null==t)throw new Error("name cannot be null.");this.name=t}}();t.TransformConstraintData=e}(i||(i={})),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 n=t,i=t.length>>1,r=this.indicesArray;r.length=0;for(var s=0;s3;){for(var l=i-1,u=(s=0,1);;){t:if(!o[s]){for(var c=r[l]<<1,f=r[s]<<1,d=r[u]<<1,p=n[c],v=n[c+1],M=n[f],g=n[f+1],m=n[d],x=n[d+1],y=(u+1)%i;y!=l;y=(y+1)%i)if(o[y]){var w=r[y]<<1,E=n[w],b=n[w+1];if(e.positiveArea(m,x,p,v,E,b)&&e.positiveArea(p,v,M,g,E,b)&&e.positiveArea(M,g,m,x,E,b))break t}break}if(0==u){do{if(!o[s])break;s--}while(s>0);break}l=s,s=u,u=(u+1)%i}h.push(r[(i+s-1)%i]),h.push(r[s]),h.push(r[(s+1)%i]),r.splice(s,1),o.splice(s,1);var T=(--i+s-1)%i,A=s==i?0:s;o[T]=e.isConcave(T,i,n,r),o[A]=e.isConcave(A,i,n,r)}return 3==i&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},e.prototype.decompose=function(t,n){var i=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var s=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(s),s.length=0;var o=this.polygonIndicesPool.obtain();o.length=0;var a=this.polygonPool.obtain();a.length=0;for(var h=-1,l=0,u=0,c=n.length;u0?(r.push(a),s.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),(a=this.polygonPool.obtain()).length=0,a.push(v),a.push(M),a.push(g),a.push(m),a.push(x),a.push(y),(o=this.polygonIndicesPool.obtain()).length=0,o.push(f),o.push(d),o.push(p),l=e.winding(v,M,g,m,x,y),h=f)}a.length>0&&(r.push(a),s.push(o));for(u=0,c=r.length;u=0;u--)0==(a=r[u]).length&&(r.splice(u,1),this.polygonPool.free(a),o=s[u],s.splice(u,1),this.polygonIndicesPool.free(o));return r},e.isConcave=function(t,e,n,i){var r=i[(e+t-1)%e]<<1,s=i[t]<<1,o=i[(t+1)%e]<<1;return!this.positiveArea(n[r],n[r+1],n[s],n[s+1],n[o],n[o+1])},e.positiveArea=function(t,e,n,i,r,s){return t*(s-i)+n*(e-s)+r*(i-e)>=0},e.winding=function(t,e,n,i,r,s){var o=n-t,a=i-e;return r*a-s*o+o*e-t*a>=0?1:-1},e}();t.Triangulator=e}(i||(i={})),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 void 0!=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 n=function(){function t(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.r=t,this.g=e,this.b=n,this.a=i}return t.prototype.set=function(t,e,n,i){return this.r=t,this.g=e,this.b=n,this.a=i,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,n,i){return this.r+=t,this.g+=e,this.b+=n,this.a+=i,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.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=n;var i=function(){function t(){}return t.clamp=function(t,e,n){return tn?n: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,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var i=Math.random(),r=e-t;return i<=(n-t)/r?t+Math.sqrt(i*r*(n-t)):e-Math.sqrt((1-i)*r*(e-n))},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=i;var s=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=s;var o=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}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=o;var a=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}(o);t.PowOut=a;var h=function(){function t(){}return t.arrayCopy=function(t,e,n,i,r){for(var s=e,o=i;s=n?e:t.setArraySize(e,n,i)},t.newArray=function(t,e){for(var n=new Array(t),i=0;i0?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=f;var d=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 o=t.bone.skeleton,a=t.attachmentVertices,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f0&&(h=a);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,n,i){var r=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?r.drawElements(e,i,r.UNSIGNED_SHORT,2*n):r.drawArrays(e,n,i),this.unbind(t)},e.prototype.bind=function(t){var e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);for(var n=0,i=0;i0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)},e.prototype.unbind=function(t){for(var e=this.context.gl,n=0;n0&&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 n=function(){return function(t,e,n){this.name=t,this.type=e,this.numElements=n}}();t.VertexAttribute=n;var i=function(e){function n(){return e.call(this,t.Shader.POSITION,h.Float,2)||this}return r(n,e),n}(n);t.Position2Attribute=i;var s=function(e){function n(){return e.call(this,t.Shader.POSITION,h.Float,3)||this}return r(n,e),n}(n);t.Position3Attribute=s;var o=function(e){function n(n){return void 0===n&&(n=0),e.call(this,t.Shader.TEXCOORDS+(0==n?"":n),h.Float,2)||this}return r(n,e),n}(n);t.TexCoordAttribute=o;var a=function(e){function n(){return e.call(this,t.Shader.COLOR,h.Float,4)||this}return r(n,e),n}(n);t.ColorAttribute=a;var h,l=function(e){function n(){return e.call(this,t.Shader.COLOR2,h.Float,4)||this}return r(n,e),n}(n);t.Color2Attribute=l,function(t){t[t.Float=0]="Float"}(h=t.VertexAttributeType||(t.VertexAttributeType={}))}(t.webgl||(t.webgl={}))}(i||(i={})),function(t){!function(t){var e=function(){function e(e,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=10920),this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=e instanceof t.ManagedWebGLRenderingContext?e:new t.ManagedWebGLRenderingContext(e);var r=n?[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,i,3*i),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 n=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),n.blendFunc(this.srcBlend,this.dstBlend))},e.prototype.draw=function(t,e,n){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+n.length>this.mesh.getIndices().length)&&this.flush();var i=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,o=0;o0||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={}))}(i||(i={})),function(t){!function(e){var n,i=function(){function i(n,i,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=n,this.context=i instanceof e.ManagedWebGLRenderingContext?i:new e.ManagedWebGLRenderingContext(i),this.twoColorTint=r,this.camera=new e.OrthoCamera(n.width,n.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 i.prototype.begin=function(){this.camera.update(),this.enableRenderer(this.batcher)},i.prototype.drawSkeleton=function(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=-1),void 0===i&&(i=-1),this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=e,this.skeletonRenderer.draw(this.batcher,t,n,i)},i.prototype.drawSkeletonDebug=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=e,this.skeletonDebugRenderer.draw(this.shapes,t,n)},i.prototype.drawTexture=function(t,e,n,i,r,s){void 0===s&&(s=null),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var o=this.QUAD,a=0;o[a++]=e,o[a++]=n,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=0,o[a++]=1,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),o[a++]=e+i,o[a++]=n,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=1,o[a++]=1,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),o[a++]=e+i,o[a++]=n+r,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=1,o[a++]=0,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),o[a++]=e,o[a++]=n+r,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=0,o[a++]=0,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),this.batcher.draw(t,o,this.QUAD_TRIANGLES)},i.prototype.drawTextureUV=function(t,e,n,i,r,s,o,a,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++]=n,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=s,u[c++]=o,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+i,u[c++]=n,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=a,u[c++]=o,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+i,u[c++]=n+r,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=a,u[c++]=h,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e,u[c++]=n+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)},i.prototype.drawTextureRotated=function(e,n,i,r,s,o,a,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,f=n+o,d=i+a,p=-o,v=-a,M=r-o,g=s-a,m=p,x=v,y=p,w=g,E=M,b=g,T=M,A=v,R=0,S=0,C=0,I=0,P=0,L=0,_=0,k=0;if(0!=h){var V=t.MathUtils.cosDeg(h),O=t.MathUtils.sinDeg(h);C=(P=V*E-O*b)+((R=V*m-O*x)-(_=V*y-O*w)),I=(L=O*E+V*b)+((S=O*m+V*x)-(k=O*y+V*w))}else R=m,S=x,_=y,k=w,P=E,L=b,C=T,I=A;R+=f,S+=d,C+=f,I+=d,P+=f,L+=d,_+=f,k+=d;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++]=_,c[D++]=k,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)},i.prototype.drawRegion=function(t,e,n,i,r,s,o){void 0===s&&(s=null),void 0===o&&(o=!1),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var a=this.QUAD,h=0;a[h++]=e,a[h++]=n,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u,a[h++]=t.v2,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),a[h++]=e+i,a[h++]=n,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u2,a[h++]=t.v2,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),a[h++]=e+i,a[h++]=n+r,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u2,a[h++]=t.v,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),a[h++]=e,a[h++]=n+r,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u,a[h++]=t.v,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),this.batcher.draw(t.texture,a,this.QUAD_TRIANGLES)},i.prototype.line=function(t,e,n,i,r,s){void 0===r&&(r=null),void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.line(t,e,n,i,r)},i.prototype.triangle=function(t,e,n,i,r,s,o,a,h,l){void 0===a&&(a=null),void 0===h&&(h=null),void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.triangle(t,e,n,i,r,s,o,a,h,l)},i.prototype.quad=function(t,e,n,i,r,s,o,a,h,l,u,c,f){void 0===l&&(l=null),void 0===u&&(u=null),void 0===c&&(c=null),void 0===f&&(f=null),this.enableRenderer(this.shapes),this.shapes.quad(t,e,n,i,r,s,o,a,h,l,u,c,f)},i.prototype.rect=function(t,e,n,i,r,s){void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.rect(t,e,n,i,r,s)},i.prototype.rectLine=function(t,e,n,i,r,s,o){void 0===o&&(o=null),this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,n,i,r,s,o)},i.prototype.polygon=function(t,e,n,i){void 0===i&&(i=null),this.enableRenderer(this.shapes),this.shapes.polygon(t,e,n,i)},i.prototype.circle=function(t,e,n,i,r,s){void 0===r&&(r=null),void 0===s&&(s=0),this.enableRenderer(this.shapes),this.shapes.circle(t,e,n,i,r,s)},i.prototype.curve=function(t,e,n,i,r,s,o,a,h,l){void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.curve(t,e,n,i,r,s,o,a,h,l)},i.prototype.end=function(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null},i.prototype.resize=function(t){var e=this.canvas,i=e.clientWidth,r=e.clientHeight;if(e.width==i&&e.height==r||(e.width=i,e.height=r),this.context.gl.viewport(0,0,e.width,e.height),t===n.Stretch);else if(t===n.Expand)this.camera.setViewport(i,r);else if(t===n.Fit){var s=e.width,o=e.height,a=this.camera.viewportWidth,h=this.camera.viewportHeight,l=h/a10920)throw new Error("Can't have more than 10920 triangles per batch: "+r);this.context=i instanceof e.ManagedWebGLRenderingContext?i:new e.ManagedWebGLRenderingContext(i),this.mesh=new e.Mesh(i,[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 i.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)},i.prototype.setBlendMode=function(t,e){var n=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),n.blendFunc(this.srcBlend,this.dstBlend))},i.prototype.setColor=function(t){this.color.setFromColor(t)},i.prototype.setColorWith=function(t,e,n,i){this.color.set(t,e,n,i)},i.prototype.point=function(t,e,i){void 0===i&&(i=null),this.check(n.Point,1),null===i&&(i=this.color),this.vertex(t,e,i)},i.prototype.line=function(t,e,i,r,s){void 0===s&&(s=null),this.check(n.Line,2);this.mesh.getVertices(),this.vertexIndex;null===s&&(s=this.color),this.vertex(t,e,s),this.vertex(i,r,s)},i.prototype.triangle=function(t,e,i,r,s,o,a,h,l,u){void 0===h&&(h=null),void 0===l&&(l=null),void 0===u&&(u=null),this.check(t?n.Filled:n.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,i,h),this.vertex(r,s,l),this.vertex(o,a,u)):(this.vertex(e,i,h),this.vertex(r,s,l),this.vertex(r,s,h),this.vertex(o,a,l),this.vertex(o,a,h),this.vertex(e,i,l))},i.prototype.quad=function(t,e,i,r,s,o,a,h,l,u,c,f,d){void 0===u&&(u=null),void 0===c&&(c=null),void 0===f&&(f=null),void 0===d&&(d=null),this.check(t?n.Filled:n.Line,3);this.mesh.getVertices(),this.vertexIndex;null===u&&(u=this.color),null===c&&(c=this.color),null===f&&(f=this.color),null===d&&(d=this.color),t?(this.vertex(e,i,u),this.vertex(r,s,c),this.vertex(o,a,f),this.vertex(o,a,f),this.vertex(h,l,d),this.vertex(e,i,u)):(this.vertex(e,i,u),this.vertex(r,s,c),this.vertex(r,s,c),this.vertex(o,a,f),this.vertex(o,a,f),this.vertex(h,l,d),this.vertex(h,l,d),this.vertex(e,i,u))},i.prototype.rect=function(t,e,n,i,r,s){void 0===s&&(s=null),this.quad(t,e,n,e+i,n,e+i,n+r,e,n+r,s,s,s,s)},i.prototype.rectLine=function(t,e,i,r,s,o,a){void 0===a&&(a=null),this.check(t?n.Filled:n.Line,8),null===a&&(a=this.color);var h=this.tmp.set(s-i,e-r);h.normalize(),o*=.5;var l=h.x*o,u=h.y*o;t?(this.vertex(e+l,i+u,a),this.vertex(e-l,i-u,a),this.vertex(r+l,s+u,a),this.vertex(r-l,s-u,a),this.vertex(r+l,s+u,a),this.vertex(e-l,i-u,a)):(this.vertex(e+l,i+u,a),this.vertex(e-l,i-u,a),this.vertex(r+l,s+u,a),this.vertex(r-l,s-u,a),this.vertex(r+l,s+u,a),this.vertex(e+l,i+u,a),this.vertex(r-l,s-u,a),this.vertex(e-l,i-u,a))},i.prototype.x=function(t,e,n){this.line(t-n,e-n,t+n,e+n),this.line(t-n,e+n,t+n,e-n)},i.prototype.polygon=function(t,e,i,r){if(void 0===r&&(r=null),i<3)throw new Error("Polygon must contain at least 3 vertices");this.check(n.Line,2*i),null===r&&(r=this.color);this.mesh.getVertices(),this.vertexIndex;i<<=1;for(var s=t[e<<=1],o=t[e+1],a=e+i,h=e,l=e+i-2;h=a?(f=s,d=o):(f=t[h+2],d=t[h+3]),this.vertex(u,c,r),this.vertex(f,d,r)}},i.prototype.circle=function(e,i,r,s,o,a){if(void 0===o&&(o=null),void 0===a&&(a=0),0===a&&(a=Math.max(1,6*t.MathUtils.cbrt(s)|0)),a<=0)throw new Error("segments must be > 0.");null===o&&(o=this.color);var h=2*t.MathUtils.PI/a,l=Math.cos(h),u=Math.sin(h),c=s,f=0;if(e){this.check(n.Filled,3*a+3),a--;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(a,h,u)},i.prototype.vertex=function(t,e,n){var i=this.vertexIndex,r=this.mesh.getVertices();r[i++]=t,r[i++]=e,r[i++]=n.r,r[i++]=n.g,r[i++]=n.b,r[i++]=n.a,this.vertexIndex=i},i.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},i.prototype.flush=function(){0!=this.vertexIndex&&(this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0)},i.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!=f.parent){var d=s+f.data.length*f.a+f.worldX,p=o+f.data.length*f.c+f.worldY;e.rectLine(!0,s+f.worldX,o+f.worldY,d,p,this.boneWidth*this.scale)}}this.drawSkeletonXY&&e.x(s,o,4*this.scale)}if(this.drawRegionAttachments){e.setColor(this.attachmentLineColor);for(u=0,c=(z=i.slots).length;u0){e.setColor(this.attachmentLineColor);var A=M[(x=2*(x>>1))-2],R=M[x-1];for(y=0,w=x;y-1||e.circle(!0,s+f.worldX,o+f.worldY,3*this.scale,n.GREEN,8)}}if(this.drawClipping){var z=i.slots;e.setColor(this.clipColor);for(u=0,c=z.length;u=0&&s==R.data.index&&(E=!0),E){o>=0&&o==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),g=i.QUAD_TRIANGLES,M=I.uvs,C=I.region.renderObject.texture,x=I.color}else{if(!(S instanceof t.MeshAttachment)){if(S instanceof t.ClippingAttachment){var P=S;a.clipStart(R,P);continue}a.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),g=L.triangles,C=L.region.renderObject.texture,M=L.uvs,x=L.color}if(null!=C){var _=R.color,k=this.tempColor;k.r=y.r*_.r*x.r,k.g=y.g*_.g*x.g,k.b=y.b*_.b*x.b,k.a=y.a*_.a*x.a,h&&(k.r*=k.a,k.g*=k.a,k.b*=k.a);var V=this.tempColor2;null==R.darkColor?V.set(0,0,0,1):(h?(V.r=R.darkColor.r*k.a,V.g=R.darkColor.g*k.a,V.b=R.darkColor.b*k.a):V.setFromColor(R.darkColor),V.a=h?1:0);var O=R.data.blendMode;if(O!=u&&(u=O,n.setBlendMode(e.WebGLBlendModeConverter.getSourceGLBlendMode(u,h),e.WebGLBlendModeConverter.getDestGLBlendMode(u))),a.isClipping()){a.clipTriangles(v.vertices,v.numFloats,g,g.length,M,k,V,l);var D=new Float32Array(a.clippedVertices),F=a.clippedTriangles;if(null!=this.vertexEffect){var N=this.vertexEffect,X=D;if(l){Y=0;for(var U=D.length;Y-1&&this.restorables.splice(e,1)},t}();e.ManagedWebGLRenderingContext=n;var i=function(){function e(){}return e.getDestGLBlendMode=function(n){switch(n){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: "+n)}},e.getSourceGLBlendMode=function(n,i){switch(void 0===i&&(i=!1),n){case t.BlendMode.Normal:case t.BlendMode.Additive:return i?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: "+n)}},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=i}(t.webgl||(t.webgl={}))}(i||(i={})),t.exports=i}).call(window)},function(t,e,n){var i=n(0),r=n(4),s=n(169),o=n(2),a=n(183),h=n(184),l=n(185),u=new i({Extends:h,initialize:function(t,e,n,i,s,u,c){var f,d,p,v=[],M=t.cacheManager.custom.spine;if(o(e)){var g=e;for(e=r(g,"key"),d=new a(t,{key:e,url:r(g,"jsonURL"),extension:r(g,"jsonExtension","json"),xhrSettings:r(g,"jsonXhrSettings")}),i=r(g,"atlasURL"),s=r(g,"preMultipliedAlpha"),Array.isArray(i)||(i=[i]),f=0;f>16&255)/255,i=(t>>8&255)/255,r=(255&t)/255,s=t>16777215?(t>>>24)/255:null,o=this.skeleton;if(e){var a=this.findSlot(e);a&&(o=a)}return o.color.r=n,o.color.g=i,o.color.b=r,null!==s&&(o.color.a=s),this},setSkeletonFromJSON:function(t,e,n,i){return this.setSkeleton(t,e,n,i)},setSkeleton:function(t,e,n,i){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,i);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkinByName("default"),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,n),this.root=this.getRootBone(),this.root&&(this.root.rotation=v(f(this.rotation))+90),this.state.apply(s),s.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=v(f(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,n,i){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===n&&(n=0),void 0===i&&(i=0),this.width=t,this.height=e,this.displayOriginX=r.x-n,this.displayOriginY=r.y-i,this},setOffset:function(t,e){var n=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=n.x-t,this.displayOriginY=n.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,n=this.scaleX,i=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=n,t.scaleY=i,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 n=0;n0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):i||s?r.TAU-(s>0?Math.acos(-i/this.scaleY):-Math.acos(i/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 n=this.matrix;return n[4]=n[0]*t+n[2]*e+n[4],n[5]=n[1]*t+n[3]*e+n[5],this},scale:function(t,e){var n=this.matrix;return n[0]*=t,n[1]*=t,n[2]*=e,n[3]*=e,this},rotate:function(t){var e=Math.sin(t),n=Math.cos(t),i=this.matrix,r=i[0],s=i[1],o=i[2],a=i[3];return i[0]=r*n+o*e,i[1]=s*n+a*e,i[2]=r*-e+o*n,i[3]=s*-e+a*n,this},multiply:function(t,e){var n=this.matrix,i=t.matrix,r=n[0],s=n[1],o=n[2],a=n[3],h=n[4],l=n[5],u=i[0],c=i[1],f=i[2],d=i[3],p=i[4],v=i[5],M=void 0===e?this:e;return M.a=u*r+c*o,M.b=u*s+c*a,M.c=f*r+d*o,M.d=f*s+d*a,M.e=p*r+v*o+h,M.f=p*s+v*a+l,M},multiplyWithOffset:function(t,e,n){var i=this.matrix,r=t.matrix,s=i[0],o=i[1],a=i[2],h=i[3],l=e*s+n*a+i[4],u=e*o+n*h+i[5],c=r[0],f=r[1],d=r[2],p=r[3],v=r[4],M=r[5];return i[0]=c*s+f*a,i[1]=c*o+f*h,i[2]=d*s+p*a,i[3]=d*o+p*h,i[4]=v*s+M*a+l,i[5]=v*o+M*h+u,this},transform:function(t,e,n,i,r,s){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],f=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=n*a+i*l,o[3]=n*h+i*u,o[4]=r*a+s*l+c,o[5]=r*h+s*u+f,this},transformPoint:function(t,e,n){void 0===n&&(n={x:0,y:0});var i=this.matrix,r=i[0],s=i[1],o=i[2],a=i[3],h=i[4],l=i[5];return n.x=t*r+e*o+h,n.y=t*s+e*a+l,n},invert:function(){var t=this.matrix,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=e*r-n*i;return t[0]=r/a,t[1]=-n/a,t[2]=-i/a,t[3]=e/a,t[4]=(i*o-r*s)/a,t[5]=-(e*o-n*s)/a,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,n,i,r,s){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o[4]=r,o[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,n=e[0],i=e[1],r=e[2],s=e[3],o=n*s-i*r;if(t.translateX=e[4],t.translateY=e[5],n||i){var a=Math.sqrt(n*n+i*i);t.rotation=i>0?Math.acos(n/a):-Math.acos(n/a),t.scaleX=a,t.scaleY=o/a}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=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,n,i,r){var s=this.matrix,o=Math.sin(n),a=Math.cos(n);return s[4]=t,s[5]=e,s[0]=a*i,s[1]=o*i,s[2]=-o*r,s[3]=a*r,this},applyInverse:function(t,e,n){void 0===n&&(n=new s);var i=this.matrix,r=i[0],o=i[1],a=i[2],h=i[3],l=i[4],u=i[5],c=1/(r*h+a*-o);return n.x=h*c*t+-a*c*e+(u*a-l*h)*c,n.y=r*c*e+-o*c*t+(-u*r+l*o)*c,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},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.decomposedMatrix=null}});t.exports=o},function(t,e){var n={_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=n},function(t,e,n){var i=n(0),r=n(195),s=n(196),o=n(202),a=n(203),h=new i({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,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,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},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,n){return this.scene.sys.input.enable(this,t,e,n),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,n=[];e&&(n.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return n.unshift(this.scene.sys.displayList.getIndex(t)),n},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.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),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});h.RENDER_MASK=15,t.exports=h},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,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,n){var i=n(0),r=n(197),s=new i({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("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var n=[],i=0;i + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var Events = __webpack_require__(/*! ./events */ "../../../src/data/events/index.js"); + +/** + * @callback DataEachCallback + * + * @param {*} parent - The parent object of the DataManager. + * @param {string} key - The key of the value. + * @param {*} value - The value. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + */ + +/** + * @classdesc + * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + * + * @class DataManager + * @memberof Phaser.Data + * @constructor + * @since 3.0.0 + * + * @param {object} parent - The object that this DataManager belongs to. + * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter. + */ +var DataManager = new Class({ + + initialize: + + function DataManager (parent, eventEmitter) + { + /** + * The object that this DataManager belongs to. + * + * @name Phaser.Data.DataManager#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The DataManager's event emitter. + * + * @name Phaser.Data.DataManager#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = eventEmitter; + + if (!eventEmitter) + { + this.events = (parent.events) ? parent.events : parent; + } + + /** + * The data list. + * + * @name Phaser.Data.DataManager#list + * @type {Object.} + * @default {} + * @since 3.0.0 + */ + this.list = {}; + + /** + * The public values list. You can use this to access anything you have stored + * in this Data Manager. For example, if you set a value called `gold` you can + * access it via: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also modify it directly: + * + * ```javascript + * this.data.values.gold += 1000; + * ``` + * + * Doing so will emit a `setdata` event from the parent of this Data Manager. + * + * Do not modify this object directly. Adding properties directly to this object will not + * emit any events. Always use `DataManager.set` to create new items the first time around. + * + * @name Phaser.Data.DataManager#values + * @type {Object.} + * @default {} + * @since 3.10.0 + */ + this.values = {}; + + /** + * Whether setting data is frozen for this DataManager. + * + * @name Phaser.Data.DataManager#_frozen + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._frozen = false; + + if (!parent.hasOwnProperty('sys') && this.events) + { + this.events.once('destroy', this.destroy, this); + } + }, + + /** + * Retrieves the value for the given key, 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 + * this.data.get('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * this.data.get([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.Data.DataManager#get + * @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. + */ + get: function (key) + { + var list = this.list; + + if (Array.isArray(key)) + { + var output = []; + + for (var i = 0; i < key.length; i++) + { + output.push(list[key[i]]); + } + + return output; + } + else + { + return list[key]; + } + }, + + /** + * Retrieves all data values in a new object. + * + * @method Phaser.Data.DataManager#getAll + * @since 3.0.0 + * + * @return {Object.} All data values. + */ + getAll: function () + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Queries the DataManager for the values of keys matching the given regular expression. + * + * @method Phaser.Data.DataManager#query + * @since 3.0.0 + * + * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). + * + * @return {Object.} The values of the keys matching the search string. + */ + query: function (search) + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key) && key.match(search)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * data.set('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `get`: + * + * ```javascript + * data.get('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted. + * + * 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.Data.DataManager#set + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @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. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + set: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (typeof key === 'string') + { + return this.setValue(key, data); + } + else + { + for (var entry in key) + { + this.setValue(entry, key[entry]); + } + } + + return this; + }, + + /** + * Internal value setter, called automatically by the `set` method. + * + * @method Phaser.Data.DataManager#setValue + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @private + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * @param {*} data - The value to set. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setValue: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (this.has(key)) + { + // Hit the key getter, which will in turn emit the events. + this.values[key] = data; + } + else + { + var _this = this; + var list = this.list; + var events = this.events; + var parent = this.parent; + + Object.defineProperty(this.values, key, { + + enumerable: true, + + configurable: true, + + get: function () + { + return list[key]; + }, + + set: function (value) + { + if (!_this._frozen) + { + var previousValue = list[key]; + list[key] = value; + + events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); + events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); + } + } + + }); + + list[key] = data; + + events.emit(Events.SET_DATA, parent, key, data); + } + + return this; + }, + + /** + * Passes all data entries to the given callback. + * + * @method Phaser.Data.DataManager#each + * @since 3.0.0 + * + * @param {DataEachCallback} callback - The function to call. + * @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 {Phaser.Data.DataManager} This DataManager object. + */ + each: function (callback, context) + { + var args = [ this.parent, null, undefined ]; + + for (var i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (var key in this.list) + { + args[1] = key; + args[2] = this.list[key]; + + callback.apply(context, args); + } + + return this; + }, + + /** + * Merge the given object of key value pairs into this DataManager. + * + * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) + * will emit a `changedata` event. + * + * @method Phaser.Data.DataManager#merge + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {Object.} data - The data to merge. + * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + merge: function (data, overwrite) + { + if (overwrite === undefined) { overwrite = true; } + + // Merge data from another component into this one + for (var key in data) + { + if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) + { + this.setValue(key, data[key]); + } + } + + return this; + }, + + /** + * Remove the value for the given key. + * + * If the key is found in this Data Manager it is removed from the internal lists and a + * `removedata` event is emitted. + * + * You can also pass in an array of keys, in which case all keys in the array will be removed: + * + * ```javascript + * this.data.remove([ 'gold', 'armor', 'health' ]); + * ``` + * + * @method Phaser.Data.DataManager#remove + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {(string|string[])} key - The key to remove, or an array of keys to remove. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + remove: function (key) + { + if (this._frozen) + { + return this; + } + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + this.removeValue(key[i]); + } + } + else + { + return this.removeValue(key); + } + + return this; + }, + + /** + * Internal value remover, called automatically by the `remove` method. + * + * @method Phaser.Data.DataManager#removeValue + * @private + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + removeValue: function (key) + { + if (this.has(key)) + { + var data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return this; + }, + + /** + * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. + * + * @method Phaser.Data.DataManager#pop + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {string} key - The key of the value to retrieve and delete. + * + * @return {*} The value of the given key. + */ + pop: function (key) + { + var data = undefined; + + if (!this._frozen && this.has(key)) + { + data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return data; + }, + + /** + * Determines whether the given key is set in this Data Manager. + * + * Please note that the 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.Data.DataManager#has + * @since 3.0.0 + * + * @param {string} key - The key to check. + * + * @return {boolean} Returns `true` if the key exists, otherwise `false`. + */ + has: function (key) + { + return this.list.hasOwnProperty(key); + }, + + /** + * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts + * to create new values or update existing ones. + * + * @method Phaser.Data.DataManager#setFreeze + * @since 3.0.0 + * + * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setFreeze: function (value) + { + this._frozen = value; + + return this; + }, + + /** + * Delete all data in this Data Manager and unfreeze it. + * + * @method Phaser.Data.DataManager#reset + * @since 3.0.0 + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + reset: function () + { + for (var key in this.list) + { + delete this.list[key]; + delete this.values[key]; + } + + this._frozen = false; + + return this; + }, + + /** + * Destroy this data manager. + * + * @method Phaser.Data.DataManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.reset(); + + this.events.off(Events.CHANGE_DATA); + this.events.off(Events.SET_DATA); + this.events.off(Events.REMOVE_DATA); + + this.parent = null; + }, + + /** + * Gets or sets the frozen state of this Data Manager. + * A frozen Data Manager will block all attempts to create new values or update existing ones. + * + * @name Phaser.Data.DataManager#freeze + * @type {boolean} + * @since 3.0.0 + */ + freeze: { + + get: function () + { + return this._frozen; + }, + + set: function (value) + { + this._frozen = (value) ? true : false; + } + + }, + + /** + * Return the total number of entries in this Data Manager. + * + * @name Phaser.Data.DataManager#count + * @type {integer} + * @since 3.0.0 + */ + count: { + + get: function () + { + var i = 0; + + for (var key in this.list) + { + if (this.list[key] !== undefined) + { + i++; + } + } + + return i; + } + + } + +}); + +module.exports = DataManager; + + +/***/ }), + +/***/ "../../../src/data/events/CHANGE_DATA_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/CHANGE_DATA_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`. + * + * This event is dispatched for all items that change in the Data Manager. + * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. + * + * @event Phaser.Data.Events#CHANGE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The new value of the item in the Data Manager. + * @param {any} previousValue - The previous value of the item in the Data Manager. + */ +module.exports = 'changedata'; + + +/***/ }), + +/***/ "../../../src/data/events/CHANGE_DATA_KEY_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Key Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`, + * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` + * then you can listen for `sprite.data.on('changedata-gold')`. + * + * @event Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.16.1 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'changedata-'; + + +/***/ }), + +/***/ "../../../src/data/events/REMOVE_DATA_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/REMOVE_DATA_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Remove Data Event. + * + * This event is dispatched by a Data Manager when an item is removed from it. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`. + * + * @event Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'removedata'; + + +/***/ }), + +/***/ "../../../src/data/events/SET_DATA_EVENT.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/SET_DATA_EVENT.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Set Data Event. + * + * This event is dispatched by a Data Manager when a new item is added to the data store. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`. + * + * @event Phaser.Data.Events#SET_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'setdata'; + + +/***/ }), + +/***/ "../../../src/data/events/index.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/index.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Data.Events + */ + +module.exports = { + + CHANGE_DATA: __webpack_require__(/*! ./CHANGE_DATA_EVENT */ "../../../src/data/events/CHANGE_DATA_EVENT.js"), + CHANGE_DATA_KEY: __webpack_require__(/*! ./CHANGE_DATA_KEY_EVENT */ "../../../src/data/events/CHANGE_DATA_KEY_EVENT.js"), + REMOVE_DATA: __webpack_require__(/*! ./REMOVE_DATA_EVENT */ "../../../src/data/events/REMOVE_DATA_EVENT.js"), + SET_DATA: __webpack_require__(/*! ./SET_DATA_EVENT */ "../../../src/data/events/SET_DATA_EVENT.js") + +}; + + +/***/ }), + +/***/ "../../../src/gameobjects/BuildGameObject.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/BuildGameObject.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(/*! ../renderer/BlendModes */ "../../../src/renderer/BlendModes.js"); +var GetAdvancedValue = __webpack_require__(/*! ../utils/object/GetAdvancedValue */ "../../../src/utils/object/GetAdvancedValue.js"); +var ScaleModes = __webpack_require__(/*! ../renderer/ScaleModes */ "../../../src/renderer/ScaleModes.js"); + +/** + * 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); + } + + // ScaleMode + + gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT); + + // 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/GameObject.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/GameObject.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var ComponentsToJSON = __webpack_require__(/*! ./components/ToJSON */ "../../../src/gameobjects/components/ToJSON.js"); +var DataManager = __webpack_require__(/*! ../data/DataManager */ "../../../src/data/DataManager.js"); +var EventEmitter = __webpack_require__(/*! eventemitter3 */ "../../../node_modules/eventemitter3/index.js"); +var Events = __webpack_require__(/*! ./events */ "../../../src/gameobjects/events/index.js"); + +/** + * @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); + + /** + * The Scene to which this Game Object belongs. + * Game Objects can only belong to one Scene. + * + * @name Phaser.GameObjects.GameObject#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * 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 move 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 {(integer|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 {integer} + * @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 {integer} + * @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 physics then this property will contain a reference to a Physics Body. + * + * @name Phaser.GameObjects.GameObject#body + * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)} + * @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; + + // 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 {(integer|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 + * + * @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; + }, + + /** + * 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. + * + * @method Phaser.GameObjects.GameObject#setInteractive + * @since 3.0.0 + * + * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. 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 (shape, callback, dropZone) + { + this.scene.sys.input.enable(this, shape, callback, 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 () + { + if (this.input) + { + this.input.enabled = false; + } + + 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; + }, + + /** + * 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) + { + return !(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 {integer[]} 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), parent.name]); + indexes.unshift(parent.getIndex(child)); + + child = parent; + + if (!parent.parentContainer) + { + break; + } + else + { + parent = parent.parentContainer; + } + } + + // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']); + indexes.unshift(this.scene.sys.displayList.getIndex(child)); + + return indexes; + }, + + /** + * 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] - Is this Game Object being destroyed as the result of a Scene shutdown? + */ + destroy: function (fromScene) + { + if (fromScene === undefined) { fromScene = false; } + + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + if (this.preDestroy) + { + this.preDestroy.call(this); + } + + this.emit(Events.DESTROY, this); + + var sys = this.scene.sys; + + if (!fromScene) + { + sys.displayList.remove(this); + sys.updateList.remove(this); + } + + if (this.input) + { + 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; + } + + // Tell the Scene to re-sort the children + if (!fromScene) + { + sys.queueDepthSort(); + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + + this.parentContainer = undefined; + + this.removeAllListeners(); + } + +}); + +/** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + * + * @constant {integer} RENDER_MASK + * @memberof Phaser.GameObjects.GameObject + * @default + */ +GameObject.RENDER_MASK = 15; + +module.exports = GameObject; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/ComputedSize.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/ComputedSize.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Depth.js": +/*!**************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Depth.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * 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 depth starts from zero (the default value) and increases from that point. 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) + { + this.scene.sys.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 depth starts from zero (the default value) and increases from that point. 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 {integer} value - The depth of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Flip.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Flip.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/ScrollFactor.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/ScrollFactor.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/ToJSON.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/ToJSON.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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, + scaleMode: gameObject.scaleMode, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Transform.js": +/*!******************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Transform.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(/*! ../../math/const */ "../../../src/math/const.js"); +var TransformMatrix = __webpack_require__(/*! ./TransformMatrix */ "../../../src/gameobjects/components/TransformMatrix.js"); +var WrapAngle = __webpack_require__(/*! ../../math/angle/Wrap */ "../../../src/math/angle/Wrap.js"); +var WrapAngleDegrees = __webpack_require__(/*! ../../math/angle/WrapDegrees */ "../../../src/math/angle/WrapDegrees.js"); + +// 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 = { + + /** + * 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: Do not use this value to set the z-index, instead see the `depth` property. + * + * @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 {integer} + * @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, 90 is down, 180/-180 is left + * and -90 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; + }, + + /** + * 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. + * + * @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; + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/TransformMatrix.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/TransformMatrix.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var MATH_CONST = __webpack_require__(/*! ../../math/const */ "../../../src/math/const.js"); +var Vector2 = __webpack_require__(/*! ../../math/Vector2 */ "../../../src/math/Vector2.js"); + +/** + * @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 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 {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) ? this : out; + + destinationMatrix.a = (sourceA * localA) + (sourceB * localC); + destinationMatrix.b = (sourceA * localB) + (sourceB * localD); + destinationMatrix.c = (sourceC * localA) + (sourceD * localC); + destinationMatrix.d = (sourceC * localB) + (sourceD * localD); + destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE; + destinationMatrix.f = (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 using 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.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates. + * + * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} 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; + }, + + /** + * 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 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.decomposedMatrix = null; + } + +}); + +module.exports = TransformMatrix; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Visible.js": +/*!****************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Visible.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/events/DESTROY_EVENT.js": +/*!******************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/events/DESTROY_EVENT.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Destroy Event. + * + * 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 + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. + */ +module.exports = 'destroy'; + + +/***/ }), + +/***/ "../../../src/gameobjects/events/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/events/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ "../../../src/gameobjects/events/DESTROY_EVENT.js") }; + + +/***/ }), + +/***/ "../../../src/loader/File.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/loader/File.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ./const */ "../../../src/loader/const.js"); +var Events = __webpack_require__(/*! ./events */ "../../../src/loader/events/index.js"); +var GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var GetURL = __webpack_require__(/*! ./GetURL */ "../../../src/loader/GetURL.js"); +var MergeXHRSettings = __webpack_require__(/*! ./MergeXHRSettings */ "../../../src/loader/MergeXHRSettings.js"); +var XHRLoader = __webpack_require__(/*! ./XHRLoader */ "../../../src/loader/XHRLoader.js"); +var XHRSettings = __webpack_require__(/*! ./XHRSettings */ "../../../src/loader/XHRSettings.js"); + +/** + * @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); + + /** + * 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.type || !this.key) + { + throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + } + + /** + * The URL of the file, not including baseURL. + * Automatically has Loader.path prepended to it. + * + * @name Phaser.Loader.File#url + * @type {string} + * @since 3.0.0 + */ + this.url = GetFastValue(fileConfig, 'url'); + + if (this.url === undefined) + { + this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof(this.url) !== 'function') + { + this.url = loader.path + this.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 {integer} + * @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.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 localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && 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.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 () + { + 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.cache.add(this.key, this.data); + } + + this.pendingDestroy(); + }, + + /** + * 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 (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); + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/loader/FileTypesManager.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/FileTypesManager.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/loader/GetURL.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/loader/GetURL.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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:|http:\/\/|https:\/\/|\/\/)/)) + { + return file.url; + } + else + { + return baseURL + file.url; + } +}; + +module.exports = GetURL; + + +/***/ }), + +/***/ "../../../src/loader/MergeXHRSettings.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/MergeXHRSettings.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(/*! ../utils/object/Extend */ "../../../src/utils/object/Extend.js"); +var XHRSettings = __webpack_require__(/*! ./XHRSettings */ "../../../src/loader/XHRSettings.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/loader/MultiFile.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/MultiFile.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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) + { + /** + * 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; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = files; + + /** + * 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 {integer} + * @since 3.7.0 + */ + + this.pending = files.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {integer} + * @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 = {}; + + // Link the files + for (var i = 0; i < files.length; i++) + { + files[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++; + } + } + +}); + +module.exports = MultiFile; + + +/***/ }), + +/***/ "../../../src/loader/XHRLoader.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/XHRLoader.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(/*! ./MergeXHRSettings */ "../../../src/loader/MergeXHRSettings.js"); + +/** + * 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.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); + } + + // 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; + + +/***/ }), + +/***/ "../../../src/loader/XHRSettings.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/XHRSettings.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [timeout=0] - Optional XHR timeout value. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + */ +var XHRSettings = function (responseType, async, user, password, timeout) +{ + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } + + // 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 + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined + + }; +}; + +module.exports = XHRSettings; + + +/***/ }), + +/***/ "../../../src/loader/const.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/loader/const.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {integer} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {integer} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {integer} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started + * + * @name Phaser.Loader.FILE_PENDING + * @type {integer} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing + * + * @name Phaser.Loader.FILE_LOADED + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load + * + * @name Phaser.Loader.FILE_FAILED + * @type {integer} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {integer} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {integer} + * @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 {integer} + * @since 3.0.0 + */ + FILE_POPULATED: 19 + +}; + +module.exports = FILE_CONST; + + +/***/ }), + +/***/ "../../../src/loader/events/ADD_EVENT.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/ADD_EVENT.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), + +/***/ "../../../src/loader/events/COMPLETE_EVENT.js": +/*!**************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/COMPLETE_EVENT.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {integer} totalComplete - The total number of files that successfully loaded. + * @param {integer} totalFailed - The total number of files that failed to load. + */ +module.exports = 'complete'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_COMPLETE_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_COMPLETE_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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)`. + * + * 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 + * @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. + */ +module.exports = 'filecomplete'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_KEY_COMPLETE_EVENT.js": +/*!***********************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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-atlas-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 + * }); + * ``` + * + * 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 + * @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. + */ +module.exports = 'filecomplete-'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_LOAD_ERROR_EVENT.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + */ +module.exports = 'loaderror'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_LOAD_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_LOAD_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + */ +module.exports = 'load'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_PROGRESS_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_PROGRESS_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), + +/***/ "../../../src/loader/events/POST_PROCESS_EVENT.js": +/*!******************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/POST_PROCESS_EVENT.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'postprocess'; + + +/***/ }), + +/***/ "../../../src/loader/events/PROGRESS_EVENT.js": +/*!**************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/PROGRESS_EVENT.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {number} progress - The current progress of the load. A value between 0 and 1. + */ +module.exports = 'progress'; + + +/***/ }), + +/***/ "../../../src/loader/events/START_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/START_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'start'; + + +/***/ }), + +/***/ "../../../src/loader/events/index.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/index.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Loader.Events + */ + +module.exports = { + + ADD: __webpack_require__(/*! ./ADD_EVENT */ "../../../src/loader/events/ADD_EVENT.js"), + COMPLETE: __webpack_require__(/*! ./COMPLETE_EVENT */ "../../../src/loader/events/COMPLETE_EVENT.js"), + FILE_COMPLETE: __webpack_require__(/*! ./FILE_COMPLETE_EVENT */ "../../../src/loader/events/FILE_COMPLETE_EVENT.js"), + FILE_KEY_COMPLETE: __webpack_require__(/*! ./FILE_KEY_COMPLETE_EVENT */ "../../../src/loader/events/FILE_KEY_COMPLETE_EVENT.js"), + FILE_LOAD_ERROR: __webpack_require__(/*! ./FILE_LOAD_ERROR_EVENT */ "../../../src/loader/events/FILE_LOAD_ERROR_EVENT.js"), + FILE_LOAD: __webpack_require__(/*! ./FILE_LOAD_EVENT */ "../../../src/loader/events/FILE_LOAD_EVENT.js"), + FILE_PROGRESS: __webpack_require__(/*! ./FILE_PROGRESS_EVENT */ "../../../src/loader/events/FILE_PROGRESS_EVENT.js"), + POST_PROCESS: __webpack_require__(/*! ./POST_PROCESS_EVENT */ "../../../src/loader/events/POST_PROCESS_EVENT.js"), + PROGRESS: __webpack_require__(/*! ./PROGRESS_EVENT */ "../../../src/loader/events/PROGRESS_EVENT.js"), + START: __webpack_require__(/*! ./START_EVENT */ "../../../src/loader/events/START_EVENT.js") + +}; + + +/***/ }), + +/***/ "../../../src/loader/filetypes/ImageFile.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/filetypes/ImageFile.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); +var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); +var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); +var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +/** + * @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); + } + }, + + /** + * 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'); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture; + var linkFile = this.linkFile; + + if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + { + if (this.type === 'image') + { + texture = this.cache.addImage(this.key, this.data, linkFile.data); + } + else + { + texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); + } + + this.pendingDestroy(texture); + + linkFile.pendingDestroy(texture); + } + else if (!linkFile) + { + texture = this.cache.addImage(this.key, this.data); + + this.pendingDestroy(texture); + } + } + +}); + +/** + * 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. + * + * 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#addFileEvent + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), + +/***/ "../../../src/loader/filetypes/JSONFile.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/filetypes/JSONFile.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); +var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); +var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); +var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ "../../../src/utils/object/GetValue.js"); +var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +/** + * @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 {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". + * @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); + + if (IsPlainObject(url)) + { + // Object provided instead of a URL, so no need to actually load it (populate data with value) + 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; + + var json = JSON.parse(this.xhrLoader.responseText); + + 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#addFileEvent + * @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 {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". + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), + +/***/ "../../../src/loader/filetypes/TextFile.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/filetypes/TextFile.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); +var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); +var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); +var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +/** + * @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 extension = 'txt'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'text', + cache: loader.cacheManager.text, + 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#addFileEvent + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), + +/***/ "../../../src/math/Average.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Average.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Bernstein.js": +/*!************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Bernstein.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Factorial = __webpack_require__(/*! ./Factorial */ "../../../src/math/Factorial.js"); + +/** + * [description] + * + * @function Phaser.Math.Bernstein + * @since 3.0.0 + * + * @param {number} n - [description] + * @param {number} i - [description] + * + * @return {number} [description] + */ +var Bernstein = function (n, i) +{ + return Factorial(n) / Factorial(i) / Factorial(n - i); +}; + +module.exports = Bernstein; + + +/***/ }), + +/***/ "../../../src/math/Between.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Between.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} min - The minimum value. + * @param {integer} max - The maximum value. + * + * @return {integer} The random integer. + */ +var Between = function (min, max) +{ + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +module.exports = Between; + + +/***/ }), + +/***/ "../../../src/math/CatmullRom.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/CatmullRom.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a Catmull-Rom value. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - [description] + * @param {number} p0 - [description] + * @param {number} p1 - [description] + * @param {number} p2 - [description] + * @param {number} p3 - [description] + * + * @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; + + +/***/ }), + +/***/ "../../../src/math/CeilTo.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/CeilTo.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [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; + + +/***/ }), + +/***/ "../../../src/math/Clamp.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Clamp.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/DegToRad.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/DegToRad.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); + +/** + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {integer} 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; + + +/***/ }), + +/***/ "../../../src/math/Difference.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Difference.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Factorial.js": +/*!************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Factorial.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/FloatBetween.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/FloatBetween.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/FloorTo.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/FloorTo.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. + * @param {integer} [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; + + +/***/ }), + +/***/ "../../../src/math/FromPercent.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/FromPercent.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(/*! ./Clamp */ "../../../src/math/Clamp.js"); + +/** + * 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; +}; + +module.exports = FromPercent; + + +/***/ }), + +/***/ "../../../src/math/GetSpeed.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/GetSpeed.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the speed required to cover a distance in the time given. + * + * @function Phaser.Math.GetSpeed + * @since 3.0.0 + * + * @param {number} distance - The distance to travel in pixels. + * @param {integer} time - The time, in ms, to cover the distance in. + * + * @return {number} The amount you will need to increment the position by each step in order to cover the distance in the time given. + */ +var GetSpeed = function (distance, time) +{ + return (distance / time) / 1000; +}; + +module.exports = GetSpeed; + + +/***/ }), + +/***/ "../../../src/math/IsEven.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/IsEven.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/IsEvenStrict.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/IsEvenStrict.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Linear.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Linear.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Matrix3.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Matrix3.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - [description] + * + * @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; + + +/***/ }), + +/***/ "../../../src/math/Matrix4.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Matrix4.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * @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); + }, + + // TODO - Should work with basic values + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + 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]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + 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]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * 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 () + { + var out = this.val; + + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 0; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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 null; + } + + det = 1 / det; + + a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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]; + + a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); + a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); + a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); + a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); + a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); + a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); + a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); + a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - [description] + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = []; + var m1 = this.val; + var m2 = src.val; + + a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; + a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; + a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; + a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; + + a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; + a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; + a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; + a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; + + a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; + a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; + a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; + a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; + + a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; + a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; + a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; + a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; + + return this.fromArray(a); + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + translate: function (v) + { + var x = v.x; + var y = v.y; + var z = v.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; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + scale: function (v) + { + var x = v.x; + var y = v.y; + var z = v.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; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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; + + this.fromArray([ + 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 + ]); + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 null; + } + + 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]; + + // 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 + a[0] = a00 * b00 + a10 * b01 + a20 * b02; + a[1] = a01 * b00 + a11 * b01 + a21 * b02; + a[2] = a02 * b00 + a12 * b01 + a22 * b02; + a[3] = a03 * b00 + a13 * b01 + a23 * b02; + a[4] = a00 * b10 + a10 * b11 + a20 * b12; + a[5] = a01 * b10 + a11 * b11 + a21 * b12; + a[6] = a02 * b10 + a12 * b11 + a22 * b12; + a[7] = a03 * b10 + a13 * b11 + a23 * b12; + a[8] = a00 * b20 + a10 * b21 + a20 * b22; + a[9] = a01 * b20 + a11 * b21 + a21 * b22; + a[10] = a02 * b20 + a12 * b21 + a22 * b22; + a[11] = a03 * b20 + a13 * b21 + a23 * b22; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var out = this.val; + + 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; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = v.x; + out[13] = v.y; + out[14] = v.z; + out[15] = 1; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + fromQuat: function (q) + { + var out = this.val; + + 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; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var out = this.val; + + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + out[0] = (near * 2) * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (near * 2) * tb; + out[6] = 0; + out[7] = 0; + + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (far * near * 2) * nf; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var out = this.val; + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (2 * far * near) * nf; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + var out = this.val; + + out[0] = (2 * near) / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (2 * near) / height; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = -far / (near - far); + out[11] = 1; + + out[12] = 0; + out[13] = 0; + out[14] = (near * far) / (near - far); + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var out = this.val; + 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; + + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + + 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 {Phaser.Math.Matrix4} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var out = this.val; + + 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; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + + return this; + }, + + /** + * 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 - [description] + * @param {number} pitch - [description] + * @param {number} roll - [description] + * + * @return {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 !== undefined) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix !== undefined) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + } + +}); + +var _tempMat1 = new Matrix4(); +var _tempMat2 = new Matrix4(); + +module.exports = Matrix4; + + +/***/ }), + +/***/ "../../../src/math/MaxAdd.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/MaxAdd.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/MinSub.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/MinSub.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Percent.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Percent.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Quaternion.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Quaternion.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var Vector3 = __webpack_require__(/*! ./Vector3 */ "../../../src/math/Vector3.js"); +var Matrix3 = __webpack_require__(/*! ./Matrix3 */ "../../../src/math/Matrix3.js"); + +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] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + * @param {number} [w] - 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 + * @since 3.0.0 + */ + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.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; + } + }, + + /** + * 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) + { + this.x = src.x; + this.y = src.y; + this.z = src.z; + this.w = src.w; + + return this; + }, + + /** + * Set the components of this Quaternion. + * + * @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. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + 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 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; + + 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; + + 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; + + 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; + } + + 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; + + 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Quaternion#rotationTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - [description] + * @param {Phaser.Math.Vector3} b - [description] + * + * @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) + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + } + 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 () + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + }, + + /** + * 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); + + this.x = s * axis.x; + this.y = s * axis.y; + this.z = s * axis.z; + this.w = Math.cos(rad); + + return this; + }, + + /** + * 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; + + this.x = ax * bw + aw * bx + ay * bz - az * by; + this.y = ay * bw + aw * by + az * bx - ax * bz; + this.z = az * bw + aw * bz + ax * by - ay * bx; + this.w = aw * bw - ax * bx - ay * by - az * bz; + + return this; + }, + + /** + * 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 + this.x = scale0 * ax + scale1 * bx; + this.y = scale0 * ay + scale1 * by; + this.z = scale0 * az + scale1 * bz; + this.w = scale0 * aw + scale1 * bw; + + return this; + }, + + /** + * 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; + + // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + this.x = -a0 * invDot; + this.y = -a1 * invDot; + this.z = -a2 * invDot; + this.w = a3 * invDot; + + return this; + }, + + /** + * 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; + + 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); + + this.x = ax * bw + aw * bx; + this.y = ay * bw + az * bx; + this.z = az * bw - ay * bx; + this.w = aw * bw - ax * bx; + + return this; + }, + + /** + * 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); + + this.x = ax * bw - az * by; + this.y = ay * bw + aw * by; + this.z = az * bw + ax * by; + this.w = aw * bw - ay * by; + + return this; + }, + + /** + * 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); + + this.x = ax * bw + ay * bz; + this.y = ay * bw - ax * bz; + this.z = az * bw + aw * bz; + this.w = aw * bw - az * bz; + + return this; + }, + + /** + * 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; + }, + + /** + * 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; + } + + return this; + } + +}); + +module.exports = Quaternion; + + +/***/ }), + +/***/ "../../../src/math/RadToDeg.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/RadToDeg.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); + +/** + * 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 {integer} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), + +/***/ "../../../src/math/RandomXY.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/RandomXY.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RandomXYZ.js": +/*!************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RandomXYZ.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RandomXYZW.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RandomXYZW.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; } + + // TODO: Not spherical; should fix this for more uniform distribution + 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; + + +/***/ }), + +/***/ "../../../src/math/Rotate.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Rotate.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RotateAround.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RotateAround.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` by the given `angle`. + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @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.Geom.Point} The given point, rotated by the given angle around the given coordinates. + */ +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; + + +/***/ }), + +/***/ "../../../src/math/RotateAroundDistance.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RotateAroundDistance.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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`. + * + * @function Phaser.Math.RotateAroundDistance + * @since 3.0.0 + * + * @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.Geom.Point} 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; + + +/***/ }), + +/***/ "../../../src/math/RotateVec3.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RotateVec3.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector3 = __webpack_require__(/*! ../math/Vector3 */ "../../../src/math/Vector3.js"); +var Matrix4 = __webpack_require__(/*! ../math/Matrix4 */ "../../../src/math/Matrix4.js"); +var Quaternion = __webpack_require__(/*! ../math/Quaternion */ "../../../src/math/Quaternion.js"); + +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; + + +/***/ }), + +/***/ "../../../src/math/RoundAwayFromZero.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RoundAwayFromZero.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RoundTo.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/RoundTo.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {integer} [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; + + +/***/ }), + +/***/ "../../../src/math/SinCosTableGenerator.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/SinCosTableGenerator.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/SmoothStep.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/SmoothStep.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/SmootherStep.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/SmootherStep.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/ToXY.js": +/*!*******************************************!*\ + !*** D:/wamp/www/phaser/src/math/ToXY.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(/*! ./Vector2 */ "../../../src/math/Vector2.js"); + +/** + * Returns a Vec2 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 Vec2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {integer} index - The position within the grid to get the x/y value for. + * @param {integer} width - The width of the grid. + * @param {integer} 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; + } + + out.set(x, y); + } + + return out; +}; + +module.exports = ToXY; + + +/***/ }), + +/***/ "../../../src/math/TransformXY.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/TransformXY.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(/*! ./Vector2 */ "../../../src/math/Vector2.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/Vector2.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Vector2.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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] - The x component, or an object with `x` and `y` properties. + * @param {number} [y] - 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.Math.Vector2} 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.Math.Vector2} 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)); + }, + + /** + * 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; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector2#add + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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); + }, + + /** + * 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; + }, + + /** + * Right-hand normalize (make unit length) this Vector. + * + * @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; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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; + } + +}); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/Vector3.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Vector3.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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; + }, + + /** + * 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); + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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 Matrix. + * + * @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; + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/math/Vector4.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Vector4.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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) + { + // TODO: is this really the same as Vector3? + // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/ + // 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; + }, + + /** + * 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; + } + +}); + +// TODO: Check if these are required internally, if not, remove. +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; + + +/***/ }), + +/***/ "../../../src/math/Within.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Within.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Wrap.js": +/*!*******************************************!*\ + !*** D:/wamp/www/phaser/src/math/Wrap.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/Between.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Between.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/BetweenPoints.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/BetweenPoints.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} 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; + + +/***/ }), + +/***/ "../../../src/math/angle/BetweenPointsY.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/BetweenPointsY.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} 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; + + +/***/ }), + +/***/ "../../../src/math/angle/BetweenY.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/BetweenY.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/CounterClockwise.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/CounterClockwise.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ../const */ "../../../src/math/const.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/Normalize.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Normalize.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/Reverse.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Reverse.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Normalize = __webpack_require__(/*! ./Normalize */ "../../../src/math/angle/Normalize.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/RotateTo.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/RotateTo.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(/*! ../const */ "../../../src/math/const.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/ShortestBetween.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/ShortestBetween.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. + * + * TODO: Wrap the angles in this function? + * + * @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; + + +/***/ }), + +/***/ "../../../src/math/angle/Wrap.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Wrap.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathWrap = __webpack_require__(/*! ../Wrap */ "../../../src/math/Wrap.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/WrapDegrees.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/WrapDegrees.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(/*! ../Wrap */ "../../../src/math/Wrap.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/index.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/index.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Angle + */ + +module.exports = { + + Between: __webpack_require__(/*! ./Between */ "../../../src/math/angle/Between.js"), + BetweenPoints: __webpack_require__(/*! ./BetweenPoints */ "../../../src/math/angle/BetweenPoints.js"), + BetweenPointsY: __webpack_require__(/*! ./BetweenPointsY */ "../../../src/math/angle/BetweenPointsY.js"), + BetweenY: __webpack_require__(/*! ./BetweenY */ "../../../src/math/angle/BetweenY.js"), + CounterClockwise: __webpack_require__(/*! ./CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"), + Normalize: __webpack_require__(/*! ./Normalize */ "../../../src/math/angle/Normalize.js"), + Reverse: __webpack_require__(/*! ./Reverse */ "../../../src/math/angle/Reverse.js"), + RotateTo: __webpack_require__(/*! ./RotateTo */ "../../../src/math/angle/RotateTo.js"), + ShortestBetween: __webpack_require__(/*! ./ShortestBetween */ "../../../src/math/angle/ShortestBetween.js"), + Wrap: __webpack_require__(/*! ./Wrap */ "../../../src/math/angle/Wrap.js"), + WrapDegrees: __webpack_require__(/*! ./WrapDegrees */ "../../../src/math/angle/WrapDegrees.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/const.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/math/const.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + +}; + +module.exports = MATH_CONST; + + +/***/ }), + +/***/ "../../../src/math/distance/DistanceBetween.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/DistanceBetween.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/distance/DistancePower.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/DistancePower.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/distance/DistanceSquared.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/DistanceSquared.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/distance/index.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/index.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Distance + */ + +module.exports = { + + Between: __webpack_require__(/*! ./DistanceBetween */ "../../../src/math/distance/DistanceBetween.js"), + Power: __webpack_require__(/*! ./DistancePower */ "../../../src/math/distance/DistancePower.js"), + Squared: __webpack_require__(/*! ./DistanceSquared */ "../../../src/math/distance/DistanceSquared.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/back/In.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/In.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/back/InOut.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/InOut.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/back/Out.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/Out.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/back/index.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Back + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/back/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/back/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/back/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/In.js": +/*!*******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/In.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/InOut.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/InOut.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/Out.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/Out.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/bounce/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/bounce/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/bounce/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/In.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/In.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/InOut.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/InOut.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/Out.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/Out.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/index.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/index.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/circular/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/circular/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/circular/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/In.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/In.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/InOut.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/InOut.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/Out.js": +/*!*******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/Out.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/index.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/index.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/cubic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/cubic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/cubic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/In.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/In.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/InOut.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/InOut.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/Out.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/Out.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/elastic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/elastic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/elastic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/In.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/In.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/InOut.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/InOut.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/Out.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/Out.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/index.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/expo/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/expo/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/expo/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/index.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/index.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing + */ + +module.exports = { + + Back: __webpack_require__(/*! ./back */ "../../../src/math/easing/back/index.js"), + Bounce: __webpack_require__(/*! ./bounce */ "../../../src/math/easing/bounce/index.js"), + Circular: __webpack_require__(/*! ./circular */ "../../../src/math/easing/circular/index.js"), + Cubic: __webpack_require__(/*! ./cubic */ "../../../src/math/easing/cubic/index.js"), + Elastic: __webpack_require__(/*! ./elastic */ "../../../src/math/easing/elastic/index.js"), + Expo: __webpack_require__(/*! ./expo */ "../../../src/math/easing/expo/index.js"), + Linear: __webpack_require__(/*! ./linear */ "../../../src/math/easing/linear/index.js"), + Quadratic: __webpack_require__(/*! ./quadratic */ "../../../src/math/easing/quadratic/index.js"), + Quartic: __webpack_require__(/*! ./quartic */ "../../../src/math/easing/quartic/index.js"), + Quintic: __webpack_require__(/*! ./quintic */ "../../../src/math/easing/quintic/index.js"), + Sine: __webpack_require__(/*! ./sine */ "../../../src/math/easing/sine/index.js"), + Stepped: __webpack_require__(/*! ./stepped */ "../../../src/math/easing/stepped/index.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/linear/Linear.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/linear/Linear.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Linear easing (no variation). + * + * @function Phaser.Math.Easing.Linear.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; + + +/***/ }), + +/***/ "../../../src/math/easing/linear/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/linear/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Linear + */ + +module.exports = __webpack_require__(/*! ./Linear */ "../../../src/math/easing/linear/Linear.js"); + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/In.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/In.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/InOut.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/InOut.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/Out.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/Out.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/index.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/index.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/quadratic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/quadratic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/quadratic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/In.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/In.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/InOut.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/InOut.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/Out.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/Out.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/quartic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/quartic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/quartic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/In.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/In.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/InOut.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/InOut.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/Out.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/Out.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/quintic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/quintic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/quintic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/In.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/In.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/InOut.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/InOut.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/Out.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/Out.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/index.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/sine/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/sine/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/sine/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/stepped/Stepped.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/stepped/Stepped.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Stepped easing. + * + * @function Phaser.Math.Easing.Stepped.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; + + +/***/ }), + +/***/ "../../../src/math/easing/stepped/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/stepped/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(/*! ./Stepped */ "../../../src/math/easing/stepped/Stepped.js"); + + +/***/ }), + +/***/ "../../../src/math/fuzzy/Ceil.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/Ceil.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/Equal.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/Equal.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/Floor.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/Floor.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/GreaterThan.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/GreaterThan.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/LessThan.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/LessThan.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/index.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/index.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Fuzzy + */ + +module.exports = { + + Ceil: __webpack_require__(/*! ./Ceil */ "../../../src/math/fuzzy/Ceil.js"), + Equal: __webpack_require__(/*! ./Equal */ "../../../src/math/fuzzy/Equal.js"), + Floor: __webpack_require__(/*! ./Floor */ "../../../src/math/fuzzy/Floor.js"), + GreaterThan: __webpack_require__(/*! ./GreaterThan */ "../../../src/math/fuzzy/GreaterThan.js"), + LessThan: __webpack_require__(/*! ./LessThan */ "../../../src/math/fuzzy/LessThan.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/index.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/math/index.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); +var Extend = __webpack_require__(/*! ../utils/object/Extend */ "../../../src/utils/object/Extend.js"); + +/** + * @namespace Phaser.Math + */ + +var PhaserMath = { + + // Collections of functions + Angle: __webpack_require__(/*! ./angle/ */ "../../../src/math/angle/index.js"), + Distance: __webpack_require__(/*! ./distance/ */ "../../../src/math/distance/index.js"), + Easing: __webpack_require__(/*! ./easing/ */ "../../../src/math/easing/index.js"), + Fuzzy: __webpack_require__(/*! ./fuzzy/ */ "../../../src/math/fuzzy/index.js"), + Interpolation: __webpack_require__(/*! ./interpolation/ */ "../../../src/math/interpolation/index.js"), + Pow2: __webpack_require__(/*! ./pow2/ */ "../../../src/math/pow2/index.js"), + Snap: __webpack_require__(/*! ./snap/ */ "../../../src/math/snap/index.js"), + + // Expose the RNG Class + RandomDataGenerator: __webpack_require__(/*! ./random-data-generator/RandomDataGenerator */ "../../../src/math/random-data-generator/RandomDataGenerator.js"), + + // Single functions + Average: __webpack_require__(/*! ./Average */ "../../../src/math/Average.js"), + Bernstein: __webpack_require__(/*! ./Bernstein */ "../../../src/math/Bernstein.js"), + Between: __webpack_require__(/*! ./Between */ "../../../src/math/Between.js"), + CatmullRom: __webpack_require__(/*! ./CatmullRom */ "../../../src/math/CatmullRom.js"), + CeilTo: __webpack_require__(/*! ./CeilTo */ "../../../src/math/CeilTo.js"), + Clamp: __webpack_require__(/*! ./Clamp */ "../../../src/math/Clamp.js"), + DegToRad: __webpack_require__(/*! ./DegToRad */ "../../../src/math/DegToRad.js"), + Difference: __webpack_require__(/*! ./Difference */ "../../../src/math/Difference.js"), + Factorial: __webpack_require__(/*! ./Factorial */ "../../../src/math/Factorial.js"), + FloatBetween: __webpack_require__(/*! ./FloatBetween */ "../../../src/math/FloatBetween.js"), + FloorTo: __webpack_require__(/*! ./FloorTo */ "../../../src/math/FloorTo.js"), + FromPercent: __webpack_require__(/*! ./FromPercent */ "../../../src/math/FromPercent.js"), + GetSpeed: __webpack_require__(/*! ./GetSpeed */ "../../../src/math/GetSpeed.js"), + IsEven: __webpack_require__(/*! ./IsEven */ "../../../src/math/IsEven.js"), + IsEvenStrict: __webpack_require__(/*! ./IsEvenStrict */ "../../../src/math/IsEvenStrict.js"), + Linear: __webpack_require__(/*! ./Linear */ "../../../src/math/Linear.js"), + MaxAdd: __webpack_require__(/*! ./MaxAdd */ "../../../src/math/MaxAdd.js"), + MinSub: __webpack_require__(/*! ./MinSub */ "../../../src/math/MinSub.js"), + Percent: __webpack_require__(/*! ./Percent */ "../../../src/math/Percent.js"), + RadToDeg: __webpack_require__(/*! ./RadToDeg */ "../../../src/math/RadToDeg.js"), + RandomXY: __webpack_require__(/*! ./RandomXY */ "../../../src/math/RandomXY.js"), + RandomXYZ: __webpack_require__(/*! ./RandomXYZ */ "../../../src/math/RandomXYZ.js"), + RandomXYZW: __webpack_require__(/*! ./RandomXYZW */ "../../../src/math/RandomXYZW.js"), + Rotate: __webpack_require__(/*! ./Rotate */ "../../../src/math/Rotate.js"), + RotateAround: __webpack_require__(/*! ./RotateAround */ "../../../src/math/RotateAround.js"), + RotateAroundDistance: __webpack_require__(/*! ./RotateAroundDistance */ "../../../src/math/RotateAroundDistance.js"), + RoundAwayFromZero: __webpack_require__(/*! ./RoundAwayFromZero */ "../../../src/math/RoundAwayFromZero.js"), + RoundTo: __webpack_require__(/*! ./RoundTo */ "../../../src/math/RoundTo.js"), + SinCosTableGenerator: __webpack_require__(/*! ./SinCosTableGenerator */ "../../../src/math/SinCosTableGenerator.js"), + SmootherStep: __webpack_require__(/*! ./SmootherStep */ "../../../src/math/SmootherStep.js"), + SmoothStep: __webpack_require__(/*! ./SmoothStep */ "../../../src/math/SmoothStep.js"), + ToXY: __webpack_require__(/*! ./ToXY */ "../../../src/math/ToXY.js"), + TransformXY: __webpack_require__(/*! ./TransformXY */ "../../../src/math/TransformXY.js"), + Within: __webpack_require__(/*! ./Within */ "../../../src/math/Within.js"), + Wrap: __webpack_require__(/*! ./Wrap */ "../../../src/math/Wrap.js"), + + // Vector classes + Vector2: __webpack_require__(/*! ./Vector2 */ "../../../src/math/Vector2.js"), + Vector3: __webpack_require__(/*! ./Vector3 */ "../../../src/math/Vector3.js"), + Vector4: __webpack_require__(/*! ./Vector4 */ "../../../src/math/Vector4.js"), + Matrix3: __webpack_require__(/*! ./Matrix3 */ "../../../src/math/Matrix3.js"), + Matrix4: __webpack_require__(/*! ./Matrix4 */ "../../../src/math/Matrix4.js"), + Quaternion: __webpack_require__(/*! ./Quaternion */ "../../../src/math/Quaternion.js"), + RotateVec3: __webpack_require__(/*! ./RotateVec3 */ "../../../src/math/RotateVec3.js") + +}; + +// Merge in the consts + +PhaserMath = Extend(false, PhaserMath, CONST); + +// Export it + +module.exports = PhaserMath; + + +/***/ }), + +/***/ "../../../src/math/interpolation/BezierInterpolation.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/BezierInterpolation.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bernstein = __webpack_require__(/*! ../Bernstein */ "../../../src/math/Bernstein.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/CatmullRomInterpolation.js": +/*!****************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/CatmullRomInterpolation.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CatmullRom = __webpack_require__(/*! ../CatmullRom */ "../../../src/math/CatmullRom.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/CubicBezierInterpolation.js": +/*!*****************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/CubicBezierInterpolation.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/LinearInterpolation.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/LinearInterpolation.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Linear = __webpack_require__(/*! ../Linear */ "../../../src/math/Linear.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/QuadraticBezierInterpolation.js": +/*!*********************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/QuadraticBezierInterpolation.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/SmoothStepInterpolation.js": +/*!****************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/SmoothStepInterpolation.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmoothStep = __webpack_require__(/*! ../SmoothStep */ "../../../src/math/SmoothStep.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/SmootherStepInterpolation.js": +/*!******************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/SmootherStepInterpolation.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmootherStep = __webpack_require__(/*! ../SmootherStep */ "../../../src/math/SmootherStep.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Interpolation + */ + +module.exports = { + + Bezier: __webpack_require__(/*! ./BezierInterpolation */ "../../../src/math/interpolation/BezierInterpolation.js"), + CatmullRom: __webpack_require__(/*! ./CatmullRomInterpolation */ "../../../src/math/interpolation/CatmullRomInterpolation.js"), + CubicBezier: __webpack_require__(/*! ./CubicBezierInterpolation */ "../../../src/math/interpolation/CubicBezierInterpolation.js"), + Linear: __webpack_require__(/*! ./LinearInterpolation */ "../../../src/math/interpolation/LinearInterpolation.js"), + QuadraticBezier: __webpack_require__(/*! ./QuadraticBezierInterpolation */ "../../../src/math/interpolation/QuadraticBezierInterpolation.js"), + SmoothStep: __webpack_require__(/*! ./SmoothStepInterpolation */ "../../../src/math/interpolation/SmoothStepInterpolation.js"), + SmootherStep: __webpack_require__(/*! ./SmootherStepInterpolation */ "../../../src/math/interpolation/SmootherStepInterpolation.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/pow2/GetPowerOfTwo.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/GetPowerOfTwo.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.GetPowerOfTwo + * @since 3.0.0 + * + * @param {number} value - The value. + * + * @return {integer} 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; + + +/***/ }), + +/***/ "../../../src/math/pow2/IsSizePowerOfTwo.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/IsSizePowerOfTwo.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsSizePowerOfTwo + * @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; + + +/***/ }), + +/***/ "../../../src/math/pow2/IsValuePowerOfTwo.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/IsValuePowerOfTwo.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsValuePowerOfTwo + * @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; + + +/***/ }), + +/***/ "../../../src/math/pow2/index.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/index.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Pow2 + */ + +module.exports = { + + GetNext: __webpack_require__(/*! ./GetPowerOfTwo */ "../../../src/math/pow2/GetPowerOfTwo.js"), + IsSize: __webpack_require__(/*! ./IsSizePowerOfTwo */ "../../../src/math/pow2/IsSizePowerOfTwo.js"), + IsValue: __webpack_require__(/*! ./IsValuePowerOfTwo */ "../../../src/math/pow2/IsValuePowerOfTwo.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/random-data-generator/RandomDataGenerator.js": +/*!********************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/random-data-generator/RandomDataGenerator.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} [array] - The array to be shuffled. + * + * @return {array} 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; + + +/***/ }), + +/***/ "../../../src/math/snap/SnapCeil.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/SnapCeil.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/snap/SnapFloor.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/SnapFloor.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/snap/SnapTo.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/SnapTo.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/snap/index.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/index.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Snap + */ + +module.exports = { + + Ceil: __webpack_require__(/*! ./SnapCeil */ "../../../src/math/snap/SnapCeil.js"), + Floor: __webpack_require__(/*! ./SnapFloor */ "../../../src/math/snap/SnapFloor.js"), + To: __webpack_require__(/*! ./SnapTo */ "../../../src/math/snap/SnapTo.js") + +}; + + +/***/ }), + +/***/ "../../../src/plugins/BasePlugin.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/plugins/BasePlugin.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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; + + /** + * 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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#scene + * @type {?Phaser.Scene} + * @protected + * @since 3.8.0 + */ + this.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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#systems + * @type {?Phaser.Scenes.Systems} + * @protected + * @since 3.8.0 + */ + this.systems; + }, + + /** + * Called by the PluginManager when this 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. + * + * @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 () + { + }, + + /** + * Called by the PluginManager when this plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + * + * @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); + }, + + /** + * Called by the PluginManager when this 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. + * + * @method Phaser.Plugins.BasePlugin#stop + * @since 3.8.0 + */ + stop: function () + { + }, + + /** + * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots. + * By this point the plugin properties `scene` and `systems` will have already been set. + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + * + * @method Phaser.Plugins.BasePlugin#boot + * @since 3.8.0 + */ + boot: function () + { + // Here are the Scene events you can listen to. + // At the very least you should offer a destroy handler for when the Scene closes down. + + // var eventEmitter = this.systems.events; + + // eventEmitter.once('destroy', this.sceneDestroy, this); + // eventEmitter.on('start', this.sceneStart, this); + // eventEmitter.on('preupdate', this.scenePreUpdate, this); + // eventEmitter.on('update', this.sceneUpdate, this); + // eventEmitter.on('postupdate', this.scenePostUpdate, this); + // eventEmitter.on('pause', this.scenePause, this); + // eventEmitter.on('resume', this.sceneResume, this); + // eventEmitter.on('sleep', this.sceneSleep, this); + // eventEmitter.on('wake', this.sceneWake, this); + // eventEmitter.on('shutdown', this.sceneShutdown, this); + // eventEmitter.on('destroy', this.sceneDestroy, this); + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/plugins/ScenePlugin.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/plugins/ScenePlugin.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var BasePlugin = __webpack_require__(/*! ./BasePlugin */ "../../../src/plugins/BasePlugin.js"); +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var SceneEvents = __webpack_require__(/*! ../scene/events */ "../../../src/scene/events/index.js"); + +/** + * @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. + */ +var ScenePlugin = new Class({ + + Extends: BasePlugin, + + initialize: + + function ScenePlugin (scene, pluginManager) + { + BasePlugin.call(this, pluginManager); + + this.scene = scene; + this.systems = scene.sys; + + 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 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 () + { + } + +}); + +module.exports = ScenePlugin; + + +/***/ }), + +/***/ "../../../src/renderer/BlendModes.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/renderer/BlendModes.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + DIFFERENCE: 11, + + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + * + * @name Phaser.BlendModes.EXCLUSION + * @type {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + LUMINOSITY: 16, + + /** + * Alpha erase blend mode. For Canvas and WebGL. + * + * @name Phaser.BlendModes.ERASE + * @type {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + LIGHTER: 25, + + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + * + * @name Phaser.BlendModes.COPY + * @type {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + XOR: 27 + +}; + + +/***/ }), + +/***/ "../../../src/renderer/ScaleModes.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/renderer/ScaleModes.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @readonly + * @since 3.0.0 + */ + DEFAULT: 0, + + /** + * Linear Scale Mode. + * + * @name Phaser.ScaleModes.LINEAR + * @type {integer} + * @readonly + * @since 3.0.0 + */ + LINEAR: 0, + + /** + * Nearest Scale Mode. + * + * @name Phaser.ScaleModes.NEAREST + * @type {integer} + * @readonly + * @since 3.0.0 + */ + NEAREST: 1 + +}; + +module.exports = ScaleModes; + + +/***/ }), + +/***/ "../../../src/scale/events/RESIZE_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scale/events/RESIZE_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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 multiplied by resolution. + * @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} resolution - The current resolution. Defaults to 1 at the moment. + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/BOOT_EVENT.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/BOOT_EVENT.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('boot', listener)`. + * + * @event Phaser.Scenes.Events#BOOT + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/CREATE_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/CREATE_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('create', listener)`. + * + * @event Phaser.Scenes.Events#CREATE + * @since 3.17.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. + */ +module.exports = 'create'; + + +/***/ }), + +/***/ "../../../src/scene/events/DESTROY_EVENT.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/DESTROY_EVENT.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/PAUSE_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/PAUSE_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('pause', listener)`. + * + * @event Phaser.Scenes.Events#PAUSE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/POST_UPDATE_EVENT.js": +/*!****************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/POST_UPDATE_EVENT.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#POST_UPDATE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/PRE_UPDATE_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/PRE_UPDATE_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#PRE_UPDATE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/READY_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/READY_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('ready', listener)`. + * + * @event Phaser.Scenes.Events#READY + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/RENDER_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/RENDER_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('render', listener)`. + * + * A Scene will only render if it is visible and active. + * By the time this event is dispatched, the Scene will have already been rendered. + * + * @event Phaser.Scenes.Events#RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'render'; + + +/***/ }), + +/***/ "../../../src/scene/events/RESUME_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/RESUME_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('resume', listener)`. + * + * @event Phaser.Scenes.Events#RESUME + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/SHUTDOWN_EVENT.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/SHUTDOWN_EVENT.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/SLEEP_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/SLEEP_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('sleep', listener)`. + * + * @event Phaser.Scenes.Events#SLEEP + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/START_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/START_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('start', listener)`. + * + * @event Phaser.Scenes.Events#START + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_COMPLETE_EVENT.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @since 3.5.0 + * + * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. + */ +module.exports = 'transitioncomplete'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_INIT_EVENT.js": +/*!********************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_INIT_EVENT.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_OUT_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_OUT_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_START_EVENT.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_START_EVENT.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_WAKE_EVENT.js": +/*!********************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/UPDATE_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/UPDATE_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#UPDATE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/WAKE_EVENT.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/WAKE_EVENT.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('wake', listener)`. + * + * @event Phaser.Scenes.Events#WAKE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/index.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/index.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Scenes.Events + */ + +module.exports = { + + BOOT: __webpack_require__(/*! ./BOOT_EVENT */ "../../../src/scene/events/BOOT_EVENT.js"), + CREATE: __webpack_require__(/*! ./CREATE_EVENT */ "../../../src/scene/events/CREATE_EVENT.js"), + DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ "../../../src/scene/events/DESTROY_EVENT.js"), + PAUSE: __webpack_require__(/*! ./PAUSE_EVENT */ "../../../src/scene/events/PAUSE_EVENT.js"), + POST_UPDATE: __webpack_require__(/*! ./POST_UPDATE_EVENT */ "../../../src/scene/events/POST_UPDATE_EVENT.js"), + PRE_UPDATE: __webpack_require__(/*! ./PRE_UPDATE_EVENT */ "../../../src/scene/events/PRE_UPDATE_EVENT.js"), + READY: __webpack_require__(/*! ./READY_EVENT */ "../../../src/scene/events/READY_EVENT.js"), + RENDER: __webpack_require__(/*! ./RENDER_EVENT */ "../../../src/scene/events/RENDER_EVENT.js"), + RESUME: __webpack_require__(/*! ./RESUME_EVENT */ "../../../src/scene/events/RESUME_EVENT.js"), + SHUTDOWN: __webpack_require__(/*! ./SHUTDOWN_EVENT */ "../../../src/scene/events/SHUTDOWN_EVENT.js"), + SLEEP: __webpack_require__(/*! ./SLEEP_EVENT */ "../../../src/scene/events/SLEEP_EVENT.js"), + START: __webpack_require__(/*! ./START_EVENT */ "../../../src/scene/events/START_EVENT.js"), + TRANSITION_COMPLETE: __webpack_require__(/*! ./TRANSITION_COMPLETE_EVENT */ "../../../src/scene/events/TRANSITION_COMPLETE_EVENT.js"), + TRANSITION_INIT: __webpack_require__(/*! ./TRANSITION_INIT_EVENT */ "../../../src/scene/events/TRANSITION_INIT_EVENT.js"), + TRANSITION_OUT: __webpack_require__(/*! ./TRANSITION_OUT_EVENT */ "../../../src/scene/events/TRANSITION_OUT_EVENT.js"), + TRANSITION_START: __webpack_require__(/*! ./TRANSITION_START_EVENT */ "../../../src/scene/events/TRANSITION_START_EVENT.js"), + TRANSITION_WAKE: __webpack_require__(/*! ./TRANSITION_WAKE_EVENT */ "../../../src/scene/events/TRANSITION_WAKE_EVENT.js"), + UPDATE: __webpack_require__(/*! ./UPDATE_EVENT */ "../../../src/scene/events/UPDATE_EVENT.js"), + WAKE: __webpack_require__(/*! ./WAKE_EVENT */ "../../../src/scene/events/WAKE_EVENT.js") + +}; + + +/***/ }), + +/***/ "../../../src/utils/Class.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/utils/Class.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// 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; +} + +/** + * Extends the given `myClass` object's prototype with the properties of `definition`. + * + * @function extend + * @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. + */ +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]; + } + } +} + +/** + * Applies the given `mixins` to the prototype of `myClass`. + * + * @function mixin + * @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) + { + return; + } + + if (!Array.isArray(mixins)) + { + mixins = [ mixins ]; + } + + 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; + + +/***/ }), + +/***/ "../../../src/utils/NOOP.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/utils/NOOP.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/utils/object/Extend.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/Extend.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsPlainObject = __webpack_require__(/*! ./IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +// @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 + * + * @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; + + +/***/ }), + +/***/ "../../../src/utils/object/GetAdvancedValue.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/GetAdvancedValue.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH = __webpack_require__(/*! ../../math */ "../../../src/math/index.js"); +var GetValue = __webpack_require__(/*! ./GetValue */ "../../../src/utils/object/GetValue.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/utils/object/GetFastValue.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/GetFastValue.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/utils/object/GetValue.js": +/*!*******************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/GetValue.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Source object +// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' +// The default value to use if the key doesn't exist + +/** + * Retrieves a value from an object. + * + * @function Phaser.Utils.Objects.GetValue + * @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 GetValue = function (source, key, defaultValue) +{ + if (!source || typeof source === 'number') + { + return defaultValue; + } + else if (source.hasOwnProperty(key)) + { + return source[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parent = source; + var value = defaultValue; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parent.hasOwnProperty(keys[i])) + { + // Yes it has a key property, let's carry on down + value = parent[keys[i]]; + + parent = parent[keys[i]]; + } + else + { + // Can't go any further, so reset to default + value = defaultValue; + break; + } + } + + return value; + } + else + { + return defaultValue; + } +}; + +module.exports = GetValue; + + +/***/ }), + +/***/ "../../../src/utils/object/IsPlainObject.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/IsPlainObject.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 (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; + + +/***/ }), + +/***/ "./SpineFile.js": +/*!**********************!*\ + !*** ./SpineFile.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Class = __webpack_require__(/*! ../../../src/utils/Class */ "../../../src/utils/Class.js"); +var GetFastValue = __webpack_require__(/*! ../../../src/utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var ImageFile = __webpack_require__(/*! ../../../src/loader/filetypes/ImageFile.js */ "../../../src/loader/filetypes/ImageFile.js"); +var IsPlainObject = __webpack_require__(/*! ../../../src/utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); +var JSONFile = __webpack_require__(/*! ../../../src/loader/filetypes/JSONFile.js */ "../../../src/loader/filetypes/JSONFile.js"); +var MultiFile = __webpack_require__(/*! ../../../src/loader/MultiFile.js */ "../../../src/loader/MultiFile.js"); +var TextFile = __webpack_require__(/*! ../../../src/loader/filetypes/TextFile.js */ "../../../src/loader/filetypes/TextFile.js"); + +/** + * @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} [textureURL] - The absolute or relative URL to load the texture image file from. + * @property {string} [textureExtension='png'] - The default file extension to use for the image texture if no url is provided. + * @property {XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture image file. + * @property {string} [normalMap] - The filename of an associated normal map. It uses the same path and url to load as the texture image. + * @property {string} [atlasURL] - The absolute or relative URL to load the atlas data file from. + * @property {string} [atlasExtension='txt'] - The default file extension to use for the atlas data if no url is provided. + * @property {XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas data file. + */ + +/** + * @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, + 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 = []; + + 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', currentBaseURL); + var path = GetFastValue(config, 'path', currentPath); + var prefix = GetFastValue(config, 'prefix', currentPrefix); + 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 = '_SP_' + textureURL; + + var image = new ImageFile(loader, key, textureURL, textureXhrSettings); + + 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 combinedAtlastData = ''; + var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; + + for (var i = 1; i < this.files.length; i++) + { + var file = this.files[i]; + + if (file.type === 'text') + { + atlasKey = file.key.substr(0, file.key.length - 2); + + atlasCache = file.cache; + + combinedAtlastData = combinedAtlastData.concat(file.data); + } + else + { + var key = file.key.substr(4).trim(); + + this.loader.textureManager.addImage(key, file.data); + } + + file.pendingDestroy(); + } + + atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlastData }); + + this.complete = true; + } + } + +}); + +module.exports = SpineFile; + + +/***/ }), + +/***/ "./SpinePlugin.js": +/*!************************!*\ + !*** ./SpinePlugin.js ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var BuildGameObject = __webpack_require__(/*! ../../../src/gameobjects/BuildGameObject */ "../../../src/gameobjects/BuildGameObject.js"); +var Class = __webpack_require__(/*! ../../../src/utils/Class */ "../../../src/utils/Class.js"); +var GetValue = __webpack_require__(/*! ../../../src/utils/object/GetValue */ "../../../src/utils/object/GetValue.js"); +var ResizeEvent = __webpack_require__(/*! ../../../src/scale/events/RESIZE_EVENT */ "../../../src/scale/events/RESIZE_EVENT.js"); +var ScenePlugin = __webpack_require__(/*! ../../../src/plugins/ScenePlugin */ "../../../src/plugins/ScenePlugin.js"); +var Spine = __webpack_require__(/*! Spine */ "./runtimes/spine-both.js"); +var SpineFile = __webpack_require__(/*! ./SpineFile */ "./SpineFile.js"); +var SpineGameObject = __webpack_require__(/*! ./gameobject/SpineGameObject */ "./gameobject/SpineGameObject.js"); + +/** + * @classdesc + * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game objects. + * + * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin + * uses the Spine 3.7 runtimes. Files created in a more recent version of Spine may not work as a result. + * + * You can find more details about Spine at http://esotericsoftware.com/. + * + * 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. + * + * 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 a Game Object Factory method, allowin you to create Spine Game Objects: + * + * ```javascript + * this.add.spine(512, 650, 'stretchyman') + * ``` + * + * 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 preMultipiedAlpha 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. + * + * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference + * + * @class SpinePlugin + * @memberOf Phaser + * @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. + */ +var SpinePlugin = new Class({ + + Extends: ScenePlugin, + + initialize: + + function SpinePlugin (scene, pluginManager) + { + ScenePlugin.call(this, scene, pluginManager); + + 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. + * + * 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; + } + + pluginManager.registerFileType('spine', this.spineFileCallback, scene); + + pluginManager.registerGameObject('spine', this.add.bind(this), this.make.bind(this)); + }, + + /** + * 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); + }, + + /** + * 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 () + { + this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + + // Monkeypatch the Spine setBlendMode functions, or batching is destroyed + + var setBlendMode = function (srcBlend, dstBlend) + { + if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend) + { + var gl = this.context.gl; + + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + + if (this.isDrawing) + { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + } + }; + + this.sceneRenderer.batcher.setBlendMode = setBlendMode; + this.sceneRenderer.shapes.setBlendMode = setBlendMode; + + this.skeletonRenderer = this.sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = this.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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage()); + + spineTextures.add(key, canvasTexture); + + return canvasTexture; + }); + } + + 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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + var gl = this.sceneRenderer.context.gl; + + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage(), false); + + spineTextures.add(key, glTexture); + + return glTexture; + }); + } + + 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 preMultipiedAlpha 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#addFileEvent + * @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} [preMultipiedAlpha=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. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ + spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings) + { + var multifile; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new SpineFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; + }, + + /** + * 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. + */ + add: function (x, y, key, animationName, loop) + { + var spineGO = new SpineGameObject(this.scene, this, x, y, key, animationName, loop); + + this.scene.sys.displayList.add(spineGO); + this.scene.sys.updateList.add(spineGO); + + return spineGO; + }, + + /** + * 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. + */ + 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 spineGO = new SpineGameObject(this.scene, this, 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(); + }, + + /** + * 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 Spine.Vector2(temp2.x, temp2.y); + } + else if (bone) + { + return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y); + } + else + { + return new Spine.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 Spine.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; + } + + var preMultipliedAlpha = atlasData.preMultipliedAlpha; + + var atlasLoader = new Spine.AtlasAttachmentLoader(atlas); + + var skeletonJson = new Spine.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 Spine.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 Spine.AnimationStateData(skeleton.data); + + var state = new Spine.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 Spine.Vector2(); + var size = new Spine.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.viewportWidth = viewportWidth; + sceneRenderer.camera.viewportHeight = 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); + + this.sceneRenderer.dispose(); + }, + + /** + * 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.pluginManager.removeGameObject('spine', true, true); + + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; + + this.cache = null; + this.spineTextures = null; + this.json = null; + this.textures = null; + this.sceneRenderer = null; + this.skeletonRenderer = null; + this.gl = null; + } + +}); + +module.exports = SpinePlugin; + + +/***/ }), + +/***/ "./events/COMPLETE_EVENT.js": +/*!**********************************!*\ + !*** ./events/COMPLETE_EVENT.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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'; + + +/***/ }), + +/***/ "./events/DISPOSE_EVENT.js": +/*!*********************************!*\ + !*** ./events/DISPOSE_EVENT.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#DISPOSE + * @since 3.19.0 + */ +module.exports = 'dispose'; + + +/***/ }), + +/***/ "./events/END_EVENT.js": +/*!*****************************!*\ + !*** ./events/END_EVENT.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#END + * @since 3.19.0 + */ +module.exports = 'end'; + + +/***/ }), + +/***/ "./events/EVENT_EVENT.js": +/*!*******************************!*\ + !*** ./events/EVENT_EVENT.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#EVENT + * @since 3.19.0 + */ +module.exports = 'event'; + + +/***/ }), + +/***/ "./events/INTERRUPTED_EVENT.js": +/*!*************************************!*\ + !*** ./events/INTERRUPTED_EVENT.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#INTERRUPTED + * @since 3.19.0 + */ +module.exports = 'interrupted'; + + +/***/ }), + +/***/ "./events/START_EVENT.js": +/*!*******************************!*\ + !*** ./events/START_EVENT.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#START + * @since 3.19.0 + */ +module.exports = 'start'; + + +/***/ }), + +/***/ "./events/index.js": +/*!*************************!*\ + !*** ./events/index.js ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace SpinePluginEvents + */ + +module.exports = { + + COMPLETE: __webpack_require__(/*! ./COMPLETE_EVENT */ "./events/COMPLETE_EVENT.js"), + DISPOSE: __webpack_require__(/*! ./DISPOSE_EVENT */ "./events/DISPOSE_EVENT.js"), + END: __webpack_require__(/*! ./END_EVENT */ "./events/END_EVENT.js"), + EVENT: __webpack_require__(/*! ./EVENT_EVENT */ "./events/EVENT_EVENT.js"), + INTERRUPTED: __webpack_require__(/*! ./INTERRUPTED_EVENT */ "./events/INTERRUPTED_EVENT.js"), + START: __webpack_require__(/*! ./START_EVENT */ "./events/START_EVENT.js") + +}; + + +/***/ }), + +/***/ "./gameobject/SpineGameObject.js": +/*!***************************************!*\ + !*** ./gameobject/SpineGameObject.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var AngleBetween = __webpack_require__(/*! ../../../../src/math/angle/Between */ "../../../src/math/angle/Between.js"); +var Clamp = __webpack_require__(/*! ../../../../src/math/Clamp */ "../../../src/math/Clamp.js"); +var Class = __webpack_require__(/*! ../../../../src/utils/Class */ "../../../src/utils/Class.js"); +var ComponentsComputedSize = __webpack_require__(/*! ../../../../src/gameobjects/components/ComputedSize */ "../../../src/gameobjects/components/ComputedSize.js"); +var ComponentsDepth = __webpack_require__(/*! ../../../../src/gameobjects/components/Depth */ "../../../src/gameobjects/components/Depth.js"); +var ComponentsFlip = __webpack_require__(/*! ../../../../src/gameobjects/components/Flip */ "../../../src/gameobjects/components/Flip.js"); +var ComponentsScrollFactor = __webpack_require__(/*! ../../../../src/gameobjects/components/ScrollFactor */ "../../../src/gameobjects/components/ScrollFactor.js"); +var ComponentsTransform = __webpack_require__(/*! ../../../../src/gameobjects/components/Transform */ "../../../src/gameobjects/components/Transform.js"); +var ComponentsVisible = __webpack_require__(/*! ../../../../src/gameobjects/components/Visible */ "../../../src/gameobjects/components/Visible.js"); +var CounterClockwise = __webpack_require__(/*! ../../../../src/math/angle/CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"); +var DegToRad = __webpack_require__(/*! ../../../../src/math/DegToRad */ "../../../src/math/DegToRad.js"); +var GameObject = __webpack_require__(/*! ../../../../src/gameobjects/GameObject */ "../../../src/gameobjects/GameObject.js"); +var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../../src/math/RadToDeg.js"); +var SpineEvents = __webpack_require__(/*! ../events/ */ "./events/index.js"); +var SpineGameObjectRender = __webpack_require__(/*! ./SpineGameObjectRender */ "./gameobject/SpineGameObjectRender.js"); + +/** + * @classdesc + * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates + * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to + * easily change the skin, slot attachment, bone positions and more. + * + * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly. + * You can only create them if the Spine plugin has been loaded into Phaser. + * + * The quickest way is the Game Object Factory: + * + * ```javascript + * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true); + * ``` + * + * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly` + * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is + * an optional animation to start playing on the skeleton. The final argument `true` sets the + * animation to loop. Look at the documentation for further details on each of these options. + * + * For more control, you can use the Game Object Creator, passing in a Spine Game Object + * Configuration object: + * + * ```javascript + * let jelly = this.make.spine({ + * x: 512, y: 550, key: 'jelly', + * scale: 1.5, + * skinName: 'square_Green', + * animationName: 'jelly-think', loop: true, + * slotName: 'hat', attachmentName: 'images/La_14' + * }); + * ``` + * + * Here, you've got the ability to specify extra details, such as the slot name, attachments or + * overall scale. + * + * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to + * update and render, it must be added to the display and update lists of your Scene: + * + * ```javascript + * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true); + * this.sys.displayList.add(jelly); + * this.sys.updateList.add(jelly); + * ``` + * + * It's possible to enable Spine Game Objects for input, but you should be aware that it will use + * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but + * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created. + * If it's not suitable, provide your own shape to the `setInteractive` method. + * + * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for + * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game + * Object position with it. See the examples for further details. + * + * If your Spine Game Object has black outlines around the different parts of the texture when it + * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have + * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details. + * + * @class SpineGameObject + * @constructor + * @since 3.19.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 {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? + */ +var SpineGameObject = new Class({ + + Extends: GameObject, + + Mixins: [ + ComponentsComputedSize, + ComponentsDepth, + ComponentsFlip, + ComponentsScrollFactor, + ComponentsTransform, + ComponentsVisible, + SpineGameObjectRender + ], + + initialize: + + function SpineGameObject (scene, plugin, x, y, key, animationName, loop) + { + GameObject.call(this, scene, 'Spine'); + + /** + * A reference to the Spine Plugin. + * + * @name SpineGameObject#plugin + * @type {SpinePlugin} + * @since 3.19.0 + */ + this.plugin = plugin; + + /** + * The Spine Skeleton this Game Object is using. + * + * @name SpineGameObject#skeleton + * @type {spine.Skeleton} + * @since 3.19.0 + */ + this.skeleton = null; + + /** + * The Spine Skeleton Data associated with the Skeleton this Game Object is using. + * + * @name SpineGameObject#skeletonData + * @type {spine.SkeletonData} + * @since 3.19.0 + */ + this.skeletonData = null; + + /** + * The Spine Animation State this Game Object is using. + * + * @name SpineGameObject#state + * @type {spine.AnimationState} + * @since 3.19.0 + */ + this.state = null; + + /** + * The Spine Animation State Data associated with the Animation State this Game Object is using. + * + * @name SpineGameObject#stateData + * @type {spine.AnimationStateData} + * @since 3.19.0 + */ + this.stateData = null; + + /** + * A reference to the root bone of the Skeleton. + * + * @name SpineGameObject#root + * @type {spine.Bone} + * @since 3.19.0 + */ + this.root = null; + + /** + * This object holds the calculated bounds of the current + * pose, as set when a new Skeleton is applied. + * + * @name SpineGameObject#bounds + * @type {any} + * @since 3.19.0 + */ + this.bounds = null; + + /** + * A Game Object level flag that allows you to enable debug drawing + * to the Skeleton Debug Renderer by toggling it. + * + * @name SpineGameObject#drawDebug + * @type {boolean} + * @since 3.19.0 + */ + this.drawDebug = false; + + /** + * The factor to scale the Animation update time by. + * + * @name SpineGameObject#timeScale + * @type {number} + * @since 3.19.0 + */ + this.timeScale = 1; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginX + * @type {number} + * @since 3.19.0 + */ + this.displayOriginX = 0; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginY + * @type {number} + * @since 3.19.0 + */ + this.displayOriginY = 0; + + /** + * A flag that stores if the texture associated with the current + * Skin being used by this Game Object, has its alpha pre-multiplied + * into it, or not. + * + * @name SpineGameObject#preMultipliedAlpha + * @type {boolean} + * @since 3.19.0 + */ + this.preMultipliedAlpha = false; + + /** + * A default Blend Mode. You cannot change the blend mode of a + * Spine Game Object. + * + * @name SpineGameObject#blendMode + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.blendMode = 0; + + this.setPosition(x, y); + + if (key) + { + this.setSkeleton(key, animationName, loop); + } + }, + + /** + * Overrides the default Game Object method and always returns true. + * Rendering is decided in the renderer functions. + * + * @method SpineGameObject#willRender + * @since 3.19.0 + * + * @return {boolean} Always returns `true`. + */ + willRender: function () + { + return true; + }, + + /** + * Set the Alpha level for the whole Skeleton 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 SpineGameObject#setAlpha + * @since 3.19.0 + * + * @param {number} [value=1] - The alpha value used for the whole Skeleton. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (value, slotName) + { + if (value === undefined) { value = 1; } + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + slot.color.a = Clamp(value, 0, 1); + } + } + else + { + this.alpha = value; + } + + return this; + }, + + /** + * The alpha value of the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#alpha + * @type {number} + * @since 3.19.0 + */ + alpha: { + + get: function () + { + return this.skeleton.color.a; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.a = v; + } + + if (v === 0) + { + this.renderFlags &= ~2; + } + else + { + this.renderFlags |= 2; + } + } + + }, + + /** + * The amount of red used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#red + * @type {number} + * @since 3.19.0 + */ + red: { + + get: function () + { + return this.skeleton.color.r; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.r = v; + } + } + + }, + + /** + * The amount of green used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#green + * @type {number} + * @since 3.19.0 + */ + green: { + + get: function () + { + return this.skeleton.color.g; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.g = v; + } + } + + }, + + /** + * The amount of blue used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#blue + * @type {number} + * @since 3.19.0 + */ + blue: { + + get: function () + { + return this.skeleton.color.b; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.b = v; + } + } + + }, + + /** + * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton. + * + * @method SpineGameObject#setColor + * @since 3.19.0 + * + * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color. + * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton. + * + * @return {this} This Game Object instance. + */ + setColor: function (color, slotName) + { + if (color === undefined) { color = 0xffffff; } + + var red = (color >> 16 & 0xFF) / 255; + var green = (color >> 8 & 0xFF) / 255; + var blue = (color & 0xFF) / 255; + var alpha = (color > 16777215) ? (color >>> 24) / 255 : null; + + var target = this.skeleton; + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + target = slot; + } + } + + target.color.r = red; + target.color.g = green; + target.color.b = blue; + + if (alpha !== null) + { + target.color.a = alpha; + } + + return this; + }, + + /** + * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object + * that contains the Skeleton data. + * + * @method SpineGameObject#setSkeletonFromJSON + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ + setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop) + { + return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop); + }, + + /** + * Sets this Game Object to use the given Skeleton based on its cache key. + * + * Typically, once set, the Skeleton doesn't change. Instead, you change the skin, + * or slot attachment, or any other property to adjust it. + * + * @method SpineGameObject#setSkeleton + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ + setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON) + { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON); + + this.skeletonData = data.skeletonData; + + this.preMultipliedAlpha = data.preMultipliedAlpha; + + var skeleton = data.skeleton; + + skeleton.setSkinByName('default'); + skeleton.setToSetupPose(); + + this.skeleton = skeleton; + + // AnimationState + data = this.plugin.createAnimationState(skeleton); + + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + this.state = data.state; + this.stateData = data.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) + }); + + if (animationName) + { + this.setAnimation(0, animationName, loop); + } + + this.root = this.getRootBone(); + + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.state.apply(skeleton); + + skeleton.updateCache(); + + return this.updateSize(); + }, + + /** + * Internal event handler that emits the Spine onComplete event via this Game Object. + * + * @method SpineGameObject#onComplete + * @fires SpinePluginEvents#COMPLETE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onComplete: function (entry) + { + this.emit(SpineEvents.COMPLETE, entry); + }, + + /** + * Internal event handler that emits the Spine onDispose event via this Game Object. + * + * @method SpineGameObject#onDispose + * @fires SpinePluginEvents#DISPOSE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onDispose: function (entry) + { + this.emit(SpineEvents.DISPOSE, entry); + }, + + /** + * Internal event handler that emits the Spine onEnd event via this Game Object. + * + * @method SpineGameObject#onEnd + * @fires SpinePluginEvents#END + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onEnd: function (entry) + { + this.emit(SpineEvents.END, entry); + }, + + /** + * Internal event handler that emits the Spine Event event via this Game Object. + * + * @method SpineGameObject#onEvent + * @fires SpinePluginEvents#EVENT + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + * @param {spine.Event} event - The Spine event. + */ + onEvent: function (entry, event) + { + this.emit(SpineEvents.EVENT, entry, event); + }, + + /** + * Internal event handler that emits the Spine onInterrupted event via this Game Object. + * + * @method SpineGameObject#onInterrupted + * @fires SpinePluginEvents#INTERRUPTED + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onInterrupted: function (entry) + { + this.emit(SpineEvents.INTERRUPTED, entry); + }, + + /** + * Internal event handler that emits the Spine onStart event via this Game Object. + * + * @method SpineGameObject#onStart + * @fires SpinePluginEvents#START + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onStart: function (entry) + { + this.emit(SpineEvents.START, entry); + }, + + /** + * Refreshes the data about the current Skeleton. + * + * This will reset the rotation, position and size of the Skeleton to match this Game Object. + * + * Call this method if you need to access the Skeleton data directly, and it may have changed + * recently. + * + * @method SpineGameObject#refresh + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + refresh: function () + { + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.updateSize(); + + this.skeleton.updateCache(); + + return this; + }, + + /** + * Sets the size of this Game Object. + * + * If no arguments are given it uses the current skeleton data dimensions. + * + * You can use this method to set a fixed size of this Game Object, such as for input detection, + * when the skeleton data doesn't match what is required in-game. + * + * @method SpineGameObject#setSize + * @since 3.19.0 + * + * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width. + * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height. + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setSize: function (width, height, offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (width === undefined) { width = skeleton.data.width; } + if (height === undefined) { height = skeleton.data.height; } + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.width = width; + this.height = height; + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Sets the offset of this Game Object from the Skeleton position. + * + * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using. + * + * @method SpineGameObject#setOffset + * @since 3.19.0 + * + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setOffset: function (offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Internal method that syncs all of the Game Object position and scale data to the Skeleton. + * It then syncs the skeleton bounds back to this Game Object. + * + * This method is called automatically as needed internally, however, it's also exposed should + * you require overriding the size settings. + * + * @method SpineGameObject#updateSize + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + updateSize: function () + { + var skeleton = this.skeleton; + var renderer = this.plugin.renderer; + + var height = renderer.height; + + var oldScaleX = this.scaleX; + var oldScaleY = this.scaleY; + + skeleton.x = this.x; + skeleton.y = height - this.y; + skeleton.scaleX = 1; + skeleton.scaleY = 1; + + skeleton.updateWorldTransform(); + + var bounds = this.getBounds(); + + this.width = bounds.size.x; + this.height = bounds.size.y; + + this.displayOriginX = this.x - bounds.offset.x; + this.displayOriginY = this.y - (height - (this.height + bounds.offset.y)); + + skeleton.scaleX = oldScaleX; + skeleton.scaleY = oldScaleY; + + skeleton.updateWorldTransform(); + + return this; + }, + + /** + * The horizontal scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleX + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + this.refresh(); + } + + }, + + /** + * The vertical scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleY + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + this.refresh(); + } + + }, + + /** + * Returns an array containing the names of all the bones in the Skeleton Data. + * + * @method SpineGameObject#getBoneList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the bones in the Skeleton Data. + */ + getBoneList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.bones.length; i++) + { + output.push(skeletonData.bones[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the skins in the Skeleton Data. + * + * @method SpineGameObject#getSkinList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the skins in the Skeleton Data. + */ + getSkinList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.skins.length; i++) + { + output.push(skeletonData.skins[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the slots in the Skeleton. + * + * @method SpineGameObject#getSlotList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the slots in the Skeleton. + */ + getSlotList: function () + { + var output = []; + + var skeleton = this.skeleton; + + for (var i = 0; i < skeleton.slots.length; i++) + { + output.push(skeleton.slots[i].data.name); + } + + return output; + }, + + /** + * Returns an array containing the names of all the animations in the Skeleton Data. + * + * @method SpineGameObject#getAnimationList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the animations in the Skeleton Data. + */ + getAnimationList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.animations.length; i++) + { + output.push(skeletonData.animations[i].name); + } + } + + return output; + }, + + /** + * Returns the current animation being played on the given track, if any. + * + * @method SpineGameObject#getCurrentAnimation + * @since 3.19.0 + * + * @param {integer} [trackIndex=0] - The track to return the current animation on. + * + * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation. + */ + getCurrentAnimation: function (trackIndex) + { + if (trackIndex === undefined) { trackIndex = 0; } + + var current = this.state.getCurrent(trackIndex); + + if (current) + { + return current.animation; + } + }, + + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#play + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead. + */ + play: function (animationName, loop, ignoreIfPlaying) + { + this.setAnimation(0, animationName, loop, ignoreIfPlaying); + + return this; + }, + + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#setAnimation + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to play the animation on. + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying) + { + if (loop === undefined) { loop = false; } + if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } + + if (ignoreIfPlaying && this.state) + { + var currentTrack = this.state.getCurrent(0); + + if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete()) + { + return; + } + } + + if (this.findAnimation(animationName)) + { + return this.state.setAnimation(trackIndex, animationName, loop); + } + }, + + /** + * Adds an animation to be played after the current or last queued animation for a track. + * If the track is empty, it is equivalent to calling setAnimation. + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous + * track entry minus any mix duration (from the AnimationStateData) plus the specified delay + * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration). + * If the previous entry is looping, its next loop completion is used instead of its duration. + * + * @method SpineGameObject#addAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {string} animationName - The string-based key of the animation to add. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + addAnimation: function (trackIndex, animationName, loop, delay) + { + return this.state.addAnimation(trackIndex, animationName, loop, delay); + }, + + /** + * Sets an empty animation for a track, discarding any queued animations, and sets the track + * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out. + * + * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation, + * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be + * applied less and less over the mix duration. Properties keyed in the previous animation transition to + * the value from lower tracks or to the setup pose value if no lower tracks key the property. + * A mix duration of 0 still mixes out over one frame. + * + * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation + * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new + * animation to be applied more and more over the mix duration. Properties keyed in the new animation + * transition from the value from lower tracks or from the setup pose value if no lower tracks key the + * property to the value keyed in the new animation. + * + * @method SpineGameObject#setEmptyAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {spine.TrackEntry} The returned Track Entry. + */ + setEmptyAnimation: function (trackIndex, mixDuration) + { + return this.state.setEmptyAnimation(trackIndex, mixDuration); + }, + + /** + * Removes all animations from the track, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTrack + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * + * @return {this} This Game Object. + */ + clearTrack: function (trackIndex) + { + this.state.clearTrack(trackIndex); + + return this; + }, + + /** + * Removes all animations from all tracks, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTracks + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + clearTracks: function () + { + this.state.clearTracks(); + + return this; + }, + + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkinByName + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to set. + * + * @return {this} This Game Object. + */ + setSkinByName: function (skinName) + { + var skeleton = this.skeleton; + + skeleton.setSkinByName(skinName); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); + + return this; + }, + + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkin + * @since 3.19.0 + * + * @param {?spine.Skin} newSkin - The Skin to set. May be `null`. + * + * @return {this} This Game Object. + */ + setSkin: function (newSkin) + { + var skeleton = this.skeleton; + + skeleton.setSkin(newSkin); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); + + return this; + }, + + /** + * Sets the mix duration when changing from the specified animation to the other. + * + * @method SpineGameObject#setMix + * @since 3.19.0 + * + * @param {string} fromName - The animation to mix from. + * @param {string} toName - The animation to mix to. + * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {this} This Game Object. + */ + setMix: function (fromName, toName, duration) + { + this.stateData.setMix(fromName, toName, duration); + + return this; + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot + * index and attachment name. First the skin is checked and if the attachment was not found, + * the default skin is checked. + * + * @method SpineGameObject#getAttachment + * @since 3.19.0 + * + * @param {integer} slotIndex - The slot index to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachment: function (slotIndex, attachmentName) + { + return this.skeleton.getAttachment(slotIndex, attachmentName); + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name. + * + * @method SpineGameObject#getAttachmentByName + * @since 3.19.0 + * + * @param {string} slotName - The slot name to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachmentByName: function (slotName, attachmentName) + { + return this.skeleton.getAttachmentByName(slotName, attachmentName); + }, + + /** + * A convenience method to set an attachment by finding the slot with findSlot, + * finding the attachment with getAttachment, then setting the slot's attachment. + * + * @method SpineGameObject#setAttachment + * @since 3.19.0 + * + * @param {string} slotName - The slot name to add the attachment to. + * @param {string} attachmentName - The attachment name to add. + * + * @return {this} This Game Object. + */ + setAttachment: function (slotName, attachmentName) + { + if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length) + { + for (var i = 0; i < slotName.length; i++) + { + this.skeleton.setAttachment(slotName[i], attachmentName[i]); + } + } + else + { + this.skeleton.setAttachment(slotName, attachmentName); + } + + return this; + }, + + /** + * Sets the bones, constraints, slots, and draw order to their setup pose values. + * + * @method SpineGameObject#setToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setToSetupPose: function () + { + this.skeleton.setToSetupPose(); + + return this; + }, + + /** + * Sets the slots and draw order to their setup pose values. + * + * @method SpineGameObject#setSlotsToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setSlotsToSetupPose: function () + { + this.skeleton.setSlotsToSetupPose(); + + return this; + }, + + /** + * Sets the bones and constraints to their setup pose values. + * + * @method SpineGameObject#setBonesToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setBonesToSetupPose: function () + { + this.skeleton.setBonesToSetupPose(); + + return this; + }, + + /** + * Gets the root bone, or null. + * + * @method SpineGameObject#getRootBone + * @since 3.19.0 + * + * @return {spine.Bone} The root bone, or null. + */ + getRootBone: function () + { + return this.skeleton.getRootBone(); + }, + + /** + * Takes a Bone object and a position in world space and rotates the Bone so it is angled + * towards the given position. You can set an optional angle offset, should the bone be + * designed at a specific angle already. You can also set a minimum and maximum range for the angle. + * + * @method SpineGameObject#angleBoneToXY + * @since 3.19.0 + * + * @param {spine.Bone} bone - The bone to rotate towards the world position. + * @param {number} worldX - The world x coordinate to rotate the bone towards. + * @param {number} worldY - The world y coordinate to rotate the bone towards. + * @param {number} [offset=0] - An offset to add to the rotation angle. + * @param {number} [minAngle=0] - The minimum range of the rotation angle. + * @param {number} [maxAngle=360] - The maximum range of the rotation angle. + * + * @return {this} This Game Object. + */ + angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle) + { + if (offset === undefined) { offset = 0; } + if (minAngle === undefined) { minAngle = 0; } + if (maxAngle === undefined) { maxAngle = 360; } + + var renderer = this.plugin.renderer; + var height = renderer.height; + + var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset)); + + bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle); + + return this; + }, + + /** + * Finds a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBone + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {spine.Bone} The bone, or null. + */ + findBone: function (boneName) + { + return this.skeleton.findBone(boneName); + }, + + /** + * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBoneIndex + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {integer} The bone index. Or -1 if the bone was not found. + */ + findBoneIndex: function (boneName) + { + return this.skeleton.findBoneIndex(boneName); + }, + + /** + * Finds a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlot + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {spine.Slot} The Slot. May be null. + */ + findSlot: function (slotName) + { + return this.skeleton.findSlot(slotName); + }, + + /** + * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlotIndex + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {integer} The slot index. Or -1 if the Slot was not found. + */ + findSlotIndex: function (slotName) + { + return this.skeleton.findSlotIndex(slotName); + }, + + /** + * Finds a skin by comparing each skin's name. It is more efficient to cache the results of + * this method than to call it multiple times. + * + * @method SpineGameObject#findSkin + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to find. + * + * @return {spine.Skin} The Skin. May be null. + */ + findSkin: function (skinName) + { + return this.skeletonData.findSkin(skinName); + }, + + /** + * Finds an event by comparing each events's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findEvent + * @since 3.19.0 + * + * @param {string} eventDataName - The name of the event to find. + * + * @return {spine.EventData} The Event Data. May be null. + */ + findEvent: function (eventDataName) + { + return this.skeletonData.findEvent(eventDataName); + }, + + /** + * Finds an animation by comparing each animation's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findAnimation + * @since 3.19.0 + * + * @param {string} animationName - The name of the animation to find. + * + * @return {spine.Animation} The Animation. May be null. + */ + findAnimation: function (animationName) + { + return this.skeletonData.findAnimation(animationName); + }, + + /** + * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findIkConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.IkConstraintData} The IK constraint. May be null. + */ + findIkConstraint: function (constraintName) + { + return this.skeletonData.findIkConstraint(constraintName); + }, + + /** + * Finds an transform constraint by comparing each transform constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findTransformConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.TransformConstraintData} The transform constraint. May be null. + */ + findTransformConstraint: function (constraintName) + { + return this.skeletonData.findTransformConstraint(constraintName); + }, + + /** + * Finds a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.PathConstraintData} The path constraint. May be null. + */ + findPathConstraint: function (constraintName) + { + return this.skeletonData.findPathConstraint(constraintName); + }, + + /** + * Finds the index of a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraintIndex + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {integer} The constraint index. Or -1 if the constraint was not found. + */ + findPathConstraintIndex: function (constraintName) + { + return this.skeletonData.findPathConstraintIndex(constraintName); + }, + + /** + * 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 SpineGameObject#getBounds + * @since 3.19.0 + * + * @return {any} The bounds object. + */ + getBounds: function () + { + return this.plugin.getBounds(this.skeleton); + }, + + /** + * Internal update handler. + * + * @method SpineGameObject#preUpdate + * @protected + * @since 3.19.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + var skeleton = this.skeleton; + + this.state.update((delta / 1000) * this.timeScale); + + this.state.apply(skeleton); + + // this.emit('spine.update', skeleton); + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method SpineGameObject#preDestroy + * @protected + * @since 3.19.0 + */ + preDestroy: function () + { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + this.plugin = null; + + this.skeleton = null; + this.skeletonData = null; + + this.state = null; + this.stateData = null; + } + +}); + +module.exports = SpineGameObject; + + +/***/ }), + +/***/ "./gameobject/SpineGameObjectCanvasRenderer.js": +/*!*****************************************************!*\ + !*** ./gameobject/SpineGameObjectCanvasRenderer.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var CounterClockwise = __webpack_require__(/*! ../../../../src/math/angle/CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"); +var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../../src/math/RadToDeg.js"); +var Wrap = __webpack_require__(/*! ../../../../src/math/Wrap */ "../../../src/math/Wrap.js"); + +/** + * 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 {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @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, interpolationPercentage, camera, parentMatrix) +{ + var context = renderer.currentContext; + + var plugin = src.plugin; + var skeleton = src.skeleton; + var skeletonRenderer = plugin.skeletonRenderer; + + var GameObjectRenderMask = 15; + + var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); + + if (!skeleton || !willRender) + { + return; + } + + var camMatrix = renderer._tempMatrix1; + var spriteMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + 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; + } + + // Add autoUpdate option + skeleton.updateWorldTransform(); + + skeletonRenderer.ctx = context; + skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug); + + context.save(); + + skeletonRenderer.draw(skeleton); + + context.restore(); +}; + +module.exports = SpineGameObjectCanvasRenderer; + + +/***/ }), + +/***/ "./gameobject/SpineGameObjectRender.js": +/*!*********************************************!*\ + !*** ./gameobject/SpineGameObjectRender.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var renderWebGL = __webpack_require__(/*! ../../../../src/utils/NOOP */ "../../../src/utils/NOOP.js"); +var renderCanvas = __webpack_require__(/*! ../../../../src/utils/NOOP */ "../../../src/utils/NOOP.js"); + +if (true) +{ + renderWebGL = __webpack_require__(/*! ./SpineGameObjectWebGLRenderer */ "./gameobject/SpineGameObjectWebGLRenderer.js"); +} + +if (true) +{ + renderCanvas = __webpack_require__(/*! ./SpineGameObjectCanvasRenderer */ "./gameobject/SpineGameObjectCanvasRenderer.js"); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), + +/***/ "./gameobject/SpineGameObjectWebGLRenderer.js": +/*!****************************************************!*\ + !*** ./gameobject/SpineGameObjectWebGLRenderer.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var CounterClockwise = __webpack_require__(/*! ../../../../src/math/angle/CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"); +var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../../src/math/RadToDeg.js"); +var Wrap = __webpack_require__(/*! ../../../../src/math/Wrap */ "../../../src/math/Wrap.js"); + +/** + * 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 {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @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 SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var plugin = src.plugin; + var skeleton = src.skeleton; + var sceneRenderer = plugin.sceneRenderer; + + var GameObjectRenderMask = 15; + + var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); + + if (!skeleton || !willRender) + { + // Reset the current type + renderer.currentType = ''; + + // If there is already a batch running, we need to close it + if (!renderer.nextTypeMatch) + { + // The next object in the display list is not a Spine object, so we end the batch + sceneRenderer.end(); + + renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline); + } + + return; + } + + if (renderer.newType) + { + renderer.clearPipeline(); + } + + var camMatrix = renderer._tempMatrix1; + var spriteMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + 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); + } + + 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; + + 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; + } + + // Add autoUpdate option + skeleton.updateWorldTransform(); + + if (renderer.newType) + { + sceneRenderer.begin(); + } + + // Draw the current skeleton + sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + + 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 object, so we end the batch + sceneRenderer.end(); + + renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline); + } +}; + +module.exports = SpineGameObjectWebGLRenderer; + + +/***/ }), + +/***/ "./runtimes/spine-both.js": +/*!********************************!*\ + !*** ./runtimes/spine-both.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/*** IMPORTS FROM imports-loader ***/ +(function() { + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var spine; +(function (spine) { + var Animation = (function () { + function Animation(name, timelines, duration) { + if (name == null) + throw new Error("name cannot be null."); + if (timelines == null) + throw new Error("timelines cannot be null."); + this.name = name; + this.timelines = timelines; + this.duration = duration; + } + Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (loop && this.duration != 0) { + time %= this.duration; + if (lastTime > 0) + lastTime %= this.duration; + } + var timelines = this.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction); + }; + Animation.binarySearch = function (values, target, step) { + if (step === void 0) { step = 1; } + var low = 0; + var high = values.length / step - 2; + if (high == 0) + return step; + var current = high >>> 1; + while (true) { + if (values[(current + 1) * step] <= target) + low = current + 1; + else + high = current; + if (low == high) + return (low + 1) * step; + current = (low + high) >>> 1; + } + }; + Animation.linearSearch = function (values, target, step) { + for (var i = 0, last = values.length - step; i <= last; i += step) + if (values[i] > target) + return i; + return -1; + }; + return Animation; + }()); + spine.Animation = Animation; + var MixBlend; + (function (MixBlend) { + MixBlend[MixBlend["setup"] = 0] = "setup"; + MixBlend[MixBlend["first"] = 1] = "first"; + MixBlend[MixBlend["replace"] = 2] = "replace"; + MixBlend[MixBlend["add"] = 3] = "add"; + })(MixBlend = spine.MixBlend || (spine.MixBlend = {})); + var MixDirection; + (function (MixDirection) { + MixDirection[MixDirection["in"] = 0] = "in"; + MixDirection[MixDirection["out"] = 1] = "out"; + })(MixDirection = spine.MixDirection || (spine.MixDirection = {})); + var TimelineType; + (function (TimelineType) { + TimelineType[TimelineType["rotate"] = 0] = "rotate"; + TimelineType[TimelineType["translate"] = 1] = "translate"; + TimelineType[TimelineType["scale"] = 2] = "scale"; + TimelineType[TimelineType["shear"] = 3] = "shear"; + TimelineType[TimelineType["attachment"] = 4] = "attachment"; + TimelineType[TimelineType["color"] = 5] = "color"; + TimelineType[TimelineType["deform"] = 6] = "deform"; + TimelineType[TimelineType["event"] = 7] = "event"; + TimelineType[TimelineType["drawOrder"] = 8] = "drawOrder"; + TimelineType[TimelineType["ikConstraint"] = 9] = "ikConstraint"; + TimelineType[TimelineType["transformConstraint"] = 10] = "transformConstraint"; + TimelineType[TimelineType["pathConstraintPosition"] = 11] = "pathConstraintPosition"; + TimelineType[TimelineType["pathConstraintSpacing"] = 12] = "pathConstraintSpacing"; + TimelineType[TimelineType["pathConstraintMix"] = 13] = "pathConstraintMix"; + TimelineType[TimelineType["twoColor"] = 14] = "twoColor"; + })(TimelineType = spine.TimelineType || (spine.TimelineType = {})); + var CurveTimeline = (function () { + function CurveTimeline(frameCount) { + if (frameCount <= 0) + throw new Error("frameCount must be > 0: " + frameCount); + this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE); + } + CurveTimeline.prototype.getFrameCount = function () { + return this.curves.length / CurveTimeline.BEZIER_SIZE + 1; + }; + CurveTimeline.prototype.setLinear = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR; + }; + CurveTimeline.prototype.setStepped = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED; + }; + CurveTimeline.prototype.getCurveType = function (frameIndex) { + var index = frameIndex * CurveTimeline.BEZIER_SIZE; + if (index == this.curves.length) + return CurveTimeline.LINEAR; + var type = this.curves[index]; + if (type == CurveTimeline.LINEAR) + return CurveTimeline.LINEAR; + if (type == CurveTimeline.STEPPED) + return CurveTimeline.STEPPED; + return CurveTimeline.BEZIER; + }; + CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) { + var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03; + var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006; + var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy; + var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var curves = this.curves; + curves[i++] = CurveTimeline.BEZIER; + var x = dfx, y = dfy; + for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + curves[i] = x; + curves[i + 1] = y; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + x += dfx; + y += dfy; + } + }; + CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) { + percent = spine.MathUtils.clamp(percent, 0, 1); + var curves = this.curves; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var type = curves[i]; + if (type == CurveTimeline.LINEAR) + return percent; + if (type == CurveTimeline.STEPPED) + return 0; + i++; + var x = 0; + for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + x = curves[i]; + if (x >= percent) { + var prevX = void 0, prevY = void 0; + if (i == start) { + prevX = 0; + prevY = 0; + } + else { + prevX = curves[i - 2]; + prevY = curves[i - 1]; + } + return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); + } + } + var y = curves[i - 1]; + return y + (1 - y) * (percent - x) / (1 - x); + }; + CurveTimeline.LINEAR = 0; + CurveTimeline.STEPPED = 1; + CurveTimeline.BEZIER = 2; + CurveTimeline.BEZIER_SIZE = 10 * 2 - 1; + return CurveTimeline; + }()); + spine.CurveTimeline = CurveTimeline; + var RotateTimeline = (function (_super) { + __extends(RotateTimeline, _super); + function RotateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount << 1); + return _this; + } + RotateTimeline.prototype.getPropertyId = function () { + return (TimelineType.rotate << 24) + this.boneIndex; + }; + RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) { + frameIndex <<= 1; + this.frames[frameIndex] = time; + this.frames[frameIndex + RotateTimeline.ROTATION] = degrees; + }; + RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation; + return; + case MixBlend.first: + var r_1 = bone.data.rotation - bone.rotation; + bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha; + } + return; + } + if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { + var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION]; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + r_2 * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r_2 += bone.data.rotation - bone.rotation; + r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; + case MixBlend.add: + bone.rotation += r_2 * alpha; + } + return; + } + var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES); + var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime)); + var r = frames[frame + RotateTimeline.ROTATION] - prevRotation; + r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r += bone.data.rotation - bone.rotation; + case MixBlend.add: + bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + } + }; + RotateTimeline.ENTRIES = 2; + RotateTimeline.PREV_TIME = -2; + RotateTimeline.PREV_ROTATION = -1; + RotateTimeline.ROTATION = 1; + return RotateTimeline; + }(CurveTimeline)); + spine.RotateTimeline = RotateTimeline; + var TranslateTimeline = (function (_super) { + __extends(TranslateTimeline, _super); + function TranslateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES); + return _this; + } + TranslateTimeline.prototype.getPropertyId = function () { + return (TimelineType.translate << 24) + this.boneIndex; + }; + TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) { + frameIndex *= TranslateTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TranslateTimeline.X] = x; + this.frames[frameIndex + TranslateTimeline.Y] = y; + }; + TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x; + bone.y = bone.data.y; + return; + case MixBlend.first: + bone.x += (bone.data.x - bone.x) * alpha; + bone.y += (bone.data.y - bone.y) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { + x = frames[frames.length + TranslateTimeline.PREV_X]; + y = frames[frames.length + TranslateTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES); + x = frames[frame + TranslateTimeline.PREV_X]; + y = frames[frame + TranslateTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime)); + x += (frames[frame + TranslateTimeline.X] - x) * percent; + y += (frames[frame + TranslateTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x + x * alpha; + bone.y = bone.data.y + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.x += (bone.data.x + x - bone.x) * alpha; + bone.y += (bone.data.y + y - bone.y) * alpha; + break; + case MixBlend.add: + bone.x += x * alpha; + bone.y += y * alpha; + } + }; + TranslateTimeline.ENTRIES = 3; + TranslateTimeline.PREV_TIME = -3; + TranslateTimeline.PREV_X = -2; + TranslateTimeline.PREV_Y = -1; + TranslateTimeline.X = 1; + TranslateTimeline.Y = 2; + return TranslateTimeline; + }(CurveTimeline)); + spine.TranslateTimeline = TranslateTimeline; + var ScaleTimeline = (function (_super) { + __extends(ScaleTimeline, _super); + function ScaleTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ScaleTimeline.prototype.getPropertyId = function () { + return (TimelineType.scale << 24) + this.boneIndex; + }; + ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.scaleX = bone.data.scaleX; + bone.scaleY = bone.data.scaleY; + return; + case MixBlend.first: + bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha; + bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { + x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX; + y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY; + } + else { + var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES); + x = frames[frame + ScaleTimeline.PREV_X]; + y = frames[frame + ScaleTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime)); + x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX; + y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY; + } + if (alpha == 1) { + if (blend == MixBlend.add) { + bone.scaleX += x - bone.data.scaleX; + bone.scaleY += y - bone.data.scaleY; + } + else { + bone.scaleX = x; + bone.scaleY = y; + } + } + else { + var bx = 0, by = 0; + if (direction == MixDirection.out) { + switch (blend) { + case MixBlend.setup: + bx = bone.data.scaleX; + by = bone.data.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.add: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha; + } + } + else { + switch (blend) { + case MixBlend.setup: + bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.add: + bx = spine.MathUtils.signum(x); + by = spine.MathUtils.signum(y); + bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha; + bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha; + } + } + } + }; + return ScaleTimeline; + }(TranslateTimeline)); + spine.ScaleTimeline = ScaleTimeline; + var ShearTimeline = (function (_super) { + __extends(ShearTimeline, _super); + function ShearTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ShearTimeline.prototype.getPropertyId = function () { + return (TimelineType.shear << 24) + this.boneIndex; + }; + ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX; + bone.shearY = bone.data.shearY; + return; + case MixBlend.first: + bone.shearX += (bone.data.shearX - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY - bone.shearY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { + x = frames[frames.length + ShearTimeline.PREV_X]; + y = frames[frames.length + ShearTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES); + x = frames[frame + ShearTimeline.PREV_X]; + y = frames[frame + ShearTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime)); + x = x + (frames[frame + ShearTimeline.X] - x) * percent; + y = y + (frames[frame + ShearTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX + x * alpha; + bone.shearY = bone.data.shearY + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha; + break; + case MixBlend.add: + bone.shearX += x * alpha; + bone.shearY += y * alpha; + } + }; + return ShearTimeline; + }(TranslateTimeline)); + spine.ShearTimeline = ShearTimeline; + var ColorTimeline = (function (_super) { + __extends(ColorTimeline, _super); + function ColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES); + return _this; + } + ColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.color << 24) + this.slotIndex; + }; + ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) { + frameIndex *= ColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + ColorTimeline.R] = r; + this.frames[frameIndex + ColorTimeline.G] = g; + this.frames[frameIndex + ColorTimeline.B] = b; + this.frames[frameIndex + ColorTimeline.A] = a; + }; + ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + return; + case MixBlend.first: + var color = slot.color, setup = slot.data.color; + color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha); + } + return; + } + var r = 0, g = 0, b = 0, a = 0; + if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + ColorTimeline.PREV_R]; + g = frames[i + ColorTimeline.PREV_G]; + b = frames[i + ColorTimeline.PREV_B]; + a = frames[i + ColorTimeline.PREV_A]; + } + else { + var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES); + r = frames[frame + ColorTimeline.PREV_R]; + g = frames[frame + ColorTimeline.PREV_G]; + b = frames[frame + ColorTimeline.PREV_B]; + a = frames[frame + ColorTimeline.PREV_A]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + ColorTimeline.R] - r) * percent; + g += (frames[frame + ColorTimeline.G] - g) * percent; + b += (frames[frame + ColorTimeline.B] - b) * percent; + a += (frames[frame + ColorTimeline.A] - a) * percent; + } + if (alpha == 1) + slot.color.set(r, g, b, a); + else { + var color = slot.color; + if (blend == MixBlend.setup) + color.setFromColor(slot.data.color); + color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); + } + }; + ColorTimeline.ENTRIES = 5; + ColorTimeline.PREV_TIME = -5; + ColorTimeline.PREV_R = -4; + ColorTimeline.PREV_G = -3; + ColorTimeline.PREV_B = -2; + ColorTimeline.PREV_A = -1; + ColorTimeline.R = 1; + ColorTimeline.G = 2; + ColorTimeline.B = 3; + ColorTimeline.A = 4; + return ColorTimeline; + }(CurveTimeline)); + spine.ColorTimeline = ColorTimeline; + var TwoColorTimeline = (function (_super) { + __extends(TwoColorTimeline, _super); + function TwoColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES); + return _this; + } + TwoColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.twoColor << 24) + this.slotIndex; + }; + TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) { + frameIndex *= TwoColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TwoColorTimeline.R] = r; + this.frames[frameIndex + TwoColorTimeline.G] = g; + this.frames[frameIndex + TwoColorTimeline.B] = b; + this.frames[frameIndex + TwoColorTimeline.A] = a; + this.frames[frameIndex + TwoColorTimeline.R2] = r2; + this.frames[frameIndex + TwoColorTimeline.G2] = g2; + this.frames[frameIndex + TwoColorTimeline.B2] = b2; + }; + TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + slot.darkColor.setFromColor(slot.data.darkColor); + return; + case MixBlend.first: + var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor; + light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha); + dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0); + } + return; + } + var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; + if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + TwoColorTimeline.PREV_R]; + g = frames[i + TwoColorTimeline.PREV_G]; + b = frames[i + TwoColorTimeline.PREV_B]; + a = frames[i + TwoColorTimeline.PREV_A]; + r2 = frames[i + TwoColorTimeline.PREV_R2]; + g2 = frames[i + TwoColorTimeline.PREV_G2]; + b2 = frames[i + TwoColorTimeline.PREV_B2]; + } + else { + var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES); + r = frames[frame + TwoColorTimeline.PREV_R]; + g = frames[frame + TwoColorTimeline.PREV_G]; + b = frames[frame + TwoColorTimeline.PREV_B]; + a = frames[frame + TwoColorTimeline.PREV_A]; + r2 = frames[frame + TwoColorTimeline.PREV_R2]; + g2 = frames[frame + TwoColorTimeline.PREV_G2]; + b2 = frames[frame + TwoColorTimeline.PREV_B2]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + TwoColorTimeline.R] - r) * percent; + g += (frames[frame + TwoColorTimeline.G] - g) * percent; + b += (frames[frame + TwoColorTimeline.B] - b) * percent; + a += (frames[frame + TwoColorTimeline.A] - a) * percent; + r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent; + g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent; + b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent; + } + if (alpha == 1) { + slot.color.set(r, g, b, a); + slot.darkColor.set(r2, g2, b2, 1); + } + else { + var light = slot.color, dark = slot.darkColor; + if (blend == MixBlend.setup) { + light.setFromColor(slot.data.color); + dark.setFromColor(slot.data.darkColor); + } + light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); + dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0); + } + }; + TwoColorTimeline.ENTRIES = 8; + TwoColorTimeline.PREV_TIME = -8; + TwoColorTimeline.PREV_R = -7; + TwoColorTimeline.PREV_G = -6; + TwoColorTimeline.PREV_B = -5; + TwoColorTimeline.PREV_A = -4; + TwoColorTimeline.PREV_R2 = -3; + TwoColorTimeline.PREV_G2 = -2; + TwoColorTimeline.PREV_B2 = -1; + TwoColorTimeline.R = 1; + TwoColorTimeline.G = 2; + TwoColorTimeline.B = 3; + TwoColorTimeline.A = 4; + TwoColorTimeline.R2 = 5; + TwoColorTimeline.G2 = 6; + TwoColorTimeline.B2 = 7; + return TwoColorTimeline; + }(CurveTimeline)); + spine.TwoColorTimeline = TwoColorTimeline; + var AttachmentTimeline = (function () { + function AttachmentTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.attachmentNames = new Array(frameCount); + } + AttachmentTimeline.prototype.getPropertyId = function () { + return (TimelineType.attachment << 24) + this.slotIndex; + }; + AttachmentTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) { + this.frames[frameIndex] = time; + this.attachmentNames[frameIndex] = attachmentName; + }; + AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + if (direction == MixDirection.out && blend == MixBlend.setup) { + var attachmentName_1 = slot.data.attachmentName; + slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1)); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) { + var attachmentName_2 = slot.data.attachmentName; + slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2)); + } + return; + } + var frameIndex = 0; + if (time >= frames[frames.length - 1]) + frameIndex = frames.length - 1; + else + frameIndex = Animation.binarySearch(frames, time, 1) - 1; + var attachmentName = this.attachmentNames[frameIndex]; + skeleton.slots[this.slotIndex] + .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); + }; + return AttachmentTimeline; + }()); + spine.AttachmentTimeline = AttachmentTimeline; + var zeros = null; + var DeformTimeline = (function (_super) { + __extends(DeformTimeline, _super); + function DeformTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount); + _this.frameVertices = new Array(frameCount); + if (zeros == null) + zeros = spine.Utils.newFloatArray(64); + return _this; + } + DeformTimeline.prototype.getPropertyId = function () { + return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex; + }; + DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) { + this.frames[frameIndex] = time; + this.frameVertices[frameIndex] = vertices; + }; + DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var slotAttachment = slot.getAttachment(); + if (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment)) + return; + var verticesArray = slot.attachmentVertices; + if (verticesArray.length == 0) + blend = MixBlend.setup; + var frameVertices = this.frameVertices; + var vertexCount = frameVertices[0].length; + var frames = this.frames; + if (time < frames[0]) { + var vertexAttachment = slotAttachment; + switch (blend) { + case MixBlend.setup: + verticesArray.length = 0; + return; + case MixBlend.first: + if (alpha == 1) { + verticesArray.length = 0; + break; + } + var vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount); + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha; + } + else { + alpha = 1 - alpha; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] *= alpha; + } + } + return; + } + var vertices = spine.Utils.setArraySize(verticesArray, vertexCount); + if (time >= frames[frames.length - 1]) { + var lastVertices = frameVertices[frames.length - 1]; + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_1 = 0; i_1 < vertexCount; i_1++) { + vertices[i_1] += lastVertices[i_1] - setupVertices[i_1]; + } + } + else { + for (var i_2 = 0; i_2 < vertexCount; i_2++) + vertices[i_2] += lastVertices[i_2]; + } + } + else { + spine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount); + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_1 = slotAttachment; + if (vertexAttachment_1.bones == null) { + var setupVertices = vertexAttachment_1.vertices; + for (var i_3 = 0; i_3 < vertexCount; i_3++) { + var setup = setupVertices[i_3]; + vertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha; + } + } + else { + for (var i_4 = 0; i_4 < vertexCount; i_4++) + vertices[i_4] = lastVertices[i_4] * alpha; + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_5 = 0; i_5 < vertexCount; i_5++) + vertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_6 = 0; i_6 < vertexCount; i_6++) { + vertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha; + } + } + else { + for (var i_7 = 0; i_7 < vertexCount; i_7++) + vertices[i_7] += lastVertices[i_7] * alpha; + } + } + } + return; + } + var frame = Animation.binarySearch(frames, time); + var prevVertices = frameVertices[frame - 1]; + var nextVertices = frameVertices[frame]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime)); + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_8 = 0; i_8 < vertexCount; i_8++) { + var prev = prevVertices[i_8]; + vertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8]; + } + } + else { + for (var i_9 = 0; i_9 < vertexCount; i_9++) { + var prev = prevVertices[i_9]; + vertices[i_9] += prev + (nextVertices[i_9] - prev) * percent; + } + } + } + else { + for (var i_10 = 0; i_10 < vertexCount; i_10++) { + var prev = prevVertices[i_10]; + vertices[i_10] = prev + (nextVertices[i_10] - prev) * percent; + } + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_2 = slotAttachment; + if (vertexAttachment_2.bones == null) { + var setupVertices = vertexAttachment_2.vertices; + for (var i_11 = 0; i_11 < vertexCount; i_11++) { + var prev = prevVertices[i_11], setup = setupVertices[i_11]; + vertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha; + } + } + else { + for (var i_12 = 0; i_12 < vertexCount; i_12++) { + var prev = prevVertices[i_12]; + vertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha; + } + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_13 = 0; i_13 < vertexCount; i_13++) { + var prev = prevVertices[i_13]; + vertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha; + } + break; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_14 = 0; i_14 < vertexCount; i_14++) { + var prev = prevVertices[i_14]; + vertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha; + } + } + else { + for (var i_15 = 0; i_15 < vertexCount; i_15++) { + var prev = prevVertices[i_15]; + vertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha; + } + } + } + } + }; + return DeformTimeline; + }(CurveTimeline)); + spine.DeformTimeline = DeformTimeline; + var EventTimeline = (function () { + function EventTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.events = new Array(frameCount); + } + EventTimeline.prototype.getPropertyId = function () { + return TimelineType.event << 24; + }; + EventTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + EventTimeline.prototype.setFrame = function (frameIndex, event) { + this.frames[frameIndex] = event.time; + this.events[frameIndex] = event; + }; + EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + if (firedEvents == null) + return; + var frames = this.frames; + var frameCount = this.frames.length; + if (lastTime > time) { + this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction); + lastTime = -1; + } + else if (lastTime >= frames[frameCount - 1]) + return; + if (time < frames[0]) + return; + var frame = 0; + if (lastTime < frames[0]) + frame = 0; + else { + frame = Animation.binarySearch(frames, lastTime); + var frameTime = frames[frame]; + while (frame > 0) { + if (frames[frame - 1] != frameTime) + break; + frame--; + } + } + for (; frame < frameCount && time >= frames[frame]; frame++) + firedEvents.push(this.events[frame]); + }; + return EventTimeline; + }()); + spine.EventTimeline = EventTimeline; + var DrawOrderTimeline = (function () { + function DrawOrderTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.drawOrders = new Array(frameCount); + } + DrawOrderTimeline.prototype.getPropertyId = function () { + return TimelineType.drawOrder << 24; + }; + DrawOrderTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) { + this.frames[frameIndex] = time; + this.drawOrders[frameIndex] = drawOrder; + }; + DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var drawOrder = skeleton.drawOrder; + var slots = skeleton.slots; + if (direction == MixDirection.out && blend == MixBlend.setup) { + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frame = 0; + if (time >= frames[frames.length - 1]) + frame = frames.length - 1; + else + frame = Animation.binarySearch(frames, time) - 1; + var drawOrderToSetupIndex = this.drawOrders[frame]; + if (drawOrderToSetupIndex == null) + spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length); + else { + for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) + drawOrder[i] = slots[drawOrderToSetupIndex[i]]; + } + }; + return DrawOrderTimeline; + }()); + spine.DrawOrderTimeline = DrawOrderTimeline; + var IkConstraintTimeline = (function (_super) { + __extends(IkConstraintTimeline, _super); + function IkConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES); + return _this; + } + IkConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex; + }; + IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) { + frameIndex *= IkConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + IkConstraintTimeline.MIX] = mix; + this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection; + this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0; + this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0; + }; + IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.ikConstraints[this.ikConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + return; + case MixBlend.first: + constraint.mix += (constraint.data.mix - constraint.mix) * alpha; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + return; + } + if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + return; + } + var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES); + var mix = frames[frame + IkConstraintTimeline.PREV_MIX]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime)); + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + }; + IkConstraintTimeline.ENTRIES = 5; + IkConstraintTimeline.PREV_TIME = -5; + IkConstraintTimeline.PREV_MIX = -4; + IkConstraintTimeline.PREV_BEND_DIRECTION = -3; + IkConstraintTimeline.PREV_COMPRESS = -2; + IkConstraintTimeline.PREV_STRETCH = -1; + IkConstraintTimeline.MIX = 1; + IkConstraintTimeline.BEND_DIRECTION = 2; + IkConstraintTimeline.COMPRESS = 3; + IkConstraintTimeline.STRETCH = 4; + return IkConstraintTimeline; + }(CurveTimeline)); + spine.IkConstraintTimeline = IkConstraintTimeline; + var TransformConstraintTimeline = (function (_super) { + __extends(TransformConstraintTimeline, _super); + function TransformConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES); + return _this; + } + TransformConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex; + }; + TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) { + frameIndex *= TransformConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix; + this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix; + this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix; + }; + TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.transformConstraints[this.transformConstraintIndex]; + if (time < frames[0]) { + var data = constraint.data; + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + return; + case MixBlend.first: + constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha; + constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha; + constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha; + } + return; + } + var rotate = 0, translate = 0, scale = 0, shear = 0; + if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { + var i = frames.length; + rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[i + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[i + TransformConstraintTimeline.PREV_SHEAR]; + } + else { + var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES); + rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[frame + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent; + scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent; + shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent; + } + if (blend == MixBlend.setup) { + var data = constraint.data; + constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha; + constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha; + constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha; + constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + constraint.scaleMix += (scale - constraint.scaleMix) * alpha; + constraint.shearMix += (shear - constraint.shearMix) * alpha; + } + }; + TransformConstraintTimeline.ENTRIES = 5; + TransformConstraintTimeline.PREV_TIME = -5; + TransformConstraintTimeline.PREV_ROTATE = -4; + TransformConstraintTimeline.PREV_TRANSLATE = -3; + TransformConstraintTimeline.PREV_SCALE = -2; + TransformConstraintTimeline.PREV_SHEAR = -1; + TransformConstraintTimeline.ROTATE = 1; + TransformConstraintTimeline.TRANSLATE = 2; + TransformConstraintTimeline.SCALE = 3; + TransformConstraintTimeline.SHEAR = 4; + return TransformConstraintTimeline; + }(CurveTimeline)); + spine.TransformConstraintTimeline = TransformConstraintTimeline; + var PathConstraintPositionTimeline = (function (_super) { + __extends(PathConstraintPositionTimeline, _super); + function PathConstraintPositionTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES); + return _this; + } + PathConstraintPositionTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex; + }; + PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) { + frameIndex *= PathConstraintPositionTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value; + }; + PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.position = constraint.data.position; + return; + case MixBlend.first: + constraint.position += (constraint.data.position - constraint.position) * alpha; + } + return; + } + var position = 0; + if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) + position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES); + position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime)); + position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent; + } + if (blend == MixBlend.setup) + constraint.position = constraint.data.position + (position - constraint.data.position) * alpha; + else + constraint.position += (position - constraint.position) * alpha; + }; + PathConstraintPositionTimeline.ENTRIES = 2; + PathConstraintPositionTimeline.PREV_TIME = -2; + PathConstraintPositionTimeline.PREV_VALUE = -1; + PathConstraintPositionTimeline.VALUE = 1; + return PathConstraintPositionTimeline; + }(CurveTimeline)); + spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline; + var PathConstraintSpacingTimeline = (function (_super) { + __extends(PathConstraintSpacingTimeline, _super); + function PathConstraintSpacingTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + PathConstraintSpacingTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex; + }; + PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.spacing = constraint.data.spacing; + return; + case MixBlend.first: + constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha; + } + return; + } + var spacing = 0; + if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) + spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES); + spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime)); + spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent; + } + if (blend == MixBlend.setup) + constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha; + else + constraint.spacing += (spacing - constraint.spacing) * alpha; + }; + return PathConstraintSpacingTimeline; + }(PathConstraintPositionTimeline)); + spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline; + var PathConstraintMixTimeline = (function (_super) { + __extends(PathConstraintMixTimeline, _super); + function PathConstraintMixTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES); + return _this; + } + PathConstraintMixTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex; + }; + PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) { + frameIndex *= PathConstraintMixTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix; + }; + PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = constraint.data.rotateMix; + constraint.translateMix = constraint.data.translateMix; + return; + case MixBlend.first: + constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha; + } + return; + } + var rotate = 0, translate = 0; + if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { + rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE]; + } + else { + var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES); + rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent; + } + if (blend == MixBlend.setup) { + constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha; + constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + } + }; + PathConstraintMixTimeline.ENTRIES = 3; + PathConstraintMixTimeline.PREV_TIME = -3; + PathConstraintMixTimeline.PREV_ROTATE = -2; + PathConstraintMixTimeline.PREV_TRANSLATE = -1; + PathConstraintMixTimeline.ROTATE = 1; + PathConstraintMixTimeline.TRANSLATE = 2; + return PathConstraintMixTimeline; + }(CurveTimeline)); + spine.PathConstraintMixTimeline = PathConstraintMixTimeline; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationState = (function () { + function AnimationState(data) { + this.tracks = new Array(); + this.events = new Array(); + this.listeners = new Array(); + this.queue = new EventQueue(this); + this.propertyIDs = new spine.IntSet(); + this.animationsChanged = false; + this.timeScale = 1; + this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); }); + this.data = data; + } + AnimationState.prototype.update = function (delta) { + delta *= this.timeScale; + var tracks = this.tracks; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null) + continue; + current.animationLast = current.nextAnimationLast; + current.trackLast = current.nextTrackLast; + var currentDelta = delta * current.timeScale; + if (current.delay > 0) { + current.delay -= currentDelta; + if (current.delay > 0) + continue; + currentDelta = -current.delay; + current.delay = 0; + } + var next = current.next; + if (next != null) { + var nextTime = current.trackLast - next.delay; + if (nextTime >= 0) { + next.delay = 0; + next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; + current.trackTime += currentDelta; + this.setCurrent(i, next, true); + while (next.mixingFrom != null) { + next.mixTime += delta; + next = next.mixingFrom; + } + continue; + } + } + else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) { + tracks[i] = null; + this.queue.end(current); + this.disposeNext(current); + continue; + } + if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) { + var from = current.mixingFrom; + current.mixingFrom = null; + if (from != null) + from.mixingTo = null; + while (from != null) { + this.queue.end(from); + from = from.mixingFrom; + } + } + current.trackTime += currentDelta; + } + this.queue.drain(); + }; + AnimationState.prototype.updateMixingFrom = function (to, delta) { + var from = to.mixingFrom; + if (from == null) + return true; + var finished = this.updateMixingFrom(from, delta); + from.animationLast = from.nextAnimationLast; + from.trackLast = from.nextTrackLast; + if (to.mixTime > 0 && to.mixTime >= to.mixDuration) { + if (from.totalAlpha == 0 || to.mixDuration == 0) { + to.mixingFrom = from.mixingFrom; + if (from.mixingFrom != null) + from.mixingFrom.mixingTo = to; + to.interruptAlpha = from.interruptAlpha; + this.queue.end(from); + } + return finished; + } + from.trackTime += delta * from.timeScale; + to.mixTime += delta; + return false; + }; + AnimationState.prototype.apply = function (skeleton) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (this.animationsChanged) + this._animationsChanged(); + var events = this.events; + var tracks = this.tracks; + var applied = false; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null || current.delay > 0) + continue; + applied = true; + var blend = i == 0 ? spine.MixBlend.first : current.mixBlend; + var mix = current.alpha; + if (current.mixingFrom != null) + mix *= this.applyMixingFrom(current, skeleton, blend); + else if (current.trackTime >= current.trackEnd && current.next == null) + mix = 0; + var animationLast = current.animationLast, animationTime = current.getAnimationTime(); + var timelineCount = current.animation.timelines.length; + var timelines = current.animation.timelines; + if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) { + for (var ii = 0; ii < timelineCount; ii++) + timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]); + } + else { + var timelineMode = current.timelineMode; + var firstFrame = current.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = current.timelinesRotation; + for (var ii = 0; ii < timelineCount; ii++) { + var timeline = timelines[ii]; + var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup; + if (timeline instanceof spine.RotateTimeline) { + this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame); + } + else { + spine.Utils.webkit602BugfixHelper(mix, blend); + timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]); + } + } + } + this.queueEvents(current, animationTime); + events.length = 0; + current.nextAnimationLast = animationTime; + current.nextTrackLast = current.trackTime; + } + this.queue.drain(); + return applied; + }; + AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) { + var from = to.mixingFrom; + if (from.mixingFrom != null) + this.applyMixingFrom(from, skeleton, blend); + var mix = 0; + if (to.mixDuration == 0) { + mix = 1; + if (blend == spine.MixBlend.first) + blend = spine.MixBlend.setup; + } + else { + mix = to.mixTime / to.mixDuration; + if (mix > 1) + mix = 1; + if (blend != spine.MixBlend.first) + blend = from.mixBlend; + } + var events = mix < from.eventThreshold ? this.events : null; + var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold; + var animationLast = from.animationLast, animationTime = from.getAnimationTime(); + var timelineCount = from.animation.timelines.length; + var timelines = from.animation.timelines; + var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); + if (blend == spine.MixBlend.add) { + for (var i = 0; i < timelineCount; i++) + timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out); + } + else { + var timelineMode = from.timelineMode; + var timelineHoldMix = from.timelineHoldMix; + var firstFrame = from.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = from.timelinesRotation; + from.totalAlpha = 0; + for (var i = 0; i < timelineCount; i++) { + var timeline = timelines[i]; + var direction = spine.MixDirection.out; + var timelineBlend = void 0; + var alpha = 0; + switch (timelineMode[i]) { + case AnimationState.SUBSEQUENT: + if (!attachments && timeline instanceof spine.AttachmentTimeline) + continue; + if (!drawOrder && timeline instanceof spine.DrawOrderTimeline) + continue; + timelineBlend = blend; + alpha = alphaMix; + break; + case AnimationState.FIRST: + timelineBlend = spine.MixBlend.setup; + alpha = alphaMix; + break; + case AnimationState.HOLD: + timelineBlend = spine.MixBlend.setup; + alpha = alphaHold; + break; + default: + timelineBlend = spine.MixBlend.setup; + var holdMix = timelineHoldMix[i]; + alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); + break; + } + from.totalAlpha += alpha; + if (timeline instanceof spine.RotateTimeline) + this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame); + else { + spine.Utils.webkit602BugfixHelper(alpha, blend); + if (timelineBlend == spine.MixBlend.setup) { + if (timeline instanceof spine.AttachmentTimeline) { + if (attachments) + direction = spine.MixDirection.out; + } + else if (timeline instanceof spine.DrawOrderTimeline) { + if (drawOrder) + direction = spine.MixDirection.out; + } + } + timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction); + } + } + } + if (to.mixDuration > 0) + this.queueEvents(from, animationTime); + this.events.length = 0; + from.nextAnimationLast = animationTime; + from.nextTrackLast = from.trackTime; + return mix; + }; + AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { + if (firstFrame) + timelinesRotation[i] = 0; + if (alpha == 1) { + timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]); + return; + } + var rotateTimeline = timeline; + var frames = rotateTimeline.frames; + var bone = skeleton.bones[rotateTimeline.boneIndex]; + var r1 = 0, r2 = 0; + if (time < frames[0]) { + switch (blend) { + case spine.MixBlend.setup: + bone.rotation = bone.data.rotation; + default: + return; + case spine.MixBlend.first: + r1 = bone.rotation; + r2 = bone.data.rotation; + } + } + else { + r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation; + if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES]) + r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION]; + else { + var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES); + var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime)); + r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + r2 = prevRotation + r2 * percent + bone.data.rotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + } + } + var total = 0, diff = r2 - r1; + diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360; + if (diff == 0) { + total = timelinesRotation[i]; + } + else { + var lastTotal = 0, lastDiff = 0; + if (firstFrame) { + lastTotal = 0; + lastDiff = diff; + } + else { + lastTotal = timelinesRotation[i]; + lastDiff = timelinesRotation[i + 1]; + } + var current = diff > 0, dir = lastTotal >= 0; + if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) { + if (Math.abs(lastTotal) > 180) + lastTotal += 360 * spine.MathUtils.signum(lastTotal); + dir = current; + } + total = diff + lastTotal - lastTotal % 360; + if (dir != current) + total += 360 * spine.MathUtils.signum(lastTotal); + timelinesRotation[i] = total; + } + timelinesRotation[i + 1] = diff; + r1 += total * alpha; + bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360; + }; + AnimationState.prototype.queueEvents = function (entry, animationTime) { + var animationStart = entry.animationStart, animationEnd = entry.animationEnd; + var duration = animationEnd - animationStart; + var trackLastWrapped = entry.trackLast % duration; + var events = this.events; + var i = 0, n = events.length; + for (; i < n; i++) { + var event_1 = events[i]; + if (event_1.time < trackLastWrapped) + break; + if (event_1.time > animationEnd) + continue; + this.queue.event(entry, event_1); + } + var complete = false; + if (entry.loop) + complete = duration == 0 || trackLastWrapped > entry.trackTime % duration; + else + complete = animationTime >= animationEnd && entry.animationLast < animationEnd; + if (complete) + this.queue.complete(entry); + for (; i < n; i++) { + var event_2 = events[i]; + if (event_2.time < animationStart) + continue; + this.queue.event(entry, events[i]); + } + }; + AnimationState.prototype.clearTracks = function () { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) + this.clearTrack(i); + this.tracks.length = 0; + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.clearTrack = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return; + var current = this.tracks[trackIndex]; + if (current == null) + return; + this.queue.end(current); + this.disposeNext(current); + var entry = current; + while (true) { + var from = entry.mixingFrom; + if (from == null) + break; + this.queue.end(from); + entry.mixingFrom = null; + entry.mixingTo = null; + entry = from; + } + this.tracks[current.trackIndex] = null; + this.queue.drain(); + }; + AnimationState.prototype.setCurrent = function (index, current, interrupt) { + var from = this.expandToIndex(index); + this.tracks[index] = current; + if (from != null) { + if (interrupt) + this.queue.interrupt(from); + current.mixingFrom = from; + from.mixingTo = current; + current.mixTime = 0; + if (from.mixingFrom != null && from.mixDuration > 0) + current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); + from.timelinesRotation.length = 0; + } + this.queue.start(current); + }; + AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.setAnimationWith(trackIndex, animation, loop); + }; + AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) { + if (animation == null) + throw new Error("animation cannot be null."); + var interrupt = true; + var current = this.expandToIndex(trackIndex); + if (current != null) { + if (current.nextTrackLast == -1) { + this.tracks[trackIndex] = current.mixingFrom; + this.queue.interrupt(current); + this.queue.end(current); + this.disposeNext(current); + current = current.mixingFrom; + interrupt = false; + } + else + this.disposeNext(current); + } + var entry = this.trackEntry(trackIndex, animation, loop, current); + this.setCurrent(trackIndex, entry, interrupt); + this.queue.drain(); + return entry; + }; + AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.addAnimationWith(trackIndex, animation, loop, delay); + }; + AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) { + if (animation == null) + throw new Error("animation cannot be null."); + var last = this.expandToIndex(trackIndex); + if (last != null) { + while (last.next != null) + last = last.next; + } + var entry = this.trackEntry(trackIndex, animation, loop, last); + if (last == null) { + this.setCurrent(trackIndex, entry, true); + this.queue.drain(); + } + else { + last.next = entry; + if (delay <= 0) { + var duration = last.animationEnd - last.animationStart; + if (duration != 0) { + if (last.loop) + delay += duration * (1 + ((last.trackTime / duration) | 0)); + else + delay += Math.max(duration, last.trackTime); + delay -= this.data.getMix(last.animation, animation); + } + else + delay = last.trackTime; + } + } + entry.delay = delay; + return entry; + }; + AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) { + var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) { + if (delay <= 0) + delay -= mixDuration; + var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.setEmptyAnimations = function (mixDuration) { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) { + var current = this.tracks[i]; + if (current != null) + this.setEmptyAnimation(current.trackIndex, mixDuration); + } + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.expandToIndex = function (index) { + if (index < this.tracks.length) + return this.tracks[index]; + spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null); + this.tracks.length = index + 1; + return null; + }; + AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) { + var entry = this.trackEntryPool.obtain(); + entry.trackIndex = trackIndex; + entry.animation = animation; + entry.loop = loop; + entry.holdPrevious = false; + entry.eventThreshold = 0; + entry.attachmentThreshold = 0; + entry.drawOrderThreshold = 0; + entry.animationStart = 0; + entry.animationEnd = animation.duration; + entry.animationLast = -1; + entry.nextAnimationLast = -1; + entry.delay = 0; + entry.trackTime = 0; + entry.trackLast = -1; + entry.nextTrackLast = -1; + entry.trackEnd = Number.MAX_VALUE; + entry.timeScale = 1; + entry.alpha = 1; + entry.interruptAlpha = 1; + entry.mixTime = 0; + entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); + return entry; + }; + AnimationState.prototype.disposeNext = function (entry) { + var next = entry.next; + while (next != null) { + this.queue.dispose(next); + next = next.next; + } + entry.next = null; + }; + AnimationState.prototype._animationsChanged = function () { + this.animationsChanged = false; + this.propertyIDs.clear(); + for (var i = 0, n = this.tracks.length; i < n; i++) { + var entry = this.tracks[i]; + if (entry == null) + continue; + while (entry.mixingFrom != null) + entry = entry.mixingFrom; + do { + if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add) + this.setTimelineModes(entry); + entry = entry.mixingTo; + } while (entry != null); + } + }; + AnimationState.prototype.setTimelineModes = function (entry) { + var to = entry.mixingTo; + var timelines = entry.animation.timelines; + var timelinesCount = entry.animation.timelines.length; + var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount); + entry.timelineHoldMix.length = 0; + var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount); + var propertyIDs = this.propertyIDs; + if (to != null && to.holdPrevious) { + for (var i = 0; i < timelinesCount; i++) { + propertyIDs.add(timelines[i].getPropertyId()); + timelineMode[i] = AnimationState.HOLD; + } + return; + } + outer: for (var i = 0; i < timelinesCount; i++) { + var id = timelines[i].getPropertyId(); + if (!propertyIDs.add(id)) + timelineMode[i] = AnimationState.SUBSEQUENT; + else if (to == null || !this.hasTimeline(to, id)) + timelineMode[i] = AnimationState.FIRST; + else { + for (var next = to.mixingTo; next != null; next = next.mixingTo) { + if (this.hasTimeline(next, id)) + continue; + if (entry.mixDuration > 0) { + timelineMode[i] = AnimationState.HOLD_MIX; + timelineDipMix[i] = next; + continue outer; + } + break; + } + timelineMode[i] = AnimationState.HOLD; + } + } + }; + AnimationState.prototype.hasTimeline = function (entry, id) { + var timelines = entry.animation.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + if (timelines[i].getPropertyId() == id) + return true; + return false; + }; + AnimationState.prototype.getCurrent = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return null; + return this.tracks[trackIndex]; + }; + AnimationState.prototype.addListener = function (listener) { + if (listener == null) + throw new Error("listener cannot be null."); + this.listeners.push(listener); + }; + AnimationState.prototype.removeListener = function (listener) { + var index = this.listeners.indexOf(listener); + if (index >= 0) + this.listeners.splice(index, 1); + }; + AnimationState.prototype.clearListeners = function () { + this.listeners.length = 0; + }; + AnimationState.prototype.clearListenerNotifications = function () { + this.queue.clear(); + }; + AnimationState.emptyAnimation = new spine.Animation("", [], 0); + AnimationState.SUBSEQUENT = 0; + AnimationState.FIRST = 1; + AnimationState.HOLD = 2; + AnimationState.HOLD_MIX = 3; + return AnimationState; + }()); + spine.AnimationState = AnimationState; + var TrackEntry = (function () { + function TrackEntry() { + this.mixBlend = spine.MixBlend.replace; + this.timelineMode = new Array(); + this.timelineHoldMix = new Array(); + this.timelinesRotation = new Array(); + } + TrackEntry.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; + }; + TrackEntry.prototype.getAnimationTime = function () { + if (this.loop) { + var duration = this.animationEnd - this.animationStart; + if (duration == 0) + return this.animationStart; + return (this.trackTime % duration) + this.animationStart; + } + return Math.min(this.trackTime + this.animationStart, this.animationEnd); + }; + TrackEntry.prototype.setAnimationLast = function (animationLast) { + this.animationLast = animationLast; + this.nextAnimationLast = animationLast; + }; + TrackEntry.prototype.isComplete = function () { + return this.trackTime >= this.animationEnd - this.animationStart; + }; + TrackEntry.prototype.resetRotationDirections = function () { + this.timelinesRotation.length = 0; + }; + return TrackEntry; + }()); + spine.TrackEntry = TrackEntry; + var EventQueue = (function () { + function EventQueue(animState) { + this.objects = []; + this.drainDisabled = false; + this.animState = animState; + } + EventQueue.prototype.start = function (entry) { + this.objects.push(EventType.start); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.interrupt = function (entry) { + this.objects.push(EventType.interrupt); + this.objects.push(entry); + }; + EventQueue.prototype.end = function (entry) { + this.objects.push(EventType.end); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.dispose = function (entry) { + this.objects.push(EventType.dispose); + this.objects.push(entry); + }; + EventQueue.prototype.complete = function (entry) { + this.objects.push(EventType.complete); + this.objects.push(entry); + }; + EventQueue.prototype.event = function (entry, event) { + this.objects.push(EventType.event); + this.objects.push(entry); + this.objects.push(event); + }; + EventQueue.prototype.drain = function () { + if (this.drainDisabled) + return; + this.drainDisabled = true; + var objects = this.objects; + var listeners = this.animState.listeners; + for (var i = 0; i < objects.length; i += 2) { + var type = objects[i]; + var entry = objects[i + 1]; + switch (type) { + case EventType.start: + if (entry.listener != null && entry.listener.start) + entry.listener.start(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].start) + listeners[ii].start(entry); + break; + case EventType.interrupt: + if (entry.listener != null && entry.listener.interrupt) + entry.listener.interrupt(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].interrupt) + listeners[ii].interrupt(entry); + break; + case EventType.end: + if (entry.listener != null && entry.listener.end) + entry.listener.end(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].end) + listeners[ii].end(entry); + case EventType.dispose: + if (entry.listener != null && entry.listener.dispose) + entry.listener.dispose(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].dispose) + listeners[ii].dispose(entry); + this.animState.trackEntryPool.free(entry); + break; + case EventType.complete: + if (entry.listener != null && entry.listener.complete) + entry.listener.complete(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].complete) + listeners[ii].complete(entry); + break; + case EventType.event: + var event_3 = objects[i++ + 2]; + if (entry.listener != null && entry.listener.event) + entry.listener.event(entry, event_3); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].event) + listeners[ii].event(entry, event_3); + break; + } + } + this.clear(); + this.drainDisabled = false; + }; + EventQueue.prototype.clear = function () { + this.objects.length = 0; + }; + return EventQueue; + }()); + spine.EventQueue = EventQueue; + var EventType; + (function (EventType) { + EventType[EventType["start"] = 0] = "start"; + EventType[EventType["interrupt"] = 1] = "interrupt"; + EventType[EventType["end"] = 2] = "end"; + EventType[EventType["dispose"] = 3] = "dispose"; + EventType[EventType["complete"] = 4] = "complete"; + EventType[EventType["event"] = 5] = "event"; + })(EventType = spine.EventType || (spine.EventType = {})); + var AnimationStateAdapter2 = (function () { + function AnimationStateAdapter2() { + } + AnimationStateAdapter2.prototype.start = function (entry) { + }; + AnimationStateAdapter2.prototype.interrupt = function (entry) { + }; + AnimationStateAdapter2.prototype.end = function (entry) { + }; + AnimationStateAdapter2.prototype.dispose = function (entry) { + }; + AnimationStateAdapter2.prototype.complete = function (entry) { + }; + AnimationStateAdapter2.prototype.event = function (entry, event) { + }; + return AnimationStateAdapter2; + }()); + spine.AnimationStateAdapter2 = AnimationStateAdapter2; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationStateData = (function () { + function AnimationStateData(skeletonData) { + this.animationToMixTime = {}; + this.defaultMix = 0; + if (skeletonData == null) + throw new Error("skeletonData cannot be null."); + this.skeletonData = skeletonData; + } + AnimationStateData.prototype.setMix = function (fromName, toName, duration) { + var from = this.skeletonData.findAnimation(fromName); + if (from == null) + throw new Error("Animation not found: " + fromName); + var to = this.skeletonData.findAnimation(toName); + if (to == null) + throw new Error("Animation not found: " + toName); + this.setMixWith(from, to, duration); + }; + AnimationStateData.prototype.setMixWith = function (from, to, duration) { + if (from == null) + throw new Error("from cannot be null."); + if (to == null) + throw new Error("to cannot be null."); + var key = from.name + "." + to.name; + this.animationToMixTime[key] = duration; + }; + AnimationStateData.prototype.getMix = function (from, to) { + var key = from.name + "." + to.name; + var value = this.animationToMixTime[key]; + return value === undefined ? this.defaultMix : value; + }; + return AnimationStateData; + }()); + spine.AnimationStateData = AnimationStateData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AssetManager = (function () { + function AssetManager(textureLoader, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.assets = {}; + this.errors = {}; + this.toLoad = 0; + this.loaded = 0; + this.textureLoader = textureLoader; + this.pathPrefix = pathPrefix; + } + AssetManager.downloadText = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.onload = function () { + if (request.status == 200) { + success(request.responseText); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.downloadBinary = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.responseType = "arraybuffer"; + request.onload = function () { + if (request.status == 200) { + success(new Uint8Array(request.response)); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.prototype.loadText = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (data) { + _this.assets[path] = data; + if (success) + success(path, data); + _this.toLoad--; + _this.loaded++; + }, function (state, responseText) { + _this.errors[path] = "Couldn't load text " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load text " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.loadTexture = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = path; + }; + AssetManager.prototype.loadTextureData = function (path, data, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = data; + }; + AssetManager.prototype.loadTextureAtlas = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + var parent = path.lastIndexOf("/") >= 0 ? path.substring(0, path.lastIndexOf("/")) : ""; + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (atlasData) { + var pagesLoaded = { count: 0 }; + var atlasPages = new Array(); + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + atlasPages.push(parent + "/" + path); + var image = document.createElement("img"); + image.width = 16; + image.height = 16; + return new spine.FakeTexture(image); + }); + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + return; + } + var _loop_1 = function (atlasPage) { + var pageLoadError = false; + _this.loadTexture(atlasPage, function (imagePath, image) { + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + if (!pageLoadError) { + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + return _this.get(parent + "/" + path); + }); + _this.assets[path] = atlas; + if (success) + success(path, atlas); + _this.toLoad--; + _this.loaded++; + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + } + } + else { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + } + }, function (imagePath, errorMessage) { + pageLoadError = true; + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + }); + }; + for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) { + var atlasPage = atlasPages_1[_i]; + _loop_1(atlasPage); + } + }, function (state, responseText) { + _this.errors[path] = "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.get = function (path) { + path = this.pathPrefix + path; + return this.assets[path]; + }; + AssetManager.prototype.remove = function (path) { + path = this.pathPrefix + path; + var asset = this.assets[path]; + if (asset.dispose) + asset.dispose(); + this.assets[path] = null; + }; + AssetManager.prototype.removeAll = function () { + for (var key in this.assets) { + var asset = this.assets[key]; + if (asset.dispose) + asset.dispose(); + } + this.assets = {}; + }; + AssetManager.prototype.isLoadingComplete = function () { + return this.toLoad == 0; + }; + AssetManager.prototype.getToLoad = function () { + return this.toLoad; + }; + AssetManager.prototype.getLoaded = function () { + return this.loaded; + }; + AssetManager.prototype.dispose = function () { + this.removeAll(); + }; + AssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + AssetManager.prototype.getErrors = function () { + return this.errors; + }; + return AssetManager; + }()); + spine.AssetManager = AssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AtlasAttachmentLoader = (function () { + function AtlasAttachmentLoader(atlas) { + this.atlas = atlas; + } + AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.RegionAttachment(name); + attachment.setRegion(region); + return attachment; + }; + AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.MeshAttachment(name); + attachment.region = region; + return attachment; + }; + AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) { + return new spine.BoundingBoxAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) { + return new spine.PathAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) { + return new spine.PointAttachment(name); + }; + AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) { + return new spine.ClippingAttachment(name); + }; + return AtlasAttachmentLoader; + }()); + spine.AtlasAttachmentLoader = AtlasAttachmentLoader; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BlendMode; + (function (BlendMode) { + BlendMode[BlendMode["Normal"] = 0] = "Normal"; + BlendMode[BlendMode["Additive"] = 1] = "Additive"; + BlendMode[BlendMode["Multiply"] = 2] = "Multiply"; + BlendMode[BlendMode["Screen"] = 3] = "Screen"; + })(BlendMode = spine.BlendMode || (spine.BlendMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Bone = (function () { + function Bone(data, skeleton, parent) { + 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 = false; + this.a = 0; + this.b = 0; + this.worldX = 0; + this.c = 0; + this.d = 0; + this.worldY = 0; + this.sorted = false; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.skeleton = skeleton; + this.parent = parent; + this.setToSetupPose(); + } + Bone.prototype.update = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransform = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) { + this.ax = x; + this.ay = y; + this.arotation = rotation; + this.ascaleX = scaleX; + this.ascaleY = scaleY; + this.ashearX = shearX; + this.ashearY = shearY; + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + var skeleton = this.skeleton; + var rotationY = rotation + 90 + shearY; + var sx = skeleton.scaleX; + var sy = skeleton.scaleY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy; + this.worldX = x * sx + skeleton.x; + this.worldY = y * sy + skeleton.y; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + this.worldX = pa * x + pb * y + parent.worldX; + this.worldY = pc * x + pd * y + parent.worldY; + switch (this.data.transformMode) { + case spine.TransformMode.Normal: { + var rotationY = rotation + 90 + shearY; + var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(rotationY) * scaleY; + var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(rotationY) * scaleY; + this.a = pa * la + pb * lc; + this.b = pa * lb + pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + return; + } + case spine.TransformMode.OnlyTranslation: { + var rotationY = rotation + 90 + shearY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY; + break; + } + case spine.TransformMode.NoRotationOrReflection: { + var s = pa * pa + pc * pc; + var prx = 0; + if (s > 0.0001) { + s = Math.abs(pa * pd - pb * pc) / s; + pb = pc * s; + pd = pa * s; + prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg; + } + else { + pa = 0; + pc = 0; + prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg; + } + var rx = rotation + shearX - prx; + var ry = rotation + shearY - prx + 90; + var la = spine.MathUtils.cosDeg(rx) * scaleX; + var lb = spine.MathUtils.cosDeg(ry) * scaleY; + var lc = spine.MathUtils.sinDeg(rx) * scaleX; + var ld = spine.MathUtils.sinDeg(ry) * scaleY; + this.a = pa * la - pb * lc; + this.b = pa * lb - pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + break; + } + case spine.TransformMode.NoScale: + case spine.TransformMode.NoScaleOrReflection: { + var cos = spine.MathUtils.cosDeg(rotation); + var sin = spine.MathUtils.sinDeg(rotation); + var za = (pa * cos + pb * sin) / this.skeleton.scaleX; + var zc = (pc * cos + pd * sin) / this.skeleton.scaleY; + var s = Math.sqrt(za * za + zc * zc); + if (s > 0.00001) + s = 1 / s; + za *= s; + zc *= s; + s = Math.sqrt(za * za + zc * zc); + if (this.data.transformMode == spine.TransformMode.NoScale + && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) + s = -s; + var r = Math.PI / 2 + Math.atan2(zc, za); + var zb = Math.cos(r) * s; + var zd = Math.sin(r) * s; + var la = spine.MathUtils.cosDeg(shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY; + var lc = spine.MathUtils.sinDeg(shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY; + this.a = za * la + zb * lc; + this.b = za * lb + zb * ld; + this.c = zc * la + zd * lc; + this.d = zc * lb + zd * ld; + break; + } + } + this.a *= this.skeleton.scaleX; + this.b *= this.skeleton.scaleX; + this.c *= this.skeleton.scaleY; + this.d *= this.skeleton.scaleY; + }; + Bone.prototype.setToSetupPose = function () { + var data = this.data; + this.x = data.x; + this.y = data.y; + this.rotation = data.rotation; + this.scaleX = data.scaleX; + this.scaleY = data.scaleY; + this.shearX = data.shearX; + this.shearY = data.shearY; + }; + Bone.prototype.getWorldRotationX = function () { + return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldRotationY = function () { + return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldScaleX = function () { + return Math.sqrt(this.a * this.a + this.c * this.c); + }; + Bone.prototype.getWorldScaleY = function () { + return Math.sqrt(this.b * this.b + this.d * this.d); + }; + Bone.prototype.updateAppliedTransform = function () { + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + this.ax = this.worldX; + this.ay = this.worldY; + this.arotation = Math.atan2(this.c, this.a) * spine.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; + this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + var pid = 1 / (pa * pd - pb * pc); + var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; + this.ax = (dx * pd * pid - dy * pb * pid); + this.ay = (dy * pa * pid - dx * pc * pid); + var ia = pid * pd; + var id = pid * pa; + var ib = pid * pb; + var ic = pid * pc; + var ra = ia * this.a - ib * this.c; + var rb = ia * this.b - ib * this.d; + var rc = id * this.c - ic * this.a; + var rd = id * this.d - ic * this.b; + this.ashearX = 0; + this.ascaleX = Math.sqrt(ra * ra + rc * rc); + if (this.ascaleX > 0.0001) { + var det = ra * rd - rb * rc; + this.ascaleY = det / this.ascaleX; + this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg; + this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg; + } + else { + this.ascaleX = 0; + this.ascaleY = Math.sqrt(rb * rb + rd * rd); + this.ashearY = 0; + this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg; + } + }; + Bone.prototype.worldToLocal = function (world) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var invDet = 1 / (a * d - b * c); + var x = world.x - this.worldX, y = world.y - this.worldY; + world.x = (x * d * invDet - y * b * invDet); + world.y = (y * a * invDet - x * c * invDet); + return world; + }; + Bone.prototype.localToWorld = function (local) { + var x = local.x, y = local.y; + local.x = x * this.a + y * this.b + this.worldX; + local.y = x * this.c + y * this.d + this.worldY; + return local; + }; + Bone.prototype.worldToLocalRotation = function (worldRotation) { + var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation); + return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX; + }; + Bone.prototype.localToWorldRotation = function (localRotation) { + localRotation -= this.rotation - this.shearX; + var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation); + return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.rotateWorld = function (degrees) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees); + this.a = cos * a - sin * c; + this.b = cos * b - sin * d; + this.c = sin * a + cos * c; + this.d = sin * b + cos * d; + this.appliedValid = false; + }; + return Bone; + }()); + spine.Bone = Bone; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoneData = (function () { + function BoneData(index, name, parent) { + this.x = 0; + this.y = 0; + this.rotation = 0; + this.scaleX = 1; + this.scaleY = 1; + this.shearX = 0; + this.shearY = 0; + this.transformMode = TransformMode.Normal; + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + this.index = index; + this.name = name; + this.parent = parent; + } + return BoneData; + }()); + spine.BoneData = BoneData; + var TransformMode; + (function (TransformMode) { + TransformMode[TransformMode["Normal"] = 0] = "Normal"; + TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation"; + TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; + TransformMode[TransformMode["NoScale"] = 3] = "NoScale"; + TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; + })(TransformMode = spine.TransformMode || (spine.TransformMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Event = (function () { + function Event(time, data) { + if (data == null) + throw new Error("data cannot be null."); + this.time = time; + this.data = data; + } + return Event; + }()); + spine.Event = Event; +})(spine || (spine = {})); +var spine; +(function (spine) { + var EventData = (function () { + function EventData(name) { + this.name = name; + } + return EventData; + }()); + spine.EventData = EventData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraint = (function () { + function IkConstraint(data, skeleton) { + this.bendDirection = 0; + this.compress = false; + this.stretch = false; + this.mix = 1; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.mix = data.mix; + this.bendDirection = data.bendDirection; + this.compress = data.compress; + this.stretch = data.stretch; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + IkConstraint.prototype.getOrder = function () { + return this.data.order; + }; + IkConstraint.prototype.apply = function () { + this.update(); + }; + IkConstraint.prototype.update = function () { + var target = this.target; + var bones = this.bones; + switch (bones.length) { + case 1: + this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix); + break; + case 2: + this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix); + break; + } + }; + IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) { + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var p = bone.parent; + var id = 1 / (p.a * p.d - p.b * p.c); + var x = targetX - p.worldX, y = targetY - p.worldY; + var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay; + var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation; + if (bone.ascaleX < 0) + rotationIK += 180; + if (rotationIK > 180) + rotationIK -= 360; + else if (rotationIK < -180) + rotationIK += 360; + var sx = bone.ascaleX, sy = bone.ascaleY; + if (compress || stretch) { + var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty); + if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) { + var s = (dd / b - 1) * alpha + 1; + sx *= s; + if (uniform) + sy *= s; + } + } + bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY); + }; + IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) { + if (alpha == 0) { + child.updateWorldTransform(); + return; + } + if (!parent.appliedValid) + parent.updateAppliedTransform(); + if (!child.appliedValid) + child.updateAppliedTransform(); + var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX; + var os1 = 0, os2 = 0, s2 = 0; + if (psx < 0) { + psx = -psx; + os1 = 180; + s2 = -1; + } + else { + os1 = 0; + s2 = 1; + } + if (psy < 0) { + psy = -psy; + s2 = -s2; + } + if (csx < 0) { + csx = -csx; + os2 = 180; + } + else + os2 = 0; + var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; + var u = Math.abs(psx - psy) <= 0.0001; + if (!u) { + cy = 0; + cwx = a * cx + parent.worldX; + cwy = c * cx + parent.worldY; + } + else { + cy = child.ay; + cwx = a * cx + b * cy + parent.worldX; + cwy = c * cx + d * cy + parent.worldY; + } + var pp = parent.parent; + a = pp.a; + b = pp.b; + c = pp.c; + d = pp.d; + var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY; + var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty; + x = cwx - pp.worldX; + y = cwy - pp.worldY; + var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; + var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0; + outer: if (u) { + l2 *= psx; + var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); + if (cos < -1) + cos = -1; + else if (cos > 1) { + cos = 1; + if (stretch && l1 + l2 > 0.0001) + sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1; + } + a2 = Math.acos(cos) * bendDir; + a = l1 + l2 * cos; + b = l2 * Math.sin(a2); + a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b); + } + else { + a = psx * l2; + b = psy * l2; + var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); + c = bb * l1 * l1 + aa * dd - aa * bb; + var c1 = -2 * bb * l1, c2 = bb - aa; + d = c1 * c1 - 4 * c2 * c; + if (d >= 0) { + var q = Math.sqrt(d); + if (c1 < 0) + q = -q; + q = -(c1 + q) / 2; + var r0 = q / c2, r1 = c / q; + var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; + if (r * r <= dd) { + y = Math.sqrt(dd - r * r) * bendDir; + a1 = ta - Math.atan2(y, r); + a2 = Math.atan2(y / psy, (r - l1) / psx); + break outer; + } + } + var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; + var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; + c = -a * l1 / (aa - bb); + if (c >= -1 && c <= 1) { + c = Math.acos(c); + x = a * Math.cos(c) + l1; + y = b * Math.sin(c); + d = x * x + y * y; + if (d < minDist) { + minAngle = c; + minDist = d; + minX = x; + minY = y; + } + if (d > maxDist) { + maxAngle = c; + maxDist = d; + maxX = x; + maxY = y; + } + } + if (dd <= (minDist + maxDist) / 2) { + a1 = ta - Math.atan2(minY * bendDir, minX); + a2 = minAngle * bendDir; + } + else { + a1 = ta - Math.atan2(maxY * bendDir, maxX); + a2 = maxAngle * bendDir; + } + } + var os = Math.atan2(cy, cx) * s2; + var rotation = parent.arotation; + a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation; + if (a1 > 180) + a1 -= 360; + else if (a1 < -180) + a1 += 360; + parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0); + rotation = child.arotation; + a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; + if (a2 > 180) + a2 -= 360; + else if (a2 < -180) + a2 += 360; + child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); + }; + return IkConstraint; + }()); + spine.IkConstraint = IkConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraintData = (function () { + function IkConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.bendDirection = 1; + this.compress = false; + this.stretch = false; + this.uniform = false; + this.mix = 1; + this.name = name; + } + return IkConstraintData; + }()); + spine.IkConstraintData = IkConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraint = (function () { + function PathConstraint(data, skeleton) { + 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(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0, n = data.bones.length; i < n; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findSlot(data.target.name); + this.position = data.position; + this.spacing = data.spacing; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + } + PathConstraint.prototype.apply = function () { + this.update(); + }; + PathConstraint.prototype.update = function () { + var attachment = this.target.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + return; + var rotateMix = this.rotateMix, translateMix = this.translateMix; + var translate = translateMix > 0, rotate = rotateMix > 0; + if (!translate && !rotate) + return; + var data = this.data; + var percentSpacing = data.spacingMode == spine.SpacingMode.Percent; + var rotateMode = data.rotateMode; + var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale; + var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1; + var bones = this.bones; + var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null; + var spacing = this.spacing; + if (scale || !percentSpacing) { + if (scale) + lengths = spine.Utils.setArraySize(this.lengths, boneCount); + var lengthSpacing = data.spacingMode == spine.SpacingMode.Length; + for (var i = 0, n = spacesCount - 1; i < n;) { + var bone = bones[i]; + var setupLength = bone.data.length; + if (setupLength < PathConstraint.epsilon) { + if (scale) + lengths[i] = 0; + spaces[++i] = 0; + } + else if (percentSpacing) { + if (scale) { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_1 = Math.sqrt(x * x + y * y); + lengths[i] = length_1; + } + spaces[++i] = spacing; + } + else { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_2 = Math.sqrt(x * x + y * y); + if (scale) + lengths[i] = length_2; + spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength; + } + } + } + else { + for (var i = 1; i < spacesCount; i++) + spaces[i] = spacing; + } + var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing); + var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; + var tip = false; + if (offsetRotation == 0) + tip = rotateMode == spine.RotateMode.Chain; + else { + tip = false; + var p = this.target.bone; + offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + } + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.worldX += (boneX - bone.worldX) * translateMix; + bone.worldY += (boneY - bone.worldY) * translateMix; + var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; + if (scale) { + var length_3 = lengths[i]; + if (length_3 != 0) { + var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1; + bone.a *= s; + bone.c *= s; + } + } + boneX = x; + boneY = y; + if (rotate) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; + if (tangents) + r = positions[p - 1]; + else if (spaces[i + 1] == 0) + r = positions[p + 2]; + else + r = Math.atan2(dy, dx); + r -= Math.atan2(c, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_4 = bone.data.length; + boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix; + boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix; + } + else { + r += offsetRotation; + } + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + } + bone.appliedValid = false; + } + }; + PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) { + var target = this.target; + var position = this.position; + var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null; + var closed = path.closed; + var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE; + if (!path.constantSpeed) { + var lengths = path.lengths; + curveCount -= closed ? 1 : 2; + var pathLength_1 = lengths[curveCount]; + if (percentPosition) + position *= pathLength_1; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength_1; + } + world = spine.Utils.setArraySize(this.world, 8); + for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength_1; + if (p < 0) + p += pathLength_1; + curve = 0; + } + else if (p < 0) { + if (prevCurve != PathConstraint.BEFORE) { + prevCurve = PathConstraint.BEFORE; + path.computeWorldVertices(target, 2, 4, world, 0, 2); + } + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength_1) { + if (prevCurve != PathConstraint.AFTER) { + prevCurve = PathConstraint.AFTER; + path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2); + } + this.addAfterPosition(p - pathLength_1, world, 0, out, o); + continue; + } + for (;; curve++) { + var length_5 = lengths[curve]; + if (p > length_5) + continue; + if (curve == 0) + p /= length_5; + else { + var prev = lengths[curve - 1]; + p = (p - prev) / (length_5 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + if (closed && curve == curveCount) { + path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2); + path.computeWorldVertices(target, 0, 4, world, 4, 2); + } + else + path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2); + } + this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0)); + } + return out; + } + if (closed) { + verticesLength += 2; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2); + path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2); + world[verticesLength - 2] = world[0]; + world[verticesLength - 1] = world[1]; + } + else { + curveCount--; + verticesLength -= 4; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength, world, 0, 2); + } + var curves = spine.Utils.setArraySize(this.curves, curveCount); + var pathLength = 0; + var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = world[w]; + cy1 = world[w + 1]; + cx2 = world[w + 2]; + cy2 = world[w + 3]; + x2 = world[w + 4]; + y2 = world[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) + position *= pathLength; + else + position *= pathLength / path.lengths[curveCount - 1]; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength; + } + var segments = this.segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength) { + this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); + continue; + } + for (;; curve++) { + var length_6 = curves[curve]; + if (p > length_6) + continue; + if (curve == 0) + p /= length_6; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_6 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + var ii = curve * 6; + x1 = world[ii]; + y1 = world[ii + 1]; + cx1 = world[ii + 2]; + cy1 = world[ii + 3]; + cx2 = world[ii + 4]; + cy2 = world[ii + 5]; + x2 = world[ii + 6]; + y2 = world[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + p *= curveLength; + for (;; segment++) { + var length_7 = segments[segment]; + if (p > length_7) + continue; + if (segment == 0) + p /= length_7; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_7 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0)); + } + return out; + }; + PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) { + var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) { + var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { + if (p == 0 || isNaN(p)) { + out[o] = x1; + out[o + 1] = y1; + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + return; + } + var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; + var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; + var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; + out[o] = x; + out[o + 1] = y; + if (tangents) { + if (p < 0.001) + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + else + out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); + } + }; + PathConstraint.prototype.getOrder = function () { + return this.data.order; + }; + PathConstraint.NONE = -1; + PathConstraint.BEFORE = -2; + PathConstraint.AFTER = -3; + PathConstraint.epsilon = 0.00001; + return PathConstraint; + }()); + spine.PathConstraint = PathConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraintData = (function () { + function PathConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.name = name; + } + return PathConstraintData; + }()); + spine.PathConstraintData = PathConstraintData; + var PositionMode; + (function (PositionMode) { + PositionMode[PositionMode["Fixed"] = 0] = "Fixed"; + PositionMode[PositionMode["Percent"] = 1] = "Percent"; + })(PositionMode = spine.PositionMode || (spine.PositionMode = {})); + var SpacingMode; + (function (SpacingMode) { + SpacingMode[SpacingMode["Length"] = 0] = "Length"; + SpacingMode[SpacingMode["Fixed"] = 1] = "Fixed"; + SpacingMode[SpacingMode["Percent"] = 2] = "Percent"; + })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {})); + var RotateMode; + (function (RotateMode) { + RotateMode[RotateMode["Tangent"] = 0] = "Tangent"; + RotateMode[RotateMode["Chain"] = 1] = "Chain"; + RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale"; + })(RotateMode = spine.RotateMode || (spine.RotateMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Assets = (function () { + function Assets(clientId) { + this.toLoad = new Array(); + this.assets = {}; + this.clientId = clientId; + } + Assets.prototype.loaded = function () { + var i = 0; + for (var v in this.assets) + i++; + return i; + }; + return Assets; + }()); + var SharedAssetManager = (function () { + function SharedAssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.clientAssets = {}; + this.queuedAssets = {}; + this.rawAssets = {}; + this.errors = {}; + this.pathPrefix = pathPrefix; + } + SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) { + clientAssets = new Assets(clientId); + this.clientAssets[clientId] = clientAssets; + } + if (textureLoader !== null) + clientAssets.textureLoader = textureLoader; + clientAssets.toLoad.push(path); + if (this.queuedAssets[path] === path) { + return false; + } + else { + this.queuedAssets[path] = path; + return true; + } + }; + SharedAssetManager.prototype.loadText = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = request.responseText; + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadJson = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = JSON.parse(request.responseText); + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, textureLoader, path)) + return; + var img = new Image(); + img.src = path; + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + _this.rawAssets[path] = img; + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + }; + }; + SharedAssetManager.prototype.get = function (clientId, path) { + path = this.pathPrefix + path; + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + return clientAssets.assets[path]; + }; + SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { + for (var i = 0; i < clientAssets.toLoad.length; i++) { + var path = clientAssets.toLoad[i]; + var asset = clientAssets.assets[path]; + if (asset === null || asset === undefined) { + var rawAsset = this.rawAssets[path]; + if (rawAsset === null || rawAsset === undefined) + continue; + if (rawAsset instanceof HTMLImageElement) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } + } + } + }; + SharedAssetManager.prototype.isLoadingComplete = function (clientId) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + this.updateClientAssets(clientAssets); + return clientAssets.toLoad.length == clientAssets.loaded(); + }; + SharedAssetManager.prototype.dispose = function () { + }; + SharedAssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + SharedAssetManager.prototype.getErrors = function () { + return this.errors; + }; + return SharedAssetManager; + }()); + spine.SharedAssetManager = SharedAssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skeleton = (function () { + function Skeleton(data) { + this._updateCache = new Array(); + this.updateCacheReset = new Array(); + this.time = 0; + this.scaleX = 1; + this.scaleY = 1; + this.x = 0; + this.y = 0; + if (data == null) + throw new Error("data cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) { + var boneData = data.bones[i]; + var bone = void 0; + if (boneData.parent == null) + bone = new spine.Bone(boneData, this, null); + else { + var parent_1 = this.bones[boneData.parent.index]; + bone = new spine.Bone(boneData, this, parent_1); + parent_1.children.push(bone); + } + this.bones.push(bone); + } + this.slots = new Array(); + this.drawOrder = new Array(); + for (var i = 0; i < data.slots.length; i++) { + var slotData = data.slots[i]; + var bone = this.bones[slotData.boneData.index]; + var slot = new spine.Slot(slotData, bone); + this.slots.push(slot); + this.drawOrder.push(slot); + } + this.ikConstraints = new Array(); + for (var i = 0; i < data.ikConstraints.length; i++) { + var ikConstraintData = data.ikConstraints[i]; + this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this)); + } + this.transformConstraints = new Array(); + for (var i = 0; i < data.transformConstraints.length; i++) { + var transformConstraintData = data.transformConstraints[i]; + this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this)); + } + this.pathConstraints = new Array(); + for (var i = 0; i < data.pathConstraints.length; i++) { + var pathConstraintData = data.pathConstraints[i]; + this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this)); + } + this.color = new spine.Color(1, 1, 1, 1); + this.updateCache(); + } + Skeleton.prototype.updateCache = function () { + var updateCache = this._updateCache; + updateCache.length = 0; + this.updateCacheReset.length = 0; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].sorted = false; + var ikConstraints = this.ikConstraints; + var transformConstraints = this.transformConstraints; + var pathConstraints = this.pathConstraints; + var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length; + var constraintCount = ikCount + transformCount + pathCount; + outer: for (var i = 0; i < constraintCount; i++) { + for (var ii = 0; ii < ikCount; ii++) { + var constraint = ikConstraints[ii]; + if (constraint.data.order == i) { + this.sortIkConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < transformCount; ii++) { + var constraint = transformConstraints[ii]; + if (constraint.data.order == i) { + this.sortTransformConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < pathCount; ii++) { + var constraint = pathConstraints[ii]; + if (constraint.data.order == i) { + this.sortPathConstraint(constraint); + continue outer; + } + } + } + for (var i = 0, n = bones.length; i < n; i++) + this.sortBone(bones[i]); + }; + Skeleton.prototype.sortIkConstraint = function (constraint) { + var target = constraint.target; + this.sortBone(target); + var constrained = constraint.bones; + var parent = constrained[0]; + this.sortBone(parent); + if (constrained.length > 1) { + var child = constrained[constrained.length - 1]; + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + this._updateCache.push(constraint); + this.sortReset(parent.children); + constrained[constrained.length - 1].sorted = true; + }; + Skeleton.prototype.sortPathConstraint = function (constraint) { + var slot = constraint.target; + var slotIndex = slot.data.index; + var slotBone = slot.bone; + if (this.skin != null) + this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); + if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin) + this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); + for (var i = 0, n = this.data.skins.length; i < n; i++) + this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone); + var attachment = slot.getAttachment(); + if (attachment instanceof spine.PathAttachment) + this.sortPathConstraintAttachmentWith(attachment, slotBone); + var constrained = constraint.bones; + var boneCount = constrained.length; + for (var i = 0; i < boneCount; i++) + this.sortBone(constrained[i]); + this._updateCache.push(constraint); + for (var i = 0; i < boneCount; i++) + this.sortReset(constrained[i].children); + for (var i = 0; i < boneCount; i++) + constrained[i].sorted = true; + }; + Skeleton.prototype.sortTransformConstraint = function (constraint) { + this.sortBone(constraint.target); + var constrained = constraint.bones; + var boneCount = constrained.length; + if (constraint.data.local) { + for (var i = 0; i < boneCount; i++) { + var child = constrained[i]; + this.sortBone(child.parent); + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + } + else { + for (var i = 0; i < boneCount; i++) { + this.sortBone(constrained[i]); + } + } + this._updateCache.push(constraint); + for (var ii = 0; ii < boneCount; ii++) + this.sortReset(constrained[ii].children); + for (var ii = 0; ii < boneCount; ii++) + constrained[ii].sorted = true; + }; + Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) { + var attachments = skin.attachments[slotIndex]; + if (!attachments) + return; + for (var key in attachments) { + this.sortPathConstraintAttachmentWith(attachments[key], slotBone); + } + }; + Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) { + if (!(attachment instanceof spine.PathAttachment)) + return; + var pathBones = attachment.bones; + if (pathBones == null) + this.sortBone(slotBone); + else { + var bones = this.bones; + var i = 0; + while (i < pathBones.length) { + var boneCount = pathBones[i++]; + for (var n = i + boneCount; i < n; i++) { + var boneIndex = pathBones[i]; + this.sortBone(bones[boneIndex]); + } + } + } + }; + Skeleton.prototype.sortBone = function (bone) { + if (bone.sorted) + return; + var parent = bone.parent; + if (parent != null) + this.sortBone(parent); + bone.sorted = true; + this._updateCache.push(bone); + }; + Skeleton.prototype.sortReset = function (bones) { + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.sorted) + this.sortReset(bone.children); + bone.sorted = false; + } + }; + Skeleton.prototype.updateWorldTransform = function () { + var updateCacheReset = this.updateCacheReset; + for (var i = 0, n = updateCacheReset.length; i < n; i++) { + var bone = updateCacheReset[i]; + bone.ax = bone.x; + bone.ay = bone.y; + bone.arotation = bone.rotation; + bone.ascaleX = bone.scaleX; + bone.ascaleY = bone.scaleY; + bone.ashearX = bone.shearX; + bone.ashearY = bone.shearY; + bone.appliedValid = true; + } + var updateCache = this._updateCache; + for (var i = 0, n = updateCache.length; i < n; i++) + updateCache[i].update(); + }; + Skeleton.prototype.setToSetupPose = function () { + this.setBonesToSetupPose(); + this.setSlotsToSetupPose(); + }; + Skeleton.prototype.setBonesToSetupPose = function () { + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].setToSetupPose(); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + var data = constraint.data; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + } + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + var data = constraint.data; + constraint.position = data.position; + constraint.spacing = data.spacing; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + } + }; + Skeleton.prototype.setSlotsToSetupPose = function () { + var slots = this.slots; + spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); + for (var i = 0, n = slots.length; i < n; i++) + slots[i].setToSetupPose(); + }; + Skeleton.prototype.getRootBone = function () { + if (this.bones.length == 0) + return null; + return this.bones[0]; + }; + Skeleton.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.data.name == boneName) + return bone; + } + return null; + }; + Skeleton.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].data.name == boneName) + return i; + return -1; + }; + Skeleton.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) + return slot; + } + return null; + }; + Skeleton.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].data.name == slotName) + return i; + return -1; + }; + Skeleton.prototype.setSkinByName = function (skinName) { + var skin = this.data.findSkin(skinName); + if (skin == null) + throw new Error("Skin not found: " + skinName); + this.setSkin(skin); + }; + Skeleton.prototype.setSkin = function (newSkin) { + if (newSkin != null) { + if (this.skin != null) + newSkin.attachAll(this, this.skin); + else { + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var name_1 = slot.data.attachmentName; + if (name_1 != null) { + var attachment = newSkin.getAttachment(i, name_1); + if (attachment != null) + slot.setAttachment(attachment); + } + } + } + } + this.skin = newSkin; + }; + Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) { + return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName); + }; + Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) { + if (attachmentName == null) + throw new Error("attachmentName cannot be null."); + if (this.skin != null) { + var attachment = this.skin.getAttachment(slotIndex, attachmentName); + if (attachment != null) + return attachment; + } + if (this.data.defaultSkin != null) + return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); + return null; + }; + Skeleton.prototype.setAttachment = function (slotName, attachmentName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) { + var attachment = null; + if (attachmentName != null) { + attachment = this.getAttachment(i, attachmentName); + if (attachment == null) + throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName); + } + slot.setAttachment(attachment); + return; + } + } + throw new Error("Slot not found: " + slotName); + }; + Skeleton.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var ikConstraint = ikConstraints[i]; + if (ikConstraint.data.name == constraintName) + return ikConstraint; + } + return null; + }; + Skeleton.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.getBounds = function (offset, size, temp) { + if (temp === void 0) { temp = new Array(2); } + if (offset == null) + throw new Error("offset cannot be null."); + if (size == null) + throw new Error("size cannot be null."); + var drawOrder = this.drawOrder; + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var verticesLength = 0; + var vertices = null; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + verticesLength = 8; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + attachment.computeWorldVertices(slot.bone, vertices, 0, 2); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + verticesLength = mesh.worldVerticesLength; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2); + } + if (vertices != null) { + for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + } + offset.set(minX, minY); + size.set(maxX - minX, maxY - minY); + }; + Skeleton.prototype.update = function (delta) { + this.time += delta; + }; + return Skeleton; + }()); + spine.Skeleton = Skeleton; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonBounds = (function () { + function SkeletonBounds() { + this.minX = 0; + this.minY = 0; + this.maxX = 0; + this.maxY = 0; + this.boundingBoxes = new Array(); + this.polygons = new Array(); + this.polygonPool = new spine.Pool(function () { + return spine.Utils.newFloatArray(16); + }); + } + SkeletonBounds.prototype.update = function (skeleton, updateAabb) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + var boundingBoxes = this.boundingBoxes; + var polygons = this.polygons; + var polygonPool = this.polygonPool; + var slots = skeleton.slots; + var slotCount = slots.length; + boundingBoxes.length = 0; + polygonPool.freeAll(polygons); + polygons.length = 0; + for (var i = 0; i < slotCount; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.BoundingBoxAttachment) { + var boundingBox = attachment; + boundingBoxes.push(boundingBox); + var polygon = polygonPool.obtain(); + if (polygon.length != boundingBox.worldVerticesLength) { + polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength); + } + polygons.push(polygon); + boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2); + } + } + if (updateAabb) { + this.aabbCompute(); + } + else { + this.minX = Number.POSITIVE_INFINITY; + this.minY = Number.POSITIVE_INFINITY; + this.maxX = Number.NEGATIVE_INFINITY; + this.maxY = Number.NEGATIVE_INFINITY; + } + }; + SkeletonBounds.prototype.aabbCompute = function () { + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + var vertices = polygon; + for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) { + var x = vertices[ii]; + var y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + this.minX = minX; + this.minY = minY; + this.maxX = maxX; + this.maxY = maxY; + }; + SkeletonBounds.prototype.aabbContainsPoint = function (x, y) { + return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; + }; + SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) { + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) + return false; + var m = (y2 - y1) / (x2 - x1); + var y = m * (minX - x1) + y1; + if (y > minY && y < maxY) + return true; + y = m * (maxX - x1) + y1; + if (y > minY && y < maxY) + return true; + var x = (minY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + x = (maxY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + return false; + }; + SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) { + return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; + }; + SkeletonBounds.prototype.containsPoint = function (x, y) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.containsPointPolygon(polygons[i], x, y)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) { + var vertices = polygon; + var nn = polygon.length; + var prevIndex = nn - 2; + var inside = false; + for (var ii = 0; ii < nn; ii += 2) { + var vertexY = vertices[ii + 1]; + var prevY = vertices[prevIndex + 1]; + if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { + var vertexX = vertices[ii]; + if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) + inside = !inside; + } + prevIndex = ii; + } + return inside; + }; + SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) { + var vertices = polygon; + var nn = polygon.length; + var width12 = x1 - x2, height12 = y1 - y2; + var det1 = x1 * y2 - y1 * x2; + var x3 = vertices[nn - 2], y3 = vertices[nn - 1]; + for (var ii = 0; ii < nn; ii += 2) { + var x4 = vertices[ii], y4 = vertices[ii + 1]; + var det2 = x3 * y4 - y3 * x4; + var width34 = x3 - x4, height34 = y3 - y4; + var det3 = width12 * height34 - height12 * width34; + var x = (det1 * width34 - width12 * det2) / det3; + if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { + var y = (det1 * height34 - height12 * det2) / det3; + if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) + return true; + } + x3 = x4; + y3 = y4; + } + return false; + }; + SkeletonBounds.prototype.getPolygon = function (boundingBox) { + if (boundingBox == null) + throw new Error("boundingBox cannot be null."); + var index = this.boundingBoxes.indexOf(boundingBox); + return index == -1 ? null : this.polygons[index]; + }; + SkeletonBounds.prototype.getWidth = function () { + return this.maxX - this.minX; + }; + SkeletonBounds.prototype.getHeight = function () { + return this.maxY - this.minY; + }; + return SkeletonBounds; + }()); + spine.SkeletonBounds = SkeletonBounds; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonClipping = (function () { + function SkeletonClipping() { + this.triangulator = new spine.Triangulator(); + this.clippingPolygon = new Array(); + this.clipOutput = new Array(); + this.clippedVertices = new Array(); + this.clippedTriangles = new Array(); + this.scratch = new Array(); + } + SkeletonClipping.prototype.clipStart = function (slot, clip) { + if (this.clipAttachment != null) + return 0; + this.clipAttachment = clip; + var n = clip.worldVerticesLength; + var vertices = spine.Utils.setArraySize(this.clippingPolygon, n); + clip.computeWorldVertices(slot, 0, n, vertices, 0, 2); + var clippingPolygon = this.clippingPolygon; + SkeletonClipping.makeClockwise(clippingPolygon); + var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); + for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) { + var polygon = clippingPolygons[i]; + SkeletonClipping.makeClockwise(polygon); + polygon.push(polygon[0]); + polygon.push(polygon[1]); + } + return clippingPolygons.length; + }; + SkeletonClipping.prototype.clipEndWithSlot = function (slot) { + if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data) + this.clipEnd(); + }; + SkeletonClipping.prototype.clipEnd = function () { + if (this.clipAttachment == null) + return; + this.clipAttachment = null; + this.clippingPolygons = null; + this.clippedVertices.length = 0; + this.clippedTriangles.length = 0; + this.clippingPolygon.length = 0; + }; + SkeletonClipping.prototype.isClipping = function () { + return this.clipAttachment != null; + }; + SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) { + var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; + var clippedTriangles = this.clippedTriangles; + var polygons = this.clippingPolygons; + var polygonsCount = this.clippingPolygons.length; + var vertexSize = twoColor ? 12 : 8; + var index = 0; + clippedVertices.length = 0; + clippedTriangles.length = 0; + outer: for (var i = 0; i < trianglesLength; i += 3) { + var vertexOffset = triangles[i] << 1; + var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; + var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 1] << 1; + var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; + var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 2] << 1; + var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; + var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; + for (var p = 0; p < polygonsCount; p++) { + var s = clippedVertices.length; + if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { + var clipOutputLength = clipOutput.length; + if (clipOutputLength == 0) + continue; + var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; + var d = 1 / (d0 * d2 + d1 * (y1 - y3)); + var clipOutputCount = clipOutputLength >> 1; + var clipOutputItems = this.clipOutput; + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize); + for (var ii = 0; ii < clipOutputLength; ii += 2) { + var x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; + clippedVerticesItems[s] = x; + clippedVerticesItems[s + 1] = y; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + var c0 = x - x3, c1 = y - y3; + var a = (d0 * c0 + d1 * c1) * d; + var b = (d4 * c0 + d2 * c1) * d; + var c = 1 - a - b; + clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c; + clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c; + if (twoColor) { + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + } + s += vertexSize; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); + clipOutputCount--; + for (var ii = 1; ii < clipOutputCount; ii++) { + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + ii); + clippedTrianglesItems[s + 2] = (index + ii + 1); + s += 3; + } + index += clipOutputCount + 1; + } + else { + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize); + clippedVerticesItems[s] = x1; + clippedVerticesItems[s + 1] = y1; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + if (!twoColor) { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = x2; + clippedVerticesItems[s + 9] = y2; + clippedVerticesItems[s + 10] = light.r; + clippedVerticesItems[s + 11] = light.g; + clippedVerticesItems[s + 12] = light.b; + clippedVerticesItems[s + 13] = light.a; + clippedVerticesItems[s + 14] = u2; + clippedVerticesItems[s + 15] = v2; + clippedVerticesItems[s + 16] = x3; + clippedVerticesItems[s + 17] = y3; + clippedVerticesItems[s + 18] = light.r; + clippedVerticesItems[s + 19] = light.g; + clippedVerticesItems[s + 20] = light.b; + clippedVerticesItems[s + 21] = light.a; + clippedVerticesItems[s + 22] = u3; + clippedVerticesItems[s + 23] = v3; + } + else { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + clippedVerticesItems[s + 12] = x2; + clippedVerticesItems[s + 13] = y2; + clippedVerticesItems[s + 14] = light.r; + clippedVerticesItems[s + 15] = light.g; + clippedVerticesItems[s + 16] = light.b; + clippedVerticesItems[s + 17] = light.a; + clippedVerticesItems[s + 18] = u2; + clippedVerticesItems[s + 19] = v2; + clippedVerticesItems[s + 20] = dark.r; + clippedVerticesItems[s + 21] = dark.g; + clippedVerticesItems[s + 22] = dark.b; + clippedVerticesItems[s + 23] = dark.a; + clippedVerticesItems[s + 24] = x3; + clippedVerticesItems[s + 25] = y3; + clippedVerticesItems[s + 26] = light.r; + clippedVerticesItems[s + 27] = light.g; + clippedVerticesItems[s + 28] = light.b; + clippedVerticesItems[s + 29] = light.a; + clippedVerticesItems[s + 30] = u3; + clippedVerticesItems[s + 31] = v3; + clippedVerticesItems[s + 32] = dark.r; + clippedVerticesItems[s + 33] = dark.g; + clippedVerticesItems[s + 34] = dark.b; + clippedVerticesItems[s + 35] = dark.a; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3); + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + 1); + clippedTrianglesItems[s + 2] = (index + 2); + index += 3; + continue outer; + } + } + } + }; + SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) { + var originalOutput = output; + var clipped = false; + var input = null; + if (clippingArea.length % 4 >= 2) { + input = output; + output = this.scratch; + } + else + input = this.scratch; + input.length = 0; + input.push(x1); + input.push(y1); + input.push(x2); + input.push(y2); + input.push(x3); + input.push(y3); + input.push(x1); + input.push(y1); + output.length = 0; + var clippingVertices = clippingArea; + var clippingVerticesLast = clippingArea.length - 4; + for (var i = 0;; i += 2) { + var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; + var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3]; + var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2; + var inputVertices = input; + var inputVerticesLength = input.length - 2, outputStart = output.length; + for (var ii = 0; ii < inputVerticesLength; ii += 2) { + var inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; + var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3]; + var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0; + if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) { + if (side2) { + output.push(inputX2); + output.push(inputY2); + continue; + } + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + } + else if (side2) { + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + output.push(inputX2); + output.push(inputY2); + } + clipped = true; + } + if (outputStart == output.length) { + originalOutput.length = 0; + return true; + } + output.push(output[0]); + output.push(output[1]); + if (i == clippingVerticesLast) + break; + var temp = output; + output = input; + output.length = 0; + input = temp; + } + if (originalOutput != output) { + originalOutput.length = 0; + for (var i = 0, n = output.length - 2; i < n; i++) + originalOutput[i] = output[i]; + } + else + originalOutput.length = originalOutput.length - 2; + return clipped; + }; + SkeletonClipping.makeClockwise = function (polygon) { + var vertices = polygon; + var verticeslength = polygon.length; + var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; + for (var i = 0, n = verticeslength - 3; i < n; i += 2) { + p1x = vertices[i]; + p1y = vertices[i + 1]; + p2x = vertices[i + 2]; + p2y = vertices[i + 3]; + area += p1x * p2y - p2x * p1y; + } + if (area < 0) + return; + for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { + var x = vertices[i], y = vertices[i + 1]; + var other = lastX - i; + vertices[i] = vertices[other]; + vertices[i + 1] = vertices[other + 1]; + vertices[other] = x; + vertices[other + 1] = y; + } + }; + return SkeletonClipping; + }()); + spine.SkeletonClipping = SkeletonClipping; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonData = (function () { + function SkeletonData() { + this.bones = new Array(); + this.slots = new Array(); + this.skins = new Array(); + this.events = new Array(); + this.animations = new Array(); + this.ikConstraints = new Array(); + this.transformConstraints = new Array(); + this.pathConstraints = new Array(); + this.fps = 0; + } + SkeletonData.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.name == boneName) + return bone; + } + return null; + }; + SkeletonData.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].name == boneName) + return i; + return -1; + }; + SkeletonData.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.name == slotName) + return slot; + } + return null; + }; + SkeletonData.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].name == slotName) + return i; + return -1; + }; + SkeletonData.prototype.findSkin = function (skinName) { + if (skinName == null) + throw new Error("skinName cannot be null."); + var skins = this.skins; + for (var i = 0, n = skins.length; i < n; i++) { + var skin = skins[i]; + if (skin.name == skinName) + return skin; + } + return null; + }; + SkeletonData.prototype.findEvent = function (eventDataName) { + if (eventDataName == null) + throw new Error("eventDataName cannot be null."); + var events = this.events; + for (var i = 0, n = events.length; i < n; i++) { + var event_4 = events[i]; + if (event_4.name == eventDataName) + return event_4; + } + return null; + }; + SkeletonData.prototype.findAnimation = function (animationName) { + if (animationName == null) + throw new Error("animationName cannot be null."); + var animations = this.animations; + for (var i = 0, n = animations.length; i < n; i++) { + var animation = animations[i]; + if (animation.name == animationName) + return animation; + } + return null; + }; + SkeletonData.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) { + if (pathConstraintName == null) + throw new Error("pathConstraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) + if (pathConstraints[i].name == pathConstraintName) + return i; + return -1; + }; + return SkeletonData; + }()); + spine.SkeletonData = SkeletonData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonJson = (function () { + function SkeletonJson(attachmentLoader) { + this.scale = 1; + this.linkedMeshes = new Array(); + this.attachmentLoader = attachmentLoader; + } + SkeletonJson.prototype.readSkeletonData = function (json) { + var scale = this.scale; + var skeletonData = new spine.SkeletonData(); + var root = typeof (json) === "string" ? JSON.parse(json) : json; + var skeletonMap = root.skeleton; + if (skeletonMap != null) { + skeletonData.hash = skeletonMap.hash; + skeletonData.version = skeletonMap.spine; + skeletonData.width = skeletonMap.width; + skeletonData.height = skeletonMap.height; + skeletonData.fps = skeletonMap.fps; + skeletonData.imagesPath = skeletonMap.images; + } + if (root.bones) { + for (var i = 0; i < root.bones.length; i++) { + var boneMap = root.bones[i]; + var parent_2 = null; + var parentName = this.getValue(boneMap, "parent", null); + if (parentName != null) { + parent_2 = skeletonData.findBone(parentName); + if (parent_2 == null) + throw new Error("Parent bone not found: " + parentName); + } + var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2); + data.length = this.getValue(boneMap, "length", 0) * scale; + data.x = this.getValue(boneMap, "x", 0) * scale; + data.y = this.getValue(boneMap, "y", 0) * scale; + data.rotation = this.getValue(boneMap, "rotation", 0); + data.scaleX = this.getValue(boneMap, "scaleX", 1); + data.scaleY = this.getValue(boneMap, "scaleY", 1); + data.shearX = this.getValue(boneMap, "shearX", 0); + data.shearY = this.getValue(boneMap, "shearY", 0); + data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal")); + skeletonData.bones.push(data); + } + } + if (root.slots) { + for (var i = 0; i < root.slots.length; i++) { + var slotMap = root.slots[i]; + var slotName = slotMap.name; + var boneName = slotMap.bone; + var boneData = skeletonData.findBone(boneName); + if (boneData == null) + throw new Error("Slot bone not found: " + boneName); + var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData); + var color = this.getValue(slotMap, "color", null); + if (color != null) + data.color.setFromString(color); + var dark = this.getValue(slotMap, "dark", null); + if (dark != null) { + data.darkColor = new spine.Color(1, 1, 1, 1); + data.darkColor.setFromString(dark); + } + data.attachmentName = this.getValue(slotMap, "attachment", null); + data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, "blend", "normal")); + skeletonData.slots.push(data); + } + } + if (root.ik) { + for (var i = 0; i < root.ik.length; i++) { + var constraintMap = root.ik[i]; + var data = new spine.IkConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("IK bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("IK target bone not found: " + targetName); + data.mix = this.getValue(constraintMap, "mix", 1); + data.bendDirection = this.getValue(constraintMap, "bendPositive", true) ? 1 : -1; + data.compress = this.getValue(constraintMap, "compress", false); + data.stretch = this.getValue(constraintMap, "stretch", false); + data.uniform = this.getValue(constraintMap, "uniform", false); + skeletonData.ikConstraints.push(data); + } + } + if (root.transform) { + for (var i = 0; i < root.transform.length; i++) { + var constraintMap = root.transform[i]; + var data = new spine.TransformConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("Transform constraint target bone not found: " + targetName); + data.local = this.getValue(constraintMap, "local", false); + data.relative = this.getValue(constraintMap, "relative", false); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.offsetX = this.getValue(constraintMap, "x", 0) * scale; + data.offsetY = this.getValue(constraintMap, "y", 0) * scale; + data.offsetScaleX = this.getValue(constraintMap, "scaleX", 0); + data.offsetScaleY = this.getValue(constraintMap, "scaleY", 0); + data.offsetShearY = this.getValue(constraintMap, "shearY", 0); + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + data.scaleMix = this.getValue(constraintMap, "scaleMix", 1); + data.shearMix = this.getValue(constraintMap, "shearMix", 1); + skeletonData.transformConstraints.push(data); + } + } + if (root.path) { + for (var i = 0; i < root.path.length; i++) { + var constraintMap = root.path[i]; + var data = new spine.PathConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findSlot(targetName); + if (data.target == null) + throw new Error("Path target slot not found: " + targetName); + data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, "positionMode", "percent")); + data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, "spacingMode", "length")); + data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, "rotateMode", "tangent")); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.position = this.getValue(constraintMap, "position", 0); + if (data.positionMode == spine.PositionMode.Fixed) + data.position *= scale; + data.spacing = this.getValue(constraintMap, "spacing", 0); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + data.spacing *= scale; + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + skeletonData.pathConstraints.push(data); + } + } + if (root.skins) { + for (var skinName in root.skins) { + var skinMap = root.skins[skinName]; + var skin = new spine.Skin(skinName); + for (var slotName in skinMap) { + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + var slotMap = skinMap[slotName]; + for (var entryName in slotMap) { + var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData); + if (attachment != null) + skin.addAttachment(slotIndex, entryName, attachment); + } + } + skeletonData.skins.push(skin); + if (skin.name == "default") + skeletonData.defaultSkin = skin; + } + } + for (var i = 0, n = this.linkedMeshes.length; i < n; i++) { + var linkedMesh = this.linkedMeshes[i]; + var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); + if (skin == null) + throw new Error("Skin not found: " + linkedMesh.skin); + var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); + if (parent_3 == null) + throw new Error("Parent mesh not found: " + linkedMesh.parent); + linkedMesh.mesh.setParentMesh(parent_3); + linkedMesh.mesh.updateUVs(); + } + this.linkedMeshes.length = 0; + if (root.events) { + for (var eventName in root.events) { + var eventMap = root.events[eventName]; + var data = new spine.EventData(eventName); + data.intValue = this.getValue(eventMap, "int", 0); + data.floatValue = this.getValue(eventMap, "float", 0); + data.stringValue = this.getValue(eventMap, "string", ""); + data.audioPath = this.getValue(eventMap, "audio", null); + if (data.audioPath != null) { + data.volume = this.getValue(eventMap, "volume", 1); + data.balance = this.getValue(eventMap, "balance", 0); + } + skeletonData.events.push(data); + } + } + if (root.animations) { + for (var animationName in root.animations) { + var animationMap = root.animations[animationName]; + this.readAnimation(animationMap, animationName, skeletonData); + } + } + return skeletonData; + }; + SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) { + var scale = this.scale; + name = this.getValue(map, "name", name); + var type = this.getValue(map, "type", "region"); + switch (type) { + case "region": { + var path = this.getValue(map, "path", name); + var region = this.attachmentLoader.newRegionAttachment(skin, name, path); + if (region == null) + return null; + region.path = path; + region.x = this.getValue(map, "x", 0) * scale; + region.y = this.getValue(map, "y", 0) * scale; + region.scaleX = this.getValue(map, "scaleX", 1); + region.scaleY = this.getValue(map, "scaleY", 1); + region.rotation = this.getValue(map, "rotation", 0); + region.width = map.width * scale; + region.height = map.height * scale; + var color = this.getValue(map, "color", null); + if (color != null) + region.color.setFromString(color); + region.updateOffset(); + return region; + } + case "boundingbox": { + var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); + if (box == null) + return null; + this.readVertices(map, box, map.vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + box.color.setFromString(color); + return box; + } + case "mesh": + case "linkedmesh": { + var path = this.getValue(map, "path", name); + var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); + if (mesh == null) + return null; + mesh.path = path; + var color = this.getValue(map, "color", null); + if (color != null) + mesh.color.setFromString(color); + var parent_4 = this.getValue(map, "parent", null); + if (parent_4 != null) { + mesh.inheritDeform = this.getValue(map, "deform", true); + this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, "skin", null), slotIndex, parent_4)); + return mesh; + } + var uvs = map.uvs; + this.readVertices(map, mesh, uvs.length); + mesh.triangles = map.triangles; + mesh.regionUVs = uvs; + mesh.updateUVs(); + mesh.hullLength = this.getValue(map, "hull", 0) * 2; + return mesh; + } + case "path": { + var path = this.attachmentLoader.newPathAttachment(skin, name); + if (path == null) + return null; + path.closed = this.getValue(map, "closed", false); + path.constantSpeed = this.getValue(map, "constantSpeed", true); + var vertexCount = map.vertexCount; + this.readVertices(map, path, vertexCount << 1); + var lengths = spine.Utils.newArray(vertexCount / 3, 0); + for (var i = 0; i < map.lengths.length; i++) + lengths[i] = map.lengths[i] * scale; + path.lengths = lengths; + var color = this.getValue(map, "color", null); + if (color != null) + path.color.setFromString(color); + return path; + } + case "point": { + var point = this.attachmentLoader.newPointAttachment(skin, name); + if (point == null) + return null; + point.x = this.getValue(map, "x", 0) * scale; + point.y = this.getValue(map, "y", 0) * scale; + point.rotation = this.getValue(map, "rotation", 0); + var color = this.getValue(map, "color", null); + if (color != null) + point.color.setFromString(color); + return point; + } + case "clipping": { + var clip = this.attachmentLoader.newClippingAttachment(skin, name); + if (clip == null) + return null; + var end = this.getValue(map, "end", null); + if (end != null) { + var slot = skeletonData.findSlot(end); + if (slot == null) + throw new Error("Clipping end slot not found: " + end); + clip.endSlot = slot; + } + var vertexCount = map.vertexCount; + this.readVertices(map, clip, vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + clip.color.setFromString(color); + return clip; + } + } + return null; + }; + SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) { + var scale = this.scale; + attachment.worldVerticesLength = verticesLength; + var vertices = map.vertices; + if (verticesLength == vertices.length) { + var scaledVertices = spine.Utils.toFloatArray(vertices); + if (scale != 1) { + for (var i = 0, n = vertices.length; i < n; i++) + scaledVertices[i] *= scale; + } + attachment.vertices = scaledVertices; + return; + } + var weights = new Array(); + var bones = new Array(); + for (var i = 0, n = vertices.length; i < n;) { + var boneCount = vertices[i++]; + bones.push(boneCount); + for (var nn = i + boneCount * 4; i < nn; i += 4) { + bones.push(vertices[i]); + weights.push(vertices[i + 1] * scale); + weights.push(vertices[i + 2] * scale); + weights.push(vertices[i + 3]); + } + } + attachment.bones = bones; + attachment.vertices = spine.Utils.toFloatArray(weights); + }; + SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) { + var scale = this.scale; + var timelines = new Array(); + var duration = 0; + if (map.slots) { + for (var slotName in map.slots) { + var slotMap = map.slots[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + if (timelineName == "attachment") { + var timeline = new spine.AttachmentTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex++, valueMap.time, valueMap.name); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + else if (timelineName == "color") { + var timeline = new spine.ColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var color = new spine.Color(); + color.setFromString(valueMap.color); + timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]); + } + else if (timelineName == "twoColor") { + var timeline = new spine.TwoColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var light = new spine.Color(); + var dark = new spine.Color(); + light.setFromString(valueMap.light); + dark.setFromString(valueMap.dark); + timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"); + } + } + } + if (map.bones) { + for (var boneName in map.bones) { + var boneMap = map.bones[boneName]; + var boneIndex = skeletonData.findBoneIndex(boneName); + if (boneIndex == -1) + throw new Error("Bone not found: " + boneName); + for (var timelineName in boneMap) { + var timelineMap = boneMap[timelineName]; + if (timelineName === "rotate") { + var timeline = new spine.RotateTimeline(timelineMap.length); + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, valueMap.angle); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]); + } + else if (timelineName === "translate" || timelineName === "scale" || timelineName === "shear") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "scale") + timeline = new spine.ScaleTimeline(timelineMap.length); + else if (timelineName === "shear") + timeline = new spine.ShearTimeline(timelineMap.length); + else { + timeline = new spine.TranslateTimeline(timelineMap.length); + timelineScale = scale; + } + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var x = this.getValue(valueMap, "x", 0), y = this.getValue(valueMap, "y", 0); + timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"); + } + } + } + if (map.ik) { + for (var constraintName in map.ik) { + var constraintMap = map.ik[constraintName]; + var constraint = skeletonData.findIkConstraint(constraintName); + var timeline = new spine.IkConstraintTimeline(constraintMap.length); + timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "mix", 1), this.getValue(valueMap, "bendPositive", true) ? 1 : -1, this.getValue(valueMap, "compress", false), this.getValue(valueMap, "stretch", false)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]); + } + } + if (map.transform) { + for (var constraintName in map.transform) { + var constraintMap = map.transform[constraintName]; + var constraint = skeletonData.findTransformConstraint(constraintName); + var timeline = new spine.TransformConstraintTimeline(constraintMap.length); + timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1), this.getValue(valueMap, "scaleMix", 1), this.getValue(valueMap, "shearMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]); + } + } + if (map.paths) { + for (var constraintName in map.paths) { + var constraintMap = map.paths[constraintName]; + var index = skeletonData.findPathConstraintIndex(constraintName); + if (index == -1) + throw new Error("Path constraint not found: " + constraintName); + var data = skeletonData.pathConstraints[index]; + for (var timelineName in constraintMap) { + var timelineMap = constraintMap[timelineName]; + if (timelineName === "position" || timelineName === "spacing") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "spacing") { + timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + timelineScale = scale; + } + else { + timeline = new spine.PathConstraintPositionTimeline(timelineMap.length); + if (data.positionMode == spine.PositionMode.Fixed) + timelineScale = scale; + } + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]); + } + else if (timelineName === "mix") { + var timeline = new spine.PathConstraintMixTimeline(timelineMap.length); + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]); + } + } + } + } + if (map.deform) { + for (var deformName in map.deform) { + var deformMap = map.deform[deformName]; + var skin = skeletonData.findSkin(deformName); + if (skin == null) + throw new Error("Skin not found: " + deformName); + for (var slotName in deformMap) { + var slotMap = deformMap[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotMap.name); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + var attachment = skin.getAttachment(slotIndex, timelineName); + if (attachment == null) + throw new Error("Deform attachment not found: " + timelineMap.name); + var weighted = attachment.bones != null; + var vertices = attachment.vertices; + var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; + var timeline = new spine.DeformTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + timeline.attachment = attachment; + var frameIndex = 0; + for (var j = 0; j < timelineMap.length; j++) { + var valueMap = timelineMap[j]; + var deform = void 0; + var verticesValue = this.getValue(valueMap, "vertices", null); + if (verticesValue == null) + deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices; + else { + deform = spine.Utils.newFloatArray(deformLength); + var start = this.getValue(valueMap, "offset", 0); + spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); + if (scale != 1) { + for (var i = start, n = i + verticesValue.length; i < n; i++) + deform[i] *= scale; + } + if (!weighted) { + for (var i = 0; i < deformLength; i++) + deform[i] += vertices[i]; + } + } + timeline.setFrame(frameIndex, valueMap.time, deform); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + } + } + } + var drawOrderNode = map.drawOrder; + if (drawOrderNode == null) + drawOrderNode = map.draworder; + if (drawOrderNode != null) { + var timeline = new spine.DrawOrderTimeline(drawOrderNode.length); + var slotCount = skeletonData.slots.length; + var frameIndex = 0; + for (var j = 0; j < drawOrderNode.length; j++) { + var drawOrderMap = drawOrderNode[j]; + var drawOrder = null; + var offsets = this.getValue(drawOrderMap, "offsets", null); + if (offsets != null) { + drawOrder = spine.Utils.newArray(slotCount, -1); + var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0); + var originalIndex = 0, unchangedIndex = 0; + for (var i = 0; i < offsets.length; i++) { + var offsetMap = offsets[i]; + var slotIndex = skeletonData.findSlotIndex(offsetMap.slot); + if (slotIndex == -1) + throw new Error("Slot not found: " + offsetMap.slot); + while (originalIndex != slotIndex) + unchanged[unchangedIndex++] = originalIndex++; + drawOrder[originalIndex + offsetMap.offset] = originalIndex++; + } + while (originalIndex < slotCount) + unchanged[unchangedIndex++] = originalIndex++; + for (var i = slotCount - 1; i >= 0; i--) + if (drawOrder[i] == -1) + drawOrder[i] = unchanged[--unchangedIndex]; + } + timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (map.events) { + var timeline = new spine.EventTimeline(map.events.length); + var frameIndex = 0; + for (var i = 0; i < map.events.length; i++) { + var eventMap = map.events[i]; + var eventData = skeletonData.findEvent(eventMap.name); + if (eventData == null) + throw new Error("Event not found: " + eventMap.name); + var event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData); + event_5.intValue = this.getValue(eventMap, "int", eventData.intValue); + event_5.floatValue = this.getValue(eventMap, "float", eventData.floatValue); + event_5.stringValue = this.getValue(eventMap, "string", eventData.stringValue); + if (event_5.data.audioPath != null) { + event_5.volume = this.getValue(eventMap, "volume", 1); + event_5.balance = this.getValue(eventMap, "balance", 0); + } + timeline.setFrame(frameIndex++, event_5); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (isNaN(duration)) { + throw new Error("Error while parsing animation, duration is NaN"); + } + skeletonData.animations.push(new spine.Animation(name, timelines, duration)); + }; + SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) { + if (!map.curve) + return; + if (map.curve === "stepped") + timeline.setStepped(frameIndex); + else if (Object.prototype.toString.call(map.curve) === '[object Array]') { + var curve = map.curve; + timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); + } + }; + SkeletonJson.prototype.getValue = function (map, prop, defaultValue) { + return map[prop] !== undefined ? map[prop] : defaultValue; + }; + SkeletonJson.blendModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.BlendMode.Normal; + if (str == "additive") + return spine.BlendMode.Additive; + if (str == "multiply") + return spine.BlendMode.Multiply; + if (str == "screen") + return spine.BlendMode.Screen; + throw new Error("Unknown blend mode: " + str); + }; + SkeletonJson.positionModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "fixed") + return spine.PositionMode.Fixed; + if (str == "percent") + return spine.PositionMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.spacingModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "length") + return spine.SpacingMode.Length; + if (str == "fixed") + return spine.SpacingMode.Fixed; + if (str == "percent") + return spine.SpacingMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.rotateModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "tangent") + return spine.RotateMode.Tangent; + if (str == "chain") + return spine.RotateMode.Chain; + if (str == "chainscale") + return spine.RotateMode.ChainScale; + throw new Error("Unknown rotate mode: " + str); + }; + SkeletonJson.transformModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.TransformMode.Normal; + if (str == "onlytranslation") + return spine.TransformMode.OnlyTranslation; + if (str == "norotationorreflection") + return spine.TransformMode.NoRotationOrReflection; + if (str == "noscale") + return spine.TransformMode.NoScale; + if (str == "noscaleorreflection") + return spine.TransformMode.NoScaleOrReflection; + throw new Error("Unknown transform mode: " + str); + }; + return SkeletonJson; + }()); + spine.SkeletonJson = SkeletonJson; + var LinkedMesh = (function () { + function LinkedMesh(mesh, skin, slotIndex, parent) { + this.mesh = mesh; + this.skin = skin; + this.slotIndex = slotIndex; + this.parent = parent; + } + return LinkedMesh; + }()); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skin = (function () { + function Skin(name) { + this.attachments = new Array(); + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + Skin.prototype.addAttachment = function (slotIndex, name, attachment) { + if (attachment == null) + throw new Error("attachment cannot be null."); + var attachments = this.attachments; + if (slotIndex >= attachments.length) + attachments.length = slotIndex + 1; + if (!attachments[slotIndex]) + attachments[slotIndex] = {}; + attachments[slotIndex][name] = attachment; + }; + Skin.prototype.getAttachment = function (slotIndex, name) { + var dictionary = this.attachments[slotIndex]; + return dictionary ? dictionary[name] : null; + }; + Skin.prototype.attachAll = function (skeleton, oldSkin) { + var slotIndex = 0; + for (var i = 0; i < skeleton.slots.length; i++) { + var slot = skeleton.slots[i]; + var slotAttachment = slot.getAttachment(); + if (slotAttachment && slotIndex < oldSkin.attachments.length) { + var dictionary = oldSkin.attachments[slotIndex]; + for (var key in dictionary) { + var skinAttachment = dictionary[key]; + if (slotAttachment == skinAttachment) { + var attachment = this.getAttachment(slotIndex, key); + if (attachment != null) + slot.setAttachment(attachment); + break; + } + } + } + slotIndex++; + } + }; + return Skin; + }()); + spine.Skin = Skin; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Slot = (function () { + function Slot(data, bone) { + this.attachmentVertices = new Array(); + if (data == null) + throw new Error("data cannot be null."); + if (bone == null) + throw new Error("bone cannot be null."); + this.data = data; + this.bone = bone; + this.color = new spine.Color(); + this.darkColor = data.darkColor == null ? null : new spine.Color(); + this.setToSetupPose(); + } + Slot.prototype.getAttachment = function () { + return this.attachment; + }; + Slot.prototype.setAttachment = function (attachment) { + if (this.attachment == attachment) + return; + this.attachment = attachment; + this.attachmentTime = this.bone.skeleton.time; + this.attachmentVertices.length = 0; + }; + Slot.prototype.setAttachmentTime = function (time) { + this.attachmentTime = this.bone.skeleton.time - time; + }; + Slot.prototype.getAttachmentTime = function () { + return this.bone.skeleton.time - this.attachmentTime; + }; + Slot.prototype.setToSetupPose = function () { + this.color.setFromColor(this.data.color); + if (this.darkColor != null) + this.darkColor.setFromColor(this.data.darkColor); + if (this.data.attachmentName == null) + this.attachment = null; + else { + this.attachment = null; + this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)); + } + }; + return Slot; + }()); + spine.Slot = Slot; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SlotData = (function () { + function SlotData(index, name, boneData) { + this.color = new spine.Color(1, 1, 1, 1); + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + if (boneData == null) + throw new Error("boneData cannot be null."); + this.index = index; + this.name = name; + this.boneData = boneData; + } + return SlotData; + }()); + spine.SlotData = SlotData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Texture = (function () { + function Texture(image) { + this._image = image; + } + Texture.prototype.getImage = function () { + return this._image; + }; + Texture.filterFromString = function (text) { + switch (text.toLowerCase()) { + case "nearest": return TextureFilter.Nearest; + case "linear": return TextureFilter.Linear; + case "mipmap": return TextureFilter.MipMap; + case "mipmapnearestnearest": return TextureFilter.MipMapNearestNearest; + case "mipmaplinearnearest": return TextureFilter.MipMapLinearNearest; + case "mipmapnearestlinear": return TextureFilter.MipMapNearestLinear; + case "mipmaplinearlinear": return TextureFilter.MipMapLinearLinear; + default: throw new Error("Unknown texture filter " + text); + } + }; + Texture.wrapFromString = function (text) { + switch (text.toLowerCase()) { + case "mirroredtepeat": return TextureWrap.MirroredRepeat; + case "clamptoedge": return TextureWrap.ClampToEdge; + case "repeat": return TextureWrap.Repeat; + default: throw new Error("Unknown texture wrap " + text); + } + }; + return Texture; + }()); + spine.Texture = Texture; + var TextureFilter; + (function (TextureFilter) { + TextureFilter[TextureFilter["Nearest"] = 9728] = "Nearest"; + TextureFilter[TextureFilter["Linear"] = 9729] = "Linear"; + TextureFilter[TextureFilter["MipMap"] = 9987] = "MipMap"; + TextureFilter[TextureFilter["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; + TextureFilter[TextureFilter["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; + TextureFilter[TextureFilter["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; + TextureFilter[TextureFilter["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; + })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {})); + var TextureWrap; + (function (TextureWrap) { + TextureWrap[TextureWrap["MirroredRepeat"] = 33648] = "MirroredRepeat"; + TextureWrap[TextureWrap["ClampToEdge"] = 33071] = "ClampToEdge"; + TextureWrap[TextureWrap["Repeat"] = 10497] = "Repeat"; + })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {})); + var TextureRegion = (function () { + function TextureRegion() { + this.u = 0; + this.v = 0; + this.u2 = 0; + this.v2 = 0; + this.width = 0; + this.height = 0; + this.rotate = false; + this.offsetX = 0; + this.offsetY = 0; + this.originalWidth = 0; + this.originalHeight = 0; + } + return TextureRegion; + }()); + spine.TextureRegion = TextureRegion; + var FakeTexture = (function (_super) { + __extends(FakeTexture, _super); + function FakeTexture() { + return _super !== null && _super.apply(this, arguments) || this; + } + FakeTexture.prototype.setFilters = function (minFilter, magFilter) { }; + FakeTexture.prototype.setWraps = function (uWrap, vWrap) { }; + FakeTexture.prototype.dispose = function () { }; + return FakeTexture; + }(Texture)); + spine.FakeTexture = FakeTexture; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TextureAtlas = (function () { + function TextureAtlas(atlasText, textureLoader) { + this.pages = new Array(); + this.regions = new Array(); + this.load(atlasText, textureLoader); + } + TextureAtlas.prototype.load = function (atlasText, textureLoader) { + if (textureLoader == null) + throw new Error("textureLoader cannot be null."); + var reader = new TextureAtlasReader(atlasText); + var tuple = new Array(4); + var page = null; + while (true) { + var line = reader.readLine(); + if (line == null) + break; + line = line.trim(); + if (line.length == 0) + page = null; + else if (!page) { + page = new TextureAtlasPage(); + page.name = line; + if (reader.readTuple(tuple) == 2) { + page.width = parseInt(tuple[0]); + page.height = parseInt(tuple[1]); + reader.readTuple(tuple); + } + reader.readTuple(tuple); + page.minFilter = spine.Texture.filterFromString(tuple[0]); + page.magFilter = spine.Texture.filterFromString(tuple[1]); + var direction = reader.readValue(); + page.uWrap = spine.TextureWrap.ClampToEdge; + page.vWrap = spine.TextureWrap.ClampToEdge; + if (direction == "x") + page.uWrap = spine.TextureWrap.Repeat; + else if (direction == "y") + page.vWrap = spine.TextureWrap.Repeat; + else if (direction == "xy") + page.uWrap = page.vWrap = spine.TextureWrap.Repeat; + page.texture = textureLoader(line); + page.texture.setFilters(page.minFilter, page.magFilter); + page.texture.setWraps(page.uWrap, page.vWrap); + page.width = page.texture.getImage().width; + page.height = page.texture.getImage().height; + this.pages.push(page); + } + else { + var region = new TextureAtlasRegion(); + region.name = line; + region.page = page; + region.rotate = reader.readValue() == "true"; + reader.readTuple(tuple); + var x = parseInt(tuple[0]); + var y = parseInt(tuple[1]); + reader.readTuple(tuple); + var width = parseInt(tuple[0]); + var height = parseInt(tuple[1]); + region.u = x / page.width; + region.v = y / page.height; + if (region.rotate) { + region.u2 = (x + height) / page.width; + region.v2 = (y + width) / page.height; + } + else { + region.u2 = (x + width) / page.width; + region.v2 = (y + height) / page.height; + } + region.x = x; + region.y = y; + region.width = Math.abs(width); + region.height = Math.abs(height); + if (reader.readTuple(tuple) == 4) { + if (reader.readTuple(tuple) == 4) { + reader.readTuple(tuple); + } + } + region.originalWidth = parseInt(tuple[0]); + region.originalHeight = parseInt(tuple[1]); + reader.readTuple(tuple); + region.offsetX = parseInt(tuple[0]); + region.offsetY = parseInt(tuple[1]); + region.index = parseInt(reader.readValue()); + region.texture = page.texture; + this.regions.push(region); + } + } + }; + TextureAtlas.prototype.findRegion = function (name) { + for (var i = 0; i < this.regions.length; i++) { + if (this.regions[i].name == name) { + return this.regions[i]; + } + } + return null; + }; + TextureAtlas.prototype.dispose = function () { + for (var i = 0; i < this.pages.length; i++) { + this.pages[i].texture.dispose(); + } + }; + return TextureAtlas; + }()); + spine.TextureAtlas = TextureAtlas; + var TextureAtlasReader = (function () { + function TextureAtlasReader(text) { + this.index = 0; + this.lines = text.split(/\r\n|\r|\n/); + } + TextureAtlasReader.prototype.readLine = function () { + if (this.index >= this.lines.length) + return null; + return this.lines[this.index++]; + }; + TextureAtlasReader.prototype.readValue = function () { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + return line.substring(colon + 1).trim(); + }; + TextureAtlasReader.prototype.readTuple = function (tuple) { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + var i = 0, lastMatch = colon + 1; + for (; i < 3; i++) { + var comma = line.indexOf(",", lastMatch); + if (comma == -1) + break; + tuple[i] = line.substr(lastMatch, comma - lastMatch).trim(); + lastMatch = comma + 1; + } + tuple[i] = line.substring(lastMatch).trim(); + return i + 1; + }; + return TextureAtlasReader; + }()); + var TextureAtlasPage = (function () { + function TextureAtlasPage() { + } + return TextureAtlasPage; + }()); + spine.TextureAtlasPage = TextureAtlasPage; + var TextureAtlasRegion = (function (_super) { + __extends(TextureAtlasRegion, _super); + function TextureAtlasRegion() { + return _super !== null && _super.apply(this, arguments) || this; + } + return TextureAtlasRegion; + }(spine.TextureRegion)); + spine.TextureAtlasRegion = TextureAtlasRegion; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraint = (function () { + function TransformConstraint(data, skeleton) { + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.temp = new spine.Vector2(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + this.scaleMix = data.scaleMix; + this.shearMix = data.shearMix; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + TransformConstraint.prototype.apply = function () { + this.update(); + }; + TransformConstraint.prototype.update = function () { + if (this.data.local) { + if (this.data.relative) + this.applyRelativeLocal(); + else + this.applyAbsoluteLocal(); + } + else { + if (this.data.relative) + this.applyRelativeWorld(); + else + this.applyAbsoluteWorld(); + } + }; + TransformConstraint.prototype.applyAbsoluteWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect; + var offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += (temp.x - bone.worldX) * translateMix; + bone.worldY += (temp.y - bone.worldY) * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c); + var ts = Math.sqrt(ta * ta + tc * tc); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s; + bone.a *= s; + bone.c *= s; + s = Math.sqrt(bone.b * bone.b + bone.d * bone.d); + ts = Math.sqrt(tb * tb + td * td); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var b = bone.b, d = bone.d; + var by = Math.atan2(d, b); + var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a)); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r = by + (r + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyRelativeWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += temp.x * translateMix; + bone.worldY += temp.y * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1; + bone.a *= s; + bone.c *= s; + s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var r = Math.atan2(td, tb) - Math.atan2(tc, ta); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + var b = bone.b, d = bone.d; + r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyAbsoluteLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) { + var r = target.arotation - rotation + this.data.offsetRotation; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + rotation += r * rotateMix; + } + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax - x + this.data.offsetX) * translateMix; + y += (target.ay - y + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX; + if (scaleY > 0.00001) + scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY; + } + var shearY = bone.ashearY; + if (shearMix != 0) { + var r = target.ashearY - shearY + this.data.offsetShearY; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + bone.shearY += r * shearMix; + } + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.applyRelativeLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) + rotation += (target.arotation + this.data.offsetRotation) * rotateMix; + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax + this.data.offsetX) * translateMix; + y += (target.ay + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1; + if (scaleY > 0.00001) + scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1; + } + var shearY = bone.ashearY; + if (shearMix != 0) + shearY += (target.ashearY + this.data.offsetShearY) * shearMix; + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.getOrder = function () { + return this.data.order; + }; + return TransformConstraint; + }()); + spine.TransformConstraint = TransformConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraintData = (function () { + function TransformConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.offsetRotation = 0; + this.offsetX = 0; + this.offsetY = 0; + this.offsetScaleX = 0; + this.offsetScaleY = 0; + this.offsetShearY = 0; + this.relative = false; + this.local = false; + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return TransformConstraintData; + }()); + spine.TransformConstraintData = TransformConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Triangulator = (function () { + function Triangulator() { + this.convexPolygons = new Array(); + this.convexPolygonsIndices = new Array(); + this.indicesArray = new Array(); + this.isConcaveArray = new Array(); + this.triangles = new Array(); + this.polygonPool = new spine.Pool(function () { + return new Array(); + }); + this.polygonIndicesPool = new spine.Pool(function () { + return new Array(); + }); + } + Triangulator.prototype.triangulate = function (verticesArray) { + var vertices = verticesArray; + var vertexCount = verticesArray.length >> 1; + var indices = this.indicesArray; + indices.length = 0; + for (var i = 0; i < vertexCount; i++) + indices[i] = i; + var isConcave = this.isConcaveArray; + isConcave.length = 0; + for (var i = 0, n = vertexCount; i < n; ++i) + isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices); + var triangles = this.triangles; + triangles.length = 0; + while (vertexCount > 3) { + var previous = vertexCount - 1, i = 0, next = 1; + while (true) { + outer: if (!isConcave[i]) { + var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; + var p1x = vertices[p1], p1y = vertices[p1 + 1]; + var p2x = vertices[p2], p2y = vertices[p2 + 1]; + var p3x = vertices[p3], p3y = vertices[p3 + 1]; + for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { + if (!isConcave[ii]) + continue; + var v = indices[ii] << 1; + var vx = vertices[v], vy = vertices[v + 1]; + if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { + if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { + if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) + break outer; + } + } + } + break; + } + if (next == 0) { + do { + if (!isConcave[i]) + break; + i--; + } while (i > 0); + break; + } + previous = i; + i = next; + next = (next + 1) % vertexCount; + } + triangles.push(indices[(vertexCount + i - 1) % vertexCount]); + triangles.push(indices[i]); + triangles.push(indices[(i + 1) % vertexCount]); + indices.splice(i, 1); + isConcave.splice(i, 1); + vertexCount--; + var previousIndex = (vertexCount + i - 1) % vertexCount; + var nextIndex = i == vertexCount ? 0 : i; + isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices); + isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices); + } + if (vertexCount == 3) { + triangles.push(indices[2]); + triangles.push(indices[0]); + triangles.push(indices[1]); + } + return triangles; + }; + Triangulator.prototype.decompose = function (verticesArray, triangles) { + var vertices = verticesArray; + var convexPolygons = this.convexPolygons; + this.polygonPool.freeAll(convexPolygons); + convexPolygons.length = 0; + var convexPolygonsIndices = this.convexPolygonsIndices; + this.polygonIndicesPool.freeAll(convexPolygonsIndices); + convexPolygonsIndices.length = 0; + var polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + var polygon = this.polygonPool.obtain(); + polygon.length = 0; + var fanBaseIndex = -1, lastWinding = 0; + for (var i = 0, n = triangles.length; i < n; i += 3) { + var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; + var x1 = vertices[t1], y1 = vertices[t1 + 1]; + var x2 = vertices[t2], y2 = vertices[t2 + 1]; + var x3 = vertices[t3], y3 = vertices[t3 + 1]; + var merged = false; + if (fanBaseIndex == t1) { + var o = polygon.length - 4; + var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); + var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]); + if (winding1 == lastWinding && winding2 == lastWinding) { + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(t3); + merged = true; + } + } + if (!merged) { + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + else { + this.polygonPool.free(polygon); + this.polygonIndicesPool.free(polygonIndices); + } + polygon = this.polygonPool.obtain(); + polygon.length = 0; + polygon.push(x1); + polygon.push(y1); + polygon.push(x2); + polygon.push(y2); + polygon.push(x3); + polygon.push(y3); + polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + polygonIndices.push(t1); + polygonIndices.push(t2); + polygonIndices.push(t3); + lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3); + fanBaseIndex = t1; + } + } + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + for (var i = 0, n = convexPolygons.length; i < n; i++) { + polygonIndices = convexPolygonsIndices[i]; + if (polygonIndices.length == 0) + continue; + var firstIndex = polygonIndices[0]; + var lastIndex = polygonIndices[polygonIndices.length - 1]; + polygon = convexPolygons[i]; + var o = polygon.length - 4; + var prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; + var prevX = polygon[o + 2], prevY = polygon[o + 3]; + var firstX = polygon[0], firstY = polygon[1]; + var secondX = polygon[2], secondY = polygon[3]; + var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); + for (var ii = 0; ii < n; ii++) { + if (ii == i) + continue; + var otherIndices = convexPolygonsIndices[ii]; + if (otherIndices.length != 3) + continue; + var otherFirstIndex = otherIndices[0]; + var otherSecondIndex = otherIndices[1]; + var otherLastIndex = otherIndices[2]; + var otherPoly = convexPolygons[ii]; + var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; + if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) + continue; + var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); + var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY); + if (winding1 == winding && winding2 == winding) { + otherPoly.length = 0; + otherIndices.length = 0; + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(otherLastIndex); + prevPrevX = prevX; + prevPrevY = prevY; + prevX = x3; + prevY = y3; + ii = 0; + } + } + } + for (var i = convexPolygons.length - 1; i >= 0; i--) { + polygon = convexPolygons[i]; + if (polygon.length == 0) { + convexPolygons.splice(i, 1); + this.polygonPool.free(polygon); + polygonIndices = convexPolygonsIndices[i]; + convexPolygonsIndices.splice(i, 1); + this.polygonIndicesPool.free(polygonIndices); + } + } + return convexPolygons; + }; + Triangulator.isConcave = function (index, vertexCount, vertices, indices) { + var previous = indices[(vertexCount + index - 1) % vertexCount] << 1; + var current = indices[index] << 1; + var next = indices[(index + 1) % vertexCount] << 1; + return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); + }; + Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) { + return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; + }; + Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) { + var px = p2x - p1x, py = p2y - p1y; + return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; + }; + return Triangulator; + }()); + spine.Triangulator = Triangulator; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IntSet = (function () { + function IntSet() { + this.array = new Array(); + } + IntSet.prototype.add = function (value) { + var contains = this.contains(value); + this.array[value | 0] = value | 0; + return !contains; + }; + IntSet.prototype.contains = function (value) { + return this.array[value | 0] != undefined; + }; + IntSet.prototype.remove = function (value) { + this.array[value | 0] = undefined; + }; + IntSet.prototype.clear = function () { + this.array.length = 0; + }; + return IntSet; + }()); + spine.IntSet = IntSet; + var Color = (function () { + function Color(r, g, b, a) { + if (r === void 0) { r = 0; } + if (g === void 0) { g = 0; } + if (b === void 0) { b = 0; } + if (a === void 0) { a = 0; } + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + Color.prototype.set = function (r, g, b, a) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + this.clamp(); + return this; + }; + Color.prototype.setFromColor = function (c) { + this.r = c.r; + this.g = c.g; + this.b = c.b; + this.a = c.a; + return this; + }; + Color.prototype.setFromString = function (hex) { + hex = hex.charAt(0) == '#' ? hex.substr(1) : hex; + this.r = parseInt(hex.substr(0, 2), 16) / 255.0; + this.g = parseInt(hex.substr(2, 2), 16) / 255.0; + this.b = parseInt(hex.substr(4, 2), 16) / 255.0; + this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0; + return this; + }; + Color.prototype.add = function (r, g, b, a) { + this.r += r; + this.g += g; + this.b += b; + this.a += a; + this.clamp(); + return this; + }; + Color.prototype.clamp = function () { + if (this.r < 0) + this.r = 0; + else if (this.r > 1) + this.r = 1; + if (this.g < 0) + this.g = 0; + else if (this.g > 1) + this.g = 1; + if (this.b < 0) + this.b = 0; + else if (this.b > 1) + this.b = 1; + if (this.a < 0) + this.a = 0; + else if (this.a > 1) + this.a = 1; + return this; + }; + Color.WHITE = new Color(1, 1, 1, 1); + Color.RED = new Color(1, 0, 0, 1); + Color.GREEN = new Color(0, 1, 0, 1); + Color.BLUE = new Color(0, 0, 1, 1); + Color.MAGENTA = new Color(1, 0, 1, 1); + return Color; + }()); + spine.Color = Color; + var MathUtils = (function () { + function MathUtils() { + } + MathUtils.clamp = function (value, min, max) { + if (value < min) + return min; + if (value > max) + return max; + return value; + }; + MathUtils.cosDeg = function (degrees) { + return Math.cos(degrees * MathUtils.degRad); + }; + MathUtils.sinDeg = function (degrees) { + return Math.sin(degrees * MathUtils.degRad); + }; + MathUtils.signum = function (value) { + return value > 0 ? 1 : value < 0 ? -1 : 0; + }; + MathUtils.toInt = function (x) { + return x > 0 ? Math.floor(x) : Math.ceil(x); + }; + MathUtils.cbrt = function (x) { + var y = Math.pow(Math.abs(x), 1 / 3); + return x < 0 ? -y : y; + }; + MathUtils.randomTriangular = function (min, max) { + return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); + }; + MathUtils.randomTriangularWith = function (min, max, mode) { + var u = Math.random(); + var d = max - min; + if (u <= (mode - min) / d) + return min + Math.sqrt(u * d * (mode - min)); + return max - Math.sqrt((1 - u) * d * (max - mode)); + }; + MathUtils.PI = 3.1415927; + MathUtils.PI2 = MathUtils.PI * 2; + MathUtils.radiansToDegrees = 180 / MathUtils.PI; + MathUtils.radDeg = MathUtils.radiansToDegrees; + MathUtils.degreesToRadians = MathUtils.PI / 180; + MathUtils.degRad = MathUtils.degreesToRadians; + return MathUtils; + }()); + spine.MathUtils = MathUtils; + var Interpolation = (function () { + function Interpolation() { + } + Interpolation.prototype.apply = function (start, end, a) { + return start + (end - start) * this.applyInternal(a); + }; + return Interpolation; + }()); + spine.Interpolation = Interpolation; + var Pow = (function (_super) { + __extends(Pow, _super); + function Pow(power) { + var _this = _super.call(this) || this; + _this.power = 2; + _this.power = power; + return _this; + } + Pow.prototype.applyInternal = function (a) { + if (a <= 0.5) + return Math.pow(a * 2, this.power) / 2; + return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1; + }; + return Pow; + }(Interpolation)); + spine.Pow = Pow; + var PowOut = (function (_super) { + __extends(PowOut, _super); + function PowOut(power) { + return _super.call(this, power) || this; + } + PowOut.prototype.applyInternal = function (a) { + return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1; + }; + return PowOut; + }(Pow)); + spine.PowOut = PowOut; + var Utils = (function () { + function Utils() { + } + Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) { + for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { + dest[j] = source[i]; + } + }; + Utils.setArraySize = function (array, size, value) { + if (value === void 0) { value = 0; } + var oldSize = array.length; + if (oldSize == size) + return array; + array.length = size; + if (oldSize < size) { + for (var i = oldSize; i < size; i++) + array[i] = value; + } + return array; + }; + Utils.ensureArrayCapacity = function (array, size, value) { + if (value === void 0) { value = 0; } + if (array.length >= size) + return array; + return Utils.setArraySize(array, size, value); + }; + Utils.newArray = function (size, defaultValue) { + var array = new Array(size); + for (var i = 0; i < size; i++) + array[i] = defaultValue; + return array; + }; + Utils.newFloatArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Float32Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.newShortArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Int16Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.toFloatArray = function (array) { + return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; + }; + Utils.toSinglePrecision = function (value) { + return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; + }; + Utils.webkit602BugfixHelper = function (alpha, blend) { + }; + Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== "undefined"; + return Utils; + }()); + spine.Utils = Utils; + var DebugUtils = (function () { + function DebugUtils() { + } + DebugUtils.logBones = function (skeleton) { + for (var i = 0; i < skeleton.bones.length; i++) { + var bone = skeleton.bones[i]; + console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY); + } + }; + return DebugUtils; + }()); + spine.DebugUtils = DebugUtils; + var Pool = (function () { + function Pool(instantiator) { + this.items = new Array(); + this.instantiator = instantiator; + } + Pool.prototype.obtain = function () { + return this.items.length > 0 ? this.items.pop() : this.instantiator(); + }; + Pool.prototype.free = function (item) { + if (item.reset) + item.reset(); + this.items.push(item); + }; + Pool.prototype.freeAll = function (items) { + for (var i = 0; i < items.length; i++) { + if (items[i].reset) + items[i].reset(); + this.items[i] = items[i]; + } + }; + Pool.prototype.clear = function () { + this.items.length = 0; + }; + return Pool; + }()); + spine.Pool = Pool; + var Vector2 = (function () { + function Vector2(x, y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + this.x = x; + this.y = y; + } + Vector2.prototype.set = function (x, y) { + this.x = x; + this.y = y; + return this; + }; + Vector2.prototype.length = function () { + var x = this.x; + var y = this.y; + return Math.sqrt(x * x + y * y); + }; + Vector2.prototype.normalize = function () { + var len = this.length(); + if (len != 0) { + this.x /= len; + this.y /= len; + } + return this; + }; + return Vector2; + }()); + spine.Vector2 = Vector2; + var TimeKeeper = (function () { + function TimeKeeper() { + this.maxDelta = 0.064; + this.framesPerSecond = 0; + this.delta = 0; + this.totalTime = 0; + this.lastTime = Date.now() / 1000; + this.frameCount = 0; + this.frameTime = 0; + } + TimeKeeper.prototype.update = function () { + var now = Date.now() / 1000; + this.delta = now - this.lastTime; + this.frameTime += this.delta; + this.totalTime += this.delta; + if (this.delta > this.maxDelta) + this.delta = this.maxDelta; + this.lastTime = now; + this.frameCount++; + if (this.frameTime > 1) { + this.framesPerSecond = this.frameCount / this.frameTime; + this.frameTime = 0; + this.frameCount = 0; + } + }; + return TimeKeeper; + }()); + spine.TimeKeeper = TimeKeeper; + var WindowedMean = (function () { + function WindowedMean(windowSize) { + if (windowSize === void 0) { windowSize = 32; } + this.addedValues = 0; + this.lastValue = 0; + this.mean = 0; + this.dirty = true; + this.values = new Array(windowSize); + } + WindowedMean.prototype.hasEnoughData = function () { + return this.addedValues >= this.values.length; + }; + WindowedMean.prototype.addValue = function (value) { + if (this.addedValues < this.values.length) + this.addedValues++; + this.values[this.lastValue++] = value; + if (this.lastValue > this.values.length - 1) + this.lastValue = 0; + this.dirty = true; + }; + WindowedMean.prototype.getMean = function () { + if (this.hasEnoughData()) { + if (this.dirty) { + var mean = 0; + for (var i = 0; i < this.values.length; i++) { + mean += this.values[i]; + } + this.mean = mean / this.values.length; + this.dirty = false; + } + return this.mean; + } + else { + return 0; + } + }; + return WindowedMean; + }()); + spine.WindowedMean = WindowedMean; +})(spine || (spine = {})); +(function () { + if (!Math.fround) { + Math.fround = (function (array) { + return function (x) { + return array[0] = x, array[0]; + }; + })(new Float32Array(1)); + } +})(); +var spine; +(function (spine) { + var Attachment = (function () { + function Attachment(name) { + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return Attachment; + }()); + spine.Attachment = Attachment; + var VertexAttachment = (function (_super) { + __extends(VertexAttachment, _super); + function VertexAttachment(name) { + var _this = _super.call(this, name) || this; + _this.id = (VertexAttachment.nextID++ & 65535) << 11; + _this.worldVerticesLength = 0; + return _this; + } + VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) { + count = offset + (count >> 1) * stride; + var skeleton = slot.bone.skeleton; + var deformArray = slot.attachmentVertices; + var vertices = this.vertices; + var bones = this.bones; + if (bones == null) { + if (deformArray.length > 0) + vertices = deformArray; + var bone = slot.bone; + var x = bone.worldX; + var y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) { + var vx = vertices[v_1], vy = vertices[v_1 + 1]; + worldVertices[w] = vx * a + vy * b + x; + worldVertices[w + 1] = vx * c + vy * d + y; + } + return; + } + var v = 0, skip = 0; + for (var i = 0; i < start; i += 2) { + var n = bones[v]; + v += n + 1; + skip += n; + } + var skeletonBones = skeleton.bones; + if (deformArray.length == 0) { + for (var w = offset, b = skip * 3; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + else { + var deform = deformArray; + for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3, f += 2) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + }; + VertexAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment; + }; + VertexAttachment.nextID = 0; + return VertexAttachment; + }(Attachment)); + spine.VertexAttachment = VertexAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AttachmentType; + (function (AttachmentType) { + AttachmentType[AttachmentType["Region"] = 0] = "Region"; + AttachmentType[AttachmentType["BoundingBox"] = 1] = "BoundingBox"; + AttachmentType[AttachmentType["Mesh"] = 2] = "Mesh"; + AttachmentType[AttachmentType["LinkedMesh"] = 3] = "LinkedMesh"; + AttachmentType[AttachmentType["Path"] = 4] = "Path"; + AttachmentType[AttachmentType["Point"] = 5] = "Point"; + })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoundingBoxAttachment = (function (_super) { + __extends(BoundingBoxAttachment, _super); + function BoundingBoxAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return BoundingBoxAttachment; + }(spine.VertexAttachment)); + spine.BoundingBoxAttachment = BoundingBoxAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var ClippingAttachment = (function (_super) { + __extends(ClippingAttachment, _super); + function ClippingAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1); + return _this; + } + return ClippingAttachment; + }(spine.VertexAttachment)); + spine.ClippingAttachment = ClippingAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var MeshAttachment = (function (_super) { + __extends(MeshAttachment, _super); + function MeshAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + _this.inheritDeform = false; + _this.tempColor = new spine.Color(0, 0, 0, 0); + return _this; + } + MeshAttachment.prototype.updateUVs = function () { + var regionUVs = this.regionUVs; + if (this.uvs == null || this.uvs.length != regionUVs.length) + this.uvs = spine.Utils.newFloatArray(regionUVs.length); + var uvs = this.uvs; + var u = 0, v = 0, width = 0, height = 0; + if (this.region instanceof spine.TextureAtlasRegion) { + var region = this.region; + var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height; + if (region.rotate) { + u = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth; + v = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight; + width = region.originalHeight / textureWidth; + height = region.originalWidth / textureHeight; + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i + 1] * width; + uvs[i + 1] = v + height - regionUVs[i] * height; + } + return; + } + u = region.u - region.offsetX / textureWidth; + v = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight; + width = region.originalWidth / textureWidth; + height = region.originalHeight / textureHeight; + } + else if (this.region == null) { + u = v = 0; + width = height = 1; + } + else { + u = this.region.u; + v = this.region.v; + width = this.region.u2 - u; + height = this.region.v2 - v; + } + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i] * width; + uvs[i + 1] = v + regionUVs[i + 1] * height; + } + }; + MeshAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment); + }; + MeshAttachment.prototype.getParentMesh = function () { + return this.parentMesh; + }; + MeshAttachment.prototype.setParentMesh = function (parentMesh) { + this.parentMesh = parentMesh; + if (parentMesh != null) { + this.bones = parentMesh.bones; + this.vertices = parentMesh.vertices; + this.worldVerticesLength = parentMesh.worldVerticesLength; + this.regionUVs = parentMesh.regionUVs; + this.triangles = parentMesh.triangles; + this.hullLength = parentMesh.hullLength; + this.worldVerticesLength = parentMesh.worldVerticesLength; + } + }; + return MeshAttachment; + }(spine.VertexAttachment)); + spine.MeshAttachment = MeshAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathAttachment = (function (_super) { + __extends(PathAttachment, _super); + function PathAttachment(name) { + var _this = _super.call(this, name) || this; + _this.closed = false; + _this.constantSpeed = false; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return PathAttachment; + }(spine.VertexAttachment)); + spine.PathAttachment = PathAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PointAttachment = (function (_super) { + __extends(PointAttachment, _super); + function PointAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.38, 0.94, 0, 1); + return _this; + } + PointAttachment.prototype.computeWorldPosition = function (bone, point) { + point.x = this.x * bone.a + this.y * bone.b + bone.worldX; + point.y = this.x * bone.c + this.y * bone.d + bone.worldY; + return point; + }; + PointAttachment.prototype.computeWorldRotation = function (bone) { + var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation); + var x = cos * bone.a + sin * bone.b; + var y = cos * bone.c + sin * bone.d; + return Math.atan2(y, x) * spine.MathUtils.radDeg; + }; + return PointAttachment; + }(spine.VertexAttachment)); + spine.PointAttachment = PointAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var RegionAttachment = (function (_super) { + __extends(RegionAttachment, _super); + function RegionAttachment(name) { + var _this = _super.call(this, name) || this; + _this.x = 0; + _this.y = 0; + _this.scaleX = 1; + _this.scaleY = 1; + _this.rotation = 0; + _this.width = 0; + _this.height = 0; + _this.color = new spine.Color(1, 1, 1, 1); + _this.offset = spine.Utils.newFloatArray(8); + _this.uvs = spine.Utils.newFloatArray(8); + _this.tempColor = new spine.Color(1, 1, 1, 1); + return _this; + } + RegionAttachment.prototype.updateOffset = function () { + var regionScaleX = this.width / this.region.originalWidth * this.scaleX; + var regionScaleY = this.height / this.region.originalHeight * this.scaleY; + var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; + var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; + var localX2 = localX + this.region.width * regionScaleX; + var localY2 = localY + this.region.height * regionScaleY; + var radians = this.rotation * Math.PI / 180; + var cos = Math.cos(radians); + var sin = Math.sin(radians); + var localXCos = localX * cos + this.x; + var localXSin = localX * sin; + var localYCos = localY * cos + this.y; + var localYSin = localY * sin; + var localX2Cos = localX2 * cos + this.x; + var localX2Sin = localX2 * sin; + var localY2Cos = localY2 * cos + this.y; + var localY2Sin = localY2 * sin; + var offset = this.offset; + offset[RegionAttachment.OX1] = localXCos - localYSin; + offset[RegionAttachment.OY1] = localYCos + localXSin; + offset[RegionAttachment.OX2] = localXCos - localY2Sin; + offset[RegionAttachment.OY2] = localY2Cos + localXSin; + offset[RegionAttachment.OX3] = localX2Cos - localY2Sin; + offset[RegionAttachment.OY3] = localY2Cos + localX2Sin; + offset[RegionAttachment.OX4] = localX2Cos - localYSin; + offset[RegionAttachment.OY4] = localYCos + localX2Sin; + }; + RegionAttachment.prototype.setRegion = function (region) { + this.region = region; + var uvs = this.uvs; + if (region.rotate) { + uvs[2] = region.u; + uvs[3] = region.v2; + uvs[4] = region.u; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v; + uvs[0] = region.u2; + uvs[1] = region.v2; + } + else { + uvs[0] = region.u; + uvs[1] = region.v2; + uvs[2] = region.u; + uvs[3] = region.v; + uvs[4] = region.u2; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v2; + } + }; + RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) { + var vertexOffset = this.offset; + var x = bone.worldX, y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var offsetX = 0, offsetY = 0; + offsetX = vertexOffset[RegionAttachment.OX1]; + offsetY = vertexOffset[RegionAttachment.OY1]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX2]; + offsetY = vertexOffset[RegionAttachment.OY2]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX3]; + offsetY = vertexOffset[RegionAttachment.OY3]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX4]; + offsetY = vertexOffset[RegionAttachment.OY4]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + }; + RegionAttachment.OX1 = 0; + RegionAttachment.OY1 = 1; + RegionAttachment.OX2 = 2; + RegionAttachment.OY2 = 3; + RegionAttachment.OX3 = 4; + RegionAttachment.OY3 = 5; + RegionAttachment.OX4 = 6; + RegionAttachment.OY4 = 7; + RegionAttachment.X1 = 0; + RegionAttachment.Y1 = 1; + RegionAttachment.C1R = 2; + RegionAttachment.C1G = 3; + RegionAttachment.C1B = 4; + RegionAttachment.C1A = 5; + RegionAttachment.U1 = 6; + RegionAttachment.V1 = 7; + RegionAttachment.X2 = 8; + RegionAttachment.Y2 = 9; + RegionAttachment.C2R = 10; + RegionAttachment.C2G = 11; + RegionAttachment.C2B = 12; + RegionAttachment.C2A = 13; + RegionAttachment.U2 = 14; + RegionAttachment.V2 = 15; + RegionAttachment.X3 = 16; + RegionAttachment.Y3 = 17; + RegionAttachment.C3R = 18; + RegionAttachment.C3G = 19; + RegionAttachment.C3B = 20; + RegionAttachment.C3A = 21; + RegionAttachment.U3 = 22; + RegionAttachment.V3 = 23; + RegionAttachment.X4 = 24; + RegionAttachment.Y4 = 25; + RegionAttachment.C4R = 26; + RegionAttachment.C4G = 27; + RegionAttachment.C4B = 28; + RegionAttachment.C4A = 29; + RegionAttachment.U4 = 30; + RegionAttachment.V4 = 31; + return RegionAttachment; + }(spine.Attachment)); + spine.RegionAttachment = RegionAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var JitterEffect = (function () { + function JitterEffect(jitterX, jitterY) { + this.jitterX = 0; + this.jitterY = 0; + this.jitterX = jitterX; + this.jitterY = jitterY; + } + JitterEffect.prototype.begin = function (skeleton) { + }; + JitterEffect.prototype.transform = function (position, uv, light, dark) { + position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + }; + JitterEffect.prototype.end = function () { + }; + return JitterEffect; + }()); + spine.JitterEffect = JitterEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SwirlEffect = (function () { + function SwirlEffect(radius) { + this.centerX = 0; + this.centerY = 0; + this.radius = 0; + this.angle = 0; + this.worldX = 0; + this.worldY = 0; + this.radius = radius; + } + SwirlEffect.prototype.begin = function (skeleton) { + this.worldX = skeleton.x + this.centerX; + this.worldY = skeleton.y + this.centerY; + }; + SwirlEffect.prototype.transform = function (position, uv, light, dark) { + var radAngle = this.angle * spine.MathUtils.degreesToRadians; + var x = position.x - this.worldX; + var y = position.y - this.worldY; + var dist = Math.sqrt(x * x + y * y); + if (dist < this.radius) { + var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius); + var cos = Math.cos(theta); + var sin = Math.sin(theta); + position.x = cos * x - sin * y + this.worldX; + position.y = sin * x + cos * y + this.worldY; + } + }; + SwirlEffect.prototype.end = function () { + }; + SwirlEffect.interpolation = new spine.PowOut(2); + return SwirlEffect; + }()); + spine.SwirlEffect = SwirlEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var AssetManager = (function (_super) { + __extends(AssetManager, _super); + function AssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + return _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this; + } + return AssetManager; + }(spine.AssetManager)); + canvas.AssetManager = AssetManager; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var CanvasTexture = (function (_super) { + __extends(CanvasTexture, _super); + function CanvasTexture(image) { + return _super.call(this, image) || this; + } + CanvasTexture.prototype.setFilters = function (minFilter, magFilter) { }; + CanvasTexture.prototype.setWraps = function (uWrap, vWrap) { }; + CanvasTexture.prototype.dispose = function () { }; + return CanvasTexture; + }(spine.Texture)); + canvas.CanvasTexture = CanvasTexture; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var canvas; + (function (canvas) { + var SkeletonRenderer = (function () { + function SkeletonRenderer(context) { + this.triangleRendering = false; + this.debugRendering = false; + this.vertices = spine.Utils.newFloatArray(8 * 1024); + this.tempColor = new spine.Color(); + this.ctx = context; + } + SkeletonRenderer.prototype.draw = function (skeleton) { + if (this.triangleRendering) + this.drawTriangles(skeleton); + else + this.drawImages(skeleton); + }; + SkeletonRenderer.prototype.drawImages = function (skeleton) { + var ctx = this.ctx; + var drawOrder = skeleton.drawOrder; + if (this.debugRendering) + ctx.strokeStyle = "green"; + ctx.save(); + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var attachment = slot.getAttachment(); + var regionAttachment = null; + var region = null; + var image = null; + if (attachment instanceof spine.RegionAttachment) { + regionAttachment = attachment; + region = regionAttachment.region; + image = region.texture.getImage(); + } + else + continue; + var skeleton_1 = slot.bone.skeleton; + var skeletonColor = skeleton_1.color; + var slotColor = slot.color; + var regionColor = regionAttachment.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha); + var att = attachment; + var bone = slot.bone; + var w = region.width; + var h = region.height; + ctx.save(); + ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY); + ctx.translate(attachment.offset[0], attachment.offset[1]); + ctx.rotate(attachment.rotation * Math.PI / 180); + var atlasScale = att.width / w; + ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY); + ctx.translate(w / 2, h / 2); + if (attachment.region.rotate) { + var t = w; + w = h; + h = t; + ctx.rotate(-Math.PI / 2); + } + ctx.scale(1, -1); + ctx.translate(-w / 2, -h / 2); + if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { + ctx.globalAlpha = color.a; + } + ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h); + if (this.debugRendering) + ctx.strokeRect(0, 0, w, h); + ctx.restore(); + } + ctx.restore(); + }; + SkeletonRenderer.prototype.drawTriangles = function (skeleton) { + var blendMode = null; + var vertices = this.vertices; + var triangles = null; + var drawOrder = skeleton.drawOrder; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var attachment = slot.getAttachment(); + var texture = null; + var region = null; + if (attachment instanceof spine.RegionAttachment) { + var regionAttachment = attachment; + vertices = this.computeRegionVertices(slot, regionAttachment, false); + triangles = SkeletonRenderer.QUAD_TRIANGLES; + region = regionAttachment.region; + texture = region.texture.getImage(); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + vertices = this.computeMeshVertices(slot, mesh, false); + triangles = mesh.triangles; + texture = mesh.region.renderObject.texture.getImage(); + } + else + continue; + if (texture != null) { + var slotBlendMode = slot.data.blendMode; + if (slotBlendMode != blendMode) { + blendMode = slotBlendMode; + } + var skeleton_2 = slot.bone.skeleton; + var skeletonColor = skeleton_2.color; + var slotColor = slot.color; + var attachmentColor = attachment.color; + var alpha = skeletonColor.a * slotColor.a * attachmentColor.a; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha); + var ctx = this.ctx; + if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { + ctx.globalAlpha = color.a; + } + for (var j = 0; j < triangles.length; j += 3) { + var t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8; + var x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7]; + var x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7]; + var x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7]; + this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2); + if (this.debugRendering) { + ctx.strokeStyle = "green"; + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.lineTo(x0, y0); + ctx.stroke(); + } + } + } + } + this.ctx.globalAlpha = 1; + }; + SkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) { + var ctx = this.ctx; + u0 *= img.width; + v0 *= img.height; + u1 *= img.width; + v1 *= img.height; + u2 *= img.width; + v2 *= img.height; + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.closePath(); + x1 -= x0; + y1 -= y0; + x2 -= x0; + y2 -= y0; + u1 -= u0; + v1 -= v0; + u2 -= u0; + v2 -= v0; + var det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0; + ctx.save(); + ctx.transform(a, b, c, d, e, f); + ctx.clip(); + ctx.drawImage(img, 0, 0); + ctx.restore(); + }; + SkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) { + var skeleton = slot.bone.skeleton; + var skeletonColor = skeleton.color; + var slotColor = slot.color; + var regionColor = region.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var multiplier = pma ? alpha : 1; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); + region.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE); + var vertices = this.vertices; + var uvs = region.uvs; + vertices[spine.RegionAttachment.C1R] = color.r; + vertices[spine.RegionAttachment.C1G] = color.g; + vertices[spine.RegionAttachment.C1B] = color.b; + vertices[spine.RegionAttachment.C1A] = color.a; + vertices[spine.RegionAttachment.U1] = uvs[0]; + vertices[spine.RegionAttachment.V1] = uvs[1]; + vertices[spine.RegionAttachment.C2R] = color.r; + vertices[spine.RegionAttachment.C2G] = color.g; + vertices[spine.RegionAttachment.C2B] = color.b; + vertices[spine.RegionAttachment.C2A] = color.a; + vertices[spine.RegionAttachment.U2] = uvs[2]; + vertices[spine.RegionAttachment.V2] = uvs[3]; + vertices[spine.RegionAttachment.C3R] = color.r; + vertices[spine.RegionAttachment.C3G] = color.g; + vertices[spine.RegionAttachment.C3B] = color.b; + vertices[spine.RegionAttachment.C3A] = color.a; + vertices[spine.RegionAttachment.U3] = uvs[4]; + vertices[spine.RegionAttachment.V3] = uvs[5]; + vertices[spine.RegionAttachment.C4R] = color.r; + vertices[spine.RegionAttachment.C4G] = color.g; + vertices[spine.RegionAttachment.C4B] = color.b; + vertices[spine.RegionAttachment.C4A] = color.a; + vertices[spine.RegionAttachment.U4] = uvs[6]; + vertices[spine.RegionAttachment.V4] = uvs[7]; + return vertices; + }; + SkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) { + var skeleton = slot.bone.skeleton; + var skeletonColor = skeleton.color; + var slotColor = slot.color; + var regionColor = mesh.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var multiplier = pma ? alpha : 1; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); + var numVertices = mesh.worldVerticesLength / 2; + if (this.vertices.length < mesh.worldVerticesLength) { + this.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength); + } + var vertices = this.vertices; + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE); + var uvs = mesh.uvs; + for (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) { + vertices[v++] = color.r; + vertices[v++] = color.g; + vertices[v++] = color.b; + vertices[v++] = color.a; + vertices[v++] = uvs[u++]; + vertices[v++] = uvs[u++]; + v += 2; + } + return vertices; + }; + SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; + SkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4; + return SkeletonRenderer; + }()); + canvas.SkeletonRenderer = SkeletonRenderer; + })(canvas = spine.canvas || (spine.canvas = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var AssetManager = (function (_super) { + __extends(AssetManager, _super); + function AssetManager(context, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + return _super.call(this, function (image) { + return new spine.webgl.GLTexture(context, image); + }, pathPrefix) || this; + } + return AssetManager; + }(spine.AssetManager)); + webgl.AssetManager = AssetManager; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var OrthoCamera = (function () { + function OrthoCamera(viewportWidth, viewportHeight) { + this.position = new webgl.Vector3(0, 0, 0); + this.direction = new webgl.Vector3(0, 0, -1); + this.up = new webgl.Vector3(0, 1, 0); + this.near = 0; + this.far = 100; + this.zoom = 1; + this.viewportWidth = 0; + this.viewportHeight = 0; + this.projectionView = new webgl.Matrix4(); + this.inverseProjectionView = new webgl.Matrix4(); + this.projection = new webgl.Matrix4(); + this.view = new webgl.Matrix4(); + this.tmp = new webgl.Vector3(); + this.viewportWidth = viewportWidth; + this.viewportHeight = viewportHeight; + this.update(); + } + OrthoCamera.prototype.update = function () { + var projection = this.projection; + var view = this.view; + var projectionView = this.projectionView; + var inverseProjectionView = this.inverseProjectionView; + var zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight; + projection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far); + view.lookAt(this.position, this.direction, this.up); + projectionView.set(projection.values); + projectionView.multiply(view); + inverseProjectionView.set(projectionView.values).invert(); + }; + OrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) { + var x = screenCoords.x, y = screenHeight - screenCoords.y - 1; + var tmp = this.tmp; + tmp.x = (2 * x) / screenWidth - 1; + tmp.y = (2 * y) / screenHeight - 1; + tmp.z = (2 * screenCoords.z) - 1; + tmp.project(this.inverseProjectionView); + screenCoords.set(tmp.x, tmp.y, tmp.z); + return screenCoords; + }; + OrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) { + this.viewportWidth = viewportWidth; + this.viewportHeight = viewportHeight; + }; + return OrthoCamera; + }()); + webgl.OrthoCamera = OrthoCamera; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var GLTexture = (function (_super) { + __extends(GLTexture, _super); + function GLTexture(context, image, useMipMaps) { + if (useMipMaps === void 0) { useMipMaps = false; } + var _this = _super.call(this, image) || this; + _this.texture = null; + _this.boundUnit = 0; + _this.useMipMaps = false; + _this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + _this.useMipMaps = useMipMaps; + _this.restore(); + _this.context.addRestorable(_this); + return _this; + } + GLTexture.prototype.setFilters = function (minFilter, magFilter) { + var gl = this.context.gl; + this.bind(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); + }; + GLTexture.prototype.setWraps = function (uWrap, vWrap) { + var gl = this.context.gl; + this.bind(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap); + }; + GLTexture.prototype.update = function (useMipMaps) { + var gl = this.context.gl; + if (!this.texture) { + this.texture = this.context.gl.createTexture(); + } + this.bind(); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + if (useMipMaps) + gl.generateMipmap(gl.TEXTURE_2D); + }; + GLTexture.prototype.restore = function () { + this.texture = null; + this.update(this.useMipMaps); + }; + GLTexture.prototype.bind = function (unit) { + if (unit === void 0) { unit = 0; } + var gl = this.context.gl; + this.boundUnit = unit; + gl.activeTexture(gl.TEXTURE0 + unit); + gl.bindTexture(gl.TEXTURE_2D, this.texture); + }; + GLTexture.prototype.unbind = function () { + var gl = this.context.gl; + gl.activeTexture(gl.TEXTURE0 + this.boundUnit); + gl.bindTexture(gl.TEXTURE_2D, null); + }; + GLTexture.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + gl.deleteTexture(this.texture); + }; + return GLTexture; + }(spine.Texture)); + webgl.GLTexture = GLTexture; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + webgl.M00 = 0; + webgl.M01 = 4; + webgl.M02 = 8; + webgl.M03 = 12; + webgl.M10 = 1; + webgl.M11 = 5; + webgl.M12 = 9; + webgl.M13 = 13; + webgl.M20 = 2; + webgl.M21 = 6; + webgl.M22 = 10; + webgl.M23 = 14; + webgl.M30 = 3; + webgl.M31 = 7; + webgl.M32 = 11; + webgl.M33 = 15; + var Matrix4 = (function () { + function Matrix4() { + this.temp = new Float32Array(16); + this.values = new Float32Array(16); + var v = this.values; + v[webgl.M00] = 1; + v[webgl.M11] = 1; + v[webgl.M22] = 1; + v[webgl.M33] = 1; + } + Matrix4.prototype.set = function (values) { + this.values.set(values); + return this; + }; + Matrix4.prototype.transpose = function () { + var t = this.temp; + var v = this.values; + t[webgl.M00] = v[webgl.M00]; + t[webgl.M01] = v[webgl.M10]; + t[webgl.M02] = v[webgl.M20]; + t[webgl.M03] = v[webgl.M30]; + t[webgl.M10] = v[webgl.M01]; + t[webgl.M11] = v[webgl.M11]; + t[webgl.M12] = v[webgl.M21]; + t[webgl.M13] = v[webgl.M31]; + t[webgl.M20] = v[webgl.M02]; + t[webgl.M21] = v[webgl.M12]; + t[webgl.M22] = v[webgl.M22]; + t[webgl.M23] = v[webgl.M32]; + t[webgl.M30] = v[webgl.M03]; + t[webgl.M31] = v[webgl.M13]; + t[webgl.M32] = v[webgl.M23]; + t[webgl.M33] = v[webgl.M33]; + return this.set(t); + }; + Matrix4.prototype.identity = function () { + var v = this.values; + v[webgl.M00] = 1; + v[webgl.M01] = 0; + v[webgl.M02] = 0; + v[webgl.M03] = 0; + v[webgl.M10] = 0; + v[webgl.M11] = 1; + v[webgl.M12] = 0; + v[webgl.M13] = 0; + v[webgl.M20] = 0; + v[webgl.M21] = 0; + v[webgl.M22] = 1; + v[webgl.M23] = 0; + v[webgl.M30] = 0; + v[webgl.M31] = 0; + v[webgl.M32] = 0; + v[webgl.M33] = 1; + return this; + }; + Matrix4.prototype.invert = function () { + var v = this.values; + var t = this.temp; + var l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] + + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] + - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] + - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] + + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] + + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] + - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] + - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + if (l_det == 0) + throw new Error("non-invertible matrix"); + var inv_det = 1.0 / l_det; + t[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32] + - v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32] + + v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32] + - v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33]; + t[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22] + + v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23]; + t[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32] + + v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32] + - v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32] + + v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33]; + t[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22] + - v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23]; + t[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31] + - v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33]; + t[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31] + + v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33]; + t[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31] + - v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33]; + t[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21] + + v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23]; + t[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31] + + v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32]; + t[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31] + - v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32]; + t[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31] + + v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32]; + t[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21] + - v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22]; + v[webgl.M00] = t[webgl.M00] * inv_det; + v[webgl.M01] = t[webgl.M01] * inv_det; + v[webgl.M02] = t[webgl.M02] * inv_det; + v[webgl.M03] = t[webgl.M03] * inv_det; + v[webgl.M10] = t[webgl.M10] * inv_det; + v[webgl.M11] = t[webgl.M11] * inv_det; + v[webgl.M12] = t[webgl.M12] * inv_det; + v[webgl.M13] = t[webgl.M13] * inv_det; + v[webgl.M20] = t[webgl.M20] * inv_det; + v[webgl.M21] = t[webgl.M21] * inv_det; + v[webgl.M22] = t[webgl.M22] * inv_det; + v[webgl.M23] = t[webgl.M23] * inv_det; + v[webgl.M30] = t[webgl.M30] * inv_det; + v[webgl.M31] = t[webgl.M31] * inv_det; + v[webgl.M32] = t[webgl.M32] * inv_det; + v[webgl.M33] = t[webgl.M33] * inv_det; + return this; + }; + Matrix4.prototype.determinant = function () { + var v = this.values; + return v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] + + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] + - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] + - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] + + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] + + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] + - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] + - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + }; + Matrix4.prototype.translate = function (x, y, z) { + var v = this.values; + v[webgl.M03] += x; + v[webgl.M13] += y; + v[webgl.M23] += z; + return this; + }; + Matrix4.prototype.copy = function () { + return new Matrix4().set(this.values); + }; + Matrix4.prototype.projection = function (near, far, fovy, aspectRatio) { + this.identity(); + var l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0)); + var l_a1 = (far + near) / (near - far); + var l_a2 = (2 * far * near) / (near - far); + var v = this.values; + v[webgl.M00] = l_fd / aspectRatio; + v[webgl.M10] = 0; + v[webgl.M20] = 0; + v[webgl.M30] = 0; + v[webgl.M01] = 0; + v[webgl.M11] = l_fd; + v[webgl.M21] = 0; + v[webgl.M31] = 0; + v[webgl.M02] = 0; + v[webgl.M12] = 0; + v[webgl.M22] = l_a1; + v[webgl.M32] = -1; + v[webgl.M03] = 0; + v[webgl.M13] = 0; + v[webgl.M23] = l_a2; + v[webgl.M33] = 0; + return this; + }; + Matrix4.prototype.ortho2d = function (x, y, width, height) { + return this.ortho(x, x + width, y, y + height, 0, 1); + }; + Matrix4.prototype.ortho = function (left, right, bottom, top, near, far) { + this.identity(); + var x_orth = 2 / (right - left); + var y_orth = 2 / (top - bottom); + var z_orth = -2 / (far - near); + var tx = -(right + left) / (right - left); + var ty = -(top + bottom) / (top - bottom); + var tz = -(far + near) / (far - near); + var v = this.values; + v[webgl.M00] = x_orth; + v[webgl.M10] = 0; + v[webgl.M20] = 0; + v[webgl.M30] = 0; + v[webgl.M01] = 0; + v[webgl.M11] = y_orth; + v[webgl.M21] = 0; + v[webgl.M31] = 0; + v[webgl.M02] = 0; + v[webgl.M12] = 0; + v[webgl.M22] = z_orth; + v[webgl.M32] = 0; + v[webgl.M03] = tx; + v[webgl.M13] = ty; + v[webgl.M23] = tz; + v[webgl.M33] = 1; + return this; + }; + Matrix4.prototype.multiply = function (matrix) { + var t = this.temp; + var v = this.values; + var m = matrix.values; + t[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30]; + t[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31]; + t[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32]; + t[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33]; + t[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30]; + t[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31]; + t[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32]; + t[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33]; + t[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30]; + t[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31]; + t[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32]; + t[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33]; + t[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30]; + t[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31]; + t[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32]; + t[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33]; + return this.set(this.temp); + }; + Matrix4.prototype.multiplyLeft = function (matrix) { + var t = this.temp; + var v = this.values; + var m = matrix.values; + t[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30]; + t[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31]; + t[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32]; + t[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33]; + t[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30]; + t[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31]; + t[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32]; + t[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33]; + t[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30]; + t[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31]; + t[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32]; + t[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33]; + t[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30]; + t[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31]; + t[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32]; + t[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33]; + return this.set(this.temp); + }; + Matrix4.prototype.lookAt = function (position, direction, up) { + Matrix4.initTemps(); + var xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis; + zAxis.setFrom(direction).normalize(); + xAxis.setFrom(direction).normalize(); + xAxis.cross(up).normalize(); + yAxis.setFrom(xAxis).cross(zAxis).normalize(); + this.identity(); + var val = this.values; + val[webgl.M00] = xAxis.x; + val[webgl.M01] = xAxis.y; + val[webgl.M02] = xAxis.z; + val[webgl.M10] = yAxis.x; + val[webgl.M11] = yAxis.y; + val[webgl.M12] = yAxis.z; + val[webgl.M20] = -zAxis.x; + val[webgl.M21] = -zAxis.y; + val[webgl.M22] = -zAxis.z; + Matrix4.tmpMatrix.identity(); + Matrix4.tmpMatrix.values[webgl.M03] = -position.x; + Matrix4.tmpMatrix.values[webgl.M13] = -position.y; + Matrix4.tmpMatrix.values[webgl.M23] = -position.z; + this.multiply(Matrix4.tmpMatrix); + return this; + }; + Matrix4.initTemps = function () { + if (Matrix4.xAxis === null) + Matrix4.xAxis = new webgl.Vector3(); + if (Matrix4.yAxis === null) + Matrix4.yAxis = new webgl.Vector3(); + if (Matrix4.zAxis === null) + Matrix4.zAxis = new webgl.Vector3(); + }; + Matrix4.xAxis = null; + Matrix4.yAxis = null; + Matrix4.zAxis = null; + Matrix4.tmpMatrix = new Matrix4(); + return Matrix4; + }()); + webgl.Matrix4 = Matrix4; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Mesh = (function () { + function Mesh(context, attributes, maxVertices, maxIndices) { + this.attributes = attributes; + this.verticesLength = 0; + this.dirtyVertices = false; + this.indicesLength = 0; + this.dirtyIndices = false; + this.elementsPerVertex = 0; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.elementsPerVertex = 0; + for (var i = 0; i < attributes.length; i++) { + this.elementsPerVertex += attributes[i].numElements; + } + this.vertices = new Float32Array(maxVertices * this.elementsPerVertex); + this.indices = new Uint16Array(maxIndices); + this.context.addRestorable(this); + } + Mesh.prototype.getAttributes = function () { return this.attributes; }; + Mesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; }; + Mesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; }; + Mesh.prototype.setVerticesLength = function (length) { + this.dirtyVertices = true; + this.verticesLength = length; + }; + Mesh.prototype.getVertices = function () { return this.vertices; }; + Mesh.prototype.maxIndices = function () { return this.indices.length; }; + Mesh.prototype.numIndices = function () { return this.indicesLength; }; + Mesh.prototype.setIndicesLength = function (length) { + this.dirtyIndices = true; + this.indicesLength = length; + }; + Mesh.prototype.getIndices = function () { return this.indices; }; + ; + Mesh.prototype.getVertexSizeInFloats = function () { + var size = 0; + for (var i = 0; i < this.attributes.length; i++) { + var attribute = this.attributes[i]; + size += attribute.numElements; + } + return size; + }; + Mesh.prototype.setVertices = function (vertices) { + this.dirtyVertices = true; + if (vertices.length > this.vertices.length) + throw Error("Mesh can't store more than " + this.maxVertices() + " vertices"); + this.vertices.set(vertices, 0); + this.verticesLength = vertices.length; + }; + Mesh.prototype.setIndices = function (indices) { + this.dirtyIndices = true; + if (indices.length > this.indices.length) + throw Error("Mesh can't store more than " + this.maxIndices() + " indices"); + this.indices.set(indices, 0); + this.indicesLength = indices.length; + }; + Mesh.prototype.draw = function (shader, primitiveType) { + this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex); + }; + Mesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) { + var gl = this.context.gl; + if (this.dirtyVertices || this.dirtyIndices) + this.update(); + this.bind(shader); + if (this.indicesLength > 0) { + gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2); + } + else { + gl.drawArrays(primitiveType, offset, count); + } + this.unbind(shader); + }; + Mesh.prototype.bind = function (shader) { + var gl = this.context.gl; + gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); + var offset = 0; + for (var i = 0; i < this.attributes.length; i++) { + var attrib = this.attributes[i]; + var location_1 = shader.getAttributeLocation(attrib.name); + gl.enableVertexAttribArray(location_1); + gl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4); + offset += attrib.numElements; + } + if (this.indicesLength > 0) + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); + }; + Mesh.prototype.unbind = function (shader) { + var gl = this.context.gl; + for (var i = 0; i < this.attributes.length; i++) { + var attrib = this.attributes[i]; + var location_2 = shader.getAttributeLocation(attrib.name); + gl.disableVertexAttribArray(location_2); + } + gl.bindBuffer(gl.ARRAY_BUFFER, null); + if (this.indicesLength > 0) + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); + }; + Mesh.prototype.update = function () { + var gl = this.context.gl; + if (this.dirtyVertices) { + if (!this.verticesBuffer) { + this.verticesBuffer = gl.createBuffer(); + } + gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); + gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW); + this.dirtyVertices = false; + } + if (this.dirtyIndices) { + if (!this.indicesBuffer) { + this.indicesBuffer = gl.createBuffer(); + } + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW); + this.dirtyIndices = false; + } + }; + Mesh.prototype.restore = function () { + this.verticesBuffer = null; + this.indicesBuffer = null; + this.update(); + }; + Mesh.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + gl.deleteBuffer(this.verticesBuffer); + gl.deleteBuffer(this.indicesBuffer); + }; + return Mesh; + }()); + webgl.Mesh = Mesh; + var VertexAttribute = (function () { + function VertexAttribute(name, type, numElements) { + this.name = name; + this.type = type; + this.numElements = numElements; + } + return VertexAttribute; + }()); + webgl.VertexAttribute = VertexAttribute; + var Position2Attribute = (function (_super) { + __extends(Position2Attribute, _super); + function Position2Attribute() { + return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this; + } + return Position2Attribute; + }(VertexAttribute)); + webgl.Position2Attribute = Position2Attribute; + var Position3Attribute = (function (_super) { + __extends(Position3Attribute, _super); + function Position3Attribute() { + return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this; + } + return Position3Attribute; + }(VertexAttribute)); + webgl.Position3Attribute = Position3Attribute; + var TexCoordAttribute = (function (_super) { + __extends(TexCoordAttribute, _super); + function TexCoordAttribute(unit) { + if (unit === void 0) { unit = 0; } + return _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? "" : unit), VertexAttributeType.Float, 2) || this; + } + return TexCoordAttribute; + }(VertexAttribute)); + webgl.TexCoordAttribute = TexCoordAttribute; + var ColorAttribute = (function (_super) { + __extends(ColorAttribute, _super); + function ColorAttribute() { + return _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this; + } + return ColorAttribute; + }(VertexAttribute)); + webgl.ColorAttribute = ColorAttribute; + var Color2Attribute = (function (_super) { + __extends(Color2Attribute, _super); + function Color2Attribute() { + return _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this; + } + return Color2Attribute; + }(VertexAttribute)); + webgl.Color2Attribute = Color2Attribute; + var VertexAttributeType; + (function (VertexAttributeType) { + VertexAttributeType[VertexAttributeType["Float"] = 0] = "Float"; + })(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var PolygonBatcher = (function () { + function PolygonBatcher(context, twoColorTint, maxVertices) { + if (twoColorTint === void 0) { twoColorTint = true; } + if (maxVertices === void 0) { maxVertices = 10920; } + this.isDrawing = false; + this.shader = null; + this.lastTexture = null; + this.verticesLength = 0; + this.indicesLength = 0; + if (maxVertices > 10920) + throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + var attributes = twoColorTint ? + [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] : + [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()]; + this.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3); + this.srcBlend = this.context.gl.SRC_ALPHA; + this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; + } + PolygonBatcher.prototype.begin = function (shader) { + var gl = 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 = shader; + this.lastTexture = null; + this.isDrawing = true; + gl.enable(gl.BLEND); + gl.blendFunc(this.srcBlend, this.dstBlend); + }; + PolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) { + var gl = this.context.gl; + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + if (this.isDrawing) { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + }; + PolygonBatcher.prototype.draw = function (texture, vertices, indices) { + if (texture != this.lastTexture) { + this.flush(); + this.lastTexture = texture; + } + else if (this.verticesLength + vertices.length > this.mesh.getVertices().length || + this.indicesLength + indices.length > this.mesh.getIndices().length) { + this.flush(); + } + var indexStart = this.mesh.numVertices(); + this.mesh.getVertices().set(vertices, this.verticesLength); + this.verticesLength += vertices.length; + this.mesh.setVerticesLength(this.verticesLength); + var indicesArray = this.mesh.getIndices(); + for (var i = this.indicesLength, j = 0; j < indices.length; i++, j++) + indicesArray[i] = indices[j] + indexStart; + this.indicesLength += indices.length; + this.mesh.setIndicesLength(this.indicesLength); + }; + PolygonBatcher.prototype.flush = function () { + var gl = this.context.gl; + if (this.verticesLength == 0) + return; + this.lastTexture.bind(); + this.mesh.draw(this.shader, gl.TRIANGLES); + this.verticesLength = 0; + this.indicesLength = 0; + this.mesh.setVerticesLength(0); + this.mesh.setIndicesLength(0); + this.drawCalls++; + }; + PolygonBatcher.prototype.end = function () { + var gl = this.context.gl; + if (!this.isDrawing) + throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()"); + if (this.verticesLength > 0 || this.indicesLength > 0) + this.flush(); + this.shader = null; + this.lastTexture = null; + this.isDrawing = false; + gl.disable(gl.BLEND); + }; + PolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; }; + PolygonBatcher.prototype.dispose = function () { + this.mesh.dispose(); + }; + return PolygonBatcher; + }()); + webgl.PolygonBatcher = PolygonBatcher; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var SceneRenderer = (function () { + function SceneRenderer(canvas, context, twoColorTint) { + if (twoColorTint === void 0) { twoColorTint = true; } + this.twoColorTint = false; + 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 spine.Color(1, 1, 1, 1); + this.canvas = canvas; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.twoColorTint = twoColorTint; + this.camera = new webgl.OrthoCamera(canvas.width, canvas.height); + this.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context); + this.batcher = new webgl.PolygonBatcher(this.context, twoColorTint); + this.shapesShader = webgl.Shader.newColored(this.context); + this.shapes = new webgl.ShapeRenderer(this.context); + this.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint); + this.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context); + } + SceneRenderer.prototype.begin = function () { + this.camera.update(); + this.enableRenderer(this.batcher); + }; + SceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + if (slotRangeStart === void 0) { slotRangeStart = -1; } + if (slotRangeEnd === void 0) { slotRangeEnd = -1; } + this.enableRenderer(this.batcher); + this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha; + this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd); + }; + SceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + if (ignoredBones === void 0) { ignoredBones = null; } + this.enableRenderer(this.shapes); + this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha; + this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones); + }; + SceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u; + quad[i++] = v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u2; + quad[i++] = v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u2; + quad[i++] = v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u; + quad[i++] = v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) { + if (color === void 0) { color = null; } + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var worldOriginX = x + pivotX; + var worldOriginY = y + pivotY; + var fx = -pivotX; + var fy = -pivotY; + var fx2 = width - pivotX; + var fy2 = height - pivotY; + var p1x = fx; + var p1y = fy; + var p2x = fx; + var p2y = fy2; + var p3x = fx2; + var p3y = fy2; + var p4x = fx2; + var p4y = fy; + var x1 = 0; + var y1 = 0; + var x2 = 0; + var y2 = 0; + var x3 = 0; + var y3 = 0; + var x4 = 0; + var y4 = 0; + if (angle != 0) { + var cos = spine.MathUtils.cosDeg(angle); + var sin = spine.MathUtils.sinDeg(angle); + x1 = cos * p1x - sin * p1y; + y1 = sin * p1x + cos * p1y; + x4 = cos * p2x - sin * p2y; + y4 = sin * p2x + cos * p2y; + x3 = cos * p3x - sin * p3y; + y3 = sin * p3x + cos * p3y; + x2 = x3 + (x1 - x4); + y2 = y3 + (y1 - y4); + } + else { + x1 = p1x; + y1 = p1y; + x4 = p2x; + y4 = p2y; + x3 = p3x; + y3 = p3y; + x2 = p4x; + y2 = p4y; + } + x1 += worldOriginX; + y1 += worldOriginY; + x2 += worldOriginX; + y2 += worldOriginY; + x3 += worldOriginX; + y3 += worldOriginY; + x4 += worldOriginX; + y4 += worldOriginY; + var i = 0; + quad[i++] = x1; + quad[i++] = y1; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x2; + quad[i++] = y2; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x3; + quad[i++] = y3; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x4; + quad[i++] = y4; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) { + if (color === void 0) { color = null; } + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u; + quad[i++] = region.v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u2; + quad[i++] = region.v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u2; + quad[i++] = region.v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u; + quad[i++] = region.v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + this.enableRenderer(this.shapes); + this.shapes.line(x, y, x2, y2, color); + }; + SceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + this.enableRenderer(this.shapes); + this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3); + }; + SceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + if (color4 === void 0) { color4 = null; } + this.enableRenderer(this.shapes); + this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4); + }; + SceneRenderer.prototype.rect = function (filled, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.rect(filled, x, y, width, height, color); + }; + SceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.rectLine(filled, x1, y1, x2, y2, width, color); + }; + SceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.polygon(polygonVertices, offset, count, color); + }; + SceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { + if (color === void 0) { color = null; } + if (segments === void 0) { segments = 0; } + this.enableRenderer(this.shapes); + this.shapes.circle(filled, x, y, radius, color, segments); + }; + SceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color); + }; + SceneRenderer.prototype.end = function () { + if (this.activeRenderer === this.batcher) + this.batcher.end(); + else if (this.activeRenderer === this.shapes) + this.shapes.end(); + this.activeRenderer = null; + }; + SceneRenderer.prototype.resize = function (resizeMode) { + var canvas = this.canvas; + var w = canvas.clientWidth; + var h = canvas.clientHeight; + if (canvas.width != w || canvas.height != h) { + canvas.width = w; + canvas.height = h; + } + this.context.gl.viewport(0, 0, canvas.width, canvas.height); + if (resizeMode === ResizeMode.Stretch) { + } + else if (resizeMode === ResizeMode.Expand) { + this.camera.setViewport(w, h); + } + else if (resizeMode === ResizeMode.Fit) { + var sourceWidth = canvas.width, sourceHeight = canvas.height; + var targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight; + var targetRatio = targetHeight / targetWidth; + var sourceRatio = sourceHeight / sourceWidth; + var scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight; + this.camera.viewportWidth = sourceWidth * scale; + this.camera.viewportHeight = sourceHeight * scale; + } + this.camera.update(); + }; + SceneRenderer.prototype.enableRenderer = function (renderer) { + if (this.activeRenderer === renderer) + return; + this.end(); + if (renderer instanceof webgl.PolygonBatcher) { + this.batcherShader.bind(); + this.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); + this.batcherShader.setUniformi("u_texture", 0); + this.batcher.begin(this.batcherShader); + this.activeRenderer = this.batcher; + } + else if (renderer instanceof webgl.ShapeRenderer) { + this.shapesShader.bind(); + this.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); + this.shapes.begin(this.shapesShader); + this.activeRenderer = this.shapes; + } + else { + this.activeRenderer = this.skeletonDebugRenderer; + } + }; + SceneRenderer.prototype.dispose = function () { + this.batcher.dispose(); + this.batcherShader.dispose(); + this.shapes.dispose(); + this.shapesShader.dispose(); + this.skeletonDebugRenderer.dispose(); + }; + return SceneRenderer; + }()); + webgl.SceneRenderer = SceneRenderer; + var ResizeMode; + (function (ResizeMode) { + ResizeMode[ResizeMode["Stretch"] = 0] = "Stretch"; + ResizeMode[ResizeMode["Expand"] = 1] = "Expand"; + ResizeMode[ResizeMode["Fit"] = 2] = "Fit"; + })(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Shader = (function () { + function Shader(context, vertexShader, fragmentShader) { + this.vertexShader = vertexShader; + this.fragmentShader = fragmentShader; + this.vs = null; + this.fs = null; + this.program = null; + this.tmp2x2 = new Float32Array(2 * 2); + this.tmp3x3 = new Float32Array(3 * 3); + this.tmp4x4 = new Float32Array(4 * 4); + this.vsSource = vertexShader; + this.fsSource = fragmentShader; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.context.addRestorable(this); + this.compile(); + } + Shader.prototype.getProgram = function () { return this.program; }; + Shader.prototype.getVertexShader = function () { return this.vertexShader; }; + Shader.prototype.getFragmentShader = function () { return this.fragmentShader; }; + Shader.prototype.getVertexShaderSource = function () { return this.vsSource; }; + Shader.prototype.getFragmentSource = function () { return this.fsSource; }; + Shader.prototype.compile = function () { + var gl = this.context.gl; + try { + this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader); + this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader); + this.program = this.compileProgram(this.vs, this.fs); + } + catch (e) { + this.dispose(); + throw e; + } + }; + Shader.prototype.compileShader = function (type, source) { + var gl = this.context.gl; + var shader = gl.createShader(type); + gl.shaderSource(shader, source); + gl.compileShader(shader); + if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { + var error = "Couldn't compile shader: " + gl.getShaderInfoLog(shader); + gl.deleteShader(shader); + if (!gl.isContextLost()) + throw new Error(error); + } + return shader; + }; + Shader.prototype.compileProgram = function (vs, fs) { + var gl = this.context.gl; + var program = gl.createProgram(); + gl.attachShader(program, vs); + gl.attachShader(program, fs); + gl.linkProgram(program); + if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { + var error = "Couldn't compile shader program: " + gl.getProgramInfoLog(program); + gl.deleteProgram(program); + if (!gl.isContextLost()) + throw new Error(error); + } + return program; + }; + Shader.prototype.restore = function () { + this.compile(); + }; + Shader.prototype.bind = function () { + this.context.gl.useProgram(this.program); + }; + Shader.prototype.unbind = function () { + this.context.gl.useProgram(null); + }; + Shader.prototype.setUniformi = function (uniform, value) { + this.context.gl.uniform1i(this.getUniformLocation(uniform), value); + }; + Shader.prototype.setUniformf = function (uniform, value) { + this.context.gl.uniform1f(this.getUniformLocation(uniform), value); + }; + Shader.prototype.setUniform2f = function (uniform, value, value2) { + this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2); + }; + Shader.prototype.setUniform3f = function (uniform, value, value2, value3) { + this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3); + }; + Shader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) { + this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4); + }; + Shader.prototype.setUniform2x2f = function (uniform, value) { + var gl = this.context.gl; + this.tmp2x2.set(value); + gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2); + }; + Shader.prototype.setUniform3x3f = function (uniform, value) { + var gl = this.context.gl; + this.tmp3x3.set(value); + gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3); + }; + Shader.prototype.setUniform4x4f = function (uniform, value) { + var gl = this.context.gl; + this.tmp4x4.set(value); + gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4); + }; + Shader.prototype.getUniformLocation = function (uniform) { + var gl = this.context.gl; + var location = gl.getUniformLocation(this.program, uniform); + if (!location && !gl.isContextLost()) + throw new Error("Couldn't find location for uniform " + uniform); + return location; + }; + Shader.prototype.getAttributeLocation = function (attribute) { + var gl = this.context.gl; + var location = gl.getAttribLocation(this.program, attribute); + if (location == -1 && !gl.isContextLost()) + throw new Error("Couldn't find location for attribute " + attribute); + return location; + }; + Shader.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + if (this.vs) { + gl.deleteShader(this.vs); + this.vs = null; + } + if (this.fs) { + gl.deleteShader(this.fs); + this.fs = null; + } + if (this.program) { + gl.deleteProgram(this.program); + this.program = null; + } + }; + Shader.newColoredTextured = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.newTwoColoredTextured = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR2 + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_dark = " + Shader.COLOR2 + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.newColored = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tuniform mat4 " + Shader.MVP_MATRIX + ";\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = " + Shader.COLOR + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.MVP_MATRIX = "u_projTrans"; + Shader.POSITION = "a_position"; + Shader.COLOR = "a_color"; + Shader.COLOR2 = "a_color2"; + Shader.TEXCOORDS = "a_texCoords"; + Shader.SAMPLER = "u_texture"; + return Shader; + }()); + webgl.Shader = Shader; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var ShapeRenderer = (function () { + function ShapeRenderer(context, maxVertices) { + if (maxVertices === void 0) { maxVertices = 10920; } + this.isDrawing = false; + this.shapeType = ShapeType.Filled; + this.color = new spine.Color(1, 1, 1, 1); + this.vertexIndex = 0; + this.tmp = new spine.Vector2(); + if (maxVertices > 10920) + throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0); + this.srcBlend = this.context.gl.SRC_ALPHA; + this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; + } + ShapeRenderer.prototype.begin = function (shader) { + if (this.isDrawing) + throw new Error("ShapeRenderer.begin() has already been called"); + this.shader = shader; + this.vertexIndex = 0; + this.isDrawing = true; + var gl = this.context.gl; + gl.enable(gl.BLEND); + gl.blendFunc(this.srcBlend, this.dstBlend); + }; + ShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) { + var gl = this.context.gl; + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + if (this.isDrawing) { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + }; + ShapeRenderer.prototype.setColor = function (color) { + this.color.setFromColor(color); + }; + ShapeRenderer.prototype.setColorWith = function (r, g, b, a) { + this.color.set(r, g, b, a); + }; + ShapeRenderer.prototype.point = function (x, y, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Point, 1); + if (color === null) + color = this.color; + this.vertex(x, y, color); + }; + ShapeRenderer.prototype.line = function (x, y, x2, y2, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Line, 2); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + this.vertex(x, y, color); + this.vertex(x2, y2, color); + }; + ShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + if (color2 === null) + color2 = this.color; + if (color3 === null) + color3 = this.color; + if (filled) { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + } + else { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x2, y2, color); + this.vertex(x3, y3, color2); + this.vertex(x3, y3, color); + this.vertex(x, y, color2); + } + }; + ShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + if (color4 === void 0) { color4 = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + if (color2 === null) + color2 = this.color; + if (color3 === null) + color3 = this.color; + if (color4 === null) + color4 = this.color; + if (filled) { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + this.vertex(x3, y3, color3); + this.vertex(x4, y4, color4); + this.vertex(x, y, color); + } + else { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + this.vertex(x3, y3, color3); + this.vertex(x4, y4, color4); + this.vertex(x4, y4, color4); + this.vertex(x, y, color); + } + }; + ShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color); + }; + ShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { + if (color === void 0) { color = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 8); + if (color === null) + color = this.color; + var t = this.tmp.set(y2 - y1, x1 - x2); + t.normalize(); + width *= 0.5; + var tx = t.x * width; + var ty = t.y * width; + if (!filled) { + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x1 - tx, y1 - ty, color); + } + else { + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + } + }; + ShapeRenderer.prototype.x = function (x, y, size) { + this.line(x - size, y - size, x + size, y + size); + this.line(x - size, y + size, x + size, y - size); + }; + ShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { + if (color === void 0) { color = null; } + if (count < 3) + throw new Error("Polygon must contain at least 3 vertices"); + this.check(ShapeType.Line, count * 2); + if (color === null) + color = this.color; + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + offset <<= 1; + count <<= 1; + var firstX = polygonVertices[offset]; + var firstY = polygonVertices[offset + 1]; + var last = offset + count; + for (var i = offset, n = offset + count - 2; i < n; i += 2) { + var x1 = polygonVertices[i]; + var y1 = polygonVertices[i + 1]; + var x2 = 0; + var y2 = 0; + if (i + 2 >= last) { + x2 = firstX; + y2 = firstY; + } + else { + x2 = polygonVertices[i + 2]; + y2 = polygonVertices[i + 3]; + } + this.vertex(x1, y1, color); + this.vertex(x2, y2, color); + } + }; + ShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { + if (color === void 0) { color = null; } + if (segments === void 0) { segments = 0; } + if (segments === 0) + segments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0); + if (segments <= 0) + throw new Error("segments must be > 0."); + if (color === null) + color = this.color; + var angle = 2 * spine.MathUtils.PI / segments; + var cos = Math.cos(angle); + var sin = Math.sin(angle); + var cx = radius, cy = 0; + if (!filled) { + this.check(ShapeType.Line, segments * 2 + 2); + for (var i = 0; i < segments; i++) { + this.vertex(x + cx, y + cy, color); + var temp_1 = cx; + cx = cos * cx - sin * cy; + cy = sin * temp_1 + cos * cy; + this.vertex(x + cx, y + cy, color); + } + this.vertex(x + cx, y + cy, color); + } + else { + this.check(ShapeType.Filled, segments * 3 + 3); + segments--; + for (var i = 0; i < segments; i++) { + this.vertex(x, y, color); + this.vertex(x + cx, y + cy, color); + var temp_2 = cx; + cx = cos * cx - sin * cy; + cy = sin * temp_2 + cos * cy; + this.vertex(x + cx, y + cy, color); + } + this.vertex(x, y, color); + this.vertex(x + cx, y + cy, color); + } + var temp = cx; + cx = radius; + cy = 0; + this.vertex(x + cx, y + cy, color); + }; + ShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Line, segments * 2 + 2); + if (color === null) + color = this.color; + var subdiv_step = 1 / segments; + var subdiv_step2 = subdiv_step * subdiv_step; + var subdiv_step3 = subdiv_step * subdiv_step * subdiv_step; + var pre1 = 3 * subdiv_step; + var pre2 = 3 * subdiv_step2; + var pre4 = 6 * subdiv_step2; + var pre5 = 6 * subdiv_step3; + var tmp1x = x1 - cx1 * 2 + cx2; + var tmp1y = y1 - cy1 * 2 + cy2; + var tmp2x = (cx1 - cx2) * 3 - x1 + x2; + var tmp2y = (cy1 - cy2) * 3 - y1 + y2; + var fx = x1; + var fy = y1; + var dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3; + var dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3; + var ddfx = tmp1x * pre4 + tmp2x * pre5; + var ddfy = tmp1y * pre4 + tmp2y * pre5; + var dddfx = tmp2x * pre5; + var dddfy = tmp2y * pre5; + while (segments-- > 0) { + this.vertex(fx, fy, color); + fx += dfx; + fy += dfy; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + this.vertex(fx, fy, color); + } + this.vertex(fx, fy, color); + this.vertex(x2, y2, color); + }; + ShapeRenderer.prototype.vertex = function (x, y, color) { + var idx = this.vertexIndex; + var vertices = this.mesh.getVertices(); + vertices[idx++] = x; + vertices[idx++] = y; + vertices[idx++] = color.r; + vertices[idx++] = color.g; + vertices[idx++] = color.b; + vertices[idx++] = color.a; + this.vertexIndex = idx; + }; + ShapeRenderer.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 = false; + }; + ShapeRenderer.prototype.flush = function () { + if (this.vertexIndex == 0) + return; + this.mesh.setVerticesLength(this.vertexIndex); + this.mesh.draw(this.shader, this.shapeType); + this.vertexIndex = 0; + }; + ShapeRenderer.prototype.check = function (shapeType, numVertices) { + if (!this.isDrawing) + throw new Error("ShapeRenderer.begin() has not been called"); + if (this.shapeType == shapeType) { + if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) + this.flush(); + else + return; + } + else { + this.flush(); + this.shapeType = shapeType; + } + }; + ShapeRenderer.prototype.dispose = function () { + this.mesh.dispose(); + }; + return ShapeRenderer; + }()); + webgl.ShapeRenderer = ShapeRenderer; + var ShapeType; + (function (ShapeType) { + ShapeType[ShapeType["Point"] = 0] = "Point"; + ShapeType[ShapeType["Line"] = 1] = "Line"; + ShapeType[ShapeType["Filled"] = 4] = "Filled"; + })(ShapeType = webgl.ShapeType || (webgl.ShapeType = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var SkeletonDebugRenderer = (function () { + function SkeletonDebugRenderer(context) { + this.boneLineColor = new spine.Color(1, 0, 0, 1); + this.boneOriginColor = new spine.Color(0, 1, 0, 1); + this.attachmentLineColor = new spine.Color(0, 0, 1, 0.5); + this.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5); + this.pathColor = new spine.Color().setFromString("FF7F00"); + this.clipColor = new spine.Color(0.8, 0, 0, 2); + this.aabbColor = new spine.Color(0, 1, 0, 0.5); + this.drawBones = true; + this.drawRegionAttachments = true; + this.drawBoundingBoxes = true; + this.drawMeshHull = true; + this.drawMeshTriangles = true; + this.drawPaths = true; + this.drawSkeletonXY = false; + this.drawClipping = true; + this.premultipliedAlpha = false; + this.scale = 1; + this.boneWidth = 2; + this.bounds = new spine.SkeletonBounds(); + this.temp = new Array(); + this.vertices = spine.Utils.newFloatArray(2 * 1024); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + } + SkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) { + if (ignoredBones === void 0) { ignoredBones = null; } + var skeletonX = skeleton.x; + var skeletonY = skeleton.y; + var gl = this.context.gl; + var srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA; + shapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA); + var bones = skeleton.bones; + if (this.drawBones) { + shapes.setColor(this.boneLineColor); + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) + continue; + if (bone.parent == null) + continue; + var x = skeletonX + bone.data.length * bone.a + bone.worldX; + var y = skeletonY + bone.data.length * bone.c + bone.worldY; + shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale); + } + if (this.drawSkeletonXY) + shapes.x(skeletonX, skeletonY, 4 * this.scale); + } + if (this.drawRegionAttachments) { + shapes.setColor(this.attachmentLineColor); + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + var regionAttachment = attachment; + var vertices = this.vertices; + regionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2); + shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]); + shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]); + shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]); + shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]); + } + } + } + if (this.drawMeshHull || this.drawMeshTriangles) { + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.MeshAttachment)) + continue; + var mesh = attachment; + var vertices = this.vertices; + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2); + var triangles = mesh.triangles; + var hullLength = mesh.hullLength; + if (this.drawMeshTriangles) { + shapes.setColor(this.triangleLineColor); + for (var ii = 0, nn = triangles.length; ii < nn; ii += 3) { + var v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2; + shapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]); + } + } + if (this.drawMeshHull && hullLength > 0) { + shapes.setColor(this.attachmentLineColor); + hullLength = (hullLength >> 1) * 2; + var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1]; + for (var ii = 0, nn = hullLength; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + shapes.line(x, y, lastX, lastY); + lastX = x; + lastY = y; + } + } + } + } + if (this.drawBoundingBoxes) { + var bounds = this.bounds; + bounds.update(skeleton, true); + shapes.setColor(this.aabbColor); + shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight()); + var polygons = bounds.polygons; + var boxes = bounds.boundingBoxes; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + shapes.setColor(boxes[i].color); + shapes.polygon(polygon, 0, polygon.length); + } + } + if (this.drawPaths) { + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + continue; + var path = attachment; + var nn = path.worldVerticesLength; + var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); + path.computeWorldVertices(slot, 0, nn, world, 0, 2); + var color = this.pathColor; + var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0; + if (path.closed) { + shapes.setColor(color); + var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1]; + x2 = world[nn - 4]; + y2 = world[nn - 3]; + shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); + shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); + shapes.line(x1, y1, cx1, cy1); + shapes.line(x2, y2, cx2, cy2); + } + nn -= 4; + for (var ii = 4; ii < nn; ii += 6) { + var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3]; + x2 = world[ii + 4]; + y2 = world[ii + 5]; + shapes.setColor(color); + shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); + shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); + shapes.line(x1, y1, cx1, cy1); + shapes.line(x2, y2, cx2, cy2); + x1 = x2; + y1 = y2; + } + } + } + if (this.drawBones) { + shapes.setColor(this.boneOriginColor); + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) + continue; + shapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8); + } + } + if (this.drawClipping) { + var slots = skeleton.slots; + shapes.setColor(this.clipColor); + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.ClippingAttachment)) + continue; + var clip = attachment; + var nn = clip.worldVerticesLength; + var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); + clip.computeWorldVertices(slot, 0, nn, world, 0, 2); + for (var i_16 = 0, n_2 = world.length; i_16 < n_2; i_16 += 2) { + var x = world[i_16]; + var y = world[i_16 + 1]; + var x2 = world[(i_16 + 2) % world.length]; + var y2 = world[(i_16 + 3) % world.length]; + shapes.line(x, y, x2, y2); + } + } + } + }; + SkeletonDebugRenderer.prototype.dispose = function () { + }; + SkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1); + SkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1); + return SkeletonDebugRenderer; + }()); + webgl.SkeletonDebugRenderer = SkeletonDebugRenderer; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Renderable = (function () { + function Renderable(vertices, numVertices, numFloats) { + this.vertices = vertices; + this.numVertices = numVertices; + this.numFloats = numFloats; + } + return Renderable; + }()); + ; + var SkeletonRenderer = (function () { + function SkeletonRenderer(context, twoColorTint) { + if (twoColorTint === void 0) { twoColorTint = true; } + this.premultipliedAlpha = false; + this.vertexEffect = null; + this.tempColor = new spine.Color(); + this.tempColor2 = new spine.Color(); + this.vertexSize = 2 + 2 + 4; + this.twoColorTint = false; + this.renderable = new Renderable(null, 0, 0); + this.clipper = new spine.SkeletonClipping(); + this.temp = new spine.Vector2(); + this.temp2 = new spine.Vector2(); + this.temp3 = new spine.Color(); + this.temp4 = new spine.Color(); + this.twoColorTint = twoColorTint; + if (twoColorTint) + this.vertexSize += 4; + this.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024); + } + SkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) { + if (slotRangeStart === void 0) { slotRangeStart = -1; } + if (slotRangeEnd === void 0) { slotRangeEnd = -1; } + var clipper = this.clipper; + var premultipliedAlpha = this.premultipliedAlpha; + var twoColorTint = this.twoColorTint; + var blendMode = null; + var tempPos = this.temp; + var tempUv = this.temp2; + var tempLight = this.temp3; + var tempDark = this.temp4; + var renderable = this.renderable; + var uvs = null; + var triangles = null; + var drawOrder = skeleton.drawOrder; + var attachmentColor = null; + var skeletonColor = skeleton.color; + var vertexSize = twoColorTint ? 12 : 8; + var inRange = false; + if (slotRangeStart == -1) + inRange = true; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var clippedVertexSize = clipper.isClipping() ? 2 : vertexSize; + var slot = drawOrder[i]; + if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) { + inRange = true; + } + if (!inRange) { + clipper.clipEndWithSlot(slot); + continue; + } + if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) { + inRange = false; + } + var attachment = slot.getAttachment(); + var texture = null; + if (attachment instanceof spine.RegionAttachment) { + var region = attachment; + renderable.vertices = this.vertices; + renderable.numVertices = 4; + renderable.numFloats = clippedVertexSize << 2; + region.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize); + triangles = SkeletonRenderer.QUAD_TRIANGLES; + uvs = region.uvs; + texture = region.region.renderObject.texture; + attachmentColor = region.color; + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + renderable.vertices = this.vertices; + renderable.numVertices = (mesh.worldVerticesLength >> 1); + renderable.numFloats = renderable.numVertices * clippedVertexSize; + if (renderable.numFloats > renderable.vertices.length) { + renderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats); + } + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize); + triangles = mesh.triangles; + texture = mesh.region.renderObject.texture; + uvs = mesh.uvs; + attachmentColor = mesh.color; + } + else if (attachment instanceof spine.ClippingAttachment) { + var clip = (attachment); + clipper.clipStart(slot, clip); + continue; + } + else { + clipper.clipEndWithSlot(slot); + continue; + } + if (texture != null) { + var slotColor = slot.color; + var finalColor = this.tempColor; + finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r; + finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g; + finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b; + finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a; + if (premultipliedAlpha) { + finalColor.r *= finalColor.a; + finalColor.g *= finalColor.a; + finalColor.b *= finalColor.a; + } + var darkColor = this.tempColor2; + if (slot.darkColor == null) + darkColor.set(0, 0, 0, 1.0); + else { + if (premultipliedAlpha) { + darkColor.r = slot.darkColor.r * finalColor.a; + darkColor.g = slot.darkColor.g * finalColor.a; + darkColor.b = slot.darkColor.b * finalColor.a; + } + else { + darkColor.setFromColor(slot.darkColor); + } + darkColor.a = premultipliedAlpha ? 1.0 : 0.0; + } + var slotBlendMode = slot.data.blendMode; + if (slotBlendMode != blendMode) { + blendMode = slotBlendMode; + batcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode)); + } + if (clipper.isClipping()) { + clipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint); + var clippedVertices = new Float32Array(clipper.clippedVertices); + var clippedTriangles = clipper.clippedTriangles; + if (this.vertexEffect != null) { + var vertexEffect = this.vertexEffect; + var verts = clippedVertices; + if (!twoColorTint) { + for (var v = 0, n_3 = clippedVertices.length; v < n_3; v += vertexSize) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); + tempUv.x = verts[v + 6]; + tempUv.y = verts[v + 7]; + tempDark.set(0, 0, 0, 0); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + } + } + else { + for (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); + tempUv.x = verts[v + 6]; + tempUv.y = verts[v + 7]; + tempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + verts[v + 8] = tempDark.r; + verts[v + 9] = tempDark.g; + verts[v + 10] = tempDark.b; + verts[v + 11] = tempDark.a; + } + } + } + batcher.draw(texture, clippedVertices, clippedTriangles); + } + else { + var verts = renderable.vertices; + if (this.vertexEffect != null) { + var vertexEffect = this.vertexEffect; + if (!twoColorTint) { + for (var v = 0, u = 0, n_5 = renderable.numFloats; v < n_5; v += vertexSize, u += 2) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempUv.x = uvs[u]; + tempUv.y = uvs[u + 1]; + tempLight.setFromColor(finalColor); + tempDark.set(0, 0, 0, 0); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + } + } + else { + for (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempUv.x = uvs[u]; + tempUv.y = uvs[u + 1]; + tempLight.setFromColor(finalColor); + tempDark.setFromColor(darkColor); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + verts[v + 8] = tempDark.r; + verts[v + 9] = tempDark.g; + verts[v + 10] = tempDark.b; + verts[v + 11] = tempDark.a; + } + } + } + else { + if (!twoColorTint) { + for (var v = 2, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) { + verts[v] = finalColor.r; + verts[v + 1] = finalColor.g; + verts[v + 2] = finalColor.b; + verts[v + 3] = finalColor.a; + verts[v + 4] = uvs[u]; + verts[v + 5] = uvs[u + 1]; + } + } + else { + for (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) { + verts[v] = finalColor.r; + verts[v + 1] = finalColor.g; + verts[v + 2] = finalColor.b; + verts[v + 3] = finalColor.a; + verts[v + 4] = uvs[u]; + verts[v + 5] = uvs[u + 1]; + verts[v + 6] = darkColor.r; + verts[v + 7] = darkColor.g; + verts[v + 8] = darkColor.b; + verts[v + 9] = darkColor.a; + } + } + } + var view = renderable.vertices.subarray(0, renderable.numFloats); + batcher.draw(texture, view, triangles); + } + } + clipper.clipEndWithSlot(slot); + } + clipper.clipEnd(); + }; + SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; + return SkeletonRenderer; + }()); + webgl.SkeletonRenderer = SkeletonRenderer; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Vector3 = (function () { + function Vector3(x, y, z) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (z === void 0) { z = 0; } + this.x = 0; + this.y = 0; + this.z = 0; + this.x = x; + this.y = y; + this.z = z; + } + Vector3.prototype.setFrom = function (v) { + this.x = v.x; + this.y = v.y; + this.z = v.z; + return this; + }; + Vector3.prototype.set = function (x, y, z) { + this.x = x; + this.y = y; + this.z = z; + return this; + }; + Vector3.prototype.add = function (v) { + this.x += v.x; + this.y += v.y; + this.z += v.z; + return this; + }; + Vector3.prototype.sub = function (v) { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + return this; + }; + Vector3.prototype.scale = function (s) { + this.x *= s; + this.y *= s; + this.z *= s; + return this; + }; + Vector3.prototype.normalize = function () { + var len = this.length(); + if (len == 0) + return this; + len = 1 / len; + this.x *= len; + this.y *= len; + this.z *= len; + return this; + }; + Vector3.prototype.cross = function (v) { + return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x); + }; + Vector3.prototype.multiply = function (matrix) { + var l_mat = matrix.values; + return this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]); + }; + Vector3.prototype.project = function (matrix) { + var l_mat = matrix.values; + var l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]); + return this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w); + }; + Vector3.prototype.dot = function (v) { + return this.x * v.x + this.y * v.y + this.z * v.z; + }; + Vector3.prototype.length = function () { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + }; + Vector3.prototype.distance = function (v) { + var a = v.x - this.x; + var b = v.y - this.y; + var c = v.z - this.z; + return Math.sqrt(a * a + b * b + c * c); + }; + return Vector3; + }()); + webgl.Vector3 = Vector3; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var ManagedWebGLRenderingContext = (function () { + function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) { + var _this = this; + if (contextConfig === void 0) { contextConfig = { alpha: "true" }; } + this.restorables = new Array(); + if (canvasOrContext instanceof HTMLCanvasElement) { + var canvas_1 = canvasOrContext; + this.gl = (canvas_1.getContext("webgl", contextConfig) || canvas_1.getContext("experimental-webgl", contextConfig)); + this.canvas = canvas_1; + canvas_1.addEventListener("webglcontextlost", function (e) { + var event = e; + if (e) { + e.preventDefault(); + } + }); + canvas_1.addEventListener("webglcontextrestored", function (e) { + for (var i = 0, n = _this.restorables.length; i < n; i++) { + _this.restorables[i].restore(); + } + }); + } + else { + this.gl = canvasOrContext; + this.canvas = this.gl.canvas; + } + } + ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) { + this.restorables.push(restorable); + }; + ManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) { + var index = this.restorables.indexOf(restorable); + if (index > -1) + this.restorables.splice(index, 1); + }; + return ManagedWebGLRenderingContext; + }()); + webgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext; + var WebGLBlendModeConverter = (function () { + function WebGLBlendModeConverter() { + } + WebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) { + switch (blendMode) { + case spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + case spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE; + case spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + default: throw new Error("Unknown blend mode: " + blendMode); + } + }; + WebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + switch (blendMode) { + case spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; + case spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; + case spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR; + case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE; + default: throw new Error("Unknown blend mode: " + blendMode); + } + }; + WebGLBlendModeConverter.ZERO = 0; + WebGLBlendModeConverter.ONE = 1; + WebGLBlendModeConverter.SRC_COLOR = 0x0300; + WebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301; + WebGLBlendModeConverter.SRC_ALPHA = 0x0302; + WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303; + WebGLBlendModeConverter.DST_ALPHA = 0x0304; + WebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305; + WebGLBlendModeConverter.DST_COLOR = 0x0306; + return WebGLBlendModeConverter; + }()); + webgl.WebGLBlendModeConverter = WebGLBlendModeConverter; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +//# sourceMappingURL=spine-both.js.map + +/*** EXPORTS FROM exports-loader ***/ +module.exports = spine; +}.call(window)); + +/***/ }) + +/******/ }); +//# sourceMappingURL=SpinePluginDebug.js.map \ No newline at end of file diff --git a/plugins/spine/dist/SpinePluginDebug.js.map b/plugins/spine/dist/SpinePluginDebug.js.map new file mode 100644 index 000000000..dc4d8e021 --- /dev/null +++ b/plugins/spine/dist/SpinePluginDebug.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///D:/wamp/www/phaser/node_modules/eventemitter3/index.js","webpack:///D:/wamp/www/phaser/src/data/DataManager.js","webpack:///D:/wamp/www/phaser/src/data/events/CHANGE_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/REMOVE_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/SET_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/index.js","webpack:///D:/wamp/www/phaser/src/gameobjects/BuildGameObject.js","webpack:///D:/wamp/www/phaser/src/gameobjects/GameObject.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ComputedSize.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Depth.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Flip.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ScrollFactor.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ToJSON.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Transform.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/TransformMatrix.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Visible.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/index.js","webpack:///D:/wamp/www/phaser/src/loader/File.js","webpack:///D:/wamp/www/phaser/src/loader/FileTypesManager.js","webpack:///D:/wamp/www/phaser/src/loader/GetURL.js","webpack:///D:/wamp/www/phaser/src/loader/MergeXHRSettings.js","webpack:///D:/wamp/www/phaser/src/loader/MultiFile.js","webpack:///D:/wamp/www/phaser/src/loader/XHRLoader.js","webpack:///D:/wamp/www/phaser/src/loader/XHRSettings.js","webpack:///D:/wamp/www/phaser/src/loader/const.js","webpack:///D:/wamp/www/phaser/src/loader/events/ADD_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_LOAD_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_PROGRESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/POST_PROCESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/PROGRESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/START_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/index.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/ImageFile.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/JSONFile.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/TextFile.js","webpack:///D:/wamp/www/phaser/src/math/Average.js","webpack:///D:/wamp/www/phaser/src/math/Bernstein.js","webpack:///D:/wamp/www/phaser/src/math/Between.js","webpack:///D:/wamp/www/phaser/src/math/CatmullRom.js","webpack:///D:/wamp/www/phaser/src/math/CeilTo.js","webpack:///D:/wamp/www/phaser/src/math/Clamp.js","webpack:///D:/wamp/www/phaser/src/math/DegToRad.js","webpack:///D:/wamp/www/phaser/src/math/Difference.js","webpack:///D:/wamp/www/phaser/src/math/Factorial.js","webpack:///D:/wamp/www/phaser/src/math/FloatBetween.js","webpack:///D:/wamp/www/phaser/src/math/FloorTo.js","webpack:///D:/wamp/www/phaser/src/math/FromPercent.js","webpack:///D:/wamp/www/phaser/src/math/GetSpeed.js","webpack:///D:/wamp/www/phaser/src/math/IsEven.js","webpack:///D:/wamp/www/phaser/src/math/IsEvenStrict.js","webpack:///D:/wamp/www/phaser/src/math/Linear.js","webpack:///D:/wamp/www/phaser/src/math/Matrix3.js","webpack:///D:/wamp/www/phaser/src/math/Matrix4.js","webpack:///D:/wamp/www/phaser/src/math/MaxAdd.js","webpack:///D:/wamp/www/phaser/src/math/MinSub.js","webpack:///D:/wamp/www/phaser/src/math/Percent.js","webpack:///D:/wamp/www/phaser/src/math/Quaternion.js","webpack:///D:/wamp/www/phaser/src/math/RadToDeg.js","webpack:///D:/wamp/www/phaser/src/math/RandomXY.js","webpack:///D:/wamp/www/phaser/src/math/RandomXYZ.js","webpack:///D:/wamp/www/phaser/src/math/RandomXYZW.js","webpack:///D:/wamp/www/phaser/src/math/Rotate.js","webpack:///D:/wamp/www/phaser/src/math/RotateAround.js","webpack:///D:/wamp/www/phaser/src/math/RotateAroundDistance.js","webpack:///D:/wamp/www/phaser/src/math/RotateVec3.js","webpack:///D:/wamp/www/phaser/src/math/RoundAwayFromZero.js","webpack:///D:/wamp/www/phaser/src/math/RoundTo.js","webpack:///D:/wamp/www/phaser/src/math/SinCosTableGenerator.js","webpack:///D:/wamp/www/phaser/src/math/SmoothStep.js","webpack:///D:/wamp/www/phaser/src/math/SmootherStep.js","webpack:///D:/wamp/www/phaser/src/math/ToXY.js","webpack:///D:/wamp/www/phaser/src/math/TransformXY.js","webpack:///D:/wamp/www/phaser/src/math/Vector2.js","webpack:///D:/wamp/www/phaser/src/math/Vector3.js","webpack:///D:/wamp/www/phaser/src/math/Vector4.js","webpack:///D:/wamp/www/phaser/src/math/Within.js","webpack:///D:/wamp/www/phaser/src/math/Wrap.js","webpack:///D:/wamp/www/phaser/src/math/angle/Between.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenPoints.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenPointsY.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenY.js","webpack:///D:/wamp/www/phaser/src/math/angle/CounterClockwise.js","webpack:///D:/wamp/www/phaser/src/math/angle/Normalize.js","webpack:///D:/wamp/www/phaser/src/math/angle/Reverse.js","webpack:///D:/wamp/www/phaser/src/math/angle/RotateTo.js","webpack:///D:/wamp/www/phaser/src/math/angle/ShortestBetween.js","webpack:///D:/wamp/www/phaser/src/math/angle/Wrap.js","webpack:///D:/wamp/www/phaser/src/math/angle/WrapDegrees.js","webpack:///D:/wamp/www/phaser/src/math/angle/index.js","webpack:///D:/wamp/www/phaser/src/math/const.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceBetween.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistancePower.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceSquared.js","webpack:///D:/wamp/www/phaser/src/math/distance/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/linear/Linear.js","webpack:///D:/wamp/www/phaser/src/math/easing/linear/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/stepped/Stepped.js","webpack:///D:/wamp/www/phaser/src/math/easing/stepped/index.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Ceil.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Equal.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Floor.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/GreaterThan.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/LessThan.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/index.js","webpack:///D:/wamp/www/phaser/src/math/index.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/BezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/CatmullRomInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/CubicBezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/LinearInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/QuadraticBezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/SmoothStepInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/SmootherStepInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/index.js","webpack:///D:/wamp/www/phaser/src/math/pow2/GetPowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/IsSizePowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/IsValuePowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/index.js","webpack:///D:/wamp/www/phaser/src/math/random-data-generator/RandomDataGenerator.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapCeil.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapFloor.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapTo.js","webpack:///D:/wamp/www/phaser/src/math/snap/index.js","webpack:///D:/wamp/www/phaser/src/plugins/BasePlugin.js","webpack:///D:/wamp/www/phaser/src/plugins/ScenePlugin.js","webpack:///D:/wamp/www/phaser/src/renderer/BlendModes.js","webpack:///D:/wamp/www/phaser/src/renderer/ScaleModes.js","webpack:///D:/wamp/www/phaser/src/scale/events/RESIZE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/BOOT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/CREATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/PAUSE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/POST_UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/PRE_UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/READY_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/RENDER_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/RESUME_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/SHUTDOWN_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/SLEEP_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/START_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_INIT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_OUT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_START_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/WAKE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/index.js","webpack:///D:/wamp/www/phaser/src/utils/Class.js","webpack:///D:/wamp/www/phaser/src/utils/NOOP.js","webpack:///D:/wamp/www/phaser/src/utils/object/Extend.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetAdvancedValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetFastValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/IsPlainObject.js","webpack:///./SpineFile.js","webpack:///./SpinePlugin.js","webpack:///./events/COMPLETE_EVENT.js","webpack:///./events/DISPOSE_EVENT.js","webpack:///./events/END_EVENT.js","webpack:///./events/EVENT_EVENT.js","webpack:///./events/INTERRUPTED_EVENT.js","webpack:///./events/START_EVENT.js","webpack:///./events/index.js","webpack:///./gameobject/SpineGameObject.js","webpack:///./gameobject/SpineGameObjectCanvasRenderer.js","webpack:///./gameobject/SpineGameObjectRender.js","webpack:///./gameobject/SpineGameObjectWebGLRenderer.js","webpack:///./runtimes/spine-both.js"],"names":[],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yDAAyD,OAAO;AAChE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yCAAyC,SAAS;AAClD;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA,eAAe,YAAY;AAC3B;;AAEA;AACA,2DAA2D;AAC3D,+DAA+D;AAC/D,mEAAmE;AACnE,uEAAuE;AACvE;AACA,0DAA0D,SAAS;AACnE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,2DAA2D,YAAY;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI,IAA6B;AACjC;AACA;;;;;;;;;;;;AC/UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,aAAa,mBAAO,CAAC,mDAAU;;AAE/B;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,KAAK;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2DAA2D;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa;;AAEb;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,EAAE;AACjB,eAAe,KAAK;AACpB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,QAAQ;AACvB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA,sCAAsC,kBAAkB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1nBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,qBAAqB,mBAAO,CAAC,kFAAyB;AACtD,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,cAAc,mBAAO,CAAC,oEAAkB;;AAExC;;;;;;;;;;;;ACjBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,mEAAwB;AACjD,uBAAuB,mBAAO,CAAC,uFAAkC;AACjE,iBAAiB,mBAAO,CAAC,mEAAwB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,8BAA8B;AACzC,WAAW,0CAA0C;AACrD;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,iBAAiB,WAAW,KAAK,SAAS;;AAE1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,kBAAkB,KAAK,gBAAgB;;AAExD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,iBAAiB,cAAc,KAAK,UAAU;;AAE9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9HA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,uBAAuB,mBAAO,CAAC,0EAAqB;AACpD,kBAAkB,mBAAO,CAAC,6DAAqB;AAC/C,mBAAmB,mBAAO,CAAC,mEAAe;AAC1C,aAAa,mBAAO,CAAC,0DAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2DAA2D;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,mCAAmC;AAClD,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wCAAwC;AACxD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,sCAAsC,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1nBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9IA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACtFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC7JA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpGA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA,YAAY,wCAAwC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,oDAAkB;AAC3C,sBAAsB,mBAAO,CAAC,iFAAmB;AACjD,gBAAgB,mBAAO,CAAC,8DAAuB;AAC/C,uBAAuB,mBAAO,CAAC,4EAA8B;;AAE7D;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,kCAAkC,oCAAoC;AACtE,mCAAmC,sCAAsC;;AAEzE;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;;AAE3E;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;AAC3E,yCAAyC,sCAAsC;;AAE/E;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC/gBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,iBAAiB,mBAAO,CAAC,oDAAkB;AAC3C,cAAc,mBAAO,CAAC,wDAAoB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;;AAEvC;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,+CAA+C;AAC9D;AACA,gBAAgB,+CAA+C;AAC/D;AACA;AACA;AACA,kCAAkC,UAAU,cAAc;;AAE1D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,mCAAmC,wBAAwB;;AAE3D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACj8BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AClFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA,kBAAkB,UAAU,mBAAO,CAAC,yEAAiB;;;;;;;;;;;;ACVrD;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,YAAY,mBAAO,CAAC,6CAAS;AAC7B,aAAa,mBAAO,CAAC,qDAAU;AAC/B,mBAAmB,mBAAO,CAAC,+EAA8B;AACzD,aAAa,mBAAO,CAAC,+CAAU;AAC/B,uBAAuB,mBAAO,CAAC,mEAAoB;AACnD,gBAAgB,mBAAO,CAAC,qDAAa;AACrC,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,+BAA+B;AAC1C;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA,4GAA4G;AAC5G;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,2DAA2D;;AAE3D;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kBAAkB;;AAEnD;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iEAAiE;AACjE;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACthBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AClCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,mEAAwB;AAC7C,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,sCAAsC;AACjD;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,mEAAmE;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC3LA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,mEAAoB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,sCAAsC;AACjD;AACA,YAAY,eAAe;AAC3B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC7DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,qCAAqC,mBAAmB;AACxD,8BAA8B,cAAc;AAC5C,6BAA6B,WAAW;AACxC,iCAAiC,eAAe;AAChD,gCAAgC,aAAa;;AAE7C;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACjJA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,2BAA2B;AACtC,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,uDAAuD;AACjJ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,oFAAoF,mDAAmD;AACvI;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA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;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uGAAuG;AAClH,WAAW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC3QA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,eAAe,mBAAO,CAAC,0EAA6B;AACpD,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,QAAQ;AACR,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC/NA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;ACxKA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,mDAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1kBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;;AAEA;;;;;;;;;;;;AC/6CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,4BAA4B,eAAe;;AAE3C;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,cAAc,mBAAO,CAAC,+CAAW;AACjC,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C;;AAE5C;;AAEA,gCAAgC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC7vBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,+BAA+B,YAAY;;AAE3C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC,2BAA2B;AAC3B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,qDAAiB;AACvC,cAAc,mBAAO,CAAC,qDAAiB;AACvC,iBAAiB,mBAAO,CAAC,2DAAoB;;AAE7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC7CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA,+BAA+B,YAAY;AAC3C,+BAA+B,YAAY;AAC3C,kCAAkC,eAAe;;AAEjD;;AAEA;AACA;;AAEA,mBAAmB,YAAY;AAC/B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,6BAA6B;AAC9E;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,oBAAoB;AAC/B;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,4BAA4B,qBAAqB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+CAA+C;AAC1D;AACA,YAAY,+CAA+C;AAC3D;AACA;AACA;AACA,+BAA+B,wBAAwB;;AAEvD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO;;AAEzC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,6BAA6B,YAAY;;AAEzC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;;;;;;;;;;;ACxnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;;;;;;;;;;;ACnyBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1hBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,2BAA2B;AACtC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA,2CAA2C,sCAAsC;AACjF;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,2BAA2B;AACtC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA,2CAA2C,gCAAgC;AAC3E;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,4CAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,yDAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,4CAAU;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,6BAA6B,aAAa;;AAE1C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;AC1CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,0CAAS;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,WAAW,mBAAO,CAAC,0CAAS;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,aAAa,mBAAO,CAAC,qDAAW;AAChC,mBAAmB,mBAAO,CAAC,iEAAiB;AAC5C,oBAAoB,mBAAO,CAAC,mEAAkB;AAC9C,cAAc,mBAAO,CAAC,uDAAY;AAClC,sBAAsB,mBAAO,CAAC,uEAAoB;AAClD,eAAe,mBAAO,CAAC,yDAAa;AACpC,aAAa,mBAAO,CAAC,qDAAW;AAChC,cAAc,mBAAO,CAAC,uDAAY;AAClC,qBAAqB,mBAAO,CAAC,qEAAmB;AAChD,UAAU,mBAAO,CAAC,+CAAQ;AAC1B,iBAAiB,mBAAO,CAAC,6DAAe;;AAExC;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACjEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,4BAA4B,SAAS;;AAErC;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,aAAa,mBAAO,CAAC,wEAAmB;AACxC,WAAW,mBAAO,CAAC,oEAAiB;AACpC,aAAa,mBAAO,CAAC,wEAAmB;;AAExC;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,iDAAM;AACtB,SAAS,mBAAO,CAAC,mDAAO;AACxB,WAAW,mBAAO,CAAC,uDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,mDAAM;AACtB,SAAS,mBAAO,CAAC,qDAAO;AACxB,WAAW,mBAAO,CAAC,yDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,qDAAM;AACtB,SAAS,mBAAO,CAAC,uDAAO;AACxB,WAAW,mBAAO,CAAC,2DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,kDAAM;AACtB,SAAS,mBAAO,CAAC,oDAAO;AACxB,WAAW,mBAAO,CAAC,wDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY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AAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,sDAAM;AACtB,SAAS,mBAAO,CAAC,wDAAO;AACxB,WAAW,mBAAO,CAAC,4DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,iDAAM;AACtB,SAAS,mBAAO,CAAC,mDAAO;AACxB,WAAW,mBAAO,CAAC,uDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,8DAAW;;;;;;;;;;;;ACVpC;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;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C,aAAa,mBAAO,CAAC,+CAAW;AAChC,gBAAgB,mBAAO,CAAC,qDAAc;AACtC,gBAAgB,mBAAO,CAAC,qDAAc;;AAEtC;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;ACjFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,oDAAc;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,QAAQ;AAC3B;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sDAAe;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AClDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC/DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,8CAAW;;AAEhC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sDAAe;;AAExC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,0DAAiB;;AAE5C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,YAAY,mBAAO,CAAC,qFAAuB;AAC3C,gBAAgB,mBAAO,CAAC,6FAA2B;AACnD,iBAAiB,mBAAO,CAAC,+FAA4B;AACrD,YAAY,mBAAO,CAAC,qFAAuB;AAC3C,qBAAqB,mBAAO,CAAC,uGAAgC;AAC7D,gBAAgB,mBAAO,CAAC,6FAA2B;AACnD,kBAAkB,mBAAO,CAAC,iGAA6B;;AAEvD;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,aAAa,mBAAO,CAAC,gEAAiB;AACtC,YAAY,mBAAO,CAAC,sEAAoB;AACxC,aAAa,mBAAO,CAAC,wEAAqB;;AAE1C;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B;AACA;;AAEA;;AAEA;AACA;AACA,kCAAkC,qDAAqD;;AAEvF;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,oEAAoE;;AAEpE;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;;AAEA;;AAEA,kDAAkD;AAClD,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,wCAAwC;AAC/D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA,wBAAwB,UAAU;AAClC;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;;AAEA,yBAAyB,OAAO;AAChC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC5eA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,UAAU,mBAAO,CAAC,sDAAY;AAC9B,WAAW,mBAAO,CAAC,wDAAa;AAChC,QAAQ,mBAAO,CAAC,kDAAU;;AAE1B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC9KA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,iBAAiB,mBAAO,CAAC,wDAAc;AACvC,YAAY,mBAAO,CAAC,mDAAgB;AACpC,kBAAkB,mBAAO,CAAC,2DAAiB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AClFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4EAA4E;AACvF;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,6CAA6C;AACpF;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,qDAAqD;AACpH;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA,4EAA4E,sDAAsD;AAClI;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OA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A;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvPA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,oBAAoB,mBAAO,CAAC,mEAAiB;;AAE7C,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,YAAY,OAAO;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5FA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,WAAW,mBAAO,CAAC,8CAAY;AAC/B,eAAe,mBAAO,CAAC,yDAAY;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,8CAA8C,aAAa,qBAAqB;AAChF;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE,oBAAoB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;;AAEA;;;;;;;;;;;;ACjDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,6DAA0B;AAC9C,mBAAmB,mBAAO,CAAC,yFAAwC;AACnE,gBAAgB,mBAAO,CAAC,8FAA4C;AACpE,oBAAoB,mBAAO,CAAC,2FAAyC;AACrE,eAAe,mBAAO,CAAC,4FAA2C;AAClE,gBAAgB,mBAAO,CAAC,0EAAkC;AAC1D,eAAe,mBAAO,CAAC,4FAA2C;;AAElE;AACA,aAAa,OAAO;AACpB;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,kBAAkB;AAChC,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,kBAAkB;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,iDAAiD;AAC5D,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,kBAAkB;AAC7B,WAAW,kBAAkB;AAC7B;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+BAA+B,oBAAoB;AACnD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B,qBAAqB;AACpD;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,2BAA2B,uBAAuB;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,sCAAsC,mEAAmE;;AAEzG;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACtPA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,sBAAsB,mBAAO,CAAC,6FAA0C;AACxE,YAAY,mBAAO,CAAC,6DAA0B;AAC9C,eAAe,mBAAO,CAAC,iFAAoC;AAC3D,kBAAkB,mBAAO,CAAC,yFAAwC;AAClE,kBAAkB,mBAAO,CAAC,6EAAkC;AAC5D,YAAY,mBAAO,CAAC,uCAAO;AAC3B,gBAAgB,mBAAO,CAAC,mCAAa;AACrC,sBAAsB,mBAAO,CAAC,qEAA8B;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qGAAqG;AACpH,eAAe,OAAO;AACtB,eAAe,gBAAgB;AAC/B,eAAe,QAAQ;AACvB,eAAe,sCAAsC;AACrD,eAAe,sCAAsC;AACrD;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,QAAQ;AACvB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA,mCAAmC,aAAa;;AAEhD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,eAAe;AAC9B,eAAe,WAAW;AAC1B;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACnmCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,cAAc,mBAAO,CAAC,oDAAkB;AACxC,aAAa,mBAAO,CAAC,kDAAiB;AACtC,SAAS,mBAAO,CAAC,0CAAa;AAC9B,WAAW,mBAAO,CAAC,8CAAe;AAClC,iBAAiB,mBAAO,CAAC,0DAAqB;AAC9C,WAAW,mBAAO,CAAC,8CAAe;;AAElC;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,8EAAoC;AAC/D,YAAY,mBAAO,CAAC,8DAA4B;AAChD,YAAY,mBAAO,CAAC,gEAA6B;AACjD,6BAA6B,mBAAO,CAAC,gHAAqD;AAC1F,sBAAsB,mBAAO,CAAC,kGAA8C;AAC5E,qBAAqB,mBAAO,CAAC,gGAA6C;AAC1E,6BAA6B,mBAAO,CAAC,gHAAqD;AAC1F,0BAA0B,mBAAO,CAAC,0GAAkD;AACpF,wBAAwB,mBAAO,CAAC,sGAAgD;AAChF,uBAAuB,mBAAO,CAAC,gGAA6C;AAC5E,eAAe,mBAAO,CAAC,oEAA+B;AACtD,iBAAiB,mBAAO,CAAC,sFAAwC;AACjE,eAAe,mBAAO,CAAC,oEAA+B;AACtD,kBAAkB,mBAAO,CAAC,qCAAY;AACtC,4BAA4B,mBAAO,CAAC,sEAAyB;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,kBAAkB;;AAEpD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,kCAAkC,6BAA6B;AAC/D,mCAAmC,+BAA+B;AAClE,oCAAoC,aAAa;AACjD,oCAAoC,aAAa;;AAEjD;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,oCAAoC,aAAa;AACjD,oCAAoC,aAAa;;AAEjD;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,2BAA2B;AAClD;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,oCAAoC;AAC/D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,uCAAuC,gBAAgB;;AAEvD;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,4CAA4C,yBAAyB;;AAErE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,YAAY;AAC/C,qCAAqC,cAAc;AACnD,qCAAqC,gBAAgB;;AAErD;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,8BAA8B;AAC9C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACnjDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,gGAA6C;AAC5E,eAAe,mBAAO,CAAC,oEAA+B;AACtD,WAAW,mBAAO,CAAC,4DAA2B;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5HA;AACA;AACA;AACA,kBAAkB;AAClB;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AAuD;AACpF;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA,kCAAkC,UAAU;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,WAAW;AACnE;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,mDAAmD;AACxD;AACA;AACA;AACA;AACA,KAAK,+DAA+D;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,+DAA+D;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,OAAO;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,OAAO;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,iBAAiB;AAC5D;AACA;AACA;AACA;AACA,2CAA2C,iBAAiB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,mBAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA,yCAAyC,mBAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,oBAAoB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,oBAAoB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6CAA6C;AAC/D;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,OAAO;AACxE;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,yBAAyB,EAAE;AACzF;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oBAAoB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oBAAoB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oBAAoB;AACnD;AACA;AACA;AACA;AACA;AACA,kCAAkC,oBAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,sDAAsD;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA,wCAAwC,iBAAiB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yGAAyG;AACzG;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qGAAqG;AACrG;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,2DAA2D,0BAA0B;AACrF;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,sDAAsD;AAC3D,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,kEAAkE;AACvE,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,eAAe;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,iBAAiB;AACpD;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gBAAgB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA,0DAA0D,iBAAiB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK,+DAA+D;AACpE;AACA;AACA;AACA;AACA;AACA,KAAK,4DAA4D;AACjE;AACA;AACA;AACA;AACA;AACA,KAAK,yDAAyD;AAC9D,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,wCAAwC,iBAAiB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,gCAAgC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;AACA,2BAA2B,sCAAsC;AACjE;AACA;AACA;AACA;AACA,2BAA2B,iCAAiC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD,gCAAgC,cAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,OAAO;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,SAAS;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,SAAS;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,sBAAsB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA,gCAAgC,0BAA0B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,OAAO;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oBAAoB;AACnD;AACA;AACA;AACA,mCAAmC,gCAAgC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2BAA2B;AAC1D;AACA;AACA;AACA,mCAAmC,gCAAgC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA,mCAAmC,gCAAgC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,OAAO;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wBAAwB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA,gDAAgD,QAAQ;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,0BAA0B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,0BAA0B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yFAAyF,OAAO;AAChG;AACA;AACA;AACA,uDAAuD,kBAAkB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,oBAAoB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,kEAAkE;AACvE;AACA;AACA;AACA;AACA;AACA,KAAK,4DAA4D;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E,kEAAkE;AAClE,qDAAqD;AACrD;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,gBAAgB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,oDAAoD,+BAA+B;AACnF;AACA;AACA;AACA;AACA,mCAAmC,WAAW;AAC9C;AACA;AACA;AACA;AACA;AACA,qCAAqC,UAAU;AAC/C;AACA;AACA;AACA;AACA;AACA,mCAAmC,WAAW;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,UAAU;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,wCAAwC,iBAAiB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wBAAwB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,WAAW;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,WAAW;AAC5E;AACA;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,qEAAqE;AAC1E,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,iBAAiB;AAC7D,2DAA2D,8CAA8C,EAAE;AAC3G;AACA;AACA,SAAS;AACT;AACA,KAAK,6CAA6C;AAClD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF;AAClF,wEAAwE;AACxE,2DAA2D;AAC3D;AACA,SAAS;AACT;AACA,KAAK,6CAA6C;AAClD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sBAAsB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,OAAO;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,6CAA6C;AAClD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,iBAAiB;AAC7D;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,oBAAoB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,UAAU;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,wBAAwB;AAChF,sDAAsD,sDAAsD;AAC5G,sDAAsD,qDAAqD;AAC3G;AACA;AACA;AACA;AACA,sDAAsD,sBAAsB;AAC5E,qDAAqD,4BAA4B;AACjF,qDAAqD,2BAA2B;AAChF;AACA;AACA;AACA;AACA,qDAAqD,qBAAqB;AAC1E;AACA;AACA;AACA,+BAA+B,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,sCAAsC,UAAU;AAChD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS,oFAAoF;AAC7F,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE,6CAA6C,qBAAqB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,oBAAoB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,uBAAuB;AACxF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4BAA4B;AAChF,gDAAgD,qBAAqB;AACrE,8CAA8C,mBAAmB;AACjE;AACA;AACA;AACA;AACA;AACA,oDAAoD,4BAA4B;AAChF,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,oDAAoD,4BAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,oDAAoD,4BAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,0CAA0C,cAAc;AACxD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yDAAyD;AAClE,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,qBAAqB;AAC5E,4DAA4D,0BAA0B;AACtF,8DAA8D,4BAA4B;AAC1F,kEAAkE,sBAAsB;AACxF,8DAA8D,sBAAsB;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,8CAA8C,kDAAkD,iDAAiD,+BAA+B,mCAAmC,0BAA0B,2CAA2C,mDAAmD,8EAA8E,WAAW;AAC/e,iHAAiH,2FAA2F,mCAAmC,sCAAsC,0BAA0B,uEAAuE,WAAW;AACjY;AACA;AACA;AACA,2EAA2E,8CAA8C,+CAA+C,kDAAkD,iDAAiD,+BAA+B,8BAA8B,mCAAmC,0BAA0B,2CAA2C,2CAA2C,mDAAmD,8EAA8E,WAAW;AACvmB,iHAAiH,2FAA2F,mCAAmC,mCAAmC,sCAAsC,0BAA0B,8DAA8D,oDAAoD,8HAA8H,WAAW;AAC7kB;AACA;AACA;AACA,2EAA2E,8CAA8C,iDAAiD,+BAA+B,0BAA0B,2CAA2C,8EAA8E,WAAW;AACvW,iHAAiH,2FAA2F,0BAA0B,mCAAmC,WAAW;AACpR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,qBAAqB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,0CAA0C,cAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sDAAsD;AAC/D,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,SAAS;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,YAAY;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,qBAAqB;AACrE,8CAA8C,mBAAmB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,SAAS;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,SAAS;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,OAAO;AAC1C,mCAAmC,OAAO;AAC1C,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,kBAAkB,iBAAiB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qEAAqE,OAAO;AAC5E;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4BAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;;AAEA;AACA;AACA,CAAC,e","file":"SpinePluginDebug.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./SpinePlugin.js\");\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar Events = require('./events');\r\n\r\n/**\r\n * @callback DataEachCallback\r\n *\r\n * @param {*} parent - The parent object of the DataManager.\r\n * @param {string} key - The key of the value.\r\n * @param {*} value - The value.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin.\r\n * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter,\r\n * or have a property called `events` that is an instance of it.\r\n *\r\n * @class DataManager\r\n * @memberof Phaser.Data\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {object} parent - The object that this DataManager belongs to.\r\n * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter.\r\n */\r\nvar DataManager = new Class({\r\n\r\n initialize:\r\n\r\n function DataManager (parent, eventEmitter)\r\n {\r\n /**\r\n * The object that this DataManager belongs to.\r\n *\r\n * @name Phaser.Data.DataManager#parent\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.parent = parent;\r\n\r\n /**\r\n * The DataManager's event emitter.\r\n *\r\n * @name Phaser.Data.DataManager#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events = eventEmitter;\r\n\r\n if (!eventEmitter)\r\n {\r\n this.events = (parent.events) ? parent.events : parent;\r\n }\r\n\r\n /**\r\n * The data list.\r\n *\r\n * @name Phaser.Data.DataManager#list\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.0.0\r\n */\r\n this.list = {};\r\n\r\n /**\r\n * The public values list. You can use this to access anything you have stored\r\n * in this Data Manager. For example, if you set a value called `gold` you can\r\n * access it via:\r\n *\r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also modify it directly:\r\n * \r\n * ```javascript\r\n * this.data.values.gold += 1000;\r\n * ```\r\n *\r\n * Doing so will emit a `setdata` event from the parent of this Data Manager.\r\n * \r\n * Do not modify this object directly. Adding properties directly to this object will not\r\n * emit any events. Always use `DataManager.set` to create new items the first time around.\r\n *\r\n * @name Phaser.Data.DataManager#values\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.10.0\r\n */\r\n this.values = {};\r\n\r\n /**\r\n * Whether setting data is frozen for this DataManager.\r\n *\r\n * @name Phaser.Data.DataManager#_frozen\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._frozen = false;\r\n\r\n if (!parent.hasOwnProperty('sys') && this.events)\r\n {\r\n this.events.once('destroy', this.destroy, this);\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves the value for the given key, or undefined if it doesn't exist.\r\n *\r\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\r\n * \r\n * ```javascript\r\n * this.data.get('gold');\r\n * ```\r\n *\r\n * Or access the value directly:\r\n * \r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also pass in an array of keys, in which case an array of values will be returned:\r\n * \r\n * ```javascript\r\n * this.data.get([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * This approach is useful for destructuring arrays in ES6.\r\n *\r\n * @method Phaser.Data.DataManager#get\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\r\n *\r\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\r\n */\r\n get: function (key)\r\n {\r\n var list = this.list;\r\n\r\n if (Array.isArray(key))\r\n {\r\n var output = [];\r\n\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n output.push(list[key[i]]);\r\n }\r\n\r\n return output;\r\n }\r\n else\r\n {\r\n return list[key];\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves all data values in a new object.\r\n *\r\n * @method Phaser.Data.DataManager#getAll\r\n * @since 3.0.0\r\n *\r\n * @return {Object.} All data values.\r\n */\r\n getAll: function ()\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Queries the DataManager for the values of keys matching the given regular expression.\r\n *\r\n * @method Phaser.Data.DataManager#query\r\n * @since 3.0.0\r\n *\r\n * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj).\r\n *\r\n * @return {Object.} The values of the keys matching the search string.\r\n */\r\n query: function (search)\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key) && key.match(search))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created.\r\n * \r\n * ```javascript\r\n * data.set('name', 'Red Gem Stone');\r\n * ```\r\n *\r\n * You can also pass in an object of key value pairs as the first argument:\r\n *\r\n * ```javascript\r\n * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\r\n * ```\r\n *\r\n * To get a value back again you can call `get`:\r\n * \r\n * ```javascript\r\n * data.get('gold');\r\n * ```\r\n * \r\n * Or you can access the value directly via the `values` property, where it works like any other variable:\r\n * \r\n * ```javascript\r\n * data.values.gold += 50;\r\n * ```\r\n *\r\n * When the value is first set, a `setdata` event is emitted.\r\n *\r\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\r\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\r\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\r\n *\r\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#set\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n set: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (typeof key === 'string')\r\n {\r\n return this.setValue(key, data);\r\n }\r\n else\r\n {\r\n for (var entry in key)\r\n {\r\n this.setValue(entry, key[entry]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value setter, called automatically by the `set` method.\r\n *\r\n * @method Phaser.Data.DataManager#setValue\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @private\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n * @param {*} data - The value to set.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n setValue: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (this.has(key))\r\n {\r\n // Hit the key getter, which will in turn emit the events.\r\n this.values[key] = data;\r\n }\r\n else\r\n {\r\n var _this = this;\r\n var list = this.list;\r\n var events = this.events;\r\n var parent = this.parent;\r\n\r\n Object.defineProperty(this.values, key, {\r\n\r\n enumerable: true,\r\n \r\n configurable: true,\r\n\r\n get: function ()\r\n {\r\n return list[key];\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (!_this._frozen)\r\n {\r\n var previousValue = list[key];\r\n list[key] = value;\r\n\r\n events.emit(Events.CHANGE_DATA, parent, key, value, previousValue);\r\n events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue);\r\n }\r\n }\r\n\r\n });\r\n\r\n list[key] = data;\r\n\r\n events.emit(Events.SET_DATA, parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes all data entries to the given callback.\r\n *\r\n * @method Phaser.Data.DataManager#each\r\n * @since 3.0.0\r\n *\r\n * @param {DataEachCallback} callback - The function to call.\r\n * @param {*} [context] - Value to use as `this` when executing callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n each: function (callback, context)\r\n {\r\n var args = [ this.parent, null, undefined ];\r\n\r\n for (var i = 1; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (var key in this.list)\r\n {\r\n args[1] = key;\r\n args[2] = this.list[key];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Merge the given object of key value pairs into this DataManager.\r\n *\r\n * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument)\r\n * will emit a `changedata` event.\r\n *\r\n * @method Phaser.Data.DataManager#merge\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @param {Object.} data - The data to merge.\r\n * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n merge: function (data, overwrite)\r\n {\r\n if (overwrite === undefined) { overwrite = true; }\r\n\r\n // Merge data from another component into this one\r\n for (var key in data)\r\n {\r\n if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key))))\r\n {\r\n this.setValue(key, data[key]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Remove the value for the given key.\r\n *\r\n * If the key is found in this Data Manager it is removed from the internal lists and a\r\n * `removedata` event is emitted.\r\n * \r\n * You can also pass in an array of keys, in which case all keys in the array will be removed:\r\n * \r\n * ```javascript\r\n * this.data.remove([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * @method Phaser.Data.DataManager#remove\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key to remove, or an array of keys to remove.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n remove: function (key)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n this.removeValue(key[i]);\r\n }\r\n }\r\n else\r\n {\r\n return this.removeValue(key);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value remover, called automatically by the `remove` method.\r\n *\r\n * @method Phaser.Data.DataManager#removeValue\r\n * @private\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n removeValue: function (key)\r\n {\r\n if (this.has(key))\r\n {\r\n var data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it.\r\n *\r\n * @method Phaser.Data.DataManager#pop\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the value to retrieve and delete.\r\n *\r\n * @return {*} The value of the given key.\r\n */\r\n pop: function (key)\r\n {\r\n var data = undefined;\r\n\r\n if (!this._frozen && this.has(key))\r\n {\r\n data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return data;\r\n },\r\n\r\n /**\r\n * Determines whether the given key is set in this Data Manager.\r\n * \r\n * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#has\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key to check.\r\n *\r\n * @return {boolean} Returns `true` if the key exists, otherwise `false`.\r\n */\r\n has: function (key)\r\n {\r\n return this.list.hasOwnProperty(key);\r\n },\r\n\r\n /**\r\n * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts\r\n * to create new values or update existing ones.\r\n *\r\n * @method Phaser.Data.DataManager#setFreeze\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - Whether to freeze or unfreeze the Data Manager.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n setFreeze: function (value)\r\n {\r\n this._frozen = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Delete all data in this Data Manager and unfreeze it.\r\n *\r\n * @method Phaser.Data.DataManager#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n reset: function ()\r\n {\r\n for (var key in this.list)\r\n {\r\n delete this.list[key];\r\n delete this.values[key];\r\n }\r\n\r\n this._frozen = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Destroy this data manager.\r\n *\r\n * @method Phaser.Data.DataManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.reset();\r\n\r\n this.events.off(Events.CHANGE_DATA);\r\n this.events.off(Events.SET_DATA);\r\n this.events.off(Events.REMOVE_DATA);\r\n\r\n this.parent = null;\r\n },\r\n\r\n /**\r\n * Gets or sets the frozen state of this Data Manager.\r\n * A frozen Data Manager will block all attempts to create new values or update existing ones.\r\n *\r\n * @name Phaser.Data.DataManager#freeze\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n freeze: {\r\n\r\n get: function ()\r\n {\r\n return this._frozen;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._frozen = (value) ? true : false;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Return the total number of entries in this Data Manager.\r\n *\r\n * @name Phaser.Data.DataManager#count\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n count: {\r\n\r\n get: function ()\r\n {\r\n var i = 0;\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list[key] !== undefined)\r\n {\r\n i++;\r\n }\r\n }\r\n\r\n return i;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = DataManager;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`.\r\n * \r\n * This event is dispatched for all items that change in the Data Manager.\r\n * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} value - The new value of the item in the Data Manager.\r\n * @param {any} previousValue - The previous value of the item in the Data Manager.\r\n */\r\nmodule.exports = 'changedata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Key Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`,\r\n * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold`\r\n * then you can listen for `sprite.data.on('changedata-gold')`.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.16.1\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'changedata-';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Remove Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item is removed from it.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'removedata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Set Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when a new item is added to the data store.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#SET_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'setdata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Data.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CHANGE_DATA: require('./CHANGE_DATA_EVENT'),\r\n CHANGE_DATA_KEY: require('./CHANGE_DATA_KEY_EVENT'),\r\n REMOVE_DATA: require('./REMOVE_DATA_EVENT'),\r\n SET_DATA: require('./SET_DATA_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlendModes = require('../renderer/BlendModes');\r\nvar GetAdvancedValue = require('../utils/object/GetAdvancedValue');\r\nvar ScaleModes = require('../renderer/ScaleModes');\r\n\r\n/**\r\n * Builds a Game Object using the provided configuration object.\r\n *\r\n * @function Phaser.GameObjects.BuildGameObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject.\r\n * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The built Game Object.\r\n */\r\nvar BuildGameObject = function (scene, gameObject, config)\r\n{\r\n // Position\r\n\r\n gameObject.x = GetAdvancedValue(config, 'x', 0);\r\n gameObject.y = GetAdvancedValue(config, 'y', 0);\r\n gameObject.depth = GetAdvancedValue(config, 'depth', 0);\r\n\r\n // Flip\r\n\r\n gameObject.flipX = GetAdvancedValue(config, 'flipX', false);\r\n gameObject.flipY = GetAdvancedValue(config, 'flipY', false);\r\n\r\n // Scale\r\n // Either: { scale: 2 } or { scale: { x: 2, y: 2 }}\r\n\r\n var scale = GetAdvancedValue(config, 'scale', null);\r\n\r\n if (typeof scale === 'number')\r\n {\r\n gameObject.setScale(scale);\r\n }\r\n else if (scale !== null)\r\n {\r\n gameObject.scaleX = GetAdvancedValue(scale, 'x', 1);\r\n gameObject.scaleY = GetAdvancedValue(scale, 'y', 1);\r\n }\r\n\r\n // ScrollFactor\r\n // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }}\r\n\r\n var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null);\r\n\r\n if (typeof scrollFactor === 'number')\r\n {\r\n gameObject.setScrollFactor(scrollFactor);\r\n }\r\n else if (scrollFactor !== null)\r\n {\r\n gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1);\r\n gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1);\r\n }\r\n\r\n // Rotation\r\n\r\n gameObject.rotation = GetAdvancedValue(config, 'rotation', 0);\r\n\r\n var angle = GetAdvancedValue(config, 'angle', null);\r\n\r\n if (angle !== null)\r\n {\r\n gameObject.angle = angle;\r\n }\r\n\r\n // Alpha\r\n\r\n gameObject.alpha = GetAdvancedValue(config, 'alpha', 1);\r\n\r\n // Origin\r\n // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }}\r\n\r\n var origin = GetAdvancedValue(config, 'origin', null);\r\n\r\n if (typeof origin === 'number')\r\n {\r\n gameObject.setOrigin(origin);\r\n }\r\n else if (origin !== null)\r\n {\r\n var ox = GetAdvancedValue(origin, 'x', 0.5);\r\n var oy = GetAdvancedValue(origin, 'y', 0.5);\r\n\r\n gameObject.setOrigin(ox, oy);\r\n }\r\n\r\n // ScaleMode\r\n\r\n gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT);\r\n\r\n // BlendMode\r\n\r\n gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL);\r\n\r\n // Visible\r\n\r\n gameObject.visible = GetAdvancedValue(config, 'visible', true);\r\n\r\n // Add to Scene\r\n\r\n var add = GetAdvancedValue(config, 'add', true);\r\n\r\n if (add)\r\n {\r\n scene.sys.displayList.add(gameObject);\r\n }\r\n\r\n if (gameObject.preUpdate)\r\n {\r\n scene.sys.updateList.add(gameObject);\r\n }\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = BuildGameObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar ComponentsToJSON = require('./components/ToJSON');\r\nvar DataManager = require('../data/DataManager');\r\nvar EventEmitter = require('eventemitter3');\r\nvar Events = require('./events');\r\n\r\n/**\r\n * @classdesc\r\n * The base class that all Game Objects extend.\r\n * You don't create GameObjects directly and they cannot be added to the display list.\r\n * Instead, use them as the base for your own custom classes.\r\n *\r\n * @class GameObject\r\n * @memberof Phaser.GameObjects\r\n * @extends Phaser.Events.EventEmitter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs.\r\n * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`.\r\n */\r\nvar GameObject = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function GameObject (scene, type)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The Scene to which this Game Object belongs.\r\n * Game Objects can only belong to one Scene.\r\n *\r\n * @name Phaser.GameObjects.GameObject#scene\r\n * @type {Phaser.Scene}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A textual representation of this Game Object, i.e. `sprite`.\r\n * Used internally by Phaser but is available for your own custom classes to populate.\r\n *\r\n * @name Phaser.GameObjects.GameObject#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * The current state of this Game Object.\r\n * \r\n * Phaser itself will never modify this value, although plugins may do so.\r\n * \r\n * Use this property to track the state of a Game Object during its lifetime. For example, it could move from\r\n * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant\r\n * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons.\r\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\r\n *\r\n * @name Phaser.GameObjects.GameObject#state\r\n * @type {(integer|string)}\r\n * @since 3.16.0\r\n */\r\n this.state = 0;\r\n\r\n /**\r\n * The parent Container of this Game Object, if it has one.\r\n *\r\n * @name Phaser.GameObjects.GameObject#parentContainer\r\n * @type {Phaser.GameObjects.Container}\r\n * @since 3.4.0\r\n */\r\n this.parentContainer = null;\r\n\r\n /**\r\n * The name of this Game Object.\r\n * Empty by default and never populated by Phaser, this is left for developers to use.\r\n *\r\n * @name Phaser.GameObjects.GameObject#name\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.name = '';\r\n\r\n /**\r\n * The active state of this Game Object.\r\n * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it.\r\n * An active object is one which is having its logic and internal systems updated.\r\n *\r\n * @name Phaser.GameObjects.GameObject#active\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.active = true;\r\n\r\n /**\r\n * The Tab Index of the Game Object.\r\n * Reserved for future use by plugins and the Input Manager.\r\n *\r\n * @name Phaser.GameObjects.GameObject#tabIndex\r\n * @type {integer}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.tabIndex = -1;\r\n\r\n /**\r\n * A Data Manager.\r\n * It allows you to store, query and get key/value paired information specific to this Game Object.\r\n * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`.\r\n *\r\n * @name Phaser.GameObjects.GameObject#data\r\n * @type {Phaser.Data.DataManager}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.data = null;\r\n\r\n /**\r\n * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not.\r\n * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively.\r\n * If those components are not used by your custom class then you can use this bitmask as you wish.\r\n *\r\n * @name Phaser.GameObjects.GameObject#renderFlags\r\n * @type {integer}\r\n * @default 15\r\n * @since 3.0.0\r\n */\r\n this.renderFlags = 15;\r\n\r\n /**\r\n * A bitmask that controls if this Game Object is drawn by a Camera or not.\r\n * Not usually set directly, instead call `Camera.ignore`, however you can\r\n * set this property directly using the Camera.id property:\r\n *\r\n * @example\r\n * this.cameraFilter |= camera.id\r\n *\r\n * @name Phaser.GameObjects.GameObject#cameraFilter\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.cameraFilter = 0;\r\n\r\n /**\r\n * If this Game Object is enabled for input then this property will contain an InteractiveObject instance.\r\n * Not usually set directly. Instead call `GameObject.setInteractive()`.\r\n *\r\n * @name Phaser.GameObjects.GameObject#input\r\n * @type {?Phaser.Types.Input.InteractiveObject}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.input = null;\r\n\r\n /**\r\n * If this Game Object is enabled for physics then this property will contain a reference to a Physics Body.\r\n *\r\n * @name Phaser.GameObjects.GameObject#body\r\n * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.body = null;\r\n\r\n /**\r\n * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`.\r\n * This includes calls that may come from a Group, Container or the Scene itself.\r\n * While it allows you to persist a Game Object across Scenes, please understand you are entirely\r\n * responsible for managing references to and from this Game Object.\r\n *\r\n * @name Phaser.GameObjects.GameObject#ignoreDestroy\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.5.0\r\n */\r\n this.ignoreDestroy = false;\r\n\r\n // Tell the Scene to re-sort the children\r\n scene.sys.queueDepthSort();\r\n },\r\n\r\n /**\r\n * Sets the `active` property of this Game Object and returns this Game Object for further chaining.\r\n * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setActive\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - True if this Game Object should be set as active, false if not.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setActive: function (value)\r\n {\r\n this.active = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the `name` property of this Game Object and returns this Game Object for further chaining.\r\n * The `name` property is not populated by Phaser and is presented for your own use.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setName\r\n * @since 3.0.0\r\n *\r\n * @param {string} value - The name to be given to this Game Object.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setName: function (value)\r\n {\r\n this.name = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current state of this Game Object.\r\n * \r\n * Phaser itself will never modify the State of a Game Object, although plugins may do so.\r\n * \r\n * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'.\r\n * The state value should typically be an integer (ideally mapped to a constant\r\n * in your game code), but could also be a string. It is recommended to keep it light and simple.\r\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setState\r\n * @since 3.16.0\r\n *\r\n * @param {(integer|string)} value - The state of the Game Object.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setState: function (value)\r\n {\r\n this.state = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds a Data Manager component to this Game Object.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setDataEnabled\r\n * @since 3.0.0\r\n * @see Phaser.Data.DataManager\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setDataEnabled: function ()\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Allows you to store a key value pair within this Game Objects Data Manager.\r\n *\r\n * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled\r\n * before setting the value.\r\n *\r\n * If the key doesn't already exist in the Data Manager then it is created.\r\n *\r\n * ```javascript\r\n * sprite.setData('name', 'Red Gem Stone');\r\n * ```\r\n *\r\n * You can also pass in an object of key value pairs as the first argument:\r\n *\r\n * ```javascript\r\n * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\r\n * ```\r\n *\r\n * To get a value back again you can call `getData`:\r\n *\r\n * ```javascript\r\n * sprite.getData('gold');\r\n * ```\r\n *\r\n * Or you can access the value directly via the `values` property, where it works like any other variable:\r\n *\r\n * ```javascript\r\n * sprite.data.values.gold += 50;\r\n * ```\r\n *\r\n * When the value is first set, a `setdata` event is emitted from this Game Object.\r\n *\r\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\r\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\r\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\r\n *\r\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setData\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setData: function (key, value)\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n this.data.set(key, value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist.\r\n *\r\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\r\n *\r\n * ```javascript\r\n * sprite.getData('gold');\r\n * ```\r\n *\r\n * Or access the value directly:\r\n *\r\n * ```javascript\r\n * sprite.data.values.gold;\r\n * ```\r\n *\r\n * You can also pass in an array of keys, in which case an array of values will be returned:\r\n *\r\n * ```javascript\r\n * sprite.getData([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * This approach is useful for destructuring arrays in ES6.\r\n *\r\n * @method Phaser.GameObjects.GameObject#getData\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\r\n *\r\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\r\n */\r\n getData: function (key)\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n return this.data.get(key);\r\n },\r\n\r\n /**\r\n * Pass this Game Object to the Input Manager to enable it for Input.\r\n *\r\n * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area\r\n * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced\r\n * input detection.\r\n *\r\n * 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\r\n * 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\r\n * shape for it to use.\r\n *\r\n * You can also provide an Input Configuration Object as the only argument to this method.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setInteractive\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback.\r\n * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target?\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setInteractive: function (shape, callback, dropZone)\r\n {\r\n this.scene.sys.input.enable(this, shape, callback, dropZone);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Game Object has previously been enabled for input, this will disable it.\r\n *\r\n * An object that is disabled for input stops processing or being considered for\r\n * input events, but can be turned back on again at any time by simply calling\r\n * `setInteractive()` with no arguments provided.\r\n *\r\n * If want to completely remove interaction from this Game Object then use `removeInteractive` instead.\r\n *\r\n * @method Phaser.GameObjects.GameObject#disableInteractive\r\n * @since 3.7.0\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n disableInteractive: function ()\r\n {\r\n if (this.input)\r\n {\r\n this.input.enabled = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Game Object has previously been enabled for input, this will queue it\r\n * for removal, causing it to no longer be interactive. The removal happens on\r\n * the next game step, it is not immediate.\r\n *\r\n * The Interactive Object that was assigned to this Game Object will be destroyed,\r\n * removed from the Input Manager and cleared from this Game Object.\r\n *\r\n * If you wish to re-enable this Game Object at a later date you will need to\r\n * re-create its InteractiveObject by calling `setInteractive` again.\r\n *\r\n * If you wish to only temporarily stop an object from receiving input then use\r\n * `disableInteractive` instead, as that toggles the interactive state, where-as\r\n * this erases it completely.\r\n * \r\n * If you wish to resize a hit area, don't remove and then set it as being\r\n * interactive. Instead, access the hitarea object directly and resize the shape\r\n * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the\r\n * shape is a Rectangle, which it is by default.)\r\n *\r\n * @method Phaser.GameObjects.GameObject#removeInteractive\r\n * @since 3.7.0\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n removeInteractive: function ()\r\n {\r\n this.scene.sys.input.clear(this);\r\n\r\n this.input = undefined;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * To be overridden by custom GameObjects. Allows base objects to be used in a Pool.\r\n *\r\n * @method Phaser.GameObjects.GameObject#update\r\n * @since 3.0.0\r\n *\r\n * @param {...*} [args] - args\r\n */\r\n update: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Returns a JSON representation of the Game Object.\r\n *\r\n * @method Phaser.GameObjects.GameObject#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\n toJSON: function ()\r\n {\r\n return ComponentsToJSON(this);\r\n },\r\n\r\n /**\r\n * Compares the renderMask with the renderFlags to see if this Game Object will render or not.\r\n * Also checks the Game Object against the given Cameras exclusion list.\r\n *\r\n * @method Phaser.GameObjects.GameObject#willRender\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object.\r\n *\r\n * @return {boolean} True if the Game Object should be rendered, otherwise false.\r\n */\r\n willRender: function (camera)\r\n {\r\n return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)));\r\n },\r\n\r\n /**\r\n * Returns an array containing the display list index of either this Game Object, or if it has one,\r\n * its parent Container. It then iterates up through all of the parent containers until it hits the\r\n * root of the display list (which is index 0 in the returned array).\r\n *\r\n * Used internally by the InputPlugin but also useful if you wish to find out the display depth of\r\n * this Game Object and all of its ancestors.\r\n *\r\n * @method Phaser.GameObjects.GameObject#getIndexList\r\n * @since 3.4.0\r\n *\r\n * @return {integer[]} An array of display list position indexes.\r\n */\r\n getIndexList: function ()\r\n {\r\n // eslint-disable-next-line consistent-this\r\n var child = this;\r\n var parent = this.parentContainer;\r\n\r\n var indexes = [];\r\n\r\n while (parent)\r\n {\r\n // indexes.unshift([parent.getIndex(child), parent.name]);\r\n indexes.unshift(parent.getIndex(child));\r\n\r\n child = parent;\r\n\r\n if (!parent.parentContainer)\r\n {\r\n break;\r\n }\r\n else\r\n {\r\n parent = parent.parentContainer;\r\n }\r\n }\r\n\r\n // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']);\r\n indexes.unshift(this.scene.sys.displayList.getIndex(child));\r\n\r\n return indexes;\r\n },\r\n\r\n /**\r\n * Destroys this Game Object removing it from the Display List and Update List and\r\n * severing all ties to parent resources.\r\n *\r\n * Also removes itself from the Input Manager and Physics Manager if previously enabled.\r\n *\r\n * Use this to remove a Game Object from your game if you don't ever plan to use it again.\r\n * As long as no reference to it exists within your own code it should become free for\r\n * garbage collection by the browser.\r\n *\r\n * If you just want to temporarily disable an object then look at using the\r\n * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected.\r\n *\r\n * @method Phaser.GameObjects.GameObject#destroy\r\n * @fires Phaser.GameObjects.Events#DESTROY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [fromScene=false] - Is this Game Object being destroyed as the result of a Scene shutdown?\r\n */\r\n destroy: function (fromScene)\r\n {\r\n if (fromScene === undefined) { fromScene = false; }\r\n\r\n // This Game Object has already been destroyed\r\n if (!this.scene || this.ignoreDestroy)\r\n {\r\n return;\r\n }\r\n\r\n if (this.preDestroy)\r\n {\r\n this.preDestroy.call(this);\r\n }\r\n\r\n this.emit(Events.DESTROY, this);\r\n\r\n var sys = this.scene.sys;\r\n\r\n if (!fromScene)\r\n {\r\n sys.displayList.remove(this);\r\n sys.updateList.remove(this);\r\n }\r\n\r\n if (this.input)\r\n {\r\n sys.input.clear(this);\r\n this.input = undefined;\r\n }\r\n\r\n if (this.data)\r\n {\r\n this.data.destroy();\r\n\r\n this.data = undefined;\r\n }\r\n\r\n if (this.body)\r\n {\r\n this.body.destroy();\r\n this.body = undefined;\r\n }\r\n\r\n // Tell the Scene to re-sort the children\r\n if (!fromScene)\r\n {\r\n sys.queueDepthSort();\r\n }\r\n\r\n this.active = false;\r\n this.visible = false;\r\n\r\n this.scene = undefined;\r\n\r\n this.parentContainer = undefined;\r\n\r\n this.removeAllListeners();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not.\r\n *\r\n * @constant {integer} RENDER_MASK\r\n * @memberof Phaser.GameObjects.GameObject\r\n * @default\r\n */\r\nGameObject.RENDER_MASK = 15;\r\n\r\nmodule.exports = GameObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for calculating and setting the size of a non-Frame based Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.ComputedSize\r\n * @since 3.0.0\r\n */\r\n\r\nvar ComputedSize = {\r\n\r\n /**\r\n * The native (un-scaled) width of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayWidth` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n width: 0,\r\n\r\n /**\r\n * The native (un-scaled) height of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayHeight` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n height: 0,\r\n\r\n /**\r\n * The displayed width of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayWidth: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleX * this.width;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleX = value / this.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The displayed height of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayHeight: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleY * this.height;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleY = value / this.height;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the internal size of this Game Object, as used for frame or physics body creation.\r\n * \r\n * This will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\r\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\r\n * to do so by giving pixel values.\r\n * \r\n * If you have enabled this Game Object for input, changing the size will _not_ change the\r\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setSize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the display size of this Game Object.\r\n * \r\n * Calling this will adjust the scale.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDisplaySize: function (width, height)\r\n {\r\n this.displayWidth = width;\r\n this.displayHeight = height;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ComputedSize;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the depth of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Depth\r\n * @since 3.0.0\r\n */\r\n\r\nvar Depth = {\r\n\r\n /**\r\n * Private internal value. Holds the depth of the Game Object.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#_depth\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _depth: 0,\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#depth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n depth: {\r\n\r\n get: function ()\r\n {\r\n return this._depth;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scene.sys.queueDepthSort();\r\n this._depth = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @method Phaser.GameObjects.Components.Depth#setDepth\r\n * @since 3.0.0\r\n *\r\n * @param {integer} value - The depth of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDepth: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.depth = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Depth;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for visually flipping a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Flip\r\n * @since 3.0.0\r\n */\r\n\r\nvar Flip = {\r\n\r\n /**\r\n * The horizontally flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipX\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipX: false,\r\n\r\n /**\r\n * The vertically flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down)\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipY\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipY: false,\r\n\r\n /**\r\n * Toggles the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipX\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipX: function ()\r\n {\r\n this.flipX = !this.flipX;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Toggles the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipY\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipY: function ()\r\n {\r\n this.flipY = !this.flipY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipX\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipX: function (value)\r\n {\r\n this.flipX = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipY: function (value)\r\n {\r\n this.flipY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal and vertical flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped will render inversed on the flipped axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlip\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlip: function (x, y)\r\n {\r\n this.flipX = x;\r\n this.flipY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#resetFlip\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n resetFlip: function ()\r\n {\r\n this.flipX = false;\r\n this.flipY = false;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Flip;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the Scroll Factor of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.ScrollFactor\r\n * @since 3.0.0\r\n */\r\n\r\nvar ScrollFactor = {\r\n\r\n /**\r\n * The horizontal scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorX: 1,\r\n\r\n /**\r\n * The vertical scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorY: 1,\r\n\r\n /**\r\n * Sets the scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scroll factor of this Game Object.\r\n * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScrollFactor: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.scrollFactorX = x;\r\n this.scrollFactorY = y;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ScrollFactor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Build a JSON representation of the given Game Object.\r\n *\r\n * This is typically extended further by Game Object specific implementations.\r\n *\r\n * @method Phaser.GameObjects.Components.ToJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON.\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\nvar ToJSON = function (gameObject)\r\n{\r\n var out = {\r\n name: gameObject.name,\r\n type: gameObject.type,\r\n x: gameObject.x,\r\n y: gameObject.y,\r\n depth: gameObject.depth,\r\n scale: {\r\n x: gameObject.scaleX,\r\n y: gameObject.scaleY\r\n },\r\n origin: {\r\n x: gameObject.originX,\r\n y: gameObject.originY\r\n },\r\n flipX: gameObject.flipX,\r\n flipY: gameObject.flipY,\r\n rotation: gameObject.rotation,\r\n alpha: gameObject.alpha,\r\n visible: gameObject.visible,\r\n scaleMode: gameObject.scaleMode,\r\n blendMode: gameObject.blendMode,\r\n textureKey: '',\r\n frameKey: '',\r\n data: {}\r\n };\r\n\r\n if (gameObject.texture)\r\n {\r\n out.textureKey = gameObject.texture.key;\r\n out.frameKey = gameObject.frame.name;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ToJSON;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = require('../../math/const');\r\nvar TransformMatrix = require('./TransformMatrix');\r\nvar WrapAngle = require('../../math/angle/Wrap');\r\nvar WrapAngleDegrees = require('../../math/angle/WrapDegrees');\r\n\r\n// global bitmask flag for GameObject.renderMask (used by Scale)\r\nvar _FLAG = 4; // 0100\r\n\r\n/**\r\n * Provides methods used for getting and setting the position, scale and rotation of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Transform\r\n * @since 3.0.0\r\n */\r\n\r\nvar Transform = {\r\n\r\n /**\r\n * Private internal value. Holds the horizontal scale value.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_scaleX\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _scaleX: 1,\r\n\r\n /**\r\n * Private internal value. Holds the vertical scale value.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_scaleY\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _scaleY: 1,\r\n\r\n /**\r\n * Private internal value. Holds the rotation value in radians.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_rotation\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _rotation: 0,\r\n\r\n /**\r\n * The x position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n x: 0,\r\n\r\n /**\r\n * The y position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n y: 0,\r\n\r\n /**\r\n * The z position of this Game Object.\r\n * Note: Do not use this value to set the z-index, instead see the `depth` property.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n z: 0,\r\n\r\n /**\r\n * The w position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n w: 0,\r\n\r\n /**\r\n * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object\r\n * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`.\r\n * \r\n * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this\r\n * isn't the case, use the `scaleX` or `scaleY` properties instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.18.0\r\n */\r\n scale: {\r\n\r\n get: function ()\r\n {\r\n return (this._scaleX + this._scaleY) / 2;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n this._scaleY = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The horizontal scale of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scaleX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scaleY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleY = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The angle of this Game Object as expressed in degrees.\r\n * \r\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left\r\n * and -90 is up.\r\n *\r\n * If you prefer to work in radians, see the `rotation` property instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#angle\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n angle: {\r\n\r\n get: function ()\r\n {\r\n return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG);\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in degrees\r\n this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD;\r\n }\r\n },\r\n\r\n /**\r\n * The angle of this Game Object in radians.\r\n * \r\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left\r\n * and -90 is up.\r\n *\r\n * If you prefer to work in degrees, see the `angle` property instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#rotation\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return this._rotation;\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in radians\r\n this._rotation = WrapAngle(value);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x position of this Game Object.\r\n * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value.\r\n * @param {number} [z=0] - The z position of this Game Object.\r\n * @param {number} [w=0] - The w position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setPosition: function (x, y, z, w)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n if (z === undefined) { z = 0; }\r\n if (w === undefined) { w = 0; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n this.w = w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the position of this Game Object to be a random position within the confines of\r\n * the given area.\r\n * \r\n * If no area is specified a random position between 0 x 0 and the game width x height is used instead.\r\n *\r\n * The position does not factor in the size of this Game Object, meaning that only the origin is\r\n * guaranteed to be within the area.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setRandomPosition\r\n * @since 3.8.0\r\n *\r\n * @param {number} [x=0] - The x position of the top-left of the random area.\r\n * @param {number} [y=0] - The y position of the top-left of the random area.\r\n * @param {number} [width] - The width of the random area.\r\n * @param {number} [height] - The height of the random area.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setRandomPosition: function (x, y, width, height)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.scene.sys.scale.width; }\r\n if (height === undefined) { height = this.scene.sys.scale.height; }\r\n\r\n this.x = x + (Math.random() * width);\r\n this.y = y + (Math.random() * height);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the rotation of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setRotation\r\n * @since 3.0.0\r\n *\r\n * @param {number} [radians=0] - The rotation of this Game Object, in radians.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setRotation: function (radians)\r\n {\r\n if (radians === undefined) { radians = 0; }\r\n\r\n this.rotation = radians;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the angle of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setAngle\r\n * @since 3.0.0\r\n *\r\n * @param {number} [degrees=0] - The rotation of this Game Object, in degrees.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAngle: function (degrees)\r\n {\r\n if (degrees === undefined) { degrees = 0; }\r\n\r\n this.angle = degrees;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scale of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale of this Game Object.\r\n * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScale: function (x, y)\r\n {\r\n if (x === undefined) { x = 1; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.scaleX = x;\r\n this.scaleY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the x position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setX\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The x position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setX: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the y position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setY\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The y position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setY: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the z position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The z position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setZ: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.z = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the w position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setW\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The w position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setW: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.w = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the local transform matrix for this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\r\n */\r\n getLocalTransformMatrix: function (tempMatrix)\r\n {\r\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\r\n\r\n return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\r\n },\r\n\r\n /**\r\n * Gets the world transform matrix for this Game Object, factoring in any parent Containers.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\r\n */\r\n getWorldTransformMatrix: function (tempMatrix, parentMatrix)\r\n {\r\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\r\n if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); }\r\n\r\n var parent = this.parentContainer;\r\n\r\n if (!parent)\r\n {\r\n return this.getLocalTransformMatrix(tempMatrix);\r\n }\r\n\r\n tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\r\n\r\n while (parent)\r\n {\r\n parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY);\r\n\r\n parentMatrix.multiply(tempMatrix, tempMatrix);\r\n\r\n parent = parent.parentContainer;\r\n }\r\n\r\n return tempMatrix;\r\n },\r\n\r\n /**\r\n * Gets the sum total rotation of all of this Game Objects parent Containers.\r\n * \r\n * The returned value is in radians and will be zero if this Game Object has no parent container.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getParentRotation\r\n * @since 3.18.0\r\n *\r\n * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object.\r\n */\r\n getParentRotation: function ()\r\n {\r\n var rotation = 0;\r\n\r\n var parent = this.parentContainer;\r\n\r\n while (parent)\r\n {\r\n rotation += parent.rotation;\r\n\r\n parent = parent.parentContainer;\r\n }\r\n\r\n return rotation;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Transform;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar MATH_CONST = require('../../math/const');\r\nvar Vector2 = require('../../math/Vector2');\r\n\r\n/**\r\n * @classdesc\r\n * A Matrix used for display transformations for rendering.\r\n *\r\n * It is represented like so:\r\n *\r\n * ```\r\n * | a | c | tx |\r\n * | b | d | ty |\r\n * | 0 | 0 | 1 |\r\n * ```\r\n *\r\n * @class TransformMatrix\r\n * @memberof Phaser.GameObjects.Components\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [a=1] - The Scale X value.\r\n * @param {number} [b=0] - The Skew Y value.\r\n * @param {number} [c=0] - The Skew X value.\r\n * @param {number} [d=1] - The Scale Y value.\r\n * @param {number} [tx=0] - The Translate X value.\r\n * @param {number} [ty=0] - The Translate Y value.\r\n */\r\nvar TransformMatrix = new Class({\r\n\r\n initialize:\r\n\r\n function TransformMatrix (a, b, c, d, tx, ty)\r\n {\r\n if (a === undefined) { a = 1; }\r\n if (b === undefined) { b = 0; }\r\n if (c === undefined) { c = 0; }\r\n if (d === undefined) { d = 1; }\r\n if (tx === undefined) { tx = 0; }\r\n if (ty === undefined) { ty = 0; }\r\n\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#matrix\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]);\r\n\r\n /**\r\n * The decomposed matrix.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.decomposedMatrix = {\r\n translateX: 0,\r\n translateY: 0,\r\n scaleX: 1,\r\n scaleY: 1,\r\n rotation: 0\r\n };\r\n },\r\n\r\n /**\r\n * The Scale X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#a\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n a: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[0];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[0] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Skew Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#b\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n b: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[1];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[1] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Skew X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#c\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n c: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[2];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[2] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Scale Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#d\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n d: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[3];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[3] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#e\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n e: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#f\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n f: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#tx\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n tx: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#ty\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n ty: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Matrix. Value is in radians.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#rotation\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Matrix, normalized to be within the Phaser right-handed\r\n * clockwise rotation space. Value is in radians.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized\r\n * @type {number}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n rotationNormalized: {\r\n\r\n get: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n if (a || b)\r\n {\r\n // var r = Math.sqrt(a * a + b * b);\r\n \r\n return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX);\r\n }\r\n else if (c || d)\r\n {\r\n // var s = Math.sqrt(c * c + d * d);\r\n \r\n return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY));\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The decomposed horizontal scale of the Matrix. This value is always positive.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleX\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.a * this.a) + (this.b * this.b));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The decomposed vertical scale of the Matrix. This value is always positive.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleY\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.c * this.c) + (this.d * this.d));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Reset the Matrix to an identity matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n loadIdentity: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = 1;\r\n matrix[1] = 0;\r\n matrix[2] = 0;\r\n matrix[3] = 1;\r\n matrix[4] = 0;\r\n matrix[5] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#translate\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation value.\r\n * @param {number} y - The vertical translation value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n translate: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4];\r\n matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale value.\r\n * @param {number} y - The vertical scale value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n scale: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] *= x;\r\n matrix[1] *= x;\r\n matrix[2] *= y;\r\n matrix[3] *= y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n rotate: function (angle)\r\n {\r\n var sin = Math.sin(angle);\r\n var cos = Math.cos(angle);\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n matrix[0] = a * cos + c * sin;\r\n matrix[1] = b * cos + d * sin;\r\n matrix[2] = a * -sin + c * cos;\r\n matrix[3] = b * -sin + d * cos;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n * \r\n * If an `out` Matrix is given then the results will be stored in it.\r\n * If it is not given, this matrix will be updated in place instead.\r\n * Use an `out` Matrix if you do not wish to mutate this matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} Either this TransformMatrix, or the `out` Matrix, if given in the arguments.\r\n */\r\n multiply: function (rhs, out)\r\n {\r\n var matrix = this.matrix;\r\n var source = rhs.matrix;\r\n\r\n var localA = matrix[0];\r\n var localB = matrix[1];\r\n var localC = matrix[2];\r\n var localD = matrix[3];\r\n var localE = matrix[4];\r\n var localF = matrix[5];\r\n\r\n var sourceA = source[0];\r\n var sourceB = source[1];\r\n var sourceC = source[2];\r\n var sourceD = source[3];\r\n var sourceE = source[4];\r\n var sourceF = source[5];\r\n\r\n var destinationMatrix = (out === undefined) ? this : out;\r\n\r\n destinationMatrix.a = (sourceA * localA) + (sourceB * localC);\r\n destinationMatrix.b = (sourceA * localB) + (sourceB * localD);\r\n destinationMatrix.c = (sourceC * localA) + (sourceD * localC);\r\n destinationMatrix.d = (sourceC * localB) + (sourceD * localD);\r\n destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE;\r\n destinationMatrix.f = (sourceE * localB) + (sourceF * localD) + localF;\r\n\r\n return destinationMatrix;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the matrix given, including the offset.\r\n * \r\n * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`.\r\n * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n * @param {number} offsetX - Horizontal offset to factor in to the multiplication.\r\n * @param {number} offsetY - Vertical offset to factor in to the multiplication.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n multiplyWithOffset: function (src, offsetX, offsetY)\r\n {\r\n var matrix = this.matrix;\r\n var otherMatrix = src.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n var pse = offsetX * a0 + offsetY * c0 + tx0;\r\n var psf = offsetX * b0 + offsetY * d0 + ty0;\r\n\r\n var a1 = otherMatrix[0];\r\n var b1 = otherMatrix[1];\r\n var c1 = otherMatrix[2];\r\n var d1 = otherMatrix[3];\r\n var tx1 = otherMatrix[4];\r\n var ty1 = otherMatrix[5];\r\n\r\n matrix[0] = a1 * a0 + b1 * c0;\r\n matrix[1] = a1 * b0 + b1 * d0;\r\n matrix[2] = c1 * a0 + d1 * c0;\r\n matrix[3] = c1 * b0 + d1 * d0;\r\n matrix[4] = tx1 * a0 + ty1 * c0 + pse;\r\n matrix[5] = tx1 * b0 + ty1 * d0 + psf;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n transform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n matrix[0] = a * a0 + b * c0;\r\n matrix[1] = a * b0 + b * d0;\r\n matrix[2] = c * a0 + d * c0;\r\n matrix[3] = c * b0 + d * d0;\r\n matrix[4] = tx * a0 + ty * c0 + tx0;\r\n matrix[5] = tx * b0 + ty * d0 + ty0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform a point using this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the point to transform.\r\n * @param {number} y - The y coordinate of the point to transform.\r\n * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates.\r\n *\r\n * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates.\r\n */\r\n transformPoint: function (x, y, point)\r\n {\r\n if (point === undefined) { point = { x: 0, y: 0 }; }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n point.x = x * a + y * c + tx;\r\n point.y = x * b + y * d + ty;\r\n\r\n return point;\r\n },\r\n\r\n /**\r\n * Invert the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#invert\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n invert: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var n = a * d - b * c;\r\n\r\n matrix[0] = d / n;\r\n matrix[1] = -b / n;\r\n matrix[2] = -c / n;\r\n matrix[3] = a / n;\r\n matrix[4] = (c * ty - d * tx) / n;\r\n matrix[5] = -(a * ty - b * tx) / n;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the matrix given.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFrom: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src.a;\r\n matrix[1] = src.b;\r\n matrix[2] = src.c;\r\n matrix[3] = src.d;\r\n matrix[4] = src.e;\r\n matrix[5] = src.f;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the array given.\r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray\r\n * @since 3.11.0\r\n *\r\n * @param {array} src - The array of values to set into this matrix.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFromArray: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src[0];\r\n matrix[1] = src[1];\r\n matrix[2] = src[2];\r\n matrix[3] = src[3];\r\n matrix[4] = src[4];\r\n matrix[5] = src[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.transform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n copyToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.setTransform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n setToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values in this Matrix to the array given.\r\n * \r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray\r\n * @since 3.12.0\r\n *\r\n * @param {array} [out] - The array to copy the matrix values in to.\r\n *\r\n * @return {array} An array where elements 0 to 5 contain the values from this matrix.\r\n */\r\n copyToArray: function (out)\r\n {\r\n var matrix = this.matrix;\r\n\r\n if (out === undefined)\r\n {\r\n out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ];\r\n }\r\n else\r\n {\r\n out[0] = matrix[0];\r\n out[1] = matrix[1];\r\n out[2] = matrix[2];\r\n out[3] = matrix[3];\r\n out[4] = matrix[4];\r\n out[5] = matrix[5];\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setTransform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n setTransform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = a;\r\n matrix[1] = b;\r\n matrix[2] = c;\r\n matrix[3] = d;\r\n matrix[4] = tx;\r\n matrix[5] = ty;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Decompose this Matrix into its translation, scale and rotation values using QR decomposition.\r\n * \r\n * The result must be applied in the following order to reproduce the current matrix:\r\n * \r\n * translate -> rotate -> scale\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix\r\n * @since 3.0.0\r\n *\r\n * @return {object} The decomposed Matrix.\r\n */\r\n decomposeMatrix: function ()\r\n {\r\n var decomposedMatrix = this.decomposedMatrix;\r\n\r\n var matrix = this.matrix;\r\n\r\n // a = scale X (1)\r\n // b = shear Y (0)\r\n // c = shear X (0)\r\n // d = scale Y (1)\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n var determ = a * d - b * c;\r\n\r\n decomposedMatrix.translateX = matrix[4];\r\n decomposedMatrix.translateY = matrix[5];\r\n\r\n if (a || b)\r\n {\r\n var r = Math.sqrt(a * a + b * b);\r\n\r\n decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r);\r\n decomposedMatrix.scaleX = r;\r\n decomposedMatrix.scaleY = determ / r;\r\n }\r\n else if (c || d)\r\n {\r\n var s = Math.sqrt(c * c + d * d);\r\n\r\n decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s));\r\n decomposedMatrix.scaleX = determ / s;\r\n decomposedMatrix.scaleY = s;\r\n }\r\n else\r\n {\r\n decomposedMatrix.rotation = 0;\r\n decomposedMatrix.scaleX = 0;\r\n decomposedMatrix.scaleY = 0;\r\n }\r\n\r\n return decomposedMatrix;\r\n },\r\n\r\n /**\r\n * Apply the identity, translate, rotate and scale operations on the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation.\r\n * @param {number} y - The vertical translation.\r\n * @param {number} rotation - The angle of rotation in radians.\r\n * @param {number} scaleX - The horizontal scale.\r\n * @param {number} scaleY - The vertical scale.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n applyITRS: function (x, y, rotation, scaleX, scaleY)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var radianSin = Math.sin(rotation);\r\n var radianCos = Math.cos(rotation);\r\n\r\n // Translate\r\n matrix[4] = x;\r\n matrix[5] = y;\r\n\r\n // Rotate and Scale\r\n matrix[0] = radianCos * scaleX;\r\n matrix[1] = radianSin * scaleX;\r\n matrix[2] = -radianSin * scaleY;\r\n matrix[3] = radianCos * scaleY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of\r\n * the current matrix with its transformation applied.\r\n * \r\n * Can be used to translate points from world to local space.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse\r\n * @since 3.12.0\r\n *\r\n * @param {number} x - The x position to translate.\r\n * @param {number} y - The y position to translate.\r\n * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix.\r\n */\r\n applyInverse: function (x, y, output)\r\n {\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var id = 1 / ((a * d) + (c * -b));\r\n\r\n output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id);\r\n output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id);\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the X component of this matrix multiplied by the given values.\r\n * This is the same as `x * a + y * c + e`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getX\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated x value.\r\n */\r\n getX: function (x, y)\r\n {\r\n return x * this.a + y * this.c + this.e;\r\n },\r\n\r\n /**\r\n * Returns the Y component of this matrix multiplied by the given values.\r\n * This is the same as `x * b + y * d + f`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getY\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated y value.\r\n */\r\n getY: function (x, y)\r\n {\r\n return x * this.b + y * this.d + this.f;\r\n },\r\n\r\n /**\r\n * Returns a string that can be used in a CSS Transform call as a `matrix` property.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix\r\n * @since 3.12.0\r\n *\r\n * @return {string} A string containing the CSS Transform matrix values.\r\n */\r\n getCSSMatrix: function ()\r\n {\r\n var m = this.matrix;\r\n\r\n return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')';\r\n },\r\n\r\n /**\r\n * Destroys this Transform Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#destroy\r\n * @since 3.4.0\r\n */\r\n destroy: function ()\r\n {\r\n this.matrix = null;\r\n this.decomposedMatrix = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TransformMatrix;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 1; // 0001\r\n\r\n/**\r\n * Provides methods used for setting the visibility of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Visible\r\n * @since 3.0.0\r\n */\r\n\r\nvar Visible = {\r\n\r\n /**\r\n * Private internal value. Holds the visible value.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#_visible\r\n * @type {boolean}\r\n * @private\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n _visible: true,\r\n\r\n /**\r\n * The visible state of the Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#visible\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n visible: {\r\n\r\n get: function ()\r\n {\r\n return this._visible;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value)\r\n {\r\n this._visible = true;\r\n this.renderFlags |= _FLAG;\r\n }\r\n else\r\n {\r\n this._visible = false;\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the visibility of this Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n *\r\n * @method Phaser.GameObjects.Components.Visible#setVisible\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The visible state of the Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setVisible: function (value)\r\n {\r\n this.visible = value;\r\n\r\n return this;\r\n }\r\n};\r\n\r\nmodule.exports = Visible;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Destroy Event.\r\n * \r\n * This event is dispatched when a Game Object instance is being destroyed.\r\n * \r\n * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed.\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.GameObjects.Events\r\n */\r\n\r\nmodule.exports = { DESTROY: require('./DESTROY_EVENT') };\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar CONST = require('./const');\r\nvar Events = require('./events');\r\nvar GetFastValue = require('../utils/object/GetFastValue');\r\nvar GetURL = require('./GetURL');\r\nvar MergeXHRSettings = require('./MergeXHRSettings');\r\nvar XHRLoader = require('./XHRLoader');\r\nvar XHRSettings = require('./XHRSettings');\r\n\r\n/**\r\n * @classdesc\r\n * The base File class used by all File Types that the Loader can support.\r\n * 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.\r\n *\r\n * @class File\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\r\n * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type.\r\n */\r\nvar File = new Class({\r\n\r\n initialize:\r\n\r\n function File (loader, fileConfig)\r\n {\r\n /**\r\n * A reference to the Loader that is going to load this file.\r\n *\r\n * @name Phaser.Loader.File#loader\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.0.0\r\n */\r\n this.loader = loader;\r\n\r\n /**\r\n * A reference to the Cache, or Texture Manager, that is going to store this file if it loads.\r\n *\r\n * @name Phaser.Loader.File#cache\r\n * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)}\r\n * @since 3.7.0\r\n */\r\n this.cache = GetFastValue(fileConfig, 'cache', false);\r\n\r\n /**\r\n * The file type string (image, json, etc) for sorting within the Loader.\r\n *\r\n * @name Phaser.Loader.File#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = GetFastValue(fileConfig, 'type', false);\r\n\r\n /**\r\n * Unique cache key (unique within its file type)\r\n *\r\n * @name Phaser.Loader.File#key\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.key = GetFastValue(fileConfig, 'key', false);\r\n\r\n var loadKey = this.key;\r\n\r\n if (loader.prefix && loader.prefix !== '')\r\n {\r\n this.key = loader.prefix + loadKey;\r\n }\r\n\r\n if (!this.type || !this.key)\r\n {\r\n throw new Error('Error calling \\'Loader.' + this.type + '\\' invalid key provided.');\r\n }\r\n\r\n /**\r\n * The URL of the file, not including baseURL.\r\n * Automatically has Loader.path prepended to it.\r\n *\r\n * @name Phaser.Loader.File#url\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.url = GetFastValue(fileConfig, 'url');\r\n\r\n if (this.url === undefined)\r\n {\r\n this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', '');\r\n }\r\n else if (typeof(this.url) !== 'function')\r\n {\r\n this.url = loader.path + this.url;\r\n }\r\n\r\n /**\r\n * The final URL this file will load from, including baseURL and path.\r\n * Set automatically when the Loader calls 'load' on this file.\r\n *\r\n * @name Phaser.Loader.File#src\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.src = '';\r\n\r\n /**\r\n * The merged XHRSettings for this file.\r\n *\r\n * @name Phaser.Loader.File#xhrSettings\r\n * @type {Phaser.Types.Loader.XHRSettingsObject}\r\n * @since 3.0.0\r\n */\r\n this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined));\r\n\r\n if (GetFastValue(fileConfig, 'xhrSettings', false))\r\n {\r\n this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {}));\r\n }\r\n\r\n /**\r\n * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File.\r\n *\r\n * @name Phaser.Loader.File#xhrLoader\r\n * @type {?XMLHttpRequest}\r\n * @since 3.0.0\r\n */\r\n this.xhrLoader = null;\r\n\r\n /**\r\n * The current state of the file. One of the FILE_CONST values.\r\n *\r\n * @name Phaser.Loader.File#state\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING;\r\n\r\n /**\r\n * The total size of this file.\r\n * Set by onProgress and only if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#bytesTotal\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.bytesTotal = 0;\r\n\r\n /**\r\n * Updated as the file loads.\r\n * Only set if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#bytesLoaded\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.bytesLoaded = -1;\r\n\r\n /**\r\n * A percentage value between 0 and 1 indicating how much of this file has loaded.\r\n * Only set if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#percentComplete\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.percentComplete = -1;\r\n\r\n /**\r\n * For CORs based loading.\r\n * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set)\r\n *\r\n * @name Phaser.Loader.File#crossOrigin\r\n * @type {(string|undefined)}\r\n * @since 3.0.0\r\n */\r\n this.crossOrigin = undefined;\r\n\r\n /**\r\n * The processed file data, stored here after the file has loaded.\r\n *\r\n * @name Phaser.Loader.File#data\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.data = undefined;\r\n\r\n /**\r\n * A config object that can be used by file types to store transitional data.\r\n *\r\n * @name Phaser.Loader.File#config\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.config = GetFastValue(fileConfig, 'config', {});\r\n\r\n /**\r\n * If this is a multipart file, i.e. an atlas and its json together, then this is a reference\r\n * to the parent MultiFile. Set and used internally by the Loader or specific file types.\r\n *\r\n * @name Phaser.Loader.File#multiFile\r\n * @type {?Phaser.Loader.MultiFile}\r\n * @since 3.7.0\r\n */\r\n this.multiFile;\r\n\r\n /**\r\n * Does this file have an associated linked file? Such as an image and a normal map.\r\n * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't\r\n * actually bound by data, where-as a linkFile is.\r\n *\r\n * @name Phaser.Loader.File#linkFile\r\n * @type {?Phaser.Loader.File}\r\n * @since 3.7.0\r\n */\r\n this.linkFile;\r\n },\r\n\r\n /**\r\n * Links this File with another, so they depend upon each other for loading and processing.\r\n *\r\n * @method Phaser.Loader.File#setLink\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} fileB - The file to link to this one.\r\n */\r\n setLink: function (fileB)\r\n {\r\n this.linkFile = fileB;\r\n\r\n fileB.linkFile = this;\r\n },\r\n\r\n /**\r\n * Resets the XHRLoader instance this file is using.\r\n *\r\n * @method Phaser.Loader.File#resetXHR\r\n * @since 3.0.0\r\n */\r\n resetXHR: function ()\r\n {\r\n if (this.xhrLoader)\r\n {\r\n this.xhrLoader.onload = undefined;\r\n this.xhrLoader.onerror = undefined;\r\n this.xhrLoader.onprogress = undefined;\r\n }\r\n },\r\n\r\n /**\r\n * Called by the Loader, starts the actual file downloading.\r\n * During the load the methods onLoad, onError and onProgress are called, based on the XHR events.\r\n * You shouldn't normally call this method directly, it's meant to be invoked by the Loader.\r\n *\r\n * @method Phaser.Loader.File#load\r\n * @since 3.0.0\r\n */\r\n load: function ()\r\n {\r\n if (this.state === CONST.FILE_POPULATED)\r\n {\r\n // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL\r\n this.loader.nextFile(this, true);\r\n }\r\n else\r\n {\r\n this.src = GetURL(this, this.loader.baseURL);\r\n\r\n if (this.src.indexOf('data:') === 0)\r\n {\r\n console.warn('Local data URIs are not supported: ' + this.key);\r\n }\r\n else\r\n {\r\n // The creation of this XHRLoader starts the load process going.\r\n // It will automatically call the following, based on the load outcome:\r\n // \r\n // xhr.onload = this.onLoad\r\n // xhr.onerror = this.onError\r\n // xhr.onprogress = this.onProgress\r\n\r\n this.xhrLoader = XHRLoader(this, this.loader.xhr);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Called when the file finishes loading, is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onLoad\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load.\r\n */\r\n onLoad: function (xhr, event)\r\n {\r\n var localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && event.target.status === 0));\r\n\r\n var success = !(event.target && event.target.status !== 200) || localFileOk;\r\n\r\n // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.\r\n if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599)\r\n {\r\n success = false;\r\n }\r\n\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, success);\r\n },\r\n\r\n /**\r\n * Called if the file errors while loading, is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onError\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error.\r\n */\r\n onError: function ()\r\n {\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, false);\r\n },\r\n\r\n /**\r\n * Called during the file load progress. Is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onProgress\r\n * @fires Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n *\r\n * @param {ProgressEvent} event - The DOM ProgressEvent.\r\n */\r\n onProgress: function (event)\r\n {\r\n if (event.lengthComputable)\r\n {\r\n this.bytesLoaded = event.loaded;\r\n this.bytesTotal = event.total;\r\n\r\n this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1);\r\n\r\n this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete);\r\n }\r\n },\r\n\r\n /**\r\n * Usually overridden by the FileTypes and is called by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage.\r\n *\r\n * @method Phaser.Loader.File#onProcess\r\n * @since 3.0.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.onProcessComplete();\r\n },\r\n\r\n /**\r\n * Called when the File has completed processing.\r\n * Checks on the state of its multifile, if set.\r\n *\r\n * @method Phaser.Loader.File#onProcessComplete\r\n * @since 3.7.0\r\n */\r\n onProcessComplete: function ()\r\n {\r\n this.state = CONST.FILE_COMPLETE;\r\n\r\n if (this.multiFile)\r\n {\r\n this.multiFile.onFileComplete(this);\r\n }\r\n\r\n this.loader.fileProcessComplete(this);\r\n },\r\n\r\n /**\r\n * Called when the File has completed processing but it generated an error.\r\n * Checks on the state of its multifile, if set.\r\n *\r\n * @method Phaser.Loader.File#onProcessError\r\n * @since 3.7.0\r\n */\r\n onProcessError: function ()\r\n {\r\n this.state = CONST.FILE_ERRORED;\r\n\r\n if (this.multiFile)\r\n {\r\n this.multiFile.onFileFailed(this);\r\n }\r\n\r\n this.loader.fileProcessComplete(this);\r\n },\r\n\r\n /**\r\n * Checks if a key matching the one used by this file exists in the target Cache or not.\r\n * This is called automatically by the LoaderPlugin to decide if the file can be safely\r\n * loaded or will conflict.\r\n *\r\n * @method Phaser.Loader.File#hasCacheConflict\r\n * @since 3.7.0\r\n *\r\n * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`.\r\n */\r\n hasCacheConflict: function ()\r\n {\r\n return (this.cache && this.cache.exists(this.key));\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n * This method is often overridden by specific file types.\r\n *\r\n * @method Phaser.Loader.File#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.cache)\r\n {\r\n this.cache.add(this.key, this.data);\r\n }\r\n\r\n this.pendingDestroy();\r\n },\r\n\r\n /**\r\n * Called once the file has been added to its cache and is now ready for deletion from the Loader.\r\n * It will emit a `filecomplete` event from the LoaderPlugin.\r\n *\r\n * @method Phaser.Loader.File#pendingDestroy\r\n * @fires Phaser.Loader.Events#FILE_COMPLETE\r\n * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE\r\n * @since 3.7.0\r\n */\r\n pendingDestroy: function (data)\r\n {\r\n if (data === undefined) { data = this.data; }\r\n\r\n var key = this.key;\r\n var type = this.type;\r\n\r\n this.loader.emit(Events.FILE_COMPLETE, key, type, data);\r\n this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data);\r\n\r\n this.loader.flagForRemoval(this);\r\n },\r\n\r\n /**\r\n * Destroy this File and any references it holds.\r\n *\r\n * @method Phaser.Loader.File#destroy\r\n * @since 3.7.0\r\n */\r\n destroy: function ()\r\n {\r\n this.loader = null;\r\n this.cache = null;\r\n this.xhrSettings = null;\r\n this.multiFile = null;\r\n this.linkFile = null;\r\n this.data = null;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Static method for creating object URL using URL API and setting it as image 'src' attribute.\r\n * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader.\r\n *\r\n * @method Phaser.Loader.File.createObjectURL\r\n * @static\r\n * @since 3.7.0\r\n * \r\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL.\r\n * @param {Blob} blob - A Blob object to create an object URL for.\r\n * @param {string} defaultType - Default mime type used if blob type is not available.\r\n */\r\nFile.createObjectURL = function (image, blob, defaultType)\r\n{\r\n if (typeof URL === 'function')\r\n {\r\n image.src = URL.createObjectURL(blob);\r\n }\r\n else\r\n {\r\n var reader = new FileReader();\r\n\r\n reader.onload = function ()\r\n {\r\n image.removeAttribute('crossOrigin');\r\n image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1];\r\n };\r\n\r\n reader.onerror = image.onerror;\r\n\r\n reader.readAsDataURL(blob);\r\n }\r\n};\r\n\r\n/**\r\n * Static method for releasing an existing object URL which was previously created\r\n * by calling {@link File#createObjectURL} method.\r\n *\r\n * @method Phaser.Loader.File.revokeObjectURL\r\n * @static\r\n * @since 3.7.0\r\n * \r\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked.\r\n */\r\nFile.revokeObjectURL = function (image)\r\n{\r\n if (typeof URL === 'function')\r\n {\r\n URL.revokeObjectURL(image.src);\r\n }\r\n};\r\n\r\nmodule.exports = File;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar types = {};\r\n\r\n/**\r\n * @namespace Phaser.Loader.FileTypesManager\r\n */\r\n\r\nvar FileTypesManager = {\r\n\r\n /**\r\n * Static method called when a LoaderPlugin is created.\r\n * \r\n * Loops through the local types object and injects all of them as\r\n * properties into the LoaderPlugin instance.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.install\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into.\r\n */\r\n install: function (loader)\r\n {\r\n for (var key in types)\r\n {\r\n loader[key] = types[key];\r\n }\r\n },\r\n\r\n /**\r\n * Static method called directly by the File Types.\r\n * \r\n * The key is a reference to the function used to load the files via the Loader, i.e. `image`.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.register\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key that will be used as the method name in the LoaderPlugin.\r\n * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked.\r\n */\r\n register: function (key, factoryFunction)\r\n {\r\n types[key] = factoryFunction;\r\n },\r\n\r\n /**\r\n * Removed all associated file types.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n types = {};\r\n }\r\n\r\n};\r\n\r\nmodule.exports = FileTypesManager;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Given a File and a baseURL value this returns the URL the File will use to download from.\r\n *\r\n * @function Phaser.Loader.GetURL\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File object.\r\n * @param {string} baseURL - A default base URL.\r\n *\r\n * @return {string} The URL the File will use.\r\n */\r\nvar GetURL = function (file, baseURL)\r\n{\r\n if (!file.url)\r\n {\r\n return false;\r\n }\r\n\r\n if (file.url.match(/^(?:blob:|data:|http:\\/\\/|https:\\/\\/|\\/\\/)/))\r\n {\r\n return file.url;\r\n }\r\n else\r\n {\r\n return baseURL + file.url;\r\n }\r\n};\r\n\r\nmodule.exports = GetURL;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Extend = require('../utils/object/Extend');\r\nvar XHRSettings = require('./XHRSettings');\r\n\r\n/**\r\n * Takes two XHRSettings Objects and creates a new XHRSettings object from them.\r\n *\r\n * The new object is seeded by the values given in the global settings, but any setting in\r\n * the local object overrides the global ones.\r\n *\r\n * @function Phaser.Loader.MergeXHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object.\r\n */\r\nvar MergeXHRSettings = function (global, local)\r\n{\r\n var output = (global === undefined) ? XHRSettings() : Extend({}, global);\r\n\r\n if (local)\r\n {\r\n for (var setting in local)\r\n {\r\n if (local[setting] !== undefined)\r\n {\r\n output[setting] = local[setting];\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = MergeXHRSettings;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after\r\n * 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.\r\n * \r\n * 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.\r\n *\r\n * @class MultiFile\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\r\n * @param {string} type - The file type string for sorting within the Loader.\r\n * @param {string} key - The key of the file within the loader.\r\n * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile.\r\n */\r\nvar MultiFile = new Class({\r\n\r\n initialize:\r\n\r\n function MultiFile (loader, type, key, files)\r\n {\r\n /**\r\n * A reference to the Loader that is going to load this file.\r\n *\r\n * @name Phaser.Loader.MultiFile#loader\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.7.0\r\n */\r\n this.loader = loader;\r\n\r\n /**\r\n * The file type string for sorting within the Loader.\r\n *\r\n * @name Phaser.Loader.MultiFile#type\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * Unique cache key (unique within its file type)\r\n *\r\n * @name Phaser.Loader.MultiFile#key\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.key = key;\r\n\r\n /**\r\n * Array of files that make up this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#files\r\n * @type {Phaser.Loader.File[]}\r\n * @since 3.7.0\r\n */\r\n this.files = files;\r\n\r\n /**\r\n * The completion status of this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#complete\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.7.0\r\n */\r\n this.complete = false;\r\n\r\n /**\r\n * The number of files to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#pending\r\n * @type {integer}\r\n * @since 3.7.0\r\n */\r\n\r\n this.pending = files.length;\r\n\r\n /**\r\n * The number of files that failed to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#failed\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.7.0\r\n */\r\n this.failed = 0;\r\n\r\n /**\r\n * A storage container for transient data that the loading files need.\r\n *\r\n * @name Phaser.Loader.MultiFile#config\r\n * @type {any}\r\n * @since 3.7.0\r\n */\r\n this.config = {};\r\n\r\n // Link the files\r\n for (var i = 0; i < files.length; i++)\r\n {\r\n files[i].multiFile = this;\r\n }\r\n },\r\n\r\n /**\r\n * Checks if this MultiFile is ready to process its children or not.\r\n *\r\n * @method Phaser.Loader.MultiFile#isReadyToProcess\r\n * @since 3.7.0\r\n *\r\n * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`.\r\n */\r\n isReadyToProcess: function ()\r\n {\r\n return (this.pending === 0 && this.failed === 0 && !this.complete);\r\n },\r\n\r\n /**\r\n * Adds another child to this MultiFile, increases the pending count and resets the completion status.\r\n *\r\n * @method Phaser.Loader.MultiFile#addToMultiFile\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} files - The File to add to this MultiFile.\r\n *\r\n * @return {Phaser.Loader.MultiFile} This MultiFile instance.\r\n */\r\n addToMultiFile: function (file)\r\n {\r\n this.files.push(file);\r\n\r\n file.multiFile = this;\r\n\r\n this.pending++;\r\n\r\n this.complete = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileComplete\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n }\r\n },\r\n\r\n /**\r\n * Called by each File that fails to load.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileFailed\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has failed to load.\r\n */\r\n onFileFailed: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.failed++;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MultiFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MergeXHRSettings = require('./MergeXHRSettings');\r\n\r\n/**\r\n * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings\r\n * and starts the download of it. It uses the Files own XHRSettings and merges them\r\n * with the global XHRSettings object to set the xhr values before download.\r\n *\r\n * @function Phaser.Loader.XHRLoader\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File to download.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object.\r\n *\r\n * @return {XMLHttpRequest} The XHR object.\r\n */\r\nvar XHRLoader = function (file, globalXHRSettings)\r\n{\r\n var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings);\r\n\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', file.src, config.async, config.user, config.password);\r\n\r\n xhr.responseType = file.xhrSettings.responseType;\r\n xhr.timeout = config.timeout;\r\n\r\n if (config.header && config.headerValue)\r\n {\r\n xhr.setRequestHeader(config.header, config.headerValue);\r\n }\r\n\r\n if (config.requestedWith)\r\n {\r\n xhr.setRequestHeader('X-Requested-With', config.requestedWith);\r\n }\r\n\r\n if (config.overrideMimeType)\r\n {\r\n xhr.overrideMimeType(config.overrideMimeType);\r\n }\r\n\r\n // 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.)\r\n\r\n xhr.onload = file.onLoad.bind(file, xhr);\r\n xhr.onerror = file.onError.bind(file, xhr);\r\n xhr.onprogress = file.onProgress.bind(file);\r\n\r\n // This is the only standard method, the ones above are browser additions (maybe not universal?)\r\n // xhr.onreadystatechange\r\n\r\n xhr.send();\r\n\r\n return xhr;\r\n};\r\n\r\nmodule.exports = XHRLoader;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Creates an XHRSettings Object with default values.\r\n *\r\n * @function Phaser.Loader.XHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'.\r\n * @param {boolean} [async=true] - Should the XHR request use async or not?\r\n * @param {string} [user=''] - Optional username for the XHR request.\r\n * @param {string} [password=''] - Optional password for the XHR request.\r\n * @param {integer} [timeout=0] - Optional XHR timeout value.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader.\r\n */\r\nvar XHRSettings = function (responseType, async, user, password, timeout)\r\n{\r\n if (responseType === undefined) { responseType = ''; }\r\n if (async === undefined) { async = true; }\r\n if (user === undefined) { user = ''; }\r\n if (password === undefined) { password = ''; }\r\n if (timeout === undefined) { timeout = 0; }\r\n\r\n // Before sending a request, set the xhr.responseType to \"text\",\r\n // \"arraybuffer\", \"blob\", or \"document\", depending on your data needs.\r\n // Note, setting xhr.responseType = '' (or omitting) will default the response to \"text\".\r\n\r\n return {\r\n\r\n // Ignored by the Loader, only used by File.\r\n responseType: responseType,\r\n\r\n async: async,\r\n\r\n // credentials\r\n user: user,\r\n password: password,\r\n\r\n // timeout in ms (0 = no timeout)\r\n timeout: timeout,\r\n\r\n // setRequestHeader\r\n header: undefined,\r\n headerValue: undefined,\r\n requestedWith: false,\r\n\r\n // overrideMimeType\r\n overrideMimeType: undefined\r\n\r\n };\r\n};\r\n\r\nmodule.exports = XHRSettings;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FILE_CONST = {\r\n\r\n /**\r\n * The Loader is idle.\r\n * \r\n * @name Phaser.Loader.LOADER_IDLE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_IDLE: 0,\r\n\r\n /**\r\n * The Loader is actively loading.\r\n * \r\n * @name Phaser.Loader.LOADER_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_LOADING: 1,\r\n\r\n /**\r\n * The Loader is processing files is has loaded.\r\n * \r\n * @name Phaser.Loader.LOADER_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_PROCESSING: 2,\r\n\r\n /**\r\n * The Loader has completed loading and processing.\r\n * \r\n * @name Phaser.Loader.LOADER_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_COMPLETE: 3,\r\n\r\n /**\r\n * The Loader is shutting down.\r\n * \r\n * @name Phaser.Loader.LOADER_SHUTDOWN\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_SHUTDOWN: 4,\r\n\r\n /**\r\n * The Loader has been destroyed.\r\n * \r\n * @name Phaser.Loader.LOADER_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_DESTROYED: 5,\r\n\r\n /**\r\n * File is in the load queue but not yet started\r\n * \r\n * @name Phaser.Loader.FILE_PENDING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PENDING: 10,\r\n\r\n /**\r\n * File has been started to load by the loader (onLoad called)\r\n * \r\n * @name Phaser.Loader.FILE_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADING: 11,\r\n\r\n /**\r\n * File has loaded successfully, awaiting processing \r\n * \r\n * @name Phaser.Loader.FILE_LOADED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADED: 12,\r\n\r\n /**\r\n * File failed to load\r\n * \r\n * @name Phaser.Loader.FILE_FAILED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_FAILED: 13,\r\n\r\n /**\r\n * File is being processed (onProcess callback)\r\n * \r\n * @name Phaser.Loader.FILE_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PROCESSING: 14,\r\n\r\n /**\r\n * The File has errored somehow during processing.\r\n * \r\n * @name Phaser.Loader.FILE_ERRORED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_ERRORED: 16,\r\n\r\n /**\r\n * File has finished processing.\r\n * \r\n * @name Phaser.Loader.FILE_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_COMPLETE: 17,\r\n\r\n /**\r\n * File has been destroyed\r\n * \r\n * @name Phaser.Loader.FILE_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_DESTROYED: 18,\r\n\r\n /**\r\n * File was populated from local data and doesn't need an HTTP request\r\n * \r\n * @name Phaser.Loader.FILE_POPULATED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_POPULATED: 19\r\n\r\n};\r\n\r\nmodule.exports = FILE_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Add File Event.\r\n * \r\n * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('addfile', listener)`.\r\n * \r\n * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them.\r\n *\r\n * @event Phaser.Loader.Events#ADD\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The unique key of the file that was added to the Loader.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`.\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader.\r\n */\r\nmodule.exports = 'addfile';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Complete Event.\r\n * \r\n * This event is dispatched when the Loader has fully processed everything in the load queue.\r\n * By this point every loaded file will now be in its associated cache and ready for use.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('complete', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {integer} totalComplete - The total number of files that successfully loaded.\r\n * @param {integer} totalFailed - The total number of files that failed to load.\r\n */\r\nmodule.exports = 'complete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`.\r\n * \r\n * 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.\r\n *\r\n * @event Phaser.Loader.Events#FILE_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * It uses a special dynamic event name constructed from the key and type of the file.\r\n * \r\n * For example, if you have loaded an `image` with a key of `monster`, you can listen for it\r\n * using the following:\r\n *\r\n * ```javascript\r\n * this.load.on('filecomplete-image-monster', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n *\r\n * Or, if you have loaded a texture `atlas` with a key of `Level1`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-atlas-Level1', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event.\r\n *\r\n * @event Phaser.Loader.Events#FILE_KEY_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete-';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Error Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file fails to load.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('loaderror', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD_ERROR\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n */\r\nmodule.exports = 'loaderror';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file finishes loading,\r\n * but _before_ it is processed and added to the internal Phaser caches.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('load', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which just finished loading.\r\n */\r\nmodule.exports = 'load';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Progress Event.\r\n * \r\n * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and\r\n * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is.\r\n */\r\nmodule.exports = 'fileprogress';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Post Process Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue.\r\n * It is dispatched before the internal lists are cleared and each File is destroyed.\r\n * \r\n * Use this hook to perform any last minute processing of files that can only happen once the\r\n * Loader has completed, but prior to it emitting the `complete` event.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('postprocess', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#POST_PROCESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'postprocess';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Progress Event.\r\n * \r\n * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('progress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {number} progress - The current progress of the load. A value between 0 and 1.\r\n */\r\nmodule.exports = 'progress';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Start Event.\r\n * \r\n * This event is dispatched when the Loader starts running. At this point load progress is zero.\r\n * \r\n * This event is dispatched even if there aren't any files in the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('start', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Loader.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ADD: require('./ADD_EVENT'),\r\n COMPLETE: require('./COMPLETE_EVENT'),\r\n FILE_COMPLETE: require('./FILE_COMPLETE_EVENT'),\r\n FILE_KEY_COMPLETE: require('./FILE_KEY_COMPLETE_EVENT'),\r\n FILE_LOAD_ERROR: require('./FILE_LOAD_ERROR_EVENT'),\r\n FILE_LOAD: require('./FILE_LOAD_EVENT'),\r\n FILE_PROGRESS: require('./FILE_PROGRESS_EVENT'),\r\n POST_PROCESS: require('./POST_PROCESS_EVENT'),\r\n PROGRESS: require('./PROGRESS_EVENT'),\r\n START: require('./START_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single Image File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image.\r\n *\r\n * @class ImageFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets.\r\n */\r\nvar ImageFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function ImageFile (loader, key, url, xhrSettings, frameConfig)\r\n {\r\n var extension = 'png';\r\n var normalMapURL;\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n normalMapURL = GetFastValue(config, 'normalMap');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n frameConfig = GetFastValue(config, 'frameConfig');\r\n }\r\n\r\n if (Array.isArray(url))\r\n {\r\n normalMapURL = url[1];\r\n url = url[0];\r\n }\r\n\r\n var fileConfig = {\r\n type: 'image',\r\n cache: loader.textureManager,\r\n extension: extension,\r\n responseType: 'blob',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: frameConfig\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n // Do we have a normal map to load as well?\r\n if (normalMapURL)\r\n {\r\n var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig);\r\n\r\n normalMap.type = 'normalMap';\r\n\r\n this.setLink(normalMap);\r\n\r\n loader.addFile(normalMap);\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = new Image();\r\n\r\n this.data.crossOrigin = this.crossOrigin;\r\n\r\n var _this = this;\r\n\r\n this.data.onload = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessComplete();\r\n };\r\n\r\n this.data.onerror = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessError();\r\n };\r\n\r\n File.createObjectURL(this.data, this.xhrLoader.response, 'image/png');\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var texture;\r\n var linkFile = this.linkFile;\r\n\r\n if (linkFile && linkFile.state === CONST.FILE_COMPLETE)\r\n {\r\n if (this.type === 'image')\r\n {\r\n texture = this.cache.addImage(this.key, this.data, linkFile.data);\r\n }\r\n else\r\n {\r\n texture = this.cache.addImage(linkFile.key, linkFile.data, this.data);\r\n }\r\n\r\n this.pendingDestroy(texture);\r\n\r\n linkFile.pendingDestroy(texture);\r\n }\r\n else if (!linkFile)\r\n {\r\n texture = this.cache.addImage(this.key, this.data);\r\n\r\n this.pendingDestroy(texture);\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an Image, or array of Images, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.image('logo', 'images/phaserLogo.png');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback\r\n * of animated gifs to Canvas elements.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.image('logo', 'images/AtariLogo.png');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'logo');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n * \r\n * ```javascript\r\n * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]);\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n * \r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png',\r\n * normalMap: 'images/AtariLogo-n.png'\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#image\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('image', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new ImageFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new ImageFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = ImageFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar GetValue = require('../../utils/object/GetValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single JSON File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json.\r\n *\r\n * @class JSONFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n */\r\nvar JSONFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n // 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\r\n // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing\r\n\r\n function JSONFile (loader, key, url, xhrSettings, dataKey)\r\n {\r\n var extension = 'json';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n dataKey = GetFastValue(config, 'dataKey', dataKey);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'json',\r\n cache: loader.cacheManager.json,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: dataKey\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n if (IsPlainObject(url))\r\n {\r\n // Object provided instead of a URL, so no need to actually load it (populate data with value)\r\n if (dataKey)\r\n {\r\n this.data = GetValue(url, dataKey);\r\n }\r\n else\r\n {\r\n this.data = url;\r\n }\r\n\r\n this.state = CONST.FILE_POPULATED;\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.JSONFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n if (this.state !== CONST.FILE_POPULATED)\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n var json = JSON.parse(this.xhrLoader.responseText);\r\n\r\n var key = this.config;\r\n\r\n if (typeof key === 'string')\r\n {\r\n this.data = GetValue(json, key, json);\r\n }\r\n else\r\n {\r\n this.data = json;\r\n }\r\n }\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a JSON file, or array of JSON files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.json('wavedata', 'files/AlienWaveData.json');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the JSON Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the JSON Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.json({\r\n * key: 'wavedata',\r\n * url: 'files/AlienWaveData.json'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n * \r\n * ```javascript\r\n * this.load.json('wavedata', 'files/AlienWaveData.json');\r\n * // and later in your game ...\r\n * var data = this.cache.json.get('wavedata');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and\r\n * this is what you would use to retrieve the text from the JSON Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * 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,\r\n * rather than the whole file. For example, if your JSON data had a structure like this:\r\n * \r\n * ```json\r\n * {\r\n * \"level1\": {\r\n * \"baddies\": {\r\n * \"aliens\": {},\r\n * \"boss\": {}\r\n * }\r\n * },\r\n * \"level2\": {},\r\n * \"level3\": {}\r\n * }\r\n * ```\r\n *\r\n * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`.\r\n *\r\n * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#json\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {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\".\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('json', function (key, url, dataKey, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new JSONFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = JSONFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single Text File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text.\r\n *\r\n * @class TextFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar TextFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function TextFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'txt';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'text',\r\n cache: loader.cacheManager.text,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.TextFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = this.xhrLoader.responseText;\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Text file, or array of Text files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Text Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Text Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.text({\r\n * key: 'story',\r\n * url: 'files/IntroStory.txt'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n *\r\n * ```javascript\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * // and later in your game ...\r\n * var data = this.cache.text.get('story');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and\r\n * this is what you would use to retrieve the text from the Text Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#text\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('text', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new TextFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new TextFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = TextFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the mean average of the given values.\r\n *\r\n * @function Phaser.Math.Average\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} values - The values to average.\r\n *\r\n * @return {number} The average value.\r\n */\r\nvar Average = function (values)\r\n{\r\n var sum = 0;\r\n\r\n for (var i = 0; i < values.length; i++)\r\n {\r\n sum += (+values[i]);\r\n }\r\n\r\n return sum / values.length;\r\n};\r\n\r\nmodule.exports = Average;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Factorial = require('./Factorial');\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Math.Bernstein\r\n * @since 3.0.0\r\n *\r\n * @param {number} n - [description]\r\n * @param {number} i - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\nvar Bernstein = function (n, i)\r\n{\r\n return Factorial(n) / Factorial(i) / Factorial(n - i);\r\n};\r\n\r\nmodule.exports = Bernstein;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random integer between the `min` and `max` values, inclusive.\r\n *\r\n * @function Phaser.Math.Between\r\n * @since 3.0.0\r\n *\r\n * @param {integer} min - The minimum value.\r\n * @param {integer} max - The maximum value.\r\n *\r\n * @return {integer} The random integer.\r\n */\r\nvar Between = function (min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n};\r\n\r\nmodule.exports = Between;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates a Catmull-Rom value.\r\n *\r\n * @function Phaser.Math.CatmullRom\r\n * @since 3.0.0\r\n *\r\n * @param {number} t - [description]\r\n * @param {number} p0 - [description]\r\n * @param {number} p1 - [description]\r\n * @param {number} p2 - [description]\r\n * @param {number} p3 - [description]\r\n *\r\n * @return {number} The Catmull-Rom value.\r\n */\r\nvar CatmullRom = function (t, p0, p1, p2, p3)\r\n{\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n var t2 = t * t;\r\n var t3 = t * t2;\r\n\r\n return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\r\n};\r\n\r\nmodule.exports = CatmullRom;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Ceils to some place comparative to a `base`, default is 10 for decimal place.\r\n *\r\n * The `place` is represented by the power applied to `base` to get that place.\r\n *\r\n * @function Phaser.Math.CeilTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {number} [place=0] - The place to round to.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar CeilTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.ceil(value * p) / p;\r\n};\r\n\r\nmodule.exports = CeilTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Force a value within the boundaries by clamping it to the range `min`, `max`.\r\n *\r\n * @function Phaser.Math.Clamp\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to be clamped.\r\n * @param {number} min - The minimum bounds.\r\n * @param {number} max - The maximum bounds.\r\n *\r\n * @return {number} The clamped value.\r\n */\r\nvar Clamp = function (value, min, max)\r\n{\r\n return Math.max(min, Math.min(max, value));\r\n};\r\n\r\nmodule.exports = Clamp;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\n\r\n/**\r\n * Convert the given angle from degrees, to the equivalent angle in radians.\r\n *\r\n * @function Phaser.Math.DegToRad\r\n * @since 3.0.0\r\n *\r\n * @param {integer} degrees - The angle (in degrees) to convert to radians.\r\n *\r\n * @return {number} The given angle converted to radians.\r\n */\r\nvar DegToRad = function (degrees)\r\n{\r\n return degrees * CONST.DEG_TO_RAD;\r\n};\r\n\r\nmodule.exports = DegToRad;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the positive difference of two given numbers.\r\n *\r\n * @function Phaser.Math.Difference\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first number in the calculation.\r\n * @param {number} b - The second number in the calculation.\r\n *\r\n * @return {number} The positive difference of the two given numbers.\r\n */\r\nvar Difference = function (a, b)\r\n{\r\n return Math.abs(a - b);\r\n};\r\n\r\nmodule.exports = Difference;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the factorial of a given number for integer values greater than 0.\r\n *\r\n * @function Phaser.Math.Factorial\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - A positive integer to calculate the factorial of.\r\n *\r\n * @return {number} The factorial of the given number.\r\n */\r\nvar Factorial = function (value)\r\n{\r\n if (value === 0)\r\n {\r\n return 1;\r\n }\r\n\r\n var res = value;\r\n\r\n while (--value)\r\n {\r\n res *= value;\r\n }\r\n\r\n return res;\r\n};\r\n\r\nmodule.exports = Factorial;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive.\r\n *\r\n * @function Phaser.Math.FloatBetween\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The lower bound for the float, inclusive.\r\n * @param {number} max - The upper bound for the float exclusive.\r\n *\r\n * @return {number} A random float within the given range.\r\n */\r\nvar FloatBetween = function (min, max)\r\n{\r\n return Math.random() * (max - min) + min;\r\n};\r\n\r\nmodule.exports = FloatBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Floors to some place comparative to a `base`, default is 10 for decimal place.\r\n *\r\n * The `place` is represented by the power applied to `base` to get that place.\r\n *\r\n * @function Phaser.Math.FloorTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {integer} [place=0] - The place to round to.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar FloorTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.floor(value * p) / p;\r\n};\r\n\r\nmodule.exports = FloorTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = require('./Clamp');\r\n\r\n/**\r\n * Return a value based on the range between `min` and `max` and the percentage given.\r\n *\r\n * @function Phaser.Math.FromPercent\r\n * @since 3.0.0\r\n *\r\n * @param {number} percent - A value between 0 and 1 representing the percentage.\r\n * @param {number} min - The minimum value.\r\n * @param {number} [max] - The maximum value.\r\n *\r\n * @return {number} The value that is `percent` percent between `min` and `max`.\r\n */\r\nvar FromPercent = function (percent, min, max)\r\n{\r\n percent = Clamp(percent, 0, 1);\r\n\r\n return (max - min) * percent;\r\n};\r\n\r\nmodule.exports = FromPercent;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the speed required to cover a distance in the time given.\r\n *\r\n * @function Phaser.Math.GetSpeed\r\n * @since 3.0.0\r\n *\r\n * @param {number} distance - The distance to travel in pixels.\r\n * @param {integer} time - The time, in ms, to cover the distance in.\r\n *\r\n * @return {number} The amount you will need to increment the position by each step in order to cover the distance in the time given.\r\n */\r\nvar GetSpeed = function (distance, time)\r\n{\r\n return (distance / time) / 1000;\r\n};\r\n\r\nmodule.exports = GetSpeed;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check if a given value is an even number.\r\n *\r\n * @function Phaser.Math.IsEven\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to perform the check with.\r\n *\r\n * @return {boolean} Whether the number is even or not.\r\n */\r\nvar IsEven = function (value)\r\n{\r\n // Use abstract equality == for \"is number\" test\r\n\r\n // eslint-disable-next-line eqeqeq\r\n return (value == parseFloat(value)) ? !(value % 2) : void 0;\r\n};\r\n\r\nmodule.exports = IsEven;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check if a given value is an even number using a strict type check.\r\n *\r\n * @function Phaser.Math.IsEvenStrict\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to perform the check with.\r\n *\r\n * @return {boolean} Whether the number is even or not.\r\n */\r\nvar IsEvenStrict = function (value)\r\n{\r\n // Use strict equality === for \"is number\" test\r\n return (value === parseFloat(value)) ? !(value % 2) : void 0;\r\n};\r\n\r\nmodule.exports = IsEvenStrict;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates a linear (interpolation) value over t.\r\n *\r\n * @function Phaser.Math.Linear\r\n * @since 3.0.0\r\n *\r\n * @param {number} p0 - The first point.\r\n * @param {number} p1 - The second point.\r\n * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1.\r\n *\r\n * @return {number} The step t% of the way between p0 and p1.\r\n */\r\nvar Linear = function (p0, p1, t)\r\n{\r\n return (p1 - p0) * t + p0;\r\n};\r\n\r\nmodule.exports = Linear;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A three-dimensional matrix.\r\n *\r\n * Defaults to the identity matrix when instantiated.\r\n *\r\n * @class Matrix3\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from.\r\n */\r\nvar Matrix3 = new Class({\r\n\r\n initialize:\r\n\r\n function Matrix3 (m)\r\n {\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.Math.Matrix3#val\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.val = new Float32Array(9);\r\n\r\n if (m)\r\n {\r\n // Assume Matrix3 with val:\r\n this.copy(m);\r\n }\r\n else\r\n {\r\n // Default to identity\r\n this.identity();\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Matrix3.\r\n *\r\n * @method Phaser.Math.Matrix3#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} A clone of this Matrix3.\r\n */\r\n clone: function ()\r\n {\r\n return new Matrix3(this);\r\n },\r\n\r\n /**\r\n * This method is an alias for `Matrix3.copy`.\r\n *\r\n * @method Phaser.Math.Matrix3#set\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n set: function (src)\r\n {\r\n return this.copy(src);\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix into this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n copy: function (src)\r\n {\r\n var out = this.val;\r\n var a = src.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix4 into this Matrix3.\r\n *\r\n * @method Phaser.Math.Matrix3#fromMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromMat4: function (m)\r\n {\r\n var a = m.val;\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given array.\r\n *\r\n * @method Phaser.Math.Matrix3#fromArray\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The array to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromArray: function (a)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n identity: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transpose this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#transpose\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n transpose: function ()\r\n {\r\n var a = this.val;\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a12 = a[5];\r\n\r\n a[1] = a[3];\r\n a[2] = a[6];\r\n a[3] = a01;\r\n a[5] = a[7];\r\n a[6] = a02;\r\n a[7] = a12;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n invert: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n var b01 = a22 * a11 - a12 * a21;\r\n var b11 = -a22 * a10 + a12 * a20;\r\n var b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n var det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n a[0] = b01 * det;\r\n a[1] = (-a22 * a01 + a02 * a21) * det;\r\n a[2] = (a12 * a01 - a02 * a11) * det;\r\n a[3] = b11 * det;\r\n a[4] = (a22 * a00 - a02 * a20) * det;\r\n a[5] = (-a12 * a00 + a02 * a10) * det;\r\n a[6] = b21 * det;\r\n a[7] = (-a21 * a00 + a01 * a20) * det;\r\n a[8] = (a11 * a00 - a01 * a10) * det;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the adjoint, or adjugate, of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#adjoint\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n adjoint: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n a[0] = (a11 * a22 - a12 * a21);\r\n a[1] = (a02 * a21 - a01 * a22);\r\n a[2] = (a01 * a12 - a02 * a11);\r\n a[3] = (a12 * a20 - a10 * a22);\r\n a[4] = (a00 * a22 - a02 * a20);\r\n a[5] = (a02 * a10 - a00 * a12);\r\n a[6] = (a10 * a21 - a11 * a20);\r\n a[7] = (a01 * a20 - a00 * a21);\r\n a[8] = (a00 * a11 - a01 * a10);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the determinant of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#determinant\r\n * @since 3.0.0\r\n *\r\n * @return {number} The determinant of this Matrix.\r\n */\r\n determinant: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n multiply: function (src)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n var b = src.val;\r\n\r\n var b00 = b[0];\r\n var b01 = b[1];\r\n var b02 = b[2];\r\n var b10 = b[3];\r\n var b11 = b[4];\r\n var b12 = b[5];\r\n var b20 = b[6];\r\n var b21 = b[7];\r\n var b22 = b[8];\r\n\r\n a[0] = b00 * a00 + b01 * a10 + b02 * a20;\r\n a[1] = b00 * a01 + b01 * a11 + b02 * a21;\r\n a[2] = b00 * a02 + b01 * a12 + b02 * a22;\r\n\r\n a[3] = b10 * a00 + b11 * a10 + b12 * a20;\r\n a[4] = b10 * a01 + b11 * a11 + b12 * a21;\r\n a[5] = b10 * a02 + b11 * a12 + b12 * a22;\r\n\r\n a[6] = b20 * a00 + b21 * a10 + b22 * a20;\r\n a[7] = b20 * a01 + b21 * a11 + b22 * a21;\r\n a[8] = b20 * a02 + b21 * a12 + b22 * a22;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given Vector.\r\n *\r\n * @method Phaser.Math.Matrix3#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n translate: function (v)\r\n {\r\n var a = this.val;\r\n var x = v.x;\r\n var y = v.y;\r\n\r\n a[6] = x * a[0] + y * a[3] + a[6];\r\n a[7] = x * a[1] + y * a[4] + a[7];\r\n a[8] = x * a[2] + y * a[5] + a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a rotation transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n rotate: function (rad)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n a[0] = c * a00 + s * a10;\r\n a[1] = c * a01 + s * a11;\r\n a[2] = c * a02 + s * a12;\r\n\r\n a[3] = c * a10 - s * a00;\r\n a[4] = c * a11 - s * a01;\r\n a[5] = c * a12 - s * a02;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * Uses the `x` and `y` components of the given Vector to scale the Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#scale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n scale: function (v)\r\n {\r\n var a = this.val;\r\n var x = v.x;\r\n var y = v.y;\r\n\r\n a[0] = x * a[0];\r\n a[1] = x * a[1];\r\n a[2] = x * a[2];\r\n\r\n a[3] = y * a[3];\r\n a[4] = y * a[4];\r\n a[5] = y * a[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given Quaternion.\r\n *\r\n * @method Phaser.Math.Matrix3#fromQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromQuat: function (q)\r\n {\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n var out = this.val;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[3] = xy + wz;\r\n out[6] = xz - wy;\r\n\r\n out[1] = xy - wz;\r\n out[4] = 1 - (xx + zz);\r\n out[7] = yz + wx;\r\n\r\n out[2] = xz + wy;\r\n out[5] = yz - wx;\r\n out[8] = 1 - (xx + yy);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Matrix3#normalFromMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} m - [description]\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n normalFromMat4: function (m)\r\n {\r\n var a = m.val;\r\n var out = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Matrix3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\nvar EPSILON = 0.000001;\r\n\r\n/**\r\n * @classdesc\r\n * A four-dimensional matrix.\r\n *\r\n * @class Matrix4\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from.\r\n */\r\nvar Matrix4 = new Class({\r\n\r\n initialize:\r\n\r\n function Matrix4 (m)\r\n {\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.Math.Matrix4#val\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.val = new Float32Array(16);\r\n\r\n if (m)\r\n {\r\n // Assume Matrix4 with val:\r\n this.copy(m);\r\n }\r\n else\r\n {\r\n // Default to identity\r\n this.identity();\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Matrix4.\r\n *\r\n * @method Phaser.Math.Matrix4#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} A clone of this Matrix4.\r\n */\r\n clone: function ()\r\n {\r\n return new Matrix4(this);\r\n },\r\n\r\n // TODO - Should work with basic values\r\n\r\n /**\r\n * This method is an alias for `Matrix4.copy`.\r\n *\r\n * @method Phaser.Math.Matrix4#set\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n set: function (src)\r\n {\r\n return this.copy(src);\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix into this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n copy: function (src)\r\n {\r\n var out = this.val;\r\n var a = src.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given array.\r\n *\r\n * @method Phaser.Math.Matrix4#fromArray\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The array to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromArray: function (a)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix.\r\n *\r\n * Sets all values to `0`.\r\n *\r\n * @method Phaser.Math.Matrix4#zero\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n zero: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 0;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x`, `y` and `z` values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#xyz\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n * @param {number} z - The z value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n xyz: function (x, y, z)\r\n {\r\n this.identity();\r\n\r\n var out = this.val;\r\n\r\n out[12] = x;\r\n out[13] = y;\r\n out[14] = z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the scaling values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaling\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x scaling value.\r\n * @param {number} y - The y scaling value.\r\n * @param {number} z - The z scaling value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaling: function (x, y, z)\r\n {\r\n this.zero();\r\n\r\n var out = this.val;\r\n\r\n out[0] = x;\r\n out[5] = y;\r\n out[10] = z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n identity: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transpose this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#transpose\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n transpose: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n var a23 = a[11];\r\n\r\n a[1] = a[4];\r\n a[2] = a[8];\r\n a[3] = a[12];\r\n a[4] = a01;\r\n a[6] = a[9];\r\n a[7] = a[13];\r\n a[8] = a02;\r\n a[9] = a12;\r\n a[11] = a[14];\r\n a[12] = a03;\r\n a[13] = a13;\r\n a[14] = a23;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n invert: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the adjoint, or adjugate, of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#adjoint\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n adjoint: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22));\r\n a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\r\n a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12));\r\n a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\r\n a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\r\n a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22));\r\n a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\r\n a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12));\r\n a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21));\r\n a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\r\n a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11));\r\n a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\r\n a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\r\n a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21));\r\n a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\r\n a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11));\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the determinant of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#determinant\r\n * @since 3.0.0\r\n *\r\n * @return {number} The determinant of this Matrix.\r\n */\r\n determinant: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiply: function (src)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b = src.val;\r\n\r\n // Cache only the current line of the second matrix\r\n var b0 = b[0];\r\n var b1 = b[1];\r\n var b2 = b[2];\r\n var b3 = b[3];\r\n\r\n a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n\r\n a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n\r\n a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n\r\n a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Matrix4#multiplyLocal\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - [description]\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiplyLocal: function (src)\r\n {\r\n var a = [];\r\n var m1 = this.val;\r\n var m2 = src.val;\r\n\r\n a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12];\r\n a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13];\r\n a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14];\r\n a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15];\r\n\r\n a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12];\r\n a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13];\r\n a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14];\r\n a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15];\r\n\r\n a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12];\r\n a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13];\r\n a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14];\r\n a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15];\r\n\r\n a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12];\r\n a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13];\r\n a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14];\r\n a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15];\r\n\r\n return this.fromArray(a);\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translate: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given values.\r\n *\r\n * @method Phaser.Math.Matrix4#translateXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translateXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scale: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaleXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaleXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Derive a rotation matrix around the given axis.\r\n *\r\n * @method Phaser.Math.Matrix4#makeRotationAxis\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis.\r\n * @param {number} angle - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n makeRotationAxis: function (axis, angle)\r\n {\r\n // Based on http://www.gamedev.net/reference/articles/article1199.asp\r\n\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n var t = 1 - c;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var tx = t * x;\r\n var ty = t * y;\r\n\r\n this.fromArray([\r\n tx * x + c, tx * y - s * z, tx * z + s * y, 0,\r\n tx * y + s * z, ty * y + c, ty * z - s * x, 0,\r\n tx * z - s * y, ty * z + s * x, t * z * z + c, 0,\r\n 0, 0, 0, 1\r\n ]);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a rotation transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n * @param {Phaser.Math.Vector3} axis - The axis to rotate upon.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotate: function (rad, axis)\r\n {\r\n var a = this.val;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (Math.abs(len) < EPSILON)\r\n {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n var t = 1 - c;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n var b00 = x * x * t + c;\r\n var b01 = y * x * t + z * s;\r\n var b02 = z * x * t - y * s;\r\n\r\n var b10 = x * y * t - z * s;\r\n var b11 = y * y * t + c;\r\n var b12 = z * y * t + x * s;\r\n\r\n var b20 = x * z * t + y * s;\r\n var b21 = y * z * t - x * s;\r\n var b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n a[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n a[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n a[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n a[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n a[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n a[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n a[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n a[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n a[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n a[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n a[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n a[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its X axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateX: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[4] = a10 * c + a20 * s;\r\n a[5] = a11 * c + a21 * s;\r\n a[6] = a12 * c + a22 * s;\r\n a[7] = a13 * c + a23 * s;\r\n a[8] = a20 * c - a10 * s;\r\n a[9] = a21 * c - a11 * s;\r\n a[10] = a22 * c - a12 * s;\r\n a[11] = a23 * c - a13 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Y axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateY: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c - a20 * s;\r\n a[1] = a01 * c - a21 * s;\r\n a[2] = a02 * c - a22 * s;\r\n a[3] = a03 * c - a23 * s;\r\n a[8] = a00 * s + a20 * c;\r\n a[9] = a01 * s + a21 * c;\r\n a[10] = a02 * s + a22 * c;\r\n a[11] = a03 * s + a23 * c;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Z axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateZ: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c + a10 * s;\r\n a[1] = a01 * c + a11 * s;\r\n a[2] = a02 * c + a12 * s;\r\n a[3] = a03 * c + a13 * s;\r\n a[4] = a10 * c - a00 * s;\r\n a[5] = a11 * c - a01 * s;\r\n a[6] = a12 * c - a02 * s;\r\n a[7] = a13 * c - a03 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given rotation Quaternion and translation Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#fromRotationTranslation\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from.\r\n * @param {Phaser.Math.Vector3} v - The Vector to set translation from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromRotationTranslation: function (q, v)\r\n {\r\n // Quaternion math\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = v.x;\r\n out[13] = v.y;\r\n out[14] = v.z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given Quaternion.\r\n *\r\n * @method Phaser.Math.Matrix4#fromQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromQuat: function (q)\r\n {\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a frustum matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#frustum\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n frustum: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n\r\n var rl = 1 / (right - left);\r\n var tb = 1 / (top - bottom);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = (near * 2) * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (near * 2) * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (far * near * 2) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspective\r\n * @since 3.0.0\r\n *\r\n * @param {number} fovy - Vertical field of view in radians\r\n * @param {number} aspect - Aspect ratio. Typically viewport width /height.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspective: function (fovy, aspect, near, far)\r\n {\r\n var out = this.val;\r\n var f = 1.0 / Math.tan(fovy / 2);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (2 * far * near) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspectiveLH\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of the frustum.\r\n * @param {number} height - The height of the frustum.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspectiveLH: function (width, height, near, far)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = (2 * near) / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (2 * near) / height;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = -far / (near - far);\r\n out[11] = 1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (near * far) / (near - far);\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate an orthogonal projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#ortho\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n ortho: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n var lr = left - right;\r\n var bt = bottom - top;\r\n var nf = near - far;\r\n\r\n // Avoid division by zero\r\n lr = (lr === 0) ? lr : 1 / lr;\r\n bt = (bt === 0) ? bt : 1 / bt;\r\n nf = (nf === 0) ? nf : 1 / nf;\r\n\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a look-at matrix with the given eye position, focal point, and up axis.\r\n *\r\n * @method Phaser.Math.Matrix4#lookAt\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} eye - Position of the viewer\r\n * @param {Phaser.Math.Vector3} center - Point the viewer is looking at\r\n * @param {Phaser.Math.Vector3} up - vec3 pointing up.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n lookAt: function (eye, center, up)\r\n {\r\n var out = this.val;\r\n\r\n var eyex = eye.x;\r\n var eyey = eye.y;\r\n var eyez = eye.z;\r\n\r\n var upx = up.x;\r\n var upy = up.y;\r\n var upz = up.z;\r\n\r\n var centerx = center.x;\r\n var centery = center.y;\r\n var centerz = center.z;\r\n\r\n if (Math.abs(eyex - centerx) < EPSILON &&\r\n Math.abs(eyey - centery) < EPSILON &&\r\n Math.abs(eyez - centerz) < EPSILON)\r\n {\r\n return this.identity();\r\n }\r\n\r\n var z0 = eyex - centerx;\r\n var z1 = eyey - centery;\r\n var z2 = eyez - centerz;\r\n\r\n var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n var x0 = upy * z2 - upz * z1;\r\n var x1 = upz * z0 - upx * z2;\r\n var x2 = upx * z1 - upy * z0;\r\n\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n\r\n if (!len)\r\n {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n var y0 = z1 * x2 - z2 * x1;\r\n var y1 = z2 * x0 - z0 * x2;\r\n var y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n\r\n if (!len)\r\n {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values.\r\n *\r\n * @method Phaser.Math.Matrix4#yawPitchRoll\r\n * @since 3.0.0\r\n *\r\n * @param {number} yaw - [description]\r\n * @param {number} pitch - [description]\r\n * @param {number} roll - [description]\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n yawPitchRoll: function (yaw, pitch, roll)\r\n {\r\n this.zero();\r\n _tempMat1.zero();\r\n _tempMat2.zero();\r\n\r\n var m0 = this.val;\r\n var m1 = _tempMat1.val;\r\n var m2 = _tempMat2.val;\r\n\r\n // Rotate Z\r\n var s = Math.sin(roll);\r\n var c = Math.cos(roll);\r\n\r\n m0[10] = 1;\r\n m0[15] = 1;\r\n m0[0] = c;\r\n m0[1] = s;\r\n m0[4] = -s;\r\n m0[5] = c;\r\n\r\n // Rotate X\r\n s = Math.sin(pitch);\r\n c = Math.cos(pitch);\r\n\r\n m1[0] = 1;\r\n m1[15] = 1;\r\n m1[5] = c;\r\n m1[10] = c;\r\n m1[9] = -s;\r\n m1[6] = s;\r\n\r\n // Rotate Y\r\n s = Math.sin(yaw);\r\n c = Math.cos(yaw);\r\n\r\n m2[5] = 1;\r\n m2[15] = 1;\r\n m2[0] = c;\r\n m2[2] = -s;\r\n m2[8] = s;\r\n m2[10] = c;\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#setWorldMatrix\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix.\r\n * @param {Phaser.Math.Vector3} position - The position of the world matrix.\r\n * @param {Phaser.Math.Vector3} scale - The scale of the world matrix.\r\n * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix.\r\n * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix)\r\n {\r\n this.yawPitchRoll(rotation.y, rotation.x, rotation.z);\r\n\r\n _tempMat1.scaling(scale.x, scale.y, scale.z);\r\n _tempMat2.xyz(position.x, position.y, position.z);\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n if (viewMatrix !== undefined)\r\n {\r\n this.multiplyLocal(viewMatrix);\r\n }\r\n\r\n if (projectionMatrix !== undefined)\r\n {\r\n this.multiplyLocal(projectionMatrix);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nvar _tempMat1 = new Matrix4();\r\nvar _tempMat2 = new Matrix4();\r\n\r\nmodule.exports = Matrix4;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Add an `amount` to a `value`, limiting the maximum result to `max`.\r\n *\r\n * @function Phaser.Math.MaxAdd\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to add to.\r\n * @param {number} amount - The amount to add.\r\n * @param {number} max - The maximum value to return.\r\n *\r\n * @return {number} The resulting value.\r\n */\r\nvar MaxAdd = function (value, amount, max)\r\n{\r\n return Math.min(value + amount, max);\r\n};\r\n\r\nmodule.exports = MaxAdd;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Subtract an `amount` from `value`, limiting the minimum result to `min`.\r\n *\r\n * @function Phaser.Math.MinSub\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to subtract from.\r\n * @param {number} amount - The amount to subtract.\r\n * @param {number} min - The minimum value to return.\r\n *\r\n * @return {number} The resulting value.\r\n */\r\nvar MinSub = function (value, amount, min)\r\n{\r\n return Math.max(value - amount, min);\r\n};\r\n\r\nmodule.exports = MinSub;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Work out what percentage `value` is of the range between `min` and `max`.\r\n * If `max` isn't given then it will return the percentage of `value` to `min`.\r\n *\r\n * 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.\r\n *\r\n * @function Phaser.Math.Percent\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to determine the percentage of.\r\n * @param {number} min - The minimum value.\r\n * @param {number} [max] - The maximum value.\r\n * @param {number} [upperMax] - The mid-way point in the range that represents 100%.\r\n *\r\n * @return {number} A value between 0 and 1 representing the percentage.\r\n */\r\nvar Percent = function (value, min, max, upperMax)\r\n{\r\n if (max === undefined) { max = min + 1; }\r\n\r\n var percentage = (value - min) / (max - min);\r\n\r\n if (percentage > 1)\r\n {\r\n if (upperMax !== undefined)\r\n {\r\n percentage = ((upperMax - value)) / (upperMax - max);\r\n\r\n if (percentage < 0)\r\n {\r\n percentage = 0;\r\n }\r\n }\r\n else\r\n {\r\n percentage = 1;\r\n }\r\n }\r\n else if (percentage < 0)\r\n {\r\n percentage = 0;\r\n }\r\n\r\n return percentage;\r\n};\r\n\r\nmodule.exports = Percent;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\nvar Vector3 = require('./Vector3');\r\nvar Matrix3 = require('./Matrix3');\r\n\r\nvar EPSILON = 0.000001;\r\n\r\n// Some shared 'private' arrays\r\nvar siNext = new Int8Array([ 1, 2, 0 ]);\r\nvar tmp = new Float32Array([ 0, 0, 0 ]);\r\n\r\nvar xUnitVec3 = new Vector3(1, 0, 0);\r\nvar yUnitVec3 = new Vector3(0, 1, 0);\r\n\r\nvar tmpvec = new Vector3();\r\nvar tmpMat3 = new Matrix3();\r\n\r\n/**\r\n * @classdesc\r\n * A quaternion.\r\n *\r\n * @class Quaternion\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n * @param {number} [w] - The w component.\r\n */\r\nvar Quaternion = new Class({\r\n\r\n initialize:\r\n\r\n function Quaternion (x, y, z, w)\r\n {\r\n /**\r\n * The x component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The y component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The z component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The w component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Copy the components of a given Quaternion or Vector into this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#copy\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z;\r\n this.w = src.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the components of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components.\r\n * @param {number} [y=0] - The y component.\r\n * @param {number} [z=0] - The z component.\r\n * @param {number} [w=0] - The w component.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n set: function (x, y, z, w)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Quaternion#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z;\r\n this.w += v.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Quaternion#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z;\r\n this.w -= v.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Quaternion by the given value.\r\n *\r\n * @method Phaser.Math.Quaternion#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Quaternion by.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n scale: function (scale)\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the length of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Quaternion.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Quaternion squared.\r\n *\r\n * @method Phaser.Math.Quaternion#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Quaternion, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n },\r\n\r\n /**\r\n * Normalize this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var len = x * x + y * y + z * z + w * w;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n this.w = w * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Quaternion and the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#dot\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion.\r\n *\r\n * @return {number} The dot product of this Quaternion and the given Quaternion or Vector.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\r\n },\r\n\r\n /**\r\n * Linearly interpolate this Quaternion towards the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards.\r\n * @param {number} [t=0] - The percentage of interpolation.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n this.w = aw + t * (v.w - aw);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Quaternion#rotationTo\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} a - [description]\r\n * @param {Phaser.Math.Vector3} b - [description]\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotationTo: function (a, b)\r\n {\r\n var dot = a.x * b.x + a.y * b.y + a.z * b.z;\r\n\r\n if (dot < -0.999999)\r\n {\r\n if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON)\r\n {\r\n tmpvec.copy(yUnitVec3).cross(a);\r\n }\r\n\r\n tmpvec.normalize();\r\n\r\n return this.setAxisAngle(tmpvec, Math.PI);\r\n\r\n }\r\n else if (dot > 0.999999)\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 1;\r\n\r\n return this;\r\n }\r\n else\r\n {\r\n tmpvec.copy(a).cross(b);\r\n\r\n this.x = tmpvec.x;\r\n this.y = tmpvec.y;\r\n this.z = tmpvec.z;\r\n this.w = 1 + dot;\r\n\r\n return this.normalize();\r\n }\r\n },\r\n\r\n /**\r\n * Set the axes of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#setAxes\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} view - The view axis.\r\n * @param {Phaser.Math.Vector3} right - The right axis.\r\n * @param {Phaser.Math.Vector3} up - The upwards axis.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n setAxes: function (view, right, up)\r\n {\r\n var m = tmpMat3.val;\r\n\r\n m[0] = right.x;\r\n m[3] = right.y;\r\n m[6] = right.z;\r\n\r\n m[1] = up.x;\r\n m[4] = up.y;\r\n m[7] = up.z;\r\n\r\n m[2] = -view.x;\r\n m[5] = -view.y;\r\n m[8] = -view.z;\r\n\r\n return this.fromMat3(tmpMat3).normalize();\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n identity: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the axis angle of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#setAxisAngle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} axis - The axis.\r\n * @param {number} rad - The angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n setAxisAngle: function (axis, rad)\r\n {\r\n rad = rad * 0.5;\r\n\r\n var s = Math.sin(rad);\r\n\r\n this.x = s * axis.x;\r\n this.y = s * axis.y;\r\n this.z = s * axis.z;\r\n this.w = Math.cos(rad);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply this Quaternion by the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n multiply: function (b)\r\n {\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n var bw = b.w;\r\n\r\n this.x = ax * bw + aw * bx + ay * bz - az * by;\r\n this.y = ay * bw + aw * by + az * bx - ax * bz;\r\n this.z = az * bw + aw * bz + ax * by - ay * bx;\r\n this.w = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#slerp\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards.\r\n * @param {number} t - The percentage of interpolation.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n slerp: function (b, t)\r\n {\r\n // benchmarks: http://jsperf.com/quaternion-slerp-implementations\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n var bw = b.w;\r\n\r\n // calc cosine\r\n var cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n\r\n // adjust signs (if necessary)\r\n if (cosom < 0)\r\n {\r\n cosom = -cosom;\r\n bx = - bx;\r\n by = - by;\r\n bz = - bz;\r\n bw = - bw;\r\n }\r\n\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n var scale0 = 1 - t;\r\n var scale1 = t;\r\n\r\n // calculate coefficients\r\n if ((1 - cosom) > EPSILON)\r\n {\r\n // standard case (slerp)\r\n var omega = Math.acos(cosom);\r\n var sinom = Math.sin(omega);\r\n\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n }\r\n\r\n // calculate final values\r\n this.x = scale0 * ax + scale1 * bx;\r\n this.y = scale0 * ay + scale1 * by;\r\n this.z = scale0 * az + scale1 * bz;\r\n this.w = scale0 * aw + scale1 * bw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n invert: function ()\r\n {\r\n var a0 = this.x;\r\n var a1 = this.y;\r\n var a2 = this.z;\r\n var a3 = this.w;\r\n\r\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n var invDot = (dot) ? 1 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n this.x = -a0 * invDot;\r\n this.y = -a1 * invDot;\r\n this.z = -a2 * invDot;\r\n this.w = a3 * invDot;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Convert this Quaternion into its conjugate.\r\n *\r\n * Sets the x, y and z components.\r\n *\r\n * @method Phaser.Math.Quaternion#conjugate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n conjugate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the X axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateX: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw + aw * bx;\r\n this.y = ay * bw + az * bx;\r\n this.z = az * bw - ay * bx;\r\n this.w = aw * bw - ax * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the Y axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateY: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var by = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw - az * by;\r\n this.y = ay * bw + aw * by;\r\n this.z = az * bw + ax * by;\r\n this.w = aw * bw - ay * by;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the Z axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateZ: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bz = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw + ay * bz;\r\n this.y = ay * bw - ax * bz;\r\n this.z = az * bw + aw * bz;\r\n this.w = aw * bw - az * bz;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Create a unit (or rotation) Quaternion from its x, y, and z components.\r\n *\r\n * Sets the w component.\r\n *\r\n * @method Phaser.Math.Quaternion#calculateW\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n calculateW: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n this.w = -Math.sqrt(1.0 - x * x - y * y - z * z);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Convert the given Matrix into this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#fromMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n fromMat3: function (mat)\r\n {\r\n // benchmarks:\r\n // http://jsperf.com/typed-array-access-speed\r\n // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion\r\n\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n var m = mat.val;\r\n var fTrace = m[0] + m[4] + m[8];\r\n var fRoot;\r\n\r\n if (fTrace > 0)\r\n {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n\r\n this.w = 0.5 * fRoot;\r\n\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n\r\n this.x = (m[7] - m[5]) * fRoot;\r\n this.y = (m[2] - m[6]) * fRoot;\r\n this.z = (m[3] - m[1]) * fRoot;\r\n }\r\n else\r\n {\r\n // |w| <= 1/2\r\n var i = 0;\r\n\r\n if (m[4] > m[0])\r\n {\r\n i = 1;\r\n }\r\n\r\n if (m[8] > m[i * 3 + i])\r\n {\r\n i = 2;\r\n }\r\n\r\n var j = siNext[i];\r\n var k = siNext[j];\r\n\r\n // This isn't quite as clean without array access\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\r\n tmp[i] = 0.5 * fRoot;\r\n\r\n fRoot = 0.5 / fRoot;\r\n\r\n tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n\r\n this.x = tmp[0];\r\n this.y = tmp[1];\r\n this.z = tmp[2];\r\n this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Quaternion;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\n\r\n/**\r\n * Convert the given angle in radians, to the equivalent angle in degrees.\r\n *\r\n * @function Phaser.Math.RadToDeg\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The angle in radians to convert ot degrees.\r\n *\r\n * @return {integer} The given angle converted to degrees.\r\n */\r\nvar RadToDeg = function (radians)\r\n{\r\n return radians * CONST.RAD_TO_DEG;\r\n};\r\n\r\nmodule.exports = RadToDeg;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random unit vector.\r\n *\r\n * Computes random values for the given vector between -1 and 1 that can be used to represent a direction.\r\n *\r\n * Optionally accepts a scale value to scale the resulting vector by.\r\n *\r\n * @function Phaser.Math.RandomXY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for.\r\n * @param {number} [scale=1] - The scale of the random values.\r\n *\r\n * @return {Phaser.Math.Vector2} The given Vector.\r\n */\r\nvar RandomXY = function (vector, scale)\r\n{\r\n if (scale === undefined) { scale = 1; }\r\n\r\n var r = Math.random() * 2 * Math.PI;\r\n\r\n vector.x = Math.cos(r) * scale;\r\n vector.y = Math.sin(r) * scale;\r\n\r\n return vector;\r\n};\r\n\r\nmodule.exports = RandomXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random position vector in a spherical area, optionally defined by the given radius.\r\n *\r\n * @function Phaser.Math.RandomXYZ\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for.\r\n * @param {number} [radius=1] - The radius.\r\n *\r\n * @return {Phaser.Math.Vector3} The given Vector.\r\n */\r\nvar RandomXYZ = function (vec3, radius)\r\n{\r\n if (radius === undefined) { radius = 1; }\r\n\r\n var r = Math.random() * 2 * Math.PI;\r\n var z = (Math.random() * 2) - 1;\r\n var zScale = Math.sqrt(1 - z * z) * radius;\r\n\r\n vec3.x = Math.cos(r) * zScale;\r\n vec3.y = Math.sin(r) * zScale;\r\n vec3.z = z * radius;\r\n\r\n return vec3;\r\n};\r\n\r\nmodule.exports = RandomXYZ;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random four-dimensional vector.\r\n *\r\n * @function Phaser.Math.RandomXYZW\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for.\r\n * @param {number} [scale=1] - The scale of the random values.\r\n *\r\n * @return {Phaser.Math.Vector4} The given Vector.\r\n */\r\nvar RandomXYZW = function (vec4, scale)\r\n{\r\n if (scale === undefined) { scale = 1; }\r\n\r\n // TODO: Not spherical; should fix this for more uniform distribution\r\n vec4.x = (Math.random() * 2 - 1) * scale;\r\n vec4.y = (Math.random() * 2 - 1) * scale;\r\n vec4.z = (Math.random() * 2 - 1) * scale;\r\n vec4.w = (Math.random() * 2 - 1) * scale;\r\n\r\n return vec4;\r\n};\r\n\r\nmodule.exports = RandomXYZW;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction.\r\n *\r\n * @function Phaser.Math.Rotate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} angle - The angle to be rotated by in an anticlockwise direction.\r\n *\r\n * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction.\r\n */\r\nvar Rotate = function (point, angle)\r\n{\r\n var x = point.x;\r\n var y = point.y;\r\n\r\n point.x = (x * Math.cos(angle)) - (y * Math.sin(angle));\r\n point.y = (x * Math.sin(angle)) + (y * Math.cos(angle));\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = Rotate;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a `point` around `x` and `y` by the given `angle`.\r\n *\r\n * @function Phaser.Math.RotateAround\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} x - The horizontal coordinate to rotate around.\r\n * @param {number} y - The vertical coordinate to rotate around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Geom.Point} The given point, rotated by the given angle around the given coordinates.\r\n */\r\nvar RotateAround = function (point, x, y, angle)\r\n{\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n\r\n var tx = point.x - x;\r\n var ty = point.y - y;\r\n\r\n point.x = tx * c - ty * s + x;\r\n point.y = tx * s + ty * c + y;\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = RotateAround;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a `point` around `x` and `y` by the given `angle` and `distance`.\r\n *\r\n * @function Phaser.Math.RotateAroundDistance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} x - The horizontal coordinate to rotate around.\r\n * @param {number} y - The vertical coordinate to rotate around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n * @param {number} distance - The distance from (x, y) to place the point at.\r\n *\r\n * @return {Phaser.Geom.Point} The given point.\r\n */\r\nvar RotateAroundDistance = function (point, x, y, angle, distance)\r\n{\r\n var t = angle + Math.atan2(point.y - y, point.x - x);\r\n\r\n point.x = x + (distance * Math.cos(t));\r\n point.y = y + (distance * Math.sin(t));\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = RotateAroundDistance;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector3 = require('../math/Vector3');\r\nvar Matrix4 = require('../math/Matrix4');\r\nvar Quaternion = require('../math/Quaternion');\r\n\r\nvar tmpMat4 = new Matrix4();\r\nvar tmpQuat = new Quaternion();\r\nvar tmpVec3 = new Vector3();\r\n\r\n/**\r\n * Rotates a vector in place by axis angle.\r\n *\r\n * This is the same as transforming a point by an\r\n * axis-angle quaternion, but it has higher precision.\r\n *\r\n * @function Phaser.Math.RotateVec3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec - The vector to be rotated.\r\n * @param {Phaser.Math.Vector3} axis - The axis to rotate around.\r\n * @param {number} radians - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Math.Vector3} The given vector.\r\n */\r\nvar RotateVec3 = function (vec, axis, radians)\r\n{\r\n // Set the quaternion to our axis angle\r\n tmpQuat.setAxisAngle(axis, radians);\r\n\r\n // Create a rotation matrix from the axis angle\r\n tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0));\r\n\r\n // Multiply our vector by the rotation matrix\r\n return vec.transformMat4(tmpMat4);\r\n};\r\n\r\nmodule.exports = RotateVec3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down.\r\n *\r\n * @function Phaser.Math.RoundAwayFromZero\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to round.\r\n *\r\n * @return {number} The rounded number, rounded away from zero.\r\n */\r\nvar RoundAwayFromZero = function (value)\r\n{\r\n // \"Opposite\" of truncate.\r\n return (value > 0) ? Math.ceil(value) : Math.floor(value);\r\n};\r\n\r\nmodule.exports = RoundAwayFromZero;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Round a value to the given precision.\r\n * \r\n * For example:\r\n * \r\n * ```javascript\r\n * RoundTo(123.456, 0) = 123\r\n * RoundTo(123.456, 1) = 120\r\n * RoundTo(123.456, 2) = 100\r\n * ```\r\n * \r\n * To round the decimal, i.e. to round to precision, pass in a negative `place`:\r\n * \r\n * ```javascript\r\n * RoundTo(123.456789, 0) = 123\r\n * RoundTo(123.456789, -1) = 123.5\r\n * RoundTo(123.456789, -2) = 123.46\r\n * RoundTo(123.456789, -3) = 123.457\r\n * ```\r\n *\r\n * @function Phaser.Math.RoundTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar RoundTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.round(value * p) / p;\r\n};\r\n\r\nmodule.exports = RoundTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Generate a series of sine and cosine values.\r\n *\r\n * @function Phaser.Math.SinCosTableGenerator\r\n * @since 3.0.0\r\n *\r\n * @param {number} length - The number of values to generate.\r\n * @param {number} [sinAmp=1] - The sine value amplitude.\r\n * @param {number} [cosAmp=1] - The cosine value amplitude.\r\n * @param {number} [frequency=1] - The frequency of the values.\r\n *\r\n * @return {Phaser.Types.Math.SinCosTable} The generated values.\r\n */\r\nvar SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency)\r\n{\r\n if (sinAmp === undefined) { sinAmp = 1; }\r\n if (cosAmp === undefined) { cosAmp = 1; }\r\n if (frequency === undefined) { frequency = 1; }\r\n\r\n frequency *= Math.PI / length;\r\n\r\n var cos = [];\r\n var sin = [];\r\n\r\n for (var c = 0; c < length; c++)\r\n {\r\n cosAmp -= sinAmp * frequency;\r\n sinAmp += cosAmp * frequency;\r\n\r\n cos[c] = cosAmp;\r\n sin[c] = sinAmp;\r\n }\r\n\r\n return {\r\n sin: sin,\r\n cos: cos,\r\n length: length\r\n };\r\n};\r\n\r\nmodule.exports = SinCosTableGenerator;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a smooth interpolation percentage of `x` between `min` and `max`.\r\n *\r\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\r\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\r\n * between 0 and 1 otherwise.\r\n *\r\n * @function Phaser.Math.SmoothStep\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\r\n *\r\n * @param {number} x - The input value.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The percentage of interpolation, between 0 and 1.\r\n */\r\nvar SmoothStep = function (x, min, max)\r\n{\r\n if (x <= min)\r\n {\r\n return 0;\r\n }\r\n\r\n if (x >= max)\r\n {\r\n return 1;\r\n }\r\n\r\n x = (x - min) / (max - min);\r\n\r\n return x * x * (3 - 2 * x);\r\n};\r\n\r\nmodule.exports = SmoothStep;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a smoother interpolation percentage of `x` between `min` and `max`.\r\n *\r\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\r\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\r\n * between 0 and 1 otherwise.\r\n *\r\n * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}.\r\n *\r\n * @function Phaser.Math.SmootherStep\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\r\n *\r\n * @param {number} x - The input value.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The percentage of interpolation, between 0 and 1.\r\n */\r\nvar SmootherStep = function (x, min, max)\r\n{\r\n x = Math.max(0, Math.min(1, (x - min) / (max - min)));\r\n\r\n return x * x * x * (x * (x * 6 - 15) + 10);\r\n};\r\n\r\nmodule.exports = SmootherStep;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = require('./Vector2');\r\n\r\n/**\r\n * Returns a Vec2 containing the x and y position of the given index in a `width` x `height` sized grid.\r\n * \r\n * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2.\r\n * \r\n * If the given index is out of range an empty Vec2 is returned.\r\n *\r\n * @function Phaser.Math.ToXY\r\n * @since 3.19.0\r\n *\r\n * @param {integer} index - The position within the grid to get the x/y value for.\r\n * @param {integer} width - The width of the grid.\r\n * @param {integer} height - The height of the grid.\r\n * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index.\r\n */\r\nvar ToXY = function (index, width, height, out)\r\n{\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var x = 0;\r\n var y = 0;\r\n var total = width * height;\r\n\r\n if (index > 0 && index <= total)\r\n {\r\n if (index > width - 1)\r\n {\r\n y = Math.floor(index / width);\r\n x = index - (y * width);\r\n }\r\n else\r\n {\r\n x = index;\r\n }\r\n\r\n out.set(x, y);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ToXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = require('./Vector2');\r\n\r\n/**\r\n * Takes the `x` and `y` coordinates and transforms them into the same space as\r\n * defined by the position, rotation and scale values.\r\n *\r\n * @function Phaser.Math.TransformXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to be transformed.\r\n * @param {number} y - The y coordinate to be transformed.\r\n * @param {number} positionX - Horizontal position of the transform point.\r\n * @param {number} positionY - Vertical position of the transform point.\r\n * @param {number} rotation - Rotation of the transform point, in radians.\r\n * @param {number} scaleX - Horizontal scale of the transform point.\r\n * @param {number} scaleY - Vertical scale of the transform point.\r\n * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point.\r\n */\r\nvar TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output)\r\n{\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var radianSin = Math.sin(rotation);\r\n var radianCos = Math.cos(rotation);\r\n\r\n // Rotate and Scale\r\n var a = radianCos * scaleX;\r\n var b = radianSin * scaleX;\r\n var c = -radianSin * scaleY;\r\n var d = radianCos * scaleY;\r\n\r\n // Invert\r\n var id = 1 / ((a * d) + (c * -b));\r\n\r\n output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id);\r\n output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id);\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = TransformXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 2D space.\r\n *\r\n * A two-component vector.\r\n *\r\n * @class Vector2\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties.\r\n * @param {number} [y] - The y component.\r\n */\r\nvar Vector2 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector2 (x, y)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n }\r\n else\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector2.\r\n *\r\n * @method Phaser.Math.Vector2#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} A clone of this Vector2.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector2(this.x, this.y);\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x || 0;\r\n this.y = src.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the component values of this Vector from a given Vector2Like object.\r\n *\r\n * @method Phaser.Math.Vector2#setFromObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setFromObject: function (obj)\r\n {\r\n this.x = obj.x || 0;\r\n this.y = obj.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x` and `y` components of the this Vector to the given `x` and `y` values.\r\n *\r\n * @method Phaser.Math.Vector2#set\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n set: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This method is an alias for `Vector2.set`.\r\n *\r\n * @method Phaser.Math.Vector2#setTo\r\n * @since 3.4.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setTo: function (x, y)\r\n {\r\n return this.set(x, y);\r\n },\r\n\r\n /**\r\n * Sets the `x` and `y` values of this object from a given polar coordinate.\r\n *\r\n * @method Phaser.Math.Vector2#setToPolar\r\n * @since 3.0.0\r\n *\r\n * @param {number} azimuth - The angular coordinate, in radians.\r\n * @param {number} [radius=1] - The radial coordinate (length).\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setToPolar: function (azimuth, radius)\r\n {\r\n if (radius == null) { radius = 1; }\r\n\r\n this.x = Math.cos(azimuth) * radius;\r\n this.y = Math.sin(azimuth) * radius;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict equality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector2#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} v - The vector to compare with this Vector.\r\n *\r\n * @return {boolean} Whether the given Vector is equal to this Vector.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y));\r\n },\r\n\r\n /**\r\n * Calculate the angle between this Vector and the positive x-axis, in radians.\r\n *\r\n * @method Phaser.Math.Vector2#angle\r\n * @since 3.0.0\r\n *\r\n * @return {number} The angle between this Vector, and the positive x-axis, given in radians.\r\n */\r\n angle: function ()\r\n {\r\n // computes the angle in radians with respect to the positive x-axis\r\n\r\n var angle = Math.atan2(this.y, this.x);\r\n\r\n if (angle < 0)\r\n {\r\n angle += 2 * Math.PI;\r\n }\r\n\r\n return angle;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#add\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n add: function (src)\r\n {\r\n this.x += src.x;\r\n this.y += src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n subtract: function (src)\r\n {\r\n this.x -= src.x;\r\n this.y -= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n multiply: function (src)\r\n {\r\n this.x *= src.x;\r\n this.y *= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector2#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n scale: function (value)\r\n {\r\n if (isFinite(value))\r\n {\r\n this.x *= value;\r\n this.y *= value;\r\n }\r\n else\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#divide\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n divide: function (src)\r\n {\r\n this.x /= src.x;\r\n this.y /= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Negate the `x` and `y` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#distance\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector2#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return dx * dx + dy * dy;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return Math.sqrt(x * x + y * y);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector2#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return x * x + y * y;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector2#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var len = x * x + y * y;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Right-hand normalize (make unit length) this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#normalizeRightHand\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalizeRightHand: function ()\r\n {\r\n var x = this.x;\r\n\r\n this.x = this.y * -1;\r\n this.y = x;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to dot product with this Vector2.\r\n *\r\n * @return {number} The dot product of this Vector and the given Vector.\r\n */\r\n dot: function (src)\r\n {\r\n return this.x * src.x + this.y * src.y;\r\n },\r\n\r\n /**\r\n * Calculate the cross product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#cross\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to cross with this Vector2.\r\n *\r\n * @return {number} The cross product of this Vector and the given Vector.\r\n */\r\n cross: function (src)\r\n {\r\n return this.x * src.y - this.y * src.x;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n lerp: function (src, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n\r\n this.x = ax + t * (src.x - ax);\r\n this.y = ay + t * (src.y - ay);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat3: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[3] * y + m[6];\r\n this.y = m[1] * x + m[4] * y + m[7];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[12];\r\n this.y = m[1] * x + m[5] * y + m[13];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0).\r\n *\r\n * @method Phaser.Math.Vector2#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A static zero Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ZERO\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.1.0\r\n */\r\nVector2.ZERO = new Vector2();\r\n\r\n/**\r\n * A static right Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.RIGHT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.RIGHT = new Vector2(1, 0);\r\n\r\n/**\r\n * A static left Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.LEFT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.LEFT = new Vector2(-1, 0);\r\n\r\n/**\r\n * A static up Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.UP\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.UP = new Vector2(0, -1);\r\n\r\n/**\r\n * A static down Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.DOWN\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.DOWN = new Vector2(0, 1);\r\n\r\n/**\r\n * A static one Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ONE\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.ONE = new Vector2(1, 1);\r\n\r\nmodule.exports = Vector2;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 3D space.\r\n *\r\n * A three-component vector.\r\n *\r\n * @class Vector3\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n */\r\nvar Vector3 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector3 (x, y, z)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The z component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.z = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Set this Vector to point up.\r\n *\r\n * Sets the y component of the vector to 1, and the others to 0.\r\n *\r\n * @method Phaser.Math.Vector3#up\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n up: function ()\r\n {\r\n this.x = 0;\r\n this.y = 1;\r\n this.z = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector3.\r\n *\r\n * @method Phaser.Math.Vector3#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector3(this.x, this.y, this.z);\r\n },\r\n\r\n /**\r\n * Calculate the cross (vector) product of two given Vectors.\r\n *\r\n * @method Phaser.Math.Vector3#crossVectors\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} a - The first Vector to multiply.\r\n * @param {Phaser.Math.Vector3} b - The second Vector to multiply.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n crossVectors: function (a, b)\r\n {\r\n var ax = a.x;\r\n var ay = a.y;\r\n var az = a.z;\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n\r\n this.x = ay * bz - az * by;\r\n this.y = az * bx - ax * bz;\r\n this.z = ax * by - ay * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict equality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector3#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to compare against.\r\n *\r\n * @return {boolean} True if the two vectors strictly match, otherwise false.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z));\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#copy\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values.\r\n *\r\n * @method Phaser.Math.Vector3#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components.\r\n * @param {number} [y] - The y value to set for this Vector.\r\n * @param {number} [z] - The z value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n set: function (x, y, z)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector3#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector3#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n multiply: function (v)\r\n {\r\n this.x *= v.x;\r\n this.y *= v.y;\r\n this.z *= v.z || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector3#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n scale: function (scale)\r\n {\r\n if (isFinite(scale))\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n }\r\n else\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#divide\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n divide: function (v)\r\n {\r\n this.x /= v.x;\r\n this.y /= v.y;\r\n this.z /= v.z || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Negate the `x`, `y` and `z` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#distance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n\r\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector3#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n\r\n return dx * dx + dy * dy + dz * dz;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n return Math.sqrt(x * x + y * y + z * z);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector3#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n return x * x + y * y + z * z;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector3#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var len = x * x + y * y + z * z;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3.\r\n *\r\n * @return {number} The dot product of this Vector and `v`.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z;\r\n },\r\n\r\n /**\r\n * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#cross\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector to cross product with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n cross: function (v)\r\n {\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var bx = v.x;\r\n var by = v.y;\r\n var bz = v.z;\r\n\r\n this.x = ay * bz - az * by;\r\n this.y = az * bx - ax * bz;\r\n this.z = ax * by - ay * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector3#transformMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformMat3: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n this.x = x * m[0] + y * m[3] + z * m[6];\r\n this.y = x * m[1] + y * m[4] + z * m[7];\r\n this.z = x * m[2] + y * m[5] + z * m[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector3#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12];\r\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13];\r\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transforms the coordinates of this Vector3 with the given Matrix4.\r\n *\r\n * @method Phaser.Math.Vector3#transformCoordinates\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformCoordinates: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12];\r\n var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13];\r\n var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14];\r\n var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15];\r\n\r\n this.x = tx / tw;\r\n this.y = ty / tw;\r\n this.z = tz / tw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Quaternion.\r\n *\r\n * @method Phaser.Math.Vector3#transformQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformQuat: function (q)\r\n {\r\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var qx = q.x;\r\n var qy = q.y;\r\n var qz = q.z;\r\n var qw = q.w;\r\n\r\n // calculate quat * vec\r\n var ix = qw * x + qy * z - qz * y;\r\n var iy = qw * y + qz * x - qx * z;\r\n var iz = qw * z + qx * y - qy * x;\r\n var iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection,\r\n * e.g. unprojecting a 2D point into 3D space.\r\n *\r\n * @method Phaser.Math.Vector3#project\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n project: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n var a00 = m[0];\r\n var a01 = m[1];\r\n var a02 = m[2];\r\n var a03 = m[3];\r\n var a10 = m[4];\r\n var a11 = m[5];\r\n var a12 = m[6];\r\n var a13 = m[7];\r\n var a20 = m[8];\r\n var a21 = m[9];\r\n var a22 = m[10];\r\n var a23 = m[11];\r\n var a30 = m[12];\r\n var a31 = m[13];\r\n var a32 = m[14];\r\n var a33 = m[15];\r\n\r\n var lw = 1 / (x * a03 + y * a13 + z * a23 + a33);\r\n\r\n this.x = (x * a00 + y * a10 + z * a20 + a30) * lw;\r\n this.y = (x * a01 + y * a11 + z * a21 + a31) * lw;\r\n this.z = (x * a02 + y * a12 + z * a22 + a32) * lw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Unproject this point from 2D space to 3D space.\r\n * The point should have its x and y properties set to\r\n * 2D screen space, and the z either at 0 (near plane)\r\n * or 1 (far plane). The provided matrix is assumed to already\r\n * be combined, i.e. projection * view * model.\r\n *\r\n * After this operation, this vector's (x, y, z) components will\r\n * represent the unprojected 3D coordinate.\r\n *\r\n * @method Phaser.Math.Vector3#unproject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels.\r\n * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n unproject: function (viewport, invProjectionView)\r\n {\r\n var viewX = viewport.x;\r\n var viewY = viewport.y;\r\n var viewWidth = viewport.z;\r\n var viewHeight = viewport.w;\r\n\r\n var x = this.x - viewX;\r\n var y = (viewHeight - this.y - 1) - viewY;\r\n var z = this.z;\r\n\r\n this.x = (2 * x) / viewWidth - 1;\r\n this.y = (2 * y) / viewHeight - 1;\r\n this.z = 2 * z - 1;\r\n\r\n return this.project(invProjectionView);\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0, 0).\r\n *\r\n * @method Phaser.Math.Vector3#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A static zero Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.ZERO\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.ZERO = new Vector3();\r\n\r\n/**\r\n * A static right Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.RIGHT\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.RIGHT = new Vector3(1, 0, 0);\r\n\r\n/**\r\n * A static left Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.LEFT\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.LEFT = new Vector3(-1, 0, 0);\r\n\r\n/**\r\n * A static up Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.UP\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.UP = new Vector3(0, -1, 0);\r\n\r\n/**\r\n * A static down Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.DOWN\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.DOWN = new Vector3(0, 1, 0);\r\n\r\n/**\r\n * A static forward Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.FORWARD\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.FORWARD = new Vector3(0, 0, 1);\r\n\r\n/**\r\n * A static back Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.BACK\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.BACK = new Vector3(0, 0, -1);\r\n\r\n/**\r\n * A static one Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.ONE\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.ONE = new Vector3(1, 1, 1);\r\n\r\nmodule.exports = Vector3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 4D space.\r\n *\r\n * A four-component vector.\r\n *\r\n * @class Vector4\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n * @param {number} [w] - The w component.\r\n */\r\nvar Vector4 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector4 (x, y, z, w)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The z component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.z = 0;\r\n\r\n /**\r\n * The w component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.w = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector4.\r\n *\r\n * @method Phaser.Math.Vector4#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} A clone of this Vector4.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector4(this.x, this.y, this.z, this.w);\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z || 0;\r\n this.w = src.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict quality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector4#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The vector to check equality with.\r\n *\r\n * @return {boolean} A boolean indicating whether the two Vectors are equal or not.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w));\r\n },\r\n\r\n /**\r\n * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values.\r\n *\r\n * @method Phaser.Math.Vector4#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components.\r\n * @param {number} y - The y value to set for this Vector.\r\n * @param {number} z - The z value to set for this Vector.\r\n * @param {number} w - The z value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n set: function (x, y, z, w)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector4#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z || 0;\r\n this.w += v.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector4#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z || 0;\r\n this.w -= v.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector4#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n scale: function (scale)\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector4#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector4#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var len = x * x + y * y + z * z + w * w;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n this.w = w * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4.\r\n *\r\n * @return {number} The dot product of this Vector and the given Vector.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n this.w = aw + t * (v.w - aw);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n multiply: function (v)\r\n {\r\n this.x *= v.x;\r\n this.y *= v.y;\r\n this.z *= v.z || 1;\r\n this.w *= v.w || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#divide\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n divide: function (v)\r\n {\r\n this.x /= v.x;\r\n this.y /= v.y;\r\n this.z /= v.z || 1;\r\n this.w /= v.w || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#distance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n var dw = v.w - this.w || 0;\r\n\r\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector4#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n var dw = v.w - this.w || 0;\r\n\r\n return dx * dx + dy * dy + dz * dz + dw * dw;\r\n },\r\n\r\n /**\r\n * Negate the `x`, `y`, `z` and `w` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n this.w = -this.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector4#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Quaternion.\r\n *\r\n * @method Phaser.Math.Vector4#transformQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n transformQuat: function (q)\r\n {\r\n // TODO: is this really the same as Vector3?\r\n // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/\r\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var qx = q.x;\r\n var qy = q.y;\r\n var qz = q.z;\r\n var qw = q.w;\r\n\r\n // calculate quat * vec\r\n var ix = qw * x + qy * z - qz * y;\r\n var iy = qw * y + qz * x - qx * z;\r\n var iz = qw * z + qx * y - qy * x;\r\n var iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0, 0, 0).\r\n *\r\n * @method Phaser.Math.Vector4#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n// TODO: Check if these are required internally, if not, remove.\r\nVector4.prototype.sub = Vector4.prototype.subtract;\r\nVector4.prototype.mul = Vector4.prototype.multiply;\r\nVector4.prototype.div = Vector4.prototype.divide;\r\nVector4.prototype.dist = Vector4.prototype.distance;\r\nVector4.prototype.distSq = Vector4.prototype.distanceSq;\r\nVector4.prototype.len = Vector4.prototype.length;\r\nVector4.prototype.lenSq = Vector4.prototype.lengthSq;\r\n\r\nmodule.exports = Vector4;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the two values are within the given `tolerance` of each other.\r\n *\r\n * @function Phaser.Math.Within\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value to use in the calculation.\r\n * @param {number} b - The second value to use in the calculation.\r\n * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range.\r\n *\r\n * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`.\r\n */\r\nvar Within = function (a, b, tolerance)\r\n{\r\n return (Math.abs(a - b) <= tolerance);\r\n};\r\n\r\nmodule.exports = Within;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Wrap the given `value` between `min` and `max.\r\n *\r\n * @function Phaser.Math.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to wrap.\r\n * @param {number} min - The minimum value.\r\n * @param {number} max - The maximum value.\r\n *\r\n * @return {number} The wrapped value.\r\n */\r\nvar Wrap = function (value, min, max)\r\n{\r\n var range = max - min;\r\n\r\n return (min + ((((value - min) % range) + range) % range));\r\n};\r\n\r\nmodule.exports = Wrap;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\r\n *\r\n * @function Phaser.Math.Angle.Between\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar Between = function (x1, y1, x2, y2)\r\n{\r\n return Math.atan2(y2 - y1, x2 - x1);\r\n};\r\n\r\nmodule.exports = Between;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\r\n *\r\n * Calculates the angle of the vector from the first point to the second point.\r\n *\r\n * @function Phaser.Math.Angle.BetweenPoints\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point1 - The first point.\r\n * @param {(Phaser.Geom.Point|object)} point2 - The second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenPoints = function (point1, point2)\r\n{\r\n return Math.atan2(point2.y - point1.y, point2.x - point1.x);\r\n};\r\n\r\nmodule.exports = BetweenPoints;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\r\n *\r\n * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate\r\n * travels down the screen.\r\n *\r\n * @function Phaser.Math.Angle.BetweenPointsY\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point1 - The first point.\r\n * @param {(Phaser.Geom.Point|object)} point2 - The second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenPointsY = function (point1, point2)\r\n{\r\n return Math.atan2(point2.x - point1.x, point2.y - point1.y);\r\n};\r\n\r\nmodule.exports = BetweenPointsY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\r\n *\r\n * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate\r\n * travels down the screen.\r\n *\r\n * @function Phaser.Math.Angle.BetweenY\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenY = function (x1, y1, x2, y2)\r\n{\r\n return Math.atan2(x2 - x1, y2 - y1);\r\n};\r\n\r\nmodule.exports = BetweenY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('../const');\r\n\r\n/**\r\n * Takes an angle in Phasers default clockwise format and converts it so that\r\n * 0 is North, 90 is West, 180 is South and 270 is East,\r\n * therefore running counter-clockwise instead of clockwise.\r\n * \r\n * You can pass in the angle from a Game Object using:\r\n * \r\n * ```javascript\r\n * var converted = CounterClockwise(gameobject.rotation);\r\n * ```\r\n * \r\n * All values for this function are in radians.\r\n *\r\n * @function Phaser.Math.Angle.CounterClockwise\r\n * @since 3.16.0\r\n *\r\n * @param {number} angle - The angle to convert, in radians.\r\n *\r\n * @return {number} The converted angle, in radians.\r\n */\r\nvar CounterClockwise = function (angle)\r\n{\r\n if (angle > Math.PI)\r\n {\r\n angle -= CONST.PI2;\r\n }\r\n\r\n return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2);\r\n};\r\n\r\nmodule.exports = CounterClockwise;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Normalize an angle to the [0, 2pi] range.\r\n *\r\n * @function Phaser.Math.Angle.Normalize\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to normalize, in radians.\r\n *\r\n * @return {number} The normalized angle, in radians.\r\n */\r\nvar Normalize = function (angle)\r\n{\r\n angle = angle % (2 * Math.PI);\r\n\r\n if (angle >= 0)\r\n {\r\n return angle;\r\n }\r\n else\r\n {\r\n return angle + 2 * Math.PI;\r\n }\r\n};\r\n\r\nmodule.exports = Normalize;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Normalize = require('./Normalize');\r\n\r\n/**\r\n * Reverse the given angle.\r\n *\r\n * @function Phaser.Math.Angle.Reverse\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to reverse, in radians.\r\n *\r\n * @return {number} The reversed angle, in radians.\r\n */\r\nvar Reverse = function (angle)\r\n{\r\n return Normalize(angle + Math.PI);\r\n};\r\n\r\nmodule.exports = Reverse;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = require('../const');\r\n\r\n/**\r\n * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call.\r\n *\r\n * @function Phaser.Math.Angle.RotateTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} currentAngle - The current angle, in radians.\r\n * @param {number} targetAngle - The target angle to rotate to, in radians.\r\n * @param {number} [lerp=0.05] - The lerp value to add to the current angle.\r\n *\r\n * @return {number} The adjusted angle.\r\n */\r\nvar RotateTo = function (currentAngle, targetAngle, lerp)\r\n{\r\n if (lerp === undefined) { lerp = 0.05; }\r\n\r\n if (currentAngle === targetAngle)\r\n {\r\n return currentAngle;\r\n }\r\n\r\n if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp))\r\n {\r\n currentAngle = targetAngle;\r\n }\r\n else\r\n {\r\n if (Math.abs(targetAngle - currentAngle) > Math.PI)\r\n {\r\n if (targetAngle < currentAngle)\r\n {\r\n targetAngle += MATH_CONST.PI2;\r\n }\r\n else\r\n {\r\n targetAngle -= MATH_CONST.PI2;\r\n }\r\n }\r\n\r\n if (targetAngle > currentAngle)\r\n {\r\n currentAngle += lerp;\r\n }\r\n else if (targetAngle < currentAngle)\r\n {\r\n currentAngle -= lerp;\r\n }\r\n }\r\n\r\n return currentAngle;\r\n};\r\n\r\nmodule.exports = RotateTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Gets the shortest angle between `angle1` and `angle2`.\r\n *\r\n * Both angles must be in the range -180 to 180, which is the same clamped\r\n * range that `sprite.angle` uses, so you can pass in two sprite angles to\r\n * this method and get the shortest angle back between the two of them.\r\n *\r\n * The angle returned will be in the same range. If the returned angle is\r\n * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's\r\n * a clockwise rotation.\r\n *\r\n * TODO: Wrap the angles in this function?\r\n *\r\n * @function Phaser.Math.Angle.ShortestBetween\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle1 - The first angle in the range -180 to 180.\r\n * @param {number} angle2 - The second angle in the range -180 to 180.\r\n *\r\n * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation.\r\n */\r\nvar ShortestBetween = function (angle1, angle2)\r\n{\r\n var difference = angle2 - angle1;\r\n\r\n if (difference === 0)\r\n {\r\n return 0;\r\n }\r\n\r\n var times = Math.floor((difference - (-180)) / 360);\r\n\r\n return difference - (times * 360);\r\n\r\n};\r\n\r\nmodule.exports = ShortestBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MathWrap = require('../Wrap');\r\n\r\n/**\r\n * Wrap an angle.\r\n *\r\n * Wraps the angle to a value in the range of -PI to PI.\r\n *\r\n * @function Phaser.Math.Angle.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in radians.\r\n *\r\n * @return {number} The wrapped angle, in radians.\r\n */\r\nvar Wrap = function (angle)\r\n{\r\n return MathWrap(angle, -Math.PI, Math.PI);\r\n};\r\n\r\nmodule.exports = Wrap;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Wrap = require('../Wrap');\r\n\r\n/**\r\n * Wrap an angle in degrees.\r\n *\r\n * Wraps the angle to a value in the range of -180 to 180.\r\n *\r\n * @function Phaser.Math.Angle.WrapDegrees\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in degrees.\r\n *\r\n * @return {number} The wrapped angle, in degrees.\r\n */\r\nvar WrapDegrees = function (angle)\r\n{\r\n return Wrap(angle, -180, 180);\r\n};\r\n\r\nmodule.exports = WrapDegrees;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Angle\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Between: require('./Between'),\r\n BetweenPoints: require('./BetweenPoints'),\r\n BetweenPointsY: require('./BetweenPointsY'),\r\n BetweenY: require('./BetweenY'),\r\n CounterClockwise: require('./CounterClockwise'),\r\n Normalize: require('./Normalize'),\r\n Reverse: require('./Reverse'),\r\n RotateTo: require('./RotateTo'),\r\n ShortestBetween: require('./ShortestBetween'),\r\n Wrap: require('./Wrap'),\r\n WrapDegrees: require('./WrapDegrees')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = {\r\n\r\n /**\r\n * The value of PI * 2.\r\n * \r\n * @name Phaser.Math.PI2\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n PI2: Math.PI * 2,\r\n\r\n /**\r\n * The value of PI * 0.5.\r\n * \r\n * @name Phaser.Math.TAU\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n TAU: Math.PI * 0.5,\r\n\r\n /**\r\n * An epsilon value (1.0e-6)\r\n * \r\n * @name Phaser.Math.EPSILON\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n EPSILON: 1.0e-6,\r\n\r\n /**\r\n * For converting degrees to radians (PI / 180)\r\n * \r\n * @name Phaser.Math.DEG_TO_RAD\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n DEG_TO_RAD: Math.PI / 180,\r\n\r\n /**\r\n * For converting radians to degrees (180 / PI)\r\n * \r\n * @name Phaser.Math.RAD_TO_DEG\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n RAD_TO_DEG: 180 / Math.PI,\r\n\r\n /**\r\n * An instance of the Random Number Generator.\r\n * This is not set until the Game boots.\r\n * \r\n * @name Phaser.Math.RND\r\n * @type {Phaser.Math.RandomDataGenerator}\r\n * @since 3.0.0\r\n */\r\n RND: null\r\n\r\n};\r\n\r\nmodule.exports = MATH_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points).\r\n *\r\n * @function Phaser.Math.Distance.Between\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar DistanceBetween = function (x1, y1, x2, y2)\r\n{\r\n var dx = x1 - x2;\r\n var dy = y1 - y2;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n};\r\n\r\nmodule.exports = DistanceBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points) to the power of `pow`.\r\n *\r\n * @function Phaser.Math.Distance.Power\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n * @param {number} pow - The exponent.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar DistancePower = function (x1, y1, x2, y2, pow)\r\n{\r\n if (pow === undefined) { pow = 2; }\r\n\r\n return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow));\r\n};\r\n\r\nmodule.exports = DistancePower;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points), squared.\r\n *\r\n * @function Phaser.Math.Distance.Squared\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point, squared.\r\n */\r\nvar DistanceSquared = function (x1, y1, x2, y2)\r\n{\r\n var dx = x1 - x2;\r\n var dy = y1 - y2;\r\n\r\n return dx * dx + dy * dy;\r\n};\r\n\r\nmodule.exports = DistanceSquared;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Distance\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Between: require('./DistanceBetween'),\r\n Power: require('./DistancePower'),\r\n Squared: require('./DistanceSquared')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Back.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n return v * v * ((overshoot + 1) * v - overshoot);\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Back.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n var s = overshoot * 1.525;\r\n\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * (v * v * ((s + 1) * v - s));\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Back.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n return --v * v * ((overshoot + 1) * v + overshoot) + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Back\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n v = 1 - v;\r\n\r\n if (v < 1 / 2.75)\r\n {\r\n return 1 - (7.5625 * v * v);\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75);\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375);\r\n }\r\n else\r\n {\r\n return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375);\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n var reverse = false;\r\n\r\n if (v < 0.5)\r\n {\r\n v = 1 - (v * 2);\r\n reverse = true;\r\n }\r\n else\r\n {\r\n v = (v * 2) - 1;\r\n }\r\n\r\n if (v < 1 / 2.75)\r\n {\r\n v = 7.5625 * v * v;\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\r\n }\r\n else\r\n {\r\n v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\r\n }\r\n\r\n if (reverse)\r\n {\r\n return (1 - v) * 0.5;\r\n }\r\n else\r\n {\r\n return v * 0.5 + 0.5;\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n if (v < 1 / 2.75)\r\n {\r\n return 7.5625 * v * v;\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\r\n }\r\n else\r\n {\r\n return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Bounce\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Circular.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return 1 - Math.sqrt(1 - v * v);\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Circular.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return -0.5 * (Math.sqrt(1 - v * v) - 1);\r\n }\r\n else\r\n {\r\n return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Circular.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return Math.sqrt(1 - (--v * v));\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Circular\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v;\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * v + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return --v * v * v + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Cubic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n if ((v *= 2) < 1)\r\n {\r\n return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\r\n }\r\n else\r\n {\r\n return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1);\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Elastic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Expo.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return Math.pow(2, 10 * (v - 1)) - 0.001;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Expo.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * Math.pow(2, 10 * (v - 1));\r\n }\r\n else\r\n {\r\n return 0.5 * (2 - Math.pow(2, -10 * (v - 1)));\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Expo.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return 1 - Math.pow(2, -10 * v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Expo\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Back: require('./back'),\r\n Bounce: require('./bounce'),\r\n Circular: require('./circular'),\r\n Cubic: require('./cubic'),\r\n Elastic: require('./elastic'),\r\n Expo: require('./expo'),\r\n Linear: require('./linear'),\r\n Quadratic: require('./quadratic'),\r\n Quartic: require('./quartic'),\r\n Quintic: require('./quintic'),\r\n Sine: require('./sine'),\r\n Stepped: require('./stepped')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Linear easing (no variation).\r\n *\r\n * @function Phaser.Math.Easing.Linear.Linear\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Linear = function (v)\r\n{\r\n return v;\r\n};\r\n\r\nmodule.exports = Linear;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Linear\r\n */\r\n\r\nmodule.exports = require('./Linear');\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v;\r\n }\r\n else\r\n {\r\n return -0.5 * (--v * (v - 2) - 1);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return v * (2 - v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quadratic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v * v;\r\n }\r\n else\r\n {\r\n return -0.5 * ((v -= 2) * v * v * v - 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return 1 - (--v * v * v * v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quartic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v * v * v;\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * v * v * v + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return --v * v * v * v * v + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quintic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Sine.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 1 - Math.cos(v * Math.PI / 2);\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Sine.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 0.5 * (1 - Math.cos(Math.PI * v));\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Sine.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return Math.sin(v * Math.PI / 2);\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Sine\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Stepped easing.\r\n *\r\n * @function Phaser.Math.Easing.Stepped.Stepped\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [steps=1] - The number of steps in the ease.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Stepped = function (v, steps)\r\n{\r\n if (steps === undefined) { steps = 1; }\r\n\r\n if (v <= 0)\r\n {\r\n return 0;\r\n }\r\n else if (v >= 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return (((steps * v) | 0) + 1) * (1 / steps);\r\n }\r\n};\r\n\r\nmodule.exports = Stepped;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Stepped\r\n */\r\n\r\nmodule.exports = require('./Stepped');\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the fuzzy ceiling of the given value.\r\n *\r\n * @function Phaser.Math.Fuzzy.Ceil\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {number} The fuzzy ceiling of the value.\r\n */\r\nvar Ceil = function (value, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.ceil(value - epsilon);\r\n};\r\n\r\nmodule.exports = Ceil;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether the given values are fuzzily equal.\r\n *\r\n * Two numbers are fuzzily equal if their difference is less than `epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.Equal\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`.\r\n */\r\nvar Equal = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.abs(a - b) < epsilon;\r\n};\r\n\r\nmodule.exports = Equal;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the fuzzy floor of the given value.\r\n *\r\n * @function Phaser.Math.Fuzzy.Floor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {number} The floor of the value.\r\n */\r\nvar Floor = function (value, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.floor(value + epsilon);\r\n};\r\n\r\nmodule.exports = Floor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether `a` is fuzzily greater than `b`.\r\n *\r\n * `a` is fuzzily greater than `b` if it is more than `b - epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.GreaterThan\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`.\r\n */\r\nvar GreaterThan = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return a > b - epsilon;\r\n};\r\n\r\nmodule.exports = GreaterThan;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether `a` is fuzzily less than `b`.\r\n *\r\n * `a` is fuzzily less than `b` if it is less than `b + epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.LessThan\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`.\r\n */\r\nvar LessThan = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return a < b + epsilon;\r\n};\r\n\r\nmodule.exports = LessThan;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Fuzzy\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Ceil: require('./Ceil'),\r\n Equal: require('./Equal'),\r\n Floor: require('./Floor'),\r\n GreaterThan: require('./GreaterThan'),\r\n LessThan: require('./LessThan')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\nvar Extend = require('../utils/object/Extend');\r\n\r\n/**\r\n * @namespace Phaser.Math\r\n */\r\n\r\nvar PhaserMath = {\r\n\r\n // Collections of functions\r\n Angle: require('./angle/'),\r\n Distance: require('./distance/'),\r\n Easing: require('./easing/'),\r\n Fuzzy: require('./fuzzy/'),\r\n Interpolation: require('./interpolation/'),\r\n Pow2: require('./pow2/'),\r\n Snap: require('./snap/'),\r\n\r\n // Expose the RNG Class\r\n RandomDataGenerator: require('./random-data-generator/RandomDataGenerator'),\r\n\r\n // Single functions\r\n Average: require('./Average'),\r\n Bernstein: require('./Bernstein'),\r\n Between: require('./Between'),\r\n CatmullRom: require('./CatmullRom'),\r\n CeilTo: require('./CeilTo'),\r\n Clamp: require('./Clamp'),\r\n DegToRad: require('./DegToRad'),\r\n Difference: require('./Difference'),\r\n Factorial: require('./Factorial'),\r\n FloatBetween: require('./FloatBetween'),\r\n FloorTo: require('./FloorTo'),\r\n FromPercent: require('./FromPercent'),\r\n GetSpeed: require('./GetSpeed'),\r\n IsEven: require('./IsEven'),\r\n IsEvenStrict: require('./IsEvenStrict'),\r\n Linear: require('./Linear'),\r\n MaxAdd: require('./MaxAdd'),\r\n MinSub: require('./MinSub'),\r\n Percent: require('./Percent'),\r\n RadToDeg: require('./RadToDeg'),\r\n RandomXY: require('./RandomXY'),\r\n RandomXYZ: require('./RandomXYZ'),\r\n RandomXYZW: require('./RandomXYZW'),\r\n Rotate: require('./Rotate'),\r\n RotateAround: require('./RotateAround'),\r\n RotateAroundDistance: require('./RotateAroundDistance'),\r\n RoundAwayFromZero: require('./RoundAwayFromZero'),\r\n RoundTo: require('./RoundTo'),\r\n SinCosTableGenerator: require('./SinCosTableGenerator'),\r\n SmootherStep: require('./SmootherStep'),\r\n SmoothStep: require('./SmoothStep'),\r\n ToXY: require('./ToXY'),\r\n TransformXY: require('./TransformXY'),\r\n Within: require('./Within'),\r\n Wrap: require('./Wrap'),\r\n\r\n // Vector classes\r\n Vector2: require('./Vector2'),\r\n Vector3: require('./Vector3'),\r\n Vector4: require('./Vector4'),\r\n Matrix3: require('./Matrix3'),\r\n Matrix4: require('./Matrix4'),\r\n Quaternion: require('./Quaternion'),\r\n RotateVec3: require('./RotateVec3')\r\n\r\n};\r\n\r\n// Merge in the consts\r\n\r\nPhaserMath = Extend(false, PhaserMath, CONST);\r\n\r\n// Export it\r\n\r\nmodule.exports = PhaserMath;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bernstein = require('../Bernstein');\r\n\r\n/**\r\n * A bezier interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.Bezier\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar BezierInterpolation = function (v, k)\r\n{\r\n var b = 0;\r\n var n = v.length - 1;\r\n\r\n for (var i = 0; i <= n; i++)\r\n {\r\n b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i);\r\n }\r\n\r\n return b;\r\n};\r\n\r\nmodule.exports = BezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CatmullRom = require('../CatmullRom');\r\n\r\n/**\r\n * A Catmull-Rom interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.CatmullRom\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar CatmullRomInterpolation = function (v, k)\r\n{\r\n var m = v.length - 1;\r\n var f = m * k;\r\n var i = Math.floor(f);\r\n\r\n if (v[0] === v[m])\r\n {\r\n if (k < 0)\r\n {\r\n i = Math.floor(f = m * (1 + k));\r\n }\r\n\r\n return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]);\r\n }\r\n else\r\n {\r\n if (k < 0)\r\n {\r\n return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]);\r\n }\r\n\r\n if (k > 1)\r\n {\r\n return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]);\r\n }\r\n\r\n 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]);\r\n }\r\n};\r\n\r\nmodule.exports = CatmullRomInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P0 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return k * k * k * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P1 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return 3 * k * k * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P2 (t, p)\r\n{\r\n return 3 * (1 - t) * t * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P3 (t, p)\r\n{\r\n return t * t * t * p;\r\n}\r\n\r\n/**\r\n * A cubic bezier interpolation method.\r\n *\r\n * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a\r\n *\r\n * @function Phaser.Math.Interpolation.CubicBezier\r\n * @since 3.0.0\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} p0 - The start point.\r\n * @param {number} p1 - The first control point.\r\n * @param {number} p2 - The second control point.\r\n * @param {number} p3 - The end point.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar CubicBezierInterpolation = function (t, p0, p1, p2, p3)\r\n{\r\n return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3);\r\n};\r\n\r\nmodule.exports = CubicBezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Linear = require('../Linear');\r\n\r\n/**\r\n * A linear interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.Linear\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation}\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {!number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {!number} The interpolated value.\r\n */\r\nvar LinearInterpolation = function (v, k)\r\n{\r\n var m = v.length - 1;\r\n var f = m * k;\r\n var i = Math.floor(f);\r\n\r\n if (k < 0)\r\n {\r\n return Linear(v[0], v[1], f);\r\n }\r\n else if (k > 1)\r\n {\r\n return Linear(v[m], v[m - 1], m - f);\r\n }\r\n else\r\n {\r\n return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i);\r\n }\r\n};\r\n\r\nmodule.exports = LinearInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P0 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return k * k * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P1 (t, p)\r\n{\r\n return 2 * (1 - t) * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P2 (t, p)\r\n{\r\n return t * t * p;\r\n}\r\n\r\n// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js\r\n\r\n/**\r\n * A quadratic bezier interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.QuadraticBezier\r\n * @since 3.2.0\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} p0 - The start point.\r\n * @param {number} p1 - The control point.\r\n * @param {number} p2 - The end point.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar QuadraticBezierInterpolation = function (t, p0, p1, p2)\r\n{\r\n return P0(t, p0) + P1(t, p1) + P2(t, p2);\r\n};\r\n\r\nmodule.exports = QuadraticBezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SmoothStep = require('../SmoothStep');\r\n\r\n/**\r\n * A Smooth Step interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.SmoothStep\r\n * @since 3.9.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar SmoothStepInterpolation = function (t, min, max)\r\n{\r\n return min + (max - min) * SmoothStep(t, 0, 1);\r\n};\r\n\r\nmodule.exports = SmoothStepInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SmootherStep = require('../SmootherStep');\r\n\r\n/**\r\n * A Smoother Step interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.SmootherStep\r\n * @since 3.9.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar SmootherStepInterpolation = function (t, min, max)\r\n{\r\n return min + (max - min) * SmootherStep(t, 0, 1);\r\n};\r\n\r\nmodule.exports = SmootherStepInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Interpolation\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Bezier: require('./BezierInterpolation'),\r\n CatmullRom: require('./CatmullRomInterpolation'),\r\n CubicBezier: require('./CubicBezierInterpolation'),\r\n Linear: require('./LinearInterpolation'),\r\n QuadraticBezier: require('./QuadraticBezierInterpolation'),\r\n SmoothStep: require('./SmoothStepInterpolation'),\r\n SmootherStep: require('./SmootherStepInterpolation')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the nearest power of 2 to the given `value`.\r\n *\r\n * @function Phaser.Math.Pow2.GetPowerOfTwo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n *\r\n * @return {integer} The nearest power of 2 to `value`.\r\n */\r\nvar GetPowerOfTwo = function (value)\r\n{\r\n var index = Math.log(value) / 0.6931471805599453;\r\n\r\n return (1 << Math.ceil(index));\r\n};\r\n\r\nmodule.exports = GetPowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the given `width` and `height` are a power of two.\r\n * Useful for checking texture dimensions.\r\n *\r\n * @function Phaser.Math.Pow2.IsSizePowerOfTwo\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width.\r\n * @param {number} height - The height.\r\n *\r\n * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`.\r\n */\r\nvar IsSizePowerOfTwo = function (width, height)\r\n{\r\n return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0);\r\n};\r\n\r\nmodule.exports = IsSizePowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Tests the value and returns `true` if it is a power of two.\r\n *\r\n * @function Phaser.Math.Pow2.IsValuePowerOfTwo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to check if it's a power of two.\r\n *\r\n * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`.\r\n */\r\nvar IsValuePowerOfTwo = function (value)\r\n{\r\n return (value > 0 && (value & (value - 1)) === 0);\r\n};\r\n\r\nmodule.exports = IsValuePowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Pow2\r\n */\r\n\r\nmodule.exports = {\r\n\r\n GetNext: require('./GetPowerOfTwo'),\r\n IsSize: require('./IsSizePowerOfTwo'),\r\n IsValue: require('./IsValuePowerOfTwo')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A seeded Random Data Generator.\r\n * \r\n * Access via `Phaser.Math.RND` which is an instance of this class pre-defined\r\n * by Phaser. Or, create your own instance to use as you require.\r\n * \r\n * The `Math.RND` generator is seeded by the Game Config property value `seed`.\r\n * If no such config property exists, a random number is used.\r\n * \r\n * If you create your own instance of this class you should provide a seed for it.\r\n * If no seed is given it will use a 'random' one based on Date.now.\r\n *\r\n * @class RandomDataGenerator\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} [seeds] - The seeds to use for the random number generator.\r\n */\r\nvar RandomDataGenerator = new Class({\r\n\r\n initialize:\r\n\r\n function RandomDataGenerator (seeds)\r\n {\r\n if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; }\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#c\r\n * @type {number}\r\n * @default 1\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.c = 1;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s0\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s0 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s1\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s1 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s2\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s2 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#n\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.2.0\r\n */\r\n this.n = 0;\r\n\r\n /**\r\n * Signs to choose from.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#signs\r\n * @type {number[]}\r\n * @since 3.0.0\r\n */\r\n this.signs = [ -1, 1 ];\r\n\r\n if (seeds)\r\n {\r\n this.init(seeds);\r\n }\r\n },\r\n\r\n /**\r\n * Private random helper.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#rnd\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @return {number} A random number.\r\n */\r\n rnd: function ()\r\n {\r\n var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32\r\n\r\n this.c = t | 0;\r\n this.s0 = this.s1;\r\n this.s1 = this.s2;\r\n this.s2 = t - this.c;\r\n\r\n return this.s2;\r\n },\r\n\r\n /**\r\n * Internal method that creates a seed hash.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#hash\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {string} data - The value to hash.\r\n *\r\n * @return {number} The hashed value.\r\n */\r\n hash: function (data)\r\n {\r\n var h;\r\n var n = this.n;\r\n\r\n data = data.toString();\r\n\r\n for (var i = 0; i < data.length; i++)\r\n {\r\n n += data.charCodeAt(i);\r\n h = 0.02519603282416938 * n;\r\n n = h >>> 0;\r\n h -= n;\r\n h *= n;\r\n n = h >>> 0;\r\n h -= n;\r\n n += h * 0x100000000;// 2^32\r\n }\r\n\r\n this.n = n;\r\n\r\n return (n >>> 0) * 2.3283064365386963e-10;// 2^-32\r\n },\r\n\r\n /**\r\n * Initialize the state of the random data generator.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#init\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} seeds - The seeds to initialize the random data generator with.\r\n */\r\n init: function (seeds)\r\n {\r\n if (typeof seeds === 'string')\r\n {\r\n this.state(seeds);\r\n }\r\n else\r\n {\r\n this.sow(seeds);\r\n }\r\n },\r\n\r\n /**\r\n * Reset the seed of the random data generator.\r\n *\r\n * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#sow\r\n * @since 3.0.0\r\n *\r\n * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used.\r\n */\r\n sow: function (seeds)\r\n {\r\n // Always reset to default seed\r\n this.n = 0xefc8249d;\r\n this.s0 = this.hash(' ');\r\n this.s1 = this.hash(' ');\r\n this.s2 = this.hash(' ');\r\n this.c = 1;\r\n\r\n if (!seeds)\r\n {\r\n return;\r\n }\r\n\r\n // Apply any seeds\r\n for (var i = 0; i < seeds.length && (seeds[i] != null); i++)\r\n {\r\n var seed = seeds[i];\r\n\r\n this.s0 -= this.hash(seed);\r\n this.s0 += ~~(this.s0 < 0);\r\n this.s1 -= this.hash(seed);\r\n this.s1 += ~~(this.s1 < 0);\r\n this.s2 -= this.hash(seed);\r\n this.s2 += ~~(this.s2 < 0);\r\n }\r\n },\r\n\r\n /**\r\n * Returns a random integer between 0 and 2^32.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#integer\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random integer between 0 and 2^32.\r\n */\r\n integer: function ()\r\n {\r\n // 2^32\r\n return this.rnd() * 0x100000000;\r\n },\r\n\r\n /**\r\n * Returns a random real number between 0 and 1.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#frac\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between 0 and 1.\r\n */\r\n frac: function ()\r\n {\r\n // 2^-53\r\n return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16;\r\n },\r\n\r\n /**\r\n * Returns a random real number between 0 and 2^32.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#real\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between 0 and 2^32.\r\n */\r\n real: function ()\r\n {\r\n return this.integer() + this.frac();\r\n },\r\n\r\n /**\r\n * Returns a random integer between and including min and max.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#integerInRange\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n integerInRange: function (min, max)\r\n {\r\n return Math.floor(this.realInRange(0, max - min + 1) + min);\r\n },\r\n\r\n /**\r\n * Returns a random integer between and including min and max.\r\n * This method is an alias for RandomDataGenerator.integerInRange.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#between\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n between: function (min, max)\r\n {\r\n return Math.floor(this.realInRange(0, max - min + 1) + min);\r\n },\r\n\r\n /**\r\n * Returns a random real number between min and max.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#realInRange\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n realInRange: function (min, max)\r\n {\r\n return this.frac() * (max - min) + min;\r\n },\r\n\r\n /**\r\n * Returns a random real number between -1 and 1.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#normal\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between -1 and 1.\r\n */\r\n normal: function ()\r\n {\r\n return 1 - (2 * this.frac());\r\n },\r\n\r\n /**\r\n * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#uuid\r\n * @since 3.0.0\r\n *\r\n * @return {string} A valid RFC4122 version4 ID hex string\r\n */\r\n uuid: function ()\r\n {\r\n var a = '';\r\n var b = '';\r\n\r\n for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-')\r\n {\r\n // eslint-disable-next-line no-empty\r\n }\r\n\r\n return b;\r\n },\r\n\r\n /**\r\n * Returns a random element from within the given array.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#pick\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to pick a random element from.\r\n *\r\n * @return {*} A random member of the array.\r\n */\r\n pick: function (array)\r\n {\r\n return array[this.integerInRange(0, array.length - 1)];\r\n },\r\n\r\n /**\r\n * Returns a sign to be used with multiplication operator.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#sign\r\n * @since 3.0.0\r\n *\r\n * @return {number} -1 or +1.\r\n */\r\n sign: function ()\r\n {\r\n return this.pick(this.signs);\r\n },\r\n\r\n /**\r\n * Returns a random element from within the given array, favoring the earlier entries.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#weightedPick\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to pick a random element from.\r\n *\r\n * @return {*} A random member of the array.\r\n */\r\n weightedPick: function (array)\r\n {\r\n return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)];\r\n },\r\n\r\n /**\r\n * 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.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#timestamp\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random timestamp between min and max.\r\n */\r\n timestamp: function (min, max)\r\n {\r\n return this.realInRange(min || 946684800000, max || 1577862000000);\r\n },\r\n\r\n /**\r\n * Returns a random angle between -180 and 180.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#angle\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random number between -180 and 180.\r\n */\r\n angle: function ()\r\n {\r\n return this.integerInRange(-180, 180);\r\n },\r\n\r\n /**\r\n * Returns a random rotation in radians, between -3.141 and 3.141\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#rotation\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random number between -3.141 and 3.141\r\n */\r\n rotation: function ()\r\n {\r\n return this.realInRange(-3.1415926, 3.1415926);\r\n },\r\n\r\n /**\r\n * Gets or Sets the state of the generator. This allows you to retain the values\r\n * that the generator is using between games, i.e. in a game save file.\r\n *\r\n * To seed this generator with a previously saved state you can pass it as the\r\n * `seed` value in your game config, or call this method directly after Phaser has booted.\r\n *\r\n * Call this method with no parameters to return the current state.\r\n *\r\n * If providing a state it should match the same format that this method\r\n * returns, which is a string with a header `!rnd` followed by the `c`,\r\n * `s0`, `s1` and `s2` values respectively, each comma-delimited.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#state\r\n * @since 3.0.0\r\n *\r\n * @param {string} [state] - Generator state to be set.\r\n *\r\n * @return {string} The current state of the generator.\r\n */\r\n state: function (state)\r\n {\r\n if (typeof state === 'string' && state.match(/^!rnd/))\r\n {\r\n state = state.split(',');\r\n\r\n this.c = parseFloat(state[1]);\r\n this.s0 = parseFloat(state[2]);\r\n this.s1 = parseFloat(state[3]);\r\n this.s2 = parseFloat(state[4]);\r\n }\r\n\r\n return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(',');\r\n },\r\n\r\n /**\r\n * Shuffles the given array, using the current seed.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#shuffle\r\n * @since 3.7.0\r\n *\r\n * @param {array} [array] - The array to be shuffled.\r\n *\r\n * @return {array} The shuffled array.\r\n */\r\n shuffle: function (array)\r\n {\r\n var len = array.length - 1;\r\n\r\n for (var i = len; i > 0; i--)\r\n {\r\n var randomIndex = Math.floor(this.frac() * (i + 1));\r\n var itemAtIndex = array[randomIndex];\r\n\r\n array[randomIndex] = array[i];\r\n array[i] = itemAtIndex;\r\n }\r\n\r\n return array;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = RandomDataGenerator;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using ceil.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`.\r\n * As will `14` snap to `15`... but `16` will snap to `20`.\r\n *\r\n * @function Phaser.Math.Snap.Ceil\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapCeil = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.ceil(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapCeil;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using floor.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`.\r\n * As will `14` snap to `10`... but `16` will snap to `15`.\r\n *\r\n * @function Phaser.Math.Snap.Floor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapFloor = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.floor(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapFloor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using rounding.\r\n *\r\n * 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`.\r\n *\r\n * @function Phaser.Math.Snap.To\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapTo = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.round(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Snap\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Ceil: require('./SnapCeil'),\r\n Floor: require('./SnapFloor'),\r\n To: require('./SnapTo')\r\n\r\n};\r\n","/**\r\n* @author Richard Davey \r\n* @copyright 2019 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A Global Plugin is installed just once into the Game owned Plugin Manager.\r\n * It can listen for Game events and respond to them.\r\n *\r\n * @class BasePlugin\r\n * @memberof Phaser.Plugins\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar BasePlugin = new Class({\r\n\r\n initialize:\r\n\r\n function BasePlugin (pluginManager)\r\n {\r\n /**\r\n * A handy reference to the Plugin Manager that is responsible for this plugin.\r\n * Can be used as a route to gain access to game systems and events.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#pluginManager\r\n * @type {Phaser.Plugins.PluginManager}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.pluginManager = pluginManager;\r\n\r\n /**\r\n * A reference to the Game instance this plugin is running under.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#game\r\n * @type {Phaser.Game}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.game = pluginManager.game;\r\n\r\n /**\r\n * A reference to the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You cannot use it during the `init` method, but you can during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#scene\r\n * @type {?Phaser.Scene}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.scene;\r\n\r\n /**\r\n * A reference to the Scene Systems of the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You cannot use it during the `init` method, but you can during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#systems\r\n * @type {?Phaser.Scenes.Systems}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.systems;\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is first instantiated.\r\n * It will never be called again on this instance.\r\n * In here you can set-up whatever you need for this plugin to run.\r\n * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#init\r\n * @since 3.8.0\r\n *\r\n * @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).\r\n */\r\n init: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is started.\r\n * If a plugin is stopped, and then started again, this will get called again.\r\n * Typically called immediately after `BasePlugin.init`.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#start\r\n * @since 3.8.0\r\n */\r\n start: function ()\r\n {\r\n // Here are the game-level events you can listen to.\r\n // At the very least you should offer a destroy handler for when the game closes down.\r\n\r\n // var eventEmitter = this.game.events;\r\n\r\n // eventEmitter.once('destroy', this.gameDestroy, this);\r\n // eventEmitter.on('pause', this.gamePause, this);\r\n // eventEmitter.on('resume', this.gameResume, this);\r\n // eventEmitter.on('resize', this.gameResize, this);\r\n // eventEmitter.on('prestep', this.gamePreStep, this);\r\n // eventEmitter.on('step', this.gameStep, this);\r\n // eventEmitter.on('poststep', this.gamePostStep, this);\r\n // eventEmitter.on('prerender', this.gamePreRender, this);\r\n // eventEmitter.on('postrender', this.gamePostRender, this);\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is stopped.\r\n * The game code has requested that your plugin stop doing whatever it does.\r\n * It is now considered as 'inactive' by the PluginManager.\r\n * Handle that process here (i.e. stop listening for events, etc)\r\n * If the plugin is started again then `BasePlugin.start` will be called again.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#stop\r\n * @since 3.8.0\r\n */\r\n stop: function ()\r\n {\r\n },\r\n\r\n /**\r\n * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots.\r\n * By this point the plugin properties `scene` and `systems` will have already been set.\r\n * In here you can listen for Scene events and set-up whatever you need for this plugin to run.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#boot\r\n * @since 3.8.0\r\n */\r\n boot: function ()\r\n {\r\n // Here are the Scene events you can listen to.\r\n // At the very least you should offer a destroy handler for when the Scene closes down.\r\n\r\n // var eventEmitter = this.systems.events;\r\n\r\n // eventEmitter.once('destroy', this.sceneDestroy, this);\r\n // eventEmitter.on('start', this.sceneStart, this);\r\n // eventEmitter.on('preupdate', this.scenePreUpdate, this);\r\n // eventEmitter.on('update', this.sceneUpdate, this);\r\n // eventEmitter.on('postupdate', this.scenePostUpdate, this);\r\n // eventEmitter.on('pause', this.scenePause, this);\r\n // eventEmitter.on('resume', this.sceneResume, this);\r\n // eventEmitter.on('sleep', this.sceneSleep, this);\r\n // eventEmitter.on('wake', this.sceneWake, this);\r\n // eventEmitter.on('shutdown', this.sceneShutdown, this);\r\n // eventEmitter.on('destroy', this.sceneDestroy, this);\r\n },\r\n\r\n /**\r\n * Game instance has been destroyed.\r\n * You must release everything in here, all references, all objects, free it all up.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#destroy\r\n * @since 3.8.0\r\n */\r\n destroy: function ()\r\n {\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BasePlugin;\r\n","/**\r\n* @author Richard Davey \r\n* @copyright 2019 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar BasePlugin = require('./BasePlugin');\r\nvar Class = require('../utils/Class');\r\nvar SceneEvents = require('../scene/events');\r\n\r\n/**\r\n * @classdesc\r\n * A Scene Level Plugin is installed into every Scene and belongs to that Scene.\r\n * It can listen for Scene events and respond to them.\r\n * It can map itself to a Scene property, or into the Scene Systems, or both.\r\n *\r\n * @class ScenePlugin\r\n * @memberof Phaser.Plugins\r\n * @extends Phaser.Plugins.BasePlugin\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar ScenePlugin = new Class({\r\n\r\n Extends: BasePlugin,\r\n\r\n initialize:\r\n\r\n function ScenePlugin (scene, pluginManager)\r\n {\r\n BasePlugin.call(this, pluginManager);\r\n\r\n this.scene = scene;\r\n this.systems = scene.sys;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * This method is called when the Scene boots. It is only ever called once.\r\n * \r\n * By this point the plugin properties `scene` and `systems` will have already been set.\r\n * \r\n * In here you can listen for Scene events and set-up whatever you need for this plugin to run.\r\n * Here are the Scene events you can listen to:\r\n * \r\n * start\r\n * ready\r\n * preupdate\r\n * update\r\n * postupdate\r\n * resize\r\n * pause\r\n * resume\r\n * sleep\r\n * wake\r\n * transitioninit\r\n * transitionstart\r\n * transitioncomplete\r\n * transitionout\r\n * shutdown\r\n * destroy\r\n * \r\n * At the very least you should offer a destroy handler for when the Scene closes down, i.e:\r\n *\r\n * ```javascript\r\n * var eventEmitter = this.systems.events;\r\n * eventEmitter.once('destroy', this.sceneDestroy, this);\r\n * ```\r\n *\r\n * @method Phaser.Plugins.ScenePlugin#boot\r\n * @since 3.8.0\r\n */\r\n boot: function ()\r\n {\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ScenePlugin;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Blend Modes.\r\n * \r\n * @namespace Phaser.BlendModes\r\n * @since 3.0.0\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * Skips the Blend Mode check in the renderer.\r\n * \r\n * @name Phaser.BlendModes.SKIP_CHECK\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SKIP_CHECK: -1,\r\n\r\n /**\r\n * Normal blend mode. For Canvas and WebGL.\r\n * This is the default setting and draws new shapes on top of the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.NORMAL\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n NORMAL: 0,\r\n\r\n /**\r\n * Add blend mode. For Canvas and WebGL.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.ADD\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ADD: 1,\r\n\r\n /**\r\n * Multiply blend mode. For Canvas and WebGL.\r\n * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result.\r\n * \r\n * @name Phaser.BlendModes.MULTIPLY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n MULTIPLY: 2,\r\n\r\n /**\r\n * Screen blend mode. For Canvas and WebGL.\r\n * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply)\r\n * \r\n * @name Phaser.BlendModes.SCREEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SCREEN: 3,\r\n\r\n /**\r\n * Overlay blend mode. For Canvas only.\r\n * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter.\r\n * \r\n * @name Phaser.BlendModes.OVERLAY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n OVERLAY: 4,\r\n\r\n /**\r\n * Darken blend mode. For Canvas only.\r\n * Retains the darkest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.DARKEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DARKEN: 5,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Retains the lightest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.LIGHTEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTEN: 6,\r\n\r\n /**\r\n * Color Dodge blend mode. For Canvas only.\r\n * Divides the bottom layer by the inverted top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR_DODGE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_DODGE: 7,\r\n\r\n /**\r\n * Color Burn blend mode. For Canvas only.\r\n * Divides the inverted bottom layer by the top layer, and then inverts the result.\r\n * \r\n * @name Phaser.BlendModes.COLOR_BURN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_BURN: 8,\r\n\r\n /**\r\n * Hard Light blend mode. For Canvas only.\r\n * A combination of multiply and screen like overlay, but with top and bottom layer swapped.\r\n * \r\n * @name Phaser.BlendModes.HARD_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HARD_LIGHT: 9,\r\n\r\n /**\r\n * Soft Light blend mode. For Canvas only.\r\n * A softer version of hard-light. Pure black or white does not result in pure black or white.\r\n * \r\n * @name Phaser.BlendModes.SOFT_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOFT_LIGHT: 10,\r\n\r\n /**\r\n * Difference blend mode. For Canvas only.\r\n * Subtracts the bottom layer from the top layer or the other way round to always get a positive value.\r\n * \r\n * @name Phaser.BlendModes.DIFFERENCE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DIFFERENCE: 11,\r\n\r\n /**\r\n * Exclusion blend mode. For Canvas only.\r\n * Like difference, but with lower contrast.\r\n * \r\n * @name Phaser.BlendModes.EXCLUSION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n EXCLUSION: 12,\r\n\r\n /**\r\n * Hue blend mode. For Canvas only.\r\n * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.\r\n * \r\n * @name Phaser.BlendModes.HUE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HUE: 13,\r\n\r\n /**\r\n * Saturation blend mode. For Canvas only.\r\n * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.SATURATION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SATURATION: 14,\r\n\r\n /**\r\n * Color blend mode. For Canvas only.\r\n * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR: 15,\r\n\r\n /**\r\n * Luminosity blend mode. For Canvas only.\r\n * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.LUMINOSITY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LUMINOSITY: 16,\r\n\r\n /**\r\n * Alpha erase blend mode. For Canvas and WebGL.\r\n * \r\n * @name Phaser.BlendModes.ERASE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ERASE: 17,\r\n\r\n /**\r\n * Source-in blend mode. For Canvas only.\r\n * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_IN: 18,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is drawn where it doesn't overlap the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_OUT: 19,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is only drawn where it overlaps the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_ATOP: 20,\r\n\r\n /**\r\n * Destination-over blend mode. For Canvas only.\r\n * New shapes are drawn behind the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OVER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OVER: 21,\r\n\r\n /**\r\n * Destination-in blend mode. For Canvas only.\r\n * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_IN: 22,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing content is kept where it doesn't overlap the new shape.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OUT: 23,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_ATOP: 24,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.LIGHTER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTER: 25,\r\n\r\n /**\r\n * Copy blend mode. For Canvas only.\r\n * Only the new shape is shown.\r\n * \r\n * @name Phaser.BlendModes.COPY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COPY: 26,\r\n\r\n /**\r\n * Xor blend mode. For Canvas only.\r\n * Shapes are made transparent where both overlap and drawn normal everywhere else.\r\n * \r\n * @name Phaser.BlendModes.XOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n XOR: 27\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Scale Modes.\r\n * \r\n * @namespace Phaser.ScaleModes\r\n * @since 3.0.0\r\n */\r\n\r\nvar ScaleModes = {\r\n\r\n /**\r\n * Default Scale Mode (Linear).\r\n * \r\n * @name Phaser.ScaleModes.DEFAULT\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n DEFAULT: 0,\r\n\r\n /**\r\n * Linear Scale Mode.\r\n * \r\n * @name Phaser.ScaleModes.LINEAR\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n LINEAR: 0,\r\n\r\n /**\r\n * Nearest Scale Mode.\r\n * \r\n * @name Phaser.ScaleModes.NEAREST\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n NEAREST: 1\r\n\r\n};\r\n\r\nmodule.exports = ScaleModes;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scale Manager Resize Event.\r\n * \r\n * This event is dispatched whenever the Scale Manager detects a resize event from the browser.\r\n * It sends three parameters to the callback, each of them being Size components. You can read\r\n * the `width`, `height`, `aspectRatio` and other properties of these components to help with\r\n * scaling your own game content.\r\n *\r\n * @event Phaser.Scale.Events#RESIZE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas.\r\n * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution.\r\n * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode.\r\n * @param {number} resolution - The current resolution. Defaults to 1 at the moment.\r\n * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width.\r\n * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height.\r\n */\r\nmodule.exports = 'resize';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Boot Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('boot', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#BOOT\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'boot';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Create Event.\r\n * \r\n * This event is dispatched by a Scene after it has been created by the Scene Manager.\r\n * \r\n * If a Scene has a `create` method then this event is emitted _after_ that has run.\r\n * \r\n * If there is a transition, this event will be fired after the `TRANSITION_START` event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('create', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#CREATE\r\n * @since 3.17.0\r\n * \r\n * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event.\r\n */\r\nmodule.exports = 'create';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Destroy Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems destroy process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('destroy', listener)`.\r\n * \r\n * You should destroy any resources that may be in use by your Scene in this event handler.\r\n * \r\n * @event Phaser.Scenes.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pause Event.\r\n * \r\n * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an\r\n * action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('pause', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#PAUSE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was paused.\r\n */\r\nmodule.exports = 'pause';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Post Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#POST_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'postupdate';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pre Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#PRE_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'preupdate';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Ready Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process.\r\n * By this point in the process the Scene is now fully active and rendering.\r\n * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('ready', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#READY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was started.\r\n */\r\nmodule.exports = 'ready';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Render Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('render', listener)`.\r\n * \r\n * A Scene will only render if it is visible and active.\r\n * By the time this event is dispatched, the Scene will have already been rendered.\r\n * \r\n * @event Phaser.Scenes.Events#RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene.\r\n */\r\nmodule.exports = 'render';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Resume Event.\r\n * \r\n * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('resume', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#RESUME\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed.\r\n */\r\nmodule.exports = 'resume';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Shutdown Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems shutdown process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('shutdown', listener)`.\r\n * \r\n * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding\r\n * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not\r\n * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources.\r\n * \r\n * @event Phaser.Scenes.Events#SHUTDOWN\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown.\r\n */\r\nmodule.exports = 'shutdown';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Sleep Event.\r\n * \r\n * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('sleep', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#SLEEP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep.\r\n */\r\nmodule.exports = 'sleep';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Start Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('start', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Complete Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration\r\n * of the transition.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioncomplete', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_COMPLETE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} scene -The Scene on which the transitioned completed.\r\n */\r\nmodule.exports = 'transitioncomplete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Init Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method,\r\n * this event is not dispatched.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioninit', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_INIT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitioninit';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Out Event.\r\n * \r\n * This event is dispatched by a Scene when it initiates a transition to another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionout', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_OUT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionout';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Start Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep.\r\n * \r\n * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method,\r\n * this event is dispatched anyway.\r\n * \r\n * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is\r\n * dispatched instead of this event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionstart', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_START\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionstart';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Wake Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before\r\n * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionwake', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_WAKE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionwake';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('update', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'update';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Wake Event.\r\n * \r\n * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('wake', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#WAKE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up.\r\n */\r\nmodule.exports = 'wake';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Scenes.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BOOT: require('./BOOT_EVENT'),\r\n CREATE: require('./CREATE_EVENT'),\r\n DESTROY: require('./DESTROY_EVENT'),\r\n PAUSE: require('./PAUSE_EVENT'),\r\n POST_UPDATE: require('./POST_UPDATE_EVENT'),\r\n PRE_UPDATE: require('./PRE_UPDATE_EVENT'),\r\n READY: require('./READY_EVENT'),\r\n RENDER: require('./RENDER_EVENT'),\r\n RESUME: require('./RESUME_EVENT'),\r\n SHUTDOWN: require('./SHUTDOWN_EVENT'),\r\n SLEEP: require('./SLEEP_EVENT'),\r\n START: require('./START_EVENT'),\r\n TRANSITION_COMPLETE: require('./TRANSITION_COMPLETE_EVENT'),\r\n TRANSITION_INIT: require('./TRANSITION_INIT_EVENT'),\r\n TRANSITION_OUT: require('./TRANSITION_OUT_EVENT'),\r\n TRANSITION_START: require('./TRANSITION_START_EVENT'),\r\n TRANSITION_WAKE: require('./TRANSITION_WAKE_EVENT'),\r\n UPDATE: require('./UPDATE_EVENT'),\r\n WAKE: require('./WAKE_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Taken from klasse by mattdesl https://github.com/mattdesl/klasse\r\n\r\nfunction hasGetterOrSetter (def)\r\n{\r\n return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function');\r\n}\r\n\r\nfunction getProperty (definition, k, isClassDescriptor)\r\n{\r\n // This may be a lightweight object, OR it might be a property that was defined previously.\r\n\r\n // For simple class descriptors we can just assume its NOT previously defined.\r\n var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k);\r\n\r\n if (!isClassDescriptor && def.value && typeof def.value === 'object')\r\n {\r\n def = def.value;\r\n }\r\n\r\n // This might be a regular property, or it may be a getter/setter the user defined in a class.\r\n if (def && hasGetterOrSetter(def))\r\n {\r\n if (typeof def.enumerable === 'undefined')\r\n {\r\n def.enumerable = true;\r\n }\r\n\r\n if (typeof def.configurable === 'undefined')\r\n {\r\n def.configurable = true;\r\n }\r\n\r\n return def;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n}\r\n\r\nfunction hasNonConfigurable (obj, k)\r\n{\r\n var prop = Object.getOwnPropertyDescriptor(obj, k);\r\n\r\n if (!prop)\r\n {\r\n return false;\r\n }\r\n\r\n if (prop.value && typeof prop.value === 'object')\r\n {\r\n prop = prop.value;\r\n }\r\n\r\n if (prop.configurable === false)\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Extends the given `myClass` object's prototype with the properties of `definition`.\r\n *\r\n * @function extend\r\n * @param {Object} ctor The constructor object to mix into.\r\n * @param {Object} definition A dictionary of functions for the class.\r\n * @param {boolean} isClassDescriptor Is the definition a class descriptor?\r\n * @param {Object} [extend] The parent constructor object.\r\n */\r\nfunction extend (ctor, definition, isClassDescriptor, extend)\r\n{\r\n for (var k in definition)\r\n {\r\n if (!definition.hasOwnProperty(k))\r\n {\r\n continue;\r\n }\r\n\r\n var def = getProperty(definition, k, isClassDescriptor);\r\n\r\n if (def !== false)\r\n {\r\n // If Extends is used, we will check its prototype to see if the final variable exists.\r\n\r\n var parent = extend || ctor;\r\n\r\n if (hasNonConfigurable(parent.prototype, k))\r\n {\r\n // Just skip the final property\r\n if (Class.ignoreFinals)\r\n {\r\n continue;\r\n }\r\n\r\n // We cannot re-define a property that is configurable=false.\r\n // So we will consider them final and throw an error. This is by\r\n // default so it is clear to the developer what is happening.\r\n // You can set ignoreFinals to true if you need to extend a class\r\n // which has configurable=false; it will simply not re-define final properties.\r\n throw new Error('cannot override final property \\'' + k + '\\', set Class.ignoreFinals = true to skip');\r\n }\r\n\r\n Object.defineProperty(ctor.prototype, k, def);\r\n }\r\n else\r\n {\r\n ctor.prototype[k] = definition[k];\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Applies the given `mixins` to the prototype of `myClass`.\r\n *\r\n * @function mixin\r\n * @param {Object} myClass The constructor object to mix into.\r\n * @param {Object|Array} mixins The mixins to apply to the constructor.\r\n */\r\nfunction mixin (myClass, mixins)\r\n{\r\n if (!mixins)\r\n {\r\n return;\r\n }\r\n\r\n if (!Array.isArray(mixins))\r\n {\r\n mixins = [ mixins ];\r\n }\r\n\r\n for (var i = 0; i < mixins.length; i++)\r\n {\r\n extend(myClass, mixins[i].prototype || mixins[i]);\r\n }\r\n}\r\n\r\n/**\r\n * Creates a new class with the given descriptor.\r\n * The constructor, defined by the name `initialize`,\r\n * is an optional function. If unspecified, an anonymous\r\n * function will be used which calls the parent class (if\r\n * one exists).\r\n *\r\n * You can also use `Extends` and `Mixins` to provide subclassing\r\n * and inheritance.\r\n *\r\n * @class Phaser.Class\r\n * @constructor\r\n * @param {Object} definition a dictionary of functions for the class\r\n * @example\r\n *\r\n * var MyClass = new Phaser.Class({\r\n *\r\n * initialize: function() {\r\n * this.foo = 2.0;\r\n * },\r\n *\r\n * bar: function() {\r\n * return this.foo + 5;\r\n * }\r\n * });\r\n */\r\nfunction Class (definition)\r\n{\r\n if (!definition)\r\n {\r\n definition = {};\r\n }\r\n\r\n // The variable name here dictates what we see in Chrome debugger\r\n var initialize;\r\n var Extends;\r\n\r\n if (definition.initialize)\r\n {\r\n if (typeof definition.initialize !== 'function')\r\n {\r\n throw new Error('initialize must be a function');\r\n }\r\n\r\n initialize = definition.initialize;\r\n\r\n // Usually we should avoid 'delete' in V8 at all costs.\r\n // However, its unlikely to make any performance difference\r\n // here since we only call this on class creation (i.e. not object creation).\r\n delete definition.initialize;\r\n }\r\n else if (definition.Extends)\r\n {\r\n var base = definition.Extends;\r\n\r\n initialize = function ()\r\n {\r\n base.apply(this, arguments);\r\n };\r\n }\r\n else\r\n {\r\n initialize = function () {};\r\n }\r\n\r\n if (definition.Extends)\r\n {\r\n initialize.prototype = Object.create(definition.Extends.prototype);\r\n initialize.prototype.constructor = initialize;\r\n\r\n // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin)\r\n\r\n Extends = definition.Extends;\r\n\r\n delete definition.Extends;\r\n }\r\n else\r\n {\r\n initialize.prototype.constructor = initialize;\r\n }\r\n\r\n // Grab the mixins, if they are specified...\r\n var mixins = null;\r\n\r\n if (definition.Mixins)\r\n {\r\n mixins = definition.Mixins;\r\n delete definition.Mixins;\r\n }\r\n\r\n // First, mixin if we can.\r\n mixin(initialize, mixins);\r\n\r\n // Now we grab the actual definition which defines the overrides.\r\n extend(initialize, definition, true, Extends);\r\n\r\n return initialize;\r\n}\r\n\r\nClass.extend = extend;\r\nClass.mixin = mixin;\r\nClass.ignoreFinals = false;\r\n\r\nmodule.exports = Class;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A NOOP (No Operation) callback function.\r\n *\r\n * Used internally by Phaser when it's more expensive to determine if a callback exists\r\n * than it is to just invoke an empty function.\r\n *\r\n * @function Phaser.Utils.NOOP\r\n * @since 3.0.0\r\n */\r\nvar NOOP = function ()\r\n{\r\n // NOOP\r\n};\r\n\r\nmodule.exports = NOOP;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar IsPlainObject = require('./IsPlainObject');\r\n\r\n// @param {boolean} deep - Perform a deep copy?\r\n// @param {object} target - The target object to copy to.\r\n// @return {object} The extended object.\r\n\r\n/**\r\n * This is a slightly modified version of http://api.jquery.com/jQuery.extend/\r\n *\r\n * @function Phaser.Utils.Objects.Extend\r\n * @since 3.0.0\r\n *\r\n * @return {object} The extended object.\r\n */\r\nvar Extend = function ()\r\n{\r\n var options, name, src, copy, copyIsArray, clone,\r\n target = arguments[0] || {},\r\n i = 1,\r\n length = arguments.length,\r\n deep = false;\r\n\r\n // Handle a deep copy situation\r\n if (typeof target === 'boolean')\r\n {\r\n deep = target;\r\n target = arguments[1] || {};\r\n\r\n // skip the boolean and the target\r\n i = 2;\r\n }\r\n\r\n // extend Phaser if only one argument is passed\r\n if (length === i)\r\n {\r\n target = this;\r\n --i;\r\n }\r\n\r\n for (; i < length; i++)\r\n {\r\n // Only deal with non-null/undefined values\r\n if ((options = arguments[i]) != null)\r\n {\r\n // Extend the base object\r\n for (name in options)\r\n {\r\n src = target[name];\r\n copy = options[name];\r\n\r\n // Prevent never-ending loop\r\n if (target === copy)\r\n {\r\n continue;\r\n }\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy))))\r\n {\r\n if (copyIsArray)\r\n {\r\n copyIsArray = false;\r\n clone = src && Array.isArray(src) ? src : [];\r\n }\r\n else\r\n {\r\n clone = src && IsPlainObject(src) ? src : {};\r\n }\r\n\r\n // Never move original objects, clone them\r\n target[name] = Extend(deep, clone, copy);\r\n\r\n // Don't bring in undefined values\r\n }\r\n else if (copy !== undefined)\r\n {\r\n target[name] = copy;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Return the modified object\r\n return target;\r\n};\r\n\r\nmodule.exports = Extend;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH = require('../../math');\r\nvar GetValue = require('./GetValue');\r\n\r\n/**\r\n * Retrieves a value from an object. Allows for more advanced selection options, including:\r\n *\r\n * Allowed types:\r\n * \r\n * Implicit\r\n * {\r\n * x: 4\r\n * }\r\n *\r\n * From function\r\n * {\r\n * x: function ()\r\n * }\r\n *\r\n * Randomly pick one element from the array\r\n * {\r\n * x: [a, b, c, d, e, f]\r\n * }\r\n *\r\n * Random integer between min and max:\r\n * {\r\n * x: { randInt: [min, max] }\r\n * }\r\n *\r\n * Random float between min and max:\r\n * {\r\n * x: { randFloat: [min, max] }\r\n * }\r\n * \r\n *\r\n * @function Phaser.Utils.Objects.GetAdvancedValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @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.\r\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\r\n *\r\n * @return {*} The value of the requested key.\r\n */\r\nvar GetAdvancedValue = function (source, key, defaultValue)\r\n{\r\n var value = GetValue(source, key, null);\r\n\r\n if (value === null)\r\n {\r\n return defaultValue;\r\n }\r\n else if (Array.isArray(value))\r\n {\r\n return MATH.RND.pick(value);\r\n }\r\n else if (typeof value === 'object')\r\n {\r\n if (value.hasOwnProperty('randInt'))\r\n {\r\n return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]);\r\n }\r\n else if (value.hasOwnProperty('randFloat'))\r\n {\r\n return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]);\r\n }\r\n }\r\n else if (typeof value === 'function')\r\n {\r\n return value(key);\r\n }\r\n\r\n return value;\r\n};\r\n\r\nmodule.exports = GetAdvancedValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue}\r\n *\r\n * @function Phaser.Utils.Objects.GetFastValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to search\r\n * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods)\r\n * @param {*} [defaultValue] - The default value to use if the key does not exist.\r\n *\r\n * @return {*} The value if found; otherwise, defaultValue (null if none provided)\r\n */\r\nvar GetFastValue = function (source, key, defaultValue)\r\n{\r\n var t = typeof(source);\r\n\r\n if (!source || t === 'number' || t === 'string')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key) && source[key] !== undefined)\r\n {\r\n return source[key];\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetFastValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Source object\r\n// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner'\r\n// The default value to use if the key doesn't exist\r\n\r\n/**\r\n * Retrieves a value from an object.\r\n *\r\n * @function Phaser.Utils.Objects.GetValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @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.\r\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\r\n *\r\n * @return {*} The value of the requested key.\r\n */\r\nvar GetValue = function (source, key, defaultValue)\r\n{\r\n if (!source || typeof source === 'number')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key))\r\n {\r\n return source[key];\r\n }\r\n else if (key.indexOf('.') !== -1)\r\n {\r\n var keys = key.split('.');\r\n var parent = source;\r\n var value = defaultValue;\r\n\r\n // Use for loop here so we can break early\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n if (parent.hasOwnProperty(keys[i]))\r\n {\r\n // Yes it has a key property, let's carry on down\r\n value = parent[keys[i]];\r\n\r\n parent = parent[keys[i]];\r\n }\r\n else\r\n {\r\n // Can't go any further, so reset to default\r\n value = defaultValue;\r\n break;\r\n }\r\n }\r\n\r\n return value;\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * This is a slightly modified version of jQuery.isPlainObject.\r\n * A plain object is an object whose internal class property is [object Object].\r\n *\r\n * @function Phaser.Utils.Objects.IsPlainObject\r\n * @since 3.0.0\r\n *\r\n * @param {object} obj - The object to inspect.\r\n *\r\n * @return {boolean} `true` if the object is plain, otherwise `false`.\r\n */\r\nvar IsPlainObject = function (obj)\r\n{\r\n // Not plain objects:\r\n // - Any object or value whose internal [[Class]] property is not \"[object Object]\"\r\n // - DOM nodes\r\n // - window\r\n if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window)\r\n {\r\n return false;\r\n }\r\n\r\n // Support: Firefox <20\r\n // The try/catch suppresses exceptions thrown when attempting to access\r\n // the \"constructor\" property of certain host objects, ie. |window.location|\r\n // https://bugzilla.mozilla.org/show_bug.cgi?id=814622\r\n try\r\n {\r\n if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf'))\r\n {\r\n return false;\r\n }\r\n }\r\n catch (e)\r\n {\r\n return false;\r\n }\r\n\r\n // If the function hasn't returned already, we're confident that\r\n // |obj| is a plain object, created by {} or constructed with new Object\r\n return true;\r\n};\r\n\r\nmodule.exports = IsPlainObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = require('../../../src/utils/Class');\r\nvar GetFastValue = require('../../../src/utils/object/GetFastValue');\r\nvar ImageFile = require('../../../src/loader/filetypes/ImageFile.js');\r\nvar IsPlainObject = require('../../../src/utils/object/IsPlainObject');\r\nvar JSONFile = require('../../../src/loader/filetypes/JSONFile.js');\r\nvar MultiFile = require('../../../src/loader/MultiFile.js');\r\nvar TextFile = require('../../../src/loader/filetypes/TextFile.js');\r\n\r\n/**\r\n * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig\r\n *\r\n * @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager.\r\n * @property {string} [textureURL] - The absolute or relative URL to load the texture image file from.\r\n * @property {string} [textureExtension='png'] - The default file extension to use for the image texture if no url is provided.\r\n * @property {XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture image file.\r\n * @property {string} [normalMap] - The filename of an associated normal map. It uses the same path and url to load as the texture image.\r\n * @property {string} [atlasURL] - The absolute or relative URL to load the atlas data file from.\r\n * @property {string} [atlasExtension='txt'] - The default file extension to use for the atlas data if no url is provided.\r\n * @property {XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas data file.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * A Spine File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#spine method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spine.\r\n *\r\n * @class SpineFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @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\".\r\n * @param {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not?\r\n * @param {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.\r\n */\r\nvar SpineFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function SpineFile (loader, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)\r\n {\r\n var i;\r\n var json;\r\n var atlas;\r\n var files = [];\r\n var cache = loader.cacheManager.custom.spine;\r\n\r\n // atlas can be an array of atlas files, not just a single one\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n\r\n json = new JSONFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'jsonURL'),\r\n extension: GetFastValue(config, 'jsonExtension', 'json'),\r\n xhrSettings: GetFastValue(config, 'jsonXhrSettings')\r\n });\r\n\r\n atlasURL = GetFastValue(config, 'atlasURL');\r\n preMultipliedAlpha = GetFastValue(config, 'preMultipliedAlpha');\r\n\r\n if (!Array.isArray(atlasURL))\r\n {\r\n atlasURL = [ atlasURL ];\r\n }\r\n\r\n for (i = 0; i < atlasURL.length; i++)\r\n {\r\n atlas = new TextFile(loader, {\r\n key: key,\r\n url: atlasURL[i],\r\n extension: GetFastValue(config, 'atlasExtension', 'atlas'),\r\n xhrSettings: GetFastValue(config, 'atlasXhrSettings')\r\n });\r\n\r\n atlas.cache = cache;\r\n\r\n files.push(atlas);\r\n }\r\n }\r\n else\r\n {\r\n json = new JSONFile(loader, key, jsonURL, jsonXhrSettings);\r\n\r\n if (!Array.isArray(atlasURL))\r\n {\r\n atlasURL = [ atlasURL ];\r\n }\r\n\r\n for (i = 0; i < atlasURL.length; i++)\r\n {\r\n atlas = new TextFile(loader, key + '_' + i, atlasURL[i], atlasXhrSettings);\r\n atlas.cache = cache;\r\n\r\n files.push(atlas);\r\n }\r\n }\r\n\r\n files.unshift(json);\r\n\r\n MultiFile.call(this, loader, 'spine', key, files);\r\n\r\n this.config.preMultipliedAlpha = preMultipliedAlpha;\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.FileTypes.SpineFile#onFileComplete\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n\r\n if (file.type === 'text')\r\n {\r\n // Inspect the data for the files to now load\r\n var content = file.data.split('\\n');\r\n\r\n // Extract the textures\r\n var textures = [];\r\n\r\n for (var t = 0; t < content.length; t++)\r\n {\r\n var line = content[t];\r\n\r\n if (line.trim() === '' && t < content.length - 1)\r\n {\r\n line = content[t + 1];\r\n\r\n textures.push(line);\r\n }\r\n }\r\n\r\n var config = this.config;\r\n var loader = this.loader;\r\n\r\n var currentBaseURL = loader.baseURL;\r\n var currentPath = loader.path;\r\n var currentPrefix = loader.prefix;\r\n\r\n var baseURL = GetFastValue(config, 'baseURL', currentBaseURL);\r\n var path = GetFastValue(config, 'path', currentPath);\r\n var prefix = GetFastValue(config, 'prefix', currentPrefix);\r\n var textureXhrSettings = GetFastValue(config, 'textureXhrSettings');\r\n\r\n loader.setBaseURL(baseURL);\r\n loader.setPath(path);\r\n loader.setPrefix(prefix);\r\n\r\n for (var i = 0; i < textures.length; i++)\r\n {\r\n var textureURL = textures[i];\r\n\r\n var key = '_SP_' + textureURL;\r\n\r\n var image = new ImageFile(loader, key, textureURL, textureXhrSettings);\r\n\r\n this.addToMultiFile(image);\r\n\r\n loader.addFile(image);\r\n }\r\n\r\n // Reset the loader settings\r\n loader.setBaseURL(currentBaseURL);\r\n loader.setPath(currentPath);\r\n loader.setPrefix(currentPrefix);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.SpineFile#addToCache\r\n * @since 3.19.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n var fileJSON = this.files[0];\r\n\r\n fileJSON.addToCache();\r\n\r\n var atlasCache;\r\n var atlasKey = '';\r\n var combinedAtlastData = '';\r\n var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false;\r\n\r\n for (var i = 1; i < this.files.length; i++)\r\n {\r\n var file = this.files[i];\r\n\r\n if (file.type === 'text')\r\n {\r\n atlasKey = file.key.substr(0, file.key.length - 2);\r\n\r\n atlasCache = file.cache;\r\n\r\n combinedAtlastData = combinedAtlastData.concat(file.data);\r\n }\r\n else\r\n {\r\n var key = file.key.substr(4).trim();\r\n \r\n this.loader.textureManager.addImage(key, file.data);\r\n }\r\n\r\n file.pendingDestroy();\r\n }\r\n\r\n atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlastData });\r\n\r\n this.complete = true;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpineFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar BuildGameObject = require('../../../src/gameobjects/BuildGameObject');\r\nvar Class = require('../../../src/utils/Class');\r\nvar GetValue = require('../../../src/utils/object/GetValue');\r\nvar ResizeEvent = require('../../../src/scale/events/RESIZE_EVENT');\r\nvar ScenePlugin = require('../../../src/plugins/ScenePlugin');\r\nvar Spine = require('Spine');\r\nvar SpineFile = require('./SpineFile');\r\nvar SpineGameObject = require('./gameobject/SpineGameObject');\r\n\r\n/**\r\n * @classdesc\r\n * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game objects.\r\n * \r\n * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin\r\n * uses the Spine 3.7 runtimes. Files created in a more recent version of Spine may not work as a result.\r\n * \r\n * You can find more details about Spine at http://esotericsoftware.com/.\r\n * \r\n * Please note that you require a Spine license in order to use Spine Runtimes in your games.\r\n * \r\n * You can install this plugin into your Phaser game by either importing it, if you're using ES6:\r\n * \r\n * ```javascript\r\n * import * as SpinePlugin from './SpinePlugin.js';\r\n * ```\r\n * \r\n * and then adding it to your Phaser Game configuration:\r\n * \r\n * ```javascript\r\n * plugins: {\r\n * scene: [\r\n * { key: 'SpinePlugin', plugin: window.SpinePlugin, mapping: 'spine' }\r\n * ]\r\n * }\r\n * ```\r\n * \r\n * If you're using ES5 then you can load the Spine Plugin in a Scene files payload, _within_ your\r\n * Game Configuration object, like this:\r\n * \r\n * ```javascript\r\n * scene: {\r\n * preload: preload,\r\n * create: create,\r\n * pack: {\r\n * files: [\r\n * { type: 'scenePlugin', key: 'SpinePlugin', url: 'plugins/SpinePlugin.js', sceneKey: 'spine' }\r\n * ]\r\n * }\r\n * }\r\n * ```\r\n * \r\n * Loading it like this allows you to then use commands such as `this.load.spine` from within the\r\n * same Scene. Alternatively, you can use the method `this.load.plugin` to load the plugin via the normal\r\n * Phaser Loader. However, doing so will not add it to the current Scene. It will be available from any\r\n * subsequent Scenes.\r\n * \r\n * Assuming a default environment you access it from within a Scene by using the `this.spine` reference.\r\n * \r\n * When this plugin is installed into a Scene it will add a Loader File Type, allowing you to load\r\n * Spine files directly, i.e.:\r\n * \r\n * ```javascript\r\n * this.load.spine('stretchyman', 'stretchyman-pro.json', [ 'stretchyman-pma.atlas' ], true);\r\n * ```\r\n * \r\n * It also installs a Game Object Factory method, allowin you to create Spine Game Objects:\r\n * \r\n * ```javascript\r\n * this.add.spine(512, 650, 'stretchyman')\r\n * ```\r\n * \r\n * The first argument is the key which you used when importing the Spine data. There are lots of\r\n * things you can specify, such as the animation name, skeleton, slot attachments and more. Please\r\n * see the respective documentation and examples for further details.\r\n * \r\n * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary.\r\n * The associated atlas files are scanned for any texture files present in them, which are then loaded.\r\n * If you have exported your Spine data with preMultipiedAlpha set, then you should enable this in the\r\n * load arguments, or you may see black outlines around skeleton textures.\r\n * \r\n * The Spine plugin is local to the Scene in which it is installed. This means a change to something,\r\n * such as the Skeleton Debug Renderer, in this Scene, will not impact the renderer in any other Scene.\r\n * The only exception to this is with the caches this plugin creates. Spine atlas and texture data are\r\n * stored in their own caches, which are global, meaning they're accessible from any Scene in your\r\n * game, regardless if the Scene loaded the Spine data or not.\r\n * \r\n * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference\r\n *\r\n * @class SpinePlugin\r\n * @memberOf Phaser\r\n * @extends Phaser.Plugins.ScenePlugin\r\n * @constructor\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Phaser Plugin Manager.\r\n */\r\nvar SpinePlugin = new Class({\r\n\r\n Extends: ScenePlugin,\r\n\r\n initialize:\r\n\r\n function SpinePlugin (scene, pluginManager)\r\n {\r\n ScenePlugin.call(this, scene, pluginManager);\r\n\r\n var game = pluginManager.game;\r\n\r\n /**\r\n * A read-only flag that indicates if the game is running under WebGL or Canvas.\r\n *\r\n * @name SpinePlugin#isWebGL\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.isWebGL = (game.config.renderType === 2);\r\n\r\n /**\r\n * A custom cache that stores the Spine atlas data.\r\n * \r\n * This cache is global across your game, allowing you to access Spine data loaded from other Scenes,\r\n * no matter which Scene you are in.\r\n *\r\n * @name SpinePlugin#cache\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.cache = game.cache.addCustom('spine');\r\n\r\n /**\r\n * A custom cache that stores the Spine Textures.\r\n * \r\n * This cache is global across your game, allowing you to access Spine data loaded from other Scenes,\r\n * no matter which Scene you are in.\r\n *\r\n * @name SpinePlugin#spineTextures\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.spineTextures = game.cache.addCustom('spineTextures');\r\n\r\n /**\r\n * A reference to the global JSON Cache.\r\n *\r\n * @name SpinePlugin#json\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.json = game.cache.json;\r\n\r\n /**\r\n * A reference to the global Texture Manager.\r\n *\r\n * @name SpinePlugin#textures\r\n * @type {Phaser.Textures.TextureManager}\r\n * @since 3.19.0\r\n */\r\n this.textures = game.textures;\r\n\r\n /**\r\n * A flag that sets if the Skeleton Renderers will render debug information over the top\r\n * of the skeleton or not.\r\n *\r\n * @name SpinePlugin#drawDebug\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.drawDebug = false;\r\n\r\n /**\r\n * The underlying WebGL context of the Phaser renderer.\r\n * \r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#gl\r\n * @type {WebGLRenderingContext}\r\n * @since 3.19.0\r\n */\r\n this.gl;\r\n\r\n /**\r\n * A reference to either the Canvas or WebGL Renderer that this Game is using.\r\n *\r\n * @name SpinePlugin#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.19.0\r\n */\r\n this.renderer;\r\n\r\n /**\r\n * An instance of the Spine WebGL Scene Renderer.\r\n * \r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#sceneRenderer\r\n * @type {spine.webgl.SceneRenderer}\r\n * @since 3.19.0\r\n */\r\n this.sceneRenderer;\r\n\r\n /**\r\n * An instance of the Spine Skeleton Renderer.\r\n *\r\n * @name SpinePlugin#skeletonRenderer\r\n * @type {(spine.canvas.SkeletonRenderer|spine.webgl.SkeletonRenderer)}\r\n * @since 3.19.0\r\n */\r\n this.skeletonRenderer;\r\n\r\n /**\r\n * An instance of the Spine Skeleton Debug Renderer.\r\n * \r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#skeletonDebugRenderer\r\n * @type {spine.webgl.skeletonDebugRenderer}\r\n * @since 3.19.0\r\n */\r\n this.skeletonDebugRenderer;\r\n\r\n /**\r\n * A reference to the Spine runtime.\r\n * This is the runtime created by Esoteric Software\r\n *\r\n * @name SpinePlugin#plugin\r\n * @type {spine}\r\n * @since 3.19.0\r\n */\r\n this.plugin = Spine;\r\n\r\n /**\r\n * An internal vector3 used by the screen to world method.\r\n *\r\n * @name SpinePlugin#temp1\r\n * @private\r\n * @type {spine.webgl.Vector3}\r\n * @since 3.19.0\r\n */\r\n this.temp1;\r\n\r\n /**\r\n * An internal vector3 used by the screen to world method.\r\n *\r\n * @name SpinePlugin#temp2\r\n * @private\r\n * @type {spine.webgl.Vector3}\r\n * @since 3.19.0\r\n */\r\n this.temp2;\r\n\r\n if (this.isWebGL)\r\n {\r\n this.runtime = Spine.webgl;\r\n\r\n this.renderer = game.renderer;\r\n this.gl = game.renderer.gl;\r\n\r\n this.getAtlas = this.getAtlasWebGL;\r\n }\r\n else\r\n {\r\n this.runtime = Spine.canvas;\r\n\r\n this.renderer = game.renderer;\r\n\r\n this.getAtlas = this.getAtlasCanvas;\r\n }\r\n\r\n pluginManager.registerFileType('spine', this.spineFileCallback, scene);\r\n\r\n pluginManager.registerGameObject('spine', this.add.bind(this), this.make.bind(this));\r\n },\r\n\r\n /**\r\n * Internal boot handler.\r\n *\r\n * @method SpinePlugin#boot\r\n * @private\r\n * @since 3.19.0\r\n */\r\n boot: function ()\r\n {\r\n if (this.isWebGL)\r\n {\r\n this.bootWebGL();\r\n this.onResize();\r\n this.game.scale.on(ResizeEvent, this.onResize, this);\r\n }\r\n else\r\n {\r\n this.bootCanvas();\r\n }\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.once('shutdown', this.shutdown, this);\r\n eventEmitter.once('destroy', this.destroy, this);\r\n },\r\n\r\n /**\r\n * Internal boot handler for the Canvas Renderer.\r\n *\r\n * @method SpinePlugin#bootCanvas\r\n * @private\r\n * @since 3.19.0\r\n */\r\n bootCanvas: function ()\r\n {\r\n this.skeletonRenderer = new Spine.canvas.SkeletonRenderer(this.scene.sys.context);\r\n },\r\n\r\n /**\r\n * Internal boot handler for the WebGL Renderer.\r\n *\r\n * @method SpinePlugin#bootWebGL\r\n * @private\r\n * @since 3.19.0\r\n */\r\n bootWebGL: function ()\r\n {\r\n this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true);\r\n\r\n // Monkeypatch the Spine setBlendMode functions, or batching is destroyed\r\n\r\n var setBlendMode = function (srcBlend, dstBlend)\r\n {\r\n if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend)\r\n {\r\n var gl = this.context.gl;\r\n\r\n this.srcBlend = srcBlend;\r\n this.dstBlend = dstBlend;\r\n\r\n if (this.isDrawing)\r\n {\r\n this.flush();\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n }\r\n }\r\n };\r\n\r\n this.sceneRenderer.batcher.setBlendMode = setBlendMode;\r\n this.sceneRenderer.shapes.setBlendMode = setBlendMode;\r\n\r\n this.skeletonRenderer = this.sceneRenderer.skeletonRenderer;\r\n this.skeletonDebugRenderer = this.sceneRenderer.skeletonDebugRenderer;\r\n\r\n this.temp1 = new Spine.webgl.Vector3(0, 0, 0);\r\n this.temp2 = new Spine.webgl.Vector3(0, 0, 0);\r\n },\r\n\r\n /**\r\n * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas,\r\n * then returns it. You do not normally need to invoke this method directly.\r\n *\r\n * @method SpinePlugin#getAtlasCanvas\r\n * @since 3.19.0\r\n * \r\n * @param {string} key - The key of the Spine Atlas to create.\r\n * \r\n * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.\r\n */\r\n getAtlasCanvas: function (key)\r\n {\r\n var atlasEntry = this.cache.get(key);\r\n\r\n if (!atlasEntry)\r\n {\r\n console.warn('No atlas data for: ' + key);\r\n return;\r\n }\r\n\r\n var atlas;\r\n var spineTextures = this.spineTextures;\r\n\r\n if (spineTextures.has(key))\r\n {\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function ()\r\n {\r\n return spineTextures.get(key);\r\n });\r\n }\r\n else\r\n {\r\n var textures = this.textures;\r\n\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)\r\n {\r\n var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage());\r\n\r\n spineTextures.add(key, canvasTexture);\r\n\r\n return canvasTexture;\r\n });\r\n }\r\n\r\n return atlas;\r\n },\r\n\r\n /**\r\n * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas,\r\n * then returns it. You do not normally need to invoke this method directly.\r\n *\r\n * @method SpinePlugin#getAtlasWebGL\r\n * @since 3.19.0\r\n * \r\n * @param {string} key - The key of the Spine Atlas to create.\r\n * \r\n * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.\r\n */\r\n getAtlasWebGL: function (key)\r\n {\r\n var atlasEntry = this.cache.get(key);\r\n\r\n if (!atlasEntry)\r\n {\r\n console.warn('No atlas data for: ' + key);\r\n return;\r\n }\r\n\r\n var atlas;\r\n var spineTextures = this.spineTextures;\r\n\r\n if (spineTextures.has(key))\r\n {\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function ()\r\n {\r\n return spineTextures.get(key);\r\n });\r\n }\r\n else\r\n {\r\n var textures = this.textures;\r\n\r\n var gl = this.sceneRenderer.context.gl;\r\n\r\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\r\n\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)\r\n {\r\n var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage(), false);\r\n\r\n spineTextures.add(key, glTexture);\r\n\r\n return glTexture;\r\n });\r\n }\r\n\r\n return atlas;\r\n },\r\n\r\n /**\r\n * Adds a Spine Skeleton and Atlas file, or array of files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.spine('spineBoy', 'boy.json', 'boy.atlas', true);\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n * \r\n * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary. The associated\r\n * atlas files are scanned for any texture files present in them, which are then loaded. If you have exported\r\n * your Spine data with preMultipiedAlpha set, then you should enable this in the arguments, or you may see black\r\n * outlines around skeleton textures.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global Spine cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Spine cache.\r\n * Loading a file using a key that is already taken will result in a warning.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.spine({\r\n * key: 'mainmenu',\r\n * jsonURL: 'boy.json',\r\n * atlasURL: 'boy.atlas',\r\n * preMultipliedAlpha: true\r\n * });\r\n * ```\r\n * \r\n * If you need to load multiple Spine atlas files, provide them as an array:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.spine('demos', 'demos.json', [ 'atlas1.atlas', 'atlas2.atlas' ], true);\r\n * }\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.SpineFileConfig` for more details.\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the data from the Spine plugin.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Spine Plugin has been built or loaded into Phaser.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#spine\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.19.0\r\n *\r\n * @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.\r\n * @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\".\r\n * @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\".\r\n * @param {boolean} [preMultipiedAlpha=false] - Do the texture files include pre-multiplied alpha or not?\r\n * @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.\r\n * @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.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\n spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)\r\n {\r\n var multifile;\r\n \r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new SpineFile(this, key[i]);\r\n \r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n \r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a new Spine Game Object and adds it to the Scene.\r\n * \r\n * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from\r\n * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects\r\n * do not have a Phaser origin.\r\n * \r\n * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period\r\n * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains\r\n * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference\r\n * that.\r\n * \r\n * ```javascript\r\n * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);\r\n * ```\r\n * \r\n * The key is optional. If not passed here, you need to call `SpineGameObject.setSkeleton()` to use it.\r\n * \r\n * The animation name is also optional and can be set later via `SpineGameObject.setAnimation`.\r\n * \r\n * Should you wish for more control over the object creation, such as setting a slot attachment or skin\r\n * name, then use `SpinePlugin.make` instead.\r\n *\r\n * @method SpinePlugin#add\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin.\r\n * @param {string} [animationName] - The name of the animation to set on this Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation playback be looped or not?\r\n *\r\n * @return {SpineGameObject} The Game Object that was created.\r\n */\r\n add: function (x, y, key, animationName, loop)\r\n {\r\n var spineGO = new SpineGameObject(this.scene, this, x, y, key, animationName, loop);\r\n\r\n this.scene.sys.displayList.add(spineGO);\r\n this.scene.sys.updateList.add(spineGO);\r\n \r\n return spineGO;\r\n },\r\n\r\n /**\r\n * Creates a new Spine Game Object from the given configuration file and optionally adds it to the Scene.\r\n * \r\n * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from\r\n * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects\r\n * do not have a Phaser origin.\r\n * \r\n * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period\r\n * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains\r\n * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference\r\n * that.\r\n * \r\n * ```javascript\r\n * let jelly = this.make.spine({\r\n * x: 500, y: 500, key: 'jelly',\r\n * scale: 1.5,\r\n * skinName: 'square_Green',\r\n * animationName: 'jelly-idle', loop: true,\r\n * slotName: 'hat', attachmentName: 'images/La_14'\r\n * });\r\n * ```\r\n *\r\n * @method SpinePlugin#make\r\n * @since 3.19.0\r\n *\r\n * @param {any} config - The configuration object this Game Object will use to create itself.\r\n * @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.\r\n *\r\n * @return {SpineGameObject} The Game Object that was created.\r\n */\r\n make: function (config, addToScene)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetValue(config, 'key', null);\r\n var animationName = GetValue(config, 'animationName', null);\r\n var loop = GetValue(config, 'loop', false);\r\n\r\n var spineGO = new SpineGameObject(this.scene, this, 0, 0, key, animationName, loop);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, spineGO, config);\r\n\r\n // Spine specific\r\n var skinName = GetValue(config, 'skinName', false);\r\n\r\n if (skinName)\r\n {\r\n spineGO.setSkinByName(skinName);\r\n }\r\n\r\n var slotName = GetValue(config, 'slotName', false);\r\n var attachmentName = GetValue(config, 'attachmentName', null);\r\n\r\n if (slotName)\r\n {\r\n spineGO.setAttachment(slotName, attachmentName);\r\n }\r\n\r\n return spineGO.refresh();\r\n },\r\n\r\n /**\r\n * Converts the given x and y screen coordinates into the world space of the given Skeleton.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#worldToLocal\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The screen space x coordinate to convert.\r\n * @param {number} y - The screen space y coordinate to convert.\r\n * @param {spine.Skeleton} skeleton - The Spine Skeleton to convert into.\r\n * @param {spine.Bone} [bone] - Optional bone of the Skeleton to convert into.\r\n * \r\n * @return {spine.Vector2} A Vector2 containing the translated point.\r\n */\r\n worldToLocal: function (x, y, skeleton, bone)\r\n {\r\n var temp1 = this.temp1;\r\n var temp2 = this.temp2;\r\n var camera = this.sceneRenderer.camera;\r\n\r\n temp1.set(x + skeleton.x, y - skeleton.y, 0);\r\n\r\n var width = camera.viewportWidth;\r\n var height = camera.viewportHeight;\r\n\r\n camera.screenToWorld(temp1, width, height);\r\n\r\n if (bone && bone.parent !== null)\r\n {\r\n bone.parent.worldToLocal(temp2.set(temp1.x - skeleton.x, temp1.y - skeleton.y, 0));\r\n\r\n return new Spine.Vector2(temp2.x, temp2.y);\r\n }\r\n else if (bone)\r\n {\r\n return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y);\r\n }\r\n else\r\n {\r\n return new Spine.Vector2(temp1.x, temp1.y);\r\n }\r\n },\r\n\r\n /**\r\n * Returns a Spine Vector2 based on the given x and y values.\r\n *\r\n * @method SpinePlugin#getVector2\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The Vector x value.\r\n * @param {number} y - The Vector y value.\r\n * \r\n * @return {spine.Vector2} A Spine Vector2 based on the given values.\r\n */\r\n getVector2: function (x, y)\r\n {\r\n return new Spine.Vector2(x, y);\r\n },\r\n\r\n /**\r\n * Returns a Spine Vector2 based on the given x, y and z values.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#getVector3\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The Vector x value.\r\n * @param {number} y - The Vector y value.\r\n * @param {number} z - The Vector z value.\r\n * \r\n * @return {spine.Vector2} A Spine Vector2 based on the given values.\r\n */\r\n getVector3: function (x, y, z)\r\n {\r\n return new Spine.webgl.Vector3(x, y, z);\r\n },\r\n\r\n /**\r\n * Sets `drawBones` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugBones\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugBones: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawBones = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawRegionAttachments` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugRegionAttachments\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugRegionAttachments: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawRegionAttachments = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawBoundingBoxes` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugBoundingBoxes\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugBoundingBoxes: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawBoundingBoxes = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawMeshHull` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugMeshHull\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugMeshHull: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawMeshHull = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawMeshTriangles` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugMeshTriangles\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugMeshTriangles: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawMeshTriangles = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawPaths` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugPaths\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugPaths: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawPaths = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawSkeletonXY` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugSkeletonXY\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugSkeletonXY: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawSkeletonXY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawClipping` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugClipping\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugClipping: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawClipping = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the given vertex effect on the Spine Skeleton Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setEffect\r\n * @since 3.19.0\r\n * \r\n * @param {spine.VertexEffect} [effect] - The vertex effect to set on the Skeleton Renderer.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setEffect: function (effect)\r\n {\r\n this.sceneRenderer.skeletonRenderer.vertexEffect = effect;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a Spine Skeleton based on the given key and optional Skeleton JSON data.\r\n * \r\n * The Skeleton data should have already been loaded before calling this method.\r\n *\r\n * @method SpinePlugin#createSkeleton\r\n * @since 3.19.0\r\n * \r\n * @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`.\r\n * @param {object} [skeletonJSON] - Optional Skeleton JSON data to use, instead of getting it from the cache.\r\n * \r\n * @return {(any|null)} This Spine Skeleton data object, or `null` if the key was invalid.\r\n */\r\n createSkeleton: function (key, skeletonJSON)\r\n {\r\n var atlasKey = key;\r\n var jsonKey = key;\r\n var split = (key.indexOf('.') !== -1);\r\n\r\n if (split)\r\n {\r\n var parts = key.split('.');\r\n\r\n atlasKey = parts.shift();\r\n jsonKey = parts.join('.');\r\n }\r\n\r\n var atlasData = this.cache.get(atlasKey);\r\n var atlas = this.getAtlas(atlasKey);\r\n\r\n if (!atlas)\r\n {\r\n return null;\r\n }\r\n\r\n var preMultipliedAlpha = atlasData.preMultipliedAlpha;\r\n\r\n var atlasLoader = new Spine.AtlasAttachmentLoader(atlas);\r\n \r\n var skeletonJson = new Spine.SkeletonJson(atlasLoader);\r\n\r\n var data;\r\n\r\n if (skeletonJSON)\r\n {\r\n data = skeletonJSON;\r\n }\r\n else\r\n {\r\n var json = this.json.get(atlasKey);\r\n\r\n data = (split) ? GetValue(json, jsonKey) : json;\r\n }\r\n\r\n if (data)\r\n {\r\n var skeletonData = skeletonJson.readSkeletonData(data);\r\n\r\n var skeleton = new Spine.Skeleton(skeletonData);\r\n \r\n return { skeletonData: skeletonData, skeleton: skeleton, preMultipliedAlpha: preMultipliedAlpha };\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n },\r\n\r\n /**\r\n * Creates a new Animation State and Animation State Data for the given skeleton.\r\n * \r\n * The returned object contains two properties: `state` and `stateData` respectively.\r\n *\r\n * @method SpinePlugin#createAnimationState\r\n * @since 3.19.0\r\n * \r\n * @param {spine.Skeleton} skeleton - The Skeleton to create the Animation State for.\r\n * \r\n * @return {any} An object containing the Animation State and Animation State Data instances.\r\n */\r\n createAnimationState: function (skeleton)\r\n {\r\n var stateData = new Spine.AnimationStateData(skeleton.data);\r\n\r\n var state = new Spine.AnimationState(stateData);\r\n\r\n return { stateData: stateData, state: state };\r\n },\r\n\r\n /**\r\n * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * \r\n * The returned object contains two properties: `offset` and `size`:\r\n * \r\n * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * `size` - The width and height of the AABB.\r\n *\r\n * @method SpinePlugin#getBounds\r\n * @since 3.19.0\r\n * \r\n * @param {spine.Skeleton} skeleton - The Skeleton to get the bounds from.\r\n * \r\n * @return {any} The bounds object.\r\n */\r\n getBounds: function (skeleton)\r\n {\r\n var offset = new Spine.Vector2();\r\n var size = new Spine.Vector2();\r\n\r\n skeleton.getBounds(offset, size, []);\r\n\r\n return { offset: offset, size: size };\r\n },\r\n\r\n /**\r\n * Internal handler for when the renderer resizes.\r\n * \r\n * Only called if running in WebGL.\r\n *\r\n * @method SpinePlugin#onResize\r\n * @since 3.19.0\r\n */\r\n onResize: function ()\r\n {\r\n var renderer = this.renderer;\r\n var sceneRenderer = this.sceneRenderer;\r\n\r\n var viewportWidth = renderer.width;\r\n var viewportHeight = renderer.height;\r\n\r\n sceneRenderer.camera.position.x = viewportWidth / 2;\r\n sceneRenderer.camera.position.y = viewportHeight / 2;\r\n \r\n sceneRenderer.camera.viewportWidth = viewportWidth;\r\n sceneRenderer.camera.viewportHeight = viewportHeight;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * \r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method SpinePlugin#shutdown\r\n * @private\r\n * @since 3.19.0\r\n */\r\n shutdown: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off('shutdown', this.shutdown, this);\r\n\r\n this.sceneRenderer.dispose();\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * \r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method SpinePlugin#destroy\r\n * @private\r\n * @since 3.19.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.pluginManager.removeGameObject('spine', true, true);\r\n\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n\r\n this.cache = null;\r\n this.spineTextures = null;\r\n this.json = null;\r\n this.textures = null;\r\n this.sceneRenderer = null;\r\n this.skeletonRenderer = null;\r\n this.gl = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpinePlugin;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#COMPLETE\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'complete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#DISPOSE\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'dispose';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#END\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'end';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#EVENT\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'event';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#INTERRUPTED\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'interrupted';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#START\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace SpinePluginEvents\r\n */\r\n\r\nmodule.exports = {\r\n\r\n COMPLETE: require('./COMPLETE_EVENT'),\r\n DISPOSE: require('./DISPOSE_EVENT'),\r\n END: require('./END_EVENT'),\r\n EVENT: require('./EVENT_EVENT'),\r\n INTERRUPTED: require('./INTERRUPTED_EVENT'),\r\n START: require('./START_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar AngleBetween = require('../../../../src/math/angle/Between');\r\nvar Clamp = require('../../../../src/math/Clamp');\r\nvar Class = require('../../../../src/utils/Class');\r\nvar ComponentsComputedSize = require('../../../../src/gameobjects/components/ComputedSize');\r\nvar ComponentsDepth = require('../../../../src/gameobjects/components/Depth');\r\nvar ComponentsFlip = require('../../../../src/gameobjects/components/Flip');\r\nvar ComponentsScrollFactor = require('../../../../src/gameobjects/components/ScrollFactor');\r\nvar ComponentsTransform = require('../../../../src/gameobjects/components/Transform');\r\nvar ComponentsVisible = require('../../../../src/gameobjects/components/Visible');\r\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\r\nvar DegToRad = require('../../../../src/math/DegToRad');\r\nvar GameObject = require('../../../../src/gameobjects/GameObject');\r\nvar RadToDeg = require('../../../../src/math/RadToDeg');\r\nvar SpineEvents = require('../events/');\r\nvar SpineGameObjectRender = require('./SpineGameObjectRender');\r\n\r\n/**\r\n * @classdesc\r\n * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates\r\n * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to\r\n * easily change the skin, slot attachment, bone positions and more.\r\n * \r\n * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly.\r\n * You can only create them if the Spine plugin has been loaded into Phaser.\r\n * \r\n * The quickest way is the Game Object Factory:\r\n * \r\n * ```javascript\r\n * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);\r\n * ```\r\n * \r\n * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly`\r\n * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is\r\n * an optional animation to start playing on the skeleton. The final argument `true` sets the\r\n * animation to loop. Look at the documentation for further details on each of these options.\r\n * \r\n * For more control, you can use the Game Object Creator, passing in a Spine Game Object\r\n * Configuration object:\r\n * \r\n * ```javascript\r\n * let jelly = this.make.spine({\r\n * x: 512, y: 550, key: 'jelly',\r\n * scale: 1.5,\r\n * skinName: 'square_Green',\r\n * animationName: 'jelly-think', loop: true,\r\n * slotName: 'hat', attachmentName: 'images/La_14'\r\n * });\r\n * ```\r\n * \r\n * Here, you've got the ability to specify extra details, such as the slot name, attachments or\r\n * overall scale.\r\n * \r\n * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to\r\n * update and render, it must be added to the display and update lists of your Scene:\r\n * \r\n * ```javascript\r\n * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true);\r\n * this.sys.displayList.add(jelly);\r\n * this.sys.updateList.add(jelly);\r\n * ```\r\n * \r\n * It's possible to enable Spine Game Objects for input, but you should be aware that it will use\r\n * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but\r\n * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created.\r\n * If it's not suitable, provide your own shape to the `setInteractive` method.\r\n * \r\n * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for\r\n * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game\r\n * Object position with it. See the examples for further details.\r\n * \r\n * If your Spine Game Object has black outlines around the different parts of the texture when it\r\n * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have\r\n * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details.\r\n *\r\n * @class SpineGameObject\r\n * @constructor\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to.\r\n * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin.\r\n * @param {string} [animationName] - The name of the animation to set on this Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation playback be looped or not?\r\n */\r\nvar SpineGameObject = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n ComponentsComputedSize,\r\n ComponentsDepth,\r\n ComponentsFlip,\r\n ComponentsScrollFactor,\r\n ComponentsTransform,\r\n ComponentsVisible,\r\n SpineGameObjectRender\r\n ],\r\n\r\n initialize:\r\n\r\n function SpineGameObject (scene, plugin, x, y, key, animationName, loop)\r\n {\r\n GameObject.call(this, scene, 'Spine');\r\n\r\n /**\r\n * A reference to the Spine Plugin.\r\n *\r\n * @name SpineGameObject#plugin\r\n * @type {SpinePlugin}\r\n * @since 3.19.0\r\n */\r\n this.plugin = plugin;\r\n\r\n /**\r\n * The Spine Skeleton this Game Object is using.\r\n *\r\n * @name SpineGameObject#skeleton\r\n * @type {spine.Skeleton}\r\n * @since 3.19.0\r\n */\r\n this.skeleton = null;\r\n\r\n /**\r\n * The Spine Skeleton Data associated with the Skeleton this Game Object is using.\r\n *\r\n * @name SpineGameObject#skeletonData\r\n * @type {spine.SkeletonData}\r\n * @since 3.19.0\r\n */\r\n this.skeletonData = null;\r\n\r\n /**\r\n * The Spine Animation State this Game Object is using.\r\n *\r\n * @name SpineGameObject#state\r\n * @type {spine.AnimationState}\r\n * @since 3.19.0\r\n */\r\n this.state = null;\r\n\r\n /**\r\n * The Spine Animation State Data associated with the Animation State this Game Object is using.\r\n *\r\n * @name SpineGameObject#stateData\r\n * @type {spine.AnimationStateData}\r\n * @since 3.19.0\r\n */\r\n this.stateData = null;\r\n\r\n /**\r\n * A reference to the root bone of the Skeleton.\r\n *\r\n * @name SpineGameObject#root\r\n * @type {spine.Bone}\r\n * @since 3.19.0\r\n */\r\n this.root = null;\r\n\r\n /**\r\n * This object holds the calculated bounds of the current\r\n * pose, as set when a new Skeleton is applied.\r\n *\r\n * @name SpineGameObject#bounds\r\n * @type {any}\r\n * @since 3.19.0\r\n */\r\n this.bounds = null;\r\n \r\n /**\r\n * A Game Object level flag that allows you to enable debug drawing\r\n * to the Skeleton Debug Renderer by toggling it.\r\n *\r\n * @name SpineGameObject#drawDebug\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.drawDebug = false;\r\n\r\n /**\r\n * The factor to scale the Animation update time by.\r\n *\r\n * @name SpineGameObject#timeScale\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.timeScale = 1;\r\n\r\n /**\r\n * The calculated Display Origin of this Game Object.\r\n *\r\n * @name SpineGameObject#displayOriginX\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.displayOriginX = 0;\r\n\r\n /**\r\n * The calculated Display Origin of this Game Object.\r\n *\r\n * @name SpineGameObject#displayOriginY\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.displayOriginY = 0;\r\n\r\n /**\r\n * A flag that stores if the texture associated with the current\r\n * Skin being used by this Game Object, has its alpha pre-multiplied\r\n * into it, or not.\r\n *\r\n * @name SpineGameObject#preMultipliedAlpha\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.preMultipliedAlpha = false;\r\n\r\n /**\r\n * A default Blend Mode. You cannot change the blend mode of a\r\n * Spine Game Object.\r\n *\r\n * @name SpineGameObject#blendMode\r\n * @type {number}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.blendMode = 0;\r\n\r\n this.setPosition(x, y);\r\n\r\n if (key)\r\n {\r\n this.setSkeleton(key, animationName, loop);\r\n }\r\n },\r\n\r\n /**\r\n * Overrides the default Game Object method and always returns true.\r\n * Rendering is decided in the renderer functions.\r\n *\r\n * @method SpineGameObject#willRender\r\n * @since 3.19.0\r\n *\r\n * @return {boolean} Always returns `true`.\r\n */\r\n willRender: function ()\r\n {\r\n return true;\r\n },\r\n\r\n /**\r\n * Set the Alpha level for the whole Skeleton of this Game Object.\r\n * \r\n * The alpha controls the opacity of the Game Object as it renders.\r\n * \r\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\r\n *\r\n * @method SpineGameObject#setAlpha\r\n * @since 3.19.0\r\n *\r\n * @param {number} [value=1] - The alpha value used for the whole Skeleton.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAlpha: function (value, slotName)\r\n {\r\n if (value === undefined) { value = 1; }\r\n\r\n if (slotName)\r\n {\r\n var slot = this.findSlot(slotName);\r\n\r\n if (slot)\r\n {\r\n slot.color.a = Clamp(value, 0, 1);\r\n }\r\n }\r\n else\r\n {\r\n this.alpha = value;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The alpha value of the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#alpha\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n alpha: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.a;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.a = v;\r\n }\r\n\r\n if (v === 0)\r\n {\r\n this.renderFlags &= ~2;\r\n }\r\n else\r\n {\r\n this.renderFlags |= 2;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of red used when rendering the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#red\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n red: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.r;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.r = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of green used when rendering the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#green\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n green: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.g;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.g = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of blue used when rendering the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#blue\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n blue: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.b;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.b = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton.\r\n *\r\n * @method SpineGameObject#setColor\r\n * @since 3.19.0\r\n *\r\n * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color.\r\n * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setColor: function (color, slotName)\r\n {\r\n if (color === undefined) { color = 0xffffff; }\r\n\r\n var red = (color >> 16 & 0xFF) / 255;\r\n var green = (color >> 8 & 0xFF) / 255;\r\n var blue = (color & 0xFF) / 255;\r\n var alpha = (color > 16777215) ? (color >>> 24) / 255 : null;\r\n\r\n var target = this.skeleton;\r\n\r\n if (slotName)\r\n {\r\n var slot = this.findSlot(slotName);\r\n\r\n if (slot)\r\n {\r\n target = slot;\r\n }\r\n }\r\n\r\n target.color.r = red;\r\n target.color.g = green;\r\n target.color.b = blue;\r\n\r\n if (alpha !== null)\r\n {\r\n target.color.a = alpha;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object\r\n * that contains the Skeleton data.\r\n *\r\n * @method SpineGameObject#setSkeletonFromJSON\r\n * @since 3.19.0\r\n * \r\n * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton.\r\n * @param {object} skeletonJSON - The JSON data for the Skeleton.\r\n * @param {string} [animationName] - Optional name of the animation to set on the Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation, if set, loop or not?\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop)\r\n {\r\n return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop);\r\n },\r\n\r\n /**\r\n * Sets this Game Object to use the given Skeleton based on its cache key.\r\n * \r\n * Typically, once set, the Skeleton doesn't change. Instead, you change the skin,\r\n * or slot attachment, or any other property to adjust it.\r\n *\r\n * @method SpineGameObject#setSkeleton\r\n * @since 3.19.0\r\n * \r\n * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton.\r\n * @param {object} skeletonJSON - The JSON data for the Skeleton.\r\n * @param {string} [animationName] - Optional name of the animation to set on the Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation, if set, loop or not?\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON)\r\n {\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON);\r\n\r\n this.skeletonData = data.skeletonData;\r\n\r\n this.preMultipliedAlpha = data.preMultipliedAlpha;\r\n\r\n var skeleton = data.skeleton;\r\n\r\n skeleton.setSkinByName('default');\r\n skeleton.setToSetupPose();\r\n\r\n this.skeleton = skeleton;\r\n\r\n // AnimationState\r\n data = this.plugin.createAnimationState(skeleton);\r\n\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n this.state = data.state;\r\n this.stateData = data.stateData;\r\n\r\n this.state.addListener({\r\n event: this.onEvent.bind(this),\r\n complete: this.onComplete.bind(this),\r\n start: this.onStart.bind(this),\r\n end: this.onEnd.bind(this),\r\n dispose: this.onDispose.bind(this),\r\n interrupted: this.onInterrupted.bind(this)\r\n });\r\n\r\n if (animationName)\r\n {\r\n this.setAnimation(0, animationName, loop);\r\n }\r\n\r\n this.root = this.getRootBone();\r\n\r\n if (this.root)\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90;\r\n }\r\n\r\n this.state.apply(skeleton);\r\n\r\n skeleton.updateCache();\r\n\r\n return this.updateSize();\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onComplete event via this Game Object.\r\n *\r\n * @method SpineGameObject#onComplete\r\n * @fires SpinePluginEvents#COMPLETE\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onComplete: function (entry)\r\n {\r\n this.emit(SpineEvents.COMPLETE, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onDispose event via this Game Object.\r\n *\r\n * @method SpineGameObject#onDispose\r\n * @fires SpinePluginEvents#DISPOSE\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onDispose: function (entry)\r\n {\r\n this.emit(SpineEvents.DISPOSE, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onEnd event via this Game Object.\r\n *\r\n * @method SpineGameObject#onEnd\r\n * @fires SpinePluginEvents#END\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onEnd: function (entry)\r\n {\r\n this.emit(SpineEvents.END, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine Event event via this Game Object.\r\n *\r\n * @method SpineGameObject#onEvent\r\n * @fires SpinePluginEvents#EVENT\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n * @param {spine.Event} event - The Spine event.\r\n */\r\n onEvent: function (entry, event)\r\n {\r\n this.emit(SpineEvents.EVENT, entry, event);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onInterrupted event via this Game Object.\r\n *\r\n * @method SpineGameObject#onInterrupted\r\n * @fires SpinePluginEvents#INTERRUPTED\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onInterrupted: function (entry)\r\n {\r\n this.emit(SpineEvents.INTERRUPTED, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onStart event via this Game Object.\r\n *\r\n * @method SpineGameObject#onStart\r\n * @fires SpinePluginEvents#START\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onStart: function (entry)\r\n {\r\n this.emit(SpineEvents.START, entry);\r\n },\r\n\r\n /**\r\n * Refreshes the data about the current Skeleton.\r\n * \r\n * This will reset the rotation, position and size of the Skeleton to match this Game Object.\r\n * \r\n * Call this method if you need to access the Skeleton data directly, and it may have changed\r\n * recently.\r\n *\r\n * @method SpineGameObject#refresh\r\n * @since 3.19.0\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n refresh: function ()\r\n {\r\n if (this.root)\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90;\r\n }\r\n\r\n this.updateSize();\r\n\r\n this.skeleton.updateCache();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the size of this Game Object.\r\n * \r\n * If no arguments are given it uses the current skeleton data dimensions.\r\n * \r\n * You can use this method to set a fixed size of this Game Object, such as for input detection,\r\n * when the skeleton data doesn't match what is required in-game.\r\n *\r\n * @method SpineGameObject#setSize\r\n * @since 3.19.0\r\n * \r\n * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width.\r\n * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height.\r\n * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate.\r\n * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate.\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n setSize: function (width, height, offsetX, offsetY)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n if (width === undefined) { width = skeleton.data.width; }\r\n if (height === undefined) { height = skeleton.data.height; }\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n this.displayOriginX = skeleton.x - offsetX;\r\n this.displayOriginY = skeleton.y - offsetY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the offset of this Game Object from the Skeleton position.\r\n * \r\n * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using.\r\n *\r\n * @method SpineGameObject#setOffset\r\n * @since 3.19.0\r\n * \r\n * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate.\r\n * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate.\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n setOffset: function (offsetX, offsetY)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n this.displayOriginX = skeleton.x - offsetX;\r\n this.displayOriginY = skeleton.y - offsetY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that syncs all of the Game Object position and scale data to the Skeleton.\r\n * It then syncs the skeleton bounds back to this Game Object.\r\n * \r\n * This method is called automatically as needed internally, however, it's also exposed should\r\n * you require overriding the size settings.\r\n *\r\n * @method SpineGameObject#updateSize\r\n * @since 3.19.0\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n updateSize: function ()\r\n {\r\n var skeleton = this.skeleton;\r\n var renderer = this.plugin.renderer;\r\n\r\n var height = renderer.height;\r\n\r\n var oldScaleX = this.scaleX;\r\n var oldScaleY = this.scaleY;\r\n\r\n skeleton.x = this.x;\r\n skeleton.y = height - this.y;\r\n skeleton.scaleX = 1;\r\n skeleton.scaleY = 1;\r\n\r\n skeleton.updateWorldTransform();\r\n\r\n var bounds = this.getBounds();\r\n\r\n this.width = bounds.size.x;\r\n this.height = bounds.size.y;\r\n\r\n this.displayOriginX = this.x - bounds.offset.x;\r\n this.displayOriginY = this.y - (height - (this.height + bounds.offset.y));\r\n\r\n skeleton.scaleX = oldScaleX;\r\n skeleton.scaleY = oldScaleY;\r\n\r\n skeleton.updateWorldTransform();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The horizontal scale of this Game Object, as applied to the Skeleton it is using.\r\n *\r\n * @name SpineGameObject#scaleX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.19.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n\r\n this.refresh();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of this Game Object, as applied to the Skeleton it is using.\r\n *\r\n * @name SpineGameObject#scaleY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.19.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleY = value;\r\n\r\n this.refresh();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the bones in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getBoneList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the bones in the Skeleton Data.\r\n */\r\n getBoneList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.bones.length; i++)\r\n {\r\n output.push(skeletonData.bones[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the skins in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getSkinList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the skins in the Skeleton Data.\r\n */\r\n getSkinList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.skins.length; i++)\r\n {\r\n output.push(skeletonData.skins[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the slots in the Skeleton.\r\n *\r\n * @method SpineGameObject#getSlotList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the slots in the Skeleton.\r\n */\r\n getSlotList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeleton = this.skeleton;\r\n\r\n for (var i = 0; i < skeleton.slots.length; i++)\r\n {\r\n output.push(skeleton.slots[i].data.name);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the animations in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getAnimationList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the animations in the Skeleton Data.\r\n */\r\n getAnimationList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.animations.length; i++)\r\n {\r\n output.push(skeletonData.animations[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the current animation being played on the given track, if any.\r\n *\r\n * @method SpineGameObject#getCurrentAnimation\r\n * @since 3.19.0\r\n * \r\n * @param {integer} [trackIndex=0] - The track to return the current animation on.\r\n * \r\n * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation.\r\n */\r\n getCurrentAnimation: function (trackIndex)\r\n {\r\n if (trackIndex === undefined) { trackIndex = 0; }\r\n\r\n var current = this.state.getCurrent(trackIndex);\r\n\r\n if (current)\r\n {\r\n return current.animation;\r\n }\r\n },\r\n\r\n /**\r\n * Sets the current animation for a track, discarding any queued animations.\r\n * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from).\r\n * \r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n *\r\n * @method SpineGameObject#play\r\n * @fires SpinePluginEvents#START\r\n * @since 3.19.0\r\n *\r\n * @param {string} animationName - The string-based key of the animation to play.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call.\r\n *\r\n * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead.\r\n */\r\n play: function (animationName, loop, ignoreIfPlaying)\r\n {\r\n this.setAnimation(0, animationName, loop, ignoreIfPlaying);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current animation for a track, discarding any queued animations.\r\n * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from).\r\n * \r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n *\r\n * @method SpineGameObject#setAnimation\r\n * @fires SpinePluginEvents#START\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to play the animation on.\r\n * @param {string} animationName - The string-based key of the animation to play.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call.\r\n *\r\n * @return {spine.TrackEntry} A track entry to allow further customization of animation playback.\r\n */\r\n setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying)\r\n {\r\n if (loop === undefined) { loop = false; }\r\n if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; }\r\n\r\n if (ignoreIfPlaying && this.state)\r\n {\r\n var currentTrack = this.state.getCurrent(0);\r\n \r\n if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete())\r\n {\r\n return;\r\n }\r\n }\r\n\r\n if (this.findAnimation(animationName))\r\n {\r\n return this.state.setAnimation(trackIndex, animationName, loop);\r\n }\r\n },\r\n\r\n /**\r\n * Adds an animation to be played after the current or last queued animation for a track.\r\n * If the track is empty, it is equivalent to calling setAnimation.\r\n * \r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n * \r\n * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous\r\n * track entry minus any mix duration (from the AnimationStateData) plus the specified delay\r\n * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration).\r\n * If the previous entry is looping, its next loop completion is used instead of its duration.\r\n *\r\n * @method SpineGameObject#addAnimation\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n * @param {string} animationName - The string-based key of the animation to add.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played.\r\n *\r\n * @return {spine.TrackEntry} A track entry to allow further customization of animation playback.\r\n */\r\n addAnimation: function (trackIndex, animationName, loop, delay)\r\n {\r\n return this.state.addAnimation(trackIndex, animationName, loop, delay);\r\n },\r\n\r\n /**\r\n * Sets an empty animation for a track, discarding any queued animations, and sets the track\r\n * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out.\r\n * \r\n * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation,\r\n * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be\r\n * applied less and less over the mix duration. Properties keyed in the previous animation transition to\r\n * the value from lower tracks or to the setup pose value if no lower tracks key the property.\r\n * A mix duration of 0 still mixes out over one frame.\r\n * \r\n * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation\r\n * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new\r\n * animation to be applied more and more over the mix duration. Properties keyed in the new animation\r\n * transition from the value from lower tracks or from the setup pose value if no lower tracks key the\r\n * property to the value keyed in the new animation.\r\n *\r\n * @method SpineGameObject#setEmptyAnimation\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any).\r\n *\r\n * @return {spine.TrackEntry} The returned Track Entry.\r\n */\r\n setEmptyAnimation: function (trackIndex, mixDuration)\r\n {\r\n return this.state.setEmptyAnimation(trackIndex, mixDuration);\r\n },\r\n\r\n /**\r\n * Removes all animations from the track, leaving skeletons in their current pose.\r\n * \r\n * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose.\r\n *\r\n * @method SpineGameObject#clearTrack\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n clearTrack: function (trackIndex)\r\n {\r\n this.state.clearTrack(trackIndex);\r\n\r\n return this;\r\n },\r\n \r\n /**\r\n * Removes all animations from all tracks, leaving skeletons in their current pose.\r\n * \r\n * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose.\r\n *\r\n * @method SpineGameObject#clearTracks\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n clearTracks: function ()\r\n {\r\n this.state.clearTracks();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the skin used to look up attachments before looking in the defaultSkin.\r\n * \r\n * Attachments from the new skin are attached if the corresponding attachment from the\r\n * old skin was attached. If there was no old skin, each slot's setup mode attachment is\r\n * attached from the new skin.\r\n * \r\n * After changing the skin, the visible attachments can be reset to those attached in the\r\n * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time\r\n * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide\r\n * or show attachments from the new skin.\r\n *\r\n * @method SpineGameObject#setSkinByName\r\n * @since 3.19.0\r\n * \r\n * @param {string} skinName - The name of the skin to set.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkinByName: function (skinName)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n skeleton.setSkinByName(skinName);\r\n\r\n skeleton.setSlotsToSetupPose();\r\n\r\n this.state.apply(skeleton);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the skin used to look up attachments before looking in the defaultSkin.\r\n * \r\n * Attachments from the new skin are attached if the corresponding attachment from the\r\n * old skin was attached. If there was no old skin, each slot's setup mode attachment is\r\n * attached from the new skin.\r\n * \r\n * After changing the skin, the visible attachments can be reset to those attached in the\r\n * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time\r\n * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide\r\n * or show attachments from the new skin.\r\n *\r\n * @method SpineGameObject#setSkin\r\n * @since 3.19.0\r\n * \r\n * @param {?spine.Skin} newSkin - The Skin to set. May be `null`.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkin: function (newSkin)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n skeleton.setSkin(newSkin);\r\n\r\n skeleton.setSlotsToSetupPose();\r\n\r\n this.state.apply(skeleton);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the mix duration when changing from the specified animation to the other.\r\n *\r\n * @method SpineGameObject#setMix\r\n * @since 3.19.0\r\n * \r\n * @param {string} fromName - The animation to mix from.\r\n * @param {string} toName - The animation to mix to.\r\n * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any).\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setMix: function (fromName, toName, duration)\r\n {\r\n this.stateData.setMix(fromName, toName, duration);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Finds an attachment by looking in the skin and defaultSkin using the slot\r\n * index and attachment name. First the skin is checked and if the attachment was not found,\r\n * the default skin is checked.\r\n *\r\n * @method SpineGameObject#getAttachment\r\n * @since 3.19.0\r\n * \r\n * @param {integer} slotIndex - The slot index to search.\r\n * @param {string} attachmentName - The attachment name to look for.\r\n *\r\n * @return {?spine.Attachment} The Attachment, if found. May be null.\r\n */\r\n getAttachment: function (slotIndex, attachmentName)\r\n {\r\n return this.skeleton.getAttachment(slotIndex, attachmentName);\r\n },\r\n\r\n /**\r\n * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name.\r\n *\r\n * @method SpineGameObject#getAttachmentByName\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The slot name to search.\r\n * @param {string} attachmentName - The attachment name to look for.\r\n *\r\n * @return {?spine.Attachment} The Attachment, if found. May be null.\r\n */\r\n getAttachmentByName: function (slotName, attachmentName)\r\n {\r\n return this.skeleton.getAttachmentByName(slotName, attachmentName);\r\n },\r\n\r\n /**\r\n * A convenience method to set an attachment by finding the slot with findSlot,\r\n * finding the attachment with getAttachment, then setting the slot's attachment.\r\n *\r\n * @method SpineGameObject#setAttachment\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The slot name to add the attachment to.\r\n * @param {string} attachmentName - The attachment name to add.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAttachment: function (slotName, attachmentName)\r\n {\r\n if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length)\r\n {\r\n for (var i = 0; i < slotName.length; i++)\r\n {\r\n this.skeleton.setAttachment(slotName[i], attachmentName[i]);\r\n }\r\n }\r\n else\r\n {\r\n this.skeleton.setAttachment(slotName, attachmentName);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the bones, constraints, slots, and draw order to their setup pose values.\r\n *\r\n * @method SpineGameObject#setToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setToSetupPose: function ()\r\n {\r\n this.skeleton.setToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the slots and draw order to their setup pose values.\r\n *\r\n * @method SpineGameObject#setSlotsToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSlotsToSetupPose: function ()\r\n {\r\n this.skeleton.setSlotsToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the bones and constraints to their setup pose values.\r\n *\r\n * @method SpineGameObject#setBonesToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setBonesToSetupPose: function ()\r\n {\r\n this.skeleton.setBonesToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the root bone, or null.\r\n *\r\n * @method SpineGameObject#getRootBone\r\n * @since 3.19.0\r\n *\r\n * @return {spine.Bone} The root bone, or null.\r\n */\r\n getRootBone: function ()\r\n {\r\n return this.skeleton.getRootBone();\r\n },\r\n\r\n /**\r\n * Takes a Bone object and a position in world space and rotates the Bone so it is angled\r\n * towards the given position. You can set an optional angle offset, should the bone be\r\n * designed at a specific angle already. You can also set a minimum and maximum range for the angle.\r\n *\r\n * @method SpineGameObject#angleBoneToXY\r\n * @since 3.19.0\r\n * \r\n * @param {spine.Bone} bone - The bone to rotate towards the world position.\r\n * @param {number} worldX - The world x coordinate to rotate the bone towards.\r\n * @param {number} worldY - The world y coordinate to rotate the bone towards.\r\n * @param {number} [offset=0] - An offset to add to the rotation angle.\r\n * @param {number} [minAngle=0] - The minimum range of the rotation angle.\r\n * @param {number} [maxAngle=360] - The maximum range of the rotation angle.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle)\r\n {\r\n if (offset === undefined) { offset = 0; }\r\n if (minAngle === undefined) { minAngle = 0; }\r\n if (maxAngle === undefined) { maxAngle = 360; }\r\n\r\n var renderer = this.plugin.renderer;\r\n var height = renderer.height;\r\n\r\n var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset));\r\n\r\n bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Finds a bone by comparing each bone's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findBone\r\n * @since 3.19.0\r\n * \r\n * @param {string} boneName - The name of the bone to find.\r\n *\r\n * @return {spine.Bone} The bone, or null.\r\n */\r\n findBone: function (boneName)\r\n {\r\n return this.skeleton.findBone(boneName);\r\n },\r\n\r\n /**\r\n * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findBoneIndex\r\n * @since 3.19.0\r\n * \r\n * @param {string} boneName - The name of the bone to find.\r\n *\r\n * @return {integer} The bone index. Or -1 if the bone was not found.\r\n */\r\n findBoneIndex: function (boneName)\r\n {\r\n return this.skeleton.findBoneIndex(boneName);\r\n },\r\n\r\n /**\r\n * Finds a slot by comparing each slot's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSlot\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The name of the slot to find.\r\n *\r\n * @return {spine.Slot} The Slot. May be null.\r\n */\r\n findSlot: function (slotName)\r\n {\r\n return this.skeleton.findSlot(slotName);\r\n },\r\n\r\n /**\r\n * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSlotIndex\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The name of the slot to find.\r\n *\r\n * @return {integer} The slot index. Or -1 if the Slot was not found.\r\n */\r\n findSlotIndex: function (slotName)\r\n {\r\n return this.skeleton.findSlotIndex(slotName);\r\n },\r\n\r\n /**\r\n * Finds a skin by comparing each skin's name. It is more efficient to cache the results of\r\n * this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSkin\r\n * @since 3.19.0\r\n * \r\n * @param {string} skinName - The name of the skin to find.\r\n *\r\n * @return {spine.Skin} The Skin. May be null.\r\n */\r\n findSkin: function (skinName)\r\n {\r\n return this.skeletonData.findSkin(skinName);\r\n },\r\n\r\n /**\r\n * Finds an event by comparing each events's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findEvent\r\n * @since 3.19.0\r\n * \r\n * @param {string} eventDataName - The name of the event to find.\r\n *\r\n * @return {spine.EventData} The Event Data. May be null.\r\n */\r\n findEvent: function (eventDataName)\r\n {\r\n return this.skeletonData.findEvent(eventDataName);\r\n },\r\n\r\n /**\r\n * Finds an animation by comparing each animation's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findAnimation\r\n * @since 3.19.0\r\n * \r\n * @param {string} animationName - The name of the animation to find.\r\n *\r\n * @return {spine.Animation} The Animation. May be null.\r\n */\r\n findAnimation: function (animationName)\r\n {\r\n return this.skeletonData.findAnimation(animationName);\r\n },\r\n\r\n /**\r\n * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findIkConstraint\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.IkConstraintData} The IK constraint. May be null.\r\n */\r\n findIkConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findIkConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds an transform constraint by comparing each transform constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findTransformConstraint\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.TransformConstraintData} The transform constraint. May be null.\r\n */\r\n findTransformConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findTransformConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds a path constraint by comparing each path constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findPathConstraint\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.PathConstraintData} The path constraint. May be null.\r\n */\r\n findPathConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findPathConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds the index of a path constraint by comparing each path constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findPathConstraintIndex\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {integer} The constraint index. Or -1 if the constraint was not found.\r\n */\r\n findPathConstraintIndex: function (constraintName)\r\n {\r\n return this.skeletonData.findPathConstraintIndex(constraintName);\r\n },\r\n\r\n /**\r\n * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * \r\n * The returned object contains two properties: `offset` and `size`:\r\n * \r\n * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * `size` - The width and height of the AABB.\r\n *\r\n * @method SpineGameObject#getBounds\r\n * @since 3.19.0\r\n * \r\n * @return {any} The bounds object.\r\n */\r\n getBounds: function ()\r\n {\r\n return this.plugin.getBounds(this.skeleton);\r\n },\r\n\r\n /**\r\n * Internal update handler.\r\n *\r\n * @method SpineGameObject#preUpdate\r\n * @protected\r\n * @since 3.19.0\r\n * \r\n * @param {number} time - The current timestamp.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n preUpdate: function (time, delta)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n this.state.update((delta / 1000) * this.timeScale);\r\n\r\n this.state.apply(skeleton);\r\n\r\n // this.emit('spine.update', skeleton);\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method SpineGameObject#preDestroy\r\n * @protected\r\n * @since 3.19.0\r\n */\r\n preDestroy: function ()\r\n {\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n this.plugin = null;\r\n\r\n this.skeleton = null;\r\n this.skeletonData = null;\r\n\r\n this.state = null;\r\n this.stateData = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpineGameObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\r\nvar RadToDeg = require('../../../../src/math/RadToDeg');\r\nvar Wrap = require('../../../../src/math/Wrap');\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method SpineGameObject#renderCanvas\r\n * @since 3.19.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {SpineGameObject} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var context = renderer.currentContext;\r\n\r\n var plugin = src.plugin;\r\n var skeleton = src.skeleton;\r\n var skeletonRenderer = plugin.skeletonRenderer;\r\n\r\n var GameObjectRenderMask = 15;\r\n\r\n var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)));\r\n\r\n if (!skeleton || !willRender)\r\n {\r\n return;\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1;\r\n var spriteMatrix = renderer._tempMatrix2;\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY));\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = src.x;\r\n spriteMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n skeleton.x = calcMatrix.tx;\r\n skeleton.y = calcMatrix.ty;\r\n\r\n skeleton.scaleX = calcMatrix.scaleX;\r\n\r\n // Inverse or we get upside-down skeletons\r\n skeleton.scaleY = calcMatrix.scaleY * -1;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n skeleton.scaleX *= -1;\r\n\r\n src.root.rotation = RadToDeg(calcMatrix.rotationNormalized);\r\n }\r\n else\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360);\r\n }\r\n\r\n if (src.scaleY < 0)\r\n {\r\n skeleton.scaleY *= -1;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n else\r\n {\r\n src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n }\r\n\r\n if (camera.renderToTexture)\r\n {\r\n skeleton.y = calcMatrix.ty;\r\n skeleton.scaleY *= -1;\r\n }\r\n\r\n // Add autoUpdate option\r\n skeleton.updateWorldTransform();\r\n\r\n skeletonRenderer.ctx = context;\r\n skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug);\r\n\r\n context.save();\r\n\r\n skeletonRenderer.draw(skeleton);\r\n\r\n context.restore();\r\n};\r\n\r\nmodule.exports = SpineGameObjectCanvasRenderer;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar renderWebGL = require('../../../../src/utils/NOOP');\r\nvar renderCanvas = require('../../../../src/utils/NOOP');\r\n\r\nif (typeof WEBGL_RENDERER)\r\n{\r\n renderWebGL = require('./SpineGameObjectWebGLRenderer');\r\n}\r\n\r\nif (typeof CANVAS_RENDERER)\r\n{\r\n renderCanvas = require('./SpineGameObjectCanvasRenderer');\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\r\nvar RadToDeg = require('../../../../src/math/RadToDeg');\r\nvar Wrap = require('../../../../src/math/Wrap');\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method SpineGameObject#renderWebGL\r\n * @since 3.19.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {SpineGameObject} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var plugin = src.plugin;\r\n var skeleton = src.skeleton;\r\n var sceneRenderer = plugin.sceneRenderer;\r\n\r\n var GameObjectRenderMask = 15;\r\n\r\n var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)));\r\n\r\n if (!skeleton || !willRender)\r\n {\r\n // Reset the current type\r\n renderer.currentType = '';\r\n\r\n // If there is already a batch running, we need to close it\r\n if (!renderer.nextTypeMatch)\r\n {\r\n // The next object in the display list is not a Spine object, so we end the batch\r\n sceneRenderer.end();\r\n \r\n renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline);\r\n }\r\n \r\n return;\r\n }\r\n\r\n if (renderer.newType)\r\n {\r\n renderer.clearPipeline();\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1;\r\n var spriteMatrix = renderer._tempMatrix2;\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY));\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = src.x;\r\n spriteMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n var viewportHeight = renderer.height;\r\n\r\n skeleton.x = calcMatrix.tx;\r\n skeleton.y = viewportHeight - calcMatrix.ty;\r\n\r\n skeleton.scaleX = calcMatrix.scaleX;\r\n skeleton.scaleY = calcMatrix.scaleY;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n skeleton.scaleX *= -1;\r\n\r\n src.root.rotation = RadToDeg(calcMatrix.rotationNormalized);\r\n }\r\n else\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360);\r\n }\r\n\r\n if (src.scaleY < 0)\r\n {\r\n skeleton.scaleY *= -1;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n else\r\n {\r\n src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n }\r\n\r\n if (camera.renderToTexture)\r\n {\r\n skeleton.y = calcMatrix.ty;\r\n skeleton.scaleY *= -1;\r\n }\r\n\r\n // Add autoUpdate option\r\n skeleton.updateWorldTransform();\r\n\r\n if (renderer.newType)\r\n {\r\n sceneRenderer.begin();\r\n }\r\n\r\n // Draw the current skeleton\r\n sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha);\r\n\r\n if (plugin.drawDebug || src.drawDebug)\r\n {\r\n // Because if we don't, the bones render positions are completely wrong (*sigh*)\r\n var oldX = skeleton.x;\r\n var oldY = skeleton.y;\r\n\r\n skeleton.x = 0;\r\n skeleton.y = 0;\r\n\r\n sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha);\r\n\r\n skeleton.x = oldX;\r\n skeleton.y = oldY;\r\n }\r\n\r\n if (!renderer.nextTypeMatch)\r\n {\r\n // The next object in the display list is not a Spine object, so we end the batch\r\n sceneRenderer.end();\r\n\r\n renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline);\r\n }\r\n};\r\n\r\nmodule.exports = SpineGameObjectWebGLRenderer;\r\n","/*** IMPORTS FROM imports-loader ***/\n(function() {\n\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nvar spine;\r\n(function (spine) {\r\n var Animation = (function () {\r\n function Animation(name, timelines, duration) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (timelines == null)\r\n throw new Error(\"timelines cannot be null.\");\r\n this.name = name;\r\n this.timelines = timelines;\r\n this.duration = duration;\r\n }\r\n Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0)\r\n lastTime %= this.duration;\r\n }\r\n var timelines = this.timelines;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\r\n };\r\n Animation.binarySearch = function (values, target, step) {\r\n if (step === void 0) { step = 1; }\r\n var low = 0;\r\n var high = values.length / step - 2;\r\n if (high == 0)\r\n return step;\r\n var current = high >>> 1;\r\n while (true) {\r\n if (values[(current + 1) * step] <= target)\r\n low = current + 1;\r\n else\r\n high = current;\r\n if (low == high)\r\n return (low + 1) * step;\r\n current = (low + high) >>> 1;\r\n }\r\n };\r\n Animation.linearSearch = function (values, target, step) {\r\n for (var i = 0, last = values.length - step; i <= last; i += step)\r\n if (values[i] > target)\r\n return i;\r\n return -1;\r\n };\r\n return Animation;\r\n }());\r\n spine.Animation = Animation;\r\n var MixBlend;\r\n (function (MixBlend) {\r\n MixBlend[MixBlend[\"setup\"] = 0] = \"setup\";\r\n MixBlend[MixBlend[\"first\"] = 1] = \"first\";\r\n MixBlend[MixBlend[\"replace\"] = 2] = \"replace\";\r\n MixBlend[MixBlend[\"add\"] = 3] = \"add\";\r\n })(MixBlend = spine.MixBlend || (spine.MixBlend = {}));\r\n var MixDirection;\r\n (function (MixDirection) {\r\n MixDirection[MixDirection[\"in\"] = 0] = \"in\";\r\n MixDirection[MixDirection[\"out\"] = 1] = \"out\";\r\n })(MixDirection = spine.MixDirection || (spine.MixDirection = {}));\r\n var TimelineType;\r\n (function (TimelineType) {\r\n TimelineType[TimelineType[\"rotate\"] = 0] = \"rotate\";\r\n TimelineType[TimelineType[\"translate\"] = 1] = \"translate\";\r\n TimelineType[TimelineType[\"scale\"] = 2] = \"scale\";\r\n TimelineType[TimelineType[\"shear\"] = 3] = \"shear\";\r\n TimelineType[TimelineType[\"attachment\"] = 4] = \"attachment\";\r\n TimelineType[TimelineType[\"color\"] = 5] = \"color\";\r\n TimelineType[TimelineType[\"deform\"] = 6] = \"deform\";\r\n TimelineType[TimelineType[\"event\"] = 7] = \"event\";\r\n TimelineType[TimelineType[\"drawOrder\"] = 8] = \"drawOrder\";\r\n TimelineType[TimelineType[\"ikConstraint\"] = 9] = \"ikConstraint\";\r\n TimelineType[TimelineType[\"transformConstraint\"] = 10] = \"transformConstraint\";\r\n TimelineType[TimelineType[\"pathConstraintPosition\"] = 11] = \"pathConstraintPosition\";\r\n TimelineType[TimelineType[\"pathConstraintSpacing\"] = 12] = \"pathConstraintSpacing\";\r\n TimelineType[TimelineType[\"pathConstraintMix\"] = 13] = \"pathConstraintMix\";\r\n TimelineType[TimelineType[\"twoColor\"] = 14] = \"twoColor\";\r\n })(TimelineType = spine.TimelineType || (spine.TimelineType = {}));\r\n var CurveTimeline = (function () {\r\n function CurveTimeline(frameCount) {\r\n if (frameCount <= 0)\r\n throw new Error(\"frameCount must be > 0: \" + frameCount);\r\n this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\r\n }\r\n CurveTimeline.prototype.getFrameCount = function () {\r\n return this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\r\n };\r\n CurveTimeline.prototype.setLinear = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\r\n };\r\n CurveTimeline.prototype.setStepped = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\r\n };\r\n CurveTimeline.prototype.getCurveType = function (frameIndex) {\r\n var index = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n if (index == this.curves.length)\r\n return CurveTimeline.LINEAR;\r\n var type = this.curves[index];\r\n if (type == CurveTimeline.LINEAR)\r\n return CurveTimeline.LINEAR;\r\n if (type == CurveTimeline.STEPPED)\r\n return CurveTimeline.STEPPED;\r\n return CurveTimeline.BEZIER;\r\n };\r\n CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) {\r\n var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var curves = this.curves;\r\n curves[i++] = CurveTimeline.BEZIER;\r\n var x = dfx, y = dfy;\r\n for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n x += dfx;\r\n y += dfy;\r\n }\r\n };\r\n CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) {\r\n percent = spine.MathUtils.clamp(percent, 0, 1);\r\n var curves = this.curves;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var type = curves[i];\r\n if (type == CurveTimeline.LINEAR)\r\n return percent;\r\n if (type == CurveTimeline.STEPPED)\r\n return 0;\r\n i++;\r\n var x = 0;\r\n for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n x = curves[i];\r\n if (x >= percent) {\r\n var prevX = void 0, prevY = void 0;\r\n if (i == start) {\r\n prevX = 0;\r\n prevY = 0;\r\n }\r\n else {\r\n prevX = curves[i - 2];\r\n prevY = curves[i - 1];\r\n }\r\n return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\r\n }\r\n }\r\n var y = curves[i - 1];\r\n return y + (1 - y) * (percent - x) / (1 - x);\r\n };\r\n CurveTimeline.LINEAR = 0;\r\n CurveTimeline.STEPPED = 1;\r\n CurveTimeline.BEZIER = 2;\r\n CurveTimeline.BEZIER_SIZE = 10 * 2 - 1;\r\n return CurveTimeline;\r\n }());\r\n spine.CurveTimeline = CurveTimeline;\r\n var RotateTimeline = (function (_super) {\r\n __extends(RotateTimeline, _super);\r\n function RotateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount << 1);\r\n return _this;\r\n }\r\n RotateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.rotate << 24) + this.boneIndex;\r\n };\r\n RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) {\r\n frameIndex <<= 1;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\r\n };\r\n RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n return;\r\n case MixBlend.first:\r\n var r_1 = bone.data.rotation - bone.rotation;\r\n bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) {\r\n var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + r_2 * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r_2 += bone.data.rotation - bone.rotation;\r\n r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360;\r\n case MixBlend.add:\r\n bone.rotation += r_2 * alpha;\r\n }\r\n return;\r\n }\r\n var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n var r = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r += bone.data.rotation - bone.rotation;\r\n case MixBlend.add:\r\n bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n }\r\n };\r\n RotateTimeline.ENTRIES = 2;\r\n RotateTimeline.PREV_TIME = -2;\r\n RotateTimeline.PREV_ROTATION = -1;\r\n RotateTimeline.ROTATION = 1;\r\n return RotateTimeline;\r\n }(CurveTimeline));\r\n spine.RotateTimeline = RotateTimeline;\r\n var TranslateTimeline = (function (_super) {\r\n __extends(TranslateTimeline, _super);\r\n function TranslateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TranslateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.translate << 24) + this.boneIndex;\r\n };\r\n TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) {\r\n frameIndex *= TranslateTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TranslateTimeline.X] = x;\r\n this.frames[frameIndex + TranslateTimeline.Y] = y;\r\n };\r\n TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x;\r\n bone.y = bone.data.y;\r\n return;\r\n case MixBlend.first:\r\n bone.x += (bone.data.x - bone.x) * alpha;\r\n bone.y += (bone.data.y - bone.y) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) {\r\n x = frames[frames.length + TranslateTimeline.PREV_X];\r\n y = frames[frames.length + TranslateTimeline.PREV_Y];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\r\n x = frames[frame + TranslateTimeline.PREV_X];\r\n y = frames[frame + TranslateTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\r\n x += (frames[frame + TranslateTimeline.X] - x) * percent;\r\n y += (frames[frame + TranslateTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x + x * alpha;\r\n bone.y = bone.data.y + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.x += (bone.data.x + x - bone.x) * alpha;\r\n bone.y += (bone.data.y + y - bone.y) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.x += x * alpha;\r\n bone.y += y * alpha;\r\n }\r\n };\r\n TranslateTimeline.ENTRIES = 3;\r\n TranslateTimeline.PREV_TIME = -3;\r\n TranslateTimeline.PREV_X = -2;\r\n TranslateTimeline.PREV_Y = -1;\r\n TranslateTimeline.X = 1;\r\n TranslateTimeline.Y = 2;\r\n return TranslateTimeline;\r\n }(CurveTimeline));\r\n spine.TranslateTimeline = TranslateTimeline;\r\n var ScaleTimeline = (function (_super) {\r\n __extends(ScaleTimeline, _super);\r\n function ScaleTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ScaleTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.scale << 24) + this.boneIndex;\r\n };\r\n ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleX = bone.data.scaleX;\r\n bone.scaleY = bone.data.scaleY;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) {\r\n x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX;\r\n y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY;\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\r\n x = frames[frame + ScaleTimeline.PREV_X];\r\n y = frames[frame + ScaleTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\r\n x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX;\r\n y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY;\r\n }\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n bone.scaleX += x - bone.data.scaleX;\r\n bone.scaleY += y - bone.data.scaleY;\r\n }\r\n else {\r\n bone.scaleX = x;\r\n bone.scaleY = y;\r\n }\r\n }\r\n else {\r\n var bx = 0, by = 0;\r\n if (direction == MixDirection.out) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = bone.data.scaleX;\r\n by = bone.data.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x);\r\n by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x);\r\n by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = spine.MathUtils.signum(x);\r\n by = spine.MathUtils.signum(y);\r\n bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;\r\n bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleTimeline;\r\n }(TranslateTimeline));\r\n spine.ScaleTimeline = ScaleTimeline;\r\n var ShearTimeline = (function (_super) {\r\n __extends(ShearTimeline, _super);\r\n function ShearTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ShearTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.shear << 24) + this.boneIndex;\r\n };\r\n ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX;\r\n bone.shearY = bone.data.shearY;\r\n return;\r\n case MixBlend.first:\r\n bone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ShearTimeline.ENTRIES]) {\r\n x = frames[frames.length + ShearTimeline.PREV_X];\r\n y = frames[frames.length + ShearTimeline.PREV_Y];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\r\n x = frames[frame + ShearTimeline.PREV_X];\r\n y = frames[frame + ShearTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\r\n x = x + (frames[frame + ShearTimeline.X] - x) * percent;\r\n y = y + (frames[frame + ShearTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX + x * alpha;\r\n bone.shearY = bone.data.shearY + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearX += x * alpha;\r\n bone.shearY += y * alpha;\r\n }\r\n };\r\n return ShearTimeline;\r\n }(TranslateTimeline));\r\n spine.ShearTimeline = ShearTimeline;\r\n var ColorTimeline = (function (_super) {\r\n __extends(ColorTimeline, _super);\r\n function ColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n ColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.color << 24) + this.slotIndex;\r\n };\r\n ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) {\r\n frameIndex *= ColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + ColorTimeline.R] = r;\r\n this.frames[frameIndex + ColorTimeline.G] = g;\r\n this.frames[frameIndex + ColorTimeline.B] = b;\r\n this.frames[frameIndex + ColorTimeline.A] = a;\r\n };\r\n ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n return;\r\n case MixBlend.first:\r\n var color = slot.color, setup = slot.data.color;\r\n color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0;\r\n if (time >= frames[frames.length - ColorTimeline.ENTRIES]) {\r\n var i = frames.length;\r\n r = frames[i + ColorTimeline.PREV_R];\r\n g = frames[i + ColorTimeline.PREV_G];\r\n b = frames[i + ColorTimeline.PREV_B];\r\n a = frames[i + ColorTimeline.PREV_A];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\r\n r = frames[frame + ColorTimeline.PREV_R];\r\n g = frames[frame + ColorTimeline.PREV_G];\r\n b = frames[frame + ColorTimeline.PREV_B];\r\n a = frames[frame + ColorTimeline.PREV_A];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + ColorTimeline.R] - r) * percent;\r\n g += (frames[frame + ColorTimeline.G] - g) * percent;\r\n b += (frames[frame + ColorTimeline.B] - b) * percent;\r\n a += (frames[frame + ColorTimeline.A] - a) * percent;\r\n }\r\n if (alpha == 1)\r\n slot.color.set(r, g, b, a);\r\n else {\r\n var color = slot.color;\r\n if (blend == MixBlend.setup)\r\n color.setFromColor(slot.data.color);\r\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n }\r\n };\r\n ColorTimeline.ENTRIES = 5;\r\n ColorTimeline.PREV_TIME = -5;\r\n ColorTimeline.PREV_R = -4;\r\n ColorTimeline.PREV_G = -3;\r\n ColorTimeline.PREV_B = -2;\r\n ColorTimeline.PREV_A = -1;\r\n ColorTimeline.R = 1;\r\n ColorTimeline.G = 2;\r\n ColorTimeline.B = 3;\r\n ColorTimeline.A = 4;\r\n return ColorTimeline;\r\n }(CurveTimeline));\r\n spine.ColorTimeline = ColorTimeline;\r\n var TwoColorTimeline = (function (_super) {\r\n __extends(TwoColorTimeline, _super);\r\n function TwoColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TwoColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.twoColor << 24) + this.slotIndex;\r\n };\r\n TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) {\r\n frameIndex *= TwoColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TwoColorTimeline.R] = r;\r\n this.frames[frameIndex + TwoColorTimeline.G] = g;\r\n this.frames[frameIndex + TwoColorTimeline.B] = b;\r\n this.frames[frameIndex + TwoColorTimeline.A] = a;\r\n this.frames[frameIndex + TwoColorTimeline.R2] = r2;\r\n this.frames[frameIndex + TwoColorTimeline.G2] = g2;\r\n this.frames[frameIndex + TwoColorTimeline.B2] = b2;\r\n };\r\n TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n slot.darkColor.setFromColor(slot.data.darkColor);\r\n return;\r\n case MixBlend.first:\r\n var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\r\n dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\r\n if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) {\r\n var i = frames.length;\r\n r = frames[i + TwoColorTimeline.PREV_R];\r\n g = frames[i + TwoColorTimeline.PREV_G];\r\n b = frames[i + TwoColorTimeline.PREV_B];\r\n a = frames[i + TwoColorTimeline.PREV_A];\r\n r2 = frames[i + TwoColorTimeline.PREV_R2];\r\n g2 = frames[i + TwoColorTimeline.PREV_G2];\r\n b2 = frames[i + TwoColorTimeline.PREV_B2];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES);\r\n r = frames[frame + TwoColorTimeline.PREV_R];\r\n g = frames[frame + TwoColorTimeline.PREV_G];\r\n b = frames[frame + TwoColorTimeline.PREV_B];\r\n a = frames[frame + TwoColorTimeline.PREV_A];\r\n r2 = frames[frame + TwoColorTimeline.PREV_R2];\r\n g2 = frames[frame + TwoColorTimeline.PREV_G2];\r\n b2 = frames[frame + TwoColorTimeline.PREV_B2];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + TwoColorTimeline.R] - r) * percent;\r\n g += (frames[frame + TwoColorTimeline.G] - g) * percent;\r\n b += (frames[frame + TwoColorTimeline.B] - b) * percent;\r\n a += (frames[frame + TwoColorTimeline.A] - a) * percent;\r\n r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent;\r\n g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent;\r\n b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent;\r\n }\r\n if (alpha == 1) {\r\n slot.color.set(r, g, b, a);\r\n slot.darkColor.set(r2, g2, b2, 1);\r\n }\r\n else {\r\n var light = slot.color, dark = slot.darkColor;\r\n if (blend == MixBlend.setup) {\r\n light.setFromColor(slot.data.color);\r\n dark.setFromColor(slot.data.darkColor);\r\n }\r\n light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\r\n dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);\r\n }\r\n };\r\n TwoColorTimeline.ENTRIES = 8;\r\n TwoColorTimeline.PREV_TIME = -8;\r\n TwoColorTimeline.PREV_R = -7;\r\n TwoColorTimeline.PREV_G = -6;\r\n TwoColorTimeline.PREV_B = -5;\r\n TwoColorTimeline.PREV_A = -4;\r\n TwoColorTimeline.PREV_R2 = -3;\r\n TwoColorTimeline.PREV_G2 = -2;\r\n TwoColorTimeline.PREV_B2 = -1;\r\n TwoColorTimeline.R = 1;\r\n TwoColorTimeline.G = 2;\r\n TwoColorTimeline.B = 3;\r\n TwoColorTimeline.A = 4;\r\n TwoColorTimeline.R2 = 5;\r\n TwoColorTimeline.G2 = 6;\r\n TwoColorTimeline.B2 = 7;\r\n return TwoColorTimeline;\r\n }(CurveTimeline));\r\n spine.TwoColorTimeline = TwoColorTimeline;\r\n var AttachmentTimeline = (function () {\r\n function AttachmentTimeline(frameCount) {\r\n this.frames = spine.Utils.newFloatArray(frameCount);\r\n this.attachmentNames = new Array(frameCount);\r\n }\r\n AttachmentTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.attachment << 24) + this.slotIndex;\r\n };\r\n AttachmentTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) {\r\n this.frames[frameIndex] = time;\r\n this.attachmentNames[frameIndex] = attachmentName;\r\n };\r\n AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (direction == MixDirection.out && blend == MixBlend.setup) {\r\n var attachmentName_1 = slot.data.attachmentName;\r\n slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first) {\r\n var attachmentName_2 = slot.data.attachmentName;\r\n slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2));\r\n }\r\n return;\r\n }\r\n var frameIndex = 0;\r\n if (time >= frames[frames.length - 1])\r\n frameIndex = frames.length - 1;\r\n else\r\n frameIndex = Animation.binarySearch(frames, time, 1) - 1;\r\n var attachmentName = this.attachmentNames[frameIndex];\r\n skeleton.slots[this.slotIndex]\r\n .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n };\r\n return AttachmentTimeline;\r\n }());\r\n spine.AttachmentTimeline = AttachmentTimeline;\r\n var zeros = null;\r\n var DeformTimeline = (function (_super) {\r\n __extends(DeformTimeline, _super);\r\n function DeformTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount);\r\n _this.frameVertices = new Array(frameCount);\r\n if (zeros == null)\r\n zeros = spine.Utils.newFloatArray(64);\r\n return _this;\r\n }\r\n DeformTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex;\r\n };\r\n DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) {\r\n this.frames[frameIndex] = time;\r\n this.frameVertices[frameIndex] = vertices;\r\n };\r\n DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n var slotAttachment = slot.getAttachment();\r\n if (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment))\r\n return;\r\n var verticesArray = slot.attachmentVertices;\r\n if (verticesArray.length == 0)\r\n blend = MixBlend.setup;\r\n var frameVertices = this.frameVertices;\r\n var vertexCount = frameVertices[0].length;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n var vertexAttachment = slotAttachment;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n verticesArray.length = 0;\r\n return;\r\n case MixBlend.first:\r\n if (alpha == 1) {\r\n verticesArray.length = 0;\r\n break;\r\n }\r\n var vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount);\r\n if (vertexAttachment.bones == null) {\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha;\r\n }\r\n else {\r\n alpha = 1 - alpha;\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices_1[i] *= alpha;\r\n }\r\n }\r\n return;\r\n }\r\n var vertices = spine.Utils.setArraySize(verticesArray, vertexCount);\r\n if (time >= frames[frames.length - 1]) {\r\n var lastVertices = frameVertices[frames.length - 1];\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_1 = 0; i_1 < vertexCount; i_1++) {\r\n vertices[i_1] += lastVertices[i_1] - setupVertices[i_1];\r\n }\r\n }\r\n else {\r\n for (var i_2 = 0; i_2 < vertexCount; i_2++)\r\n vertices[i_2] += lastVertices[i_2];\r\n }\r\n }\r\n else {\r\n spine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount);\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_1 = slotAttachment;\r\n if (vertexAttachment_1.bones == null) {\r\n var setupVertices = vertexAttachment_1.vertices;\r\n for (var i_3 = 0; i_3 < vertexCount; i_3++) {\r\n var setup = setupVertices[i_3];\r\n vertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha;\r\n }\r\n }\r\n else {\r\n for (var i_4 = 0; i_4 < vertexCount; i_4++)\r\n vertices[i_4] = lastVertices[i_4] * alpha;\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_5 = 0; i_5 < vertexCount; i_5++)\r\n vertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_6 = 0; i_6 < vertexCount; i_6++) {\r\n vertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha;\r\n }\r\n }\r\n else {\r\n for (var i_7 = 0; i_7 < vertexCount; i_7++)\r\n vertices[i_7] += lastVertices[i_7] * alpha;\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n var frame = Animation.binarySearch(frames, time);\r\n var prevVertices = frameVertices[frame - 1];\r\n var nextVertices = frameVertices[frame];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_8 = 0; i_8 < vertexCount; i_8++) {\r\n var prev = prevVertices[i_8];\r\n vertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8];\r\n }\r\n }\r\n else {\r\n for (var i_9 = 0; i_9 < vertexCount; i_9++) {\r\n var prev = prevVertices[i_9];\r\n vertices[i_9] += prev + (nextVertices[i_9] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i_10 = 0; i_10 < vertexCount; i_10++) {\r\n var prev = prevVertices[i_10];\r\n vertices[i_10] = prev + (nextVertices[i_10] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_2 = slotAttachment;\r\n if (vertexAttachment_2.bones == null) {\r\n var setupVertices = vertexAttachment_2.vertices;\r\n for (var i_11 = 0; i_11 < vertexCount; i_11++) {\r\n var prev = prevVertices[i_11], setup = setupVertices[i_11];\r\n vertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha;\r\n }\r\n }\r\n else {\r\n for (var i_12 = 0; i_12 < vertexCount; i_12++) {\r\n var prev = prevVertices[i_12];\r\n vertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha;\r\n }\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_13 = 0; i_13 < vertexCount; i_13++) {\r\n var prev = prevVertices[i_13];\r\n vertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha;\r\n }\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_14 = 0; i_14 < vertexCount; i_14++) {\r\n var prev = prevVertices[i_14];\r\n vertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha;\r\n }\r\n }\r\n else {\r\n for (var i_15 = 0; i_15 < vertexCount; i_15++) {\r\n var prev = prevVertices[i_15];\r\n vertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n return DeformTimeline;\r\n }(CurveTimeline));\r\n spine.DeformTimeline = DeformTimeline;\r\n var EventTimeline = (function () {\r\n function EventTimeline(frameCount) {\r\n this.frames = spine.Utils.newFloatArray(frameCount);\r\n this.events = new Array(frameCount);\r\n }\r\n EventTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.event << 24;\r\n };\r\n EventTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n EventTimeline.prototype.setFrame = function (frameIndex, event) {\r\n this.frames[frameIndex] = event.time;\r\n this.events[frameIndex] = event;\r\n };\r\n EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n if (firedEvents == null)\r\n return;\r\n var frames = this.frames;\r\n var frameCount = this.frames.length;\r\n if (lastTime > time) {\r\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\r\n lastTime = -1;\r\n }\r\n else if (lastTime >= frames[frameCount - 1])\r\n return;\r\n if (time < frames[0])\r\n return;\r\n var frame = 0;\r\n if (lastTime < frames[0])\r\n frame = 0;\r\n else {\r\n frame = Animation.binarySearch(frames, lastTime);\r\n var frameTime = frames[frame];\r\n while (frame > 0) {\r\n if (frames[frame - 1] != frameTime)\r\n break;\r\n frame--;\r\n }\r\n }\r\n for (; frame < frameCount && time >= frames[frame]; frame++)\r\n firedEvents.push(this.events[frame]);\r\n };\r\n return EventTimeline;\r\n }());\r\n spine.EventTimeline = EventTimeline;\r\n var DrawOrderTimeline = (function () {\r\n function DrawOrderTimeline(frameCount) {\r\n this.frames = spine.Utils.newFloatArray(frameCount);\r\n this.drawOrders = new Array(frameCount);\r\n }\r\n DrawOrderTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.drawOrder << 24;\r\n };\r\n DrawOrderTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) {\r\n this.frames[frameIndex] = time;\r\n this.drawOrders[frameIndex] = drawOrder;\r\n };\r\n DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var drawOrder = skeleton.drawOrder;\r\n var slots = skeleton.slots;\r\n if (direction == MixDirection.out && blend == MixBlend.setup) {\r\n spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frame = 0;\r\n if (time >= frames[frames.length - 1])\r\n frame = frames.length - 1;\r\n else\r\n frame = Animation.binarySearch(frames, time) - 1;\r\n var drawOrderToSetupIndex = this.drawOrders[frame];\r\n if (drawOrderToSetupIndex == null)\r\n spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\r\n else {\r\n for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n }\r\n };\r\n return DrawOrderTimeline;\r\n }());\r\n spine.DrawOrderTimeline = DrawOrderTimeline;\r\n var IkConstraintTimeline = (function (_super) {\r\n __extends(IkConstraintTimeline, _super);\r\n function IkConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n IkConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;\r\n };\r\n IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) {\r\n frameIndex *= IkConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\r\n this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\r\n this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0;\r\n this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0;\r\n };\r\n IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mix = constraint.data.mix;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n return;\r\n case MixBlend.first:\r\n constraint.mix += (constraint.data.mix - constraint.mix) * alpha;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;\r\n if (direction == MixDirection.out) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\r\n if (direction == MixDirection[\"in\"]) {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n return;\r\n }\r\n var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\r\n var mix = frames[frame + IkConstraintTimeline.PREV_MIX];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;\r\n if (direction == MixDirection.out) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\r\n if (direction == MixDirection[\"in\"]) {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n };\r\n IkConstraintTimeline.ENTRIES = 5;\r\n IkConstraintTimeline.PREV_TIME = -5;\r\n IkConstraintTimeline.PREV_MIX = -4;\r\n IkConstraintTimeline.PREV_BEND_DIRECTION = -3;\r\n IkConstraintTimeline.PREV_COMPRESS = -2;\r\n IkConstraintTimeline.PREV_STRETCH = -1;\r\n IkConstraintTimeline.MIX = 1;\r\n IkConstraintTimeline.BEND_DIRECTION = 2;\r\n IkConstraintTimeline.COMPRESS = 3;\r\n IkConstraintTimeline.STRETCH = 4;\r\n return IkConstraintTimeline;\r\n }(CurveTimeline));\r\n spine.IkConstraintTimeline = IkConstraintTimeline;\r\n var TransformConstraintTimeline = (function (_super) {\r\n __extends(TransformConstraintTimeline, _super);\r\n function TransformConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TransformConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;\r\n };\r\n TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) {\r\n frameIndex *= TransformConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\r\n };\r\n TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n if (time < frames[0]) {\r\n var data = constraint.data;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0, scale = 0, shear = 0;\r\n if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) {\r\n var i = frames.length;\r\n rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[i + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[i + TransformConstraintTimeline.PREV_SHEAR];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\r\n rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent;\r\n scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent;\r\n shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha;\r\n constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha;\r\n constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha;\r\n constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (scale - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (shear - constraint.shearMix) * alpha;\r\n }\r\n };\r\n TransformConstraintTimeline.ENTRIES = 5;\r\n TransformConstraintTimeline.PREV_TIME = -5;\r\n TransformConstraintTimeline.PREV_ROTATE = -4;\r\n TransformConstraintTimeline.PREV_TRANSLATE = -3;\r\n TransformConstraintTimeline.PREV_SCALE = -2;\r\n TransformConstraintTimeline.PREV_SHEAR = -1;\r\n TransformConstraintTimeline.ROTATE = 1;\r\n TransformConstraintTimeline.TRANSLATE = 2;\r\n TransformConstraintTimeline.SCALE = 3;\r\n TransformConstraintTimeline.SHEAR = 4;\r\n return TransformConstraintTimeline;\r\n }(CurveTimeline));\r\n spine.TransformConstraintTimeline = TransformConstraintTimeline;\r\n var PathConstraintPositionTimeline = (function (_super) {\r\n __extends(PathConstraintPositionTimeline, _super);\r\n function PathConstraintPositionTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintPositionTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;\r\n };\r\n PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) {\r\n frameIndex *= PathConstraintPositionTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\r\n };\r\n PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.position = constraint.data.position;\r\n return;\r\n case MixBlend.first:\r\n constraint.position += (constraint.data.position - constraint.position) * alpha;\r\n }\r\n return;\r\n }\r\n var position = 0;\r\n if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES])\r\n position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE];\r\n else {\r\n var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\r\n position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\r\n position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\r\n else\r\n constraint.position += (position - constraint.position) * alpha;\r\n };\r\n PathConstraintPositionTimeline.ENTRIES = 2;\r\n PathConstraintPositionTimeline.PREV_TIME = -2;\r\n PathConstraintPositionTimeline.PREV_VALUE = -1;\r\n PathConstraintPositionTimeline.VALUE = 1;\r\n return PathConstraintPositionTimeline;\r\n }(CurveTimeline));\r\n spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline;\r\n var PathConstraintSpacingTimeline = (function (_super) {\r\n __extends(PathConstraintSpacingTimeline, _super);\r\n function PathConstraintSpacingTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n PathConstraintSpacingTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;\r\n };\r\n PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.spacing = constraint.data.spacing;\r\n return;\r\n case MixBlend.first:\r\n constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\r\n }\r\n return;\r\n }\r\n var spacing = 0;\r\n if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES])\r\n spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE];\r\n else {\r\n var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\r\n spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\r\n spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\r\n else\r\n constraint.spacing += (spacing - constraint.spacing) * alpha;\r\n };\r\n return PathConstraintSpacingTimeline;\r\n }(PathConstraintPositionTimeline));\r\n spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline;\r\n var PathConstraintMixTimeline = (function (_super) {\r\n __extends(PathConstraintMixTimeline, _super);\r\n function PathConstraintMixTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintMixTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;\r\n };\r\n PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) {\r\n frameIndex *= PathConstraintMixTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\r\n };\r\n PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = constraint.data.rotateMix;\r\n constraint.translateMix = constraint.data.translateMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0;\r\n if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) {\r\n rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\r\n rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha;\r\n constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n }\r\n };\r\n PathConstraintMixTimeline.ENTRIES = 3;\r\n PathConstraintMixTimeline.PREV_TIME = -3;\r\n PathConstraintMixTimeline.PREV_ROTATE = -2;\r\n PathConstraintMixTimeline.PREV_TRANSLATE = -1;\r\n PathConstraintMixTimeline.ROTATE = 1;\r\n PathConstraintMixTimeline.TRANSLATE = 2;\r\n return PathConstraintMixTimeline;\r\n }(CurveTimeline));\r\n spine.PathConstraintMixTimeline = PathConstraintMixTimeline;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var AnimationState = (function () {\r\n function AnimationState(data) {\r\n this.tracks = new Array();\r\n this.events = new Array();\r\n this.listeners = new Array();\r\n this.queue = new EventQueue(this);\r\n this.propertyIDs = new spine.IntSet();\r\n this.animationsChanged = false;\r\n this.timeScale = 1;\r\n this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); });\r\n this.data = data;\r\n }\r\n AnimationState.prototype.update = function (delta) {\r\n delta *= this.timeScale;\r\n var tracks = this.tracks;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var current = tracks[i];\r\n if (current == null)\r\n continue;\r\n current.animationLast = current.nextAnimationLast;\r\n current.trackLast = current.nextTrackLast;\r\n var currentDelta = delta * current.timeScale;\r\n if (current.delay > 0) {\r\n current.delay -= currentDelta;\r\n if (current.delay > 0)\r\n continue;\r\n currentDelta = -current.delay;\r\n current.delay = 0;\r\n }\r\n var next = current.next;\r\n if (next != null) {\r\n var nextTime = current.trackLast - next.delay;\r\n if (nextTime >= 0) {\r\n next.delay = 0;\r\n next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\r\n current.trackTime += currentDelta;\r\n this.setCurrent(i, next, true);\r\n while (next.mixingFrom != null) {\r\n next.mixTime += delta;\r\n next = next.mixingFrom;\r\n }\r\n continue;\r\n }\r\n }\r\n else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {\r\n tracks[i] = null;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n continue;\r\n }\r\n if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) {\r\n var from = current.mixingFrom;\r\n current.mixingFrom = null;\r\n if (from != null)\r\n from.mixingTo = null;\r\n while (from != null) {\r\n this.queue.end(from);\r\n from = from.mixingFrom;\r\n }\r\n }\r\n current.trackTime += currentDelta;\r\n }\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.updateMixingFrom = function (to, delta) {\r\n var from = to.mixingFrom;\r\n if (from == null)\r\n return true;\r\n var finished = this.updateMixingFrom(from, delta);\r\n from.animationLast = from.nextAnimationLast;\r\n from.trackLast = from.nextTrackLast;\r\n if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\r\n if (from.totalAlpha == 0 || to.mixDuration == 0) {\r\n to.mixingFrom = from.mixingFrom;\r\n if (from.mixingFrom != null)\r\n from.mixingFrom.mixingTo = to;\r\n to.interruptAlpha = from.interruptAlpha;\r\n this.queue.end(from);\r\n }\r\n return finished;\r\n }\r\n from.trackTime += delta * from.timeScale;\r\n to.mixTime += delta;\r\n return false;\r\n };\r\n AnimationState.prototype.apply = function (skeleton) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (this.animationsChanged)\r\n this._animationsChanged();\r\n var events = this.events;\r\n var tracks = this.tracks;\r\n var applied = false;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var current = tracks[i];\r\n if (current == null || current.delay > 0)\r\n continue;\r\n applied = true;\r\n var blend = i == 0 ? spine.MixBlend.first : current.mixBlend;\r\n var mix = current.alpha;\r\n if (current.mixingFrom != null)\r\n mix *= this.applyMixingFrom(current, skeleton, blend);\r\n else if (current.trackTime >= current.trackEnd && current.next == null)\r\n mix = 0;\r\n var animationLast = current.animationLast, animationTime = current.getAnimationTime();\r\n var timelineCount = current.animation.timelines.length;\r\n var timelines = current.animation.timelines;\r\n if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) {\r\n for (var ii = 0; ii < timelineCount; ii++)\r\n timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection[\"in\"]);\r\n }\r\n else {\r\n var timelineMode = current.timelineMode;\r\n var firstFrame = current.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = current.timelinesRotation;\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n var timeline = timelines[ii];\r\n var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup;\r\n if (timeline instanceof spine.RotateTimeline) {\r\n this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame);\r\n }\r\n else {\r\n spine.Utils.webkit602BugfixHelper(mix, blend);\r\n timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection[\"in\"]);\r\n }\r\n }\r\n }\r\n this.queueEvents(current, animationTime);\r\n events.length = 0;\r\n current.nextAnimationLast = animationTime;\r\n current.nextTrackLast = current.trackTime;\r\n }\r\n this.queue.drain();\r\n return applied;\r\n };\r\n AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\r\n var from = to.mixingFrom;\r\n if (from.mixingFrom != null)\r\n this.applyMixingFrom(from, skeleton, blend);\r\n var mix = 0;\r\n if (to.mixDuration == 0) {\r\n mix = 1;\r\n if (blend == spine.MixBlend.first)\r\n blend = spine.MixBlend.setup;\r\n }\r\n else {\r\n mix = to.mixTime / to.mixDuration;\r\n if (mix > 1)\r\n mix = 1;\r\n if (blend != spine.MixBlend.first)\r\n blend = from.mixBlend;\r\n }\r\n var events = mix < from.eventThreshold ? this.events : null;\r\n var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\r\n var animationLast = from.animationLast, animationTime = from.getAnimationTime();\r\n var timelineCount = from.animation.timelines.length;\r\n var timelines = from.animation.timelines;\r\n var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\r\n if (blend == spine.MixBlend.add) {\r\n for (var i = 0; i < timelineCount; i++)\r\n timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out);\r\n }\r\n else {\r\n var timelineMode = from.timelineMode;\r\n var timelineHoldMix = from.timelineHoldMix;\r\n var firstFrame = from.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = from.timelinesRotation;\r\n from.totalAlpha = 0;\r\n for (var i = 0; i < timelineCount; i++) {\r\n var timeline = timelines[i];\r\n var direction = spine.MixDirection.out;\r\n var timelineBlend = void 0;\r\n var alpha = 0;\r\n switch (timelineMode[i]) {\r\n case AnimationState.SUBSEQUENT:\r\n if (!attachments && timeline instanceof spine.AttachmentTimeline)\r\n continue;\r\n if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)\r\n continue;\r\n timelineBlend = blend;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.FIRST:\r\n timelineBlend = spine.MixBlend.setup;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.HOLD:\r\n timelineBlend = spine.MixBlend.setup;\r\n alpha = alphaHold;\r\n break;\r\n default:\r\n timelineBlend = spine.MixBlend.setup;\r\n var holdMix = timelineHoldMix[i];\r\n alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\r\n break;\r\n }\r\n from.totalAlpha += alpha;\r\n if (timeline instanceof spine.RotateTimeline)\r\n this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);\r\n else {\r\n spine.Utils.webkit602BugfixHelper(alpha, blend);\r\n if (timelineBlend == spine.MixBlend.setup) {\r\n if (timeline instanceof spine.AttachmentTimeline) {\r\n if (attachments)\r\n direction = spine.MixDirection.out;\r\n }\r\n else if (timeline instanceof spine.DrawOrderTimeline) {\r\n if (drawOrder)\r\n direction = spine.MixDirection.out;\r\n }\r\n }\r\n timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);\r\n }\r\n }\r\n }\r\n if (to.mixDuration > 0)\r\n this.queueEvents(from, animationTime);\r\n this.events.length = 0;\r\n from.nextAnimationLast = animationTime;\r\n from.nextTrackLast = from.trackTime;\r\n return mix;\r\n };\r\n AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\r\n if (firstFrame)\r\n timelinesRotation[i] = 0;\r\n if (alpha == 1) {\r\n timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection[\"in\"]);\r\n return;\r\n }\r\n var rotateTimeline = timeline;\r\n var frames = rotateTimeline.frames;\r\n var bone = skeleton.bones[rotateTimeline.boneIndex];\r\n var r1 = 0, r2 = 0;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case spine.MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n default:\r\n return;\r\n case spine.MixBlend.first:\r\n r1 = bone.rotation;\r\n r2 = bone.data.rotation;\r\n }\r\n }\r\n else {\r\n r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation;\r\n if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES])\r\n r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION];\r\n else {\r\n var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime));\r\n r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n r2 = prevRotation + r2 * percent + bone.data.rotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n }\r\n }\r\n var total = 0, diff = r2 - r1;\r\n diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\r\n if (diff == 0) {\r\n total = timelinesRotation[i];\r\n }\r\n else {\r\n var lastTotal = 0, lastDiff = 0;\r\n if (firstFrame) {\r\n lastTotal = 0;\r\n lastDiff = diff;\r\n }\r\n else {\r\n lastTotal = timelinesRotation[i];\r\n lastDiff = timelinesRotation[i + 1];\r\n }\r\n var current = diff > 0, dir = lastTotal >= 0;\r\n if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\r\n if (Math.abs(lastTotal) > 180)\r\n lastTotal += 360 * spine.MathUtils.signum(lastTotal);\r\n dir = current;\r\n }\r\n total = diff + lastTotal - lastTotal % 360;\r\n if (dir != current)\r\n total += 360 * spine.MathUtils.signum(lastTotal);\r\n timelinesRotation[i] = total;\r\n }\r\n timelinesRotation[i + 1] = diff;\r\n r1 += total * alpha;\r\n bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360;\r\n };\r\n AnimationState.prototype.queueEvents = function (entry, animationTime) {\r\n var animationStart = entry.animationStart, animationEnd = entry.animationEnd;\r\n var duration = animationEnd - animationStart;\r\n var trackLastWrapped = entry.trackLast % duration;\r\n var events = this.events;\r\n var i = 0, n = events.length;\r\n for (; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.time < trackLastWrapped)\r\n break;\r\n if (event_1.time > animationEnd)\r\n continue;\r\n this.queue.event(entry, event_1);\r\n }\r\n var complete = false;\r\n if (entry.loop)\r\n complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\r\n else\r\n complete = animationTime >= animationEnd && entry.animationLast < animationEnd;\r\n if (complete)\r\n this.queue.complete(entry);\r\n for (; i < n; i++) {\r\n var event_2 = events[i];\r\n if (event_2.time < animationStart)\r\n continue;\r\n this.queue.event(entry, events[i]);\r\n }\r\n };\r\n AnimationState.prototype.clearTracks = function () {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.clearTrack = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return;\r\n var current = this.tracks[trackIndex];\r\n if (current == null)\r\n return;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n var entry = current;\r\n while (true) {\r\n var from = entry.mixingFrom;\r\n if (from == null)\r\n break;\r\n this.queue.end(from);\r\n entry.mixingFrom = null;\r\n entry.mixingTo = null;\r\n entry = from;\r\n }\r\n this.tracks[current.trackIndex] = null;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.setCurrent = function (index, current, interrupt) {\r\n var from = this.expandToIndex(index);\r\n this.tracks[index] = current;\r\n if (from != null) {\r\n if (interrupt)\r\n this.queue.interrupt(from);\r\n current.mixingFrom = from;\r\n from.mixingTo = current;\r\n current.mixTime = 0;\r\n if (from.mixingFrom != null && from.mixDuration > 0)\r\n current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\r\n from.timelinesRotation.length = 0;\r\n }\r\n this.queue.start(current);\r\n };\r\n AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n };\r\n AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var interrupt = true;\r\n var current = this.expandToIndex(trackIndex);\r\n if (current != null) {\r\n if (current.nextTrackLast == -1) {\r\n this.tracks[trackIndex] = current.mixingFrom;\r\n this.queue.interrupt(current);\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n current = current.mixingFrom;\r\n interrupt = false;\r\n }\r\n else\r\n this.disposeNext(current);\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, current);\r\n this.setCurrent(trackIndex, entry, interrupt);\r\n this.queue.drain();\r\n return entry;\r\n };\r\n AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n };\r\n AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var last = this.expandToIndex(trackIndex);\r\n if (last != null) {\r\n while (last.next != null)\r\n last = last.next;\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, last);\r\n if (last == null) {\r\n this.setCurrent(trackIndex, entry, true);\r\n this.queue.drain();\r\n }\r\n else {\r\n last.next = entry;\r\n if (delay <= 0) {\r\n var duration = last.animationEnd - last.animationStart;\r\n if (duration != 0) {\r\n if (last.loop)\r\n delay += duration * (1 + ((last.trackTime / duration) | 0));\r\n else\r\n delay += Math.max(duration, last.trackTime);\r\n delay -= this.data.getMix(last.animation, animation);\r\n }\r\n else\r\n delay = last.trackTime;\r\n }\r\n }\r\n entry.delay = delay;\r\n return entry;\r\n };\r\n AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\r\n var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\r\n if (delay <= 0)\r\n delay -= mixDuration;\r\n var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n AnimationState.prototype.setEmptyAnimations = function (mixDuration) {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var current = this.tracks[i];\r\n if (current != null)\r\n this.setEmptyAnimation(current.trackIndex, mixDuration);\r\n }\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.expandToIndex = function (index) {\r\n if (index < this.tracks.length)\r\n return this.tracks[index];\r\n spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n };\r\n AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\r\n var entry = this.trackEntryPool.obtain();\r\n entry.trackIndex = trackIndex;\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.holdPrevious = false;\r\n entry.eventThreshold = 0;\r\n entry.attachmentThreshold = 0;\r\n entry.drawOrderThreshold = 0;\r\n entry.animationStart = 0;\r\n entry.animationEnd = animation.duration;\r\n entry.animationLast = -1;\r\n entry.nextAnimationLast = -1;\r\n entry.delay = 0;\r\n entry.trackTime = 0;\r\n entry.trackLast = -1;\r\n entry.nextTrackLast = -1;\r\n entry.trackEnd = Number.MAX_VALUE;\r\n entry.timeScale = 1;\r\n entry.alpha = 1;\r\n entry.interruptAlpha = 1;\r\n entry.mixTime = 0;\r\n entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);\r\n return entry;\r\n };\r\n AnimationState.prototype.disposeNext = function (entry) {\r\n var next = entry.next;\r\n while (next != null) {\r\n this.queue.dispose(next);\r\n next = next.next;\r\n }\r\n entry.next = null;\r\n };\r\n AnimationState.prototype._animationsChanged = function () {\r\n this.animationsChanged = false;\r\n this.propertyIDs.clear();\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var entry = this.tracks[i];\r\n if (entry == null)\r\n continue;\r\n while (entry.mixingFrom != null)\r\n entry = entry.mixingFrom;\r\n do {\r\n if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add)\r\n this.setTimelineModes(entry);\r\n entry = entry.mixingTo;\r\n } while (entry != null);\r\n }\r\n };\r\n AnimationState.prototype.setTimelineModes = function (entry) {\r\n var to = entry.mixingTo;\r\n var timelines = entry.animation.timelines;\r\n var timelinesCount = entry.animation.timelines.length;\r\n var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount);\r\n entry.timelineHoldMix.length = 0;\r\n var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount);\r\n var propertyIDs = this.propertyIDs;\r\n if (to != null && to.holdPrevious) {\r\n for (var i = 0; i < timelinesCount; i++) {\r\n propertyIDs.add(timelines[i].getPropertyId());\r\n timelineMode[i] = AnimationState.HOLD;\r\n }\r\n return;\r\n }\r\n outer: for (var i = 0; i < timelinesCount; i++) {\r\n var id = timelines[i].getPropertyId();\r\n if (!propertyIDs.add(id))\r\n timelineMode[i] = AnimationState.SUBSEQUENT;\r\n else if (to == null || !this.hasTimeline(to, id))\r\n timelineMode[i] = AnimationState.FIRST;\r\n else {\r\n for (var next = to.mixingTo; next != null; next = next.mixingTo) {\r\n if (this.hasTimeline(next, id))\r\n continue;\r\n if (entry.mixDuration > 0) {\r\n timelineMode[i] = AnimationState.HOLD_MIX;\r\n timelineDipMix[i] = next;\r\n continue outer;\r\n }\r\n break;\r\n }\r\n timelineMode[i] = AnimationState.HOLD;\r\n }\r\n }\r\n };\r\n AnimationState.prototype.hasTimeline = function (entry, id) {\r\n var timelines = entry.animation.timelines;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n if (timelines[i].getPropertyId() == id)\r\n return true;\r\n return false;\r\n };\r\n AnimationState.prototype.getCurrent = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return null;\r\n return this.tracks[trackIndex];\r\n };\r\n AnimationState.prototype.addListener = function (listener) {\r\n if (listener == null)\r\n throw new Error(\"listener cannot be null.\");\r\n this.listeners.push(listener);\r\n };\r\n AnimationState.prototype.removeListener = function (listener) {\r\n var index = this.listeners.indexOf(listener);\r\n if (index >= 0)\r\n this.listeners.splice(index, 1);\r\n };\r\n AnimationState.prototype.clearListeners = function () {\r\n this.listeners.length = 0;\r\n };\r\n AnimationState.prototype.clearListenerNotifications = function () {\r\n this.queue.clear();\r\n };\r\n AnimationState.emptyAnimation = new spine.Animation(\"\", [], 0);\r\n AnimationState.SUBSEQUENT = 0;\r\n AnimationState.FIRST = 1;\r\n AnimationState.HOLD = 2;\r\n AnimationState.HOLD_MIX = 3;\r\n return AnimationState;\r\n }());\r\n spine.AnimationState = AnimationState;\r\n var TrackEntry = (function () {\r\n function TrackEntry() {\r\n this.mixBlend = spine.MixBlend.replace;\r\n this.timelineMode = new Array();\r\n this.timelineHoldMix = new Array();\r\n this.timelinesRotation = new Array();\r\n }\r\n TrackEntry.prototype.reset = function () {\r\n this.next = null;\r\n this.mixingFrom = null;\r\n this.mixingTo = null;\r\n this.animation = null;\r\n this.listener = null;\r\n this.timelineMode.length = 0;\r\n this.timelineHoldMix.length = 0;\r\n this.timelinesRotation.length = 0;\r\n };\r\n TrackEntry.prototype.getAnimationTime = function () {\r\n if (this.loop) {\r\n var duration = this.animationEnd - this.animationStart;\r\n if (duration == 0)\r\n return this.animationStart;\r\n return (this.trackTime % duration) + this.animationStart;\r\n }\r\n return Math.min(this.trackTime + this.animationStart, this.animationEnd);\r\n };\r\n TrackEntry.prototype.setAnimationLast = function (animationLast) {\r\n this.animationLast = animationLast;\r\n this.nextAnimationLast = animationLast;\r\n };\r\n TrackEntry.prototype.isComplete = function () {\r\n return this.trackTime >= this.animationEnd - this.animationStart;\r\n };\r\n TrackEntry.prototype.resetRotationDirections = function () {\r\n this.timelinesRotation.length = 0;\r\n };\r\n return TrackEntry;\r\n }());\r\n spine.TrackEntry = TrackEntry;\r\n var EventQueue = (function () {\r\n function EventQueue(animState) {\r\n this.objects = [];\r\n this.drainDisabled = false;\r\n this.animState = animState;\r\n }\r\n EventQueue.prototype.start = function (entry) {\r\n this.objects.push(EventType.start);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.interrupt = function (entry) {\r\n this.objects.push(EventType.interrupt);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.end = function (entry) {\r\n this.objects.push(EventType.end);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.dispose = function (entry) {\r\n this.objects.push(EventType.dispose);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.complete = function (entry) {\r\n this.objects.push(EventType.complete);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.event = function (entry, event) {\r\n this.objects.push(EventType.event);\r\n this.objects.push(entry);\r\n this.objects.push(event);\r\n };\r\n EventQueue.prototype.drain = function () {\r\n if (this.drainDisabled)\r\n return;\r\n this.drainDisabled = true;\r\n var objects = this.objects;\r\n var listeners = this.animState.listeners;\r\n for (var i = 0; i < objects.length; i += 2) {\r\n var type = objects[i];\r\n var entry = objects[i + 1];\r\n switch (type) {\r\n case EventType.start:\r\n if (entry.listener != null && entry.listener.start)\r\n entry.listener.start(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].start)\r\n listeners[ii].start(entry);\r\n break;\r\n case EventType.interrupt:\r\n if (entry.listener != null && entry.listener.interrupt)\r\n entry.listener.interrupt(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].interrupt)\r\n listeners[ii].interrupt(entry);\r\n break;\r\n case EventType.end:\r\n if (entry.listener != null && entry.listener.end)\r\n entry.listener.end(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].end)\r\n listeners[ii].end(entry);\r\n case EventType.dispose:\r\n if (entry.listener != null && entry.listener.dispose)\r\n entry.listener.dispose(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].dispose)\r\n listeners[ii].dispose(entry);\r\n this.animState.trackEntryPool.free(entry);\r\n break;\r\n case EventType.complete:\r\n if (entry.listener != null && entry.listener.complete)\r\n entry.listener.complete(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].complete)\r\n listeners[ii].complete(entry);\r\n break;\r\n case EventType.event:\r\n var event_3 = objects[i++ + 2];\r\n if (entry.listener != null && entry.listener.event)\r\n entry.listener.event(entry, event_3);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].event)\r\n listeners[ii].event(entry, event_3);\r\n break;\r\n }\r\n }\r\n this.clear();\r\n this.drainDisabled = false;\r\n };\r\n EventQueue.prototype.clear = function () {\r\n this.objects.length = 0;\r\n };\r\n return EventQueue;\r\n }());\r\n spine.EventQueue = EventQueue;\r\n var EventType;\r\n (function (EventType) {\r\n EventType[EventType[\"start\"] = 0] = \"start\";\r\n EventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\r\n EventType[EventType[\"end\"] = 2] = \"end\";\r\n EventType[EventType[\"dispose\"] = 3] = \"dispose\";\r\n EventType[EventType[\"complete\"] = 4] = \"complete\";\r\n EventType[EventType[\"event\"] = 5] = \"event\";\r\n })(EventType = spine.EventType || (spine.EventType = {}));\r\n var AnimationStateAdapter2 = (function () {\r\n function AnimationStateAdapter2() {\r\n }\r\n AnimationStateAdapter2.prototype.start = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.interrupt = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.end = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.dispose = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.complete = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.event = function (entry, event) {\r\n };\r\n return AnimationStateAdapter2;\r\n }());\r\n spine.AnimationStateAdapter2 = AnimationStateAdapter2;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var AnimationStateData = (function () {\r\n function AnimationStateData(skeletonData) {\r\n this.animationToMixTime = {};\r\n this.defaultMix = 0;\r\n if (skeletonData == null)\r\n throw new Error(\"skeletonData cannot be null.\");\r\n this.skeletonData = skeletonData;\r\n }\r\n AnimationStateData.prototype.setMix = function (fromName, toName, duration) {\r\n var from = this.skeletonData.findAnimation(fromName);\r\n if (from == null)\r\n throw new Error(\"Animation not found: \" + fromName);\r\n var to = this.skeletonData.findAnimation(toName);\r\n if (to == null)\r\n throw new Error(\"Animation not found: \" + toName);\r\n this.setMixWith(from, to, duration);\r\n };\r\n AnimationStateData.prototype.setMixWith = function (from, to, duration) {\r\n if (from == null)\r\n throw new Error(\"from cannot be null.\");\r\n if (to == null)\r\n throw new Error(\"to cannot be null.\");\r\n var key = from.name + \".\" + to.name;\r\n this.animationToMixTime[key] = duration;\r\n };\r\n AnimationStateData.prototype.getMix = function (from, to) {\r\n var key = from.name + \".\" + to.name;\r\n var value = this.animationToMixTime[key];\r\n return value === undefined ? this.defaultMix : value;\r\n };\r\n return AnimationStateData;\r\n }());\r\n spine.AnimationStateData = AnimationStateData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var AssetManager = (function () {\r\n function AssetManager(textureLoader, pathPrefix) {\r\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n this.assets = {};\r\n this.errors = {};\r\n this.toLoad = 0;\r\n this.loaded = 0;\r\n this.textureLoader = textureLoader;\r\n this.pathPrefix = pathPrefix;\r\n }\r\n AssetManager.downloadText = function (url, success, error) {\r\n var request = new XMLHttpRequest();\r\n request.open(\"GET\", url, true);\r\n request.onload = function () {\r\n if (request.status == 200) {\r\n success(request.responseText);\r\n }\r\n else {\r\n error(request.status, request.responseText);\r\n }\r\n };\r\n request.onerror = function () {\r\n error(request.status, request.responseText);\r\n };\r\n request.send();\r\n };\r\n AssetManager.downloadBinary = function (url, success, error) {\r\n var request = new XMLHttpRequest();\r\n request.open(\"GET\", url, true);\r\n request.responseType = \"arraybuffer\";\r\n request.onload = function () {\r\n if (request.status == 200) {\r\n success(new Uint8Array(request.response));\r\n }\r\n else {\r\n error(request.status, request.responseText);\r\n }\r\n };\r\n request.onerror = function () {\r\n error(request.status, request.responseText);\r\n };\r\n request.send();\r\n };\r\n AssetManager.prototype.loadText = function (path, success, error) {\r\n var _this = this;\r\n if (success === void 0) { success = null; }\r\n if (error === void 0) { error = null; }\r\n path = this.pathPrefix + path;\r\n this.toLoad++;\r\n AssetManager.downloadText(path, function (data) {\r\n _this.assets[path] = data;\r\n if (success)\r\n success(path, data);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n }, function (state, responseText) {\r\n _this.errors[path] = \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText;\r\n if (error)\r\n error(path, \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n });\r\n };\r\n AssetManager.prototype.loadTexture = function (path, success, error) {\r\n var _this = this;\r\n if (success === void 0) { success = null; }\r\n if (error === void 0) { error = null; }\r\n path = this.pathPrefix + path;\r\n this.toLoad++;\r\n var img = new Image();\r\n img.crossOrigin = \"anonymous\";\r\n img.onload = function (ev) {\r\n var texture = _this.textureLoader(img);\r\n _this.assets[path] = texture;\r\n _this.toLoad--;\r\n _this.loaded++;\r\n if (success)\r\n success(path, img);\r\n };\r\n img.onerror = function (ev) {\r\n _this.errors[path] = \"Couldn't load image \" + path;\r\n _this.toLoad--;\r\n _this.loaded++;\r\n if (error)\r\n error(path, \"Couldn't load image \" + path);\r\n };\r\n img.src = path;\r\n };\r\n AssetManager.prototype.loadTextureData = function (path, data, success, error) {\r\n var _this = this;\r\n if (success === void 0) { success = null; }\r\n if (error === void 0) { error = null; }\r\n path = this.pathPrefix + path;\r\n this.toLoad++;\r\n var img = new Image();\r\n img.onload = function (ev) {\r\n var texture = _this.textureLoader(img);\r\n _this.assets[path] = texture;\r\n _this.toLoad--;\r\n _this.loaded++;\r\n if (success)\r\n success(path, img);\r\n };\r\n img.onerror = function (ev) {\r\n _this.errors[path] = \"Couldn't load image \" + path;\r\n _this.toLoad--;\r\n _this.loaded++;\r\n if (error)\r\n error(path, \"Couldn't load image \" + path);\r\n };\r\n img.src = data;\r\n };\r\n AssetManager.prototype.loadTextureAtlas = function (path, success, error) {\r\n var _this = this;\r\n if (success === void 0) { success = null; }\r\n if (error === void 0) { error = null; }\r\n var parent = path.lastIndexOf(\"/\") >= 0 ? path.substring(0, path.lastIndexOf(\"/\")) : \"\";\r\n path = this.pathPrefix + path;\r\n this.toLoad++;\r\n AssetManager.downloadText(path, function (atlasData) {\r\n var pagesLoaded = { count: 0 };\r\n var atlasPages = new Array();\r\n try {\r\n var atlas = new spine.TextureAtlas(atlasData, function (path) {\r\n atlasPages.push(parent + \"/\" + path);\r\n var image = document.createElement(\"img\");\r\n image.width = 16;\r\n image.height = 16;\r\n return new spine.FakeTexture(image);\r\n });\r\n }\r\n catch (e) {\r\n var ex = e;\r\n _this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\r\n if (error)\r\n error(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n return;\r\n }\r\n var _loop_1 = function (atlasPage) {\r\n var pageLoadError = false;\r\n _this.loadTexture(atlasPage, function (imagePath, image) {\r\n pagesLoaded.count++;\r\n if (pagesLoaded.count == atlasPages.length) {\r\n if (!pageLoadError) {\r\n try {\r\n var atlas = new spine.TextureAtlas(atlasData, function (path) {\r\n return _this.get(parent + \"/\" + path);\r\n });\r\n _this.assets[path] = atlas;\r\n if (success)\r\n success(path, atlas);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n }\r\n catch (e) {\r\n var ex = e;\r\n _this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\r\n if (error)\r\n error(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n }\r\n }\r\n else {\r\n _this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\r\n if (error)\r\n error(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n }\r\n }\r\n }, function (imagePath, errorMessage) {\r\n pageLoadError = true;\r\n pagesLoaded.count++;\r\n if (pagesLoaded.count == atlasPages.length) {\r\n _this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\r\n if (error)\r\n error(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n }\r\n });\r\n };\r\n for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) {\r\n var atlasPage = atlasPages_1[_i];\r\n _loop_1(atlasPage);\r\n }\r\n }, function (state, responseText) {\r\n _this.errors[path] = \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText;\r\n if (error)\r\n error(path, \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n });\r\n };\r\n AssetManager.prototype.get = function (path) {\r\n path = this.pathPrefix + path;\r\n return this.assets[path];\r\n };\r\n AssetManager.prototype.remove = function (path) {\r\n path = this.pathPrefix + path;\r\n var asset = this.assets[path];\r\n if (asset.dispose)\r\n asset.dispose();\r\n this.assets[path] = null;\r\n };\r\n AssetManager.prototype.removeAll = function () {\r\n for (var key in this.assets) {\r\n var asset = this.assets[key];\r\n if (asset.dispose)\r\n asset.dispose();\r\n }\r\n this.assets = {};\r\n };\r\n AssetManager.prototype.isLoadingComplete = function () {\r\n return this.toLoad == 0;\r\n };\r\n AssetManager.prototype.getToLoad = function () {\r\n return this.toLoad;\r\n };\r\n AssetManager.prototype.getLoaded = function () {\r\n return this.loaded;\r\n };\r\n AssetManager.prototype.dispose = function () {\r\n this.removeAll();\r\n };\r\n AssetManager.prototype.hasErrors = function () {\r\n return Object.keys(this.errors).length > 0;\r\n };\r\n AssetManager.prototype.getErrors = function () {\r\n return this.errors;\r\n };\r\n return AssetManager;\r\n }());\r\n spine.AssetManager = AssetManager;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var AtlasAttachmentLoader = (function () {\r\n function AtlasAttachmentLoader(atlas) {\r\n this.atlas = atlas;\r\n }\r\n AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n region.renderObject = region;\r\n var attachment = new spine.RegionAttachment(name);\r\n attachment.setRegion(region);\r\n return attachment;\r\n };\r\n AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n region.renderObject = region;\r\n var attachment = new spine.MeshAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n };\r\n AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\r\n return new spine.BoundingBoxAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\r\n return new spine.PathAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\r\n return new spine.PointAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\r\n return new spine.ClippingAttachment(name);\r\n };\r\n return AtlasAttachmentLoader;\r\n }());\r\n spine.AtlasAttachmentLoader = AtlasAttachmentLoader;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var BlendMode;\r\n (function (BlendMode) {\r\n BlendMode[BlendMode[\"Normal\"] = 0] = \"Normal\";\r\n BlendMode[BlendMode[\"Additive\"] = 1] = \"Additive\";\r\n BlendMode[BlendMode[\"Multiply\"] = 2] = \"Multiply\";\r\n BlendMode[BlendMode[\"Screen\"] = 3] = \"Screen\";\r\n })(BlendMode = spine.BlendMode || (spine.BlendMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Bone = (function () {\r\n function Bone(data, skeleton, parent) {\r\n this.children = new Array();\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 0;\r\n this.scaleY = 0;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.ax = 0;\r\n this.ay = 0;\r\n this.arotation = 0;\r\n this.ascaleX = 0;\r\n this.ascaleY = 0;\r\n this.ashearX = 0;\r\n this.ashearY = 0;\r\n this.appliedValid = false;\r\n this.a = 0;\r\n this.b = 0;\r\n this.worldX = 0;\r\n this.c = 0;\r\n this.d = 0;\r\n this.worldY = 0;\r\n this.sorted = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.skeleton = skeleton;\r\n this.parent = parent;\r\n this.setToSetupPose();\r\n }\r\n Bone.prototype.update = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n Bone.prototype.updateWorldTransform = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\r\n this.ax = x;\r\n this.ay = y;\r\n this.arotation = rotation;\r\n this.ascaleX = scaleX;\r\n this.ascaleY = scaleY;\r\n this.ashearX = shearX;\r\n this.ashearY = shearY;\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n if (parent == null) {\r\n var skeleton = this.skeleton;\r\n var rotationY = rotation + 90 + shearY;\r\n var sx = skeleton.scaleX;\r\n var sy = skeleton.scaleY;\r\n this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\r\n this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx;\r\n this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\r\n this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;\r\n this.worldX = x * sx + skeleton.x;\r\n this.worldY = y * sy + skeleton.y;\r\n return;\r\n }\r\n var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\r\n this.worldX = pa * x + pb * y + parent.worldX;\r\n this.worldY = pc * x + pd * y + parent.worldY;\r\n switch (this.data.transformMode) {\r\n case spine.TransformMode.Normal: {\r\n var rotationY = rotation + 90 + shearY;\r\n var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;\r\n var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;\r\n this.a = pa * la + pb * lc;\r\n this.b = pa * lb + pb * ld;\r\n this.c = pc * la + pd * lc;\r\n this.d = pc * lb + pd * ld;\r\n return;\r\n }\r\n case spine.TransformMode.OnlyTranslation: {\r\n var rotationY = rotation + 90 + shearY;\r\n this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n this.b = spine.MathUtils.cosDeg(rotationY) * scaleY;\r\n this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n this.d = spine.MathUtils.sinDeg(rotationY) * scaleY;\r\n break;\r\n }\r\n case spine.TransformMode.NoRotationOrReflection: {\r\n var s = pa * pa + pc * pc;\r\n var prx = 0;\r\n if (s > 0.0001) {\r\n s = Math.abs(pa * pd - pb * pc) / s;\r\n pb = pc * s;\r\n pd = pa * s;\r\n prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg;\r\n }\r\n else {\r\n pa = 0;\r\n pc = 0;\r\n prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg;\r\n }\r\n var rx = rotation + shearX - prx;\r\n var ry = rotation + shearY - prx + 90;\r\n var la = spine.MathUtils.cosDeg(rx) * scaleX;\r\n var lb = spine.MathUtils.cosDeg(ry) * scaleY;\r\n var lc = spine.MathUtils.sinDeg(rx) * scaleX;\r\n var ld = spine.MathUtils.sinDeg(ry) * scaleY;\r\n this.a = pa * la - pb * lc;\r\n this.b = pa * lb - pb * ld;\r\n this.c = pc * la + pd * lc;\r\n this.d = pc * lb + pd * ld;\r\n break;\r\n }\r\n case spine.TransformMode.NoScale:\r\n case spine.TransformMode.NoScaleOrReflection: {\r\n var cos = spine.MathUtils.cosDeg(rotation);\r\n var sin = spine.MathUtils.sinDeg(rotation);\r\n var za = (pa * cos + pb * sin) / this.skeleton.scaleX;\r\n var zc = (pc * cos + pd * sin) / this.skeleton.scaleY;\r\n var s = Math.sqrt(za * za + zc * zc);\r\n if (s > 0.00001)\r\n s = 1 / s;\r\n za *= s;\r\n zc *= s;\r\n s = Math.sqrt(za * za + zc * zc);\r\n if (this.data.transformMode == spine.TransformMode.NoScale\r\n && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0))\r\n s = -s;\r\n var r = Math.PI / 2 + Math.atan2(zc, za);\r\n var zb = Math.cos(r) * s;\r\n var zd = Math.sin(r) * s;\r\n var la = spine.MathUtils.cosDeg(shearX) * scaleX;\r\n var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;\r\n var lc = spine.MathUtils.sinDeg(shearX) * scaleX;\r\n var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;\r\n this.a = za * la + zb * lc;\r\n this.b = za * lb + zb * ld;\r\n this.c = zc * la + zd * lc;\r\n this.d = zc * lb + zd * ld;\r\n break;\r\n }\r\n }\r\n this.a *= this.skeleton.scaleX;\r\n this.b *= this.skeleton.scaleX;\r\n this.c *= this.skeleton.scaleY;\r\n this.d *= this.skeleton.scaleY;\r\n };\r\n Bone.prototype.setToSetupPose = function () {\r\n var data = this.data;\r\n this.x = data.x;\r\n this.y = data.y;\r\n this.rotation = data.rotation;\r\n this.scaleX = data.scaleX;\r\n this.scaleY = data.scaleY;\r\n this.shearX = data.shearX;\r\n this.shearY = data.shearY;\r\n };\r\n Bone.prototype.getWorldRotationX = function () {\r\n return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldRotationY = function () {\r\n return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldScaleX = function () {\r\n return Math.sqrt(this.a * this.a + this.c * this.c);\r\n };\r\n Bone.prototype.getWorldScaleY = function () {\r\n return Math.sqrt(this.b * this.b + this.d * this.d);\r\n };\r\n Bone.prototype.updateAppliedTransform = function () {\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n if (parent == null) {\r\n this.ax = this.worldX;\r\n this.ay = this.worldY;\r\n this.arotation = Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\r\n this.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);\r\n this.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);\r\n this.ashearX = 0;\r\n this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg;\r\n return;\r\n }\r\n var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\r\n var pid = 1 / (pa * pd - pb * pc);\r\n var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;\r\n this.ax = (dx * pd * pid - dy * pb * pid);\r\n this.ay = (dy * pa * pid - dx * pc * pid);\r\n var ia = pid * pd;\r\n var id = pid * pa;\r\n var ib = pid * pb;\r\n var ic = pid * pc;\r\n var ra = ia * this.a - ib * this.c;\r\n var rb = ia * this.b - ib * this.d;\r\n var rc = id * this.c - ic * this.a;\r\n var rd = id * this.d - ic * this.b;\r\n this.ashearX = 0;\r\n this.ascaleX = Math.sqrt(ra * ra + rc * rc);\r\n if (this.ascaleX > 0.0001) {\r\n var det = ra * rd - rb * rc;\r\n this.ascaleY = det / this.ascaleX;\r\n this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg;\r\n this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg;\r\n }\r\n else {\r\n this.ascaleX = 0;\r\n this.ascaleY = Math.sqrt(rb * rb + rd * rd);\r\n this.ashearY = 0;\r\n this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg;\r\n }\r\n };\r\n Bone.prototype.worldToLocal = function (world) {\r\n var a = this.a, b = this.b, c = this.c, d = this.d;\r\n var invDet = 1 / (a * d - b * c);\r\n var x = world.x - this.worldX, y = world.y - this.worldY;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * invDet - x * c * invDet);\r\n return world;\r\n };\r\n Bone.prototype.localToWorld = function (local) {\r\n var x = local.x, y = local.y;\r\n local.x = x * this.a + y * this.b + this.worldX;\r\n local.y = x * this.c + y * this.d + this.worldY;\r\n return local;\r\n };\r\n Bone.prototype.worldToLocalRotation = function (worldRotation) {\r\n var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation);\r\n return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX;\r\n };\r\n Bone.prototype.localToWorldRotation = function (localRotation) {\r\n localRotation -= this.rotation - this.shearX;\r\n var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation);\r\n return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg;\r\n };\r\n Bone.prototype.rotateWorld = function (degrees) {\r\n var a = this.a, b = this.b, c = this.c, d = this.d;\r\n var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees);\r\n this.a = cos * a - sin * c;\r\n this.b = cos * b - sin * d;\r\n this.c = sin * a + cos * c;\r\n this.d = sin * b + cos * d;\r\n this.appliedValid = false;\r\n };\r\n return Bone;\r\n }());\r\n spine.Bone = Bone;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var BoneData = (function () {\r\n function BoneData(index, name, parent) {\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.transformMode = TransformMode.Normal;\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.parent = parent;\r\n }\r\n return BoneData;\r\n }());\r\n spine.BoneData = BoneData;\r\n var TransformMode;\r\n (function (TransformMode) {\r\n TransformMode[TransformMode[\"Normal\"] = 0] = \"Normal\";\r\n TransformMode[TransformMode[\"OnlyTranslation\"] = 1] = \"OnlyTranslation\";\r\n TransformMode[TransformMode[\"NoRotationOrReflection\"] = 2] = \"NoRotationOrReflection\";\r\n TransformMode[TransformMode[\"NoScale\"] = 3] = \"NoScale\";\r\n TransformMode[TransformMode[\"NoScaleOrReflection\"] = 4] = \"NoScaleOrReflection\";\r\n })(TransformMode = spine.TransformMode || (spine.TransformMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Event = (function () {\r\n function Event(time, data) {\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n return Event;\r\n }());\r\n spine.Event = Event;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var EventData = (function () {\r\n function EventData(name) {\r\n this.name = name;\r\n }\r\n return EventData;\r\n }());\r\n spine.EventData = EventData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var IkConstraint = (function () {\r\n function IkConstraint(data, skeleton) {\r\n this.bendDirection = 0;\r\n this.compress = false;\r\n this.stretch = false;\r\n this.mix = 1;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mix = data.mix;\r\n this.bendDirection = data.bendDirection;\r\n this.compress = data.compress;\r\n this.stretch = data.stretch;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n IkConstraint.prototype.getOrder = function () {\r\n return this.data.order;\r\n };\r\n IkConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n IkConstraint.prototype.update = function () {\r\n var target = this.target;\r\n var bones = this.bones;\r\n switch (bones.length) {\r\n case 1:\r\n this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\r\n break;\r\n case 2:\r\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix);\r\n break;\r\n }\r\n };\r\n IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var p = bone.parent;\r\n var id = 1 / (p.a * p.d - p.b * p.c);\r\n var x = targetX - p.worldX, y = targetY - p.worldY;\r\n var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay;\r\n var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation;\r\n if (bone.ascaleX < 0)\r\n rotationIK += 180;\r\n if (rotationIK > 180)\r\n rotationIK -= 360;\r\n else if (rotationIK < -180)\r\n rotationIK += 360;\r\n var sx = bone.ascaleX, sy = bone.ascaleY;\r\n if (compress || stretch) {\r\n var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\r\n if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\r\n var s = (dd / b - 1) * alpha + 1;\r\n sx *= s;\r\n if (uniform)\r\n sy *= s;\r\n }\r\n }\r\n bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\r\n };\r\n IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) {\r\n if (alpha == 0) {\r\n child.updateWorldTransform();\r\n return;\r\n }\r\n if (!parent.appliedValid)\r\n parent.updateAppliedTransform();\r\n if (!child.appliedValid)\r\n child.updateAppliedTransform();\r\n var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;\r\n var os1 = 0, os2 = 0, s2 = 0;\r\n if (psx < 0) {\r\n psx = -psx;\r\n os1 = 180;\r\n s2 = -1;\r\n }\r\n else {\r\n os1 = 0;\r\n s2 = 1;\r\n }\r\n if (psy < 0) {\r\n psy = -psy;\r\n s2 = -s2;\r\n }\r\n if (csx < 0) {\r\n csx = -csx;\r\n os2 = 180;\r\n }\r\n else\r\n os2 = 0;\r\n var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;\r\n var u = Math.abs(psx - psy) <= 0.0001;\r\n if (!u) {\r\n cy = 0;\r\n cwx = a * cx + parent.worldX;\r\n cwy = c * cx + parent.worldY;\r\n }\r\n else {\r\n cy = child.ay;\r\n cwx = a * cx + b * cy + parent.worldX;\r\n cwy = c * cx + d * cy + parent.worldY;\r\n }\r\n var pp = parent.parent;\r\n a = pp.a;\r\n b = pp.b;\r\n c = pp.c;\r\n d = pp.d;\r\n var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY;\r\n var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty;\r\n x = cwx - pp.worldX;\r\n y = cwy - pp.worldY;\r\n var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;\r\n outer: if (u) {\r\n l2 *= psx;\r\n var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n if (cos < -1)\r\n cos = -1;\r\n else if (cos > 1) {\r\n cos = 1;\r\n if (stretch && l1 + l2 > 0.0001)\r\n sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\r\n }\r\n a2 = Math.acos(cos) * bendDir;\r\n a = l1 + l2 * cos;\r\n b = l2 * Math.sin(a2);\r\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n }\r\n else {\r\n a = psx * l2;\r\n b = psy * l2;\r\n var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\r\n c = bb * l1 * l1 + aa * dd - aa * bb;\r\n var c1 = -2 * bb * l1, c2 = bb - aa;\r\n d = c1 * c1 - 4 * c2 * c;\r\n if (d >= 0) {\r\n var q = Math.sqrt(d);\r\n if (c1 < 0)\r\n q = -q;\r\n q = -(c1 + q) / 2;\r\n var r0 = q / c2, r1 = c / q;\r\n var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n if (r * r <= dd) {\r\n y = Math.sqrt(dd - r * r) * bendDir;\r\n a1 = ta - Math.atan2(y, r);\r\n a2 = Math.atan2(y / psy, (r - l1) / psx);\r\n break outer;\r\n }\r\n }\r\n var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\r\n var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\r\n c = -a * l1 / (aa - bb);\r\n if (c >= -1 && c <= 1) {\r\n c = Math.acos(c);\r\n x = a * Math.cos(c) + l1;\r\n y = b * Math.sin(c);\r\n d = x * x + y * y;\r\n if (d < minDist) {\r\n minAngle = c;\r\n minDist = d;\r\n minX = x;\r\n minY = y;\r\n }\r\n if (d > maxDist) {\r\n maxAngle = c;\r\n maxDist = d;\r\n maxX = x;\r\n maxY = y;\r\n }\r\n }\r\n if (dd <= (minDist + maxDist) / 2) {\r\n a1 = ta - Math.atan2(minY * bendDir, minX);\r\n a2 = minAngle * bendDir;\r\n }\r\n else {\r\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n a2 = maxAngle * bendDir;\r\n }\r\n }\r\n var os = Math.atan2(cy, cx) * s2;\r\n var rotation = parent.arotation;\r\n a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation;\r\n if (a1 > 180)\r\n a1 -= 360;\r\n else if (a1 < -180)\r\n a1 += 360;\r\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0);\r\n rotation = child.arotation;\r\n a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\r\n if (a2 > 180)\r\n a2 -= 360;\r\n else if (a2 < -180)\r\n a2 += 360;\r\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n };\r\n return IkConstraint;\r\n }());\r\n spine.IkConstraint = IkConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var IkConstraintData = (function () {\r\n function IkConstraintData(name) {\r\n this.order = 0;\r\n this.bones = new Array();\r\n this.bendDirection = 1;\r\n this.compress = false;\r\n this.stretch = false;\r\n this.uniform = false;\r\n this.mix = 1;\r\n this.name = name;\r\n }\r\n return IkConstraintData;\r\n }());\r\n spine.IkConstraintData = IkConstraintData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var PathConstraint = (function () {\r\n function PathConstraint(data, skeleton) {\r\n this.position = 0;\r\n this.spacing = 0;\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.spaces = new Array();\r\n this.positions = new Array();\r\n this.world = new Array();\r\n this.curves = new Array();\r\n this.lengths = new Array();\r\n this.segments = new Array();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0, n = data.bones.length; i < n; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findSlot(data.target.name);\r\n this.position = data.position;\r\n this.spacing = data.spacing;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n }\r\n PathConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n PathConstraint.prototype.update = function () {\r\n var attachment = this.target.getAttachment();\r\n if (!(attachment instanceof spine.PathAttachment))\r\n return;\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix;\r\n var translate = translateMix > 0, rotate = rotateMix > 0;\r\n if (!translate && !rotate)\r\n return;\r\n var data = this.data;\r\n var percentSpacing = data.spacingMode == spine.SpacingMode.Percent;\r\n var rotateMode = data.rotateMode;\r\n var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale;\r\n var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n var bones = this.bones;\r\n var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null;\r\n var spacing = this.spacing;\r\n if (scale || !percentSpacing) {\r\n if (scale)\r\n lengths = spine.Utils.setArraySize(this.lengths, boneCount);\r\n var lengthSpacing = data.spacingMode == spine.SpacingMode.Length;\r\n for (var i = 0, n = spacesCount - 1; i < n;) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon) {\r\n if (scale)\r\n lengths[i] = 0;\r\n spaces[++i] = 0;\r\n }\r\n else if (percentSpacing) {\r\n if (scale) {\r\n var x = setupLength * bone.a, y = setupLength * bone.c;\r\n var length_1 = Math.sqrt(x * x + y * y);\r\n lengths[i] = length_1;\r\n }\r\n spaces[++i] = spacing;\r\n }\r\n else {\r\n var x = setupLength * bone.a, y = setupLength * bone.c;\r\n var length_2 = Math.sqrt(x * x + y * y);\r\n if (scale)\r\n lengths[i] = length_2;\r\n spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] = spacing;\r\n }\r\n var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing);\r\n var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n var tip = false;\r\n if (offsetRotation == 0)\r\n tip = rotateMode == spine.RotateMode.Chain;\r\n else {\r\n tip = false;\r\n var p = this.target.bone;\r\n offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n }\r\n for (var i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n var bone = bones[i];\r\n bone.worldX += (boneX - bone.worldX) * translateMix;\r\n bone.worldY += (boneY - bone.worldY) * translateMix;\r\n var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n if (scale) {\r\n var length_3 = lengths[i];\r\n if (length_3 != 0) {\r\n var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1;\r\n bone.a *= s;\r\n bone.c *= s;\r\n }\r\n }\r\n boneX = x;\r\n boneY = y;\r\n if (rotate) {\r\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;\r\n if (tangents)\r\n r = positions[p - 1];\r\n else if (spaces[i + 1] == 0)\r\n r = positions[p + 2];\r\n else\r\n r = Math.atan2(dy, dx);\r\n r -= Math.atan2(c, a);\r\n if (tip) {\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n var length_4 = bone.data.length;\r\n boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix;\r\n boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix;\r\n }\r\n else {\r\n r += offsetRotation;\r\n }\r\n if (r > spine.MathUtils.PI)\r\n r -= spine.MathUtils.PI2;\r\n else if (r < -spine.MathUtils.PI)\r\n r += spine.MathUtils.PI2;\r\n r *= rotateMix;\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n bone.a = cos * a - sin * c;\r\n bone.b = cos * b - sin * d;\r\n bone.c = sin * a + cos * c;\r\n bone.d = sin * b + cos * d;\r\n }\r\n bone.appliedValid = false;\r\n }\r\n };\r\n PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {\r\n var target = this.target;\r\n var position = this.position;\r\n var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;\r\n var closed = path.closed;\r\n var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n if (!path.constantSpeed) {\r\n var lengths = path.lengths;\r\n curveCount -= closed ? 1 : 2;\r\n var pathLength_1 = lengths[curveCount];\r\n if (percentPosition)\r\n position *= pathLength_1;\r\n if (percentSpacing) {\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] *= pathLength_1;\r\n }\r\n world = spine.Utils.setArraySize(this.world, 8);\r\n for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength_1;\r\n if (p < 0)\r\n p += pathLength_1;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n if (prevCurve != PathConstraint.BEFORE) {\r\n prevCurve = PathConstraint.BEFORE;\r\n path.computeWorldVertices(target, 2, 4, world, 0, 2);\r\n }\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength_1) {\r\n if (prevCurve != PathConstraint.AFTER) {\r\n prevCurve = PathConstraint.AFTER;\r\n path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\r\n }\r\n this.addAfterPosition(p - pathLength_1, world, 0, out, o);\r\n continue;\r\n }\r\n for (;; curve++) {\r\n var length_5 = lengths[curve];\r\n if (p > length_5)\r\n continue;\r\n if (curve == 0)\r\n p /= length_5;\r\n else {\r\n var prev = lengths[curve - 1];\r\n p = (p - prev) / (length_5 - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n if (closed && curve == curveCount) {\r\n path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 4, world, 4, 2);\r\n }\r\n else\r\n path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\r\n }\r\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n if (closed) {\r\n verticesLength += 2;\r\n world = spine.Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\r\n world[verticesLength - 2] = world[0];\r\n world[verticesLength - 1] = world[1];\r\n }\r\n else {\r\n curveCount--;\r\n verticesLength -= 4;\r\n world = spine.Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\r\n }\r\n var curves = spine.Utils.setArraySize(this.curves, curveCount);\r\n var pathLength = 0;\r\n var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n for (var i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n cx1 = world[w];\r\n cy1 = world[w + 1];\r\n cx2 = world[w + 2];\r\n cy2 = world[w + 3];\r\n x2 = world[w + 4];\r\n y2 = world[w + 5];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n curves[i] = pathLength;\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n if (percentPosition)\r\n position *= pathLength;\r\n else\r\n position *= pathLength / path.lengths[curveCount - 1];\r\n if (percentSpacing) {\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] *= pathLength;\r\n }\r\n var segments = this.segments;\r\n var curveLength = 0;\r\n for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0)\r\n p += pathLength;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength) {\r\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n continue;\r\n }\r\n for (;; curve++) {\r\n var length_6 = curves[curve];\r\n if (p > length_6)\r\n continue;\r\n if (curve == 0)\r\n p /= length_6;\r\n else {\r\n var prev = curves[curve - 1];\r\n p = (p - prev) / (length_6 - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n var ii = curve * 6;\r\n x1 = world[ii];\r\n y1 = world[ii + 1];\r\n cx1 = world[ii + 2];\r\n cy1 = world[ii + 3];\r\n cx2 = world[ii + 4];\r\n cy2 = world[ii + 5];\r\n x2 = world[ii + 6];\r\n y2 = world[ii + 7];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[0] = curveLength;\r\n for (ii = 1; ii < 8; ii++) {\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[ii] = curveLength;\r\n }\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[8] = curveLength;\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[9] = curveLength;\r\n segment = 0;\r\n }\r\n p *= curveLength;\r\n for (;; segment++) {\r\n var length_7 = segments[segment];\r\n if (p > length_7)\r\n continue;\r\n if (segment == 0)\r\n p /= length_7;\r\n else {\r\n var prev = segments[segment - 1];\r\n p = segment + (p - prev) / (length_7 - prev);\r\n }\r\n break;\r\n }\r\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n };\r\n PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\r\n if (p == 0 || isNaN(p)) {\r\n out[o] = x1;\r\n out[o + 1] = y1;\r\n out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n return;\r\n }\r\n var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n out[o] = x;\r\n out[o + 1] = y;\r\n if (tangents) {\r\n if (p < 0.001)\r\n out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n else\r\n out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n }\r\n };\r\n PathConstraint.prototype.getOrder = function () {\r\n return this.data.order;\r\n };\r\n PathConstraint.NONE = -1;\r\n PathConstraint.BEFORE = -2;\r\n PathConstraint.AFTER = -3;\r\n PathConstraint.epsilon = 0.00001;\r\n return PathConstraint;\r\n }());\r\n spine.PathConstraint = PathConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var PathConstraintData = (function () {\r\n function PathConstraintData(name) {\r\n this.order = 0;\r\n this.bones = new Array();\r\n this.name = name;\r\n }\r\n return PathConstraintData;\r\n }());\r\n spine.PathConstraintData = PathConstraintData;\r\n var PositionMode;\r\n (function (PositionMode) {\r\n PositionMode[PositionMode[\"Fixed\"] = 0] = \"Fixed\";\r\n PositionMode[PositionMode[\"Percent\"] = 1] = \"Percent\";\r\n })(PositionMode = spine.PositionMode || (spine.PositionMode = {}));\r\n var SpacingMode;\r\n (function (SpacingMode) {\r\n SpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\r\n SpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\r\n SpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\r\n })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {}));\r\n var RotateMode;\r\n (function (RotateMode) {\r\n RotateMode[RotateMode[\"Tangent\"] = 0] = \"Tangent\";\r\n RotateMode[RotateMode[\"Chain\"] = 1] = \"Chain\";\r\n RotateMode[RotateMode[\"ChainScale\"] = 2] = \"ChainScale\";\r\n })(RotateMode = spine.RotateMode || (spine.RotateMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Assets = (function () {\r\n function Assets(clientId) {\r\n this.toLoad = new Array();\r\n this.assets = {};\r\n this.clientId = clientId;\r\n }\r\n Assets.prototype.loaded = function () {\r\n var i = 0;\r\n for (var v in this.assets)\r\n i++;\r\n return i;\r\n };\r\n return Assets;\r\n }());\r\n var SharedAssetManager = (function () {\r\n function SharedAssetManager(pathPrefix) {\r\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n this.clientAssets = {};\r\n this.queuedAssets = {};\r\n this.rawAssets = {};\r\n this.errors = {};\r\n this.pathPrefix = pathPrefix;\r\n }\r\n SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) {\r\n var clientAssets = this.clientAssets[clientId];\r\n if (clientAssets === null || clientAssets === undefined) {\r\n clientAssets = new Assets(clientId);\r\n this.clientAssets[clientId] = clientAssets;\r\n }\r\n if (textureLoader !== null)\r\n clientAssets.textureLoader = textureLoader;\r\n clientAssets.toLoad.push(path);\r\n if (this.queuedAssets[path] === path) {\r\n return false;\r\n }\r\n else {\r\n this.queuedAssets[path] = path;\r\n return true;\r\n }\r\n };\r\n SharedAssetManager.prototype.loadText = function (clientId, path) {\r\n var _this = this;\r\n path = this.pathPrefix + path;\r\n if (!this.queueAsset(clientId, null, path))\r\n return;\r\n var request = new XMLHttpRequest();\r\n request.onreadystatechange = function () {\r\n if (request.readyState == XMLHttpRequest.DONE) {\r\n if (request.status >= 200 && request.status < 300) {\r\n _this.rawAssets[path] = request.responseText;\r\n }\r\n else {\r\n _this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\r\n }\r\n }\r\n };\r\n request.open(\"GET\", path, true);\r\n request.send();\r\n };\r\n SharedAssetManager.prototype.loadJson = function (clientId, path) {\r\n var _this = this;\r\n path = this.pathPrefix + path;\r\n if (!this.queueAsset(clientId, null, path))\r\n return;\r\n var request = new XMLHttpRequest();\r\n request.onreadystatechange = function () {\r\n if (request.readyState == XMLHttpRequest.DONE) {\r\n if (request.status >= 200 && request.status < 300) {\r\n _this.rawAssets[path] = JSON.parse(request.responseText);\r\n }\r\n else {\r\n _this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\r\n }\r\n }\r\n };\r\n request.open(\"GET\", path, true);\r\n request.send();\r\n };\r\n SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) {\r\n var _this = this;\r\n path = this.pathPrefix + path;\r\n if (!this.queueAsset(clientId, textureLoader, path))\r\n return;\r\n var img = new Image();\r\n img.src = path;\r\n img.crossOrigin = \"anonymous\";\r\n img.onload = function (ev) {\r\n _this.rawAssets[path] = img;\r\n };\r\n img.onerror = function (ev) {\r\n _this.errors[path] = \"Couldn't load image \" + path;\r\n };\r\n };\r\n SharedAssetManager.prototype.get = function (clientId, path) {\r\n path = this.pathPrefix + path;\r\n var clientAssets = this.clientAssets[clientId];\r\n if (clientAssets === null || clientAssets === undefined)\r\n return true;\r\n return clientAssets.assets[path];\r\n };\r\n SharedAssetManager.prototype.updateClientAssets = function (clientAssets) {\r\n for (var i = 0; i < clientAssets.toLoad.length; i++) {\r\n var path = clientAssets.toLoad[i];\r\n var asset = clientAssets.assets[path];\r\n if (asset === null || asset === undefined) {\r\n var rawAsset = this.rawAssets[path];\r\n if (rawAsset === null || rawAsset === undefined)\r\n continue;\r\n if (rawAsset instanceof HTMLImageElement) {\r\n clientAssets.assets[path] = clientAssets.textureLoader(rawAsset);\r\n }\r\n else {\r\n clientAssets.assets[path] = rawAsset;\r\n }\r\n }\r\n }\r\n };\r\n SharedAssetManager.prototype.isLoadingComplete = function (clientId) {\r\n var clientAssets = this.clientAssets[clientId];\r\n if (clientAssets === null || clientAssets === undefined)\r\n return true;\r\n this.updateClientAssets(clientAssets);\r\n return clientAssets.toLoad.length == clientAssets.loaded();\r\n };\r\n SharedAssetManager.prototype.dispose = function () {\r\n };\r\n SharedAssetManager.prototype.hasErrors = function () {\r\n return Object.keys(this.errors).length > 0;\r\n };\r\n SharedAssetManager.prototype.getErrors = function () {\r\n return this.errors;\r\n };\r\n return SharedAssetManager;\r\n }());\r\n spine.SharedAssetManager = SharedAssetManager;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Skeleton = (function () {\r\n function Skeleton(data) {\r\n this._updateCache = new Array();\r\n this.updateCacheReset = new Array();\r\n this.time = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.x = 0;\r\n this.y = 0;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var boneData = data.bones[i];\r\n var bone = void 0;\r\n if (boneData.parent == null)\r\n bone = new spine.Bone(boneData, this, null);\r\n else {\r\n var parent_1 = this.bones[boneData.parent.index];\r\n bone = new spine.Bone(boneData, this, parent_1);\r\n parent_1.children.push(bone);\r\n }\r\n this.bones.push(bone);\r\n }\r\n this.slots = new Array();\r\n this.drawOrder = new Array();\r\n for (var i = 0; i < data.slots.length; i++) {\r\n var slotData = data.slots[i];\r\n var bone = this.bones[slotData.boneData.index];\r\n var slot = new spine.Slot(slotData, bone);\r\n this.slots.push(slot);\r\n this.drawOrder.push(slot);\r\n }\r\n this.ikConstraints = new Array();\r\n for (var i = 0; i < data.ikConstraints.length; i++) {\r\n var ikConstraintData = data.ikConstraints[i];\r\n this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this));\r\n }\r\n this.transformConstraints = new Array();\r\n for (var i = 0; i < data.transformConstraints.length; i++) {\r\n var transformConstraintData = data.transformConstraints[i];\r\n this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this));\r\n }\r\n this.pathConstraints = new Array();\r\n for (var i = 0; i < data.pathConstraints.length; i++) {\r\n var pathConstraintData = data.pathConstraints[i];\r\n this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this));\r\n }\r\n this.color = new spine.Color(1, 1, 1, 1);\r\n this.updateCache();\r\n }\r\n Skeleton.prototype.updateCache = function () {\r\n var updateCache = this._updateCache;\r\n updateCache.length = 0;\r\n this.updateCacheReset.length = 0;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n bones[i].sorted = false;\r\n var ikConstraints = this.ikConstraints;\r\n var transformConstraints = this.transformConstraints;\r\n var pathConstraints = this.pathConstraints;\r\n var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\r\n var constraintCount = ikCount + transformCount + pathCount;\r\n outer: for (var i = 0; i < constraintCount; i++) {\r\n for (var ii = 0; ii < ikCount; ii++) {\r\n var constraint = ikConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortIkConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < transformCount; ii++) {\r\n var constraint = transformConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortTransformConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < pathCount; ii++) {\r\n var constraint = pathConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortPathConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n }\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n this.sortBone(bones[i]);\r\n };\r\n Skeleton.prototype.sortIkConstraint = function (constraint) {\r\n var target = constraint.target;\r\n this.sortBone(target);\r\n var constrained = constraint.bones;\r\n var parent = constrained[0];\r\n this.sortBone(parent);\r\n if (constrained.length > 1) {\r\n var child = constrained[constrained.length - 1];\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n this._updateCache.push(constraint);\r\n this.sortReset(parent.children);\r\n constrained[constrained.length - 1].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraint = function (constraint) {\r\n var slot = constraint.target;\r\n var slotIndex = slot.data.index;\r\n var slotBone = slot.bone;\r\n if (this.skin != null)\r\n this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\r\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n for (var i = 0, n = this.data.skins.length; i < n; i++)\r\n this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof spine.PathAttachment)\r\n this.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortBone(constrained[i]);\r\n this._updateCache.push(constraint);\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortReset(constrained[i].children);\r\n for (var i = 0; i < boneCount; i++)\r\n constrained[i].sorted = true;\r\n };\r\n Skeleton.prototype.sortTransformConstraint = function (constraint) {\r\n this.sortBone(constraint.target);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n if (constraint.data.local) {\r\n for (var i = 0; i < boneCount; i++) {\r\n var child = constrained[i];\r\n this.sortBone(child.parent);\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < boneCount; i++) {\r\n this.sortBone(constrained[i]);\r\n }\r\n }\r\n this._updateCache.push(constraint);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n this.sortReset(constrained[ii].children);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n constrained[ii].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\r\n var attachments = skin.attachments[slotIndex];\r\n if (!attachments)\r\n return;\r\n for (var key in attachments) {\r\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n }\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\r\n if (!(attachment instanceof spine.PathAttachment))\r\n return;\r\n var pathBones = attachment.bones;\r\n if (pathBones == null)\r\n this.sortBone(slotBone);\r\n else {\r\n var bones = this.bones;\r\n var i = 0;\r\n while (i < pathBones.length) {\r\n var boneCount = pathBones[i++];\r\n for (var n = i + boneCount; i < n; i++) {\r\n var boneIndex = pathBones[i];\r\n this.sortBone(bones[boneIndex]);\r\n }\r\n }\r\n }\r\n };\r\n Skeleton.prototype.sortBone = function (bone) {\r\n if (bone.sorted)\r\n return;\r\n var parent = bone.parent;\r\n if (parent != null)\r\n this.sortBone(parent);\r\n bone.sorted = true;\r\n this._updateCache.push(bone);\r\n };\r\n Skeleton.prototype.sortReset = function (bones) {\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.sorted)\r\n this.sortReset(bone.children);\r\n bone.sorted = false;\r\n }\r\n };\r\n Skeleton.prototype.updateWorldTransform = function () {\r\n var updateCacheReset = this.updateCacheReset;\r\n for (var i = 0, n = updateCacheReset.length; i < n; i++) {\r\n var bone = updateCacheReset[i];\r\n bone.ax = bone.x;\r\n bone.ay = bone.y;\r\n bone.arotation = bone.rotation;\r\n bone.ascaleX = bone.scaleX;\r\n bone.ascaleY = bone.scaleY;\r\n bone.ashearX = bone.shearX;\r\n bone.ashearY = bone.shearY;\r\n bone.appliedValid = true;\r\n }\r\n var updateCache = this._updateCache;\r\n for (var i = 0, n = updateCache.length; i < n; i++)\r\n updateCache[i].update();\r\n };\r\n Skeleton.prototype.setToSetupPose = function () {\r\n this.setBonesToSetupPose();\r\n this.setSlotsToSetupPose();\r\n };\r\n Skeleton.prototype.setBonesToSetupPose = function () {\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n bones[i].setToSetupPose();\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n constraint.mix = constraint.data.mix;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n }\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n var data = constraint.data;\r\n constraint.position = data.position;\r\n constraint.spacing = data.spacing;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n }\r\n };\r\n Skeleton.prototype.setSlotsToSetupPose = function () {\r\n var slots = this.slots;\r\n spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n slots[i].setToSetupPose();\r\n };\r\n Skeleton.prototype.getRootBone = function () {\r\n if (this.bones.length == 0)\r\n return null;\r\n return this.bones[0];\r\n };\r\n Skeleton.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.data.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n Skeleton.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].data.name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n Skeleton.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n Skeleton.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].data.name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n Skeleton.prototype.setSkinByName = function (skinName) {\r\n var skin = this.data.findSkin(skinName);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + skinName);\r\n this.setSkin(skin);\r\n };\r\n Skeleton.prototype.setSkin = function (newSkin) {\r\n if (newSkin != null) {\r\n if (this.skin != null)\r\n newSkin.attachAll(this, this.skin);\r\n else {\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var name_1 = slot.data.attachmentName;\r\n if (name_1 != null) {\r\n var attachment = newSkin.getAttachment(i, name_1);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n }\r\n }\r\n }\r\n }\r\n this.skin = newSkin;\r\n };\r\n Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\r\n return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\r\n };\r\n Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\r\n if (attachmentName == null)\r\n throw new Error(\"attachmentName cannot be null.\");\r\n if (this.skin != null) {\r\n var attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n if (attachment != null)\r\n return attachment;\r\n }\r\n if (this.data.defaultSkin != null)\r\n return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n return null;\r\n };\r\n Skeleton.prototype.setAttachment = function (slotName, attachmentName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName) {\r\n var attachment = null;\r\n if (attachmentName != null) {\r\n attachment = this.getAttachment(i, attachmentName);\r\n if (attachment == null)\r\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n }\r\n slot.setAttachment(attachment);\r\n return;\r\n }\r\n }\r\n throw new Error(\"Slot not found: \" + slotName);\r\n };\r\n Skeleton.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var ikConstraint = ikConstraints[i];\r\n if (ikConstraint.data.name == constraintName)\r\n return ikConstraint;\r\n }\r\n return null;\r\n };\r\n Skeleton.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n Skeleton.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n Skeleton.prototype.getBounds = function (offset, size, temp) {\r\n if (temp === void 0) { temp = new Array(2); }\r\n if (offset == null)\r\n throw new Error(\"offset cannot be null.\");\r\n if (size == null)\r\n throw new Error(\"size cannot be null.\");\r\n var drawOrder = this.drawOrder;\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n var verticesLength = 0;\r\n var vertices = null;\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof spine.RegionAttachment) {\r\n verticesLength = 8;\r\n vertices = spine.Utils.setArraySize(temp, verticesLength, 0);\r\n attachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n }\r\n else if (attachment instanceof spine.MeshAttachment) {\r\n var mesh = attachment;\r\n verticesLength = mesh.worldVerticesLength;\r\n vertices = spine.Utils.setArraySize(temp, verticesLength, 0);\r\n mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\r\n }\r\n if (vertices != null) {\r\n for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\r\n var x = vertices[ii], y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n }\r\n offset.set(minX, minY);\r\n size.set(maxX - minX, maxY - minY);\r\n };\r\n Skeleton.prototype.update = function (delta) {\r\n this.time += delta;\r\n };\r\n return Skeleton;\r\n }());\r\n spine.Skeleton = Skeleton;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SkeletonBounds = (function () {\r\n function SkeletonBounds() {\r\n this.minX = 0;\r\n this.minY = 0;\r\n this.maxX = 0;\r\n this.maxY = 0;\r\n this.boundingBoxes = new Array();\r\n this.polygons = new Array();\r\n this.polygonPool = new spine.Pool(function () {\r\n return spine.Utils.newFloatArray(16);\r\n });\r\n }\r\n SkeletonBounds.prototype.update = function (skeleton, updateAabb) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n var boundingBoxes = this.boundingBoxes;\r\n var polygons = this.polygons;\r\n var polygonPool = this.polygonPool;\r\n var slots = skeleton.slots;\r\n var slotCount = slots.length;\r\n boundingBoxes.length = 0;\r\n polygonPool.freeAll(polygons);\r\n polygons.length = 0;\r\n for (var i = 0; i < slotCount; i++) {\r\n var slot = slots[i];\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof spine.BoundingBoxAttachment) {\r\n var boundingBox = attachment;\r\n boundingBoxes.push(boundingBox);\r\n var polygon = polygonPool.obtain();\r\n if (polygon.length != boundingBox.worldVerticesLength) {\r\n polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength);\r\n }\r\n polygons.push(polygon);\r\n boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);\r\n }\r\n }\r\n if (updateAabb) {\r\n this.aabbCompute();\r\n }\r\n else {\r\n this.minX = Number.POSITIVE_INFINITY;\r\n this.minY = Number.POSITIVE_INFINITY;\r\n this.maxX = Number.NEGATIVE_INFINITY;\r\n this.maxY = Number.NEGATIVE_INFINITY;\r\n }\r\n };\r\n SkeletonBounds.prototype.aabbCompute = function () {\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++) {\r\n var polygon = polygons[i];\r\n var vertices = polygon;\r\n for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) {\r\n var x = vertices[ii];\r\n var y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n this.minX = minX;\r\n this.minY = minY;\r\n this.maxX = maxX;\r\n this.maxY = maxY;\r\n };\r\n SkeletonBounds.prototype.aabbContainsPoint = function (x, y) {\r\n return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\r\n };\r\n SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) {\r\n var minX = this.minX;\r\n var minY = this.minY;\r\n var maxX = this.maxX;\r\n var maxY = this.maxY;\r\n if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\r\n return false;\r\n var m = (y2 - y1) / (x2 - x1);\r\n var y = m * (minX - x1) + y1;\r\n if (y > minY && y < maxY)\r\n return true;\r\n y = m * (maxX - x1) + y1;\r\n if (y > minY && y < maxY)\r\n return true;\r\n var x = (minY - y1) / m + x1;\r\n if (x > minX && x < maxX)\r\n return true;\r\n x = (maxY - y1) / m + x1;\r\n if (x > minX && x < maxX)\r\n return true;\r\n return false;\r\n };\r\n SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) {\r\n return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\r\n };\r\n SkeletonBounds.prototype.containsPoint = function (x, y) {\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++)\r\n if (this.containsPointPolygon(polygons[i], x, y))\r\n return this.boundingBoxes[i];\r\n return null;\r\n };\r\n SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) {\r\n var vertices = polygon;\r\n var nn = polygon.length;\r\n var prevIndex = nn - 2;\r\n var inside = false;\r\n for (var ii = 0; ii < nn; ii += 2) {\r\n var vertexY = vertices[ii + 1];\r\n var prevY = vertices[prevIndex + 1];\r\n if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\r\n var vertexX = vertices[ii];\r\n if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x)\r\n inside = !inside;\r\n }\r\n prevIndex = ii;\r\n }\r\n return inside;\r\n };\r\n SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) {\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++)\r\n if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2))\r\n return this.boundingBoxes[i];\r\n return null;\r\n };\r\n SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) {\r\n var vertices = polygon;\r\n var nn = polygon.length;\r\n var width12 = x1 - x2, height12 = y1 - y2;\r\n var det1 = x1 * y2 - y1 * x2;\r\n var x3 = vertices[nn - 2], y3 = vertices[nn - 1];\r\n for (var ii = 0; ii < nn; ii += 2) {\r\n var x4 = vertices[ii], y4 = vertices[ii + 1];\r\n var det2 = x3 * y4 - y3 * x4;\r\n var width34 = x3 - x4, height34 = y3 - y4;\r\n var det3 = width12 * height34 - height12 * width34;\r\n var x = (det1 * width34 - width12 * det2) / det3;\r\n if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\r\n var y = (det1 * height34 - height12 * det2) / det3;\r\n if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1)))\r\n return true;\r\n }\r\n x3 = x4;\r\n y3 = y4;\r\n }\r\n return false;\r\n };\r\n SkeletonBounds.prototype.getPolygon = function (boundingBox) {\r\n if (boundingBox == null)\r\n throw new Error(\"boundingBox cannot be null.\");\r\n var index = this.boundingBoxes.indexOf(boundingBox);\r\n return index == -1 ? null : this.polygons[index];\r\n };\r\n SkeletonBounds.prototype.getWidth = function () {\r\n return this.maxX - this.minX;\r\n };\r\n SkeletonBounds.prototype.getHeight = function () {\r\n return this.maxY - this.minY;\r\n };\r\n return SkeletonBounds;\r\n }());\r\n spine.SkeletonBounds = SkeletonBounds;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SkeletonClipping = (function () {\r\n function SkeletonClipping() {\r\n this.triangulator = new spine.Triangulator();\r\n this.clippingPolygon = new Array();\r\n this.clipOutput = new Array();\r\n this.clippedVertices = new Array();\r\n this.clippedTriangles = new Array();\r\n this.scratch = new Array();\r\n }\r\n SkeletonClipping.prototype.clipStart = function (slot, clip) {\r\n if (this.clipAttachment != null)\r\n return 0;\r\n this.clipAttachment = clip;\r\n var n = clip.worldVerticesLength;\r\n var vertices = spine.Utils.setArraySize(this.clippingPolygon, n);\r\n clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);\r\n var clippingPolygon = this.clippingPolygon;\r\n SkeletonClipping.makeClockwise(clippingPolygon);\r\n var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));\r\n for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) {\r\n var polygon = clippingPolygons[i];\r\n SkeletonClipping.makeClockwise(polygon);\r\n polygon.push(polygon[0]);\r\n polygon.push(polygon[1]);\r\n }\r\n return clippingPolygons.length;\r\n };\r\n SkeletonClipping.prototype.clipEndWithSlot = function (slot) {\r\n if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data)\r\n this.clipEnd();\r\n };\r\n SkeletonClipping.prototype.clipEnd = function () {\r\n if (this.clipAttachment == null)\r\n return;\r\n this.clipAttachment = null;\r\n this.clippingPolygons = null;\r\n this.clippedVertices.length = 0;\r\n this.clippedTriangles.length = 0;\r\n this.clippingPolygon.length = 0;\r\n };\r\n SkeletonClipping.prototype.isClipping = function () {\r\n return this.clipAttachment != null;\r\n };\r\n SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) {\r\n var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\r\n var clippedTriangles = this.clippedTriangles;\r\n var polygons = this.clippingPolygons;\r\n var polygonsCount = this.clippingPolygons.length;\r\n var vertexSize = twoColor ? 12 : 8;\r\n var index = 0;\r\n clippedVertices.length = 0;\r\n clippedTriangles.length = 0;\r\n outer: for (var i = 0; i < trianglesLength; i += 3) {\r\n var vertexOffset = triangles[i] << 1;\r\n var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\r\n var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\r\n vertexOffset = triangles[i + 1] << 1;\r\n var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\r\n var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\r\n vertexOffset = triangles[i + 2] << 1;\r\n var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\r\n var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\r\n for (var p = 0; p < polygonsCount; p++) {\r\n var s = clippedVertices.length;\r\n if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\r\n var clipOutputLength = clipOutput.length;\r\n if (clipOutputLength == 0)\r\n continue;\r\n var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\r\n var d = 1 / (d0 * d2 + d1 * (y1 - y3));\r\n var clipOutputCount = clipOutputLength >> 1;\r\n var clipOutputItems = this.clipOutput;\r\n var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);\r\n for (var ii = 0; ii < clipOutputLength; ii += 2) {\r\n var x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\r\n clippedVerticesItems[s] = x;\r\n clippedVerticesItems[s + 1] = y;\r\n clippedVerticesItems[s + 2] = light.r;\r\n clippedVerticesItems[s + 3] = light.g;\r\n clippedVerticesItems[s + 4] = light.b;\r\n clippedVerticesItems[s + 5] = light.a;\r\n var c0 = x - x3, c1 = y - y3;\r\n var a = (d0 * c0 + d1 * c1) * d;\r\n var b = (d4 * c0 + d2 * c1) * d;\r\n var c = 1 - a - b;\r\n clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;\r\n clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;\r\n if (twoColor) {\r\n clippedVerticesItems[s + 8] = dark.r;\r\n clippedVerticesItems[s + 9] = dark.g;\r\n clippedVerticesItems[s + 10] = dark.b;\r\n clippedVerticesItems[s + 11] = dark.a;\r\n }\r\n s += vertexSize;\r\n }\r\n s = clippedTriangles.length;\r\n var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\r\n clipOutputCount--;\r\n for (var ii = 1; ii < clipOutputCount; ii++) {\r\n clippedTrianglesItems[s] = index;\r\n clippedTrianglesItems[s + 1] = (index + ii);\r\n clippedTrianglesItems[s + 2] = (index + ii + 1);\r\n s += 3;\r\n }\r\n index += clipOutputCount + 1;\r\n }\r\n else {\r\n var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize);\r\n clippedVerticesItems[s] = x1;\r\n clippedVerticesItems[s + 1] = y1;\r\n clippedVerticesItems[s + 2] = light.r;\r\n clippedVerticesItems[s + 3] = light.g;\r\n clippedVerticesItems[s + 4] = light.b;\r\n clippedVerticesItems[s + 5] = light.a;\r\n if (!twoColor) {\r\n clippedVerticesItems[s + 6] = u1;\r\n clippedVerticesItems[s + 7] = v1;\r\n clippedVerticesItems[s + 8] = x2;\r\n clippedVerticesItems[s + 9] = y2;\r\n clippedVerticesItems[s + 10] = light.r;\r\n clippedVerticesItems[s + 11] = light.g;\r\n clippedVerticesItems[s + 12] = light.b;\r\n clippedVerticesItems[s + 13] = light.a;\r\n clippedVerticesItems[s + 14] = u2;\r\n clippedVerticesItems[s + 15] = v2;\r\n clippedVerticesItems[s + 16] = x3;\r\n clippedVerticesItems[s + 17] = y3;\r\n clippedVerticesItems[s + 18] = light.r;\r\n clippedVerticesItems[s + 19] = light.g;\r\n clippedVerticesItems[s + 20] = light.b;\r\n clippedVerticesItems[s + 21] = light.a;\r\n clippedVerticesItems[s + 22] = u3;\r\n clippedVerticesItems[s + 23] = v3;\r\n }\r\n else {\r\n clippedVerticesItems[s + 6] = u1;\r\n clippedVerticesItems[s + 7] = v1;\r\n clippedVerticesItems[s + 8] = dark.r;\r\n clippedVerticesItems[s + 9] = dark.g;\r\n clippedVerticesItems[s + 10] = dark.b;\r\n clippedVerticesItems[s + 11] = dark.a;\r\n clippedVerticesItems[s + 12] = x2;\r\n clippedVerticesItems[s + 13] = y2;\r\n clippedVerticesItems[s + 14] = light.r;\r\n clippedVerticesItems[s + 15] = light.g;\r\n clippedVerticesItems[s + 16] = light.b;\r\n clippedVerticesItems[s + 17] = light.a;\r\n clippedVerticesItems[s + 18] = u2;\r\n clippedVerticesItems[s + 19] = v2;\r\n clippedVerticesItems[s + 20] = dark.r;\r\n clippedVerticesItems[s + 21] = dark.g;\r\n clippedVerticesItems[s + 22] = dark.b;\r\n clippedVerticesItems[s + 23] = dark.a;\r\n clippedVerticesItems[s + 24] = x3;\r\n clippedVerticesItems[s + 25] = y3;\r\n clippedVerticesItems[s + 26] = light.r;\r\n clippedVerticesItems[s + 27] = light.g;\r\n clippedVerticesItems[s + 28] = light.b;\r\n clippedVerticesItems[s + 29] = light.a;\r\n clippedVerticesItems[s + 30] = u3;\r\n clippedVerticesItems[s + 31] = v3;\r\n clippedVerticesItems[s + 32] = dark.r;\r\n clippedVerticesItems[s + 33] = dark.g;\r\n clippedVerticesItems[s + 34] = dark.b;\r\n clippedVerticesItems[s + 35] = dark.a;\r\n }\r\n s = clippedTriangles.length;\r\n var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3);\r\n clippedTrianglesItems[s] = index;\r\n clippedTrianglesItems[s + 1] = (index + 1);\r\n clippedTrianglesItems[s + 2] = (index + 2);\r\n index += 3;\r\n continue outer;\r\n }\r\n }\r\n }\r\n };\r\n SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) {\r\n var originalOutput = output;\r\n var clipped = false;\r\n var input = null;\r\n if (clippingArea.length % 4 >= 2) {\r\n input = output;\r\n output = this.scratch;\r\n }\r\n else\r\n input = this.scratch;\r\n input.length = 0;\r\n input.push(x1);\r\n input.push(y1);\r\n input.push(x2);\r\n input.push(y2);\r\n input.push(x3);\r\n input.push(y3);\r\n input.push(x1);\r\n input.push(y1);\r\n output.length = 0;\r\n var clippingVertices = clippingArea;\r\n var clippingVerticesLast = clippingArea.length - 4;\r\n for (var i = 0;; i += 2) {\r\n var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];\r\n var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3];\r\n var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2;\r\n var inputVertices = input;\r\n var inputVerticesLength = input.length - 2, outputStart = output.length;\r\n for (var ii = 0; ii < inputVerticesLength; ii += 2) {\r\n var inputX = inputVertices[ii], inputY = inputVertices[ii + 1];\r\n var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3];\r\n var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0;\r\n if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) {\r\n if (side2) {\r\n output.push(inputX2);\r\n output.push(inputY2);\r\n continue;\r\n }\r\n var c0 = inputY2 - inputY, c2 = inputX2 - inputX;\r\n var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\r\n if (Math.abs(s) > 0.000001) {\r\n var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\r\n output.push(edgeX + (edgeX2 - edgeX) * ua);\r\n output.push(edgeY + (edgeY2 - edgeY) * ua);\r\n }\r\n else {\r\n output.push(edgeX);\r\n output.push(edgeY);\r\n }\r\n }\r\n else if (side2) {\r\n var c0 = inputY2 - inputY, c2 = inputX2 - inputX;\r\n var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\r\n if (Math.abs(s) > 0.000001) {\r\n var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\r\n output.push(edgeX + (edgeX2 - edgeX) * ua);\r\n output.push(edgeY + (edgeY2 - edgeY) * ua);\r\n }\r\n else {\r\n output.push(edgeX);\r\n output.push(edgeY);\r\n }\r\n output.push(inputX2);\r\n output.push(inputY2);\r\n }\r\n clipped = true;\r\n }\r\n if (outputStart == output.length) {\r\n originalOutput.length = 0;\r\n return true;\r\n }\r\n output.push(output[0]);\r\n output.push(output[1]);\r\n if (i == clippingVerticesLast)\r\n break;\r\n var temp = output;\r\n output = input;\r\n output.length = 0;\r\n input = temp;\r\n }\r\n if (originalOutput != output) {\r\n originalOutput.length = 0;\r\n for (var i = 0, n = output.length - 2; i < n; i++)\r\n originalOutput[i] = output[i];\r\n }\r\n else\r\n originalOutput.length = originalOutput.length - 2;\r\n return clipped;\r\n };\r\n SkeletonClipping.makeClockwise = function (polygon) {\r\n var vertices = polygon;\r\n var verticeslength = polygon.length;\r\n var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;\r\n for (var i = 0, n = verticeslength - 3; i < n; i += 2) {\r\n p1x = vertices[i];\r\n p1y = vertices[i + 1];\r\n p2x = vertices[i + 2];\r\n p2y = vertices[i + 3];\r\n area += p1x * p2y - p2x * p1y;\r\n }\r\n if (area < 0)\r\n return;\r\n for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {\r\n var x = vertices[i], y = vertices[i + 1];\r\n var other = lastX - i;\r\n vertices[i] = vertices[other];\r\n vertices[i + 1] = vertices[other + 1];\r\n vertices[other] = x;\r\n vertices[other + 1] = y;\r\n }\r\n };\r\n return SkeletonClipping;\r\n }());\r\n spine.SkeletonClipping = SkeletonClipping;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SkeletonData = (function () {\r\n function SkeletonData() {\r\n this.bones = new Array();\r\n this.slots = new Array();\r\n this.skins = new Array();\r\n this.events = new Array();\r\n this.animations = new Array();\r\n this.ikConstraints = new Array();\r\n this.transformConstraints = new Array();\r\n this.pathConstraints = new Array();\r\n this.fps = 0;\r\n }\r\n SkeletonData.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSkin = function (skinName) {\r\n if (skinName == null)\r\n throw new Error(\"skinName cannot be null.\");\r\n var skins = this.skins;\r\n for (var i = 0, n = skins.length; i < n; i++) {\r\n var skin = skins[i];\r\n if (skin.name == skinName)\r\n return skin;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findEvent = function (eventDataName) {\r\n if (eventDataName == null)\r\n throw new Error(\"eventDataName cannot be null.\");\r\n var events = this.events;\r\n for (var i = 0, n = events.length; i < n; i++) {\r\n var event_4 = events[i];\r\n if (event_4.name == eventDataName)\r\n return event_4;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findAnimation = function (animationName) {\r\n if (animationName == null)\r\n throw new Error(\"animationName cannot be null.\");\r\n var animations = this.animations;\r\n for (var i = 0, n = animations.length; i < n; i++) {\r\n var animation = animations[i];\r\n if (animation.name == animationName)\r\n return animation;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\r\n if (pathConstraintName == null)\r\n throw new Error(\"pathConstraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++)\r\n if (pathConstraints[i].name == pathConstraintName)\r\n return i;\r\n return -1;\r\n };\r\n return SkeletonData;\r\n }());\r\n spine.SkeletonData = SkeletonData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SkeletonJson = (function () {\r\n function SkeletonJson(attachmentLoader) {\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonJson.prototype.readSkeletonData = function (json) {\r\n var scale = this.scale;\r\n var skeletonData = new spine.SkeletonData();\r\n var root = typeof (json) === \"string\" ? JSON.parse(json) : json;\r\n var skeletonMap = root.skeleton;\r\n if (skeletonMap != null) {\r\n skeletonData.hash = skeletonMap.hash;\r\n skeletonData.version = skeletonMap.spine;\r\n skeletonData.width = skeletonMap.width;\r\n skeletonData.height = skeletonMap.height;\r\n skeletonData.fps = skeletonMap.fps;\r\n skeletonData.imagesPath = skeletonMap.images;\r\n }\r\n if (root.bones) {\r\n for (var i = 0; i < root.bones.length; i++) {\r\n var boneMap = root.bones[i];\r\n var parent_2 = null;\r\n var parentName = this.getValue(boneMap, \"parent\", null);\r\n if (parentName != null) {\r\n parent_2 = skeletonData.findBone(parentName);\r\n if (parent_2 == null)\r\n throw new Error(\"Parent bone not found: \" + parentName);\r\n }\r\n var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2);\r\n data.length = this.getValue(boneMap, \"length\", 0) * scale;\r\n data.x = this.getValue(boneMap, \"x\", 0) * scale;\r\n data.y = this.getValue(boneMap, \"y\", 0) * scale;\r\n data.rotation = this.getValue(boneMap, \"rotation\", 0);\r\n data.scaleX = this.getValue(boneMap, \"scaleX\", 1);\r\n data.scaleY = this.getValue(boneMap, \"scaleY\", 1);\r\n data.shearX = this.getValue(boneMap, \"shearX\", 0);\r\n data.shearY = this.getValue(boneMap, \"shearY\", 0);\r\n data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\r\n skeletonData.bones.push(data);\r\n }\r\n }\r\n if (root.slots) {\r\n for (var i = 0; i < root.slots.length; i++) {\r\n var slotMap = root.slots[i];\r\n var slotName = slotMap.name;\r\n var boneName = slotMap.bone;\r\n var boneData = skeletonData.findBone(boneName);\r\n if (boneData == null)\r\n throw new Error(\"Slot bone not found: \" + boneName);\r\n var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData);\r\n var color = this.getValue(slotMap, \"color\", null);\r\n if (color != null)\r\n data.color.setFromString(color);\r\n var dark = this.getValue(slotMap, \"dark\", null);\r\n if (dark != null) {\r\n data.darkColor = new spine.Color(1, 1, 1, 1);\r\n data.darkColor.setFromString(dark);\r\n }\r\n data.attachmentName = this.getValue(slotMap, \"attachment\", null);\r\n data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\r\n skeletonData.slots.push(data);\r\n }\r\n }\r\n if (root.ik) {\r\n for (var i = 0; i < root.ik.length; i++) {\r\n var constraintMap = root.ik[i];\r\n var data = new spine.IkConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"IK bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"IK target bone not found: \" + targetName);\r\n data.mix = this.getValue(constraintMap, \"mix\", 1);\r\n data.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n data.compress = this.getValue(constraintMap, \"compress\", false);\r\n data.stretch = this.getValue(constraintMap, \"stretch\", false);\r\n data.uniform = this.getValue(constraintMap, \"uniform\", false);\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n }\r\n if (root.transform) {\r\n for (var i = 0; i < root.transform.length; i++) {\r\n var constraintMap = root.transform[i];\r\n var data = new spine.TransformConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Transform constraint target bone not found: \" + targetName);\r\n data.local = this.getValue(constraintMap, \"local\", false);\r\n data.relative = this.getValue(constraintMap, \"relative\", false);\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\r\n data.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\r\n data.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\r\n data.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\r\n data.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n data.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\r\n data.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n }\r\n if (root.path) {\r\n for (var i = 0; i < root.path.length; i++) {\r\n var constraintMap = root.path[i];\r\n var data = new spine.PathConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findSlot(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Path target slot not found: \" + targetName);\r\n data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\r\n data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\r\n data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.position = this.getValue(constraintMap, \"position\", 0);\r\n if (data.positionMode == spine.PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = this.getValue(constraintMap, \"spacing\", 0);\r\n if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n }\r\n if (root.skins) {\r\n for (var skinName in root.skins) {\r\n var skinMap = root.skins[skinName];\r\n var skin = new spine.Skin(skinName);\r\n for (var slotName in skinMap) {\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n var slotMap = skinMap[slotName];\r\n for (var entryName in slotMap) {\r\n var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData);\r\n if (attachment != null)\r\n skin.addAttachment(slotIndex, entryName, attachment);\r\n }\r\n }\r\n skeletonData.skins.push(skin);\r\n if (skin.name == \"default\")\r\n skeletonData.defaultSkin = skin;\r\n }\r\n }\r\n for (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (parent_3 == null)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.setParentMesh(parent_3);\r\n linkedMesh.mesh.updateUVs();\r\n }\r\n this.linkedMeshes.length = 0;\r\n if (root.events) {\r\n for (var eventName in root.events) {\r\n var eventMap = root.events[eventName];\r\n var data = new spine.EventData(eventName);\r\n data.intValue = this.getValue(eventMap, \"int\", 0);\r\n data.floatValue = this.getValue(eventMap, \"float\", 0);\r\n data.stringValue = this.getValue(eventMap, \"string\", \"\");\r\n data.audioPath = this.getValue(eventMap, \"audio\", null);\r\n if (data.audioPath != null) {\r\n data.volume = this.getValue(eventMap, \"volume\", 1);\r\n data.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n }\r\n if (root.animations) {\r\n for (var animationName in root.animations) {\r\n var animationMap = root.animations[animationName];\r\n this.readAnimation(animationMap, animationName, skeletonData);\r\n }\r\n }\r\n return skeletonData;\r\n };\r\n SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\r\n var scale = this.scale;\r\n name = this.getValue(map, \"name\", name);\r\n var type = this.getValue(map, \"type\", \"region\");\r\n switch (type) {\r\n case \"region\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n if (region == null)\r\n return null;\r\n region.path = path;\r\n region.x = this.getValue(map, \"x\", 0) * scale;\r\n region.y = this.getValue(map, \"y\", 0) * scale;\r\n region.scaleX = this.getValue(map, \"scaleX\", 1);\r\n region.scaleY = this.getValue(map, \"scaleY\", 1);\r\n region.rotation = this.getValue(map, \"rotation\", 0);\r\n region.width = map.width * scale;\r\n region.height = map.height * scale;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n region.color.setFromString(color);\r\n region.updateOffset();\r\n return region;\r\n }\r\n case \"boundingbox\": {\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (box == null)\r\n return null;\r\n this.readVertices(map, box, map.vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n box.color.setFromString(color);\r\n return box;\r\n }\r\n case \"mesh\":\r\n case \"linkedmesh\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n mesh.color.setFromString(color);\r\n var parent_4 = this.getValue(map, \"parent\", null);\r\n if (parent_4 != null) {\r\n mesh.inheritDeform = this.getValue(map, \"deform\", true);\r\n this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent_4));\r\n return mesh;\r\n }\r\n var uvs = map.uvs;\r\n this.readVertices(map, mesh, uvs.length);\r\n mesh.triangles = map.triangles;\r\n mesh.regionUVs = uvs;\r\n mesh.updateUVs();\r\n mesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\r\n return mesh;\r\n }\r\n case \"path\": {\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (path == null)\r\n return null;\r\n path.closed = this.getValue(map, \"closed\", false);\r\n path.constantSpeed = this.getValue(map, \"constantSpeed\", true);\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, path, vertexCount << 1);\r\n var lengths = spine.Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0; i < map.lengths.length; i++)\r\n lengths[i] = map.lengths[i] * scale;\r\n path.lengths = lengths;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n path.color.setFromString(color);\r\n return path;\r\n }\r\n case \"point\": {\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (point == null)\r\n return null;\r\n point.x = this.getValue(map, \"x\", 0) * scale;\r\n point.y = this.getValue(map, \"y\", 0) * scale;\r\n point.rotation = this.getValue(map, \"rotation\", 0);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n point.color.setFromString(color);\r\n return point;\r\n }\r\n case \"clipping\": {\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (clip == null)\r\n return null;\r\n var end = this.getValue(map, \"end\", null);\r\n if (end != null) {\r\n var slot = skeletonData.findSlot(end);\r\n if (slot == null)\r\n throw new Error(\"Clipping end slot not found: \" + end);\r\n clip.endSlot = slot;\r\n }\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, clip, vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n clip.color.setFromString(color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\r\n var scale = this.scale;\r\n attachment.worldVerticesLength = verticesLength;\r\n var vertices = map.vertices;\r\n if (verticesLength == vertices.length) {\r\n var scaledVertices = spine.Utils.toFloatArray(vertices);\r\n if (scale != 1) {\r\n for (var i = 0, n = vertices.length; i < n; i++)\r\n scaledVertices[i] *= scale;\r\n }\r\n attachment.vertices = scaledVertices;\r\n return;\r\n }\r\n var weights = new Array();\r\n var bones = new Array();\r\n for (var i = 0, n = vertices.length; i < n;) {\r\n var boneCount = vertices[i++];\r\n bones.push(boneCount);\r\n for (var nn = i + boneCount * 4; i < nn; i += 4) {\r\n bones.push(vertices[i]);\r\n weights.push(vertices[i + 1] * scale);\r\n weights.push(vertices[i + 2] * scale);\r\n weights.push(vertices[i + 3]);\r\n }\r\n }\r\n attachment.bones = bones;\r\n attachment.vertices = spine.Utils.toFloatArray(weights);\r\n };\r\n SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\r\n var scale = this.scale;\r\n var timelines = new Array();\r\n var duration = 0;\r\n if (map.slots) {\r\n for (var slotName in map.slots) {\r\n var slotMap = map.slots[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n if (timelineName == \"attachment\") {\r\n var timeline = new spine.AttachmentTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex++, valueMap.time, valueMap.name);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n else if (timelineName == \"color\") {\r\n var timeline = new spine.ColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var color = new spine.Color();\r\n color.setFromString(valueMap.color);\r\n timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]);\r\n }\r\n else if (timelineName == \"twoColor\") {\r\n var timeline = new spine.TwoColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var light = new spine.Color();\r\n var dark = new spine.Color();\r\n light.setFromString(valueMap.light);\r\n dark.setFromString(valueMap.dark);\r\n timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\r\n }\r\n }\r\n }\r\n if (map.bones) {\r\n for (var boneName in map.bones) {\r\n var boneMap = map.bones[boneName];\r\n var boneIndex = skeletonData.findBoneIndex(boneName);\r\n if (boneIndex == -1)\r\n throw new Error(\"Bone not found: \" + boneName);\r\n for (var timelineName in boneMap) {\r\n var timelineMap = boneMap[timelineName];\r\n if (timelineName === \"rotate\") {\r\n var timeline = new spine.RotateTimeline(timelineMap.length);\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, valueMap.angle);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\r\n var timeline = null;\r\n var timelineScale = 1;\r\n if (timelineName === \"scale\")\r\n timeline = new spine.ScaleTimeline(timelineMap.length);\r\n else if (timelineName === \"shear\")\r\n timeline = new spine.ShearTimeline(timelineMap.length);\r\n else {\r\n timeline = new spine.TranslateTimeline(timelineMap.length);\r\n timelineScale = scale;\r\n }\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var x = this.getValue(valueMap, \"x\", 0), y = this.getValue(valueMap, \"y\", 0);\r\n timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\r\n }\r\n }\r\n }\r\n if (map.ik) {\r\n for (var constraintName in map.ik) {\r\n var constraintMap = map.ik[constraintName];\r\n var constraint = skeletonData.findIkConstraint(constraintName);\r\n var timeline = new spine.IkConstraintTimeline(constraintMap.length);\r\n timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"mix\", 1), this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1, this.getValue(valueMap, \"compress\", false), this.getValue(valueMap, \"stretch\", false));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n if (map.transform) {\r\n for (var constraintName in map.transform) {\r\n var constraintMap = map.transform[constraintName];\r\n var constraint = skeletonData.findTransformConstraint(constraintName);\r\n var timeline = new spine.TransformConstraintTimeline(constraintMap.length);\r\n timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n if (map.paths) {\r\n for (var constraintName in map.paths) {\r\n var constraintMap = map.paths[constraintName];\r\n var index = skeletonData.findPathConstraintIndex(constraintName);\r\n if (index == -1)\r\n throw new Error(\"Path constraint not found: \" + constraintName);\r\n var data = skeletonData.pathConstraints[index];\r\n for (var timelineName in constraintMap) {\r\n var timelineMap = constraintMap[timelineName];\r\n if (timelineName === \"position\" || timelineName === \"spacing\") {\r\n var timeline = null;\r\n var timelineScale = 1;\r\n if (timelineName === \"spacing\") {\r\n timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length);\r\n if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n else {\r\n timeline = new spine.PathConstraintPositionTimeline(timelineMap.length);\r\n if (data.positionMode == spine.PositionMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"mix\") {\r\n var timeline = new spine.PathConstraintMixTimeline(timelineMap.length);\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]);\r\n }\r\n }\r\n }\r\n }\r\n if (map.deform) {\r\n for (var deformName in map.deform) {\r\n var deformMap = map.deform[deformName];\r\n var skin = skeletonData.findSkin(deformName);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + deformName);\r\n for (var slotName in deformMap) {\r\n var slotMap = deformMap[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotMap.name);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n var attachment = skin.getAttachment(slotIndex, timelineName);\r\n if (attachment == null)\r\n throw new Error(\"Deform attachment not found: \" + timelineMap.name);\r\n var weighted = attachment.bones != null;\r\n var vertices = attachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var timeline = new spine.DeformTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n timeline.attachment = attachment;\r\n var frameIndex = 0;\r\n for (var j = 0; j < timelineMap.length; j++) {\r\n var valueMap = timelineMap[j];\r\n var deform = void 0;\r\n var verticesValue = this.getValue(valueMap, \"vertices\", null);\r\n if (verticesValue == null)\r\n deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = spine.Utils.newFloatArray(deformLength);\r\n var start = this.getValue(valueMap, \"offset\", 0);\r\n spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n if (scale != 1) {\r\n for (var i = start, n = i + verticesValue.length; i < n; i++)\r\n deform[i] *= scale;\r\n }\r\n if (!weighted) {\r\n for (var i = 0; i < deformLength; i++)\r\n deform[i] += vertices[i];\r\n }\r\n }\r\n timeline.setFrame(frameIndex, valueMap.time, deform);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n }\r\n }\r\n }\r\n var drawOrderNode = map.drawOrder;\r\n if (drawOrderNode == null)\r\n drawOrderNode = map.draworder;\r\n if (drawOrderNode != null) {\r\n var timeline = new spine.DrawOrderTimeline(drawOrderNode.length);\r\n var slotCount = skeletonData.slots.length;\r\n var frameIndex = 0;\r\n for (var j = 0; j < drawOrderNode.length; j++) {\r\n var drawOrderMap = drawOrderNode[j];\r\n var drawOrder = null;\r\n var offsets = this.getValue(drawOrderMap, \"offsets\", null);\r\n if (offsets != null) {\r\n drawOrder = spine.Utils.newArray(slotCount, -1);\r\n var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var i = 0; i < offsets.length; i++) {\r\n var offsetMap = offsets[i];\r\n var slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + offsetMap.slot);\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n }\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n for (var i = slotCount - 1; i >= 0; i--)\r\n if (drawOrder[i] == -1)\r\n drawOrder[i] = unchanged[--unchangedIndex];\r\n }\r\n timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n if (map.events) {\r\n var timeline = new spine.EventTimeline(map.events.length);\r\n var frameIndex = 0;\r\n for (var i = 0; i < map.events.length; i++) {\r\n var eventMap = map.events[i];\r\n var eventData = skeletonData.findEvent(eventMap.name);\r\n if (eventData == null)\r\n throw new Error(\"Event not found: \" + eventMap.name);\r\n var event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData);\r\n event_5.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\r\n event_5.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\r\n event_5.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\r\n if (event_5.data.audioPath != null) {\r\n event_5.volume = this.getValue(eventMap, \"volume\", 1);\r\n event_5.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n timeline.setFrame(frameIndex++, event_5);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n if (isNaN(duration)) {\r\n throw new Error(\"Error while parsing animation, duration is NaN\");\r\n }\r\n skeletonData.animations.push(new spine.Animation(name, timelines, duration));\r\n };\r\n SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {\r\n if (!map.curve)\r\n return;\r\n if (map.curve === \"stepped\")\r\n timeline.setStepped(frameIndex);\r\n else if (Object.prototype.toString.call(map.curve) === '[object Array]') {\r\n var curve = map.curve;\r\n timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);\r\n }\r\n };\r\n SkeletonJson.prototype.getValue = function (map, prop, defaultValue) {\r\n return map[prop] !== undefined ? map[prop] : defaultValue;\r\n };\r\n SkeletonJson.blendModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return spine.BlendMode.Normal;\r\n if (str == \"additive\")\r\n return spine.BlendMode.Additive;\r\n if (str == \"multiply\")\r\n return spine.BlendMode.Multiply;\r\n if (str == \"screen\")\r\n return spine.BlendMode.Screen;\r\n throw new Error(\"Unknown blend mode: \" + str);\r\n };\r\n SkeletonJson.positionModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"fixed\")\r\n return spine.PositionMode.Fixed;\r\n if (str == \"percent\")\r\n return spine.PositionMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.spacingModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"length\")\r\n return spine.SpacingMode.Length;\r\n if (str == \"fixed\")\r\n return spine.SpacingMode.Fixed;\r\n if (str == \"percent\")\r\n return spine.SpacingMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.rotateModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"tangent\")\r\n return spine.RotateMode.Tangent;\r\n if (str == \"chain\")\r\n return spine.RotateMode.Chain;\r\n if (str == \"chainscale\")\r\n return spine.RotateMode.ChainScale;\r\n throw new Error(\"Unknown rotate mode: \" + str);\r\n };\r\n SkeletonJson.transformModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return spine.TransformMode.Normal;\r\n if (str == \"onlytranslation\")\r\n return spine.TransformMode.OnlyTranslation;\r\n if (str == \"norotationorreflection\")\r\n return spine.TransformMode.NoRotationOrReflection;\r\n if (str == \"noscale\")\r\n return spine.TransformMode.NoScale;\r\n if (str == \"noscaleorreflection\")\r\n return spine.TransformMode.NoScaleOrReflection;\r\n throw new Error(\"Unknown transform mode: \" + str);\r\n };\r\n return SkeletonJson;\r\n }());\r\n spine.SkeletonJson = SkeletonJson;\r\n var LinkedMesh = (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n }\r\n return LinkedMesh;\r\n }());\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Skin = (function () {\r\n function Skin(name) {\r\n this.attachments = new Array();\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n Skin.prototype.addAttachment = function (slotIndex, name, attachment) {\r\n if (attachment == null)\r\n throw new Error(\"attachment cannot be null.\");\r\n var attachments = this.attachments;\r\n if (slotIndex >= attachments.length)\r\n attachments.length = slotIndex + 1;\r\n if (!attachments[slotIndex])\r\n attachments[slotIndex] = {};\r\n attachments[slotIndex][name] = attachment;\r\n };\r\n Skin.prototype.getAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n return dictionary ? dictionary[name] : null;\r\n };\r\n Skin.prototype.attachAll = function (skeleton, oldSkin) {\r\n var slotIndex = 0;\r\n for (var i = 0; i < skeleton.slots.length; i++) {\r\n var slot = skeleton.slots[i];\r\n var slotAttachment = slot.getAttachment();\r\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\r\n var dictionary = oldSkin.attachments[slotIndex];\r\n for (var key in dictionary) {\r\n var skinAttachment = dictionary[key];\r\n if (slotAttachment == skinAttachment) {\r\n var attachment = this.getAttachment(slotIndex, key);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n break;\r\n }\r\n }\r\n }\r\n slotIndex++;\r\n }\r\n };\r\n return Skin;\r\n }());\r\n spine.Skin = Skin;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Slot = (function () {\r\n function Slot(data, bone) {\r\n this.attachmentVertices = new Array();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (bone == null)\r\n throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new spine.Color();\r\n this.darkColor = data.darkColor == null ? null : new spine.Color();\r\n this.setToSetupPose();\r\n }\r\n Slot.prototype.getAttachment = function () {\r\n return this.attachment;\r\n };\r\n Slot.prototype.setAttachment = function (attachment) {\r\n if (this.attachment == attachment)\r\n return;\r\n this.attachment = attachment;\r\n this.attachmentTime = this.bone.skeleton.time;\r\n this.attachmentVertices.length = 0;\r\n };\r\n Slot.prototype.setAttachmentTime = function (time) {\r\n this.attachmentTime = this.bone.skeleton.time - time;\r\n };\r\n Slot.prototype.getAttachmentTime = function () {\r\n return this.bone.skeleton.time - this.attachmentTime;\r\n };\r\n Slot.prototype.setToSetupPose = function () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.darkColor != null)\r\n this.darkColor.setFromColor(this.data.darkColor);\r\n if (this.data.attachmentName == null)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n };\r\n return Slot;\r\n }());\r\n spine.Slot = Slot;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SlotData = (function () {\r\n function SlotData(index, name, boneData) {\r\n this.color = new spine.Color(1, 1, 1, 1);\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (boneData == null)\r\n throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n return SlotData;\r\n }());\r\n spine.SlotData = SlotData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Texture = (function () {\r\n function Texture(image) {\r\n this._image = image;\r\n }\r\n Texture.prototype.getImage = function () {\r\n return this._image;\r\n };\r\n Texture.filterFromString = function (text) {\r\n switch (text.toLowerCase()) {\r\n case \"nearest\": return TextureFilter.Nearest;\r\n case \"linear\": return TextureFilter.Linear;\r\n case \"mipmap\": return TextureFilter.MipMap;\r\n case \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\r\n case \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\r\n case \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\r\n case \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\r\n default: throw new Error(\"Unknown texture filter \" + text);\r\n }\r\n };\r\n Texture.wrapFromString = function (text) {\r\n switch (text.toLowerCase()) {\r\n case \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\r\n case \"clamptoedge\": return TextureWrap.ClampToEdge;\r\n case \"repeat\": return TextureWrap.Repeat;\r\n default: throw new Error(\"Unknown texture wrap \" + text);\r\n }\r\n };\r\n return Texture;\r\n }());\r\n spine.Texture = Texture;\r\n var TextureFilter;\r\n (function (TextureFilter) {\r\n TextureFilter[TextureFilter[\"Nearest\"] = 9728] = \"Nearest\";\r\n TextureFilter[TextureFilter[\"Linear\"] = 9729] = \"Linear\";\r\n TextureFilter[TextureFilter[\"MipMap\"] = 9987] = \"MipMap\";\r\n TextureFilter[TextureFilter[\"MipMapNearestNearest\"] = 9984] = \"MipMapNearestNearest\";\r\n TextureFilter[TextureFilter[\"MipMapLinearNearest\"] = 9985] = \"MipMapLinearNearest\";\r\n TextureFilter[TextureFilter[\"MipMapNearestLinear\"] = 9986] = \"MipMapNearestLinear\";\r\n TextureFilter[TextureFilter[\"MipMapLinearLinear\"] = 9987] = \"MipMapLinearLinear\";\r\n })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {}));\r\n var TextureWrap;\r\n (function (TextureWrap) {\r\n TextureWrap[TextureWrap[\"MirroredRepeat\"] = 33648] = \"MirroredRepeat\";\r\n TextureWrap[TextureWrap[\"ClampToEdge\"] = 33071] = \"ClampToEdge\";\r\n TextureWrap[TextureWrap[\"Repeat\"] = 10497] = \"Repeat\";\r\n })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {}));\r\n var TextureRegion = (function () {\r\n function TextureRegion() {\r\n this.u = 0;\r\n this.v = 0;\r\n this.u2 = 0;\r\n this.v2 = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n this.rotate = false;\r\n this.offsetX = 0;\r\n this.offsetY = 0;\r\n this.originalWidth = 0;\r\n this.originalHeight = 0;\r\n }\r\n return TextureRegion;\r\n }());\r\n spine.TextureRegion = TextureRegion;\r\n var FakeTexture = (function (_super) {\r\n __extends(FakeTexture, _super);\r\n function FakeTexture() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n FakeTexture.prototype.setFilters = function (minFilter, magFilter) { };\r\n FakeTexture.prototype.setWraps = function (uWrap, vWrap) { };\r\n FakeTexture.prototype.dispose = function () { };\r\n return FakeTexture;\r\n }(Texture));\r\n spine.FakeTexture = FakeTexture;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var TextureAtlas = (function () {\r\n function TextureAtlas(atlasText, textureLoader) {\r\n this.pages = new Array();\r\n this.regions = new Array();\r\n this.load(atlasText, textureLoader);\r\n }\r\n TextureAtlas.prototype.load = function (atlasText, textureLoader) {\r\n if (textureLoader == null)\r\n throw new Error(\"textureLoader cannot be null.\");\r\n var reader = new TextureAtlasReader(atlasText);\r\n var tuple = new Array(4);\r\n var page = null;\r\n while (true) {\r\n var line = reader.readLine();\r\n if (line == null)\r\n break;\r\n line = line.trim();\r\n if (line.length == 0)\r\n page = null;\r\n else if (!page) {\r\n page = new TextureAtlasPage();\r\n page.name = line;\r\n if (reader.readTuple(tuple) == 2) {\r\n page.width = parseInt(tuple[0]);\r\n page.height = parseInt(tuple[1]);\r\n reader.readTuple(tuple);\r\n }\r\n reader.readTuple(tuple);\r\n page.minFilter = spine.Texture.filterFromString(tuple[0]);\r\n page.magFilter = spine.Texture.filterFromString(tuple[1]);\r\n var direction = reader.readValue();\r\n page.uWrap = spine.TextureWrap.ClampToEdge;\r\n page.vWrap = spine.TextureWrap.ClampToEdge;\r\n if (direction == \"x\")\r\n page.uWrap = spine.TextureWrap.Repeat;\r\n else if (direction == \"y\")\r\n page.vWrap = spine.TextureWrap.Repeat;\r\n else if (direction == \"xy\")\r\n page.uWrap = page.vWrap = spine.TextureWrap.Repeat;\r\n page.texture = textureLoader(line);\r\n page.texture.setFilters(page.minFilter, page.magFilter);\r\n page.texture.setWraps(page.uWrap, page.vWrap);\r\n page.width = page.texture.getImage().width;\r\n page.height = page.texture.getImage().height;\r\n this.pages.push(page);\r\n }\r\n else {\r\n var region = new TextureAtlasRegion();\r\n region.name = line;\r\n region.page = page;\r\n region.rotate = reader.readValue() == \"true\";\r\n reader.readTuple(tuple);\r\n var x = parseInt(tuple[0]);\r\n var y = parseInt(tuple[1]);\r\n reader.readTuple(tuple);\r\n var width = parseInt(tuple[0]);\r\n var height = parseInt(tuple[1]);\r\n region.u = x / page.width;\r\n region.v = y / page.height;\r\n if (region.rotate) {\r\n region.u2 = (x + height) / page.width;\r\n region.v2 = (y + width) / page.height;\r\n }\r\n else {\r\n region.u2 = (x + width) / page.width;\r\n region.v2 = (y + height) / page.height;\r\n }\r\n region.x = x;\r\n region.y = y;\r\n region.width = Math.abs(width);\r\n region.height = Math.abs(height);\r\n if (reader.readTuple(tuple) == 4) {\r\n if (reader.readTuple(tuple) == 4) {\r\n reader.readTuple(tuple);\r\n }\r\n }\r\n region.originalWidth = parseInt(tuple[0]);\r\n region.originalHeight = parseInt(tuple[1]);\r\n reader.readTuple(tuple);\r\n region.offsetX = parseInt(tuple[0]);\r\n region.offsetY = parseInt(tuple[1]);\r\n region.index = parseInt(reader.readValue());\r\n region.texture = page.texture;\r\n this.regions.push(region);\r\n }\r\n }\r\n };\r\n TextureAtlas.prototype.findRegion = function (name) {\r\n for (var i = 0; i < this.regions.length; i++) {\r\n if (this.regions[i].name == name) {\r\n return this.regions[i];\r\n }\r\n }\r\n return null;\r\n };\r\n TextureAtlas.prototype.dispose = function () {\r\n for (var i = 0; i < this.pages.length; i++) {\r\n this.pages[i].texture.dispose();\r\n }\r\n };\r\n return TextureAtlas;\r\n }());\r\n spine.TextureAtlas = TextureAtlas;\r\n var TextureAtlasReader = (function () {\r\n function TextureAtlasReader(text) {\r\n this.index = 0;\r\n this.lines = text.split(/\\r\\n|\\r|\\n/);\r\n }\r\n TextureAtlasReader.prototype.readLine = function () {\r\n if (this.index >= this.lines.length)\r\n return null;\r\n return this.lines[this.index++];\r\n };\r\n TextureAtlasReader.prototype.readValue = function () {\r\n var line = this.readLine();\r\n var colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n return line.substring(colon + 1).trim();\r\n };\r\n TextureAtlasReader.prototype.readTuple = function (tuple) {\r\n var line = this.readLine();\r\n var colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n var i = 0, lastMatch = colon + 1;\r\n for (; i < 3; i++) {\r\n var comma = line.indexOf(\",\", lastMatch);\r\n if (comma == -1)\r\n break;\r\n tuple[i] = line.substr(lastMatch, comma - lastMatch).trim();\r\n lastMatch = comma + 1;\r\n }\r\n tuple[i] = line.substring(lastMatch).trim();\r\n return i + 1;\r\n };\r\n return TextureAtlasReader;\r\n }());\r\n var TextureAtlasPage = (function () {\r\n function TextureAtlasPage() {\r\n }\r\n return TextureAtlasPage;\r\n }());\r\n spine.TextureAtlasPage = TextureAtlasPage;\r\n var TextureAtlasRegion = (function (_super) {\r\n __extends(TextureAtlasRegion, _super);\r\n function TextureAtlasRegion() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return TextureAtlasRegion;\r\n }(spine.TextureRegion));\r\n spine.TextureAtlasRegion = TextureAtlasRegion;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var TransformConstraint = (function () {\r\n function TransformConstraint(data, skeleton) {\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.scaleMix = 0;\r\n this.shearMix = 0;\r\n this.temp = new spine.Vector2();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n this.scaleMix = data.scaleMix;\r\n this.shearMix = data.shearMix;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n TransformConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n TransformConstraint.prototype.update = function () {\r\n if (this.data.local) {\r\n if (this.data.relative)\r\n this.applyRelativeLocal();\r\n else\r\n this.applyAbsoluteLocal();\r\n }\r\n else {\r\n if (this.data.relative)\r\n this.applyRelativeWorld();\r\n else\r\n this.applyAbsoluteWorld();\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var ta = target.a, tb = target.b, tc = target.c, td = target.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect;\r\n var offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n if (rotateMix != 0) {\r\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\r\n if (r > spine.MathUtils.PI)\r\n r -= spine.MathUtils.PI2;\r\n else if (r < -spine.MathUtils.PI)\r\n r += spine.MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n bone.a = cos * a - sin * c;\r\n bone.b = cos * b - sin * d;\r\n bone.c = sin * a + cos * c;\r\n bone.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n bone.worldX += (temp.x - bone.worldX) * translateMix;\r\n bone.worldY += (temp.y - bone.worldY) * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c);\r\n var ts = Math.sqrt(ta * ta + tc * tc);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\r\n bone.a *= s;\r\n bone.c *= s;\r\n s = Math.sqrt(bone.b * bone.b + bone.d * bone.d);\r\n ts = Math.sqrt(tb * tb + td * td);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\r\n bone.b *= s;\r\n bone.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var b = bone.b, d = bone.d;\r\n var by = Math.atan2(d, b);\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a));\r\n if (r > spine.MathUtils.PI)\r\n r -= spine.MathUtils.PI2;\r\n else if (r < -spine.MathUtils.PI)\r\n r += spine.MathUtils.PI2;\r\n r = by + (r + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n bone.b = Math.cos(r) * s;\r\n bone.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var ta = target.a, tb = target.b, tc = target.c, td = target.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n if (rotateMix != 0) {\r\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n var r = Math.atan2(tc, ta) + offsetRotation;\r\n if (r > spine.MathUtils.PI)\r\n r -= spine.MathUtils.PI2;\r\n else if (r < -spine.MathUtils.PI)\r\n r += spine.MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n bone.a = cos * a - sin * c;\r\n bone.b = cos * b - sin * d;\r\n bone.c = sin * a + cos * c;\r\n bone.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n bone.worldX += temp.x * translateMix;\r\n bone.worldY += temp.y * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;\r\n bone.a *= s;\r\n bone.c *= s;\r\n s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;\r\n bone.b *= s;\r\n bone.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta);\r\n if (r > spine.MathUtils.PI)\r\n r -= spine.MathUtils.PI2;\r\n else if (r < -spine.MathUtils.PI)\r\n r += spine.MathUtils.PI2;\r\n var b = bone.b, d = bone.d;\r\n r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n bone.b = Math.cos(r) * s;\r\n bone.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0) {\r\n var r = target.arotation - rotation + this.data.offsetRotation;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n rotation += r * rotateMix;\r\n }\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax - x + this.data.offsetX) * translateMix;\r\n y += (target.ay - y + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix != 0) {\r\n if (scaleX > 0.00001)\r\n scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;\r\n if (scaleY > 0.00001)\r\n scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix != 0) {\r\n var r = target.ashearY - shearY + this.data.offsetShearY;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n bone.shearY += r * shearMix;\r\n }\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0)\r\n rotation += (target.arotation + this.data.offsetRotation) * rotateMix;\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax + this.data.offsetX) * translateMix;\r\n y += (target.ay + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix != 0) {\r\n if (scaleX > 0.00001)\r\n scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;\r\n if (scaleY > 0.00001)\r\n scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix != 0)\r\n shearY += (target.ashearY + this.data.offsetShearY) * shearMix;\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n TransformConstraint.prototype.getOrder = function () {\r\n return this.data.order;\r\n };\r\n return TransformConstraint;\r\n }());\r\n spine.TransformConstraint = TransformConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var TransformConstraintData = (function () {\r\n function TransformConstraintData(name) {\r\n this.order = 0;\r\n this.bones = new Array();\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.scaleMix = 0;\r\n this.shearMix = 0;\r\n this.offsetRotation = 0;\r\n this.offsetX = 0;\r\n this.offsetY = 0;\r\n this.offsetScaleX = 0;\r\n this.offsetScaleY = 0;\r\n this.offsetShearY = 0;\r\n this.relative = false;\r\n this.local = false;\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n return TransformConstraintData;\r\n }());\r\n spine.TransformConstraintData = TransformConstraintData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Triangulator = (function () {\r\n function Triangulator() {\r\n this.convexPolygons = new Array();\r\n this.convexPolygonsIndices = new Array();\r\n this.indicesArray = new Array();\r\n this.isConcaveArray = new Array();\r\n this.triangles = new Array();\r\n this.polygonPool = new spine.Pool(function () {\r\n return new Array();\r\n });\r\n this.polygonIndicesPool = new spine.Pool(function () {\r\n return new Array();\r\n });\r\n }\r\n Triangulator.prototype.triangulate = function (verticesArray) {\r\n var vertices = verticesArray;\r\n var vertexCount = verticesArray.length >> 1;\r\n var indices = this.indicesArray;\r\n indices.length = 0;\r\n for (var i = 0; i < vertexCount; i++)\r\n indices[i] = i;\r\n var isConcave = this.isConcaveArray;\r\n isConcave.length = 0;\r\n for (var i = 0, n = vertexCount; i < n; ++i)\r\n isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);\r\n var triangles = this.triangles;\r\n triangles.length = 0;\r\n while (vertexCount > 3) {\r\n var previous = vertexCount - 1, i = 0, next = 1;\r\n while (true) {\r\n outer: if (!isConcave[i]) {\r\n var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;\r\n var p1x = vertices[p1], p1y = vertices[p1 + 1];\r\n var p2x = vertices[p2], p2y = vertices[p2 + 1];\r\n var p3x = vertices[p3], p3y = vertices[p3 + 1];\r\n for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {\r\n if (!isConcave[ii])\r\n continue;\r\n var v = indices[ii] << 1;\r\n var vx = vertices[v], vy = vertices[v + 1];\r\n if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {\r\n if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {\r\n if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy))\r\n break outer;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n if (next == 0) {\r\n do {\r\n if (!isConcave[i])\r\n break;\r\n i--;\r\n } while (i > 0);\r\n break;\r\n }\r\n previous = i;\r\n i = next;\r\n next = (next + 1) % vertexCount;\r\n }\r\n triangles.push(indices[(vertexCount + i - 1) % vertexCount]);\r\n triangles.push(indices[i]);\r\n triangles.push(indices[(i + 1) % vertexCount]);\r\n indices.splice(i, 1);\r\n isConcave.splice(i, 1);\r\n vertexCount--;\r\n var previousIndex = (vertexCount + i - 1) % vertexCount;\r\n var nextIndex = i == vertexCount ? 0 : i;\r\n isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);\r\n isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);\r\n }\r\n if (vertexCount == 3) {\r\n triangles.push(indices[2]);\r\n triangles.push(indices[0]);\r\n triangles.push(indices[1]);\r\n }\r\n return triangles;\r\n };\r\n Triangulator.prototype.decompose = function (verticesArray, triangles) {\r\n var vertices = verticesArray;\r\n var convexPolygons = this.convexPolygons;\r\n this.polygonPool.freeAll(convexPolygons);\r\n convexPolygons.length = 0;\r\n var convexPolygonsIndices = this.convexPolygonsIndices;\r\n this.polygonIndicesPool.freeAll(convexPolygonsIndices);\r\n convexPolygonsIndices.length = 0;\r\n var polygonIndices = this.polygonIndicesPool.obtain();\r\n polygonIndices.length = 0;\r\n var polygon = this.polygonPool.obtain();\r\n polygon.length = 0;\r\n var fanBaseIndex = -1, lastWinding = 0;\r\n for (var i = 0, n = triangles.length; i < n; i += 3) {\r\n var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;\r\n var x1 = vertices[t1], y1 = vertices[t1 + 1];\r\n var x2 = vertices[t2], y2 = vertices[t2 + 1];\r\n var x3 = vertices[t3], y3 = vertices[t3 + 1];\r\n var merged = false;\r\n if (fanBaseIndex == t1) {\r\n var o = polygon.length - 4;\r\n var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);\r\n var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);\r\n if (winding1 == lastWinding && winding2 == lastWinding) {\r\n polygon.push(x3);\r\n polygon.push(y3);\r\n polygonIndices.push(t3);\r\n merged = true;\r\n }\r\n }\r\n if (!merged) {\r\n if (polygon.length > 0) {\r\n convexPolygons.push(polygon);\r\n convexPolygonsIndices.push(polygonIndices);\r\n }\r\n else {\r\n this.polygonPool.free(polygon);\r\n this.polygonIndicesPool.free(polygonIndices);\r\n }\r\n polygon = this.polygonPool.obtain();\r\n polygon.length = 0;\r\n polygon.push(x1);\r\n polygon.push(y1);\r\n polygon.push(x2);\r\n polygon.push(y2);\r\n polygon.push(x3);\r\n polygon.push(y3);\r\n polygonIndices = this.polygonIndicesPool.obtain();\r\n polygonIndices.length = 0;\r\n polygonIndices.push(t1);\r\n polygonIndices.push(t2);\r\n polygonIndices.push(t3);\r\n lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);\r\n fanBaseIndex = t1;\r\n }\r\n }\r\n if (polygon.length > 0) {\r\n convexPolygons.push(polygon);\r\n convexPolygonsIndices.push(polygonIndices);\r\n }\r\n for (var i = 0, n = convexPolygons.length; i < n; i++) {\r\n polygonIndices = convexPolygonsIndices[i];\r\n if (polygonIndices.length == 0)\r\n continue;\r\n var firstIndex = polygonIndices[0];\r\n var lastIndex = polygonIndices[polygonIndices.length - 1];\r\n polygon = convexPolygons[i];\r\n var o = polygon.length - 4;\r\n var prevPrevX = polygon[o], prevPrevY = polygon[o + 1];\r\n var prevX = polygon[o + 2], prevY = polygon[o + 3];\r\n var firstX = polygon[0], firstY = polygon[1];\r\n var secondX = polygon[2], secondY = polygon[3];\r\n var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);\r\n for (var ii = 0; ii < n; ii++) {\r\n if (ii == i)\r\n continue;\r\n var otherIndices = convexPolygonsIndices[ii];\r\n if (otherIndices.length != 3)\r\n continue;\r\n var otherFirstIndex = otherIndices[0];\r\n var otherSecondIndex = otherIndices[1];\r\n var otherLastIndex = otherIndices[2];\r\n var otherPoly = convexPolygons[ii];\r\n var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];\r\n if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex)\r\n continue;\r\n var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);\r\n var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);\r\n if (winding1 == winding && winding2 == winding) {\r\n otherPoly.length = 0;\r\n otherIndices.length = 0;\r\n polygon.push(x3);\r\n polygon.push(y3);\r\n polygonIndices.push(otherLastIndex);\r\n prevPrevX = prevX;\r\n prevPrevY = prevY;\r\n prevX = x3;\r\n prevY = y3;\r\n ii = 0;\r\n }\r\n }\r\n }\r\n for (var i = convexPolygons.length - 1; i >= 0; i--) {\r\n polygon = convexPolygons[i];\r\n if (polygon.length == 0) {\r\n convexPolygons.splice(i, 1);\r\n this.polygonPool.free(polygon);\r\n polygonIndices = convexPolygonsIndices[i];\r\n convexPolygonsIndices.splice(i, 1);\r\n this.polygonIndicesPool.free(polygonIndices);\r\n }\r\n }\r\n return convexPolygons;\r\n };\r\n Triangulator.isConcave = function (index, vertexCount, vertices, indices) {\r\n var previous = indices[(vertexCount + index - 1) % vertexCount] << 1;\r\n var current = indices[index] << 1;\r\n var next = indices[(index + 1) % vertexCount] << 1;\r\n return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]);\r\n };\r\n Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) {\r\n return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;\r\n };\r\n Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) {\r\n var px = p2x - p1x, py = p2y - p1y;\r\n return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;\r\n };\r\n return Triangulator;\r\n }());\r\n spine.Triangulator = Triangulator;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var IntSet = (function () {\r\n function IntSet() {\r\n this.array = new Array();\r\n }\r\n IntSet.prototype.add = function (value) {\r\n var contains = this.contains(value);\r\n this.array[value | 0] = value | 0;\r\n return !contains;\r\n };\r\n IntSet.prototype.contains = function (value) {\r\n return this.array[value | 0] != undefined;\r\n };\r\n IntSet.prototype.remove = function (value) {\r\n this.array[value | 0] = undefined;\r\n };\r\n IntSet.prototype.clear = function () {\r\n this.array.length = 0;\r\n };\r\n return IntSet;\r\n }());\r\n spine.IntSet = IntSet;\r\n var Color = (function () {\r\n function Color(r, g, b, a) {\r\n if (r === void 0) { r = 0; }\r\n if (g === void 0) { g = 0; }\r\n if (b === void 0) { b = 0; }\r\n if (a === void 0) { a = 0; }\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n }\r\n Color.prototype.set = function (r, g, b, a) {\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n this.clamp();\r\n return this;\r\n };\r\n Color.prototype.setFromColor = function (c) {\r\n this.r = c.r;\r\n this.g = c.g;\r\n this.b = c.b;\r\n this.a = c.a;\r\n return this;\r\n };\r\n Color.prototype.setFromString = function (hex) {\r\n hex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\r\n this.r = parseInt(hex.substr(0, 2), 16) / 255.0;\r\n this.g = parseInt(hex.substr(2, 2), 16) / 255.0;\r\n this.b = parseInt(hex.substr(4, 2), 16) / 255.0;\r\n this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;\r\n return this;\r\n };\r\n Color.prototype.add = function (r, g, b, a) {\r\n this.r += r;\r\n this.g += g;\r\n this.b += b;\r\n this.a += a;\r\n this.clamp();\r\n return this;\r\n };\r\n Color.prototype.clamp = function () {\r\n if (this.r < 0)\r\n this.r = 0;\r\n else if (this.r > 1)\r\n this.r = 1;\r\n if (this.g < 0)\r\n this.g = 0;\r\n else if (this.g > 1)\r\n this.g = 1;\r\n if (this.b < 0)\r\n this.b = 0;\r\n else if (this.b > 1)\r\n this.b = 1;\r\n if (this.a < 0)\r\n this.a = 0;\r\n else if (this.a > 1)\r\n this.a = 1;\r\n return this;\r\n };\r\n Color.WHITE = new Color(1, 1, 1, 1);\r\n Color.RED = new Color(1, 0, 0, 1);\r\n Color.GREEN = new Color(0, 1, 0, 1);\r\n Color.BLUE = new Color(0, 0, 1, 1);\r\n Color.MAGENTA = new Color(1, 0, 1, 1);\r\n return Color;\r\n }());\r\n spine.Color = Color;\r\n var MathUtils = (function () {\r\n function MathUtils() {\r\n }\r\n MathUtils.clamp = function (value, min, max) {\r\n if (value < min)\r\n return min;\r\n if (value > max)\r\n return max;\r\n return value;\r\n };\r\n MathUtils.cosDeg = function (degrees) {\r\n return Math.cos(degrees * MathUtils.degRad);\r\n };\r\n MathUtils.sinDeg = function (degrees) {\r\n return Math.sin(degrees * MathUtils.degRad);\r\n };\r\n MathUtils.signum = function (value) {\r\n return value > 0 ? 1 : value < 0 ? -1 : 0;\r\n };\r\n MathUtils.toInt = function (x) {\r\n return x > 0 ? Math.floor(x) : Math.ceil(x);\r\n };\r\n MathUtils.cbrt = function (x) {\r\n var y = Math.pow(Math.abs(x), 1 / 3);\r\n return x < 0 ? -y : y;\r\n };\r\n MathUtils.randomTriangular = function (min, max) {\r\n return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\r\n };\r\n MathUtils.randomTriangularWith = function (min, max, mode) {\r\n var u = Math.random();\r\n var d = max - min;\r\n if (u <= (mode - min) / d)\r\n return min + Math.sqrt(u * d * (mode - min));\r\n return max - Math.sqrt((1 - u) * d * (max - mode));\r\n };\r\n MathUtils.PI = 3.1415927;\r\n MathUtils.PI2 = MathUtils.PI * 2;\r\n MathUtils.radiansToDegrees = 180 / MathUtils.PI;\r\n MathUtils.radDeg = MathUtils.radiansToDegrees;\r\n MathUtils.degreesToRadians = MathUtils.PI / 180;\r\n MathUtils.degRad = MathUtils.degreesToRadians;\r\n return MathUtils;\r\n }());\r\n spine.MathUtils = MathUtils;\r\n var Interpolation = (function () {\r\n function Interpolation() {\r\n }\r\n Interpolation.prototype.apply = function (start, end, a) {\r\n return start + (end - start) * this.applyInternal(a);\r\n };\r\n return Interpolation;\r\n }());\r\n spine.Interpolation = Interpolation;\r\n var Pow = (function (_super) {\r\n __extends(Pow, _super);\r\n function Pow(power) {\r\n var _this = _super.call(this) || this;\r\n _this.power = 2;\r\n _this.power = power;\r\n return _this;\r\n }\r\n Pow.prototype.applyInternal = function (a) {\r\n if (a <= 0.5)\r\n return Math.pow(a * 2, this.power) / 2;\r\n return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;\r\n };\r\n return Pow;\r\n }(Interpolation));\r\n spine.Pow = Pow;\r\n var PowOut = (function (_super) {\r\n __extends(PowOut, _super);\r\n function PowOut(power) {\r\n return _super.call(this, power) || this;\r\n }\r\n PowOut.prototype.applyInternal = function (a) {\r\n return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;\r\n };\r\n return PowOut;\r\n }(Pow));\r\n spine.PowOut = PowOut;\r\n var Utils = (function () {\r\n function Utils() {\r\n }\r\n Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) {\r\n for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\r\n dest[j] = source[i];\r\n }\r\n };\r\n Utils.setArraySize = function (array, size, value) {\r\n if (value === void 0) { value = 0; }\r\n var oldSize = array.length;\r\n if (oldSize == size)\r\n return array;\r\n array.length = size;\r\n if (oldSize < size) {\r\n for (var i = oldSize; i < size; i++)\r\n array[i] = value;\r\n }\r\n return array;\r\n };\r\n Utils.ensureArrayCapacity = function (array, size, value) {\r\n if (value === void 0) { value = 0; }\r\n if (array.length >= size)\r\n return array;\r\n return Utils.setArraySize(array, size, value);\r\n };\r\n Utils.newArray = function (size, defaultValue) {\r\n var array = new Array(size);\r\n for (var i = 0; i < size; i++)\r\n array[i] = defaultValue;\r\n return array;\r\n };\r\n Utils.newFloatArray = function (size) {\r\n if (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n return new Float32Array(size);\r\n }\r\n else {\r\n var array = new Array(size);\r\n for (var i = 0; i < array.length; i++)\r\n array[i] = 0;\r\n return array;\r\n }\r\n };\r\n Utils.newShortArray = function (size) {\r\n if (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n return new Int16Array(size);\r\n }\r\n else {\r\n var array = new Array(size);\r\n for (var i = 0; i < array.length; i++)\r\n array[i] = 0;\r\n return array;\r\n }\r\n };\r\n Utils.toFloatArray = function (array) {\r\n return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\r\n };\r\n Utils.toSinglePrecision = function (value) {\r\n return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;\r\n };\r\n Utils.webkit602BugfixHelper = function (alpha, blend) {\r\n };\r\n Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\r\n return Utils;\r\n }());\r\n spine.Utils = Utils;\r\n var DebugUtils = (function () {\r\n function DebugUtils() {\r\n }\r\n DebugUtils.logBones = function (skeleton) {\r\n for (var i = 0; i < skeleton.bones.length; i++) {\r\n var bone = skeleton.bones[i];\r\n console.log(bone.data.name + \", \" + bone.a + \", \" + bone.b + \", \" + bone.c + \", \" + bone.d + \", \" + bone.worldX + \", \" + bone.worldY);\r\n }\r\n };\r\n return DebugUtils;\r\n }());\r\n spine.DebugUtils = DebugUtils;\r\n var Pool = (function () {\r\n function Pool(instantiator) {\r\n this.items = new Array();\r\n this.instantiator = instantiator;\r\n }\r\n Pool.prototype.obtain = function () {\r\n return this.items.length > 0 ? this.items.pop() : this.instantiator();\r\n };\r\n Pool.prototype.free = function (item) {\r\n if (item.reset)\r\n item.reset();\r\n this.items.push(item);\r\n };\r\n Pool.prototype.freeAll = function (items) {\r\n for (var i = 0; i < items.length; i++) {\r\n if (items[i].reset)\r\n items[i].reset();\r\n this.items[i] = items[i];\r\n }\r\n };\r\n Pool.prototype.clear = function () {\r\n this.items.length = 0;\r\n };\r\n return Pool;\r\n }());\r\n spine.Pool = Pool;\r\n var Vector2 = (function () {\r\n function Vector2(x, y) {\r\n if (x === void 0) { x = 0; }\r\n if (y === void 0) { y = 0; }\r\n this.x = x;\r\n this.y = y;\r\n }\r\n Vector2.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Vector2.prototype.length = function () {\r\n var x = this.x;\r\n var y = this.y;\r\n return Math.sqrt(x * x + y * y);\r\n };\r\n Vector2.prototype.normalize = function () {\r\n var len = this.length();\r\n if (len != 0) {\r\n this.x /= len;\r\n this.y /= len;\r\n }\r\n return this;\r\n };\r\n return Vector2;\r\n }());\r\n spine.Vector2 = Vector2;\r\n var TimeKeeper = (function () {\r\n function TimeKeeper() {\r\n this.maxDelta = 0.064;\r\n this.framesPerSecond = 0;\r\n this.delta = 0;\r\n this.totalTime = 0;\r\n this.lastTime = Date.now() / 1000;\r\n this.frameCount = 0;\r\n this.frameTime = 0;\r\n }\r\n TimeKeeper.prototype.update = function () {\r\n var now = Date.now() / 1000;\r\n this.delta = now - this.lastTime;\r\n this.frameTime += this.delta;\r\n this.totalTime += this.delta;\r\n if (this.delta > this.maxDelta)\r\n this.delta = this.maxDelta;\r\n this.lastTime = now;\r\n this.frameCount++;\r\n if (this.frameTime > 1) {\r\n this.framesPerSecond = this.frameCount / this.frameTime;\r\n this.frameTime = 0;\r\n this.frameCount = 0;\r\n }\r\n };\r\n return TimeKeeper;\r\n }());\r\n spine.TimeKeeper = TimeKeeper;\r\n var WindowedMean = (function () {\r\n function WindowedMean(windowSize) {\r\n if (windowSize === void 0) { windowSize = 32; }\r\n this.addedValues = 0;\r\n this.lastValue = 0;\r\n this.mean = 0;\r\n this.dirty = true;\r\n this.values = new Array(windowSize);\r\n }\r\n WindowedMean.prototype.hasEnoughData = function () {\r\n return this.addedValues >= this.values.length;\r\n };\r\n WindowedMean.prototype.addValue = function (value) {\r\n if (this.addedValues < this.values.length)\r\n this.addedValues++;\r\n this.values[this.lastValue++] = value;\r\n if (this.lastValue > this.values.length - 1)\r\n this.lastValue = 0;\r\n this.dirty = true;\r\n };\r\n WindowedMean.prototype.getMean = function () {\r\n if (this.hasEnoughData()) {\r\n if (this.dirty) {\r\n var mean = 0;\r\n for (var i = 0; i < this.values.length; i++) {\r\n mean += this.values[i];\r\n }\r\n this.mean = mean / this.values.length;\r\n this.dirty = false;\r\n }\r\n return this.mean;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n return WindowedMean;\r\n }());\r\n spine.WindowedMean = WindowedMean;\r\n})(spine || (spine = {}));\r\n(function () {\r\n if (!Math.fround) {\r\n Math.fround = (function (array) {\r\n return function (x) {\r\n return array[0] = x, array[0];\r\n };\r\n })(new Float32Array(1));\r\n }\r\n})();\r\nvar spine;\r\n(function (spine) {\r\n var Attachment = (function () {\r\n function Attachment(name) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n return Attachment;\r\n }());\r\n spine.Attachment = Attachment;\r\n var VertexAttachment = (function (_super) {\r\n __extends(VertexAttachment, _super);\r\n function VertexAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.id = (VertexAttachment.nextID++ & 65535) << 11;\r\n _this.worldVerticesLength = 0;\r\n return _this;\r\n }\r\n VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n count = offset + (count >> 1) * stride;\r\n var skeleton = slot.bone.skeleton;\r\n var deformArray = slot.attachmentVertices;\r\n var vertices = this.vertices;\r\n var bones = this.bones;\r\n if (bones == null) {\r\n if (deformArray.length > 0)\r\n vertices = deformArray;\r\n var bone = slot.bone;\r\n var x = bone.worldX;\r\n var y = bone.worldY;\r\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\r\n var vx = vertices[v_1], vy = vertices[v_1 + 1];\r\n worldVertices[w] = vx * a + vy * b + x;\r\n worldVertices[w + 1] = vx * c + vy * d + y;\r\n }\r\n return;\r\n }\r\n var v = 0, skip = 0;\r\n for (var i = 0; i < start; i += 2) {\r\n var n = bones[v];\r\n v += n + 1;\r\n skip += n;\r\n }\r\n var skeletonBones = skeleton.bones;\r\n if (deformArray.length == 0) {\r\n for (var w = offset, b = skip * 3; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3) {\r\n var bone = skeletonBones[bones[v]];\r\n var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\r\n wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n else {\r\n var deform = deformArray;\r\n for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3, f += 2) {\r\n var bone = skeletonBones[bones[v]];\r\n var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\r\n wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n };\r\n VertexAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n return this == sourceAttachment;\r\n };\r\n VertexAttachment.nextID = 0;\r\n return VertexAttachment;\r\n }(Attachment));\r\n spine.VertexAttachment = VertexAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var AttachmentType;\r\n (function (AttachmentType) {\r\n AttachmentType[AttachmentType[\"Region\"] = 0] = \"Region\";\r\n AttachmentType[AttachmentType[\"BoundingBox\"] = 1] = \"BoundingBox\";\r\n AttachmentType[AttachmentType[\"Mesh\"] = 2] = \"Mesh\";\r\n AttachmentType[AttachmentType[\"LinkedMesh\"] = 3] = \"LinkedMesh\";\r\n AttachmentType[AttachmentType[\"Path\"] = 4] = \"Path\";\r\n AttachmentType[AttachmentType[\"Point\"] = 5] = \"Point\";\r\n })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var BoundingBoxAttachment = (function (_super) {\r\n __extends(BoundingBoxAttachment, _super);\r\n function BoundingBoxAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.color = new spine.Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n return BoundingBoxAttachment;\r\n }(spine.VertexAttachment));\r\n spine.BoundingBoxAttachment = BoundingBoxAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var ClippingAttachment = (function (_super) {\r\n __extends(ClippingAttachment, _super);\r\n function ClippingAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1);\r\n return _this;\r\n }\r\n return ClippingAttachment;\r\n }(spine.VertexAttachment));\r\n spine.ClippingAttachment = ClippingAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var MeshAttachment = (function (_super) {\r\n __extends(MeshAttachment, _super);\r\n function MeshAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.color = new spine.Color(1, 1, 1, 1);\r\n _this.inheritDeform = false;\r\n _this.tempColor = new spine.Color(0, 0, 0, 0);\r\n return _this;\r\n }\r\n MeshAttachment.prototype.updateUVs = function () {\r\n var regionUVs = this.regionUVs;\r\n if (this.uvs == null || this.uvs.length != regionUVs.length)\r\n this.uvs = spine.Utils.newFloatArray(regionUVs.length);\r\n var uvs = this.uvs;\r\n var u = 0, v = 0, width = 0, height = 0;\r\n if (this.region instanceof spine.TextureAtlasRegion) {\r\n var region = this.region;\r\n var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height;\r\n if (region.rotate) {\r\n u = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth;\r\n v = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight;\r\n width = region.originalHeight / textureWidth;\r\n height = region.originalWidth / textureHeight;\r\n for (var i = 0, n = uvs.length; i < n; i += 2) {\r\n uvs[i] = u + regionUVs[i + 1] * width;\r\n uvs[i + 1] = v + height - regionUVs[i] * height;\r\n }\r\n return;\r\n }\r\n u = region.u - region.offsetX / textureWidth;\r\n v = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight;\r\n width = region.originalWidth / textureWidth;\r\n height = region.originalHeight / textureHeight;\r\n }\r\n else if (this.region == null) {\r\n u = v = 0;\r\n width = height = 1;\r\n }\r\n else {\r\n u = this.region.u;\r\n v = this.region.v;\r\n width = this.region.u2 - u;\r\n height = this.region.v2 - v;\r\n }\r\n for (var i = 0, n = uvs.length; i < n; i += 2) {\r\n uvs[i] = u + regionUVs[i] * width;\r\n uvs[i + 1] = v + regionUVs[i + 1] * height;\r\n }\r\n };\r\n MeshAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);\r\n };\r\n MeshAttachment.prototype.getParentMesh = function () {\r\n return this.parentMesh;\r\n };\r\n MeshAttachment.prototype.setParentMesh = function (parentMesh) {\r\n this.parentMesh = parentMesh;\r\n if (parentMesh != null) {\r\n this.bones = parentMesh.bones;\r\n this.vertices = parentMesh.vertices;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n this.regionUVs = parentMesh.regionUVs;\r\n this.triangles = parentMesh.triangles;\r\n this.hullLength = parentMesh.hullLength;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n }\r\n };\r\n return MeshAttachment;\r\n }(spine.VertexAttachment));\r\n spine.MeshAttachment = MeshAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var PathAttachment = (function (_super) {\r\n __extends(PathAttachment, _super);\r\n function PathAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.closed = false;\r\n _this.constantSpeed = false;\r\n _this.color = new spine.Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n return PathAttachment;\r\n }(spine.VertexAttachment));\r\n spine.PathAttachment = PathAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var PointAttachment = (function (_super) {\r\n __extends(PointAttachment, _super);\r\n function PointAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.color = new spine.Color(0.38, 0.94, 0, 1);\r\n return _this;\r\n }\r\n PointAttachment.prototype.computeWorldPosition = function (bone, point) {\r\n point.x = this.x * bone.a + this.y * bone.b + bone.worldX;\r\n point.y = this.x * bone.c + this.y * bone.d + bone.worldY;\r\n return point;\r\n };\r\n PointAttachment.prototype.computeWorldRotation = function (bone) {\r\n var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation);\r\n var x = cos * bone.a + sin * bone.b;\r\n var y = cos * bone.c + sin * bone.d;\r\n return Math.atan2(y, x) * spine.MathUtils.radDeg;\r\n };\r\n return PointAttachment;\r\n }(spine.VertexAttachment));\r\n spine.PointAttachment = PointAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var RegionAttachment = (function (_super) {\r\n __extends(RegionAttachment, _super);\r\n function RegionAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.scaleX = 1;\r\n _this.scaleY = 1;\r\n _this.rotation = 0;\r\n _this.width = 0;\r\n _this.height = 0;\r\n _this.color = new spine.Color(1, 1, 1, 1);\r\n _this.offset = spine.Utils.newFloatArray(8);\r\n _this.uvs = spine.Utils.newFloatArray(8);\r\n _this.tempColor = new spine.Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n RegionAttachment.prototype.updateOffset = function () {\r\n var regionScaleX = this.width / this.region.originalWidth * this.scaleX;\r\n var regionScaleY = this.height / this.region.originalHeight * this.scaleY;\r\n var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\r\n var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\r\n var localX2 = localX + this.region.width * regionScaleX;\r\n var localY2 = localY + this.region.height * regionScaleY;\r\n var radians = this.rotation * Math.PI / 180;\r\n var cos = Math.cos(radians);\r\n var sin = Math.sin(radians);\r\n var localXCos = localX * cos + this.x;\r\n var localXSin = localX * sin;\r\n var localYCos = localY * cos + this.y;\r\n var localYSin = localY * sin;\r\n var localX2Cos = localX2 * cos + this.x;\r\n var localX2Sin = localX2 * sin;\r\n var localY2Cos = localY2 * cos + this.y;\r\n var localY2Sin = localY2 * sin;\r\n var offset = this.offset;\r\n offset[RegionAttachment.OX1] = localXCos - localYSin;\r\n offset[RegionAttachment.OY1] = localYCos + localXSin;\r\n offset[RegionAttachment.OX2] = localXCos - localY2Sin;\r\n offset[RegionAttachment.OY2] = localY2Cos + localXSin;\r\n offset[RegionAttachment.OX3] = localX2Cos - localY2Sin;\r\n offset[RegionAttachment.OY3] = localY2Cos + localX2Sin;\r\n offset[RegionAttachment.OX4] = localX2Cos - localYSin;\r\n offset[RegionAttachment.OY4] = localYCos + localX2Sin;\r\n };\r\n RegionAttachment.prototype.setRegion = function (region) {\r\n this.region = region;\r\n var uvs = this.uvs;\r\n if (region.rotate) {\r\n uvs[2] = region.u;\r\n uvs[3] = region.v2;\r\n uvs[4] = region.u;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v;\r\n uvs[0] = region.u2;\r\n uvs[1] = region.v2;\r\n }\r\n else {\r\n uvs[0] = region.u;\r\n uvs[1] = region.v2;\r\n uvs[2] = region.u;\r\n uvs[3] = region.v;\r\n uvs[4] = region.u2;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v2;\r\n }\r\n };\r\n RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {\r\n var vertexOffset = this.offset;\r\n var x = bone.worldX, y = bone.worldY;\r\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n var offsetX = 0, offsetY = 0;\r\n offsetX = vertexOffset[RegionAttachment.OX1];\r\n offsetY = vertexOffset[RegionAttachment.OY1];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x;\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX2];\r\n offsetY = vertexOffset[RegionAttachment.OY2];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x;\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX3];\r\n offsetY = vertexOffset[RegionAttachment.OY3];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x;\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX4];\r\n offsetY = vertexOffset[RegionAttachment.OY4];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x;\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n };\r\n RegionAttachment.OX1 = 0;\r\n RegionAttachment.OY1 = 1;\r\n RegionAttachment.OX2 = 2;\r\n RegionAttachment.OY2 = 3;\r\n RegionAttachment.OX3 = 4;\r\n RegionAttachment.OY3 = 5;\r\n RegionAttachment.OX4 = 6;\r\n RegionAttachment.OY4 = 7;\r\n RegionAttachment.X1 = 0;\r\n RegionAttachment.Y1 = 1;\r\n RegionAttachment.C1R = 2;\r\n RegionAttachment.C1G = 3;\r\n RegionAttachment.C1B = 4;\r\n RegionAttachment.C1A = 5;\r\n RegionAttachment.U1 = 6;\r\n RegionAttachment.V1 = 7;\r\n RegionAttachment.X2 = 8;\r\n RegionAttachment.Y2 = 9;\r\n RegionAttachment.C2R = 10;\r\n RegionAttachment.C2G = 11;\r\n RegionAttachment.C2B = 12;\r\n RegionAttachment.C2A = 13;\r\n RegionAttachment.U2 = 14;\r\n RegionAttachment.V2 = 15;\r\n RegionAttachment.X3 = 16;\r\n RegionAttachment.Y3 = 17;\r\n RegionAttachment.C3R = 18;\r\n RegionAttachment.C3G = 19;\r\n RegionAttachment.C3B = 20;\r\n RegionAttachment.C3A = 21;\r\n RegionAttachment.U3 = 22;\r\n RegionAttachment.V3 = 23;\r\n RegionAttachment.X4 = 24;\r\n RegionAttachment.Y4 = 25;\r\n RegionAttachment.C4R = 26;\r\n RegionAttachment.C4G = 27;\r\n RegionAttachment.C4B = 28;\r\n RegionAttachment.C4A = 29;\r\n RegionAttachment.U4 = 30;\r\n RegionAttachment.V4 = 31;\r\n return RegionAttachment;\r\n }(spine.Attachment));\r\n spine.RegionAttachment = RegionAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var JitterEffect = (function () {\r\n function JitterEffect(jitterX, jitterY) {\r\n this.jitterX = 0;\r\n this.jitterY = 0;\r\n this.jitterX = jitterX;\r\n this.jitterY = jitterY;\r\n }\r\n JitterEffect.prototype.begin = function (skeleton) {\r\n };\r\n JitterEffect.prototype.transform = function (position, uv, light, dark) {\r\n position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n };\r\n JitterEffect.prototype.end = function () {\r\n };\r\n return JitterEffect;\r\n }());\r\n spine.JitterEffect = JitterEffect;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SwirlEffect = (function () {\r\n function SwirlEffect(radius) {\r\n this.centerX = 0;\r\n this.centerY = 0;\r\n this.radius = 0;\r\n this.angle = 0;\r\n this.worldX = 0;\r\n this.worldY = 0;\r\n this.radius = radius;\r\n }\r\n SwirlEffect.prototype.begin = function (skeleton) {\r\n this.worldX = skeleton.x + this.centerX;\r\n this.worldY = skeleton.y + this.centerY;\r\n };\r\n SwirlEffect.prototype.transform = function (position, uv, light, dark) {\r\n var radAngle = this.angle * spine.MathUtils.degreesToRadians;\r\n var x = position.x - this.worldX;\r\n var y = position.y - this.worldY;\r\n var dist = Math.sqrt(x * x + y * y);\r\n if (dist < this.radius) {\r\n var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);\r\n var cos = Math.cos(theta);\r\n var sin = Math.sin(theta);\r\n position.x = cos * x - sin * y + this.worldX;\r\n position.y = sin * x + cos * y + this.worldY;\r\n }\r\n };\r\n SwirlEffect.prototype.end = function () {\r\n };\r\n SwirlEffect.interpolation = new spine.PowOut(2);\r\n return SwirlEffect;\r\n }());\r\n spine.SwirlEffect = SwirlEffect;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var canvas;\r\n (function (canvas) {\r\n var AssetManager = (function (_super) {\r\n __extends(AssetManager, _super);\r\n function AssetManager(pathPrefix) {\r\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n return _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this;\r\n }\r\n return AssetManager;\r\n }(spine.AssetManager));\r\n canvas.AssetManager = AssetManager;\r\n })(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var canvas;\r\n (function (canvas) {\r\n var CanvasTexture = (function (_super) {\r\n __extends(CanvasTexture, _super);\r\n function CanvasTexture(image) {\r\n return _super.call(this, image) || this;\r\n }\r\n CanvasTexture.prototype.setFilters = function (minFilter, magFilter) { };\r\n CanvasTexture.prototype.setWraps = function (uWrap, vWrap) { };\r\n CanvasTexture.prototype.dispose = function () { };\r\n return CanvasTexture;\r\n }(spine.Texture));\r\n canvas.CanvasTexture = CanvasTexture;\r\n })(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var canvas;\r\n (function (canvas) {\r\n var SkeletonRenderer = (function () {\r\n function SkeletonRenderer(context) {\r\n this.triangleRendering = false;\r\n this.debugRendering = false;\r\n this.vertices = spine.Utils.newFloatArray(8 * 1024);\r\n this.tempColor = new spine.Color();\r\n this.ctx = context;\r\n }\r\n SkeletonRenderer.prototype.draw = function (skeleton) {\r\n if (this.triangleRendering)\r\n this.drawTriangles(skeleton);\r\n else\r\n this.drawImages(skeleton);\r\n };\r\n SkeletonRenderer.prototype.drawImages = function (skeleton) {\r\n var ctx = this.ctx;\r\n var drawOrder = skeleton.drawOrder;\r\n if (this.debugRendering)\r\n ctx.strokeStyle = \"green\";\r\n ctx.save();\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n var attachment = slot.getAttachment();\r\n var regionAttachment = null;\r\n var region = null;\r\n var image = null;\r\n if (attachment instanceof spine.RegionAttachment) {\r\n regionAttachment = attachment;\r\n region = regionAttachment.region;\r\n image = region.texture.getImage();\r\n }\r\n else\r\n continue;\r\n var skeleton_1 = slot.bone.skeleton;\r\n var skeletonColor = skeleton_1.color;\r\n var slotColor = slot.color;\r\n var regionColor = regionAttachment.color;\r\n var alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n var color = this.tempColor;\r\n color.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha);\r\n var att = attachment;\r\n var bone = slot.bone;\r\n var w = region.width;\r\n var h = region.height;\r\n ctx.save();\r\n ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);\r\n ctx.translate(attachment.offset[0], attachment.offset[1]);\r\n ctx.rotate(attachment.rotation * Math.PI / 180);\r\n var atlasScale = att.width / w;\r\n ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);\r\n ctx.translate(w / 2, h / 2);\r\n if (attachment.region.rotate) {\r\n var t = w;\r\n w = h;\r\n h = t;\r\n ctx.rotate(-Math.PI / 2);\r\n }\r\n ctx.scale(1, -1);\r\n ctx.translate(-w / 2, -h / 2);\r\n if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {\r\n ctx.globalAlpha = color.a;\r\n }\r\n ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h);\r\n if (this.debugRendering)\r\n ctx.strokeRect(0, 0, w, h);\r\n ctx.restore();\r\n }\r\n ctx.restore();\r\n };\r\n SkeletonRenderer.prototype.drawTriangles = function (skeleton) {\r\n var blendMode = null;\r\n var vertices = this.vertices;\r\n var triangles = null;\r\n var drawOrder = skeleton.drawOrder;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n var attachment = slot.getAttachment();\r\n var texture = null;\r\n var region = null;\r\n if (attachment instanceof spine.RegionAttachment) {\r\n var regionAttachment = attachment;\r\n vertices = this.computeRegionVertices(slot, regionAttachment, false);\r\n triangles = SkeletonRenderer.QUAD_TRIANGLES;\r\n region = regionAttachment.region;\r\n texture = region.texture.getImage();\r\n }\r\n else if (attachment instanceof spine.MeshAttachment) {\r\n var mesh = attachment;\r\n vertices = this.computeMeshVertices(slot, mesh, false);\r\n triangles = mesh.triangles;\r\n texture = mesh.region.renderObject.texture.getImage();\r\n }\r\n else\r\n continue;\r\n if (texture != null) {\r\n var slotBlendMode = slot.data.blendMode;\r\n if (slotBlendMode != blendMode) {\r\n blendMode = slotBlendMode;\r\n }\r\n var skeleton_2 = slot.bone.skeleton;\r\n var skeletonColor = skeleton_2.color;\r\n var slotColor = slot.color;\r\n var attachmentColor = attachment.color;\r\n var alpha = skeletonColor.a * slotColor.a * attachmentColor.a;\r\n var color = this.tempColor;\r\n color.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha);\r\n var ctx = this.ctx;\r\n if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {\r\n ctx.globalAlpha = color.a;\r\n }\r\n for (var j = 0; j < triangles.length; j += 3) {\r\n var t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8;\r\n var x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7];\r\n var x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7];\r\n var x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7];\r\n this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);\r\n if (this.debugRendering) {\r\n ctx.strokeStyle = \"green\";\r\n ctx.beginPath();\r\n ctx.moveTo(x0, y0);\r\n ctx.lineTo(x1, y1);\r\n ctx.lineTo(x2, y2);\r\n ctx.lineTo(x0, y0);\r\n ctx.stroke();\r\n }\r\n }\r\n }\r\n }\r\n this.ctx.globalAlpha = 1;\r\n };\r\n SkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) {\r\n var ctx = this.ctx;\r\n u0 *= img.width;\r\n v0 *= img.height;\r\n u1 *= img.width;\r\n v1 *= img.height;\r\n u2 *= img.width;\r\n v2 *= img.height;\r\n ctx.beginPath();\r\n ctx.moveTo(x0, y0);\r\n ctx.lineTo(x1, y1);\r\n ctx.lineTo(x2, y2);\r\n ctx.closePath();\r\n x1 -= x0;\r\n y1 -= y0;\r\n x2 -= x0;\r\n y2 -= y0;\r\n u1 -= u0;\r\n v1 -= v0;\r\n u2 -= u0;\r\n v2 -= v0;\r\n var det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0;\r\n ctx.save();\r\n ctx.transform(a, b, c, d, e, f);\r\n ctx.clip();\r\n ctx.drawImage(img, 0, 0);\r\n ctx.restore();\r\n };\r\n SkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) {\r\n var skeleton = slot.bone.skeleton;\r\n var skeletonColor = skeleton.color;\r\n var slotColor = slot.color;\r\n var regionColor = region.color;\r\n var alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n var multiplier = pma ? alpha : 1;\r\n var color = this.tempColor;\r\n color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha);\r\n region.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE);\r\n var vertices = this.vertices;\r\n var uvs = region.uvs;\r\n vertices[spine.RegionAttachment.C1R] = color.r;\r\n vertices[spine.RegionAttachment.C1G] = color.g;\r\n vertices[spine.RegionAttachment.C1B] = color.b;\r\n vertices[spine.RegionAttachment.C1A] = color.a;\r\n vertices[spine.RegionAttachment.U1] = uvs[0];\r\n vertices[spine.RegionAttachment.V1] = uvs[1];\r\n vertices[spine.RegionAttachment.C2R] = color.r;\r\n vertices[spine.RegionAttachment.C2G] = color.g;\r\n vertices[spine.RegionAttachment.C2B] = color.b;\r\n vertices[spine.RegionAttachment.C2A] = color.a;\r\n vertices[spine.RegionAttachment.U2] = uvs[2];\r\n vertices[spine.RegionAttachment.V2] = uvs[3];\r\n vertices[spine.RegionAttachment.C3R] = color.r;\r\n vertices[spine.RegionAttachment.C3G] = color.g;\r\n vertices[spine.RegionAttachment.C3B] = color.b;\r\n vertices[spine.RegionAttachment.C3A] = color.a;\r\n vertices[spine.RegionAttachment.U3] = uvs[4];\r\n vertices[spine.RegionAttachment.V3] = uvs[5];\r\n vertices[spine.RegionAttachment.C4R] = color.r;\r\n vertices[spine.RegionAttachment.C4G] = color.g;\r\n vertices[spine.RegionAttachment.C4B] = color.b;\r\n vertices[spine.RegionAttachment.C4A] = color.a;\r\n vertices[spine.RegionAttachment.U4] = uvs[6];\r\n vertices[spine.RegionAttachment.V4] = uvs[7];\r\n return vertices;\r\n };\r\n SkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) {\r\n var skeleton = slot.bone.skeleton;\r\n var skeletonColor = skeleton.color;\r\n var slotColor = slot.color;\r\n var regionColor = mesh.color;\r\n var alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n var multiplier = pma ? alpha : 1;\r\n var color = this.tempColor;\r\n color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha);\r\n var numVertices = mesh.worldVerticesLength / 2;\r\n if (this.vertices.length < mesh.worldVerticesLength) {\r\n this.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength);\r\n }\r\n var vertices = this.vertices;\r\n mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE);\r\n var uvs = mesh.uvs;\r\n for (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) {\r\n vertices[v++] = color.r;\r\n vertices[v++] = color.g;\r\n vertices[v++] = color.b;\r\n vertices[v++] = color.a;\r\n vertices[v++] = uvs[u++];\r\n vertices[v++] = uvs[u++];\r\n v += 2;\r\n }\r\n return vertices;\r\n };\r\n SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n SkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4;\r\n return SkeletonRenderer;\r\n }());\r\n canvas.SkeletonRenderer = SkeletonRenderer;\r\n })(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var AssetManager = (function (_super) {\r\n __extends(AssetManager, _super);\r\n function AssetManager(context, pathPrefix) {\r\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n return _super.call(this, function (image) {\r\n return new spine.webgl.GLTexture(context, image);\r\n }, pathPrefix) || this;\r\n }\r\n return AssetManager;\r\n }(spine.AssetManager));\r\n webgl.AssetManager = AssetManager;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var OrthoCamera = (function () {\r\n function OrthoCamera(viewportWidth, viewportHeight) {\r\n this.position = new webgl.Vector3(0, 0, 0);\r\n this.direction = new webgl.Vector3(0, 0, -1);\r\n this.up = new webgl.Vector3(0, 1, 0);\r\n this.near = 0;\r\n this.far = 100;\r\n this.zoom = 1;\r\n this.viewportWidth = 0;\r\n this.viewportHeight = 0;\r\n this.projectionView = new webgl.Matrix4();\r\n this.inverseProjectionView = new webgl.Matrix4();\r\n this.projection = new webgl.Matrix4();\r\n this.view = new webgl.Matrix4();\r\n this.tmp = new webgl.Vector3();\r\n this.viewportWidth = viewportWidth;\r\n this.viewportHeight = viewportHeight;\r\n this.update();\r\n }\r\n OrthoCamera.prototype.update = function () {\r\n var projection = this.projection;\r\n var view = this.view;\r\n var projectionView = this.projectionView;\r\n var inverseProjectionView = this.inverseProjectionView;\r\n var zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight;\r\n projection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far);\r\n view.lookAt(this.position, this.direction, this.up);\r\n projectionView.set(projection.values);\r\n projectionView.multiply(view);\r\n inverseProjectionView.set(projectionView.values).invert();\r\n };\r\n OrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) {\r\n var x = screenCoords.x, y = screenHeight - screenCoords.y - 1;\r\n var tmp = this.tmp;\r\n tmp.x = (2 * x) / screenWidth - 1;\r\n tmp.y = (2 * y) / screenHeight - 1;\r\n tmp.z = (2 * screenCoords.z) - 1;\r\n tmp.project(this.inverseProjectionView);\r\n screenCoords.set(tmp.x, tmp.y, tmp.z);\r\n return screenCoords;\r\n };\r\n OrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) {\r\n this.viewportWidth = viewportWidth;\r\n this.viewportHeight = viewportHeight;\r\n };\r\n return OrthoCamera;\r\n }());\r\n webgl.OrthoCamera = OrthoCamera;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var GLTexture = (function (_super) {\r\n __extends(GLTexture, _super);\r\n function GLTexture(context, image, useMipMaps) {\r\n if (useMipMaps === void 0) { useMipMaps = false; }\r\n var _this = _super.call(this, image) || this;\r\n _this.texture = null;\r\n _this.boundUnit = 0;\r\n _this.useMipMaps = false;\r\n _this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n _this.useMipMaps = useMipMaps;\r\n _this.restore();\r\n _this.context.addRestorable(_this);\r\n return _this;\r\n }\r\n GLTexture.prototype.setFilters = function (minFilter, magFilter) {\r\n var gl = this.context.gl;\r\n this.bind();\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);\r\n };\r\n GLTexture.prototype.setWraps = function (uWrap, vWrap) {\r\n var gl = this.context.gl;\r\n this.bind();\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap);\r\n };\r\n GLTexture.prototype.update = function (useMipMaps) {\r\n var gl = this.context.gl;\r\n if (!this.texture) {\r\n this.texture = this.context.gl.createTexture();\r\n }\r\n this.bind();\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n if (useMipMaps)\r\n gl.generateMipmap(gl.TEXTURE_2D);\r\n };\r\n GLTexture.prototype.restore = function () {\r\n this.texture = null;\r\n this.update(this.useMipMaps);\r\n };\r\n GLTexture.prototype.bind = function (unit) {\r\n if (unit === void 0) { unit = 0; }\r\n var gl = this.context.gl;\r\n this.boundUnit = unit;\r\n gl.activeTexture(gl.TEXTURE0 + unit);\r\n gl.bindTexture(gl.TEXTURE_2D, this.texture);\r\n };\r\n GLTexture.prototype.unbind = function () {\r\n var gl = this.context.gl;\r\n gl.activeTexture(gl.TEXTURE0 + this.boundUnit);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n };\r\n GLTexture.prototype.dispose = function () {\r\n this.context.removeRestorable(this);\r\n var gl = this.context.gl;\r\n gl.deleteTexture(this.texture);\r\n };\r\n return GLTexture;\r\n }(spine.Texture));\r\n webgl.GLTexture = GLTexture;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n webgl.M00 = 0;\r\n webgl.M01 = 4;\r\n webgl.M02 = 8;\r\n webgl.M03 = 12;\r\n webgl.M10 = 1;\r\n webgl.M11 = 5;\r\n webgl.M12 = 9;\r\n webgl.M13 = 13;\r\n webgl.M20 = 2;\r\n webgl.M21 = 6;\r\n webgl.M22 = 10;\r\n webgl.M23 = 14;\r\n webgl.M30 = 3;\r\n webgl.M31 = 7;\r\n webgl.M32 = 11;\r\n webgl.M33 = 15;\r\n var Matrix4 = (function () {\r\n function Matrix4() {\r\n this.temp = new Float32Array(16);\r\n this.values = new Float32Array(16);\r\n var v = this.values;\r\n v[webgl.M00] = 1;\r\n v[webgl.M11] = 1;\r\n v[webgl.M22] = 1;\r\n v[webgl.M33] = 1;\r\n }\r\n Matrix4.prototype.set = function (values) {\r\n this.values.set(values);\r\n return this;\r\n };\r\n Matrix4.prototype.transpose = function () {\r\n var t = this.temp;\r\n var v = this.values;\r\n t[webgl.M00] = v[webgl.M00];\r\n t[webgl.M01] = v[webgl.M10];\r\n t[webgl.M02] = v[webgl.M20];\r\n t[webgl.M03] = v[webgl.M30];\r\n t[webgl.M10] = v[webgl.M01];\r\n t[webgl.M11] = v[webgl.M11];\r\n t[webgl.M12] = v[webgl.M21];\r\n t[webgl.M13] = v[webgl.M31];\r\n t[webgl.M20] = v[webgl.M02];\r\n t[webgl.M21] = v[webgl.M12];\r\n t[webgl.M22] = v[webgl.M22];\r\n t[webgl.M23] = v[webgl.M32];\r\n t[webgl.M30] = v[webgl.M03];\r\n t[webgl.M31] = v[webgl.M13];\r\n t[webgl.M32] = v[webgl.M23];\r\n t[webgl.M33] = v[webgl.M33];\r\n return this.set(t);\r\n };\r\n Matrix4.prototype.identity = function () {\r\n var v = this.values;\r\n v[webgl.M00] = 1;\r\n v[webgl.M01] = 0;\r\n v[webgl.M02] = 0;\r\n v[webgl.M03] = 0;\r\n v[webgl.M10] = 0;\r\n v[webgl.M11] = 1;\r\n v[webgl.M12] = 0;\r\n v[webgl.M13] = 0;\r\n v[webgl.M20] = 0;\r\n v[webgl.M21] = 0;\r\n v[webgl.M22] = 1;\r\n v[webgl.M23] = 0;\r\n v[webgl.M30] = 0;\r\n v[webgl.M31] = 0;\r\n v[webgl.M32] = 0;\r\n v[webgl.M33] = 1;\r\n return this;\r\n };\r\n Matrix4.prototype.invert = function () {\r\n var v = this.values;\r\n var t = this.temp;\r\n var l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03]\r\n + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03]\r\n - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13]\r\n - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13]\r\n + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23]\r\n + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23]\r\n - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33]\r\n - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n if (l_det == 0)\r\n throw new Error(\"non-invertible matrix\");\r\n var inv_det = 1.0 / l_det;\r\n t[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32]\r\n - v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n t[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32]\r\n + v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33];\r\n t[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32]\r\n - v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33];\r\n t[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22]\r\n + v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23];\r\n t[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32]\r\n + v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33];\r\n t[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32]\r\n - v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33];\r\n t[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32]\r\n + v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33];\r\n t[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22]\r\n - v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23];\r\n t[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31]\r\n - v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33];\r\n t[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31]\r\n + v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33];\r\n t[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31]\r\n - v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33];\r\n t[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21]\r\n + v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23];\r\n t[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31]\r\n + v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32];\r\n t[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31]\r\n - v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32];\r\n t[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31]\r\n + v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32];\r\n t[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21]\r\n - v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22];\r\n v[webgl.M00] = t[webgl.M00] * inv_det;\r\n v[webgl.M01] = t[webgl.M01] * inv_det;\r\n v[webgl.M02] = t[webgl.M02] * inv_det;\r\n v[webgl.M03] = t[webgl.M03] * inv_det;\r\n v[webgl.M10] = t[webgl.M10] * inv_det;\r\n v[webgl.M11] = t[webgl.M11] * inv_det;\r\n v[webgl.M12] = t[webgl.M12] * inv_det;\r\n v[webgl.M13] = t[webgl.M13] * inv_det;\r\n v[webgl.M20] = t[webgl.M20] * inv_det;\r\n v[webgl.M21] = t[webgl.M21] * inv_det;\r\n v[webgl.M22] = t[webgl.M22] * inv_det;\r\n v[webgl.M23] = t[webgl.M23] * inv_det;\r\n v[webgl.M30] = t[webgl.M30] * inv_det;\r\n v[webgl.M31] = t[webgl.M31] * inv_det;\r\n v[webgl.M32] = t[webgl.M32] * inv_det;\r\n v[webgl.M33] = t[webgl.M33] * inv_det;\r\n return this;\r\n };\r\n Matrix4.prototype.determinant = function () {\r\n var v = this.values;\r\n return v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03]\r\n + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03]\r\n - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13]\r\n - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13]\r\n + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23]\r\n + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23]\r\n - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33]\r\n - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n };\r\n Matrix4.prototype.translate = function (x, y, z) {\r\n var v = this.values;\r\n v[webgl.M03] += x;\r\n v[webgl.M13] += y;\r\n v[webgl.M23] += z;\r\n return this;\r\n };\r\n Matrix4.prototype.copy = function () {\r\n return new Matrix4().set(this.values);\r\n };\r\n Matrix4.prototype.projection = function (near, far, fovy, aspectRatio) {\r\n this.identity();\r\n var l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0));\r\n var l_a1 = (far + near) / (near - far);\r\n var l_a2 = (2 * far * near) / (near - far);\r\n var v = this.values;\r\n v[webgl.M00] = l_fd / aspectRatio;\r\n v[webgl.M10] = 0;\r\n v[webgl.M20] = 0;\r\n v[webgl.M30] = 0;\r\n v[webgl.M01] = 0;\r\n v[webgl.M11] = l_fd;\r\n v[webgl.M21] = 0;\r\n v[webgl.M31] = 0;\r\n v[webgl.M02] = 0;\r\n v[webgl.M12] = 0;\r\n v[webgl.M22] = l_a1;\r\n v[webgl.M32] = -1;\r\n v[webgl.M03] = 0;\r\n v[webgl.M13] = 0;\r\n v[webgl.M23] = l_a2;\r\n v[webgl.M33] = 0;\r\n return this;\r\n };\r\n Matrix4.prototype.ortho2d = function (x, y, width, height) {\r\n return this.ortho(x, x + width, y, y + height, 0, 1);\r\n };\r\n Matrix4.prototype.ortho = function (left, right, bottom, top, near, far) {\r\n this.identity();\r\n var x_orth = 2 / (right - left);\r\n var y_orth = 2 / (top - bottom);\r\n var z_orth = -2 / (far - near);\r\n var tx = -(right + left) / (right - left);\r\n var ty = -(top + bottom) / (top - bottom);\r\n var tz = -(far + near) / (far - near);\r\n var v = this.values;\r\n v[webgl.M00] = x_orth;\r\n v[webgl.M10] = 0;\r\n v[webgl.M20] = 0;\r\n v[webgl.M30] = 0;\r\n v[webgl.M01] = 0;\r\n v[webgl.M11] = y_orth;\r\n v[webgl.M21] = 0;\r\n v[webgl.M31] = 0;\r\n v[webgl.M02] = 0;\r\n v[webgl.M12] = 0;\r\n v[webgl.M22] = z_orth;\r\n v[webgl.M32] = 0;\r\n v[webgl.M03] = tx;\r\n v[webgl.M13] = ty;\r\n v[webgl.M23] = tz;\r\n v[webgl.M33] = 1;\r\n return this;\r\n };\r\n Matrix4.prototype.multiply = function (matrix) {\r\n var t = this.temp;\r\n var v = this.values;\r\n var m = matrix.values;\r\n t[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30];\r\n t[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31];\r\n t[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32];\r\n t[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33];\r\n t[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30];\r\n t[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31];\r\n t[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32];\r\n t[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33];\r\n t[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30];\r\n t[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31];\r\n t[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32];\r\n t[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33];\r\n t[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30];\r\n t[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31];\r\n t[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32];\r\n t[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33];\r\n return this.set(this.temp);\r\n };\r\n Matrix4.prototype.multiplyLeft = function (matrix) {\r\n var t = this.temp;\r\n var v = this.values;\r\n var m = matrix.values;\r\n t[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30];\r\n t[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31];\r\n t[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32];\r\n t[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33];\r\n t[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30];\r\n t[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31];\r\n t[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32];\r\n t[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33];\r\n t[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30];\r\n t[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31];\r\n t[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32];\r\n t[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33];\r\n t[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30];\r\n t[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31];\r\n t[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32];\r\n t[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33];\r\n return this.set(this.temp);\r\n };\r\n Matrix4.prototype.lookAt = function (position, direction, up) {\r\n Matrix4.initTemps();\r\n var xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis;\r\n zAxis.setFrom(direction).normalize();\r\n xAxis.setFrom(direction).normalize();\r\n xAxis.cross(up).normalize();\r\n yAxis.setFrom(xAxis).cross(zAxis).normalize();\r\n this.identity();\r\n var val = this.values;\r\n val[webgl.M00] = xAxis.x;\r\n val[webgl.M01] = xAxis.y;\r\n val[webgl.M02] = xAxis.z;\r\n val[webgl.M10] = yAxis.x;\r\n val[webgl.M11] = yAxis.y;\r\n val[webgl.M12] = yAxis.z;\r\n val[webgl.M20] = -zAxis.x;\r\n val[webgl.M21] = -zAxis.y;\r\n val[webgl.M22] = -zAxis.z;\r\n Matrix4.tmpMatrix.identity();\r\n Matrix4.tmpMatrix.values[webgl.M03] = -position.x;\r\n Matrix4.tmpMatrix.values[webgl.M13] = -position.y;\r\n Matrix4.tmpMatrix.values[webgl.M23] = -position.z;\r\n this.multiply(Matrix4.tmpMatrix);\r\n return this;\r\n };\r\n Matrix4.initTemps = function () {\r\n if (Matrix4.xAxis === null)\r\n Matrix4.xAxis = new webgl.Vector3();\r\n if (Matrix4.yAxis === null)\r\n Matrix4.yAxis = new webgl.Vector3();\r\n if (Matrix4.zAxis === null)\r\n Matrix4.zAxis = new webgl.Vector3();\r\n };\r\n Matrix4.xAxis = null;\r\n Matrix4.yAxis = null;\r\n Matrix4.zAxis = null;\r\n Matrix4.tmpMatrix = new Matrix4();\r\n return Matrix4;\r\n }());\r\n webgl.Matrix4 = Matrix4;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var Mesh = (function () {\r\n function Mesh(context, attributes, maxVertices, maxIndices) {\r\n this.attributes = attributes;\r\n this.verticesLength = 0;\r\n this.dirtyVertices = false;\r\n this.indicesLength = 0;\r\n this.dirtyIndices = false;\r\n this.elementsPerVertex = 0;\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n this.elementsPerVertex = 0;\r\n for (var i = 0; i < attributes.length; i++) {\r\n this.elementsPerVertex += attributes[i].numElements;\r\n }\r\n this.vertices = new Float32Array(maxVertices * this.elementsPerVertex);\r\n this.indices = new Uint16Array(maxIndices);\r\n this.context.addRestorable(this);\r\n }\r\n Mesh.prototype.getAttributes = function () { return this.attributes; };\r\n Mesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; };\r\n Mesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; };\r\n Mesh.prototype.setVerticesLength = function (length) {\r\n this.dirtyVertices = true;\r\n this.verticesLength = length;\r\n };\r\n Mesh.prototype.getVertices = function () { return this.vertices; };\r\n Mesh.prototype.maxIndices = function () { return this.indices.length; };\r\n Mesh.prototype.numIndices = function () { return this.indicesLength; };\r\n Mesh.prototype.setIndicesLength = function (length) {\r\n this.dirtyIndices = true;\r\n this.indicesLength = length;\r\n };\r\n Mesh.prototype.getIndices = function () { return this.indices; };\r\n ;\r\n Mesh.prototype.getVertexSizeInFloats = function () {\r\n var size = 0;\r\n for (var i = 0; i < this.attributes.length; i++) {\r\n var attribute = this.attributes[i];\r\n size += attribute.numElements;\r\n }\r\n return size;\r\n };\r\n Mesh.prototype.setVertices = function (vertices) {\r\n this.dirtyVertices = true;\r\n if (vertices.length > this.vertices.length)\r\n throw Error(\"Mesh can't store more than \" + this.maxVertices() + \" vertices\");\r\n this.vertices.set(vertices, 0);\r\n this.verticesLength = vertices.length;\r\n };\r\n Mesh.prototype.setIndices = function (indices) {\r\n this.dirtyIndices = true;\r\n if (indices.length > this.indices.length)\r\n throw Error(\"Mesh can't store more than \" + this.maxIndices() + \" indices\");\r\n this.indices.set(indices, 0);\r\n this.indicesLength = indices.length;\r\n };\r\n Mesh.prototype.draw = function (shader, primitiveType) {\r\n this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex);\r\n };\r\n Mesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) {\r\n var gl = this.context.gl;\r\n if (this.dirtyVertices || this.dirtyIndices)\r\n this.update();\r\n this.bind(shader);\r\n if (this.indicesLength > 0) {\r\n gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2);\r\n }\r\n else {\r\n gl.drawArrays(primitiveType, offset, count);\r\n }\r\n this.unbind(shader);\r\n };\r\n Mesh.prototype.bind = function (shader) {\r\n var gl = this.context.gl;\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\r\n var offset = 0;\r\n for (var i = 0; i < this.attributes.length; i++) {\r\n var attrib = this.attributes[i];\r\n var location_1 = shader.getAttributeLocation(attrib.name);\r\n gl.enableVertexAttribArray(location_1);\r\n gl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4);\r\n offset += attrib.numElements;\r\n }\r\n if (this.indicesLength > 0)\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\r\n };\r\n Mesh.prototype.unbind = function (shader) {\r\n var gl = this.context.gl;\r\n for (var i = 0; i < this.attributes.length; i++) {\r\n var attrib = this.attributes[i];\r\n var location_2 = shader.getAttributeLocation(attrib.name);\r\n gl.disableVertexAttribArray(location_2);\r\n }\r\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\r\n if (this.indicesLength > 0)\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\r\n };\r\n Mesh.prototype.update = function () {\r\n var gl = this.context.gl;\r\n if (this.dirtyVertices) {\r\n if (!this.verticesBuffer) {\r\n this.verticesBuffer = gl.createBuffer();\r\n }\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW);\r\n this.dirtyVertices = false;\r\n }\r\n if (this.dirtyIndices) {\r\n if (!this.indicesBuffer) {\r\n this.indicesBuffer = gl.createBuffer();\r\n }\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW);\r\n this.dirtyIndices = false;\r\n }\r\n };\r\n Mesh.prototype.restore = function () {\r\n this.verticesBuffer = null;\r\n this.indicesBuffer = null;\r\n this.update();\r\n };\r\n Mesh.prototype.dispose = function () {\r\n this.context.removeRestorable(this);\r\n var gl = this.context.gl;\r\n gl.deleteBuffer(this.verticesBuffer);\r\n gl.deleteBuffer(this.indicesBuffer);\r\n };\r\n return Mesh;\r\n }());\r\n webgl.Mesh = Mesh;\r\n var VertexAttribute = (function () {\r\n function VertexAttribute(name, type, numElements) {\r\n this.name = name;\r\n this.type = type;\r\n this.numElements = numElements;\r\n }\r\n return VertexAttribute;\r\n }());\r\n webgl.VertexAttribute = VertexAttribute;\r\n var Position2Attribute = (function (_super) {\r\n __extends(Position2Attribute, _super);\r\n function Position2Attribute() {\r\n return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this;\r\n }\r\n return Position2Attribute;\r\n }(VertexAttribute));\r\n webgl.Position2Attribute = Position2Attribute;\r\n var Position3Attribute = (function (_super) {\r\n __extends(Position3Attribute, _super);\r\n function Position3Attribute() {\r\n return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this;\r\n }\r\n return Position3Attribute;\r\n }(VertexAttribute));\r\n webgl.Position3Attribute = Position3Attribute;\r\n var TexCoordAttribute = (function (_super) {\r\n __extends(TexCoordAttribute, _super);\r\n function TexCoordAttribute(unit) {\r\n if (unit === void 0) { unit = 0; }\r\n return _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? \"\" : unit), VertexAttributeType.Float, 2) || this;\r\n }\r\n return TexCoordAttribute;\r\n }(VertexAttribute));\r\n webgl.TexCoordAttribute = TexCoordAttribute;\r\n var ColorAttribute = (function (_super) {\r\n __extends(ColorAttribute, _super);\r\n function ColorAttribute() {\r\n return _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this;\r\n }\r\n return ColorAttribute;\r\n }(VertexAttribute));\r\n webgl.ColorAttribute = ColorAttribute;\r\n var Color2Attribute = (function (_super) {\r\n __extends(Color2Attribute, _super);\r\n function Color2Attribute() {\r\n return _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this;\r\n }\r\n return Color2Attribute;\r\n }(VertexAttribute));\r\n webgl.Color2Attribute = Color2Attribute;\r\n var VertexAttributeType;\r\n (function (VertexAttributeType) {\r\n VertexAttributeType[VertexAttributeType[\"Float\"] = 0] = \"Float\";\r\n })(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {}));\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var PolygonBatcher = (function () {\r\n function PolygonBatcher(context, twoColorTint, maxVertices) {\r\n if (twoColorTint === void 0) { twoColorTint = true; }\r\n if (maxVertices === void 0) { maxVertices = 10920; }\r\n this.isDrawing = false;\r\n this.shader = null;\r\n this.lastTexture = null;\r\n this.verticesLength = 0;\r\n this.indicesLength = 0;\r\n if (maxVertices > 10920)\r\n throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n var attributes = twoColorTint ?\r\n [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] :\r\n [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()];\r\n this.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3);\r\n this.srcBlend = this.context.gl.SRC_ALPHA;\r\n this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA;\r\n }\r\n PolygonBatcher.prototype.begin = function (shader) {\r\n var gl = this.context.gl;\r\n if (this.isDrawing)\r\n throw new Error(\"PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()\");\r\n this.drawCalls = 0;\r\n this.shader = shader;\r\n this.lastTexture = null;\r\n this.isDrawing = true;\r\n gl.enable(gl.BLEND);\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n };\r\n PolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) {\r\n var gl = this.context.gl;\r\n this.srcBlend = srcBlend;\r\n this.dstBlend = dstBlend;\r\n if (this.isDrawing) {\r\n this.flush();\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n }\r\n };\r\n PolygonBatcher.prototype.draw = function (texture, vertices, indices) {\r\n if (texture != this.lastTexture) {\r\n this.flush();\r\n this.lastTexture = texture;\r\n }\r\n else if (this.verticesLength + vertices.length > this.mesh.getVertices().length ||\r\n this.indicesLength + indices.length > this.mesh.getIndices().length) {\r\n this.flush();\r\n }\r\n var indexStart = this.mesh.numVertices();\r\n this.mesh.getVertices().set(vertices, this.verticesLength);\r\n this.verticesLength += vertices.length;\r\n this.mesh.setVerticesLength(this.verticesLength);\r\n var indicesArray = this.mesh.getIndices();\r\n for (var i = this.indicesLength, j = 0; j < indices.length; i++, j++)\r\n indicesArray[i] = indices[j] + indexStart;\r\n this.indicesLength += indices.length;\r\n this.mesh.setIndicesLength(this.indicesLength);\r\n };\r\n PolygonBatcher.prototype.flush = function () {\r\n var gl = this.context.gl;\r\n if (this.verticesLength == 0)\r\n return;\r\n this.lastTexture.bind();\r\n this.mesh.draw(this.shader, gl.TRIANGLES);\r\n this.verticesLength = 0;\r\n this.indicesLength = 0;\r\n this.mesh.setVerticesLength(0);\r\n this.mesh.setIndicesLength(0);\r\n this.drawCalls++;\r\n };\r\n PolygonBatcher.prototype.end = function () {\r\n var gl = this.context.gl;\r\n if (!this.isDrawing)\r\n throw new Error(\"PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()\");\r\n if (this.verticesLength > 0 || this.indicesLength > 0)\r\n this.flush();\r\n this.shader = null;\r\n this.lastTexture = null;\r\n this.isDrawing = false;\r\n gl.disable(gl.BLEND);\r\n };\r\n PolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; };\r\n PolygonBatcher.prototype.dispose = function () {\r\n this.mesh.dispose();\r\n };\r\n return PolygonBatcher;\r\n }());\r\n webgl.PolygonBatcher = PolygonBatcher;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var SceneRenderer = (function () {\r\n function SceneRenderer(canvas, context, twoColorTint) {\r\n if (twoColorTint === void 0) { twoColorTint = true; }\r\n this.twoColorTint = false;\r\n this.activeRenderer = null;\r\n this.QUAD = [\r\n 0, 0, 1, 1, 1, 1, 0, 0,\r\n 0, 0, 1, 1, 1, 1, 0, 0,\r\n 0, 0, 1, 1, 1, 1, 0, 0,\r\n 0, 0, 1, 1, 1, 1, 0, 0,\r\n ];\r\n this.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n this.WHITE = new spine.Color(1, 1, 1, 1);\r\n this.canvas = canvas;\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n this.twoColorTint = twoColorTint;\r\n this.camera = new webgl.OrthoCamera(canvas.width, canvas.height);\r\n this.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context);\r\n this.batcher = new webgl.PolygonBatcher(this.context, twoColorTint);\r\n this.shapesShader = webgl.Shader.newColored(this.context);\r\n this.shapes = new webgl.ShapeRenderer(this.context);\r\n this.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint);\r\n this.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context);\r\n }\r\n SceneRenderer.prototype.begin = function () {\r\n this.camera.update();\r\n this.enableRenderer(this.batcher);\r\n };\r\n SceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) {\r\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n if (slotRangeStart === void 0) { slotRangeStart = -1; }\r\n if (slotRangeEnd === void 0) { slotRangeEnd = -1; }\r\n this.enableRenderer(this.batcher);\r\n this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha;\r\n this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd);\r\n };\r\n SceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) {\r\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n if (ignoredBones === void 0) { ignoredBones = null; }\r\n this.enableRenderer(this.shapes);\r\n this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha;\r\n this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones);\r\n };\r\n SceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.batcher);\r\n if (color === null)\r\n color = this.WHITE;\r\n var quad = this.QUAD;\r\n var i = 0;\r\n quad[i++] = x;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 0;\r\n quad[i++] = 1;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 1;\r\n quad[i++] = 1;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 1;\r\n quad[i++] = 0;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n this.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n };\r\n SceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.batcher);\r\n if (color === null)\r\n color = this.WHITE;\r\n var quad = this.QUAD;\r\n var i = 0;\r\n quad[i++] = x;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = u;\r\n quad[i++] = v;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = u2;\r\n quad[i++] = v;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = u2;\r\n quad[i++] = v2;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = u;\r\n quad[i++] = v2;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n this.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n };\r\n SceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) {\r\n if (color === void 0) { color = null; }\r\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n this.enableRenderer(this.batcher);\r\n if (color === null)\r\n color = this.WHITE;\r\n var quad = this.QUAD;\r\n var worldOriginX = x + pivotX;\r\n var worldOriginY = y + pivotY;\r\n var fx = -pivotX;\r\n var fy = -pivotY;\r\n var fx2 = width - pivotX;\r\n var fy2 = height - pivotY;\r\n var p1x = fx;\r\n var p1y = fy;\r\n var p2x = fx;\r\n var p2y = fy2;\r\n var p3x = fx2;\r\n var p3y = fy2;\r\n var p4x = fx2;\r\n var p4y = fy;\r\n var x1 = 0;\r\n var y1 = 0;\r\n var x2 = 0;\r\n var y2 = 0;\r\n var x3 = 0;\r\n var y3 = 0;\r\n var x4 = 0;\r\n var y4 = 0;\r\n if (angle != 0) {\r\n var cos = spine.MathUtils.cosDeg(angle);\r\n var sin = spine.MathUtils.sinDeg(angle);\r\n x1 = cos * p1x - sin * p1y;\r\n y1 = sin * p1x + cos * p1y;\r\n x4 = cos * p2x - sin * p2y;\r\n y4 = sin * p2x + cos * p2y;\r\n x3 = cos * p3x - sin * p3y;\r\n y3 = sin * p3x + cos * p3y;\r\n x2 = x3 + (x1 - x4);\r\n y2 = y3 + (y1 - y4);\r\n }\r\n else {\r\n x1 = p1x;\r\n y1 = p1y;\r\n x4 = p2x;\r\n y4 = p2y;\r\n x3 = p3x;\r\n y3 = p3y;\r\n x2 = p4x;\r\n y2 = p4y;\r\n }\r\n x1 += worldOriginX;\r\n y1 += worldOriginY;\r\n x2 += worldOriginX;\r\n y2 += worldOriginY;\r\n x3 += worldOriginX;\r\n y3 += worldOriginY;\r\n x4 += worldOriginX;\r\n y4 += worldOriginY;\r\n var i = 0;\r\n quad[i++] = x1;\r\n quad[i++] = y1;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 0;\r\n quad[i++] = 1;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x2;\r\n quad[i++] = y2;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 1;\r\n quad[i++] = 1;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x3;\r\n quad[i++] = y3;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 1;\r\n quad[i++] = 0;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x4;\r\n quad[i++] = y4;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n this.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n };\r\n SceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) {\r\n if (color === void 0) { color = null; }\r\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n this.enableRenderer(this.batcher);\r\n if (color === null)\r\n color = this.WHITE;\r\n var quad = this.QUAD;\r\n var i = 0;\r\n quad[i++] = x;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = region.u;\r\n quad[i++] = region.v2;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = region.u2;\r\n quad[i++] = region.v2;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = region.u2;\r\n quad[i++] = region.v;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = region.u;\r\n quad[i++] = region.v;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n this.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES);\r\n };\r\n SceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) {\r\n if (color === void 0) { color = null; }\r\n if (color2 === void 0) { color2 = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.line(x, y, x2, y2, color);\r\n };\r\n SceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) {\r\n if (color === void 0) { color = null; }\r\n if (color2 === void 0) { color2 = null; }\r\n if (color3 === void 0) { color3 = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3);\r\n };\r\n SceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) {\r\n if (color === void 0) { color = null; }\r\n if (color2 === void 0) { color2 = null; }\r\n if (color3 === void 0) { color3 = null; }\r\n if (color4 === void 0) { color4 = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4);\r\n };\r\n SceneRenderer.prototype.rect = function (filled, x, y, width, height, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.rect(filled, x, y, width, height, color);\r\n };\r\n SceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.rectLine(filled, x1, y1, x2, y2, width, color);\r\n };\r\n SceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.polygon(polygonVertices, offset, count, color);\r\n };\r\n SceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) {\r\n if (color === void 0) { color = null; }\r\n if (segments === void 0) { segments = 0; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.circle(filled, x, y, radius, color, segments);\r\n };\r\n SceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color);\r\n };\r\n SceneRenderer.prototype.end = function () {\r\n if (this.activeRenderer === this.batcher)\r\n this.batcher.end();\r\n else if (this.activeRenderer === this.shapes)\r\n this.shapes.end();\r\n this.activeRenderer = null;\r\n };\r\n SceneRenderer.prototype.resize = function (resizeMode) {\r\n var canvas = this.canvas;\r\n var w = canvas.clientWidth;\r\n var h = canvas.clientHeight;\r\n if (canvas.width != w || canvas.height != h) {\r\n canvas.width = w;\r\n canvas.height = h;\r\n }\r\n this.context.gl.viewport(0, 0, canvas.width, canvas.height);\r\n if (resizeMode === ResizeMode.Stretch) {\r\n }\r\n else if (resizeMode === ResizeMode.Expand) {\r\n this.camera.setViewport(w, h);\r\n }\r\n else if (resizeMode === ResizeMode.Fit) {\r\n var sourceWidth = canvas.width, sourceHeight = canvas.height;\r\n var targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight;\r\n var targetRatio = targetHeight / targetWidth;\r\n var sourceRatio = sourceHeight / sourceWidth;\r\n var scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight;\r\n this.camera.viewportWidth = sourceWidth * scale;\r\n this.camera.viewportHeight = sourceHeight * scale;\r\n }\r\n this.camera.update();\r\n };\r\n SceneRenderer.prototype.enableRenderer = function (renderer) {\r\n if (this.activeRenderer === renderer)\r\n return;\r\n this.end();\r\n if (renderer instanceof webgl.PolygonBatcher) {\r\n this.batcherShader.bind();\r\n this.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values);\r\n this.batcherShader.setUniformi(\"u_texture\", 0);\r\n this.batcher.begin(this.batcherShader);\r\n this.activeRenderer = this.batcher;\r\n }\r\n else if (renderer instanceof webgl.ShapeRenderer) {\r\n this.shapesShader.bind();\r\n this.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values);\r\n this.shapes.begin(this.shapesShader);\r\n this.activeRenderer = this.shapes;\r\n }\r\n else {\r\n this.activeRenderer = this.skeletonDebugRenderer;\r\n }\r\n };\r\n SceneRenderer.prototype.dispose = function () {\r\n this.batcher.dispose();\r\n this.batcherShader.dispose();\r\n this.shapes.dispose();\r\n this.shapesShader.dispose();\r\n this.skeletonDebugRenderer.dispose();\r\n };\r\n return SceneRenderer;\r\n }());\r\n webgl.SceneRenderer = SceneRenderer;\r\n var ResizeMode;\r\n (function (ResizeMode) {\r\n ResizeMode[ResizeMode[\"Stretch\"] = 0] = \"Stretch\";\r\n ResizeMode[ResizeMode[\"Expand\"] = 1] = \"Expand\";\r\n ResizeMode[ResizeMode[\"Fit\"] = 2] = \"Fit\";\r\n })(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {}));\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var Shader = (function () {\r\n function Shader(context, vertexShader, fragmentShader) {\r\n this.vertexShader = vertexShader;\r\n this.fragmentShader = fragmentShader;\r\n this.vs = null;\r\n this.fs = null;\r\n this.program = null;\r\n this.tmp2x2 = new Float32Array(2 * 2);\r\n this.tmp3x3 = new Float32Array(3 * 3);\r\n this.tmp4x4 = new Float32Array(4 * 4);\r\n this.vsSource = vertexShader;\r\n this.fsSource = fragmentShader;\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n this.context.addRestorable(this);\r\n this.compile();\r\n }\r\n Shader.prototype.getProgram = function () { return this.program; };\r\n Shader.prototype.getVertexShader = function () { return this.vertexShader; };\r\n Shader.prototype.getFragmentShader = function () { return this.fragmentShader; };\r\n Shader.prototype.getVertexShaderSource = function () { return this.vsSource; };\r\n Shader.prototype.getFragmentSource = function () { return this.fsSource; };\r\n Shader.prototype.compile = function () {\r\n var gl = this.context.gl;\r\n try {\r\n this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader);\r\n this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader);\r\n this.program = this.compileProgram(this.vs, this.fs);\r\n }\r\n catch (e) {\r\n this.dispose();\r\n throw e;\r\n }\r\n };\r\n Shader.prototype.compileShader = function (type, source) {\r\n var gl = this.context.gl;\r\n var shader = gl.createShader(type);\r\n gl.shaderSource(shader, source);\r\n gl.compileShader(shader);\r\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n var error = \"Couldn't compile shader: \" + gl.getShaderInfoLog(shader);\r\n gl.deleteShader(shader);\r\n if (!gl.isContextLost())\r\n throw new Error(error);\r\n }\r\n return shader;\r\n };\r\n Shader.prototype.compileProgram = function (vs, fs) {\r\n var gl = this.context.gl;\r\n var program = gl.createProgram();\r\n gl.attachShader(program, vs);\r\n gl.attachShader(program, fs);\r\n gl.linkProgram(program);\r\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\r\n var error = \"Couldn't compile shader program: \" + gl.getProgramInfoLog(program);\r\n gl.deleteProgram(program);\r\n if (!gl.isContextLost())\r\n throw new Error(error);\r\n }\r\n return program;\r\n };\r\n Shader.prototype.restore = function () {\r\n this.compile();\r\n };\r\n Shader.prototype.bind = function () {\r\n this.context.gl.useProgram(this.program);\r\n };\r\n Shader.prototype.unbind = function () {\r\n this.context.gl.useProgram(null);\r\n };\r\n Shader.prototype.setUniformi = function (uniform, value) {\r\n this.context.gl.uniform1i(this.getUniformLocation(uniform), value);\r\n };\r\n Shader.prototype.setUniformf = function (uniform, value) {\r\n this.context.gl.uniform1f(this.getUniformLocation(uniform), value);\r\n };\r\n Shader.prototype.setUniform2f = function (uniform, value, value2) {\r\n this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2);\r\n };\r\n Shader.prototype.setUniform3f = function (uniform, value, value2, value3) {\r\n this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3);\r\n };\r\n Shader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) {\r\n this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4);\r\n };\r\n Shader.prototype.setUniform2x2f = function (uniform, value) {\r\n var gl = this.context.gl;\r\n this.tmp2x2.set(value);\r\n gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2);\r\n };\r\n Shader.prototype.setUniform3x3f = function (uniform, value) {\r\n var gl = this.context.gl;\r\n this.tmp3x3.set(value);\r\n gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3);\r\n };\r\n Shader.prototype.setUniform4x4f = function (uniform, value) {\r\n var gl = this.context.gl;\r\n this.tmp4x4.set(value);\r\n gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4);\r\n };\r\n Shader.prototype.getUniformLocation = function (uniform) {\r\n var gl = this.context.gl;\r\n var location = gl.getUniformLocation(this.program, uniform);\r\n if (!location && !gl.isContextLost())\r\n throw new Error(\"Couldn't find location for uniform \" + uniform);\r\n return location;\r\n };\r\n Shader.prototype.getAttributeLocation = function (attribute) {\r\n var gl = this.context.gl;\r\n var location = gl.getAttribLocation(this.program, attribute);\r\n if (location == -1 && !gl.isContextLost())\r\n throw new Error(\"Couldn't find location for attribute \" + attribute);\r\n return location;\r\n };\r\n Shader.prototype.dispose = function () {\r\n this.context.removeRestorable(this);\r\n var gl = this.context.gl;\r\n if (this.vs) {\r\n gl.deleteShader(this.vs);\r\n this.vs = null;\r\n }\r\n if (this.fs) {\r\n gl.deleteShader(this.fs);\r\n this.fs = null;\r\n }\r\n if (this.program) {\r\n gl.deleteProgram(this.program);\r\n this.program = null;\r\n }\r\n };\r\n Shader.newColoredTextured = function (context) {\r\n var vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tattribute vec2 \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.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 = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tv_texCoords = \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n var fs = \"\\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\";\r\n return new Shader(context, vs, fs);\r\n };\r\n Shader.newTwoColoredTextured = function (context) {\r\n var vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR2 + \";\\n\\t\\t\\t\\tattribute vec2 \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.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 = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tv_dark = \" + Shader.COLOR2 + \";\\n\\t\\t\\t\\t\\tv_texCoords = \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n var fs = \"\\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\";\r\n return new Shader(context, vs, fs);\r\n };\r\n Shader.newColored = function (context) {\r\n var vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.MVP_MATRIX + \";\\n\\t\\t\\t\\tvarying vec4 v_color;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tv_color = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n var fs = \"\\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\";\r\n return new Shader(context, vs, fs);\r\n };\r\n Shader.MVP_MATRIX = \"u_projTrans\";\r\n Shader.POSITION = \"a_position\";\r\n Shader.COLOR = \"a_color\";\r\n Shader.COLOR2 = \"a_color2\";\r\n Shader.TEXCOORDS = \"a_texCoords\";\r\n Shader.SAMPLER = \"u_texture\";\r\n return Shader;\r\n }());\r\n webgl.Shader = Shader;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var ShapeRenderer = (function () {\r\n function ShapeRenderer(context, maxVertices) {\r\n if (maxVertices === void 0) { maxVertices = 10920; }\r\n this.isDrawing = false;\r\n this.shapeType = ShapeType.Filled;\r\n this.color = new spine.Color(1, 1, 1, 1);\r\n this.vertexIndex = 0;\r\n this.tmp = new spine.Vector2();\r\n if (maxVertices > 10920)\r\n throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n this.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0);\r\n this.srcBlend = this.context.gl.SRC_ALPHA;\r\n this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA;\r\n }\r\n ShapeRenderer.prototype.begin = function (shader) {\r\n if (this.isDrawing)\r\n throw new Error(\"ShapeRenderer.begin() has already been called\");\r\n this.shader = shader;\r\n this.vertexIndex = 0;\r\n this.isDrawing = true;\r\n var gl = this.context.gl;\r\n gl.enable(gl.BLEND);\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n };\r\n ShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) {\r\n var gl = this.context.gl;\r\n this.srcBlend = srcBlend;\r\n this.dstBlend = dstBlend;\r\n if (this.isDrawing) {\r\n this.flush();\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n }\r\n };\r\n ShapeRenderer.prototype.setColor = function (color) {\r\n this.color.setFromColor(color);\r\n };\r\n ShapeRenderer.prototype.setColorWith = function (r, g, b, a) {\r\n this.color.set(r, g, b, a);\r\n };\r\n ShapeRenderer.prototype.point = function (x, y, color) {\r\n if (color === void 0) { color = null; }\r\n this.check(ShapeType.Point, 1);\r\n if (color === null)\r\n color = this.color;\r\n this.vertex(x, y, color);\r\n };\r\n ShapeRenderer.prototype.line = function (x, y, x2, y2, color) {\r\n if (color === void 0) { color = null; }\r\n this.check(ShapeType.Line, 2);\r\n var vertices = this.mesh.getVertices();\r\n var idx = this.vertexIndex;\r\n if (color === null)\r\n color = this.color;\r\n this.vertex(x, y, color);\r\n this.vertex(x2, y2, color);\r\n };\r\n ShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) {\r\n if (color === void 0) { color = null; }\r\n if (color2 === void 0) { color2 = null; }\r\n if (color3 === void 0) { color3 = null; }\r\n this.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\r\n var vertices = this.mesh.getVertices();\r\n var idx = this.vertexIndex;\r\n if (color === null)\r\n color = this.color;\r\n if (color2 === null)\r\n color2 = this.color;\r\n if (color3 === null)\r\n color3 = this.color;\r\n if (filled) {\r\n this.vertex(x, y, color);\r\n this.vertex(x2, y2, color2);\r\n this.vertex(x3, y3, color3);\r\n }\r\n else {\r\n this.vertex(x, y, color);\r\n this.vertex(x2, y2, color2);\r\n this.vertex(x2, y2, color);\r\n this.vertex(x3, y3, color2);\r\n this.vertex(x3, y3, color);\r\n this.vertex(x, y, color2);\r\n }\r\n };\r\n ShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) {\r\n if (color === void 0) { color = null; }\r\n if (color2 === void 0) { color2 = null; }\r\n if (color3 === void 0) { color3 = null; }\r\n if (color4 === void 0) { color4 = null; }\r\n this.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\r\n var vertices = this.mesh.getVertices();\r\n var idx = this.vertexIndex;\r\n if (color === null)\r\n color = this.color;\r\n if (color2 === null)\r\n color2 = this.color;\r\n if (color3 === null)\r\n color3 = this.color;\r\n if (color4 === null)\r\n color4 = this.color;\r\n if (filled) {\r\n this.vertex(x, y, color);\r\n this.vertex(x2, y2, color2);\r\n this.vertex(x3, y3, color3);\r\n this.vertex(x3, y3, color3);\r\n this.vertex(x4, y4, color4);\r\n this.vertex(x, y, color);\r\n }\r\n else {\r\n this.vertex(x, y, color);\r\n this.vertex(x2, y2, color2);\r\n this.vertex(x2, y2, color2);\r\n this.vertex(x3, y3, color3);\r\n this.vertex(x3, y3, color3);\r\n this.vertex(x4, y4, color4);\r\n this.vertex(x4, y4, color4);\r\n this.vertex(x, y, color);\r\n }\r\n };\r\n ShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) {\r\n if (color === void 0) { color = null; }\r\n this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color);\r\n };\r\n ShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) {\r\n if (color === void 0) { color = null; }\r\n this.check(filled ? ShapeType.Filled : ShapeType.Line, 8);\r\n if (color === null)\r\n color = this.color;\r\n var t = this.tmp.set(y2 - y1, x1 - x2);\r\n t.normalize();\r\n width *= 0.5;\r\n var tx = t.x * width;\r\n var ty = t.y * width;\r\n if (!filled) {\r\n this.vertex(x1 + tx, y1 + ty, color);\r\n this.vertex(x1 - tx, y1 - ty, color);\r\n this.vertex(x2 + tx, y2 + ty, color);\r\n this.vertex(x2 - tx, y2 - ty, color);\r\n this.vertex(x2 + tx, y2 + ty, color);\r\n this.vertex(x1 + tx, y1 + ty, color);\r\n this.vertex(x2 - tx, y2 - ty, color);\r\n this.vertex(x1 - tx, y1 - ty, color);\r\n }\r\n else {\r\n this.vertex(x1 + tx, y1 + ty, color);\r\n this.vertex(x1 - tx, y1 - ty, color);\r\n this.vertex(x2 + tx, y2 + ty, color);\r\n this.vertex(x2 - tx, y2 - ty, color);\r\n this.vertex(x2 + tx, y2 + ty, color);\r\n this.vertex(x1 - tx, y1 - ty, color);\r\n }\r\n };\r\n ShapeRenderer.prototype.x = function (x, y, size) {\r\n this.line(x - size, y - size, x + size, y + size);\r\n this.line(x - size, y + size, x + size, y - size);\r\n };\r\n ShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) {\r\n if (color === void 0) { color = null; }\r\n if (count < 3)\r\n throw new Error(\"Polygon must contain at least 3 vertices\");\r\n this.check(ShapeType.Line, count * 2);\r\n if (color === null)\r\n color = this.color;\r\n var vertices = this.mesh.getVertices();\r\n var idx = this.vertexIndex;\r\n offset <<= 1;\r\n count <<= 1;\r\n var firstX = polygonVertices[offset];\r\n var firstY = polygonVertices[offset + 1];\r\n var last = offset + count;\r\n for (var i = offset, n = offset + count - 2; i < n; i += 2) {\r\n var x1 = polygonVertices[i];\r\n var y1 = polygonVertices[i + 1];\r\n var x2 = 0;\r\n var y2 = 0;\r\n if (i + 2 >= last) {\r\n x2 = firstX;\r\n y2 = firstY;\r\n }\r\n else {\r\n x2 = polygonVertices[i + 2];\r\n y2 = polygonVertices[i + 3];\r\n }\r\n this.vertex(x1, y1, color);\r\n this.vertex(x2, y2, color);\r\n }\r\n };\r\n ShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) {\r\n if (color === void 0) { color = null; }\r\n if (segments === void 0) { segments = 0; }\r\n if (segments === 0)\r\n segments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0);\r\n if (segments <= 0)\r\n throw new Error(\"segments must be > 0.\");\r\n if (color === null)\r\n color = this.color;\r\n var angle = 2 * spine.MathUtils.PI / segments;\r\n var cos = Math.cos(angle);\r\n var sin = Math.sin(angle);\r\n var cx = radius, cy = 0;\r\n if (!filled) {\r\n this.check(ShapeType.Line, segments * 2 + 2);\r\n for (var i = 0; i < segments; i++) {\r\n this.vertex(x + cx, y + cy, color);\r\n var temp_1 = cx;\r\n cx = cos * cx - sin * cy;\r\n cy = sin * temp_1 + cos * cy;\r\n this.vertex(x + cx, y + cy, color);\r\n }\r\n this.vertex(x + cx, y + cy, color);\r\n }\r\n else {\r\n this.check(ShapeType.Filled, segments * 3 + 3);\r\n segments--;\r\n for (var i = 0; i < segments; i++) {\r\n this.vertex(x, y, color);\r\n this.vertex(x + cx, y + cy, color);\r\n var temp_2 = cx;\r\n cx = cos * cx - sin * cy;\r\n cy = sin * temp_2 + cos * cy;\r\n this.vertex(x + cx, y + cy, color);\r\n }\r\n this.vertex(x, y, color);\r\n this.vertex(x + cx, y + cy, color);\r\n }\r\n var temp = cx;\r\n cx = radius;\r\n cy = 0;\r\n this.vertex(x + cx, y + cy, color);\r\n };\r\n ShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) {\r\n if (color === void 0) { color = null; }\r\n this.check(ShapeType.Line, segments * 2 + 2);\r\n if (color === null)\r\n color = this.color;\r\n var subdiv_step = 1 / segments;\r\n var subdiv_step2 = subdiv_step * subdiv_step;\r\n var subdiv_step3 = subdiv_step * subdiv_step * subdiv_step;\r\n var pre1 = 3 * subdiv_step;\r\n var pre2 = 3 * subdiv_step2;\r\n var pre4 = 6 * subdiv_step2;\r\n var pre5 = 6 * subdiv_step3;\r\n var tmp1x = x1 - cx1 * 2 + cx2;\r\n var tmp1y = y1 - cy1 * 2 + cy2;\r\n var tmp2x = (cx1 - cx2) * 3 - x1 + x2;\r\n var tmp2y = (cy1 - cy2) * 3 - y1 + y2;\r\n var fx = x1;\r\n var fy = y1;\r\n var dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;\r\n var dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;\r\n var ddfx = tmp1x * pre4 + tmp2x * pre5;\r\n var ddfy = tmp1y * pre4 + tmp2y * pre5;\r\n var dddfx = tmp2x * pre5;\r\n var dddfy = tmp2y * pre5;\r\n while (segments-- > 0) {\r\n this.vertex(fx, fy, color);\r\n fx += dfx;\r\n fy += dfy;\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n this.vertex(fx, fy, color);\r\n }\r\n this.vertex(fx, fy, color);\r\n this.vertex(x2, y2, color);\r\n };\r\n ShapeRenderer.prototype.vertex = function (x, y, color) {\r\n var idx = this.vertexIndex;\r\n var vertices = this.mesh.getVertices();\r\n vertices[idx++] = x;\r\n vertices[idx++] = y;\r\n vertices[idx++] = color.r;\r\n vertices[idx++] = color.g;\r\n vertices[idx++] = color.b;\r\n vertices[idx++] = color.a;\r\n this.vertexIndex = idx;\r\n };\r\n ShapeRenderer.prototype.end = function () {\r\n if (!this.isDrawing)\r\n throw new Error(\"ShapeRenderer.begin() has not been called\");\r\n this.flush();\r\n this.context.gl.disable(this.context.gl.BLEND);\r\n this.isDrawing = false;\r\n };\r\n ShapeRenderer.prototype.flush = function () {\r\n if (this.vertexIndex == 0)\r\n return;\r\n this.mesh.setVerticesLength(this.vertexIndex);\r\n this.mesh.draw(this.shader, this.shapeType);\r\n this.vertexIndex = 0;\r\n };\r\n ShapeRenderer.prototype.check = function (shapeType, numVertices) {\r\n if (!this.isDrawing)\r\n throw new Error(\"ShapeRenderer.begin() has not been called\");\r\n if (this.shapeType == shapeType) {\r\n if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices)\r\n this.flush();\r\n else\r\n return;\r\n }\r\n else {\r\n this.flush();\r\n this.shapeType = shapeType;\r\n }\r\n };\r\n ShapeRenderer.prototype.dispose = function () {\r\n this.mesh.dispose();\r\n };\r\n return ShapeRenderer;\r\n }());\r\n webgl.ShapeRenderer = ShapeRenderer;\r\n var ShapeType;\r\n (function (ShapeType) {\r\n ShapeType[ShapeType[\"Point\"] = 0] = \"Point\";\r\n ShapeType[ShapeType[\"Line\"] = 1] = \"Line\";\r\n ShapeType[ShapeType[\"Filled\"] = 4] = \"Filled\";\r\n })(ShapeType = webgl.ShapeType || (webgl.ShapeType = {}));\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var SkeletonDebugRenderer = (function () {\r\n function SkeletonDebugRenderer(context) {\r\n this.boneLineColor = new spine.Color(1, 0, 0, 1);\r\n this.boneOriginColor = new spine.Color(0, 1, 0, 1);\r\n this.attachmentLineColor = new spine.Color(0, 0, 1, 0.5);\r\n this.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5);\r\n this.pathColor = new spine.Color().setFromString(\"FF7F00\");\r\n this.clipColor = new spine.Color(0.8, 0, 0, 2);\r\n this.aabbColor = new spine.Color(0, 1, 0, 0.5);\r\n this.drawBones = true;\r\n this.drawRegionAttachments = true;\r\n this.drawBoundingBoxes = true;\r\n this.drawMeshHull = true;\r\n this.drawMeshTriangles = true;\r\n this.drawPaths = true;\r\n this.drawSkeletonXY = false;\r\n this.drawClipping = true;\r\n this.premultipliedAlpha = false;\r\n this.scale = 1;\r\n this.boneWidth = 2;\r\n this.bounds = new spine.SkeletonBounds();\r\n this.temp = new Array();\r\n this.vertices = spine.Utils.newFloatArray(2 * 1024);\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n }\r\n SkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) {\r\n if (ignoredBones === void 0) { ignoredBones = null; }\r\n var skeletonX = skeleton.x;\r\n var skeletonY = skeleton.y;\r\n var gl = this.context.gl;\r\n var srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA;\r\n shapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA);\r\n var bones = skeleton.bones;\r\n if (this.drawBones) {\r\n shapes.setColor(this.boneLineColor);\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1)\r\n continue;\r\n if (bone.parent == null)\r\n continue;\r\n var x = skeletonX + bone.data.length * bone.a + bone.worldX;\r\n var y = skeletonY + bone.data.length * bone.c + bone.worldY;\r\n shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale);\r\n }\r\n if (this.drawSkeletonXY)\r\n shapes.x(skeletonX, skeletonY, 4 * this.scale);\r\n }\r\n if (this.drawRegionAttachments) {\r\n shapes.setColor(this.attachmentLineColor);\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof spine.RegionAttachment) {\r\n var regionAttachment = attachment;\r\n var vertices = this.vertices;\r\n regionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]);\r\n shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]);\r\n shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]);\r\n shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]);\r\n }\r\n }\r\n }\r\n if (this.drawMeshHull || this.drawMeshTriangles) {\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var attachment = slot.getAttachment();\r\n if (!(attachment instanceof spine.MeshAttachment))\r\n continue;\r\n var mesh = attachment;\r\n var vertices = this.vertices;\r\n mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2);\r\n var triangles = mesh.triangles;\r\n var hullLength = mesh.hullLength;\r\n if (this.drawMeshTriangles) {\r\n shapes.setColor(this.triangleLineColor);\r\n for (var ii = 0, nn = triangles.length; ii < nn; ii += 3) {\r\n var v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2;\r\n shapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]);\r\n }\r\n }\r\n if (this.drawMeshHull && hullLength > 0) {\r\n shapes.setColor(this.attachmentLineColor);\r\n hullLength = (hullLength >> 1) * 2;\r\n var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1];\r\n for (var ii = 0, nn = hullLength; ii < nn; ii += 2) {\r\n var x = vertices[ii], y = vertices[ii + 1];\r\n shapes.line(x, y, lastX, lastY);\r\n lastX = x;\r\n lastY = y;\r\n }\r\n }\r\n }\r\n }\r\n if (this.drawBoundingBoxes) {\r\n var bounds = this.bounds;\r\n bounds.update(skeleton, true);\r\n shapes.setColor(this.aabbColor);\r\n shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight());\r\n var polygons = bounds.polygons;\r\n var boxes = bounds.boundingBoxes;\r\n for (var i = 0, n = polygons.length; i < n; i++) {\r\n var polygon = polygons[i];\r\n shapes.setColor(boxes[i].color);\r\n shapes.polygon(polygon, 0, polygon.length);\r\n }\r\n }\r\n if (this.drawPaths) {\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var attachment = slot.getAttachment();\r\n if (!(attachment instanceof spine.PathAttachment))\r\n continue;\r\n var path = attachment;\r\n var nn = path.worldVerticesLength;\r\n var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0);\r\n path.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n var color = this.pathColor;\r\n var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0;\r\n if (path.closed) {\r\n shapes.setColor(color);\r\n var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1];\r\n x2 = world[nn - 4];\r\n y2 = world[nn - 3];\r\n shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\r\n shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\r\n shapes.line(x1, y1, cx1, cy1);\r\n shapes.line(x2, y2, cx2, cy2);\r\n }\r\n nn -= 4;\r\n for (var ii = 4; ii < nn; ii += 6) {\r\n var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3];\r\n x2 = world[ii + 4];\r\n y2 = world[ii + 5];\r\n shapes.setColor(color);\r\n shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\r\n shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\r\n shapes.line(x1, y1, cx1, cy1);\r\n shapes.line(x2, y2, cx2, cy2);\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n }\r\n }\r\n if (this.drawBones) {\r\n shapes.setColor(this.boneOriginColor);\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1)\r\n continue;\r\n shapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8);\r\n }\r\n }\r\n if (this.drawClipping) {\r\n var slots = skeleton.slots;\r\n shapes.setColor(this.clipColor);\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var attachment = slot.getAttachment();\r\n if (!(attachment instanceof spine.ClippingAttachment))\r\n continue;\r\n var clip = attachment;\r\n var nn = clip.worldVerticesLength;\r\n var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0);\r\n clip.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n for (var i_16 = 0, n_2 = world.length; i_16 < n_2; i_16 += 2) {\r\n var x = world[i_16];\r\n var y = world[i_16 + 1];\r\n var x2 = world[(i_16 + 2) % world.length];\r\n var y2 = world[(i_16 + 3) % world.length];\r\n shapes.line(x, y, x2, y2);\r\n }\r\n }\r\n }\r\n };\r\n SkeletonDebugRenderer.prototype.dispose = function () {\r\n };\r\n SkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1);\r\n SkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1);\r\n return SkeletonDebugRenderer;\r\n }());\r\n webgl.SkeletonDebugRenderer = SkeletonDebugRenderer;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var Renderable = (function () {\r\n function Renderable(vertices, numVertices, numFloats) {\r\n this.vertices = vertices;\r\n this.numVertices = numVertices;\r\n this.numFloats = numFloats;\r\n }\r\n return Renderable;\r\n }());\r\n ;\r\n var SkeletonRenderer = (function () {\r\n function SkeletonRenderer(context, twoColorTint) {\r\n if (twoColorTint === void 0) { twoColorTint = true; }\r\n this.premultipliedAlpha = false;\r\n this.vertexEffect = null;\r\n this.tempColor = new spine.Color();\r\n this.tempColor2 = new spine.Color();\r\n this.vertexSize = 2 + 2 + 4;\r\n this.twoColorTint = false;\r\n this.renderable = new Renderable(null, 0, 0);\r\n this.clipper = new spine.SkeletonClipping();\r\n this.temp = new spine.Vector2();\r\n this.temp2 = new spine.Vector2();\r\n this.temp3 = new spine.Color();\r\n this.temp4 = new spine.Color();\r\n this.twoColorTint = twoColorTint;\r\n if (twoColorTint)\r\n this.vertexSize += 4;\r\n this.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024);\r\n }\r\n SkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) {\r\n if (slotRangeStart === void 0) { slotRangeStart = -1; }\r\n if (slotRangeEnd === void 0) { slotRangeEnd = -1; }\r\n var clipper = this.clipper;\r\n var premultipliedAlpha = this.premultipliedAlpha;\r\n var twoColorTint = this.twoColorTint;\r\n var blendMode = null;\r\n var tempPos = this.temp;\r\n var tempUv = this.temp2;\r\n var tempLight = this.temp3;\r\n var tempDark = this.temp4;\r\n var renderable = this.renderable;\r\n var uvs = null;\r\n var triangles = null;\r\n var drawOrder = skeleton.drawOrder;\r\n var attachmentColor = null;\r\n var skeletonColor = skeleton.color;\r\n var vertexSize = twoColorTint ? 12 : 8;\r\n var inRange = false;\r\n if (slotRangeStart == -1)\r\n inRange = true;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var clippedVertexSize = clipper.isClipping() ? 2 : vertexSize;\r\n var slot = drawOrder[i];\r\n if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) {\r\n inRange = true;\r\n }\r\n if (!inRange) {\r\n clipper.clipEndWithSlot(slot);\r\n continue;\r\n }\r\n if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) {\r\n inRange = false;\r\n }\r\n var attachment = slot.getAttachment();\r\n var texture = null;\r\n if (attachment instanceof spine.RegionAttachment) {\r\n var region = attachment;\r\n renderable.vertices = this.vertices;\r\n renderable.numVertices = 4;\r\n renderable.numFloats = clippedVertexSize << 2;\r\n region.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize);\r\n triangles = SkeletonRenderer.QUAD_TRIANGLES;\r\n uvs = region.uvs;\r\n texture = region.region.renderObject.texture;\r\n attachmentColor = region.color;\r\n }\r\n else if (attachment instanceof spine.MeshAttachment) {\r\n var mesh = attachment;\r\n renderable.vertices = this.vertices;\r\n renderable.numVertices = (mesh.worldVerticesLength >> 1);\r\n renderable.numFloats = renderable.numVertices * clippedVertexSize;\r\n if (renderable.numFloats > renderable.vertices.length) {\r\n renderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats);\r\n }\r\n mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize);\r\n triangles = mesh.triangles;\r\n texture = mesh.region.renderObject.texture;\r\n uvs = mesh.uvs;\r\n attachmentColor = mesh.color;\r\n }\r\n else if (attachment instanceof spine.ClippingAttachment) {\r\n var clip = (attachment);\r\n clipper.clipStart(slot, clip);\r\n continue;\r\n }\r\n else {\r\n clipper.clipEndWithSlot(slot);\r\n continue;\r\n }\r\n if (texture != null) {\r\n var slotColor = slot.color;\r\n var finalColor = this.tempColor;\r\n finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r;\r\n finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g;\r\n finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b;\r\n finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a;\r\n if (premultipliedAlpha) {\r\n finalColor.r *= finalColor.a;\r\n finalColor.g *= finalColor.a;\r\n finalColor.b *= finalColor.a;\r\n }\r\n var darkColor = this.tempColor2;\r\n if (slot.darkColor == null)\r\n darkColor.set(0, 0, 0, 1.0);\r\n else {\r\n if (premultipliedAlpha) {\r\n darkColor.r = slot.darkColor.r * finalColor.a;\r\n darkColor.g = slot.darkColor.g * finalColor.a;\r\n darkColor.b = slot.darkColor.b * finalColor.a;\r\n }\r\n else {\r\n darkColor.setFromColor(slot.darkColor);\r\n }\r\n darkColor.a = premultipliedAlpha ? 1.0 : 0.0;\r\n }\r\n var slotBlendMode = slot.data.blendMode;\r\n if (slotBlendMode != blendMode) {\r\n blendMode = slotBlendMode;\r\n batcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode));\r\n }\r\n if (clipper.isClipping()) {\r\n clipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint);\r\n var clippedVertices = new Float32Array(clipper.clippedVertices);\r\n var clippedTriangles = clipper.clippedTriangles;\r\n if (this.vertexEffect != null) {\r\n var vertexEffect = this.vertexEffect;\r\n var verts = clippedVertices;\r\n if (!twoColorTint) {\r\n for (var v = 0, n_3 = clippedVertices.length; v < n_3; v += vertexSize) {\r\n tempPos.x = verts[v];\r\n tempPos.y = verts[v + 1];\r\n tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]);\r\n tempUv.x = verts[v + 6];\r\n tempUv.y = verts[v + 7];\r\n tempDark.set(0, 0, 0, 0);\r\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n verts[v] = tempPos.x;\r\n verts[v + 1] = tempPos.y;\r\n verts[v + 2] = tempLight.r;\r\n verts[v + 3] = tempLight.g;\r\n verts[v + 4] = tempLight.b;\r\n verts[v + 5] = tempLight.a;\r\n verts[v + 6] = tempUv.x;\r\n verts[v + 7] = tempUv.y;\r\n }\r\n }\r\n else {\r\n for (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) {\r\n tempPos.x = verts[v];\r\n tempPos.y = verts[v + 1];\r\n tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]);\r\n tempUv.x = verts[v + 6];\r\n tempUv.y = verts[v + 7];\r\n tempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]);\r\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n verts[v] = tempPos.x;\r\n verts[v + 1] = tempPos.y;\r\n verts[v + 2] = tempLight.r;\r\n verts[v + 3] = tempLight.g;\r\n verts[v + 4] = tempLight.b;\r\n verts[v + 5] = tempLight.a;\r\n verts[v + 6] = tempUv.x;\r\n verts[v + 7] = tempUv.y;\r\n verts[v + 8] = tempDark.r;\r\n verts[v + 9] = tempDark.g;\r\n verts[v + 10] = tempDark.b;\r\n verts[v + 11] = tempDark.a;\r\n }\r\n }\r\n }\r\n batcher.draw(texture, clippedVertices, clippedTriangles);\r\n }\r\n else {\r\n var verts = renderable.vertices;\r\n if (this.vertexEffect != null) {\r\n var vertexEffect = this.vertexEffect;\r\n if (!twoColorTint) {\r\n for (var v = 0, u = 0, n_5 = renderable.numFloats; v < n_5; v += vertexSize, u += 2) {\r\n tempPos.x = verts[v];\r\n tempPos.y = verts[v + 1];\r\n tempUv.x = uvs[u];\r\n tempUv.y = uvs[u + 1];\r\n tempLight.setFromColor(finalColor);\r\n tempDark.set(0, 0, 0, 0);\r\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n verts[v] = tempPos.x;\r\n verts[v + 1] = tempPos.y;\r\n verts[v + 2] = tempLight.r;\r\n verts[v + 3] = tempLight.g;\r\n verts[v + 4] = tempLight.b;\r\n verts[v + 5] = tempLight.a;\r\n verts[v + 6] = tempUv.x;\r\n verts[v + 7] = tempUv.y;\r\n }\r\n }\r\n else {\r\n for (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) {\r\n tempPos.x = verts[v];\r\n tempPos.y = verts[v + 1];\r\n tempUv.x = uvs[u];\r\n tempUv.y = uvs[u + 1];\r\n tempLight.setFromColor(finalColor);\r\n tempDark.setFromColor(darkColor);\r\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n verts[v] = tempPos.x;\r\n verts[v + 1] = tempPos.y;\r\n verts[v + 2] = tempLight.r;\r\n verts[v + 3] = tempLight.g;\r\n verts[v + 4] = tempLight.b;\r\n verts[v + 5] = tempLight.a;\r\n verts[v + 6] = tempUv.x;\r\n verts[v + 7] = tempUv.y;\r\n verts[v + 8] = tempDark.r;\r\n verts[v + 9] = tempDark.g;\r\n verts[v + 10] = tempDark.b;\r\n verts[v + 11] = tempDark.a;\r\n }\r\n }\r\n }\r\n else {\r\n if (!twoColorTint) {\r\n for (var v = 2, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) {\r\n verts[v] = finalColor.r;\r\n verts[v + 1] = finalColor.g;\r\n verts[v + 2] = finalColor.b;\r\n verts[v + 3] = finalColor.a;\r\n verts[v + 4] = uvs[u];\r\n verts[v + 5] = uvs[u + 1];\r\n }\r\n }\r\n else {\r\n for (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) {\r\n verts[v] = finalColor.r;\r\n verts[v + 1] = finalColor.g;\r\n verts[v + 2] = finalColor.b;\r\n verts[v + 3] = finalColor.a;\r\n verts[v + 4] = uvs[u];\r\n verts[v + 5] = uvs[u + 1];\r\n verts[v + 6] = darkColor.r;\r\n verts[v + 7] = darkColor.g;\r\n verts[v + 8] = darkColor.b;\r\n verts[v + 9] = darkColor.a;\r\n }\r\n }\r\n }\r\n var view = renderable.vertices.subarray(0, renderable.numFloats);\r\n batcher.draw(texture, view, triangles);\r\n }\r\n }\r\n clipper.clipEndWithSlot(slot);\r\n }\r\n clipper.clipEnd();\r\n };\r\n SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n return SkeletonRenderer;\r\n }());\r\n webgl.SkeletonRenderer = SkeletonRenderer;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var Vector3 = (function () {\r\n function Vector3(x, y, z) {\r\n if (x === void 0) { x = 0; }\r\n if (y === void 0) { y = 0; }\r\n if (z === void 0) { z = 0; }\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n }\r\n Vector3.prototype.setFrom = function (v) {\r\n this.x = v.x;\r\n this.y = v.y;\r\n this.z = v.z;\r\n return this;\r\n };\r\n Vector3.prototype.set = function (x, y, z) {\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n return this;\r\n };\r\n Vector3.prototype.add = function (v) {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z;\r\n return this;\r\n };\r\n Vector3.prototype.sub = function (v) {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z;\r\n return this;\r\n };\r\n Vector3.prototype.scale = function (s) {\r\n this.x *= s;\r\n this.y *= s;\r\n this.z *= s;\r\n return this;\r\n };\r\n Vector3.prototype.normalize = function () {\r\n var len = this.length();\r\n if (len == 0)\r\n return this;\r\n len = 1 / len;\r\n this.x *= len;\r\n this.y *= len;\r\n this.z *= len;\r\n return this;\r\n };\r\n Vector3.prototype.cross = function (v) {\r\n return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x);\r\n };\r\n Vector3.prototype.multiply = function (matrix) {\r\n var l_mat = matrix.values;\r\n return this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]);\r\n };\r\n Vector3.prototype.project = function (matrix) {\r\n var l_mat = matrix.values;\r\n var l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]);\r\n return this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w);\r\n };\r\n Vector3.prototype.dot = function (v) {\r\n return this.x * v.x + this.y * v.y + this.z * v.z;\r\n };\r\n Vector3.prototype.length = function () {\r\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\r\n };\r\n Vector3.prototype.distance = function (v) {\r\n var a = v.x - this.x;\r\n var b = v.y - this.y;\r\n var c = v.z - this.z;\r\n return Math.sqrt(a * a + b * b + c * c);\r\n };\r\n return Vector3;\r\n }());\r\n webgl.Vector3 = Vector3;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var ManagedWebGLRenderingContext = (function () {\r\n function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) {\r\n var _this = this;\r\n if (contextConfig === void 0) { contextConfig = { alpha: \"true\" }; }\r\n this.restorables = new Array();\r\n if (canvasOrContext instanceof HTMLCanvasElement) {\r\n var canvas_1 = canvasOrContext;\r\n this.gl = (canvas_1.getContext(\"webgl\", contextConfig) || canvas_1.getContext(\"experimental-webgl\", contextConfig));\r\n this.canvas = canvas_1;\r\n canvas_1.addEventListener(\"webglcontextlost\", function (e) {\r\n var event = e;\r\n if (e) {\r\n e.preventDefault();\r\n }\r\n });\r\n canvas_1.addEventListener(\"webglcontextrestored\", function (e) {\r\n for (var i = 0, n = _this.restorables.length; i < n; i++) {\r\n _this.restorables[i].restore();\r\n }\r\n });\r\n }\r\n else {\r\n this.gl = canvasOrContext;\r\n this.canvas = this.gl.canvas;\r\n }\r\n }\r\n ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) {\r\n this.restorables.push(restorable);\r\n };\r\n ManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) {\r\n var index = this.restorables.indexOf(restorable);\r\n if (index > -1)\r\n this.restorables.splice(index, 1);\r\n };\r\n return ManagedWebGLRenderingContext;\r\n }());\r\n webgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext;\r\n var WebGLBlendModeConverter = (function () {\r\n function WebGLBlendModeConverter() {\r\n }\r\n WebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) {\r\n switch (blendMode) {\r\n case spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n case spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE;\r\n case spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n default: throw new Error(\"Unknown blend mode: \" + blendMode);\r\n }\r\n };\r\n WebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) {\r\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n switch (blendMode) {\r\n case spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA;\r\n case spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA;\r\n case spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR;\r\n case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE;\r\n default: throw new Error(\"Unknown blend mode: \" + blendMode);\r\n }\r\n };\r\n WebGLBlendModeConverter.ZERO = 0;\r\n WebGLBlendModeConverter.ONE = 1;\r\n WebGLBlendModeConverter.SRC_COLOR = 0x0300;\r\n WebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301;\r\n WebGLBlendModeConverter.SRC_ALPHA = 0x0302;\r\n WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303;\r\n WebGLBlendModeConverter.DST_ALPHA = 0x0304;\r\n WebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305;\r\n WebGLBlendModeConverter.DST_COLOR = 0x0306;\r\n return WebGLBlendModeConverter;\r\n }());\r\n webgl.WebGLBlendModeConverter = WebGLBlendModeConverter;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\n//# sourceMappingURL=spine-both.js.map\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = spine;\n}.call(window));"],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/spine/dist/SpineWebGLPlugin.js b/plugins/spine/dist/SpineWebGLPlugin.js new file mode 100644 index 000000000..2f3e3ece4 --- /dev/null +++ b/plugins/spine/dist/SpineWebGLPlugin.js @@ -0,0 +1,30799 @@ +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 = 32); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// 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; +} + +/** + * Extends the given `myClass` object's prototype with the properties of `definition`. + * + * @function extend + * @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. + */ +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]; + } + } +} + +/** + * Applies the given `mixins` to the prototype of `myClass`. + * + * @function mixin + * @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) + { + return; + } + + if (!Array.isArray(mixins)) + { + mixins = [ mixins ]; + } + + 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; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + +}; + +module.exports = MATH_CONST; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 (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; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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 2D space. + * + * A two-component vector. + * + * @class Vector2 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties. + * @param {number} [y] - 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.Math.Vector2} 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.Math.Vector2} 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)); + }, + + /** + * 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; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector2#add + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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); + }, + + /** + * 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; + }, + + /** + * Right-hand normalize (make unit length) this Vector. + * + * @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; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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; + } + +}); + +/** + * 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; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {integer} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {integer} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {integer} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started + * + * @name Phaser.Loader.FILE_PENDING + * @type {integer} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing + * + * @name Phaser.Loader.FILE_LOADED + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load + * + * @name Phaser.Loader.FILE_FAILED + * @type {integer} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {integer} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {integer} + * @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 {integer} + * @since 3.0.0 + */ + FILE_POPULATED: 19 + +}; + +module.exports = FILE_CONST; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(1); + +/** + * 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; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(1); + +/** + * 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 {integer} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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; + }, + + /** + * 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); + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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 Matrix. + * + * @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; + }, + + /** + * 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; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Source object +// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' +// The default value to use if the key doesn't exist + +/** + * Retrieves a value from an object. + * + * @function Phaser.Utils.Objects.GetValue + * @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 GetValue = function (source, key, defaultValue) +{ + if (!source || typeof source === 'number') + { + return defaultValue; + } + else if (source.hasOwnProperty(key)) + { + return source[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parent = source; + var value = defaultValue; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parent.hasOwnProperty(keys[i])) + { + // Yes it has a key property, let's carry on down + value = parent[keys[i]]; + + parent = parent[keys[i]]; + } + else + { + // Can't go any further, so reset to default + value = defaultValue; + break; + } + } + + return value; + } + else + { + return defaultValue; + } +}; + +module.exports = GetValue; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(6); +var Events = __webpack_require__(170); +var GetFastValue = __webpack_require__(3); +var GetURL = __webpack_require__(181); +var MergeXHRSettings = __webpack_require__(29); +var XHRLoader = __webpack_require__(182); +var XHRSettings = __webpack_require__(30); + +/** + * @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); + + /** + * 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.type || !this.key) + { + throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + } + + /** + * The URL of the file, not including baseURL. + * Automatically has Loader.path prepended to it. + * + * @name Phaser.Loader.File#url + * @type {string} + * @since 3.0.0 + */ + this.url = GetFastValue(fileConfig, 'url'); + + if (this.url === undefined) + { + this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof(this.url) !== 'function') + { + this.url = loader.path + this.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 {integer} + * @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.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 localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && 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.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 () + { + 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.cache.add(this.key, this.data); + } + + this.pendingDestroy(); + }, + + /** + * 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 (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); + }, + + /** + * 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; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsPlainObject = __webpack_require__(2); + +// @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 + * + * @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; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathWrap = __webpack_require__(4); + +/** + * 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; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(4); + +/** + * 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; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Factorial = __webpack_require__(20); + +/** + * [description] + * + * @function Phaser.Math.Bernstein + * @since 3.0.0 + * + * @param {number} n - [description] + * @param {number} i - [description] + * + * @return {number} [description] + */ +var Bernstein = function (n, i) +{ + return Factorial(n) / Factorial(i) / Factorial(n - i); +}; + +module.exports = Bernstein; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a Catmull-Rom value. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - [description] + * @param {number} p0 - [description] + * @param {number} p1 - [description] + * @param {number} p2 - [description] + * @param {number} p3 - [description] + * + * @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; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(1); + +/** + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {integer} 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; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - [description] + * + * @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; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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 EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * @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); + }, + + // TODO - Should work with basic values + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + 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]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + 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]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * 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 () + { + var out = this.val; + + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 0; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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 null; + } + + det = 1 / det; + + a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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]; + + a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); + a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); + a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); + a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); + a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); + a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); + a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); + a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - [description] + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = []; + var m1 = this.val; + var m2 = src.val; + + a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; + a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; + a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; + a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; + + a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; + a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; + a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; + a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; + + a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; + a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; + a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; + a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; + + a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; + a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; + a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; + a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; + + return this.fromArray(a); + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + translate: function (v) + { + var x = v.x; + var y = v.y; + var z = v.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; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + scale: function (v) + { + var x = v.x; + var y = v.y; + var z = v.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; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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; + + this.fromArray([ + 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 + ]); + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 null; + } + + 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]; + + // 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 + a[0] = a00 * b00 + a10 * b01 + a20 * b02; + a[1] = a01 * b00 + a11 * b01 + a21 * b02; + a[2] = a02 * b00 + a12 * b01 + a22 * b02; + a[3] = a03 * b00 + a13 * b01 + a23 * b02; + a[4] = a00 * b10 + a10 * b11 + a20 * b12; + a[5] = a01 * b10 + a11 * b11 + a21 * b12; + a[6] = a02 * b10 + a12 * b11 + a22 * b12; + a[7] = a03 * b10 + a13 * b11 + a23 * b12; + a[8] = a00 * b20 + a10 * b21 + a20 * b22; + a[9] = a01 * b20 + a11 * b21 + a21 * b22; + a[10] = a02 * b20 + a12 * b21 + a22 * b22; + a[11] = a03 * b20 + a13 * b21 + a23 * b22; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var out = this.val; + + 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; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = v.x; + out[13] = v.y; + out[14] = v.z; + out[15] = 1; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + fromQuat: function (q) + { + var out = this.val; + + 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; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var out = this.val; + + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + out[0] = (near * 2) * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (near * 2) * tb; + out[6] = 0; + out[7] = 0; + + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (far * near * 2) * nf; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var out = this.val; + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (2 * far * near) * nf; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + var out = this.val; + + out[0] = (2 * near) / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (2 * near) / height; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = -far / (near - far); + out[11] = 1; + + out[12] = 0; + out[13] = 0; + out[14] = (near * far) / (near - far); + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var out = this.val; + 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; + + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + + 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 {Phaser.Math.Matrix4} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var out = this.val; + + 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; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + + return this; + }, + + /** + * 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 - [description] + * @param {number} pitch - [description] + * @param {number} roll - [description] + * + * @return {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 !== undefined) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix !== undefined) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + } + +}); + +var _tempMat1 = new Matrix4(); +var _tempMat2 = new Matrix4(); + +module.exports = Matrix4; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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 Vector3 = __webpack_require__(10); +var Matrix3 = __webpack_require__(26); + +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] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + * @param {number} [w] - 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 + * @since 3.0.0 + */ + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.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; + } + }, + + /** + * 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) + { + this.x = src.x; + this.y = src.y; + this.z = src.z; + this.w = src.w; + + return this; + }, + + /** + * Set the components of this Quaternion. + * + * @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. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + 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 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; + + 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; + + 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; + + 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; + } + + 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; + + 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Quaternion#rotationTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - [description] + * @param {Phaser.Math.Vector3} b - [description] + * + * @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) + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + } + 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 () + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + }, + + /** + * 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); + + this.x = s * axis.x; + this.y = s * axis.y; + this.z = s * axis.z; + this.w = Math.cos(rad); + + return this; + }, + + /** + * 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; + + this.x = ax * bw + aw * bx + ay * bz - az * by; + this.y = ay * bw + aw * by + az * bx - ax * bz; + this.z = az * bw + aw * bz + ax * by - ay * bx; + this.w = aw * bw - ax * bx - ay * by - az * bz; + + return this; + }, + + /** + * 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 + this.x = scale0 * ax + scale1 * bx; + this.y = scale0 * ay + scale1 * by; + this.z = scale0 * az + scale1 * bz; + this.w = scale0 * aw + scale1 * bw; + + return this; + }, + + /** + * 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; + + // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + this.x = -a0 * invDot; + this.y = -a1 * invDot; + this.z = -a2 * invDot; + this.w = a3 * invDot; + + return this; + }, + + /** + * 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; + + 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); + + this.x = ax * bw + aw * bx; + this.y = ay * bw + az * bx; + this.z = az * bw - ay * bx; + this.w = aw * bw - ax * bx; + + return this; + }, + + /** + * 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); + + this.x = ax * bw - az * by; + this.y = ay * bw + aw * by; + this.z = az * bw + ax * by; + this.w = aw * bw - ay * by; + + return this; + }, + + /** + * 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); + + this.x = ax * bw + ay * bz; + this.y = ay * bw - ax * bz; + this.z = az * bw + aw * bz; + this.w = aw * bw - az * bz; + + return this; + }, + + /** + * 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; + }, + + /** + * 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; + } + + return this; + } + +}); + +module.exports = Quaternion; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(14); +var XHRSettings = __webpack_require__(30); + +/** + * 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; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [timeout=0] - Optional XHR timeout value. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + */ +var XHRSettings = function (responseType, async, user, password, timeout) +{ + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } + + // 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 + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined + + }; +}; + +module.exports = XHRSettings; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var BuildGameObject = __webpack_require__(33); +var Class = __webpack_require__(0); +var GetValue = __webpack_require__(11); +var ResizeEvent = __webpack_require__(144); +var ScenePlugin = __webpack_require__(145); +var Spine = __webpack_require__(167); +var SpineFile = __webpack_require__(168); +var SpineGameObject = __webpack_require__(186); + +/** + * @classdesc + * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game objects. + * + * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin + * uses the Spine 3.7 runtimes. Files created in a more recent version of Spine may not work as a result. + * + * You can find more details about Spine at http://esotericsoftware.com/. + * + * 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. + * + * 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 a Game Object Factory method, allowin you to create Spine Game Objects: + * + * ```javascript + * this.add.spine(512, 650, 'stretchyman') + * ``` + * + * 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 preMultipiedAlpha 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. + * + * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference + * + * @class SpinePlugin + * @memberOf Phaser + * @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. + */ +var SpinePlugin = new Class({ + + Extends: ScenePlugin, + + initialize: + + function SpinePlugin (scene, pluginManager) + { + ScenePlugin.call(this, scene, pluginManager); + + 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. + * + * 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; + } + + pluginManager.registerFileType('spine', this.spineFileCallback, scene); + + pluginManager.registerGameObject('spine', this.add.bind(this), this.make.bind(this)); + }, + + /** + * 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); + }, + + /** + * 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 () + { + this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + + // Monkeypatch the Spine setBlendMode functions, or batching is destroyed + + var setBlendMode = function (srcBlend, dstBlend) + { + if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend) + { + var gl = this.context.gl; + + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + + if (this.isDrawing) + { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + } + }; + + this.sceneRenderer.batcher.setBlendMode = setBlendMode; + this.sceneRenderer.shapes.setBlendMode = setBlendMode; + + this.skeletonRenderer = this.sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = this.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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage()); + + spineTextures.add(key, canvasTexture); + + return canvasTexture; + }); + } + + 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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + var gl = this.sceneRenderer.context.gl; + + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage(), false); + + spineTextures.add(key, glTexture); + + return glTexture; + }); + } + + 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 preMultipiedAlpha 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#addFileEvent + * @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} [preMultipiedAlpha=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. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ + spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings) + { + var multifile; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new SpineFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; + }, + + /** + * 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. + */ + add: function (x, y, key, animationName, loop) + { + var spineGO = new SpineGameObject(this.scene, this, x, y, key, animationName, loop); + + this.scene.sys.displayList.add(spineGO); + this.scene.sys.updateList.add(spineGO); + + return spineGO; + }, + + /** + * 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. + */ + 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 spineGO = new SpineGameObject(this.scene, this, 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(); + }, + + /** + * 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 Spine.Vector2(temp2.x, temp2.y); + } + else if (bone) + { + return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y); + } + else + { + return new Spine.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 Spine.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; + } + + var preMultipliedAlpha = atlasData.preMultipliedAlpha; + + var atlasLoader = new Spine.AtlasAttachmentLoader(atlas); + + var skeletonJson = new Spine.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 Spine.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 Spine.AnimationStateData(skeleton.data); + + var state = new Spine.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 Spine.Vector2(); + var size = new Spine.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.viewportWidth = viewportWidth; + sceneRenderer.camera.viewportHeight = 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); + + this.sceneRenderer.dispose(); + }, + + /** + * 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.pluginManager.removeGameObject('spine', true, true); + + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; + + this.cache = null; + this.spineTextures = null; + this.json = null; + this.textures = null; + this.sceneRenderer = null; + this.skeletonRenderer = null; + this.gl = null; + } + +}); + +module.exports = SpinePlugin; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(34); +var GetAdvancedValue = __webpack_require__(35); +var ScaleModes = __webpack_require__(143); + +/** + * 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); + } + + // ScaleMode + + gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT); + + // 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; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + DIFFERENCE: 11, + + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + * + * @name Phaser.BlendModes.EXCLUSION + * @type {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + LUMINOSITY: 16, + + /** + * Alpha erase blend mode. For Canvas and WebGL. + * + * @name Phaser.BlendModes.ERASE + * @type {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + LIGHTER: 25, + + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + * + * @name Phaser.BlendModes.COPY + * @type {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + XOR: 27 + +}; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH = __webpack_require__(36); +var GetValue = __webpack_require__(11); + +/** + * 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; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(1); +var Extend = __webpack_require__(14); + +/** + * @namespace Phaser.Math + */ + +var PhaserMath = { + + // Collections of functions + Angle: __webpack_require__(37), + Distance: __webpack_require__(44), + Easing: __webpack_require__(48), + Fuzzy: __webpack_require__(93), + Interpolation: __webpack_require__(99), + Pow2: __webpack_require__(107), + Snap: __webpack_require__(111), + + // Expose the RNG Class + RandomDataGenerator: __webpack_require__(115), + + // Single functions + Average: __webpack_require__(116), + Bernstein: __webpack_require__(19), + Between: __webpack_require__(117), + CatmullRom: __webpack_require__(21), + CeilTo: __webpack_require__(118), + Clamp: __webpack_require__(8), + DegToRad: __webpack_require__(25), + Difference: __webpack_require__(119), + Factorial: __webpack_require__(20), + FloatBetween: __webpack_require__(120), + FloorTo: __webpack_require__(121), + FromPercent: __webpack_require__(122), + GetSpeed: __webpack_require__(123), + IsEven: __webpack_require__(124), + IsEvenStrict: __webpack_require__(125), + Linear: __webpack_require__(22), + MaxAdd: __webpack_require__(126), + MinSub: __webpack_require__(127), + Percent: __webpack_require__(128), + RadToDeg: __webpack_require__(9), + RandomXY: __webpack_require__(129), + RandomXYZ: __webpack_require__(130), + RandomXYZW: __webpack_require__(131), + Rotate: __webpack_require__(132), + RotateAround: __webpack_require__(133), + RotateAroundDistance: __webpack_require__(134), + RoundAwayFromZero: __webpack_require__(135), + RoundTo: __webpack_require__(136), + SinCosTableGenerator: __webpack_require__(137), + SmootherStep: __webpack_require__(24), + SmoothStep: __webpack_require__(23), + ToXY: __webpack_require__(138), + TransformXY: __webpack_require__(139), + Within: __webpack_require__(140), + Wrap: __webpack_require__(4), + + // Vector classes + Vector2: __webpack_require__(5), + Vector3: __webpack_require__(10), + Vector4: __webpack_require__(141), + Matrix3: __webpack_require__(26), + Matrix4: __webpack_require__(27), + Quaternion: __webpack_require__(28), + RotateVec3: __webpack_require__(142) + +}; + +// Merge in the consts + +PhaserMath = Extend(false, PhaserMath, CONST); + +// Export it + +module.exports = PhaserMath; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Angle + */ + +module.exports = { + + Between: __webpack_require__(15), + BetweenPoints: __webpack_require__(38), + BetweenPointsY: __webpack_require__(39), + BetweenY: __webpack_require__(40), + CounterClockwise: __webpack_require__(7), + Normalize: __webpack_require__(16), + Reverse: __webpack_require__(41), + RotateTo: __webpack_require__(42), + ShortestBetween: __webpack_require__(43), + Wrap: __webpack_require__(17), + WrapDegrees: __webpack_require__(18) + +}; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} 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; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} 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; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Normalize = __webpack_require__(16); + +/** + * 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; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(1); + +/** + * 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; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. + * + * TODO: Wrap the angles in this function? + * + * @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; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Distance + */ + +module.exports = { + + Between: __webpack_require__(45), + Power: __webpack_require__(46), + Squared: __webpack_require__(47) + +}; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing + */ + +module.exports = { + + Back: __webpack_require__(49), + Bounce: __webpack_require__(53), + Circular: __webpack_require__(57), + Cubic: __webpack_require__(61), + Elastic: __webpack_require__(65), + Expo: __webpack_require__(69), + Linear: __webpack_require__(73), + Quadratic: __webpack_require__(75), + Quartic: __webpack_require__(79), + Quintic: __webpack_require__(83), + Sine: __webpack_require__(87), + Stepped: __webpack_require__(91) + +}; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Back + */ + +module.exports = { + + In: __webpack_require__(50), + Out: __webpack_require__(51), + InOut: __webpack_require__(52) + +}; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(54), + Out: __webpack_require__(55), + InOut: __webpack_require__(56) + +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 56 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(58), + Out: __webpack_require__(59), + InOut: __webpack_require__(60) + +}; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 60 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(62), + Out: __webpack_require__(63), + InOut: __webpack_require__(64) + +}; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 64 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(66), + Out: __webpack_require__(67), + InOut: __webpack_require__(68) + +}; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 67 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(70), + Out: __webpack_require__(71), + InOut: __webpack_require__(72) + +}; + + +/***/ }), +/* 70 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 71 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Linear + */ + +module.exports = __webpack_require__(74); + + +/***/ }), +/* 74 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Linear easing (no variation). + * + * @function Phaser.Math.Easing.Linear.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; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(76), + Out: __webpack_require__(77), + InOut: __webpack_require__(78) + +}; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 77 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(80), + Out: __webpack_require__(81), + InOut: __webpack_require__(82) + +}; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(84), + Out: __webpack_require__(85), + InOut: __webpack_require__(86) + +}; + + +/***/ }), +/* 84 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 86 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(88), + Out: __webpack_require__(89), + InOut: __webpack_require__(90) + +}; + + +/***/ }), +/* 88 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(92); + + +/***/ }), +/* 92 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Stepped easing. + * + * @function Phaser.Math.Easing.Stepped.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; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Fuzzy + */ + +module.exports = { + + Ceil: __webpack_require__(94), + Equal: __webpack_require__(95), + Floor: __webpack_require__(96), + GreaterThan: __webpack_require__(97), + LessThan: __webpack_require__(98) + +}; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 95 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 96 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Interpolation + */ + +module.exports = { + + Bezier: __webpack_require__(100), + CatmullRom: __webpack_require__(101), + CubicBezier: __webpack_require__(102), + Linear: __webpack_require__(103), + QuadraticBezier: __webpack_require__(104), + SmoothStep: __webpack_require__(105), + SmootherStep: __webpack_require__(106) + +}; + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bernstein = __webpack_require__(19); + +/** + * 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; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CatmullRom = __webpack_require__(21); + +/** + * 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; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Linear = __webpack_require__(22); + +/** + * 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; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmoothStep = __webpack_require__(23); + +/** + * 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; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmootherStep = __webpack_require__(24); + +/** + * 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; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Pow2 + */ + +module.exports = { + + GetNext: __webpack_require__(108), + IsSize: __webpack_require__(109), + IsValue: __webpack_require__(110) + +}; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.GetPowerOfTwo + * @since 3.0.0 + * + * @param {number} value - The value. + * + * @return {integer} 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; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsSizePowerOfTwo + * @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; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsValuePowerOfTwo + * @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; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Snap + */ + +module.exports = { + + Ceil: __webpack_require__(112), + Floor: __webpack_require__(113), + To: __webpack_require__(114) + +}; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} [array] - The array to be shuffled. + * + * @return {array} 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; + + +/***/ }), +/* 116 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 117 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} min - The minimum value. + * @param {integer} max - The maximum value. + * + * @return {integer} The random integer. + */ +var Between = function (min, max) +{ + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +module.exports = Between; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [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; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. + * @param {integer} [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; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(8); + +/** + * 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; +}; + +module.exports = FromPercent; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the speed required to cover a distance in the time given. + * + * @function Phaser.Math.GetSpeed + * @since 3.0.0 + * + * @param {number} distance - The distance to travel in pixels. + * @param {integer} time - The time, in ms, to cover the distance in. + * + * @return {number} The amount you will need to increment the position by each step in order to cover the distance in the time given. + */ +var GetSpeed = function (distance, time) +{ + return (distance / time) / 1000; +}; + +module.exports = GetSpeed; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 128 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 130 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 131 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; } + + // TODO: Not spherical; should fix this for more uniform distribution + 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; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 133 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` by the given `angle`. + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @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.Geom.Point} The given point, rotated by the given angle around the given coordinates. + */ +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; + + +/***/ }), +/* 134 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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`. + * + * @function Phaser.Math.RotateAroundDistance + * @since 3.0.0 + * + * @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.Geom.Point} 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; + + +/***/ }), +/* 135 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {integer} [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; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(5); + +/** + * Returns a Vec2 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 Vec2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {integer} index - The position within the grid to get the x/y value for. + * @param {integer} width - The width of the grid. + * @param {integer} 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; + } + + out.set(x, y); + } + + return out; +}; + +module.exports = ToXY; + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(5); + +/** + * 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; + + +/***/ }), +/* 140 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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) + { + // TODO: is this really the same as Vector3? + // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/ + // 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; + }, + + /** + * 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; + } + +}); + +// TODO: Check if these are required internally, if not, remove. +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; + + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector3 = __webpack_require__(10); +var Matrix4 = __webpack_require__(27); +var Quaternion = __webpack_require__(28); + +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; + + +/***/ }), +/* 143 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @readonly + * @since 3.0.0 + */ + DEFAULT: 0, + + /** + * Linear Scale Mode. + * + * @name Phaser.ScaleModes.LINEAR + * @type {integer} + * @readonly + * @since 3.0.0 + */ + LINEAR: 0, + + /** + * Nearest Scale Mode. + * + * @name Phaser.ScaleModes.NEAREST + * @type {integer} + * @readonly + * @since 3.0.0 + */ + NEAREST: 1 + +}; + +module.exports = ScaleModes; + + +/***/ }), +/* 144 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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 multiplied by resolution. + * @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} resolution - The current resolution. Defaults to 1 at the moment. + * @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'; + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var BasePlugin = __webpack_require__(146); +var Class = __webpack_require__(0); +var SceneEvents = __webpack_require__(147); + +/** + * @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. + */ +var ScenePlugin = new Class({ + + Extends: BasePlugin, + + initialize: + + function ScenePlugin (scene, pluginManager) + { + BasePlugin.call(this, pluginManager); + + this.scene = scene; + this.systems = scene.sys; + + 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 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 () + { + } + +}); + +module.exports = ScenePlugin; + + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 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; + + /** + * 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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#scene + * @type {?Phaser.Scene} + * @protected + * @since 3.8.0 + */ + this.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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#systems + * @type {?Phaser.Scenes.Systems} + * @protected + * @since 3.8.0 + */ + this.systems; + }, + + /** + * Called by the PluginManager when this 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. + * + * @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 () + { + }, + + /** + * Called by the PluginManager when this plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + * + * @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); + }, + + /** + * Called by the PluginManager when this 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. + * + * @method Phaser.Plugins.BasePlugin#stop + * @since 3.8.0 + */ + stop: function () + { + }, + + /** + * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots. + * By this point the plugin properties `scene` and `systems` will have already been set. + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + * + * @method Phaser.Plugins.BasePlugin#boot + * @since 3.8.0 + */ + boot: function () + { + // Here are the Scene events you can listen to. + // At the very least you should offer a destroy handler for when the Scene closes down. + + // var eventEmitter = this.systems.events; + + // eventEmitter.once('destroy', this.sceneDestroy, this); + // eventEmitter.on('start', this.sceneStart, this); + // eventEmitter.on('preupdate', this.scenePreUpdate, this); + // eventEmitter.on('update', this.sceneUpdate, this); + // eventEmitter.on('postupdate', this.scenePostUpdate, this); + // eventEmitter.on('pause', this.scenePause, this); + // eventEmitter.on('resume', this.sceneResume, this); + // eventEmitter.on('sleep', this.sceneSleep, this); + // eventEmitter.on('wake', this.sceneWake, this); + // eventEmitter.on('shutdown', this.sceneShutdown, this); + // eventEmitter.on('destroy', this.sceneDestroy, this); + }, + + /** + * 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; + + +/***/ }), +/* 147 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Scenes.Events + */ + +module.exports = { + + BOOT: __webpack_require__(148), + CREATE: __webpack_require__(149), + DESTROY: __webpack_require__(150), + PAUSE: __webpack_require__(151), + POST_UPDATE: __webpack_require__(152), + PRE_UPDATE: __webpack_require__(153), + READY: __webpack_require__(154), + RENDER: __webpack_require__(155), + RESUME: __webpack_require__(156), + SHUTDOWN: __webpack_require__(157), + SLEEP: __webpack_require__(158), + START: __webpack_require__(159), + TRANSITION_COMPLETE: __webpack_require__(160), + TRANSITION_INIT: __webpack_require__(161), + TRANSITION_OUT: __webpack_require__(162), + TRANSITION_START: __webpack_require__(163), + TRANSITION_WAKE: __webpack_require__(164), + UPDATE: __webpack_require__(165), + WAKE: __webpack_require__(166) + +}; + + +/***/ }), +/* 148 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('boot', listener)`. + * + * @event Phaser.Scenes.Events#BOOT + * @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'; + + +/***/ }), +/* 149 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('create', listener)`. + * + * @event Phaser.Scenes.Events#CREATE + * @since 3.17.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. + */ +module.exports = 'create'; + + +/***/ }), +/* 150 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 151 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('pause', listener)`. + * + * @event Phaser.Scenes.Events#PAUSE + * @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'; + + +/***/ }), +/* 152 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#POST_UPDATE + * @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'; + + +/***/ }), +/* 153 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#PRE_UPDATE + * @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'; + + +/***/ }), +/* 154 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('ready', listener)`. + * + * @event Phaser.Scenes.Events#READY + * @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'; + + +/***/ }), +/* 155 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('render', listener)`. + * + * A Scene will only render if it is visible and active. + * By the time this event is dispatched, the Scene will have already been rendered. + * + * @event Phaser.Scenes.Events#RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'render'; + + +/***/ }), +/* 156 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('resume', listener)`. + * + * @event Phaser.Scenes.Events#RESUME + * @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'; + + +/***/ }), +/* 157 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 158 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('sleep', listener)`. + * + * @event Phaser.Scenes.Events#SLEEP + * @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'; + + +/***/ }), +/* 159 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('start', listener)`. + * + * @event Phaser.Scenes.Events#START + * @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'; + + +/***/ }), +/* 160 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @since 3.5.0 + * + * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. + */ +module.exports = 'transitioncomplete'; + + +/***/ }), +/* 161 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 162 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 163 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 164 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), +/* 165 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#UPDATE + * @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'; + + +/***/ }), +/* 166 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('wake', listener)`. + * + * @event Phaser.Scenes.Events#WAKE + * @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'; + + +/***/ }), +/* 167 */ +/***/ (function(module, exports) { + +/*** IMPORTS FROM imports-loader ***/ +(function() { + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var spine; +(function (spine) { + var Animation = (function () { + function Animation(name, timelines, duration) { + if (name == null) + throw new Error("name cannot be null."); + if (timelines == null) + throw new Error("timelines cannot be null."); + this.name = name; + this.timelines = timelines; + this.duration = duration; + } + Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (loop && this.duration != 0) { + time %= this.duration; + if (lastTime > 0) + lastTime %= this.duration; + } + var timelines = this.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction); + }; + Animation.binarySearch = function (values, target, step) { + if (step === void 0) { step = 1; } + var low = 0; + var high = values.length / step - 2; + if (high == 0) + return step; + var current = high >>> 1; + while (true) { + if (values[(current + 1) * step] <= target) + low = current + 1; + else + high = current; + if (low == high) + return (low + 1) * step; + current = (low + high) >>> 1; + } + }; + Animation.linearSearch = function (values, target, step) { + for (var i = 0, last = values.length - step; i <= last; i += step) + if (values[i] > target) + return i; + return -1; + }; + return Animation; + }()); + spine.Animation = Animation; + var MixBlend; + (function (MixBlend) { + MixBlend[MixBlend["setup"] = 0] = "setup"; + MixBlend[MixBlend["first"] = 1] = "first"; + MixBlend[MixBlend["replace"] = 2] = "replace"; + MixBlend[MixBlend["add"] = 3] = "add"; + })(MixBlend = spine.MixBlend || (spine.MixBlend = {})); + var MixDirection; + (function (MixDirection) { + MixDirection[MixDirection["in"] = 0] = "in"; + MixDirection[MixDirection["out"] = 1] = "out"; + })(MixDirection = spine.MixDirection || (spine.MixDirection = {})); + var TimelineType; + (function (TimelineType) { + TimelineType[TimelineType["rotate"] = 0] = "rotate"; + TimelineType[TimelineType["translate"] = 1] = "translate"; + TimelineType[TimelineType["scale"] = 2] = "scale"; + TimelineType[TimelineType["shear"] = 3] = "shear"; + TimelineType[TimelineType["attachment"] = 4] = "attachment"; + TimelineType[TimelineType["color"] = 5] = "color"; + TimelineType[TimelineType["deform"] = 6] = "deform"; + TimelineType[TimelineType["event"] = 7] = "event"; + TimelineType[TimelineType["drawOrder"] = 8] = "drawOrder"; + TimelineType[TimelineType["ikConstraint"] = 9] = "ikConstraint"; + TimelineType[TimelineType["transformConstraint"] = 10] = "transformConstraint"; + TimelineType[TimelineType["pathConstraintPosition"] = 11] = "pathConstraintPosition"; + TimelineType[TimelineType["pathConstraintSpacing"] = 12] = "pathConstraintSpacing"; + TimelineType[TimelineType["pathConstraintMix"] = 13] = "pathConstraintMix"; + TimelineType[TimelineType["twoColor"] = 14] = "twoColor"; + })(TimelineType = spine.TimelineType || (spine.TimelineType = {})); + var CurveTimeline = (function () { + function CurveTimeline(frameCount) { + if (frameCount <= 0) + throw new Error("frameCount must be > 0: " + frameCount); + this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE); + } + CurveTimeline.prototype.getFrameCount = function () { + return this.curves.length / CurveTimeline.BEZIER_SIZE + 1; + }; + CurveTimeline.prototype.setLinear = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR; + }; + CurveTimeline.prototype.setStepped = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED; + }; + CurveTimeline.prototype.getCurveType = function (frameIndex) { + var index = frameIndex * CurveTimeline.BEZIER_SIZE; + if (index == this.curves.length) + return CurveTimeline.LINEAR; + var type = this.curves[index]; + if (type == CurveTimeline.LINEAR) + return CurveTimeline.LINEAR; + if (type == CurveTimeline.STEPPED) + return CurveTimeline.STEPPED; + return CurveTimeline.BEZIER; + }; + CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) { + var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03; + var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006; + var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy; + var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var curves = this.curves; + curves[i++] = CurveTimeline.BEZIER; + var x = dfx, y = dfy; + for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + curves[i] = x; + curves[i + 1] = y; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + x += dfx; + y += dfy; + } + }; + CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) { + percent = spine.MathUtils.clamp(percent, 0, 1); + var curves = this.curves; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var type = curves[i]; + if (type == CurveTimeline.LINEAR) + return percent; + if (type == CurveTimeline.STEPPED) + return 0; + i++; + var x = 0; + for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + x = curves[i]; + if (x >= percent) { + var prevX = void 0, prevY = void 0; + if (i == start) { + prevX = 0; + prevY = 0; + } + else { + prevX = curves[i - 2]; + prevY = curves[i - 1]; + } + return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); + } + } + var y = curves[i - 1]; + return y + (1 - y) * (percent - x) / (1 - x); + }; + CurveTimeline.LINEAR = 0; + CurveTimeline.STEPPED = 1; + CurveTimeline.BEZIER = 2; + CurveTimeline.BEZIER_SIZE = 10 * 2 - 1; + return CurveTimeline; + }()); + spine.CurveTimeline = CurveTimeline; + var RotateTimeline = (function (_super) { + __extends(RotateTimeline, _super); + function RotateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount << 1); + return _this; + } + RotateTimeline.prototype.getPropertyId = function () { + return (TimelineType.rotate << 24) + this.boneIndex; + }; + RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) { + frameIndex <<= 1; + this.frames[frameIndex] = time; + this.frames[frameIndex + RotateTimeline.ROTATION] = degrees; + }; + RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation; + return; + case MixBlend.first: + var r_1 = bone.data.rotation - bone.rotation; + bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha; + } + return; + } + if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { + var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION]; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + r_2 * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r_2 += bone.data.rotation - bone.rotation; + r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; + case MixBlend.add: + bone.rotation += r_2 * alpha; + } + return; + } + var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES); + var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime)); + var r = frames[frame + RotateTimeline.ROTATION] - prevRotation; + r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r += bone.data.rotation - bone.rotation; + case MixBlend.add: + bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + } + }; + RotateTimeline.ENTRIES = 2; + RotateTimeline.PREV_TIME = -2; + RotateTimeline.PREV_ROTATION = -1; + RotateTimeline.ROTATION = 1; + return RotateTimeline; + }(CurveTimeline)); + spine.RotateTimeline = RotateTimeline; + var TranslateTimeline = (function (_super) { + __extends(TranslateTimeline, _super); + function TranslateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES); + return _this; + } + TranslateTimeline.prototype.getPropertyId = function () { + return (TimelineType.translate << 24) + this.boneIndex; + }; + TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) { + frameIndex *= TranslateTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TranslateTimeline.X] = x; + this.frames[frameIndex + TranslateTimeline.Y] = y; + }; + TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x; + bone.y = bone.data.y; + return; + case MixBlend.first: + bone.x += (bone.data.x - bone.x) * alpha; + bone.y += (bone.data.y - bone.y) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { + x = frames[frames.length + TranslateTimeline.PREV_X]; + y = frames[frames.length + TranslateTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES); + x = frames[frame + TranslateTimeline.PREV_X]; + y = frames[frame + TranslateTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime)); + x += (frames[frame + TranslateTimeline.X] - x) * percent; + y += (frames[frame + TranslateTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x + x * alpha; + bone.y = bone.data.y + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.x += (bone.data.x + x - bone.x) * alpha; + bone.y += (bone.data.y + y - bone.y) * alpha; + break; + case MixBlend.add: + bone.x += x * alpha; + bone.y += y * alpha; + } + }; + TranslateTimeline.ENTRIES = 3; + TranslateTimeline.PREV_TIME = -3; + TranslateTimeline.PREV_X = -2; + TranslateTimeline.PREV_Y = -1; + TranslateTimeline.X = 1; + TranslateTimeline.Y = 2; + return TranslateTimeline; + }(CurveTimeline)); + spine.TranslateTimeline = TranslateTimeline; + var ScaleTimeline = (function (_super) { + __extends(ScaleTimeline, _super); + function ScaleTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ScaleTimeline.prototype.getPropertyId = function () { + return (TimelineType.scale << 24) + this.boneIndex; + }; + ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.scaleX = bone.data.scaleX; + bone.scaleY = bone.data.scaleY; + return; + case MixBlend.first: + bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha; + bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { + x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX; + y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY; + } + else { + var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES); + x = frames[frame + ScaleTimeline.PREV_X]; + y = frames[frame + ScaleTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime)); + x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX; + y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY; + } + if (alpha == 1) { + if (blend == MixBlend.add) { + bone.scaleX += x - bone.data.scaleX; + bone.scaleY += y - bone.data.scaleY; + } + else { + bone.scaleX = x; + bone.scaleY = y; + } + } + else { + var bx = 0, by = 0; + if (direction == MixDirection.out) { + switch (blend) { + case MixBlend.setup: + bx = bone.data.scaleX; + by = bone.data.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.add: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha; + } + } + else { + switch (blend) { + case MixBlend.setup: + bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.add: + bx = spine.MathUtils.signum(x); + by = spine.MathUtils.signum(y); + bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha; + bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha; + } + } + } + }; + return ScaleTimeline; + }(TranslateTimeline)); + spine.ScaleTimeline = ScaleTimeline; + var ShearTimeline = (function (_super) { + __extends(ShearTimeline, _super); + function ShearTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ShearTimeline.prototype.getPropertyId = function () { + return (TimelineType.shear << 24) + this.boneIndex; + }; + ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX; + bone.shearY = bone.data.shearY; + return; + case MixBlend.first: + bone.shearX += (bone.data.shearX - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY - bone.shearY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { + x = frames[frames.length + ShearTimeline.PREV_X]; + y = frames[frames.length + ShearTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES); + x = frames[frame + ShearTimeline.PREV_X]; + y = frames[frame + ShearTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime)); + x = x + (frames[frame + ShearTimeline.X] - x) * percent; + y = y + (frames[frame + ShearTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX + x * alpha; + bone.shearY = bone.data.shearY + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha; + break; + case MixBlend.add: + bone.shearX += x * alpha; + bone.shearY += y * alpha; + } + }; + return ShearTimeline; + }(TranslateTimeline)); + spine.ShearTimeline = ShearTimeline; + var ColorTimeline = (function (_super) { + __extends(ColorTimeline, _super); + function ColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES); + return _this; + } + ColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.color << 24) + this.slotIndex; + }; + ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) { + frameIndex *= ColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + ColorTimeline.R] = r; + this.frames[frameIndex + ColorTimeline.G] = g; + this.frames[frameIndex + ColorTimeline.B] = b; + this.frames[frameIndex + ColorTimeline.A] = a; + }; + ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + return; + case MixBlend.first: + var color = slot.color, setup = slot.data.color; + color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha); + } + return; + } + var r = 0, g = 0, b = 0, a = 0; + if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + ColorTimeline.PREV_R]; + g = frames[i + ColorTimeline.PREV_G]; + b = frames[i + ColorTimeline.PREV_B]; + a = frames[i + ColorTimeline.PREV_A]; + } + else { + var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES); + r = frames[frame + ColorTimeline.PREV_R]; + g = frames[frame + ColorTimeline.PREV_G]; + b = frames[frame + ColorTimeline.PREV_B]; + a = frames[frame + ColorTimeline.PREV_A]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + ColorTimeline.R] - r) * percent; + g += (frames[frame + ColorTimeline.G] - g) * percent; + b += (frames[frame + ColorTimeline.B] - b) * percent; + a += (frames[frame + ColorTimeline.A] - a) * percent; + } + if (alpha == 1) + slot.color.set(r, g, b, a); + else { + var color = slot.color; + if (blend == MixBlend.setup) + color.setFromColor(slot.data.color); + color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); + } + }; + ColorTimeline.ENTRIES = 5; + ColorTimeline.PREV_TIME = -5; + ColorTimeline.PREV_R = -4; + ColorTimeline.PREV_G = -3; + ColorTimeline.PREV_B = -2; + ColorTimeline.PREV_A = -1; + ColorTimeline.R = 1; + ColorTimeline.G = 2; + ColorTimeline.B = 3; + ColorTimeline.A = 4; + return ColorTimeline; + }(CurveTimeline)); + spine.ColorTimeline = ColorTimeline; + var TwoColorTimeline = (function (_super) { + __extends(TwoColorTimeline, _super); + function TwoColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES); + return _this; + } + TwoColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.twoColor << 24) + this.slotIndex; + }; + TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) { + frameIndex *= TwoColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TwoColorTimeline.R] = r; + this.frames[frameIndex + TwoColorTimeline.G] = g; + this.frames[frameIndex + TwoColorTimeline.B] = b; + this.frames[frameIndex + TwoColorTimeline.A] = a; + this.frames[frameIndex + TwoColorTimeline.R2] = r2; + this.frames[frameIndex + TwoColorTimeline.G2] = g2; + this.frames[frameIndex + TwoColorTimeline.B2] = b2; + }; + TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + slot.darkColor.setFromColor(slot.data.darkColor); + return; + case MixBlend.first: + var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor; + light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha); + dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0); + } + return; + } + var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; + if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + TwoColorTimeline.PREV_R]; + g = frames[i + TwoColorTimeline.PREV_G]; + b = frames[i + TwoColorTimeline.PREV_B]; + a = frames[i + TwoColorTimeline.PREV_A]; + r2 = frames[i + TwoColorTimeline.PREV_R2]; + g2 = frames[i + TwoColorTimeline.PREV_G2]; + b2 = frames[i + TwoColorTimeline.PREV_B2]; + } + else { + var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES); + r = frames[frame + TwoColorTimeline.PREV_R]; + g = frames[frame + TwoColorTimeline.PREV_G]; + b = frames[frame + TwoColorTimeline.PREV_B]; + a = frames[frame + TwoColorTimeline.PREV_A]; + r2 = frames[frame + TwoColorTimeline.PREV_R2]; + g2 = frames[frame + TwoColorTimeline.PREV_G2]; + b2 = frames[frame + TwoColorTimeline.PREV_B2]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + TwoColorTimeline.R] - r) * percent; + g += (frames[frame + TwoColorTimeline.G] - g) * percent; + b += (frames[frame + TwoColorTimeline.B] - b) * percent; + a += (frames[frame + TwoColorTimeline.A] - a) * percent; + r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent; + g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent; + b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent; + } + if (alpha == 1) { + slot.color.set(r, g, b, a); + slot.darkColor.set(r2, g2, b2, 1); + } + else { + var light = slot.color, dark = slot.darkColor; + if (blend == MixBlend.setup) { + light.setFromColor(slot.data.color); + dark.setFromColor(slot.data.darkColor); + } + light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); + dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0); + } + }; + TwoColorTimeline.ENTRIES = 8; + TwoColorTimeline.PREV_TIME = -8; + TwoColorTimeline.PREV_R = -7; + TwoColorTimeline.PREV_G = -6; + TwoColorTimeline.PREV_B = -5; + TwoColorTimeline.PREV_A = -4; + TwoColorTimeline.PREV_R2 = -3; + TwoColorTimeline.PREV_G2 = -2; + TwoColorTimeline.PREV_B2 = -1; + TwoColorTimeline.R = 1; + TwoColorTimeline.G = 2; + TwoColorTimeline.B = 3; + TwoColorTimeline.A = 4; + TwoColorTimeline.R2 = 5; + TwoColorTimeline.G2 = 6; + TwoColorTimeline.B2 = 7; + return TwoColorTimeline; + }(CurveTimeline)); + spine.TwoColorTimeline = TwoColorTimeline; + var AttachmentTimeline = (function () { + function AttachmentTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.attachmentNames = new Array(frameCount); + } + AttachmentTimeline.prototype.getPropertyId = function () { + return (TimelineType.attachment << 24) + this.slotIndex; + }; + AttachmentTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) { + this.frames[frameIndex] = time; + this.attachmentNames[frameIndex] = attachmentName; + }; + AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + if (direction == MixDirection.out && blend == MixBlend.setup) { + var attachmentName_1 = slot.data.attachmentName; + slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1)); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) { + var attachmentName_2 = slot.data.attachmentName; + slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2)); + } + return; + } + var frameIndex = 0; + if (time >= frames[frames.length - 1]) + frameIndex = frames.length - 1; + else + frameIndex = Animation.binarySearch(frames, time, 1) - 1; + var attachmentName = this.attachmentNames[frameIndex]; + skeleton.slots[this.slotIndex] + .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); + }; + return AttachmentTimeline; + }()); + spine.AttachmentTimeline = AttachmentTimeline; + var zeros = null; + var DeformTimeline = (function (_super) { + __extends(DeformTimeline, _super); + function DeformTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount); + _this.frameVertices = new Array(frameCount); + if (zeros == null) + zeros = spine.Utils.newFloatArray(64); + return _this; + } + DeformTimeline.prototype.getPropertyId = function () { + return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex; + }; + DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) { + this.frames[frameIndex] = time; + this.frameVertices[frameIndex] = vertices; + }; + DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var slotAttachment = slot.getAttachment(); + if (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment)) + return; + var verticesArray = slot.attachmentVertices; + if (verticesArray.length == 0) + blend = MixBlend.setup; + var frameVertices = this.frameVertices; + var vertexCount = frameVertices[0].length; + var frames = this.frames; + if (time < frames[0]) { + var vertexAttachment = slotAttachment; + switch (blend) { + case MixBlend.setup: + verticesArray.length = 0; + return; + case MixBlend.first: + if (alpha == 1) { + verticesArray.length = 0; + break; + } + var vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount); + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha; + } + else { + alpha = 1 - alpha; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] *= alpha; + } + } + return; + } + var vertices = spine.Utils.setArraySize(verticesArray, vertexCount); + if (time >= frames[frames.length - 1]) { + var lastVertices = frameVertices[frames.length - 1]; + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_1 = 0; i_1 < vertexCount; i_1++) { + vertices[i_1] += lastVertices[i_1] - setupVertices[i_1]; + } + } + else { + for (var i_2 = 0; i_2 < vertexCount; i_2++) + vertices[i_2] += lastVertices[i_2]; + } + } + else { + spine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount); + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_1 = slotAttachment; + if (vertexAttachment_1.bones == null) { + var setupVertices = vertexAttachment_1.vertices; + for (var i_3 = 0; i_3 < vertexCount; i_3++) { + var setup = setupVertices[i_3]; + vertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha; + } + } + else { + for (var i_4 = 0; i_4 < vertexCount; i_4++) + vertices[i_4] = lastVertices[i_4] * alpha; + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_5 = 0; i_5 < vertexCount; i_5++) + vertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_6 = 0; i_6 < vertexCount; i_6++) { + vertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha; + } + } + else { + for (var i_7 = 0; i_7 < vertexCount; i_7++) + vertices[i_7] += lastVertices[i_7] * alpha; + } + } + } + return; + } + var frame = Animation.binarySearch(frames, time); + var prevVertices = frameVertices[frame - 1]; + var nextVertices = frameVertices[frame]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime)); + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_8 = 0; i_8 < vertexCount; i_8++) { + var prev = prevVertices[i_8]; + vertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8]; + } + } + else { + for (var i_9 = 0; i_9 < vertexCount; i_9++) { + var prev = prevVertices[i_9]; + vertices[i_9] += prev + (nextVertices[i_9] - prev) * percent; + } + } + } + else { + for (var i_10 = 0; i_10 < vertexCount; i_10++) { + var prev = prevVertices[i_10]; + vertices[i_10] = prev + (nextVertices[i_10] - prev) * percent; + } + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_2 = slotAttachment; + if (vertexAttachment_2.bones == null) { + var setupVertices = vertexAttachment_2.vertices; + for (var i_11 = 0; i_11 < vertexCount; i_11++) { + var prev = prevVertices[i_11], setup = setupVertices[i_11]; + vertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha; + } + } + else { + for (var i_12 = 0; i_12 < vertexCount; i_12++) { + var prev = prevVertices[i_12]; + vertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha; + } + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_13 = 0; i_13 < vertexCount; i_13++) { + var prev = prevVertices[i_13]; + vertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha; + } + break; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_14 = 0; i_14 < vertexCount; i_14++) { + var prev = prevVertices[i_14]; + vertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha; + } + } + else { + for (var i_15 = 0; i_15 < vertexCount; i_15++) { + var prev = prevVertices[i_15]; + vertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha; + } + } + } + } + }; + return DeformTimeline; + }(CurveTimeline)); + spine.DeformTimeline = DeformTimeline; + var EventTimeline = (function () { + function EventTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.events = new Array(frameCount); + } + EventTimeline.prototype.getPropertyId = function () { + return TimelineType.event << 24; + }; + EventTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + EventTimeline.prototype.setFrame = function (frameIndex, event) { + this.frames[frameIndex] = event.time; + this.events[frameIndex] = event; + }; + EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + if (firedEvents == null) + return; + var frames = this.frames; + var frameCount = this.frames.length; + if (lastTime > time) { + this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction); + lastTime = -1; + } + else if (lastTime >= frames[frameCount - 1]) + return; + if (time < frames[0]) + return; + var frame = 0; + if (lastTime < frames[0]) + frame = 0; + else { + frame = Animation.binarySearch(frames, lastTime); + var frameTime = frames[frame]; + while (frame > 0) { + if (frames[frame - 1] != frameTime) + break; + frame--; + } + } + for (; frame < frameCount && time >= frames[frame]; frame++) + firedEvents.push(this.events[frame]); + }; + return EventTimeline; + }()); + spine.EventTimeline = EventTimeline; + var DrawOrderTimeline = (function () { + function DrawOrderTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.drawOrders = new Array(frameCount); + } + DrawOrderTimeline.prototype.getPropertyId = function () { + return TimelineType.drawOrder << 24; + }; + DrawOrderTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) { + this.frames[frameIndex] = time; + this.drawOrders[frameIndex] = drawOrder; + }; + DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var drawOrder = skeleton.drawOrder; + var slots = skeleton.slots; + if (direction == MixDirection.out && blend == MixBlend.setup) { + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frame = 0; + if (time >= frames[frames.length - 1]) + frame = frames.length - 1; + else + frame = Animation.binarySearch(frames, time) - 1; + var drawOrderToSetupIndex = this.drawOrders[frame]; + if (drawOrderToSetupIndex == null) + spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length); + else { + for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) + drawOrder[i] = slots[drawOrderToSetupIndex[i]]; + } + }; + return DrawOrderTimeline; + }()); + spine.DrawOrderTimeline = DrawOrderTimeline; + var IkConstraintTimeline = (function (_super) { + __extends(IkConstraintTimeline, _super); + function IkConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES); + return _this; + } + IkConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex; + }; + IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) { + frameIndex *= IkConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + IkConstraintTimeline.MIX] = mix; + this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection; + this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0; + this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0; + }; + IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.ikConstraints[this.ikConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + return; + case MixBlend.first: + constraint.mix += (constraint.data.mix - constraint.mix) * alpha; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + return; + } + if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + return; + } + var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES); + var mix = frames[frame + IkConstraintTimeline.PREV_MIX]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime)); + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + }; + IkConstraintTimeline.ENTRIES = 5; + IkConstraintTimeline.PREV_TIME = -5; + IkConstraintTimeline.PREV_MIX = -4; + IkConstraintTimeline.PREV_BEND_DIRECTION = -3; + IkConstraintTimeline.PREV_COMPRESS = -2; + IkConstraintTimeline.PREV_STRETCH = -1; + IkConstraintTimeline.MIX = 1; + IkConstraintTimeline.BEND_DIRECTION = 2; + IkConstraintTimeline.COMPRESS = 3; + IkConstraintTimeline.STRETCH = 4; + return IkConstraintTimeline; + }(CurveTimeline)); + spine.IkConstraintTimeline = IkConstraintTimeline; + var TransformConstraintTimeline = (function (_super) { + __extends(TransformConstraintTimeline, _super); + function TransformConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES); + return _this; + } + TransformConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex; + }; + TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) { + frameIndex *= TransformConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix; + this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix; + this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix; + }; + TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.transformConstraints[this.transformConstraintIndex]; + if (time < frames[0]) { + var data = constraint.data; + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + return; + case MixBlend.first: + constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha; + constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha; + constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha; + } + return; + } + var rotate = 0, translate = 0, scale = 0, shear = 0; + if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { + var i = frames.length; + rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[i + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[i + TransformConstraintTimeline.PREV_SHEAR]; + } + else { + var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES); + rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[frame + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent; + scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent; + shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent; + } + if (blend == MixBlend.setup) { + var data = constraint.data; + constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha; + constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha; + constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha; + constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + constraint.scaleMix += (scale - constraint.scaleMix) * alpha; + constraint.shearMix += (shear - constraint.shearMix) * alpha; + } + }; + TransformConstraintTimeline.ENTRIES = 5; + TransformConstraintTimeline.PREV_TIME = -5; + TransformConstraintTimeline.PREV_ROTATE = -4; + TransformConstraintTimeline.PREV_TRANSLATE = -3; + TransformConstraintTimeline.PREV_SCALE = -2; + TransformConstraintTimeline.PREV_SHEAR = -1; + TransformConstraintTimeline.ROTATE = 1; + TransformConstraintTimeline.TRANSLATE = 2; + TransformConstraintTimeline.SCALE = 3; + TransformConstraintTimeline.SHEAR = 4; + return TransformConstraintTimeline; + }(CurveTimeline)); + spine.TransformConstraintTimeline = TransformConstraintTimeline; + var PathConstraintPositionTimeline = (function (_super) { + __extends(PathConstraintPositionTimeline, _super); + function PathConstraintPositionTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES); + return _this; + } + PathConstraintPositionTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex; + }; + PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) { + frameIndex *= PathConstraintPositionTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value; + }; + PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.position = constraint.data.position; + return; + case MixBlend.first: + constraint.position += (constraint.data.position - constraint.position) * alpha; + } + return; + } + var position = 0; + if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) + position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES); + position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime)); + position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent; + } + if (blend == MixBlend.setup) + constraint.position = constraint.data.position + (position - constraint.data.position) * alpha; + else + constraint.position += (position - constraint.position) * alpha; + }; + PathConstraintPositionTimeline.ENTRIES = 2; + PathConstraintPositionTimeline.PREV_TIME = -2; + PathConstraintPositionTimeline.PREV_VALUE = -1; + PathConstraintPositionTimeline.VALUE = 1; + return PathConstraintPositionTimeline; + }(CurveTimeline)); + spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline; + var PathConstraintSpacingTimeline = (function (_super) { + __extends(PathConstraintSpacingTimeline, _super); + function PathConstraintSpacingTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + PathConstraintSpacingTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex; + }; + PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.spacing = constraint.data.spacing; + return; + case MixBlend.first: + constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha; + } + return; + } + var spacing = 0; + if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) + spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES); + spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime)); + spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent; + } + if (blend == MixBlend.setup) + constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha; + else + constraint.spacing += (spacing - constraint.spacing) * alpha; + }; + return PathConstraintSpacingTimeline; + }(PathConstraintPositionTimeline)); + spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline; + var PathConstraintMixTimeline = (function (_super) { + __extends(PathConstraintMixTimeline, _super); + function PathConstraintMixTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES); + return _this; + } + PathConstraintMixTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex; + }; + PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) { + frameIndex *= PathConstraintMixTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix; + }; + PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = constraint.data.rotateMix; + constraint.translateMix = constraint.data.translateMix; + return; + case MixBlend.first: + constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha; + } + return; + } + var rotate = 0, translate = 0; + if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { + rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE]; + } + else { + var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES); + rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent; + } + if (blend == MixBlend.setup) { + constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha; + constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + } + }; + PathConstraintMixTimeline.ENTRIES = 3; + PathConstraintMixTimeline.PREV_TIME = -3; + PathConstraintMixTimeline.PREV_ROTATE = -2; + PathConstraintMixTimeline.PREV_TRANSLATE = -1; + PathConstraintMixTimeline.ROTATE = 1; + PathConstraintMixTimeline.TRANSLATE = 2; + return PathConstraintMixTimeline; + }(CurveTimeline)); + spine.PathConstraintMixTimeline = PathConstraintMixTimeline; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationState = (function () { + function AnimationState(data) { + this.tracks = new Array(); + this.events = new Array(); + this.listeners = new Array(); + this.queue = new EventQueue(this); + this.propertyIDs = new spine.IntSet(); + this.animationsChanged = false; + this.timeScale = 1; + this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); }); + this.data = data; + } + AnimationState.prototype.update = function (delta) { + delta *= this.timeScale; + var tracks = this.tracks; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null) + continue; + current.animationLast = current.nextAnimationLast; + current.trackLast = current.nextTrackLast; + var currentDelta = delta * current.timeScale; + if (current.delay > 0) { + current.delay -= currentDelta; + if (current.delay > 0) + continue; + currentDelta = -current.delay; + current.delay = 0; + } + var next = current.next; + if (next != null) { + var nextTime = current.trackLast - next.delay; + if (nextTime >= 0) { + next.delay = 0; + next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; + current.trackTime += currentDelta; + this.setCurrent(i, next, true); + while (next.mixingFrom != null) { + next.mixTime += delta; + next = next.mixingFrom; + } + continue; + } + } + else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) { + tracks[i] = null; + this.queue.end(current); + this.disposeNext(current); + continue; + } + if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) { + var from = current.mixingFrom; + current.mixingFrom = null; + if (from != null) + from.mixingTo = null; + while (from != null) { + this.queue.end(from); + from = from.mixingFrom; + } + } + current.trackTime += currentDelta; + } + this.queue.drain(); + }; + AnimationState.prototype.updateMixingFrom = function (to, delta) { + var from = to.mixingFrom; + if (from == null) + return true; + var finished = this.updateMixingFrom(from, delta); + from.animationLast = from.nextAnimationLast; + from.trackLast = from.nextTrackLast; + if (to.mixTime > 0 && to.mixTime >= to.mixDuration) { + if (from.totalAlpha == 0 || to.mixDuration == 0) { + to.mixingFrom = from.mixingFrom; + if (from.mixingFrom != null) + from.mixingFrom.mixingTo = to; + to.interruptAlpha = from.interruptAlpha; + this.queue.end(from); + } + return finished; + } + from.trackTime += delta * from.timeScale; + to.mixTime += delta; + return false; + }; + AnimationState.prototype.apply = function (skeleton) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (this.animationsChanged) + this._animationsChanged(); + var events = this.events; + var tracks = this.tracks; + var applied = false; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null || current.delay > 0) + continue; + applied = true; + var blend = i == 0 ? spine.MixBlend.first : current.mixBlend; + var mix = current.alpha; + if (current.mixingFrom != null) + mix *= this.applyMixingFrom(current, skeleton, blend); + else if (current.trackTime >= current.trackEnd && current.next == null) + mix = 0; + var animationLast = current.animationLast, animationTime = current.getAnimationTime(); + var timelineCount = current.animation.timelines.length; + var timelines = current.animation.timelines; + if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) { + for (var ii = 0; ii < timelineCount; ii++) + timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]); + } + else { + var timelineMode = current.timelineMode; + var firstFrame = current.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = current.timelinesRotation; + for (var ii = 0; ii < timelineCount; ii++) { + var timeline = timelines[ii]; + var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup; + if (timeline instanceof spine.RotateTimeline) { + this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame); + } + else { + spine.Utils.webkit602BugfixHelper(mix, blend); + timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]); + } + } + } + this.queueEvents(current, animationTime); + events.length = 0; + current.nextAnimationLast = animationTime; + current.nextTrackLast = current.trackTime; + } + this.queue.drain(); + return applied; + }; + AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) { + var from = to.mixingFrom; + if (from.mixingFrom != null) + this.applyMixingFrom(from, skeleton, blend); + var mix = 0; + if (to.mixDuration == 0) { + mix = 1; + if (blend == spine.MixBlend.first) + blend = spine.MixBlend.setup; + } + else { + mix = to.mixTime / to.mixDuration; + if (mix > 1) + mix = 1; + if (blend != spine.MixBlend.first) + blend = from.mixBlend; + } + var events = mix < from.eventThreshold ? this.events : null; + var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold; + var animationLast = from.animationLast, animationTime = from.getAnimationTime(); + var timelineCount = from.animation.timelines.length; + var timelines = from.animation.timelines; + var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); + if (blend == spine.MixBlend.add) { + for (var i = 0; i < timelineCount; i++) + timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out); + } + else { + var timelineMode = from.timelineMode; + var timelineHoldMix = from.timelineHoldMix; + var firstFrame = from.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = from.timelinesRotation; + from.totalAlpha = 0; + for (var i = 0; i < timelineCount; i++) { + var timeline = timelines[i]; + var direction = spine.MixDirection.out; + var timelineBlend = void 0; + var alpha = 0; + switch (timelineMode[i]) { + case AnimationState.SUBSEQUENT: + if (!attachments && timeline instanceof spine.AttachmentTimeline) + continue; + if (!drawOrder && timeline instanceof spine.DrawOrderTimeline) + continue; + timelineBlend = blend; + alpha = alphaMix; + break; + case AnimationState.FIRST: + timelineBlend = spine.MixBlend.setup; + alpha = alphaMix; + break; + case AnimationState.HOLD: + timelineBlend = spine.MixBlend.setup; + alpha = alphaHold; + break; + default: + timelineBlend = spine.MixBlend.setup; + var holdMix = timelineHoldMix[i]; + alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); + break; + } + from.totalAlpha += alpha; + if (timeline instanceof spine.RotateTimeline) + this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame); + else { + spine.Utils.webkit602BugfixHelper(alpha, blend); + if (timelineBlend == spine.MixBlend.setup) { + if (timeline instanceof spine.AttachmentTimeline) { + if (attachments) + direction = spine.MixDirection.out; + } + else if (timeline instanceof spine.DrawOrderTimeline) { + if (drawOrder) + direction = spine.MixDirection.out; + } + } + timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction); + } + } + } + if (to.mixDuration > 0) + this.queueEvents(from, animationTime); + this.events.length = 0; + from.nextAnimationLast = animationTime; + from.nextTrackLast = from.trackTime; + return mix; + }; + AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { + if (firstFrame) + timelinesRotation[i] = 0; + if (alpha == 1) { + timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]); + return; + } + var rotateTimeline = timeline; + var frames = rotateTimeline.frames; + var bone = skeleton.bones[rotateTimeline.boneIndex]; + var r1 = 0, r2 = 0; + if (time < frames[0]) { + switch (blend) { + case spine.MixBlend.setup: + bone.rotation = bone.data.rotation; + default: + return; + case spine.MixBlend.first: + r1 = bone.rotation; + r2 = bone.data.rotation; + } + } + else { + r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation; + if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES]) + r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION]; + else { + var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES); + var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime)); + r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + r2 = prevRotation + r2 * percent + bone.data.rotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + } + } + var total = 0, diff = r2 - r1; + diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360; + if (diff == 0) { + total = timelinesRotation[i]; + } + else { + var lastTotal = 0, lastDiff = 0; + if (firstFrame) { + lastTotal = 0; + lastDiff = diff; + } + else { + lastTotal = timelinesRotation[i]; + lastDiff = timelinesRotation[i + 1]; + } + var current = diff > 0, dir = lastTotal >= 0; + if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) { + if (Math.abs(lastTotal) > 180) + lastTotal += 360 * spine.MathUtils.signum(lastTotal); + dir = current; + } + total = diff + lastTotal - lastTotal % 360; + if (dir != current) + total += 360 * spine.MathUtils.signum(lastTotal); + timelinesRotation[i] = total; + } + timelinesRotation[i + 1] = diff; + r1 += total * alpha; + bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360; + }; + AnimationState.prototype.queueEvents = function (entry, animationTime) { + var animationStart = entry.animationStart, animationEnd = entry.animationEnd; + var duration = animationEnd - animationStart; + var trackLastWrapped = entry.trackLast % duration; + var events = this.events; + var i = 0, n = events.length; + for (; i < n; i++) { + var event_1 = events[i]; + if (event_1.time < trackLastWrapped) + break; + if (event_1.time > animationEnd) + continue; + this.queue.event(entry, event_1); + } + var complete = false; + if (entry.loop) + complete = duration == 0 || trackLastWrapped > entry.trackTime % duration; + else + complete = animationTime >= animationEnd && entry.animationLast < animationEnd; + if (complete) + this.queue.complete(entry); + for (; i < n; i++) { + var event_2 = events[i]; + if (event_2.time < animationStart) + continue; + this.queue.event(entry, events[i]); + } + }; + AnimationState.prototype.clearTracks = function () { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) + this.clearTrack(i); + this.tracks.length = 0; + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.clearTrack = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return; + var current = this.tracks[trackIndex]; + if (current == null) + return; + this.queue.end(current); + this.disposeNext(current); + var entry = current; + while (true) { + var from = entry.mixingFrom; + if (from == null) + break; + this.queue.end(from); + entry.mixingFrom = null; + entry.mixingTo = null; + entry = from; + } + this.tracks[current.trackIndex] = null; + this.queue.drain(); + }; + AnimationState.prototype.setCurrent = function (index, current, interrupt) { + var from = this.expandToIndex(index); + this.tracks[index] = current; + if (from != null) { + if (interrupt) + this.queue.interrupt(from); + current.mixingFrom = from; + from.mixingTo = current; + current.mixTime = 0; + if (from.mixingFrom != null && from.mixDuration > 0) + current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); + from.timelinesRotation.length = 0; + } + this.queue.start(current); + }; + AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.setAnimationWith(trackIndex, animation, loop); + }; + AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) { + if (animation == null) + throw new Error("animation cannot be null."); + var interrupt = true; + var current = this.expandToIndex(trackIndex); + if (current != null) { + if (current.nextTrackLast == -1) { + this.tracks[trackIndex] = current.mixingFrom; + this.queue.interrupt(current); + this.queue.end(current); + this.disposeNext(current); + current = current.mixingFrom; + interrupt = false; + } + else + this.disposeNext(current); + } + var entry = this.trackEntry(trackIndex, animation, loop, current); + this.setCurrent(trackIndex, entry, interrupt); + this.queue.drain(); + return entry; + }; + AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.addAnimationWith(trackIndex, animation, loop, delay); + }; + AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) { + if (animation == null) + throw new Error("animation cannot be null."); + var last = this.expandToIndex(trackIndex); + if (last != null) { + while (last.next != null) + last = last.next; + } + var entry = this.trackEntry(trackIndex, animation, loop, last); + if (last == null) { + this.setCurrent(trackIndex, entry, true); + this.queue.drain(); + } + else { + last.next = entry; + if (delay <= 0) { + var duration = last.animationEnd - last.animationStart; + if (duration != 0) { + if (last.loop) + delay += duration * (1 + ((last.trackTime / duration) | 0)); + else + delay += Math.max(duration, last.trackTime); + delay -= this.data.getMix(last.animation, animation); + } + else + delay = last.trackTime; + } + } + entry.delay = delay; + return entry; + }; + AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) { + var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) { + if (delay <= 0) + delay -= mixDuration; + var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.setEmptyAnimations = function (mixDuration) { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) { + var current = this.tracks[i]; + if (current != null) + this.setEmptyAnimation(current.trackIndex, mixDuration); + } + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.expandToIndex = function (index) { + if (index < this.tracks.length) + return this.tracks[index]; + spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null); + this.tracks.length = index + 1; + return null; + }; + AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) { + var entry = this.trackEntryPool.obtain(); + entry.trackIndex = trackIndex; + entry.animation = animation; + entry.loop = loop; + entry.holdPrevious = false; + entry.eventThreshold = 0; + entry.attachmentThreshold = 0; + entry.drawOrderThreshold = 0; + entry.animationStart = 0; + entry.animationEnd = animation.duration; + entry.animationLast = -1; + entry.nextAnimationLast = -1; + entry.delay = 0; + entry.trackTime = 0; + entry.trackLast = -1; + entry.nextTrackLast = -1; + entry.trackEnd = Number.MAX_VALUE; + entry.timeScale = 1; + entry.alpha = 1; + entry.interruptAlpha = 1; + entry.mixTime = 0; + entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); + return entry; + }; + AnimationState.prototype.disposeNext = function (entry) { + var next = entry.next; + while (next != null) { + this.queue.dispose(next); + next = next.next; + } + entry.next = null; + }; + AnimationState.prototype._animationsChanged = function () { + this.animationsChanged = false; + this.propertyIDs.clear(); + for (var i = 0, n = this.tracks.length; i < n; i++) { + var entry = this.tracks[i]; + if (entry == null) + continue; + while (entry.mixingFrom != null) + entry = entry.mixingFrom; + do { + if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add) + this.setTimelineModes(entry); + entry = entry.mixingTo; + } while (entry != null); + } + }; + AnimationState.prototype.setTimelineModes = function (entry) { + var to = entry.mixingTo; + var timelines = entry.animation.timelines; + var timelinesCount = entry.animation.timelines.length; + var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount); + entry.timelineHoldMix.length = 0; + var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount); + var propertyIDs = this.propertyIDs; + if (to != null && to.holdPrevious) { + for (var i = 0; i < timelinesCount; i++) { + propertyIDs.add(timelines[i].getPropertyId()); + timelineMode[i] = AnimationState.HOLD; + } + return; + } + outer: for (var i = 0; i < timelinesCount; i++) { + var id = timelines[i].getPropertyId(); + if (!propertyIDs.add(id)) + timelineMode[i] = AnimationState.SUBSEQUENT; + else if (to == null || !this.hasTimeline(to, id)) + timelineMode[i] = AnimationState.FIRST; + else { + for (var next = to.mixingTo; next != null; next = next.mixingTo) { + if (this.hasTimeline(next, id)) + continue; + if (entry.mixDuration > 0) { + timelineMode[i] = AnimationState.HOLD_MIX; + timelineDipMix[i] = next; + continue outer; + } + break; + } + timelineMode[i] = AnimationState.HOLD; + } + } + }; + AnimationState.prototype.hasTimeline = function (entry, id) { + var timelines = entry.animation.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + if (timelines[i].getPropertyId() == id) + return true; + return false; + }; + AnimationState.prototype.getCurrent = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return null; + return this.tracks[trackIndex]; + }; + AnimationState.prototype.addListener = function (listener) { + if (listener == null) + throw new Error("listener cannot be null."); + this.listeners.push(listener); + }; + AnimationState.prototype.removeListener = function (listener) { + var index = this.listeners.indexOf(listener); + if (index >= 0) + this.listeners.splice(index, 1); + }; + AnimationState.prototype.clearListeners = function () { + this.listeners.length = 0; + }; + AnimationState.prototype.clearListenerNotifications = function () { + this.queue.clear(); + }; + AnimationState.emptyAnimation = new spine.Animation("", [], 0); + AnimationState.SUBSEQUENT = 0; + AnimationState.FIRST = 1; + AnimationState.HOLD = 2; + AnimationState.HOLD_MIX = 3; + return AnimationState; + }()); + spine.AnimationState = AnimationState; + var TrackEntry = (function () { + function TrackEntry() { + this.mixBlend = spine.MixBlend.replace; + this.timelineMode = new Array(); + this.timelineHoldMix = new Array(); + this.timelinesRotation = new Array(); + } + TrackEntry.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; + }; + TrackEntry.prototype.getAnimationTime = function () { + if (this.loop) { + var duration = this.animationEnd - this.animationStart; + if (duration == 0) + return this.animationStart; + return (this.trackTime % duration) + this.animationStart; + } + return Math.min(this.trackTime + this.animationStart, this.animationEnd); + }; + TrackEntry.prototype.setAnimationLast = function (animationLast) { + this.animationLast = animationLast; + this.nextAnimationLast = animationLast; + }; + TrackEntry.prototype.isComplete = function () { + return this.trackTime >= this.animationEnd - this.animationStart; + }; + TrackEntry.prototype.resetRotationDirections = function () { + this.timelinesRotation.length = 0; + }; + return TrackEntry; + }()); + spine.TrackEntry = TrackEntry; + var EventQueue = (function () { + function EventQueue(animState) { + this.objects = []; + this.drainDisabled = false; + this.animState = animState; + } + EventQueue.prototype.start = function (entry) { + this.objects.push(EventType.start); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.interrupt = function (entry) { + this.objects.push(EventType.interrupt); + this.objects.push(entry); + }; + EventQueue.prototype.end = function (entry) { + this.objects.push(EventType.end); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.dispose = function (entry) { + this.objects.push(EventType.dispose); + this.objects.push(entry); + }; + EventQueue.prototype.complete = function (entry) { + this.objects.push(EventType.complete); + this.objects.push(entry); + }; + EventQueue.prototype.event = function (entry, event) { + this.objects.push(EventType.event); + this.objects.push(entry); + this.objects.push(event); + }; + EventQueue.prototype.drain = function () { + if (this.drainDisabled) + return; + this.drainDisabled = true; + var objects = this.objects; + var listeners = this.animState.listeners; + for (var i = 0; i < objects.length; i += 2) { + var type = objects[i]; + var entry = objects[i + 1]; + switch (type) { + case EventType.start: + if (entry.listener != null && entry.listener.start) + entry.listener.start(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].start) + listeners[ii].start(entry); + break; + case EventType.interrupt: + if (entry.listener != null && entry.listener.interrupt) + entry.listener.interrupt(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].interrupt) + listeners[ii].interrupt(entry); + break; + case EventType.end: + if (entry.listener != null && entry.listener.end) + entry.listener.end(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].end) + listeners[ii].end(entry); + case EventType.dispose: + if (entry.listener != null && entry.listener.dispose) + entry.listener.dispose(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].dispose) + listeners[ii].dispose(entry); + this.animState.trackEntryPool.free(entry); + break; + case EventType.complete: + if (entry.listener != null && entry.listener.complete) + entry.listener.complete(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].complete) + listeners[ii].complete(entry); + break; + case EventType.event: + var event_3 = objects[i++ + 2]; + if (entry.listener != null && entry.listener.event) + entry.listener.event(entry, event_3); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].event) + listeners[ii].event(entry, event_3); + break; + } + } + this.clear(); + this.drainDisabled = false; + }; + EventQueue.prototype.clear = function () { + this.objects.length = 0; + }; + return EventQueue; + }()); + spine.EventQueue = EventQueue; + var EventType; + (function (EventType) { + EventType[EventType["start"] = 0] = "start"; + EventType[EventType["interrupt"] = 1] = "interrupt"; + EventType[EventType["end"] = 2] = "end"; + EventType[EventType["dispose"] = 3] = "dispose"; + EventType[EventType["complete"] = 4] = "complete"; + EventType[EventType["event"] = 5] = "event"; + })(EventType = spine.EventType || (spine.EventType = {})); + var AnimationStateAdapter2 = (function () { + function AnimationStateAdapter2() { + } + AnimationStateAdapter2.prototype.start = function (entry) { + }; + AnimationStateAdapter2.prototype.interrupt = function (entry) { + }; + AnimationStateAdapter2.prototype.end = function (entry) { + }; + AnimationStateAdapter2.prototype.dispose = function (entry) { + }; + AnimationStateAdapter2.prototype.complete = function (entry) { + }; + AnimationStateAdapter2.prototype.event = function (entry, event) { + }; + return AnimationStateAdapter2; + }()); + spine.AnimationStateAdapter2 = AnimationStateAdapter2; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationStateData = (function () { + function AnimationStateData(skeletonData) { + this.animationToMixTime = {}; + this.defaultMix = 0; + if (skeletonData == null) + throw new Error("skeletonData cannot be null."); + this.skeletonData = skeletonData; + } + AnimationStateData.prototype.setMix = function (fromName, toName, duration) { + var from = this.skeletonData.findAnimation(fromName); + if (from == null) + throw new Error("Animation not found: " + fromName); + var to = this.skeletonData.findAnimation(toName); + if (to == null) + throw new Error("Animation not found: " + toName); + this.setMixWith(from, to, duration); + }; + AnimationStateData.prototype.setMixWith = function (from, to, duration) { + if (from == null) + throw new Error("from cannot be null."); + if (to == null) + throw new Error("to cannot be null."); + var key = from.name + "." + to.name; + this.animationToMixTime[key] = duration; + }; + AnimationStateData.prototype.getMix = function (from, to) { + var key = from.name + "." + to.name; + var value = this.animationToMixTime[key]; + return value === undefined ? this.defaultMix : value; + }; + return AnimationStateData; + }()); + spine.AnimationStateData = AnimationStateData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AssetManager = (function () { + function AssetManager(textureLoader, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.assets = {}; + this.errors = {}; + this.toLoad = 0; + this.loaded = 0; + this.textureLoader = textureLoader; + this.pathPrefix = pathPrefix; + } + AssetManager.downloadText = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.onload = function () { + if (request.status == 200) { + success(request.responseText); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.downloadBinary = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.responseType = "arraybuffer"; + request.onload = function () { + if (request.status == 200) { + success(new Uint8Array(request.response)); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.prototype.loadText = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (data) { + _this.assets[path] = data; + if (success) + success(path, data); + _this.toLoad--; + _this.loaded++; + }, function (state, responseText) { + _this.errors[path] = "Couldn't load text " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load text " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.loadTexture = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = path; + }; + AssetManager.prototype.loadTextureData = function (path, data, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = data; + }; + AssetManager.prototype.loadTextureAtlas = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + var parent = path.lastIndexOf("/") >= 0 ? path.substring(0, path.lastIndexOf("/")) : ""; + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (atlasData) { + var pagesLoaded = { count: 0 }; + var atlasPages = new Array(); + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + atlasPages.push(parent + "/" + path); + var image = document.createElement("img"); + image.width = 16; + image.height = 16; + return new spine.FakeTexture(image); + }); + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + return; + } + var _loop_1 = function (atlasPage) { + var pageLoadError = false; + _this.loadTexture(atlasPage, function (imagePath, image) { + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + if (!pageLoadError) { + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + return _this.get(parent + "/" + path); + }); + _this.assets[path] = atlas; + if (success) + success(path, atlas); + _this.toLoad--; + _this.loaded++; + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + } + } + else { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + } + }, function (imagePath, errorMessage) { + pageLoadError = true; + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + }); + }; + for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) { + var atlasPage = atlasPages_1[_i]; + _loop_1(atlasPage); + } + }, function (state, responseText) { + _this.errors[path] = "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.get = function (path) { + path = this.pathPrefix + path; + return this.assets[path]; + }; + AssetManager.prototype.remove = function (path) { + path = this.pathPrefix + path; + var asset = this.assets[path]; + if (asset.dispose) + asset.dispose(); + this.assets[path] = null; + }; + AssetManager.prototype.removeAll = function () { + for (var key in this.assets) { + var asset = this.assets[key]; + if (asset.dispose) + asset.dispose(); + } + this.assets = {}; + }; + AssetManager.prototype.isLoadingComplete = function () { + return this.toLoad == 0; + }; + AssetManager.prototype.getToLoad = function () { + return this.toLoad; + }; + AssetManager.prototype.getLoaded = function () { + return this.loaded; + }; + AssetManager.prototype.dispose = function () { + this.removeAll(); + }; + AssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + AssetManager.prototype.getErrors = function () { + return this.errors; + }; + return AssetManager; + }()); + spine.AssetManager = AssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AtlasAttachmentLoader = (function () { + function AtlasAttachmentLoader(atlas) { + this.atlas = atlas; + } + AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.RegionAttachment(name); + attachment.setRegion(region); + return attachment; + }; + AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.MeshAttachment(name); + attachment.region = region; + return attachment; + }; + AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) { + return new spine.BoundingBoxAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) { + return new spine.PathAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) { + return new spine.PointAttachment(name); + }; + AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) { + return new spine.ClippingAttachment(name); + }; + return AtlasAttachmentLoader; + }()); + spine.AtlasAttachmentLoader = AtlasAttachmentLoader; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BlendMode; + (function (BlendMode) { + BlendMode[BlendMode["Normal"] = 0] = "Normal"; + BlendMode[BlendMode["Additive"] = 1] = "Additive"; + BlendMode[BlendMode["Multiply"] = 2] = "Multiply"; + BlendMode[BlendMode["Screen"] = 3] = "Screen"; + })(BlendMode = spine.BlendMode || (spine.BlendMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Bone = (function () { + function Bone(data, skeleton, parent) { + 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 = false; + this.a = 0; + this.b = 0; + this.worldX = 0; + this.c = 0; + this.d = 0; + this.worldY = 0; + this.sorted = false; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.skeleton = skeleton; + this.parent = parent; + this.setToSetupPose(); + } + Bone.prototype.update = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransform = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) { + this.ax = x; + this.ay = y; + this.arotation = rotation; + this.ascaleX = scaleX; + this.ascaleY = scaleY; + this.ashearX = shearX; + this.ashearY = shearY; + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + var skeleton = this.skeleton; + var rotationY = rotation + 90 + shearY; + var sx = skeleton.scaleX; + var sy = skeleton.scaleY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy; + this.worldX = x * sx + skeleton.x; + this.worldY = y * sy + skeleton.y; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + this.worldX = pa * x + pb * y + parent.worldX; + this.worldY = pc * x + pd * y + parent.worldY; + switch (this.data.transformMode) { + case spine.TransformMode.Normal: { + var rotationY = rotation + 90 + shearY; + var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(rotationY) * scaleY; + var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(rotationY) * scaleY; + this.a = pa * la + pb * lc; + this.b = pa * lb + pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + return; + } + case spine.TransformMode.OnlyTranslation: { + var rotationY = rotation + 90 + shearY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY; + break; + } + case spine.TransformMode.NoRotationOrReflection: { + var s = pa * pa + pc * pc; + var prx = 0; + if (s > 0.0001) { + s = Math.abs(pa * pd - pb * pc) / s; + pb = pc * s; + pd = pa * s; + prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg; + } + else { + pa = 0; + pc = 0; + prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg; + } + var rx = rotation + shearX - prx; + var ry = rotation + shearY - prx + 90; + var la = spine.MathUtils.cosDeg(rx) * scaleX; + var lb = spine.MathUtils.cosDeg(ry) * scaleY; + var lc = spine.MathUtils.sinDeg(rx) * scaleX; + var ld = spine.MathUtils.sinDeg(ry) * scaleY; + this.a = pa * la - pb * lc; + this.b = pa * lb - pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + break; + } + case spine.TransformMode.NoScale: + case spine.TransformMode.NoScaleOrReflection: { + var cos = spine.MathUtils.cosDeg(rotation); + var sin = spine.MathUtils.sinDeg(rotation); + var za = (pa * cos + pb * sin) / this.skeleton.scaleX; + var zc = (pc * cos + pd * sin) / this.skeleton.scaleY; + var s = Math.sqrt(za * za + zc * zc); + if (s > 0.00001) + s = 1 / s; + za *= s; + zc *= s; + s = Math.sqrt(za * za + zc * zc); + if (this.data.transformMode == spine.TransformMode.NoScale + && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) + s = -s; + var r = Math.PI / 2 + Math.atan2(zc, za); + var zb = Math.cos(r) * s; + var zd = Math.sin(r) * s; + var la = spine.MathUtils.cosDeg(shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY; + var lc = spine.MathUtils.sinDeg(shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY; + this.a = za * la + zb * lc; + this.b = za * lb + zb * ld; + this.c = zc * la + zd * lc; + this.d = zc * lb + zd * ld; + break; + } + } + this.a *= this.skeleton.scaleX; + this.b *= this.skeleton.scaleX; + this.c *= this.skeleton.scaleY; + this.d *= this.skeleton.scaleY; + }; + Bone.prototype.setToSetupPose = function () { + var data = this.data; + this.x = data.x; + this.y = data.y; + this.rotation = data.rotation; + this.scaleX = data.scaleX; + this.scaleY = data.scaleY; + this.shearX = data.shearX; + this.shearY = data.shearY; + }; + Bone.prototype.getWorldRotationX = function () { + return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldRotationY = function () { + return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldScaleX = function () { + return Math.sqrt(this.a * this.a + this.c * this.c); + }; + Bone.prototype.getWorldScaleY = function () { + return Math.sqrt(this.b * this.b + this.d * this.d); + }; + Bone.prototype.updateAppliedTransform = function () { + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + this.ax = this.worldX; + this.ay = this.worldY; + this.arotation = Math.atan2(this.c, this.a) * spine.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; + this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + var pid = 1 / (pa * pd - pb * pc); + var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; + this.ax = (dx * pd * pid - dy * pb * pid); + this.ay = (dy * pa * pid - dx * pc * pid); + var ia = pid * pd; + var id = pid * pa; + var ib = pid * pb; + var ic = pid * pc; + var ra = ia * this.a - ib * this.c; + var rb = ia * this.b - ib * this.d; + var rc = id * this.c - ic * this.a; + var rd = id * this.d - ic * this.b; + this.ashearX = 0; + this.ascaleX = Math.sqrt(ra * ra + rc * rc); + if (this.ascaleX > 0.0001) { + var det = ra * rd - rb * rc; + this.ascaleY = det / this.ascaleX; + this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg; + this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg; + } + else { + this.ascaleX = 0; + this.ascaleY = Math.sqrt(rb * rb + rd * rd); + this.ashearY = 0; + this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg; + } + }; + Bone.prototype.worldToLocal = function (world) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var invDet = 1 / (a * d - b * c); + var x = world.x - this.worldX, y = world.y - this.worldY; + world.x = (x * d * invDet - y * b * invDet); + world.y = (y * a * invDet - x * c * invDet); + return world; + }; + Bone.prototype.localToWorld = function (local) { + var x = local.x, y = local.y; + local.x = x * this.a + y * this.b + this.worldX; + local.y = x * this.c + y * this.d + this.worldY; + return local; + }; + Bone.prototype.worldToLocalRotation = function (worldRotation) { + var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation); + return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX; + }; + Bone.prototype.localToWorldRotation = function (localRotation) { + localRotation -= this.rotation - this.shearX; + var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation); + return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.rotateWorld = function (degrees) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees); + this.a = cos * a - sin * c; + this.b = cos * b - sin * d; + this.c = sin * a + cos * c; + this.d = sin * b + cos * d; + this.appliedValid = false; + }; + return Bone; + }()); + spine.Bone = Bone; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoneData = (function () { + function BoneData(index, name, parent) { + this.x = 0; + this.y = 0; + this.rotation = 0; + this.scaleX = 1; + this.scaleY = 1; + this.shearX = 0; + this.shearY = 0; + this.transformMode = TransformMode.Normal; + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + this.index = index; + this.name = name; + this.parent = parent; + } + return BoneData; + }()); + spine.BoneData = BoneData; + var TransformMode; + (function (TransformMode) { + TransformMode[TransformMode["Normal"] = 0] = "Normal"; + TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation"; + TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; + TransformMode[TransformMode["NoScale"] = 3] = "NoScale"; + TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; + })(TransformMode = spine.TransformMode || (spine.TransformMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Event = (function () { + function Event(time, data) { + if (data == null) + throw new Error("data cannot be null."); + this.time = time; + this.data = data; + } + return Event; + }()); + spine.Event = Event; +})(spine || (spine = {})); +var spine; +(function (spine) { + var EventData = (function () { + function EventData(name) { + this.name = name; + } + return EventData; + }()); + spine.EventData = EventData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraint = (function () { + function IkConstraint(data, skeleton) { + this.bendDirection = 0; + this.compress = false; + this.stretch = false; + this.mix = 1; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.mix = data.mix; + this.bendDirection = data.bendDirection; + this.compress = data.compress; + this.stretch = data.stretch; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + IkConstraint.prototype.getOrder = function () { + return this.data.order; + }; + IkConstraint.prototype.apply = function () { + this.update(); + }; + IkConstraint.prototype.update = function () { + var target = this.target; + var bones = this.bones; + switch (bones.length) { + case 1: + this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix); + break; + case 2: + this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix); + break; + } + }; + IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) { + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var p = bone.parent; + var id = 1 / (p.a * p.d - p.b * p.c); + var x = targetX - p.worldX, y = targetY - p.worldY; + var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay; + var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation; + if (bone.ascaleX < 0) + rotationIK += 180; + if (rotationIK > 180) + rotationIK -= 360; + else if (rotationIK < -180) + rotationIK += 360; + var sx = bone.ascaleX, sy = bone.ascaleY; + if (compress || stretch) { + var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty); + if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) { + var s = (dd / b - 1) * alpha + 1; + sx *= s; + if (uniform) + sy *= s; + } + } + bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY); + }; + IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) { + if (alpha == 0) { + child.updateWorldTransform(); + return; + } + if (!parent.appliedValid) + parent.updateAppliedTransform(); + if (!child.appliedValid) + child.updateAppliedTransform(); + var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX; + var os1 = 0, os2 = 0, s2 = 0; + if (psx < 0) { + psx = -psx; + os1 = 180; + s2 = -1; + } + else { + os1 = 0; + s2 = 1; + } + if (psy < 0) { + psy = -psy; + s2 = -s2; + } + if (csx < 0) { + csx = -csx; + os2 = 180; + } + else + os2 = 0; + var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; + var u = Math.abs(psx - psy) <= 0.0001; + if (!u) { + cy = 0; + cwx = a * cx + parent.worldX; + cwy = c * cx + parent.worldY; + } + else { + cy = child.ay; + cwx = a * cx + b * cy + parent.worldX; + cwy = c * cx + d * cy + parent.worldY; + } + var pp = parent.parent; + a = pp.a; + b = pp.b; + c = pp.c; + d = pp.d; + var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY; + var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty; + x = cwx - pp.worldX; + y = cwy - pp.worldY; + var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; + var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0; + outer: if (u) { + l2 *= psx; + var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); + if (cos < -1) + cos = -1; + else if (cos > 1) { + cos = 1; + if (stretch && l1 + l2 > 0.0001) + sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1; + } + a2 = Math.acos(cos) * bendDir; + a = l1 + l2 * cos; + b = l2 * Math.sin(a2); + a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b); + } + else { + a = psx * l2; + b = psy * l2; + var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); + c = bb * l1 * l1 + aa * dd - aa * bb; + var c1 = -2 * bb * l1, c2 = bb - aa; + d = c1 * c1 - 4 * c2 * c; + if (d >= 0) { + var q = Math.sqrt(d); + if (c1 < 0) + q = -q; + q = -(c1 + q) / 2; + var r0 = q / c2, r1 = c / q; + var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; + if (r * r <= dd) { + y = Math.sqrt(dd - r * r) * bendDir; + a1 = ta - Math.atan2(y, r); + a2 = Math.atan2(y / psy, (r - l1) / psx); + break outer; + } + } + var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; + var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; + c = -a * l1 / (aa - bb); + if (c >= -1 && c <= 1) { + c = Math.acos(c); + x = a * Math.cos(c) + l1; + y = b * Math.sin(c); + d = x * x + y * y; + if (d < minDist) { + minAngle = c; + minDist = d; + minX = x; + minY = y; + } + if (d > maxDist) { + maxAngle = c; + maxDist = d; + maxX = x; + maxY = y; + } + } + if (dd <= (minDist + maxDist) / 2) { + a1 = ta - Math.atan2(minY * bendDir, minX); + a2 = minAngle * bendDir; + } + else { + a1 = ta - Math.atan2(maxY * bendDir, maxX); + a2 = maxAngle * bendDir; + } + } + var os = Math.atan2(cy, cx) * s2; + var rotation = parent.arotation; + a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation; + if (a1 > 180) + a1 -= 360; + else if (a1 < -180) + a1 += 360; + parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0); + rotation = child.arotation; + a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; + if (a2 > 180) + a2 -= 360; + else if (a2 < -180) + a2 += 360; + child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); + }; + return IkConstraint; + }()); + spine.IkConstraint = IkConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraintData = (function () { + function IkConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.bendDirection = 1; + this.compress = false; + this.stretch = false; + this.uniform = false; + this.mix = 1; + this.name = name; + } + return IkConstraintData; + }()); + spine.IkConstraintData = IkConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraint = (function () { + function PathConstraint(data, skeleton) { + 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(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0, n = data.bones.length; i < n; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findSlot(data.target.name); + this.position = data.position; + this.spacing = data.spacing; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + } + PathConstraint.prototype.apply = function () { + this.update(); + }; + PathConstraint.prototype.update = function () { + var attachment = this.target.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + return; + var rotateMix = this.rotateMix, translateMix = this.translateMix; + var translate = translateMix > 0, rotate = rotateMix > 0; + if (!translate && !rotate) + return; + var data = this.data; + var percentSpacing = data.spacingMode == spine.SpacingMode.Percent; + var rotateMode = data.rotateMode; + var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale; + var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1; + var bones = this.bones; + var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null; + var spacing = this.spacing; + if (scale || !percentSpacing) { + if (scale) + lengths = spine.Utils.setArraySize(this.lengths, boneCount); + var lengthSpacing = data.spacingMode == spine.SpacingMode.Length; + for (var i = 0, n = spacesCount - 1; i < n;) { + var bone = bones[i]; + var setupLength = bone.data.length; + if (setupLength < PathConstraint.epsilon) { + if (scale) + lengths[i] = 0; + spaces[++i] = 0; + } + else if (percentSpacing) { + if (scale) { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_1 = Math.sqrt(x * x + y * y); + lengths[i] = length_1; + } + spaces[++i] = spacing; + } + else { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_2 = Math.sqrt(x * x + y * y); + if (scale) + lengths[i] = length_2; + spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength; + } + } + } + else { + for (var i = 1; i < spacesCount; i++) + spaces[i] = spacing; + } + var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing); + var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; + var tip = false; + if (offsetRotation == 0) + tip = rotateMode == spine.RotateMode.Chain; + else { + tip = false; + var p = this.target.bone; + offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + } + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.worldX += (boneX - bone.worldX) * translateMix; + bone.worldY += (boneY - bone.worldY) * translateMix; + var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; + if (scale) { + var length_3 = lengths[i]; + if (length_3 != 0) { + var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1; + bone.a *= s; + bone.c *= s; + } + } + boneX = x; + boneY = y; + if (rotate) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; + if (tangents) + r = positions[p - 1]; + else if (spaces[i + 1] == 0) + r = positions[p + 2]; + else + r = Math.atan2(dy, dx); + r -= Math.atan2(c, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_4 = bone.data.length; + boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix; + boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix; + } + else { + r += offsetRotation; + } + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + } + bone.appliedValid = false; + } + }; + PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) { + var target = this.target; + var position = this.position; + var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null; + var closed = path.closed; + var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE; + if (!path.constantSpeed) { + var lengths = path.lengths; + curveCount -= closed ? 1 : 2; + var pathLength_1 = lengths[curveCount]; + if (percentPosition) + position *= pathLength_1; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength_1; + } + world = spine.Utils.setArraySize(this.world, 8); + for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength_1; + if (p < 0) + p += pathLength_1; + curve = 0; + } + else if (p < 0) { + if (prevCurve != PathConstraint.BEFORE) { + prevCurve = PathConstraint.BEFORE; + path.computeWorldVertices(target, 2, 4, world, 0, 2); + } + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength_1) { + if (prevCurve != PathConstraint.AFTER) { + prevCurve = PathConstraint.AFTER; + path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2); + } + this.addAfterPosition(p - pathLength_1, world, 0, out, o); + continue; + } + for (;; curve++) { + var length_5 = lengths[curve]; + if (p > length_5) + continue; + if (curve == 0) + p /= length_5; + else { + var prev = lengths[curve - 1]; + p = (p - prev) / (length_5 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + if (closed && curve == curveCount) { + path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2); + path.computeWorldVertices(target, 0, 4, world, 4, 2); + } + else + path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2); + } + this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0)); + } + return out; + } + if (closed) { + verticesLength += 2; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2); + path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2); + world[verticesLength - 2] = world[0]; + world[verticesLength - 1] = world[1]; + } + else { + curveCount--; + verticesLength -= 4; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength, world, 0, 2); + } + var curves = spine.Utils.setArraySize(this.curves, curveCount); + var pathLength = 0; + var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = world[w]; + cy1 = world[w + 1]; + cx2 = world[w + 2]; + cy2 = world[w + 3]; + x2 = world[w + 4]; + y2 = world[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) + position *= pathLength; + else + position *= pathLength / path.lengths[curveCount - 1]; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength; + } + var segments = this.segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength) { + this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); + continue; + } + for (;; curve++) { + var length_6 = curves[curve]; + if (p > length_6) + continue; + if (curve == 0) + p /= length_6; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_6 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + var ii = curve * 6; + x1 = world[ii]; + y1 = world[ii + 1]; + cx1 = world[ii + 2]; + cy1 = world[ii + 3]; + cx2 = world[ii + 4]; + cy2 = world[ii + 5]; + x2 = world[ii + 6]; + y2 = world[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + p *= curveLength; + for (;; segment++) { + var length_7 = segments[segment]; + if (p > length_7) + continue; + if (segment == 0) + p /= length_7; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_7 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0)); + } + return out; + }; + PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) { + var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) { + var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { + if (p == 0 || isNaN(p)) { + out[o] = x1; + out[o + 1] = y1; + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + return; + } + var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; + var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; + var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; + out[o] = x; + out[o + 1] = y; + if (tangents) { + if (p < 0.001) + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + else + out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); + } + }; + PathConstraint.prototype.getOrder = function () { + return this.data.order; + }; + PathConstraint.NONE = -1; + PathConstraint.BEFORE = -2; + PathConstraint.AFTER = -3; + PathConstraint.epsilon = 0.00001; + return PathConstraint; + }()); + spine.PathConstraint = PathConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraintData = (function () { + function PathConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.name = name; + } + return PathConstraintData; + }()); + spine.PathConstraintData = PathConstraintData; + var PositionMode; + (function (PositionMode) { + PositionMode[PositionMode["Fixed"] = 0] = "Fixed"; + PositionMode[PositionMode["Percent"] = 1] = "Percent"; + })(PositionMode = spine.PositionMode || (spine.PositionMode = {})); + var SpacingMode; + (function (SpacingMode) { + SpacingMode[SpacingMode["Length"] = 0] = "Length"; + SpacingMode[SpacingMode["Fixed"] = 1] = "Fixed"; + SpacingMode[SpacingMode["Percent"] = 2] = "Percent"; + })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {})); + var RotateMode; + (function (RotateMode) { + RotateMode[RotateMode["Tangent"] = 0] = "Tangent"; + RotateMode[RotateMode["Chain"] = 1] = "Chain"; + RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale"; + })(RotateMode = spine.RotateMode || (spine.RotateMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Assets = (function () { + function Assets(clientId) { + this.toLoad = new Array(); + this.assets = {}; + this.clientId = clientId; + } + Assets.prototype.loaded = function () { + var i = 0; + for (var v in this.assets) + i++; + return i; + }; + return Assets; + }()); + var SharedAssetManager = (function () { + function SharedAssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.clientAssets = {}; + this.queuedAssets = {}; + this.rawAssets = {}; + this.errors = {}; + this.pathPrefix = pathPrefix; + } + SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) { + clientAssets = new Assets(clientId); + this.clientAssets[clientId] = clientAssets; + } + if (textureLoader !== null) + clientAssets.textureLoader = textureLoader; + clientAssets.toLoad.push(path); + if (this.queuedAssets[path] === path) { + return false; + } + else { + this.queuedAssets[path] = path; + return true; + } + }; + SharedAssetManager.prototype.loadText = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = request.responseText; + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadJson = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = JSON.parse(request.responseText); + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, textureLoader, path)) + return; + var img = new Image(); + img.src = path; + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + _this.rawAssets[path] = img; + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + }; + }; + SharedAssetManager.prototype.get = function (clientId, path) { + path = this.pathPrefix + path; + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + return clientAssets.assets[path]; + }; + SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { + for (var i = 0; i < clientAssets.toLoad.length; i++) { + var path = clientAssets.toLoad[i]; + var asset = clientAssets.assets[path]; + if (asset === null || asset === undefined) { + var rawAsset = this.rawAssets[path]; + if (rawAsset === null || rawAsset === undefined) + continue; + if (rawAsset instanceof HTMLImageElement) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } + } + } + }; + SharedAssetManager.prototype.isLoadingComplete = function (clientId) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + this.updateClientAssets(clientAssets); + return clientAssets.toLoad.length == clientAssets.loaded(); + }; + SharedAssetManager.prototype.dispose = function () { + }; + SharedAssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + SharedAssetManager.prototype.getErrors = function () { + return this.errors; + }; + return SharedAssetManager; + }()); + spine.SharedAssetManager = SharedAssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skeleton = (function () { + function Skeleton(data) { + this._updateCache = new Array(); + this.updateCacheReset = new Array(); + this.time = 0; + this.scaleX = 1; + this.scaleY = 1; + this.x = 0; + this.y = 0; + if (data == null) + throw new Error("data cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) { + var boneData = data.bones[i]; + var bone = void 0; + if (boneData.parent == null) + bone = new spine.Bone(boneData, this, null); + else { + var parent_1 = this.bones[boneData.parent.index]; + bone = new spine.Bone(boneData, this, parent_1); + parent_1.children.push(bone); + } + this.bones.push(bone); + } + this.slots = new Array(); + this.drawOrder = new Array(); + for (var i = 0; i < data.slots.length; i++) { + var slotData = data.slots[i]; + var bone = this.bones[slotData.boneData.index]; + var slot = new spine.Slot(slotData, bone); + this.slots.push(slot); + this.drawOrder.push(slot); + } + this.ikConstraints = new Array(); + for (var i = 0; i < data.ikConstraints.length; i++) { + var ikConstraintData = data.ikConstraints[i]; + this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this)); + } + this.transformConstraints = new Array(); + for (var i = 0; i < data.transformConstraints.length; i++) { + var transformConstraintData = data.transformConstraints[i]; + this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this)); + } + this.pathConstraints = new Array(); + for (var i = 0; i < data.pathConstraints.length; i++) { + var pathConstraintData = data.pathConstraints[i]; + this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this)); + } + this.color = new spine.Color(1, 1, 1, 1); + this.updateCache(); + } + Skeleton.prototype.updateCache = function () { + var updateCache = this._updateCache; + updateCache.length = 0; + this.updateCacheReset.length = 0; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].sorted = false; + var ikConstraints = this.ikConstraints; + var transformConstraints = this.transformConstraints; + var pathConstraints = this.pathConstraints; + var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length; + var constraintCount = ikCount + transformCount + pathCount; + outer: for (var i = 0; i < constraintCount; i++) { + for (var ii = 0; ii < ikCount; ii++) { + var constraint = ikConstraints[ii]; + if (constraint.data.order == i) { + this.sortIkConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < transformCount; ii++) { + var constraint = transformConstraints[ii]; + if (constraint.data.order == i) { + this.sortTransformConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < pathCount; ii++) { + var constraint = pathConstraints[ii]; + if (constraint.data.order == i) { + this.sortPathConstraint(constraint); + continue outer; + } + } + } + for (var i = 0, n = bones.length; i < n; i++) + this.sortBone(bones[i]); + }; + Skeleton.prototype.sortIkConstraint = function (constraint) { + var target = constraint.target; + this.sortBone(target); + var constrained = constraint.bones; + var parent = constrained[0]; + this.sortBone(parent); + if (constrained.length > 1) { + var child = constrained[constrained.length - 1]; + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + this._updateCache.push(constraint); + this.sortReset(parent.children); + constrained[constrained.length - 1].sorted = true; + }; + Skeleton.prototype.sortPathConstraint = function (constraint) { + var slot = constraint.target; + var slotIndex = slot.data.index; + var slotBone = slot.bone; + if (this.skin != null) + this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); + if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin) + this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); + for (var i = 0, n = this.data.skins.length; i < n; i++) + this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone); + var attachment = slot.getAttachment(); + if (attachment instanceof spine.PathAttachment) + this.sortPathConstraintAttachmentWith(attachment, slotBone); + var constrained = constraint.bones; + var boneCount = constrained.length; + for (var i = 0; i < boneCount; i++) + this.sortBone(constrained[i]); + this._updateCache.push(constraint); + for (var i = 0; i < boneCount; i++) + this.sortReset(constrained[i].children); + for (var i = 0; i < boneCount; i++) + constrained[i].sorted = true; + }; + Skeleton.prototype.sortTransformConstraint = function (constraint) { + this.sortBone(constraint.target); + var constrained = constraint.bones; + var boneCount = constrained.length; + if (constraint.data.local) { + for (var i = 0; i < boneCount; i++) { + var child = constrained[i]; + this.sortBone(child.parent); + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + } + else { + for (var i = 0; i < boneCount; i++) { + this.sortBone(constrained[i]); + } + } + this._updateCache.push(constraint); + for (var ii = 0; ii < boneCount; ii++) + this.sortReset(constrained[ii].children); + for (var ii = 0; ii < boneCount; ii++) + constrained[ii].sorted = true; + }; + Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) { + var attachments = skin.attachments[slotIndex]; + if (!attachments) + return; + for (var key in attachments) { + this.sortPathConstraintAttachmentWith(attachments[key], slotBone); + } + }; + Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) { + if (!(attachment instanceof spine.PathAttachment)) + return; + var pathBones = attachment.bones; + if (pathBones == null) + this.sortBone(slotBone); + else { + var bones = this.bones; + var i = 0; + while (i < pathBones.length) { + var boneCount = pathBones[i++]; + for (var n = i + boneCount; i < n; i++) { + var boneIndex = pathBones[i]; + this.sortBone(bones[boneIndex]); + } + } + } + }; + Skeleton.prototype.sortBone = function (bone) { + if (bone.sorted) + return; + var parent = bone.parent; + if (parent != null) + this.sortBone(parent); + bone.sorted = true; + this._updateCache.push(bone); + }; + Skeleton.prototype.sortReset = function (bones) { + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.sorted) + this.sortReset(bone.children); + bone.sorted = false; + } + }; + Skeleton.prototype.updateWorldTransform = function () { + var updateCacheReset = this.updateCacheReset; + for (var i = 0, n = updateCacheReset.length; i < n; i++) { + var bone = updateCacheReset[i]; + bone.ax = bone.x; + bone.ay = bone.y; + bone.arotation = bone.rotation; + bone.ascaleX = bone.scaleX; + bone.ascaleY = bone.scaleY; + bone.ashearX = bone.shearX; + bone.ashearY = bone.shearY; + bone.appliedValid = true; + } + var updateCache = this._updateCache; + for (var i = 0, n = updateCache.length; i < n; i++) + updateCache[i].update(); + }; + Skeleton.prototype.setToSetupPose = function () { + this.setBonesToSetupPose(); + this.setSlotsToSetupPose(); + }; + Skeleton.prototype.setBonesToSetupPose = function () { + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].setToSetupPose(); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + var data = constraint.data; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + } + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + var data = constraint.data; + constraint.position = data.position; + constraint.spacing = data.spacing; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + } + }; + Skeleton.prototype.setSlotsToSetupPose = function () { + var slots = this.slots; + spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); + for (var i = 0, n = slots.length; i < n; i++) + slots[i].setToSetupPose(); + }; + Skeleton.prototype.getRootBone = function () { + if (this.bones.length == 0) + return null; + return this.bones[0]; + }; + Skeleton.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.data.name == boneName) + return bone; + } + return null; + }; + Skeleton.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].data.name == boneName) + return i; + return -1; + }; + Skeleton.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) + return slot; + } + return null; + }; + Skeleton.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].data.name == slotName) + return i; + return -1; + }; + Skeleton.prototype.setSkinByName = function (skinName) { + var skin = this.data.findSkin(skinName); + if (skin == null) + throw new Error("Skin not found: " + skinName); + this.setSkin(skin); + }; + Skeleton.prototype.setSkin = function (newSkin) { + if (newSkin != null) { + if (this.skin != null) + newSkin.attachAll(this, this.skin); + else { + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var name_1 = slot.data.attachmentName; + if (name_1 != null) { + var attachment = newSkin.getAttachment(i, name_1); + if (attachment != null) + slot.setAttachment(attachment); + } + } + } + } + this.skin = newSkin; + }; + Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) { + return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName); + }; + Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) { + if (attachmentName == null) + throw new Error("attachmentName cannot be null."); + if (this.skin != null) { + var attachment = this.skin.getAttachment(slotIndex, attachmentName); + if (attachment != null) + return attachment; + } + if (this.data.defaultSkin != null) + return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); + return null; + }; + Skeleton.prototype.setAttachment = function (slotName, attachmentName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) { + var attachment = null; + if (attachmentName != null) { + attachment = this.getAttachment(i, attachmentName); + if (attachment == null) + throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName); + } + slot.setAttachment(attachment); + return; + } + } + throw new Error("Slot not found: " + slotName); + }; + Skeleton.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var ikConstraint = ikConstraints[i]; + if (ikConstraint.data.name == constraintName) + return ikConstraint; + } + return null; + }; + Skeleton.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.getBounds = function (offset, size, temp) { + if (temp === void 0) { temp = new Array(2); } + if (offset == null) + throw new Error("offset cannot be null."); + if (size == null) + throw new Error("size cannot be null."); + var drawOrder = this.drawOrder; + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var verticesLength = 0; + var vertices = null; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + verticesLength = 8; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + attachment.computeWorldVertices(slot.bone, vertices, 0, 2); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + verticesLength = mesh.worldVerticesLength; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2); + } + if (vertices != null) { + for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + } + offset.set(minX, minY); + size.set(maxX - minX, maxY - minY); + }; + Skeleton.prototype.update = function (delta) { + this.time += delta; + }; + return Skeleton; + }()); + spine.Skeleton = Skeleton; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonBounds = (function () { + function SkeletonBounds() { + this.minX = 0; + this.minY = 0; + this.maxX = 0; + this.maxY = 0; + this.boundingBoxes = new Array(); + this.polygons = new Array(); + this.polygonPool = new spine.Pool(function () { + return spine.Utils.newFloatArray(16); + }); + } + SkeletonBounds.prototype.update = function (skeleton, updateAabb) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + var boundingBoxes = this.boundingBoxes; + var polygons = this.polygons; + var polygonPool = this.polygonPool; + var slots = skeleton.slots; + var slotCount = slots.length; + boundingBoxes.length = 0; + polygonPool.freeAll(polygons); + polygons.length = 0; + for (var i = 0; i < slotCount; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.BoundingBoxAttachment) { + var boundingBox = attachment; + boundingBoxes.push(boundingBox); + var polygon = polygonPool.obtain(); + if (polygon.length != boundingBox.worldVerticesLength) { + polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength); + } + polygons.push(polygon); + boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2); + } + } + if (updateAabb) { + this.aabbCompute(); + } + else { + this.minX = Number.POSITIVE_INFINITY; + this.minY = Number.POSITIVE_INFINITY; + this.maxX = Number.NEGATIVE_INFINITY; + this.maxY = Number.NEGATIVE_INFINITY; + } + }; + SkeletonBounds.prototype.aabbCompute = function () { + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + var vertices = polygon; + for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) { + var x = vertices[ii]; + var y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + this.minX = minX; + this.minY = minY; + this.maxX = maxX; + this.maxY = maxY; + }; + SkeletonBounds.prototype.aabbContainsPoint = function (x, y) { + return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; + }; + SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) { + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) + return false; + var m = (y2 - y1) / (x2 - x1); + var y = m * (minX - x1) + y1; + if (y > minY && y < maxY) + return true; + y = m * (maxX - x1) + y1; + if (y > minY && y < maxY) + return true; + var x = (minY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + x = (maxY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + return false; + }; + SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) { + return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; + }; + SkeletonBounds.prototype.containsPoint = function (x, y) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.containsPointPolygon(polygons[i], x, y)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) { + var vertices = polygon; + var nn = polygon.length; + var prevIndex = nn - 2; + var inside = false; + for (var ii = 0; ii < nn; ii += 2) { + var vertexY = vertices[ii + 1]; + var prevY = vertices[prevIndex + 1]; + if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { + var vertexX = vertices[ii]; + if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) + inside = !inside; + } + prevIndex = ii; + } + return inside; + }; + SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) { + var vertices = polygon; + var nn = polygon.length; + var width12 = x1 - x2, height12 = y1 - y2; + var det1 = x1 * y2 - y1 * x2; + var x3 = vertices[nn - 2], y3 = vertices[nn - 1]; + for (var ii = 0; ii < nn; ii += 2) { + var x4 = vertices[ii], y4 = vertices[ii + 1]; + var det2 = x3 * y4 - y3 * x4; + var width34 = x3 - x4, height34 = y3 - y4; + var det3 = width12 * height34 - height12 * width34; + var x = (det1 * width34 - width12 * det2) / det3; + if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { + var y = (det1 * height34 - height12 * det2) / det3; + if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) + return true; + } + x3 = x4; + y3 = y4; + } + return false; + }; + SkeletonBounds.prototype.getPolygon = function (boundingBox) { + if (boundingBox == null) + throw new Error("boundingBox cannot be null."); + var index = this.boundingBoxes.indexOf(boundingBox); + return index == -1 ? null : this.polygons[index]; + }; + SkeletonBounds.prototype.getWidth = function () { + return this.maxX - this.minX; + }; + SkeletonBounds.prototype.getHeight = function () { + return this.maxY - this.minY; + }; + return SkeletonBounds; + }()); + spine.SkeletonBounds = SkeletonBounds; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonClipping = (function () { + function SkeletonClipping() { + this.triangulator = new spine.Triangulator(); + this.clippingPolygon = new Array(); + this.clipOutput = new Array(); + this.clippedVertices = new Array(); + this.clippedTriangles = new Array(); + this.scratch = new Array(); + } + SkeletonClipping.prototype.clipStart = function (slot, clip) { + if (this.clipAttachment != null) + return 0; + this.clipAttachment = clip; + var n = clip.worldVerticesLength; + var vertices = spine.Utils.setArraySize(this.clippingPolygon, n); + clip.computeWorldVertices(slot, 0, n, vertices, 0, 2); + var clippingPolygon = this.clippingPolygon; + SkeletonClipping.makeClockwise(clippingPolygon); + var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); + for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) { + var polygon = clippingPolygons[i]; + SkeletonClipping.makeClockwise(polygon); + polygon.push(polygon[0]); + polygon.push(polygon[1]); + } + return clippingPolygons.length; + }; + SkeletonClipping.prototype.clipEndWithSlot = function (slot) { + if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data) + this.clipEnd(); + }; + SkeletonClipping.prototype.clipEnd = function () { + if (this.clipAttachment == null) + return; + this.clipAttachment = null; + this.clippingPolygons = null; + this.clippedVertices.length = 0; + this.clippedTriangles.length = 0; + this.clippingPolygon.length = 0; + }; + SkeletonClipping.prototype.isClipping = function () { + return this.clipAttachment != null; + }; + SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) { + var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; + var clippedTriangles = this.clippedTriangles; + var polygons = this.clippingPolygons; + var polygonsCount = this.clippingPolygons.length; + var vertexSize = twoColor ? 12 : 8; + var index = 0; + clippedVertices.length = 0; + clippedTriangles.length = 0; + outer: for (var i = 0; i < trianglesLength; i += 3) { + var vertexOffset = triangles[i] << 1; + var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; + var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 1] << 1; + var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; + var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 2] << 1; + var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; + var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; + for (var p = 0; p < polygonsCount; p++) { + var s = clippedVertices.length; + if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { + var clipOutputLength = clipOutput.length; + if (clipOutputLength == 0) + continue; + var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; + var d = 1 / (d0 * d2 + d1 * (y1 - y3)); + var clipOutputCount = clipOutputLength >> 1; + var clipOutputItems = this.clipOutput; + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize); + for (var ii = 0; ii < clipOutputLength; ii += 2) { + var x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; + clippedVerticesItems[s] = x; + clippedVerticesItems[s + 1] = y; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + var c0 = x - x3, c1 = y - y3; + var a = (d0 * c0 + d1 * c1) * d; + var b = (d4 * c0 + d2 * c1) * d; + var c = 1 - a - b; + clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c; + clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c; + if (twoColor) { + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + } + s += vertexSize; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); + clipOutputCount--; + for (var ii = 1; ii < clipOutputCount; ii++) { + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + ii); + clippedTrianglesItems[s + 2] = (index + ii + 1); + s += 3; + } + index += clipOutputCount + 1; + } + else { + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize); + clippedVerticesItems[s] = x1; + clippedVerticesItems[s + 1] = y1; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + if (!twoColor) { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = x2; + clippedVerticesItems[s + 9] = y2; + clippedVerticesItems[s + 10] = light.r; + clippedVerticesItems[s + 11] = light.g; + clippedVerticesItems[s + 12] = light.b; + clippedVerticesItems[s + 13] = light.a; + clippedVerticesItems[s + 14] = u2; + clippedVerticesItems[s + 15] = v2; + clippedVerticesItems[s + 16] = x3; + clippedVerticesItems[s + 17] = y3; + clippedVerticesItems[s + 18] = light.r; + clippedVerticesItems[s + 19] = light.g; + clippedVerticesItems[s + 20] = light.b; + clippedVerticesItems[s + 21] = light.a; + clippedVerticesItems[s + 22] = u3; + clippedVerticesItems[s + 23] = v3; + } + else { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + clippedVerticesItems[s + 12] = x2; + clippedVerticesItems[s + 13] = y2; + clippedVerticesItems[s + 14] = light.r; + clippedVerticesItems[s + 15] = light.g; + clippedVerticesItems[s + 16] = light.b; + clippedVerticesItems[s + 17] = light.a; + clippedVerticesItems[s + 18] = u2; + clippedVerticesItems[s + 19] = v2; + clippedVerticesItems[s + 20] = dark.r; + clippedVerticesItems[s + 21] = dark.g; + clippedVerticesItems[s + 22] = dark.b; + clippedVerticesItems[s + 23] = dark.a; + clippedVerticesItems[s + 24] = x3; + clippedVerticesItems[s + 25] = y3; + clippedVerticesItems[s + 26] = light.r; + clippedVerticesItems[s + 27] = light.g; + clippedVerticesItems[s + 28] = light.b; + clippedVerticesItems[s + 29] = light.a; + clippedVerticesItems[s + 30] = u3; + clippedVerticesItems[s + 31] = v3; + clippedVerticesItems[s + 32] = dark.r; + clippedVerticesItems[s + 33] = dark.g; + clippedVerticesItems[s + 34] = dark.b; + clippedVerticesItems[s + 35] = dark.a; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3); + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + 1); + clippedTrianglesItems[s + 2] = (index + 2); + index += 3; + continue outer; + } + } + } + }; + SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) { + var originalOutput = output; + var clipped = false; + var input = null; + if (clippingArea.length % 4 >= 2) { + input = output; + output = this.scratch; + } + else + input = this.scratch; + input.length = 0; + input.push(x1); + input.push(y1); + input.push(x2); + input.push(y2); + input.push(x3); + input.push(y3); + input.push(x1); + input.push(y1); + output.length = 0; + var clippingVertices = clippingArea; + var clippingVerticesLast = clippingArea.length - 4; + for (var i = 0;; i += 2) { + var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; + var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3]; + var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2; + var inputVertices = input; + var inputVerticesLength = input.length - 2, outputStart = output.length; + for (var ii = 0; ii < inputVerticesLength; ii += 2) { + var inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; + var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3]; + var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0; + if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) { + if (side2) { + output.push(inputX2); + output.push(inputY2); + continue; + } + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + } + else if (side2) { + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + output.push(inputX2); + output.push(inputY2); + } + clipped = true; + } + if (outputStart == output.length) { + originalOutput.length = 0; + return true; + } + output.push(output[0]); + output.push(output[1]); + if (i == clippingVerticesLast) + break; + var temp = output; + output = input; + output.length = 0; + input = temp; + } + if (originalOutput != output) { + originalOutput.length = 0; + for (var i = 0, n = output.length - 2; i < n; i++) + originalOutput[i] = output[i]; + } + else + originalOutput.length = originalOutput.length - 2; + return clipped; + }; + SkeletonClipping.makeClockwise = function (polygon) { + var vertices = polygon; + var verticeslength = polygon.length; + var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; + for (var i = 0, n = verticeslength - 3; i < n; i += 2) { + p1x = vertices[i]; + p1y = vertices[i + 1]; + p2x = vertices[i + 2]; + p2y = vertices[i + 3]; + area += p1x * p2y - p2x * p1y; + } + if (area < 0) + return; + for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { + var x = vertices[i], y = vertices[i + 1]; + var other = lastX - i; + vertices[i] = vertices[other]; + vertices[i + 1] = vertices[other + 1]; + vertices[other] = x; + vertices[other + 1] = y; + } + }; + return SkeletonClipping; + }()); + spine.SkeletonClipping = SkeletonClipping; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonData = (function () { + function SkeletonData() { + this.bones = new Array(); + this.slots = new Array(); + this.skins = new Array(); + this.events = new Array(); + this.animations = new Array(); + this.ikConstraints = new Array(); + this.transformConstraints = new Array(); + this.pathConstraints = new Array(); + this.fps = 0; + } + SkeletonData.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.name == boneName) + return bone; + } + return null; + }; + SkeletonData.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].name == boneName) + return i; + return -1; + }; + SkeletonData.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.name == slotName) + return slot; + } + return null; + }; + SkeletonData.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].name == slotName) + return i; + return -1; + }; + SkeletonData.prototype.findSkin = function (skinName) { + if (skinName == null) + throw new Error("skinName cannot be null."); + var skins = this.skins; + for (var i = 0, n = skins.length; i < n; i++) { + var skin = skins[i]; + if (skin.name == skinName) + return skin; + } + return null; + }; + SkeletonData.prototype.findEvent = function (eventDataName) { + if (eventDataName == null) + throw new Error("eventDataName cannot be null."); + var events = this.events; + for (var i = 0, n = events.length; i < n; i++) { + var event_4 = events[i]; + if (event_4.name == eventDataName) + return event_4; + } + return null; + }; + SkeletonData.prototype.findAnimation = function (animationName) { + if (animationName == null) + throw new Error("animationName cannot be null."); + var animations = this.animations; + for (var i = 0, n = animations.length; i < n; i++) { + var animation = animations[i]; + if (animation.name == animationName) + return animation; + } + return null; + }; + SkeletonData.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) { + if (pathConstraintName == null) + throw new Error("pathConstraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) + if (pathConstraints[i].name == pathConstraintName) + return i; + return -1; + }; + return SkeletonData; + }()); + spine.SkeletonData = SkeletonData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonJson = (function () { + function SkeletonJson(attachmentLoader) { + this.scale = 1; + this.linkedMeshes = new Array(); + this.attachmentLoader = attachmentLoader; + } + SkeletonJson.prototype.readSkeletonData = function (json) { + var scale = this.scale; + var skeletonData = new spine.SkeletonData(); + var root = typeof (json) === "string" ? JSON.parse(json) : json; + var skeletonMap = root.skeleton; + if (skeletonMap != null) { + skeletonData.hash = skeletonMap.hash; + skeletonData.version = skeletonMap.spine; + skeletonData.width = skeletonMap.width; + skeletonData.height = skeletonMap.height; + skeletonData.fps = skeletonMap.fps; + skeletonData.imagesPath = skeletonMap.images; + } + if (root.bones) { + for (var i = 0; i < root.bones.length; i++) { + var boneMap = root.bones[i]; + var parent_2 = null; + var parentName = this.getValue(boneMap, "parent", null); + if (parentName != null) { + parent_2 = skeletonData.findBone(parentName); + if (parent_2 == null) + throw new Error("Parent bone not found: " + parentName); + } + var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2); + data.length = this.getValue(boneMap, "length", 0) * scale; + data.x = this.getValue(boneMap, "x", 0) * scale; + data.y = this.getValue(boneMap, "y", 0) * scale; + data.rotation = this.getValue(boneMap, "rotation", 0); + data.scaleX = this.getValue(boneMap, "scaleX", 1); + data.scaleY = this.getValue(boneMap, "scaleY", 1); + data.shearX = this.getValue(boneMap, "shearX", 0); + data.shearY = this.getValue(boneMap, "shearY", 0); + data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal")); + skeletonData.bones.push(data); + } + } + if (root.slots) { + for (var i = 0; i < root.slots.length; i++) { + var slotMap = root.slots[i]; + var slotName = slotMap.name; + var boneName = slotMap.bone; + var boneData = skeletonData.findBone(boneName); + if (boneData == null) + throw new Error("Slot bone not found: " + boneName); + var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData); + var color = this.getValue(slotMap, "color", null); + if (color != null) + data.color.setFromString(color); + var dark = this.getValue(slotMap, "dark", null); + if (dark != null) { + data.darkColor = new spine.Color(1, 1, 1, 1); + data.darkColor.setFromString(dark); + } + data.attachmentName = this.getValue(slotMap, "attachment", null); + data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, "blend", "normal")); + skeletonData.slots.push(data); + } + } + if (root.ik) { + for (var i = 0; i < root.ik.length; i++) { + var constraintMap = root.ik[i]; + var data = new spine.IkConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("IK bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("IK target bone not found: " + targetName); + data.mix = this.getValue(constraintMap, "mix", 1); + data.bendDirection = this.getValue(constraintMap, "bendPositive", true) ? 1 : -1; + data.compress = this.getValue(constraintMap, "compress", false); + data.stretch = this.getValue(constraintMap, "stretch", false); + data.uniform = this.getValue(constraintMap, "uniform", false); + skeletonData.ikConstraints.push(data); + } + } + if (root.transform) { + for (var i = 0; i < root.transform.length; i++) { + var constraintMap = root.transform[i]; + var data = new spine.TransformConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("Transform constraint target bone not found: " + targetName); + data.local = this.getValue(constraintMap, "local", false); + data.relative = this.getValue(constraintMap, "relative", false); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.offsetX = this.getValue(constraintMap, "x", 0) * scale; + data.offsetY = this.getValue(constraintMap, "y", 0) * scale; + data.offsetScaleX = this.getValue(constraintMap, "scaleX", 0); + data.offsetScaleY = this.getValue(constraintMap, "scaleY", 0); + data.offsetShearY = this.getValue(constraintMap, "shearY", 0); + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + data.scaleMix = this.getValue(constraintMap, "scaleMix", 1); + data.shearMix = this.getValue(constraintMap, "shearMix", 1); + skeletonData.transformConstraints.push(data); + } + } + if (root.path) { + for (var i = 0; i < root.path.length; i++) { + var constraintMap = root.path[i]; + var data = new spine.PathConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findSlot(targetName); + if (data.target == null) + throw new Error("Path target slot not found: " + targetName); + data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, "positionMode", "percent")); + data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, "spacingMode", "length")); + data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, "rotateMode", "tangent")); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.position = this.getValue(constraintMap, "position", 0); + if (data.positionMode == spine.PositionMode.Fixed) + data.position *= scale; + data.spacing = this.getValue(constraintMap, "spacing", 0); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + data.spacing *= scale; + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + skeletonData.pathConstraints.push(data); + } + } + if (root.skins) { + for (var skinName in root.skins) { + var skinMap = root.skins[skinName]; + var skin = new spine.Skin(skinName); + for (var slotName in skinMap) { + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + var slotMap = skinMap[slotName]; + for (var entryName in slotMap) { + var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData); + if (attachment != null) + skin.addAttachment(slotIndex, entryName, attachment); + } + } + skeletonData.skins.push(skin); + if (skin.name == "default") + skeletonData.defaultSkin = skin; + } + } + for (var i = 0, n = this.linkedMeshes.length; i < n; i++) { + var linkedMesh = this.linkedMeshes[i]; + var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); + if (skin == null) + throw new Error("Skin not found: " + linkedMesh.skin); + var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); + if (parent_3 == null) + throw new Error("Parent mesh not found: " + linkedMesh.parent); + linkedMesh.mesh.setParentMesh(parent_3); + linkedMesh.mesh.updateUVs(); + } + this.linkedMeshes.length = 0; + if (root.events) { + for (var eventName in root.events) { + var eventMap = root.events[eventName]; + var data = new spine.EventData(eventName); + data.intValue = this.getValue(eventMap, "int", 0); + data.floatValue = this.getValue(eventMap, "float", 0); + data.stringValue = this.getValue(eventMap, "string", ""); + data.audioPath = this.getValue(eventMap, "audio", null); + if (data.audioPath != null) { + data.volume = this.getValue(eventMap, "volume", 1); + data.balance = this.getValue(eventMap, "balance", 0); + } + skeletonData.events.push(data); + } + } + if (root.animations) { + for (var animationName in root.animations) { + var animationMap = root.animations[animationName]; + this.readAnimation(animationMap, animationName, skeletonData); + } + } + return skeletonData; + }; + SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) { + var scale = this.scale; + name = this.getValue(map, "name", name); + var type = this.getValue(map, "type", "region"); + switch (type) { + case "region": { + var path = this.getValue(map, "path", name); + var region = this.attachmentLoader.newRegionAttachment(skin, name, path); + if (region == null) + return null; + region.path = path; + region.x = this.getValue(map, "x", 0) * scale; + region.y = this.getValue(map, "y", 0) * scale; + region.scaleX = this.getValue(map, "scaleX", 1); + region.scaleY = this.getValue(map, "scaleY", 1); + region.rotation = this.getValue(map, "rotation", 0); + region.width = map.width * scale; + region.height = map.height * scale; + var color = this.getValue(map, "color", null); + if (color != null) + region.color.setFromString(color); + region.updateOffset(); + return region; + } + case "boundingbox": { + var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); + if (box == null) + return null; + this.readVertices(map, box, map.vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + box.color.setFromString(color); + return box; + } + case "mesh": + case "linkedmesh": { + var path = this.getValue(map, "path", name); + var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); + if (mesh == null) + return null; + mesh.path = path; + var color = this.getValue(map, "color", null); + if (color != null) + mesh.color.setFromString(color); + var parent_4 = this.getValue(map, "parent", null); + if (parent_4 != null) { + mesh.inheritDeform = this.getValue(map, "deform", true); + this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, "skin", null), slotIndex, parent_4)); + return mesh; + } + var uvs = map.uvs; + this.readVertices(map, mesh, uvs.length); + mesh.triangles = map.triangles; + mesh.regionUVs = uvs; + mesh.updateUVs(); + mesh.hullLength = this.getValue(map, "hull", 0) * 2; + return mesh; + } + case "path": { + var path = this.attachmentLoader.newPathAttachment(skin, name); + if (path == null) + return null; + path.closed = this.getValue(map, "closed", false); + path.constantSpeed = this.getValue(map, "constantSpeed", true); + var vertexCount = map.vertexCount; + this.readVertices(map, path, vertexCount << 1); + var lengths = spine.Utils.newArray(vertexCount / 3, 0); + for (var i = 0; i < map.lengths.length; i++) + lengths[i] = map.lengths[i] * scale; + path.lengths = lengths; + var color = this.getValue(map, "color", null); + if (color != null) + path.color.setFromString(color); + return path; + } + case "point": { + var point = this.attachmentLoader.newPointAttachment(skin, name); + if (point == null) + return null; + point.x = this.getValue(map, "x", 0) * scale; + point.y = this.getValue(map, "y", 0) * scale; + point.rotation = this.getValue(map, "rotation", 0); + var color = this.getValue(map, "color", null); + if (color != null) + point.color.setFromString(color); + return point; + } + case "clipping": { + var clip = this.attachmentLoader.newClippingAttachment(skin, name); + if (clip == null) + return null; + var end = this.getValue(map, "end", null); + if (end != null) { + var slot = skeletonData.findSlot(end); + if (slot == null) + throw new Error("Clipping end slot not found: " + end); + clip.endSlot = slot; + } + var vertexCount = map.vertexCount; + this.readVertices(map, clip, vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + clip.color.setFromString(color); + return clip; + } + } + return null; + }; + SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) { + var scale = this.scale; + attachment.worldVerticesLength = verticesLength; + var vertices = map.vertices; + if (verticesLength == vertices.length) { + var scaledVertices = spine.Utils.toFloatArray(vertices); + if (scale != 1) { + for (var i = 0, n = vertices.length; i < n; i++) + scaledVertices[i] *= scale; + } + attachment.vertices = scaledVertices; + return; + } + var weights = new Array(); + var bones = new Array(); + for (var i = 0, n = vertices.length; i < n;) { + var boneCount = vertices[i++]; + bones.push(boneCount); + for (var nn = i + boneCount * 4; i < nn; i += 4) { + bones.push(vertices[i]); + weights.push(vertices[i + 1] * scale); + weights.push(vertices[i + 2] * scale); + weights.push(vertices[i + 3]); + } + } + attachment.bones = bones; + attachment.vertices = spine.Utils.toFloatArray(weights); + }; + SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) { + var scale = this.scale; + var timelines = new Array(); + var duration = 0; + if (map.slots) { + for (var slotName in map.slots) { + var slotMap = map.slots[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + if (timelineName == "attachment") { + var timeline = new spine.AttachmentTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex++, valueMap.time, valueMap.name); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + else if (timelineName == "color") { + var timeline = new spine.ColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var color = new spine.Color(); + color.setFromString(valueMap.color); + timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]); + } + else if (timelineName == "twoColor") { + var timeline = new spine.TwoColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var light = new spine.Color(); + var dark = new spine.Color(); + light.setFromString(valueMap.light); + dark.setFromString(valueMap.dark); + timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"); + } + } + } + if (map.bones) { + for (var boneName in map.bones) { + var boneMap = map.bones[boneName]; + var boneIndex = skeletonData.findBoneIndex(boneName); + if (boneIndex == -1) + throw new Error("Bone not found: " + boneName); + for (var timelineName in boneMap) { + var timelineMap = boneMap[timelineName]; + if (timelineName === "rotate") { + var timeline = new spine.RotateTimeline(timelineMap.length); + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, valueMap.angle); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]); + } + else if (timelineName === "translate" || timelineName === "scale" || timelineName === "shear") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "scale") + timeline = new spine.ScaleTimeline(timelineMap.length); + else if (timelineName === "shear") + timeline = new spine.ShearTimeline(timelineMap.length); + else { + timeline = new spine.TranslateTimeline(timelineMap.length); + timelineScale = scale; + } + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var x = this.getValue(valueMap, "x", 0), y = this.getValue(valueMap, "y", 0); + timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"); + } + } + } + if (map.ik) { + for (var constraintName in map.ik) { + var constraintMap = map.ik[constraintName]; + var constraint = skeletonData.findIkConstraint(constraintName); + var timeline = new spine.IkConstraintTimeline(constraintMap.length); + timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "mix", 1), this.getValue(valueMap, "bendPositive", true) ? 1 : -1, this.getValue(valueMap, "compress", false), this.getValue(valueMap, "stretch", false)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]); + } + } + if (map.transform) { + for (var constraintName in map.transform) { + var constraintMap = map.transform[constraintName]; + var constraint = skeletonData.findTransformConstraint(constraintName); + var timeline = new spine.TransformConstraintTimeline(constraintMap.length); + timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1), this.getValue(valueMap, "scaleMix", 1), this.getValue(valueMap, "shearMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]); + } + } + if (map.paths) { + for (var constraintName in map.paths) { + var constraintMap = map.paths[constraintName]; + var index = skeletonData.findPathConstraintIndex(constraintName); + if (index == -1) + throw new Error("Path constraint not found: " + constraintName); + var data = skeletonData.pathConstraints[index]; + for (var timelineName in constraintMap) { + var timelineMap = constraintMap[timelineName]; + if (timelineName === "position" || timelineName === "spacing") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "spacing") { + timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + timelineScale = scale; + } + else { + timeline = new spine.PathConstraintPositionTimeline(timelineMap.length); + if (data.positionMode == spine.PositionMode.Fixed) + timelineScale = scale; + } + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]); + } + else if (timelineName === "mix") { + var timeline = new spine.PathConstraintMixTimeline(timelineMap.length); + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]); + } + } + } + } + if (map.deform) { + for (var deformName in map.deform) { + var deformMap = map.deform[deformName]; + var skin = skeletonData.findSkin(deformName); + if (skin == null) + throw new Error("Skin not found: " + deformName); + for (var slotName in deformMap) { + var slotMap = deformMap[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotMap.name); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + var attachment = skin.getAttachment(slotIndex, timelineName); + if (attachment == null) + throw new Error("Deform attachment not found: " + timelineMap.name); + var weighted = attachment.bones != null; + var vertices = attachment.vertices; + var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; + var timeline = new spine.DeformTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + timeline.attachment = attachment; + var frameIndex = 0; + for (var j = 0; j < timelineMap.length; j++) { + var valueMap = timelineMap[j]; + var deform = void 0; + var verticesValue = this.getValue(valueMap, "vertices", null); + if (verticesValue == null) + deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices; + else { + deform = spine.Utils.newFloatArray(deformLength); + var start = this.getValue(valueMap, "offset", 0); + spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); + if (scale != 1) { + for (var i = start, n = i + verticesValue.length; i < n; i++) + deform[i] *= scale; + } + if (!weighted) { + for (var i = 0; i < deformLength; i++) + deform[i] += vertices[i]; + } + } + timeline.setFrame(frameIndex, valueMap.time, deform); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + } + } + } + var drawOrderNode = map.drawOrder; + if (drawOrderNode == null) + drawOrderNode = map.draworder; + if (drawOrderNode != null) { + var timeline = new spine.DrawOrderTimeline(drawOrderNode.length); + var slotCount = skeletonData.slots.length; + var frameIndex = 0; + for (var j = 0; j < drawOrderNode.length; j++) { + var drawOrderMap = drawOrderNode[j]; + var drawOrder = null; + var offsets = this.getValue(drawOrderMap, "offsets", null); + if (offsets != null) { + drawOrder = spine.Utils.newArray(slotCount, -1); + var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0); + var originalIndex = 0, unchangedIndex = 0; + for (var i = 0; i < offsets.length; i++) { + var offsetMap = offsets[i]; + var slotIndex = skeletonData.findSlotIndex(offsetMap.slot); + if (slotIndex == -1) + throw new Error("Slot not found: " + offsetMap.slot); + while (originalIndex != slotIndex) + unchanged[unchangedIndex++] = originalIndex++; + drawOrder[originalIndex + offsetMap.offset] = originalIndex++; + } + while (originalIndex < slotCount) + unchanged[unchangedIndex++] = originalIndex++; + for (var i = slotCount - 1; i >= 0; i--) + if (drawOrder[i] == -1) + drawOrder[i] = unchanged[--unchangedIndex]; + } + timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (map.events) { + var timeline = new spine.EventTimeline(map.events.length); + var frameIndex = 0; + for (var i = 0; i < map.events.length; i++) { + var eventMap = map.events[i]; + var eventData = skeletonData.findEvent(eventMap.name); + if (eventData == null) + throw new Error("Event not found: " + eventMap.name); + var event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData); + event_5.intValue = this.getValue(eventMap, "int", eventData.intValue); + event_5.floatValue = this.getValue(eventMap, "float", eventData.floatValue); + event_5.stringValue = this.getValue(eventMap, "string", eventData.stringValue); + if (event_5.data.audioPath != null) { + event_5.volume = this.getValue(eventMap, "volume", 1); + event_5.balance = this.getValue(eventMap, "balance", 0); + } + timeline.setFrame(frameIndex++, event_5); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (isNaN(duration)) { + throw new Error("Error while parsing animation, duration is NaN"); + } + skeletonData.animations.push(new spine.Animation(name, timelines, duration)); + }; + SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) { + if (!map.curve) + return; + if (map.curve === "stepped") + timeline.setStepped(frameIndex); + else if (Object.prototype.toString.call(map.curve) === '[object Array]') { + var curve = map.curve; + timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); + } + }; + SkeletonJson.prototype.getValue = function (map, prop, defaultValue) { + return map[prop] !== undefined ? map[prop] : defaultValue; + }; + SkeletonJson.blendModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.BlendMode.Normal; + if (str == "additive") + return spine.BlendMode.Additive; + if (str == "multiply") + return spine.BlendMode.Multiply; + if (str == "screen") + return spine.BlendMode.Screen; + throw new Error("Unknown blend mode: " + str); + }; + SkeletonJson.positionModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "fixed") + return spine.PositionMode.Fixed; + if (str == "percent") + return spine.PositionMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.spacingModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "length") + return spine.SpacingMode.Length; + if (str == "fixed") + return spine.SpacingMode.Fixed; + if (str == "percent") + return spine.SpacingMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.rotateModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "tangent") + return spine.RotateMode.Tangent; + if (str == "chain") + return spine.RotateMode.Chain; + if (str == "chainscale") + return spine.RotateMode.ChainScale; + throw new Error("Unknown rotate mode: " + str); + }; + SkeletonJson.transformModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.TransformMode.Normal; + if (str == "onlytranslation") + return spine.TransformMode.OnlyTranslation; + if (str == "norotationorreflection") + return spine.TransformMode.NoRotationOrReflection; + if (str == "noscale") + return spine.TransformMode.NoScale; + if (str == "noscaleorreflection") + return spine.TransformMode.NoScaleOrReflection; + throw new Error("Unknown transform mode: " + str); + }; + return SkeletonJson; + }()); + spine.SkeletonJson = SkeletonJson; + var LinkedMesh = (function () { + function LinkedMesh(mesh, skin, slotIndex, parent) { + this.mesh = mesh; + this.skin = skin; + this.slotIndex = slotIndex; + this.parent = parent; + } + return LinkedMesh; + }()); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skin = (function () { + function Skin(name) { + this.attachments = new Array(); + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + Skin.prototype.addAttachment = function (slotIndex, name, attachment) { + if (attachment == null) + throw new Error("attachment cannot be null."); + var attachments = this.attachments; + if (slotIndex >= attachments.length) + attachments.length = slotIndex + 1; + if (!attachments[slotIndex]) + attachments[slotIndex] = {}; + attachments[slotIndex][name] = attachment; + }; + Skin.prototype.getAttachment = function (slotIndex, name) { + var dictionary = this.attachments[slotIndex]; + return dictionary ? dictionary[name] : null; + }; + Skin.prototype.attachAll = function (skeleton, oldSkin) { + var slotIndex = 0; + for (var i = 0; i < skeleton.slots.length; i++) { + var slot = skeleton.slots[i]; + var slotAttachment = slot.getAttachment(); + if (slotAttachment && slotIndex < oldSkin.attachments.length) { + var dictionary = oldSkin.attachments[slotIndex]; + for (var key in dictionary) { + var skinAttachment = dictionary[key]; + if (slotAttachment == skinAttachment) { + var attachment = this.getAttachment(slotIndex, key); + if (attachment != null) + slot.setAttachment(attachment); + break; + } + } + } + slotIndex++; + } + }; + return Skin; + }()); + spine.Skin = Skin; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Slot = (function () { + function Slot(data, bone) { + this.attachmentVertices = new Array(); + if (data == null) + throw new Error("data cannot be null."); + if (bone == null) + throw new Error("bone cannot be null."); + this.data = data; + this.bone = bone; + this.color = new spine.Color(); + this.darkColor = data.darkColor == null ? null : new spine.Color(); + this.setToSetupPose(); + } + Slot.prototype.getAttachment = function () { + return this.attachment; + }; + Slot.prototype.setAttachment = function (attachment) { + if (this.attachment == attachment) + return; + this.attachment = attachment; + this.attachmentTime = this.bone.skeleton.time; + this.attachmentVertices.length = 0; + }; + Slot.prototype.setAttachmentTime = function (time) { + this.attachmentTime = this.bone.skeleton.time - time; + }; + Slot.prototype.getAttachmentTime = function () { + return this.bone.skeleton.time - this.attachmentTime; + }; + Slot.prototype.setToSetupPose = function () { + this.color.setFromColor(this.data.color); + if (this.darkColor != null) + this.darkColor.setFromColor(this.data.darkColor); + if (this.data.attachmentName == null) + this.attachment = null; + else { + this.attachment = null; + this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)); + } + }; + return Slot; + }()); + spine.Slot = Slot; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SlotData = (function () { + function SlotData(index, name, boneData) { + this.color = new spine.Color(1, 1, 1, 1); + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + if (boneData == null) + throw new Error("boneData cannot be null."); + this.index = index; + this.name = name; + this.boneData = boneData; + } + return SlotData; + }()); + spine.SlotData = SlotData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Texture = (function () { + function Texture(image) { + this._image = image; + } + Texture.prototype.getImage = function () { + return this._image; + }; + Texture.filterFromString = function (text) { + switch (text.toLowerCase()) { + case "nearest": return TextureFilter.Nearest; + case "linear": return TextureFilter.Linear; + case "mipmap": return TextureFilter.MipMap; + case "mipmapnearestnearest": return TextureFilter.MipMapNearestNearest; + case "mipmaplinearnearest": return TextureFilter.MipMapLinearNearest; + case "mipmapnearestlinear": return TextureFilter.MipMapNearestLinear; + case "mipmaplinearlinear": return TextureFilter.MipMapLinearLinear; + default: throw new Error("Unknown texture filter " + text); + } + }; + Texture.wrapFromString = function (text) { + switch (text.toLowerCase()) { + case "mirroredtepeat": return TextureWrap.MirroredRepeat; + case "clamptoedge": return TextureWrap.ClampToEdge; + case "repeat": return TextureWrap.Repeat; + default: throw new Error("Unknown texture wrap " + text); + } + }; + return Texture; + }()); + spine.Texture = Texture; + var TextureFilter; + (function (TextureFilter) { + TextureFilter[TextureFilter["Nearest"] = 9728] = "Nearest"; + TextureFilter[TextureFilter["Linear"] = 9729] = "Linear"; + TextureFilter[TextureFilter["MipMap"] = 9987] = "MipMap"; + TextureFilter[TextureFilter["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; + TextureFilter[TextureFilter["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; + TextureFilter[TextureFilter["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; + TextureFilter[TextureFilter["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; + })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {})); + var TextureWrap; + (function (TextureWrap) { + TextureWrap[TextureWrap["MirroredRepeat"] = 33648] = "MirroredRepeat"; + TextureWrap[TextureWrap["ClampToEdge"] = 33071] = "ClampToEdge"; + TextureWrap[TextureWrap["Repeat"] = 10497] = "Repeat"; + })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {})); + var TextureRegion = (function () { + function TextureRegion() { + this.u = 0; + this.v = 0; + this.u2 = 0; + this.v2 = 0; + this.width = 0; + this.height = 0; + this.rotate = false; + this.offsetX = 0; + this.offsetY = 0; + this.originalWidth = 0; + this.originalHeight = 0; + } + return TextureRegion; + }()); + spine.TextureRegion = TextureRegion; + var FakeTexture = (function (_super) { + __extends(FakeTexture, _super); + function FakeTexture() { + return _super !== null && _super.apply(this, arguments) || this; + } + FakeTexture.prototype.setFilters = function (minFilter, magFilter) { }; + FakeTexture.prototype.setWraps = function (uWrap, vWrap) { }; + FakeTexture.prototype.dispose = function () { }; + return FakeTexture; + }(Texture)); + spine.FakeTexture = FakeTexture; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TextureAtlas = (function () { + function TextureAtlas(atlasText, textureLoader) { + this.pages = new Array(); + this.regions = new Array(); + this.load(atlasText, textureLoader); + } + TextureAtlas.prototype.load = function (atlasText, textureLoader) { + if (textureLoader == null) + throw new Error("textureLoader cannot be null."); + var reader = new TextureAtlasReader(atlasText); + var tuple = new Array(4); + var page = null; + while (true) { + var line = reader.readLine(); + if (line == null) + break; + line = line.trim(); + if (line.length == 0) + page = null; + else if (!page) { + page = new TextureAtlasPage(); + page.name = line; + if (reader.readTuple(tuple) == 2) { + page.width = parseInt(tuple[0]); + page.height = parseInt(tuple[1]); + reader.readTuple(tuple); + } + reader.readTuple(tuple); + page.minFilter = spine.Texture.filterFromString(tuple[0]); + page.magFilter = spine.Texture.filterFromString(tuple[1]); + var direction = reader.readValue(); + page.uWrap = spine.TextureWrap.ClampToEdge; + page.vWrap = spine.TextureWrap.ClampToEdge; + if (direction == "x") + page.uWrap = spine.TextureWrap.Repeat; + else if (direction == "y") + page.vWrap = spine.TextureWrap.Repeat; + else if (direction == "xy") + page.uWrap = page.vWrap = spine.TextureWrap.Repeat; + page.texture = textureLoader(line); + page.texture.setFilters(page.minFilter, page.magFilter); + page.texture.setWraps(page.uWrap, page.vWrap); + page.width = page.texture.getImage().width; + page.height = page.texture.getImage().height; + this.pages.push(page); + } + else { + var region = new TextureAtlasRegion(); + region.name = line; + region.page = page; + region.rotate = reader.readValue() == "true"; + reader.readTuple(tuple); + var x = parseInt(tuple[0]); + var y = parseInt(tuple[1]); + reader.readTuple(tuple); + var width = parseInt(tuple[0]); + var height = parseInt(tuple[1]); + region.u = x / page.width; + region.v = y / page.height; + if (region.rotate) { + region.u2 = (x + height) / page.width; + region.v2 = (y + width) / page.height; + } + else { + region.u2 = (x + width) / page.width; + region.v2 = (y + height) / page.height; + } + region.x = x; + region.y = y; + region.width = Math.abs(width); + region.height = Math.abs(height); + if (reader.readTuple(tuple) == 4) { + if (reader.readTuple(tuple) == 4) { + reader.readTuple(tuple); + } + } + region.originalWidth = parseInt(tuple[0]); + region.originalHeight = parseInt(tuple[1]); + reader.readTuple(tuple); + region.offsetX = parseInt(tuple[0]); + region.offsetY = parseInt(tuple[1]); + region.index = parseInt(reader.readValue()); + region.texture = page.texture; + this.regions.push(region); + } + } + }; + TextureAtlas.prototype.findRegion = function (name) { + for (var i = 0; i < this.regions.length; i++) { + if (this.regions[i].name == name) { + return this.regions[i]; + } + } + return null; + }; + TextureAtlas.prototype.dispose = function () { + for (var i = 0; i < this.pages.length; i++) { + this.pages[i].texture.dispose(); + } + }; + return TextureAtlas; + }()); + spine.TextureAtlas = TextureAtlas; + var TextureAtlasReader = (function () { + function TextureAtlasReader(text) { + this.index = 0; + this.lines = text.split(/\r\n|\r|\n/); + } + TextureAtlasReader.prototype.readLine = function () { + if (this.index >= this.lines.length) + return null; + return this.lines[this.index++]; + }; + TextureAtlasReader.prototype.readValue = function () { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + return line.substring(colon + 1).trim(); + }; + TextureAtlasReader.prototype.readTuple = function (tuple) { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + var i = 0, lastMatch = colon + 1; + for (; i < 3; i++) { + var comma = line.indexOf(",", lastMatch); + if (comma == -1) + break; + tuple[i] = line.substr(lastMatch, comma - lastMatch).trim(); + lastMatch = comma + 1; + } + tuple[i] = line.substring(lastMatch).trim(); + return i + 1; + }; + return TextureAtlasReader; + }()); + var TextureAtlasPage = (function () { + function TextureAtlasPage() { + } + return TextureAtlasPage; + }()); + spine.TextureAtlasPage = TextureAtlasPage; + var TextureAtlasRegion = (function (_super) { + __extends(TextureAtlasRegion, _super); + function TextureAtlasRegion() { + return _super !== null && _super.apply(this, arguments) || this; + } + return TextureAtlasRegion; + }(spine.TextureRegion)); + spine.TextureAtlasRegion = TextureAtlasRegion; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraint = (function () { + function TransformConstraint(data, skeleton) { + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.temp = new spine.Vector2(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + this.scaleMix = data.scaleMix; + this.shearMix = data.shearMix; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + TransformConstraint.prototype.apply = function () { + this.update(); + }; + TransformConstraint.prototype.update = function () { + if (this.data.local) { + if (this.data.relative) + this.applyRelativeLocal(); + else + this.applyAbsoluteLocal(); + } + else { + if (this.data.relative) + this.applyRelativeWorld(); + else + this.applyAbsoluteWorld(); + } + }; + TransformConstraint.prototype.applyAbsoluteWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect; + var offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += (temp.x - bone.worldX) * translateMix; + bone.worldY += (temp.y - bone.worldY) * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c); + var ts = Math.sqrt(ta * ta + tc * tc); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s; + bone.a *= s; + bone.c *= s; + s = Math.sqrt(bone.b * bone.b + bone.d * bone.d); + ts = Math.sqrt(tb * tb + td * td); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var b = bone.b, d = bone.d; + var by = Math.atan2(d, b); + var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a)); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r = by + (r + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyRelativeWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += temp.x * translateMix; + bone.worldY += temp.y * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1; + bone.a *= s; + bone.c *= s; + s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var r = Math.atan2(td, tb) - Math.atan2(tc, ta); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + var b = bone.b, d = bone.d; + r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyAbsoluteLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) { + var r = target.arotation - rotation + this.data.offsetRotation; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + rotation += r * rotateMix; + } + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax - x + this.data.offsetX) * translateMix; + y += (target.ay - y + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX; + if (scaleY > 0.00001) + scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY; + } + var shearY = bone.ashearY; + if (shearMix != 0) { + var r = target.ashearY - shearY + this.data.offsetShearY; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + bone.shearY += r * shearMix; + } + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.applyRelativeLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) + rotation += (target.arotation + this.data.offsetRotation) * rotateMix; + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax + this.data.offsetX) * translateMix; + y += (target.ay + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1; + if (scaleY > 0.00001) + scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1; + } + var shearY = bone.ashearY; + if (shearMix != 0) + shearY += (target.ashearY + this.data.offsetShearY) * shearMix; + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.getOrder = function () { + return this.data.order; + }; + return TransformConstraint; + }()); + spine.TransformConstraint = TransformConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraintData = (function () { + function TransformConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.offsetRotation = 0; + this.offsetX = 0; + this.offsetY = 0; + this.offsetScaleX = 0; + this.offsetScaleY = 0; + this.offsetShearY = 0; + this.relative = false; + this.local = false; + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return TransformConstraintData; + }()); + spine.TransformConstraintData = TransformConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Triangulator = (function () { + function Triangulator() { + this.convexPolygons = new Array(); + this.convexPolygonsIndices = new Array(); + this.indicesArray = new Array(); + this.isConcaveArray = new Array(); + this.triangles = new Array(); + this.polygonPool = new spine.Pool(function () { + return new Array(); + }); + this.polygonIndicesPool = new spine.Pool(function () { + return new Array(); + }); + } + Triangulator.prototype.triangulate = function (verticesArray) { + var vertices = verticesArray; + var vertexCount = verticesArray.length >> 1; + var indices = this.indicesArray; + indices.length = 0; + for (var i = 0; i < vertexCount; i++) + indices[i] = i; + var isConcave = this.isConcaveArray; + isConcave.length = 0; + for (var i = 0, n = vertexCount; i < n; ++i) + isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices); + var triangles = this.triangles; + triangles.length = 0; + while (vertexCount > 3) { + var previous = vertexCount - 1, i = 0, next = 1; + while (true) { + outer: if (!isConcave[i]) { + var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; + var p1x = vertices[p1], p1y = vertices[p1 + 1]; + var p2x = vertices[p2], p2y = vertices[p2 + 1]; + var p3x = vertices[p3], p3y = vertices[p3 + 1]; + for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { + if (!isConcave[ii]) + continue; + var v = indices[ii] << 1; + var vx = vertices[v], vy = vertices[v + 1]; + if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { + if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { + if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) + break outer; + } + } + } + break; + } + if (next == 0) { + do { + if (!isConcave[i]) + break; + i--; + } while (i > 0); + break; + } + previous = i; + i = next; + next = (next + 1) % vertexCount; + } + triangles.push(indices[(vertexCount + i - 1) % vertexCount]); + triangles.push(indices[i]); + triangles.push(indices[(i + 1) % vertexCount]); + indices.splice(i, 1); + isConcave.splice(i, 1); + vertexCount--; + var previousIndex = (vertexCount + i - 1) % vertexCount; + var nextIndex = i == vertexCount ? 0 : i; + isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices); + isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices); + } + if (vertexCount == 3) { + triangles.push(indices[2]); + triangles.push(indices[0]); + triangles.push(indices[1]); + } + return triangles; + }; + Triangulator.prototype.decompose = function (verticesArray, triangles) { + var vertices = verticesArray; + var convexPolygons = this.convexPolygons; + this.polygonPool.freeAll(convexPolygons); + convexPolygons.length = 0; + var convexPolygonsIndices = this.convexPolygonsIndices; + this.polygonIndicesPool.freeAll(convexPolygonsIndices); + convexPolygonsIndices.length = 0; + var polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + var polygon = this.polygonPool.obtain(); + polygon.length = 0; + var fanBaseIndex = -1, lastWinding = 0; + for (var i = 0, n = triangles.length; i < n; i += 3) { + var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; + var x1 = vertices[t1], y1 = vertices[t1 + 1]; + var x2 = vertices[t2], y2 = vertices[t2 + 1]; + var x3 = vertices[t3], y3 = vertices[t3 + 1]; + var merged = false; + if (fanBaseIndex == t1) { + var o = polygon.length - 4; + var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); + var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]); + if (winding1 == lastWinding && winding2 == lastWinding) { + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(t3); + merged = true; + } + } + if (!merged) { + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + else { + this.polygonPool.free(polygon); + this.polygonIndicesPool.free(polygonIndices); + } + polygon = this.polygonPool.obtain(); + polygon.length = 0; + polygon.push(x1); + polygon.push(y1); + polygon.push(x2); + polygon.push(y2); + polygon.push(x3); + polygon.push(y3); + polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + polygonIndices.push(t1); + polygonIndices.push(t2); + polygonIndices.push(t3); + lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3); + fanBaseIndex = t1; + } + } + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + for (var i = 0, n = convexPolygons.length; i < n; i++) { + polygonIndices = convexPolygonsIndices[i]; + if (polygonIndices.length == 0) + continue; + var firstIndex = polygonIndices[0]; + var lastIndex = polygonIndices[polygonIndices.length - 1]; + polygon = convexPolygons[i]; + var o = polygon.length - 4; + var prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; + var prevX = polygon[o + 2], prevY = polygon[o + 3]; + var firstX = polygon[0], firstY = polygon[1]; + var secondX = polygon[2], secondY = polygon[3]; + var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); + for (var ii = 0; ii < n; ii++) { + if (ii == i) + continue; + var otherIndices = convexPolygonsIndices[ii]; + if (otherIndices.length != 3) + continue; + var otherFirstIndex = otherIndices[0]; + var otherSecondIndex = otherIndices[1]; + var otherLastIndex = otherIndices[2]; + var otherPoly = convexPolygons[ii]; + var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; + if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) + continue; + var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); + var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY); + if (winding1 == winding && winding2 == winding) { + otherPoly.length = 0; + otherIndices.length = 0; + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(otherLastIndex); + prevPrevX = prevX; + prevPrevY = prevY; + prevX = x3; + prevY = y3; + ii = 0; + } + } + } + for (var i = convexPolygons.length - 1; i >= 0; i--) { + polygon = convexPolygons[i]; + if (polygon.length == 0) { + convexPolygons.splice(i, 1); + this.polygonPool.free(polygon); + polygonIndices = convexPolygonsIndices[i]; + convexPolygonsIndices.splice(i, 1); + this.polygonIndicesPool.free(polygonIndices); + } + } + return convexPolygons; + }; + Triangulator.isConcave = function (index, vertexCount, vertices, indices) { + var previous = indices[(vertexCount + index - 1) % vertexCount] << 1; + var current = indices[index] << 1; + var next = indices[(index + 1) % vertexCount] << 1; + return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); + }; + Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) { + return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; + }; + Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) { + var px = p2x - p1x, py = p2y - p1y; + return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; + }; + return Triangulator; + }()); + spine.Triangulator = Triangulator; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IntSet = (function () { + function IntSet() { + this.array = new Array(); + } + IntSet.prototype.add = function (value) { + var contains = this.contains(value); + this.array[value | 0] = value | 0; + return !contains; + }; + IntSet.prototype.contains = function (value) { + return this.array[value | 0] != undefined; + }; + IntSet.prototype.remove = function (value) { + this.array[value | 0] = undefined; + }; + IntSet.prototype.clear = function () { + this.array.length = 0; + }; + return IntSet; + }()); + spine.IntSet = IntSet; + var Color = (function () { + function Color(r, g, b, a) { + if (r === void 0) { r = 0; } + if (g === void 0) { g = 0; } + if (b === void 0) { b = 0; } + if (a === void 0) { a = 0; } + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + Color.prototype.set = function (r, g, b, a) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + this.clamp(); + return this; + }; + Color.prototype.setFromColor = function (c) { + this.r = c.r; + this.g = c.g; + this.b = c.b; + this.a = c.a; + return this; + }; + Color.prototype.setFromString = function (hex) { + hex = hex.charAt(0) == '#' ? hex.substr(1) : hex; + this.r = parseInt(hex.substr(0, 2), 16) / 255.0; + this.g = parseInt(hex.substr(2, 2), 16) / 255.0; + this.b = parseInt(hex.substr(4, 2), 16) / 255.0; + this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0; + return this; + }; + Color.prototype.add = function (r, g, b, a) { + this.r += r; + this.g += g; + this.b += b; + this.a += a; + this.clamp(); + return this; + }; + Color.prototype.clamp = function () { + if (this.r < 0) + this.r = 0; + else if (this.r > 1) + this.r = 1; + if (this.g < 0) + this.g = 0; + else if (this.g > 1) + this.g = 1; + if (this.b < 0) + this.b = 0; + else if (this.b > 1) + this.b = 1; + if (this.a < 0) + this.a = 0; + else if (this.a > 1) + this.a = 1; + return this; + }; + Color.WHITE = new Color(1, 1, 1, 1); + Color.RED = new Color(1, 0, 0, 1); + Color.GREEN = new Color(0, 1, 0, 1); + Color.BLUE = new Color(0, 0, 1, 1); + Color.MAGENTA = new Color(1, 0, 1, 1); + return Color; + }()); + spine.Color = Color; + var MathUtils = (function () { + function MathUtils() { + } + MathUtils.clamp = function (value, min, max) { + if (value < min) + return min; + if (value > max) + return max; + return value; + }; + MathUtils.cosDeg = function (degrees) { + return Math.cos(degrees * MathUtils.degRad); + }; + MathUtils.sinDeg = function (degrees) { + return Math.sin(degrees * MathUtils.degRad); + }; + MathUtils.signum = function (value) { + return value > 0 ? 1 : value < 0 ? -1 : 0; + }; + MathUtils.toInt = function (x) { + return x > 0 ? Math.floor(x) : Math.ceil(x); + }; + MathUtils.cbrt = function (x) { + var y = Math.pow(Math.abs(x), 1 / 3); + return x < 0 ? -y : y; + }; + MathUtils.randomTriangular = function (min, max) { + return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); + }; + MathUtils.randomTriangularWith = function (min, max, mode) { + var u = Math.random(); + var d = max - min; + if (u <= (mode - min) / d) + return min + Math.sqrt(u * d * (mode - min)); + return max - Math.sqrt((1 - u) * d * (max - mode)); + }; + MathUtils.PI = 3.1415927; + MathUtils.PI2 = MathUtils.PI * 2; + MathUtils.radiansToDegrees = 180 / MathUtils.PI; + MathUtils.radDeg = MathUtils.radiansToDegrees; + MathUtils.degreesToRadians = MathUtils.PI / 180; + MathUtils.degRad = MathUtils.degreesToRadians; + return MathUtils; + }()); + spine.MathUtils = MathUtils; + var Interpolation = (function () { + function Interpolation() { + } + Interpolation.prototype.apply = function (start, end, a) { + return start + (end - start) * this.applyInternal(a); + }; + return Interpolation; + }()); + spine.Interpolation = Interpolation; + var Pow = (function (_super) { + __extends(Pow, _super); + function Pow(power) { + var _this = _super.call(this) || this; + _this.power = 2; + _this.power = power; + return _this; + } + Pow.prototype.applyInternal = function (a) { + if (a <= 0.5) + return Math.pow(a * 2, this.power) / 2; + return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1; + }; + return Pow; + }(Interpolation)); + spine.Pow = Pow; + var PowOut = (function (_super) { + __extends(PowOut, _super); + function PowOut(power) { + return _super.call(this, power) || this; + } + PowOut.prototype.applyInternal = function (a) { + return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1; + }; + return PowOut; + }(Pow)); + spine.PowOut = PowOut; + var Utils = (function () { + function Utils() { + } + Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) { + for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { + dest[j] = source[i]; + } + }; + Utils.setArraySize = function (array, size, value) { + if (value === void 0) { value = 0; } + var oldSize = array.length; + if (oldSize == size) + return array; + array.length = size; + if (oldSize < size) { + for (var i = oldSize; i < size; i++) + array[i] = value; + } + return array; + }; + Utils.ensureArrayCapacity = function (array, size, value) { + if (value === void 0) { value = 0; } + if (array.length >= size) + return array; + return Utils.setArraySize(array, size, value); + }; + Utils.newArray = function (size, defaultValue) { + var array = new Array(size); + for (var i = 0; i < size; i++) + array[i] = defaultValue; + return array; + }; + Utils.newFloatArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Float32Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.newShortArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Int16Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.toFloatArray = function (array) { + return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; + }; + Utils.toSinglePrecision = function (value) { + return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; + }; + Utils.webkit602BugfixHelper = function (alpha, blend) { + }; + Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== "undefined"; + return Utils; + }()); + spine.Utils = Utils; + var DebugUtils = (function () { + function DebugUtils() { + } + DebugUtils.logBones = function (skeleton) { + for (var i = 0; i < skeleton.bones.length; i++) { + var bone = skeleton.bones[i]; + console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY); + } + }; + return DebugUtils; + }()); + spine.DebugUtils = DebugUtils; + var Pool = (function () { + function Pool(instantiator) { + this.items = new Array(); + this.instantiator = instantiator; + } + Pool.prototype.obtain = function () { + return this.items.length > 0 ? this.items.pop() : this.instantiator(); + }; + Pool.prototype.free = function (item) { + if (item.reset) + item.reset(); + this.items.push(item); + }; + Pool.prototype.freeAll = function (items) { + for (var i = 0; i < items.length; i++) { + if (items[i].reset) + items[i].reset(); + this.items[i] = items[i]; + } + }; + Pool.prototype.clear = function () { + this.items.length = 0; + }; + return Pool; + }()); + spine.Pool = Pool; + var Vector2 = (function () { + function Vector2(x, y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + this.x = x; + this.y = y; + } + Vector2.prototype.set = function (x, y) { + this.x = x; + this.y = y; + return this; + }; + Vector2.prototype.length = function () { + var x = this.x; + var y = this.y; + return Math.sqrt(x * x + y * y); + }; + Vector2.prototype.normalize = function () { + var len = this.length(); + if (len != 0) { + this.x /= len; + this.y /= len; + } + return this; + }; + return Vector2; + }()); + spine.Vector2 = Vector2; + var TimeKeeper = (function () { + function TimeKeeper() { + this.maxDelta = 0.064; + this.framesPerSecond = 0; + this.delta = 0; + this.totalTime = 0; + this.lastTime = Date.now() / 1000; + this.frameCount = 0; + this.frameTime = 0; + } + TimeKeeper.prototype.update = function () { + var now = Date.now() / 1000; + this.delta = now - this.lastTime; + this.frameTime += this.delta; + this.totalTime += this.delta; + if (this.delta > this.maxDelta) + this.delta = this.maxDelta; + this.lastTime = now; + this.frameCount++; + if (this.frameTime > 1) { + this.framesPerSecond = this.frameCount / this.frameTime; + this.frameTime = 0; + this.frameCount = 0; + } + }; + return TimeKeeper; + }()); + spine.TimeKeeper = TimeKeeper; + var WindowedMean = (function () { + function WindowedMean(windowSize) { + if (windowSize === void 0) { windowSize = 32; } + this.addedValues = 0; + this.lastValue = 0; + this.mean = 0; + this.dirty = true; + this.values = new Array(windowSize); + } + WindowedMean.prototype.hasEnoughData = function () { + return this.addedValues >= this.values.length; + }; + WindowedMean.prototype.addValue = function (value) { + if (this.addedValues < this.values.length) + this.addedValues++; + this.values[this.lastValue++] = value; + if (this.lastValue > this.values.length - 1) + this.lastValue = 0; + this.dirty = true; + }; + WindowedMean.prototype.getMean = function () { + if (this.hasEnoughData()) { + if (this.dirty) { + var mean = 0; + for (var i = 0; i < this.values.length; i++) { + mean += this.values[i]; + } + this.mean = mean / this.values.length; + this.dirty = false; + } + return this.mean; + } + else { + return 0; + } + }; + return WindowedMean; + }()); + spine.WindowedMean = WindowedMean; +})(spine || (spine = {})); +(function () { + if (!Math.fround) { + Math.fround = (function (array) { + return function (x) { + return array[0] = x, array[0]; + }; + })(new Float32Array(1)); + } +})(); +var spine; +(function (spine) { + var Attachment = (function () { + function Attachment(name) { + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return Attachment; + }()); + spine.Attachment = Attachment; + var VertexAttachment = (function (_super) { + __extends(VertexAttachment, _super); + function VertexAttachment(name) { + var _this = _super.call(this, name) || this; + _this.id = (VertexAttachment.nextID++ & 65535) << 11; + _this.worldVerticesLength = 0; + return _this; + } + VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) { + count = offset + (count >> 1) * stride; + var skeleton = slot.bone.skeleton; + var deformArray = slot.attachmentVertices; + var vertices = this.vertices; + var bones = this.bones; + if (bones == null) { + if (deformArray.length > 0) + vertices = deformArray; + var bone = slot.bone; + var x = bone.worldX; + var y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) { + var vx = vertices[v_1], vy = vertices[v_1 + 1]; + worldVertices[w] = vx * a + vy * b + x; + worldVertices[w + 1] = vx * c + vy * d + y; + } + return; + } + var v = 0, skip = 0; + for (var i = 0; i < start; i += 2) { + var n = bones[v]; + v += n + 1; + skip += n; + } + var skeletonBones = skeleton.bones; + if (deformArray.length == 0) { + for (var w = offset, b = skip * 3; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + else { + var deform = deformArray; + for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3, f += 2) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + }; + VertexAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment; + }; + VertexAttachment.nextID = 0; + return VertexAttachment; + }(Attachment)); + spine.VertexAttachment = VertexAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AttachmentType; + (function (AttachmentType) { + AttachmentType[AttachmentType["Region"] = 0] = "Region"; + AttachmentType[AttachmentType["BoundingBox"] = 1] = "BoundingBox"; + AttachmentType[AttachmentType["Mesh"] = 2] = "Mesh"; + AttachmentType[AttachmentType["LinkedMesh"] = 3] = "LinkedMesh"; + AttachmentType[AttachmentType["Path"] = 4] = "Path"; + AttachmentType[AttachmentType["Point"] = 5] = "Point"; + })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoundingBoxAttachment = (function (_super) { + __extends(BoundingBoxAttachment, _super); + function BoundingBoxAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return BoundingBoxAttachment; + }(spine.VertexAttachment)); + spine.BoundingBoxAttachment = BoundingBoxAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var ClippingAttachment = (function (_super) { + __extends(ClippingAttachment, _super); + function ClippingAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1); + return _this; + } + return ClippingAttachment; + }(spine.VertexAttachment)); + spine.ClippingAttachment = ClippingAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var MeshAttachment = (function (_super) { + __extends(MeshAttachment, _super); + function MeshAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + _this.inheritDeform = false; + _this.tempColor = new spine.Color(0, 0, 0, 0); + return _this; + } + MeshAttachment.prototype.updateUVs = function () { + var regionUVs = this.regionUVs; + if (this.uvs == null || this.uvs.length != regionUVs.length) + this.uvs = spine.Utils.newFloatArray(regionUVs.length); + var uvs = this.uvs; + var u = 0, v = 0, width = 0, height = 0; + if (this.region instanceof spine.TextureAtlasRegion) { + var region = this.region; + var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height; + if (region.rotate) { + u = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth; + v = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight; + width = region.originalHeight / textureWidth; + height = region.originalWidth / textureHeight; + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i + 1] * width; + uvs[i + 1] = v + height - regionUVs[i] * height; + } + return; + } + u = region.u - region.offsetX / textureWidth; + v = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight; + width = region.originalWidth / textureWidth; + height = region.originalHeight / textureHeight; + } + else if (this.region == null) { + u = v = 0; + width = height = 1; + } + else { + u = this.region.u; + v = this.region.v; + width = this.region.u2 - u; + height = this.region.v2 - v; + } + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i] * width; + uvs[i + 1] = v + regionUVs[i + 1] * height; + } + }; + MeshAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment); + }; + MeshAttachment.prototype.getParentMesh = function () { + return this.parentMesh; + }; + MeshAttachment.prototype.setParentMesh = function (parentMesh) { + this.parentMesh = parentMesh; + if (parentMesh != null) { + this.bones = parentMesh.bones; + this.vertices = parentMesh.vertices; + this.worldVerticesLength = parentMesh.worldVerticesLength; + this.regionUVs = parentMesh.regionUVs; + this.triangles = parentMesh.triangles; + this.hullLength = parentMesh.hullLength; + this.worldVerticesLength = parentMesh.worldVerticesLength; + } + }; + return MeshAttachment; + }(spine.VertexAttachment)); + spine.MeshAttachment = MeshAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathAttachment = (function (_super) { + __extends(PathAttachment, _super); + function PathAttachment(name) { + var _this = _super.call(this, name) || this; + _this.closed = false; + _this.constantSpeed = false; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return PathAttachment; + }(spine.VertexAttachment)); + spine.PathAttachment = PathAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PointAttachment = (function (_super) { + __extends(PointAttachment, _super); + function PointAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.38, 0.94, 0, 1); + return _this; + } + PointAttachment.prototype.computeWorldPosition = function (bone, point) { + point.x = this.x * bone.a + this.y * bone.b + bone.worldX; + point.y = this.x * bone.c + this.y * bone.d + bone.worldY; + return point; + }; + PointAttachment.prototype.computeWorldRotation = function (bone) { + var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation); + var x = cos * bone.a + sin * bone.b; + var y = cos * bone.c + sin * bone.d; + return Math.atan2(y, x) * spine.MathUtils.radDeg; + }; + return PointAttachment; + }(spine.VertexAttachment)); + spine.PointAttachment = PointAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var RegionAttachment = (function (_super) { + __extends(RegionAttachment, _super); + function RegionAttachment(name) { + var _this = _super.call(this, name) || this; + _this.x = 0; + _this.y = 0; + _this.scaleX = 1; + _this.scaleY = 1; + _this.rotation = 0; + _this.width = 0; + _this.height = 0; + _this.color = new spine.Color(1, 1, 1, 1); + _this.offset = spine.Utils.newFloatArray(8); + _this.uvs = spine.Utils.newFloatArray(8); + _this.tempColor = new spine.Color(1, 1, 1, 1); + return _this; + } + RegionAttachment.prototype.updateOffset = function () { + var regionScaleX = this.width / this.region.originalWidth * this.scaleX; + var regionScaleY = this.height / this.region.originalHeight * this.scaleY; + var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; + var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; + var localX2 = localX + this.region.width * regionScaleX; + var localY2 = localY + this.region.height * regionScaleY; + var radians = this.rotation * Math.PI / 180; + var cos = Math.cos(radians); + var sin = Math.sin(radians); + var localXCos = localX * cos + this.x; + var localXSin = localX * sin; + var localYCos = localY * cos + this.y; + var localYSin = localY * sin; + var localX2Cos = localX2 * cos + this.x; + var localX2Sin = localX2 * sin; + var localY2Cos = localY2 * cos + this.y; + var localY2Sin = localY2 * sin; + var offset = this.offset; + offset[RegionAttachment.OX1] = localXCos - localYSin; + offset[RegionAttachment.OY1] = localYCos + localXSin; + offset[RegionAttachment.OX2] = localXCos - localY2Sin; + offset[RegionAttachment.OY2] = localY2Cos + localXSin; + offset[RegionAttachment.OX3] = localX2Cos - localY2Sin; + offset[RegionAttachment.OY3] = localY2Cos + localX2Sin; + offset[RegionAttachment.OX4] = localX2Cos - localYSin; + offset[RegionAttachment.OY4] = localYCos + localX2Sin; + }; + RegionAttachment.prototype.setRegion = function (region) { + this.region = region; + var uvs = this.uvs; + if (region.rotate) { + uvs[2] = region.u; + uvs[3] = region.v2; + uvs[4] = region.u; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v; + uvs[0] = region.u2; + uvs[1] = region.v2; + } + else { + uvs[0] = region.u; + uvs[1] = region.v2; + uvs[2] = region.u; + uvs[3] = region.v; + uvs[4] = region.u2; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v2; + } + }; + RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) { + var vertexOffset = this.offset; + var x = bone.worldX, y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var offsetX = 0, offsetY = 0; + offsetX = vertexOffset[RegionAttachment.OX1]; + offsetY = vertexOffset[RegionAttachment.OY1]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX2]; + offsetY = vertexOffset[RegionAttachment.OY2]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX3]; + offsetY = vertexOffset[RegionAttachment.OY3]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX4]; + offsetY = vertexOffset[RegionAttachment.OY4]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + }; + RegionAttachment.OX1 = 0; + RegionAttachment.OY1 = 1; + RegionAttachment.OX2 = 2; + RegionAttachment.OY2 = 3; + RegionAttachment.OX3 = 4; + RegionAttachment.OY3 = 5; + RegionAttachment.OX4 = 6; + RegionAttachment.OY4 = 7; + RegionAttachment.X1 = 0; + RegionAttachment.Y1 = 1; + RegionAttachment.C1R = 2; + RegionAttachment.C1G = 3; + RegionAttachment.C1B = 4; + RegionAttachment.C1A = 5; + RegionAttachment.U1 = 6; + RegionAttachment.V1 = 7; + RegionAttachment.X2 = 8; + RegionAttachment.Y2 = 9; + RegionAttachment.C2R = 10; + RegionAttachment.C2G = 11; + RegionAttachment.C2B = 12; + RegionAttachment.C2A = 13; + RegionAttachment.U2 = 14; + RegionAttachment.V2 = 15; + RegionAttachment.X3 = 16; + RegionAttachment.Y3 = 17; + RegionAttachment.C3R = 18; + RegionAttachment.C3G = 19; + RegionAttachment.C3B = 20; + RegionAttachment.C3A = 21; + RegionAttachment.U3 = 22; + RegionAttachment.V3 = 23; + RegionAttachment.X4 = 24; + RegionAttachment.Y4 = 25; + RegionAttachment.C4R = 26; + RegionAttachment.C4G = 27; + RegionAttachment.C4B = 28; + RegionAttachment.C4A = 29; + RegionAttachment.U4 = 30; + RegionAttachment.V4 = 31; + return RegionAttachment; + }(spine.Attachment)); + spine.RegionAttachment = RegionAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var JitterEffect = (function () { + function JitterEffect(jitterX, jitterY) { + this.jitterX = 0; + this.jitterY = 0; + this.jitterX = jitterX; + this.jitterY = jitterY; + } + JitterEffect.prototype.begin = function (skeleton) { + }; + JitterEffect.prototype.transform = function (position, uv, light, dark) { + position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + }; + JitterEffect.prototype.end = function () { + }; + return JitterEffect; + }()); + spine.JitterEffect = JitterEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SwirlEffect = (function () { + function SwirlEffect(radius) { + this.centerX = 0; + this.centerY = 0; + this.radius = 0; + this.angle = 0; + this.worldX = 0; + this.worldY = 0; + this.radius = radius; + } + SwirlEffect.prototype.begin = function (skeleton) { + this.worldX = skeleton.x + this.centerX; + this.worldY = skeleton.y + this.centerY; + }; + SwirlEffect.prototype.transform = function (position, uv, light, dark) { + var radAngle = this.angle * spine.MathUtils.degreesToRadians; + var x = position.x - this.worldX; + var y = position.y - this.worldY; + var dist = Math.sqrt(x * x + y * y); + if (dist < this.radius) { + var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius); + var cos = Math.cos(theta); + var sin = Math.sin(theta); + position.x = cos * x - sin * y + this.worldX; + position.y = sin * x + cos * y + this.worldY; + } + }; + SwirlEffect.prototype.end = function () { + }; + SwirlEffect.interpolation = new spine.PowOut(2); + return SwirlEffect; + }()); + spine.SwirlEffect = SwirlEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var AssetManager = (function (_super) { + __extends(AssetManager, _super); + function AssetManager(context, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + return _super.call(this, function (image) { + return new spine.webgl.GLTexture(context, image); + }, pathPrefix) || this; + } + return AssetManager; + }(spine.AssetManager)); + webgl.AssetManager = AssetManager; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var OrthoCamera = (function () { + function OrthoCamera(viewportWidth, viewportHeight) { + this.position = new webgl.Vector3(0, 0, 0); + this.direction = new webgl.Vector3(0, 0, -1); + this.up = new webgl.Vector3(0, 1, 0); + this.near = 0; + this.far = 100; + this.zoom = 1; + this.viewportWidth = 0; + this.viewportHeight = 0; + this.projectionView = new webgl.Matrix4(); + this.inverseProjectionView = new webgl.Matrix4(); + this.projection = new webgl.Matrix4(); + this.view = new webgl.Matrix4(); + this.tmp = new webgl.Vector3(); + this.viewportWidth = viewportWidth; + this.viewportHeight = viewportHeight; + this.update(); + } + OrthoCamera.prototype.update = function () { + var projection = this.projection; + var view = this.view; + var projectionView = this.projectionView; + var inverseProjectionView = this.inverseProjectionView; + var zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight; + projection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far); + view.lookAt(this.position, this.direction, this.up); + projectionView.set(projection.values); + projectionView.multiply(view); + inverseProjectionView.set(projectionView.values).invert(); + }; + OrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) { + var x = screenCoords.x, y = screenHeight - screenCoords.y - 1; + var tmp = this.tmp; + tmp.x = (2 * x) / screenWidth - 1; + tmp.y = (2 * y) / screenHeight - 1; + tmp.z = (2 * screenCoords.z) - 1; + tmp.project(this.inverseProjectionView); + screenCoords.set(tmp.x, tmp.y, tmp.z); + return screenCoords; + }; + OrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) { + this.viewportWidth = viewportWidth; + this.viewportHeight = viewportHeight; + }; + return OrthoCamera; + }()); + webgl.OrthoCamera = OrthoCamera; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var GLTexture = (function (_super) { + __extends(GLTexture, _super); + function GLTexture(context, image, useMipMaps) { + if (useMipMaps === void 0) { useMipMaps = false; } + var _this = _super.call(this, image) || this; + _this.texture = null; + _this.boundUnit = 0; + _this.useMipMaps = false; + _this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + _this.useMipMaps = useMipMaps; + _this.restore(); + _this.context.addRestorable(_this); + return _this; + } + GLTexture.prototype.setFilters = function (minFilter, magFilter) { + var gl = this.context.gl; + this.bind(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); + }; + GLTexture.prototype.setWraps = function (uWrap, vWrap) { + var gl = this.context.gl; + this.bind(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap); + }; + GLTexture.prototype.update = function (useMipMaps) { + var gl = this.context.gl; + if (!this.texture) { + this.texture = this.context.gl.createTexture(); + } + this.bind(); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + if (useMipMaps) + gl.generateMipmap(gl.TEXTURE_2D); + }; + GLTexture.prototype.restore = function () { + this.texture = null; + this.update(this.useMipMaps); + }; + GLTexture.prototype.bind = function (unit) { + if (unit === void 0) { unit = 0; } + var gl = this.context.gl; + this.boundUnit = unit; + gl.activeTexture(gl.TEXTURE0 + unit); + gl.bindTexture(gl.TEXTURE_2D, this.texture); + }; + GLTexture.prototype.unbind = function () { + var gl = this.context.gl; + gl.activeTexture(gl.TEXTURE0 + this.boundUnit); + gl.bindTexture(gl.TEXTURE_2D, null); + }; + GLTexture.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + gl.deleteTexture(this.texture); + }; + return GLTexture; + }(spine.Texture)); + webgl.GLTexture = GLTexture; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Input = (function () { + function Input(element) { + this.lastX = 0; + this.lastY = 0; + this.buttonDown = false; + this.currTouch = null; + this.touchesPool = new spine.Pool(function () { + return new spine.webgl.Touch(0, 0, 0); + }); + this.listeners = new Array(); + this.element = element; + this.setupCallbacks(element); + } + Input.prototype.setupCallbacks = function (element) { + var _this = this; + var mouseDown = function (ev) { + if (ev instanceof MouseEvent) { + var rect = element.getBoundingClientRect(); + var x = ev.clientX - rect.left; + var y = ev.clientY - rect.top; + var listeners = _this.listeners; + for (var i = 0; i < listeners.length; i++) { + listeners[i].down(x, y); + } + _this.lastX = x; + _this.lastY = y; + _this.buttonDown = true; + document.addEventListener("mousemove", mouseMove); + document.addEventListener("mouseup", mouseUp); + } + }; + var mouseMove = function (ev) { + if (ev instanceof MouseEvent) { + var rect = element.getBoundingClientRect(); + var x = ev.clientX - rect.left; + var y = ev.clientY - rect.top; + var listeners = _this.listeners; + for (var i = 0; i < listeners.length; i++) { + if (_this.buttonDown) { + listeners[i].dragged(x, y); + } + else { + listeners[i].moved(x, y); + } + } + _this.lastX = x; + _this.lastY = y; + } + }; + var mouseUp = function (ev) { + if (ev instanceof MouseEvent) { + var rect = element.getBoundingClientRect(); + var x = ev.clientX - rect.left; + var y = ev.clientY - rect.top; + var listeners = _this.listeners; + for (var i = 0; i < listeners.length; i++) { + listeners[i].up(x, y); + } + _this.lastX = x; + _this.lastY = y; + _this.buttonDown = false; + document.removeEventListener("mousemove", mouseMove); + document.removeEventListener("mouseup", mouseUp); + } + }; + element.addEventListener("mousedown", mouseDown, true); + element.addEventListener("mousemove", mouseMove, true); + element.addEventListener("mouseup", mouseUp, true); + element.addEventListener("touchstart", function (ev) { + if (_this.currTouch != null) + return; + var touches = ev.changedTouches; + for (var i = 0; i < touches.length; i++) { + var touch = touches[i]; + var rect = element.getBoundingClientRect(); + var x = touch.clientX - rect.left; + var y = touch.clientY - rect.top; + _this.currTouch = _this.touchesPool.obtain(); + _this.currTouch.identifier = touch.identifier; + _this.currTouch.x = x; + _this.currTouch.y = y; + break; + } + var listeners = _this.listeners; + for (var i_16 = 0; i_16 < listeners.length; i_16++) { + listeners[i_16].down(_this.currTouch.x, _this.currTouch.y); + } + console.log("Start " + _this.currTouch.x + ", " + _this.currTouch.y); + _this.lastX = _this.currTouch.x; + _this.lastY = _this.currTouch.y; + _this.buttonDown = true; + ev.preventDefault(); + }, false); + element.addEventListener("touchend", function (ev) { + var touches = ev.changedTouches; + for (var i = 0; i < touches.length; i++) { + var touch = touches[i]; + if (_this.currTouch.identifier === touch.identifier) { + var rect = element.getBoundingClientRect(); + var x = _this.currTouch.x = touch.clientX - rect.left; + var y = _this.currTouch.y = touch.clientY - rect.top; + _this.touchesPool.free(_this.currTouch); + var listeners = _this.listeners; + for (var i_17 = 0; i_17 < listeners.length; i_17++) { + listeners[i_17].up(x, y); + } + console.log("End " + x + ", " + y); + _this.lastX = x; + _this.lastY = y; + _this.buttonDown = false; + _this.currTouch = null; + break; + } + } + ev.preventDefault(); + }, false); + element.addEventListener("touchcancel", function (ev) { + var touches = ev.changedTouches; + for (var i = 0; i < touches.length; i++) { + var touch = touches[i]; + if (_this.currTouch.identifier === touch.identifier) { + var rect = element.getBoundingClientRect(); + var x = _this.currTouch.x = touch.clientX - rect.left; + var y = _this.currTouch.y = touch.clientY - rect.top; + _this.touchesPool.free(_this.currTouch); + var listeners = _this.listeners; + for (var i_18 = 0; i_18 < listeners.length; i_18++) { + listeners[i_18].up(x, y); + } + console.log("End " + x + ", " + y); + _this.lastX = x; + _this.lastY = y; + _this.buttonDown = false; + _this.currTouch = null; + break; + } + } + ev.preventDefault(); + }, false); + element.addEventListener("touchmove", function (ev) { + if (_this.currTouch == null) + return; + var touches = ev.changedTouches; + for (var i = 0; i < touches.length; i++) { + var touch = touches[i]; + if (_this.currTouch.identifier === touch.identifier) { + var rect = element.getBoundingClientRect(); + var x = touch.clientX - rect.left; + var y = touch.clientY - rect.top; + var listeners = _this.listeners; + for (var i_19 = 0; i_19 < listeners.length; i_19++) { + listeners[i_19].dragged(x, y); + } + console.log("Drag " + x + ", " + y); + _this.lastX = _this.currTouch.x = x; + _this.lastY = _this.currTouch.y = y; + break; + } + } + ev.preventDefault(); + }, false); + }; + Input.prototype.addListener = function (listener) { + this.listeners.push(listener); + }; + Input.prototype.removeListener = function (listener) { + var idx = this.listeners.indexOf(listener); + if (idx > -1) { + this.listeners.splice(idx, 1); + } + }; + return Input; + }()); + webgl.Input = Input; + var Touch = (function () { + function Touch(identifier, x, y) { + this.identifier = identifier; + this.x = x; + this.y = y; + } + return Touch; + }()); + webgl.Touch = Touch; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var LoadingScreen = (function () { + function LoadingScreen(renderer) { + this.logo = null; + this.spinner = null; + this.angle = 0; + this.fadeOut = 0; + this.timeKeeper = new spine.TimeKeeper(); + this.backgroundColor = new spine.Color(0.135, 0.135, 0.135, 1); + this.tempColor = new spine.Color(); + this.firstDraw = 0; + this.renderer = renderer; + this.timeKeeper.maxDelta = 9; + if (LoadingScreen.logoImg === null) { + var isSafari = navigator.userAgent.indexOf("Safari") > -1; + LoadingScreen.logoImg = new Image(); + LoadingScreen.logoImg.src = LoadingScreen.SPINE_LOGO_DATA; + if (!isSafari) + LoadingScreen.logoImg.crossOrigin = "anonymous"; + LoadingScreen.logoImg.onload = function (ev) { + LoadingScreen.loaded++; + }; + LoadingScreen.spinnerImg = new Image(); + LoadingScreen.spinnerImg.src = LoadingScreen.SPINNER_DATA; + if (!isSafari) + LoadingScreen.spinnerImg.crossOrigin = "anonymous"; + LoadingScreen.spinnerImg.onload = function (ev) { + LoadingScreen.loaded++; + }; + } + } + LoadingScreen.prototype.draw = function (complete) { + if (complete === void 0) { complete = false; } + if (complete && this.fadeOut > LoadingScreen.FADE_SECONDS) + return; + this.timeKeeper.update(); + var a = Math.abs(Math.sin(this.timeKeeper.totalTime + 0.75)); + this.angle -= this.timeKeeper.delta / 1.4 * 360 * (1 + 1.5 * Math.pow(a, 5)); + var renderer = this.renderer; + var canvas = renderer.canvas; + var gl = renderer.context.gl; + renderer.resize(webgl.ResizeMode.Stretch); + var oldX = renderer.camera.position.x, oldY = renderer.camera.position.y; + renderer.camera.position.set(canvas.width / 2, canvas.height / 2, 0); + renderer.camera.viewportWidth = canvas.width; + renderer.camera.viewportHeight = canvas.height; + if (!complete) { + gl.clearColor(this.backgroundColor.r, this.backgroundColor.g, this.backgroundColor.b, this.backgroundColor.a); + gl.clear(gl.COLOR_BUFFER_BIT); + this.tempColor.a = 1; + } + else { + this.fadeOut += this.timeKeeper.delta * (this.timeKeeper.totalTime < 1 ? 2 : 1); + if (this.fadeOut > LoadingScreen.FADE_SECONDS) { + renderer.camera.position.set(oldX, oldY, 0); + return; + } + a = 1 - this.fadeOut / LoadingScreen.FADE_SECONDS; + this.tempColor.setFromColor(this.backgroundColor); + this.tempColor.a = 1 - (a - 1) * (a - 1); + renderer.begin(); + renderer.quad(true, 0, 0, canvas.width, 0, canvas.width, canvas.height, 0, canvas.height, this.tempColor, this.tempColor, this.tempColor, this.tempColor); + renderer.end(); + } + this.tempColor.set(1, 1, 1, this.tempColor.a); + if (LoadingScreen.loaded != 2) + return; + if (this.logo === null) { + this.logo = new webgl.GLTexture(renderer.context, LoadingScreen.logoImg); + this.spinner = new webgl.GLTexture(renderer.context, LoadingScreen.spinnerImg); + } + this.logo.update(false); + this.spinner.update(false); + var logoWidth = this.logo.getImage().width; + var logoHeight = this.logo.getImage().height; + var spinnerWidth = this.spinner.getImage().width; + var spinnerHeight = this.spinner.getImage().height; + renderer.batcher.setBlendMode(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); + renderer.begin(); + renderer.drawTexture(this.logo, (canvas.width - logoWidth) / 2, (canvas.height - logoHeight) / 2, logoWidth, logoHeight, this.tempColor); + renderer.drawTextureRotated(this.spinner, (canvas.width - spinnerWidth) / 2, (canvas.height - spinnerHeight) / 2, spinnerWidth, spinnerHeight, spinnerWidth / 2, spinnerHeight / 2, this.angle, this.tempColor); + renderer.end(); + renderer.camera.position.set(oldX, oldY, 0); + }; + LoadingScreen.FADE_SECONDS = 1; + LoadingScreen.loaded = 0; + LoadingScreen.spinnerImg = null; + LoadingScreen.logoImg = null; + LoadingScreen.SPINNER_DATA = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAAACXBIWXMAAAsTAAALEwEAmpwYAAALB2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtbG5zOnN0Um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p7FjaR7ZzXEGcinBJDF8DnZ1Ho7wPrYNadHdINGCLdVMdrU6nMdimqHYgiaF2kn4IXJ8FMJY6iPRxsPqTksbc55ZJP2vHgOnuYwD2tU4k/eycaT891g0F5YDZ7qfQ3SidTAZgG4By4FwHgBtYBpYbZ/l/2EJnC9N0gaQAAAAASUVORK5CYII="; + return LoadingScreen; + }()); + webgl.LoadingScreen = LoadingScreen; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + webgl.M00 = 0; + webgl.M01 = 4; + webgl.M02 = 8; + webgl.M03 = 12; + webgl.M10 = 1; + webgl.M11 = 5; + webgl.M12 = 9; + webgl.M13 = 13; + webgl.M20 = 2; + webgl.M21 = 6; + webgl.M22 = 10; + webgl.M23 = 14; + webgl.M30 = 3; + webgl.M31 = 7; + webgl.M32 = 11; + webgl.M33 = 15; + var Matrix4 = (function () { + function Matrix4() { + this.temp = new Float32Array(16); + this.values = new Float32Array(16); + var v = this.values; + v[webgl.M00] = 1; + v[webgl.M11] = 1; + v[webgl.M22] = 1; + v[webgl.M33] = 1; + } + Matrix4.prototype.set = function (values) { + this.values.set(values); + return this; + }; + Matrix4.prototype.transpose = function () { + var t = this.temp; + var v = this.values; + t[webgl.M00] = v[webgl.M00]; + t[webgl.M01] = v[webgl.M10]; + t[webgl.M02] = v[webgl.M20]; + t[webgl.M03] = v[webgl.M30]; + t[webgl.M10] = v[webgl.M01]; + t[webgl.M11] = v[webgl.M11]; + t[webgl.M12] = v[webgl.M21]; + t[webgl.M13] = v[webgl.M31]; + t[webgl.M20] = v[webgl.M02]; + t[webgl.M21] = v[webgl.M12]; + t[webgl.M22] = v[webgl.M22]; + t[webgl.M23] = v[webgl.M32]; + t[webgl.M30] = v[webgl.M03]; + t[webgl.M31] = v[webgl.M13]; + t[webgl.M32] = v[webgl.M23]; + t[webgl.M33] = v[webgl.M33]; + return this.set(t); + }; + Matrix4.prototype.identity = function () { + var v = this.values; + v[webgl.M00] = 1; + v[webgl.M01] = 0; + v[webgl.M02] = 0; + v[webgl.M03] = 0; + v[webgl.M10] = 0; + v[webgl.M11] = 1; + v[webgl.M12] = 0; + v[webgl.M13] = 0; + v[webgl.M20] = 0; + v[webgl.M21] = 0; + v[webgl.M22] = 1; + v[webgl.M23] = 0; + v[webgl.M30] = 0; + v[webgl.M31] = 0; + v[webgl.M32] = 0; + v[webgl.M33] = 1; + return this; + }; + Matrix4.prototype.invert = function () { + var v = this.values; + var t = this.temp; + var l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] + + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] + - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] + - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] + + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] + + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] + - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] + - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + if (l_det == 0) + throw new Error("non-invertible matrix"); + var inv_det = 1.0 / l_det; + t[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32] + - v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32] + + v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32] + - v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33]; + t[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22] + + v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23]; + t[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32] + + v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32] + - v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32] + + v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33]; + t[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22] + - v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23]; + t[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31] + - v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33]; + t[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31] + + v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33]; + t[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31] + - v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33]; + t[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21] + + v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23]; + t[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31] + + v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32]; + t[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31] + - v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32]; + t[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31] + + v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32]; + t[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21] + - v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22]; + v[webgl.M00] = t[webgl.M00] * inv_det; + v[webgl.M01] = t[webgl.M01] * inv_det; + v[webgl.M02] = t[webgl.M02] * inv_det; + v[webgl.M03] = t[webgl.M03] * inv_det; + v[webgl.M10] = t[webgl.M10] * inv_det; + v[webgl.M11] = t[webgl.M11] * inv_det; + v[webgl.M12] = t[webgl.M12] * inv_det; + v[webgl.M13] = t[webgl.M13] * inv_det; + v[webgl.M20] = t[webgl.M20] * inv_det; + v[webgl.M21] = t[webgl.M21] * inv_det; + v[webgl.M22] = t[webgl.M22] * inv_det; + v[webgl.M23] = t[webgl.M23] * inv_det; + v[webgl.M30] = t[webgl.M30] * inv_det; + v[webgl.M31] = t[webgl.M31] * inv_det; + v[webgl.M32] = t[webgl.M32] * inv_det; + v[webgl.M33] = t[webgl.M33] * inv_det; + return this; + }; + Matrix4.prototype.determinant = function () { + var v = this.values; + return v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] + + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] + - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] + - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] + + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] + + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] + - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] + - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + }; + Matrix4.prototype.translate = function (x, y, z) { + var v = this.values; + v[webgl.M03] += x; + v[webgl.M13] += y; + v[webgl.M23] += z; + return this; + }; + Matrix4.prototype.copy = function () { + return new Matrix4().set(this.values); + }; + Matrix4.prototype.projection = function (near, far, fovy, aspectRatio) { + this.identity(); + var l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0)); + var l_a1 = (far + near) / (near - far); + var l_a2 = (2 * far * near) / (near - far); + var v = this.values; + v[webgl.M00] = l_fd / aspectRatio; + v[webgl.M10] = 0; + v[webgl.M20] = 0; + v[webgl.M30] = 0; + v[webgl.M01] = 0; + v[webgl.M11] = l_fd; + v[webgl.M21] = 0; + v[webgl.M31] = 0; + v[webgl.M02] = 0; + v[webgl.M12] = 0; + v[webgl.M22] = l_a1; + v[webgl.M32] = -1; + v[webgl.M03] = 0; + v[webgl.M13] = 0; + v[webgl.M23] = l_a2; + v[webgl.M33] = 0; + return this; + }; + Matrix4.prototype.ortho2d = function (x, y, width, height) { + return this.ortho(x, x + width, y, y + height, 0, 1); + }; + Matrix4.prototype.ortho = function (left, right, bottom, top, near, far) { + this.identity(); + var x_orth = 2 / (right - left); + var y_orth = 2 / (top - bottom); + var z_orth = -2 / (far - near); + var tx = -(right + left) / (right - left); + var ty = -(top + bottom) / (top - bottom); + var tz = -(far + near) / (far - near); + var v = this.values; + v[webgl.M00] = x_orth; + v[webgl.M10] = 0; + v[webgl.M20] = 0; + v[webgl.M30] = 0; + v[webgl.M01] = 0; + v[webgl.M11] = y_orth; + v[webgl.M21] = 0; + v[webgl.M31] = 0; + v[webgl.M02] = 0; + v[webgl.M12] = 0; + v[webgl.M22] = z_orth; + v[webgl.M32] = 0; + v[webgl.M03] = tx; + v[webgl.M13] = ty; + v[webgl.M23] = tz; + v[webgl.M33] = 1; + return this; + }; + Matrix4.prototype.multiply = function (matrix) { + var t = this.temp; + var v = this.values; + var m = matrix.values; + t[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30]; + t[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31]; + t[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32]; + t[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33]; + t[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30]; + t[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31]; + t[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32]; + t[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33]; + t[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30]; + t[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31]; + t[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32]; + t[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33]; + t[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30]; + t[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31]; + t[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32]; + t[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33]; + return this.set(this.temp); + }; + Matrix4.prototype.multiplyLeft = function (matrix) { + var t = this.temp; + var v = this.values; + var m = matrix.values; + t[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30]; + t[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31]; + t[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32]; + t[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33]; + t[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30]; + t[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31]; + t[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32]; + t[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33]; + t[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30]; + t[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31]; + t[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32]; + t[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33]; + t[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30]; + t[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31]; + t[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32]; + t[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33]; + return this.set(this.temp); + }; + Matrix4.prototype.lookAt = function (position, direction, up) { + Matrix4.initTemps(); + var xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis; + zAxis.setFrom(direction).normalize(); + xAxis.setFrom(direction).normalize(); + xAxis.cross(up).normalize(); + yAxis.setFrom(xAxis).cross(zAxis).normalize(); + this.identity(); + var val = this.values; + val[webgl.M00] = xAxis.x; + val[webgl.M01] = xAxis.y; + val[webgl.M02] = xAxis.z; + val[webgl.M10] = yAxis.x; + val[webgl.M11] = yAxis.y; + val[webgl.M12] = yAxis.z; + val[webgl.M20] = -zAxis.x; + val[webgl.M21] = -zAxis.y; + val[webgl.M22] = -zAxis.z; + Matrix4.tmpMatrix.identity(); + Matrix4.tmpMatrix.values[webgl.M03] = -position.x; + Matrix4.tmpMatrix.values[webgl.M13] = -position.y; + Matrix4.tmpMatrix.values[webgl.M23] = -position.z; + this.multiply(Matrix4.tmpMatrix); + return this; + }; + Matrix4.initTemps = function () { + if (Matrix4.xAxis === null) + Matrix4.xAxis = new webgl.Vector3(); + if (Matrix4.yAxis === null) + Matrix4.yAxis = new webgl.Vector3(); + if (Matrix4.zAxis === null) + Matrix4.zAxis = new webgl.Vector3(); + }; + Matrix4.xAxis = null; + Matrix4.yAxis = null; + Matrix4.zAxis = null; + Matrix4.tmpMatrix = new Matrix4(); + return Matrix4; + }()); + webgl.Matrix4 = Matrix4; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Mesh = (function () { + function Mesh(context, attributes, maxVertices, maxIndices) { + this.attributes = attributes; + this.verticesLength = 0; + this.dirtyVertices = false; + this.indicesLength = 0; + this.dirtyIndices = false; + this.elementsPerVertex = 0; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.elementsPerVertex = 0; + for (var i = 0; i < attributes.length; i++) { + this.elementsPerVertex += attributes[i].numElements; + } + this.vertices = new Float32Array(maxVertices * this.elementsPerVertex); + this.indices = new Uint16Array(maxIndices); + this.context.addRestorable(this); + } + Mesh.prototype.getAttributes = function () { return this.attributes; }; + Mesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; }; + Mesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; }; + Mesh.prototype.setVerticesLength = function (length) { + this.dirtyVertices = true; + this.verticesLength = length; + }; + Mesh.prototype.getVertices = function () { return this.vertices; }; + Mesh.prototype.maxIndices = function () { return this.indices.length; }; + Mesh.prototype.numIndices = function () { return this.indicesLength; }; + Mesh.prototype.setIndicesLength = function (length) { + this.dirtyIndices = true; + this.indicesLength = length; + }; + Mesh.prototype.getIndices = function () { return this.indices; }; + ; + Mesh.prototype.getVertexSizeInFloats = function () { + var size = 0; + for (var i = 0; i < this.attributes.length; i++) { + var attribute = this.attributes[i]; + size += attribute.numElements; + } + return size; + }; + Mesh.prototype.setVertices = function (vertices) { + this.dirtyVertices = true; + if (vertices.length > this.vertices.length) + throw Error("Mesh can't store more than " + this.maxVertices() + " vertices"); + this.vertices.set(vertices, 0); + this.verticesLength = vertices.length; + }; + Mesh.prototype.setIndices = function (indices) { + this.dirtyIndices = true; + if (indices.length > this.indices.length) + throw Error("Mesh can't store more than " + this.maxIndices() + " indices"); + this.indices.set(indices, 0); + this.indicesLength = indices.length; + }; + Mesh.prototype.draw = function (shader, primitiveType) { + this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex); + }; + Mesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) { + var gl = this.context.gl; + if (this.dirtyVertices || this.dirtyIndices) + this.update(); + this.bind(shader); + if (this.indicesLength > 0) { + gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2); + } + else { + gl.drawArrays(primitiveType, offset, count); + } + this.unbind(shader); + }; + Mesh.prototype.bind = function (shader) { + var gl = this.context.gl; + gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); + var offset = 0; + for (var i = 0; i < this.attributes.length; i++) { + var attrib = this.attributes[i]; + var location_1 = shader.getAttributeLocation(attrib.name); + gl.enableVertexAttribArray(location_1); + gl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4); + offset += attrib.numElements; + } + if (this.indicesLength > 0) + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); + }; + Mesh.prototype.unbind = function (shader) { + var gl = this.context.gl; + for (var i = 0; i < this.attributes.length; i++) { + var attrib = this.attributes[i]; + var location_2 = shader.getAttributeLocation(attrib.name); + gl.disableVertexAttribArray(location_2); + } + gl.bindBuffer(gl.ARRAY_BUFFER, null); + if (this.indicesLength > 0) + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); + }; + Mesh.prototype.update = function () { + var gl = this.context.gl; + if (this.dirtyVertices) { + if (!this.verticesBuffer) { + this.verticesBuffer = gl.createBuffer(); + } + gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); + gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW); + this.dirtyVertices = false; + } + if (this.dirtyIndices) { + if (!this.indicesBuffer) { + this.indicesBuffer = gl.createBuffer(); + } + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW); + this.dirtyIndices = false; + } + }; + Mesh.prototype.restore = function () { + this.verticesBuffer = null; + this.indicesBuffer = null; + this.update(); + }; + Mesh.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + gl.deleteBuffer(this.verticesBuffer); + gl.deleteBuffer(this.indicesBuffer); + }; + return Mesh; + }()); + webgl.Mesh = Mesh; + var VertexAttribute = (function () { + function VertexAttribute(name, type, numElements) { + this.name = name; + this.type = type; + this.numElements = numElements; + } + return VertexAttribute; + }()); + webgl.VertexAttribute = VertexAttribute; + var Position2Attribute = (function (_super) { + __extends(Position2Attribute, _super); + function Position2Attribute() { + return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this; + } + return Position2Attribute; + }(VertexAttribute)); + webgl.Position2Attribute = Position2Attribute; + var Position3Attribute = (function (_super) { + __extends(Position3Attribute, _super); + function Position3Attribute() { + return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this; + } + return Position3Attribute; + }(VertexAttribute)); + webgl.Position3Attribute = Position3Attribute; + var TexCoordAttribute = (function (_super) { + __extends(TexCoordAttribute, _super); + function TexCoordAttribute(unit) { + if (unit === void 0) { unit = 0; } + return _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? "" : unit), VertexAttributeType.Float, 2) || this; + } + return TexCoordAttribute; + }(VertexAttribute)); + webgl.TexCoordAttribute = TexCoordAttribute; + var ColorAttribute = (function (_super) { + __extends(ColorAttribute, _super); + function ColorAttribute() { + return _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this; + } + return ColorAttribute; + }(VertexAttribute)); + webgl.ColorAttribute = ColorAttribute; + var Color2Attribute = (function (_super) { + __extends(Color2Attribute, _super); + function Color2Attribute() { + return _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this; + } + return Color2Attribute; + }(VertexAttribute)); + webgl.Color2Attribute = Color2Attribute; + var VertexAttributeType; + (function (VertexAttributeType) { + VertexAttributeType[VertexAttributeType["Float"] = 0] = "Float"; + })(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var PolygonBatcher = (function () { + function PolygonBatcher(context, twoColorTint, maxVertices) { + if (twoColorTint === void 0) { twoColorTint = true; } + if (maxVertices === void 0) { maxVertices = 10920; } + this.isDrawing = false; + this.shader = null; + this.lastTexture = null; + this.verticesLength = 0; + this.indicesLength = 0; + if (maxVertices > 10920) + throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + var attributes = twoColorTint ? + [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] : + [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()]; + this.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3); + this.srcBlend = this.context.gl.SRC_ALPHA; + this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; + } + PolygonBatcher.prototype.begin = function (shader) { + var gl = 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 = shader; + this.lastTexture = null; + this.isDrawing = true; + gl.enable(gl.BLEND); + gl.blendFunc(this.srcBlend, this.dstBlend); + }; + PolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) { + var gl = this.context.gl; + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + if (this.isDrawing) { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + }; + PolygonBatcher.prototype.draw = function (texture, vertices, indices) { + if (texture != this.lastTexture) { + this.flush(); + this.lastTexture = texture; + } + else if (this.verticesLength + vertices.length > this.mesh.getVertices().length || + this.indicesLength + indices.length > this.mesh.getIndices().length) { + this.flush(); + } + var indexStart = this.mesh.numVertices(); + this.mesh.getVertices().set(vertices, this.verticesLength); + this.verticesLength += vertices.length; + this.mesh.setVerticesLength(this.verticesLength); + var indicesArray = this.mesh.getIndices(); + for (var i = this.indicesLength, j = 0; j < indices.length; i++, j++) + indicesArray[i] = indices[j] + indexStart; + this.indicesLength += indices.length; + this.mesh.setIndicesLength(this.indicesLength); + }; + PolygonBatcher.prototype.flush = function () { + var gl = this.context.gl; + if (this.verticesLength == 0) + return; + this.lastTexture.bind(); + this.mesh.draw(this.shader, gl.TRIANGLES); + this.verticesLength = 0; + this.indicesLength = 0; + this.mesh.setVerticesLength(0); + this.mesh.setIndicesLength(0); + this.drawCalls++; + }; + PolygonBatcher.prototype.end = function () { + var gl = this.context.gl; + if (!this.isDrawing) + throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()"); + if (this.verticesLength > 0 || this.indicesLength > 0) + this.flush(); + this.shader = null; + this.lastTexture = null; + this.isDrawing = false; + gl.disable(gl.BLEND); + }; + PolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; }; + PolygonBatcher.prototype.dispose = function () { + this.mesh.dispose(); + }; + return PolygonBatcher; + }()); + webgl.PolygonBatcher = PolygonBatcher; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var SceneRenderer = (function () { + function SceneRenderer(canvas, context, twoColorTint) { + if (twoColorTint === void 0) { twoColorTint = true; } + this.twoColorTint = false; + 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 spine.Color(1, 1, 1, 1); + this.canvas = canvas; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.twoColorTint = twoColorTint; + this.camera = new webgl.OrthoCamera(canvas.width, canvas.height); + this.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context); + this.batcher = new webgl.PolygonBatcher(this.context, twoColorTint); + this.shapesShader = webgl.Shader.newColored(this.context); + this.shapes = new webgl.ShapeRenderer(this.context); + this.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint); + this.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context); + } + SceneRenderer.prototype.begin = function () { + this.camera.update(); + this.enableRenderer(this.batcher); + }; + SceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + if (slotRangeStart === void 0) { slotRangeStart = -1; } + if (slotRangeEnd === void 0) { slotRangeEnd = -1; } + this.enableRenderer(this.batcher); + this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha; + this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd); + }; + SceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + if (ignoredBones === void 0) { ignoredBones = null; } + this.enableRenderer(this.shapes); + this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha; + this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones); + }; + SceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u; + quad[i++] = v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u2; + quad[i++] = v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u2; + quad[i++] = v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u; + quad[i++] = v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) { + if (color === void 0) { color = null; } + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var worldOriginX = x + pivotX; + var worldOriginY = y + pivotY; + var fx = -pivotX; + var fy = -pivotY; + var fx2 = width - pivotX; + var fy2 = height - pivotY; + var p1x = fx; + var p1y = fy; + var p2x = fx; + var p2y = fy2; + var p3x = fx2; + var p3y = fy2; + var p4x = fx2; + var p4y = fy; + var x1 = 0; + var y1 = 0; + var x2 = 0; + var y2 = 0; + var x3 = 0; + var y3 = 0; + var x4 = 0; + var y4 = 0; + if (angle != 0) { + var cos = spine.MathUtils.cosDeg(angle); + var sin = spine.MathUtils.sinDeg(angle); + x1 = cos * p1x - sin * p1y; + y1 = sin * p1x + cos * p1y; + x4 = cos * p2x - sin * p2y; + y4 = sin * p2x + cos * p2y; + x3 = cos * p3x - sin * p3y; + y3 = sin * p3x + cos * p3y; + x2 = x3 + (x1 - x4); + y2 = y3 + (y1 - y4); + } + else { + x1 = p1x; + y1 = p1y; + x4 = p2x; + y4 = p2y; + x3 = p3x; + y3 = p3y; + x2 = p4x; + y2 = p4y; + } + x1 += worldOriginX; + y1 += worldOriginY; + x2 += worldOriginX; + y2 += worldOriginY; + x3 += worldOriginX; + y3 += worldOriginY; + x4 += worldOriginX; + y4 += worldOriginY; + var i = 0; + quad[i++] = x1; + quad[i++] = y1; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x2; + quad[i++] = y2; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x3; + quad[i++] = y3; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x4; + quad[i++] = y4; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) { + if (color === void 0) { color = null; } + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u; + quad[i++] = region.v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u2; + quad[i++] = region.v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u2; + quad[i++] = region.v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u; + quad[i++] = region.v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + this.enableRenderer(this.shapes); + this.shapes.line(x, y, x2, y2, color); + }; + SceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + this.enableRenderer(this.shapes); + this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3); + }; + SceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + if (color4 === void 0) { color4 = null; } + this.enableRenderer(this.shapes); + this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4); + }; + SceneRenderer.prototype.rect = function (filled, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.rect(filled, x, y, width, height, color); + }; + SceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.rectLine(filled, x1, y1, x2, y2, width, color); + }; + SceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.polygon(polygonVertices, offset, count, color); + }; + SceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { + if (color === void 0) { color = null; } + if (segments === void 0) { segments = 0; } + this.enableRenderer(this.shapes); + this.shapes.circle(filled, x, y, radius, color, segments); + }; + SceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color); + }; + SceneRenderer.prototype.end = function () { + if (this.activeRenderer === this.batcher) + this.batcher.end(); + else if (this.activeRenderer === this.shapes) + this.shapes.end(); + this.activeRenderer = null; + }; + SceneRenderer.prototype.resize = function (resizeMode) { + var canvas = this.canvas; + var w = canvas.clientWidth; + var h = canvas.clientHeight; + if (canvas.width != w || canvas.height != h) { + canvas.width = w; + canvas.height = h; + } + this.context.gl.viewport(0, 0, canvas.width, canvas.height); + if (resizeMode === ResizeMode.Stretch) { + } + else if (resizeMode === ResizeMode.Expand) { + this.camera.setViewport(w, h); + } + else if (resizeMode === ResizeMode.Fit) { + var sourceWidth = canvas.width, sourceHeight = canvas.height; + var targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight; + var targetRatio = targetHeight / targetWidth; + var sourceRatio = sourceHeight / sourceWidth; + var scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight; + this.camera.viewportWidth = sourceWidth * scale; + this.camera.viewportHeight = sourceHeight * scale; + } + this.camera.update(); + }; + SceneRenderer.prototype.enableRenderer = function (renderer) { + if (this.activeRenderer === renderer) + return; + this.end(); + if (renderer instanceof webgl.PolygonBatcher) { + this.batcherShader.bind(); + this.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); + this.batcherShader.setUniformi("u_texture", 0); + this.batcher.begin(this.batcherShader); + this.activeRenderer = this.batcher; + } + else if (renderer instanceof webgl.ShapeRenderer) { + this.shapesShader.bind(); + this.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); + this.shapes.begin(this.shapesShader); + this.activeRenderer = this.shapes; + } + else { + this.activeRenderer = this.skeletonDebugRenderer; + } + }; + SceneRenderer.prototype.dispose = function () { + this.batcher.dispose(); + this.batcherShader.dispose(); + this.shapes.dispose(); + this.shapesShader.dispose(); + this.skeletonDebugRenderer.dispose(); + }; + return SceneRenderer; + }()); + webgl.SceneRenderer = SceneRenderer; + var ResizeMode; + (function (ResizeMode) { + ResizeMode[ResizeMode["Stretch"] = 0] = "Stretch"; + ResizeMode[ResizeMode["Expand"] = 1] = "Expand"; + ResizeMode[ResizeMode["Fit"] = 2] = "Fit"; + })(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Shader = (function () { + function Shader(context, vertexShader, fragmentShader) { + this.vertexShader = vertexShader; + this.fragmentShader = fragmentShader; + this.vs = null; + this.fs = null; + this.program = null; + this.tmp2x2 = new Float32Array(2 * 2); + this.tmp3x3 = new Float32Array(3 * 3); + this.tmp4x4 = new Float32Array(4 * 4); + this.vsSource = vertexShader; + this.fsSource = fragmentShader; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.context.addRestorable(this); + this.compile(); + } + Shader.prototype.getProgram = function () { return this.program; }; + Shader.prototype.getVertexShader = function () { return this.vertexShader; }; + Shader.prototype.getFragmentShader = function () { return this.fragmentShader; }; + Shader.prototype.getVertexShaderSource = function () { return this.vsSource; }; + Shader.prototype.getFragmentSource = function () { return this.fsSource; }; + Shader.prototype.compile = function () { + var gl = this.context.gl; + try { + this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader); + this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader); + this.program = this.compileProgram(this.vs, this.fs); + } + catch (e) { + this.dispose(); + throw e; + } + }; + Shader.prototype.compileShader = function (type, source) { + var gl = this.context.gl; + var shader = gl.createShader(type); + gl.shaderSource(shader, source); + gl.compileShader(shader); + if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { + var error = "Couldn't compile shader: " + gl.getShaderInfoLog(shader); + gl.deleteShader(shader); + if (!gl.isContextLost()) + throw new Error(error); + } + return shader; + }; + Shader.prototype.compileProgram = function (vs, fs) { + var gl = this.context.gl; + var program = gl.createProgram(); + gl.attachShader(program, vs); + gl.attachShader(program, fs); + gl.linkProgram(program); + if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { + var error = "Couldn't compile shader program: " + gl.getProgramInfoLog(program); + gl.deleteProgram(program); + if (!gl.isContextLost()) + throw new Error(error); + } + return program; + }; + Shader.prototype.restore = function () { + this.compile(); + }; + Shader.prototype.bind = function () { + this.context.gl.useProgram(this.program); + }; + Shader.prototype.unbind = function () { + this.context.gl.useProgram(null); + }; + Shader.prototype.setUniformi = function (uniform, value) { + this.context.gl.uniform1i(this.getUniformLocation(uniform), value); + }; + Shader.prototype.setUniformf = function (uniform, value) { + this.context.gl.uniform1f(this.getUniformLocation(uniform), value); + }; + Shader.prototype.setUniform2f = function (uniform, value, value2) { + this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2); + }; + Shader.prototype.setUniform3f = function (uniform, value, value2, value3) { + this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3); + }; + Shader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) { + this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4); + }; + Shader.prototype.setUniform2x2f = function (uniform, value) { + var gl = this.context.gl; + this.tmp2x2.set(value); + gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2); + }; + Shader.prototype.setUniform3x3f = function (uniform, value) { + var gl = this.context.gl; + this.tmp3x3.set(value); + gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3); + }; + Shader.prototype.setUniform4x4f = function (uniform, value) { + var gl = this.context.gl; + this.tmp4x4.set(value); + gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4); + }; + Shader.prototype.getUniformLocation = function (uniform) { + var gl = this.context.gl; + var location = gl.getUniformLocation(this.program, uniform); + if (!location && !gl.isContextLost()) + throw new Error("Couldn't find location for uniform " + uniform); + return location; + }; + Shader.prototype.getAttributeLocation = function (attribute) { + var gl = this.context.gl; + var location = gl.getAttribLocation(this.program, attribute); + if (location == -1 && !gl.isContextLost()) + throw new Error("Couldn't find location for attribute " + attribute); + return location; + }; + Shader.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + if (this.vs) { + gl.deleteShader(this.vs); + this.vs = null; + } + if (this.fs) { + gl.deleteShader(this.fs); + this.fs = null; + } + if (this.program) { + gl.deleteProgram(this.program); + this.program = null; + } + }; + Shader.newColoredTextured = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.newTwoColoredTextured = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR2 + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_dark = " + Shader.COLOR2 + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.newColored = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tuniform mat4 " + Shader.MVP_MATRIX + ";\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = " + Shader.COLOR + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.MVP_MATRIX = "u_projTrans"; + Shader.POSITION = "a_position"; + Shader.COLOR = "a_color"; + Shader.COLOR2 = "a_color2"; + Shader.TEXCOORDS = "a_texCoords"; + Shader.SAMPLER = "u_texture"; + return Shader; + }()); + webgl.Shader = Shader; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var ShapeRenderer = (function () { + function ShapeRenderer(context, maxVertices) { + if (maxVertices === void 0) { maxVertices = 10920; } + this.isDrawing = false; + this.shapeType = ShapeType.Filled; + this.color = new spine.Color(1, 1, 1, 1); + this.vertexIndex = 0; + this.tmp = new spine.Vector2(); + if (maxVertices > 10920) + throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0); + this.srcBlend = this.context.gl.SRC_ALPHA; + this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; + } + ShapeRenderer.prototype.begin = function (shader) { + if (this.isDrawing) + throw new Error("ShapeRenderer.begin() has already been called"); + this.shader = shader; + this.vertexIndex = 0; + this.isDrawing = true; + var gl = this.context.gl; + gl.enable(gl.BLEND); + gl.blendFunc(this.srcBlend, this.dstBlend); + }; + ShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) { + var gl = this.context.gl; + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + if (this.isDrawing) { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + }; + ShapeRenderer.prototype.setColor = function (color) { + this.color.setFromColor(color); + }; + ShapeRenderer.prototype.setColorWith = function (r, g, b, a) { + this.color.set(r, g, b, a); + }; + ShapeRenderer.prototype.point = function (x, y, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Point, 1); + if (color === null) + color = this.color; + this.vertex(x, y, color); + }; + ShapeRenderer.prototype.line = function (x, y, x2, y2, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Line, 2); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + this.vertex(x, y, color); + this.vertex(x2, y2, color); + }; + ShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + if (color2 === null) + color2 = this.color; + if (color3 === null) + color3 = this.color; + if (filled) { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + } + else { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x2, y2, color); + this.vertex(x3, y3, color2); + this.vertex(x3, y3, color); + this.vertex(x, y, color2); + } + }; + ShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + if (color4 === void 0) { color4 = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + if (color2 === null) + color2 = this.color; + if (color3 === null) + color3 = this.color; + if (color4 === null) + color4 = this.color; + if (filled) { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + this.vertex(x3, y3, color3); + this.vertex(x4, y4, color4); + this.vertex(x, y, color); + } + else { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + this.vertex(x3, y3, color3); + this.vertex(x4, y4, color4); + this.vertex(x4, y4, color4); + this.vertex(x, y, color); + } + }; + ShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color); + }; + ShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { + if (color === void 0) { color = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 8); + if (color === null) + color = this.color; + var t = this.tmp.set(y2 - y1, x1 - x2); + t.normalize(); + width *= 0.5; + var tx = t.x * width; + var ty = t.y * width; + if (!filled) { + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x1 - tx, y1 - ty, color); + } + else { + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + } + }; + ShapeRenderer.prototype.x = function (x, y, size) { + this.line(x - size, y - size, x + size, y + size); + this.line(x - size, y + size, x + size, y - size); + }; + ShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { + if (color === void 0) { color = null; } + if (count < 3) + throw new Error("Polygon must contain at least 3 vertices"); + this.check(ShapeType.Line, count * 2); + if (color === null) + color = this.color; + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + offset <<= 1; + count <<= 1; + var firstX = polygonVertices[offset]; + var firstY = polygonVertices[offset + 1]; + var last = offset + count; + for (var i = offset, n = offset + count - 2; i < n; i += 2) { + var x1 = polygonVertices[i]; + var y1 = polygonVertices[i + 1]; + var x2 = 0; + var y2 = 0; + if (i + 2 >= last) { + x2 = firstX; + y2 = firstY; + } + else { + x2 = polygonVertices[i + 2]; + y2 = polygonVertices[i + 3]; + } + this.vertex(x1, y1, color); + this.vertex(x2, y2, color); + } + }; + ShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { + if (color === void 0) { color = null; } + if (segments === void 0) { segments = 0; } + if (segments === 0) + segments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0); + if (segments <= 0) + throw new Error("segments must be > 0."); + if (color === null) + color = this.color; + var angle = 2 * spine.MathUtils.PI / segments; + var cos = Math.cos(angle); + var sin = Math.sin(angle); + var cx = radius, cy = 0; + if (!filled) { + this.check(ShapeType.Line, segments * 2 + 2); + for (var i = 0; i < segments; i++) { + this.vertex(x + cx, y + cy, color); + var temp_1 = cx; + cx = cos * cx - sin * cy; + cy = sin * temp_1 + cos * cy; + this.vertex(x + cx, y + cy, color); + } + this.vertex(x + cx, y + cy, color); + } + else { + this.check(ShapeType.Filled, segments * 3 + 3); + segments--; + for (var i = 0; i < segments; i++) { + this.vertex(x, y, color); + this.vertex(x + cx, y + cy, color); + var temp_2 = cx; + cx = cos * cx - sin * cy; + cy = sin * temp_2 + cos * cy; + this.vertex(x + cx, y + cy, color); + } + this.vertex(x, y, color); + this.vertex(x + cx, y + cy, color); + } + var temp = cx; + cx = radius; + cy = 0; + this.vertex(x + cx, y + cy, color); + }; + ShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Line, segments * 2 + 2); + if (color === null) + color = this.color; + var subdiv_step = 1 / segments; + var subdiv_step2 = subdiv_step * subdiv_step; + var subdiv_step3 = subdiv_step * subdiv_step * subdiv_step; + var pre1 = 3 * subdiv_step; + var pre2 = 3 * subdiv_step2; + var pre4 = 6 * subdiv_step2; + var pre5 = 6 * subdiv_step3; + var tmp1x = x1 - cx1 * 2 + cx2; + var tmp1y = y1 - cy1 * 2 + cy2; + var tmp2x = (cx1 - cx2) * 3 - x1 + x2; + var tmp2y = (cy1 - cy2) * 3 - y1 + y2; + var fx = x1; + var fy = y1; + var dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3; + var dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3; + var ddfx = tmp1x * pre4 + tmp2x * pre5; + var ddfy = tmp1y * pre4 + tmp2y * pre5; + var dddfx = tmp2x * pre5; + var dddfy = tmp2y * pre5; + while (segments-- > 0) { + this.vertex(fx, fy, color); + fx += dfx; + fy += dfy; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + this.vertex(fx, fy, color); + } + this.vertex(fx, fy, color); + this.vertex(x2, y2, color); + }; + ShapeRenderer.prototype.vertex = function (x, y, color) { + var idx = this.vertexIndex; + var vertices = this.mesh.getVertices(); + vertices[idx++] = x; + vertices[idx++] = y; + vertices[idx++] = color.r; + vertices[idx++] = color.g; + vertices[idx++] = color.b; + vertices[idx++] = color.a; + this.vertexIndex = idx; + }; + ShapeRenderer.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 = false; + }; + ShapeRenderer.prototype.flush = function () { + if (this.vertexIndex == 0) + return; + this.mesh.setVerticesLength(this.vertexIndex); + this.mesh.draw(this.shader, this.shapeType); + this.vertexIndex = 0; + }; + ShapeRenderer.prototype.check = function (shapeType, numVertices) { + if (!this.isDrawing) + throw new Error("ShapeRenderer.begin() has not been called"); + if (this.shapeType == shapeType) { + if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) + this.flush(); + else + return; + } + else { + this.flush(); + this.shapeType = shapeType; + } + }; + ShapeRenderer.prototype.dispose = function () { + this.mesh.dispose(); + }; + return ShapeRenderer; + }()); + webgl.ShapeRenderer = ShapeRenderer; + var ShapeType; + (function (ShapeType) { + ShapeType[ShapeType["Point"] = 0] = "Point"; + ShapeType[ShapeType["Line"] = 1] = "Line"; + ShapeType[ShapeType["Filled"] = 4] = "Filled"; + })(ShapeType = webgl.ShapeType || (webgl.ShapeType = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var SkeletonDebugRenderer = (function () { + function SkeletonDebugRenderer(context) { + this.boneLineColor = new spine.Color(1, 0, 0, 1); + this.boneOriginColor = new spine.Color(0, 1, 0, 1); + this.attachmentLineColor = new spine.Color(0, 0, 1, 0.5); + this.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5); + this.pathColor = new spine.Color().setFromString("FF7F00"); + this.clipColor = new spine.Color(0.8, 0, 0, 2); + this.aabbColor = new spine.Color(0, 1, 0, 0.5); + this.drawBones = true; + this.drawRegionAttachments = true; + this.drawBoundingBoxes = true; + this.drawMeshHull = true; + this.drawMeshTriangles = true; + this.drawPaths = true; + this.drawSkeletonXY = false; + this.drawClipping = true; + this.premultipliedAlpha = false; + this.scale = 1; + this.boneWidth = 2; + this.bounds = new spine.SkeletonBounds(); + this.temp = new Array(); + this.vertices = spine.Utils.newFloatArray(2 * 1024); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + } + SkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) { + if (ignoredBones === void 0) { ignoredBones = null; } + var skeletonX = skeleton.x; + var skeletonY = skeleton.y; + var gl = this.context.gl; + var srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA; + shapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA); + var bones = skeleton.bones; + if (this.drawBones) { + shapes.setColor(this.boneLineColor); + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) + continue; + if (bone.parent == null) + continue; + var x = skeletonX + bone.data.length * bone.a + bone.worldX; + var y = skeletonY + bone.data.length * bone.c + bone.worldY; + shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale); + } + if (this.drawSkeletonXY) + shapes.x(skeletonX, skeletonY, 4 * this.scale); + } + if (this.drawRegionAttachments) { + shapes.setColor(this.attachmentLineColor); + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + var regionAttachment = attachment; + var vertices = this.vertices; + regionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2); + shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]); + shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]); + shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]); + shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]); + } + } + } + if (this.drawMeshHull || this.drawMeshTriangles) { + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.MeshAttachment)) + continue; + var mesh = attachment; + var vertices = this.vertices; + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2); + var triangles = mesh.triangles; + var hullLength = mesh.hullLength; + if (this.drawMeshTriangles) { + shapes.setColor(this.triangleLineColor); + for (var ii = 0, nn = triangles.length; ii < nn; ii += 3) { + var v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2; + shapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]); + } + } + if (this.drawMeshHull && hullLength > 0) { + shapes.setColor(this.attachmentLineColor); + hullLength = (hullLength >> 1) * 2; + var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1]; + for (var ii = 0, nn = hullLength; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + shapes.line(x, y, lastX, lastY); + lastX = x; + lastY = y; + } + } + } + } + if (this.drawBoundingBoxes) { + var bounds = this.bounds; + bounds.update(skeleton, true); + shapes.setColor(this.aabbColor); + shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight()); + var polygons = bounds.polygons; + var boxes = bounds.boundingBoxes; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + shapes.setColor(boxes[i].color); + shapes.polygon(polygon, 0, polygon.length); + } + } + if (this.drawPaths) { + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + continue; + var path = attachment; + var nn = path.worldVerticesLength; + var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); + path.computeWorldVertices(slot, 0, nn, world, 0, 2); + var color = this.pathColor; + var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0; + if (path.closed) { + shapes.setColor(color); + var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1]; + x2 = world[nn - 4]; + y2 = world[nn - 3]; + shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); + shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); + shapes.line(x1, y1, cx1, cy1); + shapes.line(x2, y2, cx2, cy2); + } + nn -= 4; + for (var ii = 4; ii < nn; ii += 6) { + var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3]; + x2 = world[ii + 4]; + y2 = world[ii + 5]; + shapes.setColor(color); + shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); + shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); + shapes.line(x1, y1, cx1, cy1); + shapes.line(x2, y2, cx2, cy2); + x1 = x2; + y1 = y2; + } + } + } + if (this.drawBones) { + shapes.setColor(this.boneOriginColor); + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) + continue; + shapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8); + } + } + if (this.drawClipping) { + var slots = skeleton.slots; + shapes.setColor(this.clipColor); + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.ClippingAttachment)) + continue; + var clip = attachment; + var nn = clip.worldVerticesLength; + var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); + clip.computeWorldVertices(slot, 0, nn, world, 0, 2); + for (var i_20 = 0, n_2 = world.length; i_20 < n_2; i_20 += 2) { + var x = world[i_20]; + var y = world[i_20 + 1]; + var x2 = world[(i_20 + 2) % world.length]; + var y2 = world[(i_20 + 3) % world.length]; + shapes.line(x, y, x2, y2); + } + } + } + }; + SkeletonDebugRenderer.prototype.dispose = function () { + }; + SkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1); + SkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1); + return SkeletonDebugRenderer; + }()); + webgl.SkeletonDebugRenderer = SkeletonDebugRenderer; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Renderable = (function () { + function Renderable(vertices, numVertices, numFloats) { + this.vertices = vertices; + this.numVertices = numVertices; + this.numFloats = numFloats; + } + return Renderable; + }()); + ; + var SkeletonRenderer = (function () { + function SkeletonRenderer(context, twoColorTint) { + if (twoColorTint === void 0) { twoColorTint = true; } + this.premultipliedAlpha = false; + this.vertexEffect = null; + this.tempColor = new spine.Color(); + this.tempColor2 = new spine.Color(); + this.vertexSize = 2 + 2 + 4; + this.twoColorTint = false; + this.renderable = new Renderable(null, 0, 0); + this.clipper = new spine.SkeletonClipping(); + this.temp = new spine.Vector2(); + this.temp2 = new spine.Vector2(); + this.temp3 = new spine.Color(); + this.temp4 = new spine.Color(); + this.twoColorTint = twoColorTint; + if (twoColorTint) + this.vertexSize += 4; + this.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024); + } + SkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) { + if (slotRangeStart === void 0) { slotRangeStart = -1; } + if (slotRangeEnd === void 0) { slotRangeEnd = -1; } + var clipper = this.clipper; + var premultipliedAlpha = this.premultipliedAlpha; + var twoColorTint = this.twoColorTint; + var blendMode = null; + var tempPos = this.temp; + var tempUv = this.temp2; + var tempLight = this.temp3; + var tempDark = this.temp4; + var renderable = this.renderable; + var uvs = null; + var triangles = null; + var drawOrder = skeleton.drawOrder; + var attachmentColor = null; + var skeletonColor = skeleton.color; + var vertexSize = twoColorTint ? 12 : 8; + var inRange = false; + if (slotRangeStart == -1) + inRange = true; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var clippedVertexSize = clipper.isClipping() ? 2 : vertexSize; + var slot = drawOrder[i]; + if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) { + inRange = true; + } + if (!inRange) { + clipper.clipEndWithSlot(slot); + continue; + } + if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) { + inRange = false; + } + var attachment = slot.getAttachment(); + var texture = null; + if (attachment instanceof spine.RegionAttachment) { + var region = attachment; + renderable.vertices = this.vertices; + renderable.numVertices = 4; + renderable.numFloats = clippedVertexSize << 2; + region.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize); + triangles = SkeletonRenderer.QUAD_TRIANGLES; + uvs = region.uvs; + texture = region.region.renderObject.texture; + attachmentColor = region.color; + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + renderable.vertices = this.vertices; + renderable.numVertices = (mesh.worldVerticesLength >> 1); + renderable.numFloats = renderable.numVertices * clippedVertexSize; + if (renderable.numFloats > renderable.vertices.length) { + renderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats); + } + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize); + triangles = mesh.triangles; + texture = mesh.region.renderObject.texture; + uvs = mesh.uvs; + attachmentColor = mesh.color; + } + else if (attachment instanceof spine.ClippingAttachment) { + var clip = (attachment); + clipper.clipStart(slot, clip); + continue; + } + else { + clipper.clipEndWithSlot(slot); + continue; + } + if (texture != null) { + var slotColor = slot.color; + var finalColor = this.tempColor; + finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r; + finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g; + finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b; + finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a; + if (premultipliedAlpha) { + finalColor.r *= finalColor.a; + finalColor.g *= finalColor.a; + finalColor.b *= finalColor.a; + } + var darkColor = this.tempColor2; + if (slot.darkColor == null) + darkColor.set(0, 0, 0, 1.0); + else { + if (premultipliedAlpha) { + darkColor.r = slot.darkColor.r * finalColor.a; + darkColor.g = slot.darkColor.g * finalColor.a; + darkColor.b = slot.darkColor.b * finalColor.a; + } + else { + darkColor.setFromColor(slot.darkColor); + } + darkColor.a = premultipliedAlpha ? 1.0 : 0.0; + } + var slotBlendMode = slot.data.blendMode; + if (slotBlendMode != blendMode) { + blendMode = slotBlendMode; + batcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode)); + } + if (clipper.isClipping()) { + clipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint); + var clippedVertices = new Float32Array(clipper.clippedVertices); + var clippedTriangles = clipper.clippedTriangles; + if (this.vertexEffect != null) { + var vertexEffect = this.vertexEffect; + var verts = clippedVertices; + if (!twoColorTint) { + for (var v = 0, n_3 = clippedVertices.length; v < n_3; v += vertexSize) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); + tempUv.x = verts[v + 6]; + tempUv.y = verts[v + 7]; + tempDark.set(0, 0, 0, 0); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + } + } + else { + for (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); + tempUv.x = verts[v + 6]; + tempUv.y = verts[v + 7]; + tempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + verts[v + 8] = tempDark.r; + verts[v + 9] = tempDark.g; + verts[v + 10] = tempDark.b; + verts[v + 11] = tempDark.a; + } + } + } + batcher.draw(texture, clippedVertices, clippedTriangles); + } + else { + var verts = renderable.vertices; + if (this.vertexEffect != null) { + var vertexEffect = this.vertexEffect; + if (!twoColorTint) { + for (var v = 0, u = 0, n_5 = renderable.numFloats; v < n_5; v += vertexSize, u += 2) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempUv.x = uvs[u]; + tempUv.y = uvs[u + 1]; + tempLight.setFromColor(finalColor); + tempDark.set(0, 0, 0, 0); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + } + } + else { + for (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempUv.x = uvs[u]; + tempUv.y = uvs[u + 1]; + tempLight.setFromColor(finalColor); + tempDark.setFromColor(darkColor); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + verts[v + 8] = tempDark.r; + verts[v + 9] = tempDark.g; + verts[v + 10] = tempDark.b; + verts[v + 11] = tempDark.a; + } + } + } + else { + if (!twoColorTint) { + for (var v = 2, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) { + verts[v] = finalColor.r; + verts[v + 1] = finalColor.g; + verts[v + 2] = finalColor.b; + verts[v + 3] = finalColor.a; + verts[v + 4] = uvs[u]; + verts[v + 5] = uvs[u + 1]; + } + } + else { + for (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) { + verts[v] = finalColor.r; + verts[v + 1] = finalColor.g; + verts[v + 2] = finalColor.b; + verts[v + 3] = finalColor.a; + verts[v + 4] = uvs[u]; + verts[v + 5] = uvs[u + 1]; + verts[v + 6] = darkColor.r; + verts[v + 7] = darkColor.g; + verts[v + 8] = darkColor.b; + verts[v + 9] = darkColor.a; + } + } + } + var view = renderable.vertices.subarray(0, renderable.numFloats); + batcher.draw(texture, view, triangles); + } + } + clipper.clipEndWithSlot(slot); + } + clipper.clipEnd(); + }; + SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; + return SkeletonRenderer; + }()); + webgl.SkeletonRenderer = SkeletonRenderer; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Vector3 = (function () { + function Vector3(x, y, z) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (z === void 0) { z = 0; } + this.x = 0; + this.y = 0; + this.z = 0; + this.x = x; + this.y = y; + this.z = z; + } + Vector3.prototype.setFrom = function (v) { + this.x = v.x; + this.y = v.y; + this.z = v.z; + return this; + }; + Vector3.prototype.set = function (x, y, z) { + this.x = x; + this.y = y; + this.z = z; + return this; + }; + Vector3.prototype.add = function (v) { + this.x += v.x; + this.y += v.y; + this.z += v.z; + return this; + }; + Vector3.prototype.sub = function (v) { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + return this; + }; + Vector3.prototype.scale = function (s) { + this.x *= s; + this.y *= s; + this.z *= s; + return this; + }; + Vector3.prototype.normalize = function () { + var len = this.length(); + if (len == 0) + return this; + len = 1 / len; + this.x *= len; + this.y *= len; + this.z *= len; + return this; + }; + Vector3.prototype.cross = function (v) { + return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x); + }; + Vector3.prototype.multiply = function (matrix) { + var l_mat = matrix.values; + return this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]); + }; + Vector3.prototype.project = function (matrix) { + var l_mat = matrix.values; + var l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]); + return this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w); + }; + Vector3.prototype.dot = function (v) { + return this.x * v.x + this.y * v.y + this.z * v.z; + }; + Vector3.prototype.length = function () { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + }; + Vector3.prototype.distance = function (v) { + var a = v.x - this.x; + var b = v.y - this.y; + var c = v.z - this.z; + return Math.sqrt(a * a + b * b + c * c); + }; + return Vector3; + }()); + webgl.Vector3 = Vector3; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var ManagedWebGLRenderingContext = (function () { + function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) { + if (contextConfig === void 0) { contextConfig = { alpha: "true" }; } + var _this = this; + this.restorables = new Array(); + if (canvasOrContext instanceof HTMLCanvasElement) { + var canvas = canvasOrContext; + this.gl = (canvas.getContext("webgl", contextConfig) || canvas.getContext("experimental-webgl", contextConfig)); + this.canvas = canvas; + canvas.addEventListener("webglcontextlost", function (e) { + var event = e; + if (e) { + e.preventDefault(); + } + }); + canvas.addEventListener("webglcontextrestored", function (e) { + for (var i = 0, n = _this.restorables.length; i < n; i++) { + _this.restorables[i].restore(); + } + }); + } + else { + this.gl = canvasOrContext; + this.canvas = this.gl.canvas; + } + } + ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) { + this.restorables.push(restorable); + }; + ManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) { + var index = this.restorables.indexOf(restorable); + if (index > -1) + this.restorables.splice(index, 1); + }; + return ManagedWebGLRenderingContext; + }()); + webgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext; + var WebGLBlendModeConverter = (function () { + function WebGLBlendModeConverter() { + } + WebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) { + switch (blendMode) { + case spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + case spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE; + case spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + default: throw new Error("Unknown blend mode: " + blendMode); + } + }; + WebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + switch (blendMode) { + case spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; + case spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; + case spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR; + case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE; + default: throw new Error("Unknown blend mode: " + blendMode); + } + }; + WebGLBlendModeConverter.ZERO = 0; + WebGLBlendModeConverter.ONE = 1; + WebGLBlendModeConverter.SRC_COLOR = 0x0300; + WebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301; + WebGLBlendModeConverter.SRC_ALPHA = 0x0302; + WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303; + WebGLBlendModeConverter.DST_ALPHA = 0x0304; + WebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305; + WebGLBlendModeConverter.DST_COLOR = 0x0306; + return WebGLBlendModeConverter; + }()); + webgl.WebGLBlendModeConverter = WebGLBlendModeConverter; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +//# sourceMappingURL=spine-webgl.js.map + +/*** EXPORTS FROM exports-loader ***/ +module.exports = spine; +}.call(window)); + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(3); +var ImageFile = __webpack_require__(169); +var IsPlainObject = __webpack_require__(2); +var JSONFile = __webpack_require__(183); +var MultiFile = __webpack_require__(184); +var TextFile = __webpack_require__(185); + +/** + * @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} [textureURL] - The absolute or relative URL to load the texture image file from. + * @property {string} [textureExtension='png'] - The default file extension to use for the image texture if no url is provided. + * @property {XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture image file. + * @property {string} [normalMap] - The filename of an associated normal map. It uses the same path and url to load as the texture image. + * @property {string} [atlasURL] - The absolute or relative URL to load the atlas data file from. + * @property {string} [atlasExtension='txt'] - The default file extension to use for the atlas data if no url is provided. + * @property {XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas data file. + */ + +/** + * @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, + 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 = []; + + 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', currentBaseURL); + var path = GetFastValue(config, 'path', currentPath); + var prefix = GetFastValue(config, 'prefix', currentPrefix); + 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 = '_SP_' + textureURL; + + var image = new ImageFile(loader, key, textureURL, textureXhrSettings); + + 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 combinedAtlastData = ''; + var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; + + for (var i = 1; i < this.files.length; i++) + { + var file = this.files[i]; + + if (file.type === 'text') + { + atlasKey = file.key.substr(0, file.key.length - 2); + + atlasCache = file.cache; + + combinedAtlastData = combinedAtlastData.concat(file.data); + } + else + { + var key = file.key.substr(4).trim(); + + this.loader.textureManager.addImage(key, file.data); + } + + file.pendingDestroy(); + } + + atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlastData }); + + this.complete = true; + } + } + +}); + +module.exports = SpineFile; + + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(6); +var File = __webpack_require__(12); +var FileTypesManager = __webpack_require__(13); +var GetFastValue = __webpack_require__(3); +var IsPlainObject = __webpack_require__(2); + +/** + * @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); + } + }, + + /** + * 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'); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture; + var linkFile = this.linkFile; + + if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + { + if (this.type === 'image') + { + texture = this.cache.addImage(this.key, this.data, linkFile.data); + } + else + { + texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); + } + + this.pendingDestroy(texture); + + linkFile.pendingDestroy(texture); + } + else if (!linkFile) + { + texture = this.cache.addImage(this.key, this.data); + + this.pendingDestroy(texture); + } + } + +}); + +/** + * 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. + * + * 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#addFileEvent + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Loader.Events + */ + +module.exports = { + + ADD: __webpack_require__(171), + COMPLETE: __webpack_require__(172), + FILE_COMPLETE: __webpack_require__(173), + FILE_KEY_COMPLETE: __webpack_require__(174), + FILE_LOAD_ERROR: __webpack_require__(175), + FILE_LOAD: __webpack_require__(176), + FILE_PROGRESS: __webpack_require__(177), + POST_PROCESS: __webpack_require__(178), + PROGRESS: __webpack_require__(179), + START: __webpack_require__(180) + +}; + + +/***/ }), +/* 171 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), +/* 172 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {integer} totalComplete - The total number of files that successfully loaded. + * @param {integer} totalFailed - The total number of files that failed to load. + */ +module.exports = 'complete'; + + +/***/ }), +/* 173 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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)`. + * + * 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 + * @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. + */ +module.exports = 'filecomplete'; + + +/***/ }), +/* 174 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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-atlas-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 + * }); + * ``` + * + * 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 + * @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. + */ +module.exports = 'filecomplete-'; + + +/***/ }), +/* 175 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + */ +module.exports = 'loaderror'; + + +/***/ }), +/* 176 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + */ +module.exports = 'load'; + + +/***/ }), +/* 177 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), +/* 178 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'postprocess'; + + +/***/ }), +/* 179 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {number} progress - The current progress of the load. A value between 0 and 1. + */ +module.exports = 'progress'; + + +/***/ }), +/* 180 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'start'; + + +/***/ }), +/* 181 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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:|http:\/\/|https:\/\/|\/\/)/)) + { + return file.url; + } + else + { + return baseURL + file.url; + } +}; + +module.exports = GetURL; + + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(29); + +/** + * 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.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); + } + + // 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; + + +/***/ }), +/* 183 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(6); +var File = __webpack_require__(12); +var FileTypesManager = __webpack_require__(13); +var GetFastValue = __webpack_require__(3); +var GetValue = __webpack_require__(11); +var IsPlainObject = __webpack_require__(2); + +/** + * @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 {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". + * @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); + + if (IsPlainObject(url)) + { + // Object provided instead of a URL, so no need to actually load it (populate data with value) + 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; + + var json = JSON.parse(this.xhrLoader.responseText); + + 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#addFileEvent + * @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 {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". + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), +/* 184 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @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) + { + /** + * 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; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = files; + + /** + * 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 {integer} + * @since 3.7.0 + */ + + this.pending = files.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {integer} + * @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 = {}; + + // Link the files + for (var i = 0; i < files.length; i++) + { + files[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++; + } + } + +}); + +module.exports = MultiFile; + + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(6); +var File = __webpack_require__(12); +var FileTypesManager = __webpack_require__(13); +var GetFastValue = __webpack_require__(3); +var IsPlainObject = __webpack_require__(2); + +/** + * @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 extension = 'txt'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'text', + cache: loader.cacheManager.text, + 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#addFileEvent + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), +/* 186 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var AngleBetween = __webpack_require__(15); +var Clamp = __webpack_require__(8); +var Class = __webpack_require__(0); +var ComponentsComputedSize = __webpack_require__(187); +var ComponentsDepth = __webpack_require__(188); +var ComponentsFlip = __webpack_require__(189); +var ComponentsScrollFactor = __webpack_require__(190); +var ComponentsTransform = __webpack_require__(191); +var ComponentsVisible = __webpack_require__(193); +var CounterClockwise = __webpack_require__(7); +var DegToRad = __webpack_require__(25); +var GameObject = __webpack_require__(194); +var RadToDeg = __webpack_require__(9); +var SpineEvents = __webpack_require__(205); +var SpineGameObjectRender = __webpack_require__(212); + +/** + * @classdesc + * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates + * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to + * easily change the skin, slot attachment, bone positions and more. + * + * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly. + * You can only create them if the Spine plugin has been loaded into Phaser. + * + * The quickest way is the Game Object Factory: + * + * ```javascript + * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true); + * ``` + * + * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly` + * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is + * an optional animation to start playing on the skeleton. The final argument `true` sets the + * animation to loop. Look at the documentation for further details on each of these options. + * + * For more control, you can use the Game Object Creator, passing in a Spine Game Object + * Configuration object: + * + * ```javascript + * let jelly = this.make.spine({ + * x: 512, y: 550, key: 'jelly', + * scale: 1.5, + * skinName: 'square_Green', + * animationName: 'jelly-think', loop: true, + * slotName: 'hat', attachmentName: 'images/La_14' + * }); + * ``` + * + * Here, you've got the ability to specify extra details, such as the slot name, attachments or + * overall scale. + * + * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to + * update and render, it must be added to the display and update lists of your Scene: + * + * ```javascript + * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true); + * this.sys.displayList.add(jelly); + * this.sys.updateList.add(jelly); + * ``` + * + * It's possible to enable Spine Game Objects for input, but you should be aware that it will use + * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but + * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created. + * If it's not suitable, provide your own shape to the `setInteractive` method. + * + * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for + * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game + * Object position with it. See the examples for further details. + * + * If your Spine Game Object has black outlines around the different parts of the texture when it + * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have + * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details. + * + * @class SpineGameObject + * @constructor + * @since 3.19.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 {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? + */ +var SpineGameObject = new Class({ + + Extends: GameObject, + + Mixins: [ + ComponentsComputedSize, + ComponentsDepth, + ComponentsFlip, + ComponentsScrollFactor, + ComponentsTransform, + ComponentsVisible, + SpineGameObjectRender + ], + + initialize: + + function SpineGameObject (scene, plugin, x, y, key, animationName, loop) + { + GameObject.call(this, scene, 'Spine'); + + /** + * A reference to the Spine Plugin. + * + * @name SpineGameObject#plugin + * @type {SpinePlugin} + * @since 3.19.0 + */ + this.plugin = plugin; + + /** + * The Spine Skeleton this Game Object is using. + * + * @name SpineGameObject#skeleton + * @type {spine.Skeleton} + * @since 3.19.0 + */ + this.skeleton = null; + + /** + * The Spine Skeleton Data associated with the Skeleton this Game Object is using. + * + * @name SpineGameObject#skeletonData + * @type {spine.SkeletonData} + * @since 3.19.0 + */ + this.skeletonData = null; + + /** + * The Spine Animation State this Game Object is using. + * + * @name SpineGameObject#state + * @type {spine.AnimationState} + * @since 3.19.0 + */ + this.state = null; + + /** + * The Spine Animation State Data associated with the Animation State this Game Object is using. + * + * @name SpineGameObject#stateData + * @type {spine.AnimationStateData} + * @since 3.19.0 + */ + this.stateData = null; + + /** + * A reference to the root bone of the Skeleton. + * + * @name SpineGameObject#root + * @type {spine.Bone} + * @since 3.19.0 + */ + this.root = null; + + /** + * This object holds the calculated bounds of the current + * pose, as set when a new Skeleton is applied. + * + * @name SpineGameObject#bounds + * @type {any} + * @since 3.19.0 + */ + this.bounds = null; + + /** + * A Game Object level flag that allows you to enable debug drawing + * to the Skeleton Debug Renderer by toggling it. + * + * @name SpineGameObject#drawDebug + * @type {boolean} + * @since 3.19.0 + */ + this.drawDebug = false; + + /** + * The factor to scale the Animation update time by. + * + * @name SpineGameObject#timeScale + * @type {number} + * @since 3.19.0 + */ + this.timeScale = 1; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginX + * @type {number} + * @since 3.19.0 + */ + this.displayOriginX = 0; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginY + * @type {number} + * @since 3.19.0 + */ + this.displayOriginY = 0; + + /** + * A flag that stores if the texture associated with the current + * Skin being used by this Game Object, has its alpha pre-multiplied + * into it, or not. + * + * @name SpineGameObject#preMultipliedAlpha + * @type {boolean} + * @since 3.19.0 + */ + this.preMultipliedAlpha = false; + + /** + * A default Blend Mode. You cannot change the blend mode of a + * Spine Game Object. + * + * @name SpineGameObject#blendMode + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.blendMode = 0; + + this.setPosition(x, y); + + if (key) + { + this.setSkeleton(key, animationName, loop); + } + }, + + /** + * Overrides the default Game Object method and always returns true. + * Rendering is decided in the renderer functions. + * + * @method SpineGameObject#willRender + * @since 3.19.0 + * + * @return {boolean} Always returns `true`. + */ + willRender: function () + { + return true; + }, + + /** + * Set the Alpha level for the whole Skeleton 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 SpineGameObject#setAlpha + * @since 3.19.0 + * + * @param {number} [value=1] - The alpha value used for the whole Skeleton. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (value, slotName) + { + if (value === undefined) { value = 1; } + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + slot.color.a = Clamp(value, 0, 1); + } + } + else + { + this.alpha = value; + } + + return this; + }, + + /** + * The alpha value of the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#alpha + * @type {number} + * @since 3.19.0 + */ + alpha: { + + get: function () + { + return this.skeleton.color.a; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.a = v; + } + + if (v === 0) + { + this.renderFlags &= ~2; + } + else + { + this.renderFlags |= 2; + } + } + + }, + + /** + * The amount of red used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#red + * @type {number} + * @since 3.19.0 + */ + red: { + + get: function () + { + return this.skeleton.color.r; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.r = v; + } + } + + }, + + /** + * The amount of green used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#green + * @type {number} + * @since 3.19.0 + */ + green: { + + get: function () + { + return this.skeleton.color.g; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.g = v; + } + } + + }, + + /** + * The amount of blue used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#blue + * @type {number} + * @since 3.19.0 + */ + blue: { + + get: function () + { + return this.skeleton.color.b; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.b = v; + } + } + + }, + + /** + * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton. + * + * @method SpineGameObject#setColor + * @since 3.19.0 + * + * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color. + * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton. + * + * @return {this} This Game Object instance. + */ + setColor: function (color, slotName) + { + if (color === undefined) { color = 0xffffff; } + + var red = (color >> 16 & 0xFF) / 255; + var green = (color >> 8 & 0xFF) / 255; + var blue = (color & 0xFF) / 255; + var alpha = (color > 16777215) ? (color >>> 24) / 255 : null; + + var target = this.skeleton; + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + target = slot; + } + } + + target.color.r = red; + target.color.g = green; + target.color.b = blue; + + if (alpha !== null) + { + target.color.a = alpha; + } + + return this; + }, + + /** + * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object + * that contains the Skeleton data. + * + * @method SpineGameObject#setSkeletonFromJSON + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ + setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop) + { + return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop); + }, + + /** + * Sets this Game Object to use the given Skeleton based on its cache key. + * + * Typically, once set, the Skeleton doesn't change. Instead, you change the skin, + * or slot attachment, or any other property to adjust it. + * + * @method SpineGameObject#setSkeleton + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ + setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON) + { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON); + + this.skeletonData = data.skeletonData; + + this.preMultipliedAlpha = data.preMultipliedAlpha; + + var skeleton = data.skeleton; + + skeleton.setSkinByName('default'); + skeleton.setToSetupPose(); + + this.skeleton = skeleton; + + // AnimationState + data = this.plugin.createAnimationState(skeleton); + + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + this.state = data.state; + this.stateData = data.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) + }); + + if (animationName) + { + this.setAnimation(0, animationName, loop); + } + + this.root = this.getRootBone(); + + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.state.apply(skeleton); + + skeleton.updateCache(); + + return this.updateSize(); + }, + + /** + * Internal event handler that emits the Spine onComplete event via this Game Object. + * + * @method SpineGameObject#onComplete + * @fires SpinePluginEvents#COMPLETE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onComplete: function (entry) + { + this.emit(SpineEvents.COMPLETE, entry); + }, + + /** + * Internal event handler that emits the Spine onDispose event via this Game Object. + * + * @method SpineGameObject#onDispose + * @fires SpinePluginEvents#DISPOSE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onDispose: function (entry) + { + this.emit(SpineEvents.DISPOSE, entry); + }, + + /** + * Internal event handler that emits the Spine onEnd event via this Game Object. + * + * @method SpineGameObject#onEnd + * @fires SpinePluginEvents#END + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onEnd: function (entry) + { + this.emit(SpineEvents.END, entry); + }, + + /** + * Internal event handler that emits the Spine Event event via this Game Object. + * + * @method SpineGameObject#onEvent + * @fires SpinePluginEvents#EVENT + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + * @param {spine.Event} event - The Spine event. + */ + onEvent: function (entry, event) + { + this.emit(SpineEvents.EVENT, entry, event); + }, + + /** + * Internal event handler that emits the Spine onInterrupted event via this Game Object. + * + * @method SpineGameObject#onInterrupted + * @fires SpinePluginEvents#INTERRUPTED + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onInterrupted: function (entry) + { + this.emit(SpineEvents.INTERRUPTED, entry); + }, + + /** + * Internal event handler that emits the Spine onStart event via this Game Object. + * + * @method SpineGameObject#onStart + * @fires SpinePluginEvents#START + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onStart: function (entry) + { + this.emit(SpineEvents.START, entry); + }, + + /** + * Refreshes the data about the current Skeleton. + * + * This will reset the rotation, position and size of the Skeleton to match this Game Object. + * + * Call this method if you need to access the Skeleton data directly, and it may have changed + * recently. + * + * @method SpineGameObject#refresh + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + refresh: function () + { + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.updateSize(); + + this.skeleton.updateCache(); + + return this; + }, + + /** + * Sets the size of this Game Object. + * + * If no arguments are given it uses the current skeleton data dimensions. + * + * You can use this method to set a fixed size of this Game Object, such as for input detection, + * when the skeleton data doesn't match what is required in-game. + * + * @method SpineGameObject#setSize + * @since 3.19.0 + * + * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width. + * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height. + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setSize: function (width, height, offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (width === undefined) { width = skeleton.data.width; } + if (height === undefined) { height = skeleton.data.height; } + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.width = width; + this.height = height; + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Sets the offset of this Game Object from the Skeleton position. + * + * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using. + * + * @method SpineGameObject#setOffset + * @since 3.19.0 + * + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setOffset: function (offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Internal method that syncs all of the Game Object position and scale data to the Skeleton. + * It then syncs the skeleton bounds back to this Game Object. + * + * This method is called automatically as needed internally, however, it's also exposed should + * you require overriding the size settings. + * + * @method SpineGameObject#updateSize + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + updateSize: function () + { + var skeleton = this.skeleton; + var renderer = this.plugin.renderer; + + var height = renderer.height; + + var oldScaleX = this.scaleX; + var oldScaleY = this.scaleY; + + skeleton.x = this.x; + skeleton.y = height - this.y; + skeleton.scaleX = 1; + skeleton.scaleY = 1; + + skeleton.updateWorldTransform(); + + var bounds = this.getBounds(); + + this.width = bounds.size.x; + this.height = bounds.size.y; + + this.displayOriginX = this.x - bounds.offset.x; + this.displayOriginY = this.y - (height - (this.height + bounds.offset.y)); + + skeleton.scaleX = oldScaleX; + skeleton.scaleY = oldScaleY; + + skeleton.updateWorldTransform(); + + return this; + }, + + /** + * The horizontal scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleX + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + this.refresh(); + } + + }, + + /** + * The vertical scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleY + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + this.refresh(); + } + + }, + + /** + * Returns an array containing the names of all the bones in the Skeleton Data. + * + * @method SpineGameObject#getBoneList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the bones in the Skeleton Data. + */ + getBoneList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.bones.length; i++) + { + output.push(skeletonData.bones[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the skins in the Skeleton Data. + * + * @method SpineGameObject#getSkinList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the skins in the Skeleton Data. + */ + getSkinList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.skins.length; i++) + { + output.push(skeletonData.skins[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the slots in the Skeleton. + * + * @method SpineGameObject#getSlotList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the slots in the Skeleton. + */ + getSlotList: function () + { + var output = []; + + var skeleton = this.skeleton; + + for (var i = 0; i < skeleton.slots.length; i++) + { + output.push(skeleton.slots[i].data.name); + } + + return output; + }, + + /** + * Returns an array containing the names of all the animations in the Skeleton Data. + * + * @method SpineGameObject#getAnimationList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the animations in the Skeleton Data. + */ + getAnimationList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.animations.length; i++) + { + output.push(skeletonData.animations[i].name); + } + } + + return output; + }, + + /** + * Returns the current animation being played on the given track, if any. + * + * @method SpineGameObject#getCurrentAnimation + * @since 3.19.0 + * + * @param {integer} [trackIndex=0] - The track to return the current animation on. + * + * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation. + */ + getCurrentAnimation: function (trackIndex) + { + if (trackIndex === undefined) { trackIndex = 0; } + + var current = this.state.getCurrent(trackIndex); + + if (current) + { + return current.animation; + } + }, + + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#play + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead. + */ + play: function (animationName, loop, ignoreIfPlaying) + { + this.setAnimation(0, animationName, loop, ignoreIfPlaying); + + return this; + }, + + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#setAnimation + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to play the animation on. + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying) + { + if (loop === undefined) { loop = false; } + if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } + + if (ignoreIfPlaying && this.state) + { + var currentTrack = this.state.getCurrent(0); + + if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete()) + { + return; + } + } + + if (this.findAnimation(animationName)) + { + return this.state.setAnimation(trackIndex, animationName, loop); + } + }, + + /** + * Adds an animation to be played after the current or last queued animation for a track. + * If the track is empty, it is equivalent to calling setAnimation. + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous + * track entry minus any mix duration (from the AnimationStateData) plus the specified delay + * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration). + * If the previous entry is looping, its next loop completion is used instead of its duration. + * + * @method SpineGameObject#addAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {string} animationName - The string-based key of the animation to add. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + addAnimation: function (trackIndex, animationName, loop, delay) + { + return this.state.addAnimation(trackIndex, animationName, loop, delay); + }, + + /** + * Sets an empty animation for a track, discarding any queued animations, and sets the track + * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out. + * + * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation, + * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be + * applied less and less over the mix duration. Properties keyed in the previous animation transition to + * the value from lower tracks or to the setup pose value if no lower tracks key the property. + * A mix duration of 0 still mixes out over one frame. + * + * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation + * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new + * animation to be applied more and more over the mix duration. Properties keyed in the new animation + * transition from the value from lower tracks or from the setup pose value if no lower tracks key the + * property to the value keyed in the new animation. + * + * @method SpineGameObject#setEmptyAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {spine.TrackEntry} The returned Track Entry. + */ + setEmptyAnimation: function (trackIndex, mixDuration) + { + return this.state.setEmptyAnimation(trackIndex, mixDuration); + }, + + /** + * Removes all animations from the track, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTrack + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * + * @return {this} This Game Object. + */ + clearTrack: function (trackIndex) + { + this.state.clearTrack(trackIndex); + + return this; + }, + + /** + * Removes all animations from all tracks, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTracks + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + clearTracks: function () + { + this.state.clearTracks(); + + return this; + }, + + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkinByName + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to set. + * + * @return {this} This Game Object. + */ + setSkinByName: function (skinName) + { + var skeleton = this.skeleton; + + skeleton.setSkinByName(skinName); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); + + return this; + }, + + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkin + * @since 3.19.0 + * + * @param {?spine.Skin} newSkin - The Skin to set. May be `null`. + * + * @return {this} This Game Object. + */ + setSkin: function (newSkin) + { + var skeleton = this.skeleton; + + skeleton.setSkin(newSkin); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); + + return this; + }, + + /** + * Sets the mix duration when changing from the specified animation to the other. + * + * @method SpineGameObject#setMix + * @since 3.19.0 + * + * @param {string} fromName - The animation to mix from. + * @param {string} toName - The animation to mix to. + * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {this} This Game Object. + */ + setMix: function (fromName, toName, duration) + { + this.stateData.setMix(fromName, toName, duration); + + return this; + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot + * index and attachment name. First the skin is checked and if the attachment was not found, + * the default skin is checked. + * + * @method SpineGameObject#getAttachment + * @since 3.19.0 + * + * @param {integer} slotIndex - The slot index to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachment: function (slotIndex, attachmentName) + { + return this.skeleton.getAttachment(slotIndex, attachmentName); + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name. + * + * @method SpineGameObject#getAttachmentByName + * @since 3.19.0 + * + * @param {string} slotName - The slot name to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachmentByName: function (slotName, attachmentName) + { + return this.skeleton.getAttachmentByName(slotName, attachmentName); + }, + + /** + * A convenience method to set an attachment by finding the slot with findSlot, + * finding the attachment with getAttachment, then setting the slot's attachment. + * + * @method SpineGameObject#setAttachment + * @since 3.19.0 + * + * @param {string} slotName - The slot name to add the attachment to. + * @param {string} attachmentName - The attachment name to add. + * + * @return {this} This Game Object. + */ + setAttachment: function (slotName, attachmentName) + { + if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length) + { + for (var i = 0; i < slotName.length; i++) + { + this.skeleton.setAttachment(slotName[i], attachmentName[i]); + } + } + else + { + this.skeleton.setAttachment(slotName, attachmentName); + } + + return this; + }, + + /** + * Sets the bones, constraints, slots, and draw order to their setup pose values. + * + * @method SpineGameObject#setToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setToSetupPose: function () + { + this.skeleton.setToSetupPose(); + + return this; + }, + + /** + * Sets the slots and draw order to their setup pose values. + * + * @method SpineGameObject#setSlotsToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setSlotsToSetupPose: function () + { + this.skeleton.setSlotsToSetupPose(); + + return this; + }, + + /** + * Sets the bones and constraints to their setup pose values. + * + * @method SpineGameObject#setBonesToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setBonesToSetupPose: function () + { + this.skeleton.setBonesToSetupPose(); + + return this; + }, + + /** + * Gets the root bone, or null. + * + * @method SpineGameObject#getRootBone + * @since 3.19.0 + * + * @return {spine.Bone} The root bone, or null. + */ + getRootBone: function () + { + return this.skeleton.getRootBone(); + }, + + /** + * Takes a Bone object and a position in world space and rotates the Bone so it is angled + * towards the given position. You can set an optional angle offset, should the bone be + * designed at a specific angle already. You can also set a minimum and maximum range for the angle. + * + * @method SpineGameObject#angleBoneToXY + * @since 3.19.0 + * + * @param {spine.Bone} bone - The bone to rotate towards the world position. + * @param {number} worldX - The world x coordinate to rotate the bone towards. + * @param {number} worldY - The world y coordinate to rotate the bone towards. + * @param {number} [offset=0] - An offset to add to the rotation angle. + * @param {number} [minAngle=0] - The minimum range of the rotation angle. + * @param {number} [maxAngle=360] - The maximum range of the rotation angle. + * + * @return {this} This Game Object. + */ + angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle) + { + if (offset === undefined) { offset = 0; } + if (minAngle === undefined) { minAngle = 0; } + if (maxAngle === undefined) { maxAngle = 360; } + + var renderer = this.plugin.renderer; + var height = renderer.height; + + var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset)); + + bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle); + + return this; + }, + + /** + * Finds a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBone + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {spine.Bone} The bone, or null. + */ + findBone: function (boneName) + { + return this.skeleton.findBone(boneName); + }, + + /** + * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBoneIndex + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {integer} The bone index. Or -1 if the bone was not found. + */ + findBoneIndex: function (boneName) + { + return this.skeleton.findBoneIndex(boneName); + }, + + /** + * Finds a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlot + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {spine.Slot} The Slot. May be null. + */ + findSlot: function (slotName) + { + return this.skeleton.findSlot(slotName); + }, + + /** + * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlotIndex + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {integer} The slot index. Or -1 if the Slot was not found. + */ + findSlotIndex: function (slotName) + { + return this.skeleton.findSlotIndex(slotName); + }, + + /** + * Finds a skin by comparing each skin's name. It is more efficient to cache the results of + * this method than to call it multiple times. + * + * @method SpineGameObject#findSkin + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to find. + * + * @return {spine.Skin} The Skin. May be null. + */ + findSkin: function (skinName) + { + return this.skeletonData.findSkin(skinName); + }, + + /** + * Finds an event by comparing each events's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findEvent + * @since 3.19.0 + * + * @param {string} eventDataName - The name of the event to find. + * + * @return {spine.EventData} The Event Data. May be null. + */ + findEvent: function (eventDataName) + { + return this.skeletonData.findEvent(eventDataName); + }, + + /** + * Finds an animation by comparing each animation's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findAnimation + * @since 3.19.0 + * + * @param {string} animationName - The name of the animation to find. + * + * @return {spine.Animation} The Animation. May be null. + */ + findAnimation: function (animationName) + { + return this.skeletonData.findAnimation(animationName); + }, + + /** + * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findIkConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.IkConstraintData} The IK constraint. May be null. + */ + findIkConstraint: function (constraintName) + { + return this.skeletonData.findIkConstraint(constraintName); + }, + + /** + * Finds an transform constraint by comparing each transform constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findTransformConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.TransformConstraintData} The transform constraint. May be null. + */ + findTransformConstraint: function (constraintName) + { + return this.skeletonData.findTransformConstraint(constraintName); + }, + + /** + * Finds a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.PathConstraintData} The path constraint. May be null. + */ + findPathConstraint: function (constraintName) + { + return this.skeletonData.findPathConstraint(constraintName); + }, + + /** + * Finds the index of a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraintIndex + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {integer} The constraint index. Or -1 if the constraint was not found. + */ + findPathConstraintIndex: function (constraintName) + { + return this.skeletonData.findPathConstraintIndex(constraintName); + }, + + /** + * 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 SpineGameObject#getBounds + * @since 3.19.0 + * + * @return {any} The bounds object. + */ + getBounds: function () + { + return this.plugin.getBounds(this.skeleton); + }, + + /** + * Internal update handler. + * + * @method SpineGameObject#preUpdate + * @protected + * @since 3.19.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + var skeleton = this.skeleton; + + this.state.update((delta / 1000) * this.timeScale); + + this.state.apply(skeleton); + + // this.emit('spine.update', skeleton); + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method SpineGameObject#preDestroy + * @protected + * @since 3.19.0 + */ + preDestroy: function () + { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + this.plugin = null; + + this.skeleton = null; + this.skeletonData = null; + + this.state = null; + this.stateData = null; + } + +}); + +module.exports = SpineGameObject; + + +/***/ }), +/* 187 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 188 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * 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 depth starts from zero (the default value) and increases from that point. 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) + { + this.scene.sys.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 depth starts from zero (the default value) and increases from that point. 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 {integer} value - The depth of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), +/* 189 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 190 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 191 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(1); +var TransformMatrix = __webpack_require__(192); +var WrapAngle = __webpack_require__(17); +var WrapAngleDegrees = __webpack_require__(18); + +// 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 = { + + /** + * 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: Do not use this value to set the z-index, instead see the `depth` property. + * + * @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 {integer} + * @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, 90 is down, 180/-180 is left + * and -90 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; + }, + + /** + * 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. + * + * @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; + }, + + /** + * 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; + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var MATH_CONST = __webpack_require__(1); +var Vector2 = __webpack_require__(5); + +/** + * @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 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 {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) ? this : out; + + destinationMatrix.a = (sourceA * localA) + (sourceB * localC); + destinationMatrix.b = (sourceA * localB) + (sourceB * localD); + destinationMatrix.c = (sourceC * localA) + (sourceD * localC); + destinationMatrix.d = (sourceC * localB) + (sourceD * localD); + destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE; + destinationMatrix.f = (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 using 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.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates. + * + * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} 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; + }, + + /** + * 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 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.decomposedMatrix = null; + } + +}); + +module.exports = TransformMatrix; + + +/***/ }), +/* 193 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), +/* 194 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var ComponentsToJSON = __webpack_require__(195); +var DataManager = __webpack_require__(196); +var EventEmitter = __webpack_require__(202); +var Events = __webpack_require__(203); + +/** + * @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); + + /** + * The Scene to which this Game Object belongs. + * Game Objects can only belong to one Scene. + * + * @name Phaser.GameObjects.GameObject#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * 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 move 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 {(integer|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 {integer} + * @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 {integer} + * @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 physics then this property will contain a reference to a Physics Body. + * + * @name Phaser.GameObjects.GameObject#body + * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)} + * @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; + + // 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 {(integer|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 + * + * @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; + }, + + /** + * 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. + * + * @method Phaser.GameObjects.GameObject#setInteractive + * @since 3.0.0 + * + * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. 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 (shape, callback, dropZone) + { + this.scene.sys.input.enable(this, shape, callback, 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 () + { + if (this.input) + { + this.input.enabled = false; + } + + 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; + }, + + /** + * 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) + { + return !(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 {integer[]} 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), parent.name]); + indexes.unshift(parent.getIndex(child)); + + child = parent; + + if (!parent.parentContainer) + { + break; + } + else + { + parent = parent.parentContainer; + } + } + + // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']); + indexes.unshift(this.scene.sys.displayList.getIndex(child)); + + return indexes; + }, + + /** + * 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] - Is this Game Object being destroyed as the result of a Scene shutdown? + */ + destroy: function (fromScene) + { + if (fromScene === undefined) { fromScene = false; } + + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + if (this.preDestroy) + { + this.preDestroy.call(this); + } + + this.emit(Events.DESTROY, this); + + var sys = this.scene.sys; + + if (!fromScene) + { + sys.displayList.remove(this); + sys.updateList.remove(this); + } + + if (this.input) + { + 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; + } + + // Tell the Scene to re-sort the children + if (!fromScene) + { + sys.queueDepthSort(); + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + + this.parentContainer = undefined; + + this.removeAllListeners(); + } + +}); + +/** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + * + * @constant {integer} RENDER_MASK + * @memberof Phaser.GameObjects.GameObject + * @default + */ +GameObject.RENDER_MASK = 15; + +module.exports = GameObject; + + +/***/ }), +/* 195 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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, + scaleMode: gameObject.scaleMode, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Events = __webpack_require__(197); + +/** + * @callback DataEachCallback + * + * @param {*} parent - The parent object of the DataManager. + * @param {string} key - The key of the value. + * @param {*} value - The value. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + */ + +/** + * @classdesc + * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + * + * @class DataManager + * @memberof Phaser.Data + * @constructor + * @since 3.0.0 + * + * @param {object} parent - The object that this DataManager belongs to. + * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter. + */ +var DataManager = new Class({ + + initialize: + + function DataManager (parent, eventEmitter) + { + /** + * The object that this DataManager belongs to. + * + * @name Phaser.Data.DataManager#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The DataManager's event emitter. + * + * @name Phaser.Data.DataManager#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = eventEmitter; + + if (!eventEmitter) + { + this.events = (parent.events) ? parent.events : parent; + } + + /** + * The data list. + * + * @name Phaser.Data.DataManager#list + * @type {Object.} + * @default {} + * @since 3.0.0 + */ + this.list = {}; + + /** + * The public values list. You can use this to access anything you have stored + * in this Data Manager. For example, if you set a value called `gold` you can + * access it via: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also modify it directly: + * + * ```javascript + * this.data.values.gold += 1000; + * ``` + * + * Doing so will emit a `setdata` event from the parent of this Data Manager. + * + * Do not modify this object directly. Adding properties directly to this object will not + * emit any events. Always use `DataManager.set` to create new items the first time around. + * + * @name Phaser.Data.DataManager#values + * @type {Object.} + * @default {} + * @since 3.10.0 + */ + this.values = {}; + + /** + * Whether setting data is frozen for this DataManager. + * + * @name Phaser.Data.DataManager#_frozen + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._frozen = false; + + if (!parent.hasOwnProperty('sys') && this.events) + { + this.events.once('destroy', this.destroy, this); + } + }, + + /** + * Retrieves the value for the given key, 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 + * this.data.get('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * this.data.get([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.Data.DataManager#get + * @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. + */ + get: function (key) + { + var list = this.list; + + if (Array.isArray(key)) + { + var output = []; + + for (var i = 0; i < key.length; i++) + { + output.push(list[key[i]]); + } + + return output; + } + else + { + return list[key]; + } + }, + + /** + * Retrieves all data values in a new object. + * + * @method Phaser.Data.DataManager#getAll + * @since 3.0.0 + * + * @return {Object.} All data values. + */ + getAll: function () + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Queries the DataManager for the values of keys matching the given regular expression. + * + * @method Phaser.Data.DataManager#query + * @since 3.0.0 + * + * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). + * + * @return {Object.} The values of the keys matching the search string. + */ + query: function (search) + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key) && key.match(search)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * data.set('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `get`: + * + * ```javascript + * data.get('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted. + * + * 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.Data.DataManager#set + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @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. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + set: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (typeof key === 'string') + { + return this.setValue(key, data); + } + else + { + for (var entry in key) + { + this.setValue(entry, key[entry]); + } + } + + return this; + }, + + /** + * Internal value setter, called automatically by the `set` method. + * + * @method Phaser.Data.DataManager#setValue + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @private + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * @param {*} data - The value to set. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setValue: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (this.has(key)) + { + // Hit the key getter, which will in turn emit the events. + this.values[key] = data; + } + else + { + var _this = this; + var list = this.list; + var events = this.events; + var parent = this.parent; + + Object.defineProperty(this.values, key, { + + enumerable: true, + + configurable: true, + + get: function () + { + return list[key]; + }, + + set: function (value) + { + if (!_this._frozen) + { + var previousValue = list[key]; + list[key] = value; + + events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); + events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); + } + } + + }); + + list[key] = data; + + events.emit(Events.SET_DATA, parent, key, data); + } + + return this; + }, + + /** + * Passes all data entries to the given callback. + * + * @method Phaser.Data.DataManager#each + * @since 3.0.0 + * + * @param {DataEachCallback} callback - The function to call. + * @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 {Phaser.Data.DataManager} This DataManager object. + */ + each: function (callback, context) + { + var args = [ this.parent, null, undefined ]; + + for (var i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (var key in this.list) + { + args[1] = key; + args[2] = this.list[key]; + + callback.apply(context, args); + } + + return this; + }, + + /** + * Merge the given object of key value pairs into this DataManager. + * + * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) + * will emit a `changedata` event. + * + * @method Phaser.Data.DataManager#merge + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {Object.} data - The data to merge. + * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + merge: function (data, overwrite) + { + if (overwrite === undefined) { overwrite = true; } + + // Merge data from another component into this one + for (var key in data) + { + if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) + { + this.setValue(key, data[key]); + } + } + + return this; + }, + + /** + * Remove the value for the given key. + * + * If the key is found in this Data Manager it is removed from the internal lists and a + * `removedata` event is emitted. + * + * You can also pass in an array of keys, in which case all keys in the array will be removed: + * + * ```javascript + * this.data.remove([ 'gold', 'armor', 'health' ]); + * ``` + * + * @method Phaser.Data.DataManager#remove + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {(string|string[])} key - The key to remove, or an array of keys to remove. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + remove: function (key) + { + if (this._frozen) + { + return this; + } + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + this.removeValue(key[i]); + } + } + else + { + return this.removeValue(key); + } + + return this; + }, + + /** + * Internal value remover, called automatically by the `remove` method. + * + * @method Phaser.Data.DataManager#removeValue + * @private + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + removeValue: function (key) + { + if (this.has(key)) + { + var data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return this; + }, + + /** + * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. + * + * @method Phaser.Data.DataManager#pop + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {string} key - The key of the value to retrieve and delete. + * + * @return {*} The value of the given key. + */ + pop: function (key) + { + var data = undefined; + + if (!this._frozen && this.has(key)) + { + data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return data; + }, + + /** + * Determines whether the given key is set in this Data Manager. + * + * Please note that the 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.Data.DataManager#has + * @since 3.0.0 + * + * @param {string} key - The key to check. + * + * @return {boolean} Returns `true` if the key exists, otherwise `false`. + */ + has: function (key) + { + return this.list.hasOwnProperty(key); + }, + + /** + * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts + * to create new values or update existing ones. + * + * @method Phaser.Data.DataManager#setFreeze + * @since 3.0.0 + * + * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setFreeze: function (value) + { + this._frozen = value; + + return this; + }, + + /** + * Delete all data in this Data Manager and unfreeze it. + * + * @method Phaser.Data.DataManager#reset + * @since 3.0.0 + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + reset: function () + { + for (var key in this.list) + { + delete this.list[key]; + delete this.values[key]; + } + + this._frozen = false; + + return this; + }, + + /** + * Destroy this data manager. + * + * @method Phaser.Data.DataManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.reset(); + + this.events.off(Events.CHANGE_DATA); + this.events.off(Events.SET_DATA); + this.events.off(Events.REMOVE_DATA); + + this.parent = null; + }, + + /** + * Gets or sets the frozen state of this Data Manager. + * A frozen Data Manager will block all attempts to create new values or update existing ones. + * + * @name Phaser.Data.DataManager#freeze + * @type {boolean} + * @since 3.0.0 + */ + freeze: { + + get: function () + { + return this._frozen; + }, + + set: function (value) + { + this._frozen = (value) ? true : false; + } + + }, + + /** + * Return the total number of entries in this Data Manager. + * + * @name Phaser.Data.DataManager#count + * @type {integer} + * @since 3.0.0 + */ + count: { + + get: function () + { + var i = 0; + + for (var key in this.list) + { + if (this.list[key] !== undefined) + { + i++; + } + } + + return i; + } + + } + +}); + +module.exports = DataManager; + + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Data.Events + */ + +module.exports = { + + CHANGE_DATA: __webpack_require__(198), + CHANGE_DATA_KEY: __webpack_require__(199), + REMOVE_DATA: __webpack_require__(200), + SET_DATA: __webpack_require__(201) + +}; + + +/***/ }), +/* 198 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`. + * + * This event is dispatched for all items that change in the Data Manager. + * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. + * + * @event Phaser.Data.Events#CHANGE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The new value of the item in the Data Manager. + * @param {any} previousValue - The previous value of the item in the Data Manager. + */ +module.exports = 'changedata'; + + +/***/ }), +/* 199 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Key Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`, + * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` + * then you can listen for `sprite.data.on('changedata-gold')`. + * + * @event Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.16.1 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'changedata-'; + + +/***/ }), +/* 200 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Remove Data Event. + * + * This event is dispatched by a Data Manager when an item is removed from it. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`. + * + * @event Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'removedata'; + + +/***/ }), +/* 201 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Set Data Event. + * + * This event is dispatched by a Data Manager when a new item is added to the data store. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`. + * + * @event Phaser.Data.Events#SET_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'setdata'; + + +/***/ }), +/* 202 */ +/***/ (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; +} + + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { DESTROY: __webpack_require__(204) }; + + +/***/ }), +/* 204 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Destroy Event. + * + * 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 + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. + */ +module.exports = 'destroy'; + + +/***/ }), +/* 205 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace SpinePluginEvents + */ + +module.exports = { + + COMPLETE: __webpack_require__(206), + DISPOSE: __webpack_require__(207), + END: __webpack_require__(208), + EVENT: __webpack_require__(209), + INTERRUPTED: __webpack_require__(210), + START: __webpack_require__(211) + +}; + + +/***/ }), +/* 206 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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'; + + +/***/ }), +/* 207 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#DISPOSE + * @since 3.19.0 + */ +module.exports = 'dispose'; + + +/***/ }), +/* 208 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#END + * @since 3.19.0 + */ +module.exports = 'end'; + + +/***/ }), +/* 209 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#EVENT + * @since 3.19.0 + */ +module.exports = 'event'; + + +/***/ }), +/* 210 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#INTERRUPTED + * @since 3.19.0 + */ +module.exports = 'interrupted'; + + +/***/ }), +/* 211 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#START + * @since 3.19.0 + */ +module.exports = 'start'; + + +/***/ }), +/* 212 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var renderWebGL = __webpack_require__(31); +var renderCanvas = __webpack_require__(31); + +if (true) +{ + renderWebGL = __webpack_require__(213); +} + +if (false) +{} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 213 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var CounterClockwise = __webpack_require__(7); +var RadToDeg = __webpack_require__(9); +var Wrap = __webpack_require__(4); + +/** + * 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 {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @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 SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var plugin = src.plugin; + var skeleton = src.skeleton; + var sceneRenderer = plugin.sceneRenderer; + + var GameObjectRenderMask = 15; + + var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); + + if (!skeleton || !willRender) + { + // Reset the current type + renderer.currentType = ''; + + // If there is already a batch running, we need to close it + if (!renderer.nextTypeMatch) + { + // The next object in the display list is not a Spine object, so we end the batch + sceneRenderer.end(); + + renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline); + } + + return; + } + + if (renderer.newType) + { + renderer.clearPipeline(); + } + + var camMatrix = renderer._tempMatrix1; + var spriteMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + 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); + } + + 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; + + 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; + } + + // Add autoUpdate option + skeleton.updateWorldTransform(); + + if (renderer.newType) + { + sceneRenderer.begin(); + } + + // Draw the current skeleton + sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + + 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 object, so we end the batch + sceneRenderer.end(); + + renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline); + } +}; + +module.exports = SpineGameObjectWebGLRenderer; + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/plugins/spine/dist/SpineWebGLPlugin.min.js b/plugins/spine/dist/SpineWebGLPlugin.min.js new file mode 100644 index 000000000..ba63010d1 --- /dev/null +++ b/plugins/spine/dist/SpineWebGLPlugin.min.js @@ -0,0 +1 @@ +window.SpinePlugin=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.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 r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));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=32)}([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||!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 r(t,e,r,s){for(var a in e)if(e.hasOwnProperty(a)){var h=i(e,a,r);if(!1!==h){if(n((s||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0&&(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},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}});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},function(t,e){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}},function(t,e,i){var n=i(1);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,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){var n=i(1);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e,i){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},clone:function(){return new n(this.x,this.y,this.z)},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-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},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||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,o=t.z;return this.x=i*o-n*s,this.y=n*r-e*o,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},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],o=e*r[1]+i*r[5]+n*r[9]+r[13],a=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=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z,a=t.w,h=a*e+s*n-o*i,l=a*i+o*e-r*n,u=a*n+r*i-s*e,c=-r*e-s*i-o*n;return this.x=h*a+c*-r+l*-o-u*-s,this.y=l*a+c*-s+u*-r-h*-o,this.z=u*a+c*-o+h*-s-l*-r,this},project:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=r[0],o=r[1],a=r[2],h=r[3],l=r[4],u=r[5],c=r[6],f=r[7],d=r[8],p=r[9],v=r[10],M=r[11],m=r[12],g=r[13],x=r[14],y=1/(e*h+i*f+n*M+r[15]);return this.x=(e*s+i*l+n*d+m)*y,this.y=(e*o+i*u+n*p+g)*y,this.z=(e*a+i*c+n*v+x)*y,this},unproject:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,o=this.x-i,a=s-this.y-1-n,h=this.z;return this.x=2*o/r-1,this.y=2*a/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},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,s=i,o=0;o=400&&t.status<=599&&(n=!1),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(){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.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){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)},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){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,i){var n=i(2),r=function(){var t,e,i,s,o,a,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=0?t:t+2*Math.PI}},function(t,e,i){var n=i(4);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){var n=i(4);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(20);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,r){var s=.5*(n-e),o=.5*(r-i),a=t*t;return(2*i-2*n+s+o)*(t*a)+(-3*i+3*n-2*s-o)*a+s*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,i){var n=i(1);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e,i){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],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*s-o*h,c=-l*r+o*a,f=h*r-s*a,d=e*u+i*c+n*f;return d?(d=1/d,t[0]=u*d,t[1]=(-l*i+n*h)*d,t[2]=(o*i-n*s)*d,t[3]=c*d,t[4]=(l*e-n*a)*d,t[5]=(-o*e+n*r)*d,t[6]=f*d,t[7]=(-h*e+i*a)*d,t[8]=(s*e-i*r)*d,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=s*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*s,t[3]=o*a-r*l,t[4]=e*l-n*a,t[5]=n*r-e*o,t[6]=r*h-s*a,t[7]=i*a-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],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*s-o*h)+i*(-l*r+o*a)+n*(h*r-s*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,f=c[0],d=c[1],p=c[2],v=c[3],M=c[4],m=c[5],g=c[6],x=c[7],y=c[8];return e[0]=f*i+d*s+p*h,e[1]=f*n+d*o+p*l,e[2]=f*r+d*a+p*u,e[3]=v*i+M*s+m*h,e[4]=v*n+M*o+m*l,e[5]=v*r+M*a+m*u,e[6]=g*i+x*s+y*h,e[7]=g*n+x*o+y*l,e[8]=g*r+x*a+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],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*s,e[1]=l*n+h*o,e[2]=l*r+h*a,e[3]=l*s-h*i,e[4]=l*o-h*n,e[5]=l*a-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,o=i+i,a=n+n,h=e*s,l=e*o,u=e*a,c=i*o,f=i*a,d=n*a,p=r*s,v=r*o,M=r*a,m=this.val;return m[0]=1-(c+d),m[3]=l+M,m[6]=u-v,m[1]=l-M,m[4]=1-(h+d),m[7]=f+p,m[2]=u+v,m[5]=f-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],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],f=e[9],d=e[10],p=e[11],v=e[12],M=e[13],m=e[14],g=e[15],x=n*h-r*a,y=n*l-s*a,w=n*u-o*a,b=r*l-s*h,A=r*u-o*h,E=s*u-o*l,R=c*M-f*v,T=c*m-d*v,I=c*g-p*v,S=f*m-d*M,C=f*g-p*M,P=d*g-p*m,L=x*P-y*C+w*S+b*I-A*T+E*R;return L?(L=1/L,i[0]=(h*P-l*C+u*S)*L,i[1]=(l*I-a*P-u*T)*L,i[2]=(a*C-h*I+u*R)*L,i[3]=(s*C-r*P-o*S)*L,i[4]=(n*P-s*I+o*T)*L,i[5]=(r*I-n*C-o*R)*L,i[6]=(M*E-m*A+g*b)*L,i[7]=(m*w-v*E-g*y)*L,i[8]=(v*A-M*w+g*x)*L,this):null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),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],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},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(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],r=t[6],s=t[7],o=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]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],M=t[15],m=e*o-i*s,g=e*a-n*s,x=e*h-r*s,y=i*a-n*o,w=i*h-r*o,b=n*h-r*a,A=l*p-u*d,E=l*v-c*d,R=l*M-f*d,T=u*v-c*p,I=u*M-f*p,S=c*M-f*v,C=m*S-g*I+x*T+y*R-w*E+b*A;return C?(C=1/C,t[0]=(o*S-a*I+h*T)*C,t[1]=(n*I-i*S-r*T)*C,t[2]=(p*b-v*w+M*y)*C,t[3]=(c*w-u*b-f*y)*C,t[4]=(a*R-s*S-h*E)*C,t[5]=(e*S-n*R+r*E)*C,t[6]=(v*x-d*b-M*g)*C,t[7]=(l*b-c*x+f*g)*C,t[8]=(s*I-o*R+h*A)*C,t[9]=(i*R-e*I-r*A)*C,t[10]=(d*w-p*x+M*m)*C,t[11]=(u*x-l*w-f*m)*C,t[12]=(o*E-s*T-a*A)*C,t[13]=(e*T-i*E+n*A)*C,t[14]=(p*g-d*y-v*m)*C,t[15]=(l*y-u*g+c*m)*C,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],M=t[15];return t[0]=o*(c*M-f*v)-u*(a*M-h*v)+p*(a*f-h*c),t[1]=-(i*(c*M-f*v)-u*(n*M-r*v)+p*(n*f-r*c)),t[2]=i*(a*M-h*v)-o*(n*M-r*v)+p*(n*h-r*a),t[3]=-(i*(a*f-h*c)-o*(n*f-r*c)+u*(n*h-r*a)),t[4]=-(s*(c*M-f*v)-l*(a*M-h*v)+d*(a*f-h*c)),t[5]=e*(c*M-f*v)-l*(n*M-r*v)+d*(n*f-r*c),t[6]=-(e*(a*M-h*v)-s*(n*M-r*v)+d*(n*h-r*a)),t[7]=e*(a*f-h*c)-s*(n*f-r*c)+l*(n*h-r*a),t[8]=s*(u*M-f*p)-l*(o*M-h*p)+d*(o*f-h*u),t[9]=-(e*(u*M-f*p)-l*(i*M-r*p)+d*(i*f-r*u)),t[10]=e*(o*M-h*p)-s*(i*M-r*p)+d*(i*h-r*o),t[11]=-(e*(o*f-h*u)-s*(i*f-r*u)+l*(i*h-r*o)),t[12]=-(s*(u*v-c*p)-l*(o*v-a*p)+d*(o*c-a*u)),t[13]=e*(u*v-c*p)-l*(i*v-n*p)+d*(i*c-n*u),t[14]=-(e*(o*v-a*p)-s*(i*v-n*p)+d*(i*a-n*o)),t[15]=e*(o*c-a*u)-s*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],M=t[15];return(e*o-i*s)*(c*M-f*v)-(e*a-n*s)*(u*M-f*p)+(e*h-r*s)*(u*v-c*p)+(i*a-n*o)*(l*M-f*d)-(i*h-r*o)*(l*v-c*d)+(n*h-r*a)*(l*p-u*d)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],f=e[10],d=e[11],p=e[12],v=e[13],M=e[14],m=e[15],g=t.val,x=g[0],y=g[1],w=g[2],b=g[3];return e[0]=x*i+y*o+w*u+b*p,e[1]=x*n+y*a+w*c+b*v,e[2]=x*r+y*h+w*f+b*M,e[3]=x*s+y*l+w*d+b*m,x=g[4],y=g[5],w=g[6],b=g[7],e[4]=x*i+y*o+w*u+b*p,e[5]=x*n+y*a+w*c+b*v,e[6]=x*r+y*h+w*f+b*M,e[7]=x*s+y*l+w*d+b*m,x=g[8],y=g[9],w=g[10],b=g[11],e[8]=x*i+y*o+w*u+b*p,e[9]=x*n+y*a+w*c+b*v,e[10]=x*r+y*h+w*f+b*M,e[11]=x*s+y*l+w*d+b*m,x=g[12],y=g[13],w=g[14],b=g[15],e[12]=x*i+y*o+w*u+b*p,e[13]=x*n+y*a+w*c+b*v,e[14]=x*r+y*h+w*f+b*M,e[15]=x*s+y*l+w*d+b*m,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,r=this.val;return r[12]=r[0]*e+r[4]*i+r[8]*n+r[12],r[13]=r[1]*e+r[5]*i+r[9]*n+r[13],r[14]=r[2]*e+r[6]*i+r[10]*n+r[14],r[15]=r[3]*e+r[7]*i+r[11]*n+r[15],this},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){var e=t.x,i=t.y,n=t.z,r=this.val;return r[0]=r[0]*e,r[1]=r[1]*e,r[2]=r[2]*e,r[3]=r[3]*e,r[4]=r[4]*i,r[5]=r[5]*i,r[6]=r[6]*i,r[7]=r[7]*i,r[8]=r[8]*n,r[9]=r[9]*n,r[10]=r[10]*n,r[11]=r[11]*n,this},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,o=t.y,a=t.z,h=r*s,l=r*o;return this.fromArray([h*s+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*s,0,h*a-n*o,l*a+n*s,r*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,r=e.y,s=e.z,o=Math.sqrt(n*n+r*r+s*s);if(Math.abs(o)<1e-6)return null;n*=o=1/o,r*=o,s*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],f=i[2],d=i[3],p=i[4],v=i[5],M=i[6],m=i[7],g=i[8],x=i[9],y=i[10],w=i[11],b=n*n*l+h,A=r*n*l+s*a,E=s*n*l-r*a,R=n*r*l-s*a,T=r*r*l+h,I=s*r*l+n*a,S=n*s*l+r*a,C=r*s*l-n*a,P=s*s*l+h;return i[0]=u*b+p*A+g*E,i[1]=c*b+v*A+x*E,i[2]=f*b+M*A+y*E,i[3]=d*b+m*A+w*E,i[4]=u*R+p*T+g*I,i[5]=c*R+v*T+x*I,i[6]=f*R+M*T+y*I,i[7]=d*R+m*T+w*I,i[8]=u*S+p*C+g*P,i[9]=c*S+v*C+x*P,i[10]=f*S+M*C+y*P,i[11]=d*S+m*C+w*P,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[4],s=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=r*n+h*i,e[5]=s*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-r*i,e[9]=l*n-s*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=r*n-h*i,e[1]=s*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=r*i+h*n,e[9]=s*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=r*n+h*i,e[1]=s*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-r*i,e[5]=l*n-s*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,r=t.y,s=t.z,o=t.w,a=n+n,h=r+r,l=s+s,u=n*a,c=n*h,f=n*l,d=r*h,p=r*l,v=s*l,M=o*a,m=o*h,g=o*l;return i[0]=1-(d+v),i[1]=c+g,i[2]=f-m,i[3]=0,i[4]=c-g,i[5]=1-(u+v),i[6]=p+M,i[7]=0,i[8]=f+m,i[9]=p-M,i[10]=1-(u+d),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,r=t.z,s=t.w,o=i+i,a=n+n,h=r+r,l=i*o,u=i*a,c=i*h,f=n*a,d=n*h,p=r*h,v=s*o,M=s*a,m=s*h;return e[0]=1-(f+p),e[1]=u+m,e[2]=c-M,e[3]=0,e[4]=u-m,e[5]=1-(l+p),e[6]=d+v,e[7]=0,e[8]=c+M,e[9]=d-v,e[10]=1-(l+f),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,r,s){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(r-s);return o[0]=2*r*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*r*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(s+r)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=s*r*2*l,o[15]=0,this},perspective:function(t,e,i,n){var r=this.val,s=1/Math.tan(t/2),o=1/(i-n);return r[0]=s/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(n+i)*o,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*n*i*o,r[15]=0,this},perspectiveLH:function(t,e,i,n){var r=this.val;return r[0]=2*i/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2*i/e,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-n/(i-n),r[11]=1,r[12]=0,r[13]=0,r[14]=i*n/(i-n),r[15]=0,this},ortho:function(t,e,i,n,r,s){var o=this.val,a=t-e,h=i-n,l=r-s;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(s+r)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,r=t.x,s=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,f=e.z;if(Math.abs(r-u)<1e-6&&Math.abs(s-c)<1e-6&&Math.abs(o-f)<1e-6)return this.identity();var d=r-u,p=s-c,v=o-f,M=1/Math.sqrt(d*d+p*p+v*v),m=h*(v*=M)-l*(p*=M),g=l*(d*=M)-a*v,x=a*p-h*d;(M=Math.sqrt(m*m+g*g+x*x))?(m*=M=1/M,g*=M,x*=M):(m=0,g=0,x=0);var y=p*x-v*g,w=v*m-d*x,b=d*g-p*m;return(M=Math.sqrt(y*y+w*w+b*b))?(y*=M=1/M,w*=M,b*=M):(y=0,w=0,b=0),n[0]=m,n[1]=y,n[2]=d,n[3]=0,n[4]=g,n[5]=w,n[6]=p,n[7]=0,n[8]=x,n[9]=b,n[10]=v,n[11]=0,n[12]=-(m*r+g*s+x*o),n[13]=-(y*r+w*s+b*o),n[14]=-(d*r+p*s+v*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),r.zero(),s.zero();var n=this.val,o=r.val,a=s.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),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(r),this.multiplyLocal(s),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),r.scaling(i.x,i.y,i.z),s.xyz(e.x,e.y,e.z),this.multiplyLocal(r),this.multiplyLocal(s),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),r=new n,s=new n;t.exports=n},function(t,e,i){var n=i(0),r=i(10),s=i(26),o=new Int8Array([1,2,0]),a=new Float32Array([0,0,0]),h=new r(1,0,0),l=new r(0,1,0),u=new r,c=new s,f=new n({initialize:function(t,e,i,n){"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)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},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,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,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},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(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 n=c.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(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+r*s+i*a-n*o,this.y=i*h+r*o+n*s-e*a,this.z=n*h+r*a+e*o-i*s,this.w=r*h-e*s-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,r=this.z,s=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+r*h+s*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,f=e;if(1-u>1e-6){var d=Math.acos(u),p=Math.sin(d);c=Math.sin((1-e)*d)/p,f=Math.sin(e*d)/p}return this.x=c*i+f*o,this.y=c*n+f*a,this.z=c*r+f*h,this.w=c*s+f*l,this},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.x=-t*s,this.y=-e*s,this.z=-i*s,this.w=n*s,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.x=e*o+r*s,this.y=i*o+n*s,this.z=n*o-i*s,this.w=r*o-e*s,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*s,this.y=i*o+r*s,this.z=n*o+e*s,this.w=r*o-i*s,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*s,this.y=i*o-e*s,this.z=n*o+r*s,this.w=r*o-n*s,this},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},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=o[r],h=o[s];e=Math.sqrt(i[3*r+r]-i[3*s+s]-i[3*h+h]+1),a[r]=.5*e,e=.5/e,a[s]=(i[3*s+r]+i[3*r+s])*e,a[h]=(i[3*h+r]+i[3*r+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+s]-i[3*s+h])*e}return this}});t.exports=f},function(t,e,i){var n=i(14),r=i(30);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}},function(t,e){t.exports=function(t,e,i,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),{responseType:t,async:e,user:i,password:n,timeout:r,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e){t.exports=function(){}},function(t,e,i){var n=i(33),r=i(0),s=i(11),o=i(144),a=i(145),h=i(167),l=i(168),u=i(186),c=new r({Extends:a,initialize:function(t,e){a.call(this,t,e);var i=e.game;this.isWebGL=2===i.config.renderType,this.cache=i.cache.addCustom("spine"),this.spineTextures=i.cache.addCustom("spineTextures"),this.json=i.cache.json,this.textures=i.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=i.renderer,this.gl=i.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=i.renderer,this.getAtlas=this.getAtlasCanvas),e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",this.add.bind(this),this.make.bind(this))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(o,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){this.sceneRenderer=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0);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))}};this.sceneRenderer.batcher.setBlendMode=t,this.sceneRenderer.shapes.setBlendMode=t,this.skeletonRenderer=this.sceneRenderer.skeletonRenderer,this.skeletonDebugRenderer=this.sceneRenderer.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=new h.TextureAtlas(e.data,function(){return n.get(t)});else{var r=this.textures;i=new h.TextureAtlas(e.data,function(e){var i=new h.canvas.CanvasTexture(r.get(e).getSourceImage());return n.add(t,i),i})}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=new h.TextureAtlas(e.data,function(){return 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(e){var i=new h.webgl.GLTexture(s,r.get(e).getSourceImage(),!1);return n.add(t,i),i})}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,n,r,s){var o;if(Array.isArray(t))for(var a=0;a=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e=1?1:1/e*(1+(e*t|0))}},function(t,e,i){t.exports={Ceil:i(94),Equal:i(95),Floor:i(96),GreaterThan:i(97),LessThan:i(98)}},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,i){return void 0===i&&(i=1e-4),Math.abs(t-e)e-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t1?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[i1?n(t[i],t[i-1],i-r):n(t[s],t[s+1>i?i:s+1],r-s)}},function(t,e){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)}},function(t,e,i){var n=i(23);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(24);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){t.exports={GetNext:i(108),IsSize:i(109),IsValue:i(110)}},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){t.exports={Ceil:i(112),Floor:i(113),To:i(114)}},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){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;i1?void 0!==n?(r=(n-t)/(n-i))<0&&(r=0):r=1:r<0&&(r=0),r}},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,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}},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){var r=Math.cos(n),s=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*r-a*s+e,t.y=o*s+a*r+i,t}},function(t,e){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}},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(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 r=[],s=[],o=0;o0&&t<=e*i&&(s=t>e-1?t-(o=Math.floor(t/e))*e:t,r.set(s,o)),r}},function(t,e,i){var n=i(5);t.exports=function(t,e,i,r,s,o,a,h){void 0===h&&(h=new n);var l=Math.sin(s),u=Math.cos(s),c=u*o,f=l*o,d=-l*a,p=u*a,v=1/(c*p+d*-f);return h.x=p*v*t+-d*v*e+(r*d-i*p)*v,h.y=c*v*e+-f*v*t+(-r*c+i*f)*v,h}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){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,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,o=t.z,a=t.w,h=a*e+s*n-o*i,l=a*i+o*e-r*n,u=a*n+r*i-s*e,c=-r*e-s*i-o*n;return this.x=h*a+c*-r+l*-o-u*-s,this.y=l*a+c*-s+u*-r-h*-o,this.z=u*a+c*-o+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},function(t,e,i){var n=i(10),r=i(27),s=i(28),o=new r,a=new s,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e){t.exports="resize"},function(t,e,i){var n=i(146),r=i(0),s=i(147),o=new r({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){}});t.exports=o},function(t,e,i){var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game,this.scene,this.systems},init:function(){},start:function(){},stop:function(){},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e,i){t.exports={BOOT:i(148),CREATE:i(149),DESTROY:i(150),PAUSE:i(151),POST_UPDATE:i(152),PRE_UPDATE:i(153),READY:i(154),RENDER:i(155),RESUME:i(156),SHUTDOWN:i(157),SLEEP:i(158),START:i(159),TRANSITION_COMPLETE:i(160),TRANSITION_INIT:i(161),TRANSITION_OUT:i(162),TRANSITION_START:i(163),TRANSITION_WAKE:i(164),UPDATE:i(165),WAKE:i(166)}},function(t,e){t.exports="boot"},function(t,e){t.exports="create"},function(t,e){t.exports="destroy"},function(t,e){t.exports="pause"},function(t,e){t.exports="postupdate"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="ready"},function(t,e){t.exports="render"},function(t,e){t.exports="resume"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="sleep"},function(t,e){t.exports="start"},function(t,e){t.exports="transitioncomplete"},function(t,e){t.exports="transitioninit"},function(t,e){t.exports="transitionout"},function(t,e){t.exports="transitionstart"},function(t,e){t.exports="transitionwake"},function(t,e){t.exports="update"},function(t,e){t.exports="wake"},function(t,e){(function(){var e,i,n,r=this&&this.__extends||(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,i){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.duration=i}return t.prototype.apply=function(t,e,i,n,r,s,o,a){if(null==t)throw new Error("skeleton cannot be null.");n&&0!=this.duration&&(i%=this.duration,e>0&&(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.in=0]="in",t[t.out=1]="out"}(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 o=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 o=.03*(2*-i+r),a=.03*(2*-n+s),h=.006*(3*(i-r)+1),l=.006*(3*(n-s)+1),u=2*o+h,c=2*a+l,f=.3*i+o+.16666667*h,d=.3*n+a+.16666667*l,p=t*e.BEZIER_SIZE,v=this.curves;v[p++]=e.BEZIER;for(var M=f,m=d,g=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)/(a-u)}var f=r[s-1];return f+(1-f)*(n-a)/(1-a)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=o;var a=function(i){function o(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e<<1),n}return r(o,i),o.prototype.getPropertyId=function(){return(n.rotate<<24)+this.boneIndex},o.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+o.ROTATION]=i},o.prototype.apply=function(t,i,n,r,a,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(n=u[u.length-o.ENTRIES]){var d=u[u.length+o.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+d*a;break;case e.first:case e.replace:d+=c.data.rotation-c.rotation,d-=360*(16384-(16384.499999999996-d/360|0));case e.add:c.rotation+=d*a}}else{var p=s.binarySearch(u,n,o.ENTRIES),v=u[p+o.PREV_ROTATION],M=u[p],m=this.getCurvePercent((p>>1)-1,1-(n-M)/(u[p+o.PREV_TIME]-M)),g=u[p+o.ROTATION]-v;switch(g=v+(g-360*(16384-(16384.499999999996-g/360|0)))*m,h){case e.setup:c.rotation=c.data.rotation+(g-360*(16384-(16384.499999999996-g/360|0)))*a;break;case e.first:case e.replace:g+=c.data.rotation-c.rotation;case e.add:c.rotation+=(g-360*(16384-(16384.499999999996-g/360|0)))*a}}},o.ENTRIES=2,o.PREV_TIME=-2,o.PREV_ROTATION=-1,o.ROTATION=1,o}(o);t.RotateTimeline=a;var h=function(i){function o(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*o.ENTRIES),n}return r(o,i),o.prototype.getPropertyId=function(){return(n.translate<<24)+this.boneIndex},o.prototype.setFrame=function(t,e,i,n){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.X]=i,this.frames[t+o.Y]=n},o.prototype.apply=function(t,i,n,r,a,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(n=u[u.length-o.ENTRIES])f=u[u.length+o.PREV_X],d=u[u.length+o.PREV_Y];else{var p=s.binarySearch(u,n,o.ENTRIES);f=u[p+o.PREV_X],d=u[p+o.PREV_Y];var v=u[p],M=this.getCurvePercent(p/o.ENTRIES-1,1-(n-v)/(u[p+o.PREV_TIME]-v));f+=(u[p+o.X]-f)*M,d+=(u[p+o.Y]-d)*M}switch(h){case e.setup:c.x=c.data.x+f*a,c.y=c.data.y+d*a;break;case e.first:case e.replace:c.x+=(c.data.x+f-c.x)*a,c.y+=(c.data.y+d-c.y)*a;break;case e.add:c.x+=f*a,c.y+=d*a}}},o.ENTRIES=3,o.PREV_TIME=-3,o.PREV_X=-2,o.PREV_Y=-1,o.X=1,o.Y=2,o}(o);t.TranslateTimeline=h;var l=function(o){function a(t){return o.call(this,t)||this}return r(a,o),a.prototype.getPropertyId=function(){return(n.scale<<24)+this.boneIndex},a.prototype.apply=function(n,r,o,h,l,u,c){var f=this.frames,d=n.bones[this.boneIndex];if(o=f[f.length-a.ENTRIES])p=f[f.length+a.PREV_X]*d.data.scaleX,v=f[f.length+a.PREV_Y]*d.data.scaleY;else{var M=s.binarySearch(f,o,a.ENTRIES);p=f[M+a.PREV_X],v=f[M+a.PREV_Y];var m=f[M],g=this.getCurvePercent(M/a.ENTRIES-1,1-(o-m)/(f[M+a.PREV_TIME]-m));p=(p+(f[M+a.X]-p)*g)*d.data.scaleX,v=(v+(f[M+a.Y]-v)*g)*d.data.scaleY}if(1==l)u==e.add?(d.scaleX+=p-d.data.scaleX,d.scaleY+=v-d.data.scaleY):(d.scaleX=p,d.scaleY=v);else{var x=0,y=0;if(c==i.out)switch(u){case e.setup:x=d.data.scaleX,y=d.data.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,d.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.first:case e.replace:x=d.scaleX,y=d.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,d.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.add:x=d.scaleX,y=d.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-d.data.scaleX)*l,d.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-d.data.scaleY)*l}else switch(u){case e.setup:x=Math.abs(d.data.scaleX)*t.MathUtils.signum(p),y=Math.abs(d.data.scaleY)*t.MathUtils.signum(v),d.scaleX=x+(p-x)*l,d.scaleY=y+(v-y)*l;break;case e.first:case e.replace:x=Math.abs(d.scaleX)*t.MathUtils.signum(p),y=Math.abs(d.scaleY)*t.MathUtils.signum(v),d.scaleX=x+(p-x)*l,d.scaleY=y+(v-y)*l;break;case e.add:x=t.MathUtils.signum(p),y=t.MathUtils.signum(v),d.scaleX=Math.abs(d.scaleX)*x+(p-Math.abs(d.data.scaleX)*x)*l,d.scaleY=Math.abs(d.scaleY)*y+(v-Math.abs(d.data.scaleY)*y)*l}}}},a}(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,o,a,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(r=u[u.length-i.ENTRIES])f=u[u.length+i.PREV_X],d=u[u.length+i.PREV_Y];else{var p=s.binarySearch(u,r,i.ENTRIES);f=u[p+i.PREV_X],d=u[p+i.PREV_Y];var v=u[p],M=this.getCurvePercent(p/i.ENTRIES-1,1-(r-v)/(u[p+i.PREV_TIME]-v));f+=(u[p+i.X]-f)*M,d+=(u[p+i.Y]-d)*M}switch(h){case e.setup:c.shearX=c.data.shearX+f*a,c.shearY=c.data.shearY+d*a;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+f-c.shearX)*a,c.shearY+=(c.data.shearY+d-c.shearY)*a;break;case e.add:c.shearX+=f*a,c.shearY+=d*a}}},i}(h);t.ShearTimeline=u;var c=function(i){function o(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*o.ENTRIES),n}return r(o,i),o.prototype.getPropertyId=function(){return(n.color<<24)+this.slotIndex},o.prototype.setFrame=function(t,e,i,n,r,s){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.R]=i,this.frames[t+o.G]=n,this.frames[t+o.B]=r,this.frames[t+o.A]=s},o.prototype.apply=function(t,i,n,r,a,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(n=c[c.length-o.ENTRIES]){var g=c.length;p=c[g+o.PREV_R],v=c[g+o.PREV_G],M=c[g+o.PREV_B],m=c[g+o.PREV_A]}else{var x=s.binarySearch(c,n,o.ENTRIES);p=c[x+o.PREV_R],v=c[x+o.PREV_G],M=c[x+o.PREV_B],m=c[x+o.PREV_A];var y=c[x],w=this.getCurvePercent(x/o.ENTRIES-1,1-(n-y)/(c[x+o.PREV_TIME]-y));p+=(c[x+o.R]-p)*w,v+=(c[x+o.G]-v)*w,M+=(c[x+o.B]-M)*w,m+=(c[x+o.A]-m)*w}if(1==a)u.color.set(p,v,M,m);else{f=u.color;h==e.setup&&f.setFromColor(u.data.color),f.add((p-f.r)*a,(v-f.g)*a,(M-f.b)*a,(m-f.a)*a)}}},o.ENTRIES=5,o.PREV_TIME=-5,o.PREV_R=-4,o.PREV_G=-3,o.PREV_B=-2,o.PREV_A=-1,o.R=1,o.G=2,o.B=3,o.A=4,o}(o);t.ColorTimeline=c;var f=function(i){function o(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*o.ENTRIES),n}return r(o,i),o.prototype.getPropertyId=function(){return(n.twoColor<<24)+this.slotIndex},o.prototype.setFrame=function(t,e,i,n,r,s,a,h,l){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.R]=i,this.frames[t+o.G]=n,this.frames[t+o.B]=r,this.frames[t+o.A]=s,this.frames[t+o.R2]=a,this.frames[t+o.G2]=h,this.frames[t+o.B2]=l},o.prototype.apply=function(t,i,n,r,a,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(n=c[c.length-o.ENTRIES]){var A=c.length;M=c[A+o.PREV_R],m=c[A+o.PREV_G],g=c[A+o.PREV_B],x=c[A+o.PREV_A],y=c[A+o.PREV_R2],w=c[A+o.PREV_G2],b=c[A+o.PREV_B2]}else{var E=s.binarySearch(c,n,o.ENTRIES);M=c[E+o.PREV_R],m=c[E+o.PREV_G],g=c[E+o.PREV_B],x=c[E+o.PREV_A],y=c[E+o.PREV_R2],w=c[E+o.PREV_G2],b=c[E+o.PREV_B2];var R=c[E],T=this.getCurvePercent(E/o.ENTRIES-1,1-(n-R)/(c[E+o.PREV_TIME]-R));M+=(c[E+o.R]-M)*T,m+=(c[E+o.G]-m)*T,g+=(c[E+o.B]-g)*T,x+=(c[E+o.A]-x)*T,y+=(c[E+o.R2]-y)*T,w+=(c[E+o.G2]-w)*T,b+=(c[E+o.B2]-b)*T}if(1==a)u.color.set(M,m,g,x),u.darkColor.set(y,w,b,1);else{f=u.color,d=u.darkColor;h==e.setup&&(f.setFromColor(u.data.color),d.setFromColor(u.data.darkColor)),f.add((M-f.r)*a,(m-f.g)*a,(g-f.b)*a,(x-f.a)*a),d.add((y-d.r)*a,(w-d.g)*a,(b-d.b)*a,0)}}},o.ENTRIES=8,o.PREV_TIME=-8,o.PREV_R=-7,o.PREV_G=-6,o.PREV_B=-5,o.PREV_A=-4,o.PREV_R2=-3,o.PREV_G2=-2,o.PREV_B2=-1,o.R=1,o.G=2,o.B=3,o.A=4,o.R2=5,o.G2=6,o.B2=7,o}(o);t.TwoColorTimeline=f;var d=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,o,a,h,l){var u=t.slots[this.slotIndex];if(l!=i.out||h!=e.setup){var c=this.frames;if(r=c[c.length-1]?c.length-1:s.binarySearch(c,r,1)-1;var p=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(null==p?null:t.getAttachment(this.slotIndex,p))}}else{var v=u.data.attachmentName;u.setAttachment(null==v?null:t.getAttachment(this.slotIndex,v))}},r}();t.AttachmentTimeline=d;var p=null,v=function(i){function o(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(o,i),o.prototype.getPropertyId=function(){return(n.deform<<27)+ +this.attachment.id+this.slotIndex},o.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},o.prototype.apply=function(i,n,r,o,a,h,l){var u=i.slots[this.slotIndex],c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.applyDeform(this.attachment)){var f=u.attachmentVertices;0==f.length&&(h=e.setup);var d=this.frameVertices,p=d[0].length,v=this.frames;if(r=v[v.length-1]){var w=d[v.length-1];if(1==a)if(h==e.add)if(null==(M=c).bones){g=M.vertices;for(var b=0;bi)this.apply(t,e,Number.MAX_VALUE,n,r,o,a),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=M;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,o,a,h,l,u){var c=n.drawOrder,f=n.slots;if(u!=i.out||l!=e.setup){var d=this.frames;if(o=d[d.length-1]?d.length-1:s.binarySearch(d,o)-1;var v=this.drawOrders[p];if(null==v)t.Utils.arrayCopy(f,0,c,0,f.length);else for(var M=0,m=v.length;M=c[c.length-a.ENTRIES])l==e.setup?(f.mix=f.data.mix+(c[c.length+a.PREV_MIX]-f.data.mix)*h,u==i.out?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[c.length+a.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+a.PREV_COMPRESS],f.stretch=0!=c[c.length+a.PREV_STRETCH])):(f.mix+=(c[c.length+a.PREV_MIX]-f.mix)*h,u==i.in&&(f.bendDirection=c[c.length+a.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+a.PREV_COMPRESS],f.stretch=0!=c[c.length+a.PREV_STRETCH]));else{var d=s.binarySearch(c,r,a.ENTRIES),p=c[d+a.PREV_MIX],v=c[d],M=this.getCurvePercent(d/a.ENTRIES-1,1-(r-v)/(c[d+a.PREV_TIME]-v));l==e.setup?(f.mix=f.data.mix+(p+(c[d+a.MIX]-p)*M-f.data.mix)*h,u==i.out?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[d+a.PREV_BEND_DIRECTION],f.compress=0!=c[d+a.PREV_COMPRESS],f.stretch=0!=c[d+a.PREV_STRETCH])):(f.mix+=(p+(c[d+a.MIX]-p)*M-f.mix)*h,u==i.in&&(f.bendDirection=c[d+a.PREV_BEND_DIRECTION],f.compress=0!=c[d+a.PREV_COMPRESS],f.stretch=0!=c[d+a.PREV_STRETCH]))}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_MIX=-4,a.PREV_BEND_DIRECTION=-3,a.PREV_COMPRESS=-2,a.PREV_STRETCH=-1,a.MIX=1,a.BEND_DIRECTION=2,a.COMPRESS=3,a.STRETCH=4,a}(o);t.IkConstraintTimeline=g;var x=function(i){function o(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*o.ENTRIES),n}return r(o,i),o.prototype.getPropertyId=function(){return(n.transformConstraint<<24)+this.transformConstraintIndex},o.prototype.setFrame=function(t,e,i,n,r,s){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.ROTATE]=i,this.frames[t+o.TRANSLATE]=n,this.frames[t+o.SCALE]=r,this.frames[t+o.SHEAR]=s},o.prototype.apply=function(t,i,n,r,a,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(n=u[u.length-o.ENTRIES]){var m=u.length;d=u[m+o.PREV_ROTATE],p=u[m+o.PREV_TRANSLATE],v=u[m+o.PREV_SCALE],M=u[m+o.PREV_SHEAR]}else{var g=s.binarySearch(u,n,o.ENTRIES);d=u[g+o.PREV_ROTATE],p=u[g+o.PREV_TRANSLATE],v=u[g+o.PREV_SCALE],M=u[g+o.PREV_SHEAR];var x=u[g],y=this.getCurvePercent(g/o.ENTRIES-1,1-(n-x)/(u[g+o.PREV_TIME]-x));d+=(u[g+o.ROTATE]-d)*y,p+=(u[g+o.TRANSLATE]-p)*y,v+=(u[g+o.SCALE]-v)*y,M+=(u[g+o.SHEAR]-M)*y}if(h==e.setup){f=c.data;c.rotateMix=f.rotateMix+(d-f.rotateMix)*a,c.translateMix=f.translateMix+(p-f.translateMix)*a,c.scaleMix=f.scaleMix+(v-f.scaleMix)*a,c.shearMix=f.shearMix+(M-f.shearMix)*a}else c.rotateMix+=(d-c.rotateMix)*a,c.translateMix+=(p-c.translateMix)*a,c.scaleMix+=(v-c.scaleMix)*a,c.shearMix+=(M-c.shearMix)*a}},o.ENTRIES=5,o.PREV_TIME=-5,o.PREV_ROTATE=-4,o.PREV_TRANSLATE=-3,o.PREV_SCALE=-2,o.PREV_SHEAR=-1,o.ROTATE=1,o.TRANSLATE=2,o.SCALE=3,o.SHEAR=4,o}(o);t.TransformConstraintTimeline=x;var y=function(i){function o(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*o.ENTRIES),n}return r(o,i),o.prototype.getPropertyId=function(){return(n.pathConstraintPosition<<24)+this.pathConstraintIndex},o.prototype.setFrame=function(t,e,i){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.VALUE]=i},o.prototype.apply=function(t,i,n,r,a,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(n=u[u.length-o.ENTRIES])f=u[u.length+o.PREV_VALUE];else{var d=s.binarySearch(u,n,o.ENTRIES);f=u[d+o.PREV_VALUE];var p=u[d],v=this.getCurvePercent(d/o.ENTRIES-1,1-(n-p)/(u[d+o.PREV_TIME]-p));f+=(u[d+o.VALUE]-f)*v}h==e.setup?c.position=c.data.position+(f-c.data.position)*a:c.position+=(f-c.position)*a}},o.ENTRIES=2,o.PREV_TIME=-2,o.PREV_VALUE=-1,o.VALUE=1,o}(o);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,o,a,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r=u[u.length-i.ENTRIES])f=u[u.length+i.PREV_VALUE];else{var d=s.binarySearch(u,r,i.ENTRIES);f=u[d+i.PREV_VALUE];var p=u[d],v=this.getCurvePercent(d/i.ENTRIES-1,1-(r-p)/(u[d+i.PREV_TIME]-p));f+=(u[d+i.VALUE]-f)*v}h==e.setup?c.spacing=c.data.spacing+(f-c.data.spacing)*a:c.spacing+=(f-c.spacing)*a}},i}(y);t.PathConstraintSpacingTimeline=w;var b=function(i){function o(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*o.ENTRIES),n}return r(o,i),o.prototype.getPropertyId=function(){return(n.pathConstraintMix<<24)+this.pathConstraintIndex},o.prototype.setFrame=function(t,e,i,n){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.ROTATE]=i,this.frames[t+o.TRANSLATE]=n},o.prototype.apply=function(t,i,n,r,a,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(n=u[u.length-o.ENTRIES])f=u[u.length+o.PREV_ROTATE],d=u[u.length+o.PREV_TRANSLATE];else{var p=s.binarySearch(u,n,o.ENTRIES);f=u[p+o.PREV_ROTATE],d=u[p+o.PREV_TRANSLATE];var v=u[p],M=this.getCurvePercent(p/o.ENTRIES-1,1-(n-v)/(u[p+o.PREV_TIME]-v));f+=(u[p+o.ROTATE]-f)*M,d+=(u[p+o.TRANSLATE]-d)*M}h==e.setup?(c.rotateMix=c.data.rotateMix+(f-c.data.rotateMix)*a,c.translateMix=c.data.translateMix+(d-c.data.translateMix)*a):(c.rotateMix+=(f-c.rotateMix)*a,c.translateMix+=(d-c.translateMix)*a)}},o.ENTRIES=3,o.PREV_TIME=-3,o.PREV_ROTATE=-2,o.PREV_TRANSLATE=-1,o.ROTATE=1,o.TRANSLATE=2,o}(o);t.PathConstraintMixTimeline=b}(n||(n={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.timeScale=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 o=r.next;if(null!=o){var a=r.trackLast-o.delay;if(a>=0){for(o.delay=0,o.trackTime=0==r.timeScale?0:(a/r.timeScale+t)*o.timeScale,r.trackTime+=s,this.setCurrent(i,o,!0);null!=o.mixingFrom;)o.mixTime+=t,o=o.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,o=0,a=r.length;o0)){s=!0;var l=0==o?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,f=h.getAnimationTime(),d=h.animation.timelines.length,p=h.animation.timelines;if(0==o&&1==u||l==t.MixBlend.add)for(var v=0;v1&&(o=1),r!=t.MixBlend.first&&(r=s.mixBlend));var a=o0&&this.queueEvents(s,c),this.events.length=0,s.nextAnimationLast=c,s.nextTrackLast=s.trackTime,o},e.prototype.applyRotateTimeline=function(e,i,n,r,s,o,a,h){if(h&&(o[a]=0),1!=r){var l=e,u=l.frames,c=i.bones[l.boneIndex],f=0,d=0;if(n=u[u.length-t.RotateTimeline.ENTRIES])d=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],M=u[p],m=l.getCurvePercent((p>>1)-1,1-(n-M)/(u[p+t.RotateTimeline.PREV_TIME]-M));d=u[p+t.RotateTimeline.ROTATION]-v,d=v+(d-=360*(16384-(16384.499999999996-d/360|0)))*m+c.data.rotation,d-=360*(16384-(16384.499999999996-d/360|0))}var g=0,x=d-f;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))g=o[a];else{var y=0,w=0;h?(y=0,w=x):(y=o[a],w=o[a+1]);var b=x>0,A=y>=0;t.MathUtils.signum(w)!=t.MathUtils.signum(x)&&Math.abs(w)<=90&&(Math.abs(y)>180&&(y+=360*t.MathUtils.signum(y)),A=b),g=x+y-y%360,A!=b&&(g+=360*t.MathUtils.signum(y)),o[a]=g}o[a+1]=x,f+=g*r,c.rotation=f-360*(16384-(16384.499999999996-f/360|0))}else e.apply(i,0,n,null,1,s,t.MixDirection.in)},e.prototype.queueEvents=function(t,e){for(var i=t.animationStart,n=t.animationEnd,r=n-i,s=t.trackLast%r,o=this.events,a=0,h=o.length;an||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 o=r.animationEnd-r.animationStart;0!=o?(r.loop?n+=o*(1+(r.trackTime/o|0)):n+=Math.max(o,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){o[l]=e.HOLD_MIX,a[l]=c;continue t}break}o[l]=e.HOLD}else o[l]=e.FIRST;else o[l]=e.SUBSEQUENT}},e.prototype.hasTimeline=function(t,e){for(var i=t.animation.timelines,n=0,r=i.length;n=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=2,e.HOLD_MIX=3,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?i.substring(0,i.lastIndexOf("/")):"";i=this.pathPrefix+i,this.toLoad++,e.downloadText(i,function(e){var a={count:0},h=new Array;try{new t.TextureAtlas(e,function(e){h.push(o+"/"+e);var i=document.createElement("img");return i.width=16,i.height=16,new t.FakeTexture(i)})}catch(t){var l=t;return s.errors[i]="Couldn't load texture atlas "+i+": "+l.message,r&&r(i,"Couldn't load texture atlas "+i+": "+l.message),s.toLoad--,void s.loaded++}for(var u=function(l){var u=!1;s.loadTexture(l,function(l,c){if(a.count++,a.count==h.length)if(u)s.errors[i]="Couldn't load texture atlas page "+l+"} of atlas "+i,r&&r(i,"Couldn't load texture atlas page "+l+" of atlas "+i),s.toLoad--,s.loaded++;else try{var f=new t.TextureAtlas(e,function(t){return s.get(o+"/"+t)});s.assets[i]=f,n&&n(i,f),s.toLoad--,s.loaded++}catch(t){var d=t;s.errors[i]="Couldn't load texture atlas "+i+": "+d.message,r&&r(i,"Couldn't load texture atlas "+i+": "+d.message),s.toLoad--,s.loaded++}},function(t,e){u=!0,a.count++,a.count==h.length&&(s.errors[i]="Couldn't load texture atlas page "+t+"} of atlas "+i,r&&r(i,"Couldn't load texture atlas page "+t+" of atlas "+i),s.toLoad--,s.loaded++)})},c=0,f=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.worldX=0,this.c=0,this.d=0,this.worldY=0,this.sorted=!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.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,o,a){this.ax=e,this.ay=i,this.arotation=n,this.ascaleX=r,this.ascaleY=s,this.ashearX=o,this.ashearY=a,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=n+90+a,c=l.scaleX,f=l.scaleY;return this.a=t.MathUtils.cosDeg(n+o)*r*c,this.b=t.MathUtils.cosDeg(u)*s*c,this.c=t.MathUtils.sinDeg(n+o)*r*f,this.d=t.MathUtils.sinDeg(u)*s*f,this.worldX=e*c+l.x,void(this.worldY=i*f+l.y)}var d=h.a,p=h.b,v=h.c,M=h.d;switch(this.worldX=d*e+p*i+h.worldX,this.worldY=v*e+M*i+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=n+90+a;var m=t.MathUtils.cosDeg(n+o)*r,g=t.MathUtils.cosDeg(u)*s,x=t.MathUtils.sinDeg(n+o)*r,y=t.MathUtils.sinDeg(u)*s;return this.a=d*m+p*x,this.b=d*g+p*y,this.c=v*m+M*x,void(this.d=v*g+M*y);case t.TransformMode.OnlyTranslation:u=n+90+a;this.a=t.MathUtils.cosDeg(n+o)*r,this.b=t.MathUtils.cosDeg(u)*s,this.c=t.MathUtils.sinDeg(n+o)*r,this.d=t.MathUtils.sinDeg(u)*s;break;case t.TransformMode.NoRotationOrReflection:var w=0;(E=d*d+v*v)>1e-4?(p=v*(E=Math.abs(d*M-p*v)/E),M=d*E,w=Math.atan2(v,d)*t.MathUtils.radDeg):(d=0,v=0,w=90-Math.atan2(M,p)*t.MathUtils.radDeg);var b=n+o-w,A=n+a-w+90;m=t.MathUtils.cosDeg(b)*r,g=t.MathUtils.cosDeg(A)*s,x=t.MathUtils.sinDeg(b)*r,y=t.MathUtils.sinDeg(A)*s;this.a=d*m-p*x,this.b=d*g-p*y,this.c=v*m+M*x,this.d=v*g+M*y;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var E,R=t.MathUtils.cosDeg(n),T=t.MathUtils.sinDeg(n),I=(d*R+p*T)/this.skeleton.scaleX,S=(v*R+M*T)/this.skeleton.scaleY;(E=Math.sqrt(I*I+S*S))>1e-5&&(E=1/E),I*=E,S*=E,E=Math.sqrt(I*I+S*S),this.data.transformMode==t.TransformMode.NoScale&&d*M-p*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(E=-E);var C=Math.PI/2+Math.atan2(S,I),P=Math.cos(C)*E,L=Math.sin(C)*E;m=t.MathUtils.cosDeg(o)*r,g=t.MathUtils.cosDeg(90+a)*s,x=t.MathUtils.sinDeg(o)*r,y=t.MathUtils.sinDeg(90+a)*s;this.a=I*m+P*x,this.b=I*g+P*y,this.c=S*m+L*x,this.d=S*g+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,o=1/(i*s-n*r),a=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=a*s*o-h*n*o,this.ay=h*i*o-a*r*o;var l=o*s,u=o*i,c=o*n,f=o*r,d=l*this.a-c*this.c,p=l*this.b-c*this.d,v=u*this.c-f*this.a,M=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+v*v),this.ascaleX>1e-4){var m=d*M-p*v;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(d*p+v*M,m)*t.MathUtils.radDeg,this.arotation=Math.atan2(v,d)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+M*M),this.ashearY=0,this.arotation=90-Math.atan2(M,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),o=t.x-this.worldX,a=t.y-this.worldY;return t.x=o*r*s-a*i*s,t.y=a*e*s-o*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,o=t.MathUtils.cosDeg(e),a=t.MathUtils.sinDeg(e);this.a=o*i-a*r,this.b=o*n-a*s,this.c=a*i+o*r,this.d=a*n+o*s,this.appliedValid=!1},e}();t.Bone=e}(n||(n={})),function(t){var e,i=function(){return function(t,i,n){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,t<0)throw new Error("index must be >= 0.");if(null==i)throw new Error("name cannot be null.");this.index=t,this.name=i,this.parent=n}}();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(){return 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(){return 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,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.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i180?p-=360:p<-180&&(p+=360);var v=e.ascaleX,M=e.ascaleY;if(r||s){var m=e.data.length*v,g=Math.sqrt(f*f+d*d);if(r&&gm&&m>1e-4){var x=(g/m-1)*a+1;v*=x,o&&(M*=x)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+p*a,v,M,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,i,n,r,s,o,a){if(0!=a){e.appliedValid||e.updateAppliedTransform(),i.appliedValid||i.updateAppliedTransform();var h=e.ax,l=e.ay,u=e.ascaleX,c=u,f=e.ascaleY,d=i.ascaleX,p=0,v=0,M=0;u<0?(u=-u,p=180,M=-1):(p=0,M=1),f<0&&(f=-f,M=-M),d<0?(d=-d,v=180):v=0;var m=i.ax,g=0,x=0,y=0,w=e.a,b=e.b,A=e.c,E=e.d,R=Math.abs(u-f)<=1e-4;R?(x=w*m+b*(g=i.ay)+e.worldX,y=A*m+E*g+e.worldY):(g=0,x=w*m+e.worldX,y=A*m+e.worldY);var T=e.parent;w=T.a,b=T.b,A=T.c;var I=1/(w*(E=T.d)-b*A),S=n-T.worldX,C=r-T.worldY,P=(S*E-C*b)*I-h,L=(C*w-S*A)*I-l,O=P*P+L*L,D=((S=x-T.worldX)*E-(C=y-T.worldY)*b)*I-h,k=(C*w-S*A)*I-l,Y=Math.sqrt(D*D+k*k),V=i.data.length*d,N=0,F=0;t:if(R){var z=(O-Y*Y-(V*=u)*V)/(2*Y*V);z<-1?z=-1:z>1&&(z=1,o&&Y+V>1e-4&&(c*=(Math.sqrt(O)/(Y+V)-1)*a+1)),F=Math.acos(z)*s,w=Y+V*z,b=V*Math.sin(F),N=Math.atan2(L*w-P*b,P*w+L*b)}else{var U=(w=u*V)*w,X=(b=f*V)*b,B=Math.atan2(L,P),_=-2*X*Y,G=X-U;if((E=_*_-4*G*(A=X*Y*Y+U*O-U*X))>=0){var W=Math.sqrt(E);_<0&&(W=-W);var Z=(W=-(_+W)/2)/G,j=A/W,H=Math.abs(Z)=-1&&A<=1&&(A=Math.acos(A),(E=(S=w*Math.cos(A)+Y)*S+(C=b*Math.sin(A))*C)et&&($=A,et=E,tt=S,it=C)),O<=(Q+et)/2?(N=B-Math.atan2(K*s,J),F=q*s):(N=B-Math.atan2(it*s,tt),F=$*s)}var nt=Math.atan2(g,m)*M,rt=e.arotation;(N=(N-nt)*t.MathUtils.radDeg+p-rt)>180?N-=360:N<-180&&(N+=360),e.updateWorldTransformWith(h,l,rt+N*a,c,e.ascaleY,0,0),rt=i.arotation,(F=((F+nt)*t.MathUtils.radDeg-i.ashearX)*M+v-rt)>180?F-=360:F<-180&&(F+=360),i.updateWorldTransformWith(m,g,rt+F*a,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)}else i.updateWorldTransform()},e}();t.IkConstraint=e}(n||(n={})),function(t){var e=function(){return function(t){this.order=0,this.bones=new Array,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.name=t}}();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,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 o=this.data,a=o.spacingMode==t.SpacingMode.Percent,h=o.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,f=l?c:c+1,d=this.bones,p=t.Utils.setArraySize(this.spaces,f),v=null,M=this.spacing;if(u||!a){u&&(v=t.Utils.setArraySize(this.lengths,c));for(var m=o.spacingMode==t.SpacingMode.Length,g=0,x=f-1;g0?t.MathUtils.degRad:-t.MathUtils.degRad;g=0;for(var P=3;gt.MathUtils.PI?U-=t.MathUtils.PI2:U<-t.MathUtils.PI&&(U+=t.MathUtils.PI2),U*=n,X=Math.cos(U),B=Math.sin(U),L.a=X*V-B*F,L.b=X*N-B*z,L.c=B*V+X*F,L.d=B*N+X*z}L.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(i,n,r,s,o){var a=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*n+2),c=null,f=i.closed,d=i.worldVerticesLength,p=d/6,v=e.NONE;if(!i.constantSpeed){var M=i.lengths,m=M[p-=f?1:2];if(s&&(h*=m),o)for(var g=1;gm){v!=e.AFTER&&(v=e.AFTER,i.computeWorldVertices(a,d-6,4,c,0,2)),this.addAfterPosition(w-m,c,0,u,x);continue}}for(;;y++){var b=M[y];if(!(w>b)){if(0==y)w/=b;else w=(w-(q=M[y-1]))/(b-q);break}}y!=v&&(v=y,f&&y==p?(i.computeWorldVertices(a,d-4,4,c,0,2),i.computeWorldVertices(a,0,4,c,4,2)):i.computeWorldVertices(a,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||g>0&&0==W)}return u}f?(d+=2,c=t.Utils.setArraySize(this.world,d),i.computeWorldVertices(a,2,d-4,c,0,2),i.computeWorldVertices(a,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(p--,d-=4,c=t.Utils.setArraySize(this.world,d),i.computeWorldVertices(a,2,d,c,0,2));for(var A=t.Utils.setArraySize(this.curves,p),E=0,R=c[0],T=c[1],I=0,S=0,C=0,P=0,L=0,O=0,D=0,k=0,Y=0,V=0,N=0,F=0,z=0,U=0,X=(g=0,2);gE){this.addAfterPosition(w-E,c,d-4,u,x);continue}}for(;;y++){var Z=A[y];if(!(w>Z)){if(0==y)w/=Z;else w=(w-(q=A[y-1]))/(Z-q);break}}if(y!=v){v=y;var j=6*y;for(R=c[j],T=c[j+1],I=c[j+2],S=c[j+3],C=c[j+4],P=c[j+5],L=c[j+6],O=c[j+7],N=2*(D=.03*(R-2*I+C))+(Y=.006*(3*(I-C)-R+L)),F=2*(k=.03*(T-2*S+P))+(V=.006*(3*(S-P)-T+O)),z=.3*(I-R)+D+.16666667*Y,U=.3*(S-T)+k+.16666667*V,_=Math.sqrt(z*z+U*U),B[0]=_,j=1;j<8;j++)z+=N,U+=F,N+=Y,F+=V,_+=Math.sqrt(z*z+U*U),B[j]=_;z+=N,U+=F,_+=Math.sqrt(z*z+U*U),B[8]=_,z+=N+Y,U+=F+V,_+=Math.sqrt(z*z+U*U),B[9]=_,G=0}for(w*=_;;G++){var H=B[G];if(!(w>H)){var q;if(0==G)w/=H;else w=G+(w-(q=B[G-1]))/(H-q);break}}this.addCurvePosition(.1*w,R,T,I,S,C,P,L,O,u,x,r||g>0&&0==W)}return u},e.prototype.addBeforePosition=function(t,e,i,n,r){var s=e[i],o=e[i+1],a=e[i+2]-s,h=e[i+3]-o,l=Math.atan2(h,a);n[r]=s+t*Math.cos(l),n[r+1]=o+t*Math.sin(l),n[r+2]=l},e.prototype.addAfterPosition=function(t,e,i,n,r){var s=e[i+2],o=e[i+3],a=s-e[i],h=o-e[i+1],l=Math.atan2(h,a);n[r]=s+t*Math.cos(l),n[r+1]=o+t*Math.sin(l),n[r+2]=l},e.prototype.addCurvePosition=function(t,e,i,n,r,s,o,a,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 f=t*t,d=f*t,p=1-t,v=p*p,M=v*p,m=p*t,g=3*m,x=p*g,y=g*t,w=e*M+n*x+s*y+a*d,b=i*M+r*x+o*y+h*d;l[u]=w,l[u+1]=b,c&&(l[u+2]=t<.001?Math.atan2(r-i,n-e):Math.atan2(b-(i*v+r*m*2+o*f),w-(e*v+n*m*2+s*f)))},e.prototype.getOrder=function(){return this.data.order},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(n||(n={})),function(t){var e=function(){return function(t){this.order=0,this.bones=new Array,this.name=t}}();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&&void 0!==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.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?i.rawAssets[e]=n.responseText:i.errors[e]="Couldn't load text "+e+": status "+n.status+", "+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.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 "+e+": status "+n.status+", "+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)){var r=new Image;r.src=i,r.crossOrigin="anonymous",r.onload=function(t){n.rawAssets[i]=r},r.onerror=function(t){n.errors[i]="Couldn't load image "+i}}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var i=this.clientAssets[t];return null===i||void 0===i||i.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=0;e0},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 r=i[i.length-1];this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}this._updateCache.push(t),this.sortReset(n.children),i[i.length-1].sorted=!0},e.prototype.sortPathConstraint=function(e){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,o=this.data.skins.length;s-1||this.updateCacheReset.push(r)}else for(n=0;n=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,o=this.maxX,a=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||t>=o&&i>=o||e>=a&&n>=a)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[a];u+(i-h)/(l-h)*(n[s]-u)=u&&x<=d||x>=d&&x<=u)&&(x>=e&&x<=n||x>=n&&x<=e)){var y=(l*m-h*v)/g;if((y>=c&&y<=p||y>=p&&y<=c)&&(y>=i&&y<=r||y>=r&&y<=i))return!0}u=d,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 o=this.clippingPolygon;e.makeClockwise(o);for(var a=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),h=0,l=a.length;h>1,z=this.clipOutput,U=t.Utils.setArraySize(u,L+F*p),X=0;X=2?(u=a,a=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),a.length=0;for(var c=o,f=o.length-4,d=0;;d+=2){for(var p=c[d],v=c[d+1],M=c[d+2],m=c[d+3],g=p-M,x=v-m,y=u,w=u.length-2,b=a.length,A=0;A0;if(g*(R-m)-x*(E-M)>0){if(S){a.push(T),a.push(I);continue}var C=(L=I-R)*(M-p)-(O=T-E)*(m-v);if(Math.abs(C)>1e-6){var P=(O*(v-R)-L*(p-E))/C;a.push(p+(M-p)*P),a.push(v+(m-v)*P)}else a.push(p),a.push(v)}else if(S){var L,O;C=(L=I-R)*(M-p)-(O=T-E)*(m-v);if(Math.abs(C)>1e-6){P=(O*(v-R)-L*(p-E))/C;a.push(p+(M-p)*P),a.push(v+(m-v)*P)}else a.push(p),a.push(v);a.push(T),a.push(I)}l=!0}if(b==a.length)return h.length=0,!0;if(a.push(a[0]),a.push(a[1]),d==f)break;var D=a;(a=u).length=0,u=D}if(h!=a){h.length=0;d=0;for(var k=a.length-2;d>1;a=0;f--)-1==G[f]&&(G[f]=Z[--H])}y.setFrame(c++,_.time,G)}s.push(y),o=Math.max(o,y.frames[y.getFrameCount()-1])}if(e.events){for(y=new t.EventTimeline(e.events.length),c=0,f=0;f=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},t.prototype.getAttachment=function(t,e){var i=this.attachments[t];return i?i[e]:null},t.prototype.attachAll=function(t,e){for(var i=0,n=0;n= 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 "+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 "+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(){return 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 o=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=o}(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 o=new i(e),a=new Array(4),h=null;;){var l=o.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,u.rotate="true"==o.readValue(),o.readTuple(a);var c=parseInt(a[0]),f=parseInt(a[1]);o.readTuple(a);var d=parseInt(a[0]),p=parseInt(a[1]);u.u=c/h.width,u.v=f/h.height,u.rotate?(u.u2=(c+p)/h.width,u.v2=(f+d)/h.height):(u.u2=(c+d)/h.width,u.v2=(f+p)/h.height),u.x=c,u.y=f,u.width=Math.abs(d),u.height=Math.abs(p),4==o.readTuple(a)&&4==o.readTuple(a)&&o.readTuple(a),u.originalWidth=parseInt(a[0]),u.originalHeight=parseInt(a[1]),o.readTuple(a),u.offsetX=parseInt(a[0]),u.offsetY=parseInt(a[1]),u.index=parseInt(o.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new n).name=l,2==o.readTuple(a)&&(h.width=parseInt(a[0]),h.height=parseInt(a[1]),o.readTuple(a)),o.readTuple(a),h.minFilter=t.Texture.filterFromString(a[0]),h.magFilter=t.Texture.filterFromString(a[1]);var v=o.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==v?h.uWrap=t.TextureWrap.Repeat:"y"==v?h.vWrap=t.TextureWrap.Repeat:"xy"==v&&(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(){return 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,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,f=this.data.offsetShearY*u,d=this.bones,p=0,v=d.length;pt.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2),I*=e;var b=Math.cos(I),A=Math.sin(I);M.a=b*g-A*y,M.b=b*x-A*w,M.c=A*g+b*y,M.d=A*x+b*w,m=!0}if(0!=i){var E=this.temp;s.localToWorld(E.set(this.data.offsetX,this.data.offsetY)),M.worldX+=(E.x-M.worldX)*i,M.worldY+=(E.y-M.worldY)*i,m=!0}if(n>0){var R=Math.sqrt(M.a*M.a+M.c*M.c),T=Math.sqrt(o*o+h*h);R>1e-5&&(R=(R+(T-R+this.data.offsetScaleX)*n)/R),M.a*=R,M.c*=R,R=Math.sqrt(M.b*M.b+M.d*M.d),T=Math.sqrt(a*a+l*l),R>1e-5&&(R=(R+(T-R+this.data.offsetScaleY)*n)/R),M.b*=R,M.d*=R,m=!0}if(r>0){x=M.b,w=M.d;var I,S=Math.atan2(w,x);(I=Math.atan2(l,a)-Math.atan2(h,o)-(S-Math.atan2(M.c,M.a)))>t.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2),I=S+(I+f)*r;R=Math.sqrt(x*x+w*w);M.b=Math.cos(I)*R,M.d=Math.sin(I)*R,m=!0}m&&(M.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,i=this.translateMix,n=this.scaleMix,r=this.shearMix,s=this.target,o=s.a,a=s.b,h=s.c,l=s.d,u=o*l-a*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,d=this.bones,p=0,v=d.length;pt.MathUtils.PI?T-=t.MathUtils.PI2:T<-t.MathUtils.PI&&(T+=t.MathUtils.PI2),T*=e;var b=Math.cos(T),A=Math.sin(T);M.a=b*g-A*y,M.b=b*x-A*w,M.c=A*g+b*y,M.d=A*x+b*w,m=!0}if(0!=i){var E=this.temp;s.localToWorld(E.set(this.data.offsetX,this.data.offsetY)),M.worldX+=E.x*i,M.worldY+=E.y*i,m=!0}if(n>0){var R=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*n+1;M.a*=R,M.c*=R,R=(Math.sqrt(a*a+l*l)-1+this.data.offsetScaleY)*n+1,M.b*=R,M.d*=R,m=!0}if(r>0){var T;(T=Math.atan2(l,a)-Math.atan2(h,o))>t.MathUtils.PI?T-=t.MathUtils.PI2:T<-t.MathUtils.PI&&(T+=t.MathUtils.PI2);x=M.b,w=M.d;T=Math.atan2(w,x)+(T-t.MathUtils.PI/2+f)*r;R=Math.sqrt(x*x+w*w);M.b=Math.cos(T)*R,M.d=Math.sin(T)*R,m=!0}m&&(M.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,o=0,a=s.length;o1e-5&&(d=(d+(r.ascaleX-d+this.data.offsetScaleX)*i)/d),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,f,l,d,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,o=0,a=s.length;o1e-5&&(f*=(r.ascaleX-1+this.data.offsetScaleX)*i+1),d>1e-5&&(d*=(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,f,d,h.ashearX,p)}},e.prototype.getOrder=function(){return this.data.order},e}();t.TransformConstraint=e}(n||(n={})),function(t){var e=function(){return function(t){if(this.order=0,this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=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,null==t)throw new Error("name cannot be null.");this.name=t}}();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(!o[s]){for(var c=r[l]<<1,f=r[s]<<1,d=r[u]<<1,p=i[c],v=i[c+1],M=i[f],m=i[f+1],g=i[d],x=i[d+1],y=(u+1)%n;y!=l;y=(y+1)%n)if(o[y]){var w=r[y]<<1,b=i[w],A=i[w+1];if(e.positiveArea(g,x,p,v,b,A)&&e.positiveArea(p,v,M,m,b,A)&&e.positiveArea(M,m,g,x,b,A))break t}break}if(0==u){do{if(!o[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),o.splice(s,1);var E=(--n+s-1)%n,R=s==n?0:s;o[E]=e.isConcave(E,n,i,r),o[R]=e.isConcave(R,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 o=this.polygonIndicesPool.obtain();o.length=0;var a=this.polygonPool.obtain();a.length=0;for(var h=-1,l=0,u=0,c=i.length;u0?(r.push(a),s.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),(a=this.polygonPool.obtain()).length=0,a.push(v),a.push(M),a.push(m),a.push(g),a.push(x),a.push(y),(o=this.polygonIndicesPool.obtain()).length=0,o.push(f),o.push(d),o.push(p),l=e.winding(v,M,m,g,x,y),h=f)}a.length>0&&(r.push(a),s.push(o));for(u=0,c=r.length;u=0;u--)0==(a=r[u]).length&&(r.splice(u,1),this.polygonPool.free(a),o=s[u],s.splice(u,1),this.polygonIndicesPool.free(o));return r},e.isConcave=function(t,e,i,n){var r=n[(e+t-1)%e]<<1,s=n[t]<<1,o=n[(t+1)%e]<<1;return!this.positiveArea(i[r],i[r+1],i[s],i[s+1],i[o],i[o+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 o=i-t,a=n-e;return r*a-s*o+o*e-t*a>=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 void 0!=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.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 o=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=o;var a=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}(o);t.PowOut=a;var h=function(){function t(){}return t.arrayCopy=function(t,e,i,n,r){for(var s=e,o=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=f;var d=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 o=t.bone.skeleton,a=t.attachmentVertices,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f0&&(h=a);for(var y,w=(y=t.bone).worldX,b=y.worldY,A=y.a,E=y.b,R=y.c,T=y.d,I=e,S=r;S-1&&this.listeners.splice(e,1)},e}();e.Input=i;var n=function(){return function(t,e,i){this.identifier=t,this.x=e,this.y=i}}();e.Touch=n}(t.webgl||(t.webgl={}))}(n||(n={})),function(t){!function(e){var i=function(){function i(e){if(this.logo=null,this.spinner=null,this.angle=0,this.fadeOut=0,this.timeKeeper=new t.TimeKeeper,this.backgroundColor=new t.Color(.135,.135,.135,1),this.tempColor=new t.Color,this.firstDraw=0,this.renderer=e,this.timeKeeper.maxDelta=9,null===i.logoImg){var n=navigator.userAgent.indexOf("Safari")>-1;i.logoImg=new Image,i.logoImg.src=i.SPINE_LOGO_DATA,n||(i.logoImg.crossOrigin="anonymous"),i.logoImg.onload=function(t){i.loaded++},i.spinnerImg=new Image,i.spinnerImg.src=i.SPINNER_DATA,n||(i.spinnerImg.crossOrigin="anonymous"),i.spinnerImg.onload=function(t){i.loaded++}}}return i.prototype.draw=function(t){if(void 0===t&&(t=!1),!(t&&this.fadeOut>i.FADE_SECONDS)){this.timeKeeper.update();var n=Math.abs(Math.sin(this.timeKeeper.totalTime+.75));this.angle-=this.timeKeeper.delta/1.4*360*(1+1.5*Math.pow(n,5));var r=this.renderer,s=r.canvas,o=r.context.gl;r.resize(e.ResizeMode.Stretch);var a=r.camera.position.x,h=r.camera.position.y;if(r.camera.position.set(s.width/2,s.height/2,0),r.camera.viewportWidth=s.width,r.camera.viewportHeight=s.height,t){if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>i.FADE_SECONDS)return void r.camera.position.set(a,h,0);n=1-this.fadeOut/i.FADE_SECONDS,this.tempColor.setFromColor(this.backgroundColor),this.tempColor.a=1-(n-1)*(n-1),r.begin(),r.quad(!0,0,0,s.width,0,s.width,s.height,0,s.height,this.tempColor,this.tempColor,this.tempColor,this.tempColor),r.end()}else o.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),o.clear(o.COLOR_BUFFER_BIT),this.tempColor.a=1;if(this.tempColor.set(1,1,1,this.tempColor.a),2==i.loaded){null===this.logo&&(this.logo=new e.GLTexture(r.context,i.logoImg),this.spinner=new e.GLTexture(r.context,i.spinnerImg)),this.logo.update(!1),this.spinner.update(!1);var l=this.logo.getImage().width,u=this.logo.getImage().height,c=this.spinner.getImage().width,f=this.spinner.getImage().height;r.batcher.setBlendMode(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA),r.begin(),r.drawTexture(this.logo,(s.width-l)/2,(s.height-u)/2,l,u,this.tempColor),r.drawTextureRotated(this.spinner,(s.width-c)/2,(s.height-f)/2,c,f,c/2,f/2,this.angle,this.tempColor),r.end(),r.cam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t.M11=5,t.M12=9,t.M13=13,t.M20=2,t.M21=6,t.M22=10,t.M23=14,t.M30=3,t.M31=7,t.M32=11,t.M33=15;var e=function(){function e(){this.temp=new Float32Array(16),this.values=new Float32Array(16);var e=this.values;e[t.M00]=1,e[t.M11]=1,e[t.M22]=1,e[t.M33]=1}return e.prototype.set=function(t){return this.values.set(t),this},e.prototype.transpose=function(){var e=this.temp,i=this.values;return e[t.M00]=i[t.M00],e[t.M01]=i[t.M10],e[t.M02]=i[t.M20],e[t.M03]=i[t.M30],e[t.M10]=i[t.M01],e[t.M11]=i[t.M11],e[t.M12]=i[t.M21],e[t.M13]=i[t.M31],e[t.M20]=i[t.M02],e[t.M21]=i[t.M12],e[t.M22]=i[t.M22],e[t.M23]=i[t.M32],e[t.M30]=i[t.M03],e[t.M31]=i[t.M13],e[t.M32]=i[t.M23],e[t.M33]=i[t.M33],this.set(e)},e.prototype.identity=function(){var e=this.values;return e[t.M00]=1,e[t.M01]=0,e[t.M02]=0,e[t.M03]=0,e[t.M10]=0,e[t.M11]=1,e[t.M12]=0,e[t.M13]=0,e[t.M20]=0,e[t.M21]=0,e[t.M22]=1,e[t.M23]=0,e[t.M30]=0,e[t.M31]=0,e[t.M32]=0,e[t.M33]=1,this},e.prototype.invert=function(){var e=this.values,i=this.temp,n=e[t.M30]*e[t.M21]*e[t.M12]*e[t.M03]-e[t.M20]*e[t.M31]*e[t.M12]*e[t.M03]-e[t.M30]*e[t.M11]*e[t.M22]*e[t.M03]+e[t.M10]*e[t.M31]*e[t.M22]*e[t.M03]+e[t.M20]*e[t.M11]*e[t.M32]*e[t.M03]-e[t.M10]*e[t.M21]*e[t.M32]*e[t.M03]-e[t.M30]*e[t.M21]*e[t.M02]*e[t.M13]+e[t.M20]*e[t.M31]*e[t.M02]*e[t.M13]+e[t.M30]*e[t.M01]*e[t.M22]*e[t.M13]-e[t.M00]*e[t.M31]*e[t.M22]*e[t.M13]-e[t.M20]*e[t.M01]*e[t.M32]*e[t.M13]+e[t.M00]*e[t.M21]*e[t.M32]*e[t.M13]+e[t.M30]*e[t.M11]*e[t.M02]*e[t.M23]-e[t.M10]*e[t.M31]*e[t.M02]*e[t.M23]-e[t.M30]*e[t.M01]*e[t.M12]*e[t.M23]+e[t.M00]*e[t.M31]*e[t.M12]*e[t.M23]+e[t.M10]*e[t.M01]*e[t.M32]*e[t.M23]-e[t.M00]*e[t.M11]*e[t.M32]*e[t.M23]-e[t.M20]*e[t.M11]*e[t.M02]*e[t.M33]+e[t.M10]*e[t.M21]*e[t.M02]*e[t.M33]+e[t.M20]*e[t.M01]*e[t.M12]*e[t.M33]-e[t.M00]*e[t.M21]*e[t.M12]*e[t.M33]-e[t.M10]*e[t.M01]*e[t.M22]*e[t.M33]+e[t.M00]*e[t.M11]*e[t.M22]*e[t.M33];if(0==n)throw new Error("non-invertible matrix");var r=1/n;return i[t.M00]=e[t.M12]*e[t.M23]*e[t.M31]-e[t.M13]*e[t.M22]*e[t.M31]+e[t.M13]*e[t.M21]*e[t.M32]-e[t.M11]*e[t.M23]*e[t.M32]-e[t.M12]*e[t.M21]*e[t.M33]+e[t.M11]*e[t.M22]*e[t.M33],i[t.M01]=e[t.M03]*e[t.M22]*e[t.M31]-e[t.M02]*e[t.M23]*e[t.M31]-e[t.M03]*e[t.M21]*e[t.M32]+e[t.M01]*e[t.M23]*e[t.M32]+e[t.M02]*e[t.M21]*e[t.M33]-e[t.M01]*e[t.M22]*e[t.M33],i[t.M02]=e[t.M02]*e[t.M13]*e[t.M31]-e[t.M03]*e[t.M12]*e[t.M31]+e[t.M03]*e[t.M11]*e[t.M32]-e[t.M01]*e[t.M13]*e[t.M32]-e[t.M02]*e[t.M11]*e[t.M33]+e[t.M01]*e[t.M12]*e[t.M33],i[t.M03]=e[t.M03]*e[t.M12]*e[t.M21]-e[t.M02]*e[t.M13]*e[t.M21]-e[t.M03]*e[t.M11]*e[t.M22]+e[t.M01]*e[t.M13]*e[t.M22]+e[t.M02]*e[t.M11]*e[t.M23]-e[t.M01]*e[t.M12]*e[t.M23],i[t.M10]=e[t.M13]*e[t.M22]*e[t.M30]-e[t.M12]*e[t.M23]*e[t.M30]-e[t.M13]*e[t.M20]*e[t.M32]+e[t.M10]*e[t.M23]*e[t.M32]+e[t.M12]*e[t.M20]*e[t.M33]-e[t.M10]*e[t.M22]*e[t.M33],i[t.M11]=e[t.M02]*e[t.M23]*e[t.M30]-e[t.M03]*e[t.M22]*e[t.M30]+e[t.M03]*e[t.M20]*e[t.M32]-e[t.M00]*e[t.M23]*e[t.M32]-e[t.M02]*e[t.M20]*e[t.M33]+e[t.M00]*e[t.M22]*e[t.M33],i[t.M12]=e[t.M03]*e[t.M12]*e[t.M30]-e[t.M02]*e[t.M13]*e[t.M30]-e[t.M03]*e[t.M10]*e[t.M32]+e[t.M00]*e[t.M13]*e[t.M32]+e[t.M02]*e[t.M10]*e[t.M33]-e[t.M00]*e[t.M12]*e[t.M33],i[t.M13]=e[t.M02]*e[t.M13]*e[t.M20]-e[t.M03]*e[t.M12]*e[t.M20]+e[t.M03]*e[t.M10]*e[t.M22]-e[t.M00]*e[t.M13]*e[t.M22]-e[t.M02]*e[t.M10]*e[t.M23]+e[t.M00]*e[t.M12]*e[t.M23],i[t.M20]=e[t.M11]*e[t.M23]*e[t.M30]-e[t.M13]*e[t.M21]*e[t.M30]+e[t.M13]*e[t.M20]*e[t.M31]-e[t.M10]*e[t.M23]*e[t.M31]-e[t.M11]*e[t.M20]*e[t.M33]+e[t.M10]*e[t.M21]*e[t.M33],i[t.M21]=e[t.M03]*e[t.M21]*e[t.M30]-e[t.M01]*e[t.M23]*e[t.M30]-e[t.M03]*e[t.M20]*e[t.M31]+e[t.M00]*e[t.M23]*e[t.M31]+e[t.M01]*e[t.M20]*e[t.M33]-e[t.M00]*e[t.M21]*e[t.M33],i[t.M22]=e[t.M01]*e[t.M13]*e[t.M30]-e[t.M03]*e[t.M11]*e[t.M30]+e[t.M03]*e[t.M10]*e[t.M31]-e[t.M00]*e[t.M13]*e[t.M31]-e[t.M01]*e[t.M10]*e[t.M33]+e[t.M00]*e[t.M11]*e[t.M33],i[t.M23]=e[t.M03]*e[t.M11]*e[t.M20]-e[t.M01]*e[t.M13]*e[t.M20]-e[t.M03]*e[t.M10]*e[t.M21]+e[t.M00]*e[t.M13]*e[t.M21]+e[t.M01]*e[t.M10]*e[t.M23]-e[t.M00]*e[t.M11]*e[t.M23],i[t.M30]=e[t.M12]*e[t.M21]*e[t.M30]-e[t.M11]*e[t.M22]*e[t.M30]-e[t.M12]*e[t.M20]*e[t.M31]+e[t.M10]*e[t.M22]*e[t.M31]+e[t.M11]*e[t.M20]*e[t.M32]-e[t.M10]*e[t.M21]*e[t.M32],i[t.M31]=e[t.M01]*e[t.M22]*e[t.M30]-e[t.M02]*e[t.M21]*e[t.M30]+e[t.M02]*e[t.M20]*e[t.M31]-e[t.M00]*e[t.M22]*e[t.M31]-e[t.M01]*e[t.M20]*e[t.M32]+e[t.M00]*e[t.M21]*e[t.M32],i[t.M32]=e[t.M02]*e[t.M11]*e[t.M30]-e[t.M01]*e[t.M12]*e[t.M30]-e[t.M02]*e[t.M10]*e[t.M31]+e[t.M00]*e[t.M12]*e[t.M31]+e[t.M01]*e[t.M10]*e[t.M32]-e[t.M00]*e[t.M11]*e[t.M32],i[t.M33]=e[t.M01]*e[t.M12]*e[t.M20]-e[t.M02]*e[t.M11]*e[t.M20]+e[t.M02]*e[t.M10]*e[t.M21]-e[t.M00]*e[t.M12]*e[t.M21]-e[t.M01]*e[t.M10]*e[t.M22]+e[t.M00]*e[t.M11]*e[t.M22],e[t.M00]=i[t.M00]*r,e[t.M01]=i[t.M01]*r,e[t.M02]=i[t.M02]*r,e[t.M03]=i[t.M03]*r,e[t.M10]=i[t.M10]*r,e[t.M11]=i[t.M11]*r,e[t.M12]=i[t.M12]*r,e[t.M13]=i[t.M13]*r,e[t.M20]=i[t.M20]*r,e[t.M21]=i[t.M21]*r,e[t.M22]=i[t.M22]*r,e[t.M23]=i[t.M23]*r,e[t.M30]=i[t.M30]*r,e[t.M31]=i[t.M31]*r,e[t.M32]=i[t.M32]*r,e[t.M33]=i[t.M33]*r,this},e.prototype.determinant=function(){var e=this.values;return e[t.M30]*e[t.M21]*e[t.M12]*e[t.M03]-e[t.M20]*e[t.M31]*e[t.M12]*e[t.M03]-e[t.M30]*e[t.M11]*e[t.M22]*e[t.M03]+e[t.M10]*e[t.M31]*e[t.M22]*e[t.M03]+e[t.M20]*e[t.M11]*e[t.M32]*e[t.M03]-e[t.M10]*e[t.M21]*e[t.M32]*e[t.M03]-e[t.M30]*e[t.M21]*e[t.M02]*e[t.M13]+e[t.M20]*e[t.M31]*e[t.M02]*e[t.M13]+e[t.M30]*e[t.M01]*e[t.M22]*e[t.M13]-e[t.M00]*e[t.M31]*e[t.M22]*e[t.M13]-e[t.M20]*e[t.M01]*e[t.M32]*e[t.M13]+e[t.M00]*e[t.M21]*e[t.M32]*e[t.M13]+e[t.M30]*e[t.M11]*e[t.M02]*e[t.M23]-e[t.M10]*e[t.M31]*e[t.M02]*e[t.M23]-e[t.M30]*e[t.M01]*e[t.M12]*e[t.M23]+e[t.M00]*e[t.M31]*e[t.M12]*e[t.M23]+e[t.M10]*e[t.M01]*e[t.M32]*e[t.M23]-e[t.M00]*e[t.M11]*e[t.M32]*e[t.M23]-e[t.M20]*e[t.M11]*e[t.M02]*e[t.M33]+e[t.M10]*e[t.M21]*e[t.M02]*e[t.M33]+e[t.M20]*e[t.M01]*e[t.M12]*e[t.M33]-e[t.M00]*e[t.M21]*e[t.M12]*e[t.M33]-e[t.M10]*e[t.M01]*e[t.M22]*e[t.M33]+e[t.M00]*e[t.M11]*e[t.M22]*e[t.M33]},e.prototype.translate=function(e,i,n){var r=this.values;return r[t.M03]+=e,r[t.M13]+=i,r[t.M23]+=n,this},e.prototype.copy=function(){return(new e).set(this.values)},e.prototype.projection=function(e,i,n,r){this.identity();var s=1/Math.tan(n*(Math.PI/180)/2),o=(i+e)/(e-i),a=2*i*e/(e-i),h=this.values;return h[t.M00]=s/r,h[t.M10]=0,h[t.M20]=0,h[t.M30]=0,h[t.M01]=0,h[t.M11]=s,h[t.M21]=0,h[t.M31]=0,h[t.M02]=0,h[t.M12]=0,h[t.M22]=o,h[t.M32]=-1,h[t.M03]=0,h[t.M13]=0,h[t.M23]=a,h[t.M33]=0,this},e.prototype.ortho2d=function(t,e,i,n){return this.ortho(t,t+i,e,e+n,0,1)},e.prototype.ortho=function(e,i,n,r,s,o){this.identity();var a=2/(i-e),h=2/(r-n),l=-2/(o-s),u=-(i+e)/(i-e),c=-(r+n)/(r-n),f=-(o+s)/(o-s),d=this.values;return d[t.M00]=a,d[t.M10]=0,d[t.M20]=0,d[t.M30]=0,d[t.M01]=0,d[t.M11]=h,d[t.M21]=0,d[t.M31]=0,d[t.M02]=0,d[t.M12]=0,d[t.M22]=l,d[t.M32]=0,d[t.M03]=u,d[t.M13]=c,d[t.M23]=f,d[t.M33]=1,this},e.prototype.multiply=function(e){var i=this.temp,n=this.values,r=e.values;return i[t.M00]=n[t.M00]*r[t.M00]+n[t.M01]*r[t.M10]+n[t.M02]*r[t.M20]+n[t.M03]*r[t.M30],i[t.M01]=n[t.M00]*r[t.M01]+n[t.M01]*r[t.M11]+n[t.M02]*r[t.M21]+n[t.M03]*r[t.M31],i[t.M02]=n[t.M00]*r[t.M02]+n[t.M01]*r[t.M12]+n[t.M02]*r[t.M22]+n[t.M03]*r[t.M32],i[t.M03]=n[t.M00]*r[t.M03]+n[t.M01]*r[t.M13]+n[t.M02]*r[t.M23]+n[t.M03]*r[t.M33],i[t.M10]=n[t.M10]*r[t.M00]+n[t.M11]*r[t.M10]+n[t.M12]*r[t.M20]+n[t.M13]*r[t.M30],i[t.M11]=n[t.M10]*r[t.M01]+n[t.M11]*r[t.M11]+n[t.M12]*r[t.M21]+n[t.M13]*r[t.M31],i[t.M12]=n[t.M10]*r[t.M02]+n[t.M11]*r[t.M12]+n[t.M12]*r[t.M22]+n[t.M13]*r[t.M32],i[t.M13]=n[t.M10]*r[t.M03]+n[t.M11]*r[t.M13]+n[t.M12]*r[t.M23]+n[t.M13]*r[t.M33],i[t.M20]=n[t.M20]*r[t.M00]+n[t.M21]*r[t.M10]+n[t.M22]*r[t.M20]+n[t.M23]*r[t.M30],i[t.M21]=n[t.M20]*r[t.M01]+n[t.M21]*r[t.M11]+n[t.M22]*r[t.M21]+n[t.M23]*r[t.M31],i[t.M22]=n[t.M20]*r[t.M02]+n[t.M21]*r[t.M12]+n[t.M22]*r[t.M22]+n[t.M23]*r[t.M32],i[t.M23]=n[t.M20]*r[t.M03]+n[t.M21]*r[t.M13]+n[t.M22]*r[t.M23]+n[t.M23]*r[t.M33],i[t.M30]=n[t.M30]*r[t.M00]+n[t.M31]*r[t.M10]+n[t.M32]*r[t.M20]+n[t.M33]*r[t.M30],i[t.M31]=n[t.M30]*r[t.M01]+n[t.M31]*r[t.M11]+n[t.M32]*r[t.M21]+n[t.M33]*r[t.M31],i[t.M32]=n[t.M30]*r[t.M02]+n[t.M31]*r[t.M12]+n[t.M32]*r[t.M22]+n[t.M33]*r[t.M32],i[t.M33]=n[t.M30]*r[t.M03]+n[t.M31]*r[t.M13]+n[t.M32]*r[t.M23]+n[t.M33]*r[t.M33],this.set(this.temp)},e.prototype.multiplyLeft=function(e){var i=this.temp,n=this.values,r=e.values;return i[t.M00]=r[t.M00]*n[t.M00]+r[t.M01]*n[t.M10]+r[t.M02]*n[t.M20]+r[t.M03]*n[t.M30],i[t.M01]=r[t.M00]*n[t.M01]+r[t.M01]*n[t.M11]+r[t.M02]*n[t.M21]+r[t.M03]*n[t.M31],i[t.M02]=r[t.M00]*n[t.M02]+r[t.M01]*n[t.M12]+r[t.M02]*n[t.M22]+r[t.M03]*n[t.M32],i[t.M03]=r[t.M00]*n[t.M03]+r[t.M01]*n[t.M13]+r[t.M02]*n[t.M23]+r[t.M03]*n[t.M33],i[t.M10]=r[t.M10]*n[t.M00]+r[t.M11]*n[t.M10]+r[t.M12]*n[t.M20]+r[t.M13]*n[t.M30],i[t.M11]=r[t.M10]*n[t.M01]+r[t.M11]*n[t.M11]+r[t.M12]*n[t.M21]+r[t.M13]*n[t.M31],i[t.M12]=r[t.M10]*n[t.M02]+r[t.M11]*n[t.M12]+r[t.M12]*n[t.M22]+r[t.M13]*n[t.M32],i[t.M13]=r[t.M10]*n[t.M03]+r[t.M11]*n[t.M13]+r[t.M12]*n[t.M23]+r[t.M13]*n[t.M33],i[t.M20]=r[t.M20]*n[t.M00]+r[t.M21]*n[t.M10]+r[t.M22]*n[t.M20]+r[t.M23]*n[t.M30],i[t.M21]=r[t.M20]*n[t.M01]+r[t.M21]*n[t.M11]+r[t.M22]*n[t.M21]+r[t.M23]*n[t.M31],i[t.M22]=r[t.M20]*n[t.M02]+r[t.M21]*n[t.M12]+r[t.M22]*n[t.M22]+r[t.M23]*n[t.M32],i[t.M23]=r[t.M20]*n[t.M03]+r[t.M21]*n[t.M13]+r[t.M22]*n[t.M23]+r[t.M23]*n[t.M33],i[t.M30]=r[t.M30]*n[t.M00]+r[t.M31]*n[t.M10]+r[t.M32]*n[t.M20]+r[t.M33]*n[t.M30],i[t.M31]=r[t.M30]*n[t.M01]+r[t.M31]*n[t.M11]+r[t.M32]*n[t.M21]+r[t.M33]*n[t.M31],i[t.M32]=r[t.M30]*n[t.M02]+r[t.M31]*n[t.M12]+r[t.M32]*n[t.M22]+r[t.M33]*n[t.M32],i[t.M33]=r[t.M30]*n[t.M03]+r[t.M31]*n[t.M13]+r[t.M32]*n[t.M23]+r[t.M33]*n[t.M33],this.set(this.temp)},e.prototype.lookAt=function(i,n,r){e.initTemps();var s=e.xAxis,o=e.yAxis,a=e.zAxis;a.setFrom(n).normalize(),s.setFrom(n).normalize(),s.cross(r).normalize(),o.setFrom(s).cross(a).normalize(),this.identity();var h=this.values;return h[t.M00]=s.x,h[t.M01]=s.y,h[t.M02]=s.z,h[t.M10]=o.x,h[t.M11]=o.y,h[t.M12]=o.z,h[t.M20]=-a.x,h[t.M21]=-a.y,h[t.M22]=-a.z,e.tmpMatrix.identity(),e.tmpMatrix.values[t.M03]=-i.x,e.tmpMatrix.values[t.M13]=-i.y,e.tmpMatrix.values[t.M23]=-i.z,this.multiply(e.tmpMatrix),this},e.initTemps=function(){null===e.xAxis&&(e.xAxis=new t.Vector3),null===e.yAxis&&(e.yAxis=new t.Vector3),null===e.zAxis&&(e.zAxis=new t.Vector3)},e.xAxis=null,e.yAxis=null,e.zAxis=null,e.tmpMatrix=new e,e}();t.Matrix4=e}(t.webgl||(t.webgl={}))}(n||(n={})),function(t){!function(t){var e=function(){function e(e,i,n,r){this.attributes=i,this.verticesLength=0,this.dirtyVertices=!1,this.indicesLength=0,this.dirtyIndices=!1,this.elementsPerVertex=0,this.context=e instanceof t.ManagedWebGLRenderingContext?e:new t.ManagedWebGLRenderingContext(e),this.elementsPerVertex=0;for(var s=0;sthis.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(){return 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 o=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=o;var a=function(e){function i(){return e.call(this,t.Shader.COLOR,h.Float,4)||this}return r(i,e),i}(i);t.ColorAttribute=a;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,o=0;o0||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 o=this.QUAD,a=0;o[a++]=e,o[a++]=i,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=0,o[a++]=1,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),o[a++]=e+n,o[a++]=i,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=1,o[a++]=1,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),o[a++]=e+n,o[a++]=i+r,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=1,o[a++]=0,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),o[a++]=e,o[a++]=i+r,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=0,o[a++]=0,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),this.batcher.draw(t,o,this.QUAD_TRIANGLES)},n.prototype.drawTextureUV=function(t,e,i,n,r,s,o,a,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++]=o,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++]=a,u[c++]=o,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++]=a,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,o,a,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,f=i+o,d=n+a,p=-o,v=-a,M=r-o,m=s-a,g=p,x=v,y=p,w=m,b=M,A=m,E=M,R=v,T=0,I=0,S=0,C=0,P=0,L=0,O=0,D=0;if(0!=h){var k=t.MathUtils.cosDeg(h),Y=t.MathUtils.sinDeg(h);S=(P=k*b-Y*A)+((T=k*g-Y*x)-(O=k*y-Y*w)),C=(L=Y*b+k*A)+((I=Y*g+k*x)-(D=Y*y+k*w))}else T=g,I=x,O=y,D=w,P=b,L=A,S=E,C=R;T+=f,I+=d,S+=f,C+=d,P+=f,L+=d,O+=f,D+=d;var V=0;c[V++]=T,c[V++]=I,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++]=S,c[V++]=C,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++]=D,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,o){void 0===s&&(s=null),void 0===o&&(o=!1),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var a=this.QUAD,h=0;a[h++]=e,a[h++]=i,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u,a[h++]=t.v2,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),a[h++]=e+n,a[h++]=i,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u2,a[h++]=t.v2,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),a[h++]=e+n,a[h++]=i+r,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u2,a[h++]=t.v,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),a[h++]=e,a[h++]=i+r,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u,a[h++]=t.v,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),this.batcher.draw(t.texture,a,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,o,a,h,l){void 0===a&&(a=null),void 0===h&&(h=null),void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.triangle(t,e,i,n,r,s,o,a,h,l)},n.prototype.quad=function(t,e,i,n,r,s,o,a,h,l,u,c,f){void 0===l&&(l=null),void 0===u&&(u=null),void 0===c&&(c=null),void 0===f&&(f=null),this.enableRenderer(this.shapes),this.shapes.quad(t,e,i,n,r,s,o,a,h,l,u,c,f)},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,o){void 0===o&&(o=null),this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,i,n,r,s,o)},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,o,a,h,l){void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.curve(t,e,i,n,r,s,o,a,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,o=e.height,a=this.camera.viewportWidth,h=this.camera.viewportHeight,l=h/a10920)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,o,a,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(o,a,u)):(this.vertex(e,n,h),this.vertex(r,s,l),this.vertex(r,s,h),this.vertex(o,a,l),this.vertex(o,a,h),this.vertex(e,n,l))},n.prototype.quad=function(t,e,n,r,s,o,a,h,l,u,c,f,d){void 0===u&&(u=null),void 0===c&&(c=null),void 0===f&&(f=null),void 0===d&&(d=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===f&&(f=this.color),null===d&&(d=this.color),t?(this.vertex(e,n,u),this.vertex(r,s,c),this.vertex(o,a,f),this.vertex(o,a,f),this.vertex(h,l,d),this.vertex(e,n,u)):(this.vertex(e,n,u),this.vertex(r,s,c),this.vertex(r,s,c),this.vertex(o,a,f),this.vertex(o,a,f),this.vertex(h,l,d),this.vertex(h,l,d),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,o,a){void 0===a&&(a=null),this.check(t?i.Filled:i.Line,8),null===a&&(a=this.color);var h=this.tmp.set(s-n,e-r);h.normalize(),o*=.5;var l=h.x*o,u=h.y*o;t?(this.vertex(e+l,n+u,a),this.vertex(e-l,n-u,a),this.vertex(r+l,s+u,a),this.vertex(r-l,s-u,a),this.vertex(r+l,s+u,a),this.vertex(e-l,n-u,a)):(this.vertex(e+l,n+u,a),this.vertex(e-l,n-u,a),this.vertex(r+l,s+u,a),this.vertex(r-l,s-u,a),this.vertex(r+l,s+u,a),this.vertex(e+l,n+u,a),this.vertex(r-l,s-u,a),this.vertex(e-l,n-u,a))},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],o=t[e+1],a=e+n,h=e,l=e+n-2;h=a?(f=s,d=o):(f=t[h+2],d=t[h+3]),this.vertex(u,c,r),this.vertex(f,d,r)}},n.prototype.circle=function(e,n,r,s,o,a){if(void 0===o&&(o=null),void 0===a&&(a=0),0===a&&(a=Math.max(1,6*t.MathUtils.cbrt(s)|0)),a<=0)throw new Error("segments must be > 0.");null===o&&(o=this.color);var h=2*t.MathUtils.PI/a,l=Math.cos(h),u=Math.sin(h),c=s,f=0;if(e){this.check(i.Filled,3*a+3),a--;for(p=0;p0;)this.vertex(b,A,u),b+=E,A+=R,E+=T,R+=I,T+=S,I+=C,this.vertex(b,A,u);this.vertex(b,A,u),this.vertex(a,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!=f.parent){var d=s+f.data.length*f.a+f.worldX,p=o+f.data.length*f.c+f.worldY;e.rectLine(!0,s+f.worldX,o+f.worldY,d,p,this.boneWidth*this.scale)}}this.drawSkeletonXY&&e.x(s,o,4*this.scale)}if(this.drawRegionAttachments){e.setColor(this.attachmentLineColor);for(u=0,c=(B=n.slots).length;u0){e.setColor(this.attachmentLineColor);var R=M[(x=2*(x>>1))-2],T=M[x-1];for(y=0,w=x;y-1||e.circle(!0,s+f.worldX,o+f.worldY,3*this.scale,i.GREEN,8)}}if(this.drawClipping){var B=n.slots;e.setColor(this.clipColor);for(u=0,c=B.length;u=0&&s==T.data.index&&(b=!0),b){o>=0&&o==T.data.index&&(b=!1);var I=T.getAttachment(),S=null;if(I instanceof t.RegionAttachment){var C=I;v.vertices=this.vertices,v.numVertices=4,v.numFloats=R<<2,C.computeWorldVertices(T.bone,v.vertices,0,R),m=n.QUAD_TRIANGLES,M=C.uvs,S=C.region.renderObject.texture,x=C.color}else{if(!(I instanceof t.MeshAttachment)){if(I instanceof t.ClippingAttachment){var P=I;a.clipStart(T,P);continue}a.clipEndWithSlot(T);continue}var L=I;v.vertices=this.vertices,v.numVertices=L.worldVerticesLength>>1,v.numFloats=v.numVertices*R,v.numFloats>v.vertices.length&&(v.vertices=this.vertices=t.Utils.newFloatArray(v.numFloats)),L.computeWorldVertices(T,0,L.worldVerticesLength,v.vertices,0,R),m=L.triangles,S=L.region.renderObject.texture,M=L.uvs,x=L.color}if(null!=S){var O=T.color,D=this.tempColor;D.r=y.r*O.r*x.r,D.g=y.g*O.g*x.g,D.b=y.b*O.b*x.b,D.a=y.a*O.a*x.a,h&&(D.r*=D.a,D.g*=D.a,D.b*=D.a);var k=this.tempColor2;null==T.darkColor?k.set(0,0,0,1):(h?(k.r=T.darkColor.r*D.a,k.g=T.darkColor.g*D.a,k.b=T.darkColor.b*D.a):k.setFromColor(T.darkColor),k.a=h?1:0);var Y=T.data.blendMode;if(Y!=u&&(u=Y,i.setBlendMode(e.WebGLBlendModeConverter.getSourceGLBlendMode(u,h),e.WebGLBlendModeConverter.getDestGLBlendMode(u))),a.isClipping()){a.clipTriangles(v.vertices,v.numFloats,m,m.length,M,D,k,l);var V=new Float32Array(a.clippedVertices),N=a.clippedTriangles;if(null!=this.vertexEffect){var F=this.vertexEffect,z=V;if(l){X=0;for(var U=V.length;X-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)},function(t,e,i){var n=i(0),r=i(3),s=i(169),o=i(2),a=i(183),h=i(184),l=i(185),u=new n({Extends:h,initialize:function(t,e,i,n,s,u,c){var f,d,p,v=[],M=t.cacheManager.custom.spine;if(o(e)){var m=e;for(e=r(m,"key"),d=new a(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]),f=0;f>16&255)/255,n=(t>>8&255)/255,r=(255&t)/255,s=t>16777215?(t>>>24)/255:null,o=this.skeleton;if(e){var a=this.findSlot(e);a&&(o=a)}return o.color.r=i,o.color.g=n,o.color.b=r,null!==s&&(o.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.setSkinByName("default"),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(f(this.rotation))+90),this.state.apply(s),s.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=v(f(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;i0?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],o=n[2],a=n[3];return n[0]=r*i+o*e,n[1]=s*i+a*e,n[2]=r*-e+o*i,n[3]=s*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,r=i[0],s=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],f=n[2],d=n[3],p=n[4],v=n[5],M=void 0===e?this:e;return M.a=u*r+c*o,M.b=u*s+c*a,M.c=f*r+d*o,M.d=f*s+d*a,M.e=p*r+v*o+h,M.f=p*s+v*a+l,M},multiplyWithOffset:function(t,e,i){var n=this.matrix,r=t.matrix,s=n[0],o=n[1],a=n[2],h=n[3],l=e*s+i*a+n[4],u=e*o+i*h+n[5],c=r[0],f=r[1],d=r[2],p=r[3],v=r[4],M=r[5];return n[0]=c*s+f*a,n[1]=c*o+f*h,n[2]=d*s+p*a,n[3]=d*o+p*h,n[4]=v*s+M*a+l,n[5]=v*o+M*h+u,this},transform:function(t,e,i,n,r,s){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],f=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=r*a+s*l+c,o[5]=r*h+s*u+f,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,r=n[0],s=n[1],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*r+e*o+h,i.y=t*s+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=e*r-i*n;return t[0]=r/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-r*s)/a,t[5]=-(e*o-i*s)/a,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 o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=r,o[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],r=e[2],s=e[3],o=i*s-n*r;if(t.translateX=e[4],t.translateY=e[5],i||n){var a=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}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=o/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,o=Math.sin(i),a=Math.cos(i);return s[4]=t,s[5]=e,s[0]=a*n,s[1]=o*n,s[2]=-o*r,s[3]=a*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=r*c*e+-o*c*t+(-u*r+l*o)*c,i},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},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.decomposedMatrix=null}});t.exports=o},function(t,e){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){var n=i(0),r=i(195),s=i(196),o=i(202),a=i(203),h=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,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,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},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.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(h.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 i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.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),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});h.RENDER_MASK=15,t.exports=h},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,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,i){var n=i(0),r=i(197),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("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var Events = __webpack_require__(/*! ./events */ "../../../src/data/events/index.js"); + +/** + * @callback DataEachCallback + * + * @param {*} parent - The parent object of the DataManager. + * @param {string} key - The key of the value. + * @param {*} value - The value. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + */ + +/** + * @classdesc + * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + * + * @class DataManager + * @memberof Phaser.Data + * @constructor + * @since 3.0.0 + * + * @param {object} parent - The object that this DataManager belongs to. + * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter. + */ +var DataManager = new Class({ + + initialize: + + function DataManager (parent, eventEmitter) + { + /** + * The object that this DataManager belongs to. + * + * @name Phaser.Data.DataManager#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The DataManager's event emitter. + * + * @name Phaser.Data.DataManager#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = eventEmitter; + + if (!eventEmitter) + { + this.events = (parent.events) ? parent.events : parent; + } + + /** + * The data list. + * + * @name Phaser.Data.DataManager#list + * @type {Object.} + * @default {} + * @since 3.0.0 + */ + this.list = {}; + + /** + * The public values list. You can use this to access anything you have stored + * in this Data Manager. For example, if you set a value called `gold` you can + * access it via: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also modify it directly: + * + * ```javascript + * this.data.values.gold += 1000; + * ``` + * + * Doing so will emit a `setdata` event from the parent of this Data Manager. + * + * Do not modify this object directly. Adding properties directly to this object will not + * emit any events. Always use `DataManager.set` to create new items the first time around. + * + * @name Phaser.Data.DataManager#values + * @type {Object.} + * @default {} + * @since 3.10.0 + */ + this.values = {}; + + /** + * Whether setting data is frozen for this DataManager. + * + * @name Phaser.Data.DataManager#_frozen + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._frozen = false; + + if (!parent.hasOwnProperty('sys') && this.events) + { + this.events.once('destroy', this.destroy, this); + } + }, + + /** + * Retrieves the value for the given key, 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 + * this.data.get('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * this.data.get([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.Data.DataManager#get + * @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. + */ + get: function (key) + { + var list = this.list; + + if (Array.isArray(key)) + { + var output = []; + + for (var i = 0; i < key.length; i++) + { + output.push(list[key[i]]); + } + + return output; + } + else + { + return list[key]; + } + }, + + /** + * Retrieves all data values in a new object. + * + * @method Phaser.Data.DataManager#getAll + * @since 3.0.0 + * + * @return {Object.} All data values. + */ + getAll: function () + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Queries the DataManager for the values of keys matching the given regular expression. + * + * @method Phaser.Data.DataManager#query + * @since 3.0.0 + * + * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). + * + * @return {Object.} The values of the keys matching the search string. + */ + query: function (search) + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key) && key.match(search)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * data.set('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `get`: + * + * ```javascript + * data.get('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted. + * + * 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.Data.DataManager#set + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @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. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + set: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (typeof key === 'string') + { + return this.setValue(key, data); + } + else + { + for (var entry in key) + { + this.setValue(entry, key[entry]); + } + } + + return this; + }, + + /** + * Internal value setter, called automatically by the `set` method. + * + * @method Phaser.Data.DataManager#setValue + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @private + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * @param {*} data - The value to set. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setValue: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (this.has(key)) + { + // Hit the key getter, which will in turn emit the events. + this.values[key] = data; + } + else + { + var _this = this; + var list = this.list; + var events = this.events; + var parent = this.parent; + + Object.defineProperty(this.values, key, { + + enumerable: true, + + configurable: true, + + get: function () + { + return list[key]; + }, + + set: function (value) + { + if (!_this._frozen) + { + var previousValue = list[key]; + list[key] = value; + + events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); + events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); + } + } + + }); + + list[key] = data; + + events.emit(Events.SET_DATA, parent, key, data); + } + + return this; + }, + + /** + * Passes all data entries to the given callback. + * + * @method Phaser.Data.DataManager#each + * @since 3.0.0 + * + * @param {DataEachCallback} callback - The function to call. + * @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 {Phaser.Data.DataManager} This DataManager object. + */ + each: function (callback, context) + { + var args = [ this.parent, null, undefined ]; + + for (var i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (var key in this.list) + { + args[1] = key; + args[2] = this.list[key]; + + callback.apply(context, args); + } + + return this; + }, + + /** + * Merge the given object of key value pairs into this DataManager. + * + * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) + * will emit a `changedata` event. + * + * @method Phaser.Data.DataManager#merge + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {Object.} data - The data to merge. + * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + merge: function (data, overwrite) + { + if (overwrite === undefined) { overwrite = true; } + + // Merge data from another component into this one + for (var key in data) + { + if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) + { + this.setValue(key, data[key]); + } + } + + return this; + }, + + /** + * Remove the value for the given key. + * + * If the key is found in this Data Manager it is removed from the internal lists and a + * `removedata` event is emitted. + * + * You can also pass in an array of keys, in which case all keys in the array will be removed: + * + * ```javascript + * this.data.remove([ 'gold', 'armor', 'health' ]); + * ``` + * + * @method Phaser.Data.DataManager#remove + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {(string|string[])} key - The key to remove, or an array of keys to remove. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + remove: function (key) + { + if (this._frozen) + { + return this; + } + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + this.removeValue(key[i]); + } + } + else + { + return this.removeValue(key); + } + + return this; + }, + + /** + * Internal value remover, called automatically by the `remove` method. + * + * @method Phaser.Data.DataManager#removeValue + * @private + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + removeValue: function (key) + { + if (this.has(key)) + { + var data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return this; + }, + + /** + * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. + * + * @method Phaser.Data.DataManager#pop + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {string} key - The key of the value to retrieve and delete. + * + * @return {*} The value of the given key. + */ + pop: function (key) + { + var data = undefined; + + if (!this._frozen && this.has(key)) + { + data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return data; + }, + + /** + * Determines whether the given key is set in this Data Manager. + * + * Please note that the 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.Data.DataManager#has + * @since 3.0.0 + * + * @param {string} key - The key to check. + * + * @return {boolean} Returns `true` if the key exists, otherwise `false`. + */ + has: function (key) + { + return this.list.hasOwnProperty(key); + }, + + /** + * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts + * to create new values or update existing ones. + * + * @method Phaser.Data.DataManager#setFreeze + * @since 3.0.0 + * + * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setFreeze: function (value) + { + this._frozen = value; + + return this; + }, + + /** + * Delete all data in this Data Manager and unfreeze it. + * + * @method Phaser.Data.DataManager#reset + * @since 3.0.0 + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + reset: function () + { + for (var key in this.list) + { + delete this.list[key]; + delete this.values[key]; + } + + this._frozen = false; + + return this; + }, + + /** + * Destroy this data manager. + * + * @method Phaser.Data.DataManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.reset(); + + this.events.off(Events.CHANGE_DATA); + this.events.off(Events.SET_DATA); + this.events.off(Events.REMOVE_DATA); + + this.parent = null; + }, + + /** + * Gets or sets the frozen state of this Data Manager. + * A frozen Data Manager will block all attempts to create new values or update existing ones. + * + * @name Phaser.Data.DataManager#freeze + * @type {boolean} + * @since 3.0.0 + */ + freeze: { + + get: function () + { + return this._frozen; + }, + + set: function (value) + { + this._frozen = (value) ? true : false; + } + + }, + + /** + * Return the total number of entries in this Data Manager. + * + * @name Phaser.Data.DataManager#count + * @type {integer} + * @since 3.0.0 + */ + count: { + + get: function () + { + var i = 0; + + for (var key in this.list) + { + if (this.list[key] !== undefined) + { + i++; + } + } + + return i; + } + + } + +}); + +module.exports = DataManager; + + +/***/ }), + +/***/ "../../../src/data/events/CHANGE_DATA_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/CHANGE_DATA_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`. + * + * This event is dispatched for all items that change in the Data Manager. + * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. + * + * @event Phaser.Data.Events#CHANGE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The new value of the item in the Data Manager. + * @param {any} previousValue - The previous value of the item in the Data Manager. + */ +module.exports = 'changedata'; + + +/***/ }), + +/***/ "../../../src/data/events/CHANGE_DATA_KEY_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Key Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`, + * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` + * then you can listen for `sprite.data.on('changedata-gold')`. + * + * @event Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.16.1 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'changedata-'; + + +/***/ }), + +/***/ "../../../src/data/events/REMOVE_DATA_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/REMOVE_DATA_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Remove Data Event. + * + * This event is dispatched by a Data Manager when an item is removed from it. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`. + * + * @event Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'removedata'; + + +/***/ }), + +/***/ "../../../src/data/events/SET_DATA_EVENT.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/SET_DATA_EVENT.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Set Data Event. + * + * This event is dispatched by a Data Manager when a new item is added to the data store. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`. + * + * @event Phaser.Data.Events#SET_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'setdata'; + + +/***/ }), + +/***/ "../../../src/data/events/index.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/data/events/index.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Data.Events + */ + +module.exports = { + + CHANGE_DATA: __webpack_require__(/*! ./CHANGE_DATA_EVENT */ "../../../src/data/events/CHANGE_DATA_EVENT.js"), + CHANGE_DATA_KEY: __webpack_require__(/*! ./CHANGE_DATA_KEY_EVENT */ "../../../src/data/events/CHANGE_DATA_KEY_EVENT.js"), + REMOVE_DATA: __webpack_require__(/*! ./REMOVE_DATA_EVENT */ "../../../src/data/events/REMOVE_DATA_EVENT.js"), + SET_DATA: __webpack_require__(/*! ./SET_DATA_EVENT */ "../../../src/data/events/SET_DATA_EVENT.js") + +}; + + +/***/ }), + +/***/ "../../../src/gameobjects/BuildGameObject.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/BuildGameObject.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(/*! ../renderer/BlendModes */ "../../../src/renderer/BlendModes.js"); +var GetAdvancedValue = __webpack_require__(/*! ../utils/object/GetAdvancedValue */ "../../../src/utils/object/GetAdvancedValue.js"); +var ScaleModes = __webpack_require__(/*! ../renderer/ScaleModes */ "../../../src/renderer/ScaleModes.js"); + +/** + * 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); + } + + // ScaleMode + + gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT); + + // 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/GameObject.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/GameObject.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var ComponentsToJSON = __webpack_require__(/*! ./components/ToJSON */ "../../../src/gameobjects/components/ToJSON.js"); +var DataManager = __webpack_require__(/*! ../data/DataManager */ "../../../src/data/DataManager.js"); +var EventEmitter = __webpack_require__(/*! eventemitter3 */ "../../../node_modules/eventemitter3/index.js"); +var Events = __webpack_require__(/*! ./events */ "../../../src/gameobjects/events/index.js"); + +/** + * @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); + + /** + * The Scene to which this Game Object belongs. + * Game Objects can only belong to one Scene. + * + * @name Phaser.GameObjects.GameObject#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * 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 move 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 {(integer|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 {integer} + * @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 {integer} + * @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 physics then this property will contain a reference to a Physics Body. + * + * @name Phaser.GameObjects.GameObject#body + * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)} + * @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; + + // 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 {(integer|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 + * + * @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; + }, + + /** + * 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. + * + * @method Phaser.GameObjects.GameObject#setInteractive + * @since 3.0.0 + * + * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. 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 (shape, callback, dropZone) + { + this.scene.sys.input.enable(this, shape, callback, 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 () + { + if (this.input) + { + this.input.enabled = false; + } + + 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; + }, + + /** + * 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) + { + return !(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 {integer[]} 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), parent.name]); + indexes.unshift(parent.getIndex(child)); + + child = parent; + + if (!parent.parentContainer) + { + break; + } + else + { + parent = parent.parentContainer; + } + } + + // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']); + indexes.unshift(this.scene.sys.displayList.getIndex(child)); + + return indexes; + }, + + /** + * 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] - Is this Game Object being destroyed as the result of a Scene shutdown? + */ + destroy: function (fromScene) + { + if (fromScene === undefined) { fromScene = false; } + + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + if (this.preDestroy) + { + this.preDestroy.call(this); + } + + this.emit(Events.DESTROY, this); + + var sys = this.scene.sys; + + if (!fromScene) + { + sys.displayList.remove(this); + sys.updateList.remove(this); + } + + if (this.input) + { + 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; + } + + // Tell the Scene to re-sort the children + if (!fromScene) + { + sys.queueDepthSort(); + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + + this.parentContainer = undefined; + + this.removeAllListeners(); + } + +}); + +/** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + * + * @constant {integer} RENDER_MASK + * @memberof Phaser.GameObjects.GameObject + * @default + */ +GameObject.RENDER_MASK = 15; + +module.exports = GameObject; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/ComputedSize.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/ComputedSize.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Depth.js": +/*!**************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Depth.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * 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 depth starts from zero (the default value) and increases from that point. 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) + { + this.scene.sys.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 depth starts from zero (the default value) and increases from that point. 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 {integer} value - The depth of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Flip.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Flip.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/ScrollFactor.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/ScrollFactor.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/ToJSON.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/ToJSON.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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, + scaleMode: gameObject.scaleMode, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Transform.js": +/*!******************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Transform.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(/*! ../../math/const */ "../../../src/math/const.js"); +var TransformMatrix = __webpack_require__(/*! ./TransformMatrix */ "../../../src/gameobjects/components/TransformMatrix.js"); +var WrapAngle = __webpack_require__(/*! ../../math/angle/Wrap */ "../../../src/math/angle/Wrap.js"); +var WrapAngleDegrees = __webpack_require__(/*! ../../math/angle/WrapDegrees */ "../../../src/math/angle/WrapDegrees.js"); + +// 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 = { + + /** + * 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: Do not use this value to set the z-index, instead see the `depth` property. + * + * @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 {integer} + * @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, 90 is down, 180/-180 is left + * and -90 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; + }, + + /** + * 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. + * + * @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; + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/TransformMatrix.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/TransformMatrix.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var MATH_CONST = __webpack_require__(/*! ../../math/const */ "../../../src/math/const.js"); +var Vector2 = __webpack_require__(/*! ../../math/Vector2 */ "../../../src/math/Vector2.js"); + +/** + * @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 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 {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) ? this : out; + + destinationMatrix.a = (sourceA * localA) + (sourceB * localC); + destinationMatrix.b = (sourceA * localB) + (sourceB * localD); + destinationMatrix.c = (sourceC * localA) + (sourceD * localC); + destinationMatrix.d = (sourceC * localB) + (sourceD * localD); + destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE; + destinationMatrix.f = (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 using 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.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates. + * + * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} 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; + }, + + /** + * 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 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.decomposedMatrix = null; + } + +}); + +module.exports = TransformMatrix; + + +/***/ }), + +/***/ "../../../src/gameobjects/components/Visible.js": +/*!****************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/components/Visible.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/gameobjects/events/DESTROY_EVENT.js": +/*!******************************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/events/DESTROY_EVENT.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Destroy Event. + * + * 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 + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. + */ +module.exports = 'destroy'; + + +/***/ }), + +/***/ "../../../src/gameobjects/events/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/gameobjects/events/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ "../../../src/gameobjects/events/DESTROY_EVENT.js") }; + + +/***/ }), + +/***/ "../../../src/loader/File.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/loader/File.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ./const */ "../../../src/loader/const.js"); +var Events = __webpack_require__(/*! ./events */ "../../../src/loader/events/index.js"); +var GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var GetURL = __webpack_require__(/*! ./GetURL */ "../../../src/loader/GetURL.js"); +var MergeXHRSettings = __webpack_require__(/*! ./MergeXHRSettings */ "../../../src/loader/MergeXHRSettings.js"); +var XHRLoader = __webpack_require__(/*! ./XHRLoader */ "../../../src/loader/XHRLoader.js"); +var XHRSettings = __webpack_require__(/*! ./XHRSettings */ "../../../src/loader/XHRSettings.js"); + +/** + * @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); + + /** + * 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.type || !this.key) + { + throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + } + + /** + * The URL of the file, not including baseURL. + * Automatically has Loader.path prepended to it. + * + * @name Phaser.Loader.File#url + * @type {string} + * @since 3.0.0 + */ + this.url = GetFastValue(fileConfig, 'url'); + + if (this.url === undefined) + { + this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof(this.url) !== 'function') + { + this.url = loader.path + this.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 {integer} + * @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.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 localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && 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.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 () + { + 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.cache.add(this.key, this.data); + } + + this.pendingDestroy(); + }, + + /** + * 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 (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); + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/loader/FileTypesManager.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/FileTypesManager.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/loader/GetURL.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/loader/GetURL.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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:|http:\/\/|https:\/\/|\/\/)/)) + { + return file.url; + } + else + { + return baseURL + file.url; + } +}; + +module.exports = GetURL; + + +/***/ }), + +/***/ "../../../src/loader/MergeXHRSettings.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/MergeXHRSettings.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(/*! ../utils/object/Extend */ "../../../src/utils/object/Extend.js"); +var XHRSettings = __webpack_require__(/*! ./XHRSettings */ "../../../src/loader/XHRSettings.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/loader/MultiFile.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/MultiFile.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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) + { + /** + * 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; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = files; + + /** + * 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 {integer} + * @since 3.7.0 + */ + + this.pending = files.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {integer} + * @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 = {}; + + // Link the files + for (var i = 0; i < files.length; i++) + { + files[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++; + } + } + +}); + +module.exports = MultiFile; + + +/***/ }), + +/***/ "../../../src/loader/XHRLoader.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/XHRLoader.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(/*! ./MergeXHRSettings */ "../../../src/loader/MergeXHRSettings.js"); + +/** + * 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.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); + } + + // 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; + + +/***/ }), + +/***/ "../../../src/loader/XHRSettings.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/XHRSettings.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [timeout=0] - Optional XHR timeout value. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + */ +var XHRSettings = function (responseType, async, user, password, timeout) +{ + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } + + // 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 + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined + + }; +}; + +module.exports = XHRSettings; + + +/***/ }), + +/***/ "../../../src/loader/const.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/loader/const.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {integer} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {integer} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {integer} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started + * + * @name Phaser.Loader.FILE_PENDING + * @type {integer} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing + * + * @name Phaser.Loader.FILE_LOADED + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load + * + * @name Phaser.Loader.FILE_FAILED + * @type {integer} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {integer} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {integer} + * @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 {integer} + * @since 3.0.0 + */ + FILE_POPULATED: 19 + +}; + +module.exports = FILE_CONST; + + +/***/ }), + +/***/ "../../../src/loader/events/ADD_EVENT.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/ADD_EVENT.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), + +/***/ "../../../src/loader/events/COMPLETE_EVENT.js": +/*!**************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/COMPLETE_EVENT.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {integer} totalComplete - The total number of files that successfully loaded. + * @param {integer} totalFailed - The total number of files that failed to load. + */ +module.exports = 'complete'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_COMPLETE_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_COMPLETE_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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)`. + * + * 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 + * @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. + */ +module.exports = 'filecomplete'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_KEY_COMPLETE_EVENT.js": +/*!***********************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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-atlas-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 + * }); + * ``` + * + * 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 + * @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. + */ +module.exports = 'filecomplete-'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_LOAD_ERROR_EVENT.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + */ +module.exports = 'loaderror'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_LOAD_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_LOAD_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + */ +module.exports = 'load'; + + +/***/ }), + +/***/ "../../../src/loader/events/FILE_PROGRESS_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/FILE_PROGRESS_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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'; + + +/***/ }), + +/***/ "../../../src/loader/events/POST_PROCESS_EVENT.js": +/*!******************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/POST_PROCESS_EVENT.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'postprocess'; + + +/***/ }), + +/***/ "../../../src/loader/events/PROGRESS_EVENT.js": +/*!**************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/PROGRESS_EVENT.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {number} progress - The current progress of the load. A value between 0 and 1. + */ +module.exports = 'progress'; + + +/***/ }), + +/***/ "../../../src/loader/events/START_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/START_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'start'; + + +/***/ }), + +/***/ "../../../src/loader/events/index.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/events/index.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Loader.Events + */ + +module.exports = { + + ADD: __webpack_require__(/*! ./ADD_EVENT */ "../../../src/loader/events/ADD_EVENT.js"), + COMPLETE: __webpack_require__(/*! ./COMPLETE_EVENT */ "../../../src/loader/events/COMPLETE_EVENT.js"), + FILE_COMPLETE: __webpack_require__(/*! ./FILE_COMPLETE_EVENT */ "../../../src/loader/events/FILE_COMPLETE_EVENT.js"), + FILE_KEY_COMPLETE: __webpack_require__(/*! ./FILE_KEY_COMPLETE_EVENT */ "../../../src/loader/events/FILE_KEY_COMPLETE_EVENT.js"), + FILE_LOAD_ERROR: __webpack_require__(/*! ./FILE_LOAD_ERROR_EVENT */ "../../../src/loader/events/FILE_LOAD_ERROR_EVENT.js"), + FILE_LOAD: __webpack_require__(/*! ./FILE_LOAD_EVENT */ "../../../src/loader/events/FILE_LOAD_EVENT.js"), + FILE_PROGRESS: __webpack_require__(/*! ./FILE_PROGRESS_EVENT */ "../../../src/loader/events/FILE_PROGRESS_EVENT.js"), + POST_PROCESS: __webpack_require__(/*! ./POST_PROCESS_EVENT */ "../../../src/loader/events/POST_PROCESS_EVENT.js"), + PROGRESS: __webpack_require__(/*! ./PROGRESS_EVENT */ "../../../src/loader/events/PROGRESS_EVENT.js"), + START: __webpack_require__(/*! ./START_EVENT */ "../../../src/loader/events/START_EVENT.js") + +}; + + +/***/ }), + +/***/ "../../../src/loader/filetypes/ImageFile.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/filetypes/ImageFile.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); +var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); +var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); +var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +/** + * @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); + } + }, + + /** + * 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'); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture; + var linkFile = this.linkFile; + + if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + { + if (this.type === 'image') + { + texture = this.cache.addImage(this.key, this.data, linkFile.data); + } + else + { + texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); + } + + this.pendingDestroy(texture); + + linkFile.pendingDestroy(texture); + } + else if (!linkFile) + { + texture = this.cache.addImage(this.key, this.data); + + this.pendingDestroy(texture); + } + } + +}); + +/** + * 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. + * + * 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#addFileEvent + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), + +/***/ "../../../src/loader/filetypes/JSONFile.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/filetypes/JSONFile.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); +var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); +var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); +var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ "../../../src/utils/object/GetValue.js"); +var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +/** + * @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 {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". + * @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); + + if (IsPlainObject(url)) + { + // Object provided instead of a URL, so no need to actually load it (populate data with value) + 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; + + var json = JSON.parse(this.xhrLoader.responseText); + + 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#addFileEvent + * @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 {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". + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), + +/***/ "../../../src/loader/filetypes/TextFile.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/loader/filetypes/TextFile.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); +var CONST = __webpack_require__(/*! ../const */ "../../../src/loader/const.js"); +var File = __webpack_require__(/*! ../File */ "../../../src/loader/File.js"); +var FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ "../../../src/loader/FileTypesManager.js"); +var GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +/** + * @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 extension = 'txt'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'text', + cache: loader.cacheManager.text, + 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#addFileEvent + * @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 {Phaser.Loader.LoaderPlugin} 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; + + +/***/ }), + +/***/ "../../../src/math/Average.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Average.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Bernstein.js": +/*!************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Bernstein.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Factorial = __webpack_require__(/*! ./Factorial */ "../../../src/math/Factorial.js"); + +/** + * [description] + * + * @function Phaser.Math.Bernstein + * @since 3.0.0 + * + * @param {number} n - [description] + * @param {number} i - [description] + * + * @return {number} [description] + */ +var Bernstein = function (n, i) +{ + return Factorial(n) / Factorial(i) / Factorial(n - i); +}; + +module.exports = Bernstein; + + +/***/ }), + +/***/ "../../../src/math/Between.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Between.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} min - The minimum value. + * @param {integer} max - The maximum value. + * + * @return {integer} The random integer. + */ +var Between = function (min, max) +{ + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +module.exports = Between; + + +/***/ }), + +/***/ "../../../src/math/CatmullRom.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/CatmullRom.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a Catmull-Rom value. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - [description] + * @param {number} p0 - [description] + * @param {number} p1 - [description] + * @param {number} p2 - [description] + * @param {number} p3 - [description] + * + * @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; + + +/***/ }), + +/***/ "../../../src/math/CeilTo.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/CeilTo.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [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; + + +/***/ }), + +/***/ "../../../src/math/Clamp.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Clamp.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/DegToRad.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/DegToRad.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); + +/** + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {integer} 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; + + +/***/ }), + +/***/ "../../../src/math/Difference.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Difference.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Factorial.js": +/*!************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Factorial.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/FloatBetween.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/FloatBetween.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/FloorTo.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/FloorTo.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. + * @param {integer} [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; + + +/***/ }), + +/***/ "../../../src/math/FromPercent.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/FromPercent.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(/*! ./Clamp */ "../../../src/math/Clamp.js"); + +/** + * 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; +}; + +module.exports = FromPercent; + + +/***/ }), + +/***/ "../../../src/math/GetSpeed.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/GetSpeed.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the speed required to cover a distance in the time given. + * + * @function Phaser.Math.GetSpeed + * @since 3.0.0 + * + * @param {number} distance - The distance to travel in pixels. + * @param {integer} time - The time, in ms, to cover the distance in. + * + * @return {number} The amount you will need to increment the position by each step in order to cover the distance in the time given. + */ +var GetSpeed = function (distance, time) +{ + return (distance / time) / 1000; +}; + +module.exports = GetSpeed; + + +/***/ }), + +/***/ "../../../src/math/IsEven.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/IsEven.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/IsEvenStrict.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/IsEvenStrict.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Linear.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Linear.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Matrix3.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Matrix3.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - [description] + * + * @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; + + +/***/ }), + +/***/ "../../../src/math/Matrix4.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Matrix4.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * @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); + }, + + // TODO - Should work with basic values + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + 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]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + 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]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * 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 () + { + var out = this.val; + + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 0; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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 null; + } + + det = 1 / det; + + a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} 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]; + + a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); + a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); + a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); + a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); + a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); + a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); + a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); + a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - [description] + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = []; + var m1 = this.val; + var m2 = src.val; + + a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; + a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; + a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; + a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; + + a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; + a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; + a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; + a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; + + a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; + a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; + a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; + a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; + + a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; + a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; + a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; + a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; + + return this.fromArray(a); + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + translate: function (v) + { + var x = v.x; + var y = v.y; + var z = v.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; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + scale: function (v) + { + var x = v.x; + var y = v.y; + var z = v.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; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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; + + this.fromArray([ + 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 + ]); + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 null; + } + + 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]; + + // 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 + a[0] = a00 * b00 + a10 * b01 + a20 * b02; + a[1] = a01 * b00 + a11 * b01 + a21 * b02; + a[2] = a02 * b00 + a12 * b01 + a22 * b02; + a[3] = a03 * b00 + a13 * b01 + a23 * b02; + a[4] = a00 * b10 + a10 * b11 + a20 * b12; + a[5] = a01 * b10 + a11 * b11 + a21 * b12; + a[6] = a02 * b10 + a12 * b11 + a22 * b12; + a[7] = a03 * b10 + a13 * b11 + a23 * b12; + a[8] = a00 * b20 + a10 * b21 + a20 * b22; + a[9] = a01 * b20 + a11 * b21 + a21 * b22; + a[10] = a02 * b20 + a12 * b21 + a22 * b22; + a[11] = a03 * b20 + a13 * b21 + a23 * b22; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var out = this.val; + + 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; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = v.x; + out[13] = v.y; + out[14] = v.z; + out[15] = 1; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + fromQuat: function (q) + { + var out = this.val; + + 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; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var out = this.val; + + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + out[0] = (near * 2) * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (near * 2) * tb; + out[6] = 0; + out[7] = 0; + + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (far * near * 2) * nf; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var out = this.val; + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (2 * far * near) * nf; + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + var out = this.val; + + out[0] = (2 * near) / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (2 * near) / height; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = -far / (near - far); + out[11] = 1; + + out[12] = 0; + out[13] = 0; + out[14] = (near * far) / (near - far); + out[15] = 0; + + return this; + }, + + /** + * 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 {Phaser.Math.Matrix4} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var out = this.val; + 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; + + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + + 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 {Phaser.Math.Matrix4} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var out = this.val; + + 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; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + + return this; + }, + + /** + * 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 - [description] + * @param {number} pitch - [description] + * @param {number} roll - [description] + * + * @return {Phaser.Math.Matrix4} 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 {Phaser.Math.Matrix4} 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 !== undefined) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix !== undefined) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + } + +}); + +var _tempMat1 = new Matrix4(); +var _tempMat2 = new Matrix4(); + +module.exports = Matrix4; + + +/***/ }), + +/***/ "../../../src/math/MaxAdd.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/MaxAdd.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/MinSub.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/MinSub.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Percent.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Percent.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Quaternion.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/Quaternion.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var Vector3 = __webpack_require__(/*! ./Vector3 */ "../../../src/math/Vector3.js"); +var Matrix3 = __webpack_require__(/*! ./Matrix3 */ "../../../src/math/Matrix3.js"); + +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] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + * @param {number} [w] - 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 + * @since 3.0.0 + */ + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.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; + } + }, + + /** + * 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) + { + this.x = src.x; + this.y = src.y; + this.z = src.z; + this.w = src.w; + + return this; + }, + + /** + * Set the components of this Quaternion. + * + * @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. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + 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 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; + + 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; + + 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; + + 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; + } + + 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; + + 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; + }, + + /** + * [description] + * + * @method Phaser.Math.Quaternion#rotationTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - [description] + * @param {Phaser.Math.Vector3} b - [description] + * + * @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) + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + } + 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 () + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + }, + + /** + * 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); + + this.x = s * axis.x; + this.y = s * axis.y; + this.z = s * axis.z; + this.w = Math.cos(rad); + + return this; + }, + + /** + * 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; + + this.x = ax * bw + aw * bx + ay * bz - az * by; + this.y = ay * bw + aw * by + az * bx - ax * bz; + this.z = az * bw + aw * bz + ax * by - ay * bx; + this.w = aw * bw - ax * bx - ay * by - az * bz; + + return this; + }, + + /** + * 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 + this.x = scale0 * ax + scale1 * bx; + this.y = scale0 * ay + scale1 * by; + this.z = scale0 * az + scale1 * bz; + this.w = scale0 * aw + scale1 * bw; + + return this; + }, + + /** + * 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; + + // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + this.x = -a0 * invDot; + this.y = -a1 * invDot; + this.z = -a2 * invDot; + this.w = a3 * invDot; + + return this; + }, + + /** + * 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; + + 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); + + this.x = ax * bw + aw * bx; + this.y = ay * bw + az * bx; + this.z = az * bw - ay * bx; + this.w = aw * bw - ax * bx; + + return this; + }, + + /** + * 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); + + this.x = ax * bw - az * by; + this.y = ay * bw + aw * by; + this.z = az * bw + ax * by; + this.w = aw * bw - ay * by; + + return this; + }, + + /** + * 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); + + this.x = ax * bw + ay * bz; + this.y = ay * bw - ax * bz; + this.z = az * bw + aw * bz; + this.w = aw * bw - az * bz; + + return this; + }, + + /** + * 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; + }, + + /** + * 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; + } + + return this; + } + +}); + +module.exports = Quaternion; + + +/***/ }), + +/***/ "../../../src/math/RadToDeg.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/RadToDeg.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); + +/** + * 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 {integer} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), + +/***/ "../../../src/math/RandomXY.js": +/*!***********************************************!*\ + !*** D:/wamp/www/phaser/src/math/RandomXY.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RandomXYZ.js": +/*!************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RandomXYZ.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RandomXYZW.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RandomXYZW.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; } + + // TODO: Not spherical; should fix this for more uniform distribution + 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; + + +/***/ }), + +/***/ "../../../src/math/Rotate.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Rotate.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RotateAround.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RotateAround.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` by the given `angle`. + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @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.Geom.Point} The given point, rotated by the given angle around the given coordinates. + */ +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; + + +/***/ }), + +/***/ "../../../src/math/RotateAroundDistance.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RotateAroundDistance.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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`. + * + * @function Phaser.Math.RotateAroundDistance + * @since 3.0.0 + * + * @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.Geom.Point} 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; + + +/***/ }), + +/***/ "../../../src/math/RotateVec3.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RotateVec3.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector3 = __webpack_require__(/*! ../math/Vector3 */ "../../../src/math/Vector3.js"); +var Matrix4 = __webpack_require__(/*! ../math/Matrix4 */ "../../../src/math/Matrix4.js"); +var Quaternion = __webpack_require__(/*! ../math/Quaternion */ "../../../src/math/Quaternion.js"); + +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; + + +/***/ }), + +/***/ "../../../src/math/RoundAwayFromZero.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/RoundAwayFromZero.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/RoundTo.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/RoundTo.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {integer} [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; + + +/***/ }), + +/***/ "../../../src/math/SinCosTableGenerator.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/SinCosTableGenerator.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/SmoothStep.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/SmoothStep.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/SmootherStep.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/SmootherStep.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/ToXY.js": +/*!*******************************************!*\ + !*** D:/wamp/www/phaser/src/math/ToXY.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(/*! ./Vector2 */ "../../../src/math/Vector2.js"); + +/** + * Returns a Vec2 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 Vec2 is returned. + * + * @function Phaser.Math.ToXY + * @since 3.19.0 + * + * @param {integer} index - The position within the grid to get the x/y value for. + * @param {integer} width - The width of the grid. + * @param {integer} 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; + } + + out.set(x, y); + } + + return out; +}; + +module.exports = ToXY; + + +/***/ }), + +/***/ "../../../src/math/TransformXY.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/TransformXY.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(/*! ./Vector2 */ "../../../src/math/Vector2.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/Vector2.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Vector2.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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] - The x component, or an object with `x` and `y` properties. + * @param {number} [y] - 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.Math.Vector2} 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.Math.Vector2} 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)); + }, + + /** + * 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; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector2#add + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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); + }, + + /** + * 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; + }, + + /** + * Right-hand normalize (make unit length) this Vector. + * + * @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; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} 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.Math.Vector2} 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.Math.Vector2} 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; + } + +}); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/Vector3.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Vector3.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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; + }, + + /** + * 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); + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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; + }, + + /** + * 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 Matrix. + * + * @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; + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/math/Vector4.js": +/*!**********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Vector4.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 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__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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) + { + // TODO: is this really the same as Vector3? + // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/ + // 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; + }, + + /** + * 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; + } + +}); + +// TODO: Check if these are required internally, if not, remove. +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; + + +/***/ }), + +/***/ "../../../src/math/Within.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/math/Within.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/Wrap.js": +/*!*******************************************!*\ + !*** D:/wamp/www/phaser/src/math/Wrap.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/Between.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Between.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/BetweenPoints.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/BetweenPoints.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} 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; + + +/***/ }), + +/***/ "../../../src/math/angle/BetweenPointsY.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/BetweenPointsY.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} 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; + + +/***/ }), + +/***/ "../../../src/math/angle/BetweenY.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/BetweenY.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/CounterClockwise.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/CounterClockwise.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ../const */ "../../../src/math/const.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/Normalize.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Normalize.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/angle/Reverse.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Reverse.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Normalize = __webpack_require__(/*! ./Normalize */ "../../../src/math/angle/Normalize.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/RotateTo.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/RotateTo.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(/*! ../const */ "../../../src/math/const.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/ShortestBetween.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/ShortestBetween.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. + * + * TODO: Wrap the angles in this function? + * + * @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; + + +/***/ }), + +/***/ "../../../src/math/angle/Wrap.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/Wrap.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathWrap = __webpack_require__(/*! ../Wrap */ "../../../src/math/Wrap.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/WrapDegrees.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/WrapDegrees.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(/*! ../Wrap */ "../../../src/math/Wrap.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/angle/index.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/angle/index.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Angle + */ + +module.exports = { + + Between: __webpack_require__(/*! ./Between */ "../../../src/math/angle/Between.js"), + BetweenPoints: __webpack_require__(/*! ./BetweenPoints */ "../../../src/math/angle/BetweenPoints.js"), + BetweenPointsY: __webpack_require__(/*! ./BetweenPointsY */ "../../../src/math/angle/BetweenPointsY.js"), + BetweenY: __webpack_require__(/*! ./BetweenY */ "../../../src/math/angle/BetweenY.js"), + CounterClockwise: __webpack_require__(/*! ./CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"), + Normalize: __webpack_require__(/*! ./Normalize */ "../../../src/math/angle/Normalize.js"), + Reverse: __webpack_require__(/*! ./Reverse */ "../../../src/math/angle/Reverse.js"), + RotateTo: __webpack_require__(/*! ./RotateTo */ "../../../src/math/angle/RotateTo.js"), + ShortestBetween: __webpack_require__(/*! ./ShortestBetween */ "../../../src/math/angle/ShortestBetween.js"), + Wrap: __webpack_require__(/*! ./Wrap */ "../../../src/math/angle/Wrap.js"), + WrapDegrees: __webpack_require__(/*! ./WrapDegrees */ "../../../src/math/angle/WrapDegrees.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/const.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/math/const.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + +}; + +module.exports = MATH_CONST; + + +/***/ }), + +/***/ "../../../src/math/distance/DistanceBetween.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/DistanceBetween.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/distance/DistancePower.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/DistancePower.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/distance/DistanceSquared.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/DistanceSquared.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/distance/index.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/distance/index.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Distance + */ + +module.exports = { + + Between: __webpack_require__(/*! ./DistanceBetween */ "../../../src/math/distance/DistanceBetween.js"), + Power: __webpack_require__(/*! ./DistancePower */ "../../../src/math/distance/DistancePower.js"), + Squared: __webpack_require__(/*! ./DistanceSquared */ "../../../src/math/distance/DistanceSquared.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/back/In.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/In.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/back/InOut.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/InOut.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/back/Out.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/Out.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/back/index.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/back/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Back + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/back/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/back/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/back/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/In.js": +/*!*******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/In.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/InOut.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/InOut.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/Out.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/Out.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/bounce/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/bounce/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/bounce/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/bounce/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/bounce/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/In.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/In.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/InOut.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/InOut.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/Out.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/Out.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/circular/index.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/circular/index.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/circular/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/circular/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/circular/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/In.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/In.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/InOut.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/InOut.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/Out.js": +/*!*******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/Out.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/cubic/index.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/cubic/index.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/cubic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/cubic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/cubic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/In.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/In.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/InOut.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/InOut.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/Out.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/Out.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/elastic/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/elastic/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/elastic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/elastic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/elastic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/In.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/In.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/InOut.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/InOut.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/Out.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/Out.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/expo/index.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/expo/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/expo/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/expo/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/expo/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/index.js": +/*!***************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/index.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing + */ + +module.exports = { + + Back: __webpack_require__(/*! ./back */ "../../../src/math/easing/back/index.js"), + Bounce: __webpack_require__(/*! ./bounce */ "../../../src/math/easing/bounce/index.js"), + Circular: __webpack_require__(/*! ./circular */ "../../../src/math/easing/circular/index.js"), + Cubic: __webpack_require__(/*! ./cubic */ "../../../src/math/easing/cubic/index.js"), + Elastic: __webpack_require__(/*! ./elastic */ "../../../src/math/easing/elastic/index.js"), + Expo: __webpack_require__(/*! ./expo */ "../../../src/math/easing/expo/index.js"), + Linear: __webpack_require__(/*! ./linear */ "../../../src/math/easing/linear/index.js"), + Quadratic: __webpack_require__(/*! ./quadratic */ "../../../src/math/easing/quadratic/index.js"), + Quartic: __webpack_require__(/*! ./quartic */ "../../../src/math/easing/quartic/index.js"), + Quintic: __webpack_require__(/*! ./quintic */ "../../../src/math/easing/quintic/index.js"), + Sine: __webpack_require__(/*! ./sine */ "../../../src/math/easing/sine/index.js"), + Stepped: __webpack_require__(/*! ./stepped */ "../../../src/math/easing/stepped/index.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/linear/Linear.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/linear/Linear.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Linear easing (no variation). + * + * @function Phaser.Math.Easing.Linear.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; + + +/***/ }), + +/***/ "../../../src/math/easing/linear/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/linear/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Linear + */ + +module.exports = __webpack_require__(/*! ./Linear */ "../../../src/math/easing/linear/Linear.js"); + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/In.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/In.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/InOut.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/InOut.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/Out.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/Out.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quadratic/index.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quadratic/index.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/quadratic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/quadratic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/quadratic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/In.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/In.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/InOut.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/InOut.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/Out.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/Out.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quartic/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quartic/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/quartic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/quartic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/quartic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/In.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/In.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/InOut.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/InOut.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/Out.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/Out.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/quintic/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/quintic/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/quintic/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/quintic/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/quintic/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/In.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/In.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/InOut.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/InOut.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/Out.js": +/*!******************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/Out.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/easing/sine/index.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/sine/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(/*! ./In */ "../../../src/math/easing/sine/In.js"), + Out: __webpack_require__(/*! ./Out */ "../../../src/math/easing/sine/Out.js"), + InOut: __webpack_require__(/*! ./InOut */ "../../../src/math/easing/sine/InOut.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/easing/stepped/Stepped.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/stepped/Stepped.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Stepped easing. + * + * @function Phaser.Math.Easing.Stepped.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; + + +/***/ }), + +/***/ "../../../src/math/easing/stepped/index.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/easing/stepped/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(/*! ./Stepped */ "../../../src/math/easing/stepped/Stepped.js"); + + +/***/ }), + +/***/ "../../../src/math/fuzzy/Ceil.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/Ceil.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/Equal.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/Equal.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/Floor.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/Floor.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/GreaterThan.js": +/*!********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/GreaterThan.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/LessThan.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/LessThan.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/fuzzy/index.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/fuzzy/index.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Fuzzy + */ + +module.exports = { + + Ceil: __webpack_require__(/*! ./Ceil */ "../../../src/math/fuzzy/Ceil.js"), + Equal: __webpack_require__(/*! ./Equal */ "../../../src/math/fuzzy/Equal.js"), + Floor: __webpack_require__(/*! ./Floor */ "../../../src/math/fuzzy/Floor.js"), + GreaterThan: __webpack_require__(/*! ./GreaterThan */ "../../../src/math/fuzzy/GreaterThan.js"), + LessThan: __webpack_require__(/*! ./LessThan */ "../../../src/math/fuzzy/LessThan.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/index.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/math/index.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); +var Extend = __webpack_require__(/*! ../utils/object/Extend */ "../../../src/utils/object/Extend.js"); + +/** + * @namespace Phaser.Math + */ + +var PhaserMath = { + + // Collections of functions + Angle: __webpack_require__(/*! ./angle/ */ "../../../src/math/angle/index.js"), + Distance: __webpack_require__(/*! ./distance/ */ "../../../src/math/distance/index.js"), + Easing: __webpack_require__(/*! ./easing/ */ "../../../src/math/easing/index.js"), + Fuzzy: __webpack_require__(/*! ./fuzzy/ */ "../../../src/math/fuzzy/index.js"), + Interpolation: __webpack_require__(/*! ./interpolation/ */ "../../../src/math/interpolation/index.js"), + Pow2: __webpack_require__(/*! ./pow2/ */ "../../../src/math/pow2/index.js"), + Snap: __webpack_require__(/*! ./snap/ */ "../../../src/math/snap/index.js"), + + // Expose the RNG Class + RandomDataGenerator: __webpack_require__(/*! ./random-data-generator/RandomDataGenerator */ "../../../src/math/random-data-generator/RandomDataGenerator.js"), + + // Single functions + Average: __webpack_require__(/*! ./Average */ "../../../src/math/Average.js"), + Bernstein: __webpack_require__(/*! ./Bernstein */ "../../../src/math/Bernstein.js"), + Between: __webpack_require__(/*! ./Between */ "../../../src/math/Between.js"), + CatmullRom: __webpack_require__(/*! ./CatmullRom */ "../../../src/math/CatmullRom.js"), + CeilTo: __webpack_require__(/*! ./CeilTo */ "../../../src/math/CeilTo.js"), + Clamp: __webpack_require__(/*! ./Clamp */ "../../../src/math/Clamp.js"), + DegToRad: __webpack_require__(/*! ./DegToRad */ "../../../src/math/DegToRad.js"), + Difference: __webpack_require__(/*! ./Difference */ "../../../src/math/Difference.js"), + Factorial: __webpack_require__(/*! ./Factorial */ "../../../src/math/Factorial.js"), + FloatBetween: __webpack_require__(/*! ./FloatBetween */ "../../../src/math/FloatBetween.js"), + FloorTo: __webpack_require__(/*! ./FloorTo */ "../../../src/math/FloorTo.js"), + FromPercent: __webpack_require__(/*! ./FromPercent */ "../../../src/math/FromPercent.js"), + GetSpeed: __webpack_require__(/*! ./GetSpeed */ "../../../src/math/GetSpeed.js"), + IsEven: __webpack_require__(/*! ./IsEven */ "../../../src/math/IsEven.js"), + IsEvenStrict: __webpack_require__(/*! ./IsEvenStrict */ "../../../src/math/IsEvenStrict.js"), + Linear: __webpack_require__(/*! ./Linear */ "../../../src/math/Linear.js"), + MaxAdd: __webpack_require__(/*! ./MaxAdd */ "../../../src/math/MaxAdd.js"), + MinSub: __webpack_require__(/*! ./MinSub */ "../../../src/math/MinSub.js"), + Percent: __webpack_require__(/*! ./Percent */ "../../../src/math/Percent.js"), + RadToDeg: __webpack_require__(/*! ./RadToDeg */ "../../../src/math/RadToDeg.js"), + RandomXY: __webpack_require__(/*! ./RandomXY */ "../../../src/math/RandomXY.js"), + RandomXYZ: __webpack_require__(/*! ./RandomXYZ */ "../../../src/math/RandomXYZ.js"), + RandomXYZW: __webpack_require__(/*! ./RandomXYZW */ "../../../src/math/RandomXYZW.js"), + Rotate: __webpack_require__(/*! ./Rotate */ "../../../src/math/Rotate.js"), + RotateAround: __webpack_require__(/*! ./RotateAround */ "../../../src/math/RotateAround.js"), + RotateAroundDistance: __webpack_require__(/*! ./RotateAroundDistance */ "../../../src/math/RotateAroundDistance.js"), + RoundAwayFromZero: __webpack_require__(/*! ./RoundAwayFromZero */ "../../../src/math/RoundAwayFromZero.js"), + RoundTo: __webpack_require__(/*! ./RoundTo */ "../../../src/math/RoundTo.js"), + SinCosTableGenerator: __webpack_require__(/*! ./SinCosTableGenerator */ "../../../src/math/SinCosTableGenerator.js"), + SmootherStep: __webpack_require__(/*! ./SmootherStep */ "../../../src/math/SmootherStep.js"), + SmoothStep: __webpack_require__(/*! ./SmoothStep */ "../../../src/math/SmoothStep.js"), + ToXY: __webpack_require__(/*! ./ToXY */ "../../../src/math/ToXY.js"), + TransformXY: __webpack_require__(/*! ./TransformXY */ "../../../src/math/TransformXY.js"), + Within: __webpack_require__(/*! ./Within */ "../../../src/math/Within.js"), + Wrap: __webpack_require__(/*! ./Wrap */ "../../../src/math/Wrap.js"), + + // Vector classes + Vector2: __webpack_require__(/*! ./Vector2 */ "../../../src/math/Vector2.js"), + Vector3: __webpack_require__(/*! ./Vector3 */ "../../../src/math/Vector3.js"), + Vector4: __webpack_require__(/*! ./Vector4 */ "../../../src/math/Vector4.js"), + Matrix3: __webpack_require__(/*! ./Matrix3 */ "../../../src/math/Matrix3.js"), + Matrix4: __webpack_require__(/*! ./Matrix4 */ "../../../src/math/Matrix4.js"), + Quaternion: __webpack_require__(/*! ./Quaternion */ "../../../src/math/Quaternion.js"), + RotateVec3: __webpack_require__(/*! ./RotateVec3 */ "../../../src/math/RotateVec3.js") + +}; + +// Merge in the consts + +PhaserMath = Extend(false, PhaserMath, CONST); + +// Export it + +module.exports = PhaserMath; + + +/***/ }), + +/***/ "../../../src/math/interpolation/BezierInterpolation.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/BezierInterpolation.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bernstein = __webpack_require__(/*! ../Bernstein */ "../../../src/math/Bernstein.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/CatmullRomInterpolation.js": +/*!****************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/CatmullRomInterpolation.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CatmullRom = __webpack_require__(/*! ../CatmullRom */ "../../../src/math/CatmullRom.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/CubicBezierInterpolation.js": +/*!*****************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/CubicBezierInterpolation.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/LinearInterpolation.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/LinearInterpolation.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Linear = __webpack_require__(/*! ../Linear */ "../../../src/math/Linear.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/QuadraticBezierInterpolation.js": +/*!*********************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/QuadraticBezierInterpolation.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/SmoothStepInterpolation.js": +/*!****************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/SmoothStepInterpolation.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmoothStep = __webpack_require__(/*! ../SmoothStep */ "../../../src/math/SmoothStep.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/SmootherStepInterpolation.js": +/*!******************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/SmootherStepInterpolation.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmootherStep = __webpack_require__(/*! ../SmootherStep */ "../../../src/math/SmootherStep.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/math/interpolation/index.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/interpolation/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Interpolation + */ + +module.exports = { + + Bezier: __webpack_require__(/*! ./BezierInterpolation */ "../../../src/math/interpolation/BezierInterpolation.js"), + CatmullRom: __webpack_require__(/*! ./CatmullRomInterpolation */ "../../../src/math/interpolation/CatmullRomInterpolation.js"), + CubicBezier: __webpack_require__(/*! ./CubicBezierInterpolation */ "../../../src/math/interpolation/CubicBezierInterpolation.js"), + Linear: __webpack_require__(/*! ./LinearInterpolation */ "../../../src/math/interpolation/LinearInterpolation.js"), + QuadraticBezier: __webpack_require__(/*! ./QuadraticBezierInterpolation */ "../../../src/math/interpolation/QuadraticBezierInterpolation.js"), + SmoothStep: __webpack_require__(/*! ./SmoothStepInterpolation */ "../../../src/math/interpolation/SmoothStepInterpolation.js"), + SmootherStep: __webpack_require__(/*! ./SmootherStepInterpolation */ "../../../src/math/interpolation/SmootherStepInterpolation.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/pow2/GetPowerOfTwo.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/GetPowerOfTwo.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.GetPowerOfTwo + * @since 3.0.0 + * + * @param {number} value - The value. + * + * @return {integer} 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; + + +/***/ }), + +/***/ "../../../src/math/pow2/IsSizePowerOfTwo.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/IsSizePowerOfTwo.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsSizePowerOfTwo + * @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; + + +/***/ }), + +/***/ "../../../src/math/pow2/IsValuePowerOfTwo.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/IsValuePowerOfTwo.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.IsValuePowerOfTwo + * @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; + + +/***/ }), + +/***/ "../../../src/math/pow2/index.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/pow2/index.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Pow2 + */ + +module.exports = { + + GetNext: __webpack_require__(/*! ./GetPowerOfTwo */ "../../../src/math/pow2/GetPowerOfTwo.js"), + IsSize: __webpack_require__(/*! ./IsSizePowerOfTwo */ "../../../src/math/pow2/IsSizePowerOfTwo.js"), + IsValue: __webpack_require__(/*! ./IsValuePowerOfTwo */ "../../../src/math/pow2/IsValuePowerOfTwo.js") + +}; + + +/***/ }), + +/***/ "../../../src/math/random-data-generator/RandomDataGenerator.js": +/*!********************************************************************************!*\ + !*** D:/wamp/www/phaser/src/math/random-data-generator/RandomDataGenerator.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} 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 + * + * @param {array} [array] - The array to be shuffled. + * + * @return {array} 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; + + +/***/ }), + +/***/ "../../../src/math/snap/SnapCeil.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/SnapCeil.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/snap/SnapFloor.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/SnapFloor.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/snap/SnapTo.js": +/*!**************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/SnapTo.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/math/snap/index.js": +/*!*************************************************!*\ + !*** D:/wamp/www/phaser/src/math/snap/index.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Snap + */ + +module.exports = { + + Ceil: __webpack_require__(/*! ./SnapCeil */ "../../../src/math/snap/SnapCeil.js"), + Floor: __webpack_require__(/*! ./SnapFloor */ "../../../src/math/snap/SnapFloor.js"), + To: __webpack_require__(/*! ./SnapTo */ "../../../src/math/snap/SnapTo.js") + +}; + + +/***/ }), + +/***/ "../../../src/plugins/BasePlugin.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/plugins/BasePlugin.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); + +/** + * @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; + + /** + * 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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#scene + * @type {?Phaser.Scene} + * @protected + * @since 3.8.0 + */ + this.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 cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#systems + * @type {?Phaser.Scenes.Systems} + * @protected + * @since 3.8.0 + */ + this.systems; + }, + + /** + * Called by the PluginManager when this 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. + * + * @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 () + { + }, + + /** + * Called by the PluginManager when this plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + * + * @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); + }, + + /** + * Called by the PluginManager when this 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. + * + * @method Phaser.Plugins.BasePlugin#stop + * @since 3.8.0 + */ + stop: function () + { + }, + + /** + * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots. + * By this point the plugin properties `scene` and `systems` will have already been set. + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + * + * @method Phaser.Plugins.BasePlugin#boot + * @since 3.8.0 + */ + boot: function () + { + // Here are the Scene events you can listen to. + // At the very least you should offer a destroy handler for when the Scene closes down. + + // var eventEmitter = this.systems.events; + + // eventEmitter.once('destroy', this.sceneDestroy, this); + // eventEmitter.on('start', this.sceneStart, this); + // eventEmitter.on('preupdate', this.scenePreUpdate, this); + // eventEmitter.on('update', this.sceneUpdate, this); + // eventEmitter.on('postupdate', this.scenePostUpdate, this); + // eventEmitter.on('pause', this.scenePause, this); + // eventEmitter.on('resume', this.sceneResume, this); + // eventEmitter.on('sleep', this.sceneSleep, this); + // eventEmitter.on('wake', this.sceneWake, this); + // eventEmitter.on('shutdown', this.sceneShutdown, this); + // eventEmitter.on('destroy', this.sceneDestroy, this); + }, + + /** + * 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; + + +/***/ }), + +/***/ "../../../src/plugins/ScenePlugin.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/plugins/ScenePlugin.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var BasePlugin = __webpack_require__(/*! ./BasePlugin */ "../../../src/plugins/BasePlugin.js"); +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var SceneEvents = __webpack_require__(/*! ../scene/events */ "../../../src/scene/events/index.js"); + +/** + * @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. + */ +var ScenePlugin = new Class({ + + Extends: BasePlugin, + + initialize: + + function ScenePlugin (scene, pluginManager) + { + BasePlugin.call(this, pluginManager); + + this.scene = scene; + this.systems = scene.sys; + + 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 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 () + { + } + +}); + +module.exports = ScenePlugin; + + +/***/ }), + +/***/ "../../../src/renderer/BlendModes.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/renderer/BlendModes.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + DIFFERENCE: 11, + + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + * + * @name Phaser.BlendModes.EXCLUSION + * @type {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + LUMINOSITY: 16, + + /** + * Alpha erase blend mode. For Canvas and WebGL. + * + * @name Phaser.BlendModes.ERASE + * @type {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + LIGHTER: 25, + + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + * + * @name Phaser.BlendModes.COPY + * @type {integer} + * @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 {integer} + * @const + * @since 3.0.0 + */ + XOR: 27 + +}; + + +/***/ }), + +/***/ "../../../src/renderer/ScaleModes.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/renderer/ScaleModes.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @readonly + * @since 3.0.0 + */ + DEFAULT: 0, + + /** + * Linear Scale Mode. + * + * @name Phaser.ScaleModes.LINEAR + * @type {integer} + * @readonly + * @since 3.0.0 + */ + LINEAR: 0, + + /** + * Nearest Scale Mode. + * + * @name Phaser.ScaleModes.NEAREST + * @type {integer} + * @readonly + * @since 3.0.0 + */ + NEAREST: 1 + +}; + +module.exports = ScaleModes; + + +/***/ }), + +/***/ "../../../src/scale/events/RESIZE_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scale/events/RESIZE_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * @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 multiplied by resolution. + * @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} resolution - The current resolution. Defaults to 1 at the moment. + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/BOOT_EVENT.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/BOOT_EVENT.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('boot', listener)`. + * + * @event Phaser.Scenes.Events#BOOT + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/CREATE_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/CREATE_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('create', listener)`. + * + * @event Phaser.Scenes.Events#CREATE + * @since 3.17.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. + */ +module.exports = 'create'; + + +/***/ }), + +/***/ "../../../src/scene/events/DESTROY_EVENT.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/DESTROY_EVENT.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/PAUSE_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/PAUSE_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('pause', listener)`. + * + * @event Phaser.Scenes.Events#PAUSE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/POST_UPDATE_EVENT.js": +/*!****************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/POST_UPDATE_EVENT.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#POST_UPDATE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/PRE_UPDATE_EVENT.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/PRE_UPDATE_EVENT.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#PRE_UPDATE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/READY_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/READY_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('ready', listener)`. + * + * @event Phaser.Scenes.Events#READY + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/RENDER_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/RENDER_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('render', listener)`. + * + * A Scene will only render if it is visible and active. + * By the time this event is dispatched, the Scene will have already been rendered. + * + * @event Phaser.Scenes.Events#RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'render'; + + +/***/ }), + +/***/ "../../../src/scene/events/RESUME_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/RESUME_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('resume', listener)`. + * + * @event Phaser.Scenes.Events#RESUME + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/SHUTDOWN_EVENT.js": +/*!*************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/SHUTDOWN_EVENT.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/SLEEP_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/SLEEP_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('sleep', listener)`. + * + * @event Phaser.Scenes.Events#SLEEP + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/START_EVENT.js": +/*!**********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/START_EVENT.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('start', listener)`. + * + * @event Phaser.Scenes.Events#START + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_COMPLETE_EVENT.js": +/*!************************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @since 3.5.0 + * + * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. + */ +module.exports = 'transitioncomplete'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_INIT_EVENT.js": +/*!********************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_INIT_EVENT.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_OUT_EVENT.js": +/*!*******************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_OUT_EVENT.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_START_EVENT.js": +/*!*********************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_START_EVENT.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/TRANSITION_WAKE_EVENT.js": +/*!********************************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.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 + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/UPDATE_EVENT.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/UPDATE_EVENT.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#UPDATE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/WAKE_EVENT.js": +/*!*********************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/WAKE_EVENT.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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.scene.events.on('wake', listener)`. + * + * @event Phaser.Scenes.Events#WAKE + * @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'; + + +/***/ }), + +/***/ "../../../src/scene/events/index.js": +/*!****************************************************!*\ + !*** D:/wamp/www/phaser/src/scene/events/index.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Scenes.Events + */ + +module.exports = { + + BOOT: __webpack_require__(/*! ./BOOT_EVENT */ "../../../src/scene/events/BOOT_EVENT.js"), + CREATE: __webpack_require__(/*! ./CREATE_EVENT */ "../../../src/scene/events/CREATE_EVENT.js"), + DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ "../../../src/scene/events/DESTROY_EVENT.js"), + PAUSE: __webpack_require__(/*! ./PAUSE_EVENT */ "../../../src/scene/events/PAUSE_EVENT.js"), + POST_UPDATE: __webpack_require__(/*! ./POST_UPDATE_EVENT */ "../../../src/scene/events/POST_UPDATE_EVENT.js"), + PRE_UPDATE: __webpack_require__(/*! ./PRE_UPDATE_EVENT */ "../../../src/scene/events/PRE_UPDATE_EVENT.js"), + READY: __webpack_require__(/*! ./READY_EVENT */ "../../../src/scene/events/READY_EVENT.js"), + RENDER: __webpack_require__(/*! ./RENDER_EVENT */ "../../../src/scene/events/RENDER_EVENT.js"), + RESUME: __webpack_require__(/*! ./RESUME_EVENT */ "../../../src/scene/events/RESUME_EVENT.js"), + SHUTDOWN: __webpack_require__(/*! ./SHUTDOWN_EVENT */ "../../../src/scene/events/SHUTDOWN_EVENT.js"), + SLEEP: __webpack_require__(/*! ./SLEEP_EVENT */ "../../../src/scene/events/SLEEP_EVENT.js"), + START: __webpack_require__(/*! ./START_EVENT */ "../../../src/scene/events/START_EVENT.js"), + TRANSITION_COMPLETE: __webpack_require__(/*! ./TRANSITION_COMPLETE_EVENT */ "../../../src/scene/events/TRANSITION_COMPLETE_EVENT.js"), + TRANSITION_INIT: __webpack_require__(/*! ./TRANSITION_INIT_EVENT */ "../../../src/scene/events/TRANSITION_INIT_EVENT.js"), + TRANSITION_OUT: __webpack_require__(/*! ./TRANSITION_OUT_EVENT */ "../../../src/scene/events/TRANSITION_OUT_EVENT.js"), + TRANSITION_START: __webpack_require__(/*! ./TRANSITION_START_EVENT */ "../../../src/scene/events/TRANSITION_START_EVENT.js"), + TRANSITION_WAKE: __webpack_require__(/*! ./TRANSITION_WAKE_EVENT */ "../../../src/scene/events/TRANSITION_WAKE_EVENT.js"), + UPDATE: __webpack_require__(/*! ./UPDATE_EVENT */ "../../../src/scene/events/UPDATE_EVENT.js"), + WAKE: __webpack_require__(/*! ./WAKE_EVENT */ "../../../src/scene/events/WAKE_EVENT.js") + +}; + + +/***/ }), + +/***/ "../../../src/utils/Class.js": +/*!*********************************************!*\ + !*** D:/wamp/www/phaser/src/utils/Class.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// 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; +} + +/** + * Extends the given `myClass` object's prototype with the properties of `definition`. + * + * @function extend + * @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. + */ +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]; + } + } +} + +/** + * Applies the given `mixins` to the prototype of `myClass`. + * + * @function mixin + * @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) + { + return; + } + + if (!Array.isArray(mixins)) + { + mixins = [ mixins ]; + } + + 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; + + +/***/ }), + +/***/ "../../../src/utils/NOOP.js": +/*!********************************************!*\ + !*** D:/wamp/www/phaser/src/utils/NOOP.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/utils/object/Extend.js": +/*!*****************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/Extend.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsPlainObject = __webpack_require__(/*! ./IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); + +// @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 + * + * @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; + + +/***/ }), + +/***/ "../../../src/utils/object/GetAdvancedValue.js": +/*!***************************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/GetAdvancedValue.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH = __webpack_require__(/*! ../../math */ "../../../src/math/index.js"); +var GetValue = __webpack_require__(/*! ./GetValue */ "../../../src/utils/object/GetValue.js"); + +/** + * 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; + + +/***/ }), + +/***/ "../../../src/utils/object/GetFastValue.js": +/*!***********************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/GetFastValue.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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; + + +/***/ }), + +/***/ "../../../src/utils/object/GetValue.js": +/*!*******************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/GetValue.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Source object +// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' +// The default value to use if the key doesn't exist + +/** + * Retrieves a value from an object. + * + * @function Phaser.Utils.Objects.GetValue + * @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 GetValue = function (source, key, defaultValue) +{ + if (!source || typeof source === 'number') + { + return defaultValue; + } + else if (source.hasOwnProperty(key)) + { + return source[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parent = source; + var value = defaultValue; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parent.hasOwnProperty(keys[i])) + { + // Yes it has a key property, let's carry on down + value = parent[keys[i]]; + + parent = parent[keys[i]]; + } + else + { + // Can't go any further, so reset to default + value = defaultValue; + break; + } + } + + return value; + } + else + { + return defaultValue; + } +}; + +module.exports = GetValue; + + +/***/ }), + +/***/ "../../../src/utils/object/IsPlainObject.js": +/*!************************************************************!*\ + !*** D:/wamp/www/phaser/src/utils/object/IsPlainObject.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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 (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; + + +/***/ }), + +/***/ "./SpineFile.js": +/*!**********************!*\ + !*** ./SpineFile.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Class = __webpack_require__(/*! ../../../src/utils/Class */ "../../../src/utils/Class.js"); +var GetFastValue = __webpack_require__(/*! ../../../src/utils/object/GetFastValue */ "../../../src/utils/object/GetFastValue.js"); +var ImageFile = __webpack_require__(/*! ../../../src/loader/filetypes/ImageFile.js */ "../../../src/loader/filetypes/ImageFile.js"); +var IsPlainObject = __webpack_require__(/*! ../../../src/utils/object/IsPlainObject */ "../../../src/utils/object/IsPlainObject.js"); +var JSONFile = __webpack_require__(/*! ../../../src/loader/filetypes/JSONFile.js */ "../../../src/loader/filetypes/JSONFile.js"); +var MultiFile = __webpack_require__(/*! ../../../src/loader/MultiFile.js */ "../../../src/loader/MultiFile.js"); +var TextFile = __webpack_require__(/*! ../../../src/loader/filetypes/TextFile.js */ "../../../src/loader/filetypes/TextFile.js"); + +/** + * @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} [textureURL] - The absolute or relative URL to load the texture image file from. + * @property {string} [textureExtension='png'] - The default file extension to use for the image texture if no url is provided. + * @property {XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture image file. + * @property {string} [normalMap] - The filename of an associated normal map. It uses the same path and url to load as the texture image. + * @property {string} [atlasURL] - The absolute or relative URL to load the atlas data file from. + * @property {string} [atlasExtension='txt'] - The default file extension to use for the atlas data if no url is provided. + * @property {XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas data file. + */ + +/** + * @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, + 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 = []; + + 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', currentBaseURL); + var path = GetFastValue(config, 'path', currentPath); + var prefix = GetFastValue(config, 'prefix', currentPrefix); + 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 = '_SP_' + textureURL; + + var image = new ImageFile(loader, key, textureURL, textureXhrSettings); + + 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 combinedAtlastData = ''; + var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; + + for (var i = 1; i < this.files.length; i++) + { + var file = this.files[i]; + + if (file.type === 'text') + { + atlasKey = file.key.substr(0, file.key.length - 2); + + atlasCache = file.cache; + + combinedAtlastData = combinedAtlastData.concat(file.data); + } + else + { + var key = file.key.substr(4).trim(); + + this.loader.textureManager.addImage(key, file.data); + } + + file.pendingDestroy(); + } + + atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlastData }); + + this.complete = true; + } + } + +}); + +module.exports = SpineFile; + + +/***/ }), + +/***/ "./SpinePlugin.js": +/*!************************!*\ + !*** ./SpinePlugin.js ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var BuildGameObject = __webpack_require__(/*! ../../../src/gameobjects/BuildGameObject */ "../../../src/gameobjects/BuildGameObject.js"); +var Class = __webpack_require__(/*! ../../../src/utils/Class */ "../../../src/utils/Class.js"); +var GetValue = __webpack_require__(/*! ../../../src/utils/object/GetValue */ "../../../src/utils/object/GetValue.js"); +var ResizeEvent = __webpack_require__(/*! ../../../src/scale/events/RESIZE_EVENT */ "../../../src/scale/events/RESIZE_EVENT.js"); +var ScenePlugin = __webpack_require__(/*! ../../../src/plugins/ScenePlugin */ "../../../src/plugins/ScenePlugin.js"); +var Spine = __webpack_require__(/*! Spine */ "./runtimes/spine-webgl.js"); +var SpineFile = __webpack_require__(/*! ./SpineFile */ "./SpineFile.js"); +var SpineGameObject = __webpack_require__(/*! ./gameobject/SpineGameObject */ "./gameobject/SpineGameObject.js"); + +/** + * @classdesc + * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game objects. + * + * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin + * uses the Spine 3.7 runtimes. Files created in a more recent version of Spine may not work as a result. + * + * You can find more details about Spine at http://esotericsoftware.com/. + * + * 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. + * + * 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 a Game Object Factory method, allowin you to create Spine Game Objects: + * + * ```javascript + * this.add.spine(512, 650, 'stretchyman') + * ``` + * + * 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 preMultipiedAlpha 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. + * + * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference + * + * @class SpinePlugin + * @memberOf Phaser + * @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. + */ +var SpinePlugin = new Class({ + + Extends: ScenePlugin, + + initialize: + + function SpinePlugin (scene, pluginManager) + { + ScenePlugin.call(this, scene, pluginManager); + + 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. + * + * 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; + } + + pluginManager.registerFileType('spine', this.spineFileCallback, scene); + + pluginManager.registerGameObject('spine', this.add.bind(this), this.make.bind(this)); + }, + + /** + * 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); + }, + + /** + * 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 () + { + this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + + // Monkeypatch the Spine setBlendMode functions, or batching is destroyed + + var setBlendMode = function (srcBlend, dstBlend) + { + if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend) + { + var gl = this.context.gl; + + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + + if (this.isDrawing) + { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + } + }; + + this.sceneRenderer.batcher.setBlendMode = setBlendMode; + this.sceneRenderer.shapes.setBlendMode = setBlendMode; + + this.skeletonRenderer = this.sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = this.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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage()); + + spineTextures.add(key, canvasTexture); + + return canvasTexture; + }); + } + + 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 = new Spine.TextureAtlas(atlasEntry.data, function () + { + return spineTextures.get(key); + }); + } + else + { + var textures = this.textures; + + var gl = this.sceneRenderer.context.gl; + + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) + { + var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage(), false); + + spineTextures.add(key, glTexture); + + return glTexture; + }); + } + + 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 preMultipiedAlpha 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#addFileEvent + * @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} [preMultipiedAlpha=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. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ + spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings) + { + var multifile; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new SpineFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; + }, + + /** + * 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. + */ + add: function (x, y, key, animationName, loop) + { + var spineGO = new SpineGameObject(this.scene, this, x, y, key, animationName, loop); + + this.scene.sys.displayList.add(spineGO); + this.scene.sys.updateList.add(spineGO); + + return spineGO; + }, + + /** + * 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. + */ + 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 spineGO = new SpineGameObject(this.scene, this, 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(); + }, + + /** + * 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 Spine.Vector2(temp2.x, temp2.y); + } + else if (bone) + { + return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y); + } + else + { + return new Spine.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 Spine.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; + } + + var preMultipliedAlpha = atlasData.preMultipliedAlpha; + + var atlasLoader = new Spine.AtlasAttachmentLoader(atlas); + + var skeletonJson = new Spine.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 Spine.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 Spine.AnimationStateData(skeleton.data); + + var state = new Spine.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 Spine.Vector2(); + var size = new Spine.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.viewportWidth = viewportWidth; + sceneRenderer.camera.viewportHeight = 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); + + this.sceneRenderer.dispose(); + }, + + /** + * 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.pluginManager.removeGameObject('spine', true, true); + + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; + + this.cache = null; + this.spineTextures = null; + this.json = null; + this.textures = null; + this.sceneRenderer = null; + this.skeletonRenderer = null; + this.gl = null; + } + +}); + +module.exports = SpinePlugin; + + +/***/ }), + +/***/ "./events/COMPLETE_EVENT.js": +/*!**********************************!*\ + !*** ./events/COMPLETE_EVENT.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 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'; + + +/***/ }), + +/***/ "./events/DISPOSE_EVENT.js": +/*!*********************************!*\ + !*** ./events/DISPOSE_EVENT.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#DISPOSE + * @since 3.19.0 + */ +module.exports = 'dispose'; + + +/***/ }), + +/***/ "./events/END_EVENT.js": +/*!*****************************!*\ + !*** ./events/END_EVENT.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#END + * @since 3.19.0 + */ +module.exports = 'end'; + + +/***/ }), + +/***/ "./events/EVENT_EVENT.js": +/*!*******************************!*\ + !*** ./events/EVENT_EVENT.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#EVENT + * @since 3.19.0 + */ +module.exports = 'event'; + + +/***/ }), + +/***/ "./events/INTERRUPTED_EVENT.js": +/*!*************************************!*\ + !*** ./events/INTERRUPTED_EVENT.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#INTERRUPTED + * @since 3.19.0 + */ +module.exports = 'interrupted'; + + +/***/ }), + +/***/ "./events/START_EVENT.js": +/*!*******************************!*\ + !*** ./events/START_EVENT.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Complete Event. + * + * @event SpinePluginEvents#START + * @since 3.19.0 + */ +module.exports = 'start'; + + +/***/ }), + +/***/ "./events/index.js": +/*!*************************!*\ + !*** ./events/index.js ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace SpinePluginEvents + */ + +module.exports = { + + COMPLETE: __webpack_require__(/*! ./COMPLETE_EVENT */ "./events/COMPLETE_EVENT.js"), + DISPOSE: __webpack_require__(/*! ./DISPOSE_EVENT */ "./events/DISPOSE_EVENT.js"), + END: __webpack_require__(/*! ./END_EVENT */ "./events/END_EVENT.js"), + EVENT: __webpack_require__(/*! ./EVENT_EVENT */ "./events/EVENT_EVENT.js"), + INTERRUPTED: __webpack_require__(/*! ./INTERRUPTED_EVENT */ "./events/INTERRUPTED_EVENT.js"), + START: __webpack_require__(/*! ./START_EVENT */ "./events/START_EVENT.js") + +}; + + +/***/ }), + +/***/ "./gameobject/SpineGameObject.js": +/*!***************************************!*\ + !*** ./gameobject/SpineGameObject.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var AngleBetween = __webpack_require__(/*! ../../../../src/math/angle/Between */ "../../../src/math/angle/Between.js"); +var Clamp = __webpack_require__(/*! ../../../../src/math/Clamp */ "../../../src/math/Clamp.js"); +var Class = __webpack_require__(/*! ../../../../src/utils/Class */ "../../../src/utils/Class.js"); +var ComponentsComputedSize = __webpack_require__(/*! ../../../../src/gameobjects/components/ComputedSize */ "../../../src/gameobjects/components/ComputedSize.js"); +var ComponentsDepth = __webpack_require__(/*! ../../../../src/gameobjects/components/Depth */ "../../../src/gameobjects/components/Depth.js"); +var ComponentsFlip = __webpack_require__(/*! ../../../../src/gameobjects/components/Flip */ "../../../src/gameobjects/components/Flip.js"); +var ComponentsScrollFactor = __webpack_require__(/*! ../../../../src/gameobjects/components/ScrollFactor */ "../../../src/gameobjects/components/ScrollFactor.js"); +var ComponentsTransform = __webpack_require__(/*! ../../../../src/gameobjects/components/Transform */ "../../../src/gameobjects/components/Transform.js"); +var ComponentsVisible = __webpack_require__(/*! ../../../../src/gameobjects/components/Visible */ "../../../src/gameobjects/components/Visible.js"); +var CounterClockwise = __webpack_require__(/*! ../../../../src/math/angle/CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"); +var DegToRad = __webpack_require__(/*! ../../../../src/math/DegToRad */ "../../../src/math/DegToRad.js"); +var GameObject = __webpack_require__(/*! ../../../../src/gameobjects/GameObject */ "../../../src/gameobjects/GameObject.js"); +var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../../src/math/RadToDeg.js"); +var SpineEvents = __webpack_require__(/*! ../events/ */ "./events/index.js"); +var SpineGameObjectRender = __webpack_require__(/*! ./SpineGameObjectRender */ "./gameobject/SpineGameObjectRender.js"); + +/** + * @classdesc + * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates + * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to + * easily change the skin, slot attachment, bone positions and more. + * + * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly. + * You can only create them if the Spine plugin has been loaded into Phaser. + * + * The quickest way is the Game Object Factory: + * + * ```javascript + * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true); + * ``` + * + * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly` + * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is + * an optional animation to start playing on the skeleton. The final argument `true` sets the + * animation to loop. Look at the documentation for further details on each of these options. + * + * For more control, you can use the Game Object Creator, passing in a Spine Game Object + * Configuration object: + * + * ```javascript + * let jelly = this.make.spine({ + * x: 512, y: 550, key: 'jelly', + * scale: 1.5, + * skinName: 'square_Green', + * animationName: 'jelly-think', loop: true, + * slotName: 'hat', attachmentName: 'images/La_14' + * }); + * ``` + * + * Here, you've got the ability to specify extra details, such as the slot name, attachments or + * overall scale. + * + * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to + * update and render, it must be added to the display and update lists of your Scene: + * + * ```javascript + * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true); + * this.sys.displayList.add(jelly); + * this.sys.updateList.add(jelly); + * ``` + * + * It's possible to enable Spine Game Objects for input, but you should be aware that it will use + * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but + * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created. + * If it's not suitable, provide your own shape to the `setInteractive` method. + * + * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for + * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game + * Object position with it. See the examples for further details. + * + * If your Spine Game Object has black outlines around the different parts of the texture when it + * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have + * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details. + * + * @class SpineGameObject + * @constructor + * @since 3.19.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 {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? + */ +var SpineGameObject = new Class({ + + Extends: GameObject, + + Mixins: [ + ComponentsComputedSize, + ComponentsDepth, + ComponentsFlip, + ComponentsScrollFactor, + ComponentsTransform, + ComponentsVisible, + SpineGameObjectRender + ], + + initialize: + + function SpineGameObject (scene, plugin, x, y, key, animationName, loop) + { + GameObject.call(this, scene, 'Spine'); + + /** + * A reference to the Spine Plugin. + * + * @name SpineGameObject#plugin + * @type {SpinePlugin} + * @since 3.19.0 + */ + this.plugin = plugin; + + /** + * The Spine Skeleton this Game Object is using. + * + * @name SpineGameObject#skeleton + * @type {spine.Skeleton} + * @since 3.19.0 + */ + this.skeleton = null; + + /** + * The Spine Skeleton Data associated with the Skeleton this Game Object is using. + * + * @name SpineGameObject#skeletonData + * @type {spine.SkeletonData} + * @since 3.19.0 + */ + this.skeletonData = null; + + /** + * The Spine Animation State this Game Object is using. + * + * @name SpineGameObject#state + * @type {spine.AnimationState} + * @since 3.19.0 + */ + this.state = null; + + /** + * The Spine Animation State Data associated with the Animation State this Game Object is using. + * + * @name SpineGameObject#stateData + * @type {spine.AnimationStateData} + * @since 3.19.0 + */ + this.stateData = null; + + /** + * A reference to the root bone of the Skeleton. + * + * @name SpineGameObject#root + * @type {spine.Bone} + * @since 3.19.0 + */ + this.root = null; + + /** + * This object holds the calculated bounds of the current + * pose, as set when a new Skeleton is applied. + * + * @name SpineGameObject#bounds + * @type {any} + * @since 3.19.0 + */ + this.bounds = null; + + /** + * A Game Object level flag that allows you to enable debug drawing + * to the Skeleton Debug Renderer by toggling it. + * + * @name SpineGameObject#drawDebug + * @type {boolean} + * @since 3.19.0 + */ + this.drawDebug = false; + + /** + * The factor to scale the Animation update time by. + * + * @name SpineGameObject#timeScale + * @type {number} + * @since 3.19.0 + */ + this.timeScale = 1; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginX + * @type {number} + * @since 3.19.0 + */ + this.displayOriginX = 0; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginY + * @type {number} + * @since 3.19.0 + */ + this.displayOriginY = 0; + + /** + * A flag that stores if the texture associated with the current + * Skin being used by this Game Object, has its alpha pre-multiplied + * into it, or not. + * + * @name SpineGameObject#preMultipliedAlpha + * @type {boolean} + * @since 3.19.0 + */ + this.preMultipliedAlpha = false; + + /** + * A default Blend Mode. You cannot change the blend mode of a + * Spine Game Object. + * + * @name SpineGameObject#blendMode + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.blendMode = 0; + + this.setPosition(x, y); + + if (key) + { + this.setSkeleton(key, animationName, loop); + } + }, + + /** + * Overrides the default Game Object method and always returns true. + * Rendering is decided in the renderer functions. + * + * @method SpineGameObject#willRender + * @since 3.19.0 + * + * @return {boolean} Always returns `true`. + */ + willRender: function () + { + return true; + }, + + /** + * Set the Alpha level for the whole Skeleton 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 SpineGameObject#setAlpha + * @since 3.19.0 + * + * @param {number} [value=1] - The alpha value used for the whole Skeleton. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (value, slotName) + { + if (value === undefined) { value = 1; } + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + slot.color.a = Clamp(value, 0, 1); + } + } + else + { + this.alpha = value; + } + + return this; + }, + + /** + * The alpha value of the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#alpha + * @type {number} + * @since 3.19.0 + */ + alpha: { + + get: function () + { + return this.skeleton.color.a; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.a = v; + } + + if (v === 0) + { + this.renderFlags &= ~2; + } + else + { + this.renderFlags |= 2; + } + } + + }, + + /** + * The amount of red used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#red + * @type {number} + * @since 3.19.0 + */ + red: { + + get: function () + { + return this.skeleton.color.r; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.r = v; + } + } + + }, + + /** + * The amount of green used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#green + * @type {number} + * @since 3.19.0 + */ + green: { + + get: function () + { + return this.skeleton.color.g; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.g = v; + } + } + + }, + + /** + * The amount of blue used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#blue + * @type {number} + * @since 3.19.0 + */ + blue: { + + get: function () + { + return this.skeleton.color.b; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.b = v; + } + } + + }, + + /** + * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton. + * + * @method SpineGameObject#setColor + * @since 3.19.0 + * + * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color. + * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton. + * + * @return {this} This Game Object instance. + */ + setColor: function (color, slotName) + { + if (color === undefined) { color = 0xffffff; } + + var red = (color >> 16 & 0xFF) / 255; + var green = (color >> 8 & 0xFF) / 255; + var blue = (color & 0xFF) / 255; + var alpha = (color > 16777215) ? (color >>> 24) / 255 : null; + + var target = this.skeleton; + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + target = slot; + } + } + + target.color.r = red; + target.color.g = green; + target.color.b = blue; + + if (alpha !== null) + { + target.color.a = alpha; + } + + return this; + }, + + /** + * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object + * that contains the Skeleton data. + * + * @method SpineGameObject#setSkeletonFromJSON + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ + setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop) + { + return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop); + }, + + /** + * Sets this Game Object to use the given Skeleton based on its cache key. + * + * Typically, once set, the Skeleton doesn't change. Instead, you change the skin, + * or slot attachment, or any other property to adjust it. + * + * @method SpineGameObject#setSkeleton + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ + setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON) + { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON); + + this.skeletonData = data.skeletonData; + + this.preMultipliedAlpha = data.preMultipliedAlpha; + + var skeleton = data.skeleton; + + skeleton.setSkinByName('default'); + skeleton.setToSetupPose(); + + this.skeleton = skeleton; + + // AnimationState + data = this.plugin.createAnimationState(skeleton); + + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + this.state = data.state; + this.stateData = data.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) + }); + + if (animationName) + { + this.setAnimation(0, animationName, loop); + } + + this.root = this.getRootBone(); + + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.state.apply(skeleton); + + skeleton.updateCache(); + + return this.updateSize(); + }, + + /** + * Internal event handler that emits the Spine onComplete event via this Game Object. + * + * @method SpineGameObject#onComplete + * @fires SpinePluginEvents#COMPLETE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onComplete: function (entry) + { + this.emit(SpineEvents.COMPLETE, entry); + }, + + /** + * Internal event handler that emits the Spine onDispose event via this Game Object. + * + * @method SpineGameObject#onDispose + * @fires SpinePluginEvents#DISPOSE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onDispose: function (entry) + { + this.emit(SpineEvents.DISPOSE, entry); + }, + + /** + * Internal event handler that emits the Spine onEnd event via this Game Object. + * + * @method SpineGameObject#onEnd + * @fires SpinePluginEvents#END + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onEnd: function (entry) + { + this.emit(SpineEvents.END, entry); + }, + + /** + * Internal event handler that emits the Spine Event event via this Game Object. + * + * @method SpineGameObject#onEvent + * @fires SpinePluginEvents#EVENT + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + * @param {spine.Event} event - The Spine event. + */ + onEvent: function (entry, event) + { + this.emit(SpineEvents.EVENT, entry, event); + }, + + /** + * Internal event handler that emits the Spine onInterrupted event via this Game Object. + * + * @method SpineGameObject#onInterrupted + * @fires SpinePluginEvents#INTERRUPTED + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onInterrupted: function (entry) + { + this.emit(SpineEvents.INTERRUPTED, entry); + }, + + /** + * Internal event handler that emits the Spine onStart event via this Game Object. + * + * @method SpineGameObject#onStart + * @fires SpinePluginEvents#START + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onStart: function (entry) + { + this.emit(SpineEvents.START, entry); + }, + + /** + * Refreshes the data about the current Skeleton. + * + * This will reset the rotation, position and size of the Skeleton to match this Game Object. + * + * Call this method if you need to access the Skeleton data directly, and it may have changed + * recently. + * + * @method SpineGameObject#refresh + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + refresh: function () + { + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.updateSize(); + + this.skeleton.updateCache(); + + return this; + }, + + /** + * Sets the size of this Game Object. + * + * If no arguments are given it uses the current skeleton data dimensions. + * + * You can use this method to set a fixed size of this Game Object, such as for input detection, + * when the skeleton data doesn't match what is required in-game. + * + * @method SpineGameObject#setSize + * @since 3.19.0 + * + * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width. + * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height. + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setSize: function (width, height, offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (width === undefined) { width = skeleton.data.width; } + if (height === undefined) { height = skeleton.data.height; } + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.width = width; + this.height = height; + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Sets the offset of this Game Object from the Skeleton position. + * + * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using. + * + * @method SpineGameObject#setOffset + * @since 3.19.0 + * + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setOffset: function (offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Internal method that syncs all of the Game Object position and scale data to the Skeleton. + * It then syncs the skeleton bounds back to this Game Object. + * + * This method is called automatically as needed internally, however, it's also exposed should + * you require overriding the size settings. + * + * @method SpineGameObject#updateSize + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + updateSize: function () + { + var skeleton = this.skeleton; + var renderer = this.plugin.renderer; + + var height = renderer.height; + + var oldScaleX = this.scaleX; + var oldScaleY = this.scaleY; + + skeleton.x = this.x; + skeleton.y = height - this.y; + skeleton.scaleX = 1; + skeleton.scaleY = 1; + + skeleton.updateWorldTransform(); + + var bounds = this.getBounds(); + + this.width = bounds.size.x; + this.height = bounds.size.y; + + this.displayOriginX = this.x - bounds.offset.x; + this.displayOriginY = this.y - (height - (this.height + bounds.offset.y)); + + skeleton.scaleX = oldScaleX; + skeleton.scaleY = oldScaleY; + + skeleton.updateWorldTransform(); + + return this; + }, + + /** + * The horizontal scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleX + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + this.refresh(); + } + + }, + + /** + * The vertical scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleY + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + this.refresh(); + } + + }, + + /** + * Returns an array containing the names of all the bones in the Skeleton Data. + * + * @method SpineGameObject#getBoneList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the bones in the Skeleton Data. + */ + getBoneList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.bones.length; i++) + { + output.push(skeletonData.bones[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the skins in the Skeleton Data. + * + * @method SpineGameObject#getSkinList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the skins in the Skeleton Data. + */ + getSkinList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.skins.length; i++) + { + output.push(skeletonData.skins[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the slots in the Skeleton. + * + * @method SpineGameObject#getSlotList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the slots in the Skeleton. + */ + getSlotList: function () + { + var output = []; + + var skeleton = this.skeleton; + + for (var i = 0; i < skeleton.slots.length; i++) + { + output.push(skeleton.slots[i].data.name); + } + + return output; + }, + + /** + * Returns an array containing the names of all the animations in the Skeleton Data. + * + * @method SpineGameObject#getAnimationList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the animations in the Skeleton Data. + */ + getAnimationList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.animations.length; i++) + { + output.push(skeletonData.animations[i].name); + } + } + + return output; + }, + + /** + * Returns the current animation being played on the given track, if any. + * + * @method SpineGameObject#getCurrentAnimation + * @since 3.19.0 + * + * @param {integer} [trackIndex=0] - The track to return the current animation on. + * + * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation. + */ + getCurrentAnimation: function (trackIndex) + { + if (trackIndex === undefined) { trackIndex = 0; } + + var current = this.state.getCurrent(trackIndex); + + if (current) + { + return current.animation; + } + }, + + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#play + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead. + */ + play: function (animationName, loop, ignoreIfPlaying) + { + this.setAnimation(0, animationName, loop, ignoreIfPlaying); + + return this; + }, + + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#setAnimation + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to play the animation on. + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying) + { + if (loop === undefined) { loop = false; } + if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } + + if (ignoreIfPlaying && this.state) + { + var currentTrack = this.state.getCurrent(0); + + if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete()) + { + return; + } + } + + if (this.findAnimation(animationName)) + { + return this.state.setAnimation(trackIndex, animationName, loop); + } + }, + + /** + * Adds an animation to be played after the current or last queued animation for a track. + * If the track is empty, it is equivalent to calling setAnimation. + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous + * track entry minus any mix duration (from the AnimationStateData) plus the specified delay + * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration). + * If the previous entry is looping, its next loop completion is used instead of its duration. + * + * @method SpineGameObject#addAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {string} animationName - The string-based key of the animation to add. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + addAnimation: function (trackIndex, animationName, loop, delay) + { + return this.state.addAnimation(trackIndex, animationName, loop, delay); + }, + + /** + * Sets an empty animation for a track, discarding any queued animations, and sets the track + * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out. + * + * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation, + * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be + * applied less and less over the mix duration. Properties keyed in the previous animation transition to + * the value from lower tracks or to the setup pose value if no lower tracks key the property. + * A mix duration of 0 still mixes out over one frame. + * + * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation + * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new + * animation to be applied more and more over the mix duration. Properties keyed in the new animation + * transition from the value from lower tracks or from the setup pose value if no lower tracks key the + * property to the value keyed in the new animation. + * + * @method SpineGameObject#setEmptyAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {spine.TrackEntry} The returned Track Entry. + */ + setEmptyAnimation: function (trackIndex, mixDuration) + { + return this.state.setEmptyAnimation(trackIndex, mixDuration); + }, + + /** + * Removes all animations from the track, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTrack + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * + * @return {this} This Game Object. + */ + clearTrack: function (trackIndex) + { + this.state.clearTrack(trackIndex); + + return this; + }, + + /** + * Removes all animations from all tracks, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTracks + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + clearTracks: function () + { + this.state.clearTracks(); + + return this; + }, + + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkinByName + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to set. + * + * @return {this} This Game Object. + */ + setSkinByName: function (skinName) + { + var skeleton = this.skeleton; + + skeleton.setSkinByName(skinName); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); + + return this; + }, + + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkin + * @since 3.19.0 + * + * @param {?spine.Skin} newSkin - The Skin to set. May be `null`. + * + * @return {this} This Game Object. + */ + setSkin: function (newSkin) + { + var skeleton = this.skeleton; + + skeleton.setSkin(newSkin); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); + + return this; + }, + + /** + * Sets the mix duration when changing from the specified animation to the other. + * + * @method SpineGameObject#setMix + * @since 3.19.0 + * + * @param {string} fromName - The animation to mix from. + * @param {string} toName - The animation to mix to. + * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {this} This Game Object. + */ + setMix: function (fromName, toName, duration) + { + this.stateData.setMix(fromName, toName, duration); + + return this; + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot + * index and attachment name. First the skin is checked and if the attachment was not found, + * the default skin is checked. + * + * @method SpineGameObject#getAttachment + * @since 3.19.0 + * + * @param {integer} slotIndex - The slot index to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachment: function (slotIndex, attachmentName) + { + return this.skeleton.getAttachment(slotIndex, attachmentName); + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name. + * + * @method SpineGameObject#getAttachmentByName + * @since 3.19.0 + * + * @param {string} slotName - The slot name to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachmentByName: function (slotName, attachmentName) + { + return this.skeleton.getAttachmentByName(slotName, attachmentName); + }, + + /** + * A convenience method to set an attachment by finding the slot with findSlot, + * finding the attachment with getAttachment, then setting the slot's attachment. + * + * @method SpineGameObject#setAttachment + * @since 3.19.0 + * + * @param {string} slotName - The slot name to add the attachment to. + * @param {string} attachmentName - The attachment name to add. + * + * @return {this} This Game Object. + */ + setAttachment: function (slotName, attachmentName) + { + if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length) + { + for (var i = 0; i < slotName.length; i++) + { + this.skeleton.setAttachment(slotName[i], attachmentName[i]); + } + } + else + { + this.skeleton.setAttachment(slotName, attachmentName); + } + + return this; + }, + + /** + * Sets the bones, constraints, slots, and draw order to their setup pose values. + * + * @method SpineGameObject#setToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setToSetupPose: function () + { + this.skeleton.setToSetupPose(); + + return this; + }, + + /** + * Sets the slots and draw order to their setup pose values. + * + * @method SpineGameObject#setSlotsToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setSlotsToSetupPose: function () + { + this.skeleton.setSlotsToSetupPose(); + + return this; + }, + + /** + * Sets the bones and constraints to their setup pose values. + * + * @method SpineGameObject#setBonesToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setBonesToSetupPose: function () + { + this.skeleton.setBonesToSetupPose(); + + return this; + }, + + /** + * Gets the root bone, or null. + * + * @method SpineGameObject#getRootBone + * @since 3.19.0 + * + * @return {spine.Bone} The root bone, or null. + */ + getRootBone: function () + { + return this.skeleton.getRootBone(); + }, + + /** + * Takes a Bone object and a position in world space and rotates the Bone so it is angled + * towards the given position. You can set an optional angle offset, should the bone be + * designed at a specific angle already. You can also set a minimum and maximum range for the angle. + * + * @method SpineGameObject#angleBoneToXY + * @since 3.19.0 + * + * @param {spine.Bone} bone - The bone to rotate towards the world position. + * @param {number} worldX - The world x coordinate to rotate the bone towards. + * @param {number} worldY - The world y coordinate to rotate the bone towards. + * @param {number} [offset=0] - An offset to add to the rotation angle. + * @param {number} [minAngle=0] - The minimum range of the rotation angle. + * @param {number} [maxAngle=360] - The maximum range of the rotation angle. + * + * @return {this} This Game Object. + */ + angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle) + { + if (offset === undefined) { offset = 0; } + if (minAngle === undefined) { minAngle = 0; } + if (maxAngle === undefined) { maxAngle = 360; } + + var renderer = this.plugin.renderer; + var height = renderer.height; + + var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset)); + + bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle); + + return this; + }, + + /** + * Finds a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBone + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {spine.Bone} The bone, or null. + */ + findBone: function (boneName) + { + return this.skeleton.findBone(boneName); + }, + + /** + * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBoneIndex + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {integer} The bone index. Or -1 if the bone was not found. + */ + findBoneIndex: function (boneName) + { + return this.skeleton.findBoneIndex(boneName); + }, + + /** + * Finds a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlot + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {spine.Slot} The Slot. May be null. + */ + findSlot: function (slotName) + { + return this.skeleton.findSlot(slotName); + }, + + /** + * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlotIndex + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {integer} The slot index. Or -1 if the Slot was not found. + */ + findSlotIndex: function (slotName) + { + return this.skeleton.findSlotIndex(slotName); + }, + + /** + * Finds a skin by comparing each skin's name. It is more efficient to cache the results of + * this method than to call it multiple times. + * + * @method SpineGameObject#findSkin + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to find. + * + * @return {spine.Skin} The Skin. May be null. + */ + findSkin: function (skinName) + { + return this.skeletonData.findSkin(skinName); + }, + + /** + * Finds an event by comparing each events's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findEvent + * @since 3.19.0 + * + * @param {string} eventDataName - The name of the event to find. + * + * @return {spine.EventData} The Event Data. May be null. + */ + findEvent: function (eventDataName) + { + return this.skeletonData.findEvent(eventDataName); + }, + + /** + * Finds an animation by comparing each animation's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findAnimation + * @since 3.19.0 + * + * @param {string} animationName - The name of the animation to find. + * + * @return {spine.Animation} The Animation. May be null. + */ + findAnimation: function (animationName) + { + return this.skeletonData.findAnimation(animationName); + }, + + /** + * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findIkConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.IkConstraintData} The IK constraint. May be null. + */ + findIkConstraint: function (constraintName) + { + return this.skeletonData.findIkConstraint(constraintName); + }, + + /** + * Finds an transform constraint by comparing each transform constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findTransformConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.TransformConstraintData} The transform constraint. May be null. + */ + findTransformConstraint: function (constraintName) + { + return this.skeletonData.findTransformConstraint(constraintName); + }, + + /** + * Finds a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.PathConstraintData} The path constraint. May be null. + */ + findPathConstraint: function (constraintName) + { + return this.skeletonData.findPathConstraint(constraintName); + }, + + /** + * Finds the index of a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraintIndex + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {integer} The constraint index. Or -1 if the constraint was not found. + */ + findPathConstraintIndex: function (constraintName) + { + return this.skeletonData.findPathConstraintIndex(constraintName); + }, + + /** + * 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 SpineGameObject#getBounds + * @since 3.19.0 + * + * @return {any} The bounds object. + */ + getBounds: function () + { + return this.plugin.getBounds(this.skeleton); + }, + + /** + * Internal update handler. + * + * @method SpineGameObject#preUpdate + * @protected + * @since 3.19.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + var skeleton = this.skeleton; + + this.state.update((delta / 1000) * this.timeScale); + + this.state.apply(skeleton); + + // this.emit('spine.update', skeleton); + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method SpineGameObject#preDestroy + * @protected + * @since 3.19.0 + */ + preDestroy: function () + { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + + this.plugin = null; + + this.skeleton = null; + this.skeletonData = null; + + this.state = null; + this.stateData = null; + } + +}); + +module.exports = SpineGameObject; + + +/***/ }), + +/***/ "./gameobject/SpineGameObjectRender.js": +/*!*********************************************!*\ + !*** ./gameobject/SpineGameObjectRender.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var renderWebGL = __webpack_require__(/*! ../../../../src/utils/NOOP */ "../../../src/utils/NOOP.js"); +var renderCanvas = __webpack_require__(/*! ../../../../src/utils/NOOP */ "../../../src/utils/NOOP.js"); + +if (true) +{ + renderWebGL = __webpack_require__(/*! ./SpineGameObjectWebGLRenderer */ "./gameobject/SpineGameObjectWebGLRenderer.js"); +} + +if (false) +{} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), + +/***/ "./gameobject/SpineGameObjectWebGLRenderer.js": +/*!****************************************************!*\ + !*** ./gameobject/SpineGameObjectWebGLRenderer.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var CounterClockwise = __webpack_require__(/*! ../../../../src/math/angle/CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"); +var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../../src/math/RadToDeg.js"); +var Wrap = __webpack_require__(/*! ../../../../src/math/Wrap */ "../../../src/math/Wrap.js"); + +/** + * 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 {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @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 SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var plugin = src.plugin; + var skeleton = src.skeleton; + var sceneRenderer = plugin.sceneRenderer; + + var GameObjectRenderMask = 15; + + var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); + + if (!skeleton || !willRender) + { + // Reset the current type + renderer.currentType = ''; + + // If there is already a batch running, we need to close it + if (!renderer.nextTypeMatch) + { + // The next object in the display list is not a Spine object, so we end the batch + sceneRenderer.end(); + + renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline); + } + + return; + } + + if (renderer.newType) + { + renderer.clearPipeline(); + } + + var camMatrix = renderer._tempMatrix1; + var spriteMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + 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); + } + + 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; + + 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; + } + + // Add autoUpdate option + skeleton.updateWorldTransform(); + + if (renderer.newType) + { + sceneRenderer.begin(); + } + + // Draw the current skeleton + sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + + 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 object, so we end the batch + sceneRenderer.end(); + + renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline); + } +}; + +module.exports = SpineGameObjectWebGLRenderer; + + +/***/ }), + +/***/ "./runtimes/spine-webgl.js": +/*!*********************************!*\ + !*** ./runtimes/spine-webgl.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/*** IMPORTS FROM imports-loader ***/ +(function() { + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var spine; +(function (spine) { + var Animation = (function () { + function Animation(name, timelines, duration) { + if (name == null) + throw new Error("name cannot be null."); + if (timelines == null) + throw new Error("timelines cannot be null."); + this.name = name; + this.timelines = timelines; + this.duration = duration; + } + Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (loop && this.duration != 0) { + time %= this.duration; + if (lastTime > 0) + lastTime %= this.duration; + } + var timelines = this.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction); + }; + Animation.binarySearch = function (values, target, step) { + if (step === void 0) { step = 1; } + var low = 0; + var high = values.length / step - 2; + if (high == 0) + return step; + var current = high >>> 1; + while (true) { + if (values[(current + 1) * step] <= target) + low = current + 1; + else + high = current; + if (low == high) + return (low + 1) * step; + current = (low + high) >>> 1; + } + }; + Animation.linearSearch = function (values, target, step) { + for (var i = 0, last = values.length - step; i <= last; i += step) + if (values[i] > target) + return i; + return -1; + }; + return Animation; + }()); + spine.Animation = Animation; + var MixBlend; + (function (MixBlend) { + MixBlend[MixBlend["setup"] = 0] = "setup"; + MixBlend[MixBlend["first"] = 1] = "first"; + MixBlend[MixBlend["replace"] = 2] = "replace"; + MixBlend[MixBlend["add"] = 3] = "add"; + })(MixBlend = spine.MixBlend || (spine.MixBlend = {})); + var MixDirection; + (function (MixDirection) { + MixDirection[MixDirection["in"] = 0] = "in"; + MixDirection[MixDirection["out"] = 1] = "out"; + })(MixDirection = spine.MixDirection || (spine.MixDirection = {})); + var TimelineType; + (function (TimelineType) { + TimelineType[TimelineType["rotate"] = 0] = "rotate"; + TimelineType[TimelineType["translate"] = 1] = "translate"; + TimelineType[TimelineType["scale"] = 2] = "scale"; + TimelineType[TimelineType["shear"] = 3] = "shear"; + TimelineType[TimelineType["attachment"] = 4] = "attachment"; + TimelineType[TimelineType["color"] = 5] = "color"; + TimelineType[TimelineType["deform"] = 6] = "deform"; + TimelineType[TimelineType["event"] = 7] = "event"; + TimelineType[TimelineType["drawOrder"] = 8] = "drawOrder"; + TimelineType[TimelineType["ikConstraint"] = 9] = "ikConstraint"; + TimelineType[TimelineType["transformConstraint"] = 10] = "transformConstraint"; + TimelineType[TimelineType["pathConstraintPosition"] = 11] = "pathConstraintPosition"; + TimelineType[TimelineType["pathConstraintSpacing"] = 12] = "pathConstraintSpacing"; + TimelineType[TimelineType["pathConstraintMix"] = 13] = "pathConstraintMix"; + TimelineType[TimelineType["twoColor"] = 14] = "twoColor"; + })(TimelineType = spine.TimelineType || (spine.TimelineType = {})); + var CurveTimeline = (function () { + function CurveTimeline(frameCount) { + if (frameCount <= 0) + throw new Error("frameCount must be > 0: " + frameCount); + this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE); + } + CurveTimeline.prototype.getFrameCount = function () { + return this.curves.length / CurveTimeline.BEZIER_SIZE + 1; + }; + CurveTimeline.prototype.setLinear = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR; + }; + CurveTimeline.prototype.setStepped = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED; + }; + CurveTimeline.prototype.getCurveType = function (frameIndex) { + var index = frameIndex * CurveTimeline.BEZIER_SIZE; + if (index == this.curves.length) + return CurveTimeline.LINEAR; + var type = this.curves[index]; + if (type == CurveTimeline.LINEAR) + return CurveTimeline.LINEAR; + if (type == CurveTimeline.STEPPED) + return CurveTimeline.STEPPED; + return CurveTimeline.BEZIER; + }; + CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) { + var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03; + var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006; + var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy; + var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var curves = this.curves; + curves[i++] = CurveTimeline.BEZIER; + var x = dfx, y = dfy; + for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + curves[i] = x; + curves[i + 1] = y; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + x += dfx; + y += dfy; + } + }; + CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) { + percent = spine.MathUtils.clamp(percent, 0, 1); + var curves = this.curves; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var type = curves[i]; + if (type == CurveTimeline.LINEAR) + return percent; + if (type == CurveTimeline.STEPPED) + return 0; + i++; + var x = 0; + for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + x = curves[i]; + if (x >= percent) { + var prevX = void 0, prevY = void 0; + if (i == start) { + prevX = 0; + prevY = 0; + } + else { + prevX = curves[i - 2]; + prevY = curves[i - 1]; + } + return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); + } + } + var y = curves[i - 1]; + return y + (1 - y) * (percent - x) / (1 - x); + }; + CurveTimeline.LINEAR = 0; + CurveTimeline.STEPPED = 1; + CurveTimeline.BEZIER = 2; + CurveTimeline.BEZIER_SIZE = 10 * 2 - 1; + return CurveTimeline; + }()); + spine.CurveTimeline = CurveTimeline; + var RotateTimeline = (function (_super) { + __extends(RotateTimeline, _super); + function RotateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount << 1); + return _this; + } + RotateTimeline.prototype.getPropertyId = function () { + return (TimelineType.rotate << 24) + this.boneIndex; + }; + RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) { + frameIndex <<= 1; + this.frames[frameIndex] = time; + this.frames[frameIndex + RotateTimeline.ROTATION] = degrees; + }; + RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation; + return; + case MixBlend.first: + var r_1 = bone.data.rotation - bone.rotation; + bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha; + } + return; + } + if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { + var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION]; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + r_2 * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r_2 += bone.data.rotation - bone.rotation; + r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; + case MixBlend.add: + bone.rotation += r_2 * alpha; + } + return; + } + var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES); + var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime)); + var r = frames[frame + RotateTimeline.ROTATION] - prevRotation; + r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r += bone.data.rotation - bone.rotation; + case MixBlend.add: + bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + } + }; + RotateTimeline.ENTRIES = 2; + RotateTimeline.PREV_TIME = -2; + RotateTimeline.PREV_ROTATION = -1; + RotateTimeline.ROTATION = 1; + return RotateTimeline; + }(CurveTimeline)); + spine.RotateTimeline = RotateTimeline; + var TranslateTimeline = (function (_super) { + __extends(TranslateTimeline, _super); + function TranslateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES); + return _this; + } + TranslateTimeline.prototype.getPropertyId = function () { + return (TimelineType.translate << 24) + this.boneIndex; + }; + TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) { + frameIndex *= TranslateTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TranslateTimeline.X] = x; + this.frames[frameIndex + TranslateTimeline.Y] = y; + }; + TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x; + bone.y = bone.data.y; + return; + case MixBlend.first: + bone.x += (bone.data.x - bone.x) * alpha; + bone.y += (bone.data.y - bone.y) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { + x = frames[frames.length + TranslateTimeline.PREV_X]; + y = frames[frames.length + TranslateTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES); + x = frames[frame + TranslateTimeline.PREV_X]; + y = frames[frame + TranslateTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime)); + x += (frames[frame + TranslateTimeline.X] - x) * percent; + y += (frames[frame + TranslateTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x + x * alpha; + bone.y = bone.data.y + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.x += (bone.data.x + x - bone.x) * alpha; + bone.y += (bone.data.y + y - bone.y) * alpha; + break; + case MixBlend.add: + bone.x += x * alpha; + bone.y += y * alpha; + } + }; + TranslateTimeline.ENTRIES = 3; + TranslateTimeline.PREV_TIME = -3; + TranslateTimeline.PREV_X = -2; + TranslateTimeline.PREV_Y = -1; + TranslateTimeline.X = 1; + TranslateTimeline.Y = 2; + return TranslateTimeline; + }(CurveTimeline)); + spine.TranslateTimeline = TranslateTimeline; + var ScaleTimeline = (function (_super) { + __extends(ScaleTimeline, _super); + function ScaleTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ScaleTimeline.prototype.getPropertyId = function () { + return (TimelineType.scale << 24) + this.boneIndex; + }; + ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.scaleX = bone.data.scaleX; + bone.scaleY = bone.data.scaleY; + return; + case MixBlend.first: + bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha; + bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { + x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX; + y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY; + } + else { + var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES); + x = frames[frame + ScaleTimeline.PREV_X]; + y = frames[frame + ScaleTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime)); + x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX; + y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY; + } + if (alpha == 1) { + if (blend == MixBlend.add) { + bone.scaleX += x - bone.data.scaleX; + bone.scaleY += y - bone.data.scaleY; + } + else { + bone.scaleX = x; + bone.scaleY = y; + } + } + else { + var bx = 0, by = 0; + if (direction == MixDirection.out) { + switch (blend) { + case MixBlend.setup: + bx = bone.data.scaleX; + by = bone.data.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.add: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha; + } + } + else { + switch (blend) { + case MixBlend.setup: + bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.add: + bx = spine.MathUtils.signum(x); + by = spine.MathUtils.signum(y); + bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha; + bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha; + } + } + } + }; + return ScaleTimeline; + }(TranslateTimeline)); + spine.ScaleTimeline = ScaleTimeline; + var ShearTimeline = (function (_super) { + __extends(ShearTimeline, _super); + function ShearTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ShearTimeline.prototype.getPropertyId = function () { + return (TimelineType.shear << 24) + this.boneIndex; + }; + ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX; + bone.shearY = bone.data.shearY; + return; + case MixBlend.first: + bone.shearX += (bone.data.shearX - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY - bone.shearY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { + x = frames[frames.length + ShearTimeline.PREV_X]; + y = frames[frames.length + ShearTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES); + x = frames[frame + ShearTimeline.PREV_X]; + y = frames[frame + ShearTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime)); + x = x + (frames[frame + ShearTimeline.X] - x) * percent; + y = y + (frames[frame + ShearTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX + x * alpha; + bone.shearY = bone.data.shearY + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha; + break; + case MixBlend.add: + bone.shearX += x * alpha; + bone.shearY += y * alpha; + } + }; + return ShearTimeline; + }(TranslateTimeline)); + spine.ShearTimeline = ShearTimeline; + var ColorTimeline = (function (_super) { + __extends(ColorTimeline, _super); + function ColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES); + return _this; + } + ColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.color << 24) + this.slotIndex; + }; + ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) { + frameIndex *= ColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + ColorTimeline.R] = r; + this.frames[frameIndex + ColorTimeline.G] = g; + this.frames[frameIndex + ColorTimeline.B] = b; + this.frames[frameIndex + ColorTimeline.A] = a; + }; + ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + return; + case MixBlend.first: + var color = slot.color, setup = slot.data.color; + color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha); + } + return; + } + var r = 0, g = 0, b = 0, a = 0; + if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + ColorTimeline.PREV_R]; + g = frames[i + ColorTimeline.PREV_G]; + b = frames[i + ColorTimeline.PREV_B]; + a = frames[i + ColorTimeline.PREV_A]; + } + else { + var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES); + r = frames[frame + ColorTimeline.PREV_R]; + g = frames[frame + ColorTimeline.PREV_G]; + b = frames[frame + ColorTimeline.PREV_B]; + a = frames[frame + ColorTimeline.PREV_A]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + ColorTimeline.R] - r) * percent; + g += (frames[frame + ColorTimeline.G] - g) * percent; + b += (frames[frame + ColorTimeline.B] - b) * percent; + a += (frames[frame + ColorTimeline.A] - a) * percent; + } + if (alpha == 1) + slot.color.set(r, g, b, a); + else { + var color = slot.color; + if (blend == MixBlend.setup) + color.setFromColor(slot.data.color); + color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); + } + }; + ColorTimeline.ENTRIES = 5; + ColorTimeline.PREV_TIME = -5; + ColorTimeline.PREV_R = -4; + ColorTimeline.PREV_G = -3; + ColorTimeline.PREV_B = -2; + ColorTimeline.PREV_A = -1; + ColorTimeline.R = 1; + ColorTimeline.G = 2; + ColorTimeline.B = 3; + ColorTimeline.A = 4; + return ColorTimeline; + }(CurveTimeline)); + spine.ColorTimeline = ColorTimeline; + var TwoColorTimeline = (function (_super) { + __extends(TwoColorTimeline, _super); + function TwoColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES); + return _this; + } + TwoColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.twoColor << 24) + this.slotIndex; + }; + TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) { + frameIndex *= TwoColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TwoColorTimeline.R] = r; + this.frames[frameIndex + TwoColorTimeline.G] = g; + this.frames[frameIndex + TwoColorTimeline.B] = b; + this.frames[frameIndex + TwoColorTimeline.A] = a; + this.frames[frameIndex + TwoColorTimeline.R2] = r2; + this.frames[frameIndex + TwoColorTimeline.G2] = g2; + this.frames[frameIndex + TwoColorTimeline.B2] = b2; + }; + TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + slot.darkColor.setFromColor(slot.data.darkColor); + return; + case MixBlend.first: + var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor; + light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha); + dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0); + } + return; + } + var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; + if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + TwoColorTimeline.PREV_R]; + g = frames[i + TwoColorTimeline.PREV_G]; + b = frames[i + TwoColorTimeline.PREV_B]; + a = frames[i + TwoColorTimeline.PREV_A]; + r2 = frames[i + TwoColorTimeline.PREV_R2]; + g2 = frames[i + TwoColorTimeline.PREV_G2]; + b2 = frames[i + TwoColorTimeline.PREV_B2]; + } + else { + var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES); + r = frames[frame + TwoColorTimeline.PREV_R]; + g = frames[frame + TwoColorTimeline.PREV_G]; + b = frames[frame + TwoColorTimeline.PREV_B]; + a = frames[frame + TwoColorTimeline.PREV_A]; + r2 = frames[frame + TwoColorTimeline.PREV_R2]; + g2 = frames[frame + TwoColorTimeline.PREV_G2]; + b2 = frames[frame + TwoColorTimeline.PREV_B2]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + TwoColorTimeline.R] - r) * percent; + g += (frames[frame + TwoColorTimeline.G] - g) * percent; + b += (frames[frame + TwoColorTimeline.B] - b) * percent; + a += (frames[frame + TwoColorTimeline.A] - a) * percent; + r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent; + g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent; + b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent; + } + if (alpha == 1) { + slot.color.set(r, g, b, a); + slot.darkColor.set(r2, g2, b2, 1); + } + else { + var light = slot.color, dark = slot.darkColor; + if (blend == MixBlend.setup) { + light.setFromColor(slot.data.color); + dark.setFromColor(slot.data.darkColor); + } + light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); + dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0); + } + }; + TwoColorTimeline.ENTRIES = 8; + TwoColorTimeline.PREV_TIME = -8; + TwoColorTimeline.PREV_R = -7; + TwoColorTimeline.PREV_G = -6; + TwoColorTimeline.PREV_B = -5; + TwoColorTimeline.PREV_A = -4; + TwoColorTimeline.PREV_R2 = -3; + TwoColorTimeline.PREV_G2 = -2; + TwoColorTimeline.PREV_B2 = -1; + TwoColorTimeline.R = 1; + TwoColorTimeline.G = 2; + TwoColorTimeline.B = 3; + TwoColorTimeline.A = 4; + TwoColorTimeline.R2 = 5; + TwoColorTimeline.G2 = 6; + TwoColorTimeline.B2 = 7; + return TwoColorTimeline; + }(CurveTimeline)); + spine.TwoColorTimeline = TwoColorTimeline; + var AttachmentTimeline = (function () { + function AttachmentTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.attachmentNames = new Array(frameCount); + } + AttachmentTimeline.prototype.getPropertyId = function () { + return (TimelineType.attachment << 24) + this.slotIndex; + }; + AttachmentTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) { + this.frames[frameIndex] = time; + this.attachmentNames[frameIndex] = attachmentName; + }; + AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + if (direction == MixDirection.out && blend == MixBlend.setup) { + var attachmentName_1 = slot.data.attachmentName; + slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1)); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) { + var attachmentName_2 = slot.data.attachmentName; + slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2)); + } + return; + } + var frameIndex = 0; + if (time >= frames[frames.length - 1]) + frameIndex = frames.length - 1; + else + frameIndex = Animation.binarySearch(frames, time, 1) - 1; + var attachmentName = this.attachmentNames[frameIndex]; + skeleton.slots[this.slotIndex] + .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); + }; + return AttachmentTimeline; + }()); + spine.AttachmentTimeline = AttachmentTimeline; + var zeros = null; + var DeformTimeline = (function (_super) { + __extends(DeformTimeline, _super); + function DeformTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount); + _this.frameVertices = new Array(frameCount); + if (zeros == null) + zeros = spine.Utils.newFloatArray(64); + return _this; + } + DeformTimeline.prototype.getPropertyId = function () { + return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex; + }; + DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) { + this.frames[frameIndex] = time; + this.frameVertices[frameIndex] = vertices; + }; + DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var slotAttachment = slot.getAttachment(); + if (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment)) + return; + var verticesArray = slot.attachmentVertices; + if (verticesArray.length == 0) + blend = MixBlend.setup; + var frameVertices = this.frameVertices; + var vertexCount = frameVertices[0].length; + var frames = this.frames; + if (time < frames[0]) { + var vertexAttachment = slotAttachment; + switch (blend) { + case MixBlend.setup: + verticesArray.length = 0; + return; + case MixBlend.first: + if (alpha == 1) { + verticesArray.length = 0; + break; + } + var vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount); + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha; + } + else { + alpha = 1 - alpha; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] *= alpha; + } + } + return; + } + var vertices = spine.Utils.setArraySize(verticesArray, vertexCount); + if (time >= frames[frames.length - 1]) { + var lastVertices = frameVertices[frames.length - 1]; + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_1 = 0; i_1 < vertexCount; i_1++) { + vertices[i_1] += lastVertices[i_1] - setupVertices[i_1]; + } + } + else { + for (var i_2 = 0; i_2 < vertexCount; i_2++) + vertices[i_2] += lastVertices[i_2]; + } + } + else { + spine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount); + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_1 = slotAttachment; + if (vertexAttachment_1.bones == null) { + var setupVertices = vertexAttachment_1.vertices; + for (var i_3 = 0; i_3 < vertexCount; i_3++) { + var setup = setupVertices[i_3]; + vertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha; + } + } + else { + for (var i_4 = 0; i_4 < vertexCount; i_4++) + vertices[i_4] = lastVertices[i_4] * alpha; + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_5 = 0; i_5 < vertexCount; i_5++) + vertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_6 = 0; i_6 < vertexCount; i_6++) { + vertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha; + } + } + else { + for (var i_7 = 0; i_7 < vertexCount; i_7++) + vertices[i_7] += lastVertices[i_7] * alpha; + } + } + } + return; + } + var frame = Animation.binarySearch(frames, time); + var prevVertices = frameVertices[frame - 1]; + var nextVertices = frameVertices[frame]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime)); + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_8 = 0; i_8 < vertexCount; i_8++) { + var prev = prevVertices[i_8]; + vertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8]; + } + } + else { + for (var i_9 = 0; i_9 < vertexCount; i_9++) { + var prev = prevVertices[i_9]; + vertices[i_9] += prev + (nextVertices[i_9] - prev) * percent; + } + } + } + else { + for (var i_10 = 0; i_10 < vertexCount; i_10++) { + var prev = prevVertices[i_10]; + vertices[i_10] = prev + (nextVertices[i_10] - prev) * percent; + } + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_2 = slotAttachment; + if (vertexAttachment_2.bones == null) { + var setupVertices = vertexAttachment_2.vertices; + for (var i_11 = 0; i_11 < vertexCount; i_11++) { + var prev = prevVertices[i_11], setup = setupVertices[i_11]; + vertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha; + } + } + else { + for (var i_12 = 0; i_12 < vertexCount; i_12++) { + var prev = prevVertices[i_12]; + vertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha; + } + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_13 = 0; i_13 < vertexCount; i_13++) { + var prev = prevVertices[i_13]; + vertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha; + } + break; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_14 = 0; i_14 < vertexCount; i_14++) { + var prev = prevVertices[i_14]; + vertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha; + } + } + else { + for (var i_15 = 0; i_15 < vertexCount; i_15++) { + var prev = prevVertices[i_15]; + vertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha; + } + } + } + } + }; + return DeformTimeline; + }(CurveTimeline)); + spine.DeformTimeline = DeformTimeline; + var EventTimeline = (function () { + function EventTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.events = new Array(frameCount); + } + EventTimeline.prototype.getPropertyId = function () { + return TimelineType.event << 24; + }; + EventTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + EventTimeline.prototype.setFrame = function (frameIndex, event) { + this.frames[frameIndex] = event.time; + this.events[frameIndex] = event; + }; + EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + if (firedEvents == null) + return; + var frames = this.frames; + var frameCount = this.frames.length; + if (lastTime > time) { + this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction); + lastTime = -1; + } + else if (lastTime >= frames[frameCount - 1]) + return; + if (time < frames[0]) + return; + var frame = 0; + if (lastTime < frames[0]) + frame = 0; + else { + frame = Animation.binarySearch(frames, lastTime); + var frameTime = frames[frame]; + while (frame > 0) { + if (frames[frame - 1] != frameTime) + break; + frame--; + } + } + for (; frame < frameCount && time >= frames[frame]; frame++) + firedEvents.push(this.events[frame]); + }; + return EventTimeline; + }()); + spine.EventTimeline = EventTimeline; + var DrawOrderTimeline = (function () { + function DrawOrderTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.drawOrders = new Array(frameCount); + } + DrawOrderTimeline.prototype.getPropertyId = function () { + return TimelineType.drawOrder << 24; + }; + DrawOrderTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) { + this.frames[frameIndex] = time; + this.drawOrders[frameIndex] = drawOrder; + }; + DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var drawOrder = skeleton.drawOrder; + var slots = skeleton.slots; + if (direction == MixDirection.out && blend == MixBlend.setup) { + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frame = 0; + if (time >= frames[frames.length - 1]) + frame = frames.length - 1; + else + frame = Animation.binarySearch(frames, time) - 1; + var drawOrderToSetupIndex = this.drawOrders[frame]; + if (drawOrderToSetupIndex == null) + spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length); + else { + for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) + drawOrder[i] = slots[drawOrderToSetupIndex[i]]; + } + }; + return DrawOrderTimeline; + }()); + spine.DrawOrderTimeline = DrawOrderTimeline; + var IkConstraintTimeline = (function (_super) { + __extends(IkConstraintTimeline, _super); + function IkConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES); + return _this; + } + IkConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex; + }; + IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) { + frameIndex *= IkConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + IkConstraintTimeline.MIX] = mix; + this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection; + this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0; + this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0; + }; + IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.ikConstraints[this.ikConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + return; + case MixBlend.first: + constraint.mix += (constraint.data.mix - constraint.mix) * alpha; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + return; + } + if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + return; + } + var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES); + var mix = frames[frame + IkConstraintTimeline.PREV_MIX]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime)); + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + }; + IkConstraintTimeline.ENTRIES = 5; + IkConstraintTimeline.PREV_TIME = -5; + IkConstraintTimeline.PREV_MIX = -4; + IkConstraintTimeline.PREV_BEND_DIRECTION = -3; + IkConstraintTimeline.PREV_COMPRESS = -2; + IkConstraintTimeline.PREV_STRETCH = -1; + IkConstraintTimeline.MIX = 1; + IkConstraintTimeline.BEND_DIRECTION = 2; + IkConstraintTimeline.COMPRESS = 3; + IkConstraintTimeline.STRETCH = 4; + return IkConstraintTimeline; + }(CurveTimeline)); + spine.IkConstraintTimeline = IkConstraintTimeline; + var TransformConstraintTimeline = (function (_super) { + __extends(TransformConstraintTimeline, _super); + function TransformConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES); + return _this; + } + TransformConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex; + }; + TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) { + frameIndex *= TransformConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix; + this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix; + this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix; + }; + TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.transformConstraints[this.transformConstraintIndex]; + if (time < frames[0]) { + var data = constraint.data; + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + return; + case MixBlend.first: + constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha; + constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha; + constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha; + } + return; + } + var rotate = 0, translate = 0, scale = 0, shear = 0; + if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { + var i = frames.length; + rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[i + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[i + TransformConstraintTimeline.PREV_SHEAR]; + } + else { + var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES); + rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[frame + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent; + scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent; + shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent; + } + if (blend == MixBlend.setup) { + var data = constraint.data; + constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha; + constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha; + constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha; + constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + constraint.scaleMix += (scale - constraint.scaleMix) * alpha; + constraint.shearMix += (shear - constraint.shearMix) * alpha; + } + }; + TransformConstraintTimeline.ENTRIES = 5; + TransformConstraintTimeline.PREV_TIME = -5; + TransformConstraintTimeline.PREV_ROTATE = -4; + TransformConstraintTimeline.PREV_TRANSLATE = -3; + TransformConstraintTimeline.PREV_SCALE = -2; + TransformConstraintTimeline.PREV_SHEAR = -1; + TransformConstraintTimeline.ROTATE = 1; + TransformConstraintTimeline.TRANSLATE = 2; + TransformConstraintTimeline.SCALE = 3; + TransformConstraintTimeline.SHEAR = 4; + return TransformConstraintTimeline; + }(CurveTimeline)); + spine.TransformConstraintTimeline = TransformConstraintTimeline; + var PathConstraintPositionTimeline = (function (_super) { + __extends(PathConstraintPositionTimeline, _super); + function PathConstraintPositionTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES); + return _this; + } + PathConstraintPositionTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex; + }; + PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) { + frameIndex *= PathConstraintPositionTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value; + }; + PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.position = constraint.data.position; + return; + case MixBlend.first: + constraint.position += (constraint.data.position - constraint.position) * alpha; + } + return; + } + var position = 0; + if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) + position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES); + position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime)); + position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent; + } + if (blend == MixBlend.setup) + constraint.position = constraint.data.position + (position - constraint.data.position) * alpha; + else + constraint.position += (position - constraint.position) * alpha; + }; + PathConstraintPositionTimeline.ENTRIES = 2; + PathConstraintPositionTimeline.PREV_TIME = -2; + PathConstraintPositionTimeline.PREV_VALUE = -1; + PathConstraintPositionTimeline.VALUE = 1; + return PathConstraintPositionTimeline; + }(CurveTimeline)); + spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline; + var PathConstraintSpacingTimeline = (function (_super) { + __extends(PathConstraintSpacingTimeline, _super); + function PathConstraintSpacingTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + PathConstraintSpacingTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex; + }; + PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.spacing = constraint.data.spacing; + return; + case MixBlend.first: + constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha; + } + return; + } + var spacing = 0; + if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) + spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES); + spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime)); + spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent; + } + if (blend == MixBlend.setup) + constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha; + else + constraint.spacing += (spacing - constraint.spacing) * alpha; + }; + return PathConstraintSpacingTimeline; + }(PathConstraintPositionTimeline)); + spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline; + var PathConstraintMixTimeline = (function (_super) { + __extends(PathConstraintMixTimeline, _super); + function PathConstraintMixTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES); + return _this; + } + PathConstraintMixTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex; + }; + PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) { + frameIndex *= PathConstraintMixTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix; + }; + PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = constraint.data.rotateMix; + constraint.translateMix = constraint.data.translateMix; + return; + case MixBlend.first: + constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha; + } + return; + } + var rotate = 0, translate = 0; + if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { + rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE]; + } + else { + var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES); + rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent; + } + if (blend == MixBlend.setup) { + constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha; + constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + } + }; + PathConstraintMixTimeline.ENTRIES = 3; + PathConstraintMixTimeline.PREV_TIME = -3; + PathConstraintMixTimeline.PREV_ROTATE = -2; + PathConstraintMixTimeline.PREV_TRANSLATE = -1; + PathConstraintMixTimeline.ROTATE = 1; + PathConstraintMixTimeline.TRANSLATE = 2; + return PathConstraintMixTimeline; + }(CurveTimeline)); + spine.PathConstraintMixTimeline = PathConstraintMixTimeline; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationState = (function () { + function AnimationState(data) { + this.tracks = new Array(); + this.events = new Array(); + this.listeners = new Array(); + this.queue = new EventQueue(this); + this.propertyIDs = new spine.IntSet(); + this.animationsChanged = false; + this.timeScale = 1; + this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); }); + this.data = data; + } + AnimationState.prototype.update = function (delta) { + delta *= this.timeScale; + var tracks = this.tracks; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null) + continue; + current.animationLast = current.nextAnimationLast; + current.trackLast = current.nextTrackLast; + var currentDelta = delta * current.timeScale; + if (current.delay > 0) { + current.delay -= currentDelta; + if (current.delay > 0) + continue; + currentDelta = -current.delay; + current.delay = 0; + } + var next = current.next; + if (next != null) { + var nextTime = current.trackLast - next.delay; + if (nextTime >= 0) { + next.delay = 0; + next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; + current.trackTime += currentDelta; + this.setCurrent(i, next, true); + while (next.mixingFrom != null) { + next.mixTime += delta; + next = next.mixingFrom; + } + continue; + } + } + else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) { + tracks[i] = null; + this.queue.end(current); + this.disposeNext(current); + continue; + } + if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) { + var from = current.mixingFrom; + current.mixingFrom = null; + if (from != null) + from.mixingTo = null; + while (from != null) { + this.queue.end(from); + from = from.mixingFrom; + } + } + current.trackTime += currentDelta; + } + this.queue.drain(); + }; + AnimationState.prototype.updateMixingFrom = function (to, delta) { + var from = to.mixingFrom; + if (from == null) + return true; + var finished = this.updateMixingFrom(from, delta); + from.animationLast = from.nextAnimationLast; + from.trackLast = from.nextTrackLast; + if (to.mixTime > 0 && to.mixTime >= to.mixDuration) { + if (from.totalAlpha == 0 || to.mixDuration == 0) { + to.mixingFrom = from.mixingFrom; + if (from.mixingFrom != null) + from.mixingFrom.mixingTo = to; + to.interruptAlpha = from.interruptAlpha; + this.queue.end(from); + } + return finished; + } + from.trackTime += delta * from.timeScale; + to.mixTime += delta; + return false; + }; + AnimationState.prototype.apply = function (skeleton) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (this.animationsChanged) + this._animationsChanged(); + var events = this.events; + var tracks = this.tracks; + var applied = false; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null || current.delay > 0) + continue; + applied = true; + var blend = i == 0 ? spine.MixBlend.first : current.mixBlend; + var mix = current.alpha; + if (current.mixingFrom != null) + mix *= this.applyMixingFrom(current, skeleton, blend); + else if (current.trackTime >= current.trackEnd && current.next == null) + mix = 0; + var animationLast = current.animationLast, animationTime = current.getAnimationTime(); + var timelineCount = current.animation.timelines.length; + var timelines = current.animation.timelines; + if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) { + for (var ii = 0; ii < timelineCount; ii++) + timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]); + } + else { + var timelineMode = current.timelineMode; + var firstFrame = current.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = current.timelinesRotation; + for (var ii = 0; ii < timelineCount; ii++) { + var timeline = timelines[ii]; + var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup; + if (timeline instanceof spine.RotateTimeline) { + this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame); + } + else { + spine.Utils.webkit602BugfixHelper(mix, blend); + timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]); + } + } + } + this.queueEvents(current, animationTime); + events.length = 0; + current.nextAnimationLast = animationTime; + current.nextTrackLast = current.trackTime; + } + this.queue.drain(); + return applied; + }; + AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) { + var from = to.mixingFrom; + if (from.mixingFrom != null) + this.applyMixingFrom(from, skeleton, blend); + var mix = 0; + if (to.mixDuration == 0) { + mix = 1; + if (blend == spine.MixBlend.first) + blend = spine.MixBlend.setup; + } + else { + mix = to.mixTime / to.mixDuration; + if (mix > 1) + mix = 1; + if (blend != spine.MixBlend.first) + blend = from.mixBlend; + } + var events = mix < from.eventThreshold ? this.events : null; + var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold; + var animationLast = from.animationLast, animationTime = from.getAnimationTime(); + var timelineCount = from.animation.timelines.length; + var timelines = from.animation.timelines; + var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); + if (blend == spine.MixBlend.add) { + for (var i = 0; i < timelineCount; i++) + timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out); + } + else { + var timelineMode = from.timelineMode; + var timelineHoldMix = from.timelineHoldMix; + var firstFrame = from.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = from.timelinesRotation; + from.totalAlpha = 0; + for (var i = 0; i < timelineCount; i++) { + var timeline = timelines[i]; + var direction = spine.MixDirection.out; + var timelineBlend = void 0; + var alpha = 0; + switch (timelineMode[i]) { + case AnimationState.SUBSEQUENT: + if (!attachments && timeline instanceof spine.AttachmentTimeline) + continue; + if (!drawOrder && timeline instanceof spine.DrawOrderTimeline) + continue; + timelineBlend = blend; + alpha = alphaMix; + break; + case AnimationState.FIRST: + timelineBlend = spine.MixBlend.setup; + alpha = alphaMix; + break; + case AnimationState.HOLD: + timelineBlend = spine.MixBlend.setup; + alpha = alphaHold; + break; + default: + timelineBlend = spine.MixBlend.setup; + var holdMix = timelineHoldMix[i]; + alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); + break; + } + from.totalAlpha += alpha; + if (timeline instanceof spine.RotateTimeline) + this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame); + else { + spine.Utils.webkit602BugfixHelper(alpha, blend); + if (timelineBlend == spine.MixBlend.setup) { + if (timeline instanceof spine.AttachmentTimeline) { + if (attachments) + direction = spine.MixDirection.out; + } + else if (timeline instanceof spine.DrawOrderTimeline) { + if (drawOrder) + direction = spine.MixDirection.out; + } + } + timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction); + } + } + } + if (to.mixDuration > 0) + this.queueEvents(from, animationTime); + this.events.length = 0; + from.nextAnimationLast = animationTime; + from.nextTrackLast = from.trackTime; + return mix; + }; + AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { + if (firstFrame) + timelinesRotation[i] = 0; + if (alpha == 1) { + timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]); + return; + } + var rotateTimeline = timeline; + var frames = rotateTimeline.frames; + var bone = skeleton.bones[rotateTimeline.boneIndex]; + var r1 = 0, r2 = 0; + if (time < frames[0]) { + switch (blend) { + case spine.MixBlend.setup: + bone.rotation = bone.data.rotation; + default: + return; + case spine.MixBlend.first: + r1 = bone.rotation; + r2 = bone.data.rotation; + } + } + else { + r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation; + if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES]) + r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION]; + else { + var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES); + var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime)); + r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + r2 = prevRotation + r2 * percent + bone.data.rotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + } + } + var total = 0, diff = r2 - r1; + diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360; + if (diff == 0) { + total = timelinesRotation[i]; + } + else { + var lastTotal = 0, lastDiff = 0; + if (firstFrame) { + lastTotal = 0; + lastDiff = diff; + } + else { + lastTotal = timelinesRotation[i]; + lastDiff = timelinesRotation[i + 1]; + } + var current = diff > 0, dir = lastTotal >= 0; + if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) { + if (Math.abs(lastTotal) > 180) + lastTotal += 360 * spine.MathUtils.signum(lastTotal); + dir = current; + } + total = diff + lastTotal - lastTotal % 360; + if (dir != current) + total += 360 * spine.MathUtils.signum(lastTotal); + timelinesRotation[i] = total; + } + timelinesRotation[i + 1] = diff; + r1 += total * alpha; + bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360; + }; + AnimationState.prototype.queueEvents = function (entry, animationTime) { + var animationStart = entry.animationStart, animationEnd = entry.animationEnd; + var duration = animationEnd - animationStart; + var trackLastWrapped = entry.trackLast % duration; + var events = this.events; + var i = 0, n = events.length; + for (; i < n; i++) { + var event_1 = events[i]; + if (event_1.time < trackLastWrapped) + break; + if (event_1.time > animationEnd) + continue; + this.queue.event(entry, event_1); + } + var complete = false; + if (entry.loop) + complete = duration == 0 || trackLastWrapped > entry.trackTime % duration; + else + complete = animationTime >= animationEnd && entry.animationLast < animationEnd; + if (complete) + this.queue.complete(entry); + for (; i < n; i++) { + var event_2 = events[i]; + if (event_2.time < animationStart) + continue; + this.queue.event(entry, events[i]); + } + }; + AnimationState.prototype.clearTracks = function () { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) + this.clearTrack(i); + this.tracks.length = 0; + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.clearTrack = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return; + var current = this.tracks[trackIndex]; + if (current == null) + return; + this.queue.end(current); + this.disposeNext(current); + var entry = current; + while (true) { + var from = entry.mixingFrom; + if (from == null) + break; + this.queue.end(from); + entry.mixingFrom = null; + entry.mixingTo = null; + entry = from; + } + this.tracks[current.trackIndex] = null; + this.queue.drain(); + }; + AnimationState.prototype.setCurrent = function (index, current, interrupt) { + var from = this.expandToIndex(index); + this.tracks[index] = current; + if (from != null) { + if (interrupt) + this.queue.interrupt(from); + current.mixingFrom = from; + from.mixingTo = current; + current.mixTime = 0; + if (from.mixingFrom != null && from.mixDuration > 0) + current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); + from.timelinesRotation.length = 0; + } + this.queue.start(current); + }; + AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.setAnimationWith(trackIndex, animation, loop); + }; + AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) { + if (animation == null) + throw new Error("animation cannot be null."); + var interrupt = true; + var current = this.expandToIndex(trackIndex); + if (current != null) { + if (current.nextTrackLast == -1) { + this.tracks[trackIndex] = current.mixingFrom; + this.queue.interrupt(current); + this.queue.end(current); + this.disposeNext(current); + current = current.mixingFrom; + interrupt = false; + } + else + this.disposeNext(current); + } + var entry = this.trackEntry(trackIndex, animation, loop, current); + this.setCurrent(trackIndex, entry, interrupt); + this.queue.drain(); + return entry; + }; + AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.addAnimationWith(trackIndex, animation, loop, delay); + }; + AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) { + if (animation == null) + throw new Error("animation cannot be null."); + var last = this.expandToIndex(trackIndex); + if (last != null) { + while (last.next != null) + last = last.next; + } + var entry = this.trackEntry(trackIndex, animation, loop, last); + if (last == null) { + this.setCurrent(trackIndex, entry, true); + this.queue.drain(); + } + else { + last.next = entry; + if (delay <= 0) { + var duration = last.animationEnd - last.animationStart; + if (duration != 0) { + if (last.loop) + delay += duration * (1 + ((last.trackTime / duration) | 0)); + else + delay += Math.max(duration, last.trackTime); + delay -= this.data.getMix(last.animation, animation); + } + else + delay = last.trackTime; + } + } + entry.delay = delay; + return entry; + }; + AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) { + var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) { + if (delay <= 0) + delay -= mixDuration; + var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.setEmptyAnimations = function (mixDuration) { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) { + var current = this.tracks[i]; + if (current != null) + this.setEmptyAnimation(current.trackIndex, mixDuration); + } + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.expandToIndex = function (index) { + if (index < this.tracks.length) + return this.tracks[index]; + spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null); + this.tracks.length = index + 1; + return null; + }; + AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) { + var entry = this.trackEntryPool.obtain(); + entry.trackIndex = trackIndex; + entry.animation = animation; + entry.loop = loop; + entry.holdPrevious = false; + entry.eventThreshold = 0; + entry.attachmentThreshold = 0; + entry.drawOrderThreshold = 0; + entry.animationStart = 0; + entry.animationEnd = animation.duration; + entry.animationLast = -1; + entry.nextAnimationLast = -1; + entry.delay = 0; + entry.trackTime = 0; + entry.trackLast = -1; + entry.nextTrackLast = -1; + entry.trackEnd = Number.MAX_VALUE; + entry.timeScale = 1; + entry.alpha = 1; + entry.interruptAlpha = 1; + entry.mixTime = 0; + entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); + return entry; + }; + AnimationState.prototype.disposeNext = function (entry) { + var next = entry.next; + while (next != null) { + this.queue.dispose(next); + next = next.next; + } + entry.next = null; + }; + AnimationState.prototype._animationsChanged = function () { + this.animationsChanged = false; + this.propertyIDs.clear(); + for (var i = 0, n = this.tracks.length; i < n; i++) { + var entry = this.tracks[i]; + if (entry == null) + continue; + while (entry.mixingFrom != null) + entry = entry.mixingFrom; + do { + if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add) + this.setTimelineModes(entry); + entry = entry.mixingTo; + } while (entry != null); + } + }; + AnimationState.prototype.setTimelineModes = function (entry) { + var to = entry.mixingTo; + var timelines = entry.animation.timelines; + var timelinesCount = entry.animation.timelines.length; + var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount); + entry.timelineHoldMix.length = 0; + var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount); + var propertyIDs = this.propertyIDs; + if (to != null && to.holdPrevious) { + for (var i = 0; i < timelinesCount; i++) { + propertyIDs.add(timelines[i].getPropertyId()); + timelineMode[i] = AnimationState.HOLD; + } + return; + } + outer: for (var i = 0; i < timelinesCount; i++) { + var id = timelines[i].getPropertyId(); + if (!propertyIDs.add(id)) + timelineMode[i] = AnimationState.SUBSEQUENT; + else if (to == null || !this.hasTimeline(to, id)) + timelineMode[i] = AnimationState.FIRST; + else { + for (var next = to.mixingTo; next != null; next = next.mixingTo) { + if (this.hasTimeline(next, id)) + continue; + if (entry.mixDuration > 0) { + timelineMode[i] = AnimationState.HOLD_MIX; + timelineDipMix[i] = next; + continue outer; + } + break; + } + timelineMode[i] = AnimationState.HOLD; + } + } + }; + AnimationState.prototype.hasTimeline = function (entry, id) { + var timelines = entry.animation.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + if (timelines[i].getPropertyId() == id) + return true; + return false; + }; + AnimationState.prototype.getCurrent = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return null; + return this.tracks[trackIndex]; + }; + AnimationState.prototype.addListener = function (listener) { + if (listener == null) + throw new Error("listener cannot be null."); + this.listeners.push(listener); + }; + AnimationState.prototype.removeListener = function (listener) { + var index = this.listeners.indexOf(listener); + if (index >= 0) + this.listeners.splice(index, 1); + }; + AnimationState.prototype.clearListeners = function () { + this.listeners.length = 0; + }; + AnimationState.prototype.clearListenerNotifications = function () { + this.queue.clear(); + }; + AnimationState.emptyAnimation = new spine.Animation("", [], 0); + AnimationState.SUBSEQUENT = 0; + AnimationState.FIRST = 1; + AnimationState.HOLD = 2; + AnimationState.HOLD_MIX = 3; + return AnimationState; + }()); + spine.AnimationState = AnimationState; + var TrackEntry = (function () { + function TrackEntry() { + this.mixBlend = spine.MixBlend.replace; + this.timelineMode = new Array(); + this.timelineHoldMix = new Array(); + this.timelinesRotation = new Array(); + } + TrackEntry.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; + }; + TrackEntry.prototype.getAnimationTime = function () { + if (this.loop) { + var duration = this.animationEnd - this.animationStart; + if (duration == 0) + return this.animationStart; + return (this.trackTime % duration) + this.animationStart; + } + return Math.min(this.trackTime + this.animationStart, this.animationEnd); + }; + TrackEntry.prototype.setAnimationLast = function (animationLast) { + this.animationLast = animationLast; + this.nextAnimationLast = animationLast; + }; + TrackEntry.prototype.isComplete = function () { + return this.trackTime >= this.animationEnd - this.animationStart; + }; + TrackEntry.prototype.resetRotationDirections = function () { + this.timelinesRotation.length = 0; + }; + return TrackEntry; + }()); + spine.TrackEntry = TrackEntry; + var EventQueue = (function () { + function EventQueue(animState) { + this.objects = []; + this.drainDisabled = false; + this.animState = animState; + } + EventQueue.prototype.start = function (entry) { + this.objects.push(EventType.start); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.interrupt = function (entry) { + this.objects.push(EventType.interrupt); + this.objects.push(entry); + }; + EventQueue.prototype.end = function (entry) { + this.objects.push(EventType.end); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.dispose = function (entry) { + this.objects.push(EventType.dispose); + this.objects.push(entry); + }; + EventQueue.prototype.complete = function (entry) { + this.objects.push(EventType.complete); + this.objects.push(entry); + }; + EventQueue.prototype.event = function (entry, event) { + this.objects.push(EventType.event); + this.objects.push(entry); + this.objects.push(event); + }; + EventQueue.prototype.drain = function () { + if (this.drainDisabled) + return; + this.drainDisabled = true; + var objects = this.objects; + var listeners = this.animState.listeners; + for (var i = 0; i < objects.length; i += 2) { + var type = objects[i]; + var entry = objects[i + 1]; + switch (type) { + case EventType.start: + if (entry.listener != null && entry.listener.start) + entry.listener.start(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].start) + listeners[ii].start(entry); + break; + case EventType.interrupt: + if (entry.listener != null && entry.listener.interrupt) + entry.listener.interrupt(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].interrupt) + listeners[ii].interrupt(entry); + break; + case EventType.end: + if (entry.listener != null && entry.listener.end) + entry.listener.end(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].end) + listeners[ii].end(entry); + case EventType.dispose: + if (entry.listener != null && entry.listener.dispose) + entry.listener.dispose(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].dispose) + listeners[ii].dispose(entry); + this.animState.trackEntryPool.free(entry); + break; + case EventType.complete: + if (entry.listener != null && entry.listener.complete) + entry.listener.complete(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].complete) + listeners[ii].complete(entry); + break; + case EventType.event: + var event_3 = objects[i++ + 2]; + if (entry.listener != null && entry.listener.event) + entry.listener.event(entry, event_3); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].event) + listeners[ii].event(entry, event_3); + break; + } + } + this.clear(); + this.drainDisabled = false; + }; + EventQueue.prototype.clear = function () { + this.objects.length = 0; + }; + return EventQueue; + }()); + spine.EventQueue = EventQueue; + var EventType; + (function (EventType) { + EventType[EventType["start"] = 0] = "start"; + EventType[EventType["interrupt"] = 1] = "interrupt"; + EventType[EventType["end"] = 2] = "end"; + EventType[EventType["dispose"] = 3] = "dispose"; + EventType[EventType["complete"] = 4] = "complete"; + EventType[EventType["event"] = 5] = "event"; + })(EventType = spine.EventType || (spine.EventType = {})); + var AnimationStateAdapter2 = (function () { + function AnimationStateAdapter2() { + } + AnimationStateAdapter2.prototype.start = function (entry) { + }; + AnimationStateAdapter2.prototype.interrupt = function (entry) { + }; + AnimationStateAdapter2.prototype.end = function (entry) { + }; + AnimationStateAdapter2.prototype.dispose = function (entry) { + }; + AnimationStateAdapter2.prototype.complete = function (entry) { + }; + AnimationStateAdapter2.prototype.event = function (entry, event) { + }; + return AnimationStateAdapter2; + }()); + spine.AnimationStateAdapter2 = AnimationStateAdapter2; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AnimationStateData = (function () { + function AnimationStateData(skeletonData) { + this.animationToMixTime = {}; + this.defaultMix = 0; + if (skeletonData == null) + throw new Error("skeletonData cannot be null."); + this.skeletonData = skeletonData; + } + AnimationStateData.prototype.setMix = function (fromName, toName, duration) { + var from = this.skeletonData.findAnimation(fromName); + if (from == null) + throw new Error("Animation not found: " + fromName); + var to = this.skeletonData.findAnimation(toName); + if (to == null) + throw new Error("Animation not found: " + toName); + this.setMixWith(from, to, duration); + }; + AnimationStateData.prototype.setMixWith = function (from, to, duration) { + if (from == null) + throw new Error("from cannot be null."); + if (to == null) + throw new Error("to cannot be null."); + var key = from.name + "." + to.name; + this.animationToMixTime[key] = duration; + }; + AnimationStateData.prototype.getMix = function (from, to) { + var key = from.name + "." + to.name; + var value = this.animationToMixTime[key]; + return value === undefined ? this.defaultMix : value; + }; + return AnimationStateData; + }()); + spine.AnimationStateData = AnimationStateData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AssetManager = (function () { + function AssetManager(textureLoader, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.assets = {}; + this.errors = {}; + this.toLoad = 0; + this.loaded = 0; + this.textureLoader = textureLoader; + this.pathPrefix = pathPrefix; + } + AssetManager.downloadText = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.onload = function () { + if (request.status == 200) { + success(request.responseText); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.downloadBinary = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.responseType = "arraybuffer"; + request.onload = function () { + if (request.status == 200) { + success(new Uint8Array(request.response)); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.prototype.loadText = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (data) { + _this.assets[path] = data; + if (success) + success(path, data); + _this.toLoad--; + _this.loaded++; + }, function (state, responseText) { + _this.errors[path] = "Couldn't load text " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load text " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.loadTexture = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = path; + }; + AssetManager.prototype.loadTextureData = function (path, data, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = data; + }; + AssetManager.prototype.loadTextureAtlas = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + var parent = path.lastIndexOf("/") >= 0 ? path.substring(0, path.lastIndexOf("/")) : ""; + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (atlasData) { + var pagesLoaded = { count: 0 }; + var atlasPages = new Array(); + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + atlasPages.push(parent + "/" + path); + var image = document.createElement("img"); + image.width = 16; + image.height = 16; + return new spine.FakeTexture(image); + }); + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + return; + } + var _loop_1 = function (atlasPage) { + var pageLoadError = false; + _this.loadTexture(atlasPage, function (imagePath, image) { + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + if (!pageLoadError) { + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + return _this.get(parent + "/" + path); + }); + _this.assets[path] = atlas; + if (success) + success(path, atlas); + _this.toLoad--; + _this.loaded++; + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + } + } + else { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + } + }, function (imagePath, errorMessage) { + pageLoadError = true; + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + }); + }; + for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) { + var atlasPage = atlasPages_1[_i]; + _loop_1(atlasPage); + } + }, function (state, responseText) { + _this.errors[path] = "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.get = function (path) { + path = this.pathPrefix + path; + return this.assets[path]; + }; + AssetManager.prototype.remove = function (path) { + path = this.pathPrefix + path; + var asset = this.assets[path]; + if (asset.dispose) + asset.dispose(); + this.assets[path] = null; + }; + AssetManager.prototype.removeAll = function () { + for (var key in this.assets) { + var asset = this.assets[key]; + if (asset.dispose) + asset.dispose(); + } + this.assets = {}; + }; + AssetManager.prototype.isLoadingComplete = function () { + return this.toLoad == 0; + }; + AssetManager.prototype.getToLoad = function () { + return this.toLoad; + }; + AssetManager.prototype.getLoaded = function () { + return this.loaded; + }; + AssetManager.prototype.dispose = function () { + this.removeAll(); + }; + AssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + AssetManager.prototype.getErrors = function () { + return this.errors; + }; + return AssetManager; + }()); + spine.AssetManager = AssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AtlasAttachmentLoader = (function () { + function AtlasAttachmentLoader(atlas) { + this.atlas = atlas; + } + AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.RegionAttachment(name); + attachment.setRegion(region); + return attachment; + }; + AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.MeshAttachment(name); + attachment.region = region; + return attachment; + }; + AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) { + return new spine.BoundingBoxAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) { + return new spine.PathAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) { + return new spine.PointAttachment(name); + }; + AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) { + return new spine.ClippingAttachment(name); + }; + return AtlasAttachmentLoader; + }()); + spine.AtlasAttachmentLoader = AtlasAttachmentLoader; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BlendMode; + (function (BlendMode) { + BlendMode[BlendMode["Normal"] = 0] = "Normal"; + BlendMode[BlendMode["Additive"] = 1] = "Additive"; + BlendMode[BlendMode["Multiply"] = 2] = "Multiply"; + BlendMode[BlendMode["Screen"] = 3] = "Screen"; + })(BlendMode = spine.BlendMode || (spine.BlendMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Bone = (function () { + function Bone(data, skeleton, parent) { + 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 = false; + this.a = 0; + this.b = 0; + this.worldX = 0; + this.c = 0; + this.d = 0; + this.worldY = 0; + this.sorted = false; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.skeleton = skeleton; + this.parent = parent; + this.setToSetupPose(); + } + Bone.prototype.update = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransform = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) { + this.ax = x; + this.ay = y; + this.arotation = rotation; + this.ascaleX = scaleX; + this.ascaleY = scaleY; + this.ashearX = shearX; + this.ashearY = shearY; + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + var skeleton = this.skeleton; + var rotationY = rotation + 90 + shearY; + var sx = skeleton.scaleX; + var sy = skeleton.scaleY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy; + this.worldX = x * sx + skeleton.x; + this.worldY = y * sy + skeleton.y; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + this.worldX = pa * x + pb * y + parent.worldX; + this.worldY = pc * x + pd * y + parent.worldY; + switch (this.data.transformMode) { + case spine.TransformMode.Normal: { + var rotationY = rotation + 90 + shearY; + var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(rotationY) * scaleY; + var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(rotationY) * scaleY; + this.a = pa * la + pb * lc; + this.b = pa * lb + pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + return; + } + case spine.TransformMode.OnlyTranslation: { + var rotationY = rotation + 90 + shearY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY; + break; + } + case spine.TransformMode.NoRotationOrReflection: { + var s = pa * pa + pc * pc; + var prx = 0; + if (s > 0.0001) { + s = Math.abs(pa * pd - pb * pc) / s; + pb = pc * s; + pd = pa * s; + prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg; + } + else { + pa = 0; + pc = 0; + prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg; + } + var rx = rotation + shearX - prx; + var ry = rotation + shearY - prx + 90; + var la = spine.MathUtils.cosDeg(rx) * scaleX; + var lb = spine.MathUtils.cosDeg(ry) * scaleY; + var lc = spine.MathUtils.sinDeg(rx) * scaleX; + var ld = spine.MathUtils.sinDeg(ry) * scaleY; + this.a = pa * la - pb * lc; + this.b = pa * lb - pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + break; + } + case spine.TransformMode.NoScale: + case spine.TransformMode.NoScaleOrReflection: { + var cos = spine.MathUtils.cosDeg(rotation); + var sin = spine.MathUtils.sinDeg(rotation); + var za = (pa * cos + pb * sin) / this.skeleton.scaleX; + var zc = (pc * cos + pd * sin) / this.skeleton.scaleY; + var s = Math.sqrt(za * za + zc * zc); + if (s > 0.00001) + s = 1 / s; + za *= s; + zc *= s; + s = Math.sqrt(za * za + zc * zc); + if (this.data.transformMode == spine.TransformMode.NoScale + && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) + s = -s; + var r = Math.PI / 2 + Math.atan2(zc, za); + var zb = Math.cos(r) * s; + var zd = Math.sin(r) * s; + var la = spine.MathUtils.cosDeg(shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY; + var lc = spine.MathUtils.sinDeg(shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY; + this.a = za * la + zb * lc; + this.b = za * lb + zb * ld; + this.c = zc * la + zd * lc; + this.d = zc * lb + zd * ld; + break; + } + } + this.a *= this.skeleton.scaleX; + this.b *= this.skeleton.scaleX; + this.c *= this.skeleton.scaleY; + this.d *= this.skeleton.scaleY; + }; + Bone.prototype.setToSetupPose = function () { + var data = this.data; + this.x = data.x; + this.y = data.y; + this.rotation = data.rotation; + this.scaleX = data.scaleX; + this.scaleY = data.scaleY; + this.shearX = data.shearX; + this.shearY = data.shearY; + }; + Bone.prototype.getWorldRotationX = function () { + return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldRotationY = function () { + return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldScaleX = function () { + return Math.sqrt(this.a * this.a + this.c * this.c); + }; + Bone.prototype.getWorldScaleY = function () { + return Math.sqrt(this.b * this.b + this.d * this.d); + }; + Bone.prototype.updateAppliedTransform = function () { + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + this.ax = this.worldX; + this.ay = this.worldY; + this.arotation = Math.atan2(this.c, this.a) * spine.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; + this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + var pid = 1 / (pa * pd - pb * pc); + var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; + this.ax = (dx * pd * pid - dy * pb * pid); + this.ay = (dy * pa * pid - dx * pc * pid); + var ia = pid * pd; + var id = pid * pa; + var ib = pid * pb; + var ic = pid * pc; + var ra = ia * this.a - ib * this.c; + var rb = ia * this.b - ib * this.d; + var rc = id * this.c - ic * this.a; + var rd = id * this.d - ic * this.b; + this.ashearX = 0; + this.ascaleX = Math.sqrt(ra * ra + rc * rc); + if (this.ascaleX > 0.0001) { + var det = ra * rd - rb * rc; + this.ascaleY = det / this.ascaleX; + this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg; + this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg; + } + else { + this.ascaleX = 0; + this.ascaleY = Math.sqrt(rb * rb + rd * rd); + this.ashearY = 0; + this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg; + } + }; + Bone.prototype.worldToLocal = function (world) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var invDet = 1 / (a * d - b * c); + var x = world.x - this.worldX, y = world.y - this.worldY; + world.x = (x * d * invDet - y * b * invDet); + world.y = (y * a * invDet - x * c * invDet); + return world; + }; + Bone.prototype.localToWorld = function (local) { + var x = local.x, y = local.y; + local.x = x * this.a + y * this.b + this.worldX; + local.y = x * this.c + y * this.d + this.worldY; + return local; + }; + Bone.prototype.worldToLocalRotation = function (worldRotation) { + var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation); + return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX; + }; + Bone.prototype.localToWorldRotation = function (localRotation) { + localRotation -= this.rotation - this.shearX; + var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation); + return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.rotateWorld = function (degrees) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees); + this.a = cos * a - sin * c; + this.b = cos * b - sin * d; + this.c = sin * a + cos * c; + this.d = sin * b + cos * d; + this.appliedValid = false; + }; + return Bone; + }()); + spine.Bone = Bone; +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoneData = (function () { + function BoneData(index, name, parent) { + this.x = 0; + this.y = 0; + this.rotation = 0; + this.scaleX = 1; + this.scaleY = 1; + this.shearX = 0; + this.shearY = 0; + this.transformMode = TransformMode.Normal; + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + this.index = index; + this.name = name; + this.parent = parent; + } + return BoneData; + }()); + spine.BoneData = BoneData; + var TransformMode; + (function (TransformMode) { + TransformMode[TransformMode["Normal"] = 0] = "Normal"; + TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation"; + TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; + TransformMode[TransformMode["NoScale"] = 3] = "NoScale"; + TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; + })(TransformMode = spine.TransformMode || (spine.TransformMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Event = (function () { + function Event(time, data) { + if (data == null) + throw new Error("data cannot be null."); + this.time = time; + this.data = data; + } + return Event; + }()); + spine.Event = Event; +})(spine || (spine = {})); +var spine; +(function (spine) { + var EventData = (function () { + function EventData(name) { + this.name = name; + } + return EventData; + }()); + spine.EventData = EventData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraint = (function () { + function IkConstraint(data, skeleton) { + this.bendDirection = 0; + this.compress = false; + this.stretch = false; + this.mix = 1; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.mix = data.mix; + this.bendDirection = data.bendDirection; + this.compress = data.compress; + this.stretch = data.stretch; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + IkConstraint.prototype.getOrder = function () { + return this.data.order; + }; + IkConstraint.prototype.apply = function () { + this.update(); + }; + IkConstraint.prototype.update = function () { + var target = this.target; + var bones = this.bones; + switch (bones.length) { + case 1: + this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix); + break; + case 2: + this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix); + break; + } + }; + IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) { + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var p = bone.parent; + var id = 1 / (p.a * p.d - p.b * p.c); + var x = targetX - p.worldX, y = targetY - p.worldY; + var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay; + var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation; + if (bone.ascaleX < 0) + rotationIK += 180; + if (rotationIK > 180) + rotationIK -= 360; + else if (rotationIK < -180) + rotationIK += 360; + var sx = bone.ascaleX, sy = bone.ascaleY; + if (compress || stretch) { + var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty); + if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) { + var s = (dd / b - 1) * alpha + 1; + sx *= s; + if (uniform) + sy *= s; + } + } + bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY); + }; + IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) { + if (alpha == 0) { + child.updateWorldTransform(); + return; + } + if (!parent.appliedValid) + parent.updateAppliedTransform(); + if (!child.appliedValid) + child.updateAppliedTransform(); + var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX; + var os1 = 0, os2 = 0, s2 = 0; + if (psx < 0) { + psx = -psx; + os1 = 180; + s2 = -1; + } + else { + os1 = 0; + s2 = 1; + } + if (psy < 0) { + psy = -psy; + s2 = -s2; + } + if (csx < 0) { + csx = -csx; + os2 = 180; + } + else + os2 = 0; + var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; + var u = Math.abs(psx - psy) <= 0.0001; + if (!u) { + cy = 0; + cwx = a * cx + parent.worldX; + cwy = c * cx + parent.worldY; + } + else { + cy = child.ay; + cwx = a * cx + b * cy + parent.worldX; + cwy = c * cx + d * cy + parent.worldY; + } + var pp = parent.parent; + a = pp.a; + b = pp.b; + c = pp.c; + d = pp.d; + var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY; + var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty; + x = cwx - pp.worldX; + y = cwy - pp.worldY; + var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; + var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0; + outer: if (u) { + l2 *= psx; + var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); + if (cos < -1) + cos = -1; + else if (cos > 1) { + cos = 1; + if (stretch && l1 + l2 > 0.0001) + sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1; + } + a2 = Math.acos(cos) * bendDir; + a = l1 + l2 * cos; + b = l2 * Math.sin(a2); + a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b); + } + else { + a = psx * l2; + b = psy * l2; + var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); + c = bb * l1 * l1 + aa * dd - aa * bb; + var c1 = -2 * bb * l1, c2 = bb - aa; + d = c1 * c1 - 4 * c2 * c; + if (d >= 0) { + var q = Math.sqrt(d); + if (c1 < 0) + q = -q; + q = -(c1 + q) / 2; + var r0 = q / c2, r1 = c / q; + var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; + if (r * r <= dd) { + y = Math.sqrt(dd - r * r) * bendDir; + a1 = ta - Math.atan2(y, r); + a2 = Math.atan2(y / psy, (r - l1) / psx); + break outer; + } + } + var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; + var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; + c = -a * l1 / (aa - bb); + if (c >= -1 && c <= 1) { + c = Math.acos(c); + x = a * Math.cos(c) + l1; + y = b * Math.sin(c); + d = x * x + y * y; + if (d < minDist) { + minAngle = c; + minDist = d; + minX = x; + minY = y; + } + if (d > maxDist) { + maxAngle = c; + maxDist = d; + maxX = x; + maxY = y; + } + } + if (dd <= (minDist + maxDist) / 2) { + a1 = ta - Math.atan2(minY * bendDir, minX); + a2 = minAngle * bendDir; + } + else { + a1 = ta - Math.atan2(maxY * bendDir, maxX); + a2 = maxAngle * bendDir; + } + } + var os = Math.atan2(cy, cx) * s2; + var rotation = parent.arotation; + a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation; + if (a1 > 180) + a1 -= 360; + else if (a1 < -180) + a1 += 360; + parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0); + rotation = child.arotation; + a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; + if (a2 > 180) + a2 -= 360; + else if (a2 < -180) + a2 += 360; + child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); + }; + return IkConstraint; + }()); + spine.IkConstraint = IkConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IkConstraintData = (function () { + function IkConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.bendDirection = 1; + this.compress = false; + this.stretch = false; + this.uniform = false; + this.mix = 1; + this.name = name; + } + return IkConstraintData; + }()); + spine.IkConstraintData = IkConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraint = (function () { + function PathConstraint(data, skeleton) { + 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(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0, n = data.bones.length; i < n; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findSlot(data.target.name); + this.position = data.position; + this.spacing = data.spacing; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + } + PathConstraint.prototype.apply = function () { + this.update(); + }; + PathConstraint.prototype.update = function () { + var attachment = this.target.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + return; + var rotateMix = this.rotateMix, translateMix = this.translateMix; + var translate = translateMix > 0, rotate = rotateMix > 0; + if (!translate && !rotate) + return; + var data = this.data; + var percentSpacing = data.spacingMode == spine.SpacingMode.Percent; + var rotateMode = data.rotateMode; + var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale; + var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1; + var bones = this.bones; + var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null; + var spacing = this.spacing; + if (scale || !percentSpacing) { + if (scale) + lengths = spine.Utils.setArraySize(this.lengths, boneCount); + var lengthSpacing = data.spacingMode == spine.SpacingMode.Length; + for (var i = 0, n = spacesCount - 1; i < n;) { + var bone = bones[i]; + var setupLength = bone.data.length; + if (setupLength < PathConstraint.epsilon) { + if (scale) + lengths[i] = 0; + spaces[++i] = 0; + } + else if (percentSpacing) { + if (scale) { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_1 = Math.sqrt(x * x + y * y); + lengths[i] = length_1; + } + spaces[++i] = spacing; + } + else { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_2 = Math.sqrt(x * x + y * y); + if (scale) + lengths[i] = length_2; + spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength; + } + } + } + else { + for (var i = 1; i < spacesCount; i++) + spaces[i] = spacing; + } + var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing); + var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; + var tip = false; + if (offsetRotation == 0) + tip = rotateMode == spine.RotateMode.Chain; + else { + tip = false; + var p = this.target.bone; + offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + } + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.worldX += (boneX - bone.worldX) * translateMix; + bone.worldY += (boneY - bone.worldY) * translateMix; + var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; + if (scale) { + var length_3 = lengths[i]; + if (length_3 != 0) { + var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1; + bone.a *= s; + bone.c *= s; + } + } + boneX = x; + boneY = y; + if (rotate) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; + if (tangents) + r = positions[p - 1]; + else if (spaces[i + 1] == 0) + r = positions[p + 2]; + else + r = Math.atan2(dy, dx); + r -= Math.atan2(c, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_4 = bone.data.length; + boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix; + boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix; + } + else { + r += offsetRotation; + } + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + } + bone.appliedValid = false; + } + }; + PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) { + var target = this.target; + var position = this.position; + var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null; + var closed = path.closed; + var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE; + if (!path.constantSpeed) { + var lengths = path.lengths; + curveCount -= closed ? 1 : 2; + var pathLength_1 = lengths[curveCount]; + if (percentPosition) + position *= pathLength_1; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength_1; + } + world = spine.Utils.setArraySize(this.world, 8); + for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength_1; + if (p < 0) + p += pathLength_1; + curve = 0; + } + else if (p < 0) { + if (prevCurve != PathConstraint.BEFORE) { + prevCurve = PathConstraint.BEFORE; + path.computeWorldVertices(target, 2, 4, world, 0, 2); + } + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength_1) { + if (prevCurve != PathConstraint.AFTER) { + prevCurve = PathConstraint.AFTER; + path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2); + } + this.addAfterPosition(p - pathLength_1, world, 0, out, o); + continue; + } + for (;; curve++) { + var length_5 = lengths[curve]; + if (p > length_5) + continue; + if (curve == 0) + p /= length_5; + else { + var prev = lengths[curve - 1]; + p = (p - prev) / (length_5 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + if (closed && curve == curveCount) { + path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2); + path.computeWorldVertices(target, 0, 4, world, 4, 2); + } + else + path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2); + } + this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0)); + } + return out; + } + if (closed) { + verticesLength += 2; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2); + path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2); + world[verticesLength - 2] = world[0]; + world[verticesLength - 1] = world[1]; + } + else { + curveCount--; + verticesLength -= 4; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength, world, 0, 2); + } + var curves = spine.Utils.setArraySize(this.curves, curveCount); + var pathLength = 0; + var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = world[w]; + cy1 = world[w + 1]; + cx2 = world[w + 2]; + cy2 = world[w + 3]; + x2 = world[w + 4]; + y2 = world[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) + position *= pathLength; + else + position *= pathLength / path.lengths[curveCount - 1]; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength; + } + var segments = this.segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength) { + this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); + continue; + } + for (;; curve++) { + var length_6 = curves[curve]; + if (p > length_6) + continue; + if (curve == 0) + p /= length_6; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_6 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + var ii = curve * 6; + x1 = world[ii]; + y1 = world[ii + 1]; + cx1 = world[ii + 2]; + cy1 = world[ii + 3]; + cx2 = world[ii + 4]; + cy2 = world[ii + 5]; + x2 = world[ii + 6]; + y2 = world[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + p *= curveLength; + for (;; segment++) { + var length_7 = segments[segment]; + if (p > length_7) + continue; + if (segment == 0) + p /= length_7; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_7 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0)); + } + return out; + }; + PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) { + var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) { + var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { + if (p == 0 || isNaN(p)) { + out[o] = x1; + out[o + 1] = y1; + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + return; + } + var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; + var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; + var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; + out[o] = x; + out[o + 1] = y; + if (tangents) { + if (p < 0.001) + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + else + out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); + } + }; + PathConstraint.prototype.getOrder = function () { + return this.data.order; + }; + PathConstraint.NONE = -1; + PathConstraint.BEFORE = -2; + PathConstraint.AFTER = -3; + PathConstraint.epsilon = 0.00001; + return PathConstraint; + }()); + spine.PathConstraint = PathConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathConstraintData = (function () { + function PathConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.name = name; + } + return PathConstraintData; + }()); + spine.PathConstraintData = PathConstraintData; + var PositionMode; + (function (PositionMode) { + PositionMode[PositionMode["Fixed"] = 0] = "Fixed"; + PositionMode[PositionMode["Percent"] = 1] = "Percent"; + })(PositionMode = spine.PositionMode || (spine.PositionMode = {})); + var SpacingMode; + (function (SpacingMode) { + SpacingMode[SpacingMode["Length"] = 0] = "Length"; + SpacingMode[SpacingMode["Fixed"] = 1] = "Fixed"; + SpacingMode[SpacingMode["Percent"] = 2] = "Percent"; + })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {})); + var RotateMode; + (function (RotateMode) { + RotateMode[RotateMode["Tangent"] = 0] = "Tangent"; + RotateMode[RotateMode["Chain"] = 1] = "Chain"; + RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale"; + })(RotateMode = spine.RotateMode || (spine.RotateMode = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Assets = (function () { + function Assets(clientId) { + this.toLoad = new Array(); + this.assets = {}; + this.clientId = clientId; + } + Assets.prototype.loaded = function () { + var i = 0; + for (var v in this.assets) + i++; + return i; + }; + return Assets; + }()); + var SharedAssetManager = (function () { + function SharedAssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.clientAssets = {}; + this.queuedAssets = {}; + this.rawAssets = {}; + this.errors = {}; + this.pathPrefix = pathPrefix; + } + SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) { + clientAssets = new Assets(clientId); + this.clientAssets[clientId] = clientAssets; + } + if (textureLoader !== null) + clientAssets.textureLoader = textureLoader; + clientAssets.toLoad.push(path); + if (this.queuedAssets[path] === path) { + return false; + } + else { + this.queuedAssets[path] = path; + return true; + } + }; + SharedAssetManager.prototype.loadText = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = request.responseText; + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadJson = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = JSON.parse(request.responseText); + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, textureLoader, path)) + return; + var img = new Image(); + img.src = path; + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + _this.rawAssets[path] = img; + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + }; + }; + SharedAssetManager.prototype.get = function (clientId, path) { + path = this.pathPrefix + path; + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + return clientAssets.assets[path]; + }; + SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { + for (var i = 0; i < clientAssets.toLoad.length; i++) { + var path = clientAssets.toLoad[i]; + var asset = clientAssets.assets[path]; + if (asset === null || asset === undefined) { + var rawAsset = this.rawAssets[path]; + if (rawAsset === null || rawAsset === undefined) + continue; + if (rawAsset instanceof HTMLImageElement) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } + } + } + }; + SharedAssetManager.prototype.isLoadingComplete = function (clientId) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + this.updateClientAssets(clientAssets); + return clientAssets.toLoad.length == clientAssets.loaded(); + }; + SharedAssetManager.prototype.dispose = function () { + }; + SharedAssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + SharedAssetManager.prototype.getErrors = function () { + return this.errors; + }; + return SharedAssetManager; + }()); + spine.SharedAssetManager = SharedAssetManager; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skeleton = (function () { + function Skeleton(data) { + this._updateCache = new Array(); + this.updateCacheReset = new Array(); + this.time = 0; + this.scaleX = 1; + this.scaleY = 1; + this.x = 0; + this.y = 0; + if (data == null) + throw new Error("data cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) { + var boneData = data.bones[i]; + var bone = void 0; + if (boneData.parent == null) + bone = new spine.Bone(boneData, this, null); + else { + var parent_1 = this.bones[boneData.parent.index]; + bone = new spine.Bone(boneData, this, parent_1); + parent_1.children.push(bone); + } + this.bones.push(bone); + } + this.slots = new Array(); + this.drawOrder = new Array(); + for (var i = 0; i < data.slots.length; i++) { + var slotData = data.slots[i]; + var bone = this.bones[slotData.boneData.index]; + var slot = new spine.Slot(slotData, bone); + this.slots.push(slot); + this.drawOrder.push(slot); + } + this.ikConstraints = new Array(); + for (var i = 0; i < data.ikConstraints.length; i++) { + var ikConstraintData = data.ikConstraints[i]; + this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this)); + } + this.transformConstraints = new Array(); + for (var i = 0; i < data.transformConstraints.length; i++) { + var transformConstraintData = data.transformConstraints[i]; + this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this)); + } + this.pathConstraints = new Array(); + for (var i = 0; i < data.pathConstraints.length; i++) { + var pathConstraintData = data.pathConstraints[i]; + this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this)); + } + this.color = new spine.Color(1, 1, 1, 1); + this.updateCache(); + } + Skeleton.prototype.updateCache = function () { + var updateCache = this._updateCache; + updateCache.length = 0; + this.updateCacheReset.length = 0; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].sorted = false; + var ikConstraints = this.ikConstraints; + var transformConstraints = this.transformConstraints; + var pathConstraints = this.pathConstraints; + var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length; + var constraintCount = ikCount + transformCount + pathCount; + outer: for (var i = 0; i < constraintCount; i++) { + for (var ii = 0; ii < ikCount; ii++) { + var constraint = ikConstraints[ii]; + if (constraint.data.order == i) { + this.sortIkConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < transformCount; ii++) { + var constraint = transformConstraints[ii]; + if (constraint.data.order == i) { + this.sortTransformConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < pathCount; ii++) { + var constraint = pathConstraints[ii]; + if (constraint.data.order == i) { + this.sortPathConstraint(constraint); + continue outer; + } + } + } + for (var i = 0, n = bones.length; i < n; i++) + this.sortBone(bones[i]); + }; + Skeleton.prototype.sortIkConstraint = function (constraint) { + var target = constraint.target; + this.sortBone(target); + var constrained = constraint.bones; + var parent = constrained[0]; + this.sortBone(parent); + if (constrained.length > 1) { + var child = constrained[constrained.length - 1]; + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + this._updateCache.push(constraint); + this.sortReset(parent.children); + constrained[constrained.length - 1].sorted = true; + }; + Skeleton.prototype.sortPathConstraint = function (constraint) { + var slot = constraint.target; + var slotIndex = slot.data.index; + var slotBone = slot.bone; + if (this.skin != null) + this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); + if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin) + this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); + for (var i = 0, n = this.data.skins.length; i < n; i++) + this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone); + var attachment = slot.getAttachment(); + if (attachment instanceof spine.PathAttachment) + this.sortPathConstraintAttachmentWith(attachment, slotBone); + var constrained = constraint.bones; + var boneCount = constrained.length; + for (var i = 0; i < boneCount; i++) + this.sortBone(constrained[i]); + this._updateCache.push(constraint); + for (var i = 0; i < boneCount; i++) + this.sortReset(constrained[i].children); + for (var i = 0; i < boneCount; i++) + constrained[i].sorted = true; + }; + Skeleton.prototype.sortTransformConstraint = function (constraint) { + this.sortBone(constraint.target); + var constrained = constraint.bones; + var boneCount = constrained.length; + if (constraint.data.local) { + for (var i = 0; i < boneCount; i++) { + var child = constrained[i]; + this.sortBone(child.parent); + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + } + else { + for (var i = 0; i < boneCount; i++) { + this.sortBone(constrained[i]); + } + } + this._updateCache.push(constraint); + for (var ii = 0; ii < boneCount; ii++) + this.sortReset(constrained[ii].children); + for (var ii = 0; ii < boneCount; ii++) + constrained[ii].sorted = true; + }; + Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) { + var attachments = skin.attachments[slotIndex]; + if (!attachments) + return; + for (var key in attachments) { + this.sortPathConstraintAttachmentWith(attachments[key], slotBone); + } + }; + Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) { + if (!(attachment instanceof spine.PathAttachment)) + return; + var pathBones = attachment.bones; + if (pathBones == null) + this.sortBone(slotBone); + else { + var bones = this.bones; + var i = 0; + while (i < pathBones.length) { + var boneCount = pathBones[i++]; + for (var n = i + boneCount; i < n; i++) { + var boneIndex = pathBones[i]; + this.sortBone(bones[boneIndex]); + } + } + } + }; + Skeleton.prototype.sortBone = function (bone) { + if (bone.sorted) + return; + var parent = bone.parent; + if (parent != null) + this.sortBone(parent); + bone.sorted = true; + this._updateCache.push(bone); + }; + Skeleton.prototype.sortReset = function (bones) { + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.sorted) + this.sortReset(bone.children); + bone.sorted = false; + } + }; + Skeleton.prototype.updateWorldTransform = function () { + var updateCacheReset = this.updateCacheReset; + for (var i = 0, n = updateCacheReset.length; i < n; i++) { + var bone = updateCacheReset[i]; + bone.ax = bone.x; + bone.ay = bone.y; + bone.arotation = bone.rotation; + bone.ascaleX = bone.scaleX; + bone.ascaleY = bone.scaleY; + bone.ashearX = bone.shearX; + bone.ashearY = bone.shearY; + bone.appliedValid = true; + } + var updateCache = this._updateCache; + for (var i = 0, n = updateCache.length; i < n; i++) + updateCache[i].update(); + }; + Skeleton.prototype.setToSetupPose = function () { + this.setBonesToSetupPose(); + this.setSlotsToSetupPose(); + }; + Skeleton.prototype.setBonesToSetupPose = function () { + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].setToSetupPose(); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + var data = constraint.data; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + } + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + var data = constraint.data; + constraint.position = data.position; + constraint.spacing = data.spacing; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + } + }; + Skeleton.prototype.setSlotsToSetupPose = function () { + var slots = this.slots; + spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); + for (var i = 0, n = slots.length; i < n; i++) + slots[i].setToSetupPose(); + }; + Skeleton.prototype.getRootBone = function () { + if (this.bones.length == 0) + return null; + return this.bones[0]; + }; + Skeleton.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.data.name == boneName) + return bone; + } + return null; + }; + Skeleton.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].data.name == boneName) + return i; + return -1; + }; + Skeleton.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) + return slot; + } + return null; + }; + Skeleton.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].data.name == slotName) + return i; + return -1; + }; + Skeleton.prototype.setSkinByName = function (skinName) { + var skin = this.data.findSkin(skinName); + if (skin == null) + throw new Error("Skin not found: " + skinName); + this.setSkin(skin); + }; + Skeleton.prototype.setSkin = function (newSkin) { + if (newSkin != null) { + if (this.skin != null) + newSkin.attachAll(this, this.skin); + else { + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var name_1 = slot.data.attachmentName; + if (name_1 != null) { + var attachment = newSkin.getAttachment(i, name_1); + if (attachment != null) + slot.setAttachment(attachment); + } + } + } + } + this.skin = newSkin; + }; + Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) { + return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName); + }; + Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) { + if (attachmentName == null) + throw new Error("attachmentName cannot be null."); + if (this.skin != null) { + var attachment = this.skin.getAttachment(slotIndex, attachmentName); + if (attachment != null) + return attachment; + } + if (this.data.defaultSkin != null) + return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); + return null; + }; + Skeleton.prototype.setAttachment = function (slotName, attachmentName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) { + var attachment = null; + if (attachmentName != null) { + attachment = this.getAttachment(i, attachmentName); + if (attachment == null) + throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName); + } + slot.setAttachment(attachment); + return; + } + } + throw new Error("Slot not found: " + slotName); + }; + Skeleton.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var ikConstraint = ikConstraints[i]; + if (ikConstraint.data.name == constraintName) + return ikConstraint; + } + return null; + }; + Skeleton.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.getBounds = function (offset, size, temp) { + if (temp === void 0) { temp = new Array(2); } + if (offset == null) + throw new Error("offset cannot be null."); + if (size == null) + throw new Error("size cannot be null."); + var drawOrder = this.drawOrder; + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var verticesLength = 0; + var vertices = null; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + verticesLength = 8; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + attachment.computeWorldVertices(slot.bone, vertices, 0, 2); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + verticesLength = mesh.worldVerticesLength; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2); + } + if (vertices != null) { + for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + } + offset.set(minX, minY); + size.set(maxX - minX, maxY - minY); + }; + Skeleton.prototype.update = function (delta) { + this.time += delta; + }; + return Skeleton; + }()); + spine.Skeleton = Skeleton; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonBounds = (function () { + function SkeletonBounds() { + this.minX = 0; + this.minY = 0; + this.maxX = 0; + this.maxY = 0; + this.boundingBoxes = new Array(); + this.polygons = new Array(); + this.polygonPool = new spine.Pool(function () { + return spine.Utils.newFloatArray(16); + }); + } + SkeletonBounds.prototype.update = function (skeleton, updateAabb) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + var boundingBoxes = this.boundingBoxes; + var polygons = this.polygons; + var polygonPool = this.polygonPool; + var slots = skeleton.slots; + var slotCount = slots.length; + boundingBoxes.length = 0; + polygonPool.freeAll(polygons); + polygons.length = 0; + for (var i = 0; i < slotCount; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.BoundingBoxAttachment) { + var boundingBox = attachment; + boundingBoxes.push(boundingBox); + var polygon = polygonPool.obtain(); + if (polygon.length != boundingBox.worldVerticesLength) { + polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength); + } + polygons.push(polygon); + boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2); + } + } + if (updateAabb) { + this.aabbCompute(); + } + else { + this.minX = Number.POSITIVE_INFINITY; + this.minY = Number.POSITIVE_INFINITY; + this.maxX = Number.NEGATIVE_INFINITY; + this.maxY = Number.NEGATIVE_INFINITY; + } + }; + SkeletonBounds.prototype.aabbCompute = function () { + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + var vertices = polygon; + for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) { + var x = vertices[ii]; + var y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + this.minX = minX; + this.minY = minY; + this.maxX = maxX; + this.maxY = maxY; + }; + SkeletonBounds.prototype.aabbContainsPoint = function (x, y) { + return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; + }; + SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) { + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) + return false; + var m = (y2 - y1) / (x2 - x1); + var y = m * (minX - x1) + y1; + if (y > minY && y < maxY) + return true; + y = m * (maxX - x1) + y1; + if (y > minY && y < maxY) + return true; + var x = (minY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + x = (maxY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + return false; + }; + SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) { + return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; + }; + SkeletonBounds.prototype.containsPoint = function (x, y) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.containsPointPolygon(polygons[i], x, y)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) { + var vertices = polygon; + var nn = polygon.length; + var prevIndex = nn - 2; + var inside = false; + for (var ii = 0; ii < nn; ii += 2) { + var vertexY = vertices[ii + 1]; + var prevY = vertices[prevIndex + 1]; + if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { + var vertexX = vertices[ii]; + if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) + inside = !inside; + } + prevIndex = ii; + } + return inside; + }; + SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) { + var vertices = polygon; + var nn = polygon.length; + var width12 = x1 - x2, height12 = y1 - y2; + var det1 = x1 * y2 - y1 * x2; + var x3 = vertices[nn - 2], y3 = vertices[nn - 1]; + for (var ii = 0; ii < nn; ii += 2) { + var x4 = vertices[ii], y4 = vertices[ii + 1]; + var det2 = x3 * y4 - y3 * x4; + var width34 = x3 - x4, height34 = y3 - y4; + var det3 = width12 * height34 - height12 * width34; + var x = (det1 * width34 - width12 * det2) / det3; + if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { + var y = (det1 * height34 - height12 * det2) / det3; + if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) + return true; + } + x3 = x4; + y3 = y4; + } + return false; + }; + SkeletonBounds.prototype.getPolygon = function (boundingBox) { + if (boundingBox == null) + throw new Error("boundingBox cannot be null."); + var index = this.boundingBoxes.indexOf(boundingBox); + return index == -1 ? null : this.polygons[index]; + }; + SkeletonBounds.prototype.getWidth = function () { + return this.maxX - this.minX; + }; + SkeletonBounds.prototype.getHeight = function () { + return this.maxY - this.minY; + }; + return SkeletonBounds; + }()); + spine.SkeletonBounds = SkeletonBounds; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonClipping = (function () { + function SkeletonClipping() { + this.triangulator = new spine.Triangulator(); + this.clippingPolygon = new Array(); + this.clipOutput = new Array(); + this.clippedVertices = new Array(); + this.clippedTriangles = new Array(); + this.scratch = new Array(); + } + SkeletonClipping.prototype.clipStart = function (slot, clip) { + if (this.clipAttachment != null) + return 0; + this.clipAttachment = clip; + var n = clip.worldVerticesLength; + var vertices = spine.Utils.setArraySize(this.clippingPolygon, n); + clip.computeWorldVertices(slot, 0, n, vertices, 0, 2); + var clippingPolygon = this.clippingPolygon; + SkeletonClipping.makeClockwise(clippingPolygon); + var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); + for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) { + var polygon = clippingPolygons[i]; + SkeletonClipping.makeClockwise(polygon); + polygon.push(polygon[0]); + polygon.push(polygon[1]); + } + return clippingPolygons.length; + }; + SkeletonClipping.prototype.clipEndWithSlot = function (slot) { + if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data) + this.clipEnd(); + }; + SkeletonClipping.prototype.clipEnd = function () { + if (this.clipAttachment == null) + return; + this.clipAttachment = null; + this.clippingPolygons = null; + this.clippedVertices.length = 0; + this.clippedTriangles.length = 0; + this.clippingPolygon.length = 0; + }; + SkeletonClipping.prototype.isClipping = function () { + return this.clipAttachment != null; + }; + SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) { + var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; + var clippedTriangles = this.clippedTriangles; + var polygons = this.clippingPolygons; + var polygonsCount = this.clippingPolygons.length; + var vertexSize = twoColor ? 12 : 8; + var index = 0; + clippedVertices.length = 0; + clippedTriangles.length = 0; + outer: for (var i = 0; i < trianglesLength; i += 3) { + var vertexOffset = triangles[i] << 1; + var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; + var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 1] << 1; + var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; + var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 2] << 1; + var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; + var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; + for (var p = 0; p < polygonsCount; p++) { + var s = clippedVertices.length; + if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { + var clipOutputLength = clipOutput.length; + if (clipOutputLength == 0) + continue; + var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; + var d = 1 / (d0 * d2 + d1 * (y1 - y3)); + var clipOutputCount = clipOutputLength >> 1; + var clipOutputItems = this.clipOutput; + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize); + for (var ii = 0; ii < clipOutputLength; ii += 2) { + var x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; + clippedVerticesItems[s] = x; + clippedVerticesItems[s + 1] = y; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + var c0 = x - x3, c1 = y - y3; + var a = (d0 * c0 + d1 * c1) * d; + var b = (d4 * c0 + d2 * c1) * d; + var c = 1 - a - b; + clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c; + clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c; + if (twoColor) { + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + } + s += vertexSize; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); + clipOutputCount--; + for (var ii = 1; ii < clipOutputCount; ii++) { + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + ii); + clippedTrianglesItems[s + 2] = (index + ii + 1); + s += 3; + } + index += clipOutputCount + 1; + } + else { + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize); + clippedVerticesItems[s] = x1; + clippedVerticesItems[s + 1] = y1; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + if (!twoColor) { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = x2; + clippedVerticesItems[s + 9] = y2; + clippedVerticesItems[s + 10] = light.r; + clippedVerticesItems[s + 11] = light.g; + clippedVerticesItems[s + 12] = light.b; + clippedVerticesItems[s + 13] = light.a; + clippedVerticesItems[s + 14] = u2; + clippedVerticesItems[s + 15] = v2; + clippedVerticesItems[s + 16] = x3; + clippedVerticesItems[s + 17] = y3; + clippedVerticesItems[s + 18] = light.r; + clippedVerticesItems[s + 19] = light.g; + clippedVerticesItems[s + 20] = light.b; + clippedVerticesItems[s + 21] = light.a; + clippedVerticesItems[s + 22] = u3; + clippedVerticesItems[s + 23] = v3; + } + else { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + clippedVerticesItems[s + 12] = x2; + clippedVerticesItems[s + 13] = y2; + clippedVerticesItems[s + 14] = light.r; + clippedVerticesItems[s + 15] = light.g; + clippedVerticesItems[s + 16] = light.b; + clippedVerticesItems[s + 17] = light.a; + clippedVerticesItems[s + 18] = u2; + clippedVerticesItems[s + 19] = v2; + clippedVerticesItems[s + 20] = dark.r; + clippedVerticesItems[s + 21] = dark.g; + clippedVerticesItems[s + 22] = dark.b; + clippedVerticesItems[s + 23] = dark.a; + clippedVerticesItems[s + 24] = x3; + clippedVerticesItems[s + 25] = y3; + clippedVerticesItems[s + 26] = light.r; + clippedVerticesItems[s + 27] = light.g; + clippedVerticesItems[s + 28] = light.b; + clippedVerticesItems[s + 29] = light.a; + clippedVerticesItems[s + 30] = u3; + clippedVerticesItems[s + 31] = v3; + clippedVerticesItems[s + 32] = dark.r; + clippedVerticesItems[s + 33] = dark.g; + clippedVerticesItems[s + 34] = dark.b; + clippedVerticesItems[s + 35] = dark.a; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3); + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + 1); + clippedTrianglesItems[s + 2] = (index + 2); + index += 3; + continue outer; + } + } + } + }; + SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) { + var originalOutput = output; + var clipped = false; + var input = null; + if (clippingArea.length % 4 >= 2) { + input = output; + output = this.scratch; + } + else + input = this.scratch; + input.length = 0; + input.push(x1); + input.push(y1); + input.push(x2); + input.push(y2); + input.push(x3); + input.push(y3); + input.push(x1); + input.push(y1); + output.length = 0; + var clippingVertices = clippingArea; + var clippingVerticesLast = clippingArea.length - 4; + for (var i = 0;; i += 2) { + var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; + var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3]; + var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2; + var inputVertices = input; + var inputVerticesLength = input.length - 2, outputStart = output.length; + for (var ii = 0; ii < inputVerticesLength; ii += 2) { + var inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; + var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3]; + var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0; + if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) { + if (side2) { + output.push(inputX2); + output.push(inputY2); + continue; + } + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + } + else if (side2) { + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + output.push(inputX2); + output.push(inputY2); + } + clipped = true; + } + if (outputStart == output.length) { + originalOutput.length = 0; + return true; + } + output.push(output[0]); + output.push(output[1]); + if (i == clippingVerticesLast) + break; + var temp = output; + output = input; + output.length = 0; + input = temp; + } + if (originalOutput != output) { + originalOutput.length = 0; + for (var i = 0, n = output.length - 2; i < n; i++) + originalOutput[i] = output[i]; + } + else + originalOutput.length = originalOutput.length - 2; + return clipped; + }; + SkeletonClipping.makeClockwise = function (polygon) { + var vertices = polygon; + var verticeslength = polygon.length; + var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; + for (var i = 0, n = verticeslength - 3; i < n; i += 2) { + p1x = vertices[i]; + p1y = vertices[i + 1]; + p2x = vertices[i + 2]; + p2y = vertices[i + 3]; + area += p1x * p2y - p2x * p1y; + } + if (area < 0) + return; + for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { + var x = vertices[i], y = vertices[i + 1]; + var other = lastX - i; + vertices[i] = vertices[other]; + vertices[i + 1] = vertices[other + 1]; + vertices[other] = x; + vertices[other + 1] = y; + } + }; + return SkeletonClipping; + }()); + spine.SkeletonClipping = SkeletonClipping; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonData = (function () { + function SkeletonData() { + this.bones = new Array(); + this.slots = new Array(); + this.skins = new Array(); + this.events = new Array(); + this.animations = new Array(); + this.ikConstraints = new Array(); + this.transformConstraints = new Array(); + this.pathConstraints = new Array(); + this.fps = 0; + } + SkeletonData.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.name == boneName) + return bone; + } + return null; + }; + SkeletonData.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].name == boneName) + return i; + return -1; + }; + SkeletonData.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.name == slotName) + return slot; + } + return null; + }; + SkeletonData.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].name == slotName) + return i; + return -1; + }; + SkeletonData.prototype.findSkin = function (skinName) { + if (skinName == null) + throw new Error("skinName cannot be null."); + var skins = this.skins; + for (var i = 0, n = skins.length; i < n; i++) { + var skin = skins[i]; + if (skin.name == skinName) + return skin; + } + return null; + }; + SkeletonData.prototype.findEvent = function (eventDataName) { + if (eventDataName == null) + throw new Error("eventDataName cannot be null."); + var events = this.events; + for (var i = 0, n = events.length; i < n; i++) { + var event_4 = events[i]; + if (event_4.name == eventDataName) + return event_4; + } + return null; + }; + SkeletonData.prototype.findAnimation = function (animationName) { + if (animationName == null) + throw new Error("animationName cannot be null."); + var animations = this.animations; + for (var i = 0, n = animations.length; i < n; i++) { + var animation = animations[i]; + if (animation.name == animationName) + return animation; + } + return null; + }; + SkeletonData.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) { + if (pathConstraintName == null) + throw new Error("pathConstraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) + if (pathConstraints[i].name == pathConstraintName) + return i; + return -1; + }; + return SkeletonData; + }()); + spine.SkeletonData = SkeletonData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SkeletonJson = (function () { + function SkeletonJson(attachmentLoader) { + this.scale = 1; + this.linkedMeshes = new Array(); + this.attachmentLoader = attachmentLoader; + } + SkeletonJson.prototype.readSkeletonData = function (json) { + var scale = this.scale; + var skeletonData = new spine.SkeletonData(); + var root = typeof (json) === "string" ? JSON.parse(json) : json; + var skeletonMap = root.skeleton; + if (skeletonMap != null) { + skeletonData.hash = skeletonMap.hash; + skeletonData.version = skeletonMap.spine; + skeletonData.width = skeletonMap.width; + skeletonData.height = skeletonMap.height; + skeletonData.fps = skeletonMap.fps; + skeletonData.imagesPath = skeletonMap.images; + } + if (root.bones) { + for (var i = 0; i < root.bones.length; i++) { + var boneMap = root.bones[i]; + var parent_2 = null; + var parentName = this.getValue(boneMap, "parent", null); + if (parentName != null) { + parent_2 = skeletonData.findBone(parentName); + if (parent_2 == null) + throw new Error("Parent bone not found: " + parentName); + } + var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2); + data.length = this.getValue(boneMap, "length", 0) * scale; + data.x = this.getValue(boneMap, "x", 0) * scale; + data.y = this.getValue(boneMap, "y", 0) * scale; + data.rotation = this.getValue(boneMap, "rotation", 0); + data.scaleX = this.getValue(boneMap, "scaleX", 1); + data.scaleY = this.getValue(boneMap, "scaleY", 1); + data.shearX = this.getValue(boneMap, "shearX", 0); + data.shearY = this.getValue(boneMap, "shearY", 0); + data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal")); + skeletonData.bones.push(data); + } + } + if (root.slots) { + for (var i = 0; i < root.slots.length; i++) { + var slotMap = root.slots[i]; + var slotName = slotMap.name; + var boneName = slotMap.bone; + var boneData = skeletonData.findBone(boneName); + if (boneData == null) + throw new Error("Slot bone not found: " + boneName); + var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData); + var color = this.getValue(slotMap, "color", null); + if (color != null) + data.color.setFromString(color); + var dark = this.getValue(slotMap, "dark", null); + if (dark != null) { + data.darkColor = new spine.Color(1, 1, 1, 1); + data.darkColor.setFromString(dark); + } + data.attachmentName = this.getValue(slotMap, "attachment", null); + data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, "blend", "normal")); + skeletonData.slots.push(data); + } + } + if (root.ik) { + for (var i = 0; i < root.ik.length; i++) { + var constraintMap = root.ik[i]; + var data = new spine.IkConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("IK bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("IK target bone not found: " + targetName); + data.mix = this.getValue(constraintMap, "mix", 1); + data.bendDirection = this.getValue(constraintMap, "bendPositive", true) ? 1 : -1; + data.compress = this.getValue(constraintMap, "compress", false); + data.stretch = this.getValue(constraintMap, "stretch", false); + data.uniform = this.getValue(constraintMap, "uniform", false); + skeletonData.ikConstraints.push(data); + } + } + if (root.transform) { + for (var i = 0; i < root.transform.length; i++) { + var constraintMap = root.transform[i]; + var data = new spine.TransformConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("Transform constraint target bone not found: " + targetName); + data.local = this.getValue(constraintMap, "local", false); + data.relative = this.getValue(constraintMap, "relative", false); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.offsetX = this.getValue(constraintMap, "x", 0) * scale; + data.offsetY = this.getValue(constraintMap, "y", 0) * scale; + data.offsetScaleX = this.getValue(constraintMap, "scaleX", 0); + data.offsetScaleY = this.getValue(constraintMap, "scaleY", 0); + data.offsetShearY = this.getValue(constraintMap, "shearY", 0); + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + data.scaleMix = this.getValue(constraintMap, "scaleMix", 1); + data.shearMix = this.getValue(constraintMap, "shearMix", 1); + skeletonData.transformConstraints.push(data); + } + } + if (root.path) { + for (var i = 0; i < root.path.length; i++) { + var constraintMap = root.path[i]; + var data = new spine.PathConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findSlot(targetName); + if (data.target == null) + throw new Error("Path target slot not found: " + targetName); + data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, "positionMode", "percent")); + data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, "spacingMode", "length")); + data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, "rotateMode", "tangent")); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.position = this.getValue(constraintMap, "position", 0); + if (data.positionMode == spine.PositionMode.Fixed) + data.position *= scale; + data.spacing = this.getValue(constraintMap, "spacing", 0); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + data.spacing *= scale; + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + skeletonData.pathConstraints.push(data); + } + } + if (root.skins) { + for (var skinName in root.skins) { + var skinMap = root.skins[skinName]; + var skin = new spine.Skin(skinName); + for (var slotName in skinMap) { + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + var slotMap = skinMap[slotName]; + for (var entryName in slotMap) { + var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData); + if (attachment != null) + skin.addAttachment(slotIndex, entryName, attachment); + } + } + skeletonData.skins.push(skin); + if (skin.name == "default") + skeletonData.defaultSkin = skin; + } + } + for (var i = 0, n = this.linkedMeshes.length; i < n; i++) { + var linkedMesh = this.linkedMeshes[i]; + var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); + if (skin == null) + throw new Error("Skin not found: " + linkedMesh.skin); + var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); + if (parent_3 == null) + throw new Error("Parent mesh not found: " + linkedMesh.parent); + linkedMesh.mesh.setParentMesh(parent_3); + linkedMesh.mesh.updateUVs(); + } + this.linkedMeshes.length = 0; + if (root.events) { + for (var eventName in root.events) { + var eventMap = root.events[eventName]; + var data = new spine.EventData(eventName); + data.intValue = this.getValue(eventMap, "int", 0); + data.floatValue = this.getValue(eventMap, "float", 0); + data.stringValue = this.getValue(eventMap, "string", ""); + data.audioPath = this.getValue(eventMap, "audio", null); + if (data.audioPath != null) { + data.volume = this.getValue(eventMap, "volume", 1); + data.balance = this.getValue(eventMap, "balance", 0); + } + skeletonData.events.push(data); + } + } + if (root.animations) { + for (var animationName in root.animations) { + var animationMap = root.animations[animationName]; + this.readAnimation(animationMap, animationName, skeletonData); + } + } + return skeletonData; + }; + SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) { + var scale = this.scale; + name = this.getValue(map, "name", name); + var type = this.getValue(map, "type", "region"); + switch (type) { + case "region": { + var path = this.getValue(map, "path", name); + var region = this.attachmentLoader.newRegionAttachment(skin, name, path); + if (region == null) + return null; + region.path = path; + region.x = this.getValue(map, "x", 0) * scale; + region.y = this.getValue(map, "y", 0) * scale; + region.scaleX = this.getValue(map, "scaleX", 1); + region.scaleY = this.getValue(map, "scaleY", 1); + region.rotation = this.getValue(map, "rotation", 0); + region.width = map.width * scale; + region.height = map.height * scale; + var color = this.getValue(map, "color", null); + if (color != null) + region.color.setFromString(color); + region.updateOffset(); + return region; + } + case "boundingbox": { + var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); + if (box == null) + return null; + this.readVertices(map, box, map.vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + box.color.setFromString(color); + return box; + } + case "mesh": + case "linkedmesh": { + var path = this.getValue(map, "path", name); + var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); + if (mesh == null) + return null; + mesh.path = path; + var color = this.getValue(map, "color", null); + if (color != null) + mesh.color.setFromString(color); + var parent_4 = this.getValue(map, "parent", null); + if (parent_4 != null) { + mesh.inheritDeform = this.getValue(map, "deform", true); + this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, "skin", null), slotIndex, parent_4)); + return mesh; + } + var uvs = map.uvs; + this.readVertices(map, mesh, uvs.length); + mesh.triangles = map.triangles; + mesh.regionUVs = uvs; + mesh.updateUVs(); + mesh.hullLength = this.getValue(map, "hull", 0) * 2; + return mesh; + } + case "path": { + var path = this.attachmentLoader.newPathAttachment(skin, name); + if (path == null) + return null; + path.closed = this.getValue(map, "closed", false); + path.constantSpeed = this.getValue(map, "constantSpeed", true); + var vertexCount = map.vertexCount; + this.readVertices(map, path, vertexCount << 1); + var lengths = spine.Utils.newArray(vertexCount / 3, 0); + for (var i = 0; i < map.lengths.length; i++) + lengths[i] = map.lengths[i] * scale; + path.lengths = lengths; + var color = this.getValue(map, "color", null); + if (color != null) + path.color.setFromString(color); + return path; + } + case "point": { + var point = this.attachmentLoader.newPointAttachment(skin, name); + if (point == null) + return null; + point.x = this.getValue(map, "x", 0) * scale; + point.y = this.getValue(map, "y", 0) * scale; + point.rotation = this.getValue(map, "rotation", 0); + var color = this.getValue(map, "color", null); + if (color != null) + point.color.setFromString(color); + return point; + } + case "clipping": { + var clip = this.attachmentLoader.newClippingAttachment(skin, name); + if (clip == null) + return null; + var end = this.getValue(map, "end", null); + if (end != null) { + var slot = skeletonData.findSlot(end); + if (slot == null) + throw new Error("Clipping end slot not found: " + end); + clip.endSlot = slot; + } + var vertexCount = map.vertexCount; + this.readVertices(map, clip, vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + clip.color.setFromString(color); + return clip; + } + } + return null; + }; + SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) { + var scale = this.scale; + attachment.worldVerticesLength = verticesLength; + var vertices = map.vertices; + if (verticesLength == vertices.length) { + var scaledVertices = spine.Utils.toFloatArray(vertices); + if (scale != 1) { + for (var i = 0, n = vertices.length; i < n; i++) + scaledVertices[i] *= scale; + } + attachment.vertices = scaledVertices; + return; + } + var weights = new Array(); + var bones = new Array(); + for (var i = 0, n = vertices.length; i < n;) { + var boneCount = vertices[i++]; + bones.push(boneCount); + for (var nn = i + boneCount * 4; i < nn; i += 4) { + bones.push(vertices[i]); + weights.push(vertices[i + 1] * scale); + weights.push(vertices[i + 2] * scale); + weights.push(vertices[i + 3]); + } + } + attachment.bones = bones; + attachment.vertices = spine.Utils.toFloatArray(weights); + }; + SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) { + var scale = this.scale; + var timelines = new Array(); + var duration = 0; + if (map.slots) { + for (var slotName in map.slots) { + var slotMap = map.slots[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + if (timelineName == "attachment") { + var timeline = new spine.AttachmentTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex++, valueMap.time, valueMap.name); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + else if (timelineName == "color") { + var timeline = new spine.ColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var color = new spine.Color(); + color.setFromString(valueMap.color); + timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]); + } + else if (timelineName == "twoColor") { + var timeline = new spine.TwoColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var light = new spine.Color(); + var dark = new spine.Color(); + light.setFromString(valueMap.light); + dark.setFromString(valueMap.dark); + timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"); + } + } + } + if (map.bones) { + for (var boneName in map.bones) { + var boneMap = map.bones[boneName]; + var boneIndex = skeletonData.findBoneIndex(boneName); + if (boneIndex == -1) + throw new Error("Bone not found: " + boneName); + for (var timelineName in boneMap) { + var timelineMap = boneMap[timelineName]; + if (timelineName === "rotate") { + var timeline = new spine.RotateTimeline(timelineMap.length); + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, valueMap.angle); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]); + } + else if (timelineName === "translate" || timelineName === "scale" || timelineName === "shear") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "scale") + timeline = new spine.ScaleTimeline(timelineMap.length); + else if (timelineName === "shear") + timeline = new spine.ShearTimeline(timelineMap.length); + else { + timeline = new spine.TranslateTimeline(timelineMap.length); + timelineScale = scale; + } + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var x = this.getValue(valueMap, "x", 0), y = this.getValue(valueMap, "y", 0); + timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"); + } + } + } + if (map.ik) { + for (var constraintName in map.ik) { + var constraintMap = map.ik[constraintName]; + var constraint = skeletonData.findIkConstraint(constraintName); + var timeline = new spine.IkConstraintTimeline(constraintMap.length); + timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "mix", 1), this.getValue(valueMap, "bendPositive", true) ? 1 : -1, this.getValue(valueMap, "compress", false), this.getValue(valueMap, "stretch", false)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]); + } + } + if (map.transform) { + for (var constraintName in map.transform) { + var constraintMap = map.transform[constraintName]; + var constraint = skeletonData.findTransformConstraint(constraintName); + var timeline = new spine.TransformConstraintTimeline(constraintMap.length); + timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1), this.getValue(valueMap, "scaleMix", 1), this.getValue(valueMap, "shearMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]); + } + } + if (map.paths) { + for (var constraintName in map.paths) { + var constraintMap = map.paths[constraintName]; + var index = skeletonData.findPathConstraintIndex(constraintName); + if (index == -1) + throw new Error("Path constraint not found: " + constraintName); + var data = skeletonData.pathConstraints[index]; + for (var timelineName in constraintMap) { + var timelineMap = constraintMap[timelineName]; + if (timelineName === "position" || timelineName === "spacing") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "spacing") { + timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + timelineScale = scale; + } + else { + timeline = new spine.PathConstraintPositionTimeline(timelineMap.length); + if (data.positionMode == spine.PositionMode.Fixed) + timelineScale = scale; + } + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]); + } + else if (timelineName === "mix") { + var timeline = new spine.PathConstraintMixTimeline(timelineMap.length); + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]); + } + } + } + } + if (map.deform) { + for (var deformName in map.deform) { + var deformMap = map.deform[deformName]; + var skin = skeletonData.findSkin(deformName); + if (skin == null) + throw new Error("Skin not found: " + deformName); + for (var slotName in deformMap) { + var slotMap = deformMap[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotMap.name); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + var attachment = skin.getAttachment(slotIndex, timelineName); + if (attachment == null) + throw new Error("Deform attachment not found: " + timelineMap.name); + var weighted = attachment.bones != null; + var vertices = attachment.vertices; + var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; + var timeline = new spine.DeformTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + timeline.attachment = attachment; + var frameIndex = 0; + for (var j = 0; j < timelineMap.length; j++) { + var valueMap = timelineMap[j]; + var deform = void 0; + var verticesValue = this.getValue(valueMap, "vertices", null); + if (verticesValue == null) + deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices; + else { + deform = spine.Utils.newFloatArray(deformLength); + var start = this.getValue(valueMap, "offset", 0); + spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); + if (scale != 1) { + for (var i = start, n = i + verticesValue.length; i < n; i++) + deform[i] *= scale; + } + if (!weighted) { + for (var i = 0; i < deformLength; i++) + deform[i] += vertices[i]; + } + } + timeline.setFrame(frameIndex, valueMap.time, deform); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + } + } + } + var drawOrderNode = map.drawOrder; + if (drawOrderNode == null) + drawOrderNode = map.draworder; + if (drawOrderNode != null) { + var timeline = new spine.DrawOrderTimeline(drawOrderNode.length); + var slotCount = skeletonData.slots.length; + var frameIndex = 0; + for (var j = 0; j < drawOrderNode.length; j++) { + var drawOrderMap = drawOrderNode[j]; + var drawOrder = null; + var offsets = this.getValue(drawOrderMap, "offsets", null); + if (offsets != null) { + drawOrder = spine.Utils.newArray(slotCount, -1); + var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0); + var originalIndex = 0, unchangedIndex = 0; + for (var i = 0; i < offsets.length; i++) { + var offsetMap = offsets[i]; + var slotIndex = skeletonData.findSlotIndex(offsetMap.slot); + if (slotIndex == -1) + throw new Error("Slot not found: " + offsetMap.slot); + while (originalIndex != slotIndex) + unchanged[unchangedIndex++] = originalIndex++; + drawOrder[originalIndex + offsetMap.offset] = originalIndex++; + } + while (originalIndex < slotCount) + unchanged[unchangedIndex++] = originalIndex++; + for (var i = slotCount - 1; i >= 0; i--) + if (drawOrder[i] == -1) + drawOrder[i] = unchanged[--unchangedIndex]; + } + timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (map.events) { + var timeline = new spine.EventTimeline(map.events.length); + var frameIndex = 0; + for (var i = 0; i < map.events.length; i++) { + var eventMap = map.events[i]; + var eventData = skeletonData.findEvent(eventMap.name); + if (eventData == null) + throw new Error("Event not found: " + eventMap.name); + var event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData); + event_5.intValue = this.getValue(eventMap, "int", eventData.intValue); + event_5.floatValue = this.getValue(eventMap, "float", eventData.floatValue); + event_5.stringValue = this.getValue(eventMap, "string", eventData.stringValue); + if (event_5.data.audioPath != null) { + event_5.volume = this.getValue(eventMap, "volume", 1); + event_5.balance = this.getValue(eventMap, "balance", 0); + } + timeline.setFrame(frameIndex++, event_5); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (isNaN(duration)) { + throw new Error("Error while parsing animation, duration is NaN"); + } + skeletonData.animations.push(new spine.Animation(name, timelines, duration)); + }; + SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) { + if (!map.curve) + return; + if (map.curve === "stepped") + timeline.setStepped(frameIndex); + else if (Object.prototype.toString.call(map.curve) === '[object Array]') { + var curve = map.curve; + timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); + } + }; + SkeletonJson.prototype.getValue = function (map, prop, defaultValue) { + return map[prop] !== undefined ? map[prop] : defaultValue; + }; + SkeletonJson.blendModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.BlendMode.Normal; + if (str == "additive") + return spine.BlendMode.Additive; + if (str == "multiply") + return spine.BlendMode.Multiply; + if (str == "screen") + return spine.BlendMode.Screen; + throw new Error("Unknown blend mode: " + str); + }; + SkeletonJson.positionModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "fixed") + return spine.PositionMode.Fixed; + if (str == "percent") + return spine.PositionMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.spacingModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "length") + return spine.SpacingMode.Length; + if (str == "fixed") + return spine.SpacingMode.Fixed; + if (str == "percent") + return spine.SpacingMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.rotateModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "tangent") + return spine.RotateMode.Tangent; + if (str == "chain") + return spine.RotateMode.Chain; + if (str == "chainscale") + return spine.RotateMode.ChainScale; + throw new Error("Unknown rotate mode: " + str); + }; + SkeletonJson.transformModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.TransformMode.Normal; + if (str == "onlytranslation") + return spine.TransformMode.OnlyTranslation; + if (str == "norotationorreflection") + return spine.TransformMode.NoRotationOrReflection; + if (str == "noscale") + return spine.TransformMode.NoScale; + if (str == "noscaleorreflection") + return spine.TransformMode.NoScaleOrReflection; + throw new Error("Unknown transform mode: " + str); + }; + return SkeletonJson; + }()); + spine.SkeletonJson = SkeletonJson; + var LinkedMesh = (function () { + function LinkedMesh(mesh, skin, slotIndex, parent) { + this.mesh = mesh; + this.skin = skin; + this.slotIndex = slotIndex; + this.parent = parent; + } + return LinkedMesh; + }()); +})(spine || (spine = {})); +var spine; +(function (spine) { + var Skin = (function () { + function Skin(name) { + this.attachments = new Array(); + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + Skin.prototype.addAttachment = function (slotIndex, name, attachment) { + if (attachment == null) + throw new Error("attachment cannot be null."); + var attachments = this.attachments; + if (slotIndex >= attachments.length) + attachments.length = slotIndex + 1; + if (!attachments[slotIndex]) + attachments[slotIndex] = {}; + attachments[slotIndex][name] = attachment; + }; + Skin.prototype.getAttachment = function (slotIndex, name) { + var dictionary = this.attachments[slotIndex]; + return dictionary ? dictionary[name] : null; + }; + Skin.prototype.attachAll = function (skeleton, oldSkin) { + var slotIndex = 0; + for (var i = 0; i < skeleton.slots.length; i++) { + var slot = skeleton.slots[i]; + var slotAttachment = slot.getAttachment(); + if (slotAttachment && slotIndex < oldSkin.attachments.length) { + var dictionary = oldSkin.attachments[slotIndex]; + for (var key in dictionary) { + var skinAttachment = dictionary[key]; + if (slotAttachment == skinAttachment) { + var attachment = this.getAttachment(slotIndex, key); + if (attachment != null) + slot.setAttachment(attachment); + break; + } + } + } + slotIndex++; + } + }; + return Skin; + }()); + spine.Skin = Skin; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Slot = (function () { + function Slot(data, bone) { + this.attachmentVertices = new Array(); + if (data == null) + throw new Error("data cannot be null."); + if (bone == null) + throw new Error("bone cannot be null."); + this.data = data; + this.bone = bone; + this.color = new spine.Color(); + this.darkColor = data.darkColor == null ? null : new spine.Color(); + this.setToSetupPose(); + } + Slot.prototype.getAttachment = function () { + return this.attachment; + }; + Slot.prototype.setAttachment = function (attachment) { + if (this.attachment == attachment) + return; + this.attachment = attachment; + this.attachmentTime = this.bone.skeleton.time; + this.attachmentVertices.length = 0; + }; + Slot.prototype.setAttachmentTime = function (time) { + this.attachmentTime = this.bone.skeleton.time - time; + }; + Slot.prototype.getAttachmentTime = function () { + return this.bone.skeleton.time - this.attachmentTime; + }; + Slot.prototype.setToSetupPose = function () { + this.color.setFromColor(this.data.color); + if (this.darkColor != null) + this.darkColor.setFromColor(this.data.darkColor); + if (this.data.attachmentName == null) + this.attachment = null; + else { + this.attachment = null; + this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)); + } + }; + return Slot; + }()); + spine.Slot = Slot; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SlotData = (function () { + function SlotData(index, name, boneData) { + this.color = new spine.Color(1, 1, 1, 1); + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + if (boneData == null) + throw new Error("boneData cannot be null."); + this.index = index; + this.name = name; + this.boneData = boneData; + } + return SlotData; + }()); + spine.SlotData = SlotData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Texture = (function () { + function Texture(image) { + this._image = image; + } + Texture.prototype.getImage = function () { + return this._image; + }; + Texture.filterFromString = function (text) { + switch (text.toLowerCase()) { + case "nearest": return TextureFilter.Nearest; + case "linear": return TextureFilter.Linear; + case "mipmap": return TextureFilter.MipMap; + case "mipmapnearestnearest": return TextureFilter.MipMapNearestNearest; + case "mipmaplinearnearest": return TextureFilter.MipMapLinearNearest; + case "mipmapnearestlinear": return TextureFilter.MipMapNearestLinear; + case "mipmaplinearlinear": return TextureFilter.MipMapLinearLinear; + default: throw new Error("Unknown texture filter " + text); + } + }; + Texture.wrapFromString = function (text) { + switch (text.toLowerCase()) { + case "mirroredtepeat": return TextureWrap.MirroredRepeat; + case "clamptoedge": return TextureWrap.ClampToEdge; + case "repeat": return TextureWrap.Repeat; + default: throw new Error("Unknown texture wrap " + text); + } + }; + return Texture; + }()); + spine.Texture = Texture; + var TextureFilter; + (function (TextureFilter) { + TextureFilter[TextureFilter["Nearest"] = 9728] = "Nearest"; + TextureFilter[TextureFilter["Linear"] = 9729] = "Linear"; + TextureFilter[TextureFilter["MipMap"] = 9987] = "MipMap"; + TextureFilter[TextureFilter["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; + TextureFilter[TextureFilter["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; + TextureFilter[TextureFilter["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; + TextureFilter[TextureFilter["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; + })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {})); + var TextureWrap; + (function (TextureWrap) { + TextureWrap[TextureWrap["MirroredRepeat"] = 33648] = "MirroredRepeat"; + TextureWrap[TextureWrap["ClampToEdge"] = 33071] = "ClampToEdge"; + TextureWrap[TextureWrap["Repeat"] = 10497] = "Repeat"; + })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {})); + var TextureRegion = (function () { + function TextureRegion() { + this.u = 0; + this.v = 0; + this.u2 = 0; + this.v2 = 0; + this.width = 0; + this.height = 0; + this.rotate = false; + this.offsetX = 0; + this.offsetY = 0; + this.originalWidth = 0; + this.originalHeight = 0; + } + return TextureRegion; + }()); + spine.TextureRegion = TextureRegion; + var FakeTexture = (function (_super) { + __extends(FakeTexture, _super); + function FakeTexture() { + return _super !== null && _super.apply(this, arguments) || this; + } + FakeTexture.prototype.setFilters = function (minFilter, magFilter) { }; + FakeTexture.prototype.setWraps = function (uWrap, vWrap) { }; + FakeTexture.prototype.dispose = function () { }; + return FakeTexture; + }(Texture)); + spine.FakeTexture = FakeTexture; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TextureAtlas = (function () { + function TextureAtlas(atlasText, textureLoader) { + this.pages = new Array(); + this.regions = new Array(); + this.load(atlasText, textureLoader); + } + TextureAtlas.prototype.load = function (atlasText, textureLoader) { + if (textureLoader == null) + throw new Error("textureLoader cannot be null."); + var reader = new TextureAtlasReader(atlasText); + var tuple = new Array(4); + var page = null; + while (true) { + var line = reader.readLine(); + if (line == null) + break; + line = line.trim(); + if (line.length == 0) + page = null; + else if (!page) { + page = new TextureAtlasPage(); + page.name = line; + if (reader.readTuple(tuple) == 2) { + page.width = parseInt(tuple[0]); + page.height = parseInt(tuple[1]); + reader.readTuple(tuple); + } + reader.readTuple(tuple); + page.minFilter = spine.Texture.filterFromString(tuple[0]); + page.magFilter = spine.Texture.filterFromString(tuple[1]); + var direction = reader.readValue(); + page.uWrap = spine.TextureWrap.ClampToEdge; + page.vWrap = spine.TextureWrap.ClampToEdge; + if (direction == "x") + page.uWrap = spine.TextureWrap.Repeat; + else if (direction == "y") + page.vWrap = spine.TextureWrap.Repeat; + else if (direction == "xy") + page.uWrap = page.vWrap = spine.TextureWrap.Repeat; + page.texture = textureLoader(line); + page.texture.setFilters(page.minFilter, page.magFilter); + page.texture.setWraps(page.uWrap, page.vWrap); + page.width = page.texture.getImage().width; + page.height = page.texture.getImage().height; + this.pages.push(page); + } + else { + var region = new TextureAtlasRegion(); + region.name = line; + region.page = page; + region.rotate = reader.readValue() == "true"; + reader.readTuple(tuple); + var x = parseInt(tuple[0]); + var y = parseInt(tuple[1]); + reader.readTuple(tuple); + var width = parseInt(tuple[0]); + var height = parseInt(tuple[1]); + region.u = x / page.width; + region.v = y / page.height; + if (region.rotate) { + region.u2 = (x + height) / page.width; + region.v2 = (y + width) / page.height; + } + else { + region.u2 = (x + width) / page.width; + region.v2 = (y + height) / page.height; + } + region.x = x; + region.y = y; + region.width = Math.abs(width); + region.height = Math.abs(height); + if (reader.readTuple(tuple) == 4) { + if (reader.readTuple(tuple) == 4) { + reader.readTuple(tuple); + } + } + region.originalWidth = parseInt(tuple[0]); + region.originalHeight = parseInt(tuple[1]); + reader.readTuple(tuple); + region.offsetX = parseInt(tuple[0]); + region.offsetY = parseInt(tuple[1]); + region.index = parseInt(reader.readValue()); + region.texture = page.texture; + this.regions.push(region); + } + } + }; + TextureAtlas.prototype.findRegion = function (name) { + for (var i = 0; i < this.regions.length; i++) { + if (this.regions[i].name == name) { + return this.regions[i]; + } + } + return null; + }; + TextureAtlas.prototype.dispose = function () { + for (var i = 0; i < this.pages.length; i++) { + this.pages[i].texture.dispose(); + } + }; + return TextureAtlas; + }()); + spine.TextureAtlas = TextureAtlas; + var TextureAtlasReader = (function () { + function TextureAtlasReader(text) { + this.index = 0; + this.lines = text.split(/\r\n|\r|\n/); + } + TextureAtlasReader.prototype.readLine = function () { + if (this.index >= this.lines.length) + return null; + return this.lines[this.index++]; + }; + TextureAtlasReader.prototype.readValue = function () { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + return line.substring(colon + 1).trim(); + }; + TextureAtlasReader.prototype.readTuple = function (tuple) { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + var i = 0, lastMatch = colon + 1; + for (; i < 3; i++) { + var comma = line.indexOf(",", lastMatch); + if (comma == -1) + break; + tuple[i] = line.substr(lastMatch, comma - lastMatch).trim(); + lastMatch = comma + 1; + } + tuple[i] = line.substring(lastMatch).trim(); + return i + 1; + }; + return TextureAtlasReader; + }()); + var TextureAtlasPage = (function () { + function TextureAtlasPage() { + } + return TextureAtlasPage; + }()); + spine.TextureAtlasPage = TextureAtlasPage; + var TextureAtlasRegion = (function (_super) { + __extends(TextureAtlasRegion, _super); + function TextureAtlasRegion() { + return _super !== null && _super.apply(this, arguments) || this; + } + return TextureAtlasRegion; + }(spine.TextureRegion)); + spine.TextureAtlasRegion = TextureAtlasRegion; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraint = (function () { + function TransformConstraint(data, skeleton) { + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.temp = new spine.Vector2(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + this.scaleMix = data.scaleMix; + this.shearMix = data.shearMix; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + TransformConstraint.prototype.apply = function () { + this.update(); + }; + TransformConstraint.prototype.update = function () { + if (this.data.local) { + if (this.data.relative) + this.applyRelativeLocal(); + else + this.applyAbsoluteLocal(); + } + else { + if (this.data.relative) + this.applyRelativeWorld(); + else + this.applyAbsoluteWorld(); + } + }; + TransformConstraint.prototype.applyAbsoluteWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect; + var offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += (temp.x - bone.worldX) * translateMix; + bone.worldY += (temp.y - bone.worldY) * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c); + var ts = Math.sqrt(ta * ta + tc * tc); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s; + bone.a *= s; + bone.c *= s; + s = Math.sqrt(bone.b * bone.b + bone.d * bone.d); + ts = Math.sqrt(tb * tb + td * td); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var b = bone.b, d = bone.d; + var by = Math.atan2(d, b); + var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a)); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r = by + (r + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyRelativeWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += temp.x * translateMix; + bone.worldY += temp.y * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1; + bone.a *= s; + bone.c *= s; + s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var r = Math.atan2(td, tb) - Math.atan2(tc, ta); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + var b = bone.b, d = bone.d; + r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyAbsoluteLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) { + var r = target.arotation - rotation + this.data.offsetRotation; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + rotation += r * rotateMix; + } + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax - x + this.data.offsetX) * translateMix; + y += (target.ay - y + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX; + if (scaleY > 0.00001) + scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY; + } + var shearY = bone.ashearY; + if (shearMix != 0) { + var r = target.ashearY - shearY + this.data.offsetShearY; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + bone.shearY += r * shearMix; + } + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.applyRelativeLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) + rotation += (target.arotation + this.data.offsetRotation) * rotateMix; + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax + this.data.offsetX) * translateMix; + y += (target.ay + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1; + if (scaleY > 0.00001) + scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1; + } + var shearY = bone.ashearY; + if (shearMix != 0) + shearY += (target.ashearY + this.data.offsetShearY) * shearMix; + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.getOrder = function () { + return this.data.order; + }; + return TransformConstraint; + }()); + spine.TransformConstraint = TransformConstraint; +})(spine || (spine = {})); +var spine; +(function (spine) { + var TransformConstraintData = (function () { + function TransformConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.offsetRotation = 0; + this.offsetX = 0; + this.offsetY = 0; + this.offsetScaleX = 0; + this.offsetScaleY = 0; + this.offsetShearY = 0; + this.relative = false; + this.local = false; + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return TransformConstraintData; + }()); + spine.TransformConstraintData = TransformConstraintData; +})(spine || (spine = {})); +var spine; +(function (spine) { + var Triangulator = (function () { + function Triangulator() { + this.convexPolygons = new Array(); + this.convexPolygonsIndices = new Array(); + this.indicesArray = new Array(); + this.isConcaveArray = new Array(); + this.triangles = new Array(); + this.polygonPool = new spine.Pool(function () { + return new Array(); + }); + this.polygonIndicesPool = new spine.Pool(function () { + return new Array(); + }); + } + Triangulator.prototype.triangulate = function (verticesArray) { + var vertices = verticesArray; + var vertexCount = verticesArray.length >> 1; + var indices = this.indicesArray; + indices.length = 0; + for (var i = 0; i < vertexCount; i++) + indices[i] = i; + var isConcave = this.isConcaveArray; + isConcave.length = 0; + for (var i = 0, n = vertexCount; i < n; ++i) + isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices); + var triangles = this.triangles; + triangles.length = 0; + while (vertexCount > 3) { + var previous = vertexCount - 1, i = 0, next = 1; + while (true) { + outer: if (!isConcave[i]) { + var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; + var p1x = vertices[p1], p1y = vertices[p1 + 1]; + var p2x = vertices[p2], p2y = vertices[p2 + 1]; + var p3x = vertices[p3], p3y = vertices[p3 + 1]; + for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { + if (!isConcave[ii]) + continue; + var v = indices[ii] << 1; + var vx = vertices[v], vy = vertices[v + 1]; + if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { + if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { + if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) + break outer; + } + } + } + break; + } + if (next == 0) { + do { + if (!isConcave[i]) + break; + i--; + } while (i > 0); + break; + } + previous = i; + i = next; + next = (next + 1) % vertexCount; + } + triangles.push(indices[(vertexCount + i - 1) % vertexCount]); + triangles.push(indices[i]); + triangles.push(indices[(i + 1) % vertexCount]); + indices.splice(i, 1); + isConcave.splice(i, 1); + vertexCount--; + var previousIndex = (vertexCount + i - 1) % vertexCount; + var nextIndex = i == vertexCount ? 0 : i; + isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices); + isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices); + } + if (vertexCount == 3) { + triangles.push(indices[2]); + triangles.push(indices[0]); + triangles.push(indices[1]); + } + return triangles; + }; + Triangulator.prototype.decompose = function (verticesArray, triangles) { + var vertices = verticesArray; + var convexPolygons = this.convexPolygons; + this.polygonPool.freeAll(convexPolygons); + convexPolygons.length = 0; + var convexPolygonsIndices = this.convexPolygonsIndices; + this.polygonIndicesPool.freeAll(convexPolygonsIndices); + convexPolygonsIndices.length = 0; + var polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + var polygon = this.polygonPool.obtain(); + polygon.length = 0; + var fanBaseIndex = -1, lastWinding = 0; + for (var i = 0, n = triangles.length; i < n; i += 3) { + var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; + var x1 = vertices[t1], y1 = vertices[t1 + 1]; + var x2 = vertices[t2], y2 = vertices[t2 + 1]; + var x3 = vertices[t3], y3 = vertices[t3 + 1]; + var merged = false; + if (fanBaseIndex == t1) { + var o = polygon.length - 4; + var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); + var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]); + if (winding1 == lastWinding && winding2 == lastWinding) { + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(t3); + merged = true; + } + } + if (!merged) { + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + else { + this.polygonPool.free(polygon); + this.polygonIndicesPool.free(polygonIndices); + } + polygon = this.polygonPool.obtain(); + polygon.length = 0; + polygon.push(x1); + polygon.push(y1); + polygon.push(x2); + polygon.push(y2); + polygon.push(x3); + polygon.push(y3); + polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + polygonIndices.push(t1); + polygonIndices.push(t2); + polygonIndices.push(t3); + lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3); + fanBaseIndex = t1; + } + } + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + for (var i = 0, n = convexPolygons.length; i < n; i++) { + polygonIndices = convexPolygonsIndices[i]; + if (polygonIndices.length == 0) + continue; + var firstIndex = polygonIndices[0]; + var lastIndex = polygonIndices[polygonIndices.length - 1]; + polygon = convexPolygons[i]; + var o = polygon.length - 4; + var prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; + var prevX = polygon[o + 2], prevY = polygon[o + 3]; + var firstX = polygon[0], firstY = polygon[1]; + var secondX = polygon[2], secondY = polygon[3]; + var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); + for (var ii = 0; ii < n; ii++) { + if (ii == i) + continue; + var otherIndices = convexPolygonsIndices[ii]; + if (otherIndices.length != 3) + continue; + var otherFirstIndex = otherIndices[0]; + var otherSecondIndex = otherIndices[1]; + var otherLastIndex = otherIndices[2]; + var otherPoly = convexPolygons[ii]; + var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; + if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) + continue; + var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); + var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY); + if (winding1 == winding && winding2 == winding) { + otherPoly.length = 0; + otherIndices.length = 0; + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(otherLastIndex); + prevPrevX = prevX; + prevPrevY = prevY; + prevX = x3; + prevY = y3; + ii = 0; + } + } + } + for (var i = convexPolygons.length - 1; i >= 0; i--) { + polygon = convexPolygons[i]; + if (polygon.length == 0) { + convexPolygons.splice(i, 1); + this.polygonPool.free(polygon); + polygonIndices = convexPolygonsIndices[i]; + convexPolygonsIndices.splice(i, 1); + this.polygonIndicesPool.free(polygonIndices); + } + } + return convexPolygons; + }; + Triangulator.isConcave = function (index, vertexCount, vertices, indices) { + var previous = indices[(vertexCount + index - 1) % vertexCount] << 1; + var current = indices[index] << 1; + var next = indices[(index + 1) % vertexCount] << 1; + return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); + }; + Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) { + return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; + }; + Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) { + var px = p2x - p1x, py = p2y - p1y; + return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; + }; + return Triangulator; + }()); + spine.Triangulator = Triangulator; +})(spine || (spine = {})); +var spine; +(function (spine) { + var IntSet = (function () { + function IntSet() { + this.array = new Array(); + } + IntSet.prototype.add = function (value) { + var contains = this.contains(value); + this.array[value | 0] = value | 0; + return !contains; + }; + IntSet.prototype.contains = function (value) { + return this.array[value | 0] != undefined; + }; + IntSet.prototype.remove = function (value) { + this.array[value | 0] = undefined; + }; + IntSet.prototype.clear = function () { + this.array.length = 0; + }; + return IntSet; + }()); + spine.IntSet = IntSet; + var Color = (function () { + function Color(r, g, b, a) { + if (r === void 0) { r = 0; } + if (g === void 0) { g = 0; } + if (b === void 0) { b = 0; } + if (a === void 0) { a = 0; } + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + Color.prototype.set = function (r, g, b, a) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + this.clamp(); + return this; + }; + Color.prototype.setFromColor = function (c) { + this.r = c.r; + this.g = c.g; + this.b = c.b; + this.a = c.a; + return this; + }; + Color.prototype.setFromString = function (hex) { + hex = hex.charAt(0) == '#' ? hex.substr(1) : hex; + this.r = parseInt(hex.substr(0, 2), 16) / 255.0; + this.g = parseInt(hex.substr(2, 2), 16) / 255.0; + this.b = parseInt(hex.substr(4, 2), 16) / 255.0; + this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0; + return this; + }; + Color.prototype.add = function (r, g, b, a) { + this.r += r; + this.g += g; + this.b += b; + this.a += a; + this.clamp(); + return this; + }; + Color.prototype.clamp = function () { + if (this.r < 0) + this.r = 0; + else if (this.r > 1) + this.r = 1; + if (this.g < 0) + this.g = 0; + else if (this.g > 1) + this.g = 1; + if (this.b < 0) + this.b = 0; + else if (this.b > 1) + this.b = 1; + if (this.a < 0) + this.a = 0; + else if (this.a > 1) + this.a = 1; + return this; + }; + Color.WHITE = new Color(1, 1, 1, 1); + Color.RED = new Color(1, 0, 0, 1); + Color.GREEN = new Color(0, 1, 0, 1); + Color.BLUE = new Color(0, 0, 1, 1); + Color.MAGENTA = new Color(1, 0, 1, 1); + return Color; + }()); + spine.Color = Color; + var MathUtils = (function () { + function MathUtils() { + } + MathUtils.clamp = function (value, min, max) { + if (value < min) + return min; + if (value > max) + return max; + return value; + }; + MathUtils.cosDeg = function (degrees) { + return Math.cos(degrees * MathUtils.degRad); + }; + MathUtils.sinDeg = function (degrees) { + return Math.sin(degrees * MathUtils.degRad); + }; + MathUtils.signum = function (value) { + return value > 0 ? 1 : value < 0 ? -1 : 0; + }; + MathUtils.toInt = function (x) { + return x > 0 ? Math.floor(x) : Math.ceil(x); + }; + MathUtils.cbrt = function (x) { + var y = Math.pow(Math.abs(x), 1 / 3); + return x < 0 ? -y : y; + }; + MathUtils.randomTriangular = function (min, max) { + return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); + }; + MathUtils.randomTriangularWith = function (min, max, mode) { + var u = Math.random(); + var d = max - min; + if (u <= (mode - min) / d) + return min + Math.sqrt(u * d * (mode - min)); + return max - Math.sqrt((1 - u) * d * (max - mode)); + }; + MathUtils.PI = 3.1415927; + MathUtils.PI2 = MathUtils.PI * 2; + MathUtils.radiansToDegrees = 180 / MathUtils.PI; + MathUtils.radDeg = MathUtils.radiansToDegrees; + MathUtils.degreesToRadians = MathUtils.PI / 180; + MathUtils.degRad = MathUtils.degreesToRadians; + return MathUtils; + }()); + spine.MathUtils = MathUtils; + var Interpolation = (function () { + function Interpolation() { + } + Interpolation.prototype.apply = function (start, end, a) { + return start + (end - start) * this.applyInternal(a); + }; + return Interpolation; + }()); + spine.Interpolation = Interpolation; + var Pow = (function (_super) { + __extends(Pow, _super); + function Pow(power) { + var _this = _super.call(this) || this; + _this.power = 2; + _this.power = power; + return _this; + } + Pow.prototype.applyInternal = function (a) { + if (a <= 0.5) + return Math.pow(a * 2, this.power) / 2; + return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1; + }; + return Pow; + }(Interpolation)); + spine.Pow = Pow; + var PowOut = (function (_super) { + __extends(PowOut, _super); + function PowOut(power) { + return _super.call(this, power) || this; + } + PowOut.prototype.applyInternal = function (a) { + return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1; + }; + return PowOut; + }(Pow)); + spine.PowOut = PowOut; + var Utils = (function () { + function Utils() { + } + Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) { + for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { + dest[j] = source[i]; + } + }; + Utils.setArraySize = function (array, size, value) { + if (value === void 0) { value = 0; } + var oldSize = array.length; + if (oldSize == size) + return array; + array.length = size; + if (oldSize < size) { + for (var i = oldSize; i < size; i++) + array[i] = value; + } + return array; + }; + Utils.ensureArrayCapacity = function (array, size, value) { + if (value === void 0) { value = 0; } + if (array.length >= size) + return array; + return Utils.setArraySize(array, size, value); + }; + Utils.newArray = function (size, defaultValue) { + var array = new Array(size); + for (var i = 0; i < size; i++) + array[i] = defaultValue; + return array; + }; + Utils.newFloatArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Float32Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.newShortArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Int16Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.toFloatArray = function (array) { + return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; + }; + Utils.toSinglePrecision = function (value) { + return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; + }; + Utils.webkit602BugfixHelper = function (alpha, blend) { + }; + Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== "undefined"; + return Utils; + }()); + spine.Utils = Utils; + var DebugUtils = (function () { + function DebugUtils() { + } + DebugUtils.logBones = function (skeleton) { + for (var i = 0; i < skeleton.bones.length; i++) { + var bone = skeleton.bones[i]; + console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY); + } + }; + return DebugUtils; + }()); + spine.DebugUtils = DebugUtils; + var Pool = (function () { + function Pool(instantiator) { + this.items = new Array(); + this.instantiator = instantiator; + } + Pool.prototype.obtain = function () { + return this.items.length > 0 ? this.items.pop() : this.instantiator(); + }; + Pool.prototype.free = function (item) { + if (item.reset) + item.reset(); + this.items.push(item); + }; + Pool.prototype.freeAll = function (items) { + for (var i = 0; i < items.length; i++) { + if (items[i].reset) + items[i].reset(); + this.items[i] = items[i]; + } + }; + Pool.prototype.clear = function () { + this.items.length = 0; + }; + return Pool; + }()); + spine.Pool = Pool; + var Vector2 = (function () { + function Vector2(x, y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + this.x = x; + this.y = y; + } + Vector2.prototype.set = function (x, y) { + this.x = x; + this.y = y; + return this; + }; + Vector2.prototype.length = function () { + var x = this.x; + var y = this.y; + return Math.sqrt(x * x + y * y); + }; + Vector2.prototype.normalize = function () { + var len = this.length(); + if (len != 0) { + this.x /= len; + this.y /= len; + } + return this; + }; + return Vector2; + }()); + spine.Vector2 = Vector2; + var TimeKeeper = (function () { + function TimeKeeper() { + this.maxDelta = 0.064; + this.framesPerSecond = 0; + this.delta = 0; + this.totalTime = 0; + this.lastTime = Date.now() / 1000; + this.frameCount = 0; + this.frameTime = 0; + } + TimeKeeper.prototype.update = function () { + var now = Date.now() / 1000; + this.delta = now - this.lastTime; + this.frameTime += this.delta; + this.totalTime += this.delta; + if (this.delta > this.maxDelta) + this.delta = this.maxDelta; + this.lastTime = now; + this.frameCount++; + if (this.frameTime > 1) { + this.framesPerSecond = this.frameCount / this.frameTime; + this.frameTime = 0; + this.frameCount = 0; + } + }; + return TimeKeeper; + }()); + spine.TimeKeeper = TimeKeeper; + var WindowedMean = (function () { + function WindowedMean(windowSize) { + if (windowSize === void 0) { windowSize = 32; } + this.addedValues = 0; + this.lastValue = 0; + this.mean = 0; + this.dirty = true; + this.values = new Array(windowSize); + } + WindowedMean.prototype.hasEnoughData = function () { + return this.addedValues >= this.values.length; + }; + WindowedMean.prototype.addValue = function (value) { + if (this.addedValues < this.values.length) + this.addedValues++; + this.values[this.lastValue++] = value; + if (this.lastValue > this.values.length - 1) + this.lastValue = 0; + this.dirty = true; + }; + WindowedMean.prototype.getMean = function () { + if (this.hasEnoughData()) { + if (this.dirty) { + var mean = 0; + for (var i = 0; i < this.values.length; i++) { + mean += this.values[i]; + } + this.mean = mean / this.values.length; + this.dirty = false; + } + return this.mean; + } + else { + return 0; + } + }; + return WindowedMean; + }()); + spine.WindowedMean = WindowedMean; +})(spine || (spine = {})); +(function () { + if (!Math.fround) { + Math.fround = (function (array) { + return function (x) { + return array[0] = x, array[0]; + }; + })(new Float32Array(1)); + } +})(); +var spine; +(function (spine) { + var Attachment = (function () { + function Attachment(name) { + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return Attachment; + }()); + spine.Attachment = Attachment; + var VertexAttachment = (function (_super) { + __extends(VertexAttachment, _super); + function VertexAttachment(name) { + var _this = _super.call(this, name) || this; + _this.id = (VertexAttachment.nextID++ & 65535) << 11; + _this.worldVerticesLength = 0; + return _this; + } + VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) { + count = offset + (count >> 1) * stride; + var skeleton = slot.bone.skeleton; + var deformArray = slot.attachmentVertices; + var vertices = this.vertices; + var bones = this.bones; + if (bones == null) { + if (deformArray.length > 0) + vertices = deformArray; + var bone = slot.bone; + var x = bone.worldX; + var y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) { + var vx = vertices[v_1], vy = vertices[v_1 + 1]; + worldVertices[w] = vx * a + vy * b + x; + worldVertices[w + 1] = vx * c + vy * d + y; + } + return; + } + var v = 0, skip = 0; + for (var i = 0; i < start; i += 2) { + var n = bones[v]; + v += n + 1; + skip += n; + } + var skeletonBones = skeleton.bones; + if (deformArray.length == 0) { + for (var w = offset, b = skip * 3; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + else { + var deform = deformArray; + for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3, f += 2) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + }; + VertexAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment; + }; + VertexAttachment.nextID = 0; + return VertexAttachment; + }(Attachment)); + spine.VertexAttachment = VertexAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var AttachmentType; + (function (AttachmentType) { + AttachmentType[AttachmentType["Region"] = 0] = "Region"; + AttachmentType[AttachmentType["BoundingBox"] = 1] = "BoundingBox"; + AttachmentType[AttachmentType["Mesh"] = 2] = "Mesh"; + AttachmentType[AttachmentType["LinkedMesh"] = 3] = "LinkedMesh"; + AttachmentType[AttachmentType["Path"] = 4] = "Path"; + AttachmentType[AttachmentType["Point"] = 5] = "Point"; + })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var BoundingBoxAttachment = (function (_super) { + __extends(BoundingBoxAttachment, _super); + function BoundingBoxAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return BoundingBoxAttachment; + }(spine.VertexAttachment)); + spine.BoundingBoxAttachment = BoundingBoxAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var ClippingAttachment = (function (_super) { + __extends(ClippingAttachment, _super); + function ClippingAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1); + return _this; + } + return ClippingAttachment; + }(spine.VertexAttachment)); + spine.ClippingAttachment = ClippingAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var MeshAttachment = (function (_super) { + __extends(MeshAttachment, _super); + function MeshAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + _this.inheritDeform = false; + _this.tempColor = new spine.Color(0, 0, 0, 0); + return _this; + } + MeshAttachment.prototype.updateUVs = function () { + var regionUVs = this.regionUVs; + if (this.uvs == null || this.uvs.length != regionUVs.length) + this.uvs = spine.Utils.newFloatArray(regionUVs.length); + var uvs = this.uvs; + var u = 0, v = 0, width = 0, height = 0; + if (this.region instanceof spine.TextureAtlasRegion) { + var region = this.region; + var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height; + if (region.rotate) { + u = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth; + v = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight; + width = region.originalHeight / textureWidth; + height = region.originalWidth / textureHeight; + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i + 1] * width; + uvs[i + 1] = v + height - regionUVs[i] * height; + } + return; + } + u = region.u - region.offsetX / textureWidth; + v = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight; + width = region.originalWidth / textureWidth; + height = region.originalHeight / textureHeight; + } + else if (this.region == null) { + u = v = 0; + width = height = 1; + } + else { + u = this.region.u; + v = this.region.v; + width = this.region.u2 - u; + height = this.region.v2 - v; + } + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i] * width; + uvs[i + 1] = v + regionUVs[i + 1] * height; + } + }; + MeshAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment); + }; + MeshAttachment.prototype.getParentMesh = function () { + return this.parentMesh; + }; + MeshAttachment.prototype.setParentMesh = function (parentMesh) { + this.parentMesh = parentMesh; + if (parentMesh != null) { + this.bones = parentMesh.bones; + this.vertices = parentMesh.vertices; + this.worldVerticesLength = parentMesh.worldVerticesLength; + this.regionUVs = parentMesh.regionUVs; + this.triangles = parentMesh.triangles; + this.hullLength = parentMesh.hullLength; + this.worldVerticesLength = parentMesh.worldVerticesLength; + } + }; + return MeshAttachment; + }(spine.VertexAttachment)); + spine.MeshAttachment = MeshAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PathAttachment = (function (_super) { + __extends(PathAttachment, _super); + function PathAttachment(name) { + var _this = _super.call(this, name) || this; + _this.closed = false; + _this.constantSpeed = false; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return PathAttachment; + }(spine.VertexAttachment)); + spine.PathAttachment = PathAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var PointAttachment = (function (_super) { + __extends(PointAttachment, _super); + function PointAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.38, 0.94, 0, 1); + return _this; + } + PointAttachment.prototype.computeWorldPosition = function (bone, point) { + point.x = this.x * bone.a + this.y * bone.b + bone.worldX; + point.y = this.x * bone.c + this.y * bone.d + bone.worldY; + return point; + }; + PointAttachment.prototype.computeWorldRotation = function (bone) { + var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation); + var x = cos * bone.a + sin * bone.b; + var y = cos * bone.c + sin * bone.d; + return Math.atan2(y, x) * spine.MathUtils.radDeg; + }; + return PointAttachment; + }(spine.VertexAttachment)); + spine.PointAttachment = PointAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var RegionAttachment = (function (_super) { + __extends(RegionAttachment, _super); + function RegionAttachment(name) { + var _this = _super.call(this, name) || this; + _this.x = 0; + _this.y = 0; + _this.scaleX = 1; + _this.scaleY = 1; + _this.rotation = 0; + _this.width = 0; + _this.height = 0; + _this.color = new spine.Color(1, 1, 1, 1); + _this.offset = spine.Utils.newFloatArray(8); + _this.uvs = spine.Utils.newFloatArray(8); + _this.tempColor = new spine.Color(1, 1, 1, 1); + return _this; + } + RegionAttachment.prototype.updateOffset = function () { + var regionScaleX = this.width / this.region.originalWidth * this.scaleX; + var regionScaleY = this.height / this.region.originalHeight * this.scaleY; + var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; + var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; + var localX2 = localX + this.region.width * regionScaleX; + var localY2 = localY + this.region.height * regionScaleY; + var radians = this.rotation * Math.PI / 180; + var cos = Math.cos(radians); + var sin = Math.sin(radians); + var localXCos = localX * cos + this.x; + var localXSin = localX * sin; + var localYCos = localY * cos + this.y; + var localYSin = localY * sin; + var localX2Cos = localX2 * cos + this.x; + var localX2Sin = localX2 * sin; + var localY2Cos = localY2 * cos + this.y; + var localY2Sin = localY2 * sin; + var offset = this.offset; + offset[RegionAttachment.OX1] = localXCos - localYSin; + offset[RegionAttachment.OY1] = localYCos + localXSin; + offset[RegionAttachment.OX2] = localXCos - localY2Sin; + offset[RegionAttachment.OY2] = localY2Cos + localXSin; + offset[RegionAttachment.OX3] = localX2Cos - localY2Sin; + offset[RegionAttachment.OY3] = localY2Cos + localX2Sin; + offset[RegionAttachment.OX4] = localX2Cos - localYSin; + offset[RegionAttachment.OY4] = localYCos + localX2Sin; + }; + RegionAttachment.prototype.setRegion = function (region) { + this.region = region; + var uvs = this.uvs; + if (region.rotate) { + uvs[2] = region.u; + uvs[3] = region.v2; + uvs[4] = region.u; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v; + uvs[0] = region.u2; + uvs[1] = region.v2; + } + else { + uvs[0] = region.u; + uvs[1] = region.v2; + uvs[2] = region.u; + uvs[3] = region.v; + uvs[4] = region.u2; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v2; + } + }; + RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) { + var vertexOffset = this.offset; + var x = bone.worldX, y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var offsetX = 0, offsetY = 0; + offsetX = vertexOffset[RegionAttachment.OX1]; + offsetY = vertexOffset[RegionAttachment.OY1]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX2]; + offsetY = vertexOffset[RegionAttachment.OY2]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX3]; + offsetY = vertexOffset[RegionAttachment.OY3]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX4]; + offsetY = vertexOffset[RegionAttachment.OY4]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + }; + RegionAttachment.OX1 = 0; + RegionAttachment.OY1 = 1; + RegionAttachment.OX2 = 2; + RegionAttachment.OY2 = 3; + RegionAttachment.OX3 = 4; + RegionAttachment.OY3 = 5; + RegionAttachment.OX4 = 6; + RegionAttachment.OY4 = 7; + RegionAttachment.X1 = 0; + RegionAttachment.Y1 = 1; + RegionAttachment.C1R = 2; + RegionAttachment.C1G = 3; + RegionAttachment.C1B = 4; + RegionAttachment.C1A = 5; + RegionAttachment.U1 = 6; + RegionAttachment.V1 = 7; + RegionAttachment.X2 = 8; + RegionAttachment.Y2 = 9; + RegionAttachment.C2R = 10; + RegionAttachment.C2G = 11; + RegionAttachment.C2B = 12; + RegionAttachment.C2A = 13; + RegionAttachment.U2 = 14; + RegionAttachment.V2 = 15; + RegionAttachment.X3 = 16; + RegionAttachment.Y3 = 17; + RegionAttachment.C3R = 18; + RegionAttachment.C3G = 19; + RegionAttachment.C3B = 20; + RegionAttachment.C3A = 21; + RegionAttachment.U3 = 22; + RegionAttachment.V3 = 23; + RegionAttachment.X4 = 24; + RegionAttachment.Y4 = 25; + RegionAttachment.C4R = 26; + RegionAttachment.C4G = 27; + RegionAttachment.C4B = 28; + RegionAttachment.C4A = 29; + RegionAttachment.U4 = 30; + RegionAttachment.V4 = 31; + return RegionAttachment; + }(spine.Attachment)); + spine.RegionAttachment = RegionAttachment; +})(spine || (spine = {})); +var spine; +(function (spine) { + var JitterEffect = (function () { + function JitterEffect(jitterX, jitterY) { + this.jitterX = 0; + this.jitterY = 0; + this.jitterX = jitterX; + this.jitterY = jitterY; + } + JitterEffect.prototype.begin = function (skeleton) { + }; + JitterEffect.prototype.transform = function (position, uv, light, dark) { + position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + }; + JitterEffect.prototype.end = function () { + }; + return JitterEffect; + }()); + spine.JitterEffect = JitterEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var SwirlEffect = (function () { + function SwirlEffect(radius) { + this.centerX = 0; + this.centerY = 0; + this.radius = 0; + this.angle = 0; + this.worldX = 0; + this.worldY = 0; + this.radius = radius; + } + SwirlEffect.prototype.begin = function (skeleton) { + this.worldX = skeleton.x + this.centerX; + this.worldY = skeleton.y + this.centerY; + }; + SwirlEffect.prototype.transform = function (position, uv, light, dark) { + var radAngle = this.angle * spine.MathUtils.degreesToRadians; + var x = position.x - this.worldX; + var y = position.y - this.worldY; + var dist = Math.sqrt(x * x + y * y); + if (dist < this.radius) { + var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius); + var cos = Math.cos(theta); + var sin = Math.sin(theta); + position.x = cos * x - sin * y + this.worldX; + position.y = sin * x + cos * y + this.worldY; + } + }; + SwirlEffect.prototype.end = function () { + }; + SwirlEffect.interpolation = new spine.PowOut(2); + return SwirlEffect; + }()); + spine.SwirlEffect = SwirlEffect; +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var AssetManager = (function (_super) { + __extends(AssetManager, _super); + function AssetManager(context, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + return _super.call(this, function (image) { + return new spine.webgl.GLTexture(context, image); + }, pathPrefix) || this; + } + return AssetManager; + }(spine.AssetManager)); + webgl.AssetManager = AssetManager; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var OrthoCamera = (function () { + function OrthoCamera(viewportWidth, viewportHeight) { + this.position = new webgl.Vector3(0, 0, 0); + this.direction = new webgl.Vector3(0, 0, -1); + this.up = new webgl.Vector3(0, 1, 0); + this.near = 0; + this.far = 100; + this.zoom = 1; + this.viewportWidth = 0; + this.viewportHeight = 0; + this.projectionView = new webgl.Matrix4(); + this.inverseProjectionView = new webgl.Matrix4(); + this.projection = new webgl.Matrix4(); + this.view = new webgl.Matrix4(); + this.tmp = new webgl.Vector3(); + this.viewportWidth = viewportWidth; + this.viewportHeight = viewportHeight; + this.update(); + } + OrthoCamera.prototype.update = function () { + var projection = this.projection; + var view = this.view; + var projectionView = this.projectionView; + var inverseProjectionView = this.inverseProjectionView; + var zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight; + projection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far); + view.lookAt(this.position, this.direction, this.up); + projectionView.set(projection.values); + projectionView.multiply(view); + inverseProjectionView.set(projectionView.values).invert(); + }; + OrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) { + var x = screenCoords.x, y = screenHeight - screenCoords.y - 1; + var tmp = this.tmp; + tmp.x = (2 * x) / screenWidth - 1; + tmp.y = (2 * y) / screenHeight - 1; + tmp.z = (2 * screenCoords.z) - 1; + tmp.project(this.inverseProjectionView); + screenCoords.set(tmp.x, tmp.y, tmp.z); + return screenCoords; + }; + OrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) { + this.viewportWidth = viewportWidth; + this.viewportHeight = viewportHeight; + }; + return OrthoCamera; + }()); + webgl.OrthoCamera = OrthoCamera; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var GLTexture = (function (_super) { + __extends(GLTexture, _super); + function GLTexture(context, image, useMipMaps) { + if (useMipMaps === void 0) { useMipMaps = false; } + var _this = _super.call(this, image) || this; + _this.texture = null; + _this.boundUnit = 0; + _this.useMipMaps = false; + _this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + _this.useMipMaps = useMipMaps; + _this.restore(); + _this.context.addRestorable(_this); + return _this; + } + GLTexture.prototype.setFilters = function (minFilter, magFilter) { + var gl = this.context.gl; + this.bind(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); + }; + GLTexture.prototype.setWraps = function (uWrap, vWrap) { + var gl = this.context.gl; + this.bind(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap); + }; + GLTexture.prototype.update = function (useMipMaps) { + var gl = this.context.gl; + if (!this.texture) { + this.texture = this.context.gl.createTexture(); + } + this.bind(); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + if (useMipMaps) + gl.generateMipmap(gl.TEXTURE_2D); + }; + GLTexture.prototype.restore = function () { + this.texture = null; + this.update(this.useMipMaps); + }; + GLTexture.prototype.bind = function (unit) { + if (unit === void 0) { unit = 0; } + var gl = this.context.gl; + this.boundUnit = unit; + gl.activeTexture(gl.TEXTURE0 + unit); + gl.bindTexture(gl.TEXTURE_2D, this.texture); + }; + GLTexture.prototype.unbind = function () { + var gl = this.context.gl; + gl.activeTexture(gl.TEXTURE0 + this.boundUnit); + gl.bindTexture(gl.TEXTURE_2D, null); + }; + GLTexture.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + gl.deleteTexture(this.texture); + }; + return GLTexture; + }(spine.Texture)); + webgl.GLTexture = GLTexture; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Input = (function () { + function Input(element) { + this.lastX = 0; + this.lastY = 0; + this.buttonDown = false; + this.currTouch = null; + this.touchesPool = new spine.Pool(function () { + return new spine.webgl.Touch(0, 0, 0); + }); + this.listeners = new Array(); + this.element = element; + this.setupCallbacks(element); + } + Input.prototype.setupCallbacks = function (element) { + var _this = this; + var mouseDown = function (ev) { + if (ev instanceof MouseEvent) { + var rect = element.getBoundingClientRect(); + var x = ev.clientX - rect.left; + var y = ev.clientY - rect.top; + var listeners = _this.listeners; + for (var i = 0; i < listeners.length; i++) { + listeners[i].down(x, y); + } + _this.lastX = x; + _this.lastY = y; + _this.buttonDown = true; + document.addEventListener("mousemove", mouseMove); + document.addEventListener("mouseup", mouseUp); + } + }; + var mouseMove = function (ev) { + if (ev instanceof MouseEvent) { + var rect = element.getBoundingClientRect(); + var x = ev.clientX - rect.left; + var y = ev.clientY - rect.top; + var listeners = _this.listeners; + for (var i = 0; i < listeners.length; i++) { + if (_this.buttonDown) { + listeners[i].dragged(x, y); + } + else { + listeners[i].moved(x, y); + } + } + _this.lastX = x; + _this.lastY = y; + } + }; + var mouseUp = function (ev) { + if (ev instanceof MouseEvent) { + var rect = element.getBoundingClientRect(); + var x = ev.clientX - rect.left; + var y = ev.clientY - rect.top; + var listeners = _this.listeners; + for (var i = 0; i < listeners.length; i++) { + listeners[i].up(x, y); + } + _this.lastX = x; + _this.lastY = y; + _this.buttonDown = false; + document.removeEventListener("mousemove", mouseMove); + document.removeEventListener("mouseup", mouseUp); + } + }; + element.addEventListener("mousedown", mouseDown, true); + element.addEventListener("mousemove", mouseMove, true); + element.addEventListener("mouseup", mouseUp, true); + element.addEventListener("touchstart", function (ev) { + if (_this.currTouch != null) + return; + var touches = ev.changedTouches; + for (var i = 0; i < touches.length; i++) { + var touch = touches[i]; + var rect = element.getBoundingClientRect(); + var x = touch.clientX - rect.left; + var y = touch.clientY - rect.top; + _this.currTouch = _this.touchesPool.obtain(); + _this.currTouch.identifier = touch.identifier; + _this.currTouch.x = x; + _this.currTouch.y = y; + break; + } + var listeners = _this.listeners; + for (var i_16 = 0; i_16 < listeners.length; i_16++) { + listeners[i_16].down(_this.currTouch.x, _this.currTouch.y); + } + console.log("Start " + _this.currTouch.x + ", " + _this.currTouch.y); + _this.lastX = _this.currTouch.x; + _this.lastY = _this.currTouch.y; + _this.buttonDown = true; + ev.preventDefault(); + }, false); + element.addEventListener("touchend", function (ev) { + var touches = ev.changedTouches; + for (var i = 0; i < touches.length; i++) { + var touch = touches[i]; + if (_this.currTouch.identifier === touch.identifier) { + var rect = element.getBoundingClientRect(); + var x = _this.currTouch.x = touch.clientX - rect.left; + var y = _this.currTouch.y = touch.clientY - rect.top; + _this.touchesPool.free(_this.currTouch); + var listeners = _this.listeners; + for (var i_17 = 0; i_17 < listeners.length; i_17++) { + listeners[i_17].up(x, y); + } + console.log("End " + x + ", " + y); + _this.lastX = x; + _this.lastY = y; + _this.buttonDown = false; + _this.currTouch = null; + break; + } + } + ev.preventDefault(); + }, false); + element.addEventListener("touchcancel", function (ev) { + var touches = ev.changedTouches; + for (var i = 0; i < touches.length; i++) { + var touch = touches[i]; + if (_this.currTouch.identifier === touch.identifier) { + var rect = element.getBoundingClientRect(); + var x = _this.currTouch.x = touch.clientX - rect.left; + var y = _this.currTouch.y = touch.clientY - rect.top; + _this.touchesPool.free(_this.currTouch); + var listeners = _this.listeners; + for (var i_18 = 0; i_18 < listeners.length; i_18++) { + listeners[i_18].up(x, y); + } + console.log("End " + x + ", " + y); + _this.lastX = x; + _this.lastY = y; + _this.buttonDown = false; + _this.currTouch = null; + break; + } + } + ev.preventDefault(); + }, false); + element.addEventListener("touchmove", function (ev) { + if (_this.currTouch == null) + return; + var touches = ev.changedTouches; + for (var i = 0; i < touches.length; i++) { + var touch = touches[i]; + if (_this.currTouch.identifier === touch.identifier) { + var rect = element.getBoundingClientRect(); + var x = touch.clientX - rect.left; + var y = touch.clientY - rect.top; + var listeners = _this.listeners; + for (var i_19 = 0; i_19 < listeners.length; i_19++) { + listeners[i_19].dragged(x, y); + } + console.log("Drag " + x + ", " + y); + _this.lastX = _this.currTouch.x = x; + _this.lastY = _this.currTouch.y = y; + break; + } + } + ev.preventDefault(); + }, false); + }; + Input.prototype.addListener = function (listener) { + this.listeners.push(listener); + }; + Input.prototype.removeListener = function (listener) { + var idx = this.listeners.indexOf(listener); + if (idx > -1) { + this.listeners.splice(idx, 1); + } + }; + return Input; + }()); + webgl.Input = Input; + var Touch = (function () { + function Touch(identifier, x, y) { + this.identifier = identifier; + this.x = x; + this.y = y; + } + return Touch; + }()); + webgl.Touch = Touch; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var LoadingScreen = (function () { + function LoadingScreen(renderer) { + this.logo = null; + this.spinner = null; + this.angle = 0; + this.fadeOut = 0; + this.timeKeeper = new spine.TimeKeeper(); + this.backgroundColor = new spine.Color(0.135, 0.135, 0.135, 1); + this.tempColor = new spine.Color(); + this.firstDraw = 0; + this.renderer = renderer; + this.timeKeeper.maxDelta = 9; + if (LoadingScreen.logoImg === null) { + var isSafari = navigator.userAgent.indexOf("Safari") > -1; + LoadingScreen.logoImg = new Image(); + LoadingScreen.logoImg.src = LoadingScreen.SPINE_LOGO_DATA; + if (!isSafari) + LoadingScreen.logoImg.crossOrigin = "anonymous"; + LoadingScreen.logoImg.onload = function (ev) { + LoadingScreen.loaded++; + }; + LoadingScreen.spinnerImg = new Image(); + LoadingScreen.spinnerImg.src = LoadingScreen.SPINNER_DATA; + if (!isSafari) + LoadingScreen.spinnerImg.crossOrigin = "anonymous"; + LoadingScreen.spinnerImg.onload = function (ev) { + LoadingScreen.loaded++; + }; + } + } + LoadingScreen.prototype.draw = function (complete) { + if (complete === void 0) { complete = false; } + if (complete && this.fadeOut > LoadingScreen.FADE_SECONDS) + return; + this.timeKeeper.update(); + var a = Math.abs(Math.sin(this.timeKeeper.totalTime + 0.75)); + this.angle -= this.timeKeeper.delta / 1.4 * 360 * (1 + 1.5 * Math.pow(a, 5)); + var renderer = this.renderer; + var canvas = renderer.canvas; + var gl = renderer.context.gl; + renderer.resize(webgl.ResizeMode.Stretch); + var oldX = renderer.camera.position.x, oldY = renderer.camera.position.y; + renderer.camera.position.set(canvas.width / 2, canvas.height / 2, 0); + renderer.camera.viewportWidth = canvas.width; + renderer.camera.viewportHeight = canvas.height; + if (!complete) { + gl.clearColor(this.backgroundColor.r, this.backgroundColor.g, this.backgroundColor.b, this.backgroundColor.a); + gl.clear(gl.COLOR_BUFFER_BIT); + this.tempColor.a = 1; + } + else { + this.fadeOut += this.timeKeeper.delta * (this.timeKeeper.totalTime < 1 ? 2 : 1); + if (this.fadeOut > LoadingScreen.FADE_SECONDS) { + renderer.camera.position.set(oldX, oldY, 0); + return; + } + a = 1 - this.fadeOut / LoadingScreen.FADE_SECONDS; + this.tempColor.setFromColor(this.backgroundColor); + this.tempColor.a = 1 - (a - 1) * (a - 1); + renderer.begin(); + renderer.quad(true, 0, 0, canvas.width, 0, canvas.width, canvas.height, 0, canvas.height, this.tempColor, this.tempColor, this.tempColor, this.tempColor); + renderer.end(); + } + this.tempColor.set(1, 1, 1, this.tempColor.a); + if (LoadingScreen.loaded != 2) + return; + if (this.logo === null) { + this.logo = new webgl.GLTexture(renderer.context, LoadingScreen.logoImg); + this.spinner = new webgl.GLTexture(renderer.context, LoadingScreen.spinnerImg); + } + this.logo.update(false); + this.spinner.update(false); + var logoWidth = this.logo.getImage().width; + var logoHeight = this.logo.getImage().height; + var spinnerWidth = this.spinner.getImage().width; + var spinnerHeight = this.spinner.getImage().height; + renderer.batcher.setBlendMode(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); + renderer.begin(); + renderer.drawTexture(this.logo, (canvas.width - logoWidth) / 2, (canvas.height - logoHeight) / 2, logoWidth, logoHeight, this.tempColor); + renderer.drawTextureRotated(this.spinner, (canvas.width - spinnerWidth) / 2, (canvas.height - spinnerHeight) / 2, spinnerWidth, spinnerHeight, spinnerWidth / 2, spinnerHeight / 2, this.angle, this.tempColor); + renderer.end(); + renderer.camera.position.set(oldX, oldY, 0); + }; + LoadingScreen.FADE_SECONDS = 1; + LoadingScreen.loaded = 0; + LoadingScreen.spinnerImg = null; + LoadingScreen.logoImg = null; + LoadingScreen.SPINNER_DATA = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAAACXBIWXMAAAsTAAALEwEAmpwYAAALB2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJER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5UgGmjGqyjLtUrXy6oGRRTl2QivqwrJaJG2KZ5DQvsKwmmccHZVVD2fSSLmXk6XxRSHgVU5U6iqqnFJSyYKqAU+QGiJVAh2oClUdhqeLjSgOpSjFkTbwOVRXNGEDB9aCSwFIFHa3DFZBRfi1Q6gBTFk4Rs63zGijrFIg/ylRt7lW3m6kOUagQqiJ5orFONKJtHR0ok/vUAaPKOrbRt2owZZVTJmhRDaKOYW26I1st06yoBFKmk4jD61UCShSfq1OdpTLgUDW6R8t87rqcfZ1BlMr6uq6Vjhf2owGvozDKmG9dyiQCeTSAiwXVdNIP1A2uls7QkYhW/fgzVgIeXVOe6ISFOnSOjjn+uuHsK5F2NM1hLG/jSGfpjoSdjLSJg7Cp7FjaR7ZzXEGcinBJDF8DnZ1Ho7wPrYNadHdINGCLdVMdrU6nMdimqHYgiaF2kn4IXJ8FMJY6iPRxsPqTksbc55ZJP2vHgOnuYwD2tU4k/eycaT891g0F5YDZ7qfQ3SidTAZgG4By4FwHgBtYBpYbZ/l/2EJnC9N0gaQAAAAASUVORK5CYII="; + return LoadingScreen; + }()); + webgl.LoadingScreen = LoadingScreen; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + webgl.M00 = 0; + webgl.M01 = 4; + webgl.M02 = 8; + webgl.M03 = 12; + webgl.M10 = 1; + webgl.M11 = 5; + webgl.M12 = 9; + webgl.M13 = 13; + webgl.M20 = 2; + webgl.M21 = 6; + webgl.M22 = 10; + webgl.M23 = 14; + webgl.M30 = 3; + webgl.M31 = 7; + webgl.M32 = 11; + webgl.M33 = 15; + var Matrix4 = (function () { + function Matrix4() { + this.temp = new Float32Array(16); + this.values = new Float32Array(16); + var v = this.values; + v[webgl.M00] = 1; + v[webgl.M11] = 1; + v[webgl.M22] = 1; + v[webgl.M33] = 1; + } + Matrix4.prototype.set = function (values) { + this.values.set(values); + return this; + }; + Matrix4.prototype.transpose = function () { + var t = this.temp; + var v = this.values; + t[webgl.M00] = v[webgl.M00]; + t[webgl.M01] = v[webgl.M10]; + t[webgl.M02] = v[webgl.M20]; + t[webgl.M03] = v[webgl.M30]; + t[webgl.M10] = v[webgl.M01]; + t[webgl.M11] = v[webgl.M11]; + t[webgl.M12] = v[webgl.M21]; + t[webgl.M13] = v[webgl.M31]; + t[webgl.M20] = v[webgl.M02]; + t[webgl.M21] = v[webgl.M12]; + t[webgl.M22] = v[webgl.M22]; + t[webgl.M23] = v[webgl.M32]; + t[webgl.M30] = v[webgl.M03]; + t[webgl.M31] = v[webgl.M13]; + t[webgl.M32] = v[webgl.M23]; + t[webgl.M33] = v[webgl.M33]; + return this.set(t); + }; + Matrix4.prototype.identity = function () { + var v = this.values; + v[webgl.M00] = 1; + v[webgl.M01] = 0; + v[webgl.M02] = 0; + v[webgl.M03] = 0; + v[webgl.M10] = 0; + v[webgl.M11] = 1; + v[webgl.M12] = 0; + v[webgl.M13] = 0; + v[webgl.M20] = 0; + v[webgl.M21] = 0; + v[webgl.M22] = 1; + v[webgl.M23] = 0; + v[webgl.M30] = 0; + v[webgl.M31] = 0; + v[webgl.M32] = 0; + v[webgl.M33] = 1; + return this; + }; + Matrix4.prototype.invert = function () { + var v = this.values; + var t = this.temp; + var l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] + + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] + - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] + - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] + + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] + + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] + - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] + - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + if (l_det == 0) + throw new Error("non-invertible matrix"); + var inv_det = 1.0 / l_det; + t[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32] + - v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32] + + v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32] + - v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33]; + t[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22] + + v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23]; + t[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32] + + v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32] + - v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32] + + v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33]; + t[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22] + - v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23]; + t[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31] + - v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33]; + t[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31] + + v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33]; + t[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31] + - v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33]; + t[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21] + + v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23]; + t[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31] + + v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32]; + t[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31] + - v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32]; + t[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31] + + v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32]; + t[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21] + - v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22]; + v[webgl.M00] = t[webgl.M00] * inv_det; + v[webgl.M01] = t[webgl.M01] * inv_det; + v[webgl.M02] = t[webgl.M02] * inv_det; + v[webgl.M03] = t[webgl.M03] * inv_det; + v[webgl.M10] = t[webgl.M10] * inv_det; + v[webgl.M11] = t[webgl.M11] * inv_det; + v[webgl.M12] = t[webgl.M12] * inv_det; + v[webgl.M13] = t[webgl.M13] * inv_det; + v[webgl.M20] = t[webgl.M20] * inv_det; + v[webgl.M21] = t[webgl.M21] * inv_det; + v[webgl.M22] = t[webgl.M22] * inv_det; + v[webgl.M23] = t[webgl.M23] * inv_det; + v[webgl.M30] = t[webgl.M30] * inv_det; + v[webgl.M31] = t[webgl.M31] * inv_det; + v[webgl.M32] = t[webgl.M32] * inv_det; + v[webgl.M33] = t[webgl.M33] * inv_det; + return this; + }; + Matrix4.prototype.determinant = function () { + var v = this.values; + return v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] + + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] + - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] + - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] + + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] + + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] + - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] + - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + }; + Matrix4.prototype.translate = function (x, y, z) { + var v = this.values; + v[webgl.M03] += x; + v[webgl.M13] += y; + v[webgl.M23] += z; + return this; + }; + Matrix4.prototype.copy = function () { + return new Matrix4().set(this.values); + }; + Matrix4.prototype.projection = function (near, far, fovy, aspectRatio) { + this.identity(); + var l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0)); + var l_a1 = (far + near) / (near - far); + var l_a2 = (2 * far * near) / (near - far); + var v = this.values; + v[webgl.M00] = l_fd / aspectRatio; + v[webgl.M10] = 0; + v[webgl.M20] = 0; + v[webgl.M30] = 0; + v[webgl.M01] = 0; + v[webgl.M11] = l_fd; + v[webgl.M21] = 0; + v[webgl.M31] = 0; + v[webgl.M02] = 0; + v[webgl.M12] = 0; + v[webgl.M22] = l_a1; + v[webgl.M32] = -1; + v[webgl.M03] = 0; + v[webgl.M13] = 0; + v[webgl.M23] = l_a2; + v[webgl.M33] = 0; + return this; + }; + Matrix4.prototype.ortho2d = function (x, y, width, height) { + return this.ortho(x, x + width, y, y + height, 0, 1); + }; + Matrix4.prototype.ortho = function (left, right, bottom, top, near, far) { + this.identity(); + var x_orth = 2 / (right - left); + var y_orth = 2 / (top - bottom); + var z_orth = -2 / (far - near); + var tx = -(right + left) / (right - left); + var ty = -(top + bottom) / (top - bottom); + var tz = -(far + near) / (far - near); + var v = this.values; + v[webgl.M00] = x_orth; + v[webgl.M10] = 0; + v[webgl.M20] = 0; + v[webgl.M30] = 0; + v[webgl.M01] = 0; + v[webgl.M11] = y_orth; + v[webgl.M21] = 0; + v[webgl.M31] = 0; + v[webgl.M02] = 0; + v[webgl.M12] = 0; + v[webgl.M22] = z_orth; + v[webgl.M32] = 0; + v[webgl.M03] = tx; + v[webgl.M13] = ty; + v[webgl.M23] = tz; + v[webgl.M33] = 1; + return this; + }; + Matrix4.prototype.multiply = function (matrix) { + var t = this.temp; + var v = this.values; + var m = matrix.values; + t[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30]; + t[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31]; + t[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32]; + t[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33]; + t[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30]; + t[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31]; + t[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32]; + t[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33]; + t[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30]; + t[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31]; + t[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32]; + t[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33]; + t[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30]; + t[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31]; + t[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32]; + t[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33]; + return this.set(this.temp); + }; + Matrix4.prototype.multiplyLeft = function (matrix) { + var t = this.temp; + var v = this.values; + var m = matrix.values; + t[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30]; + t[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31]; + t[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32]; + t[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33]; + t[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30]; + t[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31]; + t[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32]; + t[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33]; + t[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30]; + t[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31]; + t[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32]; + t[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33]; + t[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30]; + t[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31]; + t[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32]; + t[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33]; + return this.set(this.temp); + }; + Matrix4.prototype.lookAt = function (position, direction, up) { + Matrix4.initTemps(); + var xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis; + zAxis.setFrom(direction).normalize(); + xAxis.setFrom(direction).normalize(); + xAxis.cross(up).normalize(); + yAxis.setFrom(xAxis).cross(zAxis).normalize(); + this.identity(); + var val = this.values; + val[webgl.M00] = xAxis.x; + val[webgl.M01] = xAxis.y; + val[webgl.M02] = xAxis.z; + val[webgl.M10] = yAxis.x; + val[webgl.M11] = yAxis.y; + val[webgl.M12] = yAxis.z; + val[webgl.M20] = -zAxis.x; + val[webgl.M21] = -zAxis.y; + val[webgl.M22] = -zAxis.z; + Matrix4.tmpMatrix.identity(); + Matrix4.tmpMatrix.values[webgl.M03] = -position.x; + Matrix4.tmpMatrix.values[webgl.M13] = -position.y; + Matrix4.tmpMatrix.values[webgl.M23] = -position.z; + this.multiply(Matrix4.tmpMatrix); + return this; + }; + Matrix4.initTemps = function () { + if (Matrix4.xAxis === null) + Matrix4.xAxis = new webgl.Vector3(); + if (Matrix4.yAxis === null) + Matrix4.yAxis = new webgl.Vector3(); + if (Matrix4.zAxis === null) + Matrix4.zAxis = new webgl.Vector3(); + }; + Matrix4.xAxis = null; + Matrix4.yAxis = null; + Matrix4.zAxis = null; + Matrix4.tmpMatrix = new Matrix4(); + return Matrix4; + }()); + webgl.Matrix4 = Matrix4; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Mesh = (function () { + function Mesh(context, attributes, maxVertices, maxIndices) { + this.attributes = attributes; + this.verticesLength = 0; + this.dirtyVertices = false; + this.indicesLength = 0; + this.dirtyIndices = false; + this.elementsPerVertex = 0; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.elementsPerVertex = 0; + for (var i = 0; i < attributes.length; i++) { + this.elementsPerVertex += attributes[i].numElements; + } + this.vertices = new Float32Array(maxVertices * this.elementsPerVertex); + this.indices = new Uint16Array(maxIndices); + this.context.addRestorable(this); + } + Mesh.prototype.getAttributes = function () { return this.attributes; }; + Mesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; }; + Mesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; }; + Mesh.prototype.setVerticesLength = function (length) { + this.dirtyVertices = true; + this.verticesLength = length; + }; + Mesh.prototype.getVertices = function () { return this.vertices; }; + Mesh.prototype.maxIndices = function () { return this.indices.length; }; + Mesh.prototype.numIndices = function () { return this.indicesLength; }; + Mesh.prototype.setIndicesLength = function (length) { + this.dirtyIndices = true; + this.indicesLength = length; + }; + Mesh.prototype.getIndices = function () { return this.indices; }; + ; + Mesh.prototype.getVertexSizeInFloats = function () { + var size = 0; + for (var i = 0; i < this.attributes.length; i++) { + var attribute = this.attributes[i]; + size += attribute.numElements; + } + return size; + }; + Mesh.prototype.setVertices = function (vertices) { + this.dirtyVertices = true; + if (vertices.length > this.vertices.length) + throw Error("Mesh can't store more than " + this.maxVertices() + " vertices"); + this.vertices.set(vertices, 0); + this.verticesLength = vertices.length; + }; + Mesh.prototype.setIndices = function (indices) { + this.dirtyIndices = true; + if (indices.length > this.indices.length) + throw Error("Mesh can't store more than " + this.maxIndices() + " indices"); + this.indices.set(indices, 0); + this.indicesLength = indices.length; + }; + Mesh.prototype.draw = function (shader, primitiveType) { + this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex); + }; + Mesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) { + var gl = this.context.gl; + if (this.dirtyVertices || this.dirtyIndices) + this.update(); + this.bind(shader); + if (this.indicesLength > 0) { + gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2); + } + else { + gl.drawArrays(primitiveType, offset, count); + } + this.unbind(shader); + }; + Mesh.prototype.bind = function (shader) { + var gl = this.context.gl; + gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); + var offset = 0; + for (var i = 0; i < this.attributes.length; i++) { + var attrib = this.attributes[i]; + var location_1 = shader.getAttributeLocation(attrib.name); + gl.enableVertexAttribArray(location_1); + gl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4); + offset += attrib.numElements; + } + if (this.indicesLength > 0) + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); + }; + Mesh.prototype.unbind = function (shader) { + var gl = this.context.gl; + for (var i = 0; i < this.attributes.length; i++) { + var attrib = this.attributes[i]; + var location_2 = shader.getAttributeLocation(attrib.name); + gl.disableVertexAttribArray(location_2); + } + gl.bindBuffer(gl.ARRAY_BUFFER, null); + if (this.indicesLength > 0) + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); + }; + Mesh.prototype.update = function () { + var gl = this.context.gl; + if (this.dirtyVertices) { + if (!this.verticesBuffer) { + this.verticesBuffer = gl.createBuffer(); + } + gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); + gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW); + this.dirtyVertices = false; + } + if (this.dirtyIndices) { + if (!this.indicesBuffer) { + this.indicesBuffer = gl.createBuffer(); + } + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW); + this.dirtyIndices = false; + } + }; + Mesh.prototype.restore = function () { + this.verticesBuffer = null; + this.indicesBuffer = null; + this.update(); + }; + Mesh.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + gl.deleteBuffer(this.verticesBuffer); + gl.deleteBuffer(this.indicesBuffer); + }; + return Mesh; + }()); + webgl.Mesh = Mesh; + var VertexAttribute = (function () { + function VertexAttribute(name, type, numElements) { + this.name = name; + this.type = type; + this.numElements = numElements; + } + return VertexAttribute; + }()); + webgl.VertexAttribute = VertexAttribute; + var Position2Attribute = (function (_super) { + __extends(Position2Attribute, _super); + function Position2Attribute() { + return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this; + } + return Position2Attribute; + }(VertexAttribute)); + webgl.Position2Attribute = Position2Attribute; + var Position3Attribute = (function (_super) { + __extends(Position3Attribute, _super); + function Position3Attribute() { + return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this; + } + return Position3Attribute; + }(VertexAttribute)); + webgl.Position3Attribute = Position3Attribute; + var TexCoordAttribute = (function (_super) { + __extends(TexCoordAttribute, _super); + function TexCoordAttribute(unit) { + if (unit === void 0) { unit = 0; } + return _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? "" : unit), VertexAttributeType.Float, 2) || this; + } + return TexCoordAttribute; + }(VertexAttribute)); + webgl.TexCoordAttribute = TexCoordAttribute; + var ColorAttribute = (function (_super) { + __extends(ColorAttribute, _super); + function ColorAttribute() { + return _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this; + } + return ColorAttribute; + }(VertexAttribute)); + webgl.ColorAttribute = ColorAttribute; + var Color2Attribute = (function (_super) { + __extends(Color2Attribute, _super); + function Color2Attribute() { + return _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this; + } + return Color2Attribute; + }(VertexAttribute)); + webgl.Color2Attribute = Color2Attribute; + var VertexAttributeType; + (function (VertexAttributeType) { + VertexAttributeType[VertexAttributeType["Float"] = 0] = "Float"; + })(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var PolygonBatcher = (function () { + function PolygonBatcher(context, twoColorTint, maxVertices) { + if (twoColorTint === void 0) { twoColorTint = true; } + if (maxVertices === void 0) { maxVertices = 10920; } + this.isDrawing = false; + this.shader = null; + this.lastTexture = null; + this.verticesLength = 0; + this.indicesLength = 0; + if (maxVertices > 10920) + throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + var attributes = twoColorTint ? + [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] : + [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()]; + this.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3); + this.srcBlend = this.context.gl.SRC_ALPHA; + this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; + } + PolygonBatcher.prototype.begin = function (shader) { + var gl = 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 = shader; + this.lastTexture = null; + this.isDrawing = true; + gl.enable(gl.BLEND); + gl.blendFunc(this.srcBlend, this.dstBlend); + }; + PolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) { + var gl = this.context.gl; + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + if (this.isDrawing) { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + }; + PolygonBatcher.prototype.draw = function (texture, vertices, indices) { + if (texture != this.lastTexture) { + this.flush(); + this.lastTexture = texture; + } + else if (this.verticesLength + vertices.length > this.mesh.getVertices().length || + this.indicesLength + indices.length > this.mesh.getIndices().length) { + this.flush(); + } + var indexStart = this.mesh.numVertices(); + this.mesh.getVertices().set(vertices, this.verticesLength); + this.verticesLength += vertices.length; + this.mesh.setVerticesLength(this.verticesLength); + var indicesArray = this.mesh.getIndices(); + for (var i = this.indicesLength, j = 0; j < indices.length; i++, j++) + indicesArray[i] = indices[j] + indexStart; + this.indicesLength += indices.length; + this.mesh.setIndicesLength(this.indicesLength); + }; + PolygonBatcher.prototype.flush = function () { + var gl = this.context.gl; + if (this.verticesLength == 0) + return; + this.lastTexture.bind(); + this.mesh.draw(this.shader, gl.TRIANGLES); + this.verticesLength = 0; + this.indicesLength = 0; + this.mesh.setVerticesLength(0); + this.mesh.setIndicesLength(0); + this.drawCalls++; + }; + PolygonBatcher.prototype.end = function () { + var gl = this.context.gl; + if (!this.isDrawing) + throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()"); + if (this.verticesLength > 0 || this.indicesLength > 0) + this.flush(); + this.shader = null; + this.lastTexture = null; + this.isDrawing = false; + gl.disable(gl.BLEND); + }; + PolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; }; + PolygonBatcher.prototype.dispose = function () { + this.mesh.dispose(); + }; + return PolygonBatcher; + }()); + webgl.PolygonBatcher = PolygonBatcher; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var SceneRenderer = (function () { + function SceneRenderer(canvas, context, twoColorTint) { + if (twoColorTint === void 0) { twoColorTint = true; } + this.twoColorTint = false; + 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 spine.Color(1, 1, 1, 1); + this.canvas = canvas; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.twoColorTint = twoColorTint; + this.camera = new webgl.OrthoCamera(canvas.width, canvas.height); + this.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context); + this.batcher = new webgl.PolygonBatcher(this.context, twoColorTint); + this.shapesShader = webgl.Shader.newColored(this.context); + this.shapes = new webgl.ShapeRenderer(this.context); + this.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint); + this.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context); + } + SceneRenderer.prototype.begin = function () { + this.camera.update(); + this.enableRenderer(this.batcher); + }; + SceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + if (slotRangeStart === void 0) { slotRangeStart = -1; } + if (slotRangeEnd === void 0) { slotRangeEnd = -1; } + this.enableRenderer(this.batcher); + this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha; + this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd); + }; + SceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + if (ignoredBones === void 0) { ignoredBones = null; } + this.enableRenderer(this.shapes); + this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha; + this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones); + }; + SceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u; + quad[i++] = v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u2; + quad[i++] = v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u2; + quad[i++] = v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u; + quad[i++] = v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) { + if (color === void 0) { color = null; } + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var worldOriginX = x + pivotX; + var worldOriginY = y + pivotY; + var fx = -pivotX; + var fy = -pivotY; + var fx2 = width - pivotX; + var fy2 = height - pivotY; + var p1x = fx; + var p1y = fy; + var p2x = fx; + var p2y = fy2; + var p3x = fx2; + var p3y = fy2; + var p4x = fx2; + var p4y = fy; + var x1 = 0; + var y1 = 0; + var x2 = 0; + var y2 = 0; + var x3 = 0; + var y3 = 0; + var x4 = 0; + var y4 = 0; + if (angle != 0) { + var cos = spine.MathUtils.cosDeg(angle); + var sin = spine.MathUtils.sinDeg(angle); + x1 = cos * p1x - sin * p1y; + y1 = sin * p1x + cos * p1y; + x4 = cos * p2x - sin * p2y; + y4 = sin * p2x + cos * p2y; + x3 = cos * p3x - sin * p3y; + y3 = sin * p3x + cos * p3y; + x2 = x3 + (x1 - x4); + y2 = y3 + (y1 - y4); + } + else { + x1 = p1x; + y1 = p1y; + x4 = p2x; + y4 = p2y; + x3 = p3x; + y3 = p3y; + x2 = p4x; + y2 = p4y; + } + x1 += worldOriginX; + y1 += worldOriginY; + x2 += worldOriginX; + y2 += worldOriginY; + x3 += worldOriginX; + y3 += worldOriginY; + x4 += worldOriginX; + y4 += worldOriginY; + var i = 0; + quad[i++] = x1; + quad[i++] = y1; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x2; + quad[i++] = y2; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x3; + quad[i++] = y3; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x4; + quad[i++] = y4; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) { + if (color === void 0) { color = null; } + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u; + quad[i++] = region.v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u2; + quad[i++] = region.v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u2; + quad[i++] = region.v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u; + quad[i++] = region.v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + this.enableRenderer(this.shapes); + this.shapes.line(x, y, x2, y2, color); + }; + SceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + this.enableRenderer(this.shapes); + this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3); + }; + SceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + if (color4 === void 0) { color4 = null; } + this.enableRenderer(this.shapes); + this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4); + }; + SceneRenderer.prototype.rect = function (filled, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.rect(filled, x, y, width, height, color); + }; + SceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.rectLine(filled, x1, y1, x2, y2, width, color); + }; + SceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.polygon(polygonVertices, offset, count, color); + }; + SceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { + if (color === void 0) { color = null; } + if (segments === void 0) { segments = 0; } + this.enableRenderer(this.shapes); + this.shapes.circle(filled, x, y, radius, color, segments); + }; + SceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color); + }; + SceneRenderer.prototype.end = function () { + if (this.activeRenderer === this.batcher) + this.batcher.end(); + else if (this.activeRenderer === this.shapes) + this.shapes.end(); + this.activeRenderer = null; + }; + SceneRenderer.prototype.resize = function (resizeMode) { + var canvas = this.canvas; + var w = canvas.clientWidth; + var h = canvas.clientHeight; + if (canvas.width != w || canvas.height != h) { + canvas.width = w; + canvas.height = h; + } + this.context.gl.viewport(0, 0, canvas.width, canvas.height); + if (resizeMode === ResizeMode.Stretch) { + } + else if (resizeMode === ResizeMode.Expand) { + this.camera.setViewport(w, h); + } + else if (resizeMode === ResizeMode.Fit) { + var sourceWidth = canvas.width, sourceHeight = canvas.height; + var targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight; + var targetRatio = targetHeight / targetWidth; + var sourceRatio = sourceHeight / sourceWidth; + var scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight; + this.camera.viewportWidth = sourceWidth * scale; + this.camera.viewportHeight = sourceHeight * scale; + } + this.camera.update(); + }; + SceneRenderer.prototype.enableRenderer = function (renderer) { + if (this.activeRenderer === renderer) + return; + this.end(); + if (renderer instanceof webgl.PolygonBatcher) { + this.batcherShader.bind(); + this.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); + this.batcherShader.setUniformi("u_texture", 0); + this.batcher.begin(this.batcherShader); + this.activeRenderer = this.batcher; + } + else if (renderer instanceof webgl.ShapeRenderer) { + this.shapesShader.bind(); + this.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); + this.shapes.begin(this.shapesShader); + this.activeRenderer = this.shapes; + } + else { + this.activeRenderer = this.skeletonDebugRenderer; + } + }; + SceneRenderer.prototype.dispose = function () { + this.batcher.dispose(); + this.batcherShader.dispose(); + this.shapes.dispose(); + this.shapesShader.dispose(); + this.skeletonDebugRenderer.dispose(); + }; + return SceneRenderer; + }()); + webgl.SceneRenderer = SceneRenderer; + var ResizeMode; + (function (ResizeMode) { + ResizeMode[ResizeMode["Stretch"] = 0] = "Stretch"; + ResizeMode[ResizeMode["Expand"] = 1] = "Expand"; + ResizeMode[ResizeMode["Fit"] = 2] = "Fit"; + })(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Shader = (function () { + function Shader(context, vertexShader, fragmentShader) { + this.vertexShader = vertexShader; + this.fragmentShader = fragmentShader; + this.vs = null; + this.fs = null; + this.program = null; + this.tmp2x2 = new Float32Array(2 * 2); + this.tmp3x3 = new Float32Array(3 * 3); + this.tmp4x4 = new Float32Array(4 * 4); + this.vsSource = vertexShader; + this.fsSource = fragmentShader; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.context.addRestorable(this); + this.compile(); + } + Shader.prototype.getProgram = function () { return this.program; }; + Shader.prototype.getVertexShader = function () { return this.vertexShader; }; + Shader.prototype.getFragmentShader = function () { return this.fragmentShader; }; + Shader.prototype.getVertexShaderSource = function () { return this.vsSource; }; + Shader.prototype.getFragmentSource = function () { return this.fsSource; }; + Shader.prototype.compile = function () { + var gl = this.context.gl; + try { + this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader); + this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader); + this.program = this.compileProgram(this.vs, this.fs); + } + catch (e) { + this.dispose(); + throw e; + } + }; + Shader.prototype.compileShader = function (type, source) { + var gl = this.context.gl; + var shader = gl.createShader(type); + gl.shaderSource(shader, source); + gl.compileShader(shader); + if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { + var error = "Couldn't compile shader: " + gl.getShaderInfoLog(shader); + gl.deleteShader(shader); + if (!gl.isContextLost()) + throw new Error(error); + } + return shader; + }; + Shader.prototype.compileProgram = function (vs, fs) { + var gl = this.context.gl; + var program = gl.createProgram(); + gl.attachShader(program, vs); + gl.attachShader(program, fs); + gl.linkProgram(program); + if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { + var error = "Couldn't compile shader program: " + gl.getProgramInfoLog(program); + gl.deleteProgram(program); + if (!gl.isContextLost()) + throw new Error(error); + } + return program; + }; + Shader.prototype.restore = function () { + this.compile(); + }; + Shader.prototype.bind = function () { + this.context.gl.useProgram(this.program); + }; + Shader.prototype.unbind = function () { + this.context.gl.useProgram(null); + }; + Shader.prototype.setUniformi = function (uniform, value) { + this.context.gl.uniform1i(this.getUniformLocation(uniform), value); + }; + Shader.prototype.setUniformf = function (uniform, value) { + this.context.gl.uniform1f(this.getUniformLocation(uniform), value); + }; + Shader.prototype.setUniform2f = function (uniform, value, value2) { + this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2); + }; + Shader.prototype.setUniform3f = function (uniform, value, value2, value3) { + this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3); + }; + Shader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) { + this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4); + }; + Shader.prototype.setUniform2x2f = function (uniform, value) { + var gl = this.context.gl; + this.tmp2x2.set(value); + gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2); + }; + Shader.prototype.setUniform3x3f = function (uniform, value) { + var gl = this.context.gl; + this.tmp3x3.set(value); + gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3); + }; + Shader.prototype.setUniform4x4f = function (uniform, value) { + var gl = this.context.gl; + this.tmp4x4.set(value); + gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4); + }; + Shader.prototype.getUniformLocation = function (uniform) { + var gl = this.context.gl; + var location = gl.getUniformLocation(this.program, uniform); + if (!location && !gl.isContextLost()) + throw new Error("Couldn't find location for uniform " + uniform); + return location; + }; + Shader.prototype.getAttributeLocation = function (attribute) { + var gl = this.context.gl; + var location = gl.getAttribLocation(this.program, attribute); + if (location == -1 && !gl.isContextLost()) + throw new Error("Couldn't find location for attribute " + attribute); + return location; + }; + Shader.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + if (this.vs) { + gl.deleteShader(this.vs); + this.vs = null; + } + if (this.fs) { + gl.deleteShader(this.fs); + this.fs = null; + } + if (this.program) { + gl.deleteProgram(this.program); + this.program = null; + } + }; + Shader.newColoredTextured = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.newTwoColoredTextured = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR2 + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_dark = " + Shader.COLOR2 + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.newColored = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tuniform mat4 " + Shader.MVP_MATRIX + ";\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = " + Shader.COLOR + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.MVP_MATRIX = "u_projTrans"; + Shader.POSITION = "a_position"; + Shader.COLOR = "a_color"; + Shader.COLOR2 = "a_color2"; + Shader.TEXCOORDS = "a_texCoords"; + Shader.SAMPLER = "u_texture"; + return Shader; + }()); + webgl.Shader = Shader; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var ShapeRenderer = (function () { + function ShapeRenderer(context, maxVertices) { + if (maxVertices === void 0) { maxVertices = 10920; } + this.isDrawing = false; + this.shapeType = ShapeType.Filled; + this.color = new spine.Color(1, 1, 1, 1); + this.vertexIndex = 0; + this.tmp = new spine.Vector2(); + if (maxVertices > 10920) + throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0); + this.srcBlend = this.context.gl.SRC_ALPHA; + this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; + } + ShapeRenderer.prototype.begin = function (shader) { + if (this.isDrawing) + throw new Error("ShapeRenderer.begin() has already been called"); + this.shader = shader; + this.vertexIndex = 0; + this.isDrawing = true; + var gl = this.context.gl; + gl.enable(gl.BLEND); + gl.blendFunc(this.srcBlend, this.dstBlend); + }; + ShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) { + var gl = this.context.gl; + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + if (this.isDrawing) { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + }; + ShapeRenderer.prototype.setColor = function (color) { + this.color.setFromColor(color); + }; + ShapeRenderer.prototype.setColorWith = function (r, g, b, a) { + this.color.set(r, g, b, a); + }; + ShapeRenderer.prototype.point = function (x, y, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Point, 1); + if (color === null) + color = this.color; + this.vertex(x, y, color); + }; + ShapeRenderer.prototype.line = function (x, y, x2, y2, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Line, 2); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + this.vertex(x, y, color); + this.vertex(x2, y2, color); + }; + ShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + if (color2 === null) + color2 = this.color; + if (color3 === null) + color3 = this.color; + if (filled) { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + } + else { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x2, y2, color); + this.vertex(x3, y3, color2); + this.vertex(x3, y3, color); + this.vertex(x, y, color2); + } + }; + ShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + if (color4 === void 0) { color4 = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + if (color2 === null) + color2 = this.color; + if (color3 === null) + color3 = this.color; + if (color4 === null) + color4 = this.color; + if (filled) { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + this.vertex(x3, y3, color3); + this.vertex(x4, y4, color4); + this.vertex(x, y, color); + } + else { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + this.vertex(x3, y3, color3); + this.vertex(x4, y4, color4); + this.vertex(x4, y4, color4); + this.vertex(x, y, color); + } + }; + ShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color); + }; + ShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { + if (color === void 0) { color = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 8); + if (color === null) + color = this.color; + var t = this.tmp.set(y2 - y1, x1 - x2); + t.normalize(); + width *= 0.5; + var tx = t.x * width; + var ty = t.y * width; + if (!filled) { + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x1 - tx, y1 - ty, color); + } + else { + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + } + }; + ShapeRenderer.prototype.x = function (x, y, size) { + this.line(x - size, y - size, x + size, y + size); + this.line(x - size, y + size, x + size, y - size); + }; + ShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { + if (color === void 0) { color = null; } + if (count < 3) + throw new Error("Polygon must contain at least 3 vertices"); + this.check(ShapeType.Line, count * 2); + if (color === null) + color = this.color; + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + offset <<= 1; + count <<= 1; + var firstX = polygonVertices[offset]; + var firstY = polygonVertices[offset + 1]; + var last = offset + count; + for (var i = offset, n = offset + count - 2; i < n; i += 2) { + var x1 = polygonVertices[i]; + var y1 = polygonVertices[i + 1]; + var x2 = 0; + var y2 = 0; + if (i + 2 >= last) { + x2 = firstX; + y2 = firstY; + } + else { + x2 = polygonVertices[i + 2]; + y2 = polygonVertices[i + 3]; + } + this.vertex(x1, y1, color); + this.vertex(x2, y2, color); + } + }; + ShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { + if (color === void 0) { color = null; } + if (segments === void 0) { segments = 0; } + if (segments === 0) + segments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0); + if (segments <= 0) + throw new Error("segments must be > 0."); + if (color === null) + color = this.color; + var angle = 2 * spine.MathUtils.PI / segments; + var cos = Math.cos(angle); + var sin = Math.sin(angle); + var cx = radius, cy = 0; + if (!filled) { + this.check(ShapeType.Line, segments * 2 + 2); + for (var i = 0; i < segments; i++) { + this.vertex(x + cx, y + cy, color); + var temp_1 = cx; + cx = cos * cx - sin * cy; + cy = sin * temp_1 + cos * cy; + this.vertex(x + cx, y + cy, color); + } + this.vertex(x + cx, y + cy, color); + } + else { + this.check(ShapeType.Filled, segments * 3 + 3); + segments--; + for (var i = 0; i < segments; i++) { + this.vertex(x, y, color); + this.vertex(x + cx, y + cy, color); + var temp_2 = cx; + cx = cos * cx - sin * cy; + cy = sin * temp_2 + cos * cy; + this.vertex(x + cx, y + cy, color); + } + this.vertex(x, y, color); + this.vertex(x + cx, y + cy, color); + } + var temp = cx; + cx = radius; + cy = 0; + this.vertex(x + cx, y + cy, color); + }; + ShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Line, segments * 2 + 2); + if (color === null) + color = this.color; + var subdiv_step = 1 / segments; + var subdiv_step2 = subdiv_step * subdiv_step; + var subdiv_step3 = subdiv_step * subdiv_step * subdiv_step; + var pre1 = 3 * subdiv_step; + var pre2 = 3 * subdiv_step2; + var pre4 = 6 * subdiv_step2; + var pre5 = 6 * subdiv_step3; + var tmp1x = x1 - cx1 * 2 + cx2; + var tmp1y = y1 - cy1 * 2 + cy2; + var tmp2x = (cx1 - cx2) * 3 - x1 + x2; + var tmp2y = (cy1 - cy2) * 3 - y1 + y2; + var fx = x1; + var fy = y1; + var dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3; + var dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3; + var ddfx = tmp1x * pre4 + tmp2x * pre5; + var ddfy = tmp1y * pre4 + tmp2y * pre5; + var dddfx = tmp2x * pre5; + var dddfy = tmp2y * pre5; + while (segments-- > 0) { + this.vertex(fx, fy, color); + fx += dfx; + fy += dfy; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + this.vertex(fx, fy, color); + } + this.vertex(fx, fy, color); + this.vertex(x2, y2, color); + }; + ShapeRenderer.prototype.vertex = function (x, y, color) { + var idx = this.vertexIndex; + var vertices = this.mesh.getVertices(); + vertices[idx++] = x; + vertices[idx++] = y; + vertices[idx++] = color.r; + vertices[idx++] = color.g; + vertices[idx++] = color.b; + vertices[idx++] = color.a; + this.vertexIndex = idx; + }; + ShapeRenderer.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 = false; + }; + ShapeRenderer.prototype.flush = function () { + if (this.vertexIndex == 0) + return; + this.mesh.setVerticesLength(this.vertexIndex); + this.mesh.draw(this.shader, this.shapeType); + this.vertexIndex = 0; + }; + ShapeRenderer.prototype.check = function (shapeType, numVertices) { + if (!this.isDrawing) + throw new Error("ShapeRenderer.begin() has not been called"); + if (this.shapeType == shapeType) { + if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) + this.flush(); + else + return; + } + else { + this.flush(); + this.shapeType = shapeType; + } + }; + ShapeRenderer.prototype.dispose = function () { + this.mesh.dispose(); + }; + return ShapeRenderer; + }()); + webgl.ShapeRenderer = ShapeRenderer; + var ShapeType; + (function (ShapeType) { + ShapeType[ShapeType["Point"] = 0] = "Point"; + ShapeType[ShapeType["Line"] = 1] = "Line"; + ShapeType[ShapeType["Filled"] = 4] = "Filled"; + })(ShapeType = webgl.ShapeType || (webgl.ShapeType = {})); + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var SkeletonDebugRenderer = (function () { + function SkeletonDebugRenderer(context) { + this.boneLineColor = new spine.Color(1, 0, 0, 1); + this.boneOriginColor = new spine.Color(0, 1, 0, 1); + this.attachmentLineColor = new spine.Color(0, 0, 1, 0.5); + this.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5); + this.pathColor = new spine.Color().setFromString("FF7F00"); + this.clipColor = new spine.Color(0.8, 0, 0, 2); + this.aabbColor = new spine.Color(0, 1, 0, 0.5); + this.drawBones = true; + this.drawRegionAttachments = true; + this.drawBoundingBoxes = true; + this.drawMeshHull = true; + this.drawMeshTriangles = true; + this.drawPaths = true; + this.drawSkeletonXY = false; + this.drawClipping = true; + this.premultipliedAlpha = false; + this.scale = 1; + this.boneWidth = 2; + this.bounds = new spine.SkeletonBounds(); + this.temp = new Array(); + this.vertices = spine.Utils.newFloatArray(2 * 1024); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + } + SkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) { + if (ignoredBones === void 0) { ignoredBones = null; } + var skeletonX = skeleton.x; + var skeletonY = skeleton.y; + var gl = this.context.gl; + var srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA; + shapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA); + var bones = skeleton.bones; + if (this.drawBones) { + shapes.setColor(this.boneLineColor); + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) + continue; + if (bone.parent == null) + continue; + var x = skeletonX + bone.data.length * bone.a + bone.worldX; + var y = skeletonY + bone.data.length * bone.c + bone.worldY; + shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale); + } + if (this.drawSkeletonXY) + shapes.x(skeletonX, skeletonY, 4 * this.scale); + } + if (this.drawRegionAttachments) { + shapes.setColor(this.attachmentLineColor); + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + var regionAttachment = attachment; + var vertices = this.vertices; + regionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2); + shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]); + shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]); + shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]); + shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]); + } + } + } + if (this.drawMeshHull || this.drawMeshTriangles) { + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.MeshAttachment)) + continue; + var mesh = attachment; + var vertices = this.vertices; + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2); + var triangles = mesh.triangles; + var hullLength = mesh.hullLength; + if (this.drawMeshTriangles) { + shapes.setColor(this.triangleLineColor); + for (var ii = 0, nn = triangles.length; ii < nn; ii += 3) { + var v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2; + shapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]); + } + } + if (this.drawMeshHull && hullLength > 0) { + shapes.setColor(this.attachmentLineColor); + hullLength = (hullLength >> 1) * 2; + var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1]; + for (var ii = 0, nn = hullLength; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + shapes.line(x, y, lastX, lastY); + lastX = x; + lastY = y; + } + } + } + } + if (this.drawBoundingBoxes) { + var bounds = this.bounds; + bounds.update(skeleton, true); + shapes.setColor(this.aabbColor); + shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight()); + var polygons = bounds.polygons; + var boxes = bounds.boundingBoxes; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + shapes.setColor(boxes[i].color); + shapes.polygon(polygon, 0, polygon.length); + } + } + if (this.drawPaths) { + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + continue; + var path = attachment; + var nn = path.worldVerticesLength; + var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); + path.computeWorldVertices(slot, 0, nn, world, 0, 2); + var color = this.pathColor; + var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0; + if (path.closed) { + shapes.setColor(color); + var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1]; + x2 = world[nn - 4]; + y2 = world[nn - 3]; + shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); + shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); + shapes.line(x1, y1, cx1, cy1); + shapes.line(x2, y2, cx2, cy2); + } + nn -= 4; + for (var ii = 4; ii < nn; ii += 6) { + var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3]; + x2 = world[ii + 4]; + y2 = world[ii + 5]; + shapes.setColor(color); + shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); + shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); + shapes.line(x1, y1, cx1, cy1); + shapes.line(x2, y2, cx2, cy2); + x1 = x2; + y1 = y2; + } + } + } + if (this.drawBones) { + shapes.setColor(this.boneOriginColor); + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) + continue; + shapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8); + } + } + if (this.drawClipping) { + var slots = skeleton.slots; + shapes.setColor(this.clipColor); + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.ClippingAttachment)) + continue; + var clip = attachment; + var nn = clip.worldVerticesLength; + var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); + clip.computeWorldVertices(slot, 0, nn, world, 0, 2); + for (var i_20 = 0, n_2 = world.length; i_20 < n_2; i_20 += 2) { + var x = world[i_20]; + var y = world[i_20 + 1]; + var x2 = world[(i_20 + 2) % world.length]; + var y2 = world[(i_20 + 3) % world.length]; + shapes.line(x, y, x2, y2); + } + } + } + }; + SkeletonDebugRenderer.prototype.dispose = function () { + }; + SkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1); + SkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1); + return SkeletonDebugRenderer; + }()); + webgl.SkeletonDebugRenderer = SkeletonDebugRenderer; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Renderable = (function () { + function Renderable(vertices, numVertices, numFloats) { + this.vertices = vertices; + this.numVertices = numVertices; + this.numFloats = numFloats; + } + return Renderable; + }()); + ; + var SkeletonRenderer = (function () { + function SkeletonRenderer(context, twoColorTint) { + if (twoColorTint === void 0) { twoColorTint = true; } + this.premultipliedAlpha = false; + this.vertexEffect = null; + this.tempColor = new spine.Color(); + this.tempColor2 = new spine.Color(); + this.vertexSize = 2 + 2 + 4; + this.twoColorTint = false; + this.renderable = new Renderable(null, 0, 0); + this.clipper = new spine.SkeletonClipping(); + this.temp = new spine.Vector2(); + this.temp2 = new spine.Vector2(); + this.temp3 = new spine.Color(); + this.temp4 = new spine.Color(); + this.twoColorTint = twoColorTint; + if (twoColorTint) + this.vertexSize += 4; + this.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024); + } + SkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) { + if (slotRangeStart === void 0) { slotRangeStart = -1; } + if (slotRangeEnd === void 0) { slotRangeEnd = -1; } + var clipper = this.clipper; + var premultipliedAlpha = this.premultipliedAlpha; + var twoColorTint = this.twoColorTint; + var blendMode = null; + var tempPos = this.temp; + var tempUv = this.temp2; + var tempLight = this.temp3; + var tempDark = this.temp4; + var renderable = this.renderable; + var uvs = null; + var triangles = null; + var drawOrder = skeleton.drawOrder; + var attachmentColor = null; + var skeletonColor = skeleton.color; + var vertexSize = twoColorTint ? 12 : 8; + var inRange = false; + if (slotRangeStart == -1) + inRange = true; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var clippedVertexSize = clipper.isClipping() ? 2 : vertexSize; + var slot = drawOrder[i]; + if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) { + inRange = true; + } + if (!inRange) { + clipper.clipEndWithSlot(slot); + continue; + } + if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) { + inRange = false; + } + var attachment = slot.getAttachment(); + var texture = null; + if (attachment instanceof spine.RegionAttachment) { + var region = attachment; + renderable.vertices = this.vertices; + renderable.numVertices = 4; + renderable.numFloats = clippedVertexSize << 2; + region.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize); + triangles = SkeletonRenderer.QUAD_TRIANGLES; + uvs = region.uvs; + texture = region.region.renderObject.texture; + attachmentColor = region.color; + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + renderable.vertices = this.vertices; + renderable.numVertices = (mesh.worldVerticesLength >> 1); + renderable.numFloats = renderable.numVertices * clippedVertexSize; + if (renderable.numFloats > renderable.vertices.length) { + renderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats); + } + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize); + triangles = mesh.triangles; + texture = mesh.region.renderObject.texture; + uvs = mesh.uvs; + attachmentColor = mesh.color; + } + else if (attachment instanceof spine.ClippingAttachment) { + var clip = (attachment); + clipper.clipStart(slot, clip); + continue; + } + else { + clipper.clipEndWithSlot(slot); + continue; + } + if (texture != null) { + var slotColor = slot.color; + var finalColor = this.tempColor; + finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r; + finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g; + finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b; + finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a; + if (premultipliedAlpha) { + finalColor.r *= finalColor.a; + finalColor.g *= finalColor.a; + finalColor.b *= finalColor.a; + } + var darkColor = this.tempColor2; + if (slot.darkColor == null) + darkColor.set(0, 0, 0, 1.0); + else { + if (premultipliedAlpha) { + darkColor.r = slot.darkColor.r * finalColor.a; + darkColor.g = slot.darkColor.g * finalColor.a; + darkColor.b = slot.darkColor.b * finalColor.a; + } + else { + darkColor.setFromColor(slot.darkColor); + } + darkColor.a = premultipliedAlpha ? 1.0 : 0.0; + } + var slotBlendMode = slot.data.blendMode; + if (slotBlendMode != blendMode) { + blendMode = slotBlendMode; + batcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode)); + } + if (clipper.isClipping()) { + clipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint); + var clippedVertices = new Float32Array(clipper.clippedVertices); + var clippedTriangles = clipper.clippedTriangles; + if (this.vertexEffect != null) { + var vertexEffect = this.vertexEffect; + var verts = clippedVertices; + if (!twoColorTint) { + for (var v = 0, n_3 = clippedVertices.length; v < n_3; v += vertexSize) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); + tempUv.x = verts[v + 6]; + tempUv.y = verts[v + 7]; + tempDark.set(0, 0, 0, 0); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + } + } + else { + for (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); + tempUv.x = verts[v + 6]; + tempUv.y = verts[v + 7]; + tempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + verts[v + 8] = tempDark.r; + verts[v + 9] = tempDark.g; + verts[v + 10] = tempDark.b; + verts[v + 11] = tempDark.a; + } + } + } + batcher.draw(texture, clippedVertices, clippedTriangles); + } + else { + var verts = renderable.vertices; + if (this.vertexEffect != null) { + var vertexEffect = this.vertexEffect; + if (!twoColorTint) { + for (var v = 0, u = 0, n_5 = renderable.numFloats; v < n_5; v += vertexSize, u += 2) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempUv.x = uvs[u]; + tempUv.y = uvs[u + 1]; + tempLight.setFromColor(finalColor); + tempDark.set(0, 0, 0, 0); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + } + } + else { + for (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempUv.x = uvs[u]; + tempUv.y = uvs[u + 1]; + tempLight.setFromColor(finalColor); + tempDark.setFromColor(darkColor); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + verts[v + 8] = tempDark.r; + verts[v + 9] = tempDark.g; + verts[v + 10] = tempDark.b; + verts[v + 11] = tempDark.a; + } + } + } + else { + if (!twoColorTint) { + for (var v = 2, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) { + verts[v] = finalColor.r; + verts[v + 1] = finalColor.g; + verts[v + 2] = finalColor.b; + verts[v + 3] = finalColor.a; + verts[v + 4] = uvs[u]; + verts[v + 5] = uvs[u + 1]; + } + } + else { + for (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) { + verts[v] = finalColor.r; + verts[v + 1] = finalColor.g; + verts[v + 2] = finalColor.b; + verts[v + 3] = finalColor.a; + verts[v + 4] = uvs[u]; + verts[v + 5] = uvs[u + 1]; + verts[v + 6] = darkColor.r; + verts[v + 7] = darkColor.g; + verts[v + 8] = darkColor.b; + verts[v + 9] = darkColor.a; + } + } + } + var view = renderable.vertices.subarray(0, renderable.numFloats); + batcher.draw(texture, view, triangles); + } + } + clipper.clipEndWithSlot(slot); + } + clipper.clipEnd(); + }; + SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; + return SkeletonRenderer; + }()); + webgl.SkeletonRenderer = SkeletonRenderer; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var Vector3 = (function () { + function Vector3(x, y, z) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (z === void 0) { z = 0; } + this.x = 0; + this.y = 0; + this.z = 0; + this.x = x; + this.y = y; + this.z = z; + } + Vector3.prototype.setFrom = function (v) { + this.x = v.x; + this.y = v.y; + this.z = v.z; + return this; + }; + Vector3.prototype.set = function (x, y, z) { + this.x = x; + this.y = y; + this.z = z; + return this; + }; + Vector3.prototype.add = function (v) { + this.x += v.x; + this.y += v.y; + this.z += v.z; + return this; + }; + Vector3.prototype.sub = function (v) { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + return this; + }; + Vector3.prototype.scale = function (s) { + this.x *= s; + this.y *= s; + this.z *= s; + return this; + }; + Vector3.prototype.normalize = function () { + var len = this.length(); + if (len == 0) + return this; + len = 1 / len; + this.x *= len; + this.y *= len; + this.z *= len; + return this; + }; + Vector3.prototype.cross = function (v) { + return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x); + }; + Vector3.prototype.multiply = function (matrix) { + var l_mat = matrix.values; + return this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]); + }; + Vector3.prototype.project = function (matrix) { + var l_mat = matrix.values; + var l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]); + return this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w); + }; + Vector3.prototype.dot = function (v) { + return this.x * v.x + this.y * v.y + this.z * v.z; + }; + Vector3.prototype.length = function () { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + }; + Vector3.prototype.distance = function (v) { + var a = v.x - this.x; + var b = v.y - this.y; + var c = v.z - this.z; + return Math.sqrt(a * a + b * b + c * c); + }; + return Vector3; + }()); + webgl.Vector3 = Vector3; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +var spine; +(function (spine) { + var webgl; + (function (webgl) { + var ManagedWebGLRenderingContext = (function () { + function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) { + if (contextConfig === void 0) { contextConfig = { alpha: "true" }; } + var _this = this; + this.restorables = new Array(); + if (canvasOrContext instanceof HTMLCanvasElement) { + var canvas = canvasOrContext; + this.gl = (canvas.getContext("webgl", contextConfig) || canvas.getContext("experimental-webgl", contextConfig)); + this.canvas = canvas; + canvas.addEventListener("webglcontextlost", function (e) { + var event = e; + if (e) { + e.preventDefault(); + } + }); + canvas.addEventListener("webglcontextrestored", function (e) { + for (var i = 0, n = _this.restorables.length; i < n; i++) { + _this.restorables[i].restore(); + } + }); + } + else { + this.gl = canvasOrContext; + this.canvas = this.gl.canvas; + } + } + ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) { + this.restorables.push(restorable); + }; + ManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) { + var index = this.restorables.indexOf(restorable); + if (index > -1) + this.restorables.splice(index, 1); + }; + return ManagedWebGLRenderingContext; + }()); + webgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext; + var WebGLBlendModeConverter = (function () { + function WebGLBlendModeConverter() { + } + WebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) { + switch (blendMode) { + case spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + case spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE; + case spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + default: throw new Error("Unknown blend mode: " + blendMode); + } + }; + WebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + switch (blendMode) { + case spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; + case spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; + case spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR; + case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE; + default: throw new Error("Unknown blend mode: " + blendMode); + } + }; + WebGLBlendModeConverter.ZERO = 0; + WebGLBlendModeConverter.ONE = 1; + WebGLBlendModeConverter.SRC_COLOR = 0x0300; + WebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301; + WebGLBlendModeConverter.SRC_ALPHA = 0x0302; + WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303; + WebGLBlendModeConverter.DST_ALPHA = 0x0304; + WebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305; + WebGLBlendModeConverter.DST_COLOR = 0x0306; + return WebGLBlendModeConverter; + }()); + webgl.WebGLBlendModeConverter = WebGLBlendModeConverter; + })(webgl = spine.webgl || (spine.webgl = {})); +})(spine || (spine = {})); +//# sourceMappingURL=spine-webgl.js.map + +/*** EXPORTS FROM exports-loader ***/ +module.exports = spine; +}.call(window)); + +/***/ }) + +/******/ }); +//# sourceMappingURL=SpineWebGLPluginDebug.js.map \ No newline at end of file diff --git a/plugins/spine/dist/SpineWebGLPluginDebug.js.map b/plugins/spine/dist/SpineWebGLPluginDebug.js.map new file mode 100644 index 000000000..84b18ad40 --- /dev/null +++ b/plugins/spine/dist/SpineWebGLPluginDebug.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///D:/wamp/www/phaser/node_modules/eventemitter3/index.js","webpack:///D:/wamp/www/phaser/src/data/DataManager.js","webpack:///D:/wamp/www/phaser/src/data/events/CHANGE_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/REMOVE_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/SET_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/index.js","webpack:///D:/wamp/www/phaser/src/gameobjects/BuildGameObject.js","webpack:///D:/wamp/www/phaser/src/gameobjects/GameObject.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ComputedSize.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Depth.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Flip.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ScrollFactor.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ToJSON.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Transform.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/TransformMatrix.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Visible.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/index.js","webpack:///D:/wamp/www/phaser/src/loader/File.js","webpack:///D:/wamp/www/phaser/src/loader/FileTypesManager.js","webpack:///D:/wamp/www/phaser/src/loader/GetURL.js","webpack:///D:/wamp/www/phaser/src/loader/MergeXHRSettings.js","webpack:///D:/wamp/www/phaser/src/loader/MultiFile.js","webpack:///D:/wamp/www/phaser/src/loader/XHRLoader.js","webpack:///D:/wamp/www/phaser/src/loader/XHRSettings.js","webpack:///D:/wamp/www/phaser/src/loader/const.js","webpack:///D:/wamp/www/phaser/src/loader/events/ADD_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_LOAD_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_PROGRESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/POST_PROCESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/PROGRESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/START_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/index.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/ImageFile.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/JSONFile.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/TextFile.js","webpack:///D:/wamp/www/phaser/src/math/Average.js","webpack:///D:/wamp/www/phaser/src/math/Bernstein.js","webpack:///D:/wamp/www/phaser/src/math/Between.js","webpack:///D:/wamp/www/phaser/src/math/CatmullRom.js","webpack:///D:/wamp/www/phaser/src/math/CeilTo.js","webpack:///D:/wamp/www/phaser/src/math/Clamp.js","webpack:///D:/wamp/www/phaser/src/math/DegToRad.js","webpack:///D:/wamp/www/phaser/src/math/Difference.js","webpack:///D:/wamp/www/phaser/src/math/Factorial.js","webpack:///D:/wamp/www/phaser/src/math/FloatBetween.js","webpack:///D:/wamp/www/phaser/src/math/FloorTo.js","webpack:///D:/wamp/www/phaser/src/math/FromPercent.js","webpack:///D:/wamp/www/phaser/src/math/GetSpeed.js","webpack:///D:/wamp/www/phaser/src/math/IsEven.js","webpack:///D:/wamp/www/phaser/src/math/IsEvenStrict.js","webpack:///D:/wamp/www/phaser/src/math/Linear.js","webpack:///D:/wamp/www/phaser/src/math/Matrix3.js","webpack:///D:/wamp/www/phaser/src/math/Matrix4.js","webpack:///D:/wamp/www/phaser/src/math/MaxAdd.js","webpack:///D:/wamp/www/phaser/src/math/MinSub.js","webpack:///D:/wamp/www/phaser/src/math/Percent.js","webpack:///D:/wamp/www/phaser/src/math/Quaternion.js","webpack:///D:/wamp/www/phaser/src/math/RadToDeg.js","webpack:///D:/wamp/www/phaser/src/math/RandomXY.js","webpack:///D:/wamp/www/phaser/src/math/RandomXYZ.js","webpack:///D:/wamp/www/phaser/src/math/RandomXYZW.js","webpack:///D:/wamp/www/phaser/src/math/Rotate.js","webpack:///D:/wamp/www/phaser/src/math/RotateAround.js","webpack:///D:/wamp/www/phaser/src/math/RotateAroundDistance.js","webpack:///D:/wamp/www/phaser/src/math/RotateVec3.js","webpack:///D:/wamp/www/phaser/src/math/RoundAwayFromZero.js","webpack:///D:/wamp/www/phaser/src/math/RoundTo.js","webpack:///D:/wamp/www/phaser/src/math/SinCosTableGenerator.js","webpack:///D:/wamp/www/phaser/src/math/SmoothStep.js","webpack:///D:/wamp/www/phaser/src/math/SmootherStep.js","webpack:///D:/wamp/www/phaser/src/math/ToXY.js","webpack:///D:/wamp/www/phaser/src/math/TransformXY.js","webpack:///D:/wamp/www/phaser/src/math/Vector2.js","webpack:///D:/wamp/www/phaser/src/math/Vector3.js","webpack:///D:/wamp/www/phaser/src/math/Vector4.js","webpack:///D:/wamp/www/phaser/src/math/Within.js","webpack:///D:/wamp/www/phaser/src/math/Wrap.js","webpack:///D:/wamp/www/phaser/src/math/angle/Between.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenPoints.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenPointsY.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenY.js","webpack:///D:/wamp/www/phaser/src/math/angle/CounterClockwise.js","webpack:///D:/wamp/www/phaser/src/math/angle/Normalize.js","webpack:///D:/wamp/www/phaser/src/math/angle/Reverse.js","webpack:///D:/wamp/www/phaser/src/math/angle/RotateTo.js","webpack:///D:/wamp/www/phaser/src/math/angle/ShortestBetween.js","webpack:///D:/wamp/www/phaser/src/math/angle/Wrap.js","webpack:///D:/wamp/www/phaser/src/math/angle/WrapDegrees.js","webpack:///D:/wamp/www/phaser/src/math/angle/index.js","webpack:///D:/wamp/www/phaser/src/math/const.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceBetween.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistancePower.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceSquared.js","webpack:///D:/wamp/www/phaser/src/math/distance/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/linear/Linear.js","webpack:///D:/wamp/www/phaser/src/math/easing/linear/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/stepped/Stepped.js","webpack:///D:/wamp/www/phaser/src/math/easing/stepped/index.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Ceil.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Equal.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Floor.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/GreaterThan.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/LessThan.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/index.js","webpack:///D:/wamp/www/phaser/src/math/index.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/BezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/CatmullRomInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/CubicBezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/LinearInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/QuadraticBezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/SmoothStepInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/SmootherStepInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/index.js","webpack:///D:/wamp/www/phaser/src/math/pow2/GetPowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/IsSizePowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/IsValuePowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/index.js","webpack:///D:/wamp/www/phaser/src/math/random-data-generator/RandomDataGenerator.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapCeil.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapFloor.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapTo.js","webpack:///D:/wamp/www/phaser/src/math/snap/index.js","webpack:///D:/wamp/www/phaser/src/plugins/BasePlugin.js","webpack:///D:/wamp/www/phaser/src/plugins/ScenePlugin.js","webpack:///D:/wamp/www/phaser/src/renderer/BlendModes.js","webpack:///D:/wamp/www/phaser/src/renderer/ScaleModes.js","webpack:///D:/wamp/www/phaser/src/scale/events/RESIZE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/BOOT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/CREATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/PAUSE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/POST_UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/PRE_UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/READY_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/RENDER_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/RESUME_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/SHUTDOWN_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/SLEEP_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/START_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_INIT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_OUT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_START_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/WAKE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/index.js","webpack:///D:/wamp/www/phaser/src/utils/Class.js","webpack:///D:/wamp/www/phaser/src/utils/NOOP.js","webpack:///D:/wamp/www/phaser/src/utils/object/Extend.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetAdvancedValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetFastValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/IsPlainObject.js","webpack:///./SpineFile.js","webpack:///./SpinePlugin.js","webpack:///./events/COMPLETE_EVENT.js","webpack:///./events/DISPOSE_EVENT.js","webpack:///./events/END_EVENT.js","webpack:///./events/EVENT_EVENT.js","webpack:///./events/INTERRUPTED_EVENT.js","webpack:///./events/START_EVENT.js","webpack:///./events/index.js","webpack:///./gameobject/SpineGameObject.js","webpack:///./gameobject/SpineGameObjectRender.js","webpack:///./gameobject/SpineGameObjectWebGLRenderer.js","webpack:///./runtimes/spine-webgl.js"],"names":[],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yDAAyD,OAAO;AAChE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yCAAyC,SAAS;AAClD;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA,eAAe,YAAY;AAC3B;;AAEA;AACA,2DAA2D;AAC3D,+DAA+D;AAC/D,mEAAmE;AACnE,uEAAuE;AACvE;AACA,0DAA0D,SAAS;AACnE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,2DAA2D,YAAY;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI,IAA6B;AACjC;AACA;;;;;;;;;;;;AC/UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,aAAa,mBAAO,CAAC,mDAAU;;AAE/B;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,KAAK;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2DAA2D;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa;;AAEb;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,EAAE;AACjB,eAAe,KAAK;AACpB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,QAAQ;AACvB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA,sCAAsC,kBAAkB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1nBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,qBAAqB,mBAAO,CAAC,kFAAyB;AACtD,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,cAAc,mBAAO,CAAC,oEAAkB;;AAExC;;;;;;;;;;;;ACjBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,mEAAwB;AACjD,uBAAuB,mBAAO,CAAC,uFAAkC;AACjE,iBAAiB,mBAAO,CAAC,mEAAwB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,8BAA8B;AACzC,WAAW,0CAA0C;AACrD;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,iBAAiB,WAAW,KAAK,SAAS;;AAE1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,kBAAkB,KAAK,gBAAgB;;AAExD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,iBAAiB,cAAc,KAAK,UAAU;;AAE9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9HA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,uBAAuB,mBAAO,CAAC,0EAAqB;AACpD,kBAAkB,mBAAO,CAAC,6DAAqB;AAC/C,mBAAmB,mBAAO,CAAC,mEAAe;AAC1C,aAAa,mBAAO,CAAC,0DAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2DAA2D;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,mCAAmC;AAClD,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wCAAwC;AACxD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,sCAAsC,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1nBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9IA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACtFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC7JA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpGA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA,YAAY,wCAAwC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,oDAAkB;AAC3C,sBAAsB,mBAAO,CAAC,iFAAmB;AACjD,gBAAgB,mBAAO,CAAC,8DAAuB;AAC/C,uBAAuB,mBAAO,CAAC,4EAA8B;;AAE7D;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,kCAAkC,oCAAoC;AACtE,mCAAmC,sCAAsC;;AAEzE;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;;AAE3E;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;AAC3E,yCAAyC,sCAAsC;;AAE/E;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC/gBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,iBAAiB,mBAAO,CAAC,oDAAkB;AAC3C,cAAc,mBAAO,CAAC,wDAAoB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;;AAEvC;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,+CAA+C;AAC9D;AACA,gBAAgB,+CAA+C;AAC/D;AACA;AACA;AACA,kCAAkC,UAAU,cAAc;;AAE1D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,mCAAmC,wBAAwB;;AAE3D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACj8BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AClFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA,kBAAkB,UAAU,mBAAO,CAAC,yEAAiB;;;;;;;;;;;;ACVrD;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,YAAY,mBAAO,CAAC,6CAAS;AAC7B,aAAa,mBAAO,CAAC,qDAAU;AAC/B,mBAAmB,mBAAO,CAAC,+EAA8B;AACzD,aAAa,mBAAO,CAAC,+CAAU;AAC/B,uBAAuB,mBAAO,CAAC,mEAAoB;AACnD,gBAAgB,mBAAO,CAAC,qDAAa;AACrC,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,+BAA+B;AAC1C;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA,4GAA4G;AAC5G;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,2DAA2D;;AAE3D;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kBAAkB;;AAEnD;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iEAAiE;AACjE;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACthBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AClCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,mEAAwB;AAC7C,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,sCAAsC;AACjD;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,mEAAmE;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC3LA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,mEAAoB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,sCAAsC;AACjD;AACA,YAAY,eAAe;AAC3B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC7DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,qCAAqC,mBAAmB;AACxD,8BAA8B,cAAc;AAC5C,6BAA6B,WAAW;AACxC,iCAAiC,eAAe;AAChD,gCAAgC,aAAa;;AAE7C;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACjJA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,2BAA2B;AACtC,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,uDAAuD;AACjJ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,oFAAoF,mDAAmD;AACvI;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBA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W,+CAA+C;AAC1D;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uGAAuG;AAClH,WAAW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC3QA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,eAAe,mBAAO,CAAC,0EAA6B;AACpD,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,QAAQ;AACR,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC/NA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;ACxKA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,mDAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1kBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;;AAEA;;;;;;;;;;;;AC/6CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,4BAA4B,eAAe;;AAE3C;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,cAAc,mBAAO,CAAC,+CAAW;AACjC,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C;;AAE5C;;AAEA,gCAAgC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC7vBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,+BAA+B,YAAY;;AAE3C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC,2BAA2B;AAC3B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,qDAAiB;AACvC,cAAc,mBAAO,CAAC,qDAAiB;AACvC,iBAAiB,mBAAO,CAAC,2DAAoB;;AAE7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC7CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA,+BAA+B,YAAY;AAC3C,+BAA+B,YAAY;AAC3C,kCAAkC,eAAe;;AAEjD;;AAEA;AACA;;AAEA,mBAAmB,YAAY;AAC/B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,6BAA6B;AAC9E;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,oBAAoB;AAC/B;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,4BAA4B,qBAAqB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+CAA+C;AAC1D;AACA,YAAY,+CAA+C;AAC3D;AACA;AACA;AACA,+BAA+B,wBAAwB;;AAEvD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO;;AAEzC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,6BAA6B,YAAY;;AAEzC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;;;;;;;;;;;ACxnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;;;;;;;;;;;ACnyBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1hBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,2BAA2B;AACtC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA,2CAA2C,sCAAsC;AACjF;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,2BAA2B;AACtC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA,2CAA2C,gCAAgC;AAC3E;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,4CAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,yDAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,4CAAU;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,6BAA6B,aAAa;;AAE1C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;AC1CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,0CAAS;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,WAAW,mBAAO,CAAC,0CAAS;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,aAAa,mBAAO,CAAC,qDA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AEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,aAAa,mBAAO,CAAC,wEAAmB;AACxC,WAAW,mBAAO,CAAC,oEAAiB;AACpC,aAAa,mBAAO,CAAC,wEAAmB;;AAExC;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,iDAAM;AACtB,SAAS,mBAAO,CAAC,mDAAO;AACxB,WAAW,mBAAO,CAAC,uDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,mDAAM;AACtB,SAAS,mBAAO,CAAC,qDAAO;AACxB,WAAW,mBAAO,CAAC,yDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,qDAAM;AACtB,SAAS,mBAAO,CAAC,uDAAO;AACxB,WAAW,mBAAO,CAAC,2DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,kDAAM;AACtB,SAAS,mBAAO,CAAC,oDAAO;AACxB,WAAW,mBAAO,CAAC,wDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO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;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,sDAAM;AACtB,SAAS,mBAAO,CAAC,wDAAO;AACxB,WAAW,mBAAO,CAAC,4DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,iDAAM;AACtB,SAAS,mBAAO,CAAC,mDAAO;AACxB,WAAW,mBAAO,CAAC,uDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,8DAAW;;;;;;;;;;;;ACVpC;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA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CAAC,+CAAW;AAChC,aAAa,mBAAO,CAAC,+CAAW;AAChC,gBAAgB,mBAAO,CAAC,qDAAc;AACtC,gBAAgB,mBAAO,CAAC,qDAAc;;AAEtC;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;ACjFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,oDAAc;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,QAAQ;AAC3B;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sDAAe;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AClDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC/DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,8CAAW;;AAEhC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sDAAe;;AAExC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,0DAAiB;;AAE5C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,YAAY,mBAAO,CAAC,qFAAuB;AAC3C,gBAAgB,mBAAO,CAAC,6FAA2B;AACnD,iBAAiB,mBAAO,CAAC,+FAA4B;AACrD,YAAY,mBAAO,CAAC,qFAAuB;AAC3C,qBAAqB,mBAAO,CAAC,uGAAgC;AAC7D,gBAAgB,mBAAO,CAAC,6FAA2B;AACnD,kBAAkB,mBAAO,CAAC,iGAA6B;;AAEvD;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,aAAa,mBAAO,CAAC,gEAAiB;AACtC,YAAY,mBAAO,CAAC,sEAAoB;AACxC,aAAa,mBAAO,CAAC,wEAAqB;;AAE1C;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B;AACA;;AAEA;;AAEA;AACA;AACA,kCAAkC,qDAAqD;;AAEvF;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,oEAAoE;;AAEpE;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;;AAEA;;AAEA,kDAAkD;AAClD,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,wCAAwC;AAC/D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA,wBAAwB,UAAU;AAClC;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;;AAEA,yBAAyB,OAAO;AAChC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC5eA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,UAAU,mBAAO,CAAC,sDAAY;AAC9B,WAAW,mBAAO,CAAC,wDAAa;AAChC,QAAQ,mBAAO,CAAC,kDAAU;;AAE1B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC9KA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,iBAAiB,mBAAO,CAAC,wDAAc;AACvC,YAAY,mBAAO,CAAC,mDAAgB;AACpC,kBAAkB,mBAAO,CAAC,2DAAiB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AClFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4EAA4E;AACvF;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,6CAA6C;AACpF;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,qDAAqD;AACpH;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA,4EAA4E,sDAAsD;AAClI;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAA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A;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvPA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,oBAAoB,mBAAO,CAAC,mEAAiB;;AAE7C,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,YAAY,OAAO;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5FA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,WAAW,mBAAO,CAAC,8CAAY;AAC/B,eAAe,mBAAO,CAAC,yDAAY;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,8CAA8C,aAAa,qBAAqB;AAChF;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE,oBAAoB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;;AAEA;;;;;;;;;;;;ACjDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,6DAA0B;AAC9C,mBAAmB,mBAAO,CAAC,yFAAwC;AACnE,gBAAgB,mBAAO,CAAC,8FAA4C;AACpE,oBAAoB,mBAAO,CAAC,2FAAyC;AACrE,eAAe,mBAAO,CAAC,4FAA2C;AAClE,gBAAgB,mBAAO,CAAC,0EAAkC;AAC1D,eAAe,mBAAO,CAAC,4FAA2C;;AAElE;AACA,aAAa,OAAO;AACpB;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,kBAAkB;AAChC,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,kBAAkB;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,iDAAiD;AAC5D,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,kBAAkB;AAC7B,WAAW,kBAAkB;AAC7B;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+BAA+B,oBAAoB;AACnD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B,qBAAqB;AACpD;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,2BAA2B,uBAAuB;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,sCAAsC,mEAAmE;;AAEzG;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACtPA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,sBAAsB,mBAAO,CAAC,6FAA0C;AACxE,YAAY,mBAAO,CAAC,6DAA0B;AAC9C,eAAe,mBAAO,CAAC,iFAAoC;AAC3D,kBAAkB,mBAAO,CAAC,yFAAwC;AAClE,kBAAkB,mBAAO,CAAC,6EAAkC;AAC5D,YAAY,mBAAO,CAAC,wCAAO;AAC3B,gBAAgB,mBAAO,CAAC,mCAAa;AACrC,sBAAsB,mBAAO,CAAC,qEAA8B;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qGAAqG;AACpH,eAAe,OAAO;AACtB,eAAe,gBAAgB;AAC/B,eAAe,QAAQ;AACvB,eAAe,sCAAsC;AACrD,eAAe,sCAAsC;AACrD;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,QAAQ;AACvB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA,mCAAmC,aAAa;;AAEhD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,eAAe;AAC9B,eAAe,WAAW;AAC1B;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACnmCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,cAAc,mBAAO,CAAC,oDAAkB;AACxC,aAAa,mBAAO,CAAC,kDAAiB;AACtC,SAAS,mBAAO,CAAC,0CAAa;AAC9B,WAAW,mBAAO,CAAC,8CAAe;AAClC,iBAAiB,mBAAO,CAAC,0DAAqB;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AAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,kBAAkB;;AAEpD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,kCAAkC,6BAA6B;AAC/D,mCAAmC,+BAA+B;AAClE,oCAAoC,aAAa;AACjD,oCAAoC,aAAa;;AAEjD;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,oCAAoC,aAAa;AACjD,oCAAoC,aAAa;;AAEjD;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,2BAA2B;AAClD;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,oCAAoC;AAC/D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,uCAAuC,gBAAgB;;AAEvD;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,4CAA4C,yBAAyB;;AAErE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,YAAY;AAC/C,qCAAqC,cAAc;AACnD,qCAAqC,gBAAgB;;AAErD;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,8BAA8B;AAC9C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACnjDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,kBAAkB,mBAAO,CAAC,8DAA4B;AACtD,mBAAmB,mBAAO,CAAC,8DAA4B;;AAEvD,IAAI,IAAqB;AACzB;AACA,kBAAkB,mBAAO,CAAC,oFAAgC;AAC1D;;AAEA,IAAI,KAAsB;AAC1B,EAEC;;AAED;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,gGAA6C;AAC5E,eAAe,mBAAO,CAAC,oEAA+B;AACtD,WAAW,mBAAO,CAAC,4DAA2B;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oCAAoC;AAC/C,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACjKA;AACA;;AAEA;AACA;AACA,IAAI,gBAAgB,sCAAsC,iBAAiB,EAAE;AAC7E,mBAAmB,uDAAuD;AAC1E;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA,yBAAyB,UAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,WAAW;AAC1D;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,mDAAmD;AACrD;AACA;AACA;AACA;AACA,EAAE,+DAA+D;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,+DAA+D;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,OAAO;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,6CAA6C;AACtD;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,yBAAyB,EAAE;AAChF;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,sDAAsD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF;AACjF;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,+CAA+C,0BAA0B;AACzE;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,sDAAsD;AACxD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,kEAAkE;AACpE,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,eAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA,qCAAqC,iBAAiB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE,+DAA+D;AACjE;AACA;AACA;AACA;AACA;AACA,EAAE,4DAA4D;AAC9D;AACA;AACA;AACA;AACA;AACA,EAAE,yDAAyD;AAC3D,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,+BAA+B;AACjD;AACA;AACA;AACA;AACA,kBAAkB,sCAAsC;AACxD;AACA;AACA;AACA;AACA,kBAAkB,iCAAiC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA,kBAAkB,eAAe;AACjC;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,OAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,OAAO;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,sBAAsB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,OAAO;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2BAA2B;AAC9C;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,OAAO;AAClE;AACA;AACA;AACA,yBAAyB,kBAAkB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,kEAAkE;AACpE;AACA;AACA;AACA;AACA;AACA,EAAE,4DAA4D;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;AACtE,4DAA4D;AAC5D,+CAA+C;AAC/C;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,gBAAgB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,2CAA2C,+BAA+B;AAC1E;AACA;AACA;AACA;AACA,0BAA0B,WAAW;AACrC;AACA;AACA;AACA;AACA;AACA,yBAAyB,UAAU;AACnC;AACA;AACA;AACA;AACA;AACA,0BAA0B,WAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,WAAW;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,WAAW;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,WAAW;AACjD;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,WAAW;AAChE;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,qEAAqE;AACvE,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iBAAiB;AACjD;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,UAAU;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,yBAAyB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,yBAAyB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,yBAAyB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,yBAAyB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD,mDAAmD;AACnD;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,wBAAwB;AACvE,6CAA6C,sDAAsD;AACnG,6CAA6C,qDAAqD;AAClG;AACA;AACA;AACA;AACA,6CAA6C,sBAAsB;AACnE,4CAA4C,4BAA4B;AACxE,4CAA4C,2BAA2B;AACvE;AACA;AACA;AACA;AACA,4CAA4C,qBAAqB;AACjE;AACA;AACA;AACA,mBAAmB,4BAA4B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,4BAA4B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,4BAA4B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,0BAA0B,UAAU;AACpC;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG,oFAAoF;AACvF,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD,iCAAiC,qBAAqB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,oBAAoB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,uBAAuB;AAC/E;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,4BAA4B;AACpE,oCAAoC,qBAAqB;AACzD,kCAAkC,mBAAmB;AACrD;AACA;AACA;AACA;AACA;AACA,wCAAwC,4BAA4B;AACpE,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,wCAAwC,4BAA4B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,wCAAwC,4BAA4B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,yDAAyD;AAC5D,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE,mDAAmD,0BAA0B;AAC7E,qDAAqD,4BAA4B;AACjF,yDAAyD,sBAAsB;AAC/E,qDAAqD,sBAAsB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,8CAA8C,kDAAkD,iDAAiD,+BAA+B,mCAAmC,0BAA0B,2CAA2C,mDAAmD,8EAA8E,WAAW;AACne,qGAAqG,2FAA2F,mCAAmC,sCAAsC,0BAA0B,uEAAuE,WAAW;AACrX;AACA;AACA;AACA,+DAA+D,8CAA8C,+CAA+C,kDAAkD,iDAAiD,+BAA+B,8BAA8B,mCAAmC,0BAA0B,2CAA2C,2CAA2C,mDAAmD,8EAA8E,WAAW;AAC3lB,qGAAqG,2FAA2F,mCAAmC,mCAAmC,sCAAsC,0BAA0B,8DAA8D,oDAAoD,8HAA8H,WAAW;AACjkB;AACA;AACA;AACA,+DAA+D,8CAA8C,iDAAiD,+BAA+B,0BAA0B,2CAA2C,8EAA8E,WAAW;AAC3V,qGAAqG,2FAA2F,0BAA0B,mCAAmC,WAAW;AACxQ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,qBAAqB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,sDAAsD;AACzD,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,YAAY;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,qBAAqB;AACzD,kCAAkC,mBAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,SAAS;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,SAAS;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B,uBAAuB,OAAO;AAC9B,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,kBAAkB,iBAAiB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,4BAA4B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,0CAA0C;AAC5C,CAAC,sBAAsB;AACvB;;AAEA;AACA;AACA,CAAC,e","file":"SpineWebGLPluginDebug.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./SpinePlugin.js\");\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar Events = require('./events');\r\n\r\n/**\r\n * @callback DataEachCallback\r\n *\r\n * @param {*} parent - The parent object of the DataManager.\r\n * @param {string} key - The key of the value.\r\n * @param {*} value - The value.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin.\r\n * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter,\r\n * or have a property called `events` that is an instance of it.\r\n *\r\n * @class DataManager\r\n * @memberof Phaser.Data\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {object} parent - The object that this DataManager belongs to.\r\n * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter.\r\n */\r\nvar DataManager = new Class({\r\n\r\n initialize:\r\n\r\n function DataManager (parent, eventEmitter)\r\n {\r\n /**\r\n * The object that this DataManager belongs to.\r\n *\r\n * @name Phaser.Data.DataManager#parent\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.parent = parent;\r\n\r\n /**\r\n * The DataManager's event emitter.\r\n *\r\n * @name Phaser.Data.DataManager#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events = eventEmitter;\r\n\r\n if (!eventEmitter)\r\n {\r\n this.events = (parent.events) ? parent.events : parent;\r\n }\r\n\r\n /**\r\n * The data list.\r\n *\r\n * @name Phaser.Data.DataManager#list\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.0.0\r\n */\r\n this.list = {};\r\n\r\n /**\r\n * The public values list. You can use this to access anything you have stored\r\n * in this Data Manager. For example, if you set a value called `gold` you can\r\n * access it via:\r\n *\r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also modify it directly:\r\n * \r\n * ```javascript\r\n * this.data.values.gold += 1000;\r\n * ```\r\n *\r\n * Doing so will emit a `setdata` event from the parent of this Data Manager.\r\n * \r\n * Do not modify this object directly. Adding properties directly to this object will not\r\n * emit any events. Always use `DataManager.set` to create new items the first time around.\r\n *\r\n * @name Phaser.Data.DataManager#values\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.10.0\r\n */\r\n this.values = {};\r\n\r\n /**\r\n * Whether setting data is frozen for this DataManager.\r\n *\r\n * @name Phaser.Data.DataManager#_frozen\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._frozen = false;\r\n\r\n if (!parent.hasOwnProperty('sys') && this.events)\r\n {\r\n this.events.once('destroy', this.destroy, this);\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves the value for the given key, or undefined if it doesn't exist.\r\n *\r\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\r\n * \r\n * ```javascript\r\n * this.data.get('gold');\r\n * ```\r\n *\r\n * Or access the value directly:\r\n * \r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also pass in an array of keys, in which case an array of values will be returned:\r\n * \r\n * ```javascript\r\n * this.data.get([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * This approach is useful for destructuring arrays in ES6.\r\n *\r\n * @method Phaser.Data.DataManager#get\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\r\n *\r\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\r\n */\r\n get: function (key)\r\n {\r\n var list = this.list;\r\n\r\n if (Array.isArray(key))\r\n {\r\n var output = [];\r\n\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n output.push(list[key[i]]);\r\n }\r\n\r\n return output;\r\n }\r\n else\r\n {\r\n return list[key];\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves all data values in a new object.\r\n *\r\n * @method Phaser.Data.DataManager#getAll\r\n * @since 3.0.0\r\n *\r\n * @return {Object.} All data values.\r\n */\r\n getAll: function ()\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Queries the DataManager for the values of keys matching the given regular expression.\r\n *\r\n * @method Phaser.Data.DataManager#query\r\n * @since 3.0.0\r\n *\r\n * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj).\r\n *\r\n * @return {Object.} The values of the keys matching the search string.\r\n */\r\n query: function (search)\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key) && key.match(search))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created.\r\n * \r\n * ```javascript\r\n * data.set('name', 'Red Gem Stone');\r\n * ```\r\n *\r\n * You can also pass in an object of key value pairs as the first argument:\r\n *\r\n * ```javascript\r\n * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\r\n * ```\r\n *\r\n * To get a value back again you can call `get`:\r\n * \r\n * ```javascript\r\n * data.get('gold');\r\n * ```\r\n * \r\n * Or you can access the value directly via the `values` property, where it works like any other variable:\r\n * \r\n * ```javascript\r\n * data.values.gold += 50;\r\n * ```\r\n *\r\n * When the value is first set, a `setdata` event is emitted.\r\n *\r\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\r\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\r\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\r\n *\r\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#set\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n set: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (typeof key === 'string')\r\n {\r\n return this.setValue(key, data);\r\n }\r\n else\r\n {\r\n for (var entry in key)\r\n {\r\n this.setValue(entry, key[entry]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value setter, called automatically by the `set` method.\r\n *\r\n * @method Phaser.Data.DataManager#setValue\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @private\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n * @param {*} data - The value to set.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n setValue: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (this.has(key))\r\n {\r\n // Hit the key getter, which will in turn emit the events.\r\n this.values[key] = data;\r\n }\r\n else\r\n {\r\n var _this = this;\r\n var list = this.list;\r\n var events = this.events;\r\n var parent = this.parent;\r\n\r\n Object.defineProperty(this.values, key, {\r\n\r\n enumerable: true,\r\n \r\n configurable: true,\r\n\r\n get: function ()\r\n {\r\n return list[key];\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (!_this._frozen)\r\n {\r\n var previousValue = list[key];\r\n list[key] = value;\r\n\r\n events.emit(Events.CHANGE_DATA, parent, key, value, previousValue);\r\n events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue);\r\n }\r\n }\r\n\r\n });\r\n\r\n list[key] = data;\r\n\r\n events.emit(Events.SET_DATA, parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes all data entries to the given callback.\r\n *\r\n * @method Phaser.Data.DataManager#each\r\n * @since 3.0.0\r\n *\r\n * @param {DataEachCallback} callback - The function to call.\r\n * @param {*} [context] - Value to use as `this` when executing callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n each: function (callback, context)\r\n {\r\n var args = [ this.parent, null, undefined ];\r\n\r\n for (var i = 1; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (var key in this.list)\r\n {\r\n args[1] = key;\r\n args[2] = this.list[key];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Merge the given object of key value pairs into this DataManager.\r\n *\r\n * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument)\r\n * will emit a `changedata` event.\r\n *\r\n * @method Phaser.Data.DataManager#merge\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @param {Object.} data - The data to merge.\r\n * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n merge: function (data, overwrite)\r\n {\r\n if (overwrite === undefined) { overwrite = true; }\r\n\r\n // Merge data from another component into this one\r\n for (var key in data)\r\n {\r\n if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key))))\r\n {\r\n this.setValue(key, data[key]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Remove the value for the given key.\r\n *\r\n * If the key is found in this Data Manager it is removed from the internal lists and a\r\n * `removedata` event is emitted.\r\n * \r\n * You can also pass in an array of keys, in which case all keys in the array will be removed:\r\n * \r\n * ```javascript\r\n * this.data.remove([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * @method Phaser.Data.DataManager#remove\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key to remove, or an array of keys to remove.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n remove: function (key)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n this.removeValue(key[i]);\r\n }\r\n }\r\n else\r\n {\r\n return this.removeValue(key);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value remover, called automatically by the `remove` method.\r\n *\r\n * @method Phaser.Data.DataManager#removeValue\r\n * @private\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n removeValue: function (key)\r\n {\r\n if (this.has(key))\r\n {\r\n var data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it.\r\n *\r\n * @method Phaser.Data.DataManager#pop\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the value to retrieve and delete.\r\n *\r\n * @return {*} The value of the given key.\r\n */\r\n pop: function (key)\r\n {\r\n var data = undefined;\r\n\r\n if (!this._frozen && this.has(key))\r\n {\r\n data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return data;\r\n },\r\n\r\n /**\r\n * Determines whether the given key is set in this Data Manager.\r\n * \r\n * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#has\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key to check.\r\n *\r\n * @return {boolean} Returns `true` if the key exists, otherwise `false`.\r\n */\r\n has: function (key)\r\n {\r\n return this.list.hasOwnProperty(key);\r\n },\r\n\r\n /**\r\n * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts\r\n * to create new values or update existing ones.\r\n *\r\n * @method Phaser.Data.DataManager#setFreeze\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - Whether to freeze or unfreeze the Data Manager.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n setFreeze: function (value)\r\n {\r\n this._frozen = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Delete all data in this Data Manager and unfreeze it.\r\n *\r\n * @method Phaser.Data.DataManager#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n reset: function ()\r\n {\r\n for (var key in this.list)\r\n {\r\n delete this.list[key];\r\n delete this.values[key];\r\n }\r\n\r\n this._frozen = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Destroy this data manager.\r\n *\r\n * @method Phaser.Data.DataManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.reset();\r\n\r\n this.events.off(Events.CHANGE_DATA);\r\n this.events.off(Events.SET_DATA);\r\n this.events.off(Events.REMOVE_DATA);\r\n\r\n this.parent = null;\r\n },\r\n\r\n /**\r\n * Gets or sets the frozen state of this Data Manager.\r\n * A frozen Data Manager will block all attempts to create new values or update existing ones.\r\n *\r\n * @name Phaser.Data.DataManager#freeze\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n freeze: {\r\n\r\n get: function ()\r\n {\r\n return this._frozen;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._frozen = (value) ? true : false;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Return the total number of entries in this Data Manager.\r\n *\r\n * @name Phaser.Data.DataManager#count\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n count: {\r\n\r\n get: function ()\r\n {\r\n var i = 0;\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list[key] !== undefined)\r\n {\r\n i++;\r\n }\r\n }\r\n\r\n return i;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = DataManager;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`.\r\n * \r\n * This event is dispatched for all items that change in the Data Manager.\r\n * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} value - The new value of the item in the Data Manager.\r\n * @param {any} previousValue - The previous value of the item in the Data Manager.\r\n */\r\nmodule.exports = 'changedata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Key Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`,\r\n * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold`\r\n * then you can listen for `sprite.data.on('changedata-gold')`.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.16.1\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'changedata-';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Remove Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item is removed from it.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'removedata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Set Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when a new item is added to the data store.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#SET_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'setdata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Data.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CHANGE_DATA: require('./CHANGE_DATA_EVENT'),\r\n CHANGE_DATA_KEY: require('./CHANGE_DATA_KEY_EVENT'),\r\n REMOVE_DATA: require('./REMOVE_DATA_EVENT'),\r\n SET_DATA: require('./SET_DATA_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlendModes = require('../renderer/BlendModes');\r\nvar GetAdvancedValue = require('../utils/object/GetAdvancedValue');\r\nvar ScaleModes = require('../renderer/ScaleModes');\r\n\r\n/**\r\n * Builds a Game Object using the provided configuration object.\r\n *\r\n * @function Phaser.GameObjects.BuildGameObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject.\r\n * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The built Game Object.\r\n */\r\nvar BuildGameObject = function (scene, gameObject, config)\r\n{\r\n // Position\r\n\r\n gameObject.x = GetAdvancedValue(config, 'x', 0);\r\n gameObject.y = GetAdvancedValue(config, 'y', 0);\r\n gameObject.depth = GetAdvancedValue(config, 'depth', 0);\r\n\r\n // Flip\r\n\r\n gameObject.flipX = GetAdvancedValue(config, 'flipX', false);\r\n gameObject.flipY = GetAdvancedValue(config, 'flipY', false);\r\n\r\n // Scale\r\n // Either: { scale: 2 } or { scale: { x: 2, y: 2 }}\r\n\r\n var scale = GetAdvancedValue(config, 'scale', null);\r\n\r\n if (typeof scale === 'number')\r\n {\r\n gameObject.setScale(scale);\r\n }\r\n else if (scale !== null)\r\n {\r\n gameObject.scaleX = GetAdvancedValue(scale, 'x', 1);\r\n gameObject.scaleY = GetAdvancedValue(scale, 'y', 1);\r\n }\r\n\r\n // ScrollFactor\r\n // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }}\r\n\r\n var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null);\r\n\r\n if (typeof scrollFactor === 'number')\r\n {\r\n gameObject.setScrollFactor(scrollFactor);\r\n }\r\n else if (scrollFactor !== null)\r\n {\r\n gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1);\r\n gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1);\r\n }\r\n\r\n // Rotation\r\n\r\n gameObject.rotation = GetAdvancedValue(config, 'rotation', 0);\r\n\r\n var angle = GetAdvancedValue(config, 'angle', null);\r\n\r\n if (angle !== null)\r\n {\r\n gameObject.angle = angle;\r\n }\r\n\r\n // Alpha\r\n\r\n gameObject.alpha = GetAdvancedValue(config, 'alpha', 1);\r\n\r\n // Origin\r\n // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }}\r\n\r\n var origin = GetAdvancedValue(config, 'origin', null);\r\n\r\n if (typeof origin === 'number')\r\n {\r\n gameObject.setOrigin(origin);\r\n }\r\n else if (origin !== null)\r\n {\r\n var ox = GetAdvancedValue(origin, 'x', 0.5);\r\n var oy = GetAdvancedValue(origin, 'y', 0.5);\r\n\r\n gameObject.setOrigin(ox, oy);\r\n }\r\n\r\n // ScaleMode\r\n\r\n gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT);\r\n\r\n // BlendMode\r\n\r\n gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL);\r\n\r\n // Visible\r\n\r\n gameObject.visible = GetAdvancedValue(config, 'visible', true);\r\n\r\n // Add to Scene\r\n\r\n var add = GetAdvancedValue(config, 'add', true);\r\n\r\n if (add)\r\n {\r\n scene.sys.displayList.add(gameObject);\r\n }\r\n\r\n if (gameObject.preUpdate)\r\n {\r\n scene.sys.updateList.add(gameObject);\r\n }\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = BuildGameObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar ComponentsToJSON = require('./components/ToJSON');\r\nvar DataManager = require('../data/DataManager');\r\nvar EventEmitter = require('eventemitter3');\r\nvar Events = require('./events');\r\n\r\n/**\r\n * @classdesc\r\n * The base class that all Game Objects extend.\r\n * You don't create GameObjects directly and they cannot be added to the display list.\r\n * Instead, use them as the base for your own custom classes.\r\n *\r\n * @class GameObject\r\n * @memberof Phaser.GameObjects\r\n * @extends Phaser.Events.EventEmitter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs.\r\n * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`.\r\n */\r\nvar GameObject = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function GameObject (scene, type)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The Scene to which this Game Object belongs.\r\n * Game Objects can only belong to one Scene.\r\n *\r\n * @name Phaser.GameObjects.GameObject#scene\r\n * @type {Phaser.Scene}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A textual representation of this Game Object, i.e. `sprite`.\r\n * Used internally by Phaser but is available for your own custom classes to populate.\r\n *\r\n * @name Phaser.GameObjects.GameObject#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * The current state of this Game Object.\r\n * \r\n * Phaser itself will never modify this value, although plugins may do so.\r\n * \r\n * Use this property to track the state of a Game Object during its lifetime. For example, it could move from\r\n * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant\r\n * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons.\r\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\r\n *\r\n * @name Phaser.GameObjects.GameObject#state\r\n * @type {(integer|string)}\r\n * @since 3.16.0\r\n */\r\n this.state = 0;\r\n\r\n /**\r\n * The parent Container of this Game Object, if it has one.\r\n *\r\n * @name Phaser.GameObjects.GameObject#parentContainer\r\n * @type {Phaser.GameObjects.Container}\r\n * @since 3.4.0\r\n */\r\n this.parentContainer = null;\r\n\r\n /**\r\n * The name of this Game Object.\r\n * Empty by default and never populated by Phaser, this is left for developers to use.\r\n *\r\n * @name Phaser.GameObjects.GameObject#name\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.name = '';\r\n\r\n /**\r\n * The active state of this Game Object.\r\n * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it.\r\n * An active object is one which is having its logic and internal systems updated.\r\n *\r\n * @name Phaser.GameObjects.GameObject#active\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.active = true;\r\n\r\n /**\r\n * The Tab Index of the Game Object.\r\n * Reserved for future use by plugins and the Input Manager.\r\n *\r\n * @name Phaser.GameObjects.GameObject#tabIndex\r\n * @type {integer}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.tabIndex = -1;\r\n\r\n /**\r\n * A Data Manager.\r\n * It allows you to store, query and get key/value paired information specific to this Game Object.\r\n * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`.\r\n *\r\n * @name Phaser.GameObjects.GameObject#data\r\n * @type {Phaser.Data.DataManager}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.data = null;\r\n\r\n /**\r\n * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not.\r\n * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively.\r\n * If those components are not used by your custom class then you can use this bitmask as you wish.\r\n *\r\n * @name Phaser.GameObjects.GameObject#renderFlags\r\n * @type {integer}\r\n * @default 15\r\n * @since 3.0.0\r\n */\r\n this.renderFlags = 15;\r\n\r\n /**\r\n * A bitmask that controls if this Game Object is drawn by a Camera or not.\r\n * Not usually set directly, instead call `Camera.ignore`, however you can\r\n * set this property directly using the Camera.id property:\r\n *\r\n * @example\r\n * this.cameraFilter |= camera.id\r\n *\r\n * @name Phaser.GameObjects.GameObject#cameraFilter\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.cameraFilter = 0;\r\n\r\n /**\r\n * If this Game Object is enabled for input then this property will contain an InteractiveObject instance.\r\n * Not usually set directly. Instead call `GameObject.setInteractive()`.\r\n *\r\n * @name Phaser.GameObjects.GameObject#input\r\n * @type {?Phaser.Types.Input.InteractiveObject}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.input = null;\r\n\r\n /**\r\n * If this Game Object is enabled for physics then this property will contain a reference to a Physics Body.\r\n *\r\n * @name Phaser.GameObjects.GameObject#body\r\n * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.body = null;\r\n\r\n /**\r\n * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`.\r\n * This includes calls that may come from a Group, Container or the Scene itself.\r\n * While it allows you to persist a Game Object across Scenes, please understand you are entirely\r\n * responsible for managing references to and from this Game Object.\r\n *\r\n * @name Phaser.GameObjects.GameObject#ignoreDestroy\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.5.0\r\n */\r\n this.ignoreDestroy = false;\r\n\r\n // Tell the Scene to re-sort the children\r\n scene.sys.queueDepthSort();\r\n },\r\n\r\n /**\r\n * Sets the `active` property of this Game Object and returns this Game Object for further chaining.\r\n * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setActive\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - True if this Game Object should be set as active, false if not.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setActive: function (value)\r\n {\r\n this.active = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the `name` property of this Game Object and returns this Game Object for further chaining.\r\n * The `name` property is not populated by Phaser and is presented for your own use.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setName\r\n * @since 3.0.0\r\n *\r\n * @param {string} value - The name to be given to this Game Object.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setName: function (value)\r\n {\r\n this.name = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current state of this Game Object.\r\n * \r\n * Phaser itself will never modify the State of a Game Object, although plugins may do so.\r\n * \r\n * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'.\r\n * The state value should typically be an integer (ideally mapped to a constant\r\n * in your game code), but could also be a string. It is recommended to keep it light and simple.\r\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setState\r\n * @since 3.16.0\r\n *\r\n * @param {(integer|string)} value - The state of the Game Object.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setState: function (value)\r\n {\r\n this.state = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds a Data Manager component to this Game Object.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setDataEnabled\r\n * @since 3.0.0\r\n * @see Phaser.Data.DataManager\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setDataEnabled: function ()\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Allows you to store a key value pair within this Game Objects Data Manager.\r\n *\r\n * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled\r\n * before setting the value.\r\n *\r\n * If the key doesn't already exist in the Data Manager then it is created.\r\n *\r\n * ```javascript\r\n * sprite.setData('name', 'Red Gem Stone');\r\n * ```\r\n *\r\n * You can also pass in an object of key value pairs as the first argument:\r\n *\r\n * ```javascript\r\n * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\r\n * ```\r\n *\r\n * To get a value back again you can call `getData`:\r\n *\r\n * ```javascript\r\n * sprite.getData('gold');\r\n * ```\r\n *\r\n * Or you can access the value directly via the `values` property, where it works like any other variable:\r\n *\r\n * ```javascript\r\n * sprite.data.values.gold += 50;\r\n * ```\r\n *\r\n * When the value is first set, a `setdata` event is emitted from this Game Object.\r\n *\r\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\r\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\r\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\r\n *\r\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setData\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setData: function (key, value)\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n this.data.set(key, value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist.\r\n *\r\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\r\n *\r\n * ```javascript\r\n * sprite.getData('gold');\r\n * ```\r\n *\r\n * Or access the value directly:\r\n *\r\n * ```javascript\r\n * sprite.data.values.gold;\r\n * ```\r\n *\r\n * You can also pass in an array of keys, in which case an array of values will be returned:\r\n *\r\n * ```javascript\r\n * sprite.getData([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * This approach is useful for destructuring arrays in ES6.\r\n *\r\n * @method Phaser.GameObjects.GameObject#getData\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\r\n *\r\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\r\n */\r\n getData: function (key)\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n return this.data.get(key);\r\n },\r\n\r\n /**\r\n * Pass this Game Object to the Input Manager to enable it for Input.\r\n *\r\n * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area\r\n * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced\r\n * input detection.\r\n *\r\n * 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\r\n * 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\r\n * shape for it to use.\r\n *\r\n * You can also provide an Input Configuration Object as the only argument to this method.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setInteractive\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback.\r\n * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target?\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setInteractive: function (shape, callback, dropZone)\r\n {\r\n this.scene.sys.input.enable(this, shape, callback, dropZone);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Game Object has previously been enabled for input, this will disable it.\r\n *\r\n * An object that is disabled for input stops processing or being considered for\r\n * input events, but can be turned back on again at any time by simply calling\r\n * `setInteractive()` with no arguments provided.\r\n *\r\n * If want to completely remove interaction from this Game Object then use `removeInteractive` instead.\r\n *\r\n * @method Phaser.GameObjects.GameObject#disableInteractive\r\n * @since 3.7.0\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n disableInteractive: function ()\r\n {\r\n if (this.input)\r\n {\r\n this.input.enabled = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Game Object has previously been enabled for input, this will queue it\r\n * for removal, causing it to no longer be interactive. The removal happens on\r\n * the next game step, it is not immediate.\r\n *\r\n * The Interactive Object that was assigned to this Game Object will be destroyed,\r\n * removed from the Input Manager and cleared from this Game Object.\r\n *\r\n * If you wish to re-enable this Game Object at a later date you will need to\r\n * re-create its InteractiveObject by calling `setInteractive` again.\r\n *\r\n * If you wish to only temporarily stop an object from receiving input then use\r\n * `disableInteractive` instead, as that toggles the interactive state, where-as\r\n * this erases it completely.\r\n * \r\n * If you wish to resize a hit area, don't remove and then set it as being\r\n * interactive. Instead, access the hitarea object directly and resize the shape\r\n * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the\r\n * shape is a Rectangle, which it is by default.)\r\n *\r\n * @method Phaser.GameObjects.GameObject#removeInteractive\r\n * @since 3.7.0\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n removeInteractive: function ()\r\n {\r\n this.scene.sys.input.clear(this);\r\n\r\n this.input = undefined;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * To be overridden by custom GameObjects. Allows base objects to be used in a Pool.\r\n *\r\n * @method Phaser.GameObjects.GameObject#update\r\n * @since 3.0.0\r\n *\r\n * @param {...*} [args] - args\r\n */\r\n update: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Returns a JSON representation of the Game Object.\r\n *\r\n * @method Phaser.GameObjects.GameObject#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\n toJSON: function ()\r\n {\r\n return ComponentsToJSON(this);\r\n },\r\n\r\n /**\r\n * Compares the renderMask with the renderFlags to see if this Game Object will render or not.\r\n * Also checks the Game Object against the given Cameras exclusion list.\r\n *\r\n * @method Phaser.GameObjects.GameObject#willRender\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object.\r\n *\r\n * @return {boolean} True if the Game Object should be rendered, otherwise false.\r\n */\r\n willRender: function (camera)\r\n {\r\n return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)));\r\n },\r\n\r\n /**\r\n * Returns an array containing the display list index of either this Game Object, or if it has one,\r\n * its parent Container. It then iterates up through all of the parent containers until it hits the\r\n * root of the display list (which is index 0 in the returned array).\r\n *\r\n * Used internally by the InputPlugin but also useful if you wish to find out the display depth of\r\n * this Game Object and all of its ancestors.\r\n *\r\n * @method Phaser.GameObjects.GameObject#getIndexList\r\n * @since 3.4.0\r\n *\r\n * @return {integer[]} An array of display list position indexes.\r\n */\r\n getIndexList: function ()\r\n {\r\n // eslint-disable-next-line consistent-this\r\n var child = this;\r\n var parent = this.parentContainer;\r\n\r\n var indexes = [];\r\n\r\n while (parent)\r\n {\r\n // indexes.unshift([parent.getIndex(child), parent.name]);\r\n indexes.unshift(parent.getIndex(child));\r\n\r\n child = parent;\r\n\r\n if (!parent.parentContainer)\r\n {\r\n break;\r\n }\r\n else\r\n {\r\n parent = parent.parentContainer;\r\n }\r\n }\r\n\r\n // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']);\r\n indexes.unshift(this.scene.sys.displayList.getIndex(child));\r\n\r\n return indexes;\r\n },\r\n\r\n /**\r\n * Destroys this Game Object removing it from the Display List and Update List and\r\n * severing all ties to parent resources.\r\n *\r\n * Also removes itself from the Input Manager and Physics Manager if previously enabled.\r\n *\r\n * Use this to remove a Game Object from your game if you don't ever plan to use it again.\r\n * As long as no reference to it exists within your own code it should become free for\r\n * garbage collection by the browser.\r\n *\r\n * If you just want to temporarily disable an object then look at using the\r\n * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected.\r\n *\r\n * @method Phaser.GameObjects.GameObject#destroy\r\n * @fires Phaser.GameObjects.Events#DESTROY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [fromScene=false] - Is this Game Object being destroyed as the result of a Scene shutdown?\r\n */\r\n destroy: function (fromScene)\r\n {\r\n if (fromScene === undefined) { fromScene = false; }\r\n\r\n // This Game Object has already been destroyed\r\n if (!this.scene || this.ignoreDestroy)\r\n {\r\n return;\r\n }\r\n\r\n if (this.preDestroy)\r\n {\r\n this.preDestroy.call(this);\r\n }\r\n\r\n this.emit(Events.DESTROY, this);\r\n\r\n var sys = this.scene.sys;\r\n\r\n if (!fromScene)\r\n {\r\n sys.displayList.remove(this);\r\n sys.updateList.remove(this);\r\n }\r\n\r\n if (this.input)\r\n {\r\n sys.input.clear(this);\r\n this.input = undefined;\r\n }\r\n\r\n if (this.data)\r\n {\r\n this.data.destroy();\r\n\r\n this.data = undefined;\r\n }\r\n\r\n if (this.body)\r\n {\r\n this.body.destroy();\r\n this.body = undefined;\r\n }\r\n\r\n // Tell the Scene to re-sort the children\r\n if (!fromScene)\r\n {\r\n sys.queueDepthSort();\r\n }\r\n\r\n this.active = false;\r\n this.visible = false;\r\n\r\n this.scene = undefined;\r\n\r\n this.parentContainer = undefined;\r\n\r\n this.removeAllListeners();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not.\r\n *\r\n * @constant {integer} RENDER_MASK\r\n * @memberof Phaser.GameObjects.GameObject\r\n * @default\r\n */\r\nGameObject.RENDER_MASK = 15;\r\n\r\nmodule.exports = GameObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for calculating and setting the size of a non-Frame based Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.ComputedSize\r\n * @since 3.0.0\r\n */\r\n\r\nvar ComputedSize = {\r\n\r\n /**\r\n * The native (un-scaled) width of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayWidth` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n width: 0,\r\n\r\n /**\r\n * The native (un-scaled) height of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayHeight` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n height: 0,\r\n\r\n /**\r\n * The displayed width of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayWidth: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleX * this.width;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleX = value / this.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The displayed height of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayHeight: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleY * this.height;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleY = value / this.height;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the internal size of this Game Object, as used for frame or physics body creation.\r\n * \r\n * This will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\r\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\r\n * to do so by giving pixel values.\r\n * \r\n * If you have enabled this Game Object for input, changing the size will _not_ change the\r\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setSize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the display size of this Game Object.\r\n * \r\n * Calling this will adjust the scale.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDisplaySize: function (width, height)\r\n {\r\n this.displayWidth = width;\r\n this.displayHeight = height;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ComputedSize;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the depth of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Depth\r\n * @since 3.0.0\r\n */\r\n\r\nvar Depth = {\r\n\r\n /**\r\n * Private internal value. Holds the depth of the Game Object.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#_depth\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _depth: 0,\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#depth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n depth: {\r\n\r\n get: function ()\r\n {\r\n return this._depth;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scene.sys.queueDepthSort();\r\n this._depth = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @method Phaser.GameObjects.Components.Depth#setDepth\r\n * @since 3.0.0\r\n *\r\n * @param {integer} value - The depth of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDepth: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.depth = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Depth;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for visually flipping a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Flip\r\n * @since 3.0.0\r\n */\r\n\r\nvar Flip = {\r\n\r\n /**\r\n * The horizontally flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipX\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipX: false,\r\n\r\n /**\r\n * The vertically flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down)\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipY\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipY: false,\r\n\r\n /**\r\n * Toggles the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipX\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipX: function ()\r\n {\r\n this.flipX = !this.flipX;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Toggles the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipY\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipY: function ()\r\n {\r\n this.flipY = !this.flipY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipX\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipX: function (value)\r\n {\r\n this.flipX = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipY: function (value)\r\n {\r\n this.flipY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal and vertical flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped will render inversed on the flipped axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlip\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlip: function (x, y)\r\n {\r\n this.flipX = x;\r\n this.flipY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#resetFlip\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n resetFlip: function ()\r\n {\r\n this.flipX = false;\r\n this.flipY = false;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Flip;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the Scroll Factor of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.ScrollFactor\r\n * @since 3.0.0\r\n */\r\n\r\nvar ScrollFactor = {\r\n\r\n /**\r\n * The horizontal scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorX: 1,\r\n\r\n /**\r\n * The vertical scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorY: 1,\r\n\r\n /**\r\n * Sets the scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scroll factor of this Game Object.\r\n * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScrollFactor: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.scrollFactorX = x;\r\n this.scrollFactorY = y;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ScrollFactor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Build a JSON representation of the given Game Object.\r\n *\r\n * This is typically extended further by Game Object specific implementations.\r\n *\r\n * @method Phaser.GameObjects.Components.ToJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON.\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\nvar ToJSON = function (gameObject)\r\n{\r\n var out = {\r\n name: gameObject.name,\r\n type: gameObject.type,\r\n x: gameObject.x,\r\n y: gameObject.y,\r\n depth: gameObject.depth,\r\n scale: {\r\n x: gameObject.scaleX,\r\n y: gameObject.scaleY\r\n },\r\n origin: {\r\n x: gameObject.originX,\r\n y: gameObject.originY\r\n },\r\n flipX: gameObject.flipX,\r\n flipY: gameObject.flipY,\r\n rotation: gameObject.rotation,\r\n alpha: gameObject.alpha,\r\n visible: gameObject.visible,\r\n scaleMode: gameObject.scaleMode,\r\n blendMode: gameObject.blendMode,\r\n textureKey: '',\r\n frameKey: '',\r\n data: {}\r\n };\r\n\r\n if (gameObject.texture)\r\n {\r\n out.textureKey = gameObject.texture.key;\r\n out.frameKey = gameObject.frame.name;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ToJSON;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = require('../../math/const');\r\nvar TransformMatrix = require('./TransformMatrix');\r\nvar WrapAngle = require('../../math/angle/Wrap');\r\nvar WrapAngleDegrees = require('../../math/angle/WrapDegrees');\r\n\r\n// global bitmask flag for GameObject.renderMask (used by Scale)\r\nvar _FLAG = 4; // 0100\r\n\r\n/**\r\n * Provides methods used for getting and setting the position, scale and rotation of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Transform\r\n * @since 3.0.0\r\n */\r\n\r\nvar Transform = {\r\n\r\n /**\r\n * Private internal value. Holds the horizontal scale value.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_scaleX\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _scaleX: 1,\r\n\r\n /**\r\n * Private internal value. Holds the vertical scale value.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_scaleY\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _scaleY: 1,\r\n\r\n /**\r\n * Private internal value. Holds the rotation value in radians.\r\n * \r\n * @name Phaser.GameObjects.Components.Transform#_rotation\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _rotation: 0,\r\n\r\n /**\r\n * The x position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n x: 0,\r\n\r\n /**\r\n * The y position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n y: 0,\r\n\r\n /**\r\n * The z position of this Game Object.\r\n * Note: Do not use this value to set the z-index, instead see the `depth` property.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n z: 0,\r\n\r\n /**\r\n * The w position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n w: 0,\r\n\r\n /**\r\n * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object\r\n * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`.\r\n * \r\n * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this\r\n * isn't the case, use the `scaleX` or `scaleY` properties instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.18.0\r\n */\r\n scale: {\r\n\r\n get: function ()\r\n {\r\n return (this._scaleX + this._scaleY) / 2;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n this._scaleY = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The horizontal scale of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scaleX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scaleY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleY = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The angle of this Game Object as expressed in degrees.\r\n * \r\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left\r\n * and -90 is up.\r\n *\r\n * If you prefer to work in radians, see the `rotation` property instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#angle\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n angle: {\r\n\r\n get: function ()\r\n {\r\n return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG);\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in degrees\r\n this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD;\r\n }\r\n },\r\n\r\n /**\r\n * The angle of this Game Object in radians.\r\n * \r\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left\r\n * and -90 is up.\r\n *\r\n * If you prefer to work in degrees, see the `angle` property instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#rotation\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return this._rotation;\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in radians\r\n this._rotation = WrapAngle(value);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x position of this Game Object.\r\n * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value.\r\n * @param {number} [z=0] - The z position of this Game Object.\r\n * @param {number} [w=0] - The w position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setPosition: function (x, y, z, w)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n if (z === undefined) { z = 0; }\r\n if (w === undefined) { w = 0; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n this.w = w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the position of this Game Object to be a random position within the confines of\r\n * the given area.\r\n * \r\n * If no area is specified a random position between 0 x 0 and the game width x height is used instead.\r\n *\r\n * The position does not factor in the size of this Game Object, meaning that only the origin is\r\n * guaranteed to be within the area.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setRandomPosition\r\n * @since 3.8.0\r\n *\r\n * @param {number} [x=0] - The x position of the top-left of the random area.\r\n * @param {number} [y=0] - The y position of the top-left of the random area.\r\n * @param {number} [width] - The width of the random area.\r\n * @param {number} [height] - The height of the random area.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setRandomPosition: function (x, y, width, height)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.scene.sys.scale.width; }\r\n if (height === undefined) { height = this.scene.sys.scale.height; }\r\n\r\n this.x = x + (Math.random() * width);\r\n this.y = y + (Math.random() * height);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the rotation of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setRotation\r\n * @since 3.0.0\r\n *\r\n * @param {number} [radians=0] - The rotation of this Game Object, in radians.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setRotation: function (radians)\r\n {\r\n if (radians === undefined) { radians = 0; }\r\n\r\n this.rotation = radians;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the angle of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setAngle\r\n * @since 3.0.0\r\n *\r\n * @param {number} [degrees=0] - The rotation of this Game Object, in degrees.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAngle: function (degrees)\r\n {\r\n if (degrees === undefined) { degrees = 0; }\r\n\r\n this.angle = degrees;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scale of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale of this Game Object.\r\n * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScale: function (x, y)\r\n {\r\n if (x === undefined) { x = 1; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.scaleX = x;\r\n this.scaleY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the x position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setX\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The x position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setX: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the y position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setY\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The y position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setY: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the z position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The z position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setZ: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.z = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the w position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setW\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The w position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setW: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.w = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the local transform matrix for this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\r\n */\r\n getLocalTransformMatrix: function (tempMatrix)\r\n {\r\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\r\n\r\n return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\r\n },\r\n\r\n /**\r\n * Gets the world transform matrix for this Game Object, factoring in any parent Containers.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\r\n */\r\n getWorldTransformMatrix: function (tempMatrix, parentMatrix)\r\n {\r\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\r\n if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); }\r\n\r\n var parent = this.parentContainer;\r\n\r\n if (!parent)\r\n {\r\n return this.getLocalTransformMatrix(tempMatrix);\r\n }\r\n\r\n tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\r\n\r\n while (parent)\r\n {\r\n parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY);\r\n\r\n parentMatrix.multiply(tempMatrix, tempMatrix);\r\n\r\n parent = parent.parentContainer;\r\n }\r\n\r\n return tempMatrix;\r\n },\r\n\r\n /**\r\n * Gets the sum total rotation of all of this Game Objects parent Containers.\r\n * \r\n * The returned value is in radians and will be zero if this Game Object has no parent container.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getParentRotation\r\n * @since 3.18.0\r\n *\r\n * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object.\r\n */\r\n getParentRotation: function ()\r\n {\r\n var rotation = 0;\r\n\r\n var parent = this.parentContainer;\r\n\r\n while (parent)\r\n {\r\n rotation += parent.rotation;\r\n\r\n parent = parent.parentContainer;\r\n }\r\n\r\n return rotation;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Transform;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar MATH_CONST = require('../../math/const');\r\nvar Vector2 = require('../../math/Vector2');\r\n\r\n/**\r\n * @classdesc\r\n * A Matrix used for display transformations for rendering.\r\n *\r\n * It is represented like so:\r\n *\r\n * ```\r\n * | a | c | tx |\r\n * | b | d | ty |\r\n * | 0 | 0 | 1 |\r\n * ```\r\n *\r\n * @class TransformMatrix\r\n * @memberof Phaser.GameObjects.Components\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [a=1] - The Scale X value.\r\n * @param {number} [b=0] - The Skew Y value.\r\n * @param {number} [c=0] - The Skew X value.\r\n * @param {number} [d=1] - The Scale Y value.\r\n * @param {number} [tx=0] - The Translate X value.\r\n * @param {number} [ty=0] - The Translate Y value.\r\n */\r\nvar TransformMatrix = new Class({\r\n\r\n initialize:\r\n\r\n function TransformMatrix (a, b, c, d, tx, ty)\r\n {\r\n if (a === undefined) { a = 1; }\r\n if (b === undefined) { b = 0; }\r\n if (c === undefined) { c = 0; }\r\n if (d === undefined) { d = 1; }\r\n if (tx === undefined) { tx = 0; }\r\n if (ty === undefined) { ty = 0; }\r\n\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#matrix\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]);\r\n\r\n /**\r\n * The decomposed matrix.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.decomposedMatrix = {\r\n translateX: 0,\r\n translateY: 0,\r\n scaleX: 1,\r\n scaleY: 1,\r\n rotation: 0\r\n };\r\n },\r\n\r\n /**\r\n * The Scale X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#a\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n a: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[0];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[0] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Skew Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#b\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n b: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[1];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[1] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Skew X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#c\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n c: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[2];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[2] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Scale Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#d\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n d: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[3];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[3] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#e\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n e: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#f\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n f: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#tx\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n tx: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#ty\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n ty: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Matrix. Value is in radians.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#rotation\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Matrix, normalized to be within the Phaser right-handed\r\n * clockwise rotation space. Value is in radians.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized\r\n * @type {number}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n rotationNormalized: {\r\n\r\n get: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n if (a || b)\r\n {\r\n // var r = Math.sqrt(a * a + b * b);\r\n \r\n return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX);\r\n }\r\n else if (c || d)\r\n {\r\n // var s = Math.sqrt(c * c + d * d);\r\n \r\n return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY));\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The decomposed horizontal scale of the Matrix. This value is always positive.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleX\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.a * this.a) + (this.b * this.b));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The decomposed vertical scale of the Matrix. This value is always positive.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleY\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.c * this.c) + (this.d * this.d));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Reset the Matrix to an identity matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n loadIdentity: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = 1;\r\n matrix[1] = 0;\r\n matrix[2] = 0;\r\n matrix[3] = 1;\r\n matrix[4] = 0;\r\n matrix[5] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#translate\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation value.\r\n * @param {number} y - The vertical translation value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n translate: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4];\r\n matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale value.\r\n * @param {number} y - The vertical scale value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n scale: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] *= x;\r\n matrix[1] *= x;\r\n matrix[2] *= y;\r\n matrix[3] *= y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n rotate: function (angle)\r\n {\r\n var sin = Math.sin(angle);\r\n var cos = Math.cos(angle);\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n matrix[0] = a * cos + c * sin;\r\n matrix[1] = b * cos + d * sin;\r\n matrix[2] = a * -sin + c * cos;\r\n matrix[3] = b * -sin + d * cos;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n * \r\n * If an `out` Matrix is given then the results will be stored in it.\r\n * If it is not given, this matrix will be updated in place instead.\r\n * Use an `out` Matrix if you do not wish to mutate this matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} Either this TransformMatrix, or the `out` Matrix, if given in the arguments.\r\n */\r\n multiply: function (rhs, out)\r\n {\r\n var matrix = this.matrix;\r\n var source = rhs.matrix;\r\n\r\n var localA = matrix[0];\r\n var localB = matrix[1];\r\n var localC = matrix[2];\r\n var localD = matrix[3];\r\n var localE = matrix[4];\r\n var localF = matrix[5];\r\n\r\n var sourceA = source[0];\r\n var sourceB = source[1];\r\n var sourceC = source[2];\r\n var sourceD = source[3];\r\n var sourceE = source[4];\r\n var sourceF = source[5];\r\n\r\n var destinationMatrix = (out === undefined) ? this : out;\r\n\r\n destinationMatrix.a = (sourceA * localA) + (sourceB * localC);\r\n destinationMatrix.b = (sourceA * localB) + (sourceB * localD);\r\n destinationMatrix.c = (sourceC * localA) + (sourceD * localC);\r\n destinationMatrix.d = (sourceC * localB) + (sourceD * localD);\r\n destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE;\r\n destinationMatrix.f = (sourceE * localB) + (sourceF * localD) + localF;\r\n\r\n return destinationMatrix;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the matrix given, including the offset.\r\n * \r\n * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`.\r\n * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n * @param {number} offsetX - Horizontal offset to factor in to the multiplication.\r\n * @param {number} offsetY - Vertical offset to factor in to the multiplication.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n multiplyWithOffset: function (src, offsetX, offsetY)\r\n {\r\n var matrix = this.matrix;\r\n var otherMatrix = src.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n var pse = offsetX * a0 + offsetY * c0 + tx0;\r\n var psf = offsetX * b0 + offsetY * d0 + ty0;\r\n\r\n var a1 = otherMatrix[0];\r\n var b1 = otherMatrix[1];\r\n var c1 = otherMatrix[2];\r\n var d1 = otherMatrix[3];\r\n var tx1 = otherMatrix[4];\r\n var ty1 = otherMatrix[5];\r\n\r\n matrix[0] = a1 * a0 + b1 * c0;\r\n matrix[1] = a1 * b0 + b1 * d0;\r\n matrix[2] = c1 * a0 + d1 * c0;\r\n matrix[3] = c1 * b0 + d1 * d0;\r\n matrix[4] = tx1 * a0 + ty1 * c0 + pse;\r\n matrix[5] = tx1 * b0 + ty1 * d0 + psf;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n transform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n matrix[0] = a * a0 + b * c0;\r\n matrix[1] = a * b0 + b * d0;\r\n matrix[2] = c * a0 + d * c0;\r\n matrix[3] = c * b0 + d * d0;\r\n matrix[4] = tx * a0 + ty * c0 + tx0;\r\n matrix[5] = tx * b0 + ty * d0 + ty0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform a point using this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the point to transform.\r\n * @param {number} y - The y coordinate of the point to transform.\r\n * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates.\r\n *\r\n * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates.\r\n */\r\n transformPoint: function (x, y, point)\r\n {\r\n if (point === undefined) { point = { x: 0, y: 0 }; }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n point.x = x * a + y * c + tx;\r\n point.y = x * b + y * d + ty;\r\n\r\n return point;\r\n },\r\n\r\n /**\r\n * Invert the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#invert\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n invert: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var n = a * d - b * c;\r\n\r\n matrix[0] = d / n;\r\n matrix[1] = -b / n;\r\n matrix[2] = -c / n;\r\n matrix[3] = a / n;\r\n matrix[4] = (c * ty - d * tx) / n;\r\n matrix[5] = -(a * ty - b * tx) / n;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the matrix given.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFrom: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src.a;\r\n matrix[1] = src.b;\r\n matrix[2] = src.c;\r\n matrix[3] = src.d;\r\n matrix[4] = src.e;\r\n matrix[5] = src.f;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the array given.\r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray\r\n * @since 3.11.0\r\n *\r\n * @param {array} src - The array of values to set into this matrix.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFromArray: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src[0];\r\n matrix[1] = src[1];\r\n matrix[2] = src[2];\r\n matrix[3] = src[3];\r\n matrix[4] = src[4];\r\n matrix[5] = src[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.transform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n copyToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.setTransform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n setToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values in this Matrix to the array given.\r\n * \r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray\r\n * @since 3.12.0\r\n *\r\n * @param {array} [out] - The array to copy the matrix values in to.\r\n *\r\n * @return {array} An array where elements 0 to 5 contain the values from this matrix.\r\n */\r\n copyToArray: function (out)\r\n {\r\n var matrix = this.matrix;\r\n\r\n if (out === undefined)\r\n {\r\n out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ];\r\n }\r\n else\r\n {\r\n out[0] = matrix[0];\r\n out[1] = matrix[1];\r\n out[2] = matrix[2];\r\n out[3] = matrix[3];\r\n out[4] = matrix[4];\r\n out[5] = matrix[5];\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setTransform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n setTransform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = a;\r\n matrix[1] = b;\r\n matrix[2] = c;\r\n matrix[3] = d;\r\n matrix[4] = tx;\r\n matrix[5] = ty;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Decompose this Matrix into its translation, scale and rotation values using QR decomposition.\r\n * \r\n * The result must be applied in the following order to reproduce the current matrix:\r\n * \r\n * translate -> rotate -> scale\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix\r\n * @since 3.0.0\r\n *\r\n * @return {object} The decomposed Matrix.\r\n */\r\n decomposeMatrix: function ()\r\n {\r\n var decomposedMatrix = this.decomposedMatrix;\r\n\r\n var matrix = this.matrix;\r\n\r\n // a = scale X (1)\r\n // b = shear Y (0)\r\n // c = shear X (0)\r\n // d = scale Y (1)\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n var determ = a * d - b * c;\r\n\r\n decomposedMatrix.translateX = matrix[4];\r\n decomposedMatrix.translateY = matrix[5];\r\n\r\n if (a || b)\r\n {\r\n var r = Math.sqrt(a * a + b * b);\r\n\r\n decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r);\r\n decomposedMatrix.scaleX = r;\r\n decomposedMatrix.scaleY = determ / r;\r\n }\r\n else if (c || d)\r\n {\r\n var s = Math.sqrt(c * c + d * d);\r\n\r\n decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s));\r\n decomposedMatrix.scaleX = determ / s;\r\n decomposedMatrix.scaleY = s;\r\n }\r\n else\r\n {\r\n decomposedMatrix.rotation = 0;\r\n decomposedMatrix.scaleX = 0;\r\n decomposedMatrix.scaleY = 0;\r\n }\r\n\r\n return decomposedMatrix;\r\n },\r\n\r\n /**\r\n * Apply the identity, translate, rotate and scale operations on the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation.\r\n * @param {number} y - The vertical translation.\r\n * @param {number} rotation - The angle of rotation in radians.\r\n * @param {number} scaleX - The horizontal scale.\r\n * @param {number} scaleY - The vertical scale.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n applyITRS: function (x, y, rotation, scaleX, scaleY)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var radianSin = Math.sin(rotation);\r\n var radianCos = Math.cos(rotation);\r\n\r\n // Translate\r\n matrix[4] = x;\r\n matrix[5] = y;\r\n\r\n // Rotate and Scale\r\n matrix[0] = radianCos * scaleX;\r\n matrix[1] = radianSin * scaleX;\r\n matrix[2] = -radianSin * scaleY;\r\n matrix[3] = radianCos * scaleY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of\r\n * the current matrix with its transformation applied.\r\n * \r\n * Can be used to translate points from world to local space.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse\r\n * @since 3.12.0\r\n *\r\n * @param {number} x - The x position to translate.\r\n * @param {number} y - The y position to translate.\r\n * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix.\r\n */\r\n applyInverse: function (x, y, output)\r\n {\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var id = 1 / ((a * d) + (c * -b));\r\n\r\n output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id);\r\n output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id);\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the X component of this matrix multiplied by the given values.\r\n * This is the same as `x * a + y * c + e`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getX\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated x value.\r\n */\r\n getX: function (x, y)\r\n {\r\n return x * this.a + y * this.c + this.e;\r\n },\r\n\r\n /**\r\n * Returns the Y component of this matrix multiplied by the given values.\r\n * This is the same as `x * b + y * d + f`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getY\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated y value.\r\n */\r\n getY: function (x, y)\r\n {\r\n return x * this.b + y * this.d + this.f;\r\n },\r\n\r\n /**\r\n * Returns a string that can be used in a CSS Transform call as a `matrix` property.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix\r\n * @since 3.12.0\r\n *\r\n * @return {string} A string containing the CSS Transform matrix values.\r\n */\r\n getCSSMatrix: function ()\r\n {\r\n var m = this.matrix;\r\n\r\n return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')';\r\n },\r\n\r\n /**\r\n * Destroys this Transform Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#destroy\r\n * @since 3.4.0\r\n */\r\n destroy: function ()\r\n {\r\n this.matrix = null;\r\n this.decomposedMatrix = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TransformMatrix;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 1; // 0001\r\n\r\n/**\r\n * Provides methods used for setting the visibility of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Visible\r\n * @since 3.0.0\r\n */\r\n\r\nvar Visible = {\r\n\r\n /**\r\n * Private internal value. Holds the visible value.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#_visible\r\n * @type {boolean}\r\n * @private\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n _visible: true,\r\n\r\n /**\r\n * The visible state of the Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#visible\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n visible: {\r\n\r\n get: function ()\r\n {\r\n return this._visible;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value)\r\n {\r\n this._visible = true;\r\n this.renderFlags |= _FLAG;\r\n }\r\n else\r\n {\r\n this._visible = false;\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the visibility of this Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n *\r\n * @method Phaser.GameObjects.Components.Visible#setVisible\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The visible state of the Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setVisible: function (value)\r\n {\r\n this.visible = value;\r\n\r\n return this;\r\n }\r\n};\r\n\r\nmodule.exports = Visible;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Destroy Event.\r\n * \r\n * This event is dispatched when a Game Object instance is being destroyed.\r\n * \r\n * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed.\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.GameObjects.Events\r\n */\r\n\r\nmodule.exports = { DESTROY: require('./DESTROY_EVENT') };\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar CONST = require('./const');\r\nvar Events = require('./events');\r\nvar GetFastValue = require('../utils/object/GetFastValue');\r\nvar GetURL = require('./GetURL');\r\nvar MergeXHRSettings = require('./MergeXHRSettings');\r\nvar XHRLoader = require('./XHRLoader');\r\nvar XHRSettings = require('./XHRSettings');\r\n\r\n/**\r\n * @classdesc\r\n * The base File class used by all File Types that the Loader can support.\r\n * 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.\r\n *\r\n * @class File\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\r\n * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type.\r\n */\r\nvar File = new Class({\r\n\r\n initialize:\r\n\r\n function File (loader, fileConfig)\r\n {\r\n /**\r\n * A reference to the Loader that is going to load this file.\r\n *\r\n * @name Phaser.Loader.File#loader\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.0.0\r\n */\r\n this.loader = loader;\r\n\r\n /**\r\n * A reference to the Cache, or Texture Manager, that is going to store this file if it loads.\r\n *\r\n * @name Phaser.Loader.File#cache\r\n * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)}\r\n * @since 3.7.0\r\n */\r\n this.cache = GetFastValue(fileConfig, 'cache', false);\r\n\r\n /**\r\n * The file type string (image, json, etc) for sorting within the Loader.\r\n *\r\n * @name Phaser.Loader.File#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = GetFastValue(fileConfig, 'type', false);\r\n\r\n /**\r\n * Unique cache key (unique within its file type)\r\n *\r\n * @name Phaser.Loader.File#key\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.key = GetFastValue(fileConfig, 'key', false);\r\n\r\n var loadKey = this.key;\r\n\r\n if (loader.prefix && loader.prefix !== '')\r\n {\r\n this.key = loader.prefix + loadKey;\r\n }\r\n\r\n if (!this.type || !this.key)\r\n {\r\n throw new Error('Error calling \\'Loader.' + this.type + '\\' invalid key provided.');\r\n }\r\n\r\n /**\r\n * The URL of the file, not including baseURL.\r\n * Automatically has Loader.path prepended to it.\r\n *\r\n * @name Phaser.Loader.File#url\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.url = GetFastValue(fileConfig, 'url');\r\n\r\n if (this.url === undefined)\r\n {\r\n this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', '');\r\n }\r\n else if (typeof(this.url) !== 'function')\r\n {\r\n this.url = loader.path + this.url;\r\n }\r\n\r\n /**\r\n * The final URL this file will load from, including baseURL and path.\r\n * Set automatically when the Loader calls 'load' on this file.\r\n *\r\n * @name Phaser.Loader.File#src\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.src = '';\r\n\r\n /**\r\n * The merged XHRSettings for this file.\r\n *\r\n * @name Phaser.Loader.File#xhrSettings\r\n * @type {Phaser.Types.Loader.XHRSettingsObject}\r\n * @since 3.0.0\r\n */\r\n this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined));\r\n\r\n if (GetFastValue(fileConfig, 'xhrSettings', false))\r\n {\r\n this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {}));\r\n }\r\n\r\n /**\r\n * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File.\r\n *\r\n * @name Phaser.Loader.File#xhrLoader\r\n * @type {?XMLHttpRequest}\r\n * @since 3.0.0\r\n */\r\n this.xhrLoader = null;\r\n\r\n /**\r\n * The current state of the file. One of the FILE_CONST values.\r\n *\r\n * @name Phaser.Loader.File#state\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING;\r\n\r\n /**\r\n * The total size of this file.\r\n * Set by onProgress and only if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#bytesTotal\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.bytesTotal = 0;\r\n\r\n /**\r\n * Updated as the file loads.\r\n * Only set if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#bytesLoaded\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.bytesLoaded = -1;\r\n\r\n /**\r\n * A percentage value between 0 and 1 indicating how much of this file has loaded.\r\n * Only set if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#percentComplete\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.percentComplete = -1;\r\n\r\n /**\r\n * For CORs based loading.\r\n * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set)\r\n *\r\n * @name Phaser.Loader.File#crossOrigin\r\n * @type {(string|undefined)}\r\n * @since 3.0.0\r\n */\r\n this.crossOrigin = undefined;\r\n\r\n /**\r\n * The processed file data, stored here after the file has loaded.\r\n *\r\n * @name Phaser.Loader.File#data\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.data = undefined;\r\n\r\n /**\r\n * A config object that can be used by file types to store transitional data.\r\n *\r\n * @name Phaser.Loader.File#config\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.config = GetFastValue(fileConfig, 'config', {});\r\n\r\n /**\r\n * If this is a multipart file, i.e. an atlas and its json together, then this is a reference\r\n * to the parent MultiFile. Set and used internally by the Loader or specific file types.\r\n *\r\n * @name Phaser.Loader.File#multiFile\r\n * @type {?Phaser.Loader.MultiFile}\r\n * @since 3.7.0\r\n */\r\n this.multiFile;\r\n\r\n /**\r\n * Does this file have an associated linked file? Such as an image and a normal map.\r\n * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't\r\n * actually bound by data, where-as a linkFile is.\r\n *\r\n * @name Phaser.Loader.File#linkFile\r\n * @type {?Phaser.Loader.File}\r\n * @since 3.7.0\r\n */\r\n this.linkFile;\r\n },\r\n\r\n /**\r\n * Links this File with another, so they depend upon each other for loading and processing.\r\n *\r\n * @method Phaser.Loader.File#setLink\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} fileB - The file to link to this one.\r\n */\r\n setLink: function (fileB)\r\n {\r\n this.linkFile = fileB;\r\n\r\n fileB.linkFile = this;\r\n },\r\n\r\n /**\r\n * Resets the XHRLoader instance this file is using.\r\n *\r\n * @method Phaser.Loader.File#resetXHR\r\n * @since 3.0.0\r\n */\r\n resetXHR: function ()\r\n {\r\n if (this.xhrLoader)\r\n {\r\n this.xhrLoader.onload = undefined;\r\n this.xhrLoader.onerror = undefined;\r\n this.xhrLoader.onprogress = undefined;\r\n }\r\n },\r\n\r\n /**\r\n * Called by the Loader, starts the actual file downloading.\r\n * During the load the methods onLoad, onError and onProgress are called, based on the XHR events.\r\n * You shouldn't normally call this method directly, it's meant to be invoked by the Loader.\r\n *\r\n * @method Phaser.Loader.File#load\r\n * @since 3.0.0\r\n */\r\n load: function ()\r\n {\r\n if (this.state === CONST.FILE_POPULATED)\r\n {\r\n // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL\r\n this.loader.nextFile(this, true);\r\n }\r\n else\r\n {\r\n this.src = GetURL(this, this.loader.baseURL);\r\n\r\n if (this.src.indexOf('data:') === 0)\r\n {\r\n console.warn('Local data URIs are not supported: ' + this.key);\r\n }\r\n else\r\n {\r\n // The creation of this XHRLoader starts the load process going.\r\n // It will automatically call the following, based on the load outcome:\r\n // \r\n // xhr.onload = this.onLoad\r\n // xhr.onerror = this.onError\r\n // xhr.onprogress = this.onProgress\r\n\r\n this.xhrLoader = XHRLoader(this, this.loader.xhr);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Called when the file finishes loading, is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onLoad\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load.\r\n */\r\n onLoad: function (xhr, event)\r\n {\r\n var localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && event.target.status === 0));\r\n\r\n var success = !(event.target && event.target.status !== 200) || localFileOk;\r\n\r\n // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.\r\n if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599)\r\n {\r\n success = false;\r\n }\r\n\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, success);\r\n },\r\n\r\n /**\r\n * Called if the file errors while loading, is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onError\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error.\r\n */\r\n onError: function ()\r\n {\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, false);\r\n },\r\n\r\n /**\r\n * Called during the file load progress. Is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onProgress\r\n * @fires Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n *\r\n * @param {ProgressEvent} event - The DOM ProgressEvent.\r\n */\r\n onProgress: function (event)\r\n {\r\n if (event.lengthComputable)\r\n {\r\n this.bytesLoaded = event.loaded;\r\n this.bytesTotal = event.total;\r\n\r\n this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1);\r\n\r\n this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete);\r\n }\r\n },\r\n\r\n /**\r\n * Usually overridden by the FileTypes and is called by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage.\r\n *\r\n * @method Phaser.Loader.File#onProcess\r\n * @since 3.0.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.onProcessComplete();\r\n },\r\n\r\n /**\r\n * Called when the File has completed processing.\r\n * Checks on the state of its multifile, if set.\r\n *\r\n * @method Phaser.Loader.File#onProcessComplete\r\n * @since 3.7.0\r\n */\r\n onProcessComplete: function ()\r\n {\r\n this.state = CONST.FILE_COMPLETE;\r\n\r\n if (this.multiFile)\r\n {\r\n this.multiFile.onFileComplete(this);\r\n }\r\n\r\n this.loader.fileProcessComplete(this);\r\n },\r\n\r\n /**\r\n * Called when the File has completed processing but it generated an error.\r\n * Checks on the state of its multifile, if set.\r\n *\r\n * @method Phaser.Loader.File#onProcessError\r\n * @since 3.7.0\r\n */\r\n onProcessError: function ()\r\n {\r\n this.state = CONST.FILE_ERRORED;\r\n\r\n if (this.multiFile)\r\n {\r\n this.multiFile.onFileFailed(this);\r\n }\r\n\r\n this.loader.fileProcessComplete(this);\r\n },\r\n\r\n /**\r\n * Checks if a key matching the one used by this file exists in the target Cache or not.\r\n * This is called automatically by the LoaderPlugin to decide if the file can be safely\r\n * loaded or will conflict.\r\n *\r\n * @method Phaser.Loader.File#hasCacheConflict\r\n * @since 3.7.0\r\n *\r\n * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`.\r\n */\r\n hasCacheConflict: function ()\r\n {\r\n return (this.cache && this.cache.exists(this.key));\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n * This method is often overridden by specific file types.\r\n *\r\n * @method Phaser.Loader.File#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.cache)\r\n {\r\n this.cache.add(this.key, this.data);\r\n }\r\n\r\n this.pendingDestroy();\r\n },\r\n\r\n /**\r\n * Called once the file has been added to its cache and is now ready for deletion from the Loader.\r\n * It will emit a `filecomplete` event from the LoaderPlugin.\r\n *\r\n * @method Phaser.Loader.File#pendingDestroy\r\n * @fires Phaser.Loader.Events#FILE_COMPLETE\r\n * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE\r\n * @since 3.7.0\r\n */\r\n pendingDestroy: function (data)\r\n {\r\n if (data === undefined) { data = this.data; }\r\n\r\n var key = this.key;\r\n var type = this.type;\r\n\r\n this.loader.emit(Events.FILE_COMPLETE, key, type, data);\r\n this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data);\r\n\r\n this.loader.flagForRemoval(this);\r\n },\r\n\r\n /**\r\n * Destroy this File and any references it holds.\r\n *\r\n * @method Phaser.Loader.File#destroy\r\n * @since 3.7.0\r\n */\r\n destroy: function ()\r\n {\r\n this.loader = null;\r\n this.cache = null;\r\n this.xhrSettings = null;\r\n this.multiFile = null;\r\n this.linkFile = null;\r\n this.data = null;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Static method for creating object URL using URL API and setting it as image 'src' attribute.\r\n * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader.\r\n *\r\n * @method Phaser.Loader.File.createObjectURL\r\n * @static\r\n * @since 3.7.0\r\n * \r\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL.\r\n * @param {Blob} blob - A Blob object to create an object URL for.\r\n * @param {string} defaultType - Default mime type used if blob type is not available.\r\n */\r\nFile.createObjectURL = function (image, blob, defaultType)\r\n{\r\n if (typeof URL === 'function')\r\n {\r\n image.src = URL.createObjectURL(blob);\r\n }\r\n else\r\n {\r\n var reader = new FileReader();\r\n\r\n reader.onload = function ()\r\n {\r\n image.removeAttribute('crossOrigin');\r\n image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1];\r\n };\r\n\r\n reader.onerror = image.onerror;\r\n\r\n reader.readAsDataURL(blob);\r\n }\r\n};\r\n\r\n/**\r\n * Static method for releasing an existing object URL which was previously created\r\n * by calling {@link File#createObjectURL} method.\r\n *\r\n * @method Phaser.Loader.File.revokeObjectURL\r\n * @static\r\n * @since 3.7.0\r\n * \r\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked.\r\n */\r\nFile.revokeObjectURL = function (image)\r\n{\r\n if (typeof URL === 'function')\r\n {\r\n URL.revokeObjectURL(image.src);\r\n }\r\n};\r\n\r\nmodule.exports = File;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar types = {};\r\n\r\n/**\r\n * @namespace Phaser.Loader.FileTypesManager\r\n */\r\n\r\nvar FileTypesManager = {\r\n\r\n /**\r\n * Static method called when a LoaderPlugin is created.\r\n * \r\n * Loops through the local types object and injects all of them as\r\n * properties into the LoaderPlugin instance.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.install\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into.\r\n */\r\n install: function (loader)\r\n {\r\n for (var key in types)\r\n {\r\n loader[key] = types[key];\r\n }\r\n },\r\n\r\n /**\r\n * Static method called directly by the File Types.\r\n * \r\n * The key is a reference to the function used to load the files via the Loader, i.e. `image`.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.register\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key that will be used as the method name in the LoaderPlugin.\r\n * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked.\r\n */\r\n register: function (key, factoryFunction)\r\n {\r\n types[key] = factoryFunction;\r\n },\r\n\r\n /**\r\n * Removed all associated file types.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n types = {};\r\n }\r\n\r\n};\r\n\r\nmodule.exports = FileTypesManager;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Given a File and a baseURL value this returns the URL the File will use to download from.\r\n *\r\n * @function Phaser.Loader.GetURL\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File object.\r\n * @param {string} baseURL - A default base URL.\r\n *\r\n * @return {string} The URL the File will use.\r\n */\r\nvar GetURL = function (file, baseURL)\r\n{\r\n if (!file.url)\r\n {\r\n return false;\r\n }\r\n\r\n if (file.url.match(/^(?:blob:|data:|http:\\/\\/|https:\\/\\/|\\/\\/)/))\r\n {\r\n return file.url;\r\n }\r\n else\r\n {\r\n return baseURL + file.url;\r\n }\r\n};\r\n\r\nmodule.exports = GetURL;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Extend = require('../utils/object/Extend');\r\nvar XHRSettings = require('./XHRSettings');\r\n\r\n/**\r\n * Takes two XHRSettings Objects and creates a new XHRSettings object from them.\r\n *\r\n * The new object is seeded by the values given in the global settings, but any setting in\r\n * the local object overrides the global ones.\r\n *\r\n * @function Phaser.Loader.MergeXHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object.\r\n */\r\nvar MergeXHRSettings = function (global, local)\r\n{\r\n var output = (global === undefined) ? XHRSettings() : Extend({}, global);\r\n\r\n if (local)\r\n {\r\n for (var setting in local)\r\n {\r\n if (local[setting] !== undefined)\r\n {\r\n output[setting] = local[setting];\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = MergeXHRSettings;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after\r\n * 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.\r\n * \r\n * 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.\r\n *\r\n * @class MultiFile\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\r\n * @param {string} type - The file type string for sorting within the Loader.\r\n * @param {string} key - The key of the file within the loader.\r\n * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile.\r\n */\r\nvar MultiFile = new Class({\r\n\r\n initialize:\r\n\r\n function MultiFile (loader, type, key, files)\r\n {\r\n /**\r\n * A reference to the Loader that is going to load this file.\r\n *\r\n * @name Phaser.Loader.MultiFile#loader\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.7.0\r\n */\r\n this.loader = loader;\r\n\r\n /**\r\n * The file type string for sorting within the Loader.\r\n *\r\n * @name Phaser.Loader.MultiFile#type\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * Unique cache key (unique within its file type)\r\n *\r\n * @name Phaser.Loader.MultiFile#key\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.key = key;\r\n\r\n /**\r\n * Array of files that make up this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#files\r\n * @type {Phaser.Loader.File[]}\r\n * @since 3.7.0\r\n */\r\n this.files = files;\r\n\r\n /**\r\n * The completion status of this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#complete\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.7.0\r\n */\r\n this.complete = false;\r\n\r\n /**\r\n * The number of files to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#pending\r\n * @type {integer}\r\n * @since 3.7.0\r\n */\r\n\r\n this.pending = files.length;\r\n\r\n /**\r\n * The number of files that failed to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#failed\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.7.0\r\n */\r\n this.failed = 0;\r\n\r\n /**\r\n * A storage container for transient data that the loading files need.\r\n *\r\n * @name Phaser.Loader.MultiFile#config\r\n * @type {any}\r\n * @since 3.7.0\r\n */\r\n this.config = {};\r\n\r\n // Link the files\r\n for (var i = 0; i < files.length; i++)\r\n {\r\n files[i].multiFile = this;\r\n }\r\n },\r\n\r\n /**\r\n * Checks if this MultiFile is ready to process its children or not.\r\n *\r\n * @method Phaser.Loader.MultiFile#isReadyToProcess\r\n * @since 3.7.0\r\n *\r\n * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`.\r\n */\r\n isReadyToProcess: function ()\r\n {\r\n return (this.pending === 0 && this.failed === 0 && !this.complete);\r\n },\r\n\r\n /**\r\n * Adds another child to this MultiFile, increases the pending count and resets the completion status.\r\n *\r\n * @method Phaser.Loader.MultiFile#addToMultiFile\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} files - The File to add to this MultiFile.\r\n *\r\n * @return {Phaser.Loader.MultiFile} This MultiFile instance.\r\n */\r\n addToMultiFile: function (file)\r\n {\r\n this.files.push(file);\r\n\r\n file.multiFile = this;\r\n\r\n this.pending++;\r\n\r\n this.complete = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileComplete\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n }\r\n },\r\n\r\n /**\r\n * Called by each File that fails to load.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileFailed\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has failed to load.\r\n */\r\n onFileFailed: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.failed++;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MultiFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MergeXHRSettings = require('./MergeXHRSettings');\r\n\r\n/**\r\n * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings\r\n * and starts the download of it. It uses the Files own XHRSettings and merges them\r\n * with the global XHRSettings object to set the xhr values before download.\r\n *\r\n * @function Phaser.Loader.XHRLoader\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File to download.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object.\r\n *\r\n * @return {XMLHttpRequest} The XHR object.\r\n */\r\nvar XHRLoader = function (file, globalXHRSettings)\r\n{\r\n var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings);\r\n\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', file.src, config.async, config.user, config.password);\r\n\r\n xhr.responseType = file.xhrSettings.responseType;\r\n xhr.timeout = config.timeout;\r\n\r\n if (config.header && config.headerValue)\r\n {\r\n xhr.setRequestHeader(config.header, config.headerValue);\r\n }\r\n\r\n if (config.requestedWith)\r\n {\r\n xhr.setRequestHeader('X-Requested-With', config.requestedWith);\r\n }\r\n\r\n if (config.overrideMimeType)\r\n {\r\n xhr.overrideMimeType(config.overrideMimeType);\r\n }\r\n\r\n // 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.)\r\n\r\n xhr.onload = file.onLoad.bind(file, xhr);\r\n xhr.onerror = file.onError.bind(file, xhr);\r\n xhr.onprogress = file.onProgress.bind(file);\r\n\r\n // This is the only standard method, the ones above are browser additions (maybe not universal?)\r\n // xhr.onreadystatechange\r\n\r\n xhr.send();\r\n\r\n return xhr;\r\n};\r\n\r\nmodule.exports = XHRLoader;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Creates an XHRSettings Object with default values.\r\n *\r\n * @function Phaser.Loader.XHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'.\r\n * @param {boolean} [async=true] - Should the XHR request use async or not?\r\n * @param {string} [user=''] - Optional username for the XHR request.\r\n * @param {string} [password=''] - Optional password for the XHR request.\r\n * @param {integer} [timeout=0] - Optional XHR timeout value.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader.\r\n */\r\nvar XHRSettings = function (responseType, async, user, password, timeout)\r\n{\r\n if (responseType === undefined) { responseType = ''; }\r\n if (async === undefined) { async = true; }\r\n if (user === undefined) { user = ''; }\r\n if (password === undefined) { password = ''; }\r\n if (timeout === undefined) { timeout = 0; }\r\n\r\n // Before sending a request, set the xhr.responseType to \"text\",\r\n // \"arraybuffer\", \"blob\", or \"document\", depending on your data needs.\r\n // Note, setting xhr.responseType = '' (or omitting) will default the response to \"text\".\r\n\r\n return {\r\n\r\n // Ignored by the Loader, only used by File.\r\n responseType: responseType,\r\n\r\n async: async,\r\n\r\n // credentials\r\n user: user,\r\n password: password,\r\n\r\n // timeout in ms (0 = no timeout)\r\n timeout: timeout,\r\n\r\n // setRequestHeader\r\n header: undefined,\r\n headerValue: undefined,\r\n requestedWith: false,\r\n\r\n // overrideMimeType\r\n overrideMimeType: undefined\r\n\r\n };\r\n};\r\n\r\nmodule.exports = XHRSettings;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FILE_CONST = {\r\n\r\n /**\r\n * The Loader is idle.\r\n * \r\n * @name Phaser.Loader.LOADER_IDLE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_IDLE: 0,\r\n\r\n /**\r\n * The Loader is actively loading.\r\n * \r\n * @name Phaser.Loader.LOADER_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_LOADING: 1,\r\n\r\n /**\r\n * The Loader is processing files is has loaded.\r\n * \r\n * @name Phaser.Loader.LOADER_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_PROCESSING: 2,\r\n\r\n /**\r\n * The Loader has completed loading and processing.\r\n * \r\n * @name Phaser.Loader.LOADER_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_COMPLETE: 3,\r\n\r\n /**\r\n * The Loader is shutting down.\r\n * \r\n * @name Phaser.Loader.LOADER_SHUTDOWN\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_SHUTDOWN: 4,\r\n\r\n /**\r\n * The Loader has been destroyed.\r\n * \r\n * @name Phaser.Loader.LOADER_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_DESTROYED: 5,\r\n\r\n /**\r\n * File is in the load queue but not yet started\r\n * \r\n * @name Phaser.Loader.FILE_PENDING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PENDING: 10,\r\n\r\n /**\r\n * File has been started to load by the loader (onLoad called)\r\n * \r\n * @name Phaser.Loader.FILE_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADING: 11,\r\n\r\n /**\r\n * File has loaded successfully, awaiting processing \r\n * \r\n * @name Phaser.Loader.FILE_LOADED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADED: 12,\r\n\r\n /**\r\n * File failed to load\r\n * \r\n * @name Phaser.Loader.FILE_FAILED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_FAILED: 13,\r\n\r\n /**\r\n * File is being processed (onProcess callback)\r\n * \r\n * @name Phaser.Loader.FILE_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PROCESSING: 14,\r\n\r\n /**\r\n * The File has errored somehow during processing.\r\n * \r\n * @name Phaser.Loader.FILE_ERRORED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_ERRORED: 16,\r\n\r\n /**\r\n * File has finished processing.\r\n * \r\n * @name Phaser.Loader.FILE_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_COMPLETE: 17,\r\n\r\n /**\r\n * File has been destroyed\r\n * \r\n * @name Phaser.Loader.FILE_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_DESTROYED: 18,\r\n\r\n /**\r\n * File was populated from local data and doesn't need an HTTP request\r\n * \r\n * @name Phaser.Loader.FILE_POPULATED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_POPULATED: 19\r\n\r\n};\r\n\r\nmodule.exports = FILE_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Add File Event.\r\n * \r\n * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('addfile', listener)`.\r\n * \r\n * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them.\r\n *\r\n * @event Phaser.Loader.Events#ADD\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The unique key of the file that was added to the Loader.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`.\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader.\r\n */\r\nmodule.exports = 'addfile';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Complete Event.\r\n * \r\n * This event is dispatched when the Loader has fully processed everything in the load queue.\r\n * By this point every loaded file will now be in its associated cache and ready for use.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('complete', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {integer} totalComplete - The total number of files that successfully loaded.\r\n * @param {integer} totalFailed - The total number of files that failed to load.\r\n */\r\nmodule.exports = 'complete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`.\r\n * \r\n * 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.\r\n *\r\n * @event Phaser.Loader.Events#FILE_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * It uses a special dynamic event name constructed from the key and type of the file.\r\n * \r\n * For example, if you have loaded an `image` with a key of `monster`, you can listen for it\r\n * using the following:\r\n *\r\n * ```javascript\r\n * this.load.on('filecomplete-image-monster', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n *\r\n * Or, if you have loaded a texture `atlas` with a key of `Level1`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-atlas-Level1', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event.\r\n *\r\n * @event Phaser.Loader.Events#FILE_KEY_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete-';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Error Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file fails to load.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('loaderror', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD_ERROR\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n */\r\nmodule.exports = 'loaderror';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file finishes loading,\r\n * but _before_ it is processed and added to the internal Phaser caches.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('load', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which just finished loading.\r\n */\r\nmodule.exports = 'load';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Progress Event.\r\n * \r\n * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and\r\n * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is.\r\n */\r\nmodule.exports = 'fileprogress';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Post Process Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue.\r\n * It is dispatched before the internal lists are cleared and each File is destroyed.\r\n * \r\n * Use this hook to perform any last minute processing of files that can only happen once the\r\n * Loader has completed, but prior to it emitting the `complete` event.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('postprocess', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#POST_PROCESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'postprocess';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Progress Event.\r\n * \r\n * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('progress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {number} progress - The current progress of the load. A value between 0 and 1.\r\n */\r\nmodule.exports = 'progress';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Start Event.\r\n * \r\n * This event is dispatched when the Loader starts running. At this point load progress is zero.\r\n * \r\n * This event is dispatched even if there aren't any files in the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('start', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Loader.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ADD: require('./ADD_EVENT'),\r\n COMPLETE: require('./COMPLETE_EVENT'),\r\n FILE_COMPLETE: require('./FILE_COMPLETE_EVENT'),\r\n FILE_KEY_COMPLETE: require('./FILE_KEY_COMPLETE_EVENT'),\r\n FILE_LOAD_ERROR: require('./FILE_LOAD_ERROR_EVENT'),\r\n FILE_LOAD: require('./FILE_LOAD_EVENT'),\r\n FILE_PROGRESS: require('./FILE_PROGRESS_EVENT'),\r\n POST_PROCESS: require('./POST_PROCESS_EVENT'),\r\n PROGRESS: require('./PROGRESS_EVENT'),\r\n START: require('./START_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single Image File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image.\r\n *\r\n * @class ImageFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets.\r\n */\r\nvar ImageFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function ImageFile (loader, key, url, xhrSettings, frameConfig)\r\n {\r\n var extension = 'png';\r\n var normalMapURL;\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n normalMapURL = GetFastValue(config, 'normalMap');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n frameConfig = GetFastValue(config, 'frameConfig');\r\n }\r\n\r\n if (Array.isArray(url))\r\n {\r\n normalMapURL = url[1];\r\n url = url[0];\r\n }\r\n\r\n var fileConfig = {\r\n type: 'image',\r\n cache: loader.textureManager,\r\n extension: extension,\r\n responseType: 'blob',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: frameConfig\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n // Do we have a normal map to load as well?\r\n if (normalMapURL)\r\n {\r\n var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig);\r\n\r\n normalMap.type = 'normalMap';\r\n\r\n this.setLink(normalMap);\r\n\r\n loader.addFile(normalMap);\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = new Image();\r\n\r\n this.data.crossOrigin = this.crossOrigin;\r\n\r\n var _this = this;\r\n\r\n this.data.onload = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessComplete();\r\n };\r\n\r\n this.data.onerror = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessError();\r\n };\r\n\r\n File.createObjectURL(this.data, this.xhrLoader.response, 'image/png');\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var texture;\r\n var linkFile = this.linkFile;\r\n\r\n if (linkFile && linkFile.state === CONST.FILE_COMPLETE)\r\n {\r\n if (this.type === 'image')\r\n {\r\n texture = this.cache.addImage(this.key, this.data, linkFile.data);\r\n }\r\n else\r\n {\r\n texture = this.cache.addImage(linkFile.key, linkFile.data, this.data);\r\n }\r\n\r\n this.pendingDestroy(texture);\r\n\r\n linkFile.pendingDestroy(texture);\r\n }\r\n else if (!linkFile)\r\n {\r\n texture = this.cache.addImage(this.key, this.data);\r\n\r\n this.pendingDestroy(texture);\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an Image, or array of Images, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.image('logo', 'images/phaserLogo.png');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback\r\n * of animated gifs to Canvas elements.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.image('logo', 'images/AtariLogo.png');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'logo');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n * \r\n * ```javascript\r\n * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]);\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n * \r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png',\r\n * normalMap: 'images/AtariLogo-n.png'\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#image\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('image', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new ImageFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new ImageFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = ImageFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar GetValue = require('../../utils/object/GetValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single JSON File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json.\r\n *\r\n * @class JSONFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n */\r\nvar JSONFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n // 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\r\n // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing\r\n\r\n function JSONFile (loader, key, url, xhrSettings, dataKey)\r\n {\r\n var extension = 'json';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n dataKey = GetFastValue(config, 'dataKey', dataKey);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'json',\r\n cache: loader.cacheManager.json,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: dataKey\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n if (IsPlainObject(url))\r\n {\r\n // Object provided instead of a URL, so no need to actually load it (populate data with value)\r\n if (dataKey)\r\n {\r\n this.data = GetValue(url, dataKey);\r\n }\r\n else\r\n {\r\n this.data = url;\r\n }\r\n\r\n this.state = CONST.FILE_POPULATED;\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.JSONFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n if (this.state !== CONST.FILE_POPULATED)\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n var json = JSON.parse(this.xhrLoader.responseText);\r\n\r\n var key = this.config;\r\n\r\n if (typeof key === 'string')\r\n {\r\n this.data = GetValue(json, key, json);\r\n }\r\n else\r\n {\r\n this.data = json;\r\n }\r\n }\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a JSON file, or array of JSON files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.json('wavedata', 'files/AlienWaveData.json');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the JSON Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the JSON Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.json({\r\n * key: 'wavedata',\r\n * url: 'files/AlienWaveData.json'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n * \r\n * ```javascript\r\n * this.load.json('wavedata', 'files/AlienWaveData.json');\r\n * // and later in your game ...\r\n * var data = this.cache.json.get('wavedata');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and\r\n * this is what you would use to retrieve the text from the JSON Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * 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,\r\n * rather than the whole file. For example, if your JSON data had a structure like this:\r\n * \r\n * ```json\r\n * {\r\n * \"level1\": {\r\n * \"baddies\": {\r\n * \"aliens\": {},\r\n * \"boss\": {}\r\n * }\r\n * },\r\n * \"level2\": {},\r\n * \"level3\": {}\r\n * }\r\n * ```\r\n *\r\n * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`.\r\n *\r\n * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#json\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @param {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\".\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('json', function (key, url, dataKey, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new JSONFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = JSONFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single Text File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text.\r\n *\r\n * @class TextFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar TextFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function TextFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'txt';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'text',\r\n cache: loader.cacheManager.text,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.TextFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = this.xhrLoader.responseText;\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Text file, or array of Text files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Text Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Text Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.text({\r\n * key: 'story',\r\n * url: 'files/IntroStory.txt'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n *\r\n * ```javascript\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * // and later in your game ...\r\n * var data = this.cache.text.get('story');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and\r\n * this is what you would use to retrieve the text from the Text Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#text\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('text', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new TextFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new TextFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = TextFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the mean average of the given values.\r\n *\r\n * @function Phaser.Math.Average\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} values - The values to average.\r\n *\r\n * @return {number} The average value.\r\n */\r\nvar Average = function (values)\r\n{\r\n var sum = 0;\r\n\r\n for (var i = 0; i < values.length; i++)\r\n {\r\n sum += (+values[i]);\r\n }\r\n\r\n return sum / values.length;\r\n};\r\n\r\nmodule.exports = Average;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Factorial = require('./Factorial');\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Math.Bernstein\r\n * @since 3.0.0\r\n *\r\n * @param {number} n - [description]\r\n * @param {number} i - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\nvar Bernstein = function (n, i)\r\n{\r\n return Factorial(n) / Factorial(i) / Factorial(n - i);\r\n};\r\n\r\nmodule.exports = Bernstein;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random integer between the `min` and `max` values, inclusive.\r\n *\r\n * @function Phaser.Math.Between\r\n * @since 3.0.0\r\n *\r\n * @param {integer} min - The minimum value.\r\n * @param {integer} max - The maximum value.\r\n *\r\n * @return {integer} The random integer.\r\n */\r\nvar Between = function (min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n};\r\n\r\nmodule.exports = Between;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates a Catmull-Rom value.\r\n *\r\n * @function Phaser.Math.CatmullRom\r\n * @since 3.0.0\r\n *\r\n * @param {number} t - [description]\r\n * @param {number} p0 - [description]\r\n * @param {number} p1 - [description]\r\n * @param {number} p2 - [description]\r\n * @param {number} p3 - [description]\r\n *\r\n * @return {number} The Catmull-Rom value.\r\n */\r\nvar CatmullRom = function (t, p0, p1, p2, p3)\r\n{\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n var t2 = t * t;\r\n var t3 = t * t2;\r\n\r\n return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\r\n};\r\n\r\nmodule.exports = CatmullRom;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Ceils to some place comparative to a `base`, default is 10 for decimal place.\r\n *\r\n * The `place` is represented by the power applied to `base` to get that place.\r\n *\r\n * @function Phaser.Math.CeilTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {number} [place=0] - The place to round to.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar CeilTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.ceil(value * p) / p;\r\n};\r\n\r\nmodule.exports = CeilTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Force a value within the boundaries by clamping it to the range `min`, `max`.\r\n *\r\n * @function Phaser.Math.Clamp\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to be clamped.\r\n * @param {number} min - The minimum bounds.\r\n * @param {number} max - The maximum bounds.\r\n *\r\n * @return {number} The clamped value.\r\n */\r\nvar Clamp = function (value, min, max)\r\n{\r\n return Math.max(min, Math.min(max, value));\r\n};\r\n\r\nmodule.exports = Clamp;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\n\r\n/**\r\n * Convert the given angle from degrees, to the equivalent angle in radians.\r\n *\r\n * @function Phaser.Math.DegToRad\r\n * @since 3.0.0\r\n *\r\n * @param {integer} degrees - The angle (in degrees) to convert to radians.\r\n *\r\n * @return {number} The given angle converted to radians.\r\n */\r\nvar DegToRad = function (degrees)\r\n{\r\n return degrees * CONST.DEG_TO_RAD;\r\n};\r\n\r\nmodule.exports = DegToRad;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the positive difference of two given numbers.\r\n *\r\n * @function Phaser.Math.Difference\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first number in the calculation.\r\n * @param {number} b - The second number in the calculation.\r\n *\r\n * @return {number} The positive difference of the two given numbers.\r\n */\r\nvar Difference = function (a, b)\r\n{\r\n return Math.abs(a - b);\r\n};\r\n\r\nmodule.exports = Difference;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the factorial of a given number for integer values greater than 0.\r\n *\r\n * @function Phaser.Math.Factorial\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - A positive integer to calculate the factorial of.\r\n *\r\n * @return {number} The factorial of the given number.\r\n */\r\nvar Factorial = function (value)\r\n{\r\n if (value === 0)\r\n {\r\n return 1;\r\n }\r\n\r\n var res = value;\r\n\r\n while (--value)\r\n {\r\n res *= value;\r\n }\r\n\r\n return res;\r\n};\r\n\r\nmodule.exports = Factorial;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive.\r\n *\r\n * @function Phaser.Math.FloatBetween\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The lower bound for the float, inclusive.\r\n * @param {number} max - The upper bound for the float exclusive.\r\n *\r\n * @return {number} A random float within the given range.\r\n */\r\nvar FloatBetween = function (min, max)\r\n{\r\n return Math.random() * (max - min) + min;\r\n};\r\n\r\nmodule.exports = FloatBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Floors to some place comparative to a `base`, default is 10 for decimal place.\r\n *\r\n * The `place` is represented by the power applied to `base` to get that place.\r\n *\r\n * @function Phaser.Math.FloorTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {integer} [place=0] - The place to round to.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar FloorTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.floor(value * p) / p;\r\n};\r\n\r\nmodule.exports = FloorTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = require('./Clamp');\r\n\r\n/**\r\n * Return a value based on the range between `min` and `max` and the percentage given.\r\n *\r\n * @function Phaser.Math.FromPercent\r\n * @since 3.0.0\r\n *\r\n * @param {number} percent - A value between 0 and 1 representing the percentage.\r\n * @param {number} min - The minimum value.\r\n * @param {number} [max] - The maximum value.\r\n *\r\n * @return {number} The value that is `percent` percent between `min` and `max`.\r\n */\r\nvar FromPercent = function (percent, min, max)\r\n{\r\n percent = Clamp(percent, 0, 1);\r\n\r\n return (max - min) * percent;\r\n};\r\n\r\nmodule.exports = FromPercent;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the speed required to cover a distance in the time given.\r\n *\r\n * @function Phaser.Math.GetSpeed\r\n * @since 3.0.0\r\n *\r\n * @param {number} distance - The distance to travel in pixels.\r\n * @param {integer} time - The time, in ms, to cover the distance in.\r\n *\r\n * @return {number} The amount you will need to increment the position by each step in order to cover the distance in the time given.\r\n */\r\nvar GetSpeed = function (distance, time)\r\n{\r\n return (distance / time) / 1000;\r\n};\r\n\r\nmodule.exports = GetSpeed;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check if a given value is an even number.\r\n *\r\n * @function Phaser.Math.IsEven\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to perform the check with.\r\n *\r\n * @return {boolean} Whether the number is even or not.\r\n */\r\nvar IsEven = function (value)\r\n{\r\n // Use abstract equality == for \"is number\" test\r\n\r\n // eslint-disable-next-line eqeqeq\r\n return (value == parseFloat(value)) ? !(value % 2) : void 0;\r\n};\r\n\r\nmodule.exports = IsEven;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check if a given value is an even number using a strict type check.\r\n *\r\n * @function Phaser.Math.IsEvenStrict\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to perform the check with.\r\n *\r\n * @return {boolean} Whether the number is even or not.\r\n */\r\nvar IsEvenStrict = function (value)\r\n{\r\n // Use strict equality === for \"is number\" test\r\n return (value === parseFloat(value)) ? !(value % 2) : void 0;\r\n};\r\n\r\nmodule.exports = IsEvenStrict;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates a linear (interpolation) value over t.\r\n *\r\n * @function Phaser.Math.Linear\r\n * @since 3.0.0\r\n *\r\n * @param {number} p0 - The first point.\r\n * @param {number} p1 - The second point.\r\n * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1.\r\n *\r\n * @return {number} The step t% of the way between p0 and p1.\r\n */\r\nvar Linear = function (p0, p1, t)\r\n{\r\n return (p1 - p0) * t + p0;\r\n};\r\n\r\nmodule.exports = Linear;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A three-dimensional matrix.\r\n *\r\n * Defaults to the identity matrix when instantiated.\r\n *\r\n * @class Matrix3\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from.\r\n */\r\nvar Matrix3 = new Class({\r\n\r\n initialize:\r\n\r\n function Matrix3 (m)\r\n {\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.Math.Matrix3#val\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.val = new Float32Array(9);\r\n\r\n if (m)\r\n {\r\n // Assume Matrix3 with val:\r\n this.copy(m);\r\n }\r\n else\r\n {\r\n // Default to identity\r\n this.identity();\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Matrix3.\r\n *\r\n * @method Phaser.Math.Matrix3#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} A clone of this Matrix3.\r\n */\r\n clone: function ()\r\n {\r\n return new Matrix3(this);\r\n },\r\n\r\n /**\r\n * This method is an alias for `Matrix3.copy`.\r\n *\r\n * @method Phaser.Math.Matrix3#set\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n set: function (src)\r\n {\r\n return this.copy(src);\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix into this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n copy: function (src)\r\n {\r\n var out = this.val;\r\n var a = src.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix4 into this Matrix3.\r\n *\r\n * @method Phaser.Math.Matrix3#fromMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromMat4: function (m)\r\n {\r\n var a = m.val;\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given array.\r\n *\r\n * @method Phaser.Math.Matrix3#fromArray\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The array to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromArray: function (a)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n identity: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transpose this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#transpose\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n transpose: function ()\r\n {\r\n var a = this.val;\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a12 = a[5];\r\n\r\n a[1] = a[3];\r\n a[2] = a[6];\r\n a[3] = a01;\r\n a[5] = a[7];\r\n a[6] = a02;\r\n a[7] = a12;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n invert: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n var b01 = a22 * a11 - a12 * a21;\r\n var b11 = -a22 * a10 + a12 * a20;\r\n var b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n var det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n a[0] = b01 * det;\r\n a[1] = (-a22 * a01 + a02 * a21) * det;\r\n a[2] = (a12 * a01 - a02 * a11) * det;\r\n a[3] = b11 * det;\r\n a[4] = (a22 * a00 - a02 * a20) * det;\r\n a[5] = (-a12 * a00 + a02 * a10) * det;\r\n a[6] = b21 * det;\r\n a[7] = (-a21 * a00 + a01 * a20) * det;\r\n a[8] = (a11 * a00 - a01 * a10) * det;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the adjoint, or adjugate, of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#adjoint\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n adjoint: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n a[0] = (a11 * a22 - a12 * a21);\r\n a[1] = (a02 * a21 - a01 * a22);\r\n a[2] = (a01 * a12 - a02 * a11);\r\n a[3] = (a12 * a20 - a10 * a22);\r\n a[4] = (a00 * a22 - a02 * a20);\r\n a[5] = (a02 * a10 - a00 * a12);\r\n a[6] = (a10 * a21 - a11 * a20);\r\n a[7] = (a01 * a20 - a00 * a21);\r\n a[8] = (a00 * a11 - a01 * a10);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the determinant of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#determinant\r\n * @since 3.0.0\r\n *\r\n * @return {number} The determinant of this Matrix.\r\n */\r\n determinant: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n multiply: function (src)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n var b = src.val;\r\n\r\n var b00 = b[0];\r\n var b01 = b[1];\r\n var b02 = b[2];\r\n var b10 = b[3];\r\n var b11 = b[4];\r\n var b12 = b[5];\r\n var b20 = b[6];\r\n var b21 = b[7];\r\n var b22 = b[8];\r\n\r\n a[0] = b00 * a00 + b01 * a10 + b02 * a20;\r\n a[1] = b00 * a01 + b01 * a11 + b02 * a21;\r\n a[2] = b00 * a02 + b01 * a12 + b02 * a22;\r\n\r\n a[3] = b10 * a00 + b11 * a10 + b12 * a20;\r\n a[4] = b10 * a01 + b11 * a11 + b12 * a21;\r\n a[5] = b10 * a02 + b11 * a12 + b12 * a22;\r\n\r\n a[6] = b20 * a00 + b21 * a10 + b22 * a20;\r\n a[7] = b20 * a01 + b21 * a11 + b22 * a21;\r\n a[8] = b20 * a02 + b21 * a12 + b22 * a22;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given Vector.\r\n *\r\n * @method Phaser.Math.Matrix3#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n translate: function (v)\r\n {\r\n var a = this.val;\r\n var x = v.x;\r\n var y = v.y;\r\n\r\n a[6] = x * a[0] + y * a[3] + a[6];\r\n a[7] = x * a[1] + y * a[4] + a[7];\r\n a[8] = x * a[2] + y * a[5] + a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a rotation transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n rotate: function (rad)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n a[0] = c * a00 + s * a10;\r\n a[1] = c * a01 + s * a11;\r\n a[2] = c * a02 + s * a12;\r\n\r\n a[3] = c * a10 - s * a00;\r\n a[4] = c * a11 - s * a01;\r\n a[5] = c * a12 - s * a02;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * Uses the `x` and `y` components of the given Vector to scale the Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#scale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n scale: function (v)\r\n {\r\n var a = this.val;\r\n var x = v.x;\r\n var y = v.y;\r\n\r\n a[0] = x * a[0];\r\n a[1] = x * a[1];\r\n a[2] = x * a[2];\r\n\r\n a[3] = y * a[3];\r\n a[4] = y * a[4];\r\n a[5] = y * a[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given Quaternion.\r\n *\r\n * @method Phaser.Math.Matrix3#fromQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromQuat: function (q)\r\n {\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n var out = this.val;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[3] = xy + wz;\r\n out[6] = xz - wy;\r\n\r\n out[1] = xy - wz;\r\n out[4] = 1 - (xx + zz);\r\n out[7] = yz + wx;\r\n\r\n out[2] = xz + wy;\r\n out[5] = yz - wx;\r\n out[8] = 1 - (xx + yy);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Matrix3#normalFromMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} m - [description]\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n normalFromMat4: function (m)\r\n {\r\n var a = m.val;\r\n var out = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Matrix3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\nvar EPSILON = 0.000001;\r\n\r\n/**\r\n * @classdesc\r\n * A four-dimensional matrix.\r\n *\r\n * @class Matrix4\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from.\r\n */\r\nvar Matrix4 = new Class({\r\n\r\n initialize:\r\n\r\n function Matrix4 (m)\r\n {\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.Math.Matrix4#val\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.val = new Float32Array(16);\r\n\r\n if (m)\r\n {\r\n // Assume Matrix4 with val:\r\n this.copy(m);\r\n }\r\n else\r\n {\r\n // Default to identity\r\n this.identity();\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Matrix4.\r\n *\r\n * @method Phaser.Math.Matrix4#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} A clone of this Matrix4.\r\n */\r\n clone: function ()\r\n {\r\n return new Matrix4(this);\r\n },\r\n\r\n // TODO - Should work with basic values\r\n\r\n /**\r\n * This method is an alias for `Matrix4.copy`.\r\n *\r\n * @method Phaser.Math.Matrix4#set\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n set: function (src)\r\n {\r\n return this.copy(src);\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix into this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n copy: function (src)\r\n {\r\n var out = this.val;\r\n var a = src.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given array.\r\n *\r\n * @method Phaser.Math.Matrix4#fromArray\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The array to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromArray: function (a)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix.\r\n *\r\n * Sets all values to `0`.\r\n *\r\n * @method Phaser.Math.Matrix4#zero\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n zero: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 0;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x`, `y` and `z` values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#xyz\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n * @param {number} z - The z value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n xyz: function (x, y, z)\r\n {\r\n this.identity();\r\n\r\n var out = this.val;\r\n\r\n out[12] = x;\r\n out[13] = y;\r\n out[14] = z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the scaling values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaling\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x scaling value.\r\n * @param {number} y - The y scaling value.\r\n * @param {number} z - The z scaling value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaling: function (x, y, z)\r\n {\r\n this.zero();\r\n\r\n var out = this.val;\r\n\r\n out[0] = x;\r\n out[5] = y;\r\n out[10] = z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n identity: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transpose this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#transpose\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n transpose: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n var a23 = a[11];\r\n\r\n a[1] = a[4];\r\n a[2] = a[8];\r\n a[3] = a[12];\r\n a[4] = a01;\r\n a[6] = a[9];\r\n a[7] = a[13];\r\n a[8] = a02;\r\n a[9] = a12;\r\n a[11] = a[14];\r\n a[12] = a03;\r\n a[13] = a13;\r\n a[14] = a23;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n invert: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the adjoint, or adjugate, of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#adjoint\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n adjoint: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22));\r\n a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\r\n a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12));\r\n a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\r\n a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\r\n a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22));\r\n a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\r\n a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12));\r\n a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21));\r\n a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\r\n a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11));\r\n a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\r\n a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\r\n a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21));\r\n a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\r\n a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11));\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the determinant of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#determinant\r\n * @since 3.0.0\r\n *\r\n * @return {number} The determinant of this Matrix.\r\n */\r\n determinant: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiply: function (src)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b = src.val;\r\n\r\n // Cache only the current line of the second matrix\r\n var b0 = b[0];\r\n var b1 = b[1];\r\n var b2 = b[2];\r\n var b3 = b[3];\r\n\r\n a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n\r\n a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n\r\n a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n\r\n a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Matrix4#multiplyLocal\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - [description]\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiplyLocal: function (src)\r\n {\r\n var a = [];\r\n var m1 = this.val;\r\n var m2 = src.val;\r\n\r\n a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12];\r\n a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13];\r\n a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14];\r\n a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15];\r\n\r\n a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12];\r\n a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13];\r\n a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14];\r\n a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15];\r\n\r\n a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12];\r\n a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13];\r\n a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14];\r\n a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15];\r\n\r\n a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12];\r\n a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13];\r\n a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14];\r\n a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15];\r\n\r\n return this.fromArray(a);\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translate: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given values.\r\n *\r\n * @method Phaser.Math.Matrix4#translateXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translateXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scale: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaleXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaleXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Derive a rotation matrix around the given axis.\r\n *\r\n * @method Phaser.Math.Matrix4#makeRotationAxis\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis.\r\n * @param {number} angle - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n makeRotationAxis: function (axis, angle)\r\n {\r\n // Based on http://www.gamedev.net/reference/articles/article1199.asp\r\n\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n var t = 1 - c;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var tx = t * x;\r\n var ty = t * y;\r\n\r\n this.fromArray([\r\n tx * x + c, tx * y - s * z, tx * z + s * y, 0,\r\n tx * y + s * z, ty * y + c, ty * z - s * x, 0,\r\n tx * z - s * y, ty * z + s * x, t * z * z + c, 0,\r\n 0, 0, 0, 1\r\n ]);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a rotation transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n * @param {Phaser.Math.Vector3} axis - The axis to rotate upon.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotate: function (rad, axis)\r\n {\r\n var a = this.val;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (Math.abs(len) < EPSILON)\r\n {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n var t = 1 - c;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n var b00 = x * x * t + c;\r\n var b01 = y * x * t + z * s;\r\n var b02 = z * x * t - y * s;\r\n\r\n var b10 = x * y * t - z * s;\r\n var b11 = y * y * t + c;\r\n var b12 = z * y * t + x * s;\r\n\r\n var b20 = x * z * t + y * s;\r\n var b21 = y * z * t - x * s;\r\n var b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n a[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n a[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n a[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n a[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n a[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n a[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n a[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n a[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n a[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n a[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n a[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n a[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its X axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateX: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[4] = a10 * c + a20 * s;\r\n a[5] = a11 * c + a21 * s;\r\n a[6] = a12 * c + a22 * s;\r\n a[7] = a13 * c + a23 * s;\r\n a[8] = a20 * c - a10 * s;\r\n a[9] = a21 * c - a11 * s;\r\n a[10] = a22 * c - a12 * s;\r\n a[11] = a23 * c - a13 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Y axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateY: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c - a20 * s;\r\n a[1] = a01 * c - a21 * s;\r\n a[2] = a02 * c - a22 * s;\r\n a[3] = a03 * c - a23 * s;\r\n a[8] = a00 * s + a20 * c;\r\n a[9] = a01 * s + a21 * c;\r\n a[10] = a02 * s + a22 * c;\r\n a[11] = a03 * s + a23 * c;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Z axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateZ: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c + a10 * s;\r\n a[1] = a01 * c + a11 * s;\r\n a[2] = a02 * c + a12 * s;\r\n a[3] = a03 * c + a13 * s;\r\n a[4] = a10 * c - a00 * s;\r\n a[5] = a11 * c - a01 * s;\r\n a[6] = a12 * c - a02 * s;\r\n a[7] = a13 * c - a03 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given rotation Quaternion and translation Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#fromRotationTranslation\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from.\r\n * @param {Phaser.Math.Vector3} v - The Vector to set translation from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromRotationTranslation: function (q, v)\r\n {\r\n // Quaternion math\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = v.x;\r\n out[13] = v.y;\r\n out[14] = v.z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given Quaternion.\r\n *\r\n * @method Phaser.Math.Matrix4#fromQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromQuat: function (q)\r\n {\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a frustum matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#frustum\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n frustum: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n\r\n var rl = 1 / (right - left);\r\n var tb = 1 / (top - bottom);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = (near * 2) * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (near * 2) * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (far * near * 2) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspective\r\n * @since 3.0.0\r\n *\r\n * @param {number} fovy - Vertical field of view in radians\r\n * @param {number} aspect - Aspect ratio. Typically viewport width /height.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspective: function (fovy, aspect, near, far)\r\n {\r\n var out = this.val;\r\n var f = 1.0 / Math.tan(fovy / 2);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (2 * far * near) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspectiveLH\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of the frustum.\r\n * @param {number} height - The height of the frustum.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspectiveLH: function (width, height, near, far)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = (2 * near) / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (2 * near) / height;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = -far / (near - far);\r\n out[11] = 1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (near * far) / (near - far);\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate an orthogonal projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#ortho\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n ortho: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n var lr = left - right;\r\n var bt = bottom - top;\r\n var nf = near - far;\r\n\r\n // Avoid division by zero\r\n lr = (lr === 0) ? lr : 1 / lr;\r\n bt = (bt === 0) ? bt : 1 / bt;\r\n nf = (nf === 0) ? nf : 1 / nf;\r\n\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a look-at matrix with the given eye position, focal point, and up axis.\r\n *\r\n * @method Phaser.Math.Matrix4#lookAt\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} eye - Position of the viewer\r\n * @param {Phaser.Math.Vector3} center - Point the viewer is looking at\r\n * @param {Phaser.Math.Vector3} up - vec3 pointing up.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n lookAt: function (eye, center, up)\r\n {\r\n var out = this.val;\r\n\r\n var eyex = eye.x;\r\n var eyey = eye.y;\r\n var eyez = eye.z;\r\n\r\n var upx = up.x;\r\n var upy = up.y;\r\n var upz = up.z;\r\n\r\n var centerx = center.x;\r\n var centery = center.y;\r\n var centerz = center.z;\r\n\r\n if (Math.abs(eyex - centerx) < EPSILON &&\r\n Math.abs(eyey - centery) < EPSILON &&\r\n Math.abs(eyez - centerz) < EPSILON)\r\n {\r\n return this.identity();\r\n }\r\n\r\n var z0 = eyex - centerx;\r\n var z1 = eyey - centery;\r\n var z2 = eyez - centerz;\r\n\r\n var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n var x0 = upy * z2 - upz * z1;\r\n var x1 = upz * z0 - upx * z2;\r\n var x2 = upx * z1 - upy * z0;\r\n\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n\r\n if (!len)\r\n {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n var y0 = z1 * x2 - z2 * x1;\r\n var y1 = z2 * x0 - z0 * x2;\r\n var y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n\r\n if (!len)\r\n {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values.\r\n *\r\n * @method Phaser.Math.Matrix4#yawPitchRoll\r\n * @since 3.0.0\r\n *\r\n * @param {number} yaw - [description]\r\n * @param {number} pitch - [description]\r\n * @param {number} roll - [description]\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n yawPitchRoll: function (yaw, pitch, roll)\r\n {\r\n this.zero();\r\n _tempMat1.zero();\r\n _tempMat2.zero();\r\n\r\n var m0 = this.val;\r\n var m1 = _tempMat1.val;\r\n var m2 = _tempMat2.val;\r\n\r\n // Rotate Z\r\n var s = Math.sin(roll);\r\n var c = Math.cos(roll);\r\n\r\n m0[10] = 1;\r\n m0[15] = 1;\r\n m0[0] = c;\r\n m0[1] = s;\r\n m0[4] = -s;\r\n m0[5] = c;\r\n\r\n // Rotate X\r\n s = Math.sin(pitch);\r\n c = Math.cos(pitch);\r\n\r\n m1[0] = 1;\r\n m1[15] = 1;\r\n m1[5] = c;\r\n m1[10] = c;\r\n m1[9] = -s;\r\n m1[6] = s;\r\n\r\n // Rotate Y\r\n s = Math.sin(yaw);\r\n c = Math.cos(yaw);\r\n\r\n m2[5] = 1;\r\n m2[15] = 1;\r\n m2[0] = c;\r\n m2[2] = -s;\r\n m2[8] = s;\r\n m2[10] = c;\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#setWorldMatrix\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix.\r\n * @param {Phaser.Math.Vector3} position - The position of the world matrix.\r\n * @param {Phaser.Math.Vector3} scale - The scale of the world matrix.\r\n * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix.\r\n * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix)\r\n {\r\n this.yawPitchRoll(rotation.y, rotation.x, rotation.z);\r\n\r\n _tempMat1.scaling(scale.x, scale.y, scale.z);\r\n _tempMat2.xyz(position.x, position.y, position.z);\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n if (viewMatrix !== undefined)\r\n {\r\n this.multiplyLocal(viewMatrix);\r\n }\r\n\r\n if (projectionMatrix !== undefined)\r\n {\r\n this.multiplyLocal(projectionMatrix);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nvar _tempMat1 = new Matrix4();\r\nvar _tempMat2 = new Matrix4();\r\n\r\nmodule.exports = Matrix4;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Add an `amount` to a `value`, limiting the maximum result to `max`.\r\n *\r\n * @function Phaser.Math.MaxAdd\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to add to.\r\n * @param {number} amount - The amount to add.\r\n * @param {number} max - The maximum value to return.\r\n *\r\n * @return {number} The resulting value.\r\n */\r\nvar MaxAdd = function (value, amount, max)\r\n{\r\n return Math.min(value + amount, max);\r\n};\r\n\r\nmodule.exports = MaxAdd;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Subtract an `amount` from `value`, limiting the minimum result to `min`.\r\n *\r\n * @function Phaser.Math.MinSub\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to subtract from.\r\n * @param {number} amount - The amount to subtract.\r\n * @param {number} min - The minimum value to return.\r\n *\r\n * @return {number} The resulting value.\r\n */\r\nvar MinSub = function (value, amount, min)\r\n{\r\n return Math.max(value - amount, min);\r\n};\r\n\r\nmodule.exports = MinSub;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Work out what percentage `value` is of the range between `min` and `max`.\r\n * If `max` isn't given then it will return the percentage of `value` to `min`.\r\n *\r\n * 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.\r\n *\r\n * @function Phaser.Math.Percent\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to determine the percentage of.\r\n * @param {number} min - The minimum value.\r\n * @param {number} [max] - The maximum value.\r\n * @param {number} [upperMax] - The mid-way point in the range that represents 100%.\r\n *\r\n * @return {number} A value between 0 and 1 representing the percentage.\r\n */\r\nvar Percent = function (value, min, max, upperMax)\r\n{\r\n if (max === undefined) { max = min + 1; }\r\n\r\n var percentage = (value - min) / (max - min);\r\n\r\n if (percentage > 1)\r\n {\r\n if (upperMax !== undefined)\r\n {\r\n percentage = ((upperMax - value)) / (upperMax - max);\r\n\r\n if (percentage < 0)\r\n {\r\n percentage = 0;\r\n }\r\n }\r\n else\r\n {\r\n percentage = 1;\r\n }\r\n }\r\n else if (percentage < 0)\r\n {\r\n percentage = 0;\r\n }\r\n\r\n return percentage;\r\n};\r\n\r\nmodule.exports = Percent;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\nvar Vector3 = require('./Vector3');\r\nvar Matrix3 = require('./Matrix3');\r\n\r\nvar EPSILON = 0.000001;\r\n\r\n// Some shared 'private' arrays\r\nvar siNext = new Int8Array([ 1, 2, 0 ]);\r\nvar tmp = new Float32Array([ 0, 0, 0 ]);\r\n\r\nvar xUnitVec3 = new Vector3(1, 0, 0);\r\nvar yUnitVec3 = new Vector3(0, 1, 0);\r\n\r\nvar tmpvec = new Vector3();\r\nvar tmpMat3 = new Matrix3();\r\n\r\n/**\r\n * @classdesc\r\n * A quaternion.\r\n *\r\n * @class Quaternion\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n * @param {number} [w] - The w component.\r\n */\r\nvar Quaternion = new Class({\r\n\r\n initialize:\r\n\r\n function Quaternion (x, y, z, w)\r\n {\r\n /**\r\n * The x component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The y component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The z component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The w component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Copy the components of a given Quaternion or Vector into this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#copy\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z;\r\n this.w = src.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the components of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components.\r\n * @param {number} [y=0] - The y component.\r\n * @param {number} [z=0] - The z component.\r\n * @param {number} [w=0] - The w component.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n set: function (x, y, z, w)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Quaternion#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z;\r\n this.w += v.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Quaternion#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z;\r\n this.w -= v.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Quaternion by the given value.\r\n *\r\n * @method Phaser.Math.Quaternion#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Quaternion by.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n scale: function (scale)\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the length of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Quaternion.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Quaternion squared.\r\n *\r\n * @method Phaser.Math.Quaternion#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Quaternion, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n },\r\n\r\n /**\r\n * Normalize this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var len = x * x + y * y + z * z + w * w;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n this.w = w * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Quaternion and the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#dot\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion.\r\n *\r\n * @return {number} The dot product of this Quaternion and the given Quaternion or Vector.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\r\n },\r\n\r\n /**\r\n * Linearly interpolate this Quaternion towards the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards.\r\n * @param {number} [t=0] - The percentage of interpolation.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n this.w = aw + t * (v.w - aw);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Quaternion#rotationTo\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} a - [description]\r\n * @param {Phaser.Math.Vector3} b - [description]\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotationTo: function (a, b)\r\n {\r\n var dot = a.x * b.x + a.y * b.y + a.z * b.z;\r\n\r\n if (dot < -0.999999)\r\n {\r\n if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON)\r\n {\r\n tmpvec.copy(yUnitVec3).cross(a);\r\n }\r\n\r\n tmpvec.normalize();\r\n\r\n return this.setAxisAngle(tmpvec, Math.PI);\r\n\r\n }\r\n else if (dot > 0.999999)\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 1;\r\n\r\n return this;\r\n }\r\n else\r\n {\r\n tmpvec.copy(a).cross(b);\r\n\r\n this.x = tmpvec.x;\r\n this.y = tmpvec.y;\r\n this.z = tmpvec.z;\r\n this.w = 1 + dot;\r\n\r\n return this.normalize();\r\n }\r\n },\r\n\r\n /**\r\n * Set the axes of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#setAxes\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} view - The view axis.\r\n * @param {Phaser.Math.Vector3} right - The right axis.\r\n * @param {Phaser.Math.Vector3} up - The upwards axis.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n setAxes: function (view, right, up)\r\n {\r\n var m = tmpMat3.val;\r\n\r\n m[0] = right.x;\r\n m[3] = right.y;\r\n m[6] = right.z;\r\n\r\n m[1] = up.x;\r\n m[4] = up.y;\r\n m[7] = up.z;\r\n\r\n m[2] = -view.x;\r\n m[5] = -view.y;\r\n m[8] = -view.z;\r\n\r\n return this.fromMat3(tmpMat3).normalize();\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n identity: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the axis angle of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#setAxisAngle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} axis - The axis.\r\n * @param {number} rad - The angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n setAxisAngle: function (axis, rad)\r\n {\r\n rad = rad * 0.5;\r\n\r\n var s = Math.sin(rad);\r\n\r\n this.x = s * axis.x;\r\n this.y = s * axis.y;\r\n this.z = s * axis.z;\r\n this.w = Math.cos(rad);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply this Quaternion by the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n multiply: function (b)\r\n {\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n var bw = b.w;\r\n\r\n this.x = ax * bw + aw * bx + ay * bz - az * by;\r\n this.y = ay * bw + aw * by + az * bx - ax * bz;\r\n this.z = az * bw + aw * bz + ax * by - ay * bx;\r\n this.w = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#slerp\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards.\r\n * @param {number} t - The percentage of interpolation.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n slerp: function (b, t)\r\n {\r\n // benchmarks: http://jsperf.com/quaternion-slerp-implementations\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n var bw = b.w;\r\n\r\n // calc cosine\r\n var cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n\r\n // adjust signs (if necessary)\r\n if (cosom < 0)\r\n {\r\n cosom = -cosom;\r\n bx = - bx;\r\n by = - by;\r\n bz = - bz;\r\n bw = - bw;\r\n }\r\n\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n var scale0 = 1 - t;\r\n var scale1 = t;\r\n\r\n // calculate coefficients\r\n if ((1 - cosom) > EPSILON)\r\n {\r\n // standard case (slerp)\r\n var omega = Math.acos(cosom);\r\n var sinom = Math.sin(omega);\r\n\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n }\r\n\r\n // calculate final values\r\n this.x = scale0 * ax + scale1 * bx;\r\n this.y = scale0 * ay + scale1 * by;\r\n this.z = scale0 * az + scale1 * bz;\r\n this.w = scale0 * aw + scale1 * bw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n invert: function ()\r\n {\r\n var a0 = this.x;\r\n var a1 = this.y;\r\n var a2 = this.z;\r\n var a3 = this.w;\r\n\r\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n var invDot = (dot) ? 1 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n this.x = -a0 * invDot;\r\n this.y = -a1 * invDot;\r\n this.z = -a2 * invDot;\r\n this.w = a3 * invDot;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Convert this Quaternion into its conjugate.\r\n *\r\n * Sets the x, y and z components.\r\n *\r\n * @method Phaser.Math.Quaternion#conjugate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n conjugate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the X axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateX: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw + aw * bx;\r\n this.y = ay * bw + az * bx;\r\n this.z = az * bw - ay * bx;\r\n this.w = aw * bw - ax * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the Y axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateY: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var by = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw - az * by;\r\n this.y = ay * bw + aw * by;\r\n this.z = az * bw + ax * by;\r\n this.w = aw * bw - ay * by;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the Z axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateZ: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bz = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw + ay * bz;\r\n this.y = ay * bw - ax * bz;\r\n this.z = az * bw + aw * bz;\r\n this.w = aw * bw - az * bz;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Create a unit (or rotation) Quaternion from its x, y, and z components.\r\n *\r\n * Sets the w component.\r\n *\r\n * @method Phaser.Math.Quaternion#calculateW\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n calculateW: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n this.w = -Math.sqrt(1.0 - x * x - y * y - z * z);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Convert the given Matrix into this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#fromMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n fromMat3: function (mat)\r\n {\r\n // benchmarks:\r\n // http://jsperf.com/typed-array-access-speed\r\n // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion\r\n\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n var m = mat.val;\r\n var fTrace = m[0] + m[4] + m[8];\r\n var fRoot;\r\n\r\n if (fTrace > 0)\r\n {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n\r\n this.w = 0.5 * fRoot;\r\n\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n\r\n this.x = (m[7] - m[5]) * fRoot;\r\n this.y = (m[2] - m[6]) * fRoot;\r\n this.z = (m[3] - m[1]) * fRoot;\r\n }\r\n else\r\n {\r\n // |w| <= 1/2\r\n var i = 0;\r\n\r\n if (m[4] > m[0])\r\n {\r\n i = 1;\r\n }\r\n\r\n if (m[8] > m[i * 3 + i])\r\n {\r\n i = 2;\r\n }\r\n\r\n var j = siNext[i];\r\n var k = siNext[j];\r\n\r\n // This isn't quite as clean without array access\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\r\n tmp[i] = 0.5 * fRoot;\r\n\r\n fRoot = 0.5 / fRoot;\r\n\r\n tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n\r\n this.x = tmp[0];\r\n this.y = tmp[1];\r\n this.z = tmp[2];\r\n this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Quaternion;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\n\r\n/**\r\n * Convert the given angle in radians, to the equivalent angle in degrees.\r\n *\r\n * @function Phaser.Math.RadToDeg\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The angle in radians to convert ot degrees.\r\n *\r\n * @return {integer} The given angle converted to degrees.\r\n */\r\nvar RadToDeg = function (radians)\r\n{\r\n return radians * CONST.RAD_TO_DEG;\r\n};\r\n\r\nmodule.exports = RadToDeg;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random unit vector.\r\n *\r\n * Computes random values for the given vector between -1 and 1 that can be used to represent a direction.\r\n *\r\n * Optionally accepts a scale value to scale the resulting vector by.\r\n *\r\n * @function Phaser.Math.RandomXY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for.\r\n * @param {number} [scale=1] - The scale of the random values.\r\n *\r\n * @return {Phaser.Math.Vector2} The given Vector.\r\n */\r\nvar RandomXY = function (vector, scale)\r\n{\r\n if (scale === undefined) { scale = 1; }\r\n\r\n var r = Math.random() * 2 * Math.PI;\r\n\r\n vector.x = Math.cos(r) * scale;\r\n vector.y = Math.sin(r) * scale;\r\n\r\n return vector;\r\n};\r\n\r\nmodule.exports = RandomXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random position vector in a spherical area, optionally defined by the given radius.\r\n *\r\n * @function Phaser.Math.RandomXYZ\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for.\r\n * @param {number} [radius=1] - The radius.\r\n *\r\n * @return {Phaser.Math.Vector3} The given Vector.\r\n */\r\nvar RandomXYZ = function (vec3, radius)\r\n{\r\n if (radius === undefined) { radius = 1; }\r\n\r\n var r = Math.random() * 2 * Math.PI;\r\n var z = (Math.random() * 2) - 1;\r\n var zScale = Math.sqrt(1 - z * z) * radius;\r\n\r\n vec3.x = Math.cos(r) * zScale;\r\n vec3.y = Math.sin(r) * zScale;\r\n vec3.z = z * radius;\r\n\r\n return vec3;\r\n};\r\n\r\nmodule.exports = RandomXYZ;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random four-dimensional vector.\r\n *\r\n * @function Phaser.Math.RandomXYZW\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for.\r\n * @param {number} [scale=1] - The scale of the random values.\r\n *\r\n * @return {Phaser.Math.Vector4} The given Vector.\r\n */\r\nvar RandomXYZW = function (vec4, scale)\r\n{\r\n if (scale === undefined) { scale = 1; }\r\n\r\n // TODO: Not spherical; should fix this for more uniform distribution\r\n vec4.x = (Math.random() * 2 - 1) * scale;\r\n vec4.y = (Math.random() * 2 - 1) * scale;\r\n vec4.z = (Math.random() * 2 - 1) * scale;\r\n vec4.w = (Math.random() * 2 - 1) * scale;\r\n\r\n return vec4;\r\n};\r\n\r\nmodule.exports = RandomXYZW;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction.\r\n *\r\n * @function Phaser.Math.Rotate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} angle - The angle to be rotated by in an anticlockwise direction.\r\n *\r\n * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction.\r\n */\r\nvar Rotate = function (point, angle)\r\n{\r\n var x = point.x;\r\n var y = point.y;\r\n\r\n point.x = (x * Math.cos(angle)) - (y * Math.sin(angle));\r\n point.y = (x * Math.sin(angle)) + (y * Math.cos(angle));\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = Rotate;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a `point` around `x` and `y` by the given `angle`.\r\n *\r\n * @function Phaser.Math.RotateAround\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} x - The horizontal coordinate to rotate around.\r\n * @param {number} y - The vertical coordinate to rotate around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Geom.Point} The given point, rotated by the given angle around the given coordinates.\r\n */\r\nvar RotateAround = function (point, x, y, angle)\r\n{\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n\r\n var tx = point.x - x;\r\n var ty = point.y - y;\r\n\r\n point.x = tx * c - ty * s + x;\r\n point.y = tx * s + ty * c + y;\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = RotateAround;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a `point` around `x` and `y` by the given `angle` and `distance`.\r\n *\r\n * @function Phaser.Math.RotateAroundDistance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} x - The horizontal coordinate to rotate around.\r\n * @param {number} y - The vertical coordinate to rotate around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n * @param {number} distance - The distance from (x, y) to place the point at.\r\n *\r\n * @return {Phaser.Geom.Point} The given point.\r\n */\r\nvar RotateAroundDistance = function (point, x, y, angle, distance)\r\n{\r\n var t = angle + Math.atan2(point.y - y, point.x - x);\r\n\r\n point.x = x + (distance * Math.cos(t));\r\n point.y = y + (distance * Math.sin(t));\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = RotateAroundDistance;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector3 = require('../math/Vector3');\r\nvar Matrix4 = require('../math/Matrix4');\r\nvar Quaternion = require('../math/Quaternion');\r\n\r\nvar tmpMat4 = new Matrix4();\r\nvar tmpQuat = new Quaternion();\r\nvar tmpVec3 = new Vector3();\r\n\r\n/**\r\n * Rotates a vector in place by axis angle.\r\n *\r\n * This is the same as transforming a point by an\r\n * axis-angle quaternion, but it has higher precision.\r\n *\r\n * @function Phaser.Math.RotateVec3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec - The vector to be rotated.\r\n * @param {Phaser.Math.Vector3} axis - The axis to rotate around.\r\n * @param {number} radians - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Math.Vector3} The given vector.\r\n */\r\nvar RotateVec3 = function (vec, axis, radians)\r\n{\r\n // Set the quaternion to our axis angle\r\n tmpQuat.setAxisAngle(axis, radians);\r\n\r\n // Create a rotation matrix from the axis angle\r\n tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0));\r\n\r\n // Multiply our vector by the rotation matrix\r\n return vec.transformMat4(tmpMat4);\r\n};\r\n\r\nmodule.exports = RotateVec3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down.\r\n *\r\n * @function Phaser.Math.RoundAwayFromZero\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to round.\r\n *\r\n * @return {number} The rounded number, rounded away from zero.\r\n */\r\nvar RoundAwayFromZero = function (value)\r\n{\r\n // \"Opposite\" of truncate.\r\n return (value > 0) ? Math.ceil(value) : Math.floor(value);\r\n};\r\n\r\nmodule.exports = RoundAwayFromZero;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Round a value to the given precision.\r\n * \r\n * For example:\r\n * \r\n * ```javascript\r\n * RoundTo(123.456, 0) = 123\r\n * RoundTo(123.456, 1) = 120\r\n * RoundTo(123.456, 2) = 100\r\n * ```\r\n * \r\n * To round the decimal, i.e. to round to precision, pass in a negative `place`:\r\n * \r\n * ```javascript\r\n * RoundTo(123.456789, 0) = 123\r\n * RoundTo(123.456789, -1) = 123.5\r\n * RoundTo(123.456789, -2) = 123.46\r\n * RoundTo(123.456789, -3) = 123.457\r\n * ```\r\n *\r\n * @function Phaser.Math.RoundTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar RoundTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.round(value * p) / p;\r\n};\r\n\r\nmodule.exports = RoundTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Generate a series of sine and cosine values.\r\n *\r\n * @function Phaser.Math.SinCosTableGenerator\r\n * @since 3.0.0\r\n *\r\n * @param {number} length - The number of values to generate.\r\n * @param {number} [sinAmp=1] - The sine value amplitude.\r\n * @param {number} [cosAmp=1] - The cosine value amplitude.\r\n * @param {number} [frequency=1] - The frequency of the values.\r\n *\r\n * @return {Phaser.Types.Math.SinCosTable} The generated values.\r\n */\r\nvar SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency)\r\n{\r\n if (sinAmp === undefined) { sinAmp = 1; }\r\n if (cosAmp === undefined) { cosAmp = 1; }\r\n if (frequency === undefined) { frequency = 1; }\r\n\r\n frequency *= Math.PI / length;\r\n\r\n var cos = [];\r\n var sin = [];\r\n\r\n for (var c = 0; c < length; c++)\r\n {\r\n cosAmp -= sinAmp * frequency;\r\n sinAmp += cosAmp * frequency;\r\n\r\n cos[c] = cosAmp;\r\n sin[c] = sinAmp;\r\n }\r\n\r\n return {\r\n sin: sin,\r\n cos: cos,\r\n length: length\r\n };\r\n};\r\n\r\nmodule.exports = SinCosTableGenerator;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a smooth interpolation percentage of `x` between `min` and `max`.\r\n *\r\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\r\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\r\n * between 0 and 1 otherwise.\r\n *\r\n * @function Phaser.Math.SmoothStep\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\r\n *\r\n * @param {number} x - The input value.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The percentage of interpolation, between 0 and 1.\r\n */\r\nvar SmoothStep = function (x, min, max)\r\n{\r\n if (x <= min)\r\n {\r\n return 0;\r\n }\r\n\r\n if (x >= max)\r\n {\r\n return 1;\r\n }\r\n\r\n x = (x - min) / (max - min);\r\n\r\n return x * x * (3 - 2 * x);\r\n};\r\n\r\nmodule.exports = SmoothStep;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a smoother interpolation percentage of `x` between `min` and `max`.\r\n *\r\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\r\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\r\n * between 0 and 1 otherwise.\r\n *\r\n * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}.\r\n *\r\n * @function Phaser.Math.SmootherStep\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\r\n *\r\n * @param {number} x - The input value.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The percentage of interpolation, between 0 and 1.\r\n */\r\nvar SmootherStep = function (x, min, max)\r\n{\r\n x = Math.max(0, Math.min(1, (x - min) / (max - min)));\r\n\r\n return x * x * x * (x * (x * 6 - 15) + 10);\r\n};\r\n\r\nmodule.exports = SmootherStep;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = require('./Vector2');\r\n\r\n/**\r\n * Returns a Vec2 containing the x and y position of the given index in a `width` x `height` sized grid.\r\n * \r\n * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2.\r\n * \r\n * If the given index is out of range an empty Vec2 is returned.\r\n *\r\n * @function Phaser.Math.ToXY\r\n * @since 3.19.0\r\n *\r\n * @param {integer} index - The position within the grid to get the x/y value for.\r\n * @param {integer} width - The width of the grid.\r\n * @param {integer} height - The height of the grid.\r\n * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index.\r\n */\r\nvar ToXY = function (index, width, height, out)\r\n{\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var x = 0;\r\n var y = 0;\r\n var total = width * height;\r\n\r\n if (index > 0 && index <= total)\r\n {\r\n if (index > width - 1)\r\n {\r\n y = Math.floor(index / width);\r\n x = index - (y * width);\r\n }\r\n else\r\n {\r\n x = index;\r\n }\r\n\r\n out.set(x, y);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ToXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = require('./Vector2');\r\n\r\n/**\r\n * Takes the `x` and `y` coordinates and transforms them into the same space as\r\n * defined by the position, rotation and scale values.\r\n *\r\n * @function Phaser.Math.TransformXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to be transformed.\r\n * @param {number} y - The y coordinate to be transformed.\r\n * @param {number} positionX - Horizontal position of the transform point.\r\n * @param {number} positionY - Vertical position of the transform point.\r\n * @param {number} rotation - Rotation of the transform point, in radians.\r\n * @param {number} scaleX - Horizontal scale of the transform point.\r\n * @param {number} scaleY - Vertical scale of the transform point.\r\n * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point.\r\n */\r\nvar TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output)\r\n{\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var radianSin = Math.sin(rotation);\r\n var radianCos = Math.cos(rotation);\r\n\r\n // Rotate and Scale\r\n var a = radianCos * scaleX;\r\n var b = radianSin * scaleX;\r\n var c = -radianSin * scaleY;\r\n var d = radianCos * scaleY;\r\n\r\n // Invert\r\n var id = 1 / ((a * d) + (c * -b));\r\n\r\n output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id);\r\n output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id);\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = TransformXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 2D space.\r\n *\r\n * A two-component vector.\r\n *\r\n * @class Vector2\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties.\r\n * @param {number} [y] - The y component.\r\n */\r\nvar Vector2 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector2 (x, y)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n }\r\n else\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector2.\r\n *\r\n * @method Phaser.Math.Vector2#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} A clone of this Vector2.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector2(this.x, this.y);\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x || 0;\r\n this.y = src.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the component values of this Vector from a given Vector2Like object.\r\n *\r\n * @method Phaser.Math.Vector2#setFromObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setFromObject: function (obj)\r\n {\r\n this.x = obj.x || 0;\r\n this.y = obj.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x` and `y` components of the this Vector to the given `x` and `y` values.\r\n *\r\n * @method Phaser.Math.Vector2#set\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n set: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This method is an alias for `Vector2.set`.\r\n *\r\n * @method Phaser.Math.Vector2#setTo\r\n * @since 3.4.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setTo: function (x, y)\r\n {\r\n return this.set(x, y);\r\n },\r\n\r\n /**\r\n * Sets the `x` and `y` values of this object from a given polar coordinate.\r\n *\r\n * @method Phaser.Math.Vector2#setToPolar\r\n * @since 3.0.0\r\n *\r\n * @param {number} azimuth - The angular coordinate, in radians.\r\n * @param {number} [radius=1] - The radial coordinate (length).\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setToPolar: function (azimuth, radius)\r\n {\r\n if (radius == null) { radius = 1; }\r\n\r\n this.x = Math.cos(azimuth) * radius;\r\n this.y = Math.sin(azimuth) * radius;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict equality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector2#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} v - The vector to compare with this Vector.\r\n *\r\n * @return {boolean} Whether the given Vector is equal to this Vector.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y));\r\n },\r\n\r\n /**\r\n * Calculate the angle between this Vector and the positive x-axis, in radians.\r\n *\r\n * @method Phaser.Math.Vector2#angle\r\n * @since 3.0.0\r\n *\r\n * @return {number} The angle between this Vector, and the positive x-axis, given in radians.\r\n */\r\n angle: function ()\r\n {\r\n // computes the angle in radians with respect to the positive x-axis\r\n\r\n var angle = Math.atan2(this.y, this.x);\r\n\r\n if (angle < 0)\r\n {\r\n angle += 2 * Math.PI;\r\n }\r\n\r\n return angle;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#add\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n add: function (src)\r\n {\r\n this.x += src.x;\r\n this.y += src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n subtract: function (src)\r\n {\r\n this.x -= src.x;\r\n this.y -= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n multiply: function (src)\r\n {\r\n this.x *= src.x;\r\n this.y *= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector2#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n scale: function (value)\r\n {\r\n if (isFinite(value))\r\n {\r\n this.x *= value;\r\n this.y *= value;\r\n }\r\n else\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#divide\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n divide: function (src)\r\n {\r\n this.x /= src.x;\r\n this.y /= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Negate the `x` and `y` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#distance\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector2#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return dx * dx + dy * dy;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return Math.sqrt(x * x + y * y);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector2#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return x * x + y * y;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector2#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var len = x * x + y * y;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Right-hand normalize (make unit length) this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#normalizeRightHand\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalizeRightHand: function ()\r\n {\r\n var x = this.x;\r\n\r\n this.x = this.y * -1;\r\n this.y = x;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to dot product with this Vector2.\r\n *\r\n * @return {number} The dot product of this Vector and the given Vector.\r\n */\r\n dot: function (src)\r\n {\r\n return this.x * src.x + this.y * src.y;\r\n },\r\n\r\n /**\r\n * Calculate the cross product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#cross\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to cross with this Vector2.\r\n *\r\n * @return {number} The cross product of this Vector and the given Vector.\r\n */\r\n cross: function (src)\r\n {\r\n return this.x * src.y - this.y * src.x;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n lerp: function (src, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n\r\n this.x = ax + t * (src.x - ax);\r\n this.y = ay + t * (src.y - ay);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat3: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[3] * y + m[6];\r\n this.y = m[1] * x + m[4] * y + m[7];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[12];\r\n this.y = m[1] * x + m[5] * y + m[13];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0).\r\n *\r\n * @method Phaser.Math.Vector2#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A static zero Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ZERO\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.1.0\r\n */\r\nVector2.ZERO = new Vector2();\r\n\r\n/**\r\n * A static right Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.RIGHT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.RIGHT = new Vector2(1, 0);\r\n\r\n/**\r\n * A static left Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.LEFT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.LEFT = new Vector2(-1, 0);\r\n\r\n/**\r\n * A static up Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.UP\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.UP = new Vector2(0, -1);\r\n\r\n/**\r\n * A static down Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.DOWN\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.DOWN = new Vector2(0, 1);\r\n\r\n/**\r\n * A static one Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ONE\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.ONE = new Vector2(1, 1);\r\n\r\nmodule.exports = Vector2;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 3D space.\r\n *\r\n * A three-component vector.\r\n *\r\n * @class Vector3\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n */\r\nvar Vector3 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector3 (x, y, z)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The z component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.z = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Set this Vector to point up.\r\n *\r\n * Sets the y component of the vector to 1, and the others to 0.\r\n *\r\n * @method Phaser.Math.Vector3#up\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n up: function ()\r\n {\r\n this.x = 0;\r\n this.y = 1;\r\n this.z = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector3.\r\n *\r\n * @method Phaser.Math.Vector3#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector3(this.x, this.y, this.z);\r\n },\r\n\r\n /**\r\n * Calculate the cross (vector) product of two given Vectors.\r\n *\r\n * @method Phaser.Math.Vector3#crossVectors\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} a - The first Vector to multiply.\r\n * @param {Phaser.Math.Vector3} b - The second Vector to multiply.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n crossVectors: function (a, b)\r\n {\r\n var ax = a.x;\r\n var ay = a.y;\r\n var az = a.z;\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n\r\n this.x = ay * bz - az * by;\r\n this.y = az * bx - ax * bz;\r\n this.z = ax * by - ay * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict equality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector3#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to compare against.\r\n *\r\n * @return {boolean} True if the two vectors strictly match, otherwise false.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z));\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#copy\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values.\r\n *\r\n * @method Phaser.Math.Vector3#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components.\r\n * @param {number} [y] - The y value to set for this Vector.\r\n * @param {number} [z] - The z value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n set: function (x, y, z)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector3#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector3#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n multiply: function (v)\r\n {\r\n this.x *= v.x;\r\n this.y *= v.y;\r\n this.z *= v.z || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector3#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n scale: function (scale)\r\n {\r\n if (isFinite(scale))\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n }\r\n else\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#divide\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n divide: function (v)\r\n {\r\n this.x /= v.x;\r\n this.y /= v.y;\r\n this.z /= v.z || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Negate the `x`, `y` and `z` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#distance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n\r\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector3#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n\r\n return dx * dx + dy * dy + dz * dz;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n return Math.sqrt(x * x + y * y + z * z);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector3#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n return x * x + y * y + z * z;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector3#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var len = x * x + y * y + z * z;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3.\r\n *\r\n * @return {number} The dot product of this Vector and `v`.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z;\r\n },\r\n\r\n /**\r\n * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#cross\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector to cross product with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n cross: function (v)\r\n {\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var bx = v.x;\r\n var by = v.y;\r\n var bz = v.z;\r\n\r\n this.x = ay * bz - az * by;\r\n this.y = az * bx - ax * bz;\r\n this.z = ax * by - ay * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector3#transformMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformMat3: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n this.x = x * m[0] + y * m[3] + z * m[6];\r\n this.y = x * m[1] + y * m[4] + z * m[7];\r\n this.z = x * m[2] + y * m[5] + z * m[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector3#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12];\r\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13];\r\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transforms the coordinates of this Vector3 with the given Matrix4.\r\n *\r\n * @method Phaser.Math.Vector3#transformCoordinates\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformCoordinates: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12];\r\n var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13];\r\n var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14];\r\n var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15];\r\n\r\n this.x = tx / tw;\r\n this.y = ty / tw;\r\n this.z = tz / tw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Quaternion.\r\n *\r\n * @method Phaser.Math.Vector3#transformQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformQuat: function (q)\r\n {\r\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var qx = q.x;\r\n var qy = q.y;\r\n var qz = q.z;\r\n var qw = q.w;\r\n\r\n // calculate quat * vec\r\n var ix = qw * x + qy * z - qz * y;\r\n var iy = qw * y + qz * x - qx * z;\r\n var iz = qw * z + qx * y - qy * x;\r\n var iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection,\r\n * e.g. unprojecting a 2D point into 3D space.\r\n *\r\n * @method Phaser.Math.Vector3#project\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n project: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n var a00 = m[0];\r\n var a01 = m[1];\r\n var a02 = m[2];\r\n var a03 = m[3];\r\n var a10 = m[4];\r\n var a11 = m[5];\r\n var a12 = m[6];\r\n var a13 = m[7];\r\n var a20 = m[8];\r\n var a21 = m[9];\r\n var a22 = m[10];\r\n var a23 = m[11];\r\n var a30 = m[12];\r\n var a31 = m[13];\r\n var a32 = m[14];\r\n var a33 = m[15];\r\n\r\n var lw = 1 / (x * a03 + y * a13 + z * a23 + a33);\r\n\r\n this.x = (x * a00 + y * a10 + z * a20 + a30) * lw;\r\n this.y = (x * a01 + y * a11 + z * a21 + a31) * lw;\r\n this.z = (x * a02 + y * a12 + z * a22 + a32) * lw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Unproject this point from 2D space to 3D space.\r\n * The point should have its x and y properties set to\r\n * 2D screen space, and the z either at 0 (near plane)\r\n * or 1 (far plane). The provided matrix is assumed to already\r\n * be combined, i.e. projection * view * model.\r\n *\r\n * After this operation, this vector's (x, y, z) components will\r\n * represent the unprojected 3D coordinate.\r\n *\r\n * @method Phaser.Math.Vector3#unproject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels.\r\n * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n unproject: function (viewport, invProjectionView)\r\n {\r\n var viewX = viewport.x;\r\n var viewY = viewport.y;\r\n var viewWidth = viewport.z;\r\n var viewHeight = viewport.w;\r\n\r\n var x = this.x - viewX;\r\n var y = (viewHeight - this.y - 1) - viewY;\r\n var z = this.z;\r\n\r\n this.x = (2 * x) / viewWidth - 1;\r\n this.y = (2 * y) / viewHeight - 1;\r\n this.z = 2 * z - 1;\r\n\r\n return this.project(invProjectionView);\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0, 0).\r\n *\r\n * @method Phaser.Math.Vector3#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A static zero Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.ZERO\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.ZERO = new Vector3();\r\n\r\n/**\r\n * A static right Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.RIGHT\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.RIGHT = new Vector3(1, 0, 0);\r\n\r\n/**\r\n * A static left Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.LEFT\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.LEFT = new Vector3(-1, 0, 0);\r\n\r\n/**\r\n * A static up Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.UP\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.UP = new Vector3(0, -1, 0);\r\n\r\n/**\r\n * A static down Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.DOWN\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.DOWN = new Vector3(0, 1, 0);\r\n\r\n/**\r\n * A static forward Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.FORWARD\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.FORWARD = new Vector3(0, 0, 1);\r\n\r\n/**\r\n * A static back Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.BACK\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.BACK = new Vector3(0, 0, -1);\r\n\r\n/**\r\n * A static one Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.ONE\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.ONE = new Vector3(1, 1, 1);\r\n\r\nmodule.exports = Vector3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 4D space.\r\n *\r\n * A four-component vector.\r\n *\r\n * @class Vector4\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n * @param {number} [w] - The w component.\r\n */\r\nvar Vector4 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector4 (x, y, z, w)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The z component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.z = 0;\r\n\r\n /**\r\n * The w component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.w = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector4.\r\n *\r\n * @method Phaser.Math.Vector4#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} A clone of this Vector4.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector4(this.x, this.y, this.z, this.w);\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z || 0;\r\n this.w = src.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict quality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector4#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The vector to check equality with.\r\n *\r\n * @return {boolean} A boolean indicating whether the two Vectors are equal or not.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w));\r\n },\r\n\r\n /**\r\n * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values.\r\n *\r\n * @method Phaser.Math.Vector4#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components.\r\n * @param {number} y - The y value to set for this Vector.\r\n * @param {number} z - The z value to set for this Vector.\r\n * @param {number} w - The z value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n set: function (x, y, z, w)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector4#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z || 0;\r\n this.w += v.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector4#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z || 0;\r\n this.w -= v.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector4#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n scale: function (scale)\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector4#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector4#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var len = x * x + y * y + z * z + w * w;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n this.w = w * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4.\r\n *\r\n * @return {number} The dot product of this Vector and the given Vector.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n this.w = aw + t * (v.w - aw);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n multiply: function (v)\r\n {\r\n this.x *= v.x;\r\n this.y *= v.y;\r\n this.z *= v.z || 1;\r\n this.w *= v.w || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#divide\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n divide: function (v)\r\n {\r\n this.x /= v.x;\r\n this.y /= v.y;\r\n this.z /= v.z || 1;\r\n this.w /= v.w || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#distance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n var dw = v.w - this.w || 0;\r\n\r\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector4#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n var dw = v.w - this.w || 0;\r\n\r\n return dx * dx + dy * dy + dz * dz + dw * dw;\r\n },\r\n\r\n /**\r\n * Negate the `x`, `y`, `z` and `w` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n this.w = -this.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector4#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Quaternion.\r\n *\r\n * @method Phaser.Math.Vector4#transformQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n transformQuat: function (q)\r\n {\r\n // TODO: is this really the same as Vector3?\r\n // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/\r\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var qx = q.x;\r\n var qy = q.y;\r\n var qz = q.z;\r\n var qw = q.w;\r\n\r\n // calculate quat * vec\r\n var ix = qw * x + qy * z - qz * y;\r\n var iy = qw * y + qz * x - qx * z;\r\n var iz = qw * z + qx * y - qy * x;\r\n var iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0, 0, 0).\r\n *\r\n * @method Phaser.Math.Vector4#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n// TODO: Check if these are required internally, if not, remove.\r\nVector4.prototype.sub = Vector4.prototype.subtract;\r\nVector4.prototype.mul = Vector4.prototype.multiply;\r\nVector4.prototype.div = Vector4.prototype.divide;\r\nVector4.prototype.dist = Vector4.prototype.distance;\r\nVector4.prototype.distSq = Vector4.prototype.distanceSq;\r\nVector4.prototype.len = Vector4.prototype.length;\r\nVector4.prototype.lenSq = Vector4.prototype.lengthSq;\r\n\r\nmodule.exports = Vector4;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the two values are within the given `tolerance` of each other.\r\n *\r\n * @function Phaser.Math.Within\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value to use in the calculation.\r\n * @param {number} b - The second value to use in the calculation.\r\n * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range.\r\n *\r\n * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`.\r\n */\r\nvar Within = function (a, b, tolerance)\r\n{\r\n return (Math.abs(a - b) <= tolerance);\r\n};\r\n\r\nmodule.exports = Within;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Wrap the given `value` between `min` and `max.\r\n *\r\n * @function Phaser.Math.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to wrap.\r\n * @param {number} min - The minimum value.\r\n * @param {number} max - The maximum value.\r\n *\r\n * @return {number} The wrapped value.\r\n */\r\nvar Wrap = function (value, min, max)\r\n{\r\n var range = max - min;\r\n\r\n return (min + ((((value - min) % range) + range) % range));\r\n};\r\n\r\nmodule.exports = Wrap;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\r\n *\r\n * @function Phaser.Math.Angle.Between\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar Between = function (x1, y1, x2, y2)\r\n{\r\n return Math.atan2(y2 - y1, x2 - x1);\r\n};\r\n\r\nmodule.exports = Between;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\r\n *\r\n * Calculates the angle of the vector from the first point to the second point.\r\n *\r\n * @function Phaser.Math.Angle.BetweenPoints\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point1 - The first point.\r\n * @param {(Phaser.Geom.Point|object)} point2 - The second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenPoints = function (point1, point2)\r\n{\r\n return Math.atan2(point2.y - point1.y, point2.x - point1.x);\r\n};\r\n\r\nmodule.exports = BetweenPoints;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\r\n *\r\n * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate\r\n * travels down the screen.\r\n *\r\n * @function Phaser.Math.Angle.BetweenPointsY\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point1 - The first point.\r\n * @param {(Phaser.Geom.Point|object)} point2 - The second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenPointsY = function (point1, point2)\r\n{\r\n return Math.atan2(point2.x - point1.x, point2.y - point1.y);\r\n};\r\n\r\nmodule.exports = BetweenPointsY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\r\n *\r\n * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate\r\n * travels down the screen.\r\n *\r\n * @function Phaser.Math.Angle.BetweenY\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenY = function (x1, y1, x2, y2)\r\n{\r\n return Math.atan2(x2 - x1, y2 - y1);\r\n};\r\n\r\nmodule.exports = BetweenY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('../const');\r\n\r\n/**\r\n * Takes an angle in Phasers default clockwise format and converts it so that\r\n * 0 is North, 90 is West, 180 is South and 270 is East,\r\n * therefore running counter-clockwise instead of clockwise.\r\n * \r\n * You can pass in the angle from a Game Object using:\r\n * \r\n * ```javascript\r\n * var converted = CounterClockwise(gameobject.rotation);\r\n * ```\r\n * \r\n * All values for this function are in radians.\r\n *\r\n * @function Phaser.Math.Angle.CounterClockwise\r\n * @since 3.16.0\r\n *\r\n * @param {number} angle - The angle to convert, in radians.\r\n *\r\n * @return {number} The converted angle, in radians.\r\n */\r\nvar CounterClockwise = function (angle)\r\n{\r\n if (angle > Math.PI)\r\n {\r\n angle -= CONST.PI2;\r\n }\r\n\r\n return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2);\r\n};\r\n\r\nmodule.exports = CounterClockwise;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Normalize an angle to the [0, 2pi] range.\r\n *\r\n * @function Phaser.Math.Angle.Normalize\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to normalize, in radians.\r\n *\r\n * @return {number} The normalized angle, in radians.\r\n */\r\nvar Normalize = function (angle)\r\n{\r\n angle = angle % (2 * Math.PI);\r\n\r\n if (angle >= 0)\r\n {\r\n return angle;\r\n }\r\n else\r\n {\r\n return angle + 2 * Math.PI;\r\n }\r\n};\r\n\r\nmodule.exports = Normalize;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Normalize = require('./Normalize');\r\n\r\n/**\r\n * Reverse the given angle.\r\n *\r\n * @function Phaser.Math.Angle.Reverse\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to reverse, in radians.\r\n *\r\n * @return {number} The reversed angle, in radians.\r\n */\r\nvar Reverse = function (angle)\r\n{\r\n return Normalize(angle + Math.PI);\r\n};\r\n\r\nmodule.exports = Reverse;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = require('../const');\r\n\r\n/**\r\n * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call.\r\n *\r\n * @function Phaser.Math.Angle.RotateTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} currentAngle - The current angle, in radians.\r\n * @param {number} targetAngle - The target angle to rotate to, in radians.\r\n * @param {number} [lerp=0.05] - The lerp value to add to the current angle.\r\n *\r\n * @return {number} The adjusted angle.\r\n */\r\nvar RotateTo = function (currentAngle, targetAngle, lerp)\r\n{\r\n if (lerp === undefined) { lerp = 0.05; }\r\n\r\n if (currentAngle === targetAngle)\r\n {\r\n return currentAngle;\r\n }\r\n\r\n if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp))\r\n {\r\n currentAngle = targetAngle;\r\n }\r\n else\r\n {\r\n if (Math.abs(targetAngle - currentAngle) > Math.PI)\r\n {\r\n if (targetAngle < currentAngle)\r\n {\r\n targetAngle += MATH_CONST.PI2;\r\n }\r\n else\r\n {\r\n targetAngle -= MATH_CONST.PI2;\r\n }\r\n }\r\n\r\n if (targetAngle > currentAngle)\r\n {\r\n currentAngle += lerp;\r\n }\r\n else if (targetAngle < currentAngle)\r\n {\r\n currentAngle -= lerp;\r\n }\r\n }\r\n\r\n return currentAngle;\r\n};\r\n\r\nmodule.exports = RotateTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Gets the shortest angle between `angle1` and `angle2`.\r\n *\r\n * Both angles must be in the range -180 to 180, which is the same clamped\r\n * range that `sprite.angle` uses, so you can pass in two sprite angles to\r\n * this method and get the shortest angle back between the two of them.\r\n *\r\n * The angle returned will be in the same range. If the returned angle is\r\n * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's\r\n * a clockwise rotation.\r\n *\r\n * TODO: Wrap the angles in this function?\r\n *\r\n * @function Phaser.Math.Angle.ShortestBetween\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle1 - The first angle in the range -180 to 180.\r\n * @param {number} angle2 - The second angle in the range -180 to 180.\r\n *\r\n * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation.\r\n */\r\nvar ShortestBetween = function (angle1, angle2)\r\n{\r\n var difference = angle2 - angle1;\r\n\r\n if (difference === 0)\r\n {\r\n return 0;\r\n }\r\n\r\n var times = Math.floor((difference - (-180)) / 360);\r\n\r\n return difference - (times * 360);\r\n\r\n};\r\n\r\nmodule.exports = ShortestBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MathWrap = require('../Wrap');\r\n\r\n/**\r\n * Wrap an angle.\r\n *\r\n * Wraps the angle to a value in the range of -PI to PI.\r\n *\r\n * @function Phaser.Math.Angle.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in radians.\r\n *\r\n * @return {number} The wrapped angle, in radians.\r\n */\r\nvar Wrap = function (angle)\r\n{\r\n return MathWrap(angle, -Math.PI, Math.PI);\r\n};\r\n\r\nmodule.exports = Wrap;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Wrap = require('../Wrap');\r\n\r\n/**\r\n * Wrap an angle in degrees.\r\n *\r\n * Wraps the angle to a value in the range of -180 to 180.\r\n *\r\n * @function Phaser.Math.Angle.WrapDegrees\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in degrees.\r\n *\r\n * @return {number} The wrapped angle, in degrees.\r\n */\r\nvar WrapDegrees = function (angle)\r\n{\r\n return Wrap(angle, -180, 180);\r\n};\r\n\r\nmodule.exports = WrapDegrees;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Angle\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Between: require('./Between'),\r\n BetweenPoints: require('./BetweenPoints'),\r\n BetweenPointsY: require('./BetweenPointsY'),\r\n BetweenY: require('./BetweenY'),\r\n CounterClockwise: require('./CounterClockwise'),\r\n Normalize: require('./Normalize'),\r\n Reverse: require('./Reverse'),\r\n RotateTo: require('./RotateTo'),\r\n ShortestBetween: require('./ShortestBetween'),\r\n Wrap: require('./Wrap'),\r\n WrapDegrees: require('./WrapDegrees')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = {\r\n\r\n /**\r\n * The value of PI * 2.\r\n * \r\n * @name Phaser.Math.PI2\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n PI2: Math.PI * 2,\r\n\r\n /**\r\n * The value of PI * 0.5.\r\n * \r\n * @name Phaser.Math.TAU\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n TAU: Math.PI * 0.5,\r\n\r\n /**\r\n * An epsilon value (1.0e-6)\r\n * \r\n * @name Phaser.Math.EPSILON\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n EPSILON: 1.0e-6,\r\n\r\n /**\r\n * For converting degrees to radians (PI / 180)\r\n * \r\n * @name Phaser.Math.DEG_TO_RAD\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n DEG_TO_RAD: Math.PI / 180,\r\n\r\n /**\r\n * For converting radians to degrees (180 / PI)\r\n * \r\n * @name Phaser.Math.RAD_TO_DEG\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n RAD_TO_DEG: 180 / Math.PI,\r\n\r\n /**\r\n * An instance of the Random Number Generator.\r\n * This is not set until the Game boots.\r\n * \r\n * @name Phaser.Math.RND\r\n * @type {Phaser.Math.RandomDataGenerator}\r\n * @since 3.0.0\r\n */\r\n RND: null\r\n\r\n};\r\n\r\nmodule.exports = MATH_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points).\r\n *\r\n * @function Phaser.Math.Distance.Between\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar DistanceBetween = function (x1, y1, x2, y2)\r\n{\r\n var dx = x1 - x2;\r\n var dy = y1 - y2;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n};\r\n\r\nmodule.exports = DistanceBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points) to the power of `pow`.\r\n *\r\n * @function Phaser.Math.Distance.Power\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n * @param {number} pow - The exponent.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar DistancePower = function (x1, y1, x2, y2, pow)\r\n{\r\n if (pow === undefined) { pow = 2; }\r\n\r\n return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow));\r\n};\r\n\r\nmodule.exports = DistancePower;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points), squared.\r\n *\r\n * @function Phaser.Math.Distance.Squared\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point, squared.\r\n */\r\nvar DistanceSquared = function (x1, y1, x2, y2)\r\n{\r\n var dx = x1 - x2;\r\n var dy = y1 - y2;\r\n\r\n return dx * dx + dy * dy;\r\n};\r\n\r\nmodule.exports = DistanceSquared;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Distance\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Between: require('./DistanceBetween'),\r\n Power: require('./DistancePower'),\r\n Squared: require('./DistanceSquared')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Back.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n return v * v * ((overshoot + 1) * v - overshoot);\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Back.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n var s = overshoot * 1.525;\r\n\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * (v * v * ((s + 1) * v - s));\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Back.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n return --v * v * ((overshoot + 1) * v + overshoot) + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Back\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n v = 1 - v;\r\n\r\n if (v < 1 / 2.75)\r\n {\r\n return 1 - (7.5625 * v * v);\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75);\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375);\r\n }\r\n else\r\n {\r\n return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375);\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n var reverse = false;\r\n\r\n if (v < 0.5)\r\n {\r\n v = 1 - (v * 2);\r\n reverse = true;\r\n }\r\n else\r\n {\r\n v = (v * 2) - 1;\r\n }\r\n\r\n if (v < 1 / 2.75)\r\n {\r\n v = 7.5625 * v * v;\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\r\n }\r\n else\r\n {\r\n v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\r\n }\r\n\r\n if (reverse)\r\n {\r\n return (1 - v) * 0.5;\r\n }\r\n else\r\n {\r\n return v * 0.5 + 0.5;\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n if (v < 1 / 2.75)\r\n {\r\n return 7.5625 * v * v;\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\r\n }\r\n else\r\n {\r\n return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Bounce\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Circular.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return 1 - Math.sqrt(1 - v * v);\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Circular.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return -0.5 * (Math.sqrt(1 - v * v) - 1);\r\n }\r\n else\r\n {\r\n return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Circular.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return Math.sqrt(1 - (--v * v));\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Circular\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v;\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * v + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return --v * v * v + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Cubic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n if ((v *= 2) < 1)\r\n {\r\n return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\r\n }\r\n else\r\n {\r\n return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1);\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Elastic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Expo.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return Math.pow(2, 10 * (v - 1)) - 0.001;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Expo.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * Math.pow(2, 10 * (v - 1));\r\n }\r\n else\r\n {\r\n return 0.5 * (2 - Math.pow(2, -10 * (v - 1)));\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Expo.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return 1 - Math.pow(2, -10 * v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Expo\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Back: require('./back'),\r\n Bounce: require('./bounce'),\r\n Circular: require('./circular'),\r\n Cubic: require('./cubic'),\r\n Elastic: require('./elastic'),\r\n Expo: require('./expo'),\r\n Linear: require('./linear'),\r\n Quadratic: require('./quadratic'),\r\n Quartic: require('./quartic'),\r\n Quintic: require('./quintic'),\r\n Sine: require('./sine'),\r\n Stepped: require('./stepped')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Linear easing (no variation).\r\n *\r\n * @function Phaser.Math.Easing.Linear.Linear\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Linear = function (v)\r\n{\r\n return v;\r\n};\r\n\r\nmodule.exports = Linear;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Linear\r\n */\r\n\r\nmodule.exports = require('./Linear');\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v;\r\n }\r\n else\r\n {\r\n return -0.5 * (--v * (v - 2) - 1);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return v * (2 - v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quadratic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v * v;\r\n }\r\n else\r\n {\r\n return -0.5 * ((v -= 2) * v * v * v - 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return 1 - (--v * v * v * v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quartic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v * v * v;\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * v * v * v + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return --v * v * v * v * v + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quintic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Sine.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 1 - Math.cos(v * Math.PI / 2);\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Sine.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 0.5 * (1 - Math.cos(Math.PI * v));\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Sine.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return Math.sin(v * Math.PI / 2);\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Sine\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Stepped easing.\r\n *\r\n * @function Phaser.Math.Easing.Stepped.Stepped\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [steps=1] - The number of steps in the ease.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Stepped = function (v, steps)\r\n{\r\n if (steps === undefined) { steps = 1; }\r\n\r\n if (v <= 0)\r\n {\r\n return 0;\r\n }\r\n else if (v >= 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return (((steps * v) | 0) + 1) * (1 / steps);\r\n }\r\n};\r\n\r\nmodule.exports = Stepped;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Stepped\r\n */\r\n\r\nmodule.exports = require('./Stepped');\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the fuzzy ceiling of the given value.\r\n *\r\n * @function Phaser.Math.Fuzzy.Ceil\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {number} The fuzzy ceiling of the value.\r\n */\r\nvar Ceil = function (value, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.ceil(value - epsilon);\r\n};\r\n\r\nmodule.exports = Ceil;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether the given values are fuzzily equal.\r\n *\r\n * Two numbers are fuzzily equal if their difference is less than `epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.Equal\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`.\r\n */\r\nvar Equal = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.abs(a - b) < epsilon;\r\n};\r\n\r\nmodule.exports = Equal;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the fuzzy floor of the given value.\r\n *\r\n * @function Phaser.Math.Fuzzy.Floor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {number} The floor of the value.\r\n */\r\nvar Floor = function (value, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.floor(value + epsilon);\r\n};\r\n\r\nmodule.exports = Floor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether `a` is fuzzily greater than `b`.\r\n *\r\n * `a` is fuzzily greater than `b` if it is more than `b - epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.GreaterThan\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`.\r\n */\r\nvar GreaterThan = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return a > b - epsilon;\r\n};\r\n\r\nmodule.exports = GreaterThan;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether `a` is fuzzily less than `b`.\r\n *\r\n * `a` is fuzzily less than `b` if it is less than `b + epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.LessThan\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`.\r\n */\r\nvar LessThan = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return a < b + epsilon;\r\n};\r\n\r\nmodule.exports = LessThan;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Fuzzy\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Ceil: require('./Ceil'),\r\n Equal: require('./Equal'),\r\n Floor: require('./Floor'),\r\n GreaterThan: require('./GreaterThan'),\r\n LessThan: require('./LessThan')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\nvar Extend = require('../utils/object/Extend');\r\n\r\n/**\r\n * @namespace Phaser.Math\r\n */\r\n\r\nvar PhaserMath = {\r\n\r\n // Collections of functions\r\n Angle: require('./angle/'),\r\n Distance: require('./distance/'),\r\n Easing: require('./easing/'),\r\n Fuzzy: require('./fuzzy/'),\r\n Interpolation: require('./interpolation/'),\r\n Pow2: require('./pow2/'),\r\n Snap: require('./snap/'),\r\n\r\n // Expose the RNG Class\r\n RandomDataGenerator: require('./random-data-generator/RandomDataGenerator'),\r\n\r\n // Single functions\r\n Average: require('./Average'),\r\n Bernstein: require('./Bernstein'),\r\n Between: require('./Between'),\r\n CatmullRom: require('./CatmullRom'),\r\n CeilTo: require('./CeilTo'),\r\n Clamp: require('./Clamp'),\r\n DegToRad: require('./DegToRad'),\r\n Difference: require('./Difference'),\r\n Factorial: require('./Factorial'),\r\n FloatBetween: require('./FloatBetween'),\r\n FloorTo: require('./FloorTo'),\r\n FromPercent: require('./FromPercent'),\r\n GetSpeed: require('./GetSpeed'),\r\n IsEven: require('./IsEven'),\r\n IsEvenStrict: require('./IsEvenStrict'),\r\n Linear: require('./Linear'),\r\n MaxAdd: require('./MaxAdd'),\r\n MinSub: require('./MinSub'),\r\n Percent: require('./Percent'),\r\n RadToDeg: require('./RadToDeg'),\r\n RandomXY: require('./RandomXY'),\r\n RandomXYZ: require('./RandomXYZ'),\r\n RandomXYZW: require('./RandomXYZW'),\r\n Rotate: require('./Rotate'),\r\n RotateAround: require('./RotateAround'),\r\n RotateAroundDistance: require('./RotateAroundDistance'),\r\n RoundAwayFromZero: require('./RoundAwayFromZero'),\r\n RoundTo: require('./RoundTo'),\r\n SinCosTableGenerator: require('./SinCosTableGenerator'),\r\n SmootherStep: require('./SmootherStep'),\r\n SmoothStep: require('./SmoothStep'),\r\n ToXY: require('./ToXY'),\r\n TransformXY: require('./TransformXY'),\r\n Within: require('./Within'),\r\n Wrap: require('./Wrap'),\r\n\r\n // Vector classes\r\n Vector2: require('./Vector2'),\r\n Vector3: require('./Vector3'),\r\n Vector4: require('./Vector4'),\r\n Matrix3: require('./Matrix3'),\r\n Matrix4: require('./Matrix4'),\r\n Quaternion: require('./Quaternion'),\r\n RotateVec3: require('./RotateVec3')\r\n\r\n};\r\n\r\n// Merge in the consts\r\n\r\nPhaserMath = Extend(false, PhaserMath, CONST);\r\n\r\n// Export it\r\n\r\nmodule.exports = PhaserMath;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bernstein = require('../Bernstein');\r\n\r\n/**\r\n * A bezier interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.Bezier\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar BezierInterpolation = function (v, k)\r\n{\r\n var b = 0;\r\n var n = v.length - 1;\r\n\r\n for (var i = 0; i <= n; i++)\r\n {\r\n b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i);\r\n }\r\n\r\n return b;\r\n};\r\n\r\nmodule.exports = BezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CatmullRom = require('../CatmullRom');\r\n\r\n/**\r\n * A Catmull-Rom interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.CatmullRom\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar CatmullRomInterpolation = function (v, k)\r\n{\r\n var m = v.length - 1;\r\n var f = m * k;\r\n var i = Math.floor(f);\r\n\r\n if (v[0] === v[m])\r\n {\r\n if (k < 0)\r\n {\r\n i = Math.floor(f = m * (1 + k));\r\n }\r\n\r\n return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]);\r\n }\r\n else\r\n {\r\n if (k < 0)\r\n {\r\n return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]);\r\n }\r\n\r\n if (k > 1)\r\n {\r\n return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]);\r\n }\r\n\r\n 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]);\r\n }\r\n};\r\n\r\nmodule.exports = CatmullRomInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P0 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return k * k * k * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P1 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return 3 * k * k * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P2 (t, p)\r\n{\r\n return 3 * (1 - t) * t * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P3 (t, p)\r\n{\r\n return t * t * t * p;\r\n}\r\n\r\n/**\r\n * A cubic bezier interpolation method.\r\n *\r\n * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a\r\n *\r\n * @function Phaser.Math.Interpolation.CubicBezier\r\n * @since 3.0.0\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} p0 - The start point.\r\n * @param {number} p1 - The first control point.\r\n * @param {number} p2 - The second control point.\r\n * @param {number} p3 - The end point.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar CubicBezierInterpolation = function (t, p0, p1, p2, p3)\r\n{\r\n return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3);\r\n};\r\n\r\nmodule.exports = CubicBezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Linear = require('../Linear');\r\n\r\n/**\r\n * A linear interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.Linear\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation}\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {!number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {!number} The interpolated value.\r\n */\r\nvar LinearInterpolation = function (v, k)\r\n{\r\n var m = v.length - 1;\r\n var f = m * k;\r\n var i = Math.floor(f);\r\n\r\n if (k < 0)\r\n {\r\n return Linear(v[0], v[1], f);\r\n }\r\n else if (k > 1)\r\n {\r\n return Linear(v[m], v[m - 1], m - f);\r\n }\r\n else\r\n {\r\n return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i);\r\n }\r\n};\r\n\r\nmodule.exports = LinearInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P0 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return k * k * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P1 (t, p)\r\n{\r\n return 2 * (1 - t) * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P2 (t, p)\r\n{\r\n return t * t * p;\r\n}\r\n\r\n// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js\r\n\r\n/**\r\n * A quadratic bezier interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.QuadraticBezier\r\n * @since 3.2.0\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} p0 - The start point.\r\n * @param {number} p1 - The control point.\r\n * @param {number} p2 - The end point.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar QuadraticBezierInterpolation = function (t, p0, p1, p2)\r\n{\r\n return P0(t, p0) + P1(t, p1) + P2(t, p2);\r\n};\r\n\r\nmodule.exports = QuadraticBezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SmoothStep = require('../SmoothStep');\r\n\r\n/**\r\n * A Smooth Step interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.SmoothStep\r\n * @since 3.9.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar SmoothStepInterpolation = function (t, min, max)\r\n{\r\n return min + (max - min) * SmoothStep(t, 0, 1);\r\n};\r\n\r\nmodule.exports = SmoothStepInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SmootherStep = require('../SmootherStep');\r\n\r\n/**\r\n * A Smoother Step interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.SmootherStep\r\n * @since 3.9.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar SmootherStepInterpolation = function (t, min, max)\r\n{\r\n return min + (max - min) * SmootherStep(t, 0, 1);\r\n};\r\n\r\nmodule.exports = SmootherStepInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Interpolation\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Bezier: require('./BezierInterpolation'),\r\n CatmullRom: require('./CatmullRomInterpolation'),\r\n CubicBezier: require('./CubicBezierInterpolation'),\r\n Linear: require('./LinearInterpolation'),\r\n QuadraticBezier: require('./QuadraticBezierInterpolation'),\r\n SmoothStep: require('./SmoothStepInterpolation'),\r\n SmootherStep: require('./SmootherStepInterpolation')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the nearest power of 2 to the given `value`.\r\n *\r\n * @function Phaser.Math.Pow2.GetPowerOfTwo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n *\r\n * @return {integer} The nearest power of 2 to `value`.\r\n */\r\nvar GetPowerOfTwo = function (value)\r\n{\r\n var index = Math.log(value) / 0.6931471805599453;\r\n\r\n return (1 << Math.ceil(index));\r\n};\r\n\r\nmodule.exports = GetPowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the given `width` and `height` are a power of two.\r\n * Useful for checking texture dimensions.\r\n *\r\n * @function Phaser.Math.Pow2.IsSizePowerOfTwo\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width.\r\n * @param {number} height - The height.\r\n *\r\n * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`.\r\n */\r\nvar IsSizePowerOfTwo = function (width, height)\r\n{\r\n return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0);\r\n};\r\n\r\nmodule.exports = IsSizePowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Tests the value and returns `true` if it is a power of two.\r\n *\r\n * @function Phaser.Math.Pow2.IsValuePowerOfTwo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to check if it's a power of two.\r\n *\r\n * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`.\r\n */\r\nvar IsValuePowerOfTwo = function (value)\r\n{\r\n return (value > 0 && (value & (value - 1)) === 0);\r\n};\r\n\r\nmodule.exports = IsValuePowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Pow2\r\n */\r\n\r\nmodule.exports = {\r\n\r\n GetNext: require('./GetPowerOfTwo'),\r\n IsSize: require('./IsSizePowerOfTwo'),\r\n IsValue: require('./IsValuePowerOfTwo')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A seeded Random Data Generator.\r\n * \r\n * Access via `Phaser.Math.RND` which is an instance of this class pre-defined\r\n * by Phaser. Or, create your own instance to use as you require.\r\n * \r\n * The `Math.RND` generator is seeded by the Game Config property value `seed`.\r\n * If no such config property exists, a random number is used.\r\n * \r\n * If you create your own instance of this class you should provide a seed for it.\r\n * If no seed is given it will use a 'random' one based on Date.now.\r\n *\r\n * @class RandomDataGenerator\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} [seeds] - The seeds to use for the random number generator.\r\n */\r\nvar RandomDataGenerator = new Class({\r\n\r\n initialize:\r\n\r\n function RandomDataGenerator (seeds)\r\n {\r\n if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; }\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#c\r\n * @type {number}\r\n * @default 1\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.c = 1;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s0\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s0 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s1\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s1 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s2\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s2 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#n\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.2.0\r\n */\r\n this.n = 0;\r\n\r\n /**\r\n * Signs to choose from.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#signs\r\n * @type {number[]}\r\n * @since 3.0.0\r\n */\r\n this.signs = [ -1, 1 ];\r\n\r\n if (seeds)\r\n {\r\n this.init(seeds);\r\n }\r\n },\r\n\r\n /**\r\n * Private random helper.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#rnd\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @return {number} A random number.\r\n */\r\n rnd: function ()\r\n {\r\n var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32\r\n\r\n this.c = t | 0;\r\n this.s0 = this.s1;\r\n this.s1 = this.s2;\r\n this.s2 = t - this.c;\r\n\r\n return this.s2;\r\n },\r\n\r\n /**\r\n * Internal method that creates a seed hash.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#hash\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {string} data - The value to hash.\r\n *\r\n * @return {number} The hashed value.\r\n */\r\n hash: function (data)\r\n {\r\n var h;\r\n var n = this.n;\r\n\r\n data = data.toString();\r\n\r\n for (var i = 0; i < data.length; i++)\r\n {\r\n n += data.charCodeAt(i);\r\n h = 0.02519603282416938 * n;\r\n n = h >>> 0;\r\n h -= n;\r\n h *= n;\r\n n = h >>> 0;\r\n h -= n;\r\n n += h * 0x100000000;// 2^32\r\n }\r\n\r\n this.n = n;\r\n\r\n return (n >>> 0) * 2.3283064365386963e-10;// 2^-32\r\n },\r\n\r\n /**\r\n * Initialize the state of the random data generator.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#init\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} seeds - The seeds to initialize the random data generator with.\r\n */\r\n init: function (seeds)\r\n {\r\n if (typeof seeds === 'string')\r\n {\r\n this.state(seeds);\r\n }\r\n else\r\n {\r\n this.sow(seeds);\r\n }\r\n },\r\n\r\n /**\r\n * Reset the seed of the random data generator.\r\n *\r\n * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#sow\r\n * @since 3.0.0\r\n *\r\n * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used.\r\n */\r\n sow: function (seeds)\r\n {\r\n // Always reset to default seed\r\n this.n = 0xefc8249d;\r\n this.s0 = this.hash(' ');\r\n this.s1 = this.hash(' ');\r\n this.s2 = this.hash(' ');\r\n this.c = 1;\r\n\r\n if (!seeds)\r\n {\r\n return;\r\n }\r\n\r\n // Apply any seeds\r\n for (var i = 0; i < seeds.length && (seeds[i] != null); i++)\r\n {\r\n var seed = seeds[i];\r\n\r\n this.s0 -= this.hash(seed);\r\n this.s0 += ~~(this.s0 < 0);\r\n this.s1 -= this.hash(seed);\r\n this.s1 += ~~(this.s1 < 0);\r\n this.s2 -= this.hash(seed);\r\n this.s2 += ~~(this.s2 < 0);\r\n }\r\n },\r\n\r\n /**\r\n * Returns a random integer between 0 and 2^32.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#integer\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random integer between 0 and 2^32.\r\n */\r\n integer: function ()\r\n {\r\n // 2^32\r\n return this.rnd() * 0x100000000;\r\n },\r\n\r\n /**\r\n * Returns a random real number between 0 and 1.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#frac\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between 0 and 1.\r\n */\r\n frac: function ()\r\n {\r\n // 2^-53\r\n return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16;\r\n },\r\n\r\n /**\r\n * Returns a random real number between 0 and 2^32.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#real\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between 0 and 2^32.\r\n */\r\n real: function ()\r\n {\r\n return this.integer() + this.frac();\r\n },\r\n\r\n /**\r\n * Returns a random integer between and including min and max.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#integerInRange\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n integerInRange: function (min, max)\r\n {\r\n return Math.floor(this.realInRange(0, max - min + 1) + min);\r\n },\r\n\r\n /**\r\n * Returns a random integer between and including min and max.\r\n * This method is an alias for RandomDataGenerator.integerInRange.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#between\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n between: function (min, max)\r\n {\r\n return Math.floor(this.realInRange(0, max - min + 1) + min);\r\n },\r\n\r\n /**\r\n * Returns a random real number between min and max.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#realInRange\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n realInRange: function (min, max)\r\n {\r\n return this.frac() * (max - min) + min;\r\n },\r\n\r\n /**\r\n * Returns a random real number between -1 and 1.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#normal\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between -1 and 1.\r\n */\r\n normal: function ()\r\n {\r\n return 1 - (2 * this.frac());\r\n },\r\n\r\n /**\r\n * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#uuid\r\n * @since 3.0.0\r\n *\r\n * @return {string} A valid RFC4122 version4 ID hex string\r\n */\r\n uuid: function ()\r\n {\r\n var a = '';\r\n var b = '';\r\n\r\n for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-')\r\n {\r\n // eslint-disable-next-line no-empty\r\n }\r\n\r\n return b;\r\n },\r\n\r\n /**\r\n * Returns a random element from within the given array.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#pick\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to pick a random element from.\r\n *\r\n * @return {*} A random member of the array.\r\n */\r\n pick: function (array)\r\n {\r\n return array[this.integerInRange(0, array.length - 1)];\r\n },\r\n\r\n /**\r\n * Returns a sign to be used with multiplication operator.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#sign\r\n * @since 3.0.0\r\n *\r\n * @return {number} -1 or +1.\r\n */\r\n sign: function ()\r\n {\r\n return this.pick(this.signs);\r\n },\r\n\r\n /**\r\n * Returns a random element from within the given array, favoring the earlier entries.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#weightedPick\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to pick a random element from.\r\n *\r\n * @return {*} A random member of the array.\r\n */\r\n weightedPick: function (array)\r\n {\r\n return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)];\r\n },\r\n\r\n /**\r\n * 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.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#timestamp\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random timestamp between min and max.\r\n */\r\n timestamp: function (min, max)\r\n {\r\n return this.realInRange(min || 946684800000, max || 1577862000000);\r\n },\r\n\r\n /**\r\n * Returns a random angle between -180 and 180.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#angle\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random number between -180 and 180.\r\n */\r\n angle: function ()\r\n {\r\n return this.integerInRange(-180, 180);\r\n },\r\n\r\n /**\r\n * Returns a random rotation in radians, between -3.141 and 3.141\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#rotation\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random number between -3.141 and 3.141\r\n */\r\n rotation: function ()\r\n {\r\n return this.realInRange(-3.1415926, 3.1415926);\r\n },\r\n\r\n /**\r\n * Gets or Sets the state of the generator. This allows you to retain the values\r\n * that the generator is using between games, i.e. in a game save file.\r\n *\r\n * To seed this generator with a previously saved state you can pass it as the\r\n * `seed` value in your game config, or call this method directly after Phaser has booted.\r\n *\r\n * Call this method with no parameters to return the current state.\r\n *\r\n * If providing a state it should match the same format that this method\r\n * returns, which is a string with a header `!rnd` followed by the `c`,\r\n * `s0`, `s1` and `s2` values respectively, each comma-delimited.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#state\r\n * @since 3.0.0\r\n *\r\n * @param {string} [state] - Generator state to be set.\r\n *\r\n * @return {string} The current state of the generator.\r\n */\r\n state: function (state)\r\n {\r\n if (typeof state === 'string' && state.match(/^!rnd/))\r\n {\r\n state = state.split(',');\r\n\r\n this.c = parseFloat(state[1]);\r\n this.s0 = parseFloat(state[2]);\r\n this.s1 = parseFloat(state[3]);\r\n this.s2 = parseFloat(state[4]);\r\n }\r\n\r\n return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(',');\r\n },\r\n\r\n /**\r\n * Shuffles the given array, using the current seed.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#shuffle\r\n * @since 3.7.0\r\n *\r\n * @param {array} [array] - The array to be shuffled.\r\n *\r\n * @return {array} The shuffled array.\r\n */\r\n shuffle: function (array)\r\n {\r\n var len = array.length - 1;\r\n\r\n for (var i = len; i > 0; i--)\r\n {\r\n var randomIndex = Math.floor(this.frac() * (i + 1));\r\n var itemAtIndex = array[randomIndex];\r\n\r\n array[randomIndex] = array[i];\r\n array[i] = itemAtIndex;\r\n }\r\n\r\n return array;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = RandomDataGenerator;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using ceil.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`.\r\n * As will `14` snap to `15`... but `16` will snap to `20`.\r\n *\r\n * @function Phaser.Math.Snap.Ceil\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapCeil = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.ceil(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapCeil;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using floor.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`.\r\n * As will `14` snap to `10`... but `16` will snap to `15`.\r\n *\r\n * @function Phaser.Math.Snap.Floor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapFloor = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.floor(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapFloor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using rounding.\r\n *\r\n * 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`.\r\n *\r\n * @function Phaser.Math.Snap.To\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapTo = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.round(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Snap\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Ceil: require('./SnapCeil'),\r\n Floor: require('./SnapFloor'),\r\n To: require('./SnapTo')\r\n\r\n};\r\n","/**\r\n* @author Richard Davey \r\n* @copyright 2019 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A Global Plugin is installed just once into the Game owned Plugin Manager.\r\n * It can listen for Game events and respond to them.\r\n *\r\n * @class BasePlugin\r\n * @memberof Phaser.Plugins\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar BasePlugin = new Class({\r\n\r\n initialize:\r\n\r\n function BasePlugin (pluginManager)\r\n {\r\n /**\r\n * A handy reference to the Plugin Manager that is responsible for this plugin.\r\n * Can be used as a route to gain access to game systems and events.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#pluginManager\r\n * @type {Phaser.Plugins.PluginManager}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.pluginManager = pluginManager;\r\n\r\n /**\r\n * A reference to the Game instance this plugin is running under.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#game\r\n * @type {Phaser.Game}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.game = pluginManager.game;\r\n\r\n /**\r\n * A reference to the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You cannot use it during the `init` method, but you can during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#scene\r\n * @type {?Phaser.Scene}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.scene;\r\n\r\n /**\r\n * A reference to the Scene Systems of the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You cannot use it during the `init` method, but you can during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#systems\r\n * @type {?Phaser.Scenes.Systems}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.systems;\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is first instantiated.\r\n * It will never be called again on this instance.\r\n * In here you can set-up whatever you need for this plugin to run.\r\n * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#init\r\n * @since 3.8.0\r\n *\r\n * @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).\r\n */\r\n init: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is started.\r\n * If a plugin is stopped, and then started again, this will get called again.\r\n * Typically called immediately after `BasePlugin.init`.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#start\r\n * @since 3.8.0\r\n */\r\n start: function ()\r\n {\r\n // Here are the game-level events you can listen to.\r\n // At the very least you should offer a destroy handler for when the game closes down.\r\n\r\n // var eventEmitter = this.game.events;\r\n\r\n // eventEmitter.once('destroy', this.gameDestroy, this);\r\n // eventEmitter.on('pause', this.gamePause, this);\r\n // eventEmitter.on('resume', this.gameResume, this);\r\n // eventEmitter.on('resize', this.gameResize, this);\r\n // eventEmitter.on('prestep', this.gamePreStep, this);\r\n // eventEmitter.on('step', this.gameStep, this);\r\n // eventEmitter.on('poststep', this.gamePostStep, this);\r\n // eventEmitter.on('prerender', this.gamePreRender, this);\r\n // eventEmitter.on('postrender', this.gamePostRender, this);\r\n },\r\n\r\n /**\r\n * Called by the PluginManager when this plugin is stopped.\r\n * The game code has requested that your plugin stop doing whatever it does.\r\n * It is now considered as 'inactive' by the PluginManager.\r\n * Handle that process here (i.e. stop listening for events, etc)\r\n * If the plugin is started again then `BasePlugin.start` will be called again.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#stop\r\n * @since 3.8.0\r\n */\r\n stop: function ()\r\n {\r\n },\r\n\r\n /**\r\n * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots.\r\n * By this point the plugin properties `scene` and `systems` will have already been set.\r\n * In here you can listen for Scene events and set-up whatever you need for this plugin to run.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#boot\r\n * @since 3.8.0\r\n */\r\n boot: function ()\r\n {\r\n // Here are the Scene events you can listen to.\r\n // At the very least you should offer a destroy handler for when the Scene closes down.\r\n\r\n // var eventEmitter = this.systems.events;\r\n\r\n // eventEmitter.once('destroy', this.sceneDestroy, this);\r\n // eventEmitter.on('start', this.sceneStart, this);\r\n // eventEmitter.on('preupdate', this.scenePreUpdate, this);\r\n // eventEmitter.on('update', this.sceneUpdate, this);\r\n // eventEmitter.on('postupdate', this.scenePostUpdate, this);\r\n // eventEmitter.on('pause', this.scenePause, this);\r\n // eventEmitter.on('resume', this.sceneResume, this);\r\n // eventEmitter.on('sleep', this.sceneSleep, this);\r\n // eventEmitter.on('wake', this.sceneWake, this);\r\n // eventEmitter.on('shutdown', this.sceneShutdown, this);\r\n // eventEmitter.on('destroy', this.sceneDestroy, this);\r\n },\r\n\r\n /**\r\n * Game instance has been destroyed.\r\n * You must release everything in here, all references, all objects, free it all up.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#destroy\r\n * @since 3.8.0\r\n */\r\n destroy: function ()\r\n {\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BasePlugin;\r\n","/**\r\n* @author Richard Davey \r\n* @copyright 2019 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar BasePlugin = require('./BasePlugin');\r\nvar Class = require('../utils/Class');\r\nvar SceneEvents = require('../scene/events');\r\n\r\n/**\r\n * @classdesc\r\n * A Scene Level Plugin is installed into every Scene and belongs to that Scene.\r\n * It can listen for Scene events and respond to them.\r\n * It can map itself to a Scene property, or into the Scene Systems, or both.\r\n *\r\n * @class ScenePlugin\r\n * @memberof Phaser.Plugins\r\n * @extends Phaser.Plugins.BasePlugin\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar ScenePlugin = new Class({\r\n\r\n Extends: BasePlugin,\r\n\r\n initialize:\r\n\r\n function ScenePlugin (scene, pluginManager)\r\n {\r\n BasePlugin.call(this, pluginManager);\r\n\r\n this.scene = scene;\r\n this.systems = scene.sys;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * This method is called when the Scene boots. It is only ever called once.\r\n * \r\n * By this point the plugin properties `scene` and `systems` will have already been set.\r\n * \r\n * In here you can listen for Scene events and set-up whatever you need for this plugin to run.\r\n * Here are the Scene events you can listen to:\r\n * \r\n * start\r\n * ready\r\n * preupdate\r\n * update\r\n * postupdate\r\n * resize\r\n * pause\r\n * resume\r\n * sleep\r\n * wake\r\n * transitioninit\r\n * transitionstart\r\n * transitioncomplete\r\n * transitionout\r\n * shutdown\r\n * destroy\r\n * \r\n * At the very least you should offer a destroy handler for when the Scene closes down, i.e:\r\n *\r\n * ```javascript\r\n * var eventEmitter = this.systems.events;\r\n * eventEmitter.once('destroy', this.sceneDestroy, this);\r\n * ```\r\n *\r\n * @method Phaser.Plugins.ScenePlugin#boot\r\n * @since 3.8.0\r\n */\r\n boot: function ()\r\n {\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ScenePlugin;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Blend Modes.\r\n * \r\n * @namespace Phaser.BlendModes\r\n * @since 3.0.0\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * Skips the Blend Mode check in the renderer.\r\n * \r\n * @name Phaser.BlendModes.SKIP_CHECK\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SKIP_CHECK: -1,\r\n\r\n /**\r\n * Normal blend mode. For Canvas and WebGL.\r\n * This is the default setting and draws new shapes on top of the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.NORMAL\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n NORMAL: 0,\r\n\r\n /**\r\n * Add blend mode. For Canvas and WebGL.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.ADD\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ADD: 1,\r\n\r\n /**\r\n * Multiply blend mode. For Canvas and WebGL.\r\n * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result.\r\n * \r\n * @name Phaser.BlendModes.MULTIPLY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n MULTIPLY: 2,\r\n\r\n /**\r\n * Screen blend mode. For Canvas and WebGL.\r\n * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply)\r\n * \r\n * @name Phaser.BlendModes.SCREEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SCREEN: 3,\r\n\r\n /**\r\n * Overlay blend mode. For Canvas only.\r\n * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter.\r\n * \r\n * @name Phaser.BlendModes.OVERLAY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n OVERLAY: 4,\r\n\r\n /**\r\n * Darken blend mode. For Canvas only.\r\n * Retains the darkest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.DARKEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DARKEN: 5,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Retains the lightest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.LIGHTEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTEN: 6,\r\n\r\n /**\r\n * Color Dodge blend mode. For Canvas only.\r\n * Divides the bottom layer by the inverted top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR_DODGE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_DODGE: 7,\r\n\r\n /**\r\n * Color Burn blend mode. For Canvas only.\r\n * Divides the inverted bottom layer by the top layer, and then inverts the result.\r\n * \r\n * @name Phaser.BlendModes.COLOR_BURN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_BURN: 8,\r\n\r\n /**\r\n * Hard Light blend mode. For Canvas only.\r\n * A combination of multiply and screen like overlay, but with top and bottom layer swapped.\r\n * \r\n * @name Phaser.BlendModes.HARD_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HARD_LIGHT: 9,\r\n\r\n /**\r\n * Soft Light blend mode. For Canvas only.\r\n * A softer version of hard-light. Pure black or white does not result in pure black or white.\r\n * \r\n * @name Phaser.BlendModes.SOFT_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOFT_LIGHT: 10,\r\n\r\n /**\r\n * Difference blend mode. For Canvas only.\r\n * Subtracts the bottom layer from the top layer or the other way round to always get a positive value.\r\n * \r\n * @name Phaser.BlendModes.DIFFERENCE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DIFFERENCE: 11,\r\n\r\n /**\r\n * Exclusion blend mode. For Canvas only.\r\n * Like difference, but with lower contrast.\r\n * \r\n * @name Phaser.BlendModes.EXCLUSION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n EXCLUSION: 12,\r\n\r\n /**\r\n * Hue blend mode. For Canvas only.\r\n * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.\r\n * \r\n * @name Phaser.BlendModes.HUE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HUE: 13,\r\n\r\n /**\r\n * Saturation blend mode. For Canvas only.\r\n * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.SATURATION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SATURATION: 14,\r\n\r\n /**\r\n * Color blend mode. For Canvas only.\r\n * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR: 15,\r\n\r\n /**\r\n * Luminosity blend mode. For Canvas only.\r\n * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.LUMINOSITY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LUMINOSITY: 16,\r\n\r\n /**\r\n * Alpha erase blend mode. For Canvas and WebGL.\r\n * \r\n * @name Phaser.BlendModes.ERASE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ERASE: 17,\r\n\r\n /**\r\n * Source-in blend mode. For Canvas only.\r\n * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_IN: 18,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is drawn where it doesn't overlap the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_OUT: 19,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is only drawn where it overlaps the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_ATOP: 20,\r\n\r\n /**\r\n * Destination-over blend mode. For Canvas only.\r\n * New shapes are drawn behind the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OVER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OVER: 21,\r\n\r\n /**\r\n * Destination-in blend mode. For Canvas only.\r\n * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_IN: 22,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing content is kept where it doesn't overlap the new shape.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OUT: 23,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_ATOP: 24,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.LIGHTER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTER: 25,\r\n\r\n /**\r\n * Copy blend mode. For Canvas only.\r\n * Only the new shape is shown.\r\n * \r\n * @name Phaser.BlendModes.COPY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COPY: 26,\r\n\r\n /**\r\n * Xor blend mode. For Canvas only.\r\n * Shapes are made transparent where both overlap and drawn normal everywhere else.\r\n * \r\n * @name Phaser.BlendModes.XOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n XOR: 27\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Scale Modes.\r\n * \r\n * @namespace Phaser.ScaleModes\r\n * @since 3.0.0\r\n */\r\n\r\nvar ScaleModes = {\r\n\r\n /**\r\n * Default Scale Mode (Linear).\r\n * \r\n * @name Phaser.ScaleModes.DEFAULT\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n DEFAULT: 0,\r\n\r\n /**\r\n * Linear Scale Mode.\r\n * \r\n * @name Phaser.ScaleModes.LINEAR\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n LINEAR: 0,\r\n\r\n /**\r\n * Nearest Scale Mode.\r\n * \r\n * @name Phaser.ScaleModes.NEAREST\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n NEAREST: 1\r\n\r\n};\r\n\r\nmodule.exports = ScaleModes;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scale Manager Resize Event.\r\n * \r\n * This event is dispatched whenever the Scale Manager detects a resize event from the browser.\r\n * It sends three parameters to the callback, each of them being Size components. You can read\r\n * the `width`, `height`, `aspectRatio` and other properties of these components to help with\r\n * scaling your own game content.\r\n *\r\n * @event Phaser.Scale.Events#RESIZE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas.\r\n * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution.\r\n * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode.\r\n * @param {number} resolution - The current resolution. Defaults to 1 at the moment.\r\n * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width.\r\n * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height.\r\n */\r\nmodule.exports = 'resize';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Boot Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('boot', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#BOOT\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'boot';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Create Event.\r\n * \r\n * This event is dispatched by a Scene after it has been created by the Scene Manager.\r\n * \r\n * If a Scene has a `create` method then this event is emitted _after_ that has run.\r\n * \r\n * If there is a transition, this event will be fired after the `TRANSITION_START` event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('create', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#CREATE\r\n * @since 3.17.0\r\n * \r\n * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event.\r\n */\r\nmodule.exports = 'create';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Destroy Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems destroy process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('destroy', listener)`.\r\n * \r\n * You should destroy any resources that may be in use by your Scene in this event handler.\r\n * \r\n * @event Phaser.Scenes.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pause Event.\r\n * \r\n * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an\r\n * action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('pause', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#PAUSE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was paused.\r\n */\r\nmodule.exports = 'pause';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Post Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#POST_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'postupdate';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pre Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#PRE_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'preupdate';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Ready Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process.\r\n * By this point in the process the Scene is now fully active and rendering.\r\n * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('ready', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#READY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was started.\r\n */\r\nmodule.exports = 'ready';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Render Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('render', listener)`.\r\n * \r\n * A Scene will only render if it is visible and active.\r\n * By the time this event is dispatched, the Scene will have already been rendered.\r\n * \r\n * @event Phaser.Scenes.Events#RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene.\r\n */\r\nmodule.exports = 'render';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Resume Event.\r\n * \r\n * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('resume', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#RESUME\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed.\r\n */\r\nmodule.exports = 'resume';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Shutdown Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems shutdown process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('shutdown', listener)`.\r\n * \r\n * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding\r\n * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not\r\n * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources.\r\n * \r\n * @event Phaser.Scenes.Events#SHUTDOWN\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown.\r\n */\r\nmodule.exports = 'shutdown';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Sleep Event.\r\n * \r\n * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('sleep', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#SLEEP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep.\r\n */\r\nmodule.exports = 'sleep';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Start Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('start', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Complete Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration\r\n * of the transition.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioncomplete', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_COMPLETE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} scene -The Scene on which the transitioned completed.\r\n */\r\nmodule.exports = 'transitioncomplete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Init Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method,\r\n * this event is not dispatched.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioninit', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_INIT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitioninit';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Out Event.\r\n * \r\n * This event is dispatched by a Scene when it initiates a transition to another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionout', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_OUT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionout';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Start Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep.\r\n * \r\n * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method,\r\n * this event is dispatched anyway.\r\n * \r\n * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is\r\n * dispatched instead of this event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionstart', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_START\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionstart';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Wake Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before\r\n * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionwake', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 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.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_WAKE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionwake';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('update', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @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.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'update';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Wake Event.\r\n * \r\n * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('wake', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#WAKE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up.\r\n */\r\nmodule.exports = 'wake';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Scenes.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BOOT: require('./BOOT_EVENT'),\r\n CREATE: require('./CREATE_EVENT'),\r\n DESTROY: require('./DESTROY_EVENT'),\r\n PAUSE: require('./PAUSE_EVENT'),\r\n POST_UPDATE: require('./POST_UPDATE_EVENT'),\r\n PRE_UPDATE: require('./PRE_UPDATE_EVENT'),\r\n READY: require('./READY_EVENT'),\r\n RENDER: require('./RENDER_EVENT'),\r\n RESUME: require('./RESUME_EVENT'),\r\n SHUTDOWN: require('./SHUTDOWN_EVENT'),\r\n SLEEP: require('./SLEEP_EVENT'),\r\n START: require('./START_EVENT'),\r\n TRANSITION_COMPLETE: require('./TRANSITION_COMPLETE_EVENT'),\r\n TRANSITION_INIT: require('./TRANSITION_INIT_EVENT'),\r\n TRANSITION_OUT: require('./TRANSITION_OUT_EVENT'),\r\n TRANSITION_START: require('./TRANSITION_START_EVENT'),\r\n TRANSITION_WAKE: require('./TRANSITION_WAKE_EVENT'),\r\n UPDATE: require('./UPDATE_EVENT'),\r\n WAKE: require('./WAKE_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Taken from klasse by mattdesl https://github.com/mattdesl/klasse\r\n\r\nfunction hasGetterOrSetter (def)\r\n{\r\n return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function');\r\n}\r\n\r\nfunction getProperty (definition, k, isClassDescriptor)\r\n{\r\n // This may be a lightweight object, OR it might be a property that was defined previously.\r\n\r\n // For simple class descriptors we can just assume its NOT previously defined.\r\n var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k);\r\n\r\n if (!isClassDescriptor && def.value && typeof def.value === 'object')\r\n {\r\n def = def.value;\r\n }\r\n\r\n // This might be a regular property, or it may be a getter/setter the user defined in a class.\r\n if (def && hasGetterOrSetter(def))\r\n {\r\n if (typeof def.enumerable === 'undefined')\r\n {\r\n def.enumerable = true;\r\n }\r\n\r\n if (typeof def.configurable === 'undefined')\r\n {\r\n def.configurable = true;\r\n }\r\n\r\n return def;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n}\r\n\r\nfunction hasNonConfigurable (obj, k)\r\n{\r\n var prop = Object.getOwnPropertyDescriptor(obj, k);\r\n\r\n if (!prop)\r\n {\r\n return false;\r\n }\r\n\r\n if (prop.value && typeof prop.value === 'object')\r\n {\r\n prop = prop.value;\r\n }\r\n\r\n if (prop.configurable === false)\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Extends the given `myClass` object's prototype with the properties of `definition`.\r\n *\r\n * @function extend\r\n * @param {Object} ctor The constructor object to mix into.\r\n * @param {Object} definition A dictionary of functions for the class.\r\n * @param {boolean} isClassDescriptor Is the definition a class descriptor?\r\n * @param {Object} [extend] The parent constructor object.\r\n */\r\nfunction extend (ctor, definition, isClassDescriptor, extend)\r\n{\r\n for (var k in definition)\r\n {\r\n if (!definition.hasOwnProperty(k))\r\n {\r\n continue;\r\n }\r\n\r\n var def = getProperty(definition, k, isClassDescriptor);\r\n\r\n if (def !== false)\r\n {\r\n // If Extends is used, we will check its prototype to see if the final variable exists.\r\n\r\n var parent = extend || ctor;\r\n\r\n if (hasNonConfigurable(parent.prototype, k))\r\n {\r\n // Just skip the final property\r\n if (Class.ignoreFinals)\r\n {\r\n continue;\r\n }\r\n\r\n // We cannot re-define a property that is configurable=false.\r\n // So we will consider them final and throw an error. This is by\r\n // default so it is clear to the developer what is happening.\r\n // You can set ignoreFinals to true if you need to extend a class\r\n // which has configurable=false; it will simply not re-define final properties.\r\n throw new Error('cannot override final property \\'' + k + '\\', set Class.ignoreFinals = true to skip');\r\n }\r\n\r\n Object.defineProperty(ctor.prototype, k, def);\r\n }\r\n else\r\n {\r\n ctor.prototype[k] = definition[k];\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Applies the given `mixins` to the prototype of `myClass`.\r\n *\r\n * @function mixin\r\n * @param {Object} myClass The constructor object to mix into.\r\n * @param {Object|Array} mixins The mixins to apply to the constructor.\r\n */\r\nfunction mixin (myClass, mixins)\r\n{\r\n if (!mixins)\r\n {\r\n return;\r\n }\r\n\r\n if (!Array.isArray(mixins))\r\n {\r\n mixins = [ mixins ];\r\n }\r\n\r\n for (var i = 0; i < mixins.length; i++)\r\n {\r\n extend(myClass, mixins[i].prototype || mixins[i]);\r\n }\r\n}\r\n\r\n/**\r\n * Creates a new class with the given descriptor.\r\n * The constructor, defined by the name `initialize`,\r\n * is an optional function. If unspecified, an anonymous\r\n * function will be used which calls the parent class (if\r\n * one exists).\r\n *\r\n * You can also use `Extends` and `Mixins` to provide subclassing\r\n * and inheritance.\r\n *\r\n * @class Phaser.Class\r\n * @constructor\r\n * @param {Object} definition a dictionary of functions for the class\r\n * @example\r\n *\r\n * var MyClass = new Phaser.Class({\r\n *\r\n * initialize: function() {\r\n * this.foo = 2.0;\r\n * },\r\n *\r\n * bar: function() {\r\n * return this.foo + 5;\r\n * }\r\n * });\r\n */\r\nfunction Class (definition)\r\n{\r\n if (!definition)\r\n {\r\n definition = {};\r\n }\r\n\r\n // The variable name here dictates what we see in Chrome debugger\r\n var initialize;\r\n var Extends;\r\n\r\n if (definition.initialize)\r\n {\r\n if (typeof definition.initialize !== 'function')\r\n {\r\n throw new Error('initialize must be a function');\r\n }\r\n\r\n initialize = definition.initialize;\r\n\r\n // Usually we should avoid 'delete' in V8 at all costs.\r\n // However, its unlikely to make any performance difference\r\n // here since we only call this on class creation (i.e. not object creation).\r\n delete definition.initialize;\r\n }\r\n else if (definition.Extends)\r\n {\r\n var base = definition.Extends;\r\n\r\n initialize = function ()\r\n {\r\n base.apply(this, arguments);\r\n };\r\n }\r\n else\r\n {\r\n initialize = function () {};\r\n }\r\n\r\n if (definition.Extends)\r\n {\r\n initialize.prototype = Object.create(definition.Extends.prototype);\r\n initialize.prototype.constructor = initialize;\r\n\r\n // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin)\r\n\r\n Extends = definition.Extends;\r\n\r\n delete definition.Extends;\r\n }\r\n else\r\n {\r\n initialize.prototype.constructor = initialize;\r\n }\r\n\r\n // Grab the mixins, if they are specified...\r\n var mixins = null;\r\n\r\n if (definition.Mixins)\r\n {\r\n mixins = definition.Mixins;\r\n delete definition.Mixins;\r\n }\r\n\r\n // First, mixin if we can.\r\n mixin(initialize, mixins);\r\n\r\n // Now we grab the actual definition which defines the overrides.\r\n extend(initialize, definition, true, Extends);\r\n\r\n return initialize;\r\n}\r\n\r\nClass.extend = extend;\r\nClass.mixin = mixin;\r\nClass.ignoreFinals = false;\r\n\r\nmodule.exports = Class;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A NOOP (No Operation) callback function.\r\n *\r\n * Used internally by Phaser when it's more expensive to determine if a callback exists\r\n * than it is to just invoke an empty function.\r\n *\r\n * @function Phaser.Utils.NOOP\r\n * @since 3.0.0\r\n */\r\nvar NOOP = function ()\r\n{\r\n // NOOP\r\n};\r\n\r\nmodule.exports = NOOP;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar IsPlainObject = require('./IsPlainObject');\r\n\r\n// @param {boolean} deep - Perform a deep copy?\r\n// @param {object} target - The target object to copy to.\r\n// @return {object} The extended object.\r\n\r\n/**\r\n * This is a slightly modified version of http://api.jquery.com/jQuery.extend/\r\n *\r\n * @function Phaser.Utils.Objects.Extend\r\n * @since 3.0.0\r\n *\r\n * @return {object} The extended object.\r\n */\r\nvar Extend = function ()\r\n{\r\n var options, name, src, copy, copyIsArray, clone,\r\n target = arguments[0] || {},\r\n i = 1,\r\n length = arguments.length,\r\n deep = false;\r\n\r\n // Handle a deep copy situation\r\n if (typeof target === 'boolean')\r\n {\r\n deep = target;\r\n target = arguments[1] || {};\r\n\r\n // skip the boolean and the target\r\n i = 2;\r\n }\r\n\r\n // extend Phaser if only one argument is passed\r\n if (length === i)\r\n {\r\n target = this;\r\n --i;\r\n }\r\n\r\n for (; i < length; i++)\r\n {\r\n // Only deal with non-null/undefined values\r\n if ((options = arguments[i]) != null)\r\n {\r\n // Extend the base object\r\n for (name in options)\r\n {\r\n src = target[name];\r\n copy = options[name];\r\n\r\n // Prevent never-ending loop\r\n if (target === copy)\r\n {\r\n continue;\r\n }\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy))))\r\n {\r\n if (copyIsArray)\r\n {\r\n copyIsArray = false;\r\n clone = src && Array.isArray(src) ? src : [];\r\n }\r\n else\r\n {\r\n clone = src && IsPlainObject(src) ? src : {};\r\n }\r\n\r\n // Never move original objects, clone them\r\n target[name] = Extend(deep, clone, copy);\r\n\r\n // Don't bring in undefined values\r\n }\r\n else if (copy !== undefined)\r\n {\r\n target[name] = copy;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Return the modified object\r\n return target;\r\n};\r\n\r\nmodule.exports = Extend;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH = require('../../math');\r\nvar GetValue = require('./GetValue');\r\n\r\n/**\r\n * Retrieves a value from an object. Allows for more advanced selection options, including:\r\n *\r\n * Allowed types:\r\n * \r\n * Implicit\r\n * {\r\n * x: 4\r\n * }\r\n *\r\n * From function\r\n * {\r\n * x: function ()\r\n * }\r\n *\r\n * Randomly pick one element from the array\r\n * {\r\n * x: [a, b, c, d, e, f]\r\n * }\r\n *\r\n * Random integer between min and max:\r\n * {\r\n * x: { randInt: [min, max] }\r\n * }\r\n *\r\n * Random float between min and max:\r\n * {\r\n * x: { randFloat: [min, max] }\r\n * }\r\n * \r\n *\r\n * @function Phaser.Utils.Objects.GetAdvancedValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @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.\r\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\r\n *\r\n * @return {*} The value of the requested key.\r\n */\r\nvar GetAdvancedValue = function (source, key, defaultValue)\r\n{\r\n var value = GetValue(source, key, null);\r\n\r\n if (value === null)\r\n {\r\n return defaultValue;\r\n }\r\n else if (Array.isArray(value))\r\n {\r\n return MATH.RND.pick(value);\r\n }\r\n else if (typeof value === 'object')\r\n {\r\n if (value.hasOwnProperty('randInt'))\r\n {\r\n return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]);\r\n }\r\n else if (value.hasOwnProperty('randFloat'))\r\n {\r\n return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]);\r\n }\r\n }\r\n else if (typeof value === 'function')\r\n {\r\n return value(key);\r\n }\r\n\r\n return value;\r\n};\r\n\r\nmodule.exports = GetAdvancedValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue}\r\n *\r\n * @function Phaser.Utils.Objects.GetFastValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to search\r\n * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods)\r\n * @param {*} [defaultValue] - The default value to use if the key does not exist.\r\n *\r\n * @return {*} The value if found; otherwise, defaultValue (null if none provided)\r\n */\r\nvar GetFastValue = function (source, key, defaultValue)\r\n{\r\n var t = typeof(source);\r\n\r\n if (!source || t === 'number' || t === 'string')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key) && source[key] !== undefined)\r\n {\r\n return source[key];\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetFastValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Source object\r\n// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner'\r\n// The default value to use if the key doesn't exist\r\n\r\n/**\r\n * Retrieves a value from an object.\r\n *\r\n * @function Phaser.Utils.Objects.GetValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @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.\r\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\r\n *\r\n * @return {*} The value of the requested key.\r\n */\r\nvar GetValue = function (source, key, defaultValue)\r\n{\r\n if (!source || typeof source === 'number')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key))\r\n {\r\n return source[key];\r\n }\r\n else if (key.indexOf('.') !== -1)\r\n {\r\n var keys = key.split('.');\r\n var parent = source;\r\n var value = defaultValue;\r\n\r\n // Use for loop here so we can break early\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n if (parent.hasOwnProperty(keys[i]))\r\n {\r\n // Yes it has a key property, let's carry on down\r\n value = parent[keys[i]];\r\n\r\n parent = parent[keys[i]];\r\n }\r\n else\r\n {\r\n // Can't go any further, so reset to default\r\n value = defaultValue;\r\n break;\r\n }\r\n }\r\n\r\n return value;\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * This is a slightly modified version of jQuery.isPlainObject.\r\n * A plain object is an object whose internal class property is [object Object].\r\n *\r\n * @function Phaser.Utils.Objects.IsPlainObject\r\n * @since 3.0.0\r\n *\r\n * @param {object} obj - The object to inspect.\r\n *\r\n * @return {boolean} `true` if the object is plain, otherwise `false`.\r\n */\r\nvar IsPlainObject = function (obj)\r\n{\r\n // Not plain objects:\r\n // - Any object or value whose internal [[Class]] property is not \"[object Object]\"\r\n // - DOM nodes\r\n // - window\r\n if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window)\r\n {\r\n return false;\r\n }\r\n\r\n // Support: Firefox <20\r\n // The try/catch suppresses exceptions thrown when attempting to access\r\n // the \"constructor\" property of certain host objects, ie. |window.location|\r\n // https://bugzilla.mozilla.org/show_bug.cgi?id=814622\r\n try\r\n {\r\n if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf'))\r\n {\r\n return false;\r\n }\r\n }\r\n catch (e)\r\n {\r\n return false;\r\n }\r\n\r\n // If the function hasn't returned already, we're confident that\r\n // |obj| is a plain object, created by {} or constructed with new Object\r\n return true;\r\n};\r\n\r\nmodule.exports = IsPlainObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = require('../../../src/utils/Class');\r\nvar GetFastValue = require('../../../src/utils/object/GetFastValue');\r\nvar ImageFile = require('../../../src/loader/filetypes/ImageFile.js');\r\nvar IsPlainObject = require('../../../src/utils/object/IsPlainObject');\r\nvar JSONFile = require('../../../src/loader/filetypes/JSONFile.js');\r\nvar MultiFile = require('../../../src/loader/MultiFile.js');\r\nvar TextFile = require('../../../src/loader/filetypes/TextFile.js');\r\n\r\n/**\r\n * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig\r\n *\r\n * @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager.\r\n * @property {string} [textureURL] - The absolute or relative URL to load the texture image file from.\r\n * @property {string} [textureExtension='png'] - The default file extension to use for the image texture if no url is provided.\r\n * @property {XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture image file.\r\n * @property {string} [normalMap] - The filename of an associated normal map. It uses the same path and url to load as the texture image.\r\n * @property {string} [atlasURL] - The absolute or relative URL to load the atlas data file from.\r\n * @property {string} [atlasExtension='txt'] - The default file extension to use for the atlas data if no url is provided.\r\n * @property {XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas data file.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * A Spine File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#spine method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spine.\r\n *\r\n * @class SpineFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @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\".\r\n * @param {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not?\r\n * @param {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.\r\n */\r\nvar SpineFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function SpineFile (loader, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)\r\n {\r\n var i;\r\n var json;\r\n var atlas;\r\n var files = [];\r\n var cache = loader.cacheManager.custom.spine;\r\n\r\n // atlas can be an array of atlas files, not just a single one\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n\r\n json = new JSONFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'jsonURL'),\r\n extension: GetFastValue(config, 'jsonExtension', 'json'),\r\n xhrSettings: GetFastValue(config, 'jsonXhrSettings')\r\n });\r\n\r\n atlasURL = GetFastValue(config, 'atlasURL');\r\n preMultipliedAlpha = GetFastValue(config, 'preMultipliedAlpha');\r\n\r\n if (!Array.isArray(atlasURL))\r\n {\r\n atlasURL = [ atlasURL ];\r\n }\r\n\r\n for (i = 0; i < atlasURL.length; i++)\r\n {\r\n atlas = new TextFile(loader, {\r\n key: key,\r\n url: atlasURL[i],\r\n extension: GetFastValue(config, 'atlasExtension', 'atlas'),\r\n xhrSettings: GetFastValue(config, 'atlasXhrSettings')\r\n });\r\n\r\n atlas.cache = cache;\r\n\r\n files.push(atlas);\r\n }\r\n }\r\n else\r\n {\r\n json = new JSONFile(loader, key, jsonURL, jsonXhrSettings);\r\n\r\n if (!Array.isArray(atlasURL))\r\n {\r\n atlasURL = [ atlasURL ];\r\n }\r\n\r\n for (i = 0; i < atlasURL.length; i++)\r\n {\r\n atlas = new TextFile(loader, key + '_' + i, atlasURL[i], atlasXhrSettings);\r\n atlas.cache = cache;\r\n\r\n files.push(atlas);\r\n }\r\n }\r\n\r\n files.unshift(json);\r\n\r\n MultiFile.call(this, loader, 'spine', key, files);\r\n\r\n this.config.preMultipliedAlpha = preMultipliedAlpha;\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.FileTypes.SpineFile#onFileComplete\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n\r\n if (file.type === 'text')\r\n {\r\n // Inspect the data for the files to now load\r\n var content = file.data.split('\\n');\r\n\r\n // Extract the textures\r\n var textures = [];\r\n\r\n for (var t = 0; t < content.length; t++)\r\n {\r\n var line = content[t];\r\n\r\n if (line.trim() === '' && t < content.length - 1)\r\n {\r\n line = content[t + 1];\r\n\r\n textures.push(line);\r\n }\r\n }\r\n\r\n var config = this.config;\r\n var loader = this.loader;\r\n\r\n var currentBaseURL = loader.baseURL;\r\n var currentPath = loader.path;\r\n var currentPrefix = loader.prefix;\r\n\r\n var baseURL = GetFastValue(config, 'baseURL', currentBaseURL);\r\n var path = GetFastValue(config, 'path', currentPath);\r\n var prefix = GetFastValue(config, 'prefix', currentPrefix);\r\n var textureXhrSettings = GetFastValue(config, 'textureXhrSettings');\r\n\r\n loader.setBaseURL(baseURL);\r\n loader.setPath(path);\r\n loader.setPrefix(prefix);\r\n\r\n for (var i = 0; i < textures.length; i++)\r\n {\r\n var textureURL = textures[i];\r\n\r\n var key = '_SP_' + textureURL;\r\n\r\n var image = new ImageFile(loader, key, textureURL, textureXhrSettings);\r\n\r\n this.addToMultiFile(image);\r\n\r\n loader.addFile(image);\r\n }\r\n\r\n // Reset the loader settings\r\n loader.setBaseURL(currentBaseURL);\r\n loader.setPath(currentPath);\r\n loader.setPrefix(currentPrefix);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.SpineFile#addToCache\r\n * @since 3.19.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n var fileJSON = this.files[0];\r\n\r\n fileJSON.addToCache();\r\n\r\n var atlasCache;\r\n var atlasKey = '';\r\n var combinedAtlastData = '';\r\n var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false;\r\n\r\n for (var i = 1; i < this.files.length; i++)\r\n {\r\n var file = this.files[i];\r\n\r\n if (file.type === 'text')\r\n {\r\n atlasKey = file.key.substr(0, file.key.length - 2);\r\n\r\n atlasCache = file.cache;\r\n\r\n combinedAtlastData = combinedAtlastData.concat(file.data);\r\n }\r\n else\r\n {\r\n var key = file.key.substr(4).trim();\r\n \r\n this.loader.textureManager.addImage(key, file.data);\r\n }\r\n\r\n file.pendingDestroy();\r\n }\r\n\r\n atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlastData });\r\n\r\n this.complete = true;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpineFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar BuildGameObject = require('../../../src/gameobjects/BuildGameObject');\r\nvar Class = require('../../../src/utils/Class');\r\nvar GetValue = require('../../../src/utils/object/GetValue');\r\nvar ResizeEvent = require('../../../src/scale/events/RESIZE_EVENT');\r\nvar ScenePlugin = require('../../../src/plugins/ScenePlugin');\r\nvar Spine = require('Spine');\r\nvar SpineFile = require('./SpineFile');\r\nvar SpineGameObject = require('./gameobject/SpineGameObject');\r\n\r\n/**\r\n * @classdesc\r\n * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game objects.\r\n * \r\n * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin\r\n * uses the Spine 3.7 runtimes. Files created in a more recent version of Spine may not work as a result.\r\n * \r\n * You can find more details about Spine at http://esotericsoftware.com/.\r\n * \r\n * Please note that you require a Spine license in order to use Spine Runtimes in your games.\r\n * \r\n * You can install this plugin into your Phaser game by either importing it, if you're using ES6:\r\n * \r\n * ```javascript\r\n * import * as SpinePlugin from './SpinePlugin.js';\r\n * ```\r\n * \r\n * and then adding it to your Phaser Game configuration:\r\n * \r\n * ```javascript\r\n * plugins: {\r\n * scene: [\r\n * { key: 'SpinePlugin', plugin: window.SpinePlugin, mapping: 'spine' }\r\n * ]\r\n * }\r\n * ```\r\n * \r\n * If you're using ES5 then you can load the Spine Plugin in a Scene files payload, _within_ your\r\n * Game Configuration object, like this:\r\n * \r\n * ```javascript\r\n * scene: {\r\n * preload: preload,\r\n * create: create,\r\n * pack: {\r\n * files: [\r\n * { type: 'scenePlugin', key: 'SpinePlugin', url: 'plugins/SpinePlugin.js', sceneKey: 'spine' }\r\n * ]\r\n * }\r\n * }\r\n * ```\r\n * \r\n * Loading it like this allows you to then use commands such as `this.load.spine` from within the\r\n * same Scene. Alternatively, you can use the method `this.load.plugin` to load the plugin via the normal\r\n * Phaser Loader. However, doing so will not add it to the current Scene. It will be available from any\r\n * subsequent Scenes.\r\n * \r\n * Assuming a default environment you access it from within a Scene by using the `this.spine` reference.\r\n * \r\n * When this plugin is installed into a Scene it will add a Loader File Type, allowing you to load\r\n * Spine files directly, i.e.:\r\n * \r\n * ```javascript\r\n * this.load.spine('stretchyman', 'stretchyman-pro.json', [ 'stretchyman-pma.atlas' ], true);\r\n * ```\r\n * \r\n * It also installs a Game Object Factory method, allowin you to create Spine Game Objects:\r\n * \r\n * ```javascript\r\n * this.add.spine(512, 650, 'stretchyman')\r\n * ```\r\n * \r\n * The first argument is the key which you used when importing the Spine data. There are lots of\r\n * things you can specify, such as the animation name, skeleton, slot attachments and more. Please\r\n * see the respective documentation and examples for further details.\r\n * \r\n * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary.\r\n * The associated atlas files are scanned for any texture files present in them, which are then loaded.\r\n * If you have exported your Spine data with preMultipiedAlpha set, then you should enable this in the\r\n * load arguments, or you may see black outlines around skeleton textures.\r\n * \r\n * The Spine plugin is local to the Scene in which it is installed. This means a change to something,\r\n * such as the Skeleton Debug Renderer, in this Scene, will not impact the renderer in any other Scene.\r\n * The only exception to this is with the caches this plugin creates. Spine atlas and texture data are\r\n * stored in their own caches, which are global, meaning they're accessible from any Scene in your\r\n * game, regardless if the Scene loaded the Spine data or not.\r\n * \r\n * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference\r\n *\r\n * @class SpinePlugin\r\n * @memberOf Phaser\r\n * @extends Phaser.Plugins.ScenePlugin\r\n * @constructor\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Phaser Plugin Manager.\r\n */\r\nvar SpinePlugin = new Class({\r\n\r\n Extends: ScenePlugin,\r\n\r\n initialize:\r\n\r\n function SpinePlugin (scene, pluginManager)\r\n {\r\n ScenePlugin.call(this, scene, pluginManager);\r\n\r\n var game = pluginManager.game;\r\n\r\n /**\r\n * A read-only flag that indicates if the game is running under WebGL or Canvas.\r\n *\r\n * @name SpinePlugin#isWebGL\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.isWebGL = (game.config.renderType === 2);\r\n\r\n /**\r\n * A custom cache that stores the Spine atlas data.\r\n * \r\n * This cache is global across your game, allowing you to access Spine data loaded from other Scenes,\r\n * no matter which Scene you are in.\r\n *\r\n * @name SpinePlugin#cache\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.cache = game.cache.addCustom('spine');\r\n\r\n /**\r\n * A custom cache that stores the Spine Textures.\r\n * \r\n * This cache is global across your game, allowing you to access Spine data loaded from other Scenes,\r\n * no matter which Scene you are in.\r\n *\r\n * @name SpinePlugin#spineTextures\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.spineTextures = game.cache.addCustom('spineTextures');\r\n\r\n /**\r\n * A reference to the global JSON Cache.\r\n *\r\n * @name SpinePlugin#json\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.json = game.cache.json;\r\n\r\n /**\r\n * A reference to the global Texture Manager.\r\n *\r\n * @name SpinePlugin#textures\r\n * @type {Phaser.Textures.TextureManager}\r\n * @since 3.19.0\r\n */\r\n this.textures = game.textures;\r\n\r\n /**\r\n * A flag that sets if the Skeleton Renderers will render debug information over the top\r\n * of the skeleton or not.\r\n *\r\n * @name SpinePlugin#drawDebug\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.drawDebug = false;\r\n\r\n /**\r\n * The underlying WebGL context of the Phaser renderer.\r\n * \r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#gl\r\n * @type {WebGLRenderingContext}\r\n * @since 3.19.0\r\n */\r\n this.gl;\r\n\r\n /**\r\n * A reference to either the Canvas or WebGL Renderer that this Game is using.\r\n *\r\n * @name SpinePlugin#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.19.0\r\n */\r\n this.renderer;\r\n\r\n /**\r\n * An instance of the Spine WebGL Scene Renderer.\r\n * \r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#sceneRenderer\r\n * @type {spine.webgl.SceneRenderer}\r\n * @since 3.19.0\r\n */\r\n this.sceneRenderer;\r\n\r\n /**\r\n * An instance of the Spine Skeleton Renderer.\r\n *\r\n * @name SpinePlugin#skeletonRenderer\r\n * @type {(spine.canvas.SkeletonRenderer|spine.webgl.SkeletonRenderer)}\r\n * @since 3.19.0\r\n */\r\n this.skeletonRenderer;\r\n\r\n /**\r\n * An instance of the Spine Skeleton Debug Renderer.\r\n * \r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#skeletonDebugRenderer\r\n * @type {spine.webgl.skeletonDebugRenderer}\r\n * @since 3.19.0\r\n */\r\n this.skeletonDebugRenderer;\r\n\r\n /**\r\n * A reference to the Spine runtime.\r\n * This is the runtime created by Esoteric Software\r\n *\r\n * @name SpinePlugin#plugin\r\n * @type {spine}\r\n * @since 3.19.0\r\n */\r\n this.plugin = Spine;\r\n\r\n /**\r\n * An internal vector3 used by the screen to world method.\r\n *\r\n * @name SpinePlugin#temp1\r\n * @private\r\n * @type {spine.webgl.Vector3}\r\n * @since 3.19.0\r\n */\r\n this.temp1;\r\n\r\n /**\r\n * An internal vector3 used by the screen to world method.\r\n *\r\n * @name SpinePlugin#temp2\r\n * @private\r\n * @type {spine.webgl.Vector3}\r\n * @since 3.19.0\r\n */\r\n this.temp2;\r\n\r\n if (this.isWebGL)\r\n {\r\n this.runtime = Spine.webgl;\r\n\r\n this.renderer = game.renderer;\r\n this.gl = game.renderer.gl;\r\n\r\n this.getAtlas = this.getAtlasWebGL;\r\n }\r\n else\r\n {\r\n this.runtime = Spine.canvas;\r\n\r\n this.renderer = game.renderer;\r\n\r\n this.getAtlas = this.getAtlasCanvas;\r\n }\r\n\r\n pluginManager.registerFileType('spine', this.spineFileCallback, scene);\r\n\r\n pluginManager.registerGameObject('spine', this.add.bind(this), this.make.bind(this));\r\n },\r\n\r\n /**\r\n * Internal boot handler.\r\n *\r\n * @method SpinePlugin#boot\r\n * @private\r\n * @since 3.19.0\r\n */\r\n boot: function ()\r\n {\r\n if (this.isWebGL)\r\n {\r\n this.bootWebGL();\r\n this.onResize();\r\n this.game.scale.on(ResizeEvent, this.onResize, this);\r\n }\r\n else\r\n {\r\n this.bootCanvas();\r\n }\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.once('shutdown', this.shutdown, this);\r\n eventEmitter.once('destroy', this.destroy, this);\r\n },\r\n\r\n /**\r\n * Internal boot handler for the Canvas Renderer.\r\n *\r\n * @method SpinePlugin#bootCanvas\r\n * @private\r\n * @since 3.19.0\r\n */\r\n bootCanvas: function ()\r\n {\r\n this.skeletonRenderer = new Spine.canvas.SkeletonRenderer(this.scene.sys.context);\r\n },\r\n\r\n /**\r\n * Internal boot handler for the WebGL Renderer.\r\n *\r\n * @method SpinePlugin#bootWebGL\r\n * @private\r\n * @since 3.19.0\r\n */\r\n bootWebGL: function ()\r\n {\r\n this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true);\r\n\r\n // Monkeypatch the Spine setBlendMode functions, or batching is destroyed\r\n\r\n var setBlendMode = function (srcBlend, dstBlend)\r\n {\r\n if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend)\r\n {\r\n var gl = this.context.gl;\r\n\r\n this.srcBlend = srcBlend;\r\n this.dstBlend = dstBlend;\r\n\r\n if (this.isDrawing)\r\n {\r\n this.flush();\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n }\r\n }\r\n };\r\n\r\n this.sceneRenderer.batcher.setBlendMode = setBlendMode;\r\n this.sceneRenderer.shapes.setBlendMode = setBlendMode;\r\n\r\n this.skeletonRenderer = this.sceneRenderer.skeletonRenderer;\r\n this.skeletonDebugRenderer = this.sceneRenderer.skeletonDebugRenderer;\r\n\r\n this.temp1 = new Spine.webgl.Vector3(0, 0, 0);\r\n this.temp2 = new Spine.webgl.Vector3(0, 0, 0);\r\n },\r\n\r\n /**\r\n * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas,\r\n * then returns it. You do not normally need to invoke this method directly.\r\n *\r\n * @method SpinePlugin#getAtlasCanvas\r\n * @since 3.19.0\r\n * \r\n * @param {string} key - The key of the Spine Atlas to create.\r\n * \r\n * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.\r\n */\r\n getAtlasCanvas: function (key)\r\n {\r\n var atlasEntry = this.cache.get(key);\r\n\r\n if (!atlasEntry)\r\n {\r\n console.warn('No atlas data for: ' + key);\r\n return;\r\n }\r\n\r\n var atlas;\r\n var spineTextures = this.spineTextures;\r\n\r\n if (spineTextures.has(key))\r\n {\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function ()\r\n {\r\n return spineTextures.get(key);\r\n });\r\n }\r\n else\r\n {\r\n var textures = this.textures;\r\n\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)\r\n {\r\n var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage());\r\n\r\n spineTextures.add(key, canvasTexture);\r\n\r\n return canvasTexture;\r\n });\r\n }\r\n\r\n return atlas;\r\n },\r\n\r\n /**\r\n * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas,\r\n * then returns it. You do not normally need to invoke this method directly.\r\n *\r\n * @method SpinePlugin#getAtlasWebGL\r\n * @since 3.19.0\r\n * \r\n * @param {string} key - The key of the Spine Atlas to create.\r\n * \r\n * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.\r\n */\r\n getAtlasWebGL: function (key)\r\n {\r\n var atlasEntry = this.cache.get(key);\r\n\r\n if (!atlasEntry)\r\n {\r\n console.warn('No atlas data for: ' + key);\r\n return;\r\n }\r\n\r\n var atlas;\r\n var spineTextures = this.spineTextures;\r\n\r\n if (spineTextures.has(key))\r\n {\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function ()\r\n {\r\n return spineTextures.get(key);\r\n });\r\n }\r\n else\r\n {\r\n var textures = this.textures;\r\n\r\n var gl = this.sceneRenderer.context.gl;\r\n\r\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\r\n\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)\r\n {\r\n var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage(), false);\r\n\r\n spineTextures.add(key, glTexture);\r\n\r\n return glTexture;\r\n });\r\n }\r\n\r\n return atlas;\r\n },\r\n\r\n /**\r\n * Adds a Spine Skeleton and Atlas file, or array of files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.spine('spineBoy', 'boy.json', 'boy.atlas', true);\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n * \r\n * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary. The associated\r\n * atlas files are scanned for any texture files present in them, which are then loaded. If you have exported\r\n * your Spine data with preMultipiedAlpha set, then you should enable this in the arguments, or you may see black\r\n * outlines around skeleton textures.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global Spine cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Spine cache.\r\n * Loading a file using a key that is already taken will result in a warning.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.spine({\r\n * key: 'mainmenu',\r\n * jsonURL: 'boy.json',\r\n * atlasURL: 'boy.atlas',\r\n * preMultipliedAlpha: true\r\n * });\r\n * ```\r\n * \r\n * If you need to load multiple Spine atlas files, provide them as an array:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.spine('demos', 'demos.json', [ 'atlas1.atlas', 'atlas2.atlas' ], true);\r\n * }\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.SpineFileConfig` for more details.\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the data from the Spine plugin.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Spine Plugin has been built or loaded into Phaser.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#spine\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.19.0\r\n *\r\n * @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.\r\n * @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\".\r\n * @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\".\r\n * @param {boolean} [preMultipiedAlpha=false] - Do the texture files include pre-multiplied alpha or not?\r\n * @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.\r\n * @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.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\n spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)\r\n {\r\n var multifile;\r\n \r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new SpineFile(this, key[i]);\r\n \r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n \r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a new Spine Game Object and adds it to the Scene.\r\n * \r\n * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from\r\n * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects\r\n * do not have a Phaser origin.\r\n * \r\n * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period\r\n * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains\r\n * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference\r\n * that.\r\n * \r\n * ```javascript\r\n * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);\r\n * ```\r\n * \r\n * The key is optional. If not passed here, you need to call `SpineGameObject.setSkeleton()` to use it.\r\n * \r\n * The animation name is also optional and can be set later via `SpineGameObject.setAnimation`.\r\n * \r\n * Should you wish for more control over the object creation, such as setting a slot attachment or skin\r\n * name, then use `SpinePlugin.make` instead.\r\n *\r\n * @method SpinePlugin#add\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin.\r\n * @param {string} [animationName] - The name of the animation to set on this Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation playback be looped or not?\r\n *\r\n * @return {SpineGameObject} The Game Object that was created.\r\n */\r\n add: function (x, y, key, animationName, loop)\r\n {\r\n var spineGO = new SpineGameObject(this.scene, this, x, y, key, animationName, loop);\r\n\r\n this.scene.sys.displayList.add(spineGO);\r\n this.scene.sys.updateList.add(spineGO);\r\n \r\n return spineGO;\r\n },\r\n\r\n /**\r\n * Creates a new Spine Game Object from the given configuration file and optionally adds it to the Scene.\r\n * \r\n * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from\r\n * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects\r\n * do not have a Phaser origin.\r\n * \r\n * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period\r\n * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains\r\n * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference\r\n * that.\r\n * \r\n * ```javascript\r\n * let jelly = this.make.spine({\r\n * x: 500, y: 500, key: 'jelly',\r\n * scale: 1.5,\r\n * skinName: 'square_Green',\r\n * animationName: 'jelly-idle', loop: true,\r\n * slotName: 'hat', attachmentName: 'images/La_14'\r\n * });\r\n * ```\r\n *\r\n * @method SpinePlugin#make\r\n * @since 3.19.0\r\n *\r\n * @param {any} config - The configuration object this Game Object will use to create itself.\r\n * @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.\r\n *\r\n * @return {SpineGameObject} The Game Object that was created.\r\n */\r\n make: function (config, addToScene)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetValue(config, 'key', null);\r\n var animationName = GetValue(config, 'animationName', null);\r\n var loop = GetValue(config, 'loop', false);\r\n\r\n var spineGO = new SpineGameObject(this.scene, this, 0, 0, key, animationName, loop);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, spineGO, config);\r\n\r\n // Spine specific\r\n var skinName = GetValue(config, 'skinName', false);\r\n\r\n if (skinName)\r\n {\r\n spineGO.setSkinByName(skinName);\r\n }\r\n\r\n var slotName = GetValue(config, 'slotName', false);\r\n var attachmentName = GetValue(config, 'attachmentName', null);\r\n\r\n if (slotName)\r\n {\r\n spineGO.setAttachment(slotName, attachmentName);\r\n }\r\n\r\n return spineGO.refresh();\r\n },\r\n\r\n /**\r\n * Converts the given x and y screen coordinates into the world space of the given Skeleton.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#worldToLocal\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The screen space x coordinate to convert.\r\n * @param {number} y - The screen space y coordinate to convert.\r\n * @param {spine.Skeleton} skeleton - The Spine Skeleton to convert into.\r\n * @param {spine.Bone} [bone] - Optional bone of the Skeleton to convert into.\r\n * \r\n * @return {spine.Vector2} A Vector2 containing the translated point.\r\n */\r\n worldToLocal: function (x, y, skeleton, bone)\r\n {\r\n var temp1 = this.temp1;\r\n var temp2 = this.temp2;\r\n var camera = this.sceneRenderer.camera;\r\n\r\n temp1.set(x + skeleton.x, y - skeleton.y, 0);\r\n\r\n var width = camera.viewportWidth;\r\n var height = camera.viewportHeight;\r\n\r\n camera.screenToWorld(temp1, width, height);\r\n\r\n if (bone && bone.parent !== null)\r\n {\r\n bone.parent.worldToLocal(temp2.set(temp1.x - skeleton.x, temp1.y - skeleton.y, 0));\r\n\r\n return new Spine.Vector2(temp2.x, temp2.y);\r\n }\r\n else if (bone)\r\n {\r\n return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y);\r\n }\r\n else\r\n {\r\n return new Spine.Vector2(temp1.x, temp1.y);\r\n }\r\n },\r\n\r\n /**\r\n * Returns a Spine Vector2 based on the given x and y values.\r\n *\r\n * @method SpinePlugin#getVector2\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The Vector x value.\r\n * @param {number} y - The Vector y value.\r\n * \r\n * @return {spine.Vector2} A Spine Vector2 based on the given values.\r\n */\r\n getVector2: function (x, y)\r\n {\r\n return new Spine.Vector2(x, y);\r\n },\r\n\r\n /**\r\n * Returns a Spine Vector2 based on the given x, y and z values.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#getVector3\r\n * @since 3.19.0\r\n * \r\n * @param {number} x - The Vector x value.\r\n * @param {number} y - The Vector y value.\r\n * @param {number} z - The Vector z value.\r\n * \r\n * @return {spine.Vector2} A Spine Vector2 based on the given values.\r\n */\r\n getVector3: function (x, y, z)\r\n {\r\n return new Spine.webgl.Vector3(x, y, z);\r\n },\r\n\r\n /**\r\n * Sets `drawBones` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugBones\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugBones: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawBones = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawRegionAttachments` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugRegionAttachments\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugRegionAttachments: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawRegionAttachments = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawBoundingBoxes` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugBoundingBoxes\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugBoundingBoxes: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawBoundingBoxes = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawMeshHull` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugMeshHull\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugMeshHull: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawMeshHull = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawMeshTriangles` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugMeshTriangles\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugMeshTriangles: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawMeshTriangles = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawPaths` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugPaths\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugPaths: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawPaths = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawSkeletonXY` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugSkeletonXY\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugSkeletonXY: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawSkeletonXY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawClipping` in the Spine Skeleton Debug Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugClipping\r\n * @since 3.19.0\r\n * \r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugClipping: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawClipping = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the given vertex effect on the Spine Skeleton Renderer.\r\n * \r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setEffect\r\n * @since 3.19.0\r\n * \r\n * @param {spine.VertexEffect} [effect] - The vertex effect to set on the Skeleton Renderer.\r\n * \r\n * @return {this} This Spine Plugin.\r\n */\r\n setEffect: function (effect)\r\n {\r\n this.sceneRenderer.skeletonRenderer.vertexEffect = effect;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a Spine Skeleton based on the given key and optional Skeleton JSON data.\r\n * \r\n * The Skeleton data should have already been loaded before calling this method.\r\n *\r\n * @method SpinePlugin#createSkeleton\r\n * @since 3.19.0\r\n * \r\n * @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`.\r\n * @param {object} [skeletonJSON] - Optional Skeleton JSON data to use, instead of getting it from the cache.\r\n * \r\n * @return {(any|null)} This Spine Skeleton data object, or `null` if the key was invalid.\r\n */\r\n createSkeleton: function (key, skeletonJSON)\r\n {\r\n var atlasKey = key;\r\n var jsonKey = key;\r\n var split = (key.indexOf('.') !== -1);\r\n\r\n if (split)\r\n {\r\n var parts = key.split('.');\r\n\r\n atlasKey = parts.shift();\r\n jsonKey = parts.join('.');\r\n }\r\n\r\n var atlasData = this.cache.get(atlasKey);\r\n var atlas = this.getAtlas(atlasKey);\r\n\r\n if (!atlas)\r\n {\r\n return null;\r\n }\r\n\r\n var preMultipliedAlpha = atlasData.preMultipliedAlpha;\r\n\r\n var atlasLoader = new Spine.AtlasAttachmentLoader(atlas);\r\n \r\n var skeletonJson = new Spine.SkeletonJson(atlasLoader);\r\n\r\n var data;\r\n\r\n if (skeletonJSON)\r\n {\r\n data = skeletonJSON;\r\n }\r\n else\r\n {\r\n var json = this.json.get(atlasKey);\r\n\r\n data = (split) ? GetValue(json, jsonKey) : json;\r\n }\r\n\r\n if (data)\r\n {\r\n var skeletonData = skeletonJson.readSkeletonData(data);\r\n\r\n var skeleton = new Spine.Skeleton(skeletonData);\r\n \r\n return { skeletonData: skeletonData, skeleton: skeleton, preMultipliedAlpha: preMultipliedAlpha };\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n },\r\n\r\n /**\r\n * Creates a new Animation State and Animation State Data for the given skeleton.\r\n * \r\n * The returned object contains two properties: `state` and `stateData` respectively.\r\n *\r\n * @method SpinePlugin#createAnimationState\r\n * @since 3.19.0\r\n * \r\n * @param {spine.Skeleton} skeleton - The Skeleton to create the Animation State for.\r\n * \r\n * @return {any} An object containing the Animation State and Animation State Data instances.\r\n */\r\n createAnimationState: function (skeleton)\r\n {\r\n var stateData = new Spine.AnimationStateData(skeleton.data);\r\n\r\n var state = new Spine.AnimationState(stateData);\r\n\r\n return { stateData: stateData, state: state };\r\n },\r\n\r\n /**\r\n * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * \r\n * The returned object contains two properties: `offset` and `size`:\r\n * \r\n * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * `size` - The width and height of the AABB.\r\n *\r\n * @method SpinePlugin#getBounds\r\n * @since 3.19.0\r\n * \r\n * @param {spine.Skeleton} skeleton - The Skeleton to get the bounds from.\r\n * \r\n * @return {any} The bounds object.\r\n */\r\n getBounds: function (skeleton)\r\n {\r\n var offset = new Spine.Vector2();\r\n var size = new Spine.Vector2();\r\n\r\n skeleton.getBounds(offset, size, []);\r\n\r\n return { offset: offset, size: size };\r\n },\r\n\r\n /**\r\n * Internal handler for when the renderer resizes.\r\n * \r\n * Only called if running in WebGL.\r\n *\r\n * @method SpinePlugin#onResize\r\n * @since 3.19.0\r\n */\r\n onResize: function ()\r\n {\r\n var renderer = this.renderer;\r\n var sceneRenderer = this.sceneRenderer;\r\n\r\n var viewportWidth = renderer.width;\r\n var viewportHeight = renderer.height;\r\n\r\n sceneRenderer.camera.position.x = viewportWidth / 2;\r\n sceneRenderer.camera.position.y = viewportHeight / 2;\r\n \r\n sceneRenderer.camera.viewportWidth = viewportWidth;\r\n sceneRenderer.camera.viewportHeight = viewportHeight;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * \r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method SpinePlugin#shutdown\r\n * @private\r\n * @since 3.19.0\r\n */\r\n shutdown: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off('shutdown', this.shutdown, this);\r\n\r\n this.sceneRenderer.dispose();\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * \r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method SpinePlugin#destroy\r\n * @private\r\n * @since 3.19.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.pluginManager.removeGameObject('spine', true, true);\r\n\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n\r\n this.cache = null;\r\n this.spineTextures = null;\r\n this.json = null;\r\n this.textures = null;\r\n this.sceneRenderer = null;\r\n this.skeletonRenderer = null;\r\n this.gl = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpinePlugin;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#COMPLETE\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'complete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#DISPOSE\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'dispose';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#END\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'end';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#EVENT\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'event';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#INTERRUPTED\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'interrupted';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Complete Event.\r\n *\r\n * @event SpinePluginEvents#START\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace SpinePluginEvents\r\n */\r\n\r\nmodule.exports = {\r\n\r\n COMPLETE: require('./COMPLETE_EVENT'),\r\n DISPOSE: require('./DISPOSE_EVENT'),\r\n END: require('./END_EVENT'),\r\n EVENT: require('./EVENT_EVENT'),\r\n INTERRUPTED: require('./INTERRUPTED_EVENT'),\r\n START: require('./START_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar AngleBetween = require('../../../../src/math/angle/Between');\r\nvar Clamp = require('../../../../src/math/Clamp');\r\nvar Class = require('../../../../src/utils/Class');\r\nvar ComponentsComputedSize = require('../../../../src/gameobjects/components/ComputedSize');\r\nvar ComponentsDepth = require('../../../../src/gameobjects/components/Depth');\r\nvar ComponentsFlip = require('../../../../src/gameobjects/components/Flip');\r\nvar ComponentsScrollFactor = require('../../../../src/gameobjects/components/ScrollFactor');\r\nvar ComponentsTransform = require('../../../../src/gameobjects/components/Transform');\r\nvar ComponentsVisible = require('../../../../src/gameobjects/components/Visible');\r\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\r\nvar DegToRad = require('../../../../src/math/DegToRad');\r\nvar GameObject = require('../../../../src/gameobjects/GameObject');\r\nvar RadToDeg = require('../../../../src/math/RadToDeg');\r\nvar SpineEvents = require('../events/');\r\nvar SpineGameObjectRender = require('./SpineGameObjectRender');\r\n\r\n/**\r\n * @classdesc\r\n * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates\r\n * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to\r\n * easily change the skin, slot attachment, bone positions and more.\r\n * \r\n * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly.\r\n * You can only create them if the Spine plugin has been loaded into Phaser.\r\n * \r\n * The quickest way is the Game Object Factory:\r\n * \r\n * ```javascript\r\n * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);\r\n * ```\r\n * \r\n * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly`\r\n * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is\r\n * an optional animation to start playing on the skeleton. The final argument `true` sets the\r\n * animation to loop. Look at the documentation for further details on each of these options.\r\n * \r\n * For more control, you can use the Game Object Creator, passing in a Spine Game Object\r\n * Configuration object:\r\n * \r\n * ```javascript\r\n * let jelly = this.make.spine({\r\n * x: 512, y: 550, key: 'jelly',\r\n * scale: 1.5,\r\n * skinName: 'square_Green',\r\n * animationName: 'jelly-think', loop: true,\r\n * slotName: 'hat', attachmentName: 'images/La_14'\r\n * });\r\n * ```\r\n * \r\n * Here, you've got the ability to specify extra details, such as the slot name, attachments or\r\n * overall scale.\r\n * \r\n * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to\r\n * update and render, it must be added to the display and update lists of your Scene:\r\n * \r\n * ```javascript\r\n * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true);\r\n * this.sys.displayList.add(jelly);\r\n * this.sys.updateList.add(jelly);\r\n * ```\r\n * \r\n * It's possible to enable Spine Game Objects for input, but you should be aware that it will use\r\n * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but\r\n * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created.\r\n * If it's not suitable, provide your own shape to the `setInteractive` method.\r\n * \r\n * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for\r\n * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game\r\n * Object position with it. See the examples for further details.\r\n * \r\n * If your Spine Game Object has black outlines around the different parts of the texture when it\r\n * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have\r\n * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details.\r\n *\r\n * @class SpineGameObject\r\n * @constructor\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to.\r\n * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin.\r\n * @param {string} [animationName] - The name of the animation to set on this Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation playback be looped or not?\r\n */\r\nvar SpineGameObject = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n ComponentsComputedSize,\r\n ComponentsDepth,\r\n ComponentsFlip,\r\n ComponentsScrollFactor,\r\n ComponentsTransform,\r\n ComponentsVisible,\r\n SpineGameObjectRender\r\n ],\r\n\r\n initialize:\r\n\r\n function SpineGameObject (scene, plugin, x, y, key, animationName, loop)\r\n {\r\n GameObject.call(this, scene, 'Spine');\r\n\r\n /**\r\n * A reference to the Spine Plugin.\r\n *\r\n * @name SpineGameObject#plugin\r\n * @type {SpinePlugin}\r\n * @since 3.19.0\r\n */\r\n this.plugin = plugin;\r\n\r\n /**\r\n * The Spine Skeleton this Game Object is using.\r\n *\r\n * @name SpineGameObject#skeleton\r\n * @type {spine.Skeleton}\r\n * @since 3.19.0\r\n */\r\n this.skeleton = null;\r\n\r\n /**\r\n * The Spine Skeleton Data associated with the Skeleton this Game Object is using.\r\n *\r\n * @name SpineGameObject#skeletonData\r\n * @type {spine.SkeletonData}\r\n * @since 3.19.0\r\n */\r\n this.skeletonData = null;\r\n\r\n /**\r\n * The Spine Animation State this Game Object is using.\r\n *\r\n * @name SpineGameObject#state\r\n * @type {spine.AnimationState}\r\n * @since 3.19.0\r\n */\r\n this.state = null;\r\n\r\n /**\r\n * The Spine Animation State Data associated with the Animation State this Game Object is using.\r\n *\r\n * @name SpineGameObject#stateData\r\n * @type {spine.AnimationStateData}\r\n * @since 3.19.0\r\n */\r\n this.stateData = null;\r\n\r\n /**\r\n * A reference to the root bone of the Skeleton.\r\n *\r\n * @name SpineGameObject#root\r\n * @type {spine.Bone}\r\n * @since 3.19.0\r\n */\r\n this.root = null;\r\n\r\n /**\r\n * This object holds the calculated bounds of the current\r\n * pose, as set when a new Skeleton is applied.\r\n *\r\n * @name SpineGameObject#bounds\r\n * @type {any}\r\n * @since 3.19.0\r\n */\r\n this.bounds = null;\r\n \r\n /**\r\n * A Game Object level flag that allows you to enable debug drawing\r\n * to the Skeleton Debug Renderer by toggling it.\r\n *\r\n * @name SpineGameObject#drawDebug\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.drawDebug = false;\r\n\r\n /**\r\n * The factor to scale the Animation update time by.\r\n *\r\n * @name SpineGameObject#timeScale\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.timeScale = 1;\r\n\r\n /**\r\n * The calculated Display Origin of this Game Object.\r\n *\r\n * @name SpineGameObject#displayOriginX\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.displayOriginX = 0;\r\n\r\n /**\r\n * The calculated Display Origin of this Game Object.\r\n *\r\n * @name SpineGameObject#displayOriginY\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.displayOriginY = 0;\r\n\r\n /**\r\n * A flag that stores if the texture associated with the current\r\n * Skin being used by this Game Object, has its alpha pre-multiplied\r\n * into it, or not.\r\n *\r\n * @name SpineGameObject#preMultipliedAlpha\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.preMultipliedAlpha = false;\r\n\r\n /**\r\n * A default Blend Mode. You cannot change the blend mode of a\r\n * Spine Game Object.\r\n *\r\n * @name SpineGameObject#blendMode\r\n * @type {number}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.blendMode = 0;\r\n\r\n this.setPosition(x, y);\r\n\r\n if (key)\r\n {\r\n this.setSkeleton(key, animationName, loop);\r\n }\r\n },\r\n\r\n /**\r\n * Overrides the default Game Object method and always returns true.\r\n * Rendering is decided in the renderer functions.\r\n *\r\n * @method SpineGameObject#willRender\r\n * @since 3.19.0\r\n *\r\n * @return {boolean} Always returns `true`.\r\n */\r\n willRender: function ()\r\n {\r\n return true;\r\n },\r\n\r\n /**\r\n * Set the Alpha level for the whole Skeleton of this Game Object.\r\n * \r\n * The alpha controls the opacity of the Game Object as it renders.\r\n * \r\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\r\n *\r\n * @method SpineGameObject#setAlpha\r\n * @since 3.19.0\r\n *\r\n * @param {number} [value=1] - The alpha value used for the whole Skeleton.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAlpha: function (value, slotName)\r\n {\r\n if (value === undefined) { value = 1; }\r\n\r\n if (slotName)\r\n {\r\n var slot = this.findSlot(slotName);\r\n\r\n if (slot)\r\n {\r\n slot.color.a = Clamp(value, 0, 1);\r\n }\r\n }\r\n else\r\n {\r\n this.alpha = value;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The alpha value of the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#alpha\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n alpha: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.a;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.a = v;\r\n }\r\n\r\n if (v === 0)\r\n {\r\n this.renderFlags &= ~2;\r\n }\r\n else\r\n {\r\n this.renderFlags |= 2;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of red used when rendering the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#red\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n red: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.r;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.r = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of green used when rendering the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#green\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n green: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.g;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.g = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of blue used when rendering the Skeleton.\r\n * \r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#blue\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n blue: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.b;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.b = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton.\r\n *\r\n * @method SpineGameObject#setColor\r\n * @since 3.19.0\r\n *\r\n * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color.\r\n * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setColor: function (color, slotName)\r\n {\r\n if (color === undefined) { color = 0xffffff; }\r\n\r\n var red = (color >> 16 & 0xFF) / 255;\r\n var green = (color >> 8 & 0xFF) / 255;\r\n var blue = (color & 0xFF) / 255;\r\n var alpha = (color > 16777215) ? (color >>> 24) / 255 : null;\r\n\r\n var target = this.skeleton;\r\n\r\n if (slotName)\r\n {\r\n var slot = this.findSlot(slotName);\r\n\r\n if (slot)\r\n {\r\n target = slot;\r\n }\r\n }\r\n\r\n target.color.r = red;\r\n target.color.g = green;\r\n target.color.b = blue;\r\n\r\n if (alpha !== null)\r\n {\r\n target.color.a = alpha;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object\r\n * that contains the Skeleton data.\r\n *\r\n * @method SpineGameObject#setSkeletonFromJSON\r\n * @since 3.19.0\r\n * \r\n * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton.\r\n * @param {object} skeletonJSON - The JSON data for the Skeleton.\r\n * @param {string} [animationName] - Optional name of the animation to set on the Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation, if set, loop or not?\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop)\r\n {\r\n return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop);\r\n },\r\n\r\n /**\r\n * Sets this Game Object to use the given Skeleton based on its cache key.\r\n * \r\n * Typically, once set, the Skeleton doesn't change. Instead, you change the skin,\r\n * or slot attachment, or any other property to adjust it.\r\n *\r\n * @method SpineGameObject#setSkeleton\r\n * @since 3.19.0\r\n * \r\n * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton.\r\n * @param {object} skeletonJSON - The JSON data for the Skeleton.\r\n * @param {string} [animationName] - Optional name of the animation to set on the Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation, if set, loop or not?\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON)\r\n {\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON);\r\n\r\n this.skeletonData = data.skeletonData;\r\n\r\n this.preMultipliedAlpha = data.preMultipliedAlpha;\r\n\r\n var skeleton = data.skeleton;\r\n\r\n skeleton.setSkinByName('default');\r\n skeleton.setToSetupPose();\r\n\r\n this.skeleton = skeleton;\r\n\r\n // AnimationState\r\n data = this.plugin.createAnimationState(skeleton);\r\n\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n this.state = data.state;\r\n this.stateData = data.stateData;\r\n\r\n this.state.addListener({\r\n event: this.onEvent.bind(this),\r\n complete: this.onComplete.bind(this),\r\n start: this.onStart.bind(this),\r\n end: this.onEnd.bind(this),\r\n dispose: this.onDispose.bind(this),\r\n interrupted: this.onInterrupted.bind(this)\r\n });\r\n\r\n if (animationName)\r\n {\r\n this.setAnimation(0, animationName, loop);\r\n }\r\n\r\n this.root = this.getRootBone();\r\n\r\n if (this.root)\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90;\r\n }\r\n\r\n this.state.apply(skeleton);\r\n\r\n skeleton.updateCache();\r\n\r\n return this.updateSize();\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onComplete event via this Game Object.\r\n *\r\n * @method SpineGameObject#onComplete\r\n * @fires SpinePluginEvents#COMPLETE\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onComplete: function (entry)\r\n {\r\n this.emit(SpineEvents.COMPLETE, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onDispose event via this Game Object.\r\n *\r\n * @method SpineGameObject#onDispose\r\n * @fires SpinePluginEvents#DISPOSE\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onDispose: function (entry)\r\n {\r\n this.emit(SpineEvents.DISPOSE, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onEnd event via this Game Object.\r\n *\r\n * @method SpineGameObject#onEnd\r\n * @fires SpinePluginEvents#END\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onEnd: function (entry)\r\n {\r\n this.emit(SpineEvents.END, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine Event event via this Game Object.\r\n *\r\n * @method SpineGameObject#onEvent\r\n * @fires SpinePluginEvents#EVENT\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n * @param {spine.Event} event - The Spine event.\r\n */\r\n onEvent: function (entry, event)\r\n {\r\n this.emit(SpineEvents.EVENT, entry, event);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onInterrupted event via this Game Object.\r\n *\r\n * @method SpineGameObject#onInterrupted\r\n * @fires SpinePluginEvents#INTERRUPTED\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onInterrupted: function (entry)\r\n {\r\n this.emit(SpineEvents.INTERRUPTED, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onStart event via this Game Object.\r\n *\r\n * @method SpineGameObject#onStart\r\n * @fires SpinePluginEvents#START\r\n * @private\r\n * @since 3.19.0\r\n * \r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onStart: function (entry)\r\n {\r\n this.emit(SpineEvents.START, entry);\r\n },\r\n\r\n /**\r\n * Refreshes the data about the current Skeleton.\r\n * \r\n * This will reset the rotation, position and size of the Skeleton to match this Game Object.\r\n * \r\n * Call this method if you need to access the Skeleton data directly, and it may have changed\r\n * recently.\r\n *\r\n * @method SpineGameObject#refresh\r\n * @since 3.19.0\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n refresh: function ()\r\n {\r\n if (this.root)\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90;\r\n }\r\n\r\n this.updateSize();\r\n\r\n this.skeleton.updateCache();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the size of this Game Object.\r\n * \r\n * If no arguments are given it uses the current skeleton data dimensions.\r\n * \r\n * You can use this method to set a fixed size of this Game Object, such as for input detection,\r\n * when the skeleton data doesn't match what is required in-game.\r\n *\r\n * @method SpineGameObject#setSize\r\n * @since 3.19.0\r\n * \r\n * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width.\r\n * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height.\r\n * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate.\r\n * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate.\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n setSize: function (width, height, offsetX, offsetY)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n if (width === undefined) { width = skeleton.data.width; }\r\n if (height === undefined) { height = skeleton.data.height; }\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n this.displayOriginX = skeleton.x - offsetX;\r\n this.displayOriginY = skeleton.y - offsetY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the offset of this Game Object from the Skeleton position.\r\n * \r\n * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using.\r\n *\r\n * @method SpineGameObject#setOffset\r\n * @since 3.19.0\r\n * \r\n * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate.\r\n * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate.\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n setOffset: function (offsetX, offsetY)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n this.displayOriginX = skeleton.x - offsetX;\r\n this.displayOriginY = skeleton.y - offsetY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that syncs all of the Game Object position and scale data to the Skeleton.\r\n * It then syncs the skeleton bounds back to this Game Object.\r\n * \r\n * This method is called automatically as needed internally, however, it's also exposed should\r\n * you require overriding the size settings.\r\n *\r\n * @method SpineGameObject#updateSize\r\n * @since 3.19.0\r\n * \r\n * @return {this} This Game Object.\r\n */\r\n updateSize: function ()\r\n {\r\n var skeleton = this.skeleton;\r\n var renderer = this.plugin.renderer;\r\n\r\n var height = renderer.height;\r\n\r\n var oldScaleX = this.scaleX;\r\n var oldScaleY = this.scaleY;\r\n\r\n skeleton.x = this.x;\r\n skeleton.y = height - this.y;\r\n skeleton.scaleX = 1;\r\n skeleton.scaleY = 1;\r\n\r\n skeleton.updateWorldTransform();\r\n\r\n var bounds = this.getBounds();\r\n\r\n this.width = bounds.size.x;\r\n this.height = bounds.size.y;\r\n\r\n this.displayOriginX = this.x - bounds.offset.x;\r\n this.displayOriginY = this.y - (height - (this.height + bounds.offset.y));\r\n\r\n skeleton.scaleX = oldScaleX;\r\n skeleton.scaleY = oldScaleY;\r\n\r\n skeleton.updateWorldTransform();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The horizontal scale of this Game Object, as applied to the Skeleton it is using.\r\n *\r\n * @name SpineGameObject#scaleX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.19.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n\r\n this.refresh();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of this Game Object, as applied to the Skeleton it is using.\r\n *\r\n * @name SpineGameObject#scaleY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.19.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleY = value;\r\n\r\n this.refresh();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the bones in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getBoneList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the bones in the Skeleton Data.\r\n */\r\n getBoneList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.bones.length; i++)\r\n {\r\n output.push(skeletonData.bones[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the skins in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getSkinList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the skins in the Skeleton Data.\r\n */\r\n getSkinList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.skins.length; i++)\r\n {\r\n output.push(skeletonData.skins[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the slots in the Skeleton.\r\n *\r\n * @method SpineGameObject#getSlotList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the slots in the Skeleton.\r\n */\r\n getSlotList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeleton = this.skeleton;\r\n\r\n for (var i = 0; i < skeleton.slots.length; i++)\r\n {\r\n output.push(skeleton.slots[i].data.name);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the animations in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getAnimationList\r\n * @since 3.19.0\r\n * \r\n * @return {string[]} An array containing the names of all the animations in the Skeleton Data.\r\n */\r\n getAnimationList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.animations.length; i++)\r\n {\r\n output.push(skeletonData.animations[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the current animation being played on the given track, if any.\r\n *\r\n * @method SpineGameObject#getCurrentAnimation\r\n * @since 3.19.0\r\n * \r\n * @param {integer} [trackIndex=0] - The track to return the current animation on.\r\n * \r\n * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation.\r\n */\r\n getCurrentAnimation: function (trackIndex)\r\n {\r\n if (trackIndex === undefined) { trackIndex = 0; }\r\n\r\n var current = this.state.getCurrent(trackIndex);\r\n\r\n if (current)\r\n {\r\n return current.animation;\r\n }\r\n },\r\n\r\n /**\r\n * Sets the current animation for a track, discarding any queued animations.\r\n * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from).\r\n * \r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n *\r\n * @method SpineGameObject#play\r\n * @fires SpinePluginEvents#START\r\n * @since 3.19.0\r\n *\r\n * @param {string} animationName - The string-based key of the animation to play.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call.\r\n *\r\n * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead.\r\n */\r\n play: function (animationName, loop, ignoreIfPlaying)\r\n {\r\n this.setAnimation(0, animationName, loop, ignoreIfPlaying);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current animation for a track, discarding any queued animations.\r\n * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from).\r\n * \r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n *\r\n * @method SpineGameObject#setAnimation\r\n * @fires SpinePluginEvents#START\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to play the animation on.\r\n * @param {string} animationName - The string-based key of the animation to play.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call.\r\n *\r\n * @return {spine.TrackEntry} A track entry to allow further customization of animation playback.\r\n */\r\n setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying)\r\n {\r\n if (loop === undefined) { loop = false; }\r\n if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; }\r\n\r\n if (ignoreIfPlaying && this.state)\r\n {\r\n var currentTrack = this.state.getCurrent(0);\r\n \r\n if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete())\r\n {\r\n return;\r\n }\r\n }\r\n\r\n if (this.findAnimation(animationName))\r\n {\r\n return this.state.setAnimation(trackIndex, animationName, loop);\r\n }\r\n },\r\n\r\n /**\r\n * Adds an animation to be played after the current or last queued animation for a track.\r\n * If the track is empty, it is equivalent to calling setAnimation.\r\n * \r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n * \r\n * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous\r\n * track entry minus any mix duration (from the AnimationStateData) plus the specified delay\r\n * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration).\r\n * If the previous entry is looping, its next loop completion is used instead of its duration.\r\n *\r\n * @method SpineGameObject#addAnimation\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n * @param {string} animationName - The string-based key of the animation to add.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played.\r\n *\r\n * @return {spine.TrackEntry} A track entry to allow further customization of animation playback.\r\n */\r\n addAnimation: function (trackIndex, animationName, loop, delay)\r\n {\r\n return this.state.addAnimation(trackIndex, animationName, loop, delay);\r\n },\r\n\r\n /**\r\n * Sets an empty animation for a track, discarding any queued animations, and sets the track\r\n * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out.\r\n * \r\n * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation,\r\n * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be\r\n * applied less and less over the mix duration. Properties keyed in the previous animation transition to\r\n * the value from lower tracks or to the setup pose value if no lower tracks key the property.\r\n * A mix duration of 0 still mixes out over one frame.\r\n * \r\n * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation\r\n * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new\r\n * animation to be applied more and more over the mix duration. Properties keyed in the new animation\r\n * transition from the value from lower tracks or from the setup pose value if no lower tracks key the\r\n * property to the value keyed in the new animation.\r\n *\r\n * @method SpineGameObject#setEmptyAnimation\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any).\r\n *\r\n * @return {spine.TrackEntry} The returned Track Entry.\r\n */\r\n setEmptyAnimation: function (trackIndex, mixDuration)\r\n {\r\n return this.state.setEmptyAnimation(trackIndex, mixDuration);\r\n },\r\n\r\n /**\r\n * Removes all animations from the track, leaving skeletons in their current pose.\r\n * \r\n * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose.\r\n *\r\n * @method SpineGameObject#clearTrack\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n clearTrack: function (trackIndex)\r\n {\r\n this.state.clearTrack(trackIndex);\r\n\r\n return this;\r\n },\r\n \r\n /**\r\n * Removes all animations from all tracks, leaving skeletons in their current pose.\r\n * \r\n * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose.\r\n *\r\n * @method SpineGameObject#clearTracks\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n clearTracks: function ()\r\n {\r\n this.state.clearTracks();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the skin used to look up attachments before looking in the defaultSkin.\r\n * \r\n * Attachments from the new skin are attached if the corresponding attachment from the\r\n * old skin was attached. If there was no old skin, each slot's setup mode attachment is\r\n * attached from the new skin.\r\n * \r\n * After changing the skin, the visible attachments can be reset to those attached in the\r\n * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time\r\n * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide\r\n * or show attachments from the new skin.\r\n *\r\n * @method SpineGameObject#setSkinByName\r\n * @since 3.19.0\r\n * \r\n * @param {string} skinName - The name of the skin to set.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkinByName: function (skinName)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n skeleton.setSkinByName(skinName);\r\n\r\n skeleton.setSlotsToSetupPose();\r\n\r\n this.state.apply(skeleton);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the skin used to look up attachments before looking in the defaultSkin.\r\n * \r\n * Attachments from the new skin are attached if the corresponding attachment from the\r\n * old skin was attached. If there was no old skin, each slot's setup mode attachment is\r\n * attached from the new skin.\r\n * \r\n * After changing the skin, the visible attachments can be reset to those attached in the\r\n * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time\r\n * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide\r\n * or show attachments from the new skin.\r\n *\r\n * @method SpineGameObject#setSkin\r\n * @since 3.19.0\r\n * \r\n * @param {?spine.Skin} newSkin - The Skin to set. May be `null`.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkin: function (newSkin)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n skeleton.setSkin(newSkin);\r\n\r\n skeleton.setSlotsToSetupPose();\r\n\r\n this.state.apply(skeleton);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the mix duration when changing from the specified animation to the other.\r\n *\r\n * @method SpineGameObject#setMix\r\n * @since 3.19.0\r\n * \r\n * @param {string} fromName - The animation to mix from.\r\n * @param {string} toName - The animation to mix to.\r\n * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any).\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setMix: function (fromName, toName, duration)\r\n {\r\n this.stateData.setMix(fromName, toName, duration);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Finds an attachment by looking in the skin and defaultSkin using the slot\r\n * index and attachment name. First the skin is checked and if the attachment was not found,\r\n * the default skin is checked.\r\n *\r\n * @method SpineGameObject#getAttachment\r\n * @since 3.19.0\r\n * \r\n * @param {integer} slotIndex - The slot index to search.\r\n * @param {string} attachmentName - The attachment name to look for.\r\n *\r\n * @return {?spine.Attachment} The Attachment, if found. May be null.\r\n */\r\n getAttachment: function (slotIndex, attachmentName)\r\n {\r\n return this.skeleton.getAttachment(slotIndex, attachmentName);\r\n },\r\n\r\n /**\r\n * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name.\r\n *\r\n * @method SpineGameObject#getAttachmentByName\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The slot name to search.\r\n * @param {string} attachmentName - The attachment name to look for.\r\n *\r\n * @return {?spine.Attachment} The Attachment, if found. May be null.\r\n */\r\n getAttachmentByName: function (slotName, attachmentName)\r\n {\r\n return this.skeleton.getAttachmentByName(slotName, attachmentName);\r\n },\r\n\r\n /**\r\n * A convenience method to set an attachment by finding the slot with findSlot,\r\n * finding the attachment with getAttachment, then setting the slot's attachment.\r\n *\r\n * @method SpineGameObject#setAttachment\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The slot name to add the attachment to.\r\n * @param {string} attachmentName - The attachment name to add.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAttachment: function (slotName, attachmentName)\r\n {\r\n if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length)\r\n {\r\n for (var i = 0; i < slotName.length; i++)\r\n {\r\n this.skeleton.setAttachment(slotName[i], attachmentName[i]);\r\n }\r\n }\r\n else\r\n {\r\n this.skeleton.setAttachment(slotName, attachmentName);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the bones, constraints, slots, and draw order to their setup pose values.\r\n *\r\n * @method SpineGameObject#setToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setToSetupPose: function ()\r\n {\r\n this.skeleton.setToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the slots and draw order to their setup pose values.\r\n *\r\n * @method SpineGameObject#setSlotsToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSlotsToSetupPose: function ()\r\n {\r\n this.skeleton.setSlotsToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the bones and constraints to their setup pose values.\r\n *\r\n * @method SpineGameObject#setBonesToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setBonesToSetupPose: function ()\r\n {\r\n this.skeleton.setBonesToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the root bone, or null.\r\n *\r\n * @method SpineGameObject#getRootBone\r\n * @since 3.19.0\r\n *\r\n * @return {spine.Bone} The root bone, or null.\r\n */\r\n getRootBone: function ()\r\n {\r\n return this.skeleton.getRootBone();\r\n },\r\n\r\n /**\r\n * Takes a Bone object and a position in world space and rotates the Bone so it is angled\r\n * towards the given position. You can set an optional angle offset, should the bone be\r\n * designed at a specific angle already. You can also set a minimum and maximum range for the angle.\r\n *\r\n * @method SpineGameObject#angleBoneToXY\r\n * @since 3.19.0\r\n * \r\n * @param {spine.Bone} bone - The bone to rotate towards the world position.\r\n * @param {number} worldX - The world x coordinate to rotate the bone towards.\r\n * @param {number} worldY - The world y coordinate to rotate the bone towards.\r\n * @param {number} [offset=0] - An offset to add to the rotation angle.\r\n * @param {number} [minAngle=0] - The minimum range of the rotation angle.\r\n * @param {number} [maxAngle=360] - The maximum range of the rotation angle.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle)\r\n {\r\n if (offset === undefined) { offset = 0; }\r\n if (minAngle === undefined) { minAngle = 0; }\r\n if (maxAngle === undefined) { maxAngle = 360; }\r\n\r\n var renderer = this.plugin.renderer;\r\n var height = renderer.height;\r\n\r\n var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset));\r\n\r\n bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Finds a bone by comparing each bone's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findBone\r\n * @since 3.19.0\r\n * \r\n * @param {string} boneName - The name of the bone to find.\r\n *\r\n * @return {spine.Bone} The bone, or null.\r\n */\r\n findBone: function (boneName)\r\n {\r\n return this.skeleton.findBone(boneName);\r\n },\r\n\r\n /**\r\n * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findBoneIndex\r\n * @since 3.19.0\r\n * \r\n * @param {string} boneName - The name of the bone to find.\r\n *\r\n * @return {integer} The bone index. Or -1 if the bone was not found.\r\n */\r\n findBoneIndex: function (boneName)\r\n {\r\n return this.skeleton.findBoneIndex(boneName);\r\n },\r\n\r\n /**\r\n * Finds a slot by comparing each slot's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSlot\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The name of the slot to find.\r\n *\r\n * @return {spine.Slot} The Slot. May be null.\r\n */\r\n findSlot: function (slotName)\r\n {\r\n return this.skeleton.findSlot(slotName);\r\n },\r\n\r\n /**\r\n * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSlotIndex\r\n * @since 3.19.0\r\n * \r\n * @param {string} slotName - The name of the slot to find.\r\n *\r\n * @return {integer} The slot index. Or -1 if the Slot was not found.\r\n */\r\n findSlotIndex: function (slotName)\r\n {\r\n return this.skeleton.findSlotIndex(slotName);\r\n },\r\n\r\n /**\r\n * Finds a skin by comparing each skin's name. It is more efficient to cache the results of\r\n * this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSkin\r\n * @since 3.19.0\r\n * \r\n * @param {string} skinName - The name of the skin to find.\r\n *\r\n * @return {spine.Skin} The Skin. May be null.\r\n */\r\n findSkin: function (skinName)\r\n {\r\n return this.skeletonData.findSkin(skinName);\r\n },\r\n\r\n /**\r\n * Finds an event by comparing each events's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findEvent\r\n * @since 3.19.0\r\n * \r\n * @param {string} eventDataName - The name of the event to find.\r\n *\r\n * @return {spine.EventData} The Event Data. May be null.\r\n */\r\n findEvent: function (eventDataName)\r\n {\r\n return this.skeletonData.findEvent(eventDataName);\r\n },\r\n\r\n /**\r\n * Finds an animation by comparing each animation's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findAnimation\r\n * @since 3.19.0\r\n * \r\n * @param {string} animationName - The name of the animation to find.\r\n *\r\n * @return {spine.Animation} The Animation. May be null.\r\n */\r\n findAnimation: function (animationName)\r\n {\r\n return this.skeletonData.findAnimation(animationName);\r\n },\r\n\r\n /**\r\n * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findIkConstraint\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.IkConstraintData} The IK constraint. May be null.\r\n */\r\n findIkConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findIkConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds an transform constraint by comparing each transform constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findTransformConstraint\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.TransformConstraintData} The transform constraint. May be null.\r\n */\r\n findTransformConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findTransformConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds a path constraint by comparing each path constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findPathConstraint\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.PathConstraintData} The path constraint. May be null.\r\n */\r\n findPathConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findPathConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds the index of a path constraint by comparing each path constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findPathConstraintIndex\r\n * @since 3.19.0\r\n * \r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {integer} The constraint index. Or -1 if the constraint was not found.\r\n */\r\n findPathConstraintIndex: function (constraintName)\r\n {\r\n return this.skeletonData.findPathConstraintIndex(constraintName);\r\n },\r\n\r\n /**\r\n * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * \r\n * The returned object contains two properties: `offset` and `size`:\r\n * \r\n * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * `size` - The width and height of the AABB.\r\n *\r\n * @method SpineGameObject#getBounds\r\n * @since 3.19.0\r\n * \r\n * @return {any} The bounds object.\r\n */\r\n getBounds: function ()\r\n {\r\n return this.plugin.getBounds(this.skeleton);\r\n },\r\n\r\n /**\r\n * Internal update handler.\r\n *\r\n * @method SpineGameObject#preUpdate\r\n * @protected\r\n * @since 3.19.0\r\n * \r\n * @param {number} time - The current timestamp.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n preUpdate: function (time, delta)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n this.state.update((delta / 1000) * this.timeScale);\r\n\r\n this.state.apply(skeleton);\r\n\r\n // this.emit('spine.update', skeleton);\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method SpineGameObject#preDestroy\r\n * @protected\r\n * @since 3.19.0\r\n */\r\n preDestroy: function ()\r\n {\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n this.plugin = null;\r\n\r\n this.skeleton = null;\r\n this.skeletonData = null;\r\n\r\n this.state = null;\r\n this.stateData = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpineGameObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar renderWebGL = require('../../../../src/utils/NOOP');\r\nvar renderCanvas = require('../../../../src/utils/NOOP');\r\n\r\nif (typeof WEBGL_RENDERER)\r\n{\r\n renderWebGL = require('./SpineGameObjectWebGLRenderer');\r\n}\r\n\r\nif (typeof CANVAS_RENDERER)\r\n{\r\n renderCanvas = require('./SpineGameObjectCanvasRenderer');\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\r\nvar RadToDeg = require('../../../../src/math/RadToDeg');\r\nvar Wrap = require('../../../../src/math/Wrap');\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method SpineGameObject#renderWebGL\r\n * @since 3.19.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {SpineGameObject} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var plugin = src.plugin;\r\n var skeleton = src.skeleton;\r\n var sceneRenderer = plugin.sceneRenderer;\r\n\r\n var GameObjectRenderMask = 15;\r\n\r\n var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)));\r\n\r\n if (!skeleton || !willRender)\r\n {\r\n // Reset the current type\r\n renderer.currentType = '';\r\n\r\n // If there is already a batch running, we need to close it\r\n if (!renderer.nextTypeMatch)\r\n {\r\n // The next object in the display list is not a Spine object, so we end the batch\r\n sceneRenderer.end();\r\n \r\n renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline);\r\n }\r\n \r\n return;\r\n }\r\n\r\n if (renderer.newType)\r\n {\r\n renderer.clearPipeline();\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1;\r\n var spriteMatrix = renderer._tempMatrix2;\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY));\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = src.x;\r\n spriteMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n var viewportHeight = renderer.height;\r\n\r\n skeleton.x = calcMatrix.tx;\r\n skeleton.y = viewportHeight - calcMatrix.ty;\r\n\r\n skeleton.scaleX = calcMatrix.scaleX;\r\n skeleton.scaleY = calcMatrix.scaleY;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n skeleton.scaleX *= -1;\r\n\r\n src.root.rotation = RadToDeg(calcMatrix.rotationNormalized);\r\n }\r\n else\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360);\r\n }\r\n\r\n if (src.scaleY < 0)\r\n {\r\n skeleton.scaleY *= -1;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n else\r\n {\r\n src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n }\r\n\r\n if (camera.renderToTexture)\r\n {\r\n skeleton.y = calcMatrix.ty;\r\n skeleton.scaleY *= -1;\r\n }\r\n\r\n // Add autoUpdate option\r\n skeleton.updateWorldTransform();\r\n\r\n if (renderer.newType)\r\n {\r\n sceneRenderer.begin();\r\n }\r\n\r\n // Draw the current skeleton\r\n sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha);\r\n\r\n if (plugin.drawDebug || src.drawDebug)\r\n {\r\n // Because if we don't, the bones render positions are completely wrong (*sigh*)\r\n var oldX = skeleton.x;\r\n var oldY = skeleton.y;\r\n\r\n skeleton.x = 0;\r\n skeleton.y = 0;\r\n\r\n sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha);\r\n\r\n skeleton.x = oldX;\r\n skeleton.y = oldY;\r\n }\r\n\r\n if (!renderer.nextTypeMatch)\r\n {\r\n // The next object in the display list is not a Spine object, so we end the batch\r\n sceneRenderer.end();\r\n\r\n renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline);\r\n }\r\n};\r\n\r\nmodule.exports = SpineGameObjectWebGLRenderer;\r\n","/*** IMPORTS FROM imports-loader ***/\n(function() {\n\nvar __extends = (this && this.__extends) || (function () {\r\n\tvar extendStatics = Object.setPrototypeOf ||\r\n\t\t({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n\t\tfunction (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\treturn function (d, b) {\r\n\t\textendStatics(d, b);\r\n\t\tfunction __() { this.constructor = d; }\r\n\t\td.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n\t};\r\n})();\r\nvar spine;\r\n(function (spine) {\r\n\tvar Animation = (function () {\r\n\t\tfunction Animation(name, timelines, duration) {\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tif (timelines == null)\r\n\t\t\t\tthrow new Error(\"timelines cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t\tthis.timelines = timelines;\r\n\t\t\tthis.duration = duration;\r\n\t\t}\r\n\t\tAnimation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tif (loop && this.duration != 0) {\r\n\t\t\t\ttime %= this.duration;\r\n\t\t\t\tif (lastTime > 0)\r\n\t\t\t\t\tlastTime %= this.duration;\r\n\t\t\t}\r\n\t\t\tvar timelines = this.timelines;\r\n\t\t\tfor (var i = 0, n = timelines.length; i < n; i++)\r\n\t\t\t\ttimelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\r\n\t\t};\r\n\t\tAnimation.binarySearch = function (values, target, step) {\r\n\t\t\tif (step === void 0) { step = 1; }\r\n\t\t\tvar low = 0;\r\n\t\t\tvar high = values.length / step - 2;\r\n\t\t\tif (high == 0)\r\n\t\t\t\treturn step;\r\n\t\t\tvar current = high >>> 1;\r\n\t\t\twhile (true) {\r\n\t\t\t\tif (values[(current + 1) * step] <= target)\r\n\t\t\t\t\tlow = current + 1;\r\n\t\t\t\telse\r\n\t\t\t\t\thigh = current;\r\n\t\t\t\tif (low == high)\r\n\t\t\t\t\treturn (low + 1) * step;\r\n\t\t\t\tcurrent = (low + high) >>> 1;\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimation.linearSearch = function (values, target, step) {\r\n\t\t\tfor (var i = 0, last = values.length - step; i <= last; i += step)\r\n\t\t\t\tif (values[i] > target)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\treturn Animation;\r\n\t}());\r\n\tspine.Animation = Animation;\r\n\tvar MixBlend;\r\n\t(function (MixBlend) {\r\n\t\tMixBlend[MixBlend[\"setup\"] = 0] = \"setup\";\r\n\t\tMixBlend[MixBlend[\"first\"] = 1] = \"first\";\r\n\t\tMixBlend[MixBlend[\"replace\"] = 2] = \"replace\";\r\n\t\tMixBlend[MixBlend[\"add\"] = 3] = \"add\";\r\n\t})(MixBlend = spine.MixBlend || (spine.MixBlend = {}));\r\n\tvar MixDirection;\r\n\t(function (MixDirection) {\r\n\t\tMixDirection[MixDirection[\"in\"] = 0] = \"in\";\r\n\t\tMixDirection[MixDirection[\"out\"] = 1] = \"out\";\r\n\t})(MixDirection = spine.MixDirection || (spine.MixDirection = {}));\r\n\tvar TimelineType;\r\n\t(function (TimelineType) {\r\n\t\tTimelineType[TimelineType[\"rotate\"] = 0] = \"rotate\";\r\n\t\tTimelineType[TimelineType[\"translate\"] = 1] = \"translate\";\r\n\t\tTimelineType[TimelineType[\"scale\"] = 2] = \"scale\";\r\n\t\tTimelineType[TimelineType[\"shear\"] = 3] = \"shear\";\r\n\t\tTimelineType[TimelineType[\"attachment\"] = 4] = \"attachment\";\r\n\t\tTimelineType[TimelineType[\"color\"] = 5] = \"color\";\r\n\t\tTimelineType[TimelineType[\"deform\"] = 6] = \"deform\";\r\n\t\tTimelineType[TimelineType[\"event\"] = 7] = \"event\";\r\n\t\tTimelineType[TimelineType[\"drawOrder\"] = 8] = \"drawOrder\";\r\n\t\tTimelineType[TimelineType[\"ikConstraint\"] = 9] = \"ikConstraint\";\r\n\t\tTimelineType[TimelineType[\"transformConstraint\"] = 10] = \"transformConstraint\";\r\n\t\tTimelineType[TimelineType[\"pathConstraintPosition\"] = 11] = \"pathConstraintPosition\";\r\n\t\tTimelineType[TimelineType[\"pathConstraintSpacing\"] = 12] = \"pathConstraintSpacing\";\r\n\t\tTimelineType[TimelineType[\"pathConstraintMix\"] = 13] = \"pathConstraintMix\";\r\n\t\tTimelineType[TimelineType[\"twoColor\"] = 14] = \"twoColor\";\r\n\t})(TimelineType = spine.TimelineType || (spine.TimelineType = {}));\r\n\tvar CurveTimeline = (function () {\r\n\t\tfunction CurveTimeline(frameCount) {\r\n\t\t\tif (frameCount <= 0)\r\n\t\t\t\tthrow new Error(\"frameCount must be > 0: \" + frameCount);\r\n\t\t\tthis.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\r\n\t\t}\r\n\t\tCurveTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.setLinear = function (frameIndex) {\r\n\t\t\tthis.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.setStepped = function (frameIndex) {\r\n\t\t\tthis.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.getCurveType = function (frameIndex) {\r\n\t\t\tvar index = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n\t\t\tif (index == this.curves.length)\r\n\t\t\t\treturn CurveTimeline.LINEAR;\r\n\t\t\tvar type = this.curves[index];\r\n\t\t\tif (type == CurveTimeline.LINEAR)\r\n\t\t\t\treturn CurveTimeline.LINEAR;\r\n\t\t\tif (type == CurveTimeline.STEPPED)\r\n\t\t\t\treturn CurveTimeline.STEPPED;\r\n\t\t\treturn CurveTimeline.BEZIER;\r\n\t\t};\r\n\t\tCurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) {\r\n\t\t\tvar tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n\t\t\tvar dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n\t\t\tvar ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n\t\t\tvar dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\r\n\t\t\tvar i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n\t\t\tvar curves = this.curves;\r\n\t\t\tcurves[i++] = CurveTimeline.BEZIER;\r\n\t\t\tvar x = dfx, y = dfy;\r\n\t\t\tfor (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n\t\t\t\tcurves[i] = x;\r\n\t\t\t\tcurves[i + 1] = y;\r\n\t\t\t\tdfx += ddfx;\r\n\t\t\t\tdfy += ddfy;\r\n\t\t\t\tddfx += dddfx;\r\n\t\t\t\tddfy += dddfy;\r\n\t\t\t\tx += dfx;\r\n\t\t\t\ty += dfy;\r\n\t\t\t}\r\n\t\t};\r\n\t\tCurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) {\r\n\t\t\tpercent = spine.MathUtils.clamp(percent, 0, 1);\r\n\t\t\tvar curves = this.curves;\r\n\t\t\tvar i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n\t\t\tvar type = curves[i];\r\n\t\t\tif (type == CurveTimeline.LINEAR)\r\n\t\t\t\treturn percent;\r\n\t\t\tif (type == CurveTimeline.STEPPED)\r\n\t\t\t\treturn 0;\r\n\t\t\ti++;\r\n\t\t\tvar x = 0;\r\n\t\t\tfor (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n\t\t\t\tx = curves[i];\r\n\t\t\t\tif (x >= percent) {\r\n\t\t\t\t\tvar prevX = void 0, prevY = void 0;\r\n\t\t\t\t\tif (i == start) {\r\n\t\t\t\t\t\tprevX = 0;\r\n\t\t\t\t\t\tprevY = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tprevX = curves[i - 2];\r\n\t\t\t\t\t\tprevY = curves[i - 1];\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar y = curves[i - 1];\r\n\t\t\treturn y + (1 - y) * (percent - x) / (1 - x);\r\n\t\t};\r\n\t\tCurveTimeline.LINEAR = 0;\r\n\t\tCurveTimeline.STEPPED = 1;\r\n\t\tCurveTimeline.BEZIER = 2;\r\n\t\tCurveTimeline.BEZIER_SIZE = 10 * 2 - 1;\r\n\t\treturn CurveTimeline;\r\n\t}());\r\n\tspine.CurveTimeline = CurveTimeline;\r\n\tvar RotateTimeline = (function (_super) {\r\n\t\t__extends(RotateTimeline, _super);\r\n\t\tfunction RotateTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount << 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tRotateTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.rotate << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tRotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) {\r\n\t\t\tframeIndex <<= 1;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\r\n\t\t};\r\n\t\tRotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.rotation = bone.data.rotation;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tvar r_1 = bone.data.rotation - bone.rotation;\r\n\t\t\t\t\t\tbone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (time >= frames[frames.length - RotateTimeline.ENTRIES]) {\r\n\t\t\t\tvar r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.rotation = bone.data.rotation + r_2 * alpha;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\tr_2 += bone.data.rotation - bone.rotation;\r\n\t\t\t\t\t\tr_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360;\r\n\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\tbone.rotation += r_2 * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n\t\t\tvar prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n\t\t\tvar frameTime = frames[frame];\r\n\t\t\tvar percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n\t\t\tvar r = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n\t\t\tr = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent;\r\n\t\t\tswitch (blend) {\r\n\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\tbone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.first:\r\n\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\tr += bone.data.rotation - bone.rotation;\r\n\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\tbone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tRotateTimeline.ENTRIES = 2;\r\n\t\tRotateTimeline.PREV_TIME = -2;\r\n\t\tRotateTimeline.PREV_ROTATION = -1;\r\n\t\tRotateTimeline.ROTATION = 1;\r\n\t\treturn RotateTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.RotateTimeline = RotateTimeline;\r\n\tvar TranslateTimeline = (function (_super) {\r\n\t\t__extends(TranslateTimeline, _super);\r\n\t\tfunction TranslateTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tTranslateTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.translate << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tTranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) {\r\n\t\t\tframeIndex *= TranslateTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + TranslateTimeline.X] = x;\r\n\t\t\tthis.frames[frameIndex + TranslateTimeline.Y] = y;\r\n\t\t};\r\n\t\tTranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.x = bone.data.x;\r\n\t\t\t\t\t\tbone.y = bone.data.y;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tbone.x += (bone.data.x - bone.x) * alpha;\r\n\t\t\t\t\t\tbone.y += (bone.data.y - bone.y) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar x = 0, y = 0;\r\n\t\t\tif (time >= frames[frames.length - TranslateTimeline.ENTRIES]) {\r\n\t\t\t\tx = frames[frames.length + TranslateTimeline.PREV_X];\r\n\t\t\t\ty = frames[frames.length + TranslateTimeline.PREV_Y];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\r\n\t\t\t\tx = frames[frame + TranslateTimeline.PREV_X];\r\n\t\t\t\ty = frames[frame + TranslateTimeline.PREV_Y];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tx += (frames[frame + TranslateTimeline.X] - x) * percent;\r\n\t\t\t\ty += (frames[frame + TranslateTimeline.Y] - y) * percent;\r\n\t\t\t}\r\n\t\t\tswitch (blend) {\r\n\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\tbone.x = bone.data.x + x * alpha;\r\n\t\t\t\t\tbone.y = bone.data.y + y * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.first:\r\n\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\tbone.x += (bone.data.x + x - bone.x) * alpha;\r\n\t\t\t\t\tbone.y += (bone.data.y + y - bone.y) * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\tbone.x += x * alpha;\r\n\t\t\t\t\tbone.y += y * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTranslateTimeline.ENTRIES = 3;\r\n\t\tTranslateTimeline.PREV_TIME = -3;\r\n\t\tTranslateTimeline.PREV_X = -2;\r\n\t\tTranslateTimeline.PREV_Y = -1;\r\n\t\tTranslateTimeline.X = 1;\r\n\t\tTranslateTimeline.Y = 2;\r\n\t\treturn TranslateTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.TranslateTimeline = TranslateTimeline;\r\n\tvar ScaleTimeline = (function (_super) {\r\n\t\t__extends(ScaleTimeline, _super);\r\n\t\tfunction ScaleTimeline(frameCount) {\r\n\t\t\treturn _super.call(this, frameCount) || this;\r\n\t\t}\r\n\t\tScaleTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.scale << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.scaleX = bone.data.scaleX;\r\n\t\t\t\t\t\tbone.scaleY = bone.data.scaleY;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tbone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n\t\t\t\t\t\tbone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar x = 0, y = 0;\r\n\t\t\tif (time >= frames[frames.length - ScaleTimeline.ENTRIES]) {\r\n\t\t\t\tx = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX;\r\n\t\t\t\ty = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\r\n\t\t\t\tx = frames[frame + ScaleTimeline.PREV_X];\r\n\t\t\t\ty = frames[frame + ScaleTimeline.PREV_Y];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tx = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX;\r\n\t\t\t\ty = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY;\r\n\t\t\t}\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\tif (blend == MixBlend.add) {\r\n\t\t\t\t\tbone.scaleX += x - bone.data.scaleX;\r\n\t\t\t\t\tbone.scaleY += y - bone.data.scaleY;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tbone.scaleX = x;\r\n\t\t\t\t\tbone.scaleY = y;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar bx = 0, by = 0;\r\n\t\t\t\tif (direction == MixDirection.out) {\r\n\t\t\t\t\tswitch (blend) {\r\n\t\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\t\tbx = bone.data.scaleX;\r\n\t\t\t\t\t\t\tby = bone.data.scaleY;\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\t\tbx = bone.scaleX;\r\n\t\t\t\t\t\t\tby = bone.scaleY;\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\t\tbx = bone.scaleX;\r\n\t\t\t\t\t\t\tby = bone.scaleY;\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tswitch (blend) {\r\n\t\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\t\tbx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x);\r\n\t\t\t\t\t\t\tby = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y);\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\t\tbx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x);\r\n\t\t\t\t\t\t\tby = Math.abs(bone.scaleY) * spine.MathUtils.signum(y);\r\n\t\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\t\tbx = spine.MathUtils.signum(x);\r\n\t\t\t\t\t\t\tby = spine.MathUtils.signum(y);\r\n\t\t\t\t\t\t\tbone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;\r\n\t\t\t\t\t\t\tbone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn ScaleTimeline;\r\n\t}(TranslateTimeline));\r\n\tspine.ScaleTimeline = ScaleTimeline;\r\n\tvar ShearTimeline = (function (_super) {\r\n\t\t__extends(ShearTimeline, _super);\r\n\t\tfunction ShearTimeline(frameCount) {\r\n\t\t\treturn _super.call(this, frameCount) || this;\r\n\t\t}\r\n\t\tShearTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.shear << 24) + this.boneIndex;\r\n\t\t};\r\n\t\tShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar bone = skeleton.bones[this.boneIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tbone.shearX = bone.data.shearX;\r\n\t\t\t\t\t\tbone.shearY = bone.data.shearY;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tbone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n\t\t\t\t\t\tbone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar x = 0, y = 0;\r\n\t\t\tif (time >= frames[frames.length - ShearTimeline.ENTRIES]) {\r\n\t\t\t\tx = frames[frames.length + ShearTimeline.PREV_X];\r\n\t\t\t\ty = frames[frames.length + ShearTimeline.PREV_Y];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\r\n\t\t\t\tx = frames[frame + ShearTimeline.PREV_X];\r\n\t\t\t\ty = frames[frame + ShearTimeline.PREV_Y];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tx = x + (frames[frame + ShearTimeline.X] - x) * percent;\r\n\t\t\t\ty = y + (frames[frame + ShearTimeline.Y] - y) * percent;\r\n\t\t\t}\r\n\t\t\tswitch (blend) {\r\n\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\tbone.shearX = bone.data.shearX + x * alpha;\r\n\t\t\t\t\tbone.shearY = bone.data.shearY + y * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.first:\r\n\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\tbone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n\t\t\t\t\tbone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\tbone.shearX += x * alpha;\r\n\t\t\t\t\tbone.shearY += y * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn ShearTimeline;\r\n\t}(TranslateTimeline));\r\n\tspine.ShearTimeline = ShearTimeline;\r\n\tvar ColorTimeline = (function (_super) {\r\n\t\t__extends(ColorTimeline, _super);\r\n\t\tfunction ColorTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tColorTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.color << 24) + this.slotIndex;\r\n\t\t};\r\n\t\tColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) {\r\n\t\t\tframeIndex *= ColorTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.R] = r;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.G] = g;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.B] = b;\r\n\t\t\tthis.frames[frameIndex + ColorTimeline.A] = a;\r\n\t\t};\r\n\t\tColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tslot.color.setFromColor(slot.data.color);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tvar color = slot.color, setup = slot.data.color;\r\n\t\t\t\t\t\tcolor.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar r = 0, g = 0, b = 0, a = 0;\r\n\t\t\tif (time >= frames[frames.length - ColorTimeline.ENTRIES]) {\r\n\t\t\t\tvar i = frames.length;\r\n\t\t\t\tr = frames[i + ColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[i + ColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[i + ColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[i + ColorTimeline.PREV_A];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\r\n\t\t\t\tr = frames[frame + ColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[frame + ColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[frame + ColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[frame + ColorTimeline.PREV_A];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tr += (frames[frame + ColorTimeline.R] - r) * percent;\r\n\t\t\t\tg += (frames[frame + ColorTimeline.G] - g) * percent;\r\n\t\t\t\tb += (frames[frame + ColorTimeline.B] - b) * percent;\r\n\t\t\t\ta += (frames[frame + ColorTimeline.A] - a) * percent;\r\n\t\t\t}\r\n\t\t\tif (alpha == 1)\r\n\t\t\t\tslot.color.set(r, g, b, a);\r\n\t\t\telse {\r\n\t\t\t\tvar color = slot.color;\r\n\t\t\t\tif (blend == MixBlend.setup)\r\n\t\t\t\t\tcolor.setFromColor(slot.data.color);\r\n\t\t\t\tcolor.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n\t\t\t}\r\n\t\t};\r\n\t\tColorTimeline.ENTRIES = 5;\r\n\t\tColorTimeline.PREV_TIME = -5;\r\n\t\tColorTimeline.PREV_R = -4;\r\n\t\tColorTimeline.PREV_G = -3;\r\n\t\tColorTimeline.PREV_B = -2;\r\n\t\tColorTimeline.PREV_A = -1;\r\n\t\tColorTimeline.R = 1;\r\n\t\tColorTimeline.G = 2;\r\n\t\tColorTimeline.B = 3;\r\n\t\tColorTimeline.A = 4;\r\n\t\treturn ColorTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.ColorTimeline = ColorTimeline;\r\n\tvar TwoColorTimeline = (function (_super) {\r\n\t\t__extends(TwoColorTimeline, _super);\r\n\t\tfunction TwoColorTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tTwoColorTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.twoColor << 24) + this.slotIndex;\r\n\t\t};\r\n\t\tTwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) {\r\n\t\t\tframeIndex *= TwoColorTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.R] = r;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.G] = g;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.B] = b;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.A] = a;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.R2] = r2;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.G2] = g2;\r\n\t\t\tthis.frames[frameIndex + TwoColorTimeline.B2] = b2;\r\n\t\t};\r\n\t\tTwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tslot.color.setFromColor(slot.data.color);\r\n\t\t\t\t\t\tslot.darkColor.setFromColor(slot.data.darkColor);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tvar light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n\t\t\t\t\t\tlight.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\r\n\t\t\t\t\t\tdark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\r\n\t\t\tif (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) {\r\n\t\t\t\tvar i = frames.length;\r\n\t\t\t\tr = frames[i + TwoColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[i + TwoColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[i + TwoColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[i + TwoColorTimeline.PREV_A];\r\n\t\t\t\tr2 = frames[i + TwoColorTimeline.PREV_R2];\r\n\t\t\t\tg2 = frames[i + TwoColorTimeline.PREV_G2];\r\n\t\t\t\tb2 = frames[i + TwoColorTimeline.PREV_B2];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES);\r\n\t\t\t\tr = frames[frame + TwoColorTimeline.PREV_R];\r\n\t\t\t\tg = frames[frame + TwoColorTimeline.PREV_G];\r\n\t\t\t\tb = frames[frame + TwoColorTimeline.PREV_B];\r\n\t\t\t\ta = frames[frame + TwoColorTimeline.PREV_A];\r\n\t\t\t\tr2 = frames[frame + TwoColorTimeline.PREV_R2];\r\n\t\t\t\tg2 = frames[frame + TwoColorTimeline.PREV_G2];\r\n\t\t\t\tb2 = frames[frame + TwoColorTimeline.PREV_B2];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tr += (frames[frame + TwoColorTimeline.R] - r) * percent;\r\n\t\t\t\tg += (frames[frame + TwoColorTimeline.G] - g) * percent;\r\n\t\t\t\tb += (frames[frame + TwoColorTimeline.B] - b) * percent;\r\n\t\t\t\ta += (frames[frame + TwoColorTimeline.A] - a) * percent;\r\n\t\t\t\tr2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent;\r\n\t\t\t\tg2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent;\r\n\t\t\t\tb2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent;\r\n\t\t\t}\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\tslot.color.set(r, g, b, a);\r\n\t\t\t\tslot.darkColor.set(r2, g2, b2, 1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar light = slot.color, dark = slot.darkColor;\r\n\t\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\t\tlight.setFromColor(slot.data.color);\r\n\t\t\t\t\tdark.setFromColor(slot.data.darkColor);\r\n\t\t\t\t}\r\n\t\t\t\tlight.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\r\n\t\t\t\tdark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTwoColorTimeline.ENTRIES = 8;\r\n\t\tTwoColorTimeline.PREV_TIME = -8;\r\n\t\tTwoColorTimeline.PREV_R = -7;\r\n\t\tTwoColorTimeline.PREV_G = -6;\r\n\t\tTwoColorTimeline.PREV_B = -5;\r\n\t\tTwoColorTimeline.PREV_A = -4;\r\n\t\tTwoColorTimeline.PREV_R2 = -3;\r\n\t\tTwoColorTimeline.PREV_G2 = -2;\r\n\t\tTwoColorTimeline.PREV_B2 = -1;\r\n\t\tTwoColorTimeline.R = 1;\r\n\t\tTwoColorTimeline.G = 2;\r\n\t\tTwoColorTimeline.B = 3;\r\n\t\tTwoColorTimeline.A = 4;\r\n\t\tTwoColorTimeline.R2 = 5;\r\n\t\tTwoColorTimeline.G2 = 6;\r\n\t\tTwoColorTimeline.B2 = 7;\r\n\t\treturn TwoColorTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.TwoColorTimeline = TwoColorTimeline;\r\n\tvar AttachmentTimeline = (function () {\r\n\t\tfunction AttachmentTimeline(frameCount) {\r\n\t\t\tthis.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\tthis.attachmentNames = new Array(frameCount);\r\n\t\t}\r\n\t\tAttachmentTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.attachment << 24) + this.slotIndex;\r\n\t\t};\r\n\t\tAttachmentTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.frames.length;\r\n\t\t};\r\n\t\tAttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) {\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.attachmentNames[frameIndex] = attachmentName;\r\n\t\t};\r\n\t\tAttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tif (direction == MixDirection.out && blend == MixBlend.setup) {\r\n\t\t\t\tvar attachmentName_1 = slot.data.attachmentName;\r\n\t\t\t\tslot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) {\r\n\t\t\t\t\tvar attachmentName_2 = slot.data.attachmentName;\r\n\t\t\t\t\tslot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2));\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frameIndex = 0;\r\n\t\t\tif (time >= frames[frames.length - 1])\r\n\t\t\t\tframeIndex = frames.length - 1;\r\n\t\t\telse\r\n\t\t\t\tframeIndex = Animation.binarySearch(frames, time, 1) - 1;\r\n\t\t\tvar attachmentName = this.attachmentNames[frameIndex];\r\n\t\t\tskeleton.slots[this.slotIndex]\r\n\t\t\t\t.setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n\t\t};\r\n\t\treturn AttachmentTimeline;\r\n\t}());\r\n\tspine.AttachmentTimeline = AttachmentTimeline;\r\n\tvar zeros = null;\r\n\tvar DeformTimeline = (function (_super) {\r\n\t\t__extends(DeformTimeline, _super);\r\n\t\tfunction DeformTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\t_this.frameVertices = new Array(frameCount);\r\n\t\t\tif (zeros == null)\r\n\t\t\t\tzeros = spine.Utils.newFloatArray(64);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tDeformTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex;\r\n\t\t};\r\n\t\tDeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) {\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frameVertices[frameIndex] = vertices;\r\n\t\t};\r\n\t\tDeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar slot = skeleton.slots[this.slotIndex];\r\n\t\t\tvar slotAttachment = slot.getAttachment();\r\n\t\t\tif (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment))\r\n\t\t\t\treturn;\r\n\t\t\tvar verticesArray = slot.attachmentVertices;\r\n\t\t\tif (verticesArray.length == 0)\r\n\t\t\t\tblend = MixBlend.setup;\r\n\t\t\tvar frameVertices = this.frameVertices;\r\n\t\t\tvar vertexCount = frameVertices[0].length;\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tverticesArray.length = 0;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tif (alpha == 1) {\r\n\t\t\t\t\t\t\tverticesArray.length = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount);\r\n\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\r\n\t\t\t\t\t\t\t\tvertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\talpha = 1 - alpha;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\r\n\t\t\t\t\t\t\t\tvertices_1[i] *= alpha;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar vertices = spine.Utils.setArraySize(verticesArray, vertexCount);\r\n\t\t\tif (time >= frames[frames.length - 1]) {\r\n\t\t\t\tvar lastVertices = frameVertices[frames.length - 1];\r\n\t\t\t\tif (alpha == 1) {\r\n\t\t\t\t\tif (blend == MixBlend.add) {\r\n\t\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\tfor (var i_1 = 0; i_1 < vertexCount; i_1++) {\r\n\t\t\t\t\t\t\t\tvertices[i_1] += lastVertices[i_1] - setupVertices[i_1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i_2 = 0; i_2 < vertexCount; i_2++)\r\n\t\t\t\t\t\t\t\tvertices[i_2] += lastVertices[i_2];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tspine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tswitch (blend) {\r\n\t\t\t\t\t\tcase MixBlend.setup: {\r\n\t\t\t\t\t\t\tvar vertexAttachment_1 = slotAttachment;\r\n\t\t\t\t\t\t\tif (vertexAttachment_1.bones == null) {\r\n\t\t\t\t\t\t\t\tvar setupVertices = vertexAttachment_1.vertices;\r\n\t\t\t\t\t\t\t\tfor (var i_3 = 0; i_3 < vertexCount; i_3++) {\r\n\t\t\t\t\t\t\t\t\tvar setup = setupVertices[i_3];\r\n\t\t\t\t\t\t\t\t\tvertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tfor (var i_4 = 0; i_4 < vertexCount; i_4++)\r\n\t\t\t\t\t\t\t\t\tvertices[i_4] = lastVertices[i_4] * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\t\tfor (var i_5 = 0; i_5 < vertexCount; i_5++)\r\n\t\t\t\t\t\t\t\tvertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha;\r\n\t\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\t\tfor (var i_6 = 0; i_6 < vertexCount; i_6++) {\r\n\t\t\t\t\t\t\t\t\tvertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tfor (var i_7 = 0; i_7 < vertexCount; i_7++)\r\n\t\t\t\t\t\t\t\t\tvertices[i_7] += lastVertices[i_7] * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = Animation.binarySearch(frames, time);\r\n\t\t\tvar prevVertices = frameVertices[frame - 1];\r\n\t\t\tvar nextVertices = frameVertices[frame];\r\n\t\t\tvar frameTime = frames[frame];\r\n\t\t\tvar percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\tif (blend == MixBlend.add) {\r\n\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\tfor (var i_8 = 0; i_8 < vertexCount; i_8++) {\r\n\t\t\t\t\t\t\tvar prev = prevVertices[i_8];\r\n\t\t\t\t\t\t\tvertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tfor (var i_9 = 0; i_9 < vertexCount; i_9++) {\r\n\t\t\t\t\t\t\tvar prev = prevVertices[i_9];\r\n\t\t\t\t\t\t\tvertices[i_9] += prev + (nextVertices[i_9] - prev) * percent;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tfor (var i_10 = 0; i_10 < vertexCount; i_10++) {\r\n\t\t\t\t\t\tvar prev = prevVertices[i_10];\r\n\t\t\t\t\t\tvertices[i_10] = prev + (nextVertices[i_10] - prev) * percent;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup: {\r\n\t\t\t\t\t\tvar vertexAttachment_2 = slotAttachment;\r\n\t\t\t\t\t\tif (vertexAttachment_2.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment_2.vertices;\r\n\t\t\t\t\t\t\tfor (var i_11 = 0; i_11 < vertexCount; i_11++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_11], setup = setupVertices[i_11];\r\n\t\t\t\t\t\t\t\tvertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i_12 = 0; i_12 < vertexCount; i_12++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_12];\r\n\t\t\t\t\t\t\t\tvertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\tcase MixBlend.replace:\r\n\t\t\t\t\t\tfor (var i_13 = 0; i_13 < vertexCount; i_13++) {\r\n\t\t\t\t\t\t\tvar prev = prevVertices[i_13];\r\n\t\t\t\t\t\t\tvertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase MixBlend.add:\r\n\t\t\t\t\t\tvar vertexAttachment = slotAttachment;\r\n\t\t\t\t\t\tif (vertexAttachment.bones == null) {\r\n\t\t\t\t\t\t\tvar setupVertices = vertexAttachment.vertices;\r\n\t\t\t\t\t\t\tfor (var i_14 = 0; i_14 < vertexCount; i_14++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_14];\r\n\t\t\t\t\t\t\t\tvertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfor (var i_15 = 0; i_15 < vertexCount; i_15++) {\r\n\t\t\t\t\t\t\t\tvar prev = prevVertices[i_15];\r\n\t\t\t\t\t\t\t\tvertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn DeformTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.DeformTimeline = DeformTimeline;\r\n\tvar EventTimeline = (function () {\r\n\t\tfunction EventTimeline(frameCount) {\r\n\t\t\tthis.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\tthis.events = new Array(frameCount);\r\n\t\t}\r\n\t\tEventTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn TimelineType.event << 24;\r\n\t\t};\r\n\t\tEventTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.frames.length;\r\n\t\t};\r\n\t\tEventTimeline.prototype.setFrame = function (frameIndex, event) {\r\n\t\t\tthis.frames[frameIndex] = event.time;\r\n\t\t\tthis.events[frameIndex] = event;\r\n\t\t};\r\n\t\tEventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tif (firedEvents == null)\r\n\t\t\t\treturn;\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar frameCount = this.frames.length;\r\n\t\t\tif (lastTime > time) {\r\n\t\t\t\tthis.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\r\n\t\t\t\tlastTime = -1;\r\n\t\t\t}\r\n\t\t\telse if (lastTime >= frames[frameCount - 1])\r\n\t\t\t\treturn;\r\n\t\t\tif (time < frames[0])\r\n\t\t\t\treturn;\r\n\t\t\tvar frame = 0;\r\n\t\t\tif (lastTime < frames[0])\r\n\t\t\t\tframe = 0;\r\n\t\t\telse {\r\n\t\t\t\tframe = Animation.binarySearch(frames, lastTime);\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\twhile (frame > 0) {\r\n\t\t\t\t\tif (frames[frame - 1] != frameTime)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tframe--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (; frame < frameCount && time >= frames[frame]; frame++)\r\n\t\t\t\tfiredEvents.push(this.events[frame]);\r\n\t\t};\r\n\t\treturn EventTimeline;\r\n\t}());\r\n\tspine.EventTimeline = EventTimeline;\r\n\tvar DrawOrderTimeline = (function () {\r\n\t\tfunction DrawOrderTimeline(frameCount) {\r\n\t\t\tthis.frames = spine.Utils.newFloatArray(frameCount);\r\n\t\t\tthis.drawOrders = new Array(frameCount);\r\n\t\t}\r\n\t\tDrawOrderTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn TimelineType.drawOrder << 24;\r\n\t\t};\r\n\t\tDrawOrderTimeline.prototype.getFrameCount = function () {\r\n\t\t\treturn this.frames.length;\r\n\t\t};\r\n\t\tDrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) {\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.drawOrders[frameIndex] = drawOrder;\r\n\t\t};\r\n\t\tDrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar drawOrder = skeleton.drawOrder;\r\n\t\t\tvar slots = skeleton.slots;\r\n\t\t\tif (direction == MixDirection.out && blend == MixBlend.setup) {\r\n\t\t\t\tspine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first)\r\n\t\t\t\t\tspine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = 0;\r\n\t\t\tif (time >= frames[frames.length - 1])\r\n\t\t\t\tframe = frames.length - 1;\r\n\t\t\telse\r\n\t\t\t\tframe = Animation.binarySearch(frames, time) - 1;\r\n\t\t\tvar drawOrderToSetupIndex = this.drawOrders[frame];\r\n\t\t\tif (drawOrderToSetupIndex == null)\r\n\t\t\t\tspine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\r\n\t\t\telse {\r\n\t\t\t\tfor (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n\t\t\t\t\tdrawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn DrawOrderTimeline;\r\n\t}());\r\n\tspine.DrawOrderTimeline = DrawOrderTimeline;\r\n\tvar IkConstraintTimeline = (function (_super) {\r\n\t\t__extends(IkConstraintTimeline, _super);\r\n\t\tfunction IkConstraintTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tIkConstraintTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;\r\n\t\t};\r\n\t\tIkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) {\r\n\t\t\tframeIndex *= IkConstraintTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0;\r\n\t\t\tthis.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0;\r\n\t\t};\r\n\t\tIkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.mix = constraint.data.mix;\r\n\t\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.mix += (constraint.data.mix - constraint.mix) * alpha;\r\n\t\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {\r\n\t\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\t\tconstraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;\r\n\t\t\t\t\tif (direction == MixDirection.out) {\r\n\t\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tconstraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\t\tconstraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\t\tconstraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconstraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\r\n\t\t\t\t\tif (direction == MixDirection[\"in\"]) {\r\n\t\t\t\t\t\tconstraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\t\tconstraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\t\tconstraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\r\n\t\t\tvar mix = frames[frame + IkConstraintTimeline.PREV_MIX];\r\n\t\t\tvar frameTime = frames[frame];\r\n\t\t\tvar percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\r\n\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\tconstraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;\r\n\t\t\t\tif (direction == MixDirection.out) {\r\n\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconstraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\tconstraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\tconstraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconstraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\r\n\t\t\t\tif (direction == MixDirection[\"in\"]) {\r\n\t\t\t\t\tconstraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n\t\t\t\t\tconstraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n\t\t\t\t\tconstraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tIkConstraintTimeline.ENTRIES = 5;\r\n\t\tIkConstraintTimeline.PREV_TIME = -5;\r\n\t\tIkConstraintTimeline.PREV_MIX = -4;\r\n\t\tIkConstraintTimeline.PREV_BEND_DIRECTION = -3;\r\n\t\tIkConstraintTimeline.PREV_COMPRESS = -2;\r\n\t\tIkConstraintTimeline.PREV_STRETCH = -1;\r\n\t\tIkConstraintTimeline.MIX = 1;\r\n\t\tIkConstraintTimeline.BEND_DIRECTION = 2;\r\n\t\tIkConstraintTimeline.COMPRESS = 3;\r\n\t\tIkConstraintTimeline.STRETCH = 4;\r\n\t\treturn IkConstraintTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.IkConstraintTimeline = IkConstraintTimeline;\r\n\tvar TransformConstraintTimeline = (function (_super) {\r\n\t\t__extends(TransformConstraintTimeline, _super);\r\n\t\tfunction TransformConstraintTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tTransformConstraintTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;\r\n\t\t};\r\n\t\tTransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) {\r\n\t\t\tframeIndex *= TransformConstraintTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\r\n\t\t\tthis.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\r\n\t\t};\r\n\t\tTransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.rotateMix = data.rotateMix;\r\n\t\t\t\t\t\tconstraint.translateMix = data.translateMix;\r\n\t\t\t\t\t\tconstraint.scaleMix = data.scaleMix;\r\n\t\t\t\t\t\tconstraint.shearMix = data.shearMix;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha;\r\n\t\t\t\t\t\tconstraint.translateMix += (data.translateMix - constraint.translateMix) * alpha;\r\n\t\t\t\t\t\tconstraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha;\r\n\t\t\t\t\t\tconstraint.shearMix += (data.shearMix - constraint.shearMix) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar rotate = 0, translate = 0, scale = 0, shear = 0;\r\n\t\t\tif (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) {\r\n\t\t\t\tvar i = frames.length;\r\n\t\t\t\trotate = frames[i + TransformConstraintTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE];\r\n\t\t\t\tscale = frames[i + TransformConstraintTimeline.PREV_SCALE];\r\n\t\t\t\tshear = frames[i + TransformConstraintTimeline.PREV_SHEAR];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\r\n\t\t\t\trotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\r\n\t\t\t\tscale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\r\n\t\t\t\tshear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\trotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent;\r\n\t\t\t\ttranslate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent;\r\n\t\t\t\tscale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent;\r\n\t\t\t\tshear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tconstraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha;\r\n\t\t\t\tconstraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha;\r\n\t\t\t\tconstraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconstraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n\t\t\t\tconstraint.scaleMix += (scale - constraint.scaleMix) * alpha;\r\n\t\t\t\tconstraint.shearMix += (shear - constraint.shearMix) * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraintTimeline.ENTRIES = 5;\r\n\t\tTransformConstraintTimeline.PREV_TIME = -5;\r\n\t\tTransformConstraintTimeline.PREV_ROTATE = -4;\r\n\t\tTransformConstraintTimeline.PREV_TRANSLATE = -3;\r\n\t\tTransformConstraintTimeline.PREV_SCALE = -2;\r\n\t\tTransformConstraintTimeline.PREV_SHEAR = -1;\r\n\t\tTransformConstraintTimeline.ROTATE = 1;\r\n\t\tTransformConstraintTimeline.TRANSLATE = 2;\r\n\t\tTransformConstraintTimeline.SCALE = 3;\r\n\t\tTransformConstraintTimeline.SHEAR = 4;\r\n\t\treturn TransformConstraintTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.TransformConstraintTimeline = TransformConstraintTimeline;\r\n\tvar PathConstraintPositionTimeline = (function (_super) {\r\n\t\t__extends(PathConstraintPositionTimeline, _super);\r\n\t\tfunction PathConstraintPositionTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPathConstraintPositionTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;\r\n\t\t};\r\n\t\tPathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) {\r\n\t\t\tframeIndex *= PathConstraintPositionTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\r\n\t\t};\r\n\t\tPathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.position = constraint.data.position;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.position += (constraint.data.position - constraint.position) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar position = 0;\r\n\t\t\tif (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES])\r\n\t\t\t\tposition = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE];\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\r\n\t\t\t\tposition = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tposition += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup)\r\n\t\t\t\tconstraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\r\n\t\t\telse\r\n\t\t\t\tconstraint.position += (position - constraint.position) * alpha;\r\n\t\t};\r\n\t\tPathConstraintPositionTimeline.ENTRIES = 2;\r\n\t\tPathConstraintPositionTimeline.PREV_TIME = -2;\r\n\t\tPathConstraintPositionTimeline.PREV_VALUE = -1;\r\n\t\tPathConstraintPositionTimeline.VALUE = 1;\r\n\t\treturn PathConstraintPositionTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.PathConstraintPositionTimeline = PathConstraintPositionTimeline;\r\n\tvar PathConstraintSpacingTimeline = (function (_super) {\r\n\t\t__extends(PathConstraintSpacingTimeline, _super);\r\n\t\tfunction PathConstraintSpacingTimeline(frameCount) {\r\n\t\t\treturn _super.call(this, frameCount) || this;\r\n\t\t}\r\n\t\tPathConstraintSpacingTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;\r\n\t\t};\r\n\t\tPathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.spacing = constraint.data.spacing;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar spacing = 0;\r\n\t\t\tif (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES])\r\n\t\t\t\tspacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE];\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\r\n\t\t\t\tspacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\tspacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup)\r\n\t\t\t\tconstraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\r\n\t\t\telse\r\n\t\t\t\tconstraint.spacing += (spacing - constraint.spacing) * alpha;\r\n\t\t};\r\n\t\treturn PathConstraintSpacingTimeline;\r\n\t}(PathConstraintPositionTimeline));\r\n\tspine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline;\r\n\tvar PathConstraintMixTimeline = (function (_super) {\r\n\t\t__extends(PathConstraintMixTimeline, _super);\r\n\t\tfunction PathConstraintMixTimeline(frameCount) {\r\n\t\t\tvar _this = _super.call(this, frameCount) || this;\r\n\t\t\t_this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPathConstraintMixTimeline.prototype.getPropertyId = function () {\r\n\t\t\treturn (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;\r\n\t\t};\r\n\t\tPathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) {\r\n\t\t\tframeIndex *= PathConstraintMixTimeline.ENTRIES;\r\n\t\t\tthis.frames[frameIndex] = time;\r\n\t\t\tthis.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\r\n\t\t\tthis.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\r\n\t\t};\r\n\t\tPathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n\t\t\tvar frames = this.frames;\r\n\t\t\tvar constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase MixBlend.setup:\r\n\t\t\t\t\t\tconstraint.rotateMix = constraint.data.rotateMix;\r\n\t\t\t\t\t\tconstraint.translateMix = constraint.data.translateMix;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase MixBlend.first:\r\n\t\t\t\t\t\tconstraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha;\r\n\t\t\t\t\t\tconstraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar rotate = 0, translate = 0;\r\n\t\t\tif (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) {\r\n\t\t\t\trotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\r\n\t\t\t\trotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\r\n\t\t\t\ttranslate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\tvar percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\trotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent;\r\n\t\t\t\ttranslate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent;\r\n\t\t\t}\r\n\t\t\tif (blend == MixBlend.setup) {\r\n\t\t\t\tconstraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconstraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n\t\t\t\tconstraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n\t\t\t}\r\n\t\t};\r\n\t\tPathConstraintMixTimeline.ENTRIES = 3;\r\n\t\tPathConstraintMixTimeline.PREV_TIME = -3;\r\n\t\tPathConstraintMixTimeline.PREV_ROTATE = -2;\r\n\t\tPathConstraintMixTimeline.PREV_TRANSLATE = -1;\r\n\t\tPathConstraintMixTimeline.ROTATE = 1;\r\n\t\tPathConstraintMixTimeline.TRANSLATE = 2;\r\n\t\treturn PathConstraintMixTimeline;\r\n\t}(CurveTimeline));\r\n\tspine.PathConstraintMixTimeline = PathConstraintMixTimeline;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AnimationState = (function () {\r\n\t\tfunction AnimationState(data) {\r\n\t\t\tthis.tracks = new Array();\r\n\t\t\tthis.events = new Array();\r\n\t\t\tthis.listeners = new Array();\r\n\t\t\tthis.queue = new EventQueue(this);\r\n\t\t\tthis.propertyIDs = new spine.IntSet();\r\n\t\t\tthis.animationsChanged = false;\r\n\t\t\tthis.timeScale = 1;\r\n\t\t\tthis.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); });\r\n\t\t\tthis.data = data;\r\n\t\t}\r\n\t\tAnimationState.prototype.update = function (delta) {\r\n\t\t\tdelta *= this.timeScale;\r\n\t\t\tvar tracks = this.tracks;\r\n\t\t\tfor (var i = 0, n = tracks.length; i < n; i++) {\r\n\t\t\t\tvar current = tracks[i];\r\n\t\t\t\tif (current == null)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tcurrent.animationLast = current.nextAnimationLast;\r\n\t\t\t\tcurrent.trackLast = current.nextTrackLast;\r\n\t\t\t\tvar currentDelta = delta * current.timeScale;\r\n\t\t\t\tif (current.delay > 0) {\r\n\t\t\t\t\tcurrent.delay -= currentDelta;\r\n\t\t\t\t\tif (current.delay > 0)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tcurrentDelta = -current.delay;\r\n\t\t\t\t\tcurrent.delay = 0;\r\n\t\t\t\t}\r\n\t\t\t\tvar next = current.next;\r\n\t\t\t\tif (next != null) {\r\n\t\t\t\t\tvar nextTime = current.trackLast - next.delay;\r\n\t\t\t\t\tif (nextTime >= 0) {\r\n\t\t\t\t\t\tnext.delay = 0;\r\n\t\t\t\t\t\tnext.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\r\n\t\t\t\t\t\tcurrent.trackTime += currentDelta;\r\n\t\t\t\t\t\tthis.setCurrent(i, next, true);\r\n\t\t\t\t\t\twhile (next.mixingFrom != null) {\r\n\t\t\t\t\t\t\tnext.mixTime += delta;\r\n\t\t\t\t\t\t\tnext = next.mixingFrom;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {\r\n\t\t\t\t\ttracks[i] = null;\r\n\t\t\t\t\tthis.queue.end(current);\r\n\t\t\t\t\tthis.disposeNext(current);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif (current.mixingFrom != null && this.updateMixingFrom(current, delta)) {\r\n\t\t\t\t\tvar from = current.mixingFrom;\r\n\t\t\t\t\tcurrent.mixingFrom = null;\r\n\t\t\t\t\tif (from != null)\r\n\t\t\t\t\t\tfrom.mixingTo = null;\r\n\t\t\t\t\twhile (from != null) {\r\n\t\t\t\t\t\tthis.queue.end(from);\r\n\t\t\t\t\t\tfrom = from.mixingFrom;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcurrent.trackTime += currentDelta;\r\n\t\t\t}\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.updateMixingFrom = function (to, delta) {\r\n\t\t\tvar from = to.mixingFrom;\r\n\t\t\tif (from == null)\r\n\t\t\t\treturn true;\r\n\t\t\tvar finished = this.updateMixingFrom(from, delta);\r\n\t\t\tfrom.animationLast = from.nextAnimationLast;\r\n\t\t\tfrom.trackLast = from.nextTrackLast;\r\n\t\t\tif (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\r\n\t\t\t\tif (from.totalAlpha == 0 || to.mixDuration == 0) {\r\n\t\t\t\t\tto.mixingFrom = from.mixingFrom;\r\n\t\t\t\t\tif (from.mixingFrom != null)\r\n\t\t\t\t\t\tfrom.mixingFrom.mixingTo = to;\r\n\t\t\t\t\tto.interruptAlpha = from.interruptAlpha;\r\n\t\t\t\t\tthis.queue.end(from);\r\n\t\t\t\t}\r\n\t\t\t\treturn finished;\r\n\t\t\t}\r\n\t\t\tfrom.trackTime += delta * from.timeScale;\r\n\t\t\tto.mixTime += delta;\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tAnimationState.prototype.apply = function (skeleton) {\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tif (this.animationsChanged)\r\n\t\t\t\tthis._animationsChanged();\r\n\t\t\tvar events = this.events;\r\n\t\t\tvar tracks = this.tracks;\r\n\t\t\tvar applied = false;\r\n\t\t\tfor (var i = 0, n = tracks.length; i < n; i++) {\r\n\t\t\t\tvar current = tracks[i];\r\n\t\t\t\tif (current == null || current.delay > 0)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tapplied = true;\r\n\t\t\t\tvar blend = i == 0 ? spine.MixBlend.first : current.mixBlend;\r\n\t\t\t\tvar mix = current.alpha;\r\n\t\t\t\tif (current.mixingFrom != null)\r\n\t\t\t\t\tmix *= this.applyMixingFrom(current, skeleton, blend);\r\n\t\t\t\telse if (current.trackTime >= current.trackEnd && current.next == null)\r\n\t\t\t\t\tmix = 0;\r\n\t\t\t\tvar animationLast = current.animationLast, animationTime = current.getAnimationTime();\r\n\t\t\t\tvar timelineCount = current.animation.timelines.length;\r\n\t\t\t\tvar timelines = current.animation.timelines;\r\n\t\t\t\tif ((i == 0 && mix == 1) || blend == spine.MixBlend.add) {\r\n\t\t\t\t\tfor (var ii = 0; ii < timelineCount; ii++)\r\n\t\t\t\t\t\ttimelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection[\"in\"]);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar timelineMode = current.timelineMode;\r\n\t\t\t\t\tvar firstFrame = current.timelinesRotation.length == 0;\r\n\t\t\t\t\tif (firstFrame)\r\n\t\t\t\t\t\tspine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null);\r\n\t\t\t\t\tvar timelinesRotation = current.timelinesRotation;\r\n\t\t\t\t\tfor (var ii = 0; ii < timelineCount; ii++) {\r\n\t\t\t\t\t\tvar timeline = timelines[ii];\r\n\t\t\t\t\t\tvar timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup;\r\n\t\t\t\t\t\tif (timeline instanceof spine.RotateTimeline) {\r\n\t\t\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tspine.Utils.webkit602BugfixHelper(mix, blend);\r\n\t\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection[\"in\"]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.queueEvents(current, animationTime);\r\n\t\t\t\tevents.length = 0;\r\n\t\t\t\tcurrent.nextAnimationLast = animationTime;\r\n\t\t\t\tcurrent.nextTrackLast = current.trackTime;\r\n\t\t\t}\r\n\t\t\tthis.queue.drain();\r\n\t\t\treturn applied;\r\n\t\t};\r\n\t\tAnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\r\n\t\t\tvar from = to.mixingFrom;\r\n\t\t\tif (from.mixingFrom != null)\r\n\t\t\t\tthis.applyMixingFrom(from, skeleton, blend);\r\n\t\t\tvar mix = 0;\r\n\t\t\tif (to.mixDuration == 0) {\r\n\t\t\t\tmix = 1;\r\n\t\t\t\tif (blend == spine.MixBlend.first)\r\n\t\t\t\t\tblend = spine.MixBlend.setup;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tmix = to.mixTime / to.mixDuration;\r\n\t\t\t\tif (mix > 1)\r\n\t\t\t\t\tmix = 1;\r\n\t\t\t\tif (blend != spine.MixBlend.first)\r\n\t\t\t\t\tblend = from.mixBlend;\r\n\t\t\t}\r\n\t\t\tvar events = mix < from.eventThreshold ? this.events : null;\r\n\t\t\tvar attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\r\n\t\t\tvar animationLast = from.animationLast, animationTime = from.getAnimationTime();\r\n\t\t\tvar timelineCount = from.animation.timelines.length;\r\n\t\t\tvar timelines = from.animation.timelines;\r\n\t\t\tvar alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\r\n\t\t\tif (blend == spine.MixBlend.add) {\r\n\t\t\t\tfor (var i = 0; i < timelineCount; i++)\r\n\t\t\t\t\ttimelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar timelineMode = from.timelineMode;\r\n\t\t\t\tvar timelineHoldMix = from.timelineHoldMix;\r\n\t\t\t\tvar firstFrame = from.timelinesRotation.length == 0;\r\n\t\t\t\tif (firstFrame)\r\n\t\t\t\t\tspine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);\r\n\t\t\t\tvar timelinesRotation = from.timelinesRotation;\r\n\t\t\t\tfrom.totalAlpha = 0;\r\n\t\t\t\tfor (var i = 0; i < timelineCount; i++) {\r\n\t\t\t\t\tvar timeline = timelines[i];\r\n\t\t\t\t\tvar direction = spine.MixDirection.out;\r\n\t\t\t\t\tvar timelineBlend = void 0;\r\n\t\t\t\t\tvar alpha = 0;\r\n\t\t\t\t\tswitch (timelineMode[i]) {\r\n\t\t\t\t\t\tcase AnimationState.SUBSEQUENT:\r\n\t\t\t\t\t\t\tif (!attachments && timeline instanceof spine.AttachmentTimeline)\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tif (!drawOrder && timeline instanceof spine.DrawOrderTimeline)\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\ttimelineBlend = blend;\r\n\t\t\t\t\t\t\talpha = alphaMix;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase AnimationState.FIRST:\r\n\t\t\t\t\t\t\ttimelineBlend = spine.MixBlend.setup;\r\n\t\t\t\t\t\t\talpha = alphaMix;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase AnimationState.HOLD:\r\n\t\t\t\t\t\t\ttimelineBlend = spine.MixBlend.setup;\r\n\t\t\t\t\t\t\talpha = alphaHold;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\ttimelineBlend = spine.MixBlend.setup;\r\n\t\t\t\t\t\t\tvar holdMix = timelineHoldMix[i];\r\n\t\t\t\t\t\t\talpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom.totalAlpha += alpha;\r\n\t\t\t\t\tif (timeline instanceof spine.RotateTimeline)\r\n\t\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tspine.Utils.webkit602BugfixHelper(alpha, blend);\r\n\t\t\t\t\t\tif (timelineBlend == spine.MixBlend.setup) {\r\n\t\t\t\t\t\t\tif (timeline instanceof spine.AttachmentTimeline) {\r\n\t\t\t\t\t\t\t\tif (attachments)\r\n\t\t\t\t\t\t\t\t\tdirection = spine.MixDirection.out;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if (timeline instanceof spine.DrawOrderTimeline) {\r\n\t\t\t\t\t\t\t\tif (drawOrder)\r\n\t\t\t\t\t\t\t\t\tdirection = spine.MixDirection.out;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (to.mixDuration > 0)\r\n\t\t\t\tthis.queueEvents(from, animationTime);\r\n\t\t\tthis.events.length = 0;\r\n\t\t\tfrom.nextAnimationLast = animationTime;\r\n\t\t\tfrom.nextTrackLast = from.trackTime;\r\n\t\t\treturn mix;\r\n\t\t};\r\n\t\tAnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\r\n\t\t\tif (firstFrame)\r\n\t\t\t\ttimelinesRotation[i] = 0;\r\n\t\t\tif (alpha == 1) {\r\n\t\t\t\ttimeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection[\"in\"]);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar rotateTimeline = timeline;\r\n\t\t\tvar frames = rotateTimeline.frames;\r\n\t\t\tvar bone = skeleton.bones[rotateTimeline.boneIndex];\r\n\t\t\tvar r1 = 0, r2 = 0;\r\n\t\t\tif (time < frames[0]) {\r\n\t\t\t\tswitch (blend) {\r\n\t\t\t\t\tcase spine.MixBlend.setup:\r\n\t\t\t\t\t\tbone.rotation = bone.data.rotation;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tcase spine.MixBlend.first:\r\n\t\t\t\t\t\tr1 = bone.rotation;\r\n\t\t\t\t\t\tr2 = bone.data.rotation;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tr1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation;\r\n\t\t\t\tif (time >= frames[frames.length - spine.RotateTimeline.ENTRIES])\r\n\t\t\t\t\tr2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION];\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES);\r\n\t\t\t\t\tvar prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION];\r\n\t\t\t\t\tvar frameTime = frames[frame];\r\n\t\t\t\t\tvar percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime));\r\n\t\t\t\t\tr2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation;\r\n\t\t\t\t\tr2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n\t\t\t\t\tr2 = prevRotation + r2 * percent + bone.data.rotation;\r\n\t\t\t\t\tr2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar total = 0, diff = r2 - r1;\r\n\t\t\tdiff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\r\n\t\t\tif (diff == 0) {\r\n\t\t\t\ttotal = timelinesRotation[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar lastTotal = 0, lastDiff = 0;\r\n\t\t\t\tif (firstFrame) {\r\n\t\t\t\t\tlastTotal = 0;\r\n\t\t\t\t\tlastDiff = diff;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlastTotal = timelinesRotation[i];\r\n\t\t\t\t\tlastDiff = timelinesRotation[i + 1];\r\n\t\t\t\t}\r\n\t\t\t\tvar current = diff > 0, dir = lastTotal >= 0;\r\n\t\t\t\tif (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\r\n\t\t\t\t\tif (Math.abs(lastTotal) > 180)\r\n\t\t\t\t\t\tlastTotal += 360 * spine.MathUtils.signum(lastTotal);\r\n\t\t\t\t\tdir = current;\r\n\t\t\t\t}\r\n\t\t\t\ttotal = diff + lastTotal - lastTotal % 360;\r\n\t\t\t\tif (dir != current)\r\n\t\t\t\t\ttotal += 360 * spine.MathUtils.signum(lastTotal);\r\n\t\t\t\ttimelinesRotation[i] = total;\r\n\t\t\t}\r\n\t\t\ttimelinesRotation[i + 1] = diff;\r\n\t\t\tr1 += total * alpha;\r\n\t\t\tbone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360;\r\n\t\t};\r\n\t\tAnimationState.prototype.queueEvents = function (entry, animationTime) {\r\n\t\t\tvar animationStart = entry.animationStart, animationEnd = entry.animationEnd;\r\n\t\t\tvar duration = animationEnd - animationStart;\r\n\t\t\tvar trackLastWrapped = entry.trackLast % duration;\r\n\t\t\tvar events = this.events;\r\n\t\t\tvar i = 0, n = events.length;\r\n\t\t\tfor (; i < n; i++) {\r\n\t\t\t\tvar event_1 = events[i];\r\n\t\t\t\tif (event_1.time < trackLastWrapped)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif (event_1.time > animationEnd)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tthis.queue.event(entry, event_1);\r\n\t\t\t}\r\n\t\t\tvar complete = false;\r\n\t\t\tif (entry.loop)\r\n\t\t\t\tcomplete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\r\n\t\t\telse\r\n\t\t\t\tcomplete = animationTime >= animationEnd && entry.animationLast < animationEnd;\r\n\t\t\tif (complete)\r\n\t\t\t\tthis.queue.complete(entry);\r\n\t\t\tfor (; i < n; i++) {\r\n\t\t\t\tvar event_2 = events[i];\r\n\t\t\t\tif (event_2.time < animationStart)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tthis.queue.event(entry, events[i]);\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimationState.prototype.clearTracks = function () {\r\n\t\t\tvar oldDrainDisabled = this.queue.drainDisabled;\r\n\t\t\tthis.queue.drainDisabled = true;\r\n\t\t\tfor (var i = 0, n = this.tracks.length; i < n; i++)\r\n\t\t\t\tthis.clearTrack(i);\r\n\t\t\tthis.tracks.length = 0;\r\n\t\t\tthis.queue.drainDisabled = oldDrainDisabled;\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.clearTrack = function (trackIndex) {\r\n\t\t\tif (trackIndex >= this.tracks.length)\r\n\t\t\t\treturn;\r\n\t\t\tvar current = this.tracks[trackIndex];\r\n\t\t\tif (current == null)\r\n\t\t\t\treturn;\r\n\t\t\tthis.queue.end(current);\r\n\t\t\tthis.disposeNext(current);\r\n\t\t\tvar entry = current;\r\n\t\t\twhile (true) {\r\n\t\t\t\tvar from = entry.mixingFrom;\r\n\t\t\t\tif (from == null)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tthis.queue.end(from);\r\n\t\t\t\tentry.mixingFrom = null;\r\n\t\t\t\tentry.mixingTo = null;\r\n\t\t\t\tentry = from;\r\n\t\t\t}\r\n\t\t\tthis.tracks[current.trackIndex] = null;\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.setCurrent = function (index, current, interrupt) {\r\n\t\t\tvar from = this.expandToIndex(index);\r\n\t\t\tthis.tracks[index] = current;\r\n\t\t\tif (from != null) {\r\n\t\t\t\tif (interrupt)\r\n\t\t\t\t\tthis.queue.interrupt(from);\r\n\t\t\t\tcurrent.mixingFrom = from;\r\n\t\t\t\tfrom.mixingTo = current;\r\n\t\t\t\tcurrent.mixTime = 0;\r\n\t\t\t\tif (from.mixingFrom != null && from.mixDuration > 0)\r\n\t\t\t\t\tcurrent.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\r\n\t\t\t\tfrom.timelinesRotation.length = 0;\r\n\t\t\t}\r\n\t\t\tthis.queue.start(current);\r\n\t\t};\r\n\t\tAnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\r\n\t\t\tvar animation = this.data.skeletonData.findAnimation(animationName);\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + animationName);\r\n\t\t\treturn this.setAnimationWith(trackIndex, animation, loop);\r\n\t\t};\r\n\t\tAnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"animation cannot be null.\");\r\n\t\t\tvar interrupt = true;\r\n\t\t\tvar current = this.expandToIndex(trackIndex);\r\n\t\t\tif (current != null) {\r\n\t\t\t\tif (current.nextTrackLast == -1) {\r\n\t\t\t\t\tthis.tracks[trackIndex] = current.mixingFrom;\r\n\t\t\t\t\tthis.queue.interrupt(current);\r\n\t\t\t\t\tthis.queue.end(current);\r\n\t\t\t\t\tthis.disposeNext(current);\r\n\t\t\t\t\tcurrent = current.mixingFrom;\r\n\t\t\t\t\tinterrupt = false;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.disposeNext(current);\r\n\t\t\t}\r\n\t\t\tvar entry = this.trackEntry(trackIndex, animation, loop, current);\r\n\t\t\tthis.setCurrent(trackIndex, entry, interrupt);\r\n\t\t\tthis.queue.drain();\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\r\n\t\t\tvar animation = this.data.skeletonData.findAnimation(animationName);\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + animationName);\r\n\t\t\treturn this.addAnimationWith(trackIndex, animation, loop, delay);\r\n\t\t};\r\n\t\tAnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\r\n\t\t\tif (animation == null)\r\n\t\t\t\tthrow new Error(\"animation cannot be null.\");\r\n\t\t\tvar last = this.expandToIndex(trackIndex);\r\n\t\t\tif (last != null) {\r\n\t\t\t\twhile (last.next != null)\r\n\t\t\t\t\tlast = last.next;\r\n\t\t\t}\r\n\t\t\tvar entry = this.trackEntry(trackIndex, animation, loop, last);\r\n\t\t\tif (last == null) {\r\n\t\t\t\tthis.setCurrent(trackIndex, entry, true);\r\n\t\t\t\tthis.queue.drain();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlast.next = entry;\r\n\t\t\t\tif (delay <= 0) {\r\n\t\t\t\t\tvar duration = last.animationEnd - last.animationStart;\r\n\t\t\t\t\tif (duration != 0) {\r\n\t\t\t\t\t\tif (last.loop)\r\n\t\t\t\t\t\t\tdelay += duration * (1 + ((last.trackTime / duration) | 0));\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tdelay += Math.max(duration, last.trackTime);\r\n\t\t\t\t\t\tdelay -= this.data.getMix(last.animation, animation);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tdelay = last.trackTime;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tentry.delay = delay;\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\r\n\t\t\tvar entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false);\r\n\t\t\tentry.mixDuration = mixDuration;\r\n\t\t\tentry.trackEnd = mixDuration;\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\r\n\t\t\tif (delay <= 0)\r\n\t\t\t\tdelay -= mixDuration;\r\n\t\t\tvar entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay);\r\n\t\t\tentry.mixDuration = mixDuration;\r\n\t\t\tentry.trackEnd = mixDuration;\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.setEmptyAnimations = function (mixDuration) {\r\n\t\t\tvar oldDrainDisabled = this.queue.drainDisabled;\r\n\t\t\tthis.queue.drainDisabled = true;\r\n\t\t\tfor (var i = 0, n = this.tracks.length; i < n; i++) {\r\n\t\t\t\tvar current = this.tracks[i];\r\n\t\t\t\tif (current != null)\r\n\t\t\t\t\tthis.setEmptyAnimation(current.trackIndex, mixDuration);\r\n\t\t\t}\r\n\t\t\tthis.queue.drainDisabled = oldDrainDisabled;\r\n\t\t\tthis.queue.drain();\r\n\t\t};\r\n\t\tAnimationState.prototype.expandToIndex = function (index) {\r\n\t\t\tif (index < this.tracks.length)\r\n\t\t\t\treturn this.tracks[index];\r\n\t\t\tspine.Utils.ensureArrayCapacity(this.tracks, index + 1, null);\r\n\t\t\tthis.tracks.length = index + 1;\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tAnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\r\n\t\t\tvar entry = this.trackEntryPool.obtain();\r\n\t\t\tentry.trackIndex = trackIndex;\r\n\t\t\tentry.animation = animation;\r\n\t\t\tentry.loop = loop;\r\n\t\t\tentry.holdPrevious = false;\r\n\t\t\tentry.eventThreshold = 0;\r\n\t\t\tentry.attachmentThreshold = 0;\r\n\t\t\tentry.drawOrderThreshold = 0;\r\n\t\t\tentry.animationStart = 0;\r\n\t\t\tentry.animationEnd = animation.duration;\r\n\t\t\tentry.animationLast = -1;\r\n\t\t\tentry.nextAnimationLast = -1;\r\n\t\t\tentry.delay = 0;\r\n\t\t\tentry.trackTime = 0;\r\n\t\t\tentry.trackLast = -1;\r\n\t\t\tentry.nextTrackLast = -1;\r\n\t\t\tentry.trackEnd = Number.MAX_VALUE;\r\n\t\t\tentry.timeScale = 1;\r\n\t\t\tentry.alpha = 1;\r\n\t\t\tentry.interruptAlpha = 1;\r\n\t\t\tentry.mixTime = 0;\r\n\t\t\tentry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);\r\n\t\t\treturn entry;\r\n\t\t};\r\n\t\tAnimationState.prototype.disposeNext = function (entry) {\r\n\t\t\tvar next = entry.next;\r\n\t\t\twhile (next != null) {\r\n\t\t\t\tthis.queue.dispose(next);\r\n\t\t\t\tnext = next.next;\r\n\t\t\t}\r\n\t\t\tentry.next = null;\r\n\t\t};\r\n\t\tAnimationState.prototype._animationsChanged = function () {\r\n\t\t\tthis.animationsChanged = false;\r\n\t\t\tthis.propertyIDs.clear();\r\n\t\t\tfor (var i = 0, n = this.tracks.length; i < n; i++) {\r\n\t\t\t\tvar entry = this.tracks[i];\r\n\t\t\t\tif (entry == null)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\twhile (entry.mixingFrom != null)\r\n\t\t\t\t\tentry = entry.mixingFrom;\r\n\t\t\t\tdo {\r\n\t\t\t\t\tif (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add)\r\n\t\t\t\t\t\tthis.setTimelineModes(entry);\r\n\t\t\t\t\tentry = entry.mixingTo;\r\n\t\t\t\t} while (entry != null);\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimationState.prototype.setTimelineModes = function (entry) {\r\n\t\t\tvar to = entry.mixingTo;\r\n\t\t\tvar timelines = entry.animation.timelines;\r\n\t\t\tvar timelinesCount = entry.animation.timelines.length;\r\n\t\t\tvar timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount);\r\n\t\t\tentry.timelineHoldMix.length = 0;\r\n\t\t\tvar timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount);\r\n\t\t\tvar propertyIDs = this.propertyIDs;\r\n\t\t\tif (to != null && to.holdPrevious) {\r\n\t\t\t\tfor (var i = 0; i < timelinesCount; i++) {\r\n\t\t\t\t\tpropertyIDs.add(timelines[i].getPropertyId());\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.HOLD;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\touter: for (var i = 0; i < timelinesCount; i++) {\r\n\t\t\t\tvar id = timelines[i].getPropertyId();\r\n\t\t\t\tif (!propertyIDs.add(id))\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.SUBSEQUENT;\r\n\t\t\t\telse if (to == null || !this.hasTimeline(to, id))\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.FIRST;\r\n\t\t\t\telse {\r\n\t\t\t\t\tfor (var next = to.mixingTo; next != null; next = next.mixingTo) {\r\n\t\t\t\t\t\tif (this.hasTimeline(next, id))\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tif (entry.mixDuration > 0) {\r\n\t\t\t\t\t\t\ttimelineMode[i] = AnimationState.HOLD_MIX;\r\n\t\t\t\t\t\t\ttimelineDipMix[i] = next;\r\n\t\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimelineMode[i] = AnimationState.HOLD;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tAnimationState.prototype.hasTimeline = function (entry, id) {\r\n\t\t\tvar timelines = entry.animation.timelines;\r\n\t\t\tfor (var i = 0, n = timelines.length; i < n; i++)\r\n\t\t\t\tif (timelines[i].getPropertyId() == id)\r\n\t\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tAnimationState.prototype.getCurrent = function (trackIndex) {\r\n\t\t\tif (trackIndex >= this.tracks.length)\r\n\t\t\t\treturn null;\r\n\t\t\treturn this.tracks[trackIndex];\r\n\t\t};\r\n\t\tAnimationState.prototype.addListener = function (listener) {\r\n\t\t\tif (listener == null)\r\n\t\t\t\tthrow new Error(\"listener cannot be null.\");\r\n\t\t\tthis.listeners.push(listener);\r\n\t\t};\r\n\t\tAnimationState.prototype.removeListener = function (listener) {\r\n\t\t\tvar index = this.listeners.indexOf(listener);\r\n\t\t\tif (index >= 0)\r\n\t\t\t\tthis.listeners.splice(index, 1);\r\n\t\t};\r\n\t\tAnimationState.prototype.clearListeners = function () {\r\n\t\t\tthis.listeners.length = 0;\r\n\t\t};\r\n\t\tAnimationState.prototype.clearListenerNotifications = function () {\r\n\t\t\tthis.queue.clear();\r\n\t\t};\r\n\t\tAnimationState.emptyAnimation = new spine.Animation(\"\", [], 0);\r\n\t\tAnimationState.SUBSEQUENT = 0;\r\n\t\tAnimationState.FIRST = 1;\r\n\t\tAnimationState.HOLD = 2;\r\n\t\tAnimationState.HOLD_MIX = 3;\r\n\t\treturn AnimationState;\r\n\t}());\r\n\tspine.AnimationState = AnimationState;\r\n\tvar TrackEntry = (function () {\r\n\t\tfunction TrackEntry() {\r\n\t\t\tthis.mixBlend = spine.MixBlend.replace;\r\n\t\t\tthis.timelineMode = new Array();\r\n\t\t\tthis.timelineHoldMix = new Array();\r\n\t\t\tthis.timelinesRotation = new Array();\r\n\t\t}\r\n\t\tTrackEntry.prototype.reset = function () {\r\n\t\t\tthis.next = null;\r\n\t\t\tthis.mixingFrom = null;\r\n\t\t\tthis.mixingTo = null;\r\n\t\t\tthis.animation = null;\r\n\t\t\tthis.listener = null;\r\n\t\t\tthis.timelineMode.length = 0;\r\n\t\t\tthis.timelineHoldMix.length = 0;\r\n\t\t\tthis.timelinesRotation.length = 0;\r\n\t\t};\r\n\t\tTrackEntry.prototype.getAnimationTime = function () {\r\n\t\t\tif (this.loop) {\r\n\t\t\t\tvar duration = this.animationEnd - this.animationStart;\r\n\t\t\t\tif (duration == 0)\r\n\t\t\t\t\treturn this.animationStart;\r\n\t\t\t\treturn (this.trackTime % duration) + this.animationStart;\r\n\t\t\t}\r\n\t\t\treturn Math.min(this.trackTime + this.animationStart, this.animationEnd);\r\n\t\t};\r\n\t\tTrackEntry.prototype.setAnimationLast = function (animationLast) {\r\n\t\t\tthis.animationLast = animationLast;\r\n\t\t\tthis.nextAnimationLast = animationLast;\r\n\t\t};\r\n\t\tTrackEntry.prototype.isComplete = function () {\r\n\t\t\treturn this.trackTime >= this.animationEnd - this.animationStart;\r\n\t\t};\r\n\t\tTrackEntry.prototype.resetRotationDirections = function () {\r\n\t\t\tthis.timelinesRotation.length = 0;\r\n\t\t};\r\n\t\treturn TrackEntry;\r\n\t}());\r\n\tspine.TrackEntry = TrackEntry;\r\n\tvar EventQueue = (function () {\r\n\t\tfunction EventQueue(animState) {\r\n\t\t\tthis.objects = [];\r\n\t\t\tthis.drainDisabled = false;\r\n\t\t\tthis.animState = animState;\r\n\t\t}\r\n\t\tEventQueue.prototype.start = function (entry) {\r\n\t\t\tthis.objects.push(EventType.start);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t\tthis.animState.animationsChanged = true;\r\n\t\t};\r\n\t\tEventQueue.prototype.interrupt = function (entry) {\r\n\t\t\tthis.objects.push(EventType.interrupt);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t};\r\n\t\tEventQueue.prototype.end = function (entry) {\r\n\t\t\tthis.objects.push(EventType.end);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t\tthis.animState.animationsChanged = true;\r\n\t\t};\r\n\t\tEventQueue.prototype.dispose = function (entry) {\r\n\t\t\tthis.objects.push(EventType.dispose);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t};\r\n\t\tEventQueue.prototype.complete = function (entry) {\r\n\t\t\tthis.objects.push(EventType.complete);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t};\r\n\t\tEventQueue.prototype.event = function (entry, event) {\r\n\t\t\tthis.objects.push(EventType.event);\r\n\t\t\tthis.objects.push(entry);\r\n\t\t\tthis.objects.push(event);\r\n\t\t};\r\n\t\tEventQueue.prototype.drain = function () {\r\n\t\t\tif (this.drainDisabled)\r\n\t\t\t\treturn;\r\n\t\t\tthis.drainDisabled = true;\r\n\t\t\tvar objects = this.objects;\r\n\t\t\tvar listeners = this.animState.listeners;\r\n\t\t\tfor (var i = 0; i < objects.length; i += 2) {\r\n\t\t\t\tvar type = objects[i];\r\n\t\t\t\tvar entry = objects[i + 1];\r\n\t\t\t\tswitch (type) {\r\n\t\t\t\t\tcase EventType.start:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.start)\r\n\t\t\t\t\t\t\tentry.listener.start(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].start)\r\n\t\t\t\t\t\t\t\tlisteners[ii].start(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.interrupt:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.interrupt)\r\n\t\t\t\t\t\t\tentry.listener.interrupt(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].interrupt)\r\n\t\t\t\t\t\t\t\tlisteners[ii].interrupt(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.end:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.end)\r\n\t\t\t\t\t\t\tentry.listener.end(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].end)\r\n\t\t\t\t\t\t\t\tlisteners[ii].end(entry);\r\n\t\t\t\t\tcase EventType.dispose:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.dispose)\r\n\t\t\t\t\t\t\tentry.listener.dispose(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].dispose)\r\n\t\t\t\t\t\t\t\tlisteners[ii].dispose(entry);\r\n\t\t\t\t\t\tthis.animState.trackEntryPool.free(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.complete:\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.complete)\r\n\t\t\t\t\t\t\tentry.listener.complete(entry);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].complete)\r\n\t\t\t\t\t\t\t\tlisteners[ii].complete(entry);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase EventType.event:\r\n\t\t\t\t\t\tvar event_3 = objects[i++ + 2];\r\n\t\t\t\t\t\tif (entry.listener != null && entry.listener.event)\r\n\t\t\t\t\t\t\tentry.listener.event(entry, event_3);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < listeners.length; ii++)\r\n\t\t\t\t\t\t\tif (listeners[ii].event)\r\n\t\t\t\t\t\t\t\tlisteners[ii].event(entry, event_3);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.clear();\r\n\t\t\tthis.drainDisabled = false;\r\n\t\t};\r\n\t\tEventQueue.prototype.clear = function () {\r\n\t\t\tthis.objects.length = 0;\r\n\t\t};\r\n\t\treturn EventQueue;\r\n\t}());\r\n\tspine.EventQueue = EventQueue;\r\n\tvar EventType;\r\n\t(function (EventType) {\r\n\t\tEventType[EventType[\"start\"] = 0] = \"start\";\r\n\t\tEventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\r\n\t\tEventType[EventType[\"end\"] = 2] = \"end\";\r\n\t\tEventType[EventType[\"dispose\"] = 3] = \"dispose\";\r\n\t\tEventType[EventType[\"complete\"] = 4] = \"complete\";\r\n\t\tEventType[EventType[\"event\"] = 5] = \"event\";\r\n\t})(EventType = spine.EventType || (spine.EventType = {}));\r\n\tvar AnimationStateAdapter2 = (function () {\r\n\t\tfunction AnimationStateAdapter2() {\r\n\t\t}\r\n\t\tAnimationStateAdapter2.prototype.start = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.interrupt = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.end = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.dispose = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.complete = function (entry) {\r\n\t\t};\r\n\t\tAnimationStateAdapter2.prototype.event = function (entry, event) {\r\n\t\t};\r\n\t\treturn AnimationStateAdapter2;\r\n\t}());\r\n\tspine.AnimationStateAdapter2 = AnimationStateAdapter2;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AnimationStateData = (function () {\r\n\t\tfunction AnimationStateData(skeletonData) {\r\n\t\t\tthis.animationToMixTime = {};\r\n\t\t\tthis.defaultMix = 0;\r\n\t\t\tif (skeletonData == null)\r\n\t\t\t\tthrow new Error(\"skeletonData cannot be null.\");\r\n\t\t\tthis.skeletonData = skeletonData;\r\n\t\t}\r\n\t\tAnimationStateData.prototype.setMix = function (fromName, toName, duration) {\r\n\t\t\tvar from = this.skeletonData.findAnimation(fromName);\r\n\t\t\tif (from == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + fromName);\r\n\t\t\tvar to = this.skeletonData.findAnimation(toName);\r\n\t\t\tif (to == null)\r\n\t\t\t\tthrow new Error(\"Animation not found: \" + toName);\r\n\t\t\tthis.setMixWith(from, to, duration);\r\n\t\t};\r\n\t\tAnimationStateData.prototype.setMixWith = function (from, to, duration) {\r\n\t\t\tif (from == null)\r\n\t\t\t\tthrow new Error(\"from cannot be null.\");\r\n\t\t\tif (to == null)\r\n\t\t\t\tthrow new Error(\"to cannot be null.\");\r\n\t\t\tvar key = from.name + \".\" + to.name;\r\n\t\t\tthis.animationToMixTime[key] = duration;\r\n\t\t};\r\n\t\tAnimationStateData.prototype.getMix = function (from, to) {\r\n\t\t\tvar key = from.name + \".\" + to.name;\r\n\t\t\tvar value = this.animationToMixTime[key];\r\n\t\t\treturn value === undefined ? this.defaultMix : value;\r\n\t\t};\r\n\t\treturn AnimationStateData;\r\n\t}());\r\n\tspine.AnimationStateData = AnimationStateData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AssetManager = (function () {\r\n\t\tfunction AssetManager(textureLoader, pathPrefix) {\r\n\t\t\tif (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n\t\t\tthis.assets = {};\r\n\t\t\tthis.errors = {};\r\n\t\t\tthis.toLoad = 0;\r\n\t\t\tthis.loaded = 0;\r\n\t\t\tthis.textureLoader = textureLoader;\r\n\t\t\tthis.pathPrefix = pathPrefix;\r\n\t\t}\r\n\t\tAssetManager.downloadText = function (url, success, error) {\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.open(\"GET\", url, true);\r\n\t\t\trequest.onload = function () {\r\n\t\t\t\tif (request.status == 200) {\r\n\t\t\t\t\tsuccess(request.responseText);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.onerror = function () {\r\n\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t};\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tAssetManager.downloadBinary = function (url, success, error) {\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.open(\"GET\", url, true);\r\n\t\t\trequest.responseType = \"arraybuffer\";\r\n\t\t\trequest.onload = function () {\r\n\t\t\t\tif (request.status == 200) {\r\n\t\t\t\t\tsuccess(new Uint8Array(request.response));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.onerror = function () {\r\n\t\t\t\terror(request.status, request.responseText);\r\n\t\t\t};\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tAssetManager.prototype.loadText = function (path, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tAssetManager.downloadText(path, function (data) {\r\n\t\t\t\t_this.assets[path] = data;\r\n\t\t\t\tif (success)\r\n\t\t\t\t\tsuccess(path, data);\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t}, function (state, responseText) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText);\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t});\r\n\t\t};\r\n\t\tAssetManager.prototype.loadTexture = function (path, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tvar img = new Image();\r\n\t\t\timg.crossOrigin = \"anonymous\";\r\n\t\t\timg.onload = function (ev) {\r\n\t\t\t\tvar texture = _this.textureLoader(img);\r\n\t\t\t\t_this.assets[path] = texture;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (success)\r\n\t\t\t\t\tsuccess(path, img);\r\n\t\t\t};\r\n\t\t\timg.onerror = function (ev) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load image \" + path;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load image \" + path);\r\n\t\t\t};\r\n\t\t\timg.src = path;\r\n\t\t};\r\n\t\tAssetManager.prototype.loadTextureData = function (path, data, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tvar img = new Image();\r\n\t\t\timg.onload = function (ev) {\r\n\t\t\t\tvar texture = _this.textureLoader(img);\r\n\t\t\t\t_this.assets[path] = texture;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (success)\r\n\t\t\t\t\tsuccess(path, img);\r\n\t\t\t};\r\n\t\t\timg.onerror = function (ev) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load image \" + path;\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load image \" + path);\r\n\t\t\t};\r\n\t\t\timg.src = data;\r\n\t\t};\r\n\t\tAssetManager.prototype.loadTextureAtlas = function (path, success, error) {\r\n\t\t\tvar _this = this;\r\n\t\t\tif (success === void 0) { success = null; }\r\n\t\t\tif (error === void 0) { error = null; }\r\n\t\t\tvar parent = path.lastIndexOf(\"/\") >= 0 ? path.substring(0, path.lastIndexOf(\"/\")) : \"\";\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tthis.toLoad++;\r\n\t\t\tAssetManager.downloadText(path, function (atlasData) {\r\n\t\t\t\tvar pagesLoaded = { count: 0 };\r\n\t\t\t\tvar atlasPages = new Array();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar atlas = new spine.TextureAtlas(atlasData, function (path) {\r\n\t\t\t\t\t\tatlasPages.push(parent + \"/\" + path);\r\n\t\t\t\t\t\tvar image = document.createElement(\"img\");\r\n\t\t\t\t\t\timage.width = 16;\r\n\t\t\t\t\t\timage.height = 16;\r\n\t\t\t\t\t\treturn new spine.FakeTexture(image);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\tvar ex = e;\r\n\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\r\n\t\t\t\t\tif (error)\r\n\t\t\t\t\t\terror(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\r\n\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar _loop_1 = function (atlasPage) {\r\n\t\t\t\t\tvar pageLoadError = false;\r\n\t\t\t\t\t_this.loadTexture(atlasPage, function (imagePath, image) {\r\n\t\t\t\t\t\tpagesLoaded.count++;\r\n\t\t\t\t\t\tif (pagesLoaded.count == atlasPages.length) {\r\n\t\t\t\t\t\t\tif (!pageLoadError) {\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tvar atlas = new spine.TextureAtlas(atlasData, function (path) {\r\n\t\t\t\t\t\t\t\t\t\treturn _this.get(parent + \"/\" + path);\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t_this.assets[path] = atlas;\r\n\t\t\t\t\t\t\t\t\tif (success)\r\n\t\t\t\t\t\t\t\t\t\tsuccess(path, atlas);\r\n\t\t\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tcatch (e) {\r\n\t\t\t\t\t\t\t\t\tvar ex = e;\r\n\t\t\t\t\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\r\n\t\t\t\t\t\t\t\t\tif (error)\r\n\t\t\t\t\t\t\t\t\t\terror(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\r\n\t\t\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\r\n\t\t\t\t\t\t\t\tif (error)\r\n\t\t\t\t\t\t\t\t\terror(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\r\n\t\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, function (imagePath, errorMessage) {\r\n\t\t\t\t\t\tpageLoadError = true;\r\n\t\t\t\t\t\tpagesLoaded.count++;\r\n\t\t\t\t\t\tif (pagesLoaded.count == atlasPages.length) {\r\n\t\t\t\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\r\n\t\t\t\t\t\t\tif (error)\r\n\t\t\t\t\t\t\t\terror(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\r\n\t\t\t\t\t\t\t_this.toLoad--;\r\n\t\t\t\t\t\t\t_this.loaded++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t};\r\n\t\t\t\tfor (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) {\r\n\t\t\t\t\tvar atlasPage = atlasPages_1[_i];\r\n\t\t\t\t\t_loop_1(atlasPage);\r\n\t\t\t\t}\r\n\t\t\t}, function (state, responseText) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText;\r\n\t\t\t\tif (error)\r\n\t\t\t\t\terror(path, \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText);\r\n\t\t\t\t_this.toLoad--;\r\n\t\t\t\t_this.loaded++;\r\n\t\t\t});\r\n\t\t};\r\n\t\tAssetManager.prototype.get = function (path) {\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\treturn this.assets[path];\r\n\t\t};\r\n\t\tAssetManager.prototype.remove = function (path) {\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tvar asset = this.assets[path];\r\n\t\t\tif (asset.dispose)\r\n\t\t\t\tasset.dispose();\r\n\t\t\tthis.assets[path] = null;\r\n\t\t};\r\n\t\tAssetManager.prototype.removeAll = function () {\r\n\t\t\tfor (var key in this.assets) {\r\n\t\t\t\tvar asset = this.assets[key];\r\n\t\t\t\tif (asset.dispose)\r\n\t\t\t\t\tasset.dispose();\r\n\t\t\t}\r\n\t\t\tthis.assets = {};\r\n\t\t};\r\n\t\tAssetManager.prototype.isLoadingComplete = function () {\r\n\t\t\treturn this.toLoad == 0;\r\n\t\t};\r\n\t\tAssetManager.prototype.getToLoad = function () {\r\n\t\t\treturn this.toLoad;\r\n\t\t};\r\n\t\tAssetManager.prototype.getLoaded = function () {\r\n\t\t\treturn this.loaded;\r\n\t\t};\r\n\t\tAssetManager.prototype.dispose = function () {\r\n\t\t\tthis.removeAll();\r\n\t\t};\r\n\t\tAssetManager.prototype.hasErrors = function () {\r\n\t\t\treturn Object.keys(this.errors).length > 0;\r\n\t\t};\r\n\t\tAssetManager.prototype.getErrors = function () {\r\n\t\t\treturn this.errors;\r\n\t\t};\r\n\t\treturn AssetManager;\r\n\t}());\r\n\tspine.AssetManager = AssetManager;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AtlasAttachmentLoader = (function () {\r\n\t\tfunction AtlasAttachmentLoader(atlas) {\r\n\t\t\tthis.atlas = atlas;\r\n\t\t}\r\n\t\tAtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) {\r\n\t\t\tvar region = this.atlas.findRegion(path);\r\n\t\t\tif (region == null)\r\n\t\t\t\tthrow new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n\t\t\tregion.renderObject = region;\r\n\t\t\tvar attachment = new spine.RegionAttachment(name);\r\n\t\t\tattachment.setRegion(region);\r\n\t\t\treturn attachment;\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {\r\n\t\t\tvar region = this.atlas.findRegion(path);\r\n\t\t\tif (region == null)\r\n\t\t\t\tthrow new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n\t\t\tregion.renderObject = region;\r\n\t\t\tvar attachment = new spine.MeshAttachment(name);\r\n\t\t\tattachment.region = region;\r\n\t\t\treturn attachment;\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\r\n\t\t\treturn new spine.BoundingBoxAttachment(name);\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\r\n\t\t\treturn new spine.PathAttachment(name);\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\r\n\t\t\treturn new spine.PointAttachment(name);\r\n\t\t};\r\n\t\tAtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\r\n\t\t\treturn new spine.ClippingAttachment(name);\r\n\t\t};\r\n\t\treturn AtlasAttachmentLoader;\r\n\t}());\r\n\tspine.AtlasAttachmentLoader = AtlasAttachmentLoader;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar BlendMode;\r\n\t(function (BlendMode) {\r\n\t\tBlendMode[BlendMode[\"Normal\"] = 0] = \"Normal\";\r\n\t\tBlendMode[BlendMode[\"Additive\"] = 1] = \"Additive\";\r\n\t\tBlendMode[BlendMode[\"Multiply\"] = 2] = \"Multiply\";\r\n\t\tBlendMode[BlendMode[\"Screen\"] = 3] = \"Screen\";\r\n\t})(BlendMode = spine.BlendMode || (spine.BlendMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Bone = (function () {\r\n\t\tfunction Bone(data, skeleton, parent) {\r\n\t\t\tthis.children = new Array();\r\n\t\t\tthis.x = 0;\r\n\t\t\tthis.y = 0;\r\n\t\t\tthis.rotation = 0;\r\n\t\t\tthis.scaleX = 0;\r\n\t\t\tthis.scaleY = 0;\r\n\t\t\tthis.shearX = 0;\r\n\t\t\tthis.shearY = 0;\r\n\t\t\tthis.ax = 0;\r\n\t\t\tthis.ay = 0;\r\n\t\t\tthis.arotation = 0;\r\n\t\t\tthis.ascaleX = 0;\r\n\t\t\tthis.ascaleY = 0;\r\n\t\t\tthis.ashearX = 0;\r\n\t\t\tthis.ashearY = 0;\r\n\t\t\tthis.appliedValid = false;\r\n\t\t\tthis.a = 0;\r\n\t\t\tthis.b = 0;\r\n\t\t\tthis.worldX = 0;\r\n\t\t\tthis.c = 0;\r\n\t\t\tthis.d = 0;\r\n\t\t\tthis.worldY = 0;\r\n\t\t\tthis.sorted = false;\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.skeleton = skeleton;\r\n\t\t\tthis.parent = parent;\r\n\t\t\tthis.setToSetupPose();\r\n\t\t}\r\n\t\tBone.prototype.update = function () {\r\n\t\t\tthis.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n\t\t};\r\n\t\tBone.prototype.updateWorldTransform = function () {\r\n\t\t\tthis.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n\t\t};\r\n\t\tBone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\r\n\t\t\tthis.ax = x;\r\n\t\t\tthis.ay = y;\r\n\t\t\tthis.arotation = rotation;\r\n\t\t\tthis.ascaleX = scaleX;\r\n\t\t\tthis.ascaleY = scaleY;\r\n\t\t\tthis.ashearX = shearX;\r\n\t\t\tthis.ashearY = shearY;\r\n\t\t\tthis.appliedValid = true;\r\n\t\t\tvar parent = this.parent;\r\n\t\t\tif (parent == null) {\r\n\t\t\t\tvar skeleton = this.skeleton;\r\n\t\t\t\tvar rotationY = rotation + 90 + shearY;\r\n\t\t\t\tvar sx = skeleton.scaleX;\r\n\t\t\t\tvar sy = skeleton.scaleY;\r\n\t\t\t\tthis.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\r\n\t\t\t\tthis.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx;\r\n\t\t\t\tthis.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\r\n\t\t\t\tthis.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;\r\n\t\t\t\tthis.worldX = x * sx + skeleton.x;\r\n\t\t\t\tthis.worldY = y * sy + skeleton.y;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\r\n\t\t\tthis.worldX = pa * x + pb * y + parent.worldX;\r\n\t\t\tthis.worldY = pc * x + pd * y + parent.worldY;\r\n\t\t\tswitch (this.data.transformMode) {\r\n\t\t\t\tcase spine.TransformMode.Normal: {\r\n\t\t\t\t\tvar rotationY = rotation + 90 + shearY;\r\n\t\t\t\t\tvar la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tvar lb = spine.MathUtils.cosDeg(rotationY) * scaleY;\r\n\t\t\t\t\tvar lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tvar ld = spine.MathUtils.sinDeg(rotationY) * scaleY;\r\n\t\t\t\t\tthis.a = pa * la + pb * lc;\r\n\t\t\t\t\tthis.b = pa * lb + pb * ld;\r\n\t\t\t\t\tthis.c = pc * la + pd * lc;\r\n\t\t\t\t\tthis.d = pc * lb + pd * ld;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcase spine.TransformMode.OnlyTranslation: {\r\n\t\t\t\t\tvar rotationY = rotation + 90 + shearY;\r\n\t\t\t\t\tthis.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tthis.b = spine.MathUtils.cosDeg(rotationY) * scaleY;\r\n\t\t\t\t\tthis.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n\t\t\t\t\tthis.d = spine.MathUtils.sinDeg(rotationY) * scaleY;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase spine.TransformMode.NoRotationOrReflection: {\r\n\t\t\t\t\tvar s = pa * pa + pc * pc;\r\n\t\t\t\t\tvar prx = 0;\r\n\t\t\t\t\tif (s > 0.0001) {\r\n\t\t\t\t\t\ts = Math.abs(pa * pd - pb * pc) / s;\r\n\t\t\t\t\t\tpb = pc * s;\r\n\t\t\t\t\t\tpd = pa * s;\r\n\t\t\t\t\t\tprx = Math.atan2(pc, pa) * spine.MathUtils.radDeg;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpa = 0;\r\n\t\t\t\t\t\tpc = 0;\r\n\t\t\t\t\t\tprx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar rx = rotation + shearX - prx;\r\n\t\t\t\t\tvar ry = rotation + shearY - prx + 90;\r\n\t\t\t\t\tvar la = spine.MathUtils.cosDeg(rx) * scaleX;\r\n\t\t\t\t\tvar lb = spine.MathUtils.cosDeg(ry) * scaleY;\r\n\t\t\t\t\tvar lc = spine.MathUtils.sinDeg(rx) * scaleX;\r\n\t\t\t\t\tvar ld = spine.MathUtils.sinDeg(ry) * scaleY;\r\n\t\t\t\t\tthis.a = pa * la - pb * lc;\r\n\t\t\t\t\tthis.b = pa * lb - pb * ld;\r\n\t\t\t\t\tthis.c = pc * la + pd * lc;\r\n\t\t\t\t\tthis.d = pc * lb + pd * ld;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase spine.TransformMode.NoScale:\r\n\t\t\t\tcase spine.TransformMode.NoScaleOrReflection: {\r\n\t\t\t\t\tvar cos = spine.MathUtils.cosDeg(rotation);\r\n\t\t\t\t\tvar sin = spine.MathUtils.sinDeg(rotation);\r\n\t\t\t\t\tvar za = (pa * cos + pb * sin) / this.skeleton.scaleX;\r\n\t\t\t\t\tvar zc = (pc * cos + pd * sin) / this.skeleton.scaleY;\r\n\t\t\t\t\tvar s = Math.sqrt(za * za + zc * zc);\r\n\t\t\t\t\tif (s > 0.00001)\r\n\t\t\t\t\t\ts = 1 / s;\r\n\t\t\t\t\tza *= s;\r\n\t\t\t\t\tzc *= s;\r\n\t\t\t\t\ts = Math.sqrt(za * za + zc * zc);\r\n\t\t\t\t\tif (this.data.transformMode == spine.TransformMode.NoScale\r\n\t\t\t\t\t\t&& (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0))\r\n\t\t\t\t\t\ts = -s;\r\n\t\t\t\t\tvar r = Math.PI / 2 + Math.atan2(zc, za);\r\n\t\t\t\t\tvar zb = Math.cos(r) * s;\r\n\t\t\t\t\tvar zd = Math.sin(r) * s;\r\n\t\t\t\t\tvar la = spine.MathUtils.cosDeg(shearX) * scaleX;\r\n\t\t\t\t\tvar lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;\r\n\t\t\t\t\tvar lc = spine.MathUtils.sinDeg(shearX) * scaleX;\r\n\t\t\t\t\tvar ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;\r\n\t\t\t\t\tthis.a = za * la + zb * lc;\r\n\t\t\t\t\tthis.b = za * lb + zb * ld;\r\n\t\t\t\t\tthis.c = zc * la + zd * lc;\r\n\t\t\t\t\tthis.d = zc * lb + zd * ld;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.a *= this.skeleton.scaleX;\r\n\t\t\tthis.b *= this.skeleton.scaleX;\r\n\t\t\tthis.c *= this.skeleton.scaleY;\r\n\t\t\tthis.d *= this.skeleton.scaleY;\r\n\t\t};\r\n\t\tBone.prototype.setToSetupPose = function () {\r\n\t\t\tvar data = this.data;\r\n\t\t\tthis.x = data.x;\r\n\t\t\tthis.y = data.y;\r\n\t\t\tthis.rotation = data.rotation;\r\n\t\t\tthis.scaleX = data.scaleX;\r\n\t\t\tthis.scaleY = data.scaleY;\r\n\t\t\tthis.shearX = data.shearX;\r\n\t\t\tthis.shearY = data.shearY;\r\n\t\t};\r\n\t\tBone.prototype.getWorldRotationX = function () {\r\n\t\t\treturn Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\tBone.prototype.getWorldRotationY = function () {\r\n\t\t\treturn Math.atan2(this.d, this.b) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\tBone.prototype.getWorldScaleX = function () {\r\n\t\t\treturn Math.sqrt(this.a * this.a + this.c * this.c);\r\n\t\t};\r\n\t\tBone.prototype.getWorldScaleY = function () {\r\n\t\t\treturn Math.sqrt(this.b * this.b + this.d * this.d);\r\n\t\t};\r\n\t\tBone.prototype.updateAppliedTransform = function () {\r\n\t\t\tthis.appliedValid = true;\r\n\t\t\tvar parent = this.parent;\r\n\t\t\tif (parent == null) {\r\n\t\t\t\tthis.ax = this.worldX;\r\n\t\t\t\tthis.ay = this.worldY;\r\n\t\t\t\tthis.arotation = Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\r\n\t\t\t\tthis.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);\r\n\t\t\t\tthis.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);\r\n\t\t\t\tthis.ashearX = 0;\r\n\t\t\t\tthis.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\r\n\t\t\tvar pid = 1 / (pa * pd - pb * pc);\r\n\t\t\tvar dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;\r\n\t\t\tthis.ax = (dx * pd * pid - dy * pb * pid);\r\n\t\t\tthis.ay = (dy * pa * pid - dx * pc * pid);\r\n\t\t\tvar ia = pid * pd;\r\n\t\t\tvar id = pid * pa;\r\n\t\t\tvar ib = pid * pb;\r\n\t\t\tvar ic = pid * pc;\r\n\t\t\tvar ra = ia * this.a - ib * this.c;\r\n\t\t\tvar rb = ia * this.b - ib * this.d;\r\n\t\t\tvar rc = id * this.c - ic * this.a;\r\n\t\t\tvar rd = id * this.d - ic * this.b;\r\n\t\t\tthis.ashearX = 0;\r\n\t\t\tthis.ascaleX = Math.sqrt(ra * ra + rc * rc);\r\n\t\t\tif (this.ascaleX > 0.0001) {\r\n\t\t\t\tvar det = ra * rd - rb * rc;\r\n\t\t\t\tthis.ascaleY = det / this.ascaleX;\r\n\t\t\t\tthis.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg;\r\n\t\t\t\tthis.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.ascaleX = 0;\r\n\t\t\t\tthis.ascaleY = Math.sqrt(rb * rb + rd * rd);\r\n\t\t\t\tthis.ashearY = 0;\r\n\t\t\t\tthis.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg;\r\n\t\t\t}\r\n\t\t};\r\n\t\tBone.prototype.worldToLocal = function (world) {\r\n\t\t\tvar a = this.a, b = this.b, c = this.c, d = this.d;\r\n\t\t\tvar invDet = 1 / (a * d - b * c);\r\n\t\t\tvar x = world.x - this.worldX, y = world.y - this.worldY;\r\n\t\t\tworld.x = (x * d * invDet - y * b * invDet);\r\n\t\t\tworld.y = (y * a * invDet - x * c * invDet);\r\n\t\t\treturn world;\r\n\t\t};\r\n\t\tBone.prototype.localToWorld = function (local) {\r\n\t\t\tvar x = local.x, y = local.y;\r\n\t\t\tlocal.x = x * this.a + y * this.b + this.worldX;\r\n\t\t\tlocal.y = x * this.c + y * this.d + this.worldY;\r\n\t\t\treturn local;\r\n\t\t};\r\n\t\tBone.prototype.worldToLocalRotation = function (worldRotation) {\r\n\t\t\tvar sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation);\r\n\t\t\treturn Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX;\r\n\t\t};\r\n\t\tBone.prototype.localToWorldRotation = function (localRotation) {\r\n\t\t\tlocalRotation -= this.rotation - this.shearX;\r\n\t\t\tvar sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation);\r\n\t\t\treturn Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\tBone.prototype.rotateWorld = function (degrees) {\r\n\t\t\tvar a = this.a, b = this.b, c = this.c, d = this.d;\r\n\t\t\tvar cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees);\r\n\t\t\tthis.a = cos * a - sin * c;\r\n\t\t\tthis.b = cos * b - sin * d;\r\n\t\t\tthis.c = sin * a + cos * c;\r\n\t\t\tthis.d = sin * b + cos * d;\r\n\t\t\tthis.appliedValid = false;\r\n\t\t};\r\n\t\treturn Bone;\r\n\t}());\r\n\tspine.Bone = Bone;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar BoneData = (function () {\r\n\t\tfunction BoneData(index, name, parent) {\r\n\t\t\tthis.x = 0;\r\n\t\t\tthis.y = 0;\r\n\t\t\tthis.rotation = 0;\r\n\t\t\tthis.scaleX = 1;\r\n\t\t\tthis.scaleY = 1;\r\n\t\t\tthis.shearX = 0;\r\n\t\t\tthis.shearY = 0;\r\n\t\t\tthis.transformMode = TransformMode.Normal;\r\n\t\t\tif (index < 0)\r\n\t\t\t\tthrow new Error(\"index must be >= 0.\");\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.index = index;\r\n\t\t\tthis.name = name;\r\n\t\t\tthis.parent = parent;\r\n\t\t}\r\n\t\treturn BoneData;\r\n\t}());\r\n\tspine.BoneData = BoneData;\r\n\tvar TransformMode;\r\n\t(function (TransformMode) {\r\n\t\tTransformMode[TransformMode[\"Normal\"] = 0] = \"Normal\";\r\n\t\tTransformMode[TransformMode[\"OnlyTranslation\"] = 1] = \"OnlyTranslation\";\r\n\t\tTransformMode[TransformMode[\"NoRotationOrReflection\"] = 2] = \"NoRotationOrReflection\";\r\n\t\tTransformMode[TransformMode[\"NoScale\"] = 3] = \"NoScale\";\r\n\t\tTransformMode[TransformMode[\"NoScaleOrReflection\"] = 4] = \"NoScaleOrReflection\";\r\n\t})(TransformMode = spine.TransformMode || (spine.TransformMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Event = (function () {\r\n\t\tfunction Event(time, data) {\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tthis.time = time;\r\n\t\t\tthis.data = data;\r\n\t\t}\r\n\t\treturn Event;\r\n\t}());\r\n\tspine.Event = Event;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar EventData = (function () {\r\n\t\tfunction EventData(name) {\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn EventData;\r\n\t}());\r\n\tspine.EventData = EventData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar IkConstraint = (function () {\r\n\t\tfunction IkConstraint(data, skeleton) {\r\n\t\t\tthis.bendDirection = 0;\r\n\t\t\tthis.compress = false;\r\n\t\t\tthis.stretch = false;\r\n\t\t\tthis.mix = 1;\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.mix = data.mix;\r\n\t\t\tthis.bendDirection = data.bendDirection;\r\n\t\t\tthis.compress = data.compress;\r\n\t\t\tthis.stretch = data.stretch;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0; i < data.bones.length; i++)\r\n\t\t\t\tthis.bones.push(skeleton.findBone(data.bones[i].name));\r\n\t\t\tthis.target = skeleton.findBone(data.target.name);\r\n\t\t}\r\n\t\tIkConstraint.prototype.getOrder = function () {\r\n\t\t\treturn this.data.order;\r\n\t\t};\r\n\t\tIkConstraint.prototype.apply = function () {\r\n\t\t\tthis.update();\r\n\t\t};\r\n\t\tIkConstraint.prototype.update = function () {\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tswitch (bones.length) {\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tthis.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tthis.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t};\r\n\t\tIkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\r\n\t\t\tif (!bone.appliedValid)\r\n\t\t\t\tbone.updateAppliedTransform();\r\n\t\t\tvar p = bone.parent;\r\n\t\t\tvar id = 1 / (p.a * p.d - p.b * p.c);\r\n\t\t\tvar x = targetX - p.worldX, y = targetY - p.worldY;\r\n\t\t\tvar tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay;\r\n\t\t\tvar rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation;\r\n\t\t\tif (bone.ascaleX < 0)\r\n\t\t\t\trotationIK += 180;\r\n\t\t\tif (rotationIK > 180)\r\n\t\t\t\trotationIK -= 360;\r\n\t\t\telse if (rotationIK < -180)\r\n\t\t\t\trotationIK += 360;\r\n\t\t\tvar sx = bone.ascaleX, sy = bone.ascaleY;\r\n\t\t\tif (compress || stretch) {\r\n\t\t\t\tvar b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\r\n\t\t\t\tif ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\r\n\t\t\t\t\tvar s = (dd / b - 1) * alpha + 1;\r\n\t\t\t\t\tsx *= s;\r\n\t\t\t\t\tif (uniform)\r\n\t\t\t\t\t\tsy *= s;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\r\n\t\t};\r\n\t\tIkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) {\r\n\t\t\tif (alpha == 0) {\r\n\t\t\t\tchild.updateWorldTransform();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!parent.appliedValid)\r\n\t\t\t\tparent.updateAppliedTransform();\r\n\t\t\tif (!child.appliedValid)\r\n\t\t\t\tchild.updateAppliedTransform();\r\n\t\t\tvar px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;\r\n\t\t\tvar os1 = 0, os2 = 0, s2 = 0;\r\n\t\t\tif (psx < 0) {\r\n\t\t\t\tpsx = -psx;\r\n\t\t\t\tos1 = 180;\r\n\t\t\t\ts2 = -1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tos1 = 0;\r\n\t\t\t\ts2 = 1;\r\n\t\t\t}\r\n\t\t\tif (psy < 0) {\r\n\t\t\t\tpsy = -psy;\r\n\t\t\t\ts2 = -s2;\r\n\t\t\t}\r\n\t\t\tif (csx < 0) {\r\n\t\t\t\tcsx = -csx;\r\n\t\t\t\tos2 = 180;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tos2 = 0;\r\n\t\t\tvar cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;\r\n\t\t\tvar u = Math.abs(psx - psy) <= 0.0001;\r\n\t\t\tif (!u) {\r\n\t\t\t\tcy = 0;\r\n\t\t\t\tcwx = a * cx + parent.worldX;\r\n\t\t\t\tcwy = c * cx + parent.worldY;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcy = child.ay;\r\n\t\t\t\tcwx = a * cx + b * cy + parent.worldX;\r\n\t\t\t\tcwy = c * cx + d * cy + parent.worldY;\r\n\t\t\t}\r\n\t\t\tvar pp = parent.parent;\r\n\t\t\ta = pp.a;\r\n\t\t\tb = pp.b;\r\n\t\t\tc = pp.c;\r\n\t\t\td = pp.d;\r\n\t\t\tvar id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY;\r\n\t\t\tvar tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty;\r\n\t\t\tx = cwx - pp.worldX;\r\n\t\t\ty = cwy - pp.worldY;\r\n\t\t\tvar dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n\t\t\tvar l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;\r\n\t\t\touter: if (u) {\r\n\t\t\t\tl2 *= psx;\r\n\t\t\t\tvar cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n\t\t\t\tif (cos < -1)\r\n\t\t\t\t\tcos = -1;\r\n\t\t\t\telse if (cos > 1) {\r\n\t\t\t\t\tcos = 1;\r\n\t\t\t\t\tif (stretch && l1 + l2 > 0.0001)\r\n\t\t\t\t\t\tsx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\r\n\t\t\t\t}\r\n\t\t\t\ta2 = Math.acos(cos) * bendDir;\r\n\t\t\t\ta = l1 + l2 * cos;\r\n\t\t\t\tb = l2 * Math.sin(a2);\r\n\t\t\t\ta1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ta = psx * l2;\r\n\t\t\t\tb = psy * l2;\r\n\t\t\t\tvar aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\r\n\t\t\t\tc = bb * l1 * l1 + aa * dd - aa * bb;\r\n\t\t\t\tvar c1 = -2 * bb * l1, c2 = bb - aa;\r\n\t\t\t\td = c1 * c1 - 4 * c2 * c;\r\n\t\t\t\tif (d >= 0) {\r\n\t\t\t\t\tvar q = Math.sqrt(d);\r\n\t\t\t\t\tif (c1 < 0)\r\n\t\t\t\t\t\tq = -q;\r\n\t\t\t\t\tq = -(c1 + q) / 2;\r\n\t\t\t\t\tvar r0 = q / c2, r1 = c / q;\r\n\t\t\t\t\tvar r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n\t\t\t\t\tif (r * r <= dd) {\r\n\t\t\t\t\t\ty = Math.sqrt(dd - r * r) * bendDir;\r\n\t\t\t\t\t\ta1 = ta - Math.atan2(y, r);\r\n\t\t\t\t\t\ta2 = Math.atan2(y / psy, (r - l1) / psx);\r\n\t\t\t\t\t\tbreak outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\r\n\t\t\t\tvar maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\r\n\t\t\t\tc = -a * l1 / (aa - bb);\r\n\t\t\t\tif (c >= -1 && c <= 1) {\r\n\t\t\t\t\tc = Math.acos(c);\r\n\t\t\t\t\tx = a * Math.cos(c) + l1;\r\n\t\t\t\t\ty = b * Math.sin(c);\r\n\t\t\t\t\td = x * x + y * y;\r\n\t\t\t\t\tif (d < minDist) {\r\n\t\t\t\t\t\tminAngle = c;\r\n\t\t\t\t\t\tminDist = d;\r\n\t\t\t\t\t\tminX = x;\r\n\t\t\t\t\t\tminY = y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (d > maxDist) {\r\n\t\t\t\t\t\tmaxAngle = c;\r\n\t\t\t\t\t\tmaxDist = d;\r\n\t\t\t\t\t\tmaxX = x;\r\n\t\t\t\t\t\tmaxY = y;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (dd <= (minDist + maxDist) / 2) {\r\n\t\t\t\t\ta1 = ta - Math.atan2(minY * bendDir, minX);\r\n\t\t\t\t\ta2 = minAngle * bendDir;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ta1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n\t\t\t\t\ta2 = maxAngle * bendDir;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar os = Math.atan2(cy, cx) * s2;\r\n\t\t\tvar rotation = parent.arotation;\r\n\t\t\ta1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation;\r\n\t\t\tif (a1 > 180)\r\n\t\t\t\ta1 -= 360;\r\n\t\t\telse if (a1 < -180)\r\n\t\t\t\ta1 += 360;\r\n\t\t\tparent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0);\r\n\t\t\trotation = child.arotation;\r\n\t\t\ta2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\r\n\t\t\tif (a2 > 180)\r\n\t\t\t\ta2 -= 360;\r\n\t\t\telse if (a2 < -180)\r\n\t\t\t\ta2 += 360;\r\n\t\t\tchild.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n\t\t};\r\n\t\treturn IkConstraint;\r\n\t}());\r\n\tspine.IkConstraint = IkConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar IkConstraintData = (function () {\r\n\t\tfunction IkConstraintData(name) {\r\n\t\t\tthis.order = 0;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.bendDirection = 1;\r\n\t\t\tthis.compress = false;\r\n\t\t\tthis.stretch = false;\r\n\t\t\tthis.uniform = false;\r\n\t\t\tthis.mix = 1;\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn IkConstraintData;\r\n\t}());\r\n\tspine.IkConstraintData = IkConstraintData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PathConstraint = (function () {\r\n\t\tfunction PathConstraint(data, skeleton) {\r\n\t\t\tthis.position = 0;\r\n\t\t\tthis.spacing = 0;\r\n\t\t\tthis.rotateMix = 0;\r\n\t\t\tthis.translateMix = 0;\r\n\t\t\tthis.spaces = new Array();\r\n\t\t\tthis.positions = new Array();\r\n\t\t\tthis.world = new Array();\r\n\t\t\tthis.curves = new Array();\r\n\t\t\tthis.lengths = new Array();\r\n\t\t\tthis.segments = new Array();\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0, n = data.bones.length; i < n; i++)\r\n\t\t\t\tthis.bones.push(skeleton.findBone(data.bones[i].name));\r\n\t\t\tthis.target = skeleton.findSlot(data.target.name);\r\n\t\t\tthis.position = data.position;\r\n\t\t\tthis.spacing = data.spacing;\r\n\t\t\tthis.rotateMix = data.rotateMix;\r\n\t\t\tthis.translateMix = data.translateMix;\r\n\t\t}\r\n\t\tPathConstraint.prototype.apply = function () {\r\n\t\t\tthis.update();\r\n\t\t};\r\n\t\tPathConstraint.prototype.update = function () {\r\n\t\t\tvar attachment = this.target.getAttachment();\r\n\t\t\tif (!(attachment instanceof spine.PathAttachment))\r\n\t\t\t\treturn;\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix;\r\n\t\t\tvar translate = translateMix > 0, rotate = rotateMix > 0;\r\n\t\t\tif (!translate && !rotate)\r\n\t\t\t\treturn;\r\n\t\t\tvar data = this.data;\r\n\t\t\tvar percentSpacing = data.spacingMode == spine.SpacingMode.Percent;\r\n\t\t\tvar rotateMode = data.rotateMode;\r\n\t\t\tvar tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale;\r\n\t\t\tvar boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tvar spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null;\r\n\t\t\tvar spacing = this.spacing;\r\n\t\t\tif (scale || !percentSpacing) {\r\n\t\t\t\tif (scale)\r\n\t\t\t\t\tlengths = spine.Utils.setArraySize(this.lengths, boneCount);\r\n\t\t\t\tvar lengthSpacing = data.spacingMode == spine.SpacingMode.Length;\r\n\t\t\t\tfor (var i = 0, n = spacesCount - 1; i < n;) {\r\n\t\t\t\t\tvar bone = bones[i];\r\n\t\t\t\t\tvar setupLength = bone.data.length;\r\n\t\t\t\t\tif (setupLength < PathConstraint.epsilon) {\r\n\t\t\t\t\t\tif (scale)\r\n\t\t\t\t\t\t\tlengths[i] = 0;\r\n\t\t\t\t\t\tspaces[++i] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (percentSpacing) {\r\n\t\t\t\t\t\tif (scale) {\r\n\t\t\t\t\t\t\tvar x = setupLength * bone.a, y = setupLength * bone.c;\r\n\t\t\t\t\t\t\tvar length_1 = Math.sqrt(x * x + y * y);\r\n\t\t\t\t\t\t\tlengths[i] = length_1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tspaces[++i] = spacing;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar x = setupLength * bone.a, y = setupLength * bone.c;\r\n\t\t\t\t\t\tvar length_2 = Math.sqrt(x * x + y * y);\r\n\t\t\t\t\t\tif (scale)\r\n\t\t\t\t\t\t\tlengths[i] = length_2;\r\n\t\t\t\t\t\tspaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfor (var i = 1; i < spacesCount; i++)\r\n\t\t\t\t\tspaces[i] = spacing;\r\n\t\t\t}\r\n\t\t\tvar positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing);\r\n\t\t\tvar boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n\t\t\tvar tip = false;\r\n\t\t\tif (offsetRotation == 0)\r\n\t\t\t\ttip = rotateMode == spine.RotateMode.Chain;\r\n\t\t\telse {\r\n\t\t\t\ttip = false;\r\n\t\t\t\tvar p = this.target.bone;\r\n\t\t\t\toffsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tbone.worldX += (boneX - bone.worldX) * translateMix;\r\n\t\t\t\tbone.worldY += (boneY - bone.worldY) * translateMix;\r\n\t\t\t\tvar x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n\t\t\t\tif (scale) {\r\n\t\t\t\t\tvar length_3 = lengths[i];\r\n\t\t\t\t\tif (length_3 != 0) {\r\n\t\t\t\t\t\tvar s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1;\r\n\t\t\t\t\t\tbone.a *= s;\r\n\t\t\t\t\t\tbone.c *= s;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tboneX = x;\r\n\t\t\t\tboneY = y;\r\n\t\t\t\tif (rotate) {\r\n\t\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;\r\n\t\t\t\t\tif (tangents)\r\n\t\t\t\t\t\tr = positions[p - 1];\r\n\t\t\t\t\telse if (spaces[i + 1] == 0)\r\n\t\t\t\t\t\tr = positions[p + 2];\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tr = Math.atan2(dy, dx);\r\n\t\t\t\t\tr -= Math.atan2(c, a);\r\n\t\t\t\t\tif (tip) {\r\n\t\t\t\t\t\tcos = Math.cos(r);\r\n\t\t\t\t\t\tsin = Math.sin(r);\r\n\t\t\t\t\t\tvar length_4 = bone.data.length;\r\n\t\t\t\t\t\tboneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix;\r\n\t\t\t\t\t\tboneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tr += offsetRotation;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr *= rotateMix;\r\n\t\t\t\t\tcos = Math.cos(r);\r\n\t\t\t\t\tsin = Math.sin(r);\r\n\t\t\t\t\tbone.a = cos * a - sin * c;\r\n\t\t\t\t\tbone.b = cos * b - sin * d;\r\n\t\t\t\t\tbone.c = sin * a + cos * c;\r\n\t\t\t\t\tbone.d = sin * b + cos * d;\r\n\t\t\t\t}\r\n\t\t\t\tbone.appliedValid = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tPathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar position = this.position;\r\n\t\t\tvar spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;\r\n\t\t\tvar closed = path.closed;\r\n\t\t\tvar verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n\t\t\tif (!path.constantSpeed) {\r\n\t\t\t\tvar lengths = path.lengths;\r\n\t\t\t\tcurveCount -= closed ? 1 : 2;\r\n\t\t\t\tvar pathLength_1 = lengths[curveCount];\r\n\t\t\t\tif (percentPosition)\r\n\t\t\t\t\tposition *= pathLength_1;\r\n\t\t\t\tif (percentSpacing) {\r\n\t\t\t\t\tfor (var i = 1; i < spacesCount; i++)\r\n\t\t\t\t\t\tspaces[i] *= pathLength_1;\r\n\t\t\t\t}\r\n\t\t\t\tworld = spine.Utils.setArraySize(this.world, 8);\r\n\t\t\t\tfor (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n\t\t\t\t\tvar space = spaces[i];\r\n\t\t\t\t\tposition += space;\r\n\t\t\t\t\tvar p = position;\r\n\t\t\t\t\tif (closed) {\r\n\t\t\t\t\t\tp %= pathLength_1;\r\n\t\t\t\t\t\tif (p < 0)\r\n\t\t\t\t\t\t\tp += pathLength_1;\r\n\t\t\t\t\t\tcurve = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (p < 0) {\r\n\t\t\t\t\t\tif (prevCurve != PathConstraint.BEFORE) {\r\n\t\t\t\t\t\t\tprevCurve = PathConstraint.BEFORE;\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, 2, 4, world, 0, 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (p > pathLength_1) {\r\n\t\t\t\t\t\tif (prevCurve != PathConstraint.AFTER) {\r\n\t\t\t\t\t\t\tprevCurve = PathConstraint.AFTER;\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.addAfterPosition(p - pathLength_1, world, 0, out, o);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfor (;; curve++) {\r\n\t\t\t\t\t\tvar length_5 = lengths[curve];\r\n\t\t\t\t\t\tif (p > length_5)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tif (curve == 0)\r\n\t\t\t\t\t\t\tp /= length_5;\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tvar prev = lengths[curve - 1];\r\n\t\t\t\t\t\t\tp = (p - prev) / (length_5 - prev);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (curve != prevCurve) {\r\n\t\t\t\t\t\tprevCurve = curve;\r\n\t\t\t\t\t\tif (closed && curve == curveCount) {\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, 0, 4, world, 4, 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tpath.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\r\n\t\t\t\t}\r\n\t\t\t\treturn out;\r\n\t\t\t}\r\n\t\t\tif (closed) {\r\n\t\t\t\tverticesLength += 2;\r\n\t\t\t\tworld = spine.Utils.setArraySize(this.world, verticesLength);\r\n\t\t\t\tpath.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\r\n\t\t\t\tpath.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\r\n\t\t\t\tworld[verticesLength - 2] = world[0];\r\n\t\t\t\tworld[verticesLength - 1] = world[1];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcurveCount--;\r\n\t\t\t\tverticesLength -= 4;\r\n\t\t\t\tworld = spine.Utils.setArraySize(this.world, verticesLength);\r\n\t\t\t\tpath.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\r\n\t\t\t}\r\n\t\t\tvar curves = spine.Utils.setArraySize(this.curves, curveCount);\r\n\t\t\tvar pathLength = 0;\r\n\t\t\tvar x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n\t\t\tvar tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n\t\t\tfor (var i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n\t\t\t\tcx1 = world[w];\r\n\t\t\t\tcy1 = world[w + 1];\r\n\t\t\t\tcx2 = world[w + 2];\r\n\t\t\t\tcy2 = world[w + 3];\r\n\t\t\t\tx2 = world[w + 4];\r\n\t\t\t\ty2 = world[w + 5];\r\n\t\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n\t\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n\t\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n\t\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n\t\t\t\tddfx = tmpx * 2 + dddfx;\r\n\t\t\t\tddfy = tmpy * 2 + dddfy;\r\n\t\t\t\tdfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n\t\t\t\tdfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tdfx += ddfx;\r\n\t\t\t\tdfy += ddfy;\r\n\t\t\t\tddfx += dddfx;\r\n\t\t\t\tddfy += dddfy;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tdfx += ddfx;\r\n\t\t\t\tdfy += ddfy;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tdfx += ddfx + dddfx;\r\n\t\t\t\tdfy += ddfy + dddfy;\r\n\t\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\tcurves[i] = pathLength;\r\n\t\t\t\tx1 = x2;\r\n\t\t\t\ty1 = y2;\r\n\t\t\t}\r\n\t\t\tif (percentPosition)\r\n\t\t\t\tposition *= pathLength;\r\n\t\t\telse\r\n\t\t\t\tposition *= pathLength / path.lengths[curveCount - 1];\r\n\t\t\tif (percentSpacing) {\r\n\t\t\t\tfor (var i = 1; i < spacesCount; i++)\r\n\t\t\t\t\tspaces[i] *= pathLength;\r\n\t\t\t}\r\n\t\t\tvar segments = this.segments;\r\n\t\t\tvar curveLength = 0;\r\n\t\t\tfor (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n\t\t\t\tvar space = spaces[i];\r\n\t\t\t\tposition += space;\r\n\t\t\t\tvar p = position;\r\n\t\t\t\tif (closed) {\r\n\t\t\t\t\tp %= pathLength;\r\n\t\t\t\t\tif (p < 0)\r\n\t\t\t\t\t\tp += pathLength;\r\n\t\t\t\t\tcurve = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse if (p < 0) {\r\n\t\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\telse if (p > pathLength) {\r\n\t\t\t\t\tthis.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tfor (;; curve++) {\r\n\t\t\t\t\tvar length_6 = curves[curve];\r\n\t\t\t\t\tif (p > length_6)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (curve == 0)\r\n\t\t\t\t\t\tp /= length_6;\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar prev = curves[curve - 1];\r\n\t\t\t\t\t\tp = (p - prev) / (length_6 - prev);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (curve != prevCurve) {\r\n\t\t\t\t\tprevCurve = curve;\r\n\t\t\t\t\tvar ii = curve * 6;\r\n\t\t\t\t\tx1 = world[ii];\r\n\t\t\t\t\ty1 = world[ii + 1];\r\n\t\t\t\t\tcx1 = world[ii + 2];\r\n\t\t\t\t\tcy1 = world[ii + 3];\r\n\t\t\t\t\tcx2 = world[ii + 4];\r\n\t\t\t\t\tcy2 = world[ii + 5];\r\n\t\t\t\t\tx2 = world[ii + 6];\r\n\t\t\t\t\ty2 = world[ii + 7];\r\n\t\t\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n\t\t\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n\t\t\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n\t\t\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n\t\t\t\t\tddfx = tmpx * 2 + dddfx;\r\n\t\t\t\t\tddfy = tmpy * 2 + dddfy;\r\n\t\t\t\t\tdfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n\t\t\t\t\tdfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n\t\t\t\t\tcurveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\tsegments[0] = curveLength;\r\n\t\t\t\t\tfor (ii = 1; ii < 8; ii++) {\r\n\t\t\t\t\t\tdfx += ddfx;\r\n\t\t\t\t\t\tdfy += ddfy;\r\n\t\t\t\t\t\tddfx += dddfx;\r\n\t\t\t\t\t\tddfy += dddfy;\r\n\t\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\t\tsegments[ii] = curveLength;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdfx += ddfx;\r\n\t\t\t\t\tdfy += ddfy;\r\n\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\tsegments[8] = curveLength;\r\n\t\t\t\t\tdfx += ddfx + dddfx;\r\n\t\t\t\t\tdfy += ddfy + dddfy;\r\n\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n\t\t\t\t\tsegments[9] = curveLength;\r\n\t\t\t\t\tsegment = 0;\r\n\t\t\t\t}\r\n\t\t\t\tp *= curveLength;\r\n\t\t\t\tfor (;; segment++) {\r\n\t\t\t\t\tvar length_7 = segments[segment];\r\n\t\t\t\t\tif (p > length_7)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (segment == 0)\r\n\t\t\t\t\t\tp /= length_7;\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar prev = segments[segment - 1];\r\n\t\t\t\t\t\tp = segment + (p - prev) / (length_7 - prev);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tthis.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n\t\t\t}\r\n\t\t\treturn out;\r\n\t\t};\r\n\t\tPathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\r\n\t\t\tvar x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n\t\t\tout[o] = x1 + p * Math.cos(r);\r\n\t\t\tout[o + 1] = y1 + p * Math.sin(r);\r\n\t\t\tout[o + 2] = r;\r\n\t\t};\r\n\t\tPathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\r\n\t\t\tvar x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n\t\t\tout[o] = x1 + p * Math.cos(r);\r\n\t\t\tout[o + 1] = y1 + p * Math.sin(r);\r\n\t\t\tout[o + 2] = r;\r\n\t\t};\r\n\t\tPathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\r\n\t\t\tif (p == 0 || isNaN(p)) {\r\n\t\t\t\tout[o] = x1;\r\n\t\t\t\tout[o + 1] = y1;\r\n\t\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n\t\t\tvar ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n\t\t\tvar x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n\t\t\tout[o] = x;\r\n\t\t\tout[o + 1] = y;\r\n\t\t\tif (tangents) {\r\n\t\t\t\tif (p < 0.001)\r\n\t\t\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n\t\t\t\telse\r\n\t\t\t\t\tout[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n\t\t\t}\r\n\t\t};\r\n\t\tPathConstraint.prototype.getOrder = function () {\r\n\t\t\treturn this.data.order;\r\n\t\t};\r\n\t\tPathConstraint.NONE = -1;\r\n\t\tPathConstraint.BEFORE = -2;\r\n\t\tPathConstraint.AFTER = -3;\r\n\t\tPathConstraint.epsilon = 0.00001;\r\n\t\treturn PathConstraint;\r\n\t}());\r\n\tspine.PathConstraint = PathConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PathConstraintData = (function () {\r\n\t\tfunction PathConstraintData(name) {\r\n\t\t\tthis.order = 0;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn PathConstraintData;\r\n\t}());\r\n\tspine.PathConstraintData = PathConstraintData;\r\n\tvar PositionMode;\r\n\t(function (PositionMode) {\r\n\t\tPositionMode[PositionMode[\"Fixed\"] = 0] = \"Fixed\";\r\n\t\tPositionMode[PositionMode[\"Percent\"] = 1] = \"Percent\";\r\n\t})(PositionMode = spine.PositionMode || (spine.PositionMode = {}));\r\n\tvar SpacingMode;\r\n\t(function (SpacingMode) {\r\n\t\tSpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\r\n\t\tSpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\r\n\t\tSpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\r\n\t})(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {}));\r\n\tvar RotateMode;\r\n\t(function (RotateMode) {\r\n\t\tRotateMode[RotateMode[\"Tangent\"] = 0] = \"Tangent\";\r\n\t\tRotateMode[RotateMode[\"Chain\"] = 1] = \"Chain\";\r\n\t\tRotateMode[RotateMode[\"ChainScale\"] = 2] = \"ChainScale\";\r\n\t})(RotateMode = spine.RotateMode || (spine.RotateMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Assets = (function () {\r\n\t\tfunction Assets(clientId) {\r\n\t\t\tthis.toLoad = new Array();\r\n\t\t\tthis.assets = {};\r\n\t\t\tthis.clientId = clientId;\r\n\t\t}\r\n\t\tAssets.prototype.loaded = function () {\r\n\t\t\tvar i = 0;\r\n\t\t\tfor (var v in this.assets)\r\n\t\t\t\ti++;\r\n\t\t\treturn i;\r\n\t\t};\r\n\t\treturn Assets;\r\n\t}());\r\n\tvar SharedAssetManager = (function () {\r\n\t\tfunction SharedAssetManager(pathPrefix) {\r\n\t\t\tif (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n\t\t\tthis.clientAssets = {};\r\n\t\t\tthis.queuedAssets = {};\r\n\t\t\tthis.rawAssets = {};\r\n\t\t\tthis.errors = {};\r\n\t\t\tthis.pathPrefix = pathPrefix;\r\n\t\t}\r\n\t\tSharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) {\r\n\t\t\tvar clientAssets = this.clientAssets[clientId];\r\n\t\t\tif (clientAssets === null || clientAssets === undefined) {\r\n\t\t\t\tclientAssets = new Assets(clientId);\r\n\t\t\t\tthis.clientAssets[clientId] = clientAssets;\r\n\t\t\t}\r\n\t\t\tif (textureLoader !== null)\r\n\t\t\t\tclientAssets.textureLoader = textureLoader;\r\n\t\t\tclientAssets.toLoad.push(path);\r\n\t\t\tif (this.queuedAssets[path] === path) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.queuedAssets[path] = path;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.loadText = function (clientId, path) {\r\n\t\t\tvar _this = this;\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tif (!this.queueAsset(clientId, null, path))\r\n\t\t\t\treturn;\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.onreadystatechange = function () {\r\n\t\t\t\tif (request.readyState == XMLHttpRequest.DONE) {\r\n\t\t\t\t\tif (request.status >= 200 && request.status < 300) {\r\n\t\t\t\t\t\t_this.rawAssets[path] = request.responseText;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t_this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.open(\"GET\", path, true);\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.loadJson = function (clientId, path) {\r\n\t\t\tvar _this = this;\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tif (!this.queueAsset(clientId, null, path))\r\n\t\t\t\treturn;\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.onreadystatechange = function () {\r\n\t\t\t\tif (request.readyState == XMLHttpRequest.DONE) {\r\n\t\t\t\t\tif (request.status >= 200 && request.status < 300) {\r\n\t\t\t\t\t\t_this.rawAssets[path] = JSON.parse(request.responseText);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t_this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\trequest.open(\"GET\", path, true);\r\n\t\t\trequest.send();\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) {\r\n\t\t\tvar _this = this;\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tif (!this.queueAsset(clientId, textureLoader, path))\r\n\t\t\t\treturn;\r\n\t\t\tvar img = new Image();\r\n\t\t\timg.src = path;\r\n\t\t\timg.crossOrigin = \"anonymous\";\r\n\t\t\timg.onload = function (ev) {\r\n\t\t\t\t_this.rawAssets[path] = img;\r\n\t\t\t};\r\n\t\t\timg.onerror = function (ev) {\r\n\t\t\t\t_this.errors[path] = \"Couldn't load image \" + path;\r\n\t\t\t};\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.get = function (clientId, path) {\r\n\t\t\tpath = this.pathPrefix + path;\r\n\t\t\tvar clientAssets = this.clientAssets[clientId];\r\n\t\t\tif (clientAssets === null || clientAssets === undefined)\r\n\t\t\t\treturn true;\r\n\t\t\treturn clientAssets.assets[path];\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.updateClientAssets = function (clientAssets) {\r\n\t\t\tfor (var i = 0; i < clientAssets.toLoad.length; i++) {\r\n\t\t\t\tvar path = clientAssets.toLoad[i];\r\n\t\t\t\tvar asset = clientAssets.assets[path];\r\n\t\t\t\tif (asset === null || asset === undefined) {\r\n\t\t\t\t\tvar rawAsset = this.rawAssets[path];\r\n\t\t\t\t\tif (rawAsset === null || rawAsset === undefined)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (rawAsset instanceof HTMLImageElement) {\r\n\t\t\t\t\t\tclientAssets.assets[path] = clientAssets.textureLoader(rawAsset);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tclientAssets.assets[path] = rawAsset;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.isLoadingComplete = function (clientId) {\r\n\t\t\tvar clientAssets = this.clientAssets[clientId];\r\n\t\t\tif (clientAssets === null || clientAssets === undefined)\r\n\t\t\t\treturn true;\r\n\t\t\tthis.updateClientAssets(clientAssets);\r\n\t\t\treturn clientAssets.toLoad.length == clientAssets.loaded();\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.dispose = function () {\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.hasErrors = function () {\r\n\t\t\treturn Object.keys(this.errors).length > 0;\r\n\t\t};\r\n\t\tSharedAssetManager.prototype.getErrors = function () {\r\n\t\t\treturn this.errors;\r\n\t\t};\r\n\t\treturn SharedAssetManager;\r\n\t}());\r\n\tspine.SharedAssetManager = SharedAssetManager;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Skeleton = (function () {\r\n\t\tfunction Skeleton(data) {\r\n\t\t\tthis._updateCache = new Array();\r\n\t\t\tthis.updateCacheReset = new Array();\r\n\t\t\tthis.time = 0;\r\n\t\t\tthis.scaleX = 1;\r\n\t\t\tthis.scaleY = 1;\r\n\t\t\tthis.x = 0;\r\n\t\t\tthis.y = 0;\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0; i < data.bones.length; i++) {\r\n\t\t\t\tvar boneData = data.bones[i];\r\n\t\t\t\tvar bone = void 0;\r\n\t\t\t\tif (boneData.parent == null)\r\n\t\t\t\t\tbone = new spine.Bone(boneData, this, null);\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar parent_1 = this.bones[boneData.parent.index];\r\n\t\t\t\t\tbone = new spine.Bone(boneData, this, parent_1);\r\n\t\t\t\t\tparent_1.children.push(bone);\r\n\t\t\t\t}\r\n\t\t\t\tthis.bones.push(bone);\r\n\t\t\t}\r\n\t\t\tthis.slots = new Array();\r\n\t\t\tthis.drawOrder = new Array();\r\n\t\t\tfor (var i = 0; i < data.slots.length; i++) {\r\n\t\t\t\tvar slotData = data.slots[i];\r\n\t\t\t\tvar bone = this.bones[slotData.boneData.index];\r\n\t\t\t\tvar slot = new spine.Slot(slotData, bone);\r\n\t\t\t\tthis.slots.push(slot);\r\n\t\t\t\tthis.drawOrder.push(slot);\r\n\t\t\t}\r\n\t\t\tthis.ikConstraints = new Array();\r\n\t\t\tfor (var i = 0; i < data.ikConstraints.length; i++) {\r\n\t\t\t\tvar ikConstraintData = data.ikConstraints[i];\r\n\t\t\t\tthis.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this));\r\n\t\t\t}\r\n\t\t\tthis.transformConstraints = new Array();\r\n\t\t\tfor (var i = 0; i < data.transformConstraints.length; i++) {\r\n\t\t\t\tvar transformConstraintData = data.transformConstraints[i];\r\n\t\t\t\tthis.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this));\r\n\t\t\t}\r\n\t\t\tthis.pathConstraints = new Array();\r\n\t\t\tfor (var i = 0; i < data.pathConstraints.length; i++) {\r\n\t\t\t\tvar pathConstraintData = data.pathConstraints[i];\r\n\t\t\t\tthis.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this));\r\n\t\t\t}\r\n\t\t\tthis.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\tthis.updateCache();\r\n\t\t}\r\n\t\tSkeleton.prototype.updateCache = function () {\r\n\t\t\tvar updateCache = this._updateCache;\r\n\t\t\tupdateCache.length = 0;\r\n\t\t\tthis.updateCacheReset.length = 0;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tbones[i].sorted = false;\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tvar ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\r\n\t\t\tvar constraintCount = ikCount + transformCount + pathCount;\r\n\t\t\touter: for (var i = 0; i < constraintCount; i++) {\r\n\t\t\t\tfor (var ii = 0; ii < ikCount; ii++) {\r\n\t\t\t\t\tvar constraint = ikConstraints[ii];\r\n\t\t\t\t\tif (constraint.data.order == i) {\r\n\t\t\t\t\t\tthis.sortIkConstraint(constraint);\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor (var ii = 0; ii < transformCount; ii++) {\r\n\t\t\t\t\tvar constraint = transformConstraints[ii];\r\n\t\t\t\t\tif (constraint.data.order == i) {\r\n\t\t\t\t\t\tthis.sortTransformConstraint(constraint);\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor (var ii = 0; ii < pathCount; ii++) {\r\n\t\t\t\t\tvar constraint = pathConstraints[ii];\r\n\t\t\t\t\tif (constraint.data.order == i) {\r\n\t\t\t\t\t\tthis.sortPathConstraint(constraint);\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tthis.sortBone(bones[i]);\r\n\t\t};\r\n\t\tSkeleton.prototype.sortIkConstraint = function (constraint) {\r\n\t\t\tvar target = constraint.target;\r\n\t\t\tthis.sortBone(target);\r\n\t\t\tvar constrained = constraint.bones;\r\n\t\t\tvar parent = constrained[0];\r\n\t\t\tthis.sortBone(parent);\r\n\t\t\tif (constrained.length > 1) {\r\n\t\t\t\tvar child = constrained[constrained.length - 1];\r\n\t\t\t\tif (!(this._updateCache.indexOf(child) > -1))\r\n\t\t\t\t\tthis.updateCacheReset.push(child);\r\n\t\t\t}\r\n\t\t\tthis._updateCache.push(constraint);\r\n\t\t\tthis.sortReset(parent.children);\r\n\t\t\tconstrained[constrained.length - 1].sorted = true;\r\n\t\t};\r\n\t\tSkeleton.prototype.sortPathConstraint = function (constraint) {\r\n\t\t\tvar slot = constraint.target;\r\n\t\t\tvar slotIndex = slot.data.index;\r\n\t\t\tvar slotBone = slot.bone;\r\n\t\t\tif (this.skin != null)\r\n\t\t\t\tthis.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n\t\t\tif (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\r\n\t\t\t\tthis.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n\t\t\tfor (var i = 0, n = this.data.skins.length; i < n; i++)\r\n\t\t\t\tthis.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\r\n\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\tif (attachment instanceof spine.PathAttachment)\r\n\t\t\t\tthis.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n\t\t\tvar constrained = constraint.bones;\r\n\t\t\tvar boneCount = constrained.length;\r\n\t\t\tfor (var i = 0; i < boneCount; i++)\r\n\t\t\t\tthis.sortBone(constrained[i]);\r\n\t\t\tthis._updateCache.push(constraint);\r\n\t\t\tfor (var i = 0; i < boneCount; i++)\r\n\t\t\t\tthis.sortReset(constrained[i].children);\r\n\t\t\tfor (var i = 0; i < boneCount; i++)\r\n\t\t\t\tconstrained[i].sorted = true;\r\n\t\t};\r\n\t\tSkeleton.prototype.sortTransformConstraint = function (constraint) {\r\n\t\t\tthis.sortBone(constraint.target);\r\n\t\t\tvar constrained = constraint.bones;\r\n\t\t\tvar boneCount = constrained.length;\r\n\t\t\tif (constraint.data.local) {\r\n\t\t\t\tfor (var i = 0; i < boneCount; i++) {\r\n\t\t\t\t\tvar child = constrained[i];\r\n\t\t\t\t\tthis.sortBone(child.parent);\r\n\t\t\t\t\tif (!(this._updateCache.indexOf(child) > -1))\r\n\t\t\t\t\t\tthis.updateCacheReset.push(child);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfor (var i = 0; i < boneCount; i++) {\r\n\t\t\t\t\tthis.sortBone(constrained[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis._updateCache.push(constraint);\r\n\t\t\tfor (var ii = 0; ii < boneCount; ii++)\r\n\t\t\t\tthis.sortReset(constrained[ii].children);\r\n\t\t\tfor (var ii = 0; ii < boneCount; ii++)\r\n\t\t\t\tconstrained[ii].sorted = true;\r\n\t\t};\r\n\t\tSkeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\r\n\t\t\tvar attachments = skin.attachments[slotIndex];\r\n\t\t\tif (!attachments)\r\n\t\t\t\treturn;\r\n\t\t\tfor (var key in attachments) {\r\n\t\t\t\tthis.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\r\n\t\t\tif (!(attachment instanceof spine.PathAttachment))\r\n\t\t\t\treturn;\r\n\t\t\tvar pathBones = attachment.bones;\r\n\t\t\tif (pathBones == null)\r\n\t\t\t\tthis.sortBone(slotBone);\r\n\t\t\telse {\r\n\t\t\t\tvar bones = this.bones;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\twhile (i < pathBones.length) {\r\n\t\t\t\t\tvar boneCount = pathBones[i++];\r\n\t\t\t\t\tfor (var n = i + boneCount; i < n; i++) {\r\n\t\t\t\t\t\tvar boneIndex = pathBones[i];\r\n\t\t\t\t\t\tthis.sortBone(bones[boneIndex]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.sortBone = function (bone) {\r\n\t\t\tif (bone.sorted)\r\n\t\t\t\treturn;\r\n\t\t\tvar parent = bone.parent;\r\n\t\t\tif (parent != null)\r\n\t\t\t\tthis.sortBone(parent);\r\n\t\t\tbone.sorted = true;\r\n\t\t\tthis._updateCache.push(bone);\r\n\t\t};\r\n\t\tSkeleton.prototype.sortReset = function (bones) {\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (bone.sorted)\r\n\t\t\t\t\tthis.sortReset(bone.children);\r\n\t\t\t\tbone.sorted = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.updateWorldTransform = function () {\r\n\t\t\tvar updateCacheReset = this.updateCacheReset;\r\n\t\t\tfor (var i = 0, n = updateCacheReset.length; i < n; i++) {\r\n\t\t\t\tvar bone = updateCacheReset[i];\r\n\t\t\t\tbone.ax = bone.x;\r\n\t\t\t\tbone.ay = bone.y;\r\n\t\t\t\tbone.arotation = bone.rotation;\r\n\t\t\t\tbone.ascaleX = bone.scaleX;\r\n\t\t\t\tbone.ascaleY = bone.scaleY;\r\n\t\t\t\tbone.ashearX = bone.shearX;\r\n\t\t\t\tbone.ashearY = bone.shearY;\r\n\t\t\t\tbone.appliedValid = true;\r\n\t\t\t}\r\n\t\t\tvar updateCache = this._updateCache;\r\n\t\t\tfor (var i = 0, n = updateCache.length; i < n; i++)\r\n\t\t\t\tupdateCache[i].update();\r\n\t\t};\r\n\t\tSkeleton.prototype.setToSetupPose = function () {\r\n\t\t\tthis.setBonesToSetupPose();\r\n\t\t\tthis.setSlotsToSetupPose();\r\n\t\t};\r\n\t\tSkeleton.prototype.setBonesToSetupPose = function () {\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tbones[i].setToSetupPose();\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tfor (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = ikConstraints[i];\r\n\t\t\t\tconstraint.mix = constraint.data.mix;\r\n\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\r\n\t\t\t\tconstraint.compress = constraint.data.compress;\r\n\t\t\t\tconstraint.stretch = constraint.data.stretch;\r\n\t\t\t}\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tfor (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = transformConstraints[i];\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tconstraint.rotateMix = data.rotateMix;\r\n\t\t\t\tconstraint.translateMix = data.translateMix;\r\n\t\t\t\tconstraint.scaleMix = data.scaleMix;\r\n\t\t\t\tconstraint.shearMix = data.shearMix;\r\n\t\t\t}\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = pathConstraints[i];\r\n\t\t\t\tvar data = constraint.data;\r\n\t\t\t\tconstraint.position = data.position;\r\n\t\t\t\tconstraint.spacing = data.spacing;\r\n\t\t\t\tconstraint.rotateMix = data.rotateMix;\r\n\t\t\t\tconstraint.translateMix = data.translateMix;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeleton.prototype.setSlotsToSetupPose = function () {\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tspine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++)\r\n\t\t\t\tslots[i].setToSetupPose();\r\n\t\t};\r\n\t\tSkeleton.prototype.getRootBone = function () {\r\n\t\t\tif (this.bones.length == 0)\r\n\t\t\t\treturn null;\r\n\t\t\treturn this.bones[0];\r\n\t\t};\r\n\t\tSkeleton.prototype.findBone = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (bone.data.name == boneName)\r\n\t\t\t\t\treturn bone;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findBoneIndex = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tif (bones[i].data.name == boneName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeleton.prototype.findSlot = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tif (slot.data.name == slotName)\r\n\t\t\t\t\treturn slot;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findSlotIndex = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++)\r\n\t\t\t\tif (slots[i].data.name == slotName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeleton.prototype.setSkinByName = function (skinName) {\r\n\t\t\tvar skin = this.data.findSkin(skinName);\r\n\t\t\tif (skin == null)\r\n\t\t\t\tthrow new Error(\"Skin not found: \" + skinName);\r\n\t\t\tthis.setSkin(skin);\r\n\t\t};\r\n\t\tSkeleton.prototype.setSkin = function (newSkin) {\r\n\t\t\tif (newSkin != null) {\r\n\t\t\t\tif (this.skin != null)\r\n\t\t\t\t\tnewSkin.attachAll(this, this.skin);\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar slots = this.slots;\r\n\t\t\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\t\t\tvar slot = slots[i];\r\n\t\t\t\t\t\tvar name_1 = slot.data.attachmentName;\r\n\t\t\t\t\t\tif (name_1 != null) {\r\n\t\t\t\t\t\t\tvar attachment = newSkin.getAttachment(i, name_1);\r\n\t\t\t\t\t\t\tif (attachment != null)\r\n\t\t\t\t\t\t\t\tslot.setAttachment(attachment);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.skin = newSkin;\r\n\t\t};\r\n\t\tSkeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\r\n\t\t\treturn this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\r\n\t\t};\r\n\t\tSkeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\r\n\t\t\tif (attachmentName == null)\r\n\t\t\t\tthrow new Error(\"attachmentName cannot be null.\");\r\n\t\t\tif (this.skin != null) {\r\n\t\t\t\tvar attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n\t\t\t\tif (attachment != null)\r\n\t\t\t\t\treturn attachment;\r\n\t\t\t}\r\n\t\t\tif (this.data.defaultSkin != null)\r\n\t\t\t\treturn this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.setAttachment = function (slotName, attachmentName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tif (slot.data.name == slotName) {\r\n\t\t\t\t\tvar attachment = null;\r\n\t\t\t\t\tif (attachmentName != null) {\r\n\t\t\t\t\t\tattachment = this.getAttachment(i, attachmentName);\r\n\t\t\t\t\t\tif (attachment == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tslot.setAttachment(attachment);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthrow new Error(\"Slot not found: \" + slotName);\r\n\t\t};\r\n\t\tSkeleton.prototype.findIkConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tfor (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n\t\t\t\tvar ikConstraint = ikConstraints[i];\r\n\t\t\t\tif (ikConstraint.data.name == constraintName)\r\n\t\t\t\t\treturn ikConstraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findTransformConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tfor (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = transformConstraints[i];\r\n\t\t\t\tif (constraint.data.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.findPathConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = pathConstraints[i];\r\n\t\t\t\tif (constraint.data.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeleton.prototype.getBounds = function (offset, size, temp) {\r\n\t\t\tif (temp === void 0) { temp = new Array(2); }\r\n\t\t\tif (offset == null)\r\n\t\t\t\tthrow new Error(\"offset cannot be null.\");\r\n\t\t\tif (size == null)\r\n\t\t\t\tthrow new Error(\"size cannot be null.\");\r\n\t\t\tvar drawOrder = this.drawOrder;\r\n\t\t\tvar minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n\t\t\tfor (var i = 0, n = drawOrder.length; i < n; i++) {\r\n\t\t\t\tvar slot = drawOrder[i];\r\n\t\t\t\tvar verticesLength = 0;\r\n\t\t\t\tvar vertices = null;\r\n\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\tif (attachment instanceof spine.RegionAttachment) {\r\n\t\t\t\t\tverticesLength = 8;\r\n\t\t\t\t\tvertices = spine.Utils.setArraySize(temp, verticesLength, 0);\r\n\t\t\t\t\tattachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n\t\t\t\t}\r\n\t\t\t\telse if (attachment instanceof spine.MeshAttachment) {\r\n\t\t\t\t\tvar mesh = attachment;\r\n\t\t\t\t\tverticesLength = mesh.worldVerticesLength;\r\n\t\t\t\t\tvertices = spine.Utils.setArraySize(temp, verticesLength, 0);\r\n\t\t\t\t\tmesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\r\n\t\t\t\t}\r\n\t\t\t\tif (vertices != null) {\r\n\t\t\t\t\tfor (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\r\n\t\t\t\t\t\tvar x = vertices[ii], y = vertices[ii + 1];\r\n\t\t\t\t\t\tminX = Math.min(minX, x);\r\n\t\t\t\t\t\tminY = Math.min(minY, y);\r\n\t\t\t\t\t\tmaxX = Math.max(maxX, x);\r\n\t\t\t\t\t\tmaxY = Math.max(maxY, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\toffset.set(minX, minY);\r\n\t\t\tsize.set(maxX - minX, maxY - minY);\r\n\t\t};\r\n\t\tSkeleton.prototype.update = function (delta) {\r\n\t\t\tthis.time += delta;\r\n\t\t};\r\n\t\treturn Skeleton;\r\n\t}());\r\n\tspine.Skeleton = Skeleton;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonBounds = (function () {\r\n\t\tfunction SkeletonBounds() {\r\n\t\t\tthis.minX = 0;\r\n\t\t\tthis.minY = 0;\r\n\t\t\tthis.maxX = 0;\r\n\t\t\tthis.maxY = 0;\r\n\t\t\tthis.boundingBoxes = new Array();\r\n\t\t\tthis.polygons = new Array();\r\n\t\t\tthis.polygonPool = new spine.Pool(function () {\r\n\t\t\t\treturn spine.Utils.newFloatArray(16);\r\n\t\t\t});\r\n\t\t}\r\n\t\tSkeletonBounds.prototype.update = function (skeleton, updateAabb) {\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tvar boundingBoxes = this.boundingBoxes;\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tvar polygonPool = this.polygonPool;\r\n\t\t\tvar slots = skeleton.slots;\r\n\t\t\tvar slotCount = slots.length;\r\n\t\t\tboundingBoxes.length = 0;\r\n\t\t\tpolygonPool.freeAll(polygons);\r\n\t\t\tpolygons.length = 0;\r\n\t\t\tfor (var i = 0; i < slotCount; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\tif (attachment instanceof spine.BoundingBoxAttachment) {\r\n\t\t\t\t\tvar boundingBox = attachment;\r\n\t\t\t\t\tboundingBoxes.push(boundingBox);\r\n\t\t\t\t\tvar polygon = polygonPool.obtain();\r\n\t\t\t\t\tif (polygon.length != boundingBox.worldVerticesLength) {\r\n\t\t\t\t\t\tpolygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpolygons.push(polygon);\r\n\t\t\t\t\tboundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (updateAabb) {\r\n\t\t\t\tthis.aabbCompute();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.minX = Number.POSITIVE_INFINITY;\r\n\t\t\t\tthis.minY = Number.POSITIVE_INFINITY;\r\n\t\t\t\tthis.maxX = Number.NEGATIVE_INFINITY;\r\n\t\t\t\tthis.maxY = Number.NEGATIVE_INFINITY;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbCompute = function () {\r\n\t\t\tvar minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tfor (var i = 0, n = polygons.length; i < n; i++) {\r\n\t\t\t\tvar polygon = polygons[i];\r\n\t\t\t\tvar vertices = polygon;\r\n\t\t\t\tfor (var ii = 0, nn = polygon.length; ii < nn; ii += 2) {\r\n\t\t\t\t\tvar x = vertices[ii];\r\n\t\t\t\t\tvar y = vertices[ii + 1];\r\n\t\t\t\t\tminX = Math.min(minX, x);\r\n\t\t\t\t\tminY = Math.min(minY, y);\r\n\t\t\t\t\tmaxX = Math.max(maxX, x);\r\n\t\t\t\t\tmaxY = Math.max(maxY, y);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.minX = minX;\r\n\t\t\tthis.minY = minY;\r\n\t\t\tthis.maxX = maxX;\r\n\t\t\tthis.maxY = maxY;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbContainsPoint = function (x, y) {\r\n\t\t\treturn x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) {\r\n\t\t\tvar minX = this.minX;\r\n\t\t\tvar minY = this.minY;\r\n\t\t\tvar maxX = this.maxX;\r\n\t\t\tvar maxY = this.maxY;\r\n\t\t\tif ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\r\n\t\t\t\treturn false;\r\n\t\t\tvar m = (y2 - y1) / (x2 - x1);\r\n\t\t\tvar y = m * (minX - x1) + y1;\r\n\t\t\tif (y > minY && y < maxY)\r\n\t\t\t\treturn true;\r\n\t\t\ty = m * (maxX - x1) + y1;\r\n\t\t\tif (y > minY && y < maxY)\r\n\t\t\t\treturn true;\r\n\t\t\tvar x = (minY - y1) / m + x1;\r\n\t\t\tif (x > minX && x < maxX)\r\n\t\t\t\treturn true;\r\n\t\t\tx = (maxY - y1) / m + x1;\r\n\t\t\tif (x > minX && x < maxX)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) {\r\n\t\t\treturn this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.containsPoint = function (x, y) {\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tfor (var i = 0, n = polygons.length; i < n; i++)\r\n\t\t\t\tif (this.containsPointPolygon(polygons[i], x, y))\r\n\t\t\t\t\treturn this.boundingBoxes[i];\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) {\r\n\t\t\tvar vertices = polygon;\r\n\t\t\tvar nn = polygon.length;\r\n\t\t\tvar prevIndex = nn - 2;\r\n\t\t\tvar inside = false;\r\n\t\t\tfor (var ii = 0; ii < nn; ii += 2) {\r\n\t\t\t\tvar vertexY = vertices[ii + 1];\r\n\t\t\t\tvar prevY = vertices[prevIndex + 1];\r\n\t\t\t\tif ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\r\n\t\t\t\t\tvar vertexX = vertices[ii];\r\n\t\t\t\t\tif (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x)\r\n\t\t\t\t\t\tinside = !inside;\r\n\t\t\t\t}\r\n\t\t\t\tprevIndex = ii;\r\n\t\t\t}\r\n\t\t\treturn inside;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) {\r\n\t\t\tvar polygons = this.polygons;\r\n\t\t\tfor (var i = 0, n = polygons.length; i < n; i++)\r\n\t\t\t\tif (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2))\r\n\t\t\t\t\treturn this.boundingBoxes[i];\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) {\r\n\t\t\tvar vertices = polygon;\r\n\t\t\tvar nn = polygon.length;\r\n\t\t\tvar width12 = x1 - x2, height12 = y1 - y2;\r\n\t\t\tvar det1 = x1 * y2 - y1 * x2;\r\n\t\t\tvar x3 = vertices[nn - 2], y3 = vertices[nn - 1];\r\n\t\t\tfor (var ii = 0; ii < nn; ii += 2) {\r\n\t\t\t\tvar x4 = vertices[ii], y4 = vertices[ii + 1];\r\n\t\t\t\tvar det2 = x3 * y4 - y3 * x4;\r\n\t\t\t\tvar width34 = x3 - x4, height34 = y3 - y4;\r\n\t\t\t\tvar det3 = width12 * height34 - height12 * width34;\r\n\t\t\t\tvar x = (det1 * width34 - width12 * det2) / det3;\r\n\t\t\t\tif (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\r\n\t\t\t\t\tvar y = (det1 * height34 - height12 * det2) / det3;\r\n\t\t\t\t\tif (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1)))\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tx3 = x4;\r\n\t\t\t\ty3 = y4;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.getPolygon = function (boundingBox) {\r\n\t\t\tif (boundingBox == null)\r\n\t\t\t\tthrow new Error(\"boundingBox cannot be null.\");\r\n\t\t\tvar index = this.boundingBoxes.indexOf(boundingBox);\r\n\t\t\treturn index == -1 ? null : this.polygons[index];\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.getWidth = function () {\r\n\t\t\treturn this.maxX - this.minX;\r\n\t\t};\r\n\t\tSkeletonBounds.prototype.getHeight = function () {\r\n\t\t\treturn this.maxY - this.minY;\r\n\t\t};\r\n\t\treturn SkeletonBounds;\r\n\t}());\r\n\tspine.SkeletonBounds = SkeletonBounds;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonClipping = (function () {\r\n\t\tfunction SkeletonClipping() {\r\n\t\t\tthis.triangulator = new spine.Triangulator();\r\n\t\t\tthis.clippingPolygon = new Array();\r\n\t\t\tthis.clipOutput = new Array();\r\n\t\t\tthis.clippedVertices = new Array();\r\n\t\t\tthis.clippedTriangles = new Array();\r\n\t\t\tthis.scratch = new Array();\r\n\t\t}\r\n\t\tSkeletonClipping.prototype.clipStart = function (slot, clip) {\r\n\t\t\tif (this.clipAttachment != null)\r\n\t\t\t\treturn 0;\r\n\t\t\tthis.clipAttachment = clip;\r\n\t\t\tvar n = clip.worldVerticesLength;\r\n\t\t\tvar vertices = spine.Utils.setArraySize(this.clippingPolygon, n);\r\n\t\t\tclip.computeWorldVertices(slot, 0, n, vertices, 0, 2);\r\n\t\t\tvar clippingPolygon = this.clippingPolygon;\r\n\t\t\tSkeletonClipping.makeClockwise(clippingPolygon);\r\n\t\t\tvar clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));\r\n\t\t\tfor (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) {\r\n\t\t\t\tvar polygon = clippingPolygons[i];\r\n\t\t\t\tSkeletonClipping.makeClockwise(polygon);\r\n\t\t\t\tpolygon.push(polygon[0]);\r\n\t\t\t\tpolygon.push(polygon[1]);\r\n\t\t\t}\r\n\t\t\treturn clippingPolygons.length;\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clipEndWithSlot = function (slot) {\r\n\t\t\tif (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data)\r\n\t\t\t\tthis.clipEnd();\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clipEnd = function () {\r\n\t\t\tif (this.clipAttachment == null)\r\n\t\t\t\treturn;\r\n\t\t\tthis.clipAttachment = null;\r\n\t\t\tthis.clippingPolygons = null;\r\n\t\t\tthis.clippedVertices.length = 0;\r\n\t\t\tthis.clippedTriangles.length = 0;\r\n\t\t\tthis.clippingPolygon.length = 0;\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.isClipping = function () {\r\n\t\t\treturn this.clipAttachment != null;\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) {\r\n\t\t\tvar clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\r\n\t\t\tvar clippedTriangles = this.clippedTriangles;\r\n\t\t\tvar polygons = this.clippingPolygons;\r\n\t\t\tvar polygonsCount = this.clippingPolygons.length;\r\n\t\t\tvar vertexSize = twoColor ? 12 : 8;\r\n\t\t\tvar index = 0;\r\n\t\t\tclippedVertices.length = 0;\r\n\t\t\tclippedTriangles.length = 0;\r\n\t\t\touter: for (var i = 0; i < trianglesLength; i += 3) {\r\n\t\t\t\tvar vertexOffset = triangles[i] << 1;\r\n\t\t\t\tvar x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\r\n\t\t\t\tvar u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\r\n\t\t\t\tvertexOffset = triangles[i + 1] << 1;\r\n\t\t\t\tvar x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\r\n\t\t\t\tvar u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\r\n\t\t\t\tvertexOffset = triangles[i + 2] << 1;\r\n\t\t\t\tvar x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\r\n\t\t\t\tvar u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\r\n\t\t\t\tfor (var p = 0; p < polygonsCount; p++) {\r\n\t\t\t\t\tvar s = clippedVertices.length;\r\n\t\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\r\n\t\t\t\t\t\tvar clipOutputLength = clipOutput.length;\r\n\t\t\t\t\t\tif (clipOutputLength == 0)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tvar d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\r\n\t\t\t\t\t\tvar d = 1 / (d0 * d2 + d1 * (y1 - y3));\r\n\t\t\t\t\t\tvar clipOutputCount = clipOutputLength >> 1;\r\n\t\t\t\t\t\tvar clipOutputItems = this.clipOutput;\r\n\t\t\t\t\t\tvar clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);\r\n\t\t\t\t\t\tfor (var ii = 0; ii < clipOutputLength; ii += 2) {\r\n\t\t\t\t\t\t\tvar x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\r\n\t\t\t\t\t\t\tclippedVerticesItems[s] = x;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\r\n\t\t\t\t\t\t\tvar c0 = x - x3, c1 = y - y3;\r\n\t\t\t\t\t\t\tvar a = (d0 * c0 + d1 * c1) * d;\r\n\t\t\t\t\t\t\tvar b = (d4 * c0 + d2 * c1) * d;\r\n\t\t\t\t\t\t\tvar c = 1 - a - b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;\r\n\t\t\t\t\t\t\tif (twoColor) {\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\r\n\t\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ts += vertexSize;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ts = clippedTriangles.length;\r\n\t\t\t\t\t\tvar clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\r\n\t\t\t\t\t\tclipOutputCount--;\r\n\t\t\t\t\t\tfor (var ii = 1; ii < clipOutputCount; ii++) {\r\n\t\t\t\t\t\t\tclippedTrianglesItems[s] = index;\r\n\t\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\r\n\t\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\r\n\t\t\t\t\t\t\ts += 3;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tindex += clipOutputCount + 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize);\r\n\t\t\t\t\t\tclippedVerticesItems[s] = x1;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\r\n\t\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\r\n\t\t\t\t\t\tif (!twoColor) {\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = x2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = y2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 12] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 13] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 14] = u2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 15] = v2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 16] = x3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 17] = y3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 18] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 19] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 20] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 21] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 22] = u3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 23] = v3;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 12] = x2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 13] = y2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 14] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 15] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 16] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 17] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 18] = u2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 19] = v2;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 20] = dark.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 21] = dark.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 22] = dark.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 23] = dark.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 24] = x3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 25] = y3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 26] = light.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 27] = light.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 28] = light.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 29] = light.a;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 30] = u3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 31] = v3;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 32] = dark.r;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 33] = dark.g;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 34] = dark.b;\r\n\t\t\t\t\t\t\tclippedVerticesItems[s + 35] = dark.a;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ts = clippedTriangles.length;\r\n\t\t\t\t\t\tvar clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3);\r\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\r\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\r\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\r\n\t\t\t\t\t\tindex += 3;\r\n\t\t\t\t\t\tcontinue outer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) {\r\n\t\t\tvar originalOutput = output;\r\n\t\t\tvar clipped = false;\r\n\t\t\tvar input = null;\r\n\t\t\tif (clippingArea.length % 4 >= 2) {\r\n\t\t\t\tinput = output;\r\n\t\t\t\toutput = this.scratch;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tinput = this.scratch;\r\n\t\t\tinput.length = 0;\r\n\t\t\tinput.push(x1);\r\n\t\t\tinput.push(y1);\r\n\t\t\tinput.push(x2);\r\n\t\t\tinput.push(y2);\r\n\t\t\tinput.push(x3);\r\n\t\t\tinput.push(y3);\r\n\t\t\tinput.push(x1);\r\n\t\t\tinput.push(y1);\r\n\t\t\toutput.length = 0;\r\n\t\t\tvar clippingVertices = clippingArea;\r\n\t\t\tvar clippingVerticesLast = clippingArea.length - 4;\r\n\t\t\tfor (var i = 0;; i += 2) {\r\n\t\t\t\tvar edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];\r\n\t\t\t\tvar edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3];\r\n\t\t\t\tvar deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2;\r\n\t\t\t\tvar inputVertices = input;\r\n\t\t\t\tvar inputVerticesLength = input.length - 2, outputStart = output.length;\r\n\t\t\t\tfor (var ii = 0; ii < inputVerticesLength; ii += 2) {\r\n\t\t\t\t\tvar inputX = inputVertices[ii], inputY = inputVertices[ii + 1];\r\n\t\t\t\t\tvar inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3];\r\n\t\t\t\t\tvar side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0;\r\n\t\t\t\t\tif (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) {\r\n\t\t\t\t\t\tif (side2) {\r\n\t\t\t\t\t\t\toutput.push(inputX2);\r\n\t\t\t\t\t\t\toutput.push(inputY2);\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar c0 = inputY2 - inputY, c2 = inputX2 - inputX;\r\n\t\t\t\t\t\tvar s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\r\n\t\t\t\t\t\tif (Math.abs(s) > 0.000001) {\r\n\t\t\t\t\t\t\tvar ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\r\n\t\t\t\t\t\t\toutput.push(edgeX + (edgeX2 - edgeX) * ua);\r\n\t\t\t\t\t\t\toutput.push(edgeY + (edgeY2 - edgeY) * ua);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\toutput.push(edgeX);\r\n\t\t\t\t\t\t\toutput.push(edgeY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (side2) {\r\n\t\t\t\t\t\tvar c0 = inputY2 - inputY, c2 = inputX2 - inputX;\r\n\t\t\t\t\t\tvar s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\r\n\t\t\t\t\t\tif (Math.abs(s) > 0.000001) {\r\n\t\t\t\t\t\t\tvar ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\r\n\t\t\t\t\t\t\toutput.push(edgeX + (edgeX2 - edgeX) * ua);\r\n\t\t\t\t\t\t\toutput.push(edgeY + (edgeY2 - edgeY) * ua);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\toutput.push(edgeX);\r\n\t\t\t\t\t\t\toutput.push(edgeY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\toutput.push(inputX2);\r\n\t\t\t\t\t\toutput.push(inputY2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclipped = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (outputStart == output.length) {\r\n\t\t\t\t\toriginalOutput.length = 0;\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\toutput.push(output[0]);\r\n\t\t\t\toutput.push(output[1]);\r\n\t\t\t\tif (i == clippingVerticesLast)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tvar temp = output;\r\n\t\t\t\toutput = input;\r\n\t\t\t\toutput.length = 0;\r\n\t\t\t\tinput = temp;\r\n\t\t\t}\r\n\t\t\tif (originalOutput != output) {\r\n\t\t\t\toriginalOutput.length = 0;\r\n\t\t\t\tfor (var i = 0, n = output.length - 2; i < n; i++)\r\n\t\t\t\t\toriginalOutput[i] = output[i];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\toriginalOutput.length = originalOutput.length - 2;\r\n\t\t\treturn clipped;\r\n\t\t};\r\n\t\tSkeletonClipping.makeClockwise = function (polygon) {\r\n\t\t\tvar vertices = polygon;\r\n\t\t\tvar verticeslength = polygon.length;\r\n\t\t\tvar area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;\r\n\t\t\tfor (var i = 0, n = verticeslength - 3; i < n; i += 2) {\r\n\t\t\t\tp1x = vertices[i];\r\n\t\t\t\tp1y = vertices[i + 1];\r\n\t\t\t\tp2x = vertices[i + 2];\r\n\t\t\t\tp2y = vertices[i + 3];\r\n\t\t\t\tarea += p1x * p2y - p2x * p1y;\r\n\t\t\t}\r\n\t\t\tif (area < 0)\r\n\t\t\t\treturn;\r\n\t\t\tfor (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {\r\n\t\t\t\tvar x = vertices[i], y = vertices[i + 1];\r\n\t\t\t\tvar other = lastX - i;\r\n\t\t\t\tvertices[i] = vertices[other];\r\n\t\t\t\tvertices[i + 1] = vertices[other + 1];\r\n\t\t\t\tvertices[other] = x;\r\n\t\t\t\tvertices[other + 1] = y;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn SkeletonClipping;\r\n\t}());\r\n\tspine.SkeletonClipping = SkeletonClipping;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonData = (function () {\r\n\t\tfunction SkeletonData() {\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.slots = new Array();\r\n\t\t\tthis.skins = new Array();\r\n\t\t\tthis.events = new Array();\r\n\t\t\tthis.animations = new Array();\r\n\t\t\tthis.ikConstraints = new Array();\r\n\t\t\tthis.transformConstraints = new Array();\r\n\t\t\tthis.pathConstraints = new Array();\r\n\t\t\tthis.fps = 0;\r\n\t\t}\r\n\t\tSkeletonData.prototype.findBone = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (bone.name == boneName)\r\n\t\t\t\t\treturn bone;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findBoneIndex = function (boneName) {\r\n\t\t\tif (boneName == null)\r\n\t\t\t\tthrow new Error(\"boneName cannot be null.\");\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++)\r\n\t\t\t\tif (bones[i].name == boneName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findSlot = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\tvar slot = slots[i];\r\n\t\t\t\tif (slot.name == slotName)\r\n\t\t\t\t\treturn slot;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findSlotIndex = function (slotName) {\r\n\t\t\tif (slotName == null)\r\n\t\t\t\tthrow new Error(\"slotName cannot be null.\");\r\n\t\t\tvar slots = this.slots;\r\n\t\t\tfor (var i = 0, n = slots.length; i < n; i++)\r\n\t\t\t\tif (slots[i].name == slotName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findSkin = function (skinName) {\r\n\t\t\tif (skinName == null)\r\n\t\t\t\tthrow new Error(\"skinName cannot be null.\");\r\n\t\t\tvar skins = this.skins;\r\n\t\t\tfor (var i = 0, n = skins.length; i < n; i++) {\r\n\t\t\t\tvar skin = skins[i];\r\n\t\t\t\tif (skin.name == skinName)\r\n\t\t\t\t\treturn skin;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findEvent = function (eventDataName) {\r\n\t\t\tif (eventDataName == null)\r\n\t\t\t\tthrow new Error(\"eventDataName cannot be null.\");\r\n\t\t\tvar events = this.events;\r\n\t\t\tfor (var i = 0, n = events.length; i < n; i++) {\r\n\t\t\t\tvar event_4 = events[i];\r\n\t\t\t\tif (event_4.name == eventDataName)\r\n\t\t\t\t\treturn event_4;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findAnimation = function (animationName) {\r\n\t\t\tif (animationName == null)\r\n\t\t\t\tthrow new Error(\"animationName cannot be null.\");\r\n\t\t\tvar animations = this.animations;\r\n\t\t\tfor (var i = 0, n = animations.length; i < n; i++) {\r\n\t\t\t\tvar animation = animations[i];\r\n\t\t\t\tif (animation.name == animationName)\r\n\t\t\t\t\treturn animation;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findIkConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar ikConstraints = this.ikConstraints;\r\n\t\t\tfor (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = ikConstraints[i];\r\n\t\t\t\tif (constraint.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findTransformConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar transformConstraints = this.transformConstraints;\r\n\t\t\tfor (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = transformConstraints[i];\r\n\t\t\t\tif (constraint.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findPathConstraint = function (constraintName) {\r\n\t\t\tif (constraintName == null)\r\n\t\t\t\tthrow new Error(\"constraintName cannot be null.\");\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n\t\t\t\tvar constraint = pathConstraints[i];\r\n\t\t\t\tif (constraint.name == constraintName)\r\n\t\t\t\t\treturn constraint;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\r\n\t\t\tif (pathConstraintName == null)\r\n\t\t\t\tthrow new Error(\"pathConstraintName cannot be null.\");\r\n\t\t\tvar pathConstraints = this.pathConstraints;\r\n\t\t\tfor (var i = 0, n = pathConstraints.length; i < n; i++)\r\n\t\t\t\tif (pathConstraints[i].name == pathConstraintName)\r\n\t\t\t\t\treturn i;\r\n\t\t\treturn -1;\r\n\t\t};\r\n\t\treturn SkeletonData;\r\n\t}());\r\n\tspine.SkeletonData = SkeletonData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SkeletonJson = (function () {\r\n\t\tfunction SkeletonJson(attachmentLoader) {\r\n\t\t\tthis.scale = 1;\r\n\t\t\tthis.linkedMeshes = new Array();\r\n\t\t\tthis.attachmentLoader = attachmentLoader;\r\n\t\t}\r\n\t\tSkeletonJson.prototype.readSkeletonData = function (json) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tvar skeletonData = new spine.SkeletonData();\r\n\t\t\tvar root = typeof (json) === \"string\" ? JSON.parse(json) : json;\r\n\t\t\tvar skeletonMap = root.skeleton;\r\n\t\t\tif (skeletonMap != null) {\r\n\t\t\t\tskeletonData.hash = skeletonMap.hash;\r\n\t\t\t\tskeletonData.version = skeletonMap.spine;\r\n\t\t\t\tskeletonData.width = skeletonMap.width;\r\n\t\t\t\tskeletonData.height = skeletonMap.height;\r\n\t\t\t\tskeletonData.fps = skeletonMap.fps;\r\n\t\t\t\tskeletonData.imagesPath = skeletonMap.images;\r\n\t\t\t}\r\n\t\t\tif (root.bones) {\r\n\t\t\t\tfor (var i = 0; i < root.bones.length; i++) {\r\n\t\t\t\t\tvar boneMap = root.bones[i];\r\n\t\t\t\t\tvar parent_2 = null;\r\n\t\t\t\t\tvar parentName = this.getValue(boneMap, \"parent\", null);\r\n\t\t\t\t\tif (parentName != null) {\r\n\t\t\t\t\t\tparent_2 = skeletonData.findBone(parentName);\r\n\t\t\t\t\t\tif (parent_2 == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Parent bone not found: \" + parentName);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2);\r\n\t\t\t\t\tdata.length = this.getValue(boneMap, \"length\", 0) * scale;\r\n\t\t\t\t\tdata.x = this.getValue(boneMap, \"x\", 0) * scale;\r\n\t\t\t\t\tdata.y = this.getValue(boneMap, \"y\", 0) * scale;\r\n\t\t\t\t\tdata.rotation = this.getValue(boneMap, \"rotation\", 0);\r\n\t\t\t\t\tdata.scaleX = this.getValue(boneMap, \"scaleX\", 1);\r\n\t\t\t\t\tdata.scaleY = this.getValue(boneMap, \"scaleY\", 1);\r\n\t\t\t\t\tdata.shearX = this.getValue(boneMap, \"shearX\", 0);\r\n\t\t\t\t\tdata.shearY = this.getValue(boneMap, \"shearY\", 0);\r\n\t\t\t\t\tdata.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\r\n\t\t\t\t\tskeletonData.bones.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.slots) {\r\n\t\t\t\tfor (var i = 0; i < root.slots.length; i++) {\r\n\t\t\t\t\tvar slotMap = root.slots[i];\r\n\t\t\t\t\tvar slotName = slotMap.name;\r\n\t\t\t\t\tvar boneName = slotMap.bone;\r\n\t\t\t\t\tvar boneData = skeletonData.findBone(boneName);\r\n\t\t\t\t\tif (boneData == null)\r\n\t\t\t\t\t\tthrow new Error(\"Slot bone not found: \" + boneName);\r\n\t\t\t\t\tvar data = new spine.SlotData(skeletonData.slots.length, slotName, boneData);\r\n\t\t\t\t\tvar color = this.getValue(slotMap, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tdata.color.setFromString(color);\r\n\t\t\t\t\tvar dark = this.getValue(slotMap, \"dark\", null);\r\n\t\t\t\t\tif (dark != null) {\r\n\t\t\t\t\t\tdata.darkColor = new spine.Color(1, 1, 1, 1);\r\n\t\t\t\t\t\tdata.darkColor.setFromString(dark);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata.attachmentName = this.getValue(slotMap, \"attachment\", null);\r\n\t\t\t\t\tdata.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\r\n\t\t\t\t\tskeletonData.slots.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.ik) {\r\n\t\t\t\tfor (var i = 0; i < root.ik.length; i++) {\r\n\t\t\t\t\tvar constraintMap = root.ik[i];\r\n\t\t\t\t\tvar data = new spine.IkConstraintData(constraintMap.name);\r\n\t\t\t\t\tdata.order = this.getValue(constraintMap, \"order\", 0);\r\n\t\t\t\t\tfor (var j = 0; j < constraintMap.bones.length; j++) {\r\n\t\t\t\t\t\tvar boneName = constraintMap.bones[j];\r\n\t\t\t\t\t\tvar bone = skeletonData.findBone(boneName);\r\n\t\t\t\t\t\tif (bone == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"IK bone not found: \" + boneName);\r\n\t\t\t\t\t\tdata.bones.push(bone);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar targetName = constraintMap.target;\r\n\t\t\t\t\tdata.target = skeletonData.findBone(targetName);\r\n\t\t\t\t\tif (data.target == null)\r\n\t\t\t\t\t\tthrow new Error(\"IK target bone not found: \" + targetName);\r\n\t\t\t\t\tdata.mix = this.getValue(constraintMap, \"mix\", 1);\r\n\t\t\t\t\tdata.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n\t\t\t\t\tdata.compress = this.getValue(constraintMap, \"compress\", false);\r\n\t\t\t\t\tdata.stretch = this.getValue(constraintMap, \"stretch\", false);\r\n\t\t\t\t\tdata.uniform = this.getValue(constraintMap, \"uniform\", false);\r\n\t\t\t\t\tskeletonData.ikConstraints.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.transform) {\r\n\t\t\t\tfor (var i = 0; i < root.transform.length; i++) {\r\n\t\t\t\t\tvar constraintMap = root.transform[i];\r\n\t\t\t\t\tvar data = new spine.TransformConstraintData(constraintMap.name);\r\n\t\t\t\t\tdata.order = this.getValue(constraintMap, \"order\", 0);\r\n\t\t\t\t\tfor (var j = 0; j < constraintMap.bones.length; j++) {\r\n\t\t\t\t\t\tvar boneName = constraintMap.bones[j];\r\n\t\t\t\t\t\tvar bone = skeletonData.findBone(boneName);\r\n\t\t\t\t\t\tif (bone == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Transform constraint bone not found: \" + boneName);\r\n\t\t\t\t\t\tdata.bones.push(bone);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar targetName = constraintMap.target;\r\n\t\t\t\t\tdata.target = skeletonData.findBone(targetName);\r\n\t\t\t\t\tif (data.target == null)\r\n\t\t\t\t\t\tthrow new Error(\"Transform constraint target bone not found: \" + targetName);\r\n\t\t\t\t\tdata.local = this.getValue(constraintMap, \"local\", false);\r\n\t\t\t\t\tdata.relative = this.getValue(constraintMap, \"relative\", false);\r\n\t\t\t\t\tdata.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n\t\t\t\t\tdata.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\r\n\t\t\t\t\tdata.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\r\n\t\t\t\t\tdata.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\r\n\t\t\t\t\tdata.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\r\n\t\t\t\t\tdata.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\r\n\t\t\t\t\tdata.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n\t\t\t\t\tdata.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n\t\t\t\t\tdata.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\r\n\t\t\t\t\tdata.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\r\n\t\t\t\t\tskeletonData.transformConstraints.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.path) {\r\n\t\t\t\tfor (var i = 0; i < root.path.length; i++) {\r\n\t\t\t\t\tvar constraintMap = root.path[i];\r\n\t\t\t\t\tvar data = new spine.PathConstraintData(constraintMap.name);\r\n\t\t\t\t\tdata.order = this.getValue(constraintMap, \"order\", 0);\r\n\t\t\t\t\tfor (var j = 0; j < constraintMap.bones.length; j++) {\r\n\t\t\t\t\t\tvar boneName = constraintMap.bones[j];\r\n\t\t\t\t\t\tvar bone = skeletonData.findBone(boneName);\r\n\t\t\t\t\t\tif (bone == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Transform constraint bone not found: \" + boneName);\r\n\t\t\t\t\t\tdata.bones.push(bone);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar targetName = constraintMap.target;\r\n\t\t\t\t\tdata.target = skeletonData.findSlot(targetName);\r\n\t\t\t\t\tif (data.target == null)\r\n\t\t\t\t\t\tthrow new Error(\"Path target slot not found: \" + targetName);\r\n\t\t\t\t\tdata.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\r\n\t\t\t\t\tdata.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\r\n\t\t\t\t\tdata.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\r\n\t\t\t\t\tdata.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n\t\t\t\t\tdata.position = this.getValue(constraintMap, \"position\", 0);\r\n\t\t\t\t\tif (data.positionMode == spine.PositionMode.Fixed)\r\n\t\t\t\t\t\tdata.position *= scale;\r\n\t\t\t\t\tdata.spacing = this.getValue(constraintMap, \"spacing\", 0);\r\n\t\t\t\t\tif (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n\t\t\t\t\t\tdata.spacing *= scale;\r\n\t\t\t\t\tdata.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n\t\t\t\t\tdata.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n\t\t\t\t\tskeletonData.pathConstraints.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.skins) {\r\n\t\t\t\tfor (var skinName in root.skins) {\r\n\t\t\t\t\tvar skinMap = root.skins[skinName];\r\n\t\t\t\t\tvar skin = new spine.Skin(skinName);\r\n\t\t\t\t\tfor (var slotName in skinMap) {\r\n\t\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(slotName);\r\n\t\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + slotName);\r\n\t\t\t\t\t\tvar slotMap = skinMap[slotName];\r\n\t\t\t\t\t\tfor (var entryName in slotMap) {\r\n\t\t\t\t\t\t\tvar attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData);\r\n\t\t\t\t\t\t\tif (attachment != null)\r\n\t\t\t\t\t\t\t\tskin.addAttachment(slotIndex, entryName, attachment);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tskeletonData.skins.push(skin);\r\n\t\t\t\t\tif (skin.name == \"default\")\r\n\t\t\t\t\t\tskeletonData.defaultSkin = skin;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n\t\t\t\tvar linkedMesh = this.linkedMeshes[i];\r\n\t\t\t\tvar skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n\t\t\t\tif (skin == null)\r\n\t\t\t\t\tthrow new Error(\"Skin not found: \" + linkedMesh.skin);\r\n\t\t\t\tvar parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n\t\t\t\tif (parent_3 == null)\r\n\t\t\t\t\tthrow new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n\t\t\t\tlinkedMesh.mesh.setParentMesh(parent_3);\r\n\t\t\t\tlinkedMesh.mesh.updateUVs();\r\n\t\t\t}\r\n\t\t\tthis.linkedMeshes.length = 0;\r\n\t\t\tif (root.events) {\r\n\t\t\t\tfor (var eventName in root.events) {\r\n\t\t\t\t\tvar eventMap = root.events[eventName];\r\n\t\t\t\t\tvar data = new spine.EventData(eventName);\r\n\t\t\t\t\tdata.intValue = this.getValue(eventMap, \"int\", 0);\r\n\t\t\t\t\tdata.floatValue = this.getValue(eventMap, \"float\", 0);\r\n\t\t\t\t\tdata.stringValue = this.getValue(eventMap, \"string\", \"\");\r\n\t\t\t\t\tdata.audioPath = this.getValue(eventMap, \"audio\", null);\r\n\t\t\t\t\tif (data.audioPath != null) {\r\n\t\t\t\t\t\tdata.volume = this.getValue(eventMap, \"volume\", 1);\r\n\t\t\t\t\t\tdata.balance = this.getValue(eventMap, \"balance\", 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tskeletonData.events.push(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (root.animations) {\r\n\t\t\t\tfor (var animationName in root.animations) {\r\n\t\t\t\t\tvar animationMap = root.animations[animationName];\r\n\t\t\t\t\tthis.readAnimation(animationMap, animationName, skeletonData);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn skeletonData;\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tname = this.getValue(map, \"name\", name);\r\n\t\t\tvar type = this.getValue(map, \"type\", \"region\");\r\n\t\t\tswitch (type) {\r\n\t\t\t\tcase \"region\": {\r\n\t\t\t\t\tvar path = this.getValue(map, \"path\", name);\r\n\t\t\t\t\tvar region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n\t\t\t\t\tif (region == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tregion.path = path;\r\n\t\t\t\t\tregion.x = this.getValue(map, \"x\", 0) * scale;\r\n\t\t\t\t\tregion.y = this.getValue(map, \"y\", 0) * scale;\r\n\t\t\t\t\tregion.scaleX = this.getValue(map, \"scaleX\", 1);\r\n\t\t\t\t\tregion.scaleY = this.getValue(map, \"scaleY\", 1);\r\n\t\t\t\t\tregion.rotation = this.getValue(map, \"rotation\", 0);\r\n\t\t\t\t\tregion.width = map.width * scale;\r\n\t\t\t\t\tregion.height = map.height * scale;\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tregion.color.setFromString(color);\r\n\t\t\t\t\tregion.updateOffset();\r\n\t\t\t\t\treturn region;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"boundingbox\": {\r\n\t\t\t\t\tvar box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n\t\t\t\t\tif (box == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tthis.readVertices(map, box, map.vertexCount << 1);\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tbox.color.setFromString(color);\r\n\t\t\t\t\treturn box;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"mesh\":\r\n\t\t\t\tcase \"linkedmesh\": {\r\n\t\t\t\t\tvar path = this.getValue(map, \"path\", name);\r\n\t\t\t\t\tvar mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n\t\t\t\t\tif (mesh == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tmesh.path = path;\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tmesh.color.setFromString(color);\r\n\t\t\t\t\tvar parent_4 = this.getValue(map, \"parent\", null);\r\n\t\t\t\t\tif (parent_4 != null) {\r\n\t\t\t\t\t\tmesh.inheritDeform = this.getValue(map, \"deform\", true);\r\n\t\t\t\t\t\tthis.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent_4));\r\n\t\t\t\t\t\treturn mesh;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar uvs = map.uvs;\r\n\t\t\t\t\tthis.readVertices(map, mesh, uvs.length);\r\n\t\t\t\t\tmesh.triangles = map.triangles;\r\n\t\t\t\t\tmesh.regionUVs = uvs;\r\n\t\t\t\t\tmesh.updateUVs();\r\n\t\t\t\t\tmesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\r\n\t\t\t\t\treturn mesh;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"path\": {\r\n\t\t\t\t\tvar path = this.attachmentLoader.newPathAttachment(skin, name);\r\n\t\t\t\t\tif (path == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tpath.closed = this.getValue(map, \"closed\", false);\r\n\t\t\t\t\tpath.constantSpeed = this.getValue(map, \"constantSpeed\", true);\r\n\t\t\t\t\tvar vertexCount = map.vertexCount;\r\n\t\t\t\t\tthis.readVertices(map, path, vertexCount << 1);\r\n\t\t\t\t\tvar lengths = spine.Utils.newArray(vertexCount / 3, 0);\r\n\t\t\t\t\tfor (var i = 0; i < map.lengths.length; i++)\r\n\t\t\t\t\t\tlengths[i] = map.lengths[i] * scale;\r\n\t\t\t\t\tpath.lengths = lengths;\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tpath.color.setFromString(color);\r\n\t\t\t\t\treturn path;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"point\": {\r\n\t\t\t\t\tvar point = this.attachmentLoader.newPointAttachment(skin, name);\r\n\t\t\t\t\tif (point == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tpoint.x = this.getValue(map, \"x\", 0) * scale;\r\n\t\t\t\t\tpoint.y = this.getValue(map, \"y\", 0) * scale;\r\n\t\t\t\t\tpoint.rotation = this.getValue(map, \"rotation\", 0);\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tpoint.color.setFromString(color);\r\n\t\t\t\t\treturn point;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"clipping\": {\r\n\t\t\t\t\tvar clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n\t\t\t\t\tif (clip == null)\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\tvar end = this.getValue(map, \"end\", null);\r\n\t\t\t\t\tif (end != null) {\r\n\t\t\t\t\t\tvar slot = skeletonData.findSlot(end);\r\n\t\t\t\t\t\tif (slot == null)\r\n\t\t\t\t\t\t\tthrow new Error(\"Clipping end slot not found: \" + end);\r\n\t\t\t\t\t\tclip.endSlot = slot;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar vertexCount = map.vertexCount;\r\n\t\t\t\t\tthis.readVertices(map, clip, vertexCount << 1);\r\n\t\t\t\t\tvar color = this.getValue(map, \"color\", null);\r\n\t\t\t\t\tif (color != null)\r\n\t\t\t\t\t\tclip.color.setFromString(color);\r\n\t\t\t\t\treturn clip;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tattachment.worldVerticesLength = verticesLength;\r\n\t\t\tvar vertices = map.vertices;\r\n\t\t\tif (verticesLength == vertices.length) {\r\n\t\t\t\tvar scaledVertices = spine.Utils.toFloatArray(vertices);\r\n\t\t\t\tif (scale != 1) {\r\n\t\t\t\t\tfor (var i = 0, n = vertices.length; i < n; i++)\r\n\t\t\t\t\t\tscaledVertices[i] *= scale;\r\n\t\t\t\t}\r\n\t\t\t\tattachment.vertices = scaledVertices;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar weights = new Array();\r\n\t\t\tvar bones = new Array();\r\n\t\t\tfor (var i = 0, n = vertices.length; i < n;) {\r\n\t\t\t\tvar boneCount = vertices[i++];\r\n\t\t\t\tbones.push(boneCount);\r\n\t\t\t\tfor (var nn = i + boneCount * 4; i < nn; i += 4) {\r\n\t\t\t\t\tbones.push(vertices[i]);\r\n\t\t\t\t\tweights.push(vertices[i + 1] * scale);\r\n\t\t\t\t\tweights.push(vertices[i + 2] * scale);\r\n\t\t\t\t\tweights.push(vertices[i + 3]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattachment.bones = bones;\r\n\t\t\tattachment.vertices = spine.Utils.toFloatArray(weights);\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tvar timelines = new Array();\r\n\t\t\tvar duration = 0;\r\n\t\t\tif (map.slots) {\r\n\t\t\t\tfor (var slotName in map.slots) {\r\n\t\t\t\t\tvar slotMap = map.slots[slotName];\r\n\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(slotName);\r\n\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + slotName);\r\n\t\t\t\t\tfor (var timelineName in slotMap) {\r\n\t\t\t\t\t\tvar timelineMap = slotMap[timelineName];\r\n\t\t\t\t\t\tif (timelineName == \"attachment\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.AttachmentTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex++, valueMap.time, valueMap.name);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName == \"color\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.ColorTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\tvar color = new spine.Color();\r\n\t\t\t\t\t\t\t\tcolor.setFromString(valueMap.color);\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName == \"twoColor\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.TwoColorTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\tvar light = new spine.Color();\r\n\t\t\t\t\t\t\t\tvar dark = new spine.Color();\r\n\t\t\t\t\t\t\t\tlight.setFromString(valueMap.light);\r\n\t\t\t\t\t\t\t\tdark.setFromString(valueMap.dark);\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.bones) {\r\n\t\t\t\tfor (var boneName in map.bones) {\r\n\t\t\t\t\tvar boneMap = map.bones[boneName];\r\n\t\t\t\t\tvar boneIndex = skeletonData.findBoneIndex(boneName);\r\n\t\t\t\t\tif (boneIndex == -1)\r\n\t\t\t\t\t\tthrow new Error(\"Bone not found: \" + boneName);\r\n\t\t\t\t\tfor (var timelineName in boneMap) {\r\n\t\t\t\t\t\tvar timelineMap = boneMap[timelineName];\r\n\t\t\t\t\t\tif (timelineName === \"rotate\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.RotateTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.boneIndex = boneIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, valueMap.angle);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\r\n\t\t\t\t\t\t\tvar timeline = null;\r\n\t\t\t\t\t\t\tvar timelineScale = 1;\r\n\t\t\t\t\t\t\tif (timelineName === \"scale\")\r\n\t\t\t\t\t\t\t\ttimeline = new spine.ScaleTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\telse if (timelineName === \"shear\")\r\n\t\t\t\t\t\t\t\ttimeline = new spine.ShearTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\ttimeline = new spine.TranslateTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\t\ttimelineScale = scale;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimeline.boneIndex = boneIndex;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\tvar x = this.getValue(valueMap, \"x\", 0), y = this.getValue(valueMap, \"y\", 0);\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthrow new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.ik) {\r\n\t\t\t\tfor (var constraintName in map.ik) {\r\n\t\t\t\t\tvar constraintMap = map.ik[constraintName];\r\n\t\t\t\t\tvar constraint = skeletonData.findIkConstraint(constraintName);\r\n\t\t\t\t\tvar timeline = new spine.IkConstraintTimeline(constraintMap.length);\r\n\t\t\t\t\ttimeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\tfor (var i = 0; i < constraintMap.length; i++) {\r\n\t\t\t\t\t\tvar valueMap = constraintMap[i];\r\n\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"mix\", 1), this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1, this.getValue(valueMap, \"compress\", false), this.getValue(valueMap, \"stretch\", false));\r\n\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.transform) {\r\n\t\t\t\tfor (var constraintName in map.transform) {\r\n\t\t\t\t\tvar constraintMap = map.transform[constraintName];\r\n\t\t\t\t\tvar constraint = skeletonData.findTransformConstraint(constraintName);\r\n\t\t\t\t\tvar timeline = new spine.TransformConstraintTimeline(constraintMap.length);\r\n\t\t\t\t\ttimeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\tfor (var i = 0; i < constraintMap.length; i++) {\r\n\t\t\t\t\t\tvar valueMap = constraintMap[i];\r\n\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\r\n\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.paths) {\r\n\t\t\t\tfor (var constraintName in map.paths) {\r\n\t\t\t\t\tvar constraintMap = map.paths[constraintName];\r\n\t\t\t\t\tvar index = skeletonData.findPathConstraintIndex(constraintName);\r\n\t\t\t\t\tif (index == -1)\r\n\t\t\t\t\t\tthrow new Error(\"Path constraint not found: \" + constraintName);\r\n\t\t\t\t\tvar data = skeletonData.pathConstraints[index];\r\n\t\t\t\t\tfor (var timelineName in constraintMap) {\r\n\t\t\t\t\t\tvar timelineMap = constraintMap[timelineName];\r\n\t\t\t\t\t\tif (timelineName === \"position\" || timelineName === \"spacing\") {\r\n\t\t\t\t\t\t\tvar timeline = null;\r\n\t\t\t\t\t\t\tvar timelineScale = 1;\r\n\t\t\t\t\t\t\tif (timelineName === \"spacing\") {\r\n\t\t\t\t\t\t\t\ttimeline = new spine.PathConstraintSpacingTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\t\tif (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n\t\t\t\t\t\t\t\t\ttimelineScale = scale;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\ttimeline = new spine.PathConstraintPositionTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\t\tif (data.positionMode == spine.PositionMode.Fixed)\r\n\t\t\t\t\t\t\t\t\ttimelineScale = scale;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimeline.pathConstraintIndex = index;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (timelineName === \"mix\") {\r\n\t\t\t\t\t\t\tvar timeline = new spine.PathConstraintMixTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.pathConstraintIndex = index;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var i = 0; i < timelineMap.length; i++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[i];\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1));\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (map.deform) {\r\n\t\t\t\tfor (var deformName in map.deform) {\r\n\t\t\t\t\tvar deformMap = map.deform[deformName];\r\n\t\t\t\t\tvar skin = skeletonData.findSkin(deformName);\r\n\t\t\t\t\tif (skin == null)\r\n\t\t\t\t\t\tthrow new Error(\"Skin not found: \" + deformName);\r\n\t\t\t\t\tfor (var slotName in deformMap) {\r\n\t\t\t\t\t\tvar slotMap = deformMap[slotName];\r\n\t\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(slotName);\r\n\t\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + slotMap.name);\r\n\t\t\t\t\t\tfor (var timelineName in slotMap) {\r\n\t\t\t\t\t\t\tvar timelineMap = slotMap[timelineName];\r\n\t\t\t\t\t\t\tvar attachment = skin.getAttachment(slotIndex, timelineName);\r\n\t\t\t\t\t\t\tif (attachment == null)\r\n\t\t\t\t\t\t\t\tthrow new Error(\"Deform attachment not found: \" + timelineMap.name);\r\n\t\t\t\t\t\t\tvar weighted = attachment.bones != null;\r\n\t\t\t\t\t\t\tvar vertices = attachment.vertices;\r\n\t\t\t\t\t\t\tvar deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n\t\t\t\t\t\t\tvar timeline = new spine.DeformTimeline(timelineMap.length);\r\n\t\t\t\t\t\t\ttimeline.slotIndex = slotIndex;\r\n\t\t\t\t\t\t\ttimeline.attachment = attachment;\r\n\t\t\t\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\t\t\t\tfor (var j = 0; j < timelineMap.length; j++) {\r\n\t\t\t\t\t\t\t\tvar valueMap = timelineMap[j];\r\n\t\t\t\t\t\t\t\tvar deform = void 0;\r\n\t\t\t\t\t\t\t\tvar verticesValue = this.getValue(valueMap, \"vertices\", null);\r\n\t\t\t\t\t\t\t\tif (verticesValue == null)\r\n\t\t\t\t\t\t\t\t\tdeform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices;\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tdeform = spine.Utils.newFloatArray(deformLength);\r\n\t\t\t\t\t\t\t\t\tvar start = this.getValue(valueMap, \"offset\", 0);\r\n\t\t\t\t\t\t\t\t\tspine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n\t\t\t\t\t\t\t\t\tif (scale != 1) {\r\n\t\t\t\t\t\t\t\t\t\tfor (var i = start, n = i + verticesValue.length; i < n; i++)\r\n\t\t\t\t\t\t\t\t\t\t\tdeform[i] *= scale;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif (!weighted) {\r\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < deformLength; i++)\r\n\t\t\t\t\t\t\t\t\t\t\tdeform[i] += vertices[i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\ttimeline.setFrame(frameIndex, valueMap.time, deform);\r\n\t\t\t\t\t\t\t\tthis.readCurve(valueMap, timeline, frameIndex);\r\n\t\t\t\t\t\t\t\tframeIndex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar drawOrderNode = map.drawOrder;\r\n\t\t\tif (drawOrderNode == null)\r\n\t\t\t\tdrawOrderNode = map.draworder;\r\n\t\t\tif (drawOrderNode != null) {\r\n\t\t\t\tvar timeline = new spine.DrawOrderTimeline(drawOrderNode.length);\r\n\t\t\t\tvar slotCount = skeletonData.slots.length;\r\n\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\tfor (var j = 0; j < drawOrderNode.length; j++) {\r\n\t\t\t\t\tvar drawOrderMap = drawOrderNode[j];\r\n\t\t\t\t\tvar drawOrder = null;\r\n\t\t\t\t\tvar offsets = this.getValue(drawOrderMap, \"offsets\", null);\r\n\t\t\t\t\tif (offsets != null) {\r\n\t\t\t\t\t\tdrawOrder = spine.Utils.newArray(slotCount, -1);\r\n\t\t\t\t\t\tvar unchanged = spine.Utils.newArray(slotCount - offsets.length, 0);\r\n\t\t\t\t\t\tvar originalIndex = 0, unchangedIndex = 0;\r\n\t\t\t\t\t\tfor (var i = 0; i < offsets.length; i++) {\r\n\t\t\t\t\t\t\tvar offsetMap = offsets[i];\r\n\t\t\t\t\t\t\tvar slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\r\n\t\t\t\t\t\t\tif (slotIndex == -1)\r\n\t\t\t\t\t\t\t\tthrow new Error(\"Slot not found: \" + offsetMap.slot);\r\n\t\t\t\t\t\t\twhile (originalIndex != slotIndex)\r\n\t\t\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\r\n\t\t\t\t\t\t\tdrawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\twhile (originalIndex < slotCount)\r\n\t\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\r\n\t\t\t\t\t\tfor (var i = slotCount - 1; i >= 0; i--)\r\n\t\t\t\t\t\t\tif (drawOrder[i] == -1)\r\n\t\t\t\t\t\t\t\tdrawOrder[i] = unchanged[--unchangedIndex];\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);\r\n\t\t\t\t}\r\n\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t}\r\n\t\t\tif (map.events) {\r\n\t\t\t\tvar timeline = new spine.EventTimeline(map.events.length);\r\n\t\t\t\tvar frameIndex = 0;\r\n\t\t\t\tfor (var i = 0; i < map.events.length; i++) {\r\n\t\t\t\t\tvar eventMap = map.events[i];\r\n\t\t\t\t\tvar eventData = skeletonData.findEvent(eventMap.name);\r\n\t\t\t\t\tif (eventData == null)\r\n\t\t\t\t\t\tthrow new Error(\"Event not found: \" + eventMap.name);\r\n\t\t\t\t\tvar event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData);\r\n\t\t\t\t\tevent_5.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\r\n\t\t\t\t\tevent_5.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\r\n\t\t\t\t\tevent_5.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\r\n\t\t\t\t\tif (event_5.data.audioPath != null) {\r\n\t\t\t\t\t\tevent_5.volume = this.getValue(eventMap, \"volume\", 1);\r\n\t\t\t\t\t\tevent_5.balance = this.getValue(eventMap, \"balance\", 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimeline.setFrame(frameIndex++, event_5);\r\n\t\t\t\t}\r\n\t\t\t\ttimelines.push(timeline);\r\n\t\t\t\tduration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n\t\t\t}\r\n\t\t\tif (isNaN(duration)) {\r\n\t\t\t\tthrow new Error(\"Error while parsing animation, duration is NaN\");\r\n\t\t\t}\r\n\t\t\tskeletonData.animations.push(new spine.Animation(name, timelines, duration));\r\n\t\t};\r\n\t\tSkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {\r\n\t\t\tif (!map.curve)\r\n\t\t\t\treturn;\r\n\t\t\tif (map.curve === \"stepped\")\r\n\t\t\t\ttimeline.setStepped(frameIndex);\r\n\t\t\telse if (Object.prototype.toString.call(map.curve) === '[object Array]') {\r\n\t\t\t\tvar curve = map.curve;\r\n\t\t\t\ttimeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);\r\n\t\t\t}\r\n\t\t};\r\n\t\tSkeletonJson.prototype.getValue = function (map, prop, defaultValue) {\r\n\t\t\treturn map[prop] !== undefined ? map[prop] : defaultValue;\r\n\t\t};\r\n\t\tSkeletonJson.blendModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"normal\")\r\n\t\t\t\treturn spine.BlendMode.Normal;\r\n\t\t\tif (str == \"additive\")\r\n\t\t\t\treturn spine.BlendMode.Additive;\r\n\t\t\tif (str == \"multiply\")\r\n\t\t\t\treturn spine.BlendMode.Multiply;\r\n\t\t\tif (str == \"screen\")\r\n\t\t\t\treturn spine.BlendMode.Screen;\r\n\t\t\tthrow new Error(\"Unknown blend mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.positionModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"fixed\")\r\n\t\t\t\treturn spine.PositionMode.Fixed;\r\n\t\t\tif (str == \"percent\")\r\n\t\t\t\treturn spine.PositionMode.Percent;\r\n\t\t\tthrow new Error(\"Unknown position mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.spacingModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"length\")\r\n\t\t\t\treturn spine.SpacingMode.Length;\r\n\t\t\tif (str == \"fixed\")\r\n\t\t\t\treturn spine.SpacingMode.Fixed;\r\n\t\t\tif (str == \"percent\")\r\n\t\t\t\treturn spine.SpacingMode.Percent;\r\n\t\t\tthrow new Error(\"Unknown position mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.rotateModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"tangent\")\r\n\t\t\t\treturn spine.RotateMode.Tangent;\r\n\t\t\tif (str == \"chain\")\r\n\t\t\t\treturn spine.RotateMode.Chain;\r\n\t\t\tif (str == \"chainscale\")\r\n\t\t\t\treturn spine.RotateMode.ChainScale;\r\n\t\t\tthrow new Error(\"Unknown rotate mode: \" + str);\r\n\t\t};\r\n\t\tSkeletonJson.transformModeFromString = function (str) {\r\n\t\t\tstr = str.toLowerCase();\r\n\t\t\tif (str == \"normal\")\r\n\t\t\t\treturn spine.TransformMode.Normal;\r\n\t\t\tif (str == \"onlytranslation\")\r\n\t\t\t\treturn spine.TransformMode.OnlyTranslation;\r\n\t\t\tif (str == \"norotationorreflection\")\r\n\t\t\t\treturn spine.TransformMode.NoRotationOrReflection;\r\n\t\t\tif (str == \"noscale\")\r\n\t\t\t\treturn spine.TransformMode.NoScale;\r\n\t\t\tif (str == \"noscaleorreflection\")\r\n\t\t\t\treturn spine.TransformMode.NoScaleOrReflection;\r\n\t\t\tthrow new Error(\"Unknown transform mode: \" + str);\r\n\t\t};\r\n\t\treturn SkeletonJson;\r\n\t}());\r\n\tspine.SkeletonJson = SkeletonJson;\r\n\tvar LinkedMesh = (function () {\r\n\t\tfunction LinkedMesh(mesh, skin, slotIndex, parent) {\r\n\t\t\tthis.mesh = mesh;\r\n\t\t\tthis.skin = skin;\r\n\t\t\tthis.slotIndex = slotIndex;\r\n\t\t\tthis.parent = parent;\r\n\t\t}\r\n\t\treturn LinkedMesh;\r\n\t}());\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Skin = (function () {\r\n\t\tfunction Skin(name) {\r\n\t\t\tthis.attachments = new Array();\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\tSkin.prototype.addAttachment = function (slotIndex, name, attachment) {\r\n\t\t\tif (attachment == null)\r\n\t\t\t\tthrow new Error(\"attachment cannot be null.\");\r\n\t\t\tvar attachments = this.attachments;\r\n\t\t\tif (slotIndex >= attachments.length)\r\n\t\t\t\tattachments.length = slotIndex + 1;\r\n\t\t\tif (!attachments[slotIndex])\r\n\t\t\t\tattachments[slotIndex] = {};\r\n\t\t\tattachments[slotIndex][name] = attachment;\r\n\t\t};\r\n\t\tSkin.prototype.getAttachment = function (slotIndex, name) {\r\n\t\t\tvar dictionary = this.attachments[slotIndex];\r\n\t\t\treturn dictionary ? dictionary[name] : null;\r\n\t\t};\r\n\t\tSkin.prototype.attachAll = function (skeleton, oldSkin) {\r\n\t\t\tvar slotIndex = 0;\r\n\t\t\tfor (var i = 0; i < skeleton.slots.length; i++) {\r\n\t\t\t\tvar slot = skeleton.slots[i];\r\n\t\t\t\tvar slotAttachment = slot.getAttachment();\r\n\t\t\t\tif (slotAttachment && slotIndex < oldSkin.attachments.length) {\r\n\t\t\t\t\tvar dictionary = oldSkin.attachments[slotIndex];\r\n\t\t\t\t\tfor (var key in dictionary) {\r\n\t\t\t\t\t\tvar skinAttachment = dictionary[key];\r\n\t\t\t\t\t\tif (slotAttachment == skinAttachment) {\r\n\t\t\t\t\t\t\tvar attachment = this.getAttachment(slotIndex, key);\r\n\t\t\t\t\t\t\tif (attachment != null)\r\n\t\t\t\t\t\t\t\tslot.setAttachment(attachment);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tslotIndex++;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn Skin;\r\n\t}());\r\n\tspine.Skin = Skin;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Slot = (function () {\r\n\t\tfunction Slot(data, bone) {\r\n\t\t\tthis.attachmentVertices = new Array();\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (bone == null)\r\n\t\t\t\tthrow new Error(\"bone cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.bone = bone;\r\n\t\t\tthis.color = new spine.Color();\r\n\t\t\tthis.darkColor = data.darkColor == null ? null : new spine.Color();\r\n\t\t\tthis.setToSetupPose();\r\n\t\t}\r\n\t\tSlot.prototype.getAttachment = function () {\r\n\t\t\treturn this.attachment;\r\n\t\t};\r\n\t\tSlot.prototype.setAttachment = function (attachment) {\r\n\t\t\tif (this.attachment == attachment)\r\n\t\t\t\treturn;\r\n\t\t\tthis.attachment = attachment;\r\n\t\t\tthis.attachmentTime = this.bone.skeleton.time;\r\n\t\t\tthis.attachmentVertices.length = 0;\r\n\t\t};\r\n\t\tSlot.prototype.setAttachmentTime = function (time) {\r\n\t\t\tthis.attachmentTime = this.bone.skeleton.time - time;\r\n\t\t};\r\n\t\tSlot.prototype.getAttachmentTime = function () {\r\n\t\t\treturn this.bone.skeleton.time - this.attachmentTime;\r\n\t\t};\r\n\t\tSlot.prototype.setToSetupPose = function () {\r\n\t\t\tthis.color.setFromColor(this.data.color);\r\n\t\t\tif (this.darkColor != null)\r\n\t\t\t\tthis.darkColor.setFromColor(this.data.darkColor);\r\n\t\t\tif (this.data.attachmentName == null)\r\n\t\t\t\tthis.attachment = null;\r\n\t\t\telse {\r\n\t\t\t\tthis.attachment = null;\r\n\t\t\t\tthis.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn Slot;\r\n\t}());\r\n\tspine.Slot = Slot;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SlotData = (function () {\r\n\t\tfunction SlotData(index, name, boneData) {\r\n\t\t\tthis.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\tif (index < 0)\r\n\t\t\t\tthrow new Error(\"index must be >= 0.\");\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tif (boneData == null)\r\n\t\t\t\tthrow new Error(\"boneData cannot be null.\");\r\n\t\t\tthis.index = index;\r\n\t\t\tthis.name = name;\r\n\t\t\tthis.boneData = boneData;\r\n\t\t}\r\n\t\treturn SlotData;\r\n\t}());\r\n\tspine.SlotData = SlotData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Texture = (function () {\r\n\t\tfunction Texture(image) {\r\n\t\t\tthis._image = image;\r\n\t\t}\r\n\t\tTexture.prototype.getImage = function () {\r\n\t\t\treturn this._image;\r\n\t\t};\r\n\t\tTexture.filterFromString = function (text) {\r\n\t\t\tswitch (text.toLowerCase()) {\r\n\t\t\t\tcase \"nearest\": return TextureFilter.Nearest;\r\n\t\t\t\tcase \"linear\": return TextureFilter.Linear;\r\n\t\t\t\tcase \"mipmap\": return TextureFilter.MipMap;\r\n\t\t\t\tcase \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\r\n\t\t\t\tcase \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\r\n\t\t\t\tcase \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\r\n\t\t\t\tcase \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\r\n\t\t\t\tdefault: throw new Error(\"Unknown texture filter \" + text);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTexture.wrapFromString = function (text) {\r\n\t\t\tswitch (text.toLowerCase()) {\r\n\t\t\t\tcase \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\r\n\t\t\t\tcase \"clamptoedge\": return TextureWrap.ClampToEdge;\r\n\t\t\t\tcase \"repeat\": return TextureWrap.Repeat;\r\n\t\t\t\tdefault: throw new Error(\"Unknown texture wrap \" + text);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn Texture;\r\n\t}());\r\n\tspine.Texture = Texture;\r\n\tvar TextureFilter;\r\n\t(function (TextureFilter) {\r\n\t\tTextureFilter[TextureFilter[\"Nearest\"] = 9728] = \"Nearest\";\r\n\t\tTextureFilter[TextureFilter[\"Linear\"] = 9729] = \"Linear\";\r\n\t\tTextureFilter[TextureFilter[\"MipMap\"] = 9987] = \"MipMap\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapNearestNearest\"] = 9984] = \"MipMapNearestNearest\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapLinearNearest\"] = 9985] = \"MipMapLinearNearest\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapNearestLinear\"] = 9986] = \"MipMapNearestLinear\";\r\n\t\tTextureFilter[TextureFilter[\"MipMapLinearLinear\"] = 9987] = \"MipMapLinearLinear\";\r\n\t})(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {}));\r\n\tvar TextureWrap;\r\n\t(function (TextureWrap) {\r\n\t\tTextureWrap[TextureWrap[\"MirroredRepeat\"] = 33648] = \"MirroredRepeat\";\r\n\t\tTextureWrap[TextureWrap[\"ClampToEdge\"] = 33071] = \"ClampToEdge\";\r\n\t\tTextureWrap[TextureWrap[\"Repeat\"] = 10497] = \"Repeat\";\r\n\t})(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {}));\r\n\tvar TextureRegion = (function () {\r\n\t\tfunction TextureRegion() {\r\n\t\t\tthis.u = 0;\r\n\t\t\tthis.v = 0;\r\n\t\t\tthis.u2 = 0;\r\n\t\t\tthis.v2 = 0;\r\n\t\t\tthis.width = 0;\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.rotate = false;\r\n\t\t\tthis.offsetX = 0;\r\n\t\t\tthis.offsetY = 0;\r\n\t\t\tthis.originalWidth = 0;\r\n\t\t\tthis.originalHeight = 0;\r\n\t\t}\r\n\t\treturn TextureRegion;\r\n\t}());\r\n\tspine.TextureRegion = TextureRegion;\r\n\tvar FakeTexture = (function (_super) {\r\n\t\t__extends(FakeTexture, _super);\r\n\t\tfunction FakeTexture() {\r\n\t\t\treturn _super !== null && _super.apply(this, arguments) || this;\r\n\t\t}\r\n\t\tFakeTexture.prototype.setFilters = function (minFilter, magFilter) { };\r\n\t\tFakeTexture.prototype.setWraps = function (uWrap, vWrap) { };\r\n\t\tFakeTexture.prototype.dispose = function () { };\r\n\t\treturn FakeTexture;\r\n\t}(Texture));\r\n\tspine.FakeTexture = FakeTexture;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar TextureAtlas = (function () {\r\n\t\tfunction TextureAtlas(atlasText, textureLoader) {\r\n\t\t\tthis.pages = new Array();\r\n\t\t\tthis.regions = new Array();\r\n\t\t\tthis.load(atlasText, textureLoader);\r\n\t\t}\r\n\t\tTextureAtlas.prototype.load = function (atlasText, textureLoader) {\r\n\t\t\tif (textureLoader == null)\r\n\t\t\t\tthrow new Error(\"textureLoader cannot be null.\");\r\n\t\t\tvar reader = new TextureAtlasReader(atlasText);\r\n\t\t\tvar tuple = new Array(4);\r\n\t\t\tvar page = null;\r\n\t\t\twhile (true) {\r\n\t\t\t\tvar line = reader.readLine();\r\n\t\t\t\tif (line == null)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tline = line.trim();\r\n\t\t\t\tif (line.length == 0)\r\n\t\t\t\t\tpage = null;\r\n\t\t\t\telse if (!page) {\r\n\t\t\t\t\tpage = new TextureAtlasPage();\r\n\t\t\t\t\tpage.name = line;\r\n\t\t\t\t\tif (reader.readTuple(tuple) == 2) {\r\n\t\t\t\t\t\tpage.width = parseInt(tuple[0]);\r\n\t\t\t\t\t\tpage.height = parseInt(tuple[1]);\r\n\t\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tpage.minFilter = spine.Texture.filterFromString(tuple[0]);\r\n\t\t\t\t\tpage.magFilter = spine.Texture.filterFromString(tuple[1]);\r\n\t\t\t\t\tvar direction = reader.readValue();\r\n\t\t\t\t\tpage.uWrap = spine.TextureWrap.ClampToEdge;\r\n\t\t\t\t\tpage.vWrap = spine.TextureWrap.ClampToEdge;\r\n\t\t\t\t\tif (direction == \"x\")\r\n\t\t\t\t\t\tpage.uWrap = spine.TextureWrap.Repeat;\r\n\t\t\t\t\telse if (direction == \"y\")\r\n\t\t\t\t\t\tpage.vWrap = spine.TextureWrap.Repeat;\r\n\t\t\t\t\telse if (direction == \"xy\")\r\n\t\t\t\t\t\tpage.uWrap = page.vWrap = spine.TextureWrap.Repeat;\r\n\t\t\t\t\tpage.texture = textureLoader(line);\r\n\t\t\t\t\tpage.texture.setFilters(page.minFilter, page.magFilter);\r\n\t\t\t\t\tpage.texture.setWraps(page.uWrap, page.vWrap);\r\n\t\t\t\t\tpage.width = page.texture.getImage().width;\r\n\t\t\t\t\tpage.height = page.texture.getImage().height;\r\n\t\t\t\t\tthis.pages.push(page);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar region = new TextureAtlasRegion();\r\n\t\t\t\t\tregion.name = line;\r\n\t\t\t\t\tregion.page = page;\r\n\t\t\t\t\tregion.rotate = reader.readValue() == \"true\";\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tvar x = parseInt(tuple[0]);\r\n\t\t\t\t\tvar y = parseInt(tuple[1]);\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tvar width = parseInt(tuple[0]);\r\n\t\t\t\t\tvar height = parseInt(tuple[1]);\r\n\t\t\t\t\tregion.u = x / page.width;\r\n\t\t\t\t\tregion.v = y / page.height;\r\n\t\t\t\t\tif (region.rotate) {\r\n\t\t\t\t\t\tregion.u2 = (x + height) / page.width;\r\n\t\t\t\t\t\tregion.v2 = (y + width) / page.height;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tregion.u2 = (x + width) / page.width;\r\n\t\t\t\t\t\tregion.v2 = (y + height) / page.height;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tregion.x = x;\r\n\t\t\t\t\tregion.y = y;\r\n\t\t\t\t\tregion.width = Math.abs(width);\r\n\t\t\t\t\tregion.height = Math.abs(height);\r\n\t\t\t\t\tif (reader.readTuple(tuple) == 4) {\r\n\t\t\t\t\t\tif (reader.readTuple(tuple) == 4) {\r\n\t\t\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tregion.originalWidth = parseInt(tuple[0]);\r\n\t\t\t\t\tregion.originalHeight = parseInt(tuple[1]);\r\n\t\t\t\t\treader.readTuple(tuple);\r\n\t\t\t\t\tregion.offsetX = parseInt(tuple[0]);\r\n\t\t\t\t\tregion.offsetY = parseInt(tuple[1]);\r\n\t\t\t\t\tregion.index = parseInt(reader.readValue());\r\n\t\t\t\t\tregion.texture = page.texture;\r\n\t\t\t\t\tthis.regions.push(region);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tTextureAtlas.prototype.findRegion = function (name) {\r\n\t\t\tfor (var i = 0; i < this.regions.length; i++) {\r\n\t\t\t\tif (this.regions[i].name == name) {\r\n\t\t\t\t\treturn this.regions[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\t\tTextureAtlas.prototype.dispose = function () {\r\n\t\t\tfor (var i = 0; i < this.pages.length; i++) {\r\n\t\t\t\tthis.pages[i].texture.dispose();\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn TextureAtlas;\r\n\t}());\r\n\tspine.TextureAtlas = TextureAtlas;\r\n\tvar TextureAtlasReader = (function () {\r\n\t\tfunction TextureAtlasReader(text) {\r\n\t\t\tthis.index = 0;\r\n\t\t\tthis.lines = text.split(/\\r\\n|\\r|\\n/);\r\n\t\t}\r\n\t\tTextureAtlasReader.prototype.readLine = function () {\r\n\t\t\tif (this.index >= this.lines.length)\r\n\t\t\t\treturn null;\r\n\t\t\treturn this.lines[this.index++];\r\n\t\t};\r\n\t\tTextureAtlasReader.prototype.readValue = function () {\r\n\t\t\tvar line = this.readLine();\r\n\t\t\tvar colon = line.indexOf(\":\");\r\n\t\t\tif (colon == -1)\r\n\t\t\t\tthrow new Error(\"Invalid line: \" + line);\r\n\t\t\treturn line.substring(colon + 1).trim();\r\n\t\t};\r\n\t\tTextureAtlasReader.prototype.readTuple = function (tuple) {\r\n\t\t\tvar line = this.readLine();\r\n\t\t\tvar colon = line.indexOf(\":\");\r\n\t\t\tif (colon == -1)\r\n\t\t\t\tthrow new Error(\"Invalid line: \" + line);\r\n\t\t\tvar i = 0, lastMatch = colon + 1;\r\n\t\t\tfor (; i < 3; i++) {\r\n\t\t\t\tvar comma = line.indexOf(\",\", lastMatch);\r\n\t\t\t\tif (comma == -1)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\ttuple[i] = line.substr(lastMatch, comma - lastMatch).trim();\r\n\t\t\t\tlastMatch = comma + 1;\r\n\t\t\t}\r\n\t\t\ttuple[i] = line.substring(lastMatch).trim();\r\n\t\t\treturn i + 1;\r\n\t\t};\r\n\t\treturn TextureAtlasReader;\r\n\t}());\r\n\tvar TextureAtlasPage = (function () {\r\n\t\tfunction TextureAtlasPage() {\r\n\t\t}\r\n\t\treturn TextureAtlasPage;\r\n\t}());\r\n\tspine.TextureAtlasPage = TextureAtlasPage;\r\n\tvar TextureAtlasRegion = (function (_super) {\r\n\t\t__extends(TextureAtlasRegion, _super);\r\n\t\tfunction TextureAtlasRegion() {\r\n\t\t\treturn _super !== null && _super.apply(this, arguments) || this;\r\n\t\t}\r\n\t\treturn TextureAtlasRegion;\r\n\t}(spine.TextureRegion));\r\n\tspine.TextureAtlasRegion = TextureAtlasRegion;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar TransformConstraint = (function () {\r\n\t\tfunction TransformConstraint(data, skeleton) {\r\n\t\t\tthis.rotateMix = 0;\r\n\t\t\tthis.translateMix = 0;\r\n\t\t\tthis.scaleMix = 0;\r\n\t\t\tthis.shearMix = 0;\r\n\t\t\tthis.temp = new spine.Vector2();\r\n\t\t\tif (data == null)\r\n\t\t\t\tthrow new Error(\"data cannot be null.\");\r\n\t\t\tif (skeleton == null)\r\n\t\t\t\tthrow new Error(\"skeleton cannot be null.\");\r\n\t\t\tthis.data = data;\r\n\t\t\tthis.rotateMix = data.rotateMix;\r\n\t\t\tthis.translateMix = data.translateMix;\r\n\t\t\tthis.scaleMix = data.scaleMix;\r\n\t\t\tthis.shearMix = data.shearMix;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tfor (var i = 0; i < data.bones.length; i++)\r\n\t\t\t\tthis.bones.push(skeleton.findBone(data.bones[i].name));\r\n\t\t\tthis.target = skeleton.findBone(data.target.name);\r\n\t\t}\r\n\t\tTransformConstraint.prototype.apply = function () {\r\n\t\t\tthis.update();\r\n\t\t};\r\n\t\tTransformConstraint.prototype.update = function () {\r\n\t\t\tif (this.data.local) {\r\n\t\t\t\tif (this.data.relative)\r\n\t\t\t\t\tthis.applyRelativeLocal();\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.applyAbsoluteLocal();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.data.relative)\r\n\t\t\t\t\tthis.applyRelativeWorld();\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.applyAbsoluteWorld();\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyAbsoluteWorld = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar ta = target.a, tb = target.b, tc = target.c, td = target.d;\r\n\t\t\tvar degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n\t\t\tvar offsetRotation = this.data.offsetRotation * degRadReflect;\r\n\t\t\tvar offsetShearY = this.data.offsetShearY * degRadReflect;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tvar modified = false;\r\n\t\t\t\tif (rotateMix != 0) {\r\n\t\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\t\t\tvar r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr *= rotateMix;\r\n\t\t\t\t\tvar cos = Math.cos(r), sin = Math.sin(r);\r\n\t\t\t\t\tbone.a = cos * a - sin * c;\r\n\t\t\t\t\tbone.b = cos * b - sin * d;\r\n\t\t\t\t\tbone.c = sin * a + cos * c;\r\n\t\t\t\t\tbone.d = sin * b + cos * d;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tvar temp = this.temp;\r\n\t\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n\t\t\t\t\tbone.worldX += (temp.x - bone.worldX) * translateMix;\r\n\t\t\t\t\tbone.worldY += (temp.y - bone.worldY) * translateMix;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (scaleMix > 0) {\r\n\t\t\t\t\tvar s = Math.sqrt(bone.a * bone.a + bone.c * bone.c);\r\n\t\t\t\t\tvar ts = Math.sqrt(ta * ta + tc * tc);\r\n\t\t\t\t\tif (s > 0.00001)\r\n\t\t\t\t\t\ts = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\r\n\t\t\t\t\tbone.a *= s;\r\n\t\t\t\t\tbone.c *= s;\r\n\t\t\t\t\ts = Math.sqrt(bone.b * bone.b + bone.d * bone.d);\r\n\t\t\t\t\tts = Math.sqrt(tb * tb + td * td);\r\n\t\t\t\t\tif (s > 0.00001)\r\n\t\t\t\t\t\ts = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\r\n\t\t\t\t\tbone.b *= s;\r\n\t\t\t\t\tbone.d *= s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (shearMix > 0) {\r\n\t\t\t\t\tvar b = bone.b, d = bone.d;\r\n\t\t\t\t\tvar by = Math.atan2(d, b);\r\n\t\t\t\t\tvar r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a));\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr = by + (r + offsetShearY) * shearMix;\r\n\t\t\t\t\tvar s = Math.sqrt(b * b + d * d);\r\n\t\t\t\t\tbone.b = Math.cos(r) * s;\r\n\t\t\t\t\tbone.d = Math.sin(r) * s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (modified)\r\n\t\t\t\t\tbone.appliedValid = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyRelativeWorld = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tvar ta = target.a, tb = target.b, tc = target.c, td = target.d;\r\n\t\t\tvar degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n\t\t\tvar offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tvar modified = false;\r\n\t\t\t\tif (rotateMix != 0) {\r\n\t\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\t\t\tvar r = Math.atan2(tc, ta) + offsetRotation;\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tr *= rotateMix;\r\n\t\t\t\t\tvar cos = Math.cos(r), sin = Math.sin(r);\r\n\t\t\t\t\tbone.a = cos * a - sin * c;\r\n\t\t\t\t\tbone.b = cos * b - sin * d;\r\n\t\t\t\t\tbone.c = sin * a + cos * c;\r\n\t\t\t\t\tbone.d = sin * b + cos * d;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tvar temp = this.temp;\r\n\t\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n\t\t\t\t\tbone.worldX += temp.x * translateMix;\r\n\t\t\t\t\tbone.worldY += temp.y * translateMix;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (scaleMix > 0) {\r\n\t\t\t\t\tvar s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;\r\n\t\t\t\t\tbone.a *= s;\r\n\t\t\t\t\tbone.c *= s;\r\n\t\t\t\t\ts = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;\r\n\t\t\t\t\tbone.b *= s;\r\n\t\t\t\t\tbone.d *= s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (shearMix > 0) {\r\n\t\t\t\t\tvar r = Math.atan2(td, tb) - Math.atan2(tc, ta);\r\n\t\t\t\t\tif (r > spine.MathUtils.PI)\r\n\t\t\t\t\t\tr -= spine.MathUtils.PI2;\r\n\t\t\t\t\telse if (r < -spine.MathUtils.PI)\r\n\t\t\t\t\t\tr += spine.MathUtils.PI2;\r\n\t\t\t\t\tvar b = bone.b, d = bone.d;\r\n\t\t\t\t\tr = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix;\r\n\t\t\t\t\tvar s = Math.sqrt(b * b + d * d);\r\n\t\t\t\t\tbone.b = Math.cos(r) * s;\r\n\t\t\t\t\tbone.d = Math.sin(r) * s;\r\n\t\t\t\t\tmodified = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (modified)\r\n\t\t\t\t\tbone.appliedValid = false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyAbsoluteLocal = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tif (!target.appliedValid)\r\n\t\t\t\ttarget.updateAppliedTransform();\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (!bone.appliedValid)\r\n\t\t\t\t\tbone.updateAppliedTransform();\r\n\t\t\t\tvar rotation = bone.arotation;\r\n\t\t\t\tif (rotateMix != 0) {\r\n\t\t\t\t\tvar r = target.arotation - rotation + this.data.offsetRotation;\r\n\t\t\t\t\tr -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n\t\t\t\t\trotation += r * rotateMix;\r\n\t\t\t\t}\r\n\t\t\t\tvar x = bone.ax, y = bone.ay;\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tx += (target.ax - x + this.data.offsetX) * translateMix;\r\n\t\t\t\t\ty += (target.ay - y + this.data.offsetY) * translateMix;\r\n\t\t\t\t}\r\n\t\t\t\tvar scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n\t\t\t\tif (scaleMix != 0) {\r\n\t\t\t\t\tif (scaleX > 0.00001)\r\n\t\t\t\t\t\tscaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;\r\n\t\t\t\t\tif (scaleY > 0.00001)\r\n\t\t\t\t\t\tscaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;\r\n\t\t\t\t}\r\n\t\t\t\tvar shearY = bone.ashearY;\r\n\t\t\t\tif (shearMix != 0) {\r\n\t\t\t\t\tvar r = target.ashearY - shearY + this.data.offsetShearY;\r\n\t\t\t\t\tr -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n\t\t\t\t\tbone.shearY += r * shearMix;\r\n\t\t\t\t}\r\n\t\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.applyRelativeLocal = function () {\r\n\t\t\tvar rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n\t\t\tvar target = this.target;\r\n\t\t\tif (!target.appliedValid)\r\n\t\t\t\ttarget.updateAppliedTransform();\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\tvar bone = bones[i];\r\n\t\t\t\tif (!bone.appliedValid)\r\n\t\t\t\t\tbone.updateAppliedTransform();\r\n\t\t\t\tvar rotation = bone.arotation;\r\n\t\t\t\tif (rotateMix != 0)\r\n\t\t\t\t\trotation += (target.arotation + this.data.offsetRotation) * rotateMix;\r\n\t\t\t\tvar x = bone.ax, y = bone.ay;\r\n\t\t\t\tif (translateMix != 0) {\r\n\t\t\t\t\tx += (target.ax + this.data.offsetX) * translateMix;\r\n\t\t\t\t\ty += (target.ay + this.data.offsetY) * translateMix;\r\n\t\t\t\t}\r\n\t\t\t\tvar scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n\t\t\t\tif (scaleMix != 0) {\r\n\t\t\t\t\tif (scaleX > 0.00001)\r\n\t\t\t\t\t\tscaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;\r\n\t\t\t\t\tif (scaleY > 0.00001)\r\n\t\t\t\t\t\tscaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;\r\n\t\t\t\t}\r\n\t\t\t\tvar shearY = bone.ashearY;\r\n\t\t\t\tif (shearMix != 0)\r\n\t\t\t\t\tshearY += (target.ashearY + this.data.offsetShearY) * shearMix;\r\n\t\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n\t\t\t}\r\n\t\t};\r\n\t\tTransformConstraint.prototype.getOrder = function () {\r\n\t\t\treturn this.data.order;\r\n\t\t};\r\n\t\treturn TransformConstraint;\r\n\t}());\r\n\tspine.TransformConstraint = TransformConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar TransformConstraintData = (function () {\r\n\t\tfunction TransformConstraintData(name) {\r\n\t\t\tthis.order = 0;\r\n\t\t\tthis.bones = new Array();\r\n\t\t\tthis.rotateMix = 0;\r\n\t\t\tthis.translateMix = 0;\r\n\t\t\tthis.scaleMix = 0;\r\n\t\t\tthis.shearMix = 0;\r\n\t\t\tthis.offsetRotation = 0;\r\n\t\t\tthis.offsetX = 0;\r\n\t\t\tthis.offsetY = 0;\r\n\t\t\tthis.offsetScaleX = 0;\r\n\t\t\tthis.offsetScaleY = 0;\r\n\t\t\tthis.offsetShearY = 0;\r\n\t\t\tthis.relative = false;\r\n\t\t\tthis.local = false;\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn TransformConstraintData;\r\n\t}());\r\n\tspine.TransformConstraintData = TransformConstraintData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar Triangulator = (function () {\r\n\t\tfunction Triangulator() {\r\n\t\t\tthis.convexPolygons = new Array();\r\n\t\t\tthis.convexPolygonsIndices = new Array();\r\n\t\t\tthis.indicesArray = new Array();\r\n\t\t\tthis.isConcaveArray = new Array();\r\n\t\t\tthis.triangles = new Array();\r\n\t\t\tthis.polygonPool = new spine.Pool(function () {\r\n\t\t\t\treturn new Array();\r\n\t\t\t});\r\n\t\t\tthis.polygonIndicesPool = new spine.Pool(function () {\r\n\t\t\t\treturn new Array();\r\n\t\t\t});\r\n\t\t}\r\n\t\tTriangulator.prototype.triangulate = function (verticesArray) {\r\n\t\t\tvar vertices = verticesArray;\r\n\t\t\tvar vertexCount = verticesArray.length >> 1;\r\n\t\t\tvar indices = this.indicesArray;\r\n\t\t\tindices.length = 0;\r\n\t\t\tfor (var i = 0; i < vertexCount; i++)\r\n\t\t\t\tindices[i] = i;\r\n\t\t\tvar isConcave = this.isConcaveArray;\r\n\t\t\tisConcave.length = 0;\r\n\t\t\tfor (var i = 0, n = vertexCount; i < n; ++i)\r\n\t\t\t\tisConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);\r\n\t\t\tvar triangles = this.triangles;\r\n\t\t\ttriangles.length = 0;\r\n\t\t\twhile (vertexCount > 3) {\r\n\t\t\t\tvar previous = vertexCount - 1, i = 0, next = 1;\r\n\t\t\t\twhile (true) {\r\n\t\t\t\t\touter: if (!isConcave[i]) {\r\n\t\t\t\t\t\tvar p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;\r\n\t\t\t\t\t\tvar p1x = vertices[p1], p1y = vertices[p1 + 1];\r\n\t\t\t\t\t\tvar p2x = vertices[p2], p2y = vertices[p2 + 1];\r\n\t\t\t\t\t\tvar p3x = vertices[p3], p3y = vertices[p3 + 1];\r\n\t\t\t\t\t\tfor (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {\r\n\t\t\t\t\t\t\tif (!isConcave[ii])\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tvar v = indices[ii] << 1;\r\n\t\t\t\t\t\t\tvar vx = vertices[v], vy = vertices[v + 1];\r\n\t\t\t\t\t\t\tif (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {\r\n\t\t\t\t\t\t\t\tif (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {\r\n\t\t\t\t\t\t\t\t\tif (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy))\r\n\t\t\t\t\t\t\t\t\t\tbreak outer;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (next == 0) {\r\n\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t\tif (!isConcave[i])\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\ti--;\r\n\t\t\t\t\t\t} while (i > 0);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tprevious = i;\r\n\t\t\t\t\ti = next;\r\n\t\t\t\t\tnext = (next + 1) % vertexCount;\r\n\t\t\t\t}\r\n\t\t\t\ttriangles.push(indices[(vertexCount + i - 1) % vertexCount]);\r\n\t\t\t\ttriangles.push(indices[i]);\r\n\t\t\t\ttriangles.push(indices[(i + 1) % vertexCount]);\r\n\t\t\t\tindices.splice(i, 1);\r\n\t\t\t\tisConcave.splice(i, 1);\r\n\t\t\t\tvertexCount--;\r\n\t\t\t\tvar previousIndex = (vertexCount + i - 1) % vertexCount;\r\n\t\t\t\tvar nextIndex = i == vertexCount ? 0 : i;\r\n\t\t\t\tisConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);\r\n\t\t\t\tisConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);\r\n\t\t\t}\r\n\t\t\tif (vertexCount == 3) {\r\n\t\t\t\ttriangles.push(indices[2]);\r\n\t\t\t\ttriangles.push(indices[0]);\r\n\t\t\t\ttriangles.push(indices[1]);\r\n\t\t\t}\r\n\t\t\treturn triangles;\r\n\t\t};\r\n\t\tTriangulator.prototype.decompose = function (verticesArray, triangles) {\r\n\t\t\tvar vertices = verticesArray;\r\n\t\t\tvar convexPolygons = this.convexPolygons;\r\n\t\t\tthis.polygonPool.freeAll(convexPolygons);\r\n\t\t\tconvexPolygons.length = 0;\r\n\t\t\tvar convexPolygonsIndices = this.convexPolygonsIndices;\r\n\t\t\tthis.polygonIndicesPool.freeAll(convexPolygonsIndices);\r\n\t\t\tconvexPolygonsIndices.length = 0;\r\n\t\t\tvar polygonIndices = this.polygonIndicesPool.obtain();\r\n\t\t\tpolygonIndices.length = 0;\r\n\t\t\tvar polygon = this.polygonPool.obtain();\r\n\t\t\tpolygon.length = 0;\r\n\t\t\tvar fanBaseIndex = -1, lastWinding = 0;\r\n\t\t\tfor (var i = 0, n = triangles.length; i < n; i += 3) {\r\n\t\t\t\tvar t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;\r\n\t\t\t\tvar x1 = vertices[t1], y1 = vertices[t1 + 1];\r\n\t\t\t\tvar x2 = vertices[t2], y2 = vertices[t2 + 1];\r\n\t\t\t\tvar x3 = vertices[t3], y3 = vertices[t3 + 1];\r\n\t\t\t\tvar merged = false;\r\n\t\t\t\tif (fanBaseIndex == t1) {\r\n\t\t\t\t\tvar o = polygon.length - 4;\r\n\t\t\t\t\tvar winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);\r\n\t\t\t\t\tvar winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);\r\n\t\t\t\t\tif (winding1 == lastWinding && winding2 == lastWinding) {\r\n\t\t\t\t\t\tpolygon.push(x3);\r\n\t\t\t\t\t\tpolygon.push(y3);\r\n\t\t\t\t\t\tpolygonIndices.push(t3);\r\n\t\t\t\t\t\tmerged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (!merged) {\r\n\t\t\t\t\tif (polygon.length > 0) {\r\n\t\t\t\t\t\tconvexPolygons.push(polygon);\r\n\t\t\t\t\t\tconvexPolygonsIndices.push(polygonIndices);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.polygonPool.free(polygon);\r\n\t\t\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpolygon = this.polygonPool.obtain();\r\n\t\t\t\t\tpolygon.length = 0;\r\n\t\t\t\t\tpolygon.push(x1);\r\n\t\t\t\t\tpolygon.push(y1);\r\n\t\t\t\t\tpolygon.push(x2);\r\n\t\t\t\t\tpolygon.push(y2);\r\n\t\t\t\t\tpolygon.push(x3);\r\n\t\t\t\t\tpolygon.push(y3);\r\n\t\t\t\t\tpolygonIndices = this.polygonIndicesPool.obtain();\r\n\t\t\t\t\tpolygonIndices.length = 0;\r\n\t\t\t\t\tpolygonIndices.push(t1);\r\n\t\t\t\t\tpolygonIndices.push(t2);\r\n\t\t\t\t\tpolygonIndices.push(t3);\r\n\t\t\t\t\tlastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);\r\n\t\t\t\t\tfanBaseIndex = t1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (polygon.length > 0) {\r\n\t\t\t\tconvexPolygons.push(polygon);\r\n\t\t\t\tconvexPolygonsIndices.push(polygonIndices);\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = convexPolygons.length; i < n; i++) {\r\n\t\t\t\tpolygonIndices = convexPolygonsIndices[i];\r\n\t\t\t\tif (polygonIndices.length == 0)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tvar firstIndex = polygonIndices[0];\r\n\t\t\t\tvar lastIndex = polygonIndices[polygonIndices.length - 1];\r\n\t\t\t\tpolygon = convexPolygons[i];\r\n\t\t\t\tvar o = polygon.length - 4;\r\n\t\t\t\tvar prevPrevX = polygon[o], prevPrevY = polygon[o + 1];\r\n\t\t\t\tvar prevX = polygon[o + 2], prevY = polygon[o + 3];\r\n\t\t\t\tvar firstX = polygon[0], firstY = polygon[1];\r\n\t\t\t\tvar secondX = polygon[2], secondY = polygon[3];\r\n\t\t\t\tvar winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);\r\n\t\t\t\tfor (var ii = 0; ii < n; ii++) {\r\n\t\t\t\t\tif (ii == i)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tvar otherIndices = convexPolygonsIndices[ii];\r\n\t\t\t\t\tif (otherIndices.length != 3)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tvar otherFirstIndex = otherIndices[0];\r\n\t\t\t\t\tvar otherSecondIndex = otherIndices[1];\r\n\t\t\t\t\tvar otherLastIndex = otherIndices[2];\r\n\t\t\t\t\tvar otherPoly = convexPolygons[ii];\r\n\t\t\t\t\tvar x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];\r\n\t\t\t\t\tif (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tvar winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);\r\n\t\t\t\t\tvar winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);\r\n\t\t\t\t\tif (winding1 == winding && winding2 == winding) {\r\n\t\t\t\t\t\totherPoly.length = 0;\r\n\t\t\t\t\t\totherIndices.length = 0;\r\n\t\t\t\t\t\tpolygon.push(x3);\r\n\t\t\t\t\t\tpolygon.push(y3);\r\n\t\t\t\t\t\tpolygonIndices.push(otherLastIndex);\r\n\t\t\t\t\t\tprevPrevX = prevX;\r\n\t\t\t\t\t\tprevPrevY = prevY;\r\n\t\t\t\t\t\tprevX = x3;\r\n\t\t\t\t\t\tprevY = y3;\r\n\t\t\t\t\t\tii = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var i = convexPolygons.length - 1; i >= 0; i--) {\r\n\t\t\t\tpolygon = convexPolygons[i];\r\n\t\t\t\tif (polygon.length == 0) {\r\n\t\t\t\t\tconvexPolygons.splice(i, 1);\r\n\t\t\t\t\tthis.polygonPool.free(polygon);\r\n\t\t\t\t\tpolygonIndices = convexPolygonsIndices[i];\r\n\t\t\t\t\tconvexPolygonsIndices.splice(i, 1);\r\n\t\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn convexPolygons;\r\n\t\t};\r\n\t\tTriangulator.isConcave = function (index, vertexCount, vertices, indices) {\r\n\t\t\tvar previous = indices[(vertexCount + index - 1) % vertexCount] << 1;\r\n\t\t\tvar current = indices[index] << 1;\r\n\t\t\tvar next = indices[(index + 1) % vertexCount] << 1;\r\n\t\t\treturn !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]);\r\n\t\t};\r\n\t\tTriangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) {\r\n\t\t\treturn p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;\r\n\t\t};\r\n\t\tTriangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) {\r\n\t\t\tvar px = p2x - p1x, py = p2y - p1y;\r\n\t\t\treturn p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;\r\n\t\t};\r\n\t\treturn Triangulator;\r\n\t}());\r\n\tspine.Triangulator = Triangulator;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar IntSet = (function () {\r\n\t\tfunction IntSet() {\r\n\t\t\tthis.array = new Array();\r\n\t\t}\r\n\t\tIntSet.prototype.add = function (value) {\r\n\t\t\tvar contains = this.contains(value);\r\n\t\t\tthis.array[value | 0] = value | 0;\r\n\t\t\treturn !contains;\r\n\t\t};\r\n\t\tIntSet.prototype.contains = function (value) {\r\n\t\t\treturn this.array[value | 0] != undefined;\r\n\t\t};\r\n\t\tIntSet.prototype.remove = function (value) {\r\n\t\t\tthis.array[value | 0] = undefined;\r\n\t\t};\r\n\t\tIntSet.prototype.clear = function () {\r\n\t\t\tthis.array.length = 0;\r\n\t\t};\r\n\t\treturn IntSet;\r\n\t}());\r\n\tspine.IntSet = IntSet;\r\n\tvar Color = (function () {\r\n\t\tfunction Color(r, g, b, a) {\r\n\t\t\tif (r === void 0) { r = 0; }\r\n\t\t\tif (g === void 0) { g = 0; }\r\n\t\t\tif (b === void 0) { b = 0; }\r\n\t\t\tif (a === void 0) { a = 0; }\r\n\t\t\tthis.r = r;\r\n\t\t\tthis.g = g;\r\n\t\t\tthis.b = b;\r\n\t\t\tthis.a = a;\r\n\t\t}\r\n\t\tColor.prototype.set = function (r, g, b, a) {\r\n\t\t\tthis.r = r;\r\n\t\t\tthis.g = g;\r\n\t\t\tthis.b = b;\r\n\t\t\tthis.a = a;\r\n\t\t\tthis.clamp();\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.setFromColor = function (c) {\r\n\t\t\tthis.r = c.r;\r\n\t\t\tthis.g = c.g;\r\n\t\t\tthis.b = c.b;\r\n\t\t\tthis.a = c.a;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.setFromString = function (hex) {\r\n\t\t\thex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\r\n\t\t\tthis.r = parseInt(hex.substr(0, 2), 16) / 255.0;\r\n\t\t\tthis.g = parseInt(hex.substr(2, 2), 16) / 255.0;\r\n\t\t\tthis.b = parseInt(hex.substr(4, 2), 16) / 255.0;\r\n\t\t\tthis.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.add = function (r, g, b, a) {\r\n\t\t\tthis.r += r;\r\n\t\t\tthis.g += g;\r\n\t\t\tthis.b += b;\r\n\t\t\tthis.a += a;\r\n\t\t\tthis.clamp();\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.prototype.clamp = function () {\r\n\t\t\tif (this.r < 0)\r\n\t\t\t\tthis.r = 0;\r\n\t\t\telse if (this.r > 1)\r\n\t\t\t\tthis.r = 1;\r\n\t\t\tif (this.g < 0)\r\n\t\t\t\tthis.g = 0;\r\n\t\t\telse if (this.g > 1)\r\n\t\t\t\tthis.g = 1;\r\n\t\t\tif (this.b < 0)\r\n\t\t\t\tthis.b = 0;\r\n\t\t\telse if (this.b > 1)\r\n\t\t\t\tthis.b = 1;\r\n\t\t\tif (this.a < 0)\r\n\t\t\t\tthis.a = 0;\r\n\t\t\telse if (this.a > 1)\r\n\t\t\t\tthis.a = 1;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tColor.WHITE = new Color(1, 1, 1, 1);\r\n\t\tColor.RED = new Color(1, 0, 0, 1);\r\n\t\tColor.GREEN = new Color(0, 1, 0, 1);\r\n\t\tColor.BLUE = new Color(0, 0, 1, 1);\r\n\t\tColor.MAGENTA = new Color(1, 0, 1, 1);\r\n\t\treturn Color;\r\n\t}());\r\n\tspine.Color = Color;\r\n\tvar MathUtils = (function () {\r\n\t\tfunction MathUtils() {\r\n\t\t}\r\n\t\tMathUtils.clamp = function (value, min, max) {\r\n\t\t\tif (value < min)\r\n\t\t\t\treturn min;\r\n\t\t\tif (value > max)\r\n\t\t\t\treturn max;\r\n\t\t\treturn value;\r\n\t\t};\r\n\t\tMathUtils.cosDeg = function (degrees) {\r\n\t\t\treturn Math.cos(degrees * MathUtils.degRad);\r\n\t\t};\r\n\t\tMathUtils.sinDeg = function (degrees) {\r\n\t\t\treturn Math.sin(degrees * MathUtils.degRad);\r\n\t\t};\r\n\t\tMathUtils.signum = function (value) {\r\n\t\t\treturn value > 0 ? 1 : value < 0 ? -1 : 0;\r\n\t\t};\r\n\t\tMathUtils.toInt = function (x) {\r\n\t\t\treturn x > 0 ? Math.floor(x) : Math.ceil(x);\r\n\t\t};\r\n\t\tMathUtils.cbrt = function (x) {\r\n\t\t\tvar y = Math.pow(Math.abs(x), 1 / 3);\r\n\t\t\treturn x < 0 ? -y : y;\r\n\t\t};\r\n\t\tMathUtils.randomTriangular = function (min, max) {\r\n\t\t\treturn MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\r\n\t\t};\r\n\t\tMathUtils.randomTriangularWith = function (min, max, mode) {\r\n\t\t\tvar u = Math.random();\r\n\t\t\tvar d = max - min;\r\n\t\t\tif (u <= (mode - min) / d)\r\n\t\t\t\treturn min + Math.sqrt(u * d * (mode - min));\r\n\t\t\treturn max - Math.sqrt((1 - u) * d * (max - mode));\r\n\t\t};\r\n\t\tMathUtils.PI = 3.1415927;\r\n\t\tMathUtils.PI2 = MathUtils.PI * 2;\r\n\t\tMathUtils.radiansToDegrees = 180 / MathUtils.PI;\r\n\t\tMathUtils.radDeg = MathUtils.radiansToDegrees;\r\n\t\tMathUtils.degreesToRadians = MathUtils.PI / 180;\r\n\t\tMathUtils.degRad = MathUtils.degreesToRadians;\r\n\t\treturn MathUtils;\r\n\t}());\r\n\tspine.MathUtils = MathUtils;\r\n\tvar Interpolation = (function () {\r\n\t\tfunction Interpolation() {\r\n\t\t}\r\n\t\tInterpolation.prototype.apply = function (start, end, a) {\r\n\t\t\treturn start + (end - start) * this.applyInternal(a);\r\n\t\t};\r\n\t\treturn Interpolation;\r\n\t}());\r\n\tspine.Interpolation = Interpolation;\r\n\tvar Pow = (function (_super) {\r\n\t\t__extends(Pow, _super);\r\n\t\tfunction Pow(power) {\r\n\t\t\tvar _this = _super.call(this) || this;\r\n\t\t\t_this.power = 2;\r\n\t\t\t_this.power = power;\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPow.prototype.applyInternal = function (a) {\r\n\t\t\tif (a <= 0.5)\r\n\t\t\t\treturn Math.pow(a * 2, this.power) / 2;\r\n\t\t\treturn Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;\r\n\t\t};\r\n\t\treturn Pow;\r\n\t}(Interpolation));\r\n\tspine.Pow = Pow;\r\n\tvar PowOut = (function (_super) {\r\n\t\t__extends(PowOut, _super);\r\n\t\tfunction PowOut(power) {\r\n\t\t\treturn _super.call(this, power) || this;\r\n\t\t}\r\n\t\tPowOut.prototype.applyInternal = function (a) {\r\n\t\t\treturn Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;\r\n\t\t};\r\n\t\treturn PowOut;\r\n\t}(Pow));\r\n\tspine.PowOut = PowOut;\r\n\tvar Utils = (function () {\r\n\t\tfunction Utils() {\r\n\t\t}\r\n\t\tUtils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) {\r\n\t\t\tfor (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\r\n\t\t\t\tdest[j] = source[i];\r\n\t\t\t}\r\n\t\t};\r\n\t\tUtils.setArraySize = function (array, size, value) {\r\n\t\t\tif (value === void 0) { value = 0; }\r\n\t\t\tvar oldSize = array.length;\r\n\t\t\tif (oldSize == size)\r\n\t\t\t\treturn array;\r\n\t\t\tarray.length = size;\r\n\t\t\tif (oldSize < size) {\r\n\t\t\t\tfor (var i = oldSize; i < size; i++)\r\n\t\t\t\t\tarray[i] = value;\r\n\t\t\t}\r\n\t\t\treturn array;\r\n\t\t};\r\n\t\tUtils.ensureArrayCapacity = function (array, size, value) {\r\n\t\t\tif (value === void 0) { value = 0; }\r\n\t\t\tif (array.length >= size)\r\n\t\t\t\treturn array;\r\n\t\t\treturn Utils.setArraySize(array, size, value);\r\n\t\t};\r\n\t\tUtils.newArray = function (size, defaultValue) {\r\n\t\t\tvar array = new Array(size);\r\n\t\t\tfor (var i = 0; i < size; i++)\r\n\t\t\t\tarray[i] = defaultValue;\r\n\t\t\treturn array;\r\n\t\t};\r\n\t\tUtils.newFloatArray = function (size) {\r\n\t\t\tif (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n\t\t\t\treturn new Float32Array(size);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar array = new Array(size);\r\n\t\t\t\tfor (var i = 0; i < array.length; i++)\r\n\t\t\t\t\tarray[i] = 0;\r\n\t\t\t\treturn array;\r\n\t\t\t}\r\n\t\t};\r\n\t\tUtils.newShortArray = function (size) {\r\n\t\t\tif (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n\t\t\t\treturn new Int16Array(size);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar array = new Array(size);\r\n\t\t\t\tfor (var i = 0; i < array.length; i++)\r\n\t\t\t\t\tarray[i] = 0;\r\n\t\t\t\treturn array;\r\n\t\t\t}\r\n\t\t};\r\n\t\tUtils.toFloatArray = function (array) {\r\n\t\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\r\n\t\t};\r\n\t\tUtils.toSinglePrecision = function (value) {\r\n\t\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;\r\n\t\t};\r\n\t\tUtils.webkit602BugfixHelper = function (alpha, blend) {\r\n\t\t};\r\n\t\tUtils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\r\n\t\treturn Utils;\r\n\t}());\r\n\tspine.Utils = Utils;\r\n\tvar DebugUtils = (function () {\r\n\t\tfunction DebugUtils() {\r\n\t\t}\r\n\t\tDebugUtils.logBones = function (skeleton) {\r\n\t\t\tfor (var i = 0; i < skeleton.bones.length; i++) {\r\n\t\t\t\tvar bone = skeleton.bones[i];\r\n\t\t\t\tconsole.log(bone.data.name + \", \" + bone.a + \", \" + bone.b + \", \" + bone.c + \", \" + bone.d + \", \" + bone.worldX + \", \" + bone.worldY);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn DebugUtils;\r\n\t}());\r\n\tspine.DebugUtils = DebugUtils;\r\n\tvar Pool = (function () {\r\n\t\tfunction Pool(instantiator) {\r\n\t\t\tthis.items = new Array();\r\n\t\t\tthis.instantiator = instantiator;\r\n\t\t}\r\n\t\tPool.prototype.obtain = function () {\r\n\t\t\treturn this.items.length > 0 ? this.items.pop() : this.instantiator();\r\n\t\t};\r\n\t\tPool.prototype.free = function (item) {\r\n\t\t\tif (item.reset)\r\n\t\t\t\titem.reset();\r\n\t\t\tthis.items.push(item);\r\n\t\t};\r\n\t\tPool.prototype.freeAll = function (items) {\r\n\t\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\t\tif (items[i].reset)\r\n\t\t\t\t\titems[i].reset();\r\n\t\t\t\tthis.items[i] = items[i];\r\n\t\t\t}\r\n\t\t};\r\n\t\tPool.prototype.clear = function () {\r\n\t\t\tthis.items.length = 0;\r\n\t\t};\r\n\t\treturn Pool;\r\n\t}());\r\n\tspine.Pool = Pool;\r\n\tvar Vector2 = (function () {\r\n\t\tfunction Vector2(x, y) {\r\n\t\t\tif (x === void 0) { x = 0; }\r\n\t\t\tif (y === void 0) { y = 0; }\r\n\t\t\tthis.x = x;\r\n\t\t\tthis.y = y;\r\n\t\t}\r\n\t\tVector2.prototype.set = function (x, y) {\r\n\t\t\tthis.x = x;\r\n\t\t\tthis.y = y;\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\tVector2.prototype.length = function () {\r\n\t\t\tvar x = this.x;\r\n\t\t\tvar y = this.y;\r\n\t\t\treturn Math.sqrt(x * x + y * y);\r\n\t\t};\r\n\t\tVector2.prototype.normalize = function () {\r\n\t\t\tvar len = this.length();\r\n\t\t\tif (len != 0) {\r\n\t\t\t\tthis.x /= len;\r\n\t\t\t\tthis.y /= len;\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t};\r\n\t\treturn Vector2;\r\n\t}());\r\n\tspine.Vector2 = Vector2;\r\n\tvar TimeKeeper = (function () {\r\n\t\tfunction TimeKeeper() {\r\n\t\t\tthis.maxDelta = 0.064;\r\n\t\t\tthis.framesPerSecond = 0;\r\n\t\t\tthis.delta = 0;\r\n\t\t\tthis.totalTime = 0;\r\n\t\t\tthis.lastTime = Date.now() / 1000;\r\n\t\t\tthis.frameCount = 0;\r\n\t\t\tthis.frameTime = 0;\r\n\t\t}\r\n\t\tTimeKeeper.prototype.update = function () {\r\n\t\t\tvar now = Date.now() / 1000;\r\n\t\t\tthis.delta = now - this.lastTime;\r\n\t\t\tthis.frameTime += this.delta;\r\n\t\t\tthis.totalTime += this.delta;\r\n\t\t\tif (this.delta > this.maxDelta)\r\n\t\t\t\tthis.delta = this.maxDelta;\r\n\t\t\tthis.lastTime = now;\r\n\t\t\tthis.frameCount++;\r\n\t\t\tif (this.frameTime > 1) {\r\n\t\t\t\tthis.framesPerSecond = this.frameCount / this.frameTime;\r\n\t\t\t\tthis.frameTime = 0;\r\n\t\t\t\tthis.frameCount = 0;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn TimeKeeper;\r\n\t}());\r\n\tspine.TimeKeeper = TimeKeeper;\r\n\tvar WindowedMean = (function () {\r\n\t\tfunction WindowedMean(windowSize) {\r\n\t\t\tif (windowSize === void 0) { windowSize = 32; }\r\n\t\t\tthis.addedValues = 0;\r\n\t\t\tthis.lastValue = 0;\r\n\t\t\tthis.mean = 0;\r\n\t\t\tthis.dirty = true;\r\n\t\t\tthis.values = new Array(windowSize);\r\n\t\t}\r\n\t\tWindowedMean.prototype.hasEnoughData = function () {\r\n\t\t\treturn this.addedValues >= this.values.length;\r\n\t\t};\r\n\t\tWindowedMean.prototype.addValue = function (value) {\r\n\t\t\tif (this.addedValues < this.values.length)\r\n\t\t\t\tthis.addedValues++;\r\n\t\t\tthis.values[this.lastValue++] = value;\r\n\t\t\tif (this.lastValue > this.values.length - 1)\r\n\t\t\t\tthis.lastValue = 0;\r\n\t\t\tthis.dirty = true;\r\n\t\t};\r\n\t\tWindowedMean.prototype.getMean = function () {\r\n\t\t\tif (this.hasEnoughData()) {\r\n\t\t\t\tif (this.dirty) {\r\n\t\t\t\t\tvar mean = 0;\r\n\t\t\t\t\tfor (var i = 0; i < this.values.length; i++) {\r\n\t\t\t\t\t\tmean += this.values[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.mean = mean / this.values.length;\r\n\t\t\t\t\tthis.dirty = false;\r\n\t\t\t\t}\r\n\t\t\t\treturn this.mean;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn WindowedMean;\r\n\t}());\r\n\tspine.WindowedMean = WindowedMean;\r\n})(spine || (spine = {}));\r\n(function () {\r\n\tif (!Math.fround) {\r\n\t\tMath.fround = (function (array) {\r\n\t\t\treturn function (x) {\r\n\t\t\t\treturn array[0] = x, array[0];\r\n\t\t\t};\r\n\t\t})(new Float32Array(1));\r\n\t}\r\n})();\r\nvar spine;\r\n(function (spine) {\r\n\tvar Attachment = (function () {\r\n\t\tfunction Attachment(name) {\r\n\t\t\tif (name == null)\r\n\t\t\t\tthrow new Error(\"name cannot be null.\");\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\treturn Attachment;\r\n\t}());\r\n\tspine.Attachment = Attachment;\r\n\tvar VertexAttachment = (function (_super) {\r\n\t\t__extends(VertexAttachment, _super);\r\n\t\tfunction VertexAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.id = (VertexAttachment.nextID++ & 65535) << 11;\r\n\t\t\t_this.worldVerticesLength = 0;\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tVertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n\t\t\tcount = offset + (count >> 1) * stride;\r\n\t\t\tvar skeleton = slot.bone.skeleton;\r\n\t\t\tvar deformArray = slot.attachmentVertices;\r\n\t\t\tvar vertices = this.vertices;\r\n\t\t\tvar bones = this.bones;\r\n\t\t\tif (bones == null) {\r\n\t\t\t\tif (deformArray.length > 0)\r\n\t\t\t\t\tvertices = deformArray;\r\n\t\t\t\tvar bone = slot.bone;\r\n\t\t\t\tvar x = bone.worldX;\r\n\t\t\t\tvar y = bone.worldY;\r\n\t\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\t\tfor (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\r\n\t\t\t\t\tvar vx = vertices[v_1], vy = vertices[v_1 + 1];\r\n\t\t\t\t\tworldVertices[w] = vx * a + vy * b + x;\r\n\t\t\t\t\tworldVertices[w + 1] = vx * c + vy * d + y;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar v = 0, skip = 0;\r\n\t\t\tfor (var i = 0; i < start; i += 2) {\r\n\t\t\t\tvar n = bones[v];\r\n\t\t\t\tv += n + 1;\r\n\t\t\t\tskip += n;\r\n\t\t\t}\r\n\t\t\tvar skeletonBones = skeleton.bones;\r\n\t\t\tif (deformArray.length == 0) {\r\n\t\t\t\tfor (var w = offset, b = skip * 3; w < count; w += stride) {\r\n\t\t\t\t\tvar wx = 0, wy = 0;\r\n\t\t\t\t\tvar n = bones[v++];\r\n\t\t\t\t\tn += v;\r\n\t\t\t\t\tfor (; v < n; v++, b += 3) {\r\n\t\t\t\t\t\tvar bone = skeletonBones[bones[v]];\r\n\t\t\t\t\t\tvar vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n\t\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\r\n\t\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tworldVertices[w] = wx;\r\n\t\t\t\t\tworldVertices[w + 1] = wy;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvar deform = deformArray;\r\n\t\t\t\tfor (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\r\n\t\t\t\t\tvar wx = 0, wy = 0;\r\n\t\t\t\t\tvar n = bones[v++];\r\n\t\t\t\t\tn += v;\r\n\t\t\t\t\tfor (; v < n; v++, b += 3, f += 2) {\r\n\t\t\t\t\t\tvar bone = skeletonBones[bones[v]];\r\n\t\t\t\t\t\tvar vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n\t\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\r\n\t\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tworldVertices[w] = wx;\r\n\t\t\t\t\tworldVertices[w + 1] = wy;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tVertexAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n\t\t\treturn this == sourceAttachment;\r\n\t\t};\r\n\t\tVertexAttachment.nextID = 0;\r\n\t\treturn VertexAttachment;\r\n\t}(Attachment));\r\n\tspine.VertexAttachment = VertexAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar AttachmentType;\r\n\t(function (AttachmentType) {\r\n\t\tAttachmentType[AttachmentType[\"Region\"] = 0] = \"Region\";\r\n\t\tAttachmentType[AttachmentType[\"BoundingBox\"] = 1] = \"BoundingBox\";\r\n\t\tAttachmentType[AttachmentType[\"Mesh\"] = 2] = \"Mesh\";\r\n\t\tAttachmentType[AttachmentType[\"LinkedMesh\"] = 3] = \"LinkedMesh\";\r\n\t\tAttachmentType[AttachmentType[\"Path\"] = 4] = \"Path\";\r\n\t\tAttachmentType[AttachmentType[\"Point\"] = 5] = \"Point\";\r\n\t})(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar BoundingBoxAttachment = (function (_super) {\r\n\t\t__extends(BoundingBoxAttachment, _super);\r\n\t\tfunction BoundingBoxAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\treturn BoundingBoxAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.BoundingBoxAttachment = BoundingBoxAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar ClippingAttachment = (function (_super) {\r\n\t\t__extends(ClippingAttachment, _super);\r\n\t\tfunction ClippingAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\treturn ClippingAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.ClippingAttachment = ClippingAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar MeshAttachment = (function (_super) {\r\n\t\t__extends(MeshAttachment, _super);\r\n\t\tfunction MeshAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\t_this.inheritDeform = false;\r\n\t\t\t_this.tempColor = new spine.Color(0, 0, 0, 0);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tMeshAttachment.prototype.updateUVs = function () {\r\n\t\t\tvar regionUVs = this.regionUVs;\r\n\t\t\tif (this.uvs == null || this.uvs.length != regionUVs.length)\r\n\t\t\t\tthis.uvs = spine.Utils.newFloatArray(regionUVs.length);\r\n\t\t\tvar uvs = this.uvs;\r\n\t\t\tvar u = 0, v = 0, width = 0, height = 0;\r\n\t\t\tif (this.region instanceof spine.TextureAtlasRegion) {\r\n\t\t\t\tvar region = this.region;\r\n\t\t\t\tvar textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height;\r\n\t\t\t\tif (region.rotate) {\r\n\t\t\t\t\tu = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth;\r\n\t\t\t\t\tv = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight;\r\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\r\n\t\t\t\t\theight = region.originalWidth / textureHeight;\r\n\t\t\t\t\tfor (var i = 0, n = uvs.length; i < n; i += 2) {\r\n\t\t\t\t\t\tuvs[i] = u + regionUVs[i + 1] * width;\r\n\t\t\t\t\t\tuvs[i + 1] = v + height - regionUVs[i] * height;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tu = region.u - region.offsetX / textureWidth;\r\n\t\t\t\tv = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight;\r\n\t\t\t\twidth = region.originalWidth / textureWidth;\r\n\t\t\t\theight = region.originalHeight / textureHeight;\r\n\t\t\t}\r\n\t\t\telse if (this.region == null) {\r\n\t\t\t\tu = v = 0;\r\n\t\t\t\twidth = height = 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tu = this.region.u;\r\n\t\t\t\tv = this.region.v;\r\n\t\t\t\twidth = this.region.u2 - u;\r\n\t\t\t\theight = this.region.v2 - v;\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, n = uvs.length; i < n; i += 2) {\r\n\t\t\t\tuvs[i] = u + regionUVs[i] * width;\r\n\t\t\t\tuvs[i + 1] = v + regionUVs[i + 1] * height;\r\n\t\t\t}\r\n\t\t};\r\n\t\tMeshAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n\t\t\treturn this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);\r\n\t\t};\r\n\t\tMeshAttachment.prototype.getParentMesh = function () {\r\n\t\t\treturn this.parentMesh;\r\n\t\t};\r\n\t\tMeshAttachment.prototype.setParentMesh = function (parentMesh) {\r\n\t\t\tthis.parentMesh = parentMesh;\r\n\t\t\tif (parentMesh != null) {\r\n\t\t\t\tthis.bones = parentMesh.bones;\r\n\t\t\t\tthis.vertices = parentMesh.vertices;\r\n\t\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength;\r\n\t\t\t\tthis.regionUVs = parentMesh.regionUVs;\r\n\t\t\t\tthis.triangles = parentMesh.triangles;\r\n\t\t\t\tthis.hullLength = parentMesh.hullLength;\r\n\t\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength;\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn MeshAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.MeshAttachment = MeshAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PathAttachment = (function (_super) {\r\n\t\t__extends(PathAttachment, _super);\r\n\t\tfunction PathAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.closed = false;\r\n\t\t\t_this.constantSpeed = false;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\treturn PathAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.PathAttachment = PathAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar PointAttachment = (function (_super) {\r\n\t\t__extends(PointAttachment, _super);\r\n\t\tfunction PointAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.color = new spine.Color(0.38, 0.94, 0, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tPointAttachment.prototype.computeWorldPosition = function (bone, point) {\r\n\t\t\tpoint.x = this.x * bone.a + this.y * bone.b + bone.worldX;\r\n\t\t\tpoint.y = this.x * bone.c + this.y * bone.d + bone.worldY;\r\n\t\t\treturn point;\r\n\t\t};\r\n\t\tPointAttachment.prototype.computeWorldRotation = function (bone) {\r\n\t\t\tvar cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation);\r\n\t\t\tvar x = cos * bone.a + sin * bone.b;\r\n\t\t\tvar y = cos * bone.c + sin * bone.d;\r\n\t\t\treturn Math.atan2(y, x) * spine.MathUtils.radDeg;\r\n\t\t};\r\n\t\treturn PointAttachment;\r\n\t}(spine.VertexAttachment));\r\n\tspine.PointAttachment = PointAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar RegionAttachment = (function (_super) {\r\n\t\t__extends(RegionAttachment, _super);\r\n\t\tfunction RegionAttachment(name) {\r\n\t\t\tvar _this = _super.call(this, name) || this;\r\n\t\t\t_this.x = 0;\r\n\t\t\t_this.y = 0;\r\n\t\t\t_this.scaleX = 1;\r\n\t\t\t_this.scaleY = 1;\r\n\t\t\t_this.rotation = 0;\r\n\t\t\t_this.width = 0;\r\n\t\t\t_this.height = 0;\r\n\t\t\t_this.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\t_this.offset = spine.Utils.newFloatArray(8);\r\n\t\t\t_this.uvs = spine.Utils.newFloatArray(8);\r\n\t\t\t_this.tempColor = new spine.Color(1, 1, 1, 1);\r\n\t\t\treturn _this;\r\n\t\t}\r\n\t\tRegionAttachment.prototype.updateOffset = function () {\r\n\t\t\tvar regionScaleX = this.width / this.region.originalWidth * this.scaleX;\r\n\t\t\tvar regionScaleY = this.height / this.region.originalHeight * this.scaleY;\r\n\t\t\tvar localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\r\n\t\t\tvar localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\r\n\t\t\tvar localX2 = localX + this.region.width * regionScaleX;\r\n\t\t\tvar localY2 = localY + this.region.height * regionScaleY;\r\n\t\t\tvar radians = this.rotation * Math.PI / 180;\r\n\t\t\tvar cos = Math.cos(radians);\r\n\t\t\tvar sin = Math.sin(radians);\r\n\t\t\tvar localXCos = localX * cos + this.x;\r\n\t\t\tvar localXSin = localX * sin;\r\n\t\t\tvar localYCos = localY * cos + this.y;\r\n\t\t\tvar localYSin = localY * sin;\r\n\t\t\tvar localX2Cos = localX2 * cos + this.x;\r\n\t\t\tvar localX2Sin = localX2 * sin;\r\n\t\t\tvar localY2Cos = localY2 * cos + this.y;\r\n\t\t\tvar localY2Sin = localY2 * sin;\r\n\t\t\tvar offset = this.offset;\r\n\t\t\toffset[RegionAttachment.OX1] = localXCos - localYSin;\r\n\t\t\toffset[RegionAttachment.OY1] = localYCos + localXSin;\r\n\t\t\toffset[RegionAttachment.OX2] = localXCos - localY2Sin;\r\n\t\t\toffset[RegionAttachment.OY2] = localY2Cos + localXSin;\r\n\t\t\toffset[RegionAttachment.OX3] = localX2Cos - localY2Sin;\r\n\t\t\toffset[RegionAttachment.OY3] = localY2Cos + localX2Sin;\r\n\t\t\toffset[RegionAttachment.OX4] = localX2Cos - localYSin;\r\n\t\t\toffset[RegionAttachment.OY4] = localYCos + localX2Sin;\r\n\t\t};\r\n\t\tRegionAttachment.prototype.setRegion = function (region) {\r\n\t\t\tthis.region = region;\r\n\t\t\tvar uvs = this.uvs;\r\n\t\t\tif (region.rotate) {\r\n\t\t\t\tuvs[2] = region.u;\r\n\t\t\t\tuvs[3] = region.v2;\r\n\t\t\t\tuvs[4] = region.u;\r\n\t\t\t\tuvs[5] = region.v;\r\n\t\t\t\tuvs[6] = region.u2;\r\n\t\t\t\tuvs[7] = region.v;\r\n\t\t\t\tuvs[0] = region.u2;\r\n\t\t\t\tuvs[1] = region.v2;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tuvs[0] = region.u;\r\n\t\t\t\tuvs[1] = region.v2;\r\n\t\t\t\tuvs[2] = region.u;\r\n\t\t\t\tuvs[3] = region.v;\r\n\t\t\t\tuvs[4] = region.u2;\r\n\t\t\t\tuvs[5] = region.v;\r\n\t\t\t\tuvs[6] = region.u2;\r\n\t\t\t\tuvs[7] = region.v2;\r\n\t\t\t}\r\n\t\t};\r\n\t\tRegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {\r\n\t\t\tvar vertexOffset = this.offset;\r\n\t\t\tvar x = bone.worldX, y = bone.worldY;\r\n\t\t\tvar a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n\t\t\tvar offsetX = 0, offsetY = 0;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX1];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY1];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t\toffset += stride;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX2];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY2];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t\toffset += stride;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX3];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY3];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t\toffset += stride;\r\n\t\t\toffsetX = vertexOffset[RegionAttachment.OX4];\r\n\t\t\toffsetY = vertexOffset[RegionAttachment.OY4];\r\n\t\t\tworldVertices[offset] = offsetX * a + offsetY * b + x;\r\n\t\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n\t\t};\r\n\t\tRegionAttachment.OX1 = 0;\r\n\t\tRegionAttachment.OY1 = 1;\r\n\t\tRegionAttachment.OX2 = 2;\r\n\t\tRegionAttachment.OY2 = 3;\r\n\t\tRegionAttachment.OX3 = 4;\r\n\t\tRegionAttachment.OY3 = 5;\r\n\t\tRegionAttachment.OX4 = 6;\r\n\t\tRegionAttachment.OY4 = 7;\r\n\t\tRegionAttachment.X1 = 0;\r\n\t\tRegionAttachment.Y1 = 1;\r\n\t\tRegionAttachment.C1R = 2;\r\n\t\tRegionAttachment.C1G = 3;\r\n\t\tRegionAttachment.C1B = 4;\r\n\t\tRegionAttachment.C1A = 5;\r\n\t\tRegionAttachment.U1 = 6;\r\n\t\tRegionAttachment.V1 = 7;\r\n\t\tRegionAttachment.X2 = 8;\r\n\t\tRegionAttachment.Y2 = 9;\r\n\t\tRegionAttachment.C2R = 10;\r\n\t\tRegionAttachment.C2G = 11;\r\n\t\tRegionAttachment.C2B = 12;\r\n\t\tRegionAttachment.C2A = 13;\r\n\t\tRegionAttachment.U2 = 14;\r\n\t\tRegionAttachment.V2 = 15;\r\n\t\tRegionAttachment.X3 = 16;\r\n\t\tRegionAttachment.Y3 = 17;\r\n\t\tRegionAttachment.C3R = 18;\r\n\t\tRegionAttachment.C3G = 19;\r\n\t\tRegionAttachment.C3B = 20;\r\n\t\tRegionAttachment.C3A = 21;\r\n\t\tRegionAttachment.U3 = 22;\r\n\t\tRegionAttachment.V3 = 23;\r\n\t\tRegionAttachment.X4 = 24;\r\n\t\tRegionAttachment.Y4 = 25;\r\n\t\tRegionAttachment.C4R = 26;\r\n\t\tRegionAttachment.C4G = 27;\r\n\t\tRegionAttachment.C4B = 28;\r\n\t\tRegionAttachment.C4A = 29;\r\n\t\tRegionAttachment.U4 = 30;\r\n\t\tRegionAttachment.V4 = 31;\r\n\t\treturn RegionAttachment;\r\n\t}(spine.Attachment));\r\n\tspine.RegionAttachment = RegionAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar JitterEffect = (function () {\r\n\t\tfunction JitterEffect(jitterX, jitterY) {\r\n\t\t\tthis.jitterX = 0;\r\n\t\t\tthis.jitterY = 0;\r\n\t\t\tthis.jitterX = jitterX;\r\n\t\t\tthis.jitterY = jitterY;\r\n\t\t}\r\n\t\tJitterEffect.prototype.begin = function (skeleton) {\r\n\t\t};\r\n\t\tJitterEffect.prototype.transform = function (position, uv, light, dark) {\r\n\t\t\tposition.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n\t\t\tposition.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n\t\t};\r\n\t\tJitterEffect.prototype.end = function () {\r\n\t\t};\r\n\t\treturn JitterEffect;\r\n\t}());\r\n\tspine.JitterEffect = JitterEffect;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar SwirlEffect = (function () {\r\n\t\tfunction SwirlEffect(radius) {\r\n\t\t\tthis.centerX = 0;\r\n\t\t\tthis.centerY = 0;\r\n\t\t\tthis.radius = 0;\r\n\t\t\tthis.angle = 0;\r\n\t\t\tthis.worldX = 0;\r\n\t\t\tthis.worldY = 0;\r\n\t\t\tthis.radius = radius;\r\n\t\t}\r\n\t\tSwirlEffect.prototype.begin = function (skeleton) {\r\n\t\t\tthis.worldX = skeleton.x + this.centerX;\r\n\t\t\tthis.worldY = skeleton.y + this.centerY;\r\n\t\t};\r\n\t\tSwirlEffect.prototype.transform = function (position, uv, light, dark) {\r\n\t\t\tvar radAngle = this.angle * spine.MathUtils.degreesToRadians;\r\n\t\t\tvar x = position.x - this.worldX;\r\n\t\t\tvar y = position.y - this.worldY;\r\n\t\t\tvar dist = Math.sqrt(x * x + y * y);\r\n\t\t\tif (dist < this.radius) {\r\n\t\t\t\tvar theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);\r\n\t\t\t\tvar cos = Math.cos(theta);\r\n\t\t\t\tvar sin = Math.sin(theta);\r\n\t\t\t\tposition.x = cos * x - sin * y + this.worldX;\r\n\t\t\t\tposition.y = sin * x + cos * y + this.worldY;\r\n\t\t\t}\r\n\t\t};\r\n\t\tSwirlEffect.prototype.end = function () {\r\n\t\t};\r\n\t\tSwirlEffect.interpolation = new spine.PowOut(2);\r\n\t\treturn SwirlEffect;\r\n\t}());\r\n\tspine.SwirlEffect = SwirlEffect;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar AssetManager = (function (_super) {\r\n\t\t\t__extends(AssetManager, _super);\r\n\t\t\tfunction AssetManager(context, pathPrefix) {\r\n\t\t\t\tif (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n\t\t\t\treturn _super.call(this, function (image) {\r\n\t\t\t\t\treturn new spine.webgl.GLTexture(context, image);\r\n\t\t\t\t}, pathPrefix) || this;\r\n\t\t\t}\r\n\t\t\treturn AssetManager;\r\n\t\t}(spine.AssetManager));\r\n\t\twebgl.AssetManager = AssetManager;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar OrthoCamera = (function () {\r\n\t\t\tfunction OrthoCamera(viewportWidth, viewportHeight) {\r\n\t\t\t\tthis.position = new webgl.Vector3(0, 0, 0);\r\n\t\t\t\tthis.direction = new webgl.Vector3(0, 0, -1);\r\n\t\t\t\tthis.up = new webgl.Vector3(0, 1, 0);\r\n\t\t\t\tthis.near = 0;\r\n\t\t\t\tthis.far = 100;\r\n\t\t\t\tthis.zoom = 1;\r\n\t\t\t\tthis.viewportWidth = 0;\r\n\t\t\t\tthis.viewportHeight = 0;\r\n\t\t\t\tthis.projectionView = new webgl.Matrix4();\r\n\t\t\t\tthis.inverseProjectionView = new webgl.Matrix4();\r\n\t\t\t\tthis.projection = new webgl.Matrix4();\r\n\t\t\t\tthis.view = new webgl.Matrix4();\r\n\t\t\t\tthis.tmp = new webgl.Vector3();\r\n\t\t\t\tthis.viewportWidth = viewportWidth;\r\n\t\t\t\tthis.viewportHeight = viewportHeight;\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t\tOrthoCamera.prototype.update = function () {\r\n\t\t\t\tvar projection = this.projection;\r\n\t\t\t\tvar view = this.view;\r\n\t\t\t\tvar projectionView = this.projectionView;\r\n\t\t\t\tvar inverseProjectionView = this.inverseProjectionView;\r\n\t\t\t\tvar zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight;\r\n\t\t\t\tprojection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far);\r\n\t\t\t\tview.lookAt(this.position, this.direction, this.up);\r\n\t\t\t\tprojectionView.set(projection.values);\r\n\t\t\t\tprojectionView.multiply(view);\r\n\t\t\t\tinverseProjectionView.set(projectionView.values).invert();\r\n\t\t\t};\r\n\t\t\tOrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) {\r\n\t\t\t\tvar x = screenCoords.x, y = screenHeight - screenCoords.y - 1;\r\n\t\t\t\tvar tmp = this.tmp;\r\n\t\t\t\ttmp.x = (2 * x) / screenWidth - 1;\r\n\t\t\t\ttmp.y = (2 * y) / screenHeight - 1;\r\n\t\t\t\ttmp.z = (2 * screenCoords.z) - 1;\r\n\t\t\t\ttmp.project(this.inverseProjectionView);\r\n\t\t\t\tscreenCoords.set(tmp.x, tmp.y, tmp.z);\r\n\t\t\t\treturn screenCoords;\r\n\t\t\t};\r\n\t\t\tOrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) {\r\n\t\t\t\tthis.viewportWidth = viewportWidth;\r\n\t\t\t\tthis.viewportHeight = viewportHeight;\r\n\t\t\t};\r\n\t\t\treturn OrthoCamera;\r\n\t\t}());\r\n\t\twebgl.OrthoCamera = OrthoCamera;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar GLTexture = (function (_super) {\r\n\t\t\t__extends(GLTexture, _super);\r\n\t\t\tfunction GLTexture(context, image, useMipMaps) {\r\n\t\t\t\tif (useMipMaps === void 0) { useMipMaps = false; }\r\n\t\t\t\tvar _this = _super.call(this, image) || this;\r\n\t\t\t\t_this.texture = null;\r\n\t\t\t\t_this.boundUnit = 0;\r\n\t\t\t\t_this.useMipMaps = false;\r\n\t\t\t\t_this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\t_this.useMipMaps = useMipMaps;\r\n\t\t\t\t_this.restore();\r\n\t\t\t\t_this.context.addRestorable(_this);\r\n\t\t\t\treturn _this;\r\n\t\t\t}\r\n\t\t\tGLTexture.prototype.setFilters = function (minFilter, magFilter) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.bind();\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.setWraps = function (uWrap, vWrap) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.bind();\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.update = function (useMipMaps) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (!this.texture) {\r\n\t\t\t\t\tthis.texture = this.context.gl.createTexture();\r\n\t\t\t\t}\r\n\t\t\t\tthis.bind();\r\n\t\t\t\tgl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n\t\t\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n\t\t\t\tif (useMipMaps)\r\n\t\t\t\t\tgl.generateMipmap(gl.TEXTURE_2D);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.restore = function () {\r\n\t\t\t\tthis.texture = null;\r\n\t\t\t\tthis.update(this.useMipMaps);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.bind = function (unit) {\r\n\t\t\t\tif (unit === void 0) { unit = 0; }\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.boundUnit = unit;\r\n\t\t\t\tgl.activeTexture(gl.TEXTURE0 + unit);\r\n\t\t\t\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.unbind = function () {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tgl.activeTexture(gl.TEXTURE0 + this.boundUnit);\r\n\t\t\t\tgl.bindTexture(gl.TEXTURE_2D, null);\r\n\t\t\t};\r\n\t\t\tGLTexture.prototype.dispose = function () {\r\n\t\t\t\tthis.context.removeRestorable(this);\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tgl.deleteTexture(this.texture);\r\n\t\t\t};\r\n\t\t\treturn GLTexture;\r\n\t\t}(spine.Texture));\r\n\t\twebgl.GLTexture = GLTexture;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar Input = (function () {\r\n\t\t\tfunction Input(element) {\r\n\t\t\t\tthis.lastX = 0;\r\n\t\t\t\tthis.lastY = 0;\r\n\t\t\t\tthis.buttonDown = false;\r\n\t\t\t\tthis.currTouch = null;\r\n\t\t\t\tthis.touchesPool = new spine.Pool(function () {\r\n\t\t\t\t\treturn new spine.webgl.Touch(0, 0, 0);\r\n\t\t\t\t});\r\n\t\t\t\tthis.listeners = new Array();\r\n\t\t\t\tthis.element = element;\r\n\t\t\t\tthis.setupCallbacks(element);\r\n\t\t\t}\r\n\t\t\tInput.prototype.setupCallbacks = function (element) {\r\n\t\t\t\tvar _this = this;\r\n\t\t\t\tvar mouseDown = function (ev) {\r\n\t\t\t\t\tif (ev instanceof MouseEvent) {\r\n\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\tvar x = ev.clientX - rect.left;\r\n\t\t\t\t\t\tvar y = ev.clientY - rect.top;\r\n\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\tfor (var i = 0; i < listeners.length; i++) {\r\n\t\t\t\t\t\t\tlisteners[i].down(x, y);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t_this.lastX = x;\r\n\t\t\t\t\t\t_this.lastY = y;\r\n\t\t\t\t\t\t_this.buttonDown = true;\r\n\t\t\t\t\t\tdocument.addEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\t\t\tdocument.addEventListener(\"mouseup\", mouseUp);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\tvar mouseMove = function (ev) {\r\n\t\t\t\t\tif (ev instanceof MouseEvent) {\r\n\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\tvar x = ev.clientX - rect.left;\r\n\t\t\t\t\t\tvar y = ev.clientY - rect.top;\r\n\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\tfor (var i = 0; i < listeners.length; i++) {\r\n\t\t\t\t\t\t\tif (_this.buttonDown) {\r\n\t\t\t\t\t\t\t\tlisteners[i].dragged(x, y);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tlisteners[i].moved(x, y);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t_this.lastX = x;\r\n\t\t\t\t\t\t_this.lastY = y;\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\tvar mouseUp = function (ev) {\r\n\t\t\t\t\tif (ev instanceof MouseEvent) {\r\n\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\tvar x = ev.clientX - rect.left;\r\n\t\t\t\t\t\tvar y = ev.clientY - rect.top;\r\n\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\tfor (var i = 0; i < listeners.length; i++) {\r\n\t\t\t\t\t\t\tlisteners[i].up(x, y);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t_this.lastX = x;\r\n\t\t\t\t\t\t_this.lastY = y;\r\n\t\t\t\t\t\t_this.buttonDown = false;\r\n\t\t\t\t\t\tdocument.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\t\t\tdocument.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\telement.addEventListener(\"mousedown\", mouseDown, true);\r\n\t\t\t\telement.addEventListener(\"mousemove\", mouseMove, true);\r\n\t\t\t\telement.addEventListener(\"mouseup\", mouseUp, true);\r\n\t\t\t\telement.addEventListener(\"touchstart\", function (ev) {\r\n\t\t\t\t\tif (_this.currTouch != null)\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tvar touches = ev.changedTouches;\r\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\r\n\t\t\t\t\t\tvar touch = touches[i];\r\n\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\tvar x = touch.clientX - rect.left;\r\n\t\t\t\t\t\tvar y = touch.clientY - rect.top;\r\n\t\t\t\t\t\t_this.currTouch = _this.touchesPool.obtain();\r\n\t\t\t\t\t\t_this.currTouch.identifier = touch.identifier;\r\n\t\t\t\t\t\t_this.currTouch.x = x;\r\n\t\t\t\t\t\t_this.currTouch.y = y;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\tfor (var i_16 = 0; i_16 < listeners.length; i_16++) {\r\n\t\t\t\t\t\tlisteners[i_16].down(_this.currTouch.x, _this.currTouch.y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconsole.log(\"Start \" + _this.currTouch.x + \", \" + _this.currTouch.y);\r\n\t\t\t\t\t_this.lastX = _this.currTouch.x;\r\n\t\t\t\t\t_this.lastY = _this.currTouch.y;\r\n\t\t\t\t\t_this.buttonDown = true;\r\n\t\t\t\t\tev.preventDefault();\r\n\t\t\t\t}, false);\r\n\t\t\t\telement.addEventListener(\"touchend\", function (ev) {\r\n\t\t\t\t\tvar touches = ev.changedTouches;\r\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\r\n\t\t\t\t\t\tvar touch = touches[i];\r\n\t\t\t\t\t\tif (_this.currTouch.identifier === touch.identifier) {\r\n\t\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\t\tvar x = _this.currTouch.x = touch.clientX - rect.left;\r\n\t\t\t\t\t\t\tvar y = _this.currTouch.y = touch.clientY - rect.top;\r\n\t\t\t\t\t\t\t_this.touchesPool.free(_this.currTouch);\r\n\t\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\t\tfor (var i_17 = 0; i_17 < listeners.length; i_17++) {\r\n\t\t\t\t\t\t\t\tlisteners[i_17].up(x, y);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconsole.log(\"End \" + x + \", \" + y);\r\n\t\t\t\t\t\t\t_this.lastX = x;\r\n\t\t\t\t\t\t\t_this.lastY = y;\r\n\t\t\t\t\t\t\t_this.buttonDown = false;\r\n\t\t\t\t\t\t\t_this.currTouch = null;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tev.preventDefault();\r\n\t\t\t\t}, false);\r\n\t\t\t\telement.addEventListener(\"touchcancel\", function (ev) {\r\n\t\t\t\t\tvar touches = ev.changedTouches;\r\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\r\n\t\t\t\t\t\tvar touch = touches[i];\r\n\t\t\t\t\t\tif (_this.currTouch.identifier === touch.identifier) {\r\n\t\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\t\tvar x = _this.currTouch.x = touch.clientX - rect.left;\r\n\t\t\t\t\t\t\tvar y = _this.currTouch.y = touch.clientY - rect.top;\r\n\t\t\t\t\t\t\t_this.touchesPool.free(_this.currTouch);\r\n\t\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\t\tfor (var i_18 = 0; i_18 < listeners.length; i_18++) {\r\n\t\t\t\t\t\t\t\tlisteners[i_18].up(x, y);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconsole.log(\"End \" + x + \", \" + y);\r\n\t\t\t\t\t\t\t_this.lastX = x;\r\n\t\t\t\t\t\t\t_this.lastY = y;\r\n\t\t\t\t\t\t\t_this.buttonDown = false;\r\n\t\t\t\t\t\t\t_this.currTouch = null;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tev.preventDefault();\r\n\t\t\t\t}, false);\r\n\t\t\t\telement.addEventListener(\"touchmove\", function (ev) {\r\n\t\t\t\t\tif (_this.currTouch == null)\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\tvar touches = ev.changedTouches;\r\n\t\t\t\t\tfor (var i = 0; i < touches.length; i++) {\r\n\t\t\t\t\t\tvar touch = touches[i];\r\n\t\t\t\t\t\tif (_this.currTouch.identifier === touch.identifier) {\r\n\t\t\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\t\t\tvar x = touch.clientX - rect.left;\r\n\t\t\t\t\t\t\tvar y = touch.clientY - rect.top;\r\n\t\t\t\t\t\t\tvar listeners = _this.listeners;\r\n\t\t\t\t\t\t\tfor (var i_19 = 0; i_19 < listeners.length; i_19++) {\r\n\t\t\t\t\t\t\t\tlisteners[i_19].dragged(x, y);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconsole.log(\"Drag \" + x + \", \" + y);\r\n\t\t\t\t\t\t\t_this.lastX = _this.currTouch.x = x;\r\n\t\t\t\t\t\t\t_this.lastY = _this.currTouch.y = y;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tev.preventDefault();\r\n\t\t\t\t}, false);\r\n\t\t\t};\r\n\t\t\tInput.prototype.addListener = function (listener) {\r\n\t\t\t\tthis.listeners.push(listener);\r\n\t\t\t};\r\n\t\t\tInput.prototype.removeListener = function (listener) {\r\n\t\t\t\tvar idx = this.listeners.indexOf(listener);\r\n\t\t\t\tif (idx > -1) {\r\n\t\t\t\t\tthis.listeners.splice(idx, 1);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\treturn Input;\r\n\t\t}());\r\n\t\twebgl.Input = Input;\r\n\t\tvar Touch = (function () {\r\n\t\t\tfunction Touch(identifier, x, y) {\r\n\t\t\t\tthis.identifier = identifier;\r\n\t\t\t\tthis.x = x;\r\n\t\t\t\tthis.y = y;\r\n\t\t\t}\r\n\t\t\treturn Touch;\r\n\t\t}());\r\n\t\twebgl.Touch = Touch;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar LoadingScreen = (function () {\r\n\t\t\tfunction LoadingScreen(renderer) {\r\n\t\t\t\tthis.logo = null;\r\n\t\t\t\tthis.spinner = null;\r\n\t\t\t\tthis.angle = 0;\r\n\t\t\t\tthis.fadeOut = 0;\r\n\t\t\t\tthis.timeKeeper = new spine.TimeKeeper();\r\n\t\t\t\tthis.backgroundColor = new spine.Color(0.135, 0.135, 0.135, 1);\r\n\t\t\t\tthis.tempColor = new spine.Color();\r\n\t\t\t\tthis.firstDraw = 0;\r\n\t\t\t\tthis.renderer = renderer;\r\n\t\t\t\tthis.timeKeeper.maxDelta = 9;\r\n\t\t\t\tif (LoadingScreen.logoImg === null) {\r\n\t\t\t\t\tvar isSafari = navigator.userAgent.indexOf(\"Safari\") > -1;\r\n\t\t\t\t\tLoadingScreen.logoImg = new Image();\r\n\t\t\t\t\tLoadingScreen.logoImg.src = LoadingScreen.SPINE_LOGO_DATA;\r\n\t\t\t\t\tif (!isSafari)\r\n\t\t\t\t\t\tLoadingScreen.logoImg.crossOrigin = \"anonymous\";\r\n\t\t\t\t\tLoadingScreen.logoImg.onload = function (ev) {\r\n\t\t\t\t\t\tLoadingScreen.loaded++;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tLoadingScreen.spinnerImg = new Image();\r\n\t\t\t\t\tLoadingScreen.spinnerImg.src = LoadingScreen.SPINNER_DATA;\r\n\t\t\t\t\tif (!isSafari)\r\n\t\t\t\t\t\tLoadingScreen.spinnerImg.crossOrigin = \"anonymous\";\r\n\t\t\t\t\tLoadingScreen.spinnerImg.onload = function (ev) {\r\n\t\t\t\t\t\tLoadingScreen.loaded++;\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tLoadingScreen.prototype.draw = function (complete) {\r\n\t\t\t\tif (complete === void 0) { complete = false; }\r\n\t\t\t\tif (complete && this.fadeOut > LoadingScreen.FADE_SECONDS)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tthis.timeKeeper.update();\r\n\t\t\t\tvar a = Math.abs(Math.sin(this.timeKeeper.totalTime + 0.75));\r\n\t\t\t\tthis.angle -= this.timeKeeper.delta / 1.4 * 360 * (1 + 1.5 * Math.pow(a, 5));\r\n\t\t\t\tvar renderer = this.renderer;\r\n\t\t\t\tvar canvas = renderer.canvas;\r\n\t\t\t\tvar gl = renderer.context.gl;\r\n\t\t\t\trenderer.resize(webgl.ResizeMode.Stretch);\r\n\t\t\t\tvar oldX = renderer.camera.position.x, oldY = renderer.camera.position.y;\r\n\t\t\t\trenderer.camera.position.set(canvas.width / 2, canvas.height / 2, 0);\r\n\t\t\t\trenderer.camera.viewportWidth = canvas.width;\r\n\t\t\t\trenderer.camera.viewportHeight = canvas.height;\r\n\t\t\t\tif (!complete) {\r\n\t\t\t\t\tgl.clearColor(this.backgroundColor.r, this.backgroundColor.g, this.backgroundColor.b, this.backgroundColor.a);\r\n\t\t\t\t\tgl.clear(gl.COLOR_BUFFER_BIT);\r\n\t\t\t\t\tthis.tempColor.a = 1;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.fadeOut += this.timeKeeper.delta * (this.timeKeeper.totalTime < 1 ? 2 : 1);\r\n\t\t\t\t\tif (this.fadeOut > LoadingScreen.FADE_SECONDS) {\r\n\t\t\t\t\t\trenderer.camera.position.set(oldX, oldY, 0);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ta = 1 - this.fadeOut / LoadingScreen.FADE_SECONDS;\r\n\t\t\t\t\tthis.tempColor.setFromColor(this.backgroundColor);\r\n\t\t\t\t\tthis.tempColor.a = 1 - (a - 1) * (a - 1);\r\n\t\t\t\t\trenderer.begin();\r\n\t\t\t\t\trenderer.quad(true, 0, 0, canvas.width, 0, canvas.width, canvas.height, 0, canvas.height, this.tempColor, this.tempColor, this.tempColor, this.tempColor);\r\n\t\t\t\t\trenderer.end();\r\n\t\t\t\t}\r\n\t\t\t\tthis.tempColor.set(1, 1, 1, this.tempColor.a);\r\n\t\t\t\tif (LoadingScreen.loaded != 2)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tif (this.logo === null) {\r\n\t\t\t\t\tthis.logo = new webgl.GLTexture(renderer.context, LoadingScreen.logoImg);\r\n\t\t\t\t\tthis.spinner = new webgl.GLTexture(renderer.context, LoadingScreen.spinnerImg);\r\n\t\t\t\t}\r\n\t\t\t\tthis.logo.update(false);\r\n\t\t\t\tthis.spinner.update(false);\r\n\t\t\t\tvar logoWidth = this.logo.getImage().width;\r\n\t\t\t\tvar logoHeight = this.logo.getImage().height;\r\n\t\t\t\tvar spinnerWidth = this.spinner.getImage().width;\r\n\t\t\t\tvar spinnerHeight = this.spinner.getImage().height;\r\n\t\t\t\trenderer.batcher.setBlendMode(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\r\n\t\t\t\trenderer.begin();\r\n\t\t\t\trenderer.drawTexture(this.logo, (canvas.width - logoWidth) / 2, (canvas.height - logoHeight) / 2, logoWidth, logoHeight, this.tempColor);\r\n\t\t\t\trenderer.drawTextureRotated(this.spinner, (canvas.width - spinnerWidth) / 2, (canvas.height - spinnerHeight) / 2, spinnerWidth, spinnerHeight, spinnerWidth / 2, spinnerHeight / 2, this.angle, this.tempColor);\r\n\t\t\t\trenderer.end();\r\n\t\t\t\trenderer.camera.position.set(oldX, oldY, 0);\r\n\t\t\t};\r\n\t\t\tLoadingScreen.FADE_SECONDS = 1;\r\n\t\t\tLoadingScreen.loaded = 0;\r\n\t\t\tLoadingScreen.spinnerImg = null;\r\n\t\t\tLoadingScreen.logoImg = null;\r\n\t\t\tLoadingScreen.SPINNER_DATA = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAAACXBIWXMAAAsTAAALEwEAmpwYAAALB2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veG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1Q6gBTFk4Rs63zGijrFIg/ylRt7lW3m6kOUagQqiJ5orFONKJtHR0ok/vUAaPKOrbRt2owZZVTJmhRDaKOYW26I1st06yoBFKmk4jD61UCShSfq1OdpTLgUDW6R8t87rqcfZ1BlMr6uq6Vjhf2owGvozDKmG9dyiQCeTSAiwXVdNIP1A2uls7QkYhW/fgzVgIeXVOe6ISFOnSOjjn+uuHsK5F2NM1hLG/jSGfpjoSdjLSJg7Cp7FjaR7ZzXEGcinBJDF8DnZ1Ho7wPrYNadHdINGCLdVMdrU6nMdimqHYgiaF2kn4IXJ8FMJY6iPRxsPqTksbc55ZJP2vHgOnuYwD2tU4k/eycaT891g0F5YDZ7qfQ3SidTAZgG4By4FwHgBtYBpYbZ/l/2EJnC9N0gaQAAAAASUVORK5CYII=\";\r\n\t\t\treturn LoadingScreen;\r\n\t\t}());\r\n\t\twebgl.LoadingScreen = LoadingScreen;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\twebgl.M00 = 0;\r\n\t\twebgl.M01 = 4;\r\n\t\twebgl.M02 = 8;\r\n\t\twebgl.M03 = 12;\r\n\t\twebgl.M10 = 1;\r\n\t\twebgl.M11 = 5;\r\n\t\twebgl.M12 = 9;\r\n\t\twebgl.M13 = 13;\r\n\t\twebgl.M20 = 2;\r\n\t\twebgl.M21 = 6;\r\n\t\twebgl.M22 = 10;\r\n\t\twebgl.M23 = 14;\r\n\t\twebgl.M30 = 3;\r\n\t\twebgl.M31 = 7;\r\n\t\twebgl.M32 = 11;\r\n\t\twebgl.M33 = 15;\r\n\t\tvar Matrix4 = (function () {\r\n\t\t\tfunction Matrix4() {\r\n\t\t\t\tthis.temp = new Float32Array(16);\r\n\t\t\t\tthis.values = new Float32Array(16);\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tv[webgl.M00] = 1;\r\n\t\t\t\tv[webgl.M11] = 1;\r\n\t\t\t\tv[webgl.M22] = 1;\r\n\t\t\t\tv[webgl.M33] = 1;\r\n\t\t\t}\r\n\t\t\tMatrix4.prototype.set = function (values) {\r\n\t\t\t\tthis.values.set(values);\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.transpose = function () {\r\n\t\t\t\tvar t = this.temp;\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tt[webgl.M00] = v[webgl.M00];\r\n\t\t\t\tt[webgl.M01] = v[webgl.M10];\r\n\t\t\t\tt[webgl.M02] = v[webgl.M20];\r\n\t\t\t\tt[webgl.M03] = v[webgl.M30];\r\n\t\t\t\tt[webgl.M10] = v[webgl.M01];\r\n\t\t\t\tt[webgl.M11] = v[webgl.M11];\r\n\t\t\t\tt[webgl.M12] = v[webgl.M21];\r\n\t\t\t\tt[webgl.M13] = v[webgl.M31];\r\n\t\t\t\tt[webgl.M20] = v[webgl.M02];\r\n\t\t\t\tt[webgl.M21] = v[webgl.M12];\r\n\t\t\t\tt[webgl.M22] = v[webgl.M22];\r\n\t\t\t\tt[webgl.M23] = v[webgl.M32];\r\n\t\t\t\tt[webgl.M30] = v[webgl.M03];\r\n\t\t\t\tt[webgl.M31] = v[webgl.M13];\r\n\t\t\t\tt[webgl.M32] = v[webgl.M23];\r\n\t\t\t\tt[webgl.M33] = v[webgl.M33];\r\n\t\t\t\treturn this.set(t);\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.identity = function () {\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tv[webgl.M00] = 1;\r\n\t\t\t\tv[webgl.M01] = 0;\r\n\t\t\t\tv[webgl.M02] = 0;\r\n\t\t\t\tv[webgl.M03] = 0;\r\n\t\t\t\tv[webgl.M10] = 0;\r\n\t\t\t\tv[webgl.M11] = 1;\r\n\t\t\t\tv[webgl.M12] = 0;\r\n\t\t\t\tv[webgl.M13] = 0;\r\n\t\t\t\tv[webgl.M20] = 0;\r\n\t\t\t\tv[webgl.M21] = 0;\r\n\t\t\t\tv[webgl.M22] = 1;\r\n\t\t\t\tv[webgl.M23] = 0;\r\n\t\t\t\tv[webgl.M30] = 0;\r\n\t\t\t\tv[webgl.M31] = 0;\r\n\t\t\t\tv[webgl.M32] = 0;\r\n\t\t\t\tv[webgl.M33] = 1;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.invert = function () {\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tvar t = this.temp;\r\n\t\t\t\tvar l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03]\r\n\t\t\t\t\t+ v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03]\r\n\t\t\t\t\t- v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13]\r\n\t\t\t\t\t+ v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23]\r\n\t\t\t\t\t- v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t\tif (l_det == 0)\r\n\t\t\t\t\tthrow new Error(\"non-invertible matrix\");\r\n\t\t\t\tvar inv_det = 1.0 / l_det;\r\n\t\t\t\tt[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32]\r\n\t\t\t\t\t- v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32]\r\n\t\t\t\t\t+ v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32]\r\n\t\t\t\t\t- v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22]\r\n\t\t\t\t\t+ v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23];\r\n\t\t\t\tt[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32]\r\n\t\t\t\t\t+ v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23];\r\n\t\t\t\tt[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31]\r\n\t\t\t\t\t- v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23];\r\n\t\t\t\tt[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31]\r\n\t\t\t\t\t+ v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22];\r\n\t\t\t\tv[webgl.M00] = t[webgl.M00] * inv_det;\r\n\t\t\t\tv[webgl.M01] = t[webgl.M01] * inv_det;\r\n\t\t\t\tv[webgl.M02] = t[webgl.M02] * inv_det;\r\n\t\t\t\tv[webgl.M03] = t[webgl.M03] * inv_det;\r\n\t\t\t\tv[webgl.M10] = t[webgl.M10] * inv_det;\r\n\t\t\t\tv[webgl.M11] = t[webgl.M11] * inv_det;\r\n\t\t\t\tv[webgl.M12] = t[webgl.M12] * inv_det;\r\n\t\t\t\tv[webgl.M13] = t[webgl.M13] * inv_det;\r\n\t\t\t\tv[webgl.M20] = t[webgl.M20] * inv_det;\r\n\t\t\t\tv[webgl.M21] = t[webgl.M21] * inv_det;\r\n\t\t\t\tv[webgl.M22] = t[webgl.M22] * inv_det;\r\n\t\t\t\tv[webgl.M23] = t[webgl.M23] * inv_det;\r\n\t\t\t\tv[webgl.M30] = t[webgl.M30] * inv_det;\r\n\t\t\t\tv[webgl.M31] = t[webgl.M31] * inv_det;\r\n\t\t\t\tv[webgl.M32] = t[webgl.M32] * inv_det;\r\n\t\t\t\tv[webgl.M33] = t[webgl.M33] * inv_det;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.determinant = function () {\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\treturn v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03]\r\n\t\t\t\t\t+ v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03]\r\n\t\t\t\t\t- v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13]\r\n\t\t\t\t\t+ v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23]\r\n\t\t\t\t\t+ v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23]\r\n\t\t\t\t\t- v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33]\r\n\t\t\t\t\t- v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.translate = function (x, y, z) {\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tv[webgl.M03] += x;\r\n\t\t\t\tv[webgl.M13] += y;\r\n\t\t\t\tv[webgl.M23] += z;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.copy = function () {\r\n\t\t\t\treturn new Matrix4().set(this.values);\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.projection = function (near, far, fovy, aspectRatio) {\r\n\t\t\t\tthis.identity();\r\n\t\t\t\tvar l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0));\r\n\t\t\t\tvar l_a1 = (far + near) / (near - far);\r\n\t\t\t\tvar l_a2 = (2 * far * near) / (near - far);\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tv[webgl.M00] = l_fd / aspectRatio;\r\n\t\t\t\tv[webgl.M10] = 0;\r\n\t\t\t\tv[webgl.M20] = 0;\r\n\t\t\t\tv[webgl.M30] = 0;\r\n\t\t\t\tv[webgl.M01] = 0;\r\n\t\t\t\tv[webgl.M11] = l_fd;\r\n\t\t\t\tv[webgl.M21] = 0;\r\n\t\t\t\tv[webgl.M31] = 0;\r\n\t\t\t\tv[webgl.M02] = 0;\r\n\t\t\t\tv[webgl.M12] = 0;\r\n\t\t\t\tv[webgl.M22] = l_a1;\r\n\t\t\t\tv[webgl.M32] = -1;\r\n\t\t\t\tv[webgl.M03] = 0;\r\n\t\t\t\tv[webgl.M13] = 0;\r\n\t\t\t\tv[webgl.M23] = l_a2;\r\n\t\t\t\tv[webgl.M33] = 0;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.ortho2d = function (x, y, width, height) {\r\n\t\t\t\treturn this.ortho(x, x + width, y, y + height, 0, 1);\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.ortho = function (left, right, bottom, top, near, far) {\r\n\t\t\t\tthis.identity();\r\n\t\t\t\tvar x_orth = 2 / (right - left);\r\n\t\t\t\tvar y_orth = 2 / (top - bottom);\r\n\t\t\t\tvar z_orth = -2 / (far - near);\r\n\t\t\t\tvar tx = -(right + left) / (right - left);\r\n\t\t\t\tvar ty = -(top + bottom) / (top - bottom);\r\n\t\t\t\tvar tz = -(far + near) / (far - near);\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tv[webgl.M00] = x_orth;\r\n\t\t\t\tv[webgl.M10] = 0;\r\n\t\t\t\tv[webgl.M20] = 0;\r\n\t\t\t\tv[webgl.M30] = 0;\r\n\t\t\t\tv[webgl.M01] = 0;\r\n\t\t\t\tv[webgl.M11] = y_orth;\r\n\t\t\t\tv[webgl.M21] = 0;\r\n\t\t\t\tv[webgl.M31] = 0;\r\n\t\t\t\tv[webgl.M02] = 0;\r\n\t\t\t\tv[webgl.M12] = 0;\r\n\t\t\t\tv[webgl.M22] = z_orth;\r\n\t\t\t\tv[webgl.M32] = 0;\r\n\t\t\t\tv[webgl.M03] = tx;\r\n\t\t\t\tv[webgl.M13] = ty;\r\n\t\t\t\tv[webgl.M23] = tz;\r\n\t\t\t\tv[webgl.M33] = 1;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.multiply = function (matrix) {\r\n\t\t\t\tvar t = this.temp;\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tvar m = matrix.values;\r\n\t\t\t\tt[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30];\r\n\t\t\t\tt[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31];\r\n\t\t\t\tt[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32];\r\n\t\t\t\tt[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33];\r\n\t\t\t\tt[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30];\r\n\t\t\t\tt[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31];\r\n\t\t\t\tt[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32];\r\n\t\t\t\tt[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33];\r\n\t\t\t\tt[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30];\r\n\t\t\t\tt[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31];\r\n\t\t\t\tt[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32];\r\n\t\t\t\tt[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33];\r\n\t\t\t\tt[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30];\r\n\t\t\t\tt[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31];\r\n\t\t\t\tt[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32];\r\n\t\t\t\tt[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33];\r\n\t\t\t\treturn this.set(this.temp);\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.multiplyLeft = function (matrix) {\r\n\t\t\t\tvar t = this.temp;\r\n\t\t\t\tvar v = this.values;\r\n\t\t\t\tvar m = matrix.values;\r\n\t\t\t\tt[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30];\r\n\t\t\t\tt[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31];\r\n\t\t\t\tt[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30];\r\n\t\t\t\tt[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31];\r\n\t\t\t\tt[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30];\r\n\t\t\t\tt[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31];\r\n\t\t\t\tt[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33];\r\n\t\t\t\tt[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30];\r\n\t\t\t\tt[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31];\r\n\t\t\t\tt[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32];\r\n\t\t\t\tt[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33];\r\n\t\t\t\treturn this.set(this.temp);\r\n\t\t\t};\r\n\t\t\tMatrix4.prototype.lookAt = function (position, direction, up) {\r\n\t\t\t\tMatrix4.initTemps();\r\n\t\t\t\tvar xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis;\r\n\t\t\t\tzAxis.setFrom(direction).normalize();\r\n\t\t\t\txAxis.setFrom(direction).normalize();\r\n\t\t\t\txAxis.cross(up).normalize();\r\n\t\t\t\tyAxis.setFrom(xAxis).cross(zAxis).normalize();\r\n\t\t\t\tthis.identity();\r\n\t\t\t\tvar val = this.values;\r\n\t\t\t\tval[webgl.M00] = xAxis.x;\r\n\t\t\t\tval[webgl.M01] = xAxis.y;\r\n\t\t\t\tval[webgl.M02] = xAxis.z;\r\n\t\t\t\tval[webgl.M10] = yAxis.x;\r\n\t\t\t\tval[webgl.M11] = yAxis.y;\r\n\t\t\t\tval[webgl.M12] = yAxis.z;\r\n\t\t\t\tval[webgl.M20] = -zAxis.x;\r\n\t\t\t\tval[webgl.M21] = -zAxis.y;\r\n\t\t\t\tval[webgl.M22] = -zAxis.z;\r\n\t\t\t\tMatrix4.tmpMatrix.identity();\r\n\t\t\t\tMatrix4.tmpMatrix.values[webgl.M03] = -position.x;\r\n\t\t\t\tMatrix4.tmpMatrix.values[webgl.M13] = -position.y;\r\n\t\t\t\tMatrix4.tmpMatrix.values[webgl.M23] = -position.z;\r\n\t\t\t\tthis.multiply(Matrix4.tmpMatrix);\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tMatrix4.initTemps = function () {\r\n\t\t\t\tif (Matrix4.xAxis === null)\r\n\t\t\t\t\tMatrix4.xAxis = new webgl.Vector3();\r\n\t\t\t\tif (Matrix4.yAxis === null)\r\n\t\t\t\t\tMatrix4.yAxis = new webgl.Vector3();\r\n\t\t\t\tif (Matrix4.zAxis === null)\r\n\t\t\t\t\tMatrix4.zAxis = new webgl.Vector3();\r\n\t\t\t};\r\n\t\t\tMatrix4.xAxis = null;\r\n\t\t\tMatrix4.yAxis = null;\r\n\t\t\tMatrix4.zAxis = null;\r\n\t\t\tMatrix4.tmpMatrix = new Matrix4();\r\n\t\t\treturn Matrix4;\r\n\t\t}());\r\n\t\twebgl.Matrix4 = Matrix4;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar Mesh = (function () {\r\n\t\t\tfunction Mesh(context, attributes, maxVertices, maxIndices) {\r\n\t\t\t\tthis.attributes = attributes;\r\n\t\t\t\tthis.verticesLength = 0;\r\n\t\t\t\tthis.dirtyVertices = false;\r\n\t\t\t\tthis.indicesLength = 0;\r\n\t\t\t\tthis.dirtyIndices = false;\r\n\t\t\t\tthis.elementsPerVertex = 0;\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\tthis.elementsPerVertex = 0;\r\n\t\t\t\tfor (var i = 0; i < attributes.length; i++) {\r\n\t\t\t\t\tthis.elementsPerVertex += attributes[i].numElements;\r\n\t\t\t\t}\r\n\t\t\t\tthis.vertices = new Float32Array(maxVertices * this.elementsPerVertex);\r\n\t\t\t\tthis.indices = new Uint16Array(maxIndices);\r\n\t\t\t\tthis.context.addRestorable(this);\r\n\t\t\t}\r\n\t\t\tMesh.prototype.getAttributes = function () { return this.attributes; };\r\n\t\t\tMesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; };\r\n\t\t\tMesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; };\r\n\t\t\tMesh.prototype.setVerticesLength = function (length) {\r\n\t\t\t\tthis.dirtyVertices = true;\r\n\t\t\t\tthis.verticesLength = length;\r\n\t\t\t};\r\n\t\t\tMesh.prototype.getVertices = function () { return this.vertices; };\r\n\t\t\tMesh.prototype.maxIndices = function () { return this.indices.length; };\r\n\t\t\tMesh.prototype.numIndices = function () { return this.indicesLength; };\r\n\t\t\tMesh.prototype.setIndicesLength = function (length) {\r\n\t\t\t\tthis.dirtyIndices = true;\r\n\t\t\t\tthis.indicesLength = length;\r\n\t\t\t};\r\n\t\t\tMesh.prototype.getIndices = function () { return this.indices; };\r\n\t\t\t;\r\n\t\t\tMesh.prototype.getVertexSizeInFloats = function () {\r\n\t\t\t\tvar size = 0;\r\n\t\t\t\tfor (var i = 0; i < this.attributes.length; i++) {\r\n\t\t\t\t\tvar attribute = this.attributes[i];\r\n\t\t\t\t\tsize += attribute.numElements;\r\n\t\t\t\t}\r\n\t\t\t\treturn size;\r\n\t\t\t};\r\n\t\t\tMesh.prototype.setVertices = function (vertices) {\r\n\t\t\t\tthis.dirtyVertices = true;\r\n\t\t\t\tif (vertices.length > this.vertices.length)\r\n\t\t\t\t\tthrow Error(\"Mesh can't store more than \" + this.maxVertices() + \" vertices\");\r\n\t\t\t\tthis.vertices.set(vertices, 0);\r\n\t\t\t\tthis.verticesLength = vertices.length;\r\n\t\t\t};\r\n\t\t\tMesh.prototype.setIndices = function (indices) {\r\n\t\t\t\tthis.dirtyIndices = true;\r\n\t\t\t\tif (indices.length > this.indices.length)\r\n\t\t\t\t\tthrow Error(\"Mesh can't store more than \" + this.maxIndices() + \" indices\");\r\n\t\t\t\tthis.indices.set(indices, 0);\r\n\t\t\t\tthis.indicesLength = indices.length;\r\n\t\t\t};\r\n\t\t\tMesh.prototype.draw = function (shader, primitiveType) {\r\n\t\t\t\tthis.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex);\r\n\t\t\t};\r\n\t\t\tMesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (this.dirtyVertices || this.dirtyIndices)\r\n\t\t\t\t\tthis.update();\r\n\t\t\t\tthis.bind(shader);\r\n\t\t\t\tif (this.indicesLength > 0) {\r\n\t\t\t\t\tgl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tgl.drawArrays(primitiveType, offset, count);\r\n\t\t\t\t}\r\n\t\t\t\tthis.unbind(shader);\r\n\t\t\t};\r\n\t\t\tMesh.prototype.bind = function (shader) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\r\n\t\t\t\tvar offset = 0;\r\n\t\t\t\tfor (var i = 0; i < this.attributes.length; i++) {\r\n\t\t\t\t\tvar attrib = this.attributes[i];\r\n\t\t\t\t\tvar location_1 = shader.getAttributeLocation(attrib.name);\r\n\t\t\t\t\tgl.enableVertexAttribArray(location_1);\r\n\t\t\t\t\tgl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4);\r\n\t\t\t\t\toffset += attrib.numElements;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.indicesLength > 0)\r\n\t\t\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\r\n\t\t\t};\r\n\t\t\tMesh.prototype.unbind = function (shader) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tfor (var i = 0; i < this.attributes.length; i++) {\r\n\t\t\t\t\tvar attrib = this.attributes[i];\r\n\t\t\t\t\tvar location_2 = shader.getAttributeLocation(attrib.name);\r\n\t\t\t\t\tgl.disableVertexAttribArray(location_2);\r\n\t\t\t\t}\r\n\t\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, null);\r\n\t\t\t\tif (this.indicesLength > 0)\r\n\t\t\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\r\n\t\t\t};\r\n\t\t\tMesh.prototype.update = function () {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (this.dirtyVertices) {\r\n\t\t\t\t\tif (!this.verticesBuffer) {\r\n\t\t\t\t\t\tthis.verticesBuffer = gl.createBuffer();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\r\n\t\t\t\t\tgl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW);\r\n\t\t\t\t\tthis.dirtyVertices = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.dirtyIndices) {\r\n\t\t\t\t\tif (!this.indicesBuffer) {\r\n\t\t\t\t\t\tthis.indicesBuffer = gl.createBuffer();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\r\n\t\t\t\t\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW);\r\n\t\t\t\t\tthis.dirtyIndices = false;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tMesh.prototype.restore = function () {\r\n\t\t\t\tthis.verticesBuffer = null;\r\n\t\t\t\tthis.indicesBuffer = null;\r\n\t\t\t\tthis.update();\r\n\t\t\t};\r\n\t\t\tMesh.prototype.dispose = function () {\r\n\t\t\t\tthis.context.removeRestorable(this);\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tgl.deleteBuffer(this.verticesBuffer);\r\n\t\t\t\tgl.deleteBuffer(this.indicesBuffer);\r\n\t\t\t};\r\n\t\t\treturn Mesh;\r\n\t\t}());\r\n\t\twebgl.Mesh = Mesh;\r\n\t\tvar VertexAttribute = (function () {\r\n\t\t\tfunction VertexAttribute(name, type, numElements) {\r\n\t\t\t\tthis.name = name;\r\n\t\t\t\tthis.type = type;\r\n\t\t\t\tthis.numElements = numElements;\r\n\t\t\t}\r\n\t\t\treturn VertexAttribute;\r\n\t\t}());\r\n\t\twebgl.VertexAttribute = VertexAttribute;\r\n\t\tvar Position2Attribute = (function (_super) {\r\n\t\t\t__extends(Position2Attribute, _super);\r\n\t\t\tfunction Position2Attribute() {\r\n\t\t\t\treturn _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this;\r\n\t\t\t}\r\n\t\t\treturn Position2Attribute;\r\n\t\t}(VertexAttribute));\r\n\t\twebgl.Position2Attribute = Position2Attribute;\r\n\t\tvar Position3Attribute = (function (_super) {\r\n\t\t\t__extends(Position3Attribute, _super);\r\n\t\t\tfunction Position3Attribute() {\r\n\t\t\t\treturn _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this;\r\n\t\t\t}\r\n\t\t\treturn Position3Attribute;\r\n\t\t}(VertexAttribute));\r\n\t\twebgl.Position3Attribute = Position3Attribute;\r\n\t\tvar TexCoordAttribute = (function (_super) {\r\n\t\t\t__extends(TexCoordAttribute, _super);\r\n\t\t\tfunction TexCoordAttribute(unit) {\r\n\t\t\t\tif (unit === void 0) { unit = 0; }\r\n\t\t\t\treturn _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? \"\" : unit), VertexAttributeType.Float, 2) || this;\r\n\t\t\t}\r\n\t\t\treturn TexCoordAttribute;\r\n\t\t}(VertexAttribute));\r\n\t\twebgl.TexCoordAttribute = TexCoordAttribute;\r\n\t\tvar ColorAttribute = (function (_super) {\r\n\t\t\t__extends(ColorAttribute, _super);\r\n\t\t\tfunction ColorAttribute() {\r\n\t\t\t\treturn _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this;\r\n\t\t\t}\r\n\t\t\treturn ColorAttribute;\r\n\t\t}(VertexAttribute));\r\n\t\twebgl.ColorAttribute = ColorAttribute;\r\n\t\tvar Color2Attribute = (function (_super) {\r\n\t\t\t__extends(Color2Attribute, _super);\r\n\t\t\tfunction Color2Attribute() {\r\n\t\t\t\treturn _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this;\r\n\t\t\t}\r\n\t\t\treturn Color2Attribute;\r\n\t\t}(VertexAttribute));\r\n\t\twebgl.Color2Attribute = Color2Attribute;\r\n\t\tvar VertexAttributeType;\r\n\t\t(function (VertexAttributeType) {\r\n\t\t\tVertexAttributeType[VertexAttributeType[\"Float\"] = 0] = \"Float\";\r\n\t\t})(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {}));\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar PolygonBatcher = (function () {\r\n\t\t\tfunction PolygonBatcher(context, twoColorTint, maxVertices) {\r\n\t\t\t\tif (twoColorTint === void 0) { twoColorTint = true; }\r\n\t\t\t\tif (maxVertices === void 0) { maxVertices = 10920; }\r\n\t\t\t\tthis.isDrawing = false;\r\n\t\t\t\tthis.shader = null;\r\n\t\t\t\tthis.lastTexture = null;\r\n\t\t\t\tthis.verticesLength = 0;\r\n\t\t\t\tthis.indicesLength = 0;\r\n\t\t\t\tif (maxVertices > 10920)\r\n\t\t\t\t\tthrow new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\tvar attributes = twoColorTint ?\r\n\t\t\t\t\t[new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] :\r\n\t\t\t\t\t[new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()];\r\n\t\t\t\tthis.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3);\r\n\t\t\t\tthis.srcBlend = this.context.gl.SRC_ALPHA;\r\n\t\t\t\tthis.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA;\r\n\t\t\t}\r\n\t\t\tPolygonBatcher.prototype.begin = function (shader) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (this.isDrawing)\r\n\t\t\t\t\tthrow new Error(\"PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()\");\r\n\t\t\t\tthis.drawCalls = 0;\r\n\t\t\t\tthis.shader = shader;\r\n\t\t\t\tthis.lastTexture = null;\r\n\t\t\t\tthis.isDrawing = true;\r\n\t\t\t\tgl.enable(gl.BLEND);\r\n\t\t\t\tgl.blendFunc(this.srcBlend, this.dstBlend);\r\n\t\t\t};\r\n\t\t\tPolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.srcBlend = srcBlend;\r\n\t\t\t\tthis.dstBlend = dstBlend;\r\n\t\t\t\tif (this.isDrawing) {\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\t\tgl.blendFunc(this.srcBlend, this.dstBlend);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tPolygonBatcher.prototype.draw = function (texture, vertices, indices) {\r\n\t\t\t\tif (texture != this.lastTexture) {\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\t\tthis.lastTexture = texture;\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.verticesLength + vertices.length > this.mesh.getVertices().length ||\r\n\t\t\t\t\tthis.indicesLength + indices.length > this.mesh.getIndices().length) {\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\t}\r\n\t\t\t\tvar indexStart = this.mesh.numVertices();\r\n\t\t\t\tthis.mesh.getVertices().set(vertices, this.verticesLength);\r\n\t\t\t\tthis.verticesLength += vertices.length;\r\n\t\t\t\tthis.mesh.setVerticesLength(this.verticesLength);\r\n\t\t\t\tvar indicesArray = this.mesh.getIndices();\r\n\t\t\t\tfor (var i = this.indicesLength, j = 0; j < indices.length; i++, j++)\r\n\t\t\t\t\tindicesArray[i] = indices[j] + indexStart;\r\n\t\t\t\tthis.indicesLength += indices.length;\r\n\t\t\t\tthis.mesh.setIndicesLength(this.indicesLength);\r\n\t\t\t};\r\n\t\t\tPolygonBatcher.prototype.flush = function () {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (this.verticesLength == 0)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tthis.lastTexture.bind();\r\n\t\t\t\tthis.mesh.draw(this.shader, gl.TRIANGLES);\r\n\t\t\t\tthis.verticesLength = 0;\r\n\t\t\t\tthis.indicesLength = 0;\r\n\t\t\t\tthis.mesh.setVerticesLength(0);\r\n\t\t\t\tthis.mesh.setIndicesLength(0);\r\n\t\t\t\tthis.drawCalls++;\r\n\t\t\t};\r\n\t\t\tPolygonBatcher.prototype.end = function () {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (!this.isDrawing)\r\n\t\t\t\t\tthrow new Error(\"PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()\");\r\n\t\t\t\tif (this.verticesLength > 0 || this.indicesLength > 0)\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\tthis.shader = null;\r\n\t\t\t\tthis.lastTexture = null;\r\n\t\t\t\tthis.isDrawing = false;\r\n\t\t\t\tgl.disable(gl.BLEND);\r\n\t\t\t};\r\n\t\t\tPolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; };\r\n\t\t\tPolygonBatcher.prototype.dispose = function () {\r\n\t\t\t\tthis.mesh.dispose();\r\n\t\t\t};\r\n\t\t\treturn PolygonBatcher;\r\n\t\t}());\r\n\t\twebgl.PolygonBatcher = PolygonBatcher;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar SceneRenderer = (function () {\r\n\t\t\tfunction SceneRenderer(canvas, context, twoColorTint) {\r\n\t\t\t\tif (twoColorTint === void 0) { twoColorTint = true; }\r\n\t\t\t\tthis.twoColorTint = false;\r\n\t\t\t\tthis.activeRenderer = null;\r\n\t\t\t\tthis.QUAD = [\r\n\t\t\t\t\t0, 0, 1, 1, 1, 1, 0, 0,\r\n\t\t\t\t\t0, 0, 1, 1, 1, 1, 0, 0,\r\n\t\t\t\t\t0, 0, 1, 1, 1, 1, 0, 0,\r\n\t\t\t\t\t0, 0, 1, 1, 1, 1, 0, 0,\r\n\t\t\t\t];\r\n\t\t\t\tthis.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n\t\t\t\tthis.WHITE = new spine.Color(1, 1, 1, 1);\r\n\t\t\t\tthis.canvas = canvas;\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\tthis.twoColorTint = twoColorTint;\r\n\t\t\t\tthis.camera = new webgl.OrthoCamera(canvas.width, canvas.height);\r\n\t\t\t\tthis.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context);\r\n\t\t\t\tthis.batcher = new webgl.PolygonBatcher(this.context, twoColorTint);\r\n\t\t\t\tthis.shapesShader = webgl.Shader.newColored(this.context);\r\n\t\t\t\tthis.shapes = new webgl.ShapeRenderer(this.context);\r\n\t\t\t\tthis.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint);\r\n\t\t\t\tthis.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context);\r\n\t\t\t}\r\n\t\t\tSceneRenderer.prototype.begin = function () {\r\n\t\t\t\tthis.camera.update();\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) {\r\n\t\t\t\tif (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n\t\t\t\tif (slotRangeStart === void 0) { slotRangeStart = -1; }\r\n\t\t\t\tif (slotRangeEnd === void 0) { slotRangeEnd = -1; }\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t\tthis.skeletonRenderer.premultipliedAlpha = premultipliedAlpha;\r\n\t\t\t\tthis.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) {\r\n\t\t\t\tif (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n\t\t\t\tif (ignoredBones === void 0) { ignoredBones = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha;\r\n\t\t\t\tthis.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.WHITE;\r\n\t\t\t\tvar quad = this.QUAD;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tthis.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.WHITE;\r\n\t\t\t\tvar quad = this.QUAD;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = u;\r\n\t\t\t\tquad[i++] = v;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = u2;\r\n\t\t\t\tquad[i++] = v;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = u2;\r\n\t\t\t\tquad[i++] = v2;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = u;\r\n\t\t\t\tquad[i++] = v2;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tthis.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.WHITE;\r\n\t\t\t\tvar quad = this.QUAD;\r\n\t\t\t\tvar worldOriginX = x + pivotX;\r\n\t\t\t\tvar worldOriginY = y + pivotY;\r\n\t\t\t\tvar fx = -pivotX;\r\n\t\t\t\tvar fy = -pivotY;\r\n\t\t\t\tvar fx2 = width - pivotX;\r\n\t\t\t\tvar fy2 = height - pivotY;\r\n\t\t\t\tvar p1x = fx;\r\n\t\t\t\tvar p1y = fy;\r\n\t\t\t\tvar p2x = fx;\r\n\t\t\t\tvar p2y = fy2;\r\n\t\t\t\tvar p3x = fx2;\r\n\t\t\t\tvar p3y = fy2;\r\n\t\t\t\tvar p4x = fx2;\r\n\t\t\t\tvar p4y = fy;\r\n\t\t\t\tvar x1 = 0;\r\n\t\t\t\tvar y1 = 0;\r\n\t\t\t\tvar x2 = 0;\r\n\t\t\t\tvar y2 = 0;\r\n\t\t\t\tvar x3 = 0;\r\n\t\t\t\tvar y3 = 0;\r\n\t\t\t\tvar x4 = 0;\r\n\t\t\t\tvar y4 = 0;\r\n\t\t\t\tif (angle != 0) {\r\n\t\t\t\t\tvar cos = spine.MathUtils.cosDeg(angle);\r\n\t\t\t\t\tvar sin = spine.MathUtils.sinDeg(angle);\r\n\t\t\t\t\tx1 = cos * p1x - sin * p1y;\r\n\t\t\t\t\ty1 = sin * p1x + cos * p1y;\r\n\t\t\t\t\tx4 = cos * p2x - sin * p2y;\r\n\t\t\t\t\ty4 = sin * p2x + cos * p2y;\r\n\t\t\t\t\tx3 = cos * p3x - sin * p3y;\r\n\t\t\t\t\ty3 = sin * p3x + cos * p3y;\r\n\t\t\t\t\tx2 = x3 + (x1 - x4);\r\n\t\t\t\t\ty2 = y3 + (y1 - y4);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tx1 = p1x;\r\n\t\t\t\t\ty1 = p1y;\r\n\t\t\t\t\tx4 = p2x;\r\n\t\t\t\t\ty4 = p2y;\r\n\t\t\t\t\tx3 = p3x;\r\n\t\t\t\t\ty3 = p3y;\r\n\t\t\t\t\tx2 = p4x;\r\n\t\t\t\t\ty2 = p4y;\r\n\t\t\t\t}\r\n\t\t\t\tx1 += worldOriginX;\r\n\t\t\t\ty1 += worldOriginY;\r\n\t\t\t\tx2 += worldOriginX;\r\n\t\t\t\ty2 += worldOriginY;\r\n\t\t\t\tx3 += worldOriginX;\r\n\t\t\t\ty3 += worldOriginY;\r\n\t\t\t\tx4 += worldOriginX;\r\n\t\t\t\ty4 += worldOriginY;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\tquad[i++] = x1;\r\n\t\t\t\tquad[i++] = y1;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x2;\r\n\t\t\t\tquad[i++] = y2;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x3;\r\n\t\t\t\tquad[i++] = y3;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 1;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x4;\r\n\t\t\t\tquad[i++] = y4;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tquad[i++] = 0;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tthis.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n\t\t\t\tthis.enableRenderer(this.batcher);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.WHITE;\r\n\t\t\t\tvar quad = this.QUAD;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = region.u;\r\n\t\t\t\tquad[i++] = region.v2;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = region.u2;\r\n\t\t\t\tquad[i++] = region.v2;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x + width;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = region.u2;\r\n\t\t\t\tquad[i++] = region.v;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tquad[i++] = x;\r\n\t\t\t\tquad[i++] = y + height;\r\n\t\t\t\tquad[i++] = color.r;\r\n\t\t\t\tquad[i++] = color.g;\r\n\t\t\t\tquad[i++] = color.b;\r\n\t\t\t\tquad[i++] = color.a;\r\n\t\t\t\tquad[i++] = region.u;\r\n\t\t\t\tquad[i++] = region.v;\r\n\t\t\t\tif (this.twoColorTint) {\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t\tquad[i++] = 0;\r\n\t\t\t\t}\r\n\t\t\t\tthis.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (color2 === void 0) { color2 = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.line(x, y, x2, y2, color);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (color2 === void 0) { color2 = null; }\r\n\t\t\t\tif (color3 === void 0) { color3 = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (color2 === void 0) { color2 = null; }\r\n\t\t\t\tif (color3 === void 0) { color3 = null; }\r\n\t\t\t\tif (color4 === void 0) { color4 = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.rect = function (filled, x, y, width, height, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.rect(filled, x, y, width, height, color);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.rectLine(filled, x1, y1, x2, y2, width, color);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.polygon(polygonVertices, offset, count, color);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (segments === void 0) { segments = 0; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.circle(filled, x, y, radius, color, segments);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.enableRenderer(this.shapes);\r\n\t\t\t\tthis.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color);\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.end = function () {\r\n\t\t\t\tif (this.activeRenderer === this.batcher)\r\n\t\t\t\t\tthis.batcher.end();\r\n\t\t\t\telse if (this.activeRenderer === this.shapes)\r\n\t\t\t\t\tthis.shapes.end();\r\n\t\t\t\tthis.activeRenderer = null;\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.resize = function (resizeMode) {\r\n\t\t\t\tvar canvas = this.canvas;\r\n\t\t\t\tvar w = canvas.clientWidth;\r\n\t\t\t\tvar h = canvas.clientHeight;\r\n\t\t\t\tif (canvas.width != w || canvas.height != h) {\r\n\t\t\t\t\tcanvas.width = w;\r\n\t\t\t\t\tcanvas.height = h;\r\n\t\t\t\t}\r\n\t\t\t\tthis.context.gl.viewport(0, 0, canvas.width, canvas.height);\r\n\t\t\t\tif (resizeMode === ResizeMode.Stretch) {\r\n\t\t\t\t}\r\n\t\t\t\telse if (resizeMode === ResizeMode.Expand) {\r\n\t\t\t\t\tthis.camera.setViewport(w, h);\r\n\t\t\t\t}\r\n\t\t\t\telse if (resizeMode === ResizeMode.Fit) {\r\n\t\t\t\t\tvar sourceWidth = canvas.width, sourceHeight = canvas.height;\r\n\t\t\t\t\tvar targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight;\r\n\t\t\t\t\tvar targetRatio = targetHeight / targetWidth;\r\n\t\t\t\t\tvar sourceRatio = sourceHeight / sourceWidth;\r\n\t\t\t\t\tvar scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight;\r\n\t\t\t\t\tthis.camera.viewportWidth = sourceWidth * scale;\r\n\t\t\t\t\tthis.camera.viewportHeight = sourceHeight * scale;\r\n\t\t\t\t}\r\n\t\t\t\tthis.camera.update();\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.enableRenderer = function (renderer) {\r\n\t\t\t\tif (this.activeRenderer === renderer)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tthis.end();\r\n\t\t\t\tif (renderer instanceof webgl.PolygonBatcher) {\r\n\t\t\t\t\tthis.batcherShader.bind();\r\n\t\t\t\t\tthis.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values);\r\n\t\t\t\t\tthis.batcherShader.setUniformi(\"u_texture\", 0);\r\n\t\t\t\t\tthis.batcher.begin(this.batcherShader);\r\n\t\t\t\t\tthis.activeRenderer = this.batcher;\r\n\t\t\t\t}\r\n\t\t\t\telse if (renderer instanceof webgl.ShapeRenderer) {\r\n\t\t\t\t\tthis.shapesShader.bind();\r\n\t\t\t\t\tthis.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values);\r\n\t\t\t\t\tthis.shapes.begin(this.shapesShader);\r\n\t\t\t\t\tthis.activeRenderer = this.shapes;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.activeRenderer = this.skeletonDebugRenderer;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tSceneRenderer.prototype.dispose = function () {\r\n\t\t\t\tthis.batcher.dispose();\r\n\t\t\t\tthis.batcherShader.dispose();\r\n\t\t\t\tthis.shapes.dispose();\r\n\t\t\t\tthis.shapesShader.dispose();\r\n\t\t\t\tthis.skeletonDebugRenderer.dispose();\r\n\t\t\t};\r\n\t\t\treturn SceneRenderer;\r\n\t\t}());\r\n\t\twebgl.SceneRenderer = SceneRenderer;\r\n\t\tvar ResizeMode;\r\n\t\t(function (ResizeMode) {\r\n\t\t\tResizeMode[ResizeMode[\"Stretch\"] = 0] = \"Stretch\";\r\n\t\t\tResizeMode[ResizeMode[\"Expand\"] = 1] = \"Expand\";\r\n\t\t\tResizeMode[ResizeMode[\"Fit\"] = 2] = \"Fit\";\r\n\t\t})(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {}));\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar Shader = (function () {\r\n\t\t\tfunction Shader(context, vertexShader, fragmentShader) {\r\n\t\t\t\tthis.vertexShader = vertexShader;\r\n\t\t\t\tthis.fragmentShader = fragmentShader;\r\n\t\t\t\tthis.vs = null;\r\n\t\t\t\tthis.fs = null;\r\n\t\t\t\tthis.program = null;\r\n\t\t\t\tthis.tmp2x2 = new Float32Array(2 * 2);\r\n\t\t\t\tthis.tmp3x3 = new Float32Array(3 * 3);\r\n\t\t\t\tthis.tmp4x4 = new Float32Array(4 * 4);\r\n\t\t\t\tthis.vsSource = vertexShader;\r\n\t\t\t\tthis.fsSource = fragmentShader;\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\tthis.context.addRestorable(this);\r\n\t\t\t\tthis.compile();\r\n\t\t\t}\r\n\t\t\tShader.prototype.getProgram = function () { return this.program; };\r\n\t\t\tShader.prototype.getVertexShader = function () { return this.vertexShader; };\r\n\t\t\tShader.prototype.getFragmentShader = function () { return this.fragmentShader; };\r\n\t\t\tShader.prototype.getVertexShaderSource = function () { return this.vsSource; };\r\n\t\t\tShader.prototype.getFragmentSource = function () { return this.fsSource; };\r\n\t\t\tShader.prototype.compile = function () {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader);\r\n\t\t\t\t\tthis.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader);\r\n\t\t\t\t\tthis.program = this.compileProgram(this.vs, this.fs);\r\n\t\t\t\t}\r\n\t\t\t\tcatch (e) {\r\n\t\t\t\t\tthis.dispose();\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShader.prototype.compileShader = function (type, source) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tvar shader = gl.createShader(type);\r\n\t\t\t\tgl.shaderSource(shader, source);\r\n\t\t\t\tgl.compileShader(shader);\r\n\t\t\t\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n\t\t\t\t\tvar error = \"Couldn't compile shader: \" + gl.getShaderInfoLog(shader);\r\n\t\t\t\t\tgl.deleteShader(shader);\r\n\t\t\t\t\tif (!gl.isContextLost())\r\n\t\t\t\t\t\tthrow new Error(error);\r\n\t\t\t\t}\r\n\t\t\t\treturn shader;\r\n\t\t\t};\r\n\t\t\tShader.prototype.compileProgram = function (vs, fs) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tvar program = gl.createProgram();\r\n\t\t\t\tgl.attachShader(program, vs);\r\n\t\t\t\tgl.attachShader(program, fs);\r\n\t\t\t\tgl.linkProgram(program);\r\n\t\t\t\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\r\n\t\t\t\t\tvar error = \"Couldn't compile shader program: \" + gl.getProgramInfoLog(program);\r\n\t\t\t\t\tgl.deleteProgram(program);\r\n\t\t\t\t\tif (!gl.isContextLost())\r\n\t\t\t\t\t\tthrow new Error(error);\r\n\t\t\t\t}\r\n\t\t\t\treturn program;\r\n\t\t\t};\r\n\t\t\tShader.prototype.restore = function () {\r\n\t\t\t\tthis.compile();\r\n\t\t\t};\r\n\t\t\tShader.prototype.bind = function () {\r\n\t\t\t\tthis.context.gl.useProgram(this.program);\r\n\t\t\t};\r\n\t\t\tShader.prototype.unbind = function () {\r\n\t\t\t\tthis.context.gl.useProgram(null);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniformi = function (uniform, value) {\r\n\t\t\t\tthis.context.gl.uniform1i(this.getUniformLocation(uniform), value);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniformf = function (uniform, value) {\r\n\t\t\t\tthis.context.gl.uniform1f(this.getUniformLocation(uniform), value);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform2f = function (uniform, value, value2) {\r\n\t\t\t\tthis.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform3f = function (uniform, value, value2, value3) {\r\n\t\t\t\tthis.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) {\r\n\t\t\t\tthis.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform2x2f = function (uniform, value) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.tmp2x2.set(value);\r\n\t\t\t\tgl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform3x3f = function (uniform, value) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.tmp3x3.set(value);\r\n\t\t\t\tgl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3);\r\n\t\t\t};\r\n\t\t\tShader.prototype.setUniform4x4f = function (uniform, value) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.tmp4x4.set(value);\r\n\t\t\t\tgl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4);\r\n\t\t\t};\r\n\t\t\tShader.prototype.getUniformLocation = function (uniform) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tvar location = gl.getUniformLocation(this.program, uniform);\r\n\t\t\t\tif (!location && !gl.isContextLost())\r\n\t\t\t\t\tthrow new Error(\"Couldn't find location for uniform \" + uniform);\r\n\t\t\t\treturn location;\r\n\t\t\t};\r\n\t\t\tShader.prototype.getAttributeLocation = function (attribute) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tvar location = gl.getAttribLocation(this.program, attribute);\r\n\t\t\t\tif (location == -1 && !gl.isContextLost())\r\n\t\t\t\t\tthrow new Error(\"Couldn't find location for attribute \" + attribute);\r\n\t\t\t\treturn location;\r\n\t\t\t};\r\n\t\t\tShader.prototype.dispose = function () {\r\n\t\t\t\tthis.context.removeRestorable(this);\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tif (this.vs) {\r\n\t\t\t\t\tgl.deleteShader(this.vs);\r\n\t\t\t\t\tthis.vs = null;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.fs) {\r\n\t\t\t\t\tgl.deleteShader(this.fs);\r\n\t\t\t\t\tthis.fs = null;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.program) {\r\n\t\t\t\t\tgl.deleteProgram(this.program);\r\n\t\t\t\t\tthis.program = null;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShader.newColoredTextured = function (context) {\r\n\t\t\t\tvar vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tattribute vec2 \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.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 = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tv_texCoords = \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n\t\t\t\tvar fs = \"\\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\";\r\n\t\t\t\treturn new Shader(context, vs, fs);\r\n\t\t\t};\r\n\t\t\tShader.newTwoColoredTextured = function (context) {\r\n\t\t\t\tvar vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR2 + \";\\n\\t\\t\\t\\tattribute vec2 \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.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 = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tv_dark = \" + Shader.COLOR2 + \";\\n\\t\\t\\t\\t\\tv_texCoords = \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n\t\t\t\tvar fs = \"\\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\";\r\n\t\t\t\treturn new Shader(context, vs, fs);\r\n\t\t\t};\r\n\t\t\tShader.newColored = function (context) {\r\n\t\t\t\tvar vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.MVP_MATRIX + \";\\n\\t\\t\\t\\tvarying vec4 v_color;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tv_color = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n\t\t\t\tvar fs = \"\\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\";\r\n\t\t\t\treturn new Shader(context, vs, fs);\r\n\t\t\t};\r\n\t\t\tShader.MVP_MATRIX = \"u_projTrans\";\r\n\t\t\tShader.POSITION = \"a_position\";\r\n\t\t\tShader.COLOR = \"a_color\";\r\n\t\t\tShader.COLOR2 = \"a_color2\";\r\n\t\t\tShader.TEXCOORDS = \"a_texCoords\";\r\n\t\t\tShader.SAMPLER = \"u_texture\";\r\n\t\t\treturn Shader;\r\n\t\t}());\r\n\t\twebgl.Shader = Shader;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar ShapeRenderer = (function () {\r\n\t\t\tfunction ShapeRenderer(context, maxVertices) {\r\n\t\t\t\tif (maxVertices === void 0) { maxVertices = 10920; }\r\n\t\t\t\tthis.isDrawing = false;\r\n\t\t\t\tthis.shapeType = ShapeType.Filled;\r\n\t\t\t\tthis.color = new spine.Color(1, 1, 1, 1);\r\n\t\t\t\tthis.vertexIndex = 0;\r\n\t\t\t\tthis.tmp = new spine.Vector2();\r\n\t\t\t\tif (maxVertices > 10920)\r\n\t\t\t\t\tthrow new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t\tthis.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0);\r\n\t\t\t\tthis.srcBlend = this.context.gl.SRC_ALPHA;\r\n\t\t\t\tthis.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA;\r\n\t\t\t}\r\n\t\t\tShapeRenderer.prototype.begin = function (shader) {\r\n\t\t\t\tif (this.isDrawing)\r\n\t\t\t\t\tthrow new Error(\"ShapeRenderer.begin() has already been called\");\r\n\t\t\t\tthis.shader = shader;\r\n\t\t\t\tthis.vertexIndex = 0;\r\n\t\t\t\tthis.isDrawing = true;\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tgl.enable(gl.BLEND);\r\n\t\t\t\tgl.blendFunc(this.srcBlend, this.dstBlend);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) {\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tthis.srcBlend = srcBlend;\r\n\t\t\t\tthis.dstBlend = dstBlend;\r\n\t\t\t\tif (this.isDrawing) {\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\t\tgl.blendFunc(this.srcBlend, this.dstBlend);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.setColor = function (color) {\r\n\t\t\t\tthis.color.setFromColor(color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.setColorWith = function (r, g, b, a) {\r\n\t\t\t\tthis.color.set(r, g, b, a);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.point = function (x, y, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.check(ShapeType.Point, 1);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.line = function (x, y, x2, y2, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.check(ShapeType.Line, 2);\r\n\t\t\t\tvar vertices = this.mesh.getVertices();\r\n\t\t\t\tvar idx = this.vertexIndex;\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\tthis.vertex(x2, y2, color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (color2 === void 0) { color2 = null; }\r\n\t\t\t\tif (color3 === void 0) { color3 = null; }\r\n\t\t\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\r\n\t\t\t\tvar vertices = this.mesh.getVertices();\r\n\t\t\t\tvar idx = this.vertexIndex;\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tif (color2 === null)\r\n\t\t\t\t\tcolor2 = this.color;\r\n\t\t\t\tif (color3 === null)\r\n\t\t\t\t\tcolor3 = this.color;\r\n\t\t\t\tif (filled) {\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\tthis.vertex(x2, y2, color2);\r\n\t\t\t\t\tthis.vertex(x3, y3, color3);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\tthis.vertex(x2, y2, color2);\r\n\t\t\t\t\tthis.vertex(x2, y2, color);\r\n\t\t\t\t\tthis.vertex(x3, y3, color2);\r\n\t\t\t\t\tthis.vertex(x3, y3, color);\r\n\t\t\t\t\tthis.vertex(x, y, color2);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (color2 === void 0) { color2 = null; }\r\n\t\t\t\tif (color3 === void 0) { color3 = null; }\r\n\t\t\t\tif (color4 === void 0) { color4 = null; }\r\n\t\t\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\r\n\t\t\t\tvar vertices = this.mesh.getVertices();\r\n\t\t\t\tvar idx = this.vertexIndex;\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tif (color2 === null)\r\n\t\t\t\t\tcolor2 = this.color;\r\n\t\t\t\tif (color3 === null)\r\n\t\t\t\t\tcolor3 = this.color;\r\n\t\t\t\tif (color4 === null)\r\n\t\t\t\t\tcolor4 = this.color;\r\n\t\t\t\tif (filled) {\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\tthis.vertex(x2, y2, color2);\r\n\t\t\t\t\tthis.vertex(x3, y3, color3);\r\n\t\t\t\t\tthis.vertex(x3, y3, color3);\r\n\t\t\t\t\tthis.vertex(x4, y4, color4);\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\tthis.vertex(x2, y2, color2);\r\n\t\t\t\t\tthis.vertex(x2, y2, color2);\r\n\t\t\t\t\tthis.vertex(x3, y3, color3);\r\n\t\t\t\t\tthis.vertex(x3, y3, color3);\r\n\t\t\t\t\tthis.vertex(x4, y4, color4);\r\n\t\t\t\t\tthis.vertex(x4, y4, color4);\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 8);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tvar t = this.tmp.set(y2 - y1, x1 - x2);\r\n\t\t\t\tt.normalize();\r\n\t\t\t\twidth *= 0.5;\r\n\t\t\t\tvar tx = t.x * width;\r\n\t\t\t\tvar ty = t.y * width;\r\n\t\t\t\tif (!filled) {\r\n\t\t\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\r\n\t\t\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\r\n\t\t\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\r\n\t\t\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\r\n\t\t\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\r\n\t\t\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\r\n\t\t\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\r\n\t\t\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\r\n\t\t\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\r\n\t\t\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\r\n\t\t\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\r\n\t\t\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\r\n\t\t\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.x = function (x, y, size) {\r\n\t\t\t\tthis.line(x - size, y - size, x + size, y + size);\r\n\t\t\t\tthis.line(x - size, y + size, x + size, y - size);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (count < 3)\r\n\t\t\t\t\tthrow new Error(\"Polygon must contain at least 3 vertices\");\r\n\t\t\t\tthis.check(ShapeType.Line, count * 2);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tvar vertices = this.mesh.getVertices();\r\n\t\t\t\tvar idx = this.vertexIndex;\r\n\t\t\t\toffset <<= 1;\r\n\t\t\t\tcount <<= 1;\r\n\t\t\t\tvar firstX = polygonVertices[offset];\r\n\t\t\t\tvar firstY = polygonVertices[offset + 1];\r\n\t\t\t\tvar last = offset + count;\r\n\t\t\t\tfor (var i = offset, n = offset + count - 2; i < n; i += 2) {\r\n\t\t\t\t\tvar x1 = polygonVertices[i];\r\n\t\t\t\t\tvar y1 = polygonVertices[i + 1];\r\n\t\t\t\t\tvar x2 = 0;\r\n\t\t\t\t\tvar y2 = 0;\r\n\t\t\t\t\tif (i + 2 >= last) {\r\n\t\t\t\t\t\tx2 = firstX;\r\n\t\t\t\t\t\ty2 = firstY;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tx2 = polygonVertices[i + 2];\r\n\t\t\t\t\t\ty2 = polygonVertices[i + 3];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.vertex(x1, y1, color);\r\n\t\t\t\t\tthis.vertex(x2, y2, color);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tif (segments === void 0) { segments = 0; }\r\n\t\t\t\tif (segments === 0)\r\n\t\t\t\t\tsegments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0);\r\n\t\t\t\tif (segments <= 0)\r\n\t\t\t\t\tthrow new Error(\"segments must be > 0.\");\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tvar angle = 2 * spine.MathUtils.PI / segments;\r\n\t\t\t\tvar cos = Math.cos(angle);\r\n\t\t\t\tvar sin = Math.sin(angle);\r\n\t\t\t\tvar cx = radius, cy = 0;\r\n\t\t\t\tif (!filled) {\r\n\t\t\t\t\tthis.check(ShapeType.Line, segments * 2 + 2);\r\n\t\t\t\t\tfor (var i = 0; i < segments; i++) {\r\n\t\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t\t\tvar temp_1 = cx;\r\n\t\t\t\t\t\tcx = cos * cx - sin * cy;\r\n\t\t\t\t\t\tcy = sin * temp_1 + cos * cy;\r\n\t\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.check(ShapeType.Filled, segments * 3 + 3);\r\n\t\t\t\t\tsegments--;\r\n\t\t\t\t\tfor (var i = 0; i < segments; i++) {\r\n\t\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t\t\tvar temp_2 = cx;\r\n\t\t\t\t\t\tcx = cos * cx - sin * cy;\r\n\t\t\t\t\t\tcy = sin * temp_2 + cos * cy;\r\n\t\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.vertex(x, y, color);\r\n\t\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t\t}\r\n\t\t\t\tvar temp = cx;\r\n\t\t\t\tcx = radius;\r\n\t\t\t\tcy = 0;\r\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) {\r\n\t\t\t\tif (color === void 0) { color = null; }\r\n\t\t\t\tthis.check(ShapeType.Line, segments * 2 + 2);\r\n\t\t\t\tif (color === null)\r\n\t\t\t\t\tcolor = this.color;\r\n\t\t\t\tvar subdiv_step = 1 / segments;\r\n\t\t\t\tvar subdiv_step2 = subdiv_step * subdiv_step;\r\n\t\t\t\tvar subdiv_step3 = subdiv_step * subdiv_step * subdiv_step;\r\n\t\t\t\tvar pre1 = 3 * subdiv_step;\r\n\t\t\t\tvar pre2 = 3 * subdiv_step2;\r\n\t\t\t\tvar pre4 = 6 * subdiv_step2;\r\n\t\t\t\tvar pre5 = 6 * subdiv_step3;\r\n\t\t\t\tvar tmp1x = x1 - cx1 * 2 + cx2;\r\n\t\t\t\tvar tmp1y = y1 - cy1 * 2 + cy2;\r\n\t\t\t\tvar tmp2x = (cx1 - cx2) * 3 - x1 + x2;\r\n\t\t\t\tvar tmp2y = (cy1 - cy2) * 3 - y1 + y2;\r\n\t\t\t\tvar fx = x1;\r\n\t\t\t\tvar fy = y1;\r\n\t\t\t\tvar dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;\r\n\t\t\t\tvar dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;\r\n\t\t\t\tvar ddfx = tmp1x * pre4 + tmp2x * pre5;\r\n\t\t\t\tvar ddfy = tmp1y * pre4 + tmp2y * pre5;\r\n\t\t\t\tvar dddfx = tmp2x * pre5;\r\n\t\t\t\tvar dddfy = tmp2y * pre5;\r\n\t\t\t\twhile (segments-- > 0) {\r\n\t\t\t\t\tthis.vertex(fx, fy, color);\r\n\t\t\t\t\tfx += dfx;\r\n\t\t\t\t\tfy += dfy;\r\n\t\t\t\t\tdfx += ddfx;\r\n\t\t\t\t\tdfy += ddfy;\r\n\t\t\t\t\tddfx += dddfx;\r\n\t\t\t\t\tddfy += dddfy;\r\n\t\t\t\t\tthis.vertex(fx, fy, color);\r\n\t\t\t\t}\r\n\t\t\t\tthis.vertex(fx, fy, color);\r\n\t\t\t\tthis.vertex(x2, y2, color);\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.vertex = function (x, y, color) {\r\n\t\t\t\tvar idx = this.vertexIndex;\r\n\t\t\t\tvar vertices = this.mesh.getVertices();\r\n\t\t\t\tvertices[idx++] = x;\r\n\t\t\t\tvertices[idx++] = y;\r\n\t\t\t\tvertices[idx++] = color.r;\r\n\t\t\t\tvertices[idx++] = color.g;\r\n\t\t\t\tvertices[idx++] = color.b;\r\n\t\t\t\tvertices[idx++] = color.a;\r\n\t\t\t\tthis.vertexIndex = idx;\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.end = function () {\r\n\t\t\t\tif (!this.isDrawing)\r\n\t\t\t\t\tthrow new Error(\"ShapeRenderer.begin() has not been called\");\r\n\t\t\t\tthis.flush();\r\n\t\t\t\tthis.context.gl.disable(this.context.gl.BLEND);\r\n\t\t\t\tthis.isDrawing = false;\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.flush = function () {\r\n\t\t\t\tif (this.vertexIndex == 0)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tthis.mesh.setVerticesLength(this.vertexIndex);\r\n\t\t\t\tthis.mesh.draw(this.shader, this.shapeType);\r\n\t\t\t\tthis.vertexIndex = 0;\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.check = function (shapeType, numVertices) {\r\n\t\t\t\tif (!this.isDrawing)\r\n\t\t\t\t\tthrow new Error(\"ShapeRenderer.begin() has not been called\");\r\n\t\t\t\tif (this.shapeType == shapeType) {\r\n\t\t\t\t\tif (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices)\r\n\t\t\t\t\t\tthis.flush();\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.flush();\r\n\t\t\t\t\tthis.shapeType = shapeType;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tShapeRenderer.prototype.dispose = function () {\r\n\t\t\t\tthis.mesh.dispose();\r\n\t\t\t};\r\n\t\t\treturn ShapeRenderer;\r\n\t\t}());\r\n\t\twebgl.ShapeRenderer = ShapeRenderer;\r\n\t\tvar ShapeType;\r\n\t\t(function (ShapeType) {\r\n\t\t\tShapeType[ShapeType[\"Point\"] = 0] = \"Point\";\r\n\t\t\tShapeType[ShapeType[\"Line\"] = 1] = \"Line\";\r\n\t\t\tShapeType[ShapeType[\"Filled\"] = 4] = \"Filled\";\r\n\t\t})(ShapeType = webgl.ShapeType || (webgl.ShapeType = {}));\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar SkeletonDebugRenderer = (function () {\r\n\t\t\tfunction SkeletonDebugRenderer(context) {\r\n\t\t\t\tthis.boneLineColor = new spine.Color(1, 0, 0, 1);\r\n\t\t\t\tthis.boneOriginColor = new spine.Color(0, 1, 0, 1);\r\n\t\t\t\tthis.attachmentLineColor = new spine.Color(0, 0, 1, 0.5);\r\n\t\t\t\tthis.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5);\r\n\t\t\t\tthis.pathColor = new spine.Color().setFromString(\"FF7F00\");\r\n\t\t\t\tthis.clipColor = new spine.Color(0.8, 0, 0, 2);\r\n\t\t\t\tthis.aabbColor = new spine.Color(0, 1, 0, 0.5);\r\n\t\t\t\tthis.drawBones = true;\r\n\t\t\t\tthis.drawRegionAttachments = true;\r\n\t\t\t\tthis.drawBoundingBoxes = true;\r\n\t\t\t\tthis.drawMeshHull = true;\r\n\t\t\t\tthis.drawMeshTriangles = true;\r\n\t\t\t\tthis.drawPaths = true;\r\n\t\t\t\tthis.drawSkeletonXY = false;\r\n\t\t\t\tthis.drawClipping = true;\r\n\t\t\t\tthis.premultipliedAlpha = false;\r\n\t\t\t\tthis.scale = 1;\r\n\t\t\t\tthis.boneWidth = 2;\r\n\t\t\t\tthis.bounds = new spine.SkeletonBounds();\r\n\t\t\t\tthis.temp = new Array();\r\n\t\t\t\tthis.vertices = spine.Utils.newFloatArray(2 * 1024);\r\n\t\t\t\tthis.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n\t\t\t}\r\n\t\t\tSkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) {\r\n\t\t\t\tif (ignoredBones === void 0) { ignoredBones = null; }\r\n\t\t\t\tvar skeletonX = skeleton.x;\r\n\t\t\t\tvar skeletonY = skeleton.y;\r\n\t\t\t\tvar gl = this.context.gl;\r\n\t\t\t\tvar srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA;\r\n\t\t\t\tshapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA);\r\n\t\t\t\tvar bones = skeleton.bones;\r\n\t\t\t\tif (this.drawBones) {\r\n\t\t\t\t\tshapes.setColor(this.boneLineColor);\r\n\t\t\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\t\t\tvar bone = bones[i];\r\n\t\t\t\t\t\tif (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tif (bone.parent == null)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tvar x = skeletonX + bone.data.length * bone.a + bone.worldX;\r\n\t\t\t\t\t\tvar y = skeletonY + bone.data.length * bone.c + bone.worldY;\r\n\t\t\t\t\t\tshapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.drawSkeletonXY)\r\n\t\t\t\t\t\tshapes.x(skeletonX, skeletonY, 4 * this.scale);\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawRegionAttachments) {\r\n\t\t\t\t\tshapes.setColor(this.attachmentLineColor);\r\n\t\t\t\t\tvar slots = skeleton.slots;\r\n\t\t\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\t\t\tvar slot = slots[i];\r\n\t\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\t\tif (attachment instanceof spine.RegionAttachment) {\r\n\t\t\t\t\t\t\tvar regionAttachment = attachment;\r\n\t\t\t\t\t\t\tvar vertices = this.vertices;\r\n\t\t\t\t\t\t\tregionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n\t\t\t\t\t\t\tshapes.line(vertices[0], vertices[1], vertices[2], vertices[3]);\r\n\t\t\t\t\t\t\tshapes.line(vertices[2], vertices[3], vertices[4], vertices[5]);\r\n\t\t\t\t\t\t\tshapes.line(vertices[4], vertices[5], vertices[6], vertices[7]);\r\n\t\t\t\t\t\t\tshapes.line(vertices[6], vertices[7], vertices[0], vertices[1]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawMeshHull || this.drawMeshTriangles) {\r\n\t\t\t\t\tvar slots = skeleton.slots;\r\n\t\t\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\t\t\tvar slot = slots[i];\r\n\t\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\t\tif (!(attachment instanceof spine.MeshAttachment))\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tvar mesh = attachment;\r\n\t\t\t\t\t\tvar vertices = this.vertices;\r\n\t\t\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2);\r\n\t\t\t\t\t\tvar triangles = mesh.triangles;\r\n\t\t\t\t\t\tvar hullLength = mesh.hullLength;\r\n\t\t\t\t\t\tif (this.drawMeshTriangles) {\r\n\t\t\t\t\t\t\tshapes.setColor(this.triangleLineColor);\r\n\t\t\t\t\t\t\tfor (var ii = 0, nn = triangles.length; ii < nn; ii += 3) {\r\n\t\t\t\t\t\t\t\tvar v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2;\r\n\t\t\t\t\t\t\t\tshapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.drawMeshHull && hullLength > 0) {\r\n\t\t\t\t\t\t\tshapes.setColor(this.attachmentLineColor);\r\n\t\t\t\t\t\t\thullLength = (hullLength >> 1) * 2;\r\n\t\t\t\t\t\t\tvar lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1];\r\n\t\t\t\t\t\t\tfor (var ii = 0, nn = hullLength; ii < nn; ii += 2) {\r\n\t\t\t\t\t\t\t\tvar x = vertices[ii], y = vertices[ii + 1];\r\n\t\t\t\t\t\t\t\tshapes.line(x, y, lastX, lastY);\r\n\t\t\t\t\t\t\t\tlastX = x;\r\n\t\t\t\t\t\t\t\tlastY = y;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawBoundingBoxes) {\r\n\t\t\t\t\tvar bounds = this.bounds;\r\n\t\t\t\t\tbounds.update(skeleton, true);\r\n\t\t\t\t\tshapes.setColor(this.aabbColor);\r\n\t\t\t\t\tshapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight());\r\n\t\t\t\t\tvar polygons = bounds.polygons;\r\n\t\t\t\t\tvar boxes = bounds.boundingBoxes;\r\n\t\t\t\t\tfor (var i = 0, n = polygons.length; i < n; i++) {\r\n\t\t\t\t\t\tvar polygon = polygons[i];\r\n\t\t\t\t\t\tshapes.setColor(boxes[i].color);\r\n\t\t\t\t\t\tshapes.polygon(polygon, 0, polygon.length);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawPaths) {\r\n\t\t\t\t\tvar slots = skeleton.slots;\r\n\t\t\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\t\t\tvar slot = slots[i];\r\n\t\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\t\tif (!(attachment instanceof spine.PathAttachment))\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tvar path = attachment;\r\n\t\t\t\t\t\tvar nn = path.worldVerticesLength;\r\n\t\t\t\t\t\tvar world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0);\r\n\t\t\t\t\t\tpath.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n\t\t\t\t\t\tvar color = this.pathColor;\r\n\t\t\t\t\t\tvar x1 = world[2], y1 = world[3], x2 = 0, y2 = 0;\r\n\t\t\t\t\t\tif (path.closed) {\r\n\t\t\t\t\t\t\tshapes.setColor(color);\r\n\t\t\t\t\t\t\tvar cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1];\r\n\t\t\t\t\t\t\tx2 = world[nn - 4];\r\n\t\t\t\t\t\t\ty2 = world[nn - 3];\r\n\t\t\t\t\t\t\tshapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\r\n\t\t\t\t\t\t\tshapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\r\n\t\t\t\t\t\t\tshapes.line(x1, y1, cx1, cy1);\r\n\t\t\t\t\t\t\tshapes.line(x2, y2, cx2, cy2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tnn -= 4;\r\n\t\t\t\t\t\tfor (var ii = 4; ii < nn; ii += 6) {\r\n\t\t\t\t\t\t\tvar cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3];\r\n\t\t\t\t\t\t\tx2 = world[ii + 4];\r\n\t\t\t\t\t\t\ty2 = world[ii + 5];\r\n\t\t\t\t\t\t\tshapes.setColor(color);\r\n\t\t\t\t\t\t\tshapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\r\n\t\t\t\t\t\t\tshapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\r\n\t\t\t\t\t\t\tshapes.line(x1, y1, cx1, cy1);\r\n\t\t\t\t\t\t\tshapes.line(x2, y2, cx2, cy2);\r\n\t\t\t\t\t\t\tx1 = x2;\r\n\t\t\t\t\t\t\ty1 = y2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawBones) {\r\n\t\t\t\t\tshapes.setColor(this.boneOriginColor);\r\n\t\t\t\t\tfor (var i = 0, n = bones.length; i < n; i++) {\r\n\t\t\t\t\t\tvar bone = bones[i];\r\n\t\t\t\t\t\tif (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tshapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.drawClipping) {\r\n\t\t\t\t\tvar slots = skeleton.slots;\r\n\t\t\t\t\tshapes.setColor(this.clipColor);\r\n\t\t\t\t\tfor (var i = 0, n = slots.length; i < n; i++) {\r\n\t\t\t\t\t\tvar slot = slots[i];\r\n\t\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\t\tif (!(attachment instanceof spine.ClippingAttachment))\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tvar clip = attachment;\r\n\t\t\t\t\t\tvar nn = clip.worldVerticesLength;\r\n\t\t\t\t\t\tvar world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0);\r\n\t\t\t\t\t\tclip.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n\t\t\t\t\t\tfor (var i_20 = 0, n_2 = world.length; i_20 < n_2; i_20 += 2) {\r\n\t\t\t\t\t\t\tvar x = world[i_20];\r\n\t\t\t\t\t\t\tvar y = world[i_20 + 1];\r\n\t\t\t\t\t\t\tvar x2 = world[(i_20 + 2) % world.length];\r\n\t\t\t\t\t\t\tvar y2 = world[(i_20 + 3) % world.length];\r\n\t\t\t\t\t\t\tshapes.line(x, y, x2, y2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tSkeletonDebugRenderer.prototype.dispose = function () {\r\n\t\t\t};\r\n\t\t\tSkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1);\r\n\t\t\tSkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1);\r\n\t\t\treturn SkeletonDebugRenderer;\r\n\t\t}());\r\n\t\twebgl.SkeletonDebugRenderer = SkeletonDebugRenderer;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar Renderable = (function () {\r\n\t\t\tfunction Renderable(vertices, numVertices, numFloats) {\r\n\t\t\t\tthis.vertices = vertices;\r\n\t\t\t\tthis.numVertices = numVertices;\r\n\t\t\t\tthis.numFloats = numFloats;\r\n\t\t\t}\r\n\t\t\treturn Renderable;\r\n\t\t}());\r\n\t\t;\r\n\t\tvar SkeletonRenderer = (function () {\r\n\t\t\tfunction SkeletonRenderer(context, twoColorTint) {\r\n\t\t\t\tif (twoColorTint === void 0) { twoColorTint = true; }\r\n\t\t\t\tthis.premultipliedAlpha = false;\r\n\t\t\t\tthis.vertexEffect = null;\r\n\t\t\t\tthis.tempColor = new spine.Color();\r\n\t\t\t\tthis.tempColor2 = new spine.Color();\r\n\t\t\t\tthis.vertexSize = 2 + 2 + 4;\r\n\t\t\t\tthis.twoColorTint = false;\r\n\t\t\t\tthis.renderable = new Renderable(null, 0, 0);\r\n\t\t\t\tthis.clipper = new spine.SkeletonClipping();\r\n\t\t\t\tthis.temp = new spine.Vector2();\r\n\t\t\t\tthis.temp2 = new spine.Vector2();\r\n\t\t\t\tthis.temp3 = new spine.Color();\r\n\t\t\t\tthis.temp4 = new spine.Color();\r\n\t\t\t\tthis.twoColorTint = twoColorTint;\r\n\t\t\t\tif (twoColorTint)\r\n\t\t\t\t\tthis.vertexSize += 4;\r\n\t\t\t\tthis.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024);\r\n\t\t\t}\r\n\t\t\tSkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) {\r\n\t\t\t\tif (slotRangeStart === void 0) { slotRangeStart = -1; }\r\n\t\t\t\tif (slotRangeEnd === void 0) { slotRangeEnd = -1; }\r\n\t\t\t\tvar clipper = this.clipper;\r\n\t\t\t\tvar premultipliedAlpha = this.premultipliedAlpha;\r\n\t\t\t\tvar twoColorTint = this.twoColorTint;\r\n\t\t\t\tvar blendMode = null;\r\n\t\t\t\tvar tempPos = this.temp;\r\n\t\t\t\tvar tempUv = this.temp2;\r\n\t\t\t\tvar tempLight = this.temp3;\r\n\t\t\t\tvar tempDark = this.temp4;\r\n\t\t\t\tvar renderable = this.renderable;\r\n\t\t\t\tvar uvs = null;\r\n\t\t\t\tvar triangles = null;\r\n\t\t\t\tvar drawOrder = skeleton.drawOrder;\r\n\t\t\t\tvar attachmentColor = null;\r\n\t\t\t\tvar skeletonColor = skeleton.color;\r\n\t\t\t\tvar vertexSize = twoColorTint ? 12 : 8;\r\n\t\t\t\tvar inRange = false;\r\n\t\t\t\tif (slotRangeStart == -1)\r\n\t\t\t\t\tinRange = true;\r\n\t\t\t\tfor (var i = 0, n = drawOrder.length; i < n; i++) {\r\n\t\t\t\t\tvar clippedVertexSize = clipper.isClipping() ? 2 : vertexSize;\r\n\t\t\t\t\tvar slot = drawOrder[i];\r\n\t\t\t\t\tif (slotRangeStart >= 0 && slotRangeStart == slot.data.index) {\r\n\t\t\t\t\t\tinRange = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!inRange) {\r\n\t\t\t\t\t\tclipper.clipEndWithSlot(slot);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) {\r\n\t\t\t\t\t\tinRange = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar attachment = slot.getAttachment();\r\n\t\t\t\t\tvar texture = null;\r\n\t\t\t\t\tif (attachment instanceof spine.RegionAttachment) {\r\n\t\t\t\t\t\tvar region = attachment;\r\n\t\t\t\t\t\trenderable.vertices = this.vertices;\r\n\t\t\t\t\t\trenderable.numVertices = 4;\r\n\t\t\t\t\t\trenderable.numFloats = clippedVertexSize << 2;\r\n\t\t\t\t\t\tregion.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize);\r\n\t\t\t\t\t\ttriangles = SkeletonRenderer.QUAD_TRIANGLES;\r\n\t\t\t\t\t\tuvs = region.uvs;\r\n\t\t\t\t\t\ttexture = region.region.renderObject.texture;\r\n\t\t\t\t\t\tattachmentColor = region.color;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (attachment instanceof spine.MeshAttachment) {\r\n\t\t\t\t\t\tvar mesh = attachment;\r\n\t\t\t\t\t\trenderable.vertices = this.vertices;\r\n\t\t\t\t\t\trenderable.numVertices = (mesh.worldVerticesLength >> 1);\r\n\t\t\t\t\t\trenderable.numFloats = renderable.numVertices * clippedVertexSize;\r\n\t\t\t\t\t\tif (renderable.numFloats > renderable.vertices.length) {\r\n\t\t\t\t\t\t\trenderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize);\r\n\t\t\t\t\t\ttriangles = mesh.triangles;\r\n\t\t\t\t\t\ttexture = mesh.region.renderObject.texture;\r\n\t\t\t\t\t\tuvs = mesh.uvs;\r\n\t\t\t\t\t\tattachmentColor = mesh.color;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (attachment instanceof spine.ClippingAttachment) {\r\n\t\t\t\t\t\tvar clip = (attachment);\r\n\t\t\t\t\t\tclipper.clipStart(slot, clip);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tclipper.clipEndWithSlot(slot);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (texture != null) {\r\n\t\t\t\t\t\tvar slotColor = slot.color;\r\n\t\t\t\t\t\tvar finalColor = this.tempColor;\r\n\t\t\t\t\t\tfinalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r;\r\n\t\t\t\t\t\tfinalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g;\r\n\t\t\t\t\t\tfinalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b;\r\n\t\t\t\t\t\tfinalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a;\r\n\t\t\t\t\t\tif (premultipliedAlpha) {\r\n\t\t\t\t\t\t\tfinalColor.r *= finalColor.a;\r\n\t\t\t\t\t\t\tfinalColor.g *= finalColor.a;\r\n\t\t\t\t\t\t\tfinalColor.b *= finalColor.a;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar darkColor = this.tempColor2;\r\n\t\t\t\t\t\tif (slot.darkColor == null)\r\n\t\t\t\t\t\t\tdarkColor.set(0, 0, 0, 1.0);\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (premultipliedAlpha) {\r\n\t\t\t\t\t\t\t\tdarkColor.r = slot.darkColor.r * finalColor.a;\r\n\t\t\t\t\t\t\t\tdarkColor.g = slot.darkColor.g * finalColor.a;\r\n\t\t\t\t\t\t\t\tdarkColor.b = slot.darkColor.b * finalColor.a;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tdarkColor.setFromColor(slot.darkColor);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tdarkColor.a = premultipliedAlpha ? 1.0 : 0.0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar slotBlendMode = slot.data.blendMode;\r\n\t\t\t\t\t\tif (slotBlendMode != blendMode) {\r\n\t\t\t\t\t\t\tblendMode = slotBlendMode;\r\n\t\t\t\t\t\t\tbatcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (clipper.isClipping()) {\r\n\t\t\t\t\t\t\tclipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint);\r\n\t\t\t\t\t\t\tvar clippedVertices = new Float32Array(clipper.clippedVertices);\r\n\t\t\t\t\t\t\tvar clippedTriangles = clipper.clippedTriangles;\r\n\t\t\t\t\t\t\tif (this.vertexEffect != null) {\r\n\t\t\t\t\t\t\t\tvar vertexEffect = this.vertexEffect;\r\n\t\t\t\t\t\t\t\tvar verts = clippedVertices;\r\n\t\t\t\t\t\t\t\tif (!twoColorTint) {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 0, n_3 = clippedVertices.length; v < n_3; v += vertexSize) {\r\n\t\t\t\t\t\t\t\t\t\ttempPos.x = verts[v];\r\n\t\t\t\t\t\t\t\t\t\ttempPos.y = verts[v + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]);\r\n\t\t\t\t\t\t\t\t\t\ttempUv.x = verts[v + 6];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.y = verts[v + 7];\r\n\t\t\t\t\t\t\t\t\t\ttempDark.set(0, 0, 0, 0);\r\n\t\t\t\t\t\t\t\t\t\tvertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = tempPos.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = tempPos.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = tempLight.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = tempLight.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = tempLight.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = tempLight.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 6] = tempUv.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 7] = tempUv.y;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) {\r\n\t\t\t\t\t\t\t\t\t\ttempPos.x = verts[v];\r\n\t\t\t\t\t\t\t\t\t\ttempPos.y = verts[v + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]);\r\n\t\t\t\t\t\t\t\t\t\ttempUv.x = verts[v + 6];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.y = verts[v + 7];\r\n\t\t\t\t\t\t\t\t\t\ttempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]);\r\n\t\t\t\t\t\t\t\t\t\tvertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = tempPos.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = tempPos.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = tempLight.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = tempLight.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = tempLight.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = tempLight.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 6] = tempUv.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 7] = tempUv.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 8] = tempDark.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 9] = tempDark.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 10] = tempDark.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 11] = tempDark.a;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbatcher.draw(texture, clippedVertices, clippedTriangles);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tvar verts = renderable.vertices;\r\n\t\t\t\t\t\t\tif (this.vertexEffect != null) {\r\n\t\t\t\t\t\t\t\tvar vertexEffect = this.vertexEffect;\r\n\t\t\t\t\t\t\t\tif (!twoColorTint) {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 0, u = 0, n_5 = renderable.numFloats; v < n_5; v += vertexSize, u += 2) {\r\n\t\t\t\t\t\t\t\t\t\ttempPos.x = verts[v];\r\n\t\t\t\t\t\t\t\t\t\ttempPos.y = verts[v + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.x = uvs[u];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.y = uvs[u + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempLight.setFromColor(finalColor);\r\n\t\t\t\t\t\t\t\t\t\ttempDark.set(0, 0, 0, 0);\r\n\t\t\t\t\t\t\t\t\t\tvertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = tempPos.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = tempPos.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = tempLight.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = tempLight.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = tempLight.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = tempLight.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 6] = tempUv.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 7] = tempUv.y;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) {\r\n\t\t\t\t\t\t\t\t\t\ttempPos.x = verts[v];\r\n\t\t\t\t\t\t\t\t\t\ttempPos.y = verts[v + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.x = uvs[u];\r\n\t\t\t\t\t\t\t\t\t\ttempUv.y = uvs[u + 1];\r\n\t\t\t\t\t\t\t\t\t\ttempLight.setFromColor(finalColor);\r\n\t\t\t\t\t\t\t\t\t\ttempDark.setFromColor(darkColor);\r\n\t\t\t\t\t\t\t\t\t\tvertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = tempPos.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = tempPos.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = tempLight.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = tempLight.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = tempLight.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = tempLight.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 6] = tempUv.x;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 7] = tempUv.y;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 8] = tempDark.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 9] = tempDark.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 10] = tempDark.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 11] = tempDark.a;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tif (!twoColorTint) {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 2, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) {\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = finalColor.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = finalColor.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = finalColor.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = finalColor.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = uvs[u];\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = uvs[u + 1];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tfor (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) {\r\n\t\t\t\t\t\t\t\t\t\tverts[v] = finalColor.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 1] = finalColor.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 2] = finalColor.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 3] = finalColor.a;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 4] = uvs[u];\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 5] = uvs[u + 1];\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 6] = darkColor.r;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 7] = darkColor.g;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 8] = darkColor.b;\r\n\t\t\t\t\t\t\t\t\t\tverts[v + 9] = darkColor.a;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvar view = renderable.vertices.subarray(0, renderable.numFloats);\r\n\t\t\t\t\t\t\tbatcher.draw(texture, view, triangles);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclipper.clipEndWithSlot(slot);\r\n\t\t\t\t}\r\n\t\t\t\tclipper.clipEnd();\r\n\t\t\t};\r\n\t\t\tSkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n\t\t\treturn SkeletonRenderer;\r\n\t\t}());\r\n\t\twebgl.SkeletonRenderer = SkeletonRenderer;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar Vector3 = (function () {\r\n\t\t\tfunction Vector3(x, y, z) {\r\n\t\t\t\tif (x === void 0) { x = 0; }\r\n\t\t\t\tif (y === void 0) { y = 0; }\r\n\t\t\t\tif (z === void 0) { z = 0; }\r\n\t\t\t\tthis.x = 0;\r\n\t\t\t\tthis.y = 0;\r\n\t\t\t\tthis.z = 0;\r\n\t\t\t\tthis.x = x;\r\n\t\t\t\tthis.y = y;\r\n\t\t\t\tthis.z = z;\r\n\t\t\t}\r\n\t\t\tVector3.prototype.setFrom = function (v) {\r\n\t\t\t\tthis.x = v.x;\r\n\t\t\t\tthis.y = v.y;\r\n\t\t\t\tthis.z = v.z;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.set = function (x, y, z) {\r\n\t\t\t\tthis.x = x;\r\n\t\t\t\tthis.y = y;\r\n\t\t\t\tthis.z = z;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.add = function (v) {\r\n\t\t\t\tthis.x += v.x;\r\n\t\t\t\tthis.y += v.y;\r\n\t\t\t\tthis.z += v.z;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.sub = function (v) {\r\n\t\t\t\tthis.x -= v.x;\r\n\t\t\t\tthis.y -= v.y;\r\n\t\t\t\tthis.z -= v.z;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.scale = function (s) {\r\n\t\t\t\tthis.x *= s;\r\n\t\t\t\tthis.y *= s;\r\n\t\t\t\tthis.z *= s;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.normalize = function () {\r\n\t\t\t\tvar len = this.length();\r\n\t\t\t\tif (len == 0)\r\n\t\t\t\t\treturn this;\r\n\t\t\t\tlen = 1 / len;\r\n\t\t\t\tthis.x *= len;\r\n\t\t\t\tthis.y *= len;\r\n\t\t\t\tthis.z *= len;\r\n\t\t\t\treturn this;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.cross = function (v) {\r\n\t\t\t\treturn this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x);\r\n\t\t\t};\r\n\t\t\tVector3.prototype.multiply = function (matrix) {\r\n\t\t\t\tvar l_mat = matrix.values;\r\n\t\t\t\treturn this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]);\r\n\t\t\t};\r\n\t\t\tVector3.prototype.project = function (matrix) {\r\n\t\t\t\tvar l_mat = matrix.values;\r\n\t\t\t\tvar l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]);\r\n\t\t\t\treturn this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w);\r\n\t\t\t};\r\n\t\t\tVector3.prototype.dot = function (v) {\r\n\t\t\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\r\n\t\t\t};\r\n\t\t\tVector3.prototype.length = function () {\r\n\t\t\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\r\n\t\t\t};\r\n\t\t\tVector3.prototype.distance = function (v) {\r\n\t\t\t\tvar a = v.x - this.x;\r\n\t\t\t\tvar b = v.y - this.y;\r\n\t\t\t\tvar c = v.z - this.z;\r\n\t\t\t\treturn Math.sqrt(a * a + b * b + c * c);\r\n\t\t\t};\r\n\t\t\treturn Vector3;\r\n\t\t}());\r\n\t\twebgl.Vector3 = Vector3;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n\tvar webgl;\r\n\t(function (webgl) {\r\n\t\tvar ManagedWebGLRenderingContext = (function () {\r\n\t\t\tfunction ManagedWebGLRenderingContext(canvasOrContext, contextConfig) {\r\n\t\t\t\tif (contextConfig === void 0) { contextConfig = { alpha: \"true\" }; }\r\n\t\t\t\tvar _this = this;\r\n\t\t\t\tthis.restorables = new Array();\r\n\t\t\t\tif (canvasOrContext instanceof HTMLCanvasElement) {\r\n\t\t\t\t\tvar canvas = canvasOrContext;\r\n\t\t\t\t\tthis.gl = (canvas.getContext(\"webgl\", contextConfig) || canvas.getContext(\"experimental-webgl\", contextConfig));\r\n\t\t\t\t\tthis.canvas = canvas;\r\n\t\t\t\t\tcanvas.addEventListener(\"webglcontextlost\", function (e) {\r\n\t\t\t\t\t\tvar event = e;\r\n\t\t\t\t\t\tif (e) {\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tcanvas.addEventListener(\"webglcontextrestored\", function (e) {\r\n\t\t\t\t\t\tfor (var i = 0, n = _this.restorables.length; i < n; i++) {\r\n\t\t\t\t\t\t\t_this.restorables[i].restore();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.gl = canvasOrContext;\r\n\t\t\t\t\tthis.canvas = this.gl.canvas;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) {\r\n\t\t\t\tthis.restorables.push(restorable);\r\n\t\t\t};\r\n\t\t\tManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) {\r\n\t\t\t\tvar index = this.restorables.indexOf(restorable);\r\n\t\t\t\tif (index > -1)\r\n\t\t\t\t\tthis.restorables.splice(index, 1);\r\n\t\t\t};\r\n\t\t\treturn ManagedWebGLRenderingContext;\r\n\t\t}());\r\n\t\twebgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext;\r\n\t\tvar WebGLBlendModeConverter = (function () {\r\n\t\t\tfunction WebGLBlendModeConverter() {\r\n\t\t\t}\r\n\t\t\tWebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) {\r\n\t\t\t\tswitch (blendMode) {\r\n\t\t\t\t\tcase spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n\t\t\t\t\tcase spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE;\r\n\t\t\t\t\tcase spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n\t\t\t\t\tcase spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n\t\t\t\t\tdefault: throw new Error(\"Unknown blend mode: \" + blendMode);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tWebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) {\r\n\t\t\t\tif (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n\t\t\t\tswitch (blendMode) {\r\n\t\t\t\t\tcase spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA;\r\n\t\t\t\t\tcase spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA;\r\n\t\t\t\t\tcase spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR;\r\n\t\t\t\t\tcase spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE;\r\n\t\t\t\t\tdefault: throw new Error(\"Unknown blend mode: \" + blendMode);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tWebGLBlendModeConverter.ZERO = 0;\r\n\t\t\tWebGLBlendModeConverter.ONE = 1;\r\n\t\t\tWebGLBlendModeConverter.SRC_COLOR = 0x0300;\r\n\t\t\tWebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301;\r\n\t\t\tWebGLBlendModeConverter.SRC_ALPHA = 0x0302;\r\n\t\t\tWebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303;\r\n\t\t\tWebGLBlendModeConverter.DST_ALPHA = 0x0304;\r\n\t\t\tWebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305;\r\n\t\t\tWebGLBlendModeConverter.DST_COLOR = 0x0306;\r\n\t\t\treturn WebGLBlendModeConverter;\r\n\t\t}());\r\n\t\twebgl.WebGLBlendModeConverter = WebGLBlendModeConverter;\r\n\t})(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\n//# sourceMappingURL=spine-webgl.js.map\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = spine;\n}.call(window));"],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/spine/src/SpineFile.js b/plugins/spine/src/SpineFile.js index e3924a877..d437aa659 100644 --- a/plugins/spine/src/SpineFile.js +++ b/plugins/spine/src/SpineFile.js @@ -39,10 +39,11 @@ var TextFile = require('../../../src/loader/filetypes/TextFile.js'); * @constructor * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Loader.FileTypes.UnityAtlasFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image 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 {(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 {XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @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({ @@ -51,10 +52,15 @@ var SpineFile = new Class({ initialize: - function SpineFile (loader, key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings) + 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)) { @@ -69,29 +75,58 @@ var SpineFile = new Class({ xhrSettings: GetFastValue(config, 'jsonXhrSettings') }); - atlas = new TextFile(loader, { - key: key, - url: GetFastValue(config, 'atlasURL'), - extension: GetFastValue(config, 'atlasExtension', 'atlas'), - xhrSettings: GetFastValue(config, 'atlasXhrSettings') - }); + 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, + 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); - atlas = new TextFile(loader, key, atlasURL, atlasXhrSettings); - } - - atlas.cache = loader.cacheManager.custom.spine; - MultiFile.call(this, loader, 'spine', key, [ json, atlas ]); + 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.MultiFile#onFileComplete - * @since 3.7.0 + * @method Phaser.Loader.FileTypes.SpineFile#onFileComplete + * @since 3.19.0 * * @param {Phaser.Loader.File} file - The File that has completed processing. */ @@ -164,7 +199,7 @@ var SpineFile = new Class({ * Adds this file to its target cache upon successful loading and processing. * * @method Phaser.Loader.FileTypes.SpineFile#addToCache - * @since 3.16.0 + * @since 3.19.0 */ addToCache: function () { @@ -174,152 +209,39 @@ var SpineFile = new Class({ fileJSON.addToCache(); - var fileText = this.files[1]; + var atlasCache; + var atlasKey = ''; + var combinedAtlastData = ''; + var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; - fileText.addToCache(); - - for (var i = 2; i < this.files.length; i++) + for (var i = 1; i < this.files.length; i++) { var file = this.files[i]; - var key = file.key.substr(4).trim(); + if (file.type === 'text') + { + atlasKey = file.key.substr(0, file.key.length - 2); - this.loader.textureManager.addImage(key, file.data); + atlasCache = file.cache; + + combinedAtlastData = combinedAtlastData.concat(file.data); + } + else + { + var key = file.key.substr(4).trim(); + + this.loader.textureManager.addImage(key, file.data); + } file.pendingDestroy(); } + atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlastData }); + this.complete = true; } } }); -/** - * Adds a Unity YAML based Texture Atlas, or array of atlases, 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.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.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. - * - * 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 atlas data to be provided in a YAML formatted text file as exported from Unity. - * - * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. - * - * 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.unityAtlas({ - * key: 'mainmenu', - * textureURL: 'images/MainMenu.png', - * atlasURL: 'images/MainMenu.txt' - * }); - * ``` - * - * See the documentation for `Phaser.Loader.FileTypes.SpineFileConfig` for more details. - * - * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: - * - * ```javascript - * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json'); - * // and later in your game ... - * this.add.image(x, y, 'mainmenu', 'background'); - * ``` - * - * To get a list of all available frames within an atlas please consult your Texture Atlas software. - * - * 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.unityAtlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.txt'); - * ``` - * - * Or, if you are using a config object use the `normalMap` property: - * - * ```javascript - * this.load.unityAtlas({ - * key: 'mainmenu', - * textureURL: 'images/MainMenu.png', - * normalMap: 'images/MainMenu-n.png', - * atlasURL: 'images/MainMenu.txt' - * }); - * ``` - * - * 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. - * - * Note: The ability to load this type of file will only be available if the Unity Atlas 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#spine - * @fires Phaser.Loader.LoaderPlugin#addFileEvent - * @since 3.16.0 - * - * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig|Phaser.Loader.FileTypes.SpineFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image 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 {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 {XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image 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. - * - * @return {Phaser.Loader.LoaderPlugin} The Loader instance. -FileTypesManager.register('spine', function (key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings) -{ - var multifile; - - // Supports an Object file definition in the key argument - // Or an array of objects in the key argument - // Or a single entry where all arguments have been defined - - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - multifile = new SpineFile(this, key[i]); - - this.addFile(multifile.files); - } - } - else - { - multifile = new SpineFile(this, key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings); - - this.addFile(multifile.files); - } - - return this; -}); - */ - module.exports = SpineFile; diff --git a/plugins/spine/src/SpinePlugin.js b/plugins/spine/src/SpinePlugin.js index 702d5c130..01d7cb7c6 100644 --- a/plugins/spine/src/SpinePlugin.js +++ b/plugins/spine/src/SpinePlugin.js @@ -1,20 +1,96 @@ /** * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. + * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ +var BuildGameObject = require('../../../src/gameobjects/BuildGameObject'); var Class = require('../../../src/utils/Class'); var GetValue = require('../../../src/utils/object/GetValue'); +var ResizeEvent = require('../../../src/scale/events/RESIZE_EVENT'); var ScenePlugin = require('../../../src/plugins/ScenePlugin'); -var SpineFile = require('./SpineFile'); var Spine = require('Spine'); +var SpineFile = require('./SpineFile'); var SpineGameObject = require('./gameobject/SpineGameObject'); -var Matrix4 = require('../../../src/math/Matrix4'); /** * @classdesc - * TODO + * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game objects. + * + * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin + * uses the Spine 3.7 runtimes. Files created in a more recent version of Spine may not work as a result. + * + * You can find more details about Spine at http://esotericsoftware.com/. + * + * 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. + * + * 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 a Game Object Factory method, allowin you to create Spine Game Objects: + * + * ```javascript + * this.add.spine(512, 650, 'stretchyman') + * ``` + * + * 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 preMultipiedAlpha 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. + * + * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference * * @class SpinePlugin * @extends Phaser.Plugins.ScenePlugin @@ -36,34 +112,154 @@ var SpinePlugin = new Class({ 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); - // Create a custom cache to store the spine data (.atlas files) + /** + * 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; - this.skeletonRenderer; - + /** + * 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; - this.mvp; - this.shader; - this.batcher; - this.debugRenderer; - this.debugShader; - console.log('SpinePlugin created', '- WebGL:', this.isWebGL); + /** + * 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. + * + * 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; @@ -72,21 +268,30 @@ var SpinePlugin = new Class({ { this.runtime = Spine.canvas; + this.renderer = game.renderer; + this.getAtlas = this.getAtlasCanvas; } - // Register our file type pluginManager.registerFileType('spine', this.spineFileCallback, scene); - // Register our game object - pluginManager.registerGameObject('spine', this.createSpineFactory(this)); + pluginManager.registerGameObject('spine', this.add.bind(this), this.make.bind(this)); }, + /** + * 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 { @@ -99,16 +304,74 @@ var SpinePlugin = new Class({ eventEmitter.once('destroy', this.destroy, this); }, + /** + * Internal boot handler for the Canvas Renderer. + * + * @method SpinePlugin#bootCanvas + * @private + * @since 3.19.0 + */ bootCanvas: function () { - this.skeletonRenderer = new this.runtime.SkeletonRenderer(this.scene.sys.context); + 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 () + { + this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + + // Monkeypatch the Spine setBlendMode functions, or batching is destroyed + + var setBlendMode = function (srcBlend, dstBlend) + { + if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend) + { + var gl = this.context.gl; + + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + + if (this.isDrawing) + { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + } + }; + + this.sceneRenderer.batcher.setBlendMode = setBlendMode; + this.sceneRenderer.shapes.setBlendMode = setBlendMode; + + this.skeletonRenderer = this.sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = this.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 atlasData = this.cache.get(key); + var atlasEntry = this.cache.get(key); - if (!atlasData) + if (!atlasEntry) { console.warn('No atlas data for: ' + key); return; @@ -119,7 +382,7 @@ var SpinePlugin = new Class({ if (spineTextures.has(key)) { - atlas = new Spine.TextureAtlas(atlasData, function () + atlas = new Spine.TextureAtlas(atlasEntry.data, function () { return spineTextures.get(key); }); @@ -128,7 +391,7 @@ var SpinePlugin = new Class({ { var textures = this.textures; - atlas = new Spine.TextureAtlas(atlasData, function (path) + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) { var canvasTexture = new Spine.canvas.CanvasTexture(textures.get(path).getSourceImage()); @@ -141,31 +404,22 @@ var SpinePlugin = new Class({ return atlas; }, - bootWebGL: function () - { - var gl = this.gl; - var runtime = this.runtime; - - this.mvp = new Matrix4(); - - // Create a simple shader, mesh, model-view-projection matrix and SkeletonRenderer. - this.shader = runtime.Shader.newTwoColoredTextured(gl); - this.batcher = new runtime.PolygonBatcher(gl); - - this.skeletonRenderer = new runtime.SkeletonRenderer(gl); - - this.shapes = new runtime.ShapeRenderer(gl); - - this.debugRenderer = new runtime.SkeletonDebugRenderer(gl); - - this.debugShader = runtime.Shader.newColored(gl); - }, - + /** + * 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 atlasData = this.cache.get(key); + var atlasEntry = this.cache.get(key); - if (!atlasData) + if (!atlasEntry) { console.warn('No atlas data for: ' + key); return; @@ -176,7 +430,7 @@ var SpinePlugin = new Class({ if (spineTextures.has(key)) { - atlas = new Spine.TextureAtlas(atlasData, function () + atlas = new Spine.TextureAtlas(atlasEntry.data, function () { return spineTextures.get(key); }); @@ -185,11 +439,13 @@ var SpinePlugin = new Class({ { var textures = this.textures; - var gl = this.gl; + var gl = this.sceneRenderer.context.gl; - atlas = new Spine.TextureAtlas(atlasData, function (path) + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + + atlas = new Spine.TextureAtlas(atlasEntry.data, function (path) { - var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage()); + var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage(), false); spineTextures.add(key, glTexture); @@ -200,7 +456,86 @@ var SpinePlugin = new Class({ return atlas; }, - spineFileCallback: function (key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings) + /** + * 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 preMultipiedAlpha 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#addFileEvent + * @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} [preMultipiedAlpha=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. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ + spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings) { var multifile; @@ -215,7 +550,7 @@ var SpinePlugin = new Class({ } else { - multifile = new SpineFile(this, key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings); + multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings); this.addFile(multifile.files); } @@ -225,43 +560,400 @@ var SpinePlugin = new Class({ /** * Creates a new Spine Game Object and adds it to the Scene. - * - * @method Phaser.GameObjects.GameObjectFactory#spineFactory - * @since 3.16.0 * - * @param {number} x - The horizontal position of this Game Object. - * @param {number} y - The vertical position of this Game Object. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * 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. * - * @return {Phaser.GameObjects.Spine} The Game Object that was created. + * @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. */ - createSpineFactory: function (plugin) + add: function (x, y, key, animationName, loop) { - var callback = function (x, y, key, animationName, loop) + var spineGO = new SpineGameObject(this.scene, this, x, y, key, animationName, loop); + + this.scene.sys.displayList.add(spineGO); + this.scene.sys.updateList.add(spineGO); + + return spineGO; + }, + + /** + * 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. + */ + 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 spineGO = new SpineGameObject(this.scene, this, 0, 0, key, animationName, loop); + + if (addToScene !== undefined) { - var spineGO = new SpineGameObject(this.scene, plugin, x, y, key, animationName, loop); + config.add = addToScene; + } - this.displayList.add(spineGO); - this.updateList.add(spineGO); - - return spineGO; - }; + BuildGameObject(this.scene, spineGO, config); - return callback; + // 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(); }, - getRuntime: function () + /** + * 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) { - return this.runtime; + 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 Spine.Vector2(temp2.x, temp2.y); + } + else if (bone) + { + return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y); + } + else + { + return new Spine.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 Spine.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 (key.indexOf('.')) + if (split) { var parts = key.split('.'); @@ -269,8 +961,16 @@ var SpinePlugin = new Class({ jsonKey = parts.join('.'); } + var atlasData = this.cache.get(atlasKey); var atlas = this.getAtlas(atlasKey); + if (!atlas) + { + return null; + } + + var preMultipliedAlpha = atlasData.preMultipliedAlpha; + var atlasLoader = new Spine.AtlasAttachmentLoader(atlas); var skeletonJson = new Spine.SkeletonJson(atlasLoader); @@ -285,26 +985,35 @@ var SpinePlugin = new Class({ { var json = this.json.get(atlasKey); - data = GetValue(json, jsonKey); + data = (split) ? GetValue(json, jsonKey) : json; } - var skeletonData = skeletonJson.readSkeletonData(data); + if (data) + { + var skeletonData = skeletonJson.readSkeletonData(data); - var skeleton = new Spine.Skeleton(skeletonData); - - return { skeletonData: skeletonData, skeleton: skeleton }; - }, - - getBounds: function (skeleton) - { - var offset = new Spine.Vector2(); - var size = new Spine.Vector2(); - - skeleton.getBounds(offset, size, []); - - return { offset: offset, size: size }; + var skeleton = new Spine.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 Spine.AnimationStateData(skeleton.data); @@ -314,28 +1023,83 @@ var SpinePlugin = new Class({ 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 Spine.Vector2(); + var size = new Spine.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.viewportWidth = viewportWidth; + sceneRenderer.camera.viewportHeight = 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 Camera3DPlugin#shutdown + * @method SpinePlugin#shutdown * @private - * @since 3.0.0 + * @since 3.19.0 */ shutdown: function () { var eventEmitter = this.systems.events; eventEmitter.off('shutdown', this.shutdown, this); + + if (this.sceneRenderer) + { + this.sceneRenderer.dispose(); + } }, /** * The Scene that owns this plugin is being destroyed. + * * We need to shutdown and then kill off all external references. * - * @method Camera3DPlugin#destroy + * @method SpinePlugin#destroy * @private - * @since 3.0.0 + * @since 3.19.0 */ destroy: function () { @@ -348,18 +1112,13 @@ var SpinePlugin = new Class({ this.scene = null; this.systems = null; - // Create a custom cache to store the spine data (.atlas files) this.cache = null; this.spineTextures = null; this.json = null; this.textures = null; + this.sceneRenderer = null; this.skeletonRenderer = null; this.gl = null; - this.mvp = null; - this.shader = null; - this.batcher = null; - this.debugRenderer = null; - this.debugShader = null; } }); diff --git a/plugins/spine/src/events/COMPLETE_EVENT.js b/plugins/spine/src/events/COMPLETE_EVENT.js new file mode 100644 index 000000000..3e3c6286f --- /dev/null +++ b/plugins/spine/src/events/COMPLETE_EVENT.js @@ -0,0 +1,13 @@ +/** + * @author Richard Davey + * @copyright 2019 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'; diff --git a/plugins/spine/src/events/DISPOSE_EVENT.js b/plugins/spine/src/events/DISPOSE_EVENT.js new file mode 100644 index 000000000..7b77958ed --- /dev/null +++ b/plugins/spine/src/events/DISPOSE_EVENT.js @@ -0,0 +1,13 @@ +/** + * @author Richard Davey + * @copyright 2019 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'; diff --git a/plugins/spine/src/events/END_EVENT.js b/plugins/spine/src/events/END_EVENT.js new file mode 100644 index 000000000..2397ce82d --- /dev/null +++ b/plugins/spine/src/events/END_EVENT.js @@ -0,0 +1,13 @@ +/** + * @author Richard Davey + * @copyright 2019 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'; diff --git a/plugins/spine/src/events/EVENT_EVENT.js b/plugins/spine/src/events/EVENT_EVENT.js new file mode 100644 index 000000000..ec919e12d --- /dev/null +++ b/plugins/spine/src/events/EVENT_EVENT.js @@ -0,0 +1,13 @@ +/** + * @author Richard Davey + * @copyright 2019 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'; diff --git a/plugins/spine/src/events/INTERRUPTED_EVENT.js b/plugins/spine/src/events/INTERRUPTED_EVENT.js new file mode 100644 index 000000000..c79d4f5a5 --- /dev/null +++ b/plugins/spine/src/events/INTERRUPTED_EVENT.js @@ -0,0 +1,13 @@ +/** + * @author Richard Davey + * @copyright 2019 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'; diff --git a/plugins/spine/src/events/START_EVENT.js b/plugins/spine/src/events/START_EVENT.js new file mode 100644 index 000000000..98bc69190 --- /dev/null +++ b/plugins/spine/src/events/START_EVENT.js @@ -0,0 +1,13 @@ +/** + * @author Richard Davey + * @copyright 2019 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'; diff --git a/plugins/spine/src/events/index.js b/plugins/spine/src/events/index.js new file mode 100644 index 000000000..16b612868 --- /dev/null +++ b/plugins/spine/src/events/index.js @@ -0,0 +1,20 @@ +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace SpinePluginEvents + */ + +module.exports = { + + COMPLETE: require('./COMPLETE_EVENT'), + DISPOSE: require('./DISPOSE_EVENT'), + END: require('./END_EVENT'), + EVENT: require('./EVENT_EVENT'), + INTERRUPTED: require('./INTERRUPTED_EVENT'), + START: require('./START_EVENT') + +}; diff --git a/plugins/spine/src/gameobject/SpineGameObject.js b/plugins/spine/src/gameobject/SpineGameObject.js index 95bd0e9ae..72cac6c21 100644 --- a/plugins/spine/src/gameobject/SpineGameObject.js +++ b/plugins/spine/src/gameobject/SpineGameObject.js @@ -1,39 +1,100 @@ /** * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. + * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ +var AngleBetween = require('../../../../src/math/angle/Between'); +var Clamp = require('../../../../src/math/Clamp'); var Class = require('../../../../src/utils/Class'); -var ComponentsAlpha = require('../../../../src/gameobjects/components/Alpha'); -var ComponentsBlendMode = require('../../../../src/gameobjects/components/BlendMode'); var ComponentsComputedSize = require('../../../../src/gameobjects/components/ComputedSize'); var ComponentsDepth = require('../../../../src/gameobjects/components/Depth'); var ComponentsFlip = require('../../../../src/gameobjects/components/Flip'); var ComponentsScrollFactor = require('../../../../src/gameobjects/components/ScrollFactor'); var ComponentsTransform = require('../../../../src/gameobjects/components/Transform'); var ComponentsVisible = require('../../../../src/gameobjects/components/Visible'); +var CounterClockwise = require('../../../../src/math/angle/CounterClockwise'); +var DegToRad = require('../../../../src/math/DegToRad'); var GameObject = require('../../../../src/gameobjects/GameObject'); +var RadToDeg = require('../../../../src/math/RadToDeg'); +var SpineEvents = require('../events/'); var SpineGameObjectRender = require('./SpineGameObjectRender'); /** * @classdesc - * TODO + * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates + * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to + * easily change the skin, slot attachment, bone positions and more. + * + * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly. + * You can only create them if the Spine plugin has been loaded into Phaser. + * + * The quickest way is the Game Object Factory: + * + * ```javascript + * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true); + * ``` + * + * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly` + * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is + * an optional animation to start playing on the skeleton. The final argument `true` sets the + * animation to loop. Look at the documentation for further details on each of these options. + * + * For more control, you can use the Game Object Creator, passing in a Spine Game Object + * Configuration object: + * + * ```javascript + * let jelly = this.make.spine({ + * x: 512, y: 550, key: 'jelly', + * scale: 1.5, + * skinName: 'square_Green', + * animationName: 'jelly-think', loop: true, + * slotName: 'hat', attachmentName: 'images/La_14' + * }); + * ``` + * + * Here, you've got the ability to specify extra details, such as the slot name, attachments or + * overall scale. + * + * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to + * update and render, it must be added to the display and update lists of your Scene: + * + * ```javascript + * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true); + * this.sys.displayList.add(jelly); + * this.sys.updateList.add(jelly); + * ``` + * + * It's possible to enable Spine Game Objects for input, but you should be aware that it will use + * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but + * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created. + * If it's not suitable, provide your own shape to the `setInteractive` method. + * + * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for + * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game + * Object position with it. See the examples for further details. + * + * If your Spine Game Object has black outlines around the different parts of the texture when it + * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have + * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details. * * @class SpineGameObject * @constructor - * @since 3.16.0 + * @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 {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 {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? */ var SpineGameObject = new Class({ Extends: GameObject, Mixins: [ - ComponentsAlpha, - ComponentsBlendMode, ComponentsComputedSize, ComponentsDepth, ComponentsFlip, @@ -49,22 +110,129 @@ var SpineGameObject = new Class({ { GameObject.call(this, scene, 'Spine'); + /** + * A reference to the Spine Plugin. + * + * @name SpineGameObject#plugin + * @type {SpinePlugin} + * @since 3.19.0 + */ this.plugin = plugin; - this.root = null; + /** + * The Spine Skeleton this Game Object is using. + * + * @name SpineGameObject#skeleton + * @type {spine.Skeleton} + * @since 3.19.0 + */ this.skeleton = null; + + /** + * The Spine Skeleton Data associated with the Skeleton this Game Object is using. + * + * @name SpineGameObject#skeletonData + * @type {spine.SkeletonData} + * @since 3.19.0 + */ this.skeletonData = null; + /** + * The Spine Animation State this Game Object is using. + * + * @name SpineGameObject#state + * @type {spine.AnimationState} + * @since 3.19.0 + */ this.state = null; + + /** + * The Spine Animation State Data associated with the Animation State this Game Object is using. + * + * @name SpineGameObject#stateData + * @type {spine.AnimationStateData} + * @since 3.19.0 + */ this.stateData = null; + /** + * A reference to the root bone of the Skeleton. + * + * @name SpineGameObject#root + * @type {spine.Bone} + * @since 3.19.0 + */ + this.root = null; + + /** + * This object holds the calculated bounds of the current + * pose, as set when a new Skeleton is applied. + * + * @name SpineGameObject#bounds + * @type {any} + * @since 3.19.0 + */ + this.bounds = null; + + /** + * A Game Object level flag that allows you to enable debug drawing + * to the Skeleton Debug Renderer by toggling it. + * + * @name SpineGameObject#drawDebug + * @type {boolean} + * @since 3.19.0 + */ this.drawDebug = false; + /** + * The factor to scale the Animation update time by. + * + * @name SpineGameObject#timeScale + * @type {number} + * @since 3.19.0 + */ this.timeScale = 1; + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginX + * @type {number} + * @since 3.19.0 + */ this.displayOriginX = 0; + + /** + * The calculated Display Origin of this Game Object. + * + * @name SpineGameObject#displayOriginY + * @type {number} + * @since 3.19.0 + */ this.displayOriginY = 0; + /** + * A flag that stores if the texture associated with the current + * Skin being used by this Game Object, has its alpha pre-multiplied + * into it, or not. + * + * @name SpineGameObject#preMultipliedAlpha + * @type {boolean} + * @since 3.19.0 + */ + this.preMultipliedAlpha = false; + + /** + * A default Blend Mode. You cannot change the blend mode of a + * Spine Game Object. + * + * @name SpineGameObject#blendMode + * @type {number} + * @readonly + * @since 3.19.0 + */ + this.blendMode = 0; + this.setPosition(x, y); if (key) @@ -73,24 +241,281 @@ var SpineGameObject = new Class({ } }, + /** + * Overrides the default Game Object method and always returns true. + * Rendering is decided in the renderer functions. + * + * @method SpineGameObject#willRender + * @since 3.19.0 + * + * @return {boolean} Always returns `true`. + */ + willRender: function () + { + return true; + }, + + /** + * Set the Alpha level for the whole Skeleton 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 SpineGameObject#setAlpha + * @since 3.19.0 + * + * @param {number} [value=1] - The alpha value used for the whole Skeleton. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (value, slotName) + { + if (value === undefined) { value = 1; } + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + slot.color.a = Clamp(value, 0, 1); + } + } + else + { + this.alpha = value; + } + + return this; + }, + + /** + * The alpha value of the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#alpha + * @type {number} + * @since 3.19.0 + */ + alpha: { + + get: function () + { + return this.skeleton.color.a; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.a = v; + } + + if (v === 0) + { + this.renderFlags &= ~2; + } + else + { + this.renderFlags |= 2; + } + } + + }, + + /** + * The amount of red used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#red + * @type {number} + * @since 3.19.0 + */ + red: { + + get: function () + { + return this.skeleton.color.r; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.r = v; + } + } + + }, + + /** + * The amount of green used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#green + * @type {number} + * @since 3.19.0 + */ + green: { + + get: function () + { + return this.skeleton.color.g; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.g = v; + } + } + + }, + + /** + * The amount of blue used when rendering the Skeleton. + * + * A value between 0 and 1. + * + * This is a global value, impacting the entire Skeleton, not just a region of it. + * + * @name SpineGameObject#blue + * @type {number} + * @since 3.19.0 + */ + blue: { + + get: function () + { + return this.skeleton.color.b; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + if (this.skeleton) + { + this.skeleton.color.b = v; + } + } + + }, + + /** + * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton. + * + * @method SpineGameObject#setColor + * @since 3.19.0 + * + * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color. + * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton. + * + * @return {this} This Game Object instance. + */ + setColor: function (color, slotName) + { + if (color === undefined) { color = 0xffffff; } + + var red = (color >> 16 & 0xFF) / 255; + var green = (color >> 8 & 0xFF) / 255; + var blue = (color & 0xFF) / 255; + var alpha = (color > 16777215) ? (color >>> 24) / 255 : null; + + var target = this.skeleton; + + if (slotName) + { + var slot = this.findSlot(slotName); + + if (slot) + { + target = slot; + } + } + + target.color.r = red; + target.color.g = green; + target.color.b = blue; + + if (alpha !== null) + { + target.color.a = alpha; + } + + return this; + }, + + /** + * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object + * that contains the Skeleton data. + * + * @method SpineGameObject#setSkeletonFromJSON + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop) { return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop); }, + /** + * Sets this Game Object to use the given Skeleton based on its cache key. + * + * Typically, once set, the Skeleton doesn't change. Instead, you change the skin, + * or slot attachment, or any other property to adjust it. + * + * @method SpineGameObject#setSkeleton + * @since 3.19.0 + * + * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton. + * @param {object} skeletonJSON - The JSON data for the Skeleton. + * @param {string} [animationName] - Optional name of the animation to set on the Skeleton. + * @param {boolean} [loop=false] - Should the animation, if set, loop or not? + * + * @return {this} This Game Object. + */ setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON) { + if (this.state) + { + this.state.clearListeners(); + this.state.clearListenerNotifications(); + } + var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON); this.skeletonData = data.skeletonData; + this.preMultipliedAlpha = data.preMultipliedAlpha; + var skeleton = data.skeleton; - skeleton.setToSetupPose(); - - skeleton.updateWorldTransform(); - skeleton.setSkinByName('default'); + skeleton.setToSetupPose(); this.skeleton = skeleton; @@ -104,32 +529,15 @@ var SpineGameObject = new Class({ } this.state = data.state; - this.stateData = data.stateData; - var _this = this; - this.state.addListener({ - event: function (trackIndex, event) - { - // Event on a Track - _this.emit('spine.event', _this, trackIndex, event); - }, - complete: function (trackIndex, loopCount) - { - // Animation on Track x completed, loop count - _this.emit('spine.complete', _this, trackIndex, loopCount); - }, - start: function (trackIndex) - { - // Animation on Track x started - _this.emit('spine.start', _this, trackIndex); - }, - end: function (trackIndex) - { - // Animation on Track x ended - _this.emit('spine.end', _this, trackIndex); - } + 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) }); if (animationName) @@ -139,25 +547,373 @@ var SpineGameObject = new Class({ this.root = this.getRootBone(); - this.skeleton.scaleX = this.scaleX; - this.skeleton.scaleY = this.scaleY; + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } - this.skeleton.updateWorldTransform(); + this.state.apply(skeleton); - var w = this.skeletonData.width; - var h = this.skeletonData.height; + skeleton.updateCache(); - this.width = w; - this.height = h; + return this.updateSize(); + }, - this.displayOriginX = w / 2; - this.displayOriginY = h / 2; + /** + * Internal event handler that emits the Spine onComplete event via this Game Object. + * + * @method SpineGameObject#onComplete + * @fires SpinePluginEvents#COMPLETE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onComplete: function (entry) + { + this.emit(SpineEvents.COMPLETE, entry); + }, + + /** + * Internal event handler that emits the Spine onDispose event via this Game Object. + * + * @method SpineGameObject#onDispose + * @fires SpinePluginEvents#DISPOSE + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onDispose: function (entry) + { + this.emit(SpineEvents.DISPOSE, entry); + }, + + /** + * Internal event handler that emits the Spine onEnd event via this Game Object. + * + * @method SpineGameObject#onEnd + * @fires SpinePluginEvents#END + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onEnd: function (entry) + { + this.emit(SpineEvents.END, entry); + }, + + /** + * Internal event handler that emits the Spine Event event via this Game Object. + * + * @method SpineGameObject#onEvent + * @fires SpinePluginEvents#EVENT + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + * @param {spine.Event} event - The Spine event. + */ + onEvent: function (entry, event) + { + this.emit(SpineEvents.EVENT, entry, event); + }, + + /** + * Internal event handler that emits the Spine onInterrupted event via this Game Object. + * + * @method SpineGameObject#onInterrupted + * @fires SpinePluginEvents#INTERRUPTED + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onInterrupted: function (entry) + { + this.emit(SpineEvents.INTERRUPTED, entry); + }, + + /** + * Internal event handler that emits the Spine onStart event via this Game Object. + * + * @method SpineGameObject#onStart + * @fires SpinePluginEvents#START + * @private + * @since 3.19.0 + * + * @param {any} entry - The event data from Spine. + */ + onStart: function (entry) + { + this.emit(SpineEvents.START, entry); + }, + + /** + * Refreshes the data about the current Skeleton. + * + * This will reset the rotation, position and size of the Skeleton to match this Game Object. + * + * Call this method if you need to access the Skeleton data directly, and it may have changed + * recently. + * + * @method SpineGameObject#refresh + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + refresh: function () + { + if (this.root) + { + // +90 degrees to account for the difference in Spine vs. Phaser rotation + this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90; + } + + this.updateSize(); + + this.skeleton.updateCache(); return this; }, - // http://esotericsoftware.com/spine-runtimes-guide + /** + * Sets the size of this Game Object. + * + * If no arguments are given it uses the current skeleton data dimensions. + * + * You can use this method to set a fixed size of this Game Object, such as for input detection, + * when the skeleton data doesn't match what is required in-game. + * + * @method SpineGameObject#setSize + * @since 3.19.0 + * + * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width. + * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height. + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setSize: function (width, height, offsetX, offsetY) + { + var skeleton = this.skeleton; + if (width === undefined) { width = skeleton.data.width; } + if (height === undefined) { height = skeleton.data.height; } + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.width = width; + this.height = height; + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Sets the offset of this Game Object from the Skeleton position. + * + * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using. + * + * @method SpineGameObject#setOffset + * @since 3.19.0 + * + * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate. + * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate. + * + * @return {this} This Game Object. + */ + setOffset: function (offsetX, offsetY) + { + var skeleton = this.skeleton; + + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + this.displayOriginX = skeleton.x - offsetX; + this.displayOriginY = skeleton.y - offsetY; + + return this; + }, + + /** + * Internal method that syncs all of the Game Object position and scale data to the Skeleton. + * It then syncs the skeleton bounds back to this Game Object. + * + * This method is called automatically as needed internally, however, it's also exposed should + * you require overriding the size settings. + * + * @method SpineGameObject#updateSize + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + updateSize: function () + { + var skeleton = this.skeleton; + var renderer = this.plugin.renderer; + + var height = renderer.height; + + var oldScaleX = this.scaleX; + var oldScaleY = this.scaleY; + + skeleton.x = this.x; + skeleton.y = height - this.y; + skeleton.scaleX = 1; + skeleton.scaleY = 1; + + skeleton.updateWorldTransform(); + + var bounds = this.getBounds(); + + this.width = bounds.size.x; + this.height = bounds.size.y; + + this.displayOriginX = this.x - bounds.offset.x; + this.displayOriginY = this.y - (height - (this.height + bounds.offset.y)); + + skeleton.scaleX = oldScaleX; + skeleton.scaleY = oldScaleY; + + skeleton.updateWorldTransform(); + + return this; + }, + + /** + * The horizontal scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleX + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + this.refresh(); + } + + }, + + /** + * The vertical scale of this Game Object, as applied to the Skeleton it is using. + * + * @name SpineGameObject#scaleY + * @type {number} + * @default 1 + * @since 3.19.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + this.refresh(); + } + + }, + + /** + * Returns an array containing the names of all the bones in the Skeleton Data. + * + * @method SpineGameObject#getBoneList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the bones in the Skeleton Data. + */ + getBoneList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.bones.length; i++) + { + output.push(skeletonData.bones[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the skins in the Skeleton Data. + * + * @method SpineGameObject#getSkinList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the skins in the Skeleton Data. + */ + getSkinList: function () + { + var output = []; + + var skeletonData = this.skeletonData; + + if (skeletonData) + { + for (var i = 0; i < skeletonData.skins.length; i++) + { + output.push(skeletonData.skins[i].name); + } + } + + return output; + }, + + /** + * Returns an array containing the names of all the slots in the Skeleton. + * + * @method SpineGameObject#getSlotList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the slots in the Skeleton. + */ + getSlotList: function () + { + var output = []; + + var skeleton = this.skeleton; + + for (var i = 0; i < skeleton.slots.length; i++) + { + output.push(skeleton.slots[i].data.name); + } + + return output; + }, + + /** + * Returns an array containing the names of all the animations in the Skeleton Data. + * + * @method SpineGameObject#getAnimationList + * @since 3.19.0 + * + * @return {string[]} An array containing the names of all the animations in the Skeleton Data. + */ getAnimationList: function () { var output = []; @@ -175,35 +931,157 @@ var SpineGameObject = new Class({ return output; }, - play: function (animationName, loop) + /** + * Returns the current animation being played on the given track, if any. + * + * @method SpineGameObject#getCurrentAnimation + * @since 3.19.0 + * + * @param {integer} [trackIndex=0] - The track to return the current animation on. + * + * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation. + */ + getCurrentAnimation: function (trackIndex) { - if (loop === undefined) - { - loop = false; - } + if (trackIndex === undefined) { trackIndex = 0; } - return this.setAnimation(0, animationName, loop); + var current = this.state.getCurrent(trackIndex); + + if (current) + { + return current.animation; + } }, - setAnimation: function (trackIndex, animationName, loop) + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#play + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead. + */ + play: function (animationName, loop, ignoreIfPlaying) { - this.state.setAnimation(trackIndex, animationName, loop); + this.setAnimation(0, animationName, loop, ignoreIfPlaying); return this; }, + /** + * Sets the current animation for a track, discarding any queued animations. + * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from). + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * @method SpineGameObject#setAnimation + * @fires SpinePluginEvents#START + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to play the animation on. + * @param {string} animationName - The string-based key of the animation to play. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ + setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying) + { + if (loop === undefined) { loop = false; } + if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } + + if (ignoreIfPlaying && this.state) + { + var currentTrack = this.state.getCurrent(0); + + if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete()) + { + return; + } + } + + if (this.findAnimation(animationName)) + { + return this.state.setAnimation(trackIndex, animationName, loop); + } + }, + + /** + * Adds an animation to be played after the current or last queued animation for a track. + * If the track is empty, it is equivalent to calling setAnimation. + * + * Animations are referenced by a unique string-based key, as defined in the Spine software. + * + * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous + * track entry minus any mix duration (from the AnimationStateData) plus the specified delay + * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration). + * If the previous entry is looping, its next loop completion is used instead of its duration. + * + * @method SpineGameObject#addAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {string} animationName - The string-based key of the animation to add. + * @param {boolean} [loop=false] - Should the animation be looped when played? + * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played. + * + * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. + */ addAnimation: function (trackIndex, animationName, loop, delay) { return this.state.addAnimation(trackIndex, animationName, loop, delay); }, + /** + * Sets an empty animation for a track, discarding any queued animations, and sets the track + * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out. + * + * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation, + * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be + * applied less and less over the mix duration. Properties keyed in the previous animation transition to + * the value from lower tracks or to the setup pose value if no lower tracks key the property. + * A mix duration of 0 still mixes out over one frame. + * + * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation + * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new + * animation to be applied more and more over the mix duration. Properties keyed in the new animation + * transition from the value from lower tracks or from the setup pose value if no lower tracks key the + * property to the value keyed in the new animation. + * + * @method SpineGameObject#setEmptyAnimation + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {spine.TrackEntry} The returned Track Entry. + */ setEmptyAnimation: function (trackIndex, mixDuration) { - this.state.setEmptyAnimation(trackIndex, mixDuration); - - return this; + return this.state.setEmptyAnimation(trackIndex, mixDuration); }, + /** + * Removes all animations from the track, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTrack + * @since 3.19.0 + * + * @param {integer} trackIndex - The track index to add the animation to. + * + * @return {this} This Game Object. + */ clearTrack: function (trackIndex) { this.state.clearTrack(trackIndex); @@ -211,6 +1089,17 @@ var SpineGameObject = new Class({ return this; }, + /** + * Removes all animations from all tracks, leaving skeletons in their current pose. + * + * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose, + * rather than leaving them in their current pose. + * + * @method SpineGameObject#clearTracks + * @since 3.19.0 + * + * @return {this} This Game Object. + */ clearTracks: function () { this.state.clearTracks(); @@ -218,13 +1107,57 @@ var SpineGameObject = new Class({ return this; }, + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkinByName + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to set. + * + * @return {this} This Game Object. + */ setSkinByName: function (skinName) { - this.skeleton.setSkinByName(skinName); + var skeleton = this.skeleton; + + skeleton.setSkinByName(skinName); + + skeleton.setSlotsToSetupPose(); + + this.state.apply(skeleton); return this; }, + /** + * Sets the skin used to look up attachments before looking in the defaultSkin. + * + * Attachments from the new skin are attached if the corresponding attachment from the + * old skin was attached. If there was no old skin, each slot's setup mode attachment is + * attached from the new skin. + * + * After changing the skin, the visible attachments can be reset to those attached in the + * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time + * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide + * or show attachments from the new skin. + * + * @method SpineGameObject#setSkin + * @since 3.19.0 + * + * @param {?spine.Skin} newSkin - The Skin to set. May be `null`. + * + * @return {this} This Game Object. + */ setSkin: function (newSkin) { var skeleton = this.skeleton; @@ -238,6 +1171,18 @@ var SpineGameObject = new Class({ return this; }, + /** + * Sets the mix duration when changing from the specified animation to the other. + * + * @method SpineGameObject#setMix + * @since 3.19.0 + * + * @param {string} fromName - The animation to mix from. + * @param {string} toName - The animation to mix to. + * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any). + * + * @return {this} This Game Object. + */ setMix: function (fromName, toName, duration) { this.stateData.setMix(fromName, toName, duration); @@ -245,36 +1190,364 @@ var SpineGameObject = new Class({ return this; }, + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot + * index and attachment name. First the skin is checked and if the attachment was not found, + * the default skin is checked. + * + * @method SpineGameObject#getAttachment + * @since 3.19.0 + * + * @param {integer} slotIndex - The slot index to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachment: function (slotIndex, attachmentName) + { + return this.skeleton.getAttachment(slotIndex, attachmentName); + }, + + /** + * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name. + * + * @method SpineGameObject#getAttachmentByName + * @since 3.19.0 + * + * @param {string} slotName - The slot name to search. + * @param {string} attachmentName - The attachment name to look for. + * + * @return {?spine.Attachment} The Attachment, if found. May be null. + */ + getAttachmentByName: function (slotName, attachmentName) + { + return this.skeleton.getAttachmentByName(slotName, attachmentName); + }, + + /** + * A convenience method to set an attachment by finding the slot with findSlot, + * finding the attachment with getAttachment, then setting the slot's attachment. + * + * @method SpineGameObject#setAttachment + * @since 3.19.0 + * + * @param {string} slotName - The slot name to add the attachment to. + * @param {string} attachmentName - The attachment name to add. + * + * @return {this} This Game Object. + */ + setAttachment: function (slotName, attachmentName) + { + if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length) + { + for (var i = 0; i < slotName.length; i++) + { + this.skeleton.setAttachment(slotName[i], attachmentName[i]); + } + } + else + { + this.skeleton.setAttachment(slotName, attachmentName); + } + + return this; + }, + + /** + * Sets the bones, constraints, slots, and draw order to their setup pose values. + * + * @method SpineGameObject#setToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setToSetupPose: function () + { + this.skeleton.setToSetupPose(); + + return this; + }, + + /** + * Sets the slots and draw order to their setup pose values. + * + * @method SpineGameObject#setSlotsToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setSlotsToSetupPose: function () + { + this.skeleton.setSlotsToSetupPose(); + + return this; + }, + + /** + * Sets the bones and constraints to their setup pose values. + * + * @method SpineGameObject#setBonesToSetupPose + * @since 3.19.0 + * + * @return {this} This Game Object. + */ + setBonesToSetupPose: function () + { + this.skeleton.setBonesToSetupPose(); + + return this; + }, + + /** + * Gets the root bone, or null. + * + * @method SpineGameObject#getRootBone + * @since 3.19.0 + * + * @return {spine.Bone} The root bone, or null. + */ getRootBone: function () { return this.skeleton.getRootBone(); }, + /** + * Takes a Bone object and a position in world space and rotates the Bone so it is angled + * towards the given position. You can set an optional angle offset, should the bone be + * designed at a specific angle already. You can also set a minimum and maximum range for the angle. + * + * @method SpineGameObject#angleBoneToXY + * @since 3.19.0 + * + * @param {spine.Bone} bone - The bone to rotate towards the world position. + * @param {number} worldX - The world x coordinate to rotate the bone towards. + * @param {number} worldY - The world y coordinate to rotate the bone towards. + * @param {number} [offset=0] - An offset to add to the rotation angle. + * @param {number} [minAngle=0] - The minimum range of the rotation angle. + * @param {number} [maxAngle=360] - The maximum range of the rotation angle. + * + * @return {this} This Game Object. + */ + angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle) + { + if (offset === undefined) { offset = 0; } + if (minAngle === undefined) { minAngle = 0; } + if (maxAngle === undefined) { maxAngle = 360; } + + var renderer = this.plugin.renderer; + var height = renderer.height; + + var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset)); + + bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle); + + return this; + }, + + /** + * Finds a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBone + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {spine.Bone} The bone, or null. + */ findBone: function (boneName) { return this.skeleton.findBone(boneName); }, + /** + * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findBoneIndex + * @since 3.19.0 + * + * @param {string} boneName - The name of the bone to find. + * + * @return {integer} The bone index. Or -1 if the bone was not found. + */ findBoneIndex: function (boneName) { return this.skeleton.findBoneIndex(boneName); }, + /** + * Finds a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlot + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {spine.Slot} The Slot. May be null. + */ findSlot: function (slotName) { return this.skeleton.findSlot(slotName); }, + /** + * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findSlotIndex + * @since 3.19.0 + * + * @param {string} slotName - The name of the slot to find. + * + * @return {integer} The slot index. Or -1 if the Slot was not found. + */ findSlotIndex: function (slotName) { return this.skeleton.findSlotIndex(slotName); }, + /** + * Finds a skin by comparing each skin's name. It is more efficient to cache the results of + * this method than to call it multiple times. + * + * @method SpineGameObject#findSkin + * @since 3.19.0 + * + * @param {string} skinName - The name of the skin to find. + * + * @return {spine.Skin} The Skin. May be null. + */ + findSkin: function (skinName) + { + return this.skeletonData.findSkin(skinName); + }, + + /** + * Finds an event by comparing each events's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findEvent + * @since 3.19.0 + * + * @param {string} eventDataName - The name of the event to find. + * + * @return {spine.EventData} The Event Data. May be null. + */ + findEvent: function (eventDataName) + { + return this.skeletonData.findEvent(eventDataName); + }, + + /** + * Finds an animation by comparing each animation's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findAnimation + * @since 3.19.0 + * + * @param {string} animationName - The name of the animation to find. + * + * @return {spine.Animation} The Animation. May be null. + */ + findAnimation: function (animationName) + { + return this.skeletonData.findAnimation(animationName); + }, + + /** + * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results + * of this method than to call it multiple times. + * + * @method SpineGameObject#findIkConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.IkConstraintData} The IK constraint. May be null. + */ + findIkConstraint: function (constraintName) + { + return this.skeletonData.findIkConstraint(constraintName); + }, + + /** + * Finds an transform constraint by comparing each transform constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findTransformConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.TransformConstraintData} The transform constraint. May be null. + */ + findTransformConstraint: function (constraintName) + { + return this.skeletonData.findTransformConstraint(constraintName); + }, + + /** + * Finds a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraint + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {spine.PathConstraintData} The path constraint. May be null. + */ + findPathConstraint: function (constraintName) + { + return this.skeletonData.findPathConstraint(constraintName); + }, + + /** + * Finds the index of a path constraint by comparing each path constraint's name. + * It is more efficient to cache the results of this method than to call it multiple times. + * + * @method SpineGameObject#findPathConstraintIndex + * @since 3.19.0 + * + * @param {string} constraintName - The name of the constraint to find. + * + * @return {integer} The constraint index. Or -1 if the constraint was not found. + */ + findPathConstraintIndex: function (constraintName) + { + return this.skeletonData.findPathConstraintIndex(constraintName); + }, + + /** + * 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 SpineGameObject#getBounds + * @since 3.19.0 + * + * @return {any} The bounds object. + */ getBounds: function () { return this.plugin.getBounds(this.skeleton); }, + /** + * Internal update handler. + * + * @method SpineGameObject#preUpdate + * @protected + * @since 3.19.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ preUpdate: function (time, delta) { var skeleton = this.skeleton; @@ -283,17 +1556,15 @@ var SpineGameObject = new Class({ this.state.apply(skeleton); - this.emit('spine.update', skeleton); - - skeleton.updateWorldTransform(); + // this.emit('spine.update', skeleton); }, /** * Internal destroy handler, called as part of the destroy process. * - * @method Phaser.GameObjects.RenderTexture#preDestroy + * @method SpineGameObject#preDestroy * @protected - * @since 3.16.0 + * @since 3.19.0 */ preDestroy: function () { diff --git a/plugins/spine/src/gameobject/SpineGameObjectCanvasRenderer.js b/plugins/spine/src/gameobject/SpineGameObjectCanvasRenderer.js index bb7baa308..567643042 100644 --- a/plugins/spine/src/gameobject/SpineGameObjectCanvasRenderer.js +++ b/plugins/spine/src/gameobject/SpineGameObjectCanvasRenderer.js @@ -1,22 +1,24 @@ /** * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. + * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var SetTransform = require('../../../../src/renderer/canvas/utils/SetTransform'); +var CounterClockwise = require('../../../../src/math/angle/CounterClockwise'); +var RadToDeg = require('../../../../src/math/RadToDeg'); +var Wrap = require('../../../../src/math/Wrap'); /** * 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.SpineGameObject#renderCanvas - * @since 3.16.0 + * @method SpineGameObject#renderCanvas + * @since 3.19.0 * @private * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.SpineGameObject} src - The Game Object being rendered in this call. + * @param {SpineGameObject} src - The Game Object being rendered in this call. * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @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 @@ -29,28 +31,94 @@ var SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercen var skeleton = src.skeleton; var skeletonRenderer = plugin.skeletonRenderer; - if (!skeleton || !SetTransform(renderer, context, src, camera, parentMatrix)) + var GameObjectRenderMask = 15; + + var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); + + if (!skeleton || !willRender) { return; } + var camMatrix = renderer._tempMatrix1; + var spriteMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + 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; + } + + // Add autoUpdate option + skeleton.updateWorldTransform(); + skeletonRenderer.ctx = context; + skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug); context.save(); skeletonRenderer.draw(skeleton); - if (plugin.drawDebug || src.drawDebug) - { - context.strokeStyle = '#00ff00'; - context.beginPath(); - context.moveTo(-1000, 0); - context.lineTo(1000, 0); - context.moveTo(0, -1000); - context.lineTo(0, 1000); - context.stroke(); - } - context.restore(); }; diff --git a/plugins/spine/src/gameobject/SpineGameObjectFactory.js b/plugins/spine/src/gameobject/SpineGameObjectFactory.js deleted file mode 100644 index 36a454548..000000000 --- a/plugins/spine/src/gameobject/SpineGameObjectFactory.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var SpineGameObject = require('./SpineGameObject'); -var GameObjectFactory = require('../../../../src/gameobjects/GameObjectFactory'); - -/** - * Creates a new Spine Game Object Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Spine Plugin has been built or loaded into Phaser. - * - * @method Phaser.GameObjects.GameObjectFactory#spine - * @since 3.16.0 - * - * @param {number} x - The horizontal position of this Game Object. - * @param {number} y - The vertical position of this Game Object. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.GameObjects.SpineGameObject} The Game Object that was created. - */ -GameObjectFactory.register('spine', function (x, y, key, animation) -{ - var spine = new SpineGameObject(this.scene, x, y, key, animation); - - this.displayList.add(spine); - this.updateList.add(spine); - - return spine; -}); diff --git a/plugins/spine/src/gameobject/SpineGameObjectRender.js b/plugins/spine/src/gameobject/SpineGameObjectRender.js index d355e60cb..8ec1766f5 100644 --- a/plugins/spine/src/gameobject/SpineGameObjectRender.js +++ b/plugins/spine/src/gameobject/SpineGameObjectRender.js @@ -1,6 +1,6 @@ /** * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. + * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ diff --git a/plugins/spine/src/gameobject/SpineGameObjectWebGLRenderer.js b/plugins/spine/src/gameobject/SpineGameObjectWebGLRenderer.js index 53dfc6f83..949c39139 100644 --- a/plugins/spine/src/gameobject/SpineGameObjectWebGLRenderer.js +++ b/plugins/spine/src/gameobject/SpineGameObjectWebGLRenderer.js @@ -1,23 +1,24 @@ /** * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. + * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ var CounterClockwise = require('../../../../src/math/angle/CounterClockwise'); var RadToDeg = require('../../../../src/math/RadToDeg'); +var Wrap = require('../../../../src/math/Wrap'); /** - * Renders this Game Object with the Canvas Renderer to the given Camera. + * 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.SpineGameObject#renderCanvas - * @since 3.16.0 + * @method SpineGameObject#renderWebGL + * @since 3.19.0 * @private * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.SpineGameObject} src - The Game Object being rendered in this call. + * @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 {number} interpolationPercentage - Reserved for future use and custom pipelines. * @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 @@ -25,16 +26,27 @@ var RadToDeg = require('../../../../src/math/RadToDeg'); var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) { var plugin = src.plugin; - var mvp = plugin.mvp; - - var shader = plugin.shader; - var batcher = plugin.batcher; - var runtime = plugin.runtime; var skeleton = src.skeleton; - var skeletonRenderer = plugin.skeletonRenderer; + var sceneRenderer = plugin.sceneRenderer; - if (!skeleton) + var GameObjectRenderMask = 15; + + var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); + + if (!skeleton || !willRender) { + // Reset the current type + renderer.currentType = ''; + + // If there is already a batch running, we need to close it + if (!renderer.nextTypeMatch) + { + // The next object in the display list is not a Spine object, so we end the batch + sceneRenderer.end(); + + renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline); + } + return; } @@ -47,8 +59,7 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent var spriteMatrix = renderer._tempMatrix2; var calcMatrix = renderer._tempMatrix3; - // - 90 degrees to account for the difference in Spine vs. Phaser rotation - spriteMatrix.applyITRS(src.x, src.y, src.rotation - 1.5707963267948966, src.scaleX, src.scaleY); + spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); camMatrix.copyFrom(camera.matrix); @@ -73,82 +84,79 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent camMatrix.multiply(spriteMatrix, calcMatrix); } - var width = renderer.width; - var height = renderer.height; + 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; + + 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 = calcMatrix.scaleY * -1; + skeleton.scaleY *= -1; } - else - { - skeleton.y = height - calcMatrix.ty; - skeleton.scaleY = calcMatrix.scaleY; - } - - src.root.rotation = RadToDeg(CounterClockwise(calcMatrix.rotation)); // Add autoUpdate option skeleton.updateWorldTransform(); if (renderer.newType) { - mvp.ortho(0, width, 0, height, 0, 1); - - shader.bind(); - shader.setUniformi(runtime.Shader.SAMPLER, 0); - shader.setUniform4x4f(runtime.Shader.MVP_MATRIX, mvp.val); - - batcher.begin(shader); - - skeletonRenderer.premultipliedAlpha = true; - } - - if (renderer.nextTypeMatch) - { - batcher.isDrawing = false; + sceneRenderer.begin(); } // Draw the current skeleton - skeletonRenderer.draw(batcher, skeleton); + sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + + 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 object, so we end the batch - batcher.isDrawing = true; - - batcher.end(); - - shader.unbind(); + sceneRenderer.end(); renderer.rebindPipeline(renderer.pipelines.TextureTintPipeline); } - - /* - var drawDebug = (plugin.drawDebug || src.drawDebug); - - if (drawDebug) - { - var debugShader = plugin.debugShader; - var debugRenderer = plugin.debugRenderer; - var shapes = plugin.shapes; - - debugShader.bind(); - debugShader.setUniform4x4f(runtime.Shader.MVP_MATRIX, mvp.val); - - shapes.begin(debugShader); - - debugRenderer.draw(shapes, skeleton); - - shapes.end(); - - debugShader.unbind(); - } - */ }; module.exports = SpineGameObjectWebGLRenderer; diff --git a/plugins/spine/src/runtimes/spine-both.js b/plugins/spine/src/runtimes/spine-both.js index 84df90925..07c3c9f3f 100644 --- a/plugins/spine/src/runtimes/spine-both.js +++ b/plugins/spine/src/runtimes/spine-both.js @@ -1,9716 +1,9433 @@ var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; })(); var spine; (function (spine) { - var Animation = (function () { - function Animation(name, timelines, duration) { - if (name == null) - throw new Error("name cannot be null."); - if (timelines == null) - throw new Error("timelines cannot be null."); - this.name = name; - this.timelines = timelines; - this.duration = duration; - } - Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) { - if (skeleton == null) - throw new Error("skeleton cannot be null."); - if (loop && this.duration != 0) { - time %= this.duration; - if (lastTime > 0) - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction); - }; - Animation.binarySearch = function (values, target, step) { - if (step === void 0) { step = 1; } - var low = 0; - var high = values.length / step - 2; - if (high == 0) - return step; - var current = high >>> 1; - while (true) { - if (values[(current + 1) * step] <= target) - low = current + 1; - else - high = current; - if (low == high) - return (low + 1) * step; - current = (low + high) >>> 1; - } - }; - Animation.linearSearch = function (values, target, step) { - for (var i = 0, last = values.length - step; i <= last; i += step) - if (values[i] > target) - return i; - return -1; - }; - return Animation; - }()); - spine.Animation = Animation; - var MixBlend; - (function (MixBlend) { - MixBlend[MixBlend["setup"] = 0] = "setup"; - MixBlend[MixBlend["first"] = 1] = "first"; - MixBlend[MixBlend["replace"] = 2] = "replace"; - MixBlend[MixBlend["add"] = 3] = "add"; - })(MixBlend = spine.MixBlend || (spine.MixBlend = {})); - var MixDirection; - (function (MixDirection) { - MixDirection[MixDirection["in"] = 0] = "in"; - MixDirection[MixDirection["out"] = 1] = "out"; - })(MixDirection = spine.MixDirection || (spine.MixDirection = {})); - var TimelineType; - (function (TimelineType) { - TimelineType[TimelineType["rotate"] = 0] = "rotate"; - TimelineType[TimelineType["translate"] = 1] = "translate"; - TimelineType[TimelineType["scale"] = 2] = "scale"; - TimelineType[TimelineType["shear"] = 3] = "shear"; - TimelineType[TimelineType["attachment"] = 4] = "attachment"; - TimelineType[TimelineType["color"] = 5] = "color"; - TimelineType[TimelineType["deform"] = 6] = "deform"; - TimelineType[TimelineType["event"] = 7] = "event"; - TimelineType[TimelineType["drawOrder"] = 8] = "drawOrder"; - TimelineType[TimelineType["ikConstraint"] = 9] = "ikConstraint"; - TimelineType[TimelineType["transformConstraint"] = 10] = "transformConstraint"; - TimelineType[TimelineType["pathConstraintPosition"] = 11] = "pathConstraintPosition"; - TimelineType[TimelineType["pathConstraintSpacing"] = 12] = "pathConstraintSpacing"; - TimelineType[TimelineType["pathConstraintMix"] = 13] = "pathConstraintMix"; - TimelineType[TimelineType["twoColor"] = 14] = "twoColor"; - })(TimelineType = spine.TimelineType || (spine.TimelineType = {})); - var CurveTimeline = (function () { - function CurveTimeline(frameCount) { - if (frameCount <= 0) - throw new Error("frameCount must be > 0: " + frameCount); - this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE); - } - CurveTimeline.prototype.getFrameCount = function () { - return this.curves.length / CurveTimeline.BEZIER_SIZE + 1; - }; - CurveTimeline.prototype.setLinear = function (frameIndex) { - this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR; - }; - CurveTimeline.prototype.setStepped = function (frameIndex) { - this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED; - }; - CurveTimeline.prototype.getCurveType = function (frameIndex) { - var index = frameIndex * CurveTimeline.BEZIER_SIZE; - if (index == this.curves.length) - return CurveTimeline.LINEAR; - var type = this.curves[index]; - if (type == CurveTimeline.LINEAR) - return CurveTimeline.LINEAR; - if (type == CurveTimeline.STEPPED) - return CurveTimeline.STEPPED; - return CurveTimeline.BEZIER; - }; - CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) { - var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03; - var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006; - var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy; - var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667; - var i = frameIndex * CurveTimeline.BEZIER_SIZE; - var curves = this.curves; - curves[i++] = CurveTimeline.BEZIER; - var x = dfx, y = dfy; - for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - x += dfx; - y += dfy; - } - }; - CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) { - percent = spine.MathUtils.clamp(percent, 0, 1); - var curves = this.curves; - var i = frameIndex * CurveTimeline.BEZIER_SIZE; - var type = curves[i]; - if (type == CurveTimeline.LINEAR) - return percent; - if (type == CurveTimeline.STEPPED) - return 0; - i++; - var x = 0; - for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { - x = curves[i]; - if (x >= percent) { - var prevX = void 0, prevY = void 0; - if (i == start) { - prevX = 0; - prevY = 0; - } - else { - prevX = curves[i - 2]; - prevY = curves[i - 1]; - } - return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); - } - } - var y = curves[i - 1]; - return y + (1 - y) * (percent - x) / (1 - x); - }; - CurveTimeline.LINEAR = 0; - CurveTimeline.STEPPED = 1; - CurveTimeline.BEZIER = 2; - CurveTimeline.BEZIER_SIZE = 10 * 2 - 1; - return CurveTimeline; - }()); - spine.CurveTimeline = CurveTimeline; - var RotateTimeline = (function (_super) { - __extends(RotateTimeline, _super); - function RotateTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount << 1); - return _this; - } - RotateTimeline.prototype.getPropertyId = function () { - return (TimelineType.rotate << 24) + this.boneIndex; - }; - RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) { - frameIndex <<= 1; - this.frames[frameIndex] = time; - this.frames[frameIndex + RotateTimeline.ROTATION] = degrees; - }; - RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var frames = this.frames; - var bone = skeleton.bones[this.boneIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - bone.rotation = bone.data.rotation; - return; - case MixBlend.first: - var r_1 = bone.data.rotation - bone.rotation; - bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha; - } - return; - } - if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { - var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION]; - switch (blend) { - case MixBlend.setup: - bone.rotation = bone.data.rotation + r_2 * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - r_2 += bone.data.rotation - bone.rotation; - r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; - case MixBlend.add: - bone.rotation += r_2 * alpha; - } - return; - } - var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES); - var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime)); - var r = frames[frame + RotateTimeline.ROTATION] - prevRotation; - r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent; - switch (blend) { - case MixBlend.setup: - bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - r += bone.data.rotation - bone.rotation; - case MixBlend.add: - bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; - } - }; - RotateTimeline.ENTRIES = 2; - RotateTimeline.PREV_TIME = -2; - RotateTimeline.PREV_ROTATION = -1; - RotateTimeline.ROTATION = 1; - return RotateTimeline; - }(CurveTimeline)); - spine.RotateTimeline = RotateTimeline; - var TranslateTimeline = (function (_super) { - __extends(TranslateTimeline, _super); - function TranslateTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES); - return _this; - } - TranslateTimeline.prototype.getPropertyId = function () { - return (TimelineType.translate << 24) + this.boneIndex; - }; - TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) { - frameIndex *= TranslateTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + TranslateTimeline.X] = x; - this.frames[frameIndex + TranslateTimeline.Y] = y; - }; - TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var frames = this.frames; - var bone = skeleton.bones[this.boneIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - bone.x = bone.data.x; - bone.y = bone.data.y; - return; - case MixBlend.first: - bone.x += (bone.data.x - bone.x) * alpha; - bone.y += (bone.data.y - bone.y) * alpha; - } - return; - } - var x = 0, y = 0; - if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { - x = frames[frames.length + TranslateTimeline.PREV_X]; - y = frames[frames.length + TranslateTimeline.PREV_Y]; - } - else { - var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES); - x = frames[frame + TranslateTimeline.PREV_X]; - y = frames[frame + TranslateTimeline.PREV_Y]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime)); - x += (frames[frame + TranslateTimeline.X] - x) * percent; - y += (frames[frame + TranslateTimeline.Y] - y) * percent; - } - switch (blend) { - case MixBlend.setup: - bone.x = bone.data.x + x * alpha; - bone.y = bone.data.y + y * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - bone.x += (bone.data.x + x - bone.x) * alpha; - bone.y += (bone.data.y + y - bone.y) * alpha; - break; - case MixBlend.add: - bone.x += x * alpha; - bone.y += y * alpha; - } - }; - TranslateTimeline.ENTRIES = 3; - TranslateTimeline.PREV_TIME = -3; - TranslateTimeline.PREV_X = -2; - TranslateTimeline.PREV_Y = -1; - TranslateTimeline.X = 1; - TranslateTimeline.Y = 2; - return TranslateTimeline; - }(CurveTimeline)); - spine.TranslateTimeline = TranslateTimeline; - var ScaleTimeline = (function (_super) { - __extends(ScaleTimeline, _super); - function ScaleTimeline(frameCount) { - return _super.call(this, frameCount) || this; - } - ScaleTimeline.prototype.getPropertyId = function () { - return (TimelineType.scale << 24) + this.boneIndex; - }; - ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var frames = this.frames; - var bone = skeleton.bones[this.boneIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - bone.scaleX = bone.data.scaleX; - bone.scaleY = bone.data.scaleY; - return; - case MixBlend.first: - bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha; - } - return; - } - var x = 0, y = 0; - if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { - x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX; - y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY; - } - else { - var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES); - x = frames[frame + ScaleTimeline.PREV_X]; - y = frames[frame + ScaleTimeline.PREV_Y]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime)); - x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX; - y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY; - } - if (alpha == 1) { - if (blend == MixBlend.add) { - bone.scaleX += x - bone.data.scaleX; - bone.scaleY += y - bone.data.scaleY; - } - else { - bone.scaleX = x; - bone.scaleY = y; - } - } - else { - var bx = 0, by = 0; - if (direction == MixDirection.out) { - switch (blend) { - case MixBlend.setup: - bx = bone.data.scaleX; - by = bone.data.scaleY; - bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; - bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - bx = bone.scaleX; - by = bone.scaleY; - bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; - bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; - break; - case MixBlend.add: - bx = bone.scaleX; - by = bone.scaleY; - bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha; - bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha; - } - } - else { - switch (blend) { - case MixBlend.setup: - bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x); - by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y); - bone.scaleX = bx + (x - bx) * alpha; - bone.scaleY = by + (y - by) * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x); - by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y); - bone.scaleX = bx + (x - bx) * alpha; - bone.scaleY = by + (y - by) * alpha; - break; - case MixBlend.add: - bx = spine.MathUtils.signum(x); - by = spine.MathUtils.signum(y); - bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha; - bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha; - } - } - } - }; - return ScaleTimeline; - }(TranslateTimeline)); - spine.ScaleTimeline = ScaleTimeline; - var ShearTimeline = (function (_super) { - __extends(ShearTimeline, _super); - function ShearTimeline(frameCount) { - return _super.call(this, frameCount) || this; - } - ShearTimeline.prototype.getPropertyId = function () { - return (TimelineType.shear << 24) + this.boneIndex; - }; - ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var frames = this.frames; - var bone = skeleton.bones[this.boneIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - bone.shearX = bone.data.shearX; - bone.shearY = bone.data.shearY; - return; - case MixBlend.first: - bone.shearX += (bone.data.shearX - bone.shearX) * alpha; - bone.shearY += (bone.data.shearY - bone.shearY) * alpha; - } - return; - } - var x = 0, y = 0; - if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { - x = frames[frames.length + ShearTimeline.PREV_X]; - y = frames[frames.length + ShearTimeline.PREV_Y]; - } - else { - var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES); - x = frames[frame + ShearTimeline.PREV_X]; - y = frames[frame + ShearTimeline.PREV_Y]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime)); - x = x + (frames[frame + ShearTimeline.X] - x) * percent; - y = y + (frames[frame + ShearTimeline.Y] - y) * percent; - } - switch (blend) { - case MixBlend.setup: - bone.shearX = bone.data.shearX + x * alpha; - bone.shearY = bone.data.shearY + y * alpha; - break; - case MixBlend.first: - case MixBlend.replace: - bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha; - bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha; - break; - case MixBlend.add: - bone.shearX += x * alpha; - bone.shearY += y * alpha; - } - }; - return ShearTimeline; - }(TranslateTimeline)); - spine.ShearTimeline = ShearTimeline; - var ColorTimeline = (function (_super) { - __extends(ColorTimeline, _super); - function ColorTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES); - return _this; - } - ColorTimeline.prototype.getPropertyId = function () { - return (TimelineType.color << 24) + this.slotIndex; - }; - ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) { - frameIndex *= ColorTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + ColorTimeline.R] = r; - this.frames[frameIndex + ColorTimeline.G] = g; - this.frames[frameIndex + ColorTimeline.B] = b; - this.frames[frameIndex + ColorTimeline.A] = a; - }; - ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var slot = skeleton.slots[this.slotIndex]; - var frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - slot.color.setFromColor(slot.data.color); - return; - case MixBlend.first: - var color = slot.color, setup = slot.data.color; - color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha); - } - return; - } - var r = 0, g = 0, b = 0, a = 0; - if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { - var i = frames.length; - r = frames[i + ColorTimeline.PREV_R]; - g = frames[i + ColorTimeline.PREV_G]; - b = frames[i + ColorTimeline.PREV_B]; - a = frames[i + ColorTimeline.PREV_A]; - } - else { - var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES); - r = frames[frame + ColorTimeline.PREV_R]; - g = frames[frame + ColorTimeline.PREV_G]; - b = frames[frame + ColorTimeline.PREV_B]; - a = frames[frame + ColorTimeline.PREV_A]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime)); - r += (frames[frame + ColorTimeline.R] - r) * percent; - g += (frames[frame + ColorTimeline.G] - g) * percent; - b += (frames[frame + ColorTimeline.B] - b) * percent; - a += (frames[frame + ColorTimeline.A] - a) * percent; - } - if (alpha == 1) - slot.color.set(r, g, b, a); - else { - var color = slot.color; - if (blend == MixBlend.setup) - color.setFromColor(slot.data.color); - color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); - } - }; - ColorTimeline.ENTRIES = 5; - ColorTimeline.PREV_TIME = -5; - ColorTimeline.PREV_R = -4; - ColorTimeline.PREV_G = -3; - ColorTimeline.PREV_B = -2; - ColorTimeline.PREV_A = -1; - ColorTimeline.R = 1; - ColorTimeline.G = 2; - ColorTimeline.B = 3; - ColorTimeline.A = 4; - return ColorTimeline; - }(CurveTimeline)); - spine.ColorTimeline = ColorTimeline; - var TwoColorTimeline = (function (_super) { - __extends(TwoColorTimeline, _super); - function TwoColorTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES); - return _this; - } - TwoColorTimeline.prototype.getPropertyId = function () { - return (TimelineType.twoColor << 24) + this.slotIndex; - }; - TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) { - frameIndex *= TwoColorTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + TwoColorTimeline.R] = r; - this.frames[frameIndex + TwoColorTimeline.G] = g; - this.frames[frameIndex + TwoColorTimeline.B] = b; - this.frames[frameIndex + TwoColorTimeline.A] = a; - this.frames[frameIndex + TwoColorTimeline.R2] = r2; - this.frames[frameIndex + TwoColorTimeline.G2] = g2; - this.frames[frameIndex + TwoColorTimeline.B2] = b2; - }; - TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var slot = skeleton.slots[this.slotIndex]; - var frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - slot.color.setFromColor(slot.data.color); - slot.darkColor.setFromColor(slot.data.darkColor); - return; - case MixBlend.first: - var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor; - light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha); - dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0); - } - return; - } - var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; - if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { - var i = frames.length; - r = frames[i + TwoColorTimeline.PREV_R]; - g = frames[i + TwoColorTimeline.PREV_G]; - b = frames[i + TwoColorTimeline.PREV_B]; - a = frames[i + TwoColorTimeline.PREV_A]; - r2 = frames[i + TwoColorTimeline.PREV_R2]; - g2 = frames[i + TwoColorTimeline.PREV_G2]; - b2 = frames[i + TwoColorTimeline.PREV_B2]; - } - else { - var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES); - r = frames[frame + TwoColorTimeline.PREV_R]; - g = frames[frame + TwoColorTimeline.PREV_G]; - b = frames[frame + TwoColorTimeline.PREV_B]; - a = frames[frame + TwoColorTimeline.PREV_A]; - r2 = frames[frame + TwoColorTimeline.PREV_R2]; - g2 = frames[frame + TwoColorTimeline.PREV_G2]; - b2 = frames[frame + TwoColorTimeline.PREV_B2]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime)); - r += (frames[frame + TwoColorTimeline.R] - r) * percent; - g += (frames[frame + TwoColorTimeline.G] - g) * percent; - b += (frames[frame + TwoColorTimeline.B] - b) * percent; - a += (frames[frame + TwoColorTimeline.A] - a) * percent; - r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent; - g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent; - b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent; - } - if (alpha == 1) { - slot.color.set(r, g, b, a); - slot.darkColor.set(r2, g2, b2, 1); - } - else { - var light = slot.color, dark = slot.darkColor; - if (blend == MixBlend.setup) { - light.setFromColor(slot.data.color); - dark.setFromColor(slot.data.darkColor); - } - light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); - dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0); - } - }; - TwoColorTimeline.ENTRIES = 8; - TwoColorTimeline.PREV_TIME = -8; - TwoColorTimeline.PREV_R = -7; - TwoColorTimeline.PREV_G = -6; - TwoColorTimeline.PREV_B = -5; - TwoColorTimeline.PREV_A = -4; - TwoColorTimeline.PREV_R2 = -3; - TwoColorTimeline.PREV_G2 = -2; - TwoColorTimeline.PREV_B2 = -1; - TwoColorTimeline.R = 1; - TwoColorTimeline.G = 2; - TwoColorTimeline.B = 3; - TwoColorTimeline.A = 4; - TwoColorTimeline.R2 = 5; - TwoColorTimeline.G2 = 6; - TwoColorTimeline.B2 = 7; - return TwoColorTimeline; - }(CurveTimeline)); - spine.TwoColorTimeline = TwoColorTimeline; - var AttachmentTimeline = (function () { - function AttachmentTimeline(frameCount) { - this.frames = spine.Utils.newFloatArray(frameCount); - this.attachmentNames = new Array(frameCount); - } - AttachmentTimeline.prototype.getPropertyId = function () { - return (TimelineType.attachment << 24) + this.slotIndex; - }; - AttachmentTimeline.prototype.getFrameCount = function () { - return this.frames.length; - }; - AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) { - this.frames[frameIndex] = time; - this.attachmentNames[frameIndex] = attachmentName; - }; - AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { - var slot = skeleton.slots[this.slotIndex]; - if (direction == MixDirection.out && blend == MixBlend.setup) { - var attachmentName_1 = slot.data.attachmentName; - slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1)); - return; - } - var frames = this.frames; - if (time < frames[0]) { - if (blend == MixBlend.setup || blend == MixBlend.first) { - var attachmentName_2 = slot.data.attachmentName; - slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2)); - } - return; - } - var frameIndex = 0; - if (time >= frames[frames.length - 1]) - frameIndex = frames.length - 1; - else - frameIndex = Animation.binarySearch(frames, time, 1) - 1; - var attachmentName = this.attachmentNames[frameIndex]; - skeleton.slots[this.slotIndex] - .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); - }; - return AttachmentTimeline; - }()); - spine.AttachmentTimeline = AttachmentTimeline; - var zeros = null; - var DeformTimeline = (function (_super) { - __extends(DeformTimeline, _super); - function DeformTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount); - _this.frameVertices = new Array(frameCount); - if (zeros == null) - zeros = spine.Utils.newFloatArray(64); - return _this; - } - DeformTimeline.prototype.getPropertyId = function () { - return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex; - }; - DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) { - this.frames[frameIndex] = time; - this.frameVertices[frameIndex] = vertices; - }; - DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var slot = skeleton.slots[this.slotIndex]; - var slotAttachment = slot.getAttachment(); - if (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment)) - return; - var verticesArray = slot.attachmentVertices; - if (verticesArray.length == 0) - blend = MixBlend.setup; - var frameVertices = this.frameVertices; - var vertexCount = frameVertices[0].length; - var frames = this.frames; - if (time < frames[0]) { - var vertexAttachment = slotAttachment; - switch (blend) { - case MixBlend.setup: - verticesArray.length = 0; - return; - case MixBlend.first: - if (alpha == 1) { - verticesArray.length = 0; - break; - } - var vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount); - if (vertexAttachment.bones == null) { - var setupVertices = vertexAttachment.vertices; - for (var i = 0; i < vertexCount; i++) - vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha; - } - else { - alpha = 1 - alpha; - for (var i = 0; i < vertexCount; i++) - vertices_1[i] *= alpha; - } - } - return; - } - var vertices = spine.Utils.setArraySize(verticesArray, vertexCount); - if (time >= frames[frames.length - 1]) { - var lastVertices = frameVertices[frames.length - 1]; - if (alpha == 1) { - if (blend == MixBlend.add) { - var vertexAttachment = slotAttachment; - if (vertexAttachment.bones == null) { - var setupVertices = vertexAttachment.vertices; - for (var i_1 = 0; i_1 < vertexCount; i_1++) { - vertices[i_1] += lastVertices[i_1] - setupVertices[i_1]; - } - } - else { - for (var i_2 = 0; i_2 < vertexCount; i_2++) - vertices[i_2] += lastVertices[i_2]; - } - } - else { - spine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount); - } - } - else { - switch (blend) { - case MixBlend.setup: { - var vertexAttachment_1 = slotAttachment; - if (vertexAttachment_1.bones == null) { - var setupVertices = vertexAttachment_1.vertices; - for (var i_3 = 0; i_3 < vertexCount; i_3++) { - var setup = setupVertices[i_3]; - vertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha; - } - } - else { - for (var i_4 = 0; i_4 < vertexCount; i_4++) - vertices[i_4] = lastVertices[i_4] * alpha; - } - break; - } - case MixBlend.first: - case MixBlend.replace: - for (var i_5 = 0; i_5 < vertexCount; i_5++) - vertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha; - case MixBlend.add: - var vertexAttachment = slotAttachment; - if (vertexAttachment.bones == null) { - var setupVertices = vertexAttachment.vertices; - for (var i_6 = 0; i_6 < vertexCount; i_6++) { - vertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha; - } - } - else { - for (var i_7 = 0; i_7 < vertexCount; i_7++) - vertices[i_7] += lastVertices[i_7] * alpha; - } - } - } - return; - } - var frame = Animation.binarySearch(frames, time); - var prevVertices = frameVertices[frame - 1]; - var nextVertices = frameVertices[frame]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime)); - if (alpha == 1) { - if (blend == MixBlend.add) { - var vertexAttachment = slotAttachment; - if (vertexAttachment.bones == null) { - var setupVertices = vertexAttachment.vertices; - for (var i_8 = 0; i_8 < vertexCount; i_8++) { - var prev = prevVertices[i_8]; - vertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8]; - } - } - else { - for (var i_9 = 0; i_9 < vertexCount; i_9++) { - var prev = prevVertices[i_9]; - vertices[i_9] += prev + (nextVertices[i_9] - prev) * percent; - } - } - } - else { - for (var i_10 = 0; i_10 < vertexCount; i_10++) { - var prev = prevVertices[i_10]; - vertices[i_10] = prev + (nextVertices[i_10] - prev) * percent; - } - } - } - else { - switch (blend) { - case MixBlend.setup: { - var vertexAttachment_2 = slotAttachment; - if (vertexAttachment_2.bones == null) { - var setupVertices = vertexAttachment_2.vertices; - for (var i_11 = 0; i_11 < vertexCount; i_11++) { - var prev = prevVertices[i_11], setup = setupVertices[i_11]; - vertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha; - } - } - else { - for (var i_12 = 0; i_12 < vertexCount; i_12++) { - var prev = prevVertices[i_12]; - vertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha; - } - } - break; - } - case MixBlend.first: - case MixBlend.replace: - for (var i_13 = 0; i_13 < vertexCount; i_13++) { - var prev = prevVertices[i_13]; - vertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha; - } - break; - case MixBlend.add: - var vertexAttachment = slotAttachment; - if (vertexAttachment.bones == null) { - var setupVertices = vertexAttachment.vertices; - for (var i_14 = 0; i_14 < vertexCount; i_14++) { - var prev = prevVertices[i_14]; - vertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha; - } - } - else { - for (var i_15 = 0; i_15 < vertexCount; i_15++) { - var prev = prevVertices[i_15]; - vertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha; - } - } - } - } - }; - return DeformTimeline; - }(CurveTimeline)); - spine.DeformTimeline = DeformTimeline; - var EventTimeline = (function () { - function EventTimeline(frameCount) { - this.frames = spine.Utils.newFloatArray(frameCount); - this.events = new Array(frameCount); - } - EventTimeline.prototype.getPropertyId = function () { - return TimelineType.event << 24; - }; - EventTimeline.prototype.getFrameCount = function () { - return this.frames.length; - }; - EventTimeline.prototype.setFrame = function (frameIndex, event) { - this.frames[frameIndex] = event.time; - this.events[frameIndex] = event; - }; - EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - if (firedEvents == null) - return; - var frames = this.frames; - var frameCount = this.frames.length; - if (lastTime > time) { - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction); - lastTime = -1; - } - else if (lastTime >= frames[frameCount - 1]) - return; - if (time < frames[0]) - return; - var frame = 0; - if (lastTime < frames[0]) - frame = 0; - else { - frame = Animation.binarySearch(frames, lastTime); - var frameTime = frames[frame]; - while (frame > 0) { - if (frames[frame - 1] != frameTime) - break; - frame--; - } - } - for (; frame < frameCount && time >= frames[frame]; frame++) - firedEvents.push(this.events[frame]); - }; - return EventTimeline; - }()); - spine.EventTimeline = EventTimeline; - var DrawOrderTimeline = (function () { - function DrawOrderTimeline(frameCount) { - this.frames = spine.Utils.newFloatArray(frameCount); - this.drawOrders = new Array(frameCount); - } - DrawOrderTimeline.prototype.getPropertyId = function () { - return TimelineType.drawOrder << 24; - }; - DrawOrderTimeline.prototype.getFrameCount = function () { - return this.frames.length; - }; - DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) { - this.frames[frameIndex] = time; - this.drawOrders[frameIndex] = drawOrder; - }; - DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var drawOrder = skeleton.drawOrder; - var slots = skeleton.slots; - if (direction == MixDirection.out && blend == MixBlend.setup) { - spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - return; - } - var frames = this.frames; - if (time < frames[0]) { - if (blend == MixBlend.setup || blend == MixBlend.first) - spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - return; - } - var frame = 0; - if (time >= frames[frames.length - 1]) - frame = frames.length - 1; - else - frame = Animation.binarySearch(frames, time) - 1; - var drawOrderToSetupIndex = this.drawOrders[frame]; - if (drawOrderToSetupIndex == null) - spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length); - else { - for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = slots[drawOrderToSetupIndex[i]]; - } - }; - return DrawOrderTimeline; - }()); - spine.DrawOrderTimeline = DrawOrderTimeline; - var IkConstraintTimeline = (function (_super) { - __extends(IkConstraintTimeline, _super); - function IkConstraintTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES); - return _this; - } - IkConstraintTimeline.prototype.getPropertyId = function () { - return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex; - }; - IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) { - frameIndex *= IkConstraintTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + IkConstraintTimeline.MIX] = mix; - this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection; - this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0; - this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0; - }; - IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var frames = this.frames; - var constraint = skeleton.ikConstraints[this.ikConstraintIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - constraint.mix = constraint.data.mix; - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - return; - case MixBlend.first: - constraint.mix += (constraint.data.mix - constraint.mix) * alpha; - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } - return; - } - if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { - if (blend == MixBlend.setup) { - constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha; - if (direction == MixDirection.out) { - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } - else { - constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; - constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; - constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; - } - } - else { - constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha; - if (direction == MixDirection["in"]) { - constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; - constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; - constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; - } - } - return; - } - var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES); - var mix = frames[frame + IkConstraintTimeline.PREV_MIX]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime)); - if (blend == MixBlend.setup) { - constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha; - if (direction == MixDirection.out) { - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } - else { - constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; - constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; - constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; - } - } - else { - constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha; - if (direction == MixDirection["in"]) { - constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; - constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; - constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; - } - } - }; - IkConstraintTimeline.ENTRIES = 5; - IkConstraintTimeline.PREV_TIME = -5; - IkConstraintTimeline.PREV_MIX = -4; - IkConstraintTimeline.PREV_BEND_DIRECTION = -3; - IkConstraintTimeline.PREV_COMPRESS = -2; - IkConstraintTimeline.PREV_STRETCH = -1; - IkConstraintTimeline.MIX = 1; - IkConstraintTimeline.BEND_DIRECTION = 2; - IkConstraintTimeline.COMPRESS = 3; - IkConstraintTimeline.STRETCH = 4; - return IkConstraintTimeline; - }(CurveTimeline)); - spine.IkConstraintTimeline = IkConstraintTimeline; - var TransformConstraintTimeline = (function (_super) { - __extends(TransformConstraintTimeline, _super); - function TransformConstraintTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES); - return _this; - } - TransformConstraintTimeline.prototype.getPropertyId = function () { - return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex; - }; - TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) { - frameIndex *= TransformConstraintTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix; - this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix; - this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix; - this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix; - }; - TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var frames = this.frames; - var constraint = skeleton.transformConstraints[this.transformConstraintIndex]; - if (time < frames[0]) { - var data = constraint.data; - switch (blend) { - case MixBlend.setup: - constraint.rotateMix = data.rotateMix; - constraint.translateMix = data.translateMix; - constraint.scaleMix = data.scaleMix; - constraint.shearMix = data.shearMix; - return; - case MixBlend.first: - constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha; - constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha; - constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha; - constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha; - } - return; - } - var rotate = 0, translate = 0, scale = 0, shear = 0; - if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { - var i = frames.length; - rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE]; - translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE]; - scale = frames[i + TransformConstraintTimeline.PREV_SCALE]; - shear = frames[i + TransformConstraintTimeline.PREV_SHEAR]; - } - else { - var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES); - rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE]; - translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE]; - scale = frames[frame + TransformConstraintTimeline.PREV_SCALE]; - shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime)); - rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent; - translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent; - scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent; - shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent; - } - if (blend == MixBlend.setup) { - var data = constraint.data; - constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha; - constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha; - constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha; - constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha; - } - else { - constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; - constraint.translateMix += (translate - constraint.translateMix) * alpha; - constraint.scaleMix += (scale - constraint.scaleMix) * alpha; - constraint.shearMix += (shear - constraint.shearMix) * alpha; - } - }; - TransformConstraintTimeline.ENTRIES = 5; - TransformConstraintTimeline.PREV_TIME = -5; - TransformConstraintTimeline.PREV_ROTATE = -4; - TransformConstraintTimeline.PREV_TRANSLATE = -3; - TransformConstraintTimeline.PREV_SCALE = -2; - TransformConstraintTimeline.PREV_SHEAR = -1; - TransformConstraintTimeline.ROTATE = 1; - TransformConstraintTimeline.TRANSLATE = 2; - TransformConstraintTimeline.SCALE = 3; - TransformConstraintTimeline.SHEAR = 4; - return TransformConstraintTimeline; - }(CurveTimeline)); - spine.TransformConstraintTimeline = TransformConstraintTimeline; - var PathConstraintPositionTimeline = (function (_super) { - __extends(PathConstraintPositionTimeline, _super); - function PathConstraintPositionTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES); - return _this; - } - PathConstraintPositionTimeline.prototype.getPropertyId = function () { - return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex; - }; - PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) { - frameIndex *= PathConstraintPositionTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value; - }; - PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var frames = this.frames; - var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - constraint.position = constraint.data.position; - return; - case MixBlend.first: - constraint.position += (constraint.data.position - constraint.position) * alpha; - } - return; - } - var position = 0; - if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) - position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE]; - else { - var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES); - position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime)); - position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent; - } - if (blend == MixBlend.setup) - constraint.position = constraint.data.position + (position - constraint.data.position) * alpha; - else - constraint.position += (position - constraint.position) * alpha; - }; - PathConstraintPositionTimeline.ENTRIES = 2; - PathConstraintPositionTimeline.PREV_TIME = -2; - PathConstraintPositionTimeline.PREV_VALUE = -1; - PathConstraintPositionTimeline.VALUE = 1; - return PathConstraintPositionTimeline; - }(CurveTimeline)); - spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline; - var PathConstraintSpacingTimeline = (function (_super) { - __extends(PathConstraintSpacingTimeline, _super); - function PathConstraintSpacingTimeline(frameCount) { - return _super.call(this, frameCount) || this; - } - PathConstraintSpacingTimeline.prototype.getPropertyId = function () { - return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex; - }; - PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var frames = this.frames; - var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - constraint.spacing = constraint.data.spacing; - return; - case MixBlend.first: - constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha; - } - return; - } - var spacing = 0; - if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) - spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE]; - else { - var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES); - spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime)); - spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent; - } - if (blend == MixBlend.setup) - constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha; - else - constraint.spacing += (spacing - constraint.spacing) * alpha; - }; - return PathConstraintSpacingTimeline; - }(PathConstraintPositionTimeline)); - spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline; - var PathConstraintMixTimeline = (function (_super) { - __extends(PathConstraintMixTimeline, _super); - function PathConstraintMixTimeline(frameCount) { - var _this = _super.call(this, frameCount) || this; - _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES); - return _this; - } - PathConstraintMixTimeline.prototype.getPropertyId = function () { - return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex; - }; - PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) { - frameIndex *= PathConstraintMixTimeline.ENTRIES; - this.frames[frameIndex] = time; - this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix; - this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix; - }; - PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - var frames = this.frames; - var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; - if (time < frames[0]) { - switch (blend) { - case MixBlend.setup: - constraint.rotateMix = constraint.data.rotateMix; - constraint.translateMix = constraint.data.translateMix; - return; - case MixBlend.first: - constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha; - constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha; - } - return; - } - var rotate = 0, translate = 0; - if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { - rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE]; - translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE]; - } - else { - var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES); - rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE]; - translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE]; - var frameTime = frames[frame]; - var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime)); - rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent; - translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent; - } - if (blend == MixBlend.setup) { - constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha; - constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha; - } - else { - constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; - constraint.translateMix += (translate - constraint.translateMix) * alpha; - } - }; - PathConstraintMixTimeline.ENTRIES = 3; - PathConstraintMixTimeline.PREV_TIME = -3; - PathConstraintMixTimeline.PREV_ROTATE = -2; - PathConstraintMixTimeline.PREV_TRANSLATE = -1; - PathConstraintMixTimeline.ROTATE = 1; - PathConstraintMixTimeline.TRANSLATE = 2; - return PathConstraintMixTimeline; - }(CurveTimeline)); - spine.PathConstraintMixTimeline = PathConstraintMixTimeline; + var Animation = (function () { + function Animation(name, timelines, duration) { + if (name == null) + throw new Error("name cannot be null."); + if (timelines == null) + throw new Error("timelines cannot be null."); + this.name = name; + this.timelines = timelines; + this.duration = duration; + } + Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (loop && this.duration != 0) { + time %= this.duration; + if (lastTime > 0) + lastTime %= this.duration; + } + var timelines = this.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction); + }; + Animation.binarySearch = function (values, target, step) { + if (step === void 0) { step = 1; } + var low = 0; + var high = values.length / step - 2; + if (high == 0) + return step; + var current = high >>> 1; + while (true) { + if (values[(current + 1) * step] <= target) + low = current + 1; + else + high = current; + if (low == high) + return (low + 1) * step; + current = (low + high) >>> 1; + } + }; + Animation.linearSearch = function (values, target, step) { + for (var i = 0, last = values.length - step; i <= last; i += step) + if (values[i] > target) + return i; + return -1; + }; + return Animation; + }()); + spine.Animation = Animation; + var MixBlend; + (function (MixBlend) { + MixBlend[MixBlend["setup"] = 0] = "setup"; + MixBlend[MixBlend["first"] = 1] = "first"; + MixBlend[MixBlend["replace"] = 2] = "replace"; + MixBlend[MixBlend["add"] = 3] = "add"; + })(MixBlend = spine.MixBlend || (spine.MixBlend = {})); + var MixDirection; + (function (MixDirection) { + MixDirection[MixDirection["in"] = 0] = "in"; + MixDirection[MixDirection["out"] = 1] = "out"; + })(MixDirection = spine.MixDirection || (spine.MixDirection = {})); + var TimelineType; + (function (TimelineType) { + TimelineType[TimelineType["rotate"] = 0] = "rotate"; + TimelineType[TimelineType["translate"] = 1] = "translate"; + TimelineType[TimelineType["scale"] = 2] = "scale"; + TimelineType[TimelineType["shear"] = 3] = "shear"; + TimelineType[TimelineType["attachment"] = 4] = "attachment"; + TimelineType[TimelineType["color"] = 5] = "color"; + TimelineType[TimelineType["deform"] = 6] = "deform"; + TimelineType[TimelineType["event"] = 7] = "event"; + TimelineType[TimelineType["drawOrder"] = 8] = "drawOrder"; + TimelineType[TimelineType["ikConstraint"] = 9] = "ikConstraint"; + TimelineType[TimelineType["transformConstraint"] = 10] = "transformConstraint"; + TimelineType[TimelineType["pathConstraintPosition"] = 11] = "pathConstraintPosition"; + TimelineType[TimelineType["pathConstraintSpacing"] = 12] = "pathConstraintSpacing"; + TimelineType[TimelineType["pathConstraintMix"] = 13] = "pathConstraintMix"; + TimelineType[TimelineType["twoColor"] = 14] = "twoColor"; + })(TimelineType = spine.TimelineType || (spine.TimelineType = {})); + var CurveTimeline = (function () { + function CurveTimeline(frameCount) { + if (frameCount <= 0) + throw new Error("frameCount must be > 0: " + frameCount); + this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE); + } + CurveTimeline.prototype.getFrameCount = function () { + return this.curves.length / CurveTimeline.BEZIER_SIZE + 1; + }; + CurveTimeline.prototype.setLinear = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR; + }; + CurveTimeline.prototype.setStepped = function (frameIndex) { + this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED; + }; + CurveTimeline.prototype.getCurveType = function (frameIndex) { + var index = frameIndex * CurveTimeline.BEZIER_SIZE; + if (index == this.curves.length) + return CurveTimeline.LINEAR; + var type = this.curves[index]; + if (type == CurveTimeline.LINEAR) + return CurveTimeline.LINEAR; + if (type == CurveTimeline.STEPPED) + return CurveTimeline.STEPPED; + return CurveTimeline.BEZIER; + }; + CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) { + var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03; + var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006; + var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy; + var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var curves = this.curves; + curves[i++] = CurveTimeline.BEZIER; + var x = dfx, y = dfy; + for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + curves[i] = x; + curves[i + 1] = y; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + x += dfx; + y += dfy; + } + }; + CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) { + percent = spine.MathUtils.clamp(percent, 0, 1); + var curves = this.curves; + var i = frameIndex * CurveTimeline.BEZIER_SIZE; + var type = curves[i]; + if (type == CurveTimeline.LINEAR) + return percent; + if (type == CurveTimeline.STEPPED) + return 0; + i++; + var x = 0; + for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) { + x = curves[i]; + if (x >= percent) { + var prevX = void 0, prevY = void 0; + if (i == start) { + prevX = 0; + prevY = 0; + } + else { + prevX = curves[i - 2]; + prevY = curves[i - 1]; + } + return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); + } + } + var y = curves[i - 1]; + return y + (1 - y) * (percent - x) / (1 - x); + }; + CurveTimeline.LINEAR = 0; + CurveTimeline.STEPPED = 1; + CurveTimeline.BEZIER = 2; + CurveTimeline.BEZIER_SIZE = 10 * 2 - 1; + return CurveTimeline; + }()); + spine.CurveTimeline = CurveTimeline; + var RotateTimeline = (function (_super) { + __extends(RotateTimeline, _super); + function RotateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount << 1); + return _this; + } + RotateTimeline.prototype.getPropertyId = function () { + return (TimelineType.rotate << 24) + this.boneIndex; + }; + RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) { + frameIndex <<= 1; + this.frames[frameIndex] = time; + this.frames[frameIndex + RotateTimeline.ROTATION] = degrees; + }; + RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation; + return; + case MixBlend.first: + var r_1 = bone.data.rotation - bone.rotation; + bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha; + } + return; + } + if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { + var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION]; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + r_2 * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r_2 += bone.data.rotation - bone.rotation; + r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; + case MixBlend.add: + bone.rotation += r_2 * alpha; + } + return; + } + var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES); + var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime)); + var r = frames[frame + RotateTimeline.ROTATION] - prevRotation; + r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent; + switch (blend) { + case MixBlend.setup: + bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + r += bone.data.rotation - bone.rotation; + case MixBlend.add: + bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha; + } + }; + RotateTimeline.ENTRIES = 2; + RotateTimeline.PREV_TIME = -2; + RotateTimeline.PREV_ROTATION = -1; + RotateTimeline.ROTATION = 1; + return RotateTimeline; + }(CurveTimeline)); + spine.RotateTimeline = RotateTimeline; + var TranslateTimeline = (function (_super) { + __extends(TranslateTimeline, _super); + function TranslateTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES); + return _this; + } + TranslateTimeline.prototype.getPropertyId = function () { + return (TimelineType.translate << 24) + this.boneIndex; + }; + TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) { + frameIndex *= TranslateTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TranslateTimeline.X] = x; + this.frames[frameIndex + TranslateTimeline.Y] = y; + }; + TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x; + bone.y = bone.data.y; + return; + case MixBlend.first: + bone.x += (bone.data.x - bone.x) * alpha; + bone.y += (bone.data.y - bone.y) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { + x = frames[frames.length + TranslateTimeline.PREV_X]; + y = frames[frames.length + TranslateTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES); + x = frames[frame + TranslateTimeline.PREV_X]; + y = frames[frame + TranslateTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime)); + x += (frames[frame + TranslateTimeline.X] - x) * percent; + y += (frames[frame + TranslateTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.x = bone.data.x + x * alpha; + bone.y = bone.data.y + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.x += (bone.data.x + x - bone.x) * alpha; + bone.y += (bone.data.y + y - bone.y) * alpha; + break; + case MixBlend.add: + bone.x += x * alpha; + bone.y += y * alpha; + } + }; + TranslateTimeline.ENTRIES = 3; + TranslateTimeline.PREV_TIME = -3; + TranslateTimeline.PREV_X = -2; + TranslateTimeline.PREV_Y = -1; + TranslateTimeline.X = 1; + TranslateTimeline.Y = 2; + return TranslateTimeline; + }(CurveTimeline)); + spine.TranslateTimeline = TranslateTimeline; + var ScaleTimeline = (function (_super) { + __extends(ScaleTimeline, _super); + function ScaleTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ScaleTimeline.prototype.getPropertyId = function () { + return (TimelineType.scale << 24) + this.boneIndex; + }; + ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.scaleX = bone.data.scaleX; + bone.scaleY = bone.data.scaleY; + return; + case MixBlend.first: + bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha; + bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { + x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX; + y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY; + } + else { + var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES); + x = frames[frame + ScaleTimeline.PREV_X]; + y = frames[frame + ScaleTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime)); + x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX; + y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY; + } + if (alpha == 1) { + if (blend == MixBlend.add) { + bone.scaleX += x - bone.data.scaleX; + bone.scaleY += y - bone.data.scaleY; + } + else { + bone.scaleX = x; + bone.scaleY = y; + } + } + else { + var bx = 0, by = 0; + if (direction == MixDirection.out) { + switch (blend) { + case MixBlend.setup: + bx = bone.data.scaleX; + by = bone.data.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha; + break; + case MixBlend.add: + bx = bone.scaleX; + by = bone.scaleY; + bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha; + bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha; + } + } + else { + switch (blend) { + case MixBlend.setup: + bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x); + by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; + break; + case MixBlend.add: + bx = spine.MathUtils.signum(x); + by = spine.MathUtils.signum(y); + bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha; + bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha; + } + } + } + }; + return ScaleTimeline; + }(TranslateTimeline)); + spine.ScaleTimeline = ScaleTimeline; + var ShearTimeline = (function (_super) { + __extends(ShearTimeline, _super); + function ShearTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + ShearTimeline.prototype.getPropertyId = function () { + return (TimelineType.shear << 24) + this.boneIndex; + }; + ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var frames = this.frames; + var bone = skeleton.bones[this.boneIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX; + bone.shearY = bone.data.shearY; + return; + case MixBlend.first: + bone.shearX += (bone.data.shearX - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY - bone.shearY) * alpha; + } + return; + } + var x = 0, y = 0; + if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { + x = frames[frames.length + ShearTimeline.PREV_X]; + y = frames[frames.length + ShearTimeline.PREV_Y]; + } + else { + var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES); + x = frames[frame + ShearTimeline.PREV_X]; + y = frames[frame + ShearTimeline.PREV_Y]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime)); + x = x + (frames[frame + ShearTimeline.X] - x) * percent; + y = y + (frames[frame + ShearTimeline.Y] - y) * percent; + } + switch (blend) { + case MixBlend.setup: + bone.shearX = bone.data.shearX + x * alpha; + bone.shearY = bone.data.shearY + y * alpha; + break; + case MixBlend.first: + case MixBlend.replace: + bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha; + bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha; + break; + case MixBlend.add: + bone.shearX += x * alpha; + bone.shearY += y * alpha; + } + }; + return ShearTimeline; + }(TranslateTimeline)); + spine.ShearTimeline = ShearTimeline; + var ColorTimeline = (function (_super) { + __extends(ColorTimeline, _super); + function ColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES); + return _this; + } + ColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.color << 24) + this.slotIndex; + }; + ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) { + frameIndex *= ColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + ColorTimeline.R] = r; + this.frames[frameIndex + ColorTimeline.G] = g; + this.frames[frameIndex + ColorTimeline.B] = b; + this.frames[frameIndex + ColorTimeline.A] = a; + }; + ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + return; + case MixBlend.first: + var color = slot.color, setup = slot.data.color; + color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha); + } + return; + } + var r = 0, g = 0, b = 0, a = 0; + if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + ColorTimeline.PREV_R]; + g = frames[i + ColorTimeline.PREV_G]; + b = frames[i + ColorTimeline.PREV_B]; + a = frames[i + ColorTimeline.PREV_A]; + } + else { + var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES); + r = frames[frame + ColorTimeline.PREV_R]; + g = frames[frame + ColorTimeline.PREV_G]; + b = frames[frame + ColorTimeline.PREV_B]; + a = frames[frame + ColorTimeline.PREV_A]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + ColorTimeline.R] - r) * percent; + g += (frames[frame + ColorTimeline.G] - g) * percent; + b += (frames[frame + ColorTimeline.B] - b) * percent; + a += (frames[frame + ColorTimeline.A] - a) * percent; + } + if (alpha == 1) + slot.color.set(r, g, b, a); + else { + var color = slot.color; + if (blend == MixBlend.setup) + color.setFromColor(slot.data.color); + color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); + } + }; + ColorTimeline.ENTRIES = 5; + ColorTimeline.PREV_TIME = -5; + ColorTimeline.PREV_R = -4; + ColorTimeline.PREV_G = -3; + ColorTimeline.PREV_B = -2; + ColorTimeline.PREV_A = -1; + ColorTimeline.R = 1; + ColorTimeline.G = 2; + ColorTimeline.B = 3; + ColorTimeline.A = 4; + return ColorTimeline; + }(CurveTimeline)); + spine.ColorTimeline = ColorTimeline; + var TwoColorTimeline = (function (_super) { + __extends(TwoColorTimeline, _super); + function TwoColorTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES); + return _this; + } + TwoColorTimeline.prototype.getPropertyId = function () { + return (TimelineType.twoColor << 24) + this.slotIndex; + }; + TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) { + frameIndex *= TwoColorTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TwoColorTimeline.R] = r; + this.frames[frameIndex + TwoColorTimeline.G] = g; + this.frames[frameIndex + TwoColorTimeline.B] = b; + this.frames[frameIndex + TwoColorTimeline.A] = a; + this.frames[frameIndex + TwoColorTimeline.R2] = r2; + this.frames[frameIndex + TwoColorTimeline.G2] = g2; + this.frames[frameIndex + TwoColorTimeline.B2] = b2; + }; + TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var frames = this.frames; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + slot.color.setFromColor(slot.data.color); + slot.darkColor.setFromColor(slot.data.darkColor); + return; + case MixBlend.first: + var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor; + light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha); + dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0); + } + return; + } + var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; + if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { + var i = frames.length; + r = frames[i + TwoColorTimeline.PREV_R]; + g = frames[i + TwoColorTimeline.PREV_G]; + b = frames[i + TwoColorTimeline.PREV_B]; + a = frames[i + TwoColorTimeline.PREV_A]; + r2 = frames[i + TwoColorTimeline.PREV_R2]; + g2 = frames[i + TwoColorTimeline.PREV_G2]; + b2 = frames[i + TwoColorTimeline.PREV_B2]; + } + else { + var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES); + r = frames[frame + TwoColorTimeline.PREV_R]; + g = frames[frame + TwoColorTimeline.PREV_G]; + b = frames[frame + TwoColorTimeline.PREV_B]; + a = frames[frame + TwoColorTimeline.PREV_A]; + r2 = frames[frame + TwoColorTimeline.PREV_R2]; + g2 = frames[frame + TwoColorTimeline.PREV_G2]; + b2 = frames[frame + TwoColorTimeline.PREV_B2]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime)); + r += (frames[frame + TwoColorTimeline.R] - r) * percent; + g += (frames[frame + TwoColorTimeline.G] - g) * percent; + b += (frames[frame + TwoColorTimeline.B] - b) * percent; + a += (frames[frame + TwoColorTimeline.A] - a) * percent; + r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent; + g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent; + b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent; + } + if (alpha == 1) { + slot.color.set(r, g, b, a); + slot.darkColor.set(r2, g2, b2, 1); + } + else { + var light = slot.color, dark = slot.darkColor; + if (blend == MixBlend.setup) { + light.setFromColor(slot.data.color); + dark.setFromColor(slot.data.darkColor); + } + light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); + dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0); + } + }; + TwoColorTimeline.ENTRIES = 8; + TwoColorTimeline.PREV_TIME = -8; + TwoColorTimeline.PREV_R = -7; + TwoColorTimeline.PREV_G = -6; + TwoColorTimeline.PREV_B = -5; + TwoColorTimeline.PREV_A = -4; + TwoColorTimeline.PREV_R2 = -3; + TwoColorTimeline.PREV_G2 = -2; + TwoColorTimeline.PREV_B2 = -1; + TwoColorTimeline.R = 1; + TwoColorTimeline.G = 2; + TwoColorTimeline.B = 3; + TwoColorTimeline.A = 4; + TwoColorTimeline.R2 = 5; + TwoColorTimeline.G2 = 6; + TwoColorTimeline.B2 = 7; + return TwoColorTimeline; + }(CurveTimeline)); + spine.TwoColorTimeline = TwoColorTimeline; + var AttachmentTimeline = (function () { + function AttachmentTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.attachmentNames = new Array(frameCount); + } + AttachmentTimeline.prototype.getPropertyId = function () { + return (TimelineType.attachment << 24) + this.slotIndex; + }; + AttachmentTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) { + this.frames[frameIndex] = time; + this.attachmentNames[frameIndex] = attachmentName; + }; + AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + if (direction == MixDirection.out && blend == MixBlend.setup) { + var attachmentName_1 = slot.data.attachmentName; + slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1)); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) { + var attachmentName_2 = slot.data.attachmentName; + slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2)); + } + return; + } + var frameIndex = 0; + if (time >= frames[frames.length - 1]) + frameIndex = frames.length - 1; + else + frameIndex = Animation.binarySearch(frames, time, 1) - 1; + var attachmentName = this.attachmentNames[frameIndex]; + skeleton.slots[this.slotIndex] + .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); + }; + return AttachmentTimeline; + }()); + spine.AttachmentTimeline = AttachmentTimeline; + var zeros = null; + var DeformTimeline = (function (_super) { + __extends(DeformTimeline, _super); + function DeformTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount); + _this.frameVertices = new Array(frameCount); + if (zeros == null) + zeros = spine.Utils.newFloatArray(64); + return _this; + } + DeformTimeline.prototype.getPropertyId = function () { + return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex; + }; + DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) { + this.frames[frameIndex] = time; + this.frameVertices[frameIndex] = vertices; + }; + DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var slot = skeleton.slots[this.slotIndex]; + var slotAttachment = slot.getAttachment(); + if (!(slotAttachment instanceof spine.VertexAttachment) || !slotAttachment.applyDeform(this.attachment)) + return; + var verticesArray = slot.attachmentVertices; + if (verticesArray.length == 0) + blend = MixBlend.setup; + var frameVertices = this.frameVertices; + var vertexCount = frameVertices[0].length; + var frames = this.frames; + if (time < frames[0]) { + var vertexAttachment = slotAttachment; + switch (blend) { + case MixBlend.setup: + verticesArray.length = 0; + return; + case MixBlend.first: + if (alpha == 1) { + verticesArray.length = 0; + break; + } + var vertices_1 = spine.Utils.setArraySize(verticesArray, vertexCount); + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha; + } + else { + alpha = 1 - alpha; + for (var i = 0; i < vertexCount; i++) + vertices_1[i] *= alpha; + } + } + return; + } + var vertices = spine.Utils.setArraySize(verticesArray, vertexCount); + if (time >= frames[frames.length - 1]) { + var lastVertices = frameVertices[frames.length - 1]; + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_1 = 0; i_1 < vertexCount; i_1++) { + vertices[i_1] += lastVertices[i_1] - setupVertices[i_1]; + } + } + else { + for (var i_2 = 0; i_2 < vertexCount; i_2++) + vertices[i_2] += lastVertices[i_2]; + } + } + else { + spine.Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount); + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_1 = slotAttachment; + if (vertexAttachment_1.bones == null) { + var setupVertices = vertexAttachment_1.vertices; + for (var i_3 = 0; i_3 < vertexCount; i_3++) { + var setup = setupVertices[i_3]; + vertices[i_3] = setup + (lastVertices[i_3] - setup) * alpha; + } + } + else { + for (var i_4 = 0; i_4 < vertexCount; i_4++) + vertices[i_4] = lastVertices[i_4] * alpha; + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_5 = 0; i_5 < vertexCount; i_5++) + vertices[i_5] += (lastVertices[i_5] - vertices[i_5]) * alpha; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_6 = 0; i_6 < vertexCount; i_6++) { + vertices[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha; + } + } + else { + for (var i_7 = 0; i_7 < vertexCount; i_7++) + vertices[i_7] += lastVertices[i_7] * alpha; + } + } + } + return; + } + var frame = Animation.binarySearch(frames, time); + var prevVertices = frameVertices[frame - 1]; + var nextVertices = frameVertices[frame]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime)); + if (alpha == 1) { + if (blend == MixBlend.add) { + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_8 = 0; i_8 < vertexCount; i_8++) { + var prev = prevVertices[i_8]; + vertices[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8]; + } + } + else { + for (var i_9 = 0; i_9 < vertexCount; i_9++) { + var prev = prevVertices[i_9]; + vertices[i_9] += prev + (nextVertices[i_9] - prev) * percent; + } + } + } + else { + for (var i_10 = 0; i_10 < vertexCount; i_10++) { + var prev = prevVertices[i_10]; + vertices[i_10] = prev + (nextVertices[i_10] - prev) * percent; + } + } + } + else { + switch (blend) { + case MixBlend.setup: { + var vertexAttachment_2 = slotAttachment; + if (vertexAttachment_2.bones == null) { + var setupVertices = vertexAttachment_2.vertices; + for (var i_11 = 0; i_11 < vertexCount; i_11++) { + var prev = prevVertices[i_11], setup = setupVertices[i_11]; + vertices[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha; + } + } + else { + for (var i_12 = 0; i_12 < vertexCount; i_12++) { + var prev = prevVertices[i_12]; + vertices[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha; + } + } + break; + } + case MixBlend.first: + case MixBlend.replace: + for (var i_13 = 0; i_13 < vertexCount; i_13++) { + var prev = prevVertices[i_13]; + vertices[i_13] += (prev + (nextVertices[i_13] - prev) * percent - vertices[i_13]) * alpha; + } + break; + case MixBlend.add: + var vertexAttachment = slotAttachment; + if (vertexAttachment.bones == null) { + var setupVertices = vertexAttachment.vertices; + for (var i_14 = 0; i_14 < vertexCount; i_14++) { + var prev = prevVertices[i_14]; + vertices[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha; + } + } + else { + for (var i_15 = 0; i_15 < vertexCount; i_15++) { + var prev = prevVertices[i_15]; + vertices[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha; + } + } + } + } + }; + return DeformTimeline; + }(CurveTimeline)); + spine.DeformTimeline = DeformTimeline; + var EventTimeline = (function () { + function EventTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.events = new Array(frameCount); + } + EventTimeline.prototype.getPropertyId = function () { + return TimelineType.event << 24; + }; + EventTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + EventTimeline.prototype.setFrame = function (frameIndex, event) { + this.frames[frameIndex] = event.time; + this.events[frameIndex] = event; + }; + EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + if (firedEvents == null) + return; + var frames = this.frames; + var frameCount = this.frames.length; + if (lastTime > time) { + this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction); + lastTime = -1; + } + else if (lastTime >= frames[frameCount - 1]) + return; + if (time < frames[0]) + return; + var frame = 0; + if (lastTime < frames[0]) + frame = 0; + else { + frame = Animation.binarySearch(frames, lastTime); + var frameTime = frames[frame]; + while (frame > 0) { + if (frames[frame - 1] != frameTime) + break; + frame--; + } + } + for (; frame < frameCount && time >= frames[frame]; frame++) + firedEvents.push(this.events[frame]); + }; + return EventTimeline; + }()); + spine.EventTimeline = EventTimeline; + var DrawOrderTimeline = (function () { + function DrawOrderTimeline(frameCount) { + this.frames = spine.Utils.newFloatArray(frameCount); + this.drawOrders = new Array(frameCount); + } + DrawOrderTimeline.prototype.getPropertyId = function () { + return TimelineType.drawOrder << 24; + }; + DrawOrderTimeline.prototype.getFrameCount = function () { + return this.frames.length; + }; + DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) { + this.frames[frameIndex] = time; + this.drawOrders[frameIndex] = drawOrder; + }; + DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var drawOrder = skeleton.drawOrder; + var slots = skeleton.slots; + if (direction == MixDirection.out && blend == MixBlend.setup) { + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frames = this.frames; + if (time < frames[0]) { + if (blend == MixBlend.setup || blend == MixBlend.first) + spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); + return; + } + var frame = 0; + if (time >= frames[frames.length - 1]) + frame = frames.length - 1; + else + frame = Animation.binarySearch(frames, time) - 1; + var drawOrderToSetupIndex = this.drawOrders[frame]; + if (drawOrderToSetupIndex == null) + spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length); + else { + for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) + drawOrder[i] = slots[drawOrderToSetupIndex[i]]; + } + }; + return DrawOrderTimeline; + }()); + spine.DrawOrderTimeline = DrawOrderTimeline; + var IkConstraintTimeline = (function (_super) { + __extends(IkConstraintTimeline, _super); + function IkConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES); + return _this; + } + IkConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex; + }; + IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) { + frameIndex *= IkConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + IkConstraintTimeline.MIX] = mix; + this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection; + this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0; + this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0; + }; + IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.ikConstraints[this.ikConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + return; + case MixBlend.first: + constraint.mix += (constraint.data.mix - constraint.mix) * alpha; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + return; + } + if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + return; + } + var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES); + var mix = frames[frame + IkConstraintTimeline.PREV_MIX]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime)); + if (blend == MixBlend.setup) { + constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha; + if (direction == MixDirection.out) { + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + else { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + else { + constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha; + if (direction == MixDirection["in"]) { + constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]; + constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0; + constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0; + } + } + }; + IkConstraintTimeline.ENTRIES = 5; + IkConstraintTimeline.PREV_TIME = -5; + IkConstraintTimeline.PREV_MIX = -4; + IkConstraintTimeline.PREV_BEND_DIRECTION = -3; + IkConstraintTimeline.PREV_COMPRESS = -2; + IkConstraintTimeline.PREV_STRETCH = -1; + IkConstraintTimeline.MIX = 1; + IkConstraintTimeline.BEND_DIRECTION = 2; + IkConstraintTimeline.COMPRESS = 3; + IkConstraintTimeline.STRETCH = 4; + return IkConstraintTimeline; + }(CurveTimeline)); + spine.IkConstraintTimeline = IkConstraintTimeline; + var TransformConstraintTimeline = (function (_super) { + __extends(TransformConstraintTimeline, _super); + function TransformConstraintTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES); + return _this; + } + TransformConstraintTimeline.prototype.getPropertyId = function () { + return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex; + }; + TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) { + frameIndex *= TransformConstraintTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix; + this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix; + this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix; + }; + TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.transformConstraints[this.transformConstraintIndex]; + if (time < frames[0]) { + var data = constraint.data; + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + return; + case MixBlend.first: + constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha; + constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha; + constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha; + } + return; + } + var rotate = 0, translate = 0, scale = 0, shear = 0; + if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { + var i = frames.length; + rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[i + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[i + TransformConstraintTimeline.PREV_SHEAR]; + } + else { + var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES); + rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE]; + translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE]; + scale = frames[frame + TransformConstraintTimeline.PREV_SCALE]; + shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent; + scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent; + shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent; + } + if (blend == MixBlend.setup) { + var data = constraint.data; + constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha; + constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha; + constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha; + constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + constraint.scaleMix += (scale - constraint.scaleMix) * alpha; + constraint.shearMix += (shear - constraint.shearMix) * alpha; + } + }; + TransformConstraintTimeline.ENTRIES = 5; + TransformConstraintTimeline.PREV_TIME = -5; + TransformConstraintTimeline.PREV_ROTATE = -4; + TransformConstraintTimeline.PREV_TRANSLATE = -3; + TransformConstraintTimeline.PREV_SCALE = -2; + TransformConstraintTimeline.PREV_SHEAR = -1; + TransformConstraintTimeline.ROTATE = 1; + TransformConstraintTimeline.TRANSLATE = 2; + TransformConstraintTimeline.SCALE = 3; + TransformConstraintTimeline.SHEAR = 4; + return TransformConstraintTimeline; + }(CurveTimeline)); + spine.TransformConstraintTimeline = TransformConstraintTimeline; + var PathConstraintPositionTimeline = (function (_super) { + __extends(PathConstraintPositionTimeline, _super); + function PathConstraintPositionTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES); + return _this; + } + PathConstraintPositionTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex; + }; + PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) { + frameIndex *= PathConstraintPositionTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value; + }; + PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.position = constraint.data.position; + return; + case MixBlend.first: + constraint.position += (constraint.data.position - constraint.position) * alpha; + } + return; + } + var position = 0; + if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) + position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES); + position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime)); + position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent; + } + if (blend == MixBlend.setup) + constraint.position = constraint.data.position + (position - constraint.data.position) * alpha; + else + constraint.position += (position - constraint.position) * alpha; + }; + PathConstraintPositionTimeline.ENTRIES = 2; + PathConstraintPositionTimeline.PREV_TIME = -2; + PathConstraintPositionTimeline.PREV_VALUE = -1; + PathConstraintPositionTimeline.VALUE = 1; + return PathConstraintPositionTimeline; + }(CurveTimeline)); + spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline; + var PathConstraintSpacingTimeline = (function (_super) { + __extends(PathConstraintSpacingTimeline, _super); + function PathConstraintSpacingTimeline(frameCount) { + return _super.call(this, frameCount) || this; + } + PathConstraintSpacingTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex; + }; + PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.spacing = constraint.data.spacing; + return; + case MixBlend.first: + constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha; + } + return; + } + var spacing = 0; + if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) + spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE]; + else { + var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES); + spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime)); + spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent; + } + if (blend == MixBlend.setup) + constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha; + else + constraint.spacing += (spacing - constraint.spacing) * alpha; + }; + return PathConstraintSpacingTimeline; + }(PathConstraintPositionTimeline)); + spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline; + var PathConstraintMixTimeline = (function (_super) { + __extends(PathConstraintMixTimeline, _super); + function PathConstraintMixTimeline(frameCount) { + var _this = _super.call(this, frameCount) || this; + _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES); + return _this; + } + PathConstraintMixTimeline.prototype.getPropertyId = function () { + return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex; + }; + PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) { + frameIndex *= PathConstraintMixTimeline.ENTRIES; + this.frames[frameIndex] = time; + this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix; + this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix; + }; + PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) { + var frames = this.frames; + var constraint = skeleton.pathConstraints[this.pathConstraintIndex]; + if (time < frames[0]) { + switch (blend) { + case MixBlend.setup: + constraint.rotateMix = constraint.data.rotateMix; + constraint.translateMix = constraint.data.translateMix; + return; + case MixBlend.first: + constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha; + constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha; + } + return; + } + var rotate = 0, translate = 0; + if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { + rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE]; + } + else { + var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES); + rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE]; + translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE]; + var frameTime = frames[frame]; + var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime)); + rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent; + translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent; + } + if (blend == MixBlend.setup) { + constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha; + constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha; + } + else { + constraint.rotateMix += (rotate - constraint.rotateMix) * alpha; + constraint.translateMix += (translate - constraint.translateMix) * alpha; + } + }; + PathConstraintMixTimeline.ENTRIES = 3; + PathConstraintMixTimeline.PREV_TIME = -3; + PathConstraintMixTimeline.PREV_ROTATE = -2; + PathConstraintMixTimeline.PREV_TRANSLATE = -1; + PathConstraintMixTimeline.ROTATE = 1; + PathConstraintMixTimeline.TRANSLATE = 2; + return PathConstraintMixTimeline; + }(CurveTimeline)); + spine.PathConstraintMixTimeline = PathConstraintMixTimeline; })(spine || (spine = {})); var spine; (function (spine) { - var AnimationState = (function () { - function AnimationState(data) { - this.tracks = new Array(); - this.events = new Array(); - this.listeners = new Array(); - this.queue = new EventQueue(this); - this.propertyIDs = new spine.IntSet(); - this.animationsChanged = false; - this.timeScale = 1; - this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); }); - this.data = data; - } - AnimationState.prototype.update = function (delta) { - delta *= this.timeScale; - var tracks = this.tracks; - for (var i = 0, n = tracks.length; i < n; i++) { - var current = tracks[i]; - if (current == null) - continue; - current.animationLast = current.nextAnimationLast; - current.trackLast = current.nextTrackLast; - var currentDelta = delta * current.timeScale; - if (current.delay > 0) { - current.delay -= currentDelta; - if (current.delay > 0) - continue; - currentDelta = -current.delay; - current.delay = 0; - } - var next = current.next; - if (next != null) { - var nextTime = current.trackLast - next.delay; - if (nextTime >= 0) { - next.delay = 0; - next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; - current.trackTime += currentDelta; - this.setCurrent(i, next, true); - while (next.mixingFrom != null) { - next.mixTime += delta; - next = next.mixingFrom; - } - continue; - } - } - else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) { - tracks[i] = null; - this.queue.end(current); - this.disposeNext(current); - continue; - } - if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) { - var from = current.mixingFrom; - current.mixingFrom = null; - if (from != null) - from.mixingTo = null; - while (from != null) { - this.queue.end(from); - from = from.mixingFrom; - } - } - current.trackTime += currentDelta; - } - this.queue.drain(); - }; - AnimationState.prototype.updateMixingFrom = function (to, delta) { - var from = to.mixingFrom; - if (from == null) - return true; - var finished = this.updateMixingFrom(from, delta); - from.animationLast = from.nextAnimationLast; - from.trackLast = from.nextTrackLast; - if (to.mixTime > 0 && to.mixTime >= to.mixDuration) { - if (from.totalAlpha == 0 || to.mixDuration == 0) { - to.mixingFrom = from.mixingFrom; - if (from.mixingFrom != null) - from.mixingFrom.mixingTo = to; - to.interruptAlpha = from.interruptAlpha; - this.queue.end(from); - } - return finished; - } - from.trackTime += delta * from.timeScale; - to.mixTime += delta; - return false; - }; - AnimationState.prototype.apply = function (skeleton) { - if (skeleton == null) - throw new Error("skeleton cannot be null."); - if (this.animationsChanged) - this._animationsChanged(); - var events = this.events; - var tracks = this.tracks; - var applied = false; - for (var i = 0, n = tracks.length; i < n; i++) { - var current = tracks[i]; - if (current == null || current.delay > 0) - continue; - applied = true; - var blend = i == 0 ? spine.MixBlend.first : current.mixBlend; - var mix = current.alpha; - if (current.mixingFrom != null) - mix *= this.applyMixingFrom(current, skeleton, blend); - else if (current.trackTime >= current.trackEnd && current.next == null) - mix = 0; - var animationLast = current.animationLast, animationTime = current.getAnimationTime(); - var timelineCount = current.animation.timelines.length; - var timelines = current.animation.timelines; - if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) { - for (var ii = 0; ii < timelineCount; ii++) - timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]); - } - else { - var timelineMode = current.timelineMode; - var firstFrame = current.timelinesRotation.length == 0; - if (firstFrame) - spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null); - var timelinesRotation = current.timelinesRotation; - for (var ii = 0; ii < timelineCount; ii++) { - var timeline = timelines[ii]; - var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup; - if (timeline instanceof spine.RotateTimeline) { - this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame); - } - else { - spine.Utils.webkit602BugfixHelper(mix, blend); - timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]); - } - } - } - this.queueEvents(current, animationTime); - events.length = 0; - current.nextAnimationLast = animationTime; - current.nextTrackLast = current.trackTime; - } - this.queue.drain(); - return applied; - }; - AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) { - var from = to.mixingFrom; - if (from.mixingFrom != null) - this.applyMixingFrom(from, skeleton, blend); - var mix = 0; - if (to.mixDuration == 0) { - mix = 1; - if (blend == spine.MixBlend.first) - blend = spine.MixBlend.setup; - } - else { - mix = to.mixTime / to.mixDuration; - if (mix > 1) - mix = 1; - if (blend != spine.MixBlend.first) - blend = from.mixBlend; - } - var events = mix < from.eventThreshold ? this.events : null; - var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold; - var animationLast = from.animationLast, animationTime = from.getAnimationTime(); - var timelineCount = from.animation.timelines.length; - var timelines = from.animation.timelines; - var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); - if (blend == spine.MixBlend.add) { - for (var i = 0; i < timelineCount; i++) - timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out); - } - else { - var timelineMode = from.timelineMode; - var timelineHoldMix = from.timelineHoldMix; - var firstFrame = from.timelinesRotation.length == 0; - if (firstFrame) - spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null); - var timelinesRotation = from.timelinesRotation; - from.totalAlpha = 0; - for (var i = 0; i < timelineCount; i++) { - var timeline = timelines[i]; - var direction = spine.MixDirection.out; - var timelineBlend = void 0; - var alpha = 0; - switch (timelineMode[i]) { - case AnimationState.SUBSEQUENT: - if (!attachments && timeline instanceof spine.AttachmentTimeline) - continue; - if (!drawOrder && timeline instanceof spine.DrawOrderTimeline) - continue; - timelineBlend = blend; - alpha = alphaMix; - break; - case AnimationState.FIRST: - timelineBlend = spine.MixBlend.setup; - alpha = alphaMix; - break; - case AnimationState.HOLD: - timelineBlend = spine.MixBlend.setup; - alpha = alphaHold; - break; - default: - timelineBlend = spine.MixBlend.setup; - var holdMix = timelineHoldMix[i]; - alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); - break; - } - from.totalAlpha += alpha; - if (timeline instanceof spine.RotateTimeline) - this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame); - else { - spine.Utils.webkit602BugfixHelper(alpha, blend); - if (timelineBlend == spine.MixBlend.setup) { - if (timeline instanceof spine.AttachmentTimeline) { - if (attachments) - direction = spine.MixDirection.out; - } - else if (timeline instanceof spine.DrawOrderTimeline) { - if (drawOrder) - direction = spine.MixDirection.out; - } - } - timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction); - } - } - } - if (to.mixDuration > 0) - this.queueEvents(from, animationTime); - this.events.length = 0; - from.nextAnimationLast = animationTime; - from.nextTrackLast = from.trackTime; - return mix; - }; - AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { - if (firstFrame) - timelinesRotation[i] = 0; - if (alpha == 1) { - timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]); - return; - } - var rotateTimeline = timeline; - var frames = rotateTimeline.frames; - var bone = skeleton.bones[rotateTimeline.boneIndex]; - var r1 = 0, r2 = 0; - if (time < frames[0]) { - switch (blend) { - case spine.MixBlend.setup: - bone.rotation = bone.data.rotation; - default: - return; - case spine.MixBlend.first: - r1 = bone.rotation; - r2 = bone.data.rotation; - } - } - else { - r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation; - if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES]) - r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION]; - else { - var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES); - var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION]; - var frameTime = frames[frame]; - var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime)); - r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation; - r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; - r2 = prevRotation + r2 * percent + bone.data.rotation; - r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; - } - } - var total = 0, diff = r2 - r1; - diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360; - if (diff == 0) { - total = timelinesRotation[i]; - } - else { - var lastTotal = 0, lastDiff = 0; - if (firstFrame) { - lastTotal = 0; - lastDiff = diff; - } - else { - lastTotal = timelinesRotation[i]; - lastDiff = timelinesRotation[i + 1]; - } - var current = diff > 0, dir = lastTotal >= 0; - if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) { - if (Math.abs(lastTotal) > 180) - lastTotal += 360 * spine.MathUtils.signum(lastTotal); - dir = current; - } - total = diff + lastTotal - lastTotal % 360; - if (dir != current) - total += 360 * spine.MathUtils.signum(lastTotal); - timelinesRotation[i] = total; - } - timelinesRotation[i + 1] = diff; - r1 += total * alpha; - bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360; - }; - AnimationState.prototype.queueEvents = function (entry, animationTime) { - var animationStart = entry.animationStart, animationEnd = entry.animationEnd; - var duration = animationEnd - animationStart; - var trackLastWrapped = entry.trackLast % duration; - var events = this.events; - var i = 0, n = events.length; - for (; i < n; i++) { - var event_1 = events[i]; - if (event_1.time < trackLastWrapped) - break; - if (event_1.time > animationEnd) - continue; - this.queue.event(entry, event_1); - } - var complete = false; - if (entry.loop) - complete = duration == 0 || trackLastWrapped > entry.trackTime % duration; - else - complete = animationTime >= animationEnd && entry.animationLast < animationEnd; - if (complete) - this.queue.complete(entry); - for (; i < n; i++) { - var event_2 = events[i]; - if (event_2.time < animationStart) - continue; - this.queue.event(entry, events[i]); - } - }; - AnimationState.prototype.clearTracks = function () { - var oldDrainDisabled = this.queue.drainDisabled; - this.queue.drainDisabled = true; - for (var i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - this.queue.drainDisabled = oldDrainDisabled; - this.queue.drain(); - }; - AnimationState.prototype.clearTrack = function (trackIndex) { - if (trackIndex >= this.tracks.length) - return; - var current = this.tracks[trackIndex]; - if (current == null) - return; - this.queue.end(current); - this.disposeNext(current); - var entry = current; - while (true) { - var from = entry.mixingFrom; - if (from == null) - break; - this.queue.end(from); - entry.mixingFrom = null; - entry.mixingTo = null; - entry = from; - } - this.tracks[current.trackIndex] = null; - this.queue.drain(); - }; - AnimationState.prototype.setCurrent = function (index, current, interrupt) { - var from = this.expandToIndex(index); - this.tracks[index] = current; - if (from != null) { - if (interrupt) - this.queue.interrupt(from); - current.mixingFrom = from; - from.mixingTo = current; - current.mixTime = 0; - if (from.mixingFrom != null && from.mixDuration > 0) - current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); - from.timelinesRotation.length = 0; - } - this.queue.start(current); - }; - AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (animation == null) - throw new Error("Animation not found: " + animationName); - return this.setAnimationWith(trackIndex, animation, loop); - }; - AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) { - if (animation == null) - throw new Error("animation cannot be null."); - var interrupt = true; - var current = this.expandToIndex(trackIndex); - if (current != null) { - if (current.nextTrackLast == -1) { - this.tracks[trackIndex] = current.mixingFrom; - this.queue.interrupt(current); - this.queue.end(current); - this.disposeNext(current); - current = current.mixingFrom; - interrupt = false; - } - else - this.disposeNext(current); - } - var entry = this.trackEntry(trackIndex, animation, loop, current); - this.setCurrent(trackIndex, entry, interrupt); - this.queue.drain(); - return entry; - }; - AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (animation == null) - throw new Error("Animation not found: " + animationName); - return this.addAnimationWith(trackIndex, animation, loop, delay); - }; - AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) { - if (animation == null) - throw new Error("animation cannot be null."); - var last = this.expandToIndex(trackIndex); - if (last != null) { - while (last.next != null) - last = last.next; - } - var entry = this.trackEntry(trackIndex, animation, loop, last); - if (last == null) { - this.setCurrent(trackIndex, entry, true); - this.queue.drain(); - } - else { - last.next = entry; - if (delay <= 0) { - var duration = last.animationEnd - last.animationStart; - if (duration != 0) { - if (last.loop) - delay += duration * (1 + ((last.trackTime / duration) | 0)); - else - delay += Math.max(duration, last.trackTime); - delay -= this.data.getMix(last.animation, animation); - } - else - delay = last.trackTime; - } - } - entry.delay = delay; - return entry; - }; - AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) { - var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false); - entry.mixDuration = mixDuration; - entry.trackEnd = mixDuration; - return entry; - }; - AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) { - if (delay <= 0) - delay -= mixDuration; - var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay); - entry.mixDuration = mixDuration; - entry.trackEnd = mixDuration; - return entry; - }; - AnimationState.prototype.setEmptyAnimations = function (mixDuration) { - var oldDrainDisabled = this.queue.drainDisabled; - this.queue.drainDisabled = true; - for (var i = 0, n = this.tracks.length; i < n; i++) { - var current = this.tracks[i]; - if (current != null) - this.setEmptyAnimation(current.trackIndex, mixDuration); - } - this.queue.drainDisabled = oldDrainDisabled; - this.queue.drain(); - }; - AnimationState.prototype.expandToIndex = function (index) { - if (index < this.tracks.length) - return this.tracks[index]; - spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null); - this.tracks.length = index + 1; - return null; - }; - AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) { - var entry = this.trackEntryPool.obtain(); - entry.trackIndex = trackIndex; - entry.animation = animation; - entry.loop = loop; - entry.holdPrevious = false; - entry.eventThreshold = 0; - entry.attachmentThreshold = 0; - entry.drawOrderThreshold = 0; - entry.animationStart = 0; - entry.animationEnd = animation.duration; - entry.animationLast = -1; - entry.nextAnimationLast = -1; - entry.delay = 0; - entry.trackTime = 0; - entry.trackLast = -1; - entry.nextTrackLast = -1; - entry.trackEnd = Number.MAX_VALUE; - entry.timeScale = 1; - entry.alpha = 1; - entry.interruptAlpha = 1; - entry.mixTime = 0; - entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); - return entry; - }; - AnimationState.prototype.disposeNext = function (entry) { - var next = entry.next; - while (next != null) { - this.queue.dispose(next); - next = next.next; - } - entry.next = null; - }; - AnimationState.prototype._animationsChanged = function () { - this.animationsChanged = false; - this.propertyIDs.clear(); - for (var i = 0, n = this.tracks.length; i < n; i++) { - var entry = this.tracks[i]; - if (entry == null) - continue; - while (entry.mixingFrom != null) - entry = entry.mixingFrom; - do { - if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add) - this.setTimelineModes(entry); - entry = entry.mixingTo; - } while (entry != null); - } - }; - AnimationState.prototype.setTimelineModes = function (entry) { - var to = entry.mixingTo; - var timelines = entry.animation.timelines; - var timelinesCount = entry.animation.timelines.length; - var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount); - entry.timelineHoldMix.length = 0; - var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount); - var propertyIDs = this.propertyIDs; - if (to != null && to.holdPrevious) { - for (var i = 0; i < timelinesCount; i++) { - propertyIDs.add(timelines[i].getPropertyId()); - timelineMode[i] = AnimationState.HOLD; - } - return; - } - outer: for (var i = 0; i < timelinesCount; i++) { - var id = timelines[i].getPropertyId(); - if (!propertyIDs.add(id)) - timelineMode[i] = AnimationState.SUBSEQUENT; - else if (to == null || !this.hasTimeline(to, id)) - timelineMode[i] = AnimationState.FIRST; - else { - for (var next = to.mixingTo; next != null; next = next.mixingTo) { - if (this.hasTimeline(next, id)) - continue; - if (entry.mixDuration > 0) { - timelineMode[i] = AnimationState.HOLD_MIX; - timelineDipMix[i] = next; - continue outer; - } - break; - } - timelineMode[i] = AnimationState.HOLD; - } - } - }; - AnimationState.prototype.hasTimeline = function (entry, id) { - var timelines = entry.animation.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - if (timelines[i].getPropertyId() == id) - return true; - return false; - }; - AnimationState.prototype.getCurrent = function (trackIndex) { - if (trackIndex >= this.tracks.length) - return null; - return this.tracks[trackIndex]; - }; - AnimationState.prototype.addListener = function (listener) { - if (listener == null) - throw new Error("listener cannot be null."); - this.listeners.push(listener); - }; - AnimationState.prototype.removeListener = function (listener) { - var index = this.listeners.indexOf(listener); - if (index >= 0) - this.listeners.splice(index, 1); - }; - AnimationState.prototype.clearListeners = function () { - this.listeners.length = 0; - }; - AnimationState.prototype.clearListenerNotifications = function () { - this.queue.clear(); - }; - AnimationState.emptyAnimation = new spine.Animation("", [], 0); - AnimationState.SUBSEQUENT = 0; - AnimationState.FIRST = 1; - AnimationState.HOLD = 2; - AnimationState.HOLD_MIX = 3; - return AnimationState; - }()); - spine.AnimationState = AnimationState; - var TrackEntry = (function () { - function TrackEntry() { - this.mixBlend = spine.MixBlend.replace; - this.timelineMode = new Array(); - this.timelineHoldMix = new Array(); - this.timelinesRotation = new Array(); - } - TrackEntry.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; - }; - TrackEntry.prototype.getAnimationTime = function () { - if (this.loop) { - var duration = this.animationEnd - this.animationStart; - if (duration == 0) - return this.animationStart; - return (this.trackTime % duration) + this.animationStart; - } - return Math.min(this.trackTime + this.animationStart, this.animationEnd); - }; - TrackEntry.prototype.setAnimationLast = function (animationLast) { - this.animationLast = animationLast; - this.nextAnimationLast = animationLast; - }; - TrackEntry.prototype.isComplete = function () { - return this.trackTime >= this.animationEnd - this.animationStart; - }; - TrackEntry.prototype.resetRotationDirections = function () { - this.timelinesRotation.length = 0; - }; - return TrackEntry; - }()); - spine.TrackEntry = TrackEntry; - var EventQueue = (function () { - function EventQueue(animState) { - this.objects = []; - this.drainDisabled = false; - this.animState = animState; - } - EventQueue.prototype.start = function (entry) { - this.objects.push(EventType.start); - this.objects.push(entry); - this.animState.animationsChanged = true; - }; - EventQueue.prototype.interrupt = function (entry) { - this.objects.push(EventType.interrupt); - this.objects.push(entry); - }; - EventQueue.prototype.end = function (entry) { - this.objects.push(EventType.end); - this.objects.push(entry); - this.animState.animationsChanged = true; - }; - EventQueue.prototype.dispose = function (entry) { - this.objects.push(EventType.dispose); - this.objects.push(entry); - }; - EventQueue.prototype.complete = function (entry) { - this.objects.push(EventType.complete); - this.objects.push(entry); - }; - EventQueue.prototype.event = function (entry, event) { - this.objects.push(EventType.event); - this.objects.push(entry); - this.objects.push(event); - }; - EventQueue.prototype.drain = function () { - if (this.drainDisabled) - return; - this.drainDisabled = true; - var objects = this.objects; - var listeners = this.animState.listeners; - for (var i = 0; i < objects.length; i += 2) { - var type = objects[i]; - var entry = objects[i + 1]; - switch (type) { - case EventType.start: - if (entry.listener != null && entry.listener.start) - entry.listener.start(entry); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].start) - listeners[ii].start(entry); - break; - case EventType.interrupt: - if (entry.listener != null && entry.listener.interrupt) - entry.listener.interrupt(entry); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].interrupt) - listeners[ii].interrupt(entry); - break; - case EventType.end: - if (entry.listener != null && entry.listener.end) - entry.listener.end(entry); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].end) - listeners[ii].end(entry); - case EventType.dispose: - if (entry.listener != null && entry.listener.dispose) - entry.listener.dispose(entry); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].dispose) - listeners[ii].dispose(entry); - this.animState.trackEntryPool.free(entry); - break; - case EventType.complete: - if (entry.listener != null && entry.listener.complete) - entry.listener.complete(entry); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].complete) - listeners[ii].complete(entry); - break; - case EventType.event: - var event_3 = objects[i++ + 2]; - if (entry.listener != null && entry.listener.event) - entry.listener.event(entry, event_3); - for (var ii = 0; ii < listeners.length; ii++) - if (listeners[ii].event) - listeners[ii].event(entry, event_3); - break; - } - } - this.clear(); - this.drainDisabled = false; - }; - EventQueue.prototype.clear = function () { - this.objects.length = 0; - }; - return EventQueue; - }()); - spine.EventQueue = EventQueue; - var EventType; - (function (EventType) { - EventType[EventType["start"] = 0] = "start"; - EventType[EventType["interrupt"] = 1] = "interrupt"; - EventType[EventType["end"] = 2] = "end"; - EventType[EventType["dispose"] = 3] = "dispose"; - EventType[EventType["complete"] = 4] = "complete"; - EventType[EventType["event"] = 5] = "event"; - })(EventType = spine.EventType || (spine.EventType = {})); - var AnimationStateAdapter2 = (function () { - function AnimationStateAdapter2() { - } - AnimationStateAdapter2.prototype.start = function (entry) { - }; - AnimationStateAdapter2.prototype.interrupt = function (entry) { - }; - AnimationStateAdapter2.prototype.end = function (entry) { - }; - AnimationStateAdapter2.prototype.dispose = function (entry) { - }; - AnimationStateAdapter2.prototype.complete = function (entry) { - }; - AnimationStateAdapter2.prototype.event = function (entry, event) { - }; - return AnimationStateAdapter2; - }()); - spine.AnimationStateAdapter2 = AnimationStateAdapter2; + var AnimationState = (function () { + function AnimationState(data) { + this.tracks = new Array(); + this.events = new Array(); + this.listeners = new Array(); + this.queue = new EventQueue(this); + this.propertyIDs = new spine.IntSet(); + this.animationsChanged = false; + this.timeScale = 1; + this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); }); + this.data = data; + } + AnimationState.prototype.update = function (delta) { + delta *= this.timeScale; + var tracks = this.tracks; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null) + continue; + current.animationLast = current.nextAnimationLast; + current.trackLast = current.nextTrackLast; + var currentDelta = delta * current.timeScale; + if (current.delay > 0) { + current.delay -= currentDelta; + if (current.delay > 0) + continue; + currentDelta = -current.delay; + current.delay = 0; + } + var next = current.next; + if (next != null) { + var nextTime = current.trackLast - next.delay; + if (nextTime >= 0) { + next.delay = 0; + next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; + current.trackTime += currentDelta; + this.setCurrent(i, next, true); + while (next.mixingFrom != null) { + next.mixTime += delta; + next = next.mixingFrom; + } + continue; + } + } + else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) { + tracks[i] = null; + this.queue.end(current); + this.disposeNext(current); + continue; + } + if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) { + var from = current.mixingFrom; + current.mixingFrom = null; + if (from != null) + from.mixingTo = null; + while (from != null) { + this.queue.end(from); + from = from.mixingFrom; + } + } + current.trackTime += currentDelta; + } + this.queue.drain(); + }; + AnimationState.prototype.updateMixingFrom = function (to, delta) { + var from = to.mixingFrom; + if (from == null) + return true; + var finished = this.updateMixingFrom(from, delta); + from.animationLast = from.nextAnimationLast; + from.trackLast = from.nextTrackLast; + if (to.mixTime > 0 && to.mixTime >= to.mixDuration) { + if (from.totalAlpha == 0 || to.mixDuration == 0) { + to.mixingFrom = from.mixingFrom; + if (from.mixingFrom != null) + from.mixingFrom.mixingTo = to; + to.interruptAlpha = from.interruptAlpha; + this.queue.end(from); + } + return finished; + } + from.trackTime += delta * from.timeScale; + to.mixTime += delta; + return false; + }; + AnimationState.prototype.apply = function (skeleton) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + if (this.animationsChanged) + this._animationsChanged(); + var events = this.events; + var tracks = this.tracks; + var applied = false; + for (var i = 0, n = tracks.length; i < n; i++) { + var current = tracks[i]; + if (current == null || current.delay > 0) + continue; + applied = true; + var blend = i == 0 ? spine.MixBlend.first : current.mixBlend; + var mix = current.alpha; + if (current.mixingFrom != null) + mix *= this.applyMixingFrom(current, skeleton, blend); + else if (current.trackTime >= current.trackEnd && current.next == null) + mix = 0; + var animationLast = current.animationLast, animationTime = current.getAnimationTime(); + var timelineCount = current.animation.timelines.length; + var timelines = current.animation.timelines; + if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) { + for (var ii = 0; ii < timelineCount; ii++) + timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]); + } + else { + var timelineMode = current.timelineMode; + var firstFrame = current.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = current.timelinesRotation; + for (var ii = 0; ii < timelineCount; ii++) { + var timeline = timelines[ii]; + var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup; + if (timeline instanceof spine.RotateTimeline) { + this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame); + } + else { + spine.Utils.webkit602BugfixHelper(mix, blend); + timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]); + } + } + } + this.queueEvents(current, animationTime); + events.length = 0; + current.nextAnimationLast = animationTime; + current.nextTrackLast = current.trackTime; + } + this.queue.drain(); + return applied; + }; + AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) { + var from = to.mixingFrom; + if (from.mixingFrom != null) + this.applyMixingFrom(from, skeleton, blend); + var mix = 0; + if (to.mixDuration == 0) { + mix = 1; + if (blend == spine.MixBlend.first) + blend = spine.MixBlend.setup; + } + else { + mix = to.mixTime / to.mixDuration; + if (mix > 1) + mix = 1; + if (blend != spine.MixBlend.first) + blend = from.mixBlend; + } + var events = mix < from.eventThreshold ? this.events : null; + var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold; + var animationLast = from.animationLast, animationTime = from.getAnimationTime(); + var timelineCount = from.animation.timelines.length; + var timelines = from.animation.timelines; + var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); + if (blend == spine.MixBlend.add) { + for (var i = 0; i < timelineCount; i++) + timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out); + } + else { + var timelineMode = from.timelineMode; + var timelineHoldMix = from.timelineHoldMix; + var firstFrame = from.timelinesRotation.length == 0; + if (firstFrame) + spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null); + var timelinesRotation = from.timelinesRotation; + from.totalAlpha = 0; + for (var i = 0; i < timelineCount; i++) { + var timeline = timelines[i]; + var direction = spine.MixDirection.out; + var timelineBlend = void 0; + var alpha = 0; + switch (timelineMode[i]) { + case AnimationState.SUBSEQUENT: + if (!attachments && timeline instanceof spine.AttachmentTimeline) + continue; + if (!drawOrder && timeline instanceof spine.DrawOrderTimeline) + continue; + timelineBlend = blend; + alpha = alphaMix; + break; + case AnimationState.FIRST: + timelineBlend = spine.MixBlend.setup; + alpha = alphaMix; + break; + case AnimationState.HOLD: + timelineBlend = spine.MixBlend.setup; + alpha = alphaHold; + break; + default: + timelineBlend = spine.MixBlend.setup; + var holdMix = timelineHoldMix[i]; + alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); + break; + } + from.totalAlpha += alpha; + if (timeline instanceof spine.RotateTimeline) + this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame); + else { + spine.Utils.webkit602BugfixHelper(alpha, blend); + if (timelineBlend == spine.MixBlend.setup) { + if (timeline instanceof spine.AttachmentTimeline) { + if (attachments) + direction = spine.MixDirection.out; + } + else if (timeline instanceof spine.DrawOrderTimeline) { + if (drawOrder) + direction = spine.MixDirection.out; + } + } + timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction); + } + } + } + if (to.mixDuration > 0) + this.queueEvents(from, animationTime); + this.events.length = 0; + from.nextAnimationLast = animationTime; + from.nextTrackLast = from.trackTime; + return mix; + }; + AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { + if (firstFrame) + timelinesRotation[i] = 0; + if (alpha == 1) { + timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]); + return; + } + var rotateTimeline = timeline; + var frames = rotateTimeline.frames; + var bone = skeleton.bones[rotateTimeline.boneIndex]; + var r1 = 0, r2 = 0; + if (time < frames[0]) { + switch (blend) { + case spine.MixBlend.setup: + bone.rotation = bone.data.rotation; + default: + return; + case spine.MixBlend.first: + r1 = bone.rotation; + r2 = bone.data.rotation; + } + } + else { + r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation; + if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES]) + r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION]; + else { + var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES); + var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION]; + var frameTime = frames[frame]; + var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime)); + r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + r2 = prevRotation + r2 * percent + bone.data.rotation; + r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360; + } + } + var total = 0, diff = r2 - r1; + diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360; + if (diff == 0) { + total = timelinesRotation[i]; + } + else { + var lastTotal = 0, lastDiff = 0; + if (firstFrame) { + lastTotal = 0; + lastDiff = diff; + } + else { + lastTotal = timelinesRotation[i]; + lastDiff = timelinesRotation[i + 1]; + } + var current = diff > 0, dir = lastTotal >= 0; + if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) { + if (Math.abs(lastTotal) > 180) + lastTotal += 360 * spine.MathUtils.signum(lastTotal); + dir = current; + } + total = diff + lastTotal - lastTotal % 360; + if (dir != current) + total += 360 * spine.MathUtils.signum(lastTotal); + timelinesRotation[i] = total; + } + timelinesRotation[i + 1] = diff; + r1 += total * alpha; + bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360; + }; + AnimationState.prototype.queueEvents = function (entry, animationTime) { + var animationStart = entry.animationStart, animationEnd = entry.animationEnd; + var duration = animationEnd - animationStart; + var trackLastWrapped = entry.trackLast % duration; + var events = this.events; + var i = 0, n = events.length; + for (; i < n; i++) { + var event_1 = events[i]; + if (event_1.time < trackLastWrapped) + break; + if (event_1.time > animationEnd) + continue; + this.queue.event(entry, event_1); + } + var complete = false; + if (entry.loop) + complete = duration == 0 || trackLastWrapped > entry.trackTime % duration; + else + complete = animationTime >= animationEnd && entry.animationLast < animationEnd; + if (complete) + this.queue.complete(entry); + for (; i < n; i++) { + var event_2 = events[i]; + if (event_2.time < animationStart) + continue; + this.queue.event(entry, events[i]); + } + }; + AnimationState.prototype.clearTracks = function () { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) + this.clearTrack(i); + this.tracks.length = 0; + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.clearTrack = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return; + var current = this.tracks[trackIndex]; + if (current == null) + return; + this.queue.end(current); + this.disposeNext(current); + var entry = current; + while (true) { + var from = entry.mixingFrom; + if (from == null) + break; + this.queue.end(from); + entry.mixingFrom = null; + entry.mixingTo = null; + entry = from; + } + this.tracks[current.trackIndex] = null; + this.queue.drain(); + }; + AnimationState.prototype.setCurrent = function (index, current, interrupt) { + var from = this.expandToIndex(index); + this.tracks[index] = current; + if (from != null) { + if (interrupt) + this.queue.interrupt(from); + current.mixingFrom = from; + from.mixingTo = current; + current.mixTime = 0; + if (from.mixingFrom != null && from.mixDuration > 0) + current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); + from.timelinesRotation.length = 0; + } + this.queue.start(current); + }; + AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.setAnimationWith(trackIndex, animation, loop); + }; + AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) { + if (animation == null) + throw new Error("animation cannot be null."); + var interrupt = true; + var current = this.expandToIndex(trackIndex); + if (current != null) { + if (current.nextTrackLast == -1) { + this.tracks[trackIndex] = current.mixingFrom; + this.queue.interrupt(current); + this.queue.end(current); + this.disposeNext(current); + current = current.mixingFrom; + interrupt = false; + } + else + this.disposeNext(current); + } + var entry = this.trackEntry(trackIndex, animation, loop, current); + this.setCurrent(trackIndex, entry, interrupt); + this.queue.drain(); + return entry; + }; + AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) { + var animation = this.data.skeletonData.findAnimation(animationName); + if (animation == null) + throw new Error("Animation not found: " + animationName); + return this.addAnimationWith(trackIndex, animation, loop, delay); + }; + AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) { + if (animation == null) + throw new Error("animation cannot be null."); + var last = this.expandToIndex(trackIndex); + if (last != null) { + while (last.next != null) + last = last.next; + } + var entry = this.trackEntry(trackIndex, animation, loop, last); + if (last == null) { + this.setCurrent(trackIndex, entry, true); + this.queue.drain(); + } + else { + last.next = entry; + if (delay <= 0) { + var duration = last.animationEnd - last.animationStart; + if (duration != 0) { + if (last.loop) + delay += duration * (1 + ((last.trackTime / duration) | 0)); + else + delay += Math.max(duration, last.trackTime); + delay -= this.data.getMix(last.animation, animation); + } + else + delay = last.trackTime; + } + } + entry.delay = delay; + return entry; + }; + AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) { + var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) { + if (delay <= 0) + delay -= mixDuration; + var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay); + entry.mixDuration = mixDuration; + entry.trackEnd = mixDuration; + return entry; + }; + AnimationState.prototype.setEmptyAnimations = function (mixDuration) { + var oldDrainDisabled = this.queue.drainDisabled; + this.queue.drainDisabled = true; + for (var i = 0, n = this.tracks.length; i < n; i++) { + var current = this.tracks[i]; + if (current != null) + this.setEmptyAnimation(current.trackIndex, mixDuration); + } + this.queue.drainDisabled = oldDrainDisabled; + this.queue.drain(); + }; + AnimationState.prototype.expandToIndex = function (index) { + if (index < this.tracks.length) + return this.tracks[index]; + spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null); + this.tracks.length = index + 1; + return null; + }; + AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) { + var entry = this.trackEntryPool.obtain(); + entry.trackIndex = trackIndex; + entry.animation = animation; + entry.loop = loop; + entry.holdPrevious = false; + entry.eventThreshold = 0; + entry.attachmentThreshold = 0; + entry.drawOrderThreshold = 0; + entry.animationStart = 0; + entry.animationEnd = animation.duration; + entry.animationLast = -1; + entry.nextAnimationLast = -1; + entry.delay = 0; + entry.trackTime = 0; + entry.trackLast = -1; + entry.nextTrackLast = -1; + entry.trackEnd = Number.MAX_VALUE; + entry.timeScale = 1; + entry.alpha = 1; + entry.interruptAlpha = 1; + entry.mixTime = 0; + entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); + return entry; + }; + AnimationState.prototype.disposeNext = function (entry) { + var next = entry.next; + while (next != null) { + this.queue.dispose(next); + next = next.next; + } + entry.next = null; + }; + AnimationState.prototype._animationsChanged = function () { + this.animationsChanged = false; + this.propertyIDs.clear(); + for (var i = 0, n = this.tracks.length; i < n; i++) { + var entry = this.tracks[i]; + if (entry == null) + continue; + while (entry.mixingFrom != null) + entry = entry.mixingFrom; + do { + if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add) + this.setTimelineModes(entry); + entry = entry.mixingTo; + } while (entry != null); + } + }; + AnimationState.prototype.setTimelineModes = function (entry) { + var to = entry.mixingTo; + var timelines = entry.animation.timelines; + var timelinesCount = entry.animation.timelines.length; + var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount); + entry.timelineHoldMix.length = 0; + var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount); + var propertyIDs = this.propertyIDs; + if (to != null && to.holdPrevious) { + for (var i = 0; i < timelinesCount; i++) { + propertyIDs.add(timelines[i].getPropertyId()); + timelineMode[i] = AnimationState.HOLD; + } + return; + } + outer: for (var i = 0; i < timelinesCount; i++) { + var id = timelines[i].getPropertyId(); + if (!propertyIDs.add(id)) + timelineMode[i] = AnimationState.SUBSEQUENT; + else if (to == null || !this.hasTimeline(to, id)) + timelineMode[i] = AnimationState.FIRST; + else { + for (var next = to.mixingTo; next != null; next = next.mixingTo) { + if (this.hasTimeline(next, id)) + continue; + if (entry.mixDuration > 0) { + timelineMode[i] = AnimationState.HOLD_MIX; + timelineDipMix[i] = next; + continue outer; + } + break; + } + timelineMode[i] = AnimationState.HOLD; + } + } + }; + AnimationState.prototype.hasTimeline = function (entry, id) { + var timelines = entry.animation.timelines; + for (var i = 0, n = timelines.length; i < n; i++) + if (timelines[i].getPropertyId() == id) + return true; + return false; + }; + AnimationState.prototype.getCurrent = function (trackIndex) { + if (trackIndex >= this.tracks.length) + return null; + return this.tracks[trackIndex]; + }; + AnimationState.prototype.addListener = function (listener) { + if (listener == null) + throw new Error("listener cannot be null."); + this.listeners.push(listener); + }; + AnimationState.prototype.removeListener = function (listener) { + var index = this.listeners.indexOf(listener); + if (index >= 0) + this.listeners.splice(index, 1); + }; + AnimationState.prototype.clearListeners = function () { + this.listeners.length = 0; + }; + AnimationState.prototype.clearListenerNotifications = function () { + this.queue.clear(); + }; + AnimationState.emptyAnimation = new spine.Animation("", [], 0); + AnimationState.SUBSEQUENT = 0; + AnimationState.FIRST = 1; + AnimationState.HOLD = 2; + AnimationState.HOLD_MIX = 3; + return AnimationState; + }()); + spine.AnimationState = AnimationState; + var TrackEntry = (function () { + function TrackEntry() { + this.mixBlend = spine.MixBlend.replace; + this.timelineMode = new Array(); + this.timelineHoldMix = new Array(); + this.timelinesRotation = new Array(); + } + TrackEntry.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; + }; + TrackEntry.prototype.getAnimationTime = function () { + if (this.loop) { + var duration = this.animationEnd - this.animationStart; + if (duration == 0) + return this.animationStart; + return (this.trackTime % duration) + this.animationStart; + } + return Math.min(this.trackTime + this.animationStart, this.animationEnd); + }; + TrackEntry.prototype.setAnimationLast = function (animationLast) { + this.animationLast = animationLast; + this.nextAnimationLast = animationLast; + }; + TrackEntry.prototype.isComplete = function () { + return this.trackTime >= this.animationEnd - this.animationStart; + }; + TrackEntry.prototype.resetRotationDirections = function () { + this.timelinesRotation.length = 0; + }; + return TrackEntry; + }()); + spine.TrackEntry = TrackEntry; + var EventQueue = (function () { + function EventQueue(animState) { + this.objects = []; + this.drainDisabled = false; + this.animState = animState; + } + EventQueue.prototype.start = function (entry) { + this.objects.push(EventType.start); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.interrupt = function (entry) { + this.objects.push(EventType.interrupt); + this.objects.push(entry); + }; + EventQueue.prototype.end = function (entry) { + this.objects.push(EventType.end); + this.objects.push(entry); + this.animState.animationsChanged = true; + }; + EventQueue.prototype.dispose = function (entry) { + this.objects.push(EventType.dispose); + this.objects.push(entry); + }; + EventQueue.prototype.complete = function (entry) { + this.objects.push(EventType.complete); + this.objects.push(entry); + }; + EventQueue.prototype.event = function (entry, event) { + this.objects.push(EventType.event); + this.objects.push(entry); + this.objects.push(event); + }; + EventQueue.prototype.drain = function () { + if (this.drainDisabled) + return; + this.drainDisabled = true; + var objects = this.objects; + var listeners = this.animState.listeners; + for (var i = 0; i < objects.length; i += 2) { + var type = objects[i]; + var entry = objects[i + 1]; + switch (type) { + case EventType.start: + if (entry.listener != null && entry.listener.start) + entry.listener.start(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].start) + listeners[ii].start(entry); + break; + case EventType.interrupt: + if (entry.listener != null && entry.listener.interrupt) + entry.listener.interrupt(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].interrupt) + listeners[ii].interrupt(entry); + break; + case EventType.end: + if (entry.listener != null && entry.listener.end) + entry.listener.end(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].end) + listeners[ii].end(entry); + case EventType.dispose: + if (entry.listener != null && entry.listener.dispose) + entry.listener.dispose(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].dispose) + listeners[ii].dispose(entry); + this.animState.trackEntryPool.free(entry); + break; + case EventType.complete: + if (entry.listener != null && entry.listener.complete) + entry.listener.complete(entry); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].complete) + listeners[ii].complete(entry); + break; + case EventType.event: + var event_3 = objects[i++ + 2]; + if (entry.listener != null && entry.listener.event) + entry.listener.event(entry, event_3); + for (var ii = 0; ii < listeners.length; ii++) + if (listeners[ii].event) + listeners[ii].event(entry, event_3); + break; + } + } + this.clear(); + this.drainDisabled = false; + }; + EventQueue.prototype.clear = function () { + this.objects.length = 0; + }; + return EventQueue; + }()); + spine.EventQueue = EventQueue; + var EventType; + (function (EventType) { + EventType[EventType["start"] = 0] = "start"; + EventType[EventType["interrupt"] = 1] = "interrupt"; + EventType[EventType["end"] = 2] = "end"; + EventType[EventType["dispose"] = 3] = "dispose"; + EventType[EventType["complete"] = 4] = "complete"; + EventType[EventType["event"] = 5] = "event"; + })(EventType = spine.EventType || (spine.EventType = {})); + var AnimationStateAdapter2 = (function () { + function AnimationStateAdapter2() { + } + AnimationStateAdapter2.prototype.start = function (entry) { + }; + AnimationStateAdapter2.prototype.interrupt = function (entry) { + }; + AnimationStateAdapter2.prototype.end = function (entry) { + }; + AnimationStateAdapter2.prototype.dispose = function (entry) { + }; + AnimationStateAdapter2.prototype.complete = function (entry) { + }; + AnimationStateAdapter2.prototype.event = function (entry, event) { + }; + return AnimationStateAdapter2; + }()); + spine.AnimationStateAdapter2 = AnimationStateAdapter2; })(spine || (spine = {})); var spine; (function (spine) { - var AnimationStateData = (function () { - function AnimationStateData(skeletonData) { - this.animationToMixTime = {}; - this.defaultMix = 0; - if (skeletonData == null) - throw new Error("skeletonData cannot be null."); - this.skeletonData = skeletonData; - } - AnimationStateData.prototype.setMix = function (fromName, toName, duration) { - var from = this.skeletonData.findAnimation(fromName); - if (from == null) - throw new Error("Animation not found: " + fromName); - var to = this.skeletonData.findAnimation(toName); - if (to == null) - throw new Error("Animation not found: " + toName); - this.setMixWith(from, to, duration); - }; - AnimationStateData.prototype.setMixWith = function (from, to, duration) { - if (from == null) - throw new Error("from cannot be null."); - if (to == null) - throw new Error("to cannot be null."); - var key = from.name + "." + to.name; - this.animationToMixTime[key] = duration; - }; - AnimationStateData.prototype.getMix = function (from, to) { - var key = from.name + "." + to.name; - var value = this.animationToMixTime[key]; - return value === undefined ? this.defaultMix : value; - }; - return AnimationStateData; - }()); - spine.AnimationStateData = AnimationStateData; + var AnimationStateData = (function () { + function AnimationStateData(skeletonData) { + this.animationToMixTime = {}; + this.defaultMix = 0; + if (skeletonData == null) + throw new Error("skeletonData cannot be null."); + this.skeletonData = skeletonData; + } + AnimationStateData.prototype.setMix = function (fromName, toName, duration) { + var from = this.skeletonData.findAnimation(fromName); + if (from == null) + throw new Error("Animation not found: " + fromName); + var to = this.skeletonData.findAnimation(toName); + if (to == null) + throw new Error("Animation not found: " + toName); + this.setMixWith(from, to, duration); + }; + AnimationStateData.prototype.setMixWith = function (from, to, duration) { + if (from == null) + throw new Error("from cannot be null."); + if (to == null) + throw new Error("to cannot be null."); + var key = from.name + "." + to.name; + this.animationToMixTime[key] = duration; + }; + AnimationStateData.prototype.getMix = function (from, to) { + var key = from.name + "." + to.name; + var value = this.animationToMixTime[key]; + return value === undefined ? this.defaultMix : value; + }; + return AnimationStateData; + }()); + spine.AnimationStateData = AnimationStateData; })(spine || (spine = {})); var spine; (function (spine) { - var AssetManager = (function () { - function AssetManager(textureLoader, pathPrefix) { - if (pathPrefix === void 0) { pathPrefix = ""; } - this.assets = {}; - this.errors = {}; - this.toLoad = 0; - this.loaded = 0; - this.textureLoader = textureLoader; - this.pathPrefix = pathPrefix; - } - AssetManager.downloadText = function (url, success, error) { - var request = new XMLHttpRequest(); - request.open("GET", url, true); - request.onload = function () { - if (request.status == 200) { - success(request.responseText); - } - else { - error(request.status, request.responseText); - } - }; - request.onerror = function () { - error(request.status, request.responseText); - }; - request.send(); - }; - AssetManager.downloadBinary = function (url, success, error) { - var request = new XMLHttpRequest(); - request.open("GET", url, true); - request.responseType = "arraybuffer"; - request.onload = function () { - if (request.status == 200) { - success(new Uint8Array(request.response)); - } - else { - error(request.status, request.responseText); - } - }; - request.onerror = function () { - error(request.status, request.responseText); - }; - request.send(); - }; - AssetManager.prototype.loadText = function (path, success, error) { - var _this = this; - if (success === void 0) { success = null; } - if (error === void 0) { error = null; } - path = this.pathPrefix + path; - this.toLoad++; - AssetManager.downloadText(path, function (data) { - _this.assets[path] = data; - if (success) - success(path, data); - _this.toLoad--; - _this.loaded++; - }, function (state, responseText) { - _this.errors[path] = "Couldn't load text " + path + ": status " + status + ", " + responseText; - if (error) - error(path, "Couldn't load text " + path + ": status " + status + ", " + responseText); - _this.toLoad--; - _this.loaded++; - }); - }; - AssetManager.prototype.loadTexture = function (path, success, error) { - var _this = this; - if (success === void 0) { success = null; } - if (error === void 0) { error = null; } - path = this.pathPrefix + path; - this.toLoad++; - var img = new Image(); - img.crossOrigin = "anonymous"; - img.onload = function (ev) { - var texture = _this.textureLoader(img); - _this.assets[path] = texture; - _this.toLoad--; - _this.loaded++; - if (success) - success(path, img); - }; - img.onerror = function (ev) { - _this.errors[path] = "Couldn't load image " + path; - _this.toLoad--; - _this.loaded++; - if (error) - error(path, "Couldn't load image " + path); - }; - img.src = path; - }; - AssetManager.prototype.loadTextureData = function (path, data, success, error) { - var _this = this; - if (success === void 0) { success = null; } - if (error === void 0) { error = null; } - path = this.pathPrefix + path; - this.toLoad++; - var img = new Image(); - img.onload = function (ev) { - var texture = _this.textureLoader(img); - _this.assets[path] = texture; - _this.toLoad--; - _this.loaded++; - if (success) - success(path, img); - }; - img.onerror = function (ev) { - _this.errors[path] = "Couldn't load image " + path; - _this.toLoad--; - _this.loaded++; - if (error) - error(path, "Couldn't load image " + path); - }; - img.src = data; - }; - AssetManager.prototype.loadTextureAtlas = function (path, success, error) { - var _this = this; - if (success === void 0) { success = null; } - if (error === void 0) { error = null; } - var parent = path.lastIndexOf("/") >= 0 ? path.substring(0, path.lastIndexOf("/")) : ""; - path = this.pathPrefix + path; - this.toLoad++; - AssetManager.downloadText(path, function (atlasData) { - var pagesLoaded = { count: 0 }; - var atlasPages = new Array(); - try { - var atlas = new spine.TextureAtlas(atlasData, function (path) { - atlasPages.push(parent + "/" + path); - var image = document.createElement("img"); - image.width = 16; - image.height = 16; - return new spine.FakeTexture(image); - }); - } - catch (e) { - var ex = e; - _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; - if (error) - error(path, "Couldn't load texture atlas " + path + ": " + ex.message); - _this.toLoad--; - _this.loaded++; - return; - } - var _loop_1 = function (atlasPage) { - var pageLoadError = false; - _this.loadTexture(atlasPage, function (imagePath, image) { - pagesLoaded.count++; - if (pagesLoaded.count == atlasPages.length) { - if (!pageLoadError) { - try { - var atlas = new spine.TextureAtlas(atlasData, function (path) { - return _this.get(parent + "/" + path); - }); - _this.assets[path] = atlas; - if (success) - success(path, atlas); - _this.toLoad--; - _this.loaded++; - } - catch (e) { - var ex = e; - _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; - if (error) - error(path, "Couldn't load texture atlas " + path + ": " + ex.message); - _this.toLoad--; - _this.loaded++; - } - } - else { - _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; - if (error) - error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); - _this.toLoad--; - _this.loaded++; - } - } - }, function (imagePath, errorMessage) { - pageLoadError = true; - pagesLoaded.count++; - if (pagesLoaded.count == atlasPages.length) { - _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; - if (error) - error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); - _this.toLoad--; - _this.loaded++; - } - }); - }; - for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) { - var atlasPage = atlasPages_1[_i]; - _loop_1(atlasPage); - } - }, function (state, responseText) { - _this.errors[path] = "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText; - if (error) - error(path, "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText); - _this.toLoad--; - _this.loaded++; - }); - }; - AssetManager.prototype.get = function (path) { - path = this.pathPrefix + path; - return this.assets[path]; - }; - AssetManager.prototype.remove = function (path) { - path = this.pathPrefix + path; - var asset = this.assets[path]; - if (asset.dispose) - asset.dispose(); - this.assets[path] = null; - }; - AssetManager.prototype.removeAll = function () { - for (var key in this.assets) { - var asset = this.assets[key]; - if (asset.dispose) - asset.dispose(); - } - this.assets = {}; - }; - AssetManager.prototype.isLoadingComplete = function () { - return this.toLoad == 0; - }; - AssetManager.prototype.getToLoad = function () { - return this.toLoad; - }; - AssetManager.prototype.getLoaded = function () { - return this.loaded; - }; - AssetManager.prototype.dispose = function () { - this.removeAll(); - }; - AssetManager.prototype.hasErrors = function () { - return Object.keys(this.errors).length > 0; - }; - AssetManager.prototype.getErrors = function () { - return this.errors; - }; - return AssetManager; - }()); - spine.AssetManager = AssetManager; + var AssetManager = (function () { + function AssetManager(textureLoader, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.assets = {}; + this.errors = {}; + this.toLoad = 0; + this.loaded = 0; + this.textureLoader = textureLoader; + this.pathPrefix = pathPrefix; + } + AssetManager.downloadText = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.onload = function () { + if (request.status == 200) { + success(request.responseText); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.downloadBinary = function (url, success, error) { + var request = new XMLHttpRequest(); + request.open("GET", url, true); + request.responseType = "arraybuffer"; + request.onload = function () { + if (request.status == 200) { + success(new Uint8Array(request.response)); + } + else { + error(request.status, request.responseText); + } + }; + request.onerror = function () { + error(request.status, request.responseText); + }; + request.send(); + }; + AssetManager.prototype.loadText = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (data) { + _this.assets[path] = data; + if (success) + success(path, data); + _this.toLoad--; + _this.loaded++; + }, function (state, responseText) { + _this.errors[path] = "Couldn't load text " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load text " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.loadTexture = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = path; + }; + AssetManager.prototype.loadTextureData = function (path, data, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + path = this.pathPrefix + path; + this.toLoad++; + var img = new Image(); + img.onload = function (ev) { + var texture = _this.textureLoader(img); + _this.assets[path] = texture; + _this.toLoad--; + _this.loaded++; + if (success) + success(path, img); + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + _this.toLoad--; + _this.loaded++; + if (error) + error(path, "Couldn't load image " + path); + }; + img.src = data; + }; + AssetManager.prototype.loadTextureAtlas = function (path, success, error) { + var _this = this; + if (success === void 0) { success = null; } + if (error === void 0) { error = null; } + var parent = path.lastIndexOf("/") >= 0 ? path.substring(0, path.lastIndexOf("/")) : ""; + path = this.pathPrefix + path; + this.toLoad++; + AssetManager.downloadText(path, function (atlasData) { + var pagesLoaded = { count: 0 }; + var atlasPages = new Array(); + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + atlasPages.push(parent + "/" + path); + var image = document.createElement("img"); + image.width = 16; + image.height = 16; + return new spine.FakeTexture(image); + }); + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + return; + } + var _loop_1 = function (atlasPage) { + var pageLoadError = false; + _this.loadTexture(atlasPage, function (imagePath, image) { + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + if (!pageLoadError) { + try { + var atlas = new spine.TextureAtlas(atlasData, function (path) { + return _this.get(parent + "/" + path); + }); + _this.assets[path] = atlas; + if (success) + success(path, atlas); + _this.toLoad--; + _this.loaded++; + } + catch (e) { + var ex = e; + _this.errors[path] = "Couldn't load texture atlas " + path + ": " + ex.message; + if (error) + error(path, "Couldn't load texture atlas " + path + ": " + ex.message); + _this.toLoad--; + _this.loaded++; + } + } + else { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + } + }, function (imagePath, errorMessage) { + pageLoadError = true; + pagesLoaded.count++; + if (pagesLoaded.count == atlasPages.length) { + _this.errors[path] = "Couldn't load texture atlas page " + imagePath + "} of atlas " + path; + if (error) + error(path, "Couldn't load texture atlas page " + imagePath + " of atlas " + path); + _this.toLoad--; + _this.loaded++; + } + }); + }; + for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) { + var atlasPage = atlasPages_1[_i]; + _loop_1(atlasPage); + } + }, function (state, responseText) { + _this.errors[path] = "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText; + if (error) + error(path, "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText); + _this.toLoad--; + _this.loaded++; + }); + }; + AssetManager.prototype.get = function (path) { + path = this.pathPrefix + path; + return this.assets[path]; + }; + AssetManager.prototype.remove = function (path) { + path = this.pathPrefix + path; + var asset = this.assets[path]; + if (asset.dispose) + asset.dispose(); + this.assets[path] = null; + }; + AssetManager.prototype.removeAll = function () { + for (var key in this.assets) { + var asset = this.assets[key]; + if (asset.dispose) + asset.dispose(); + } + this.assets = {}; + }; + AssetManager.prototype.isLoadingComplete = function () { + return this.toLoad == 0; + }; + AssetManager.prototype.getToLoad = function () { + return this.toLoad; + }; + AssetManager.prototype.getLoaded = function () { + return this.loaded; + }; + AssetManager.prototype.dispose = function () { + this.removeAll(); + }; + AssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + AssetManager.prototype.getErrors = function () { + return this.errors; + }; + return AssetManager; + }()); + spine.AssetManager = AssetManager; })(spine || (spine = {})); var spine; (function (spine) { - var AtlasAttachmentLoader = (function () { - function AtlasAttachmentLoader(atlas) { - this.atlas = atlas; - } - AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (region == null) - throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); - region.renderObject = region; - var attachment = new spine.RegionAttachment(name); - attachment.setRegion(region); - return attachment; - }; - AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (region == null) - throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); - region.renderObject = region; - var attachment = new spine.MeshAttachment(name); - attachment.region = region; - return attachment; - }; - AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) { - return new spine.BoundingBoxAttachment(name); - }; - AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) { - return new spine.PathAttachment(name); - }; - AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) { - return new spine.PointAttachment(name); - }; - AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) { - return new spine.ClippingAttachment(name); - }; - return AtlasAttachmentLoader; - }()); - spine.AtlasAttachmentLoader = AtlasAttachmentLoader; + var AtlasAttachmentLoader = (function () { + function AtlasAttachmentLoader(atlas) { + this.atlas = atlas; + } + AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.RegionAttachment(name); + attachment.setRegion(region); + return attachment; + }; + AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); + region.renderObject = region; + var attachment = new spine.MeshAttachment(name); + attachment.region = region; + return attachment; + }; + AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) { + return new spine.BoundingBoxAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) { + return new spine.PathAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) { + return new spine.PointAttachment(name); + }; + AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) { + return new spine.ClippingAttachment(name); + }; + return AtlasAttachmentLoader; + }()); + spine.AtlasAttachmentLoader = AtlasAttachmentLoader; })(spine || (spine = {})); var spine; (function (spine) { - var BlendMode; - (function (BlendMode) { - BlendMode[BlendMode["Normal"] = 0] = "Normal"; - BlendMode[BlendMode["Additive"] = 1] = "Additive"; - BlendMode[BlendMode["Multiply"] = 2] = "Multiply"; - BlendMode[BlendMode["Screen"] = 3] = "Screen"; - })(BlendMode = spine.BlendMode || (spine.BlendMode = {})); + var BlendMode; + (function (BlendMode) { + BlendMode[BlendMode["Normal"] = 0] = "Normal"; + BlendMode[BlendMode["Additive"] = 1] = "Additive"; + BlendMode[BlendMode["Multiply"] = 2] = "Multiply"; + BlendMode[BlendMode["Screen"] = 3] = "Screen"; + })(BlendMode = spine.BlendMode || (spine.BlendMode = {})); })(spine || (spine = {})); var spine; (function (spine) { - var Bone = (function () { - function Bone(data, skeleton, parent) { - 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 = false; - this.a = 0; - this.b = 0; - this.worldX = 0; - this.c = 0; - this.d = 0; - this.worldY = 0; - this.sorted = false; - if (data == null) - throw new Error("data cannot be null."); - if (skeleton == null) - throw new Error("skeleton cannot be null."); - this.data = data; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); - } - Bone.prototype.update = function () { - this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); - }; - Bone.prototype.updateWorldTransform = function () { - this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); - }; - Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) { - this.ax = x; - this.ay = y; - this.arotation = rotation; - this.ascaleX = scaleX; - this.ascaleY = scaleY; - this.ashearX = shearX; - this.ashearY = shearY; - this.appliedValid = true; - var parent = this.parent; - if (parent == null) { - var skeleton = this.skeleton; - var rotationY = rotation + 90 + shearY; - var sx = skeleton.scaleX; - var sy = skeleton.scaleY; - this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx; - this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx; - this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy; - this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy; - this.worldX = x * sx + skeleton.x; - this.worldY = y * sy + skeleton.y; - return; - } - var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - this.worldX = pa * x + pb * y + parent.worldX; - this.worldY = pc * x + pd * y + parent.worldY; - switch (this.data.transformMode) { - case spine.TransformMode.Normal: { - var rotationY = rotation + 90 + shearY; - var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; - var lb = spine.MathUtils.cosDeg(rotationY) * scaleY; - var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; - var ld = spine.MathUtils.sinDeg(rotationY) * scaleY; - this.a = pa * la + pb * lc; - this.b = pa * lb + pb * ld; - this.c = pc * la + pd * lc; - this.d = pc * lb + pd * ld; - return; - } - case spine.TransformMode.OnlyTranslation: { - var rotationY = rotation + 90 + shearY; - this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; - this.b = spine.MathUtils.cosDeg(rotationY) * scaleY; - this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; - this.d = spine.MathUtils.sinDeg(rotationY) * scaleY; - break; - } - case spine.TransformMode.NoRotationOrReflection: { - var s = pa * pa + pc * pc; - var prx = 0; - if (s > 0.0001) { - s = Math.abs(pa * pd - pb * pc) / s; - pb = pc * s; - pd = pa * s; - prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg; - } - else { - pa = 0; - pc = 0; - prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg; - } - var rx = rotation + shearX - prx; - var ry = rotation + shearY - prx + 90; - var la = spine.MathUtils.cosDeg(rx) * scaleX; - var lb = spine.MathUtils.cosDeg(ry) * scaleY; - var lc = spine.MathUtils.sinDeg(rx) * scaleX; - var ld = spine.MathUtils.sinDeg(ry) * scaleY; - this.a = pa * la - pb * lc; - this.b = pa * lb - pb * ld; - this.c = pc * la + pd * lc; - this.d = pc * lb + pd * ld; - break; - } - case spine.TransformMode.NoScale: - case spine.TransformMode.NoScaleOrReflection: { - var cos = spine.MathUtils.cosDeg(rotation); - var sin = spine.MathUtils.sinDeg(rotation); - var za = (pa * cos + pb * sin) / this.skeleton.scaleX; - var zc = (pc * cos + pd * sin) / this.skeleton.scaleY; - var s = Math.sqrt(za * za + zc * zc); - if (s > 0.00001) - s = 1 / s; - za *= s; - zc *= s; - s = Math.sqrt(za * za + zc * zc); - if (this.data.transformMode == spine.TransformMode.NoScale - && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) - s = -s; - var r = Math.PI / 2 + Math.atan2(zc, za); - var zb = Math.cos(r) * s; - var zd = Math.sin(r) * s; - var la = spine.MathUtils.cosDeg(shearX) * scaleX; - var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY; - var lc = spine.MathUtils.sinDeg(shearX) * scaleX; - var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY; - this.a = za * la + zb * lc; - this.b = za * lb + zb * ld; - this.c = zc * la + zd * lc; - this.d = zc * lb + zd * ld; - break; - } - } - this.a *= this.skeleton.scaleX; - this.b *= this.skeleton.scaleX; - this.c *= this.skeleton.scaleY; - this.d *= this.skeleton.scaleY; - }; - Bone.prototype.setToSetupPose = function () { - var data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.shearX = data.shearX; - this.shearY = data.shearY; - }; - Bone.prototype.getWorldRotationX = function () { - return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg; - }; - Bone.prototype.getWorldRotationY = function () { - return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg; - }; - Bone.prototype.getWorldScaleX = function () { - return Math.sqrt(this.a * this.a + this.c * this.c); - }; - Bone.prototype.getWorldScaleY = function () { - return Math.sqrt(this.b * this.b + this.d * this.d); - }; - Bone.prototype.updateAppliedTransform = function () { - this.appliedValid = true; - var parent = this.parent; - if (parent == null) { - this.ax = this.worldX; - this.ay = this.worldY; - this.arotation = Math.atan2(this.c, this.a) * spine.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; - this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg; - return; - } - var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - var pid = 1 / (pa * pd - pb * pc); - var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; - this.ax = (dx * pd * pid - dy * pb * pid); - this.ay = (dy * pa * pid - dx * pc * pid); - var ia = pid * pd; - var id = pid * pa; - var ib = pid * pb; - var ic = pid * pc; - var ra = ia * this.a - ib * this.c; - var rb = ia * this.b - ib * this.d; - var rc = id * this.c - ic * this.a; - var rd = id * this.d - ic * this.b; - this.ashearX = 0; - this.ascaleX = Math.sqrt(ra * ra + rc * rc); - if (this.ascaleX > 0.0001) { - var det = ra * rd - rb * rc; - this.ascaleY = det / this.ascaleX; - this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg; - this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg; - } - else { - this.ascaleX = 0; - this.ascaleY = Math.sqrt(rb * rb + rd * rd); - this.ashearY = 0; - this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg; - } - }; - Bone.prototype.worldToLocal = function (world) { - var a = this.a, b = this.b, c = this.c, d = this.d; - var invDet = 1 / (a * d - b * c); - var x = world.x - this.worldX, y = world.y - this.worldY; - world.x = (x * d * invDet - y * b * invDet); - world.y = (y * a * invDet - x * c * invDet); - return world; - }; - Bone.prototype.localToWorld = function (local) { - var x = local.x, y = local.y; - local.x = x * this.a + y * this.b + this.worldX; - local.y = x * this.c + y * this.d + this.worldY; - return local; - }; - Bone.prototype.worldToLocalRotation = function (worldRotation) { - var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation); - return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX; - }; - Bone.prototype.localToWorldRotation = function (localRotation) { - localRotation -= this.rotation - this.shearX; - var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation); - return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg; - }; - Bone.prototype.rotateWorld = function (degrees) { - var a = this.a, b = this.b, c = this.c, d = this.d; - var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees); - this.a = cos * a - sin * c; - this.b = cos * b - sin * d; - this.c = sin * a + cos * c; - this.d = sin * b + cos * d; - this.appliedValid = false; - }; - return Bone; - }()); - spine.Bone = Bone; + var Bone = (function () { + function Bone(data, skeleton, parent) { + 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 = false; + this.a = 0; + this.b = 0; + this.worldX = 0; + this.c = 0; + this.d = 0; + this.worldY = 0; + this.sorted = false; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.skeleton = skeleton; + this.parent = parent; + this.setToSetupPose(); + } + Bone.prototype.update = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransform = function () { + this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); + }; + Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) { + this.ax = x; + this.ay = y; + this.arotation = rotation; + this.ascaleX = scaleX; + this.ascaleY = scaleY; + this.ashearX = shearX; + this.ashearY = shearY; + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + var skeleton = this.skeleton; + var rotationY = rotation + 90 + shearY; + var sx = skeleton.scaleX; + var sy = skeleton.scaleY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy; + this.worldX = x * sx + skeleton.x; + this.worldY = y * sy + skeleton.y; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + this.worldX = pa * x + pb * y + parent.worldX; + this.worldY = pc * x + pd * y + parent.worldY; + switch (this.data.transformMode) { + case spine.TransformMode.Normal: { + var rotationY = rotation + 90 + shearY; + var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(rotationY) * scaleY; + var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(rotationY) * scaleY; + this.a = pa * la + pb * lc; + this.b = pa * lb + pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + return; + } + case spine.TransformMode.OnlyTranslation: { + var rotationY = rotation + 90 + shearY; + this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX; + this.b = spine.MathUtils.cosDeg(rotationY) * scaleY; + this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX; + this.d = spine.MathUtils.sinDeg(rotationY) * scaleY; + break; + } + case spine.TransformMode.NoRotationOrReflection: { + var s = pa * pa + pc * pc; + var prx = 0; + if (s > 0.0001) { + s = Math.abs(pa * pd - pb * pc) / s; + pb = pc * s; + pd = pa * s; + prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg; + } + else { + pa = 0; + pc = 0; + prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg; + } + var rx = rotation + shearX - prx; + var ry = rotation + shearY - prx + 90; + var la = spine.MathUtils.cosDeg(rx) * scaleX; + var lb = spine.MathUtils.cosDeg(ry) * scaleY; + var lc = spine.MathUtils.sinDeg(rx) * scaleX; + var ld = spine.MathUtils.sinDeg(ry) * scaleY; + this.a = pa * la - pb * lc; + this.b = pa * lb - pb * ld; + this.c = pc * la + pd * lc; + this.d = pc * lb + pd * ld; + break; + } + case spine.TransformMode.NoScale: + case spine.TransformMode.NoScaleOrReflection: { + var cos = spine.MathUtils.cosDeg(rotation); + var sin = spine.MathUtils.sinDeg(rotation); + var za = (pa * cos + pb * sin) / this.skeleton.scaleX; + var zc = (pc * cos + pd * sin) / this.skeleton.scaleY; + var s = Math.sqrt(za * za + zc * zc); + if (s > 0.00001) + s = 1 / s; + za *= s; + zc *= s; + s = Math.sqrt(za * za + zc * zc); + if (this.data.transformMode == spine.TransformMode.NoScale + && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) + s = -s; + var r = Math.PI / 2 + Math.atan2(zc, za); + var zb = Math.cos(r) * s; + var zd = Math.sin(r) * s; + var la = spine.MathUtils.cosDeg(shearX) * scaleX; + var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY; + var lc = spine.MathUtils.sinDeg(shearX) * scaleX; + var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY; + this.a = za * la + zb * lc; + this.b = za * lb + zb * ld; + this.c = zc * la + zd * lc; + this.d = zc * lb + zd * ld; + break; + } + } + this.a *= this.skeleton.scaleX; + this.b *= this.skeleton.scaleX; + this.c *= this.skeleton.scaleY; + this.d *= this.skeleton.scaleY; + }; + Bone.prototype.setToSetupPose = function () { + var data = this.data; + this.x = data.x; + this.y = data.y; + this.rotation = data.rotation; + this.scaleX = data.scaleX; + this.scaleY = data.scaleY; + this.shearX = data.shearX; + this.shearY = data.shearY; + }; + Bone.prototype.getWorldRotationX = function () { + return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldRotationY = function () { + return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.getWorldScaleX = function () { + return Math.sqrt(this.a * this.a + this.c * this.c); + }; + Bone.prototype.getWorldScaleY = function () { + return Math.sqrt(this.b * this.b + this.d * this.d); + }; + Bone.prototype.updateAppliedTransform = function () { + this.appliedValid = true; + var parent = this.parent; + if (parent == null) { + this.ax = this.worldX; + this.ay = this.worldY; + this.arotation = Math.atan2(this.c, this.a) * spine.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; + this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg; + return; + } + var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; + var pid = 1 / (pa * pd - pb * pc); + var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; + this.ax = (dx * pd * pid - dy * pb * pid); + this.ay = (dy * pa * pid - dx * pc * pid); + var ia = pid * pd; + var id = pid * pa; + var ib = pid * pb; + var ic = pid * pc; + var ra = ia * this.a - ib * this.c; + var rb = ia * this.b - ib * this.d; + var rc = id * this.c - ic * this.a; + var rd = id * this.d - ic * this.b; + this.ashearX = 0; + this.ascaleX = Math.sqrt(ra * ra + rc * rc); + if (this.ascaleX > 0.0001) { + var det = ra * rd - rb * rc; + this.ascaleY = det / this.ascaleX; + this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg; + this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg; + } + else { + this.ascaleX = 0; + this.ascaleY = Math.sqrt(rb * rb + rd * rd); + this.ashearY = 0; + this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg; + } + }; + Bone.prototype.worldToLocal = function (world) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var invDet = 1 / (a * d - b * c); + var x = world.x - this.worldX, y = world.y - this.worldY; + world.x = (x * d * invDet - y * b * invDet); + world.y = (y * a * invDet - x * c * invDet); + return world; + }; + Bone.prototype.localToWorld = function (local) { + var x = local.x, y = local.y; + local.x = x * this.a + y * this.b + this.worldX; + local.y = x * this.c + y * this.d + this.worldY; + return local; + }; + Bone.prototype.worldToLocalRotation = function (worldRotation) { + var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation); + return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX; + }; + Bone.prototype.localToWorldRotation = function (localRotation) { + localRotation -= this.rotation - this.shearX; + var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation); + return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg; + }; + Bone.prototype.rotateWorld = function (degrees) { + var a = this.a, b = this.b, c = this.c, d = this.d; + var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees); + this.a = cos * a - sin * c; + this.b = cos * b - sin * d; + this.c = sin * a + cos * c; + this.d = sin * b + cos * d; + this.appliedValid = false; + }; + return Bone; + }()); + spine.Bone = Bone; })(spine || (spine = {})); var spine; (function (spine) { - var BoneData = (function () { - function BoneData(index, name, parent) { - this.x = 0; - this.y = 0; - this.rotation = 0; - this.scaleX = 1; - this.scaleY = 1; - this.shearX = 0; - this.shearY = 0; - this.transformMode = TransformMode.Normal; - if (index < 0) - throw new Error("index must be >= 0."); - if (name == null) - throw new Error("name cannot be null."); - this.index = index; - this.name = name; - this.parent = parent; - } - return BoneData; - }()); - spine.BoneData = BoneData; - var TransformMode; - (function (TransformMode) { - TransformMode[TransformMode["Normal"] = 0] = "Normal"; - TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation"; - TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; - TransformMode[TransformMode["NoScale"] = 3] = "NoScale"; - TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; - })(TransformMode = spine.TransformMode || (spine.TransformMode = {})); + var BoneData = (function () { + function BoneData(index, name, parent) { + this.x = 0; + this.y = 0; + this.rotation = 0; + this.scaleX = 1; + this.scaleY = 1; + this.shearX = 0; + this.shearY = 0; + this.transformMode = TransformMode.Normal; + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + this.index = index; + this.name = name; + this.parent = parent; + } + return BoneData; + }()); + spine.BoneData = BoneData; + var TransformMode; + (function (TransformMode) { + TransformMode[TransformMode["Normal"] = 0] = "Normal"; + TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation"; + TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; + TransformMode[TransformMode["NoScale"] = 3] = "NoScale"; + TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; + })(TransformMode = spine.TransformMode || (spine.TransformMode = {})); })(spine || (spine = {})); var spine; (function (spine) { - var Event = (function () { - function Event(time, data) { - if (data == null) - throw new Error("data cannot be null."); - this.time = time; - this.data = data; - } - return Event; - }()); - spine.Event = Event; + var Event = (function () { + function Event(time, data) { + if (data == null) + throw new Error("data cannot be null."); + this.time = time; + this.data = data; + } + return Event; + }()); + spine.Event = Event; })(spine || (spine = {})); var spine; (function (spine) { - var EventData = (function () { - function EventData(name) { - this.name = name; - } - return EventData; - }()); - spine.EventData = EventData; + var EventData = (function () { + function EventData(name) { + this.name = name; + } + return EventData; + }()); + spine.EventData = EventData; })(spine || (spine = {})); var spine; (function (spine) { - var IkConstraint = (function () { - function IkConstraint(data, skeleton) { - this.bendDirection = 0; - this.compress = false; - this.stretch = false; - this.mix = 1; - if (data == null) - throw new Error("data cannot be null."); - if (skeleton == null) - throw new Error("skeleton cannot be null."); - this.data = data; - this.mix = data.mix; - this.bendDirection = data.bendDirection; - this.compress = data.compress; - this.stretch = data.stretch; - this.bones = new Array(); - for (var i = 0; i < data.bones.length; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); - } - IkConstraint.prototype.getOrder = function () { - return this.data.order; - }; - IkConstraint.prototype.apply = function () { - this.update(); - }; - IkConstraint.prototype.update = function () { - var target = this.target; - var bones = this.bones; - switch (bones.length) { - case 1: - this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix); - break; - case 2: - this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix); - break; - } - }; - IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) { - if (!bone.appliedValid) - bone.updateAppliedTransform(); - var p = bone.parent; - var id = 1 / (p.a * p.d - p.b * p.c); - var x = targetX - p.worldX, y = targetY - p.worldY; - var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay; - var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation; - if (bone.ascaleX < 0) - rotationIK += 180; - if (rotationIK > 180) - rotationIK -= 360; - else if (rotationIK < -180) - rotationIK += 360; - var sx = bone.ascaleX, sy = bone.ascaleY; - if (compress || stretch) { - var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty); - if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) { - var s = (dd / b - 1) * alpha + 1; - sx *= s; - if (uniform) - sy *= s; - } - } - bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY); - }; - IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) { - if (alpha == 0) { - child.updateWorldTransform(); - return; - } - if (!parent.appliedValid) - parent.updateAppliedTransform(); - if (!child.appliedValid) - child.updateAppliedTransform(); - var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX; - var os1 = 0, os2 = 0, s2 = 0; - if (psx < 0) { - psx = -psx; - os1 = 180; - s2 = -1; - } - else { - os1 = 0; - s2 = 1; - } - if (psy < 0) { - psy = -psy; - s2 = -s2; - } - if (csx < 0) { - csx = -csx; - os2 = 180; - } - else - os2 = 0; - var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; - var u = Math.abs(psx - psy) <= 0.0001; - if (!u) { - cy = 0; - cwx = a * cx + parent.worldX; - cwy = c * cx + parent.worldY; - } - else { - cy = child.ay; - cwx = a * cx + b * cy + parent.worldX; - cwy = c * cx + d * cy + parent.worldY; - } - var pp = parent.parent; - a = pp.a; - b = pp.b; - c = pp.c; - d = pp.d; - var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY; - var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty; - x = cwx - pp.worldX; - y = cwy - pp.worldY; - var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; - var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0; - outer: if (u) { - l2 *= psx; - var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); - if (cos < -1) - cos = -1; - else if (cos > 1) { - cos = 1; - if (stretch && l1 + l2 > 0.0001) - sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1; - } - a2 = Math.acos(cos) * bendDir; - a = l1 + l2 * cos; - b = l2 * Math.sin(a2); - a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b); - } - else { - a = psx * l2; - b = psy * l2; - var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); - c = bb * l1 * l1 + aa * dd - aa * bb; - var c1 = -2 * bb * l1, c2 = bb - aa; - d = c1 * c1 - 4 * c2 * c; - if (d >= 0) { - var q = Math.sqrt(d); - if (c1 < 0) - q = -q; - q = -(c1 + q) / 2; - var r0 = q / c2, r1 = c / q; - var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; - if (r * r <= dd) { - y = Math.sqrt(dd - r * r) * bendDir; - a1 = ta - Math.atan2(y, r); - a2 = Math.atan2(y / psy, (r - l1) / psx); - break outer; - } - } - var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; - var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; - c = -a * l1 / (aa - bb); - if (c >= -1 && c <= 1) { - c = Math.acos(c); - x = a * Math.cos(c) + l1; - y = b * Math.sin(c); - d = x * x + y * y; - if (d < minDist) { - minAngle = c; - minDist = d; - minX = x; - minY = y; - } - if (d > maxDist) { - maxAngle = c; - maxDist = d; - maxX = x; - maxY = y; - } - } - if (dd <= (minDist + maxDist) / 2) { - a1 = ta - Math.atan2(minY * bendDir, minX); - a2 = minAngle * bendDir; - } - else { - a1 = ta - Math.atan2(maxY * bendDir, maxX); - a2 = maxAngle * bendDir; - } - } - var os = Math.atan2(cy, cx) * s2; - var rotation = parent.arotation; - a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation; - if (a1 > 180) - a1 -= 360; - else if (a1 < -180) - a1 += 360; - parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0); - rotation = child.arotation; - a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; - if (a2 > 180) - a2 -= 360; - else if (a2 < -180) - a2 += 360; - child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); - }; - return IkConstraint; - }()); - spine.IkConstraint = IkConstraint; + var IkConstraint = (function () { + function IkConstraint(data, skeleton) { + this.bendDirection = 0; + this.compress = false; + this.stretch = false; + this.mix = 1; + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.mix = data.mix; + this.bendDirection = data.bendDirection; + this.compress = data.compress; + this.stretch = data.stretch; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + IkConstraint.prototype.getOrder = function () { + return this.data.order; + }; + IkConstraint.prototype.apply = function () { + this.update(); + }; + IkConstraint.prototype.update = function () { + var target = this.target; + var bones = this.bones; + switch (bones.length) { + case 1: + this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix); + break; + case 2: + this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix); + break; + } + }; + IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) { + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var p = bone.parent; + var id = 1 / (p.a * p.d - p.b * p.c); + var x = targetX - p.worldX, y = targetY - p.worldY; + var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay; + var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation; + if (bone.ascaleX < 0) + rotationIK += 180; + if (rotationIK > 180) + rotationIK -= 360; + else if (rotationIK < -180) + rotationIK += 360; + var sx = bone.ascaleX, sy = bone.ascaleY; + if (compress || stretch) { + var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty); + if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) { + var s = (dd / b - 1) * alpha + 1; + sx *= s; + if (uniform) + sy *= s; + } + } + bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY); + }; + IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) { + if (alpha == 0) { + child.updateWorldTransform(); + return; + } + if (!parent.appliedValid) + parent.updateAppliedTransform(); + if (!child.appliedValid) + child.updateAppliedTransform(); + var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX; + var os1 = 0, os2 = 0, s2 = 0; + if (psx < 0) { + psx = -psx; + os1 = 180; + s2 = -1; + } + else { + os1 = 0; + s2 = 1; + } + if (psy < 0) { + psy = -psy; + s2 = -s2; + } + if (csx < 0) { + csx = -csx; + os2 = 180; + } + else + os2 = 0; + var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; + var u = Math.abs(psx - psy) <= 0.0001; + if (!u) { + cy = 0; + cwx = a * cx + parent.worldX; + cwy = c * cx + parent.worldY; + } + else { + cy = child.ay; + cwx = a * cx + b * cy + parent.worldX; + cwy = c * cx + d * cy + parent.worldY; + } + var pp = parent.parent; + a = pp.a; + b = pp.b; + c = pp.c; + d = pp.d; + var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY; + var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty; + x = cwx - pp.worldX; + y = cwy - pp.worldY; + var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; + var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0; + outer: if (u) { + l2 *= psx; + var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); + if (cos < -1) + cos = -1; + else if (cos > 1) { + cos = 1; + if (stretch && l1 + l2 > 0.0001) + sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1; + } + a2 = Math.acos(cos) * bendDir; + a = l1 + l2 * cos; + b = l2 * Math.sin(a2); + a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b); + } + else { + a = psx * l2; + b = psy * l2; + var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); + c = bb * l1 * l1 + aa * dd - aa * bb; + var c1 = -2 * bb * l1, c2 = bb - aa; + d = c1 * c1 - 4 * c2 * c; + if (d >= 0) { + var q = Math.sqrt(d); + if (c1 < 0) + q = -q; + q = -(c1 + q) / 2; + var r0 = q / c2, r1 = c / q; + var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; + if (r * r <= dd) { + y = Math.sqrt(dd - r * r) * bendDir; + a1 = ta - Math.atan2(y, r); + a2 = Math.atan2(y / psy, (r - l1) / psx); + break outer; + } + } + var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; + var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; + c = -a * l1 / (aa - bb); + if (c >= -1 && c <= 1) { + c = Math.acos(c); + x = a * Math.cos(c) + l1; + y = b * Math.sin(c); + d = x * x + y * y; + if (d < minDist) { + minAngle = c; + minDist = d; + minX = x; + minY = y; + } + if (d > maxDist) { + maxAngle = c; + maxDist = d; + maxX = x; + maxY = y; + } + } + if (dd <= (minDist + maxDist) / 2) { + a1 = ta - Math.atan2(minY * bendDir, minX); + a2 = minAngle * bendDir; + } + else { + a1 = ta - Math.atan2(maxY * bendDir, maxX); + a2 = maxAngle * bendDir; + } + } + var os = Math.atan2(cy, cx) * s2; + var rotation = parent.arotation; + a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation; + if (a1 > 180) + a1 -= 360; + else if (a1 < -180) + a1 += 360; + parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0); + rotation = child.arotation; + a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; + if (a2 > 180) + a2 -= 360; + else if (a2 < -180) + a2 += 360; + child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); + }; + return IkConstraint; + }()); + spine.IkConstraint = IkConstraint; })(spine || (spine = {})); var spine; (function (spine) { - var IkConstraintData = (function () { - function IkConstraintData(name) { - this.order = 0; - this.bones = new Array(); - this.bendDirection = 1; - this.compress = false; - this.stretch = false; - this.uniform = false; - this.mix = 1; - this.name = name; - } - return IkConstraintData; - }()); - spine.IkConstraintData = IkConstraintData; + var IkConstraintData = (function () { + function IkConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.bendDirection = 1; + this.compress = false; + this.stretch = false; + this.uniform = false; + this.mix = 1; + this.name = name; + } + return IkConstraintData; + }()); + spine.IkConstraintData = IkConstraintData; })(spine || (spine = {})); var spine; (function (spine) { - var PathConstraint = (function () { - function PathConstraint(data, skeleton) { - 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(); - if (data == null) - throw new Error("data cannot be null."); - if (skeleton == null) - throw new Error("skeleton cannot be null."); - this.data = data; - this.bones = new Array(); - for (var i = 0, n = data.bones.length; i < n; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findSlot(data.target.name); - this.position = data.position; - this.spacing = data.spacing; - this.rotateMix = data.rotateMix; - this.translateMix = data.translateMix; - } - PathConstraint.prototype.apply = function () { - this.update(); - }; - PathConstraint.prototype.update = function () { - var attachment = this.target.getAttachment(); - if (!(attachment instanceof spine.PathAttachment)) - return; - var rotateMix = this.rotateMix, translateMix = this.translateMix; - var translate = translateMix > 0, rotate = rotateMix > 0; - if (!translate && !rotate) - return; - var data = this.data; - var percentSpacing = data.spacingMode == spine.SpacingMode.Percent; - var rotateMode = data.rotateMode; - var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale; - var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1; - var bones = this.bones; - var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null; - var spacing = this.spacing; - if (scale || !percentSpacing) { - if (scale) - lengths = spine.Utils.setArraySize(this.lengths, boneCount); - var lengthSpacing = data.spacingMode == spine.SpacingMode.Length; - for (var i = 0, n = spacesCount - 1; i < n;) { - var bone = bones[i]; - var setupLength = bone.data.length; - if (setupLength < PathConstraint.epsilon) { - if (scale) - lengths[i] = 0; - spaces[++i] = 0; - } - else if (percentSpacing) { - if (scale) { - var x = setupLength * bone.a, y = setupLength * bone.c; - var length_1 = Math.sqrt(x * x + y * y); - lengths[i] = length_1; - } - spaces[++i] = spacing; - } - else { - var x = setupLength * bone.a, y = setupLength * bone.c; - var length_2 = Math.sqrt(x * x + y * y); - if (scale) - lengths[i] = length_2; - spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength; - } - } - } - else { - for (var i = 1; i < spacesCount; i++) - spaces[i] = spacing; - } - var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing); - var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; - var tip = false; - if (offsetRotation == 0) - tip = rotateMode == spine.RotateMode.Chain; - else { - tip = false; - var p = this.target.bone; - offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; - } - for (var i = 0, p = 3; i < boneCount; i++, p += 3) { - var bone = bones[i]; - bone.worldX += (boneX - bone.worldX) * translateMix; - bone.worldY += (boneY - bone.worldY) * translateMix; - var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; - if (scale) { - var length_3 = lengths[i]; - if (length_3 != 0) { - var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1; - bone.a *= s; - bone.c *= s; - } - } - boneX = x; - boneY = y; - if (rotate) { - var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; - if (tangents) - r = positions[p - 1]; - else if (spaces[i + 1] == 0) - r = positions[p + 2]; - else - r = Math.atan2(dy, dx); - r -= Math.atan2(c, a); - if (tip) { - cos = Math.cos(r); - sin = Math.sin(r); - var length_4 = bone.data.length; - boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix; - boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix; - } - else { - r += offsetRotation; - } - if (r > spine.MathUtils.PI) - r -= spine.MathUtils.PI2; - else if (r < -spine.MathUtils.PI) - r += spine.MathUtils.PI2; - r *= rotateMix; - cos = Math.cos(r); - sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - } - bone.appliedValid = false; - } - }; - PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) { - var target = this.target; - var position = this.position; - var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null; - var closed = path.closed; - var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE; - if (!path.constantSpeed) { - var lengths = path.lengths; - curveCount -= closed ? 1 : 2; - var pathLength_1 = lengths[curveCount]; - if (percentPosition) - position *= pathLength_1; - if (percentSpacing) { - for (var i = 1; i < spacesCount; i++) - spaces[i] *= pathLength_1; - } - world = spine.Utils.setArraySize(this.world, 8); - for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { - var space = spaces[i]; - position += space; - var p = position; - if (closed) { - p %= pathLength_1; - if (p < 0) - p += pathLength_1; - curve = 0; - } - else if (p < 0) { - if (prevCurve != PathConstraint.BEFORE) { - prevCurve = PathConstraint.BEFORE; - path.computeWorldVertices(target, 2, 4, world, 0, 2); - } - this.addBeforePosition(p, world, 0, out, o); - continue; - } - else if (p > pathLength_1) { - if (prevCurve != PathConstraint.AFTER) { - prevCurve = PathConstraint.AFTER; - path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2); - } - this.addAfterPosition(p - pathLength_1, world, 0, out, o); - continue; - } - for (;; curve++) { - var length_5 = lengths[curve]; - if (p > length_5) - continue; - if (curve == 0) - p /= length_5; - else { - var prev = lengths[curve - 1]; - p = (p - prev) / (length_5 - prev); - } - break; - } - if (curve != prevCurve) { - prevCurve = curve; - if (closed && curve == curveCount) { - path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2); - path.computeWorldVertices(target, 0, 4, world, 4, 2); - } - else - path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2); - } - this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0)); - } - return out; - } - if (closed) { - verticesLength += 2; - world = spine.Utils.setArraySize(this.world, verticesLength); - path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2); - path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2); - world[verticesLength - 2] = world[0]; - world[verticesLength - 1] = world[1]; - } - else { - curveCount--; - verticesLength -= 4; - world = spine.Utils.setArraySize(this.world, verticesLength); - path.computeWorldVertices(target, 2, verticesLength, world, 0, 2); - } - var curves = spine.Utils.setArraySize(this.curves, curveCount); - var pathLength = 0; - var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; - var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; - for (var i = 0, w = 2; i < curveCount; i++, w += 6) { - cx1 = world[w]; - cy1 = world[w + 1]; - cx2 = world[w + 2]; - cy2 = world[w + 3]; - x2 = world[w + 4]; - y2 = world[w + 5]; - tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; - tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; - dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; - dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; - ddfx = tmpx * 2 + dddfx; - ddfy = tmpy * 2 + dddfy; - dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; - dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx; - dfy += ddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx + dddfx; - dfy += ddfy + dddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - curves[i] = pathLength; - x1 = x2; - y1 = y2; - } - if (percentPosition) - position *= pathLength; - else - position *= pathLength / path.lengths[curveCount - 1]; - if (percentSpacing) { - for (var i = 1; i < spacesCount; i++) - spaces[i] *= pathLength; - } - var segments = this.segments; - var curveLength = 0; - for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { - var space = spaces[i]; - position += space; - var p = position; - if (closed) { - p %= pathLength; - if (p < 0) - p += pathLength; - curve = 0; - } - else if (p < 0) { - this.addBeforePosition(p, world, 0, out, o); - continue; - } - else if (p > pathLength) { - this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); - continue; - } - for (;; curve++) { - var length_6 = curves[curve]; - if (p > length_6) - continue; - if (curve == 0) - p /= length_6; - else { - var prev = curves[curve - 1]; - p = (p - prev) / (length_6 - prev); - } - break; - } - if (curve != prevCurve) { - prevCurve = curve; - var ii = curve * 6; - x1 = world[ii]; - y1 = world[ii + 1]; - cx1 = world[ii + 2]; - cy1 = world[ii + 3]; - cx2 = world[ii + 4]; - cy2 = world[ii + 5]; - x2 = world[ii + 6]; - y2 = world[ii + 7]; - tmpx = (x1 - cx1 * 2 + cx2) * 0.03; - tmpy = (y1 - cy1 * 2 + cy2) * 0.03; - dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; - dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; - ddfx = tmpx * 2 + dddfx; - ddfy = tmpy * 2 + dddfy; - dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; - dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; - curveLength = Math.sqrt(dfx * dfx + dfy * dfy); - segments[0] = curveLength; - for (ii = 1; ii < 8; ii++) { - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[ii] = curveLength; - } - dfx += ddfx; - dfy += ddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[8] = curveLength; - dfx += ddfx + dddfx; - dfy += ddfy + dddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[9] = curveLength; - segment = 0; - } - p *= curveLength; - for (;; segment++) { - var length_7 = segments[segment]; - if (p > length_7) - continue; - if (segment == 0) - p /= length_7; - else { - var prev = segments[segment - 1]; - p = segment + (p - prev) / (length_7 - prev); - } - break; - } - this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0)); - } - return out; - }; - PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) { - var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx); - out[o] = x1 + p * Math.cos(r); - out[o + 1] = y1 + p * Math.sin(r); - out[o + 2] = r; - }; - PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) { - var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx); - out[o] = x1 + p * Math.cos(r); - out[o + 1] = y1 + p * Math.sin(r); - out[o + 2] = r; - }; - PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { - if (p == 0 || isNaN(p)) { - out[o] = x1; - out[o + 1] = y1; - out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); - return; - } - var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; - var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; - var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; - out[o] = x; - out[o + 1] = y; - if (tangents) { - if (p < 0.001) - out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); - else - out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); - } - }; - PathConstraint.prototype.getOrder = function () { - return this.data.order; - }; - PathConstraint.NONE = -1; - PathConstraint.BEFORE = -2; - PathConstraint.AFTER = -3; - PathConstraint.epsilon = 0.00001; - return PathConstraint; - }()); - spine.PathConstraint = PathConstraint; + var PathConstraint = (function () { + function PathConstraint(data, skeleton) { + 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(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0, n = data.bones.length; i < n; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findSlot(data.target.name); + this.position = data.position; + this.spacing = data.spacing; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + } + PathConstraint.prototype.apply = function () { + this.update(); + }; + PathConstraint.prototype.update = function () { + var attachment = this.target.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + return; + var rotateMix = this.rotateMix, translateMix = this.translateMix; + var translate = translateMix > 0, rotate = rotateMix > 0; + if (!translate && !rotate) + return; + var data = this.data; + var percentSpacing = data.spacingMode == spine.SpacingMode.Percent; + var rotateMode = data.rotateMode; + var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale; + var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1; + var bones = this.bones; + var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null; + var spacing = this.spacing; + if (scale || !percentSpacing) { + if (scale) + lengths = spine.Utils.setArraySize(this.lengths, boneCount); + var lengthSpacing = data.spacingMode == spine.SpacingMode.Length; + for (var i = 0, n = spacesCount - 1; i < n;) { + var bone = bones[i]; + var setupLength = bone.data.length; + if (setupLength < PathConstraint.epsilon) { + if (scale) + lengths[i] = 0; + spaces[++i] = 0; + } + else if (percentSpacing) { + if (scale) { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_1 = Math.sqrt(x * x + y * y); + lengths[i] = length_1; + } + spaces[++i] = spacing; + } + else { + var x = setupLength * bone.a, y = setupLength * bone.c; + var length_2 = Math.sqrt(x * x + y * y); + if (scale) + lengths[i] = length_2; + spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength; + } + } + } + else { + for (var i = 1; i < spacesCount; i++) + spaces[i] = spacing; + } + var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing); + var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; + var tip = false; + if (offsetRotation == 0) + tip = rotateMode == spine.RotateMode.Chain; + else { + tip = false; + var p = this.target.bone; + offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + } + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.worldX += (boneX - bone.worldX) * translateMix; + bone.worldY += (boneY - bone.worldY) * translateMix; + var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; + if (scale) { + var length_3 = lengths[i]; + if (length_3 != 0) { + var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1; + bone.a *= s; + bone.c *= s; + } + } + boneX = x; + boneY = y; + if (rotate) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; + if (tangents) + r = positions[p - 1]; + else if (spaces[i + 1] == 0) + r = positions[p + 2]; + else + r = Math.atan2(dy, dx); + r -= Math.atan2(c, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_4 = bone.data.length; + boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix; + boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix; + } + else { + r += offsetRotation; + } + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + } + bone.appliedValid = false; + } + }; + PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) { + var target = this.target; + var position = this.position; + var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null; + var closed = path.closed; + var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE; + if (!path.constantSpeed) { + var lengths = path.lengths; + curveCount -= closed ? 1 : 2; + var pathLength_1 = lengths[curveCount]; + if (percentPosition) + position *= pathLength_1; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength_1; + } + world = spine.Utils.setArraySize(this.world, 8); + for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength_1; + if (p < 0) + p += pathLength_1; + curve = 0; + } + else if (p < 0) { + if (prevCurve != PathConstraint.BEFORE) { + prevCurve = PathConstraint.BEFORE; + path.computeWorldVertices(target, 2, 4, world, 0, 2); + } + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength_1) { + if (prevCurve != PathConstraint.AFTER) { + prevCurve = PathConstraint.AFTER; + path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2); + } + this.addAfterPosition(p - pathLength_1, world, 0, out, o); + continue; + } + for (;; curve++) { + var length_5 = lengths[curve]; + if (p > length_5) + continue; + if (curve == 0) + p /= length_5; + else { + var prev = lengths[curve - 1]; + p = (p - prev) / (length_5 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + if (closed && curve == curveCount) { + path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2); + path.computeWorldVertices(target, 0, 4, world, 4, 2); + } + else + path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2); + } + this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0)); + } + return out; + } + if (closed) { + verticesLength += 2; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2); + path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2); + world[verticesLength - 2] = world[0]; + world[verticesLength - 1] = world[1]; + } + else { + curveCount--; + verticesLength -= 4; + world = spine.Utils.setArraySize(this.world, verticesLength); + path.computeWorldVertices(target, 2, verticesLength, world, 0, 2); + } + var curves = spine.Utils.setArraySize(this.curves, curveCount); + var pathLength = 0; + var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = world[w]; + cy1 = world[w + 1]; + cx2 = world[w + 2]; + cy2 = world[w + 3]; + x2 = world[w + 4]; + y2 = world[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) + position *= pathLength; + else + position *= pathLength / path.lengths[curveCount - 1]; + if (percentSpacing) { + for (var i = 1; i < spacesCount; i++) + spaces[i] *= pathLength; + } + var segments = this.segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (closed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + this.addBeforePosition(p, world, 0, out, o); + continue; + } + else if (p > pathLength) { + this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); + continue; + } + for (;; curve++) { + var length_6 = curves[curve]; + if (p > length_6) + continue; + if (curve == 0) + p /= length_6; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_6 - prev); + } + break; + } + if (curve != prevCurve) { + prevCurve = curve; + var ii = curve * 6; + x1 = world[ii]; + y1 = world[ii + 1]; + cx1 = world[ii + 2]; + cy1 = world[ii + 3]; + cx2 = world[ii + 4]; + cy2 = world[ii + 5]; + x2 = world[ii + 6]; + y2 = world[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + p *= curveLength; + for (;; segment++) { + var length_7 = segments[segment]; + if (p > length_7) + continue; + if (segment == 0) + p /= length_7; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_7 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0)); + } + return out; + }; + PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) { + var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) { + var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx); + out[o] = x1 + p * Math.cos(r); + out[o + 1] = y1 + p * Math.sin(r); + out[o + 2] = r; + }; + PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { + if (p == 0 || isNaN(p)) { + out[o] = x1; + out[o + 1] = y1; + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + return; + } + var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; + var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; + var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; + out[o] = x; + out[o + 1] = y; + if (tangents) { + if (p < 0.001) + out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); + else + out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); + } + }; + PathConstraint.prototype.getOrder = function () { + return this.data.order; + }; + PathConstraint.NONE = -1; + PathConstraint.BEFORE = -2; + PathConstraint.AFTER = -3; + PathConstraint.epsilon = 0.00001; + return PathConstraint; + }()); + spine.PathConstraint = PathConstraint; })(spine || (spine = {})); var spine; (function (spine) { - var PathConstraintData = (function () { - function PathConstraintData(name) { - this.order = 0; - this.bones = new Array(); - this.name = name; - } - return PathConstraintData; - }()); - spine.PathConstraintData = PathConstraintData; - var PositionMode; - (function (PositionMode) { - PositionMode[PositionMode["Fixed"] = 0] = "Fixed"; - PositionMode[PositionMode["Percent"] = 1] = "Percent"; - })(PositionMode = spine.PositionMode || (spine.PositionMode = {})); - var SpacingMode; - (function (SpacingMode) { - SpacingMode[SpacingMode["Length"] = 0] = "Length"; - SpacingMode[SpacingMode["Fixed"] = 1] = "Fixed"; - SpacingMode[SpacingMode["Percent"] = 2] = "Percent"; - })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {})); - var RotateMode; - (function (RotateMode) { - RotateMode[RotateMode["Tangent"] = 0] = "Tangent"; - RotateMode[RotateMode["Chain"] = 1] = "Chain"; - RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale"; - })(RotateMode = spine.RotateMode || (spine.RotateMode = {})); + var PathConstraintData = (function () { + function PathConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.name = name; + } + return PathConstraintData; + }()); + spine.PathConstraintData = PathConstraintData; + var PositionMode; + (function (PositionMode) { + PositionMode[PositionMode["Fixed"] = 0] = "Fixed"; + PositionMode[PositionMode["Percent"] = 1] = "Percent"; + })(PositionMode = spine.PositionMode || (spine.PositionMode = {})); + var SpacingMode; + (function (SpacingMode) { + SpacingMode[SpacingMode["Length"] = 0] = "Length"; + SpacingMode[SpacingMode["Fixed"] = 1] = "Fixed"; + SpacingMode[SpacingMode["Percent"] = 2] = "Percent"; + })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {})); + var RotateMode; + (function (RotateMode) { + RotateMode[RotateMode["Tangent"] = 0] = "Tangent"; + RotateMode[RotateMode["Chain"] = 1] = "Chain"; + RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale"; + })(RotateMode = spine.RotateMode || (spine.RotateMode = {})); })(spine || (spine = {})); var spine; (function (spine) { - var Assets = (function () { - function Assets(clientId) { - this.toLoad = new Array(); - this.assets = {}; - this.clientId = clientId; - } - Assets.prototype.loaded = function () { - var i = 0; - for (var v in this.assets) - i++; - return i; - }; - return Assets; - }()); - var SharedAssetManager = (function () { - function SharedAssetManager(pathPrefix) { - if (pathPrefix === void 0) { pathPrefix = ""; } - this.clientAssets = {}; - this.queuedAssets = {}; - this.rawAssets = {}; - this.errors = {}; - this.pathPrefix = pathPrefix; - } - SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) { - var clientAssets = this.clientAssets[clientId]; - if (clientAssets === null || clientAssets === undefined) { - clientAssets = new Assets(clientId); - this.clientAssets[clientId] = clientAssets; - } - if (textureLoader !== null) - clientAssets.textureLoader = textureLoader; - clientAssets.toLoad.push(path); - if (this.queuedAssets[path] === path) { - return false; - } - else { - this.queuedAssets[path] = path; - return true; - } - }; - SharedAssetManager.prototype.loadText = function (clientId, path) { - var _this = this; - path = this.pathPrefix + path; - if (!this.queueAsset(clientId, null, path)) - return; - var request = new XMLHttpRequest(); - request.onreadystatechange = function () { - if (request.readyState == XMLHttpRequest.DONE) { - if (request.status >= 200 && request.status < 300) { - _this.rawAssets[path] = request.responseText; - } - else { - _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; - } - } - }; - request.open("GET", path, true); - request.send(); - }; - SharedAssetManager.prototype.loadJson = function (clientId, path) { - var _this = this; - path = this.pathPrefix + path; - if (!this.queueAsset(clientId, null, path)) - return; - var request = new XMLHttpRequest(); - request.onreadystatechange = function () { - if (request.readyState == XMLHttpRequest.DONE) { - if (request.status >= 200 && request.status < 300) { - _this.rawAssets[path] = JSON.parse(request.responseText); - } - else { - _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; - } - } - }; - request.open("GET", path, true); - request.send(); - }; - SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) { - var _this = this; - path = this.pathPrefix + path; - if (!this.queueAsset(clientId, textureLoader, path)) - return; - var img = new Image(); - img.src = path; - img.crossOrigin = "anonymous"; - img.onload = function (ev) { - _this.rawAssets[path] = img; - }; - img.onerror = function (ev) { - _this.errors[path] = "Couldn't load image " + path; - }; - }; - SharedAssetManager.prototype.get = function (clientId, path) { - path = this.pathPrefix + path; - var clientAssets = this.clientAssets[clientId]; - if (clientAssets === null || clientAssets === undefined) - return true; - return clientAssets.assets[path]; - }; - SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { - for (var i = 0; i < clientAssets.toLoad.length; i++) { - var path = clientAssets.toLoad[i]; - var asset = clientAssets.assets[path]; - if (asset === null || asset === undefined) { - var rawAsset = this.rawAssets[path]; - if (rawAsset === null || rawAsset === undefined) - continue; - if (rawAsset instanceof HTMLImageElement) { - clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); - } - else { - clientAssets.assets[path] = rawAsset; - } - } - } - }; - SharedAssetManager.prototype.isLoadingComplete = function (clientId) { - var clientAssets = this.clientAssets[clientId]; - if (clientAssets === null || clientAssets === undefined) - return true; - this.updateClientAssets(clientAssets); - return clientAssets.toLoad.length == clientAssets.loaded(); - }; - SharedAssetManager.prototype.dispose = function () { - }; - SharedAssetManager.prototype.hasErrors = function () { - return Object.keys(this.errors).length > 0; - }; - SharedAssetManager.prototype.getErrors = function () { - return this.errors; - }; - return SharedAssetManager; - }()); - spine.SharedAssetManager = SharedAssetManager; + var Assets = (function () { + function Assets(clientId) { + this.toLoad = new Array(); + this.assets = {}; + this.clientId = clientId; + } + Assets.prototype.loaded = function () { + var i = 0; + for (var v in this.assets) + i++; + return i; + }; + return Assets; + }()); + var SharedAssetManager = (function () { + function SharedAssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + this.clientAssets = {}; + this.queuedAssets = {}; + this.rawAssets = {}; + this.errors = {}; + this.pathPrefix = pathPrefix; + } + SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) { + clientAssets = new Assets(clientId); + this.clientAssets[clientId] = clientAssets; + } + if (textureLoader !== null) + clientAssets.textureLoader = textureLoader; + clientAssets.toLoad.push(path); + if (this.queuedAssets[path] === path) { + return false; + } + else { + this.queuedAssets[path] = path; + return true; + } + }; + SharedAssetManager.prototype.loadText = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = request.responseText; + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadJson = function (clientId, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, null, path)) + return; + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState == XMLHttpRequest.DONE) { + if (request.status >= 200 && request.status < 300) { + _this.rawAssets[path] = JSON.parse(request.responseText); + } + else { + _this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText; + } + } + }; + request.open("GET", path, true); + request.send(); + }; + SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) { + var _this = this; + path = this.pathPrefix + path; + if (!this.queueAsset(clientId, textureLoader, path)) + return; + var img = new Image(); + img.src = path; + img.crossOrigin = "anonymous"; + img.onload = function (ev) { + _this.rawAssets[path] = img; + }; + img.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + }; + }; + SharedAssetManager.prototype.get = function (clientId, path) { + path = this.pathPrefix + path; + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + return clientAssets.assets[path]; + }; + SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { + for (var i = 0; i < clientAssets.toLoad.length; i++) { + var path = clientAssets.toLoad[i]; + var asset = clientAssets.assets[path]; + if (asset === null || asset === undefined) { + var rawAsset = this.rawAssets[path]; + if (rawAsset === null || rawAsset === undefined) + continue; + if (rawAsset instanceof HTMLImageElement) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } + } + } + }; + SharedAssetManager.prototype.isLoadingComplete = function (clientId) { + var clientAssets = this.clientAssets[clientId]; + if (clientAssets === null || clientAssets === undefined) + return true; + this.updateClientAssets(clientAssets); + return clientAssets.toLoad.length == clientAssets.loaded(); + }; + SharedAssetManager.prototype.dispose = function () { + }; + SharedAssetManager.prototype.hasErrors = function () { + return Object.keys(this.errors).length > 0; + }; + SharedAssetManager.prototype.getErrors = function () { + return this.errors; + }; + return SharedAssetManager; + }()); + spine.SharedAssetManager = SharedAssetManager; })(spine || (spine = {})); var spine; (function (spine) { - var Skeleton = (function () { - function Skeleton(data) { - this._updateCache = new Array(); - this.updateCacheReset = new Array(); - this.time = 0; - this.scaleX = 1; - this.scaleY = 1; - this.x = 0; - this.y = 0; - if (data == null) - throw new Error("data cannot be null."); - this.data = data; - this.bones = new Array(); - for (var i = 0; i < data.bones.length; i++) { - var boneData = data.bones[i]; - var bone = void 0; - if (boneData.parent == null) - bone = new spine.Bone(boneData, this, null); - else { - var parent_1 = this.bones[boneData.parent.index]; - bone = new spine.Bone(boneData, this, parent_1); - parent_1.children.push(bone); - } - this.bones.push(bone); - } - this.slots = new Array(); - this.drawOrder = new Array(); - for (var i = 0; i < data.slots.length; i++) { - var slotData = data.slots[i]; - var bone = this.bones[slotData.boneData.index]; - var slot = new spine.Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - this.ikConstraints = new Array(); - for (var i = 0; i < data.ikConstraints.length; i++) { - var ikConstraintData = data.ikConstraints[i]; - this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this)); - } - this.transformConstraints = new Array(); - for (var i = 0; i < data.transformConstraints.length; i++) { - var transformConstraintData = data.transformConstraints[i]; - this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this)); - } - this.pathConstraints = new Array(); - for (var i = 0; i < data.pathConstraints.length; i++) { - var pathConstraintData = data.pathConstraints[i]; - this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this)); - } - this.color = new spine.Color(1, 1, 1, 1); - this.updateCache(); - } - Skeleton.prototype.updateCache = function () { - var updateCache = this._updateCache; - updateCache.length = 0; - this.updateCacheReset.length = 0; - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].sorted = false; - var ikConstraints = this.ikConstraints; - var transformConstraints = this.transformConstraints; - var pathConstraints = this.pathConstraints; - var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length; - var constraintCount = ikCount + transformCount + pathCount; - outer: for (var i = 0; i < constraintCount; i++) { - for (var ii = 0; ii < ikCount; ii++) { - var constraint = ikConstraints[ii]; - if (constraint.data.order == i) { - this.sortIkConstraint(constraint); - continue outer; - } - } - for (var ii = 0; ii < transformCount; ii++) { - var constraint = transformConstraints[ii]; - if (constraint.data.order == i) { - this.sortTransformConstraint(constraint); - continue outer; - } - } - for (var ii = 0; ii < pathCount; ii++) { - var constraint = pathConstraints[ii]; - if (constraint.data.order == i) { - this.sortPathConstraint(constraint); - continue outer; - } - } - } - for (var i = 0, n = bones.length; i < n; i++) - this.sortBone(bones[i]); - }; - Skeleton.prototype.sortIkConstraint = function (constraint) { - var target = constraint.target; - this.sortBone(target); - var constrained = constraint.bones; - var parent = constrained[0]; - this.sortBone(parent); - if (constrained.length > 1) { - var child = constrained[constrained.length - 1]; - if (!(this._updateCache.indexOf(child) > -1)) - this.updateCacheReset.push(child); - } - this._updateCache.push(constraint); - this.sortReset(parent.children); - constrained[constrained.length - 1].sorted = true; - }; - Skeleton.prototype.sortPathConstraint = function (constraint) { - var slot = constraint.target; - var slotIndex = slot.data.index; - var slotBone = slot.bone; - if (this.skin != null) - this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); - if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin) - this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); - for (var i = 0, n = this.data.skins.length; i < n; i++) - this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone); - var attachment = slot.getAttachment(); - if (attachment instanceof spine.PathAttachment) - this.sortPathConstraintAttachmentWith(attachment, slotBone); - var constrained = constraint.bones; - var boneCount = constrained.length; - for (var i = 0; i < boneCount; i++) - this.sortBone(constrained[i]); - this._updateCache.push(constraint); - for (var i = 0; i < boneCount; i++) - this.sortReset(constrained[i].children); - for (var i = 0; i < boneCount; i++) - constrained[i].sorted = true; - }; - Skeleton.prototype.sortTransformConstraint = function (constraint) { - this.sortBone(constraint.target); - var constrained = constraint.bones; - var boneCount = constrained.length; - if (constraint.data.local) { - for (var i = 0; i < boneCount; i++) { - var child = constrained[i]; - this.sortBone(child.parent); - if (!(this._updateCache.indexOf(child) > -1)) - this.updateCacheReset.push(child); - } - } - else { - for (var i = 0; i < boneCount; i++) { - this.sortBone(constrained[i]); - } - } - this._updateCache.push(constraint); - for (var ii = 0; ii < boneCount; ii++) - this.sortReset(constrained[ii].children); - for (var ii = 0; ii < boneCount; ii++) - constrained[ii].sorted = true; - }; - Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) { - var attachments = skin.attachments[slotIndex]; - if (!attachments) - return; - for (var key in attachments) { - this.sortPathConstraintAttachmentWith(attachments[key], slotBone); - } - }; - Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) { - if (!(attachment instanceof spine.PathAttachment)) - return; - var pathBones = attachment.bones; - if (pathBones == null) - this.sortBone(slotBone); - else { - var bones = this.bones; - var i = 0; - while (i < pathBones.length) { - var boneCount = pathBones[i++]; - for (var n = i + boneCount; i < n; i++) { - var boneIndex = pathBones[i]; - this.sortBone(bones[boneIndex]); - } - } - } - }; - Skeleton.prototype.sortBone = function (bone) { - if (bone.sorted) - return; - var parent = bone.parent; - if (parent != null) - this.sortBone(parent); - bone.sorted = true; - this._updateCache.push(bone); - }; - Skeleton.prototype.sortReset = function (bones) { - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (bone.sorted) - this.sortReset(bone.children); - bone.sorted = false; - } - }; - Skeleton.prototype.updateWorldTransform = function () { - var updateCacheReset = this.updateCacheReset; - for (var i = 0, n = updateCacheReset.length; i < n; i++) { - var bone = updateCacheReset[i]; - bone.ax = bone.x; - bone.ay = bone.y; - bone.arotation = bone.rotation; - bone.ascaleX = bone.scaleX; - bone.ascaleY = bone.scaleY; - bone.ashearX = bone.shearX; - bone.ashearY = bone.shearY; - bone.appliedValid = true; - } - var updateCache = this._updateCache; - for (var i = 0, n = updateCache.length; i < n; i++) - updateCache[i].update(); - }; - Skeleton.prototype.setToSetupPose = function () { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - }; - Skeleton.prototype.setBonesToSetupPose = function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].setToSetupPose(); - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var constraint = ikConstraints[i]; - constraint.mix = constraint.data.mix; - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } - var transformConstraints = this.transformConstraints; - for (var i = 0, n = transformConstraints.length; i < n; i++) { - var constraint = transformConstraints[i]; - var data = constraint.data; - constraint.rotateMix = data.rotateMix; - constraint.translateMix = data.translateMix; - constraint.scaleMix = data.scaleMix; - constraint.shearMix = data.shearMix; - } - var pathConstraints = this.pathConstraints; - for (var i = 0, n = pathConstraints.length; i < n; i++) { - var constraint = pathConstraints[i]; - var data = constraint.data; - constraint.position = data.position; - constraint.spacing = data.spacing; - constraint.rotateMix = data.rotateMix; - constraint.translateMix = data.translateMix; - } - }; - Skeleton.prototype.setSlotsToSetupPose = function () { - var slots = this.slots; - spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); - for (var i = 0, n = slots.length; i < n; i++) - slots[i].setToSetupPose(); - }; - Skeleton.prototype.getRootBone = function () { - if (this.bones.length == 0) - return null; - return this.bones[0]; - }; - Skeleton.prototype.findBone = function (boneName) { - if (boneName == null) - throw new Error("boneName cannot be null."); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (bone.data.name == boneName) - return bone; - } - return null; - }; - Skeleton.prototype.findBoneIndex = function (boneName) { - if (boneName == null) - throw new Error("boneName cannot be null."); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) - return i; - return -1; - }; - Skeleton.prototype.findSlot = function (slotName) { - if (slotName == null) - throw new Error("slotName cannot be null."); - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) - return slot; - } - return null; - }; - Skeleton.prototype.findSlotIndex = function (slotName) { - if (slotName == null) - throw new Error("slotName cannot be null."); - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) - return i; - return -1; - }; - Skeleton.prototype.setSkinByName = function (skinName) { - var skin = this.data.findSkin(skinName); - if (skin == null) - throw new Error("Skin not found: " + skinName); - this.setSkin(skin); - }; - Skeleton.prototype.setSkin = function (newSkin) { - if (newSkin != null) { - if (this.skin != null) - newSkin.attachAll(this, this.skin); - else { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var name_1 = slot.data.attachmentName; - if (name_1 != null) { - var attachment = newSkin.getAttachment(i, name_1); - if (attachment != null) - slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - }; - Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) { - return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName); - }; - Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) { - if (attachmentName == null) - throw new Error("attachmentName cannot be null."); - if (this.skin != null) { - var attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment != null) - return attachment; - } - if (this.data.defaultSkin != null) - return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - }; - Skeleton.prototype.setAttachment = function (slotName, attachmentName) { - if (slotName == null) - throw new Error("slotName cannot be null."); - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) { - var attachment = null; - if (attachmentName != null) { - attachment = this.getAttachment(i, attachmentName); - if (attachment == null) - throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName); - } - slot.setAttachment(attachment); - return; - } - } - throw new Error("Slot not found: " + slotName); - }; - Skeleton.prototype.findIkConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var ikConstraint = ikConstraints[i]; - if (ikConstraint.data.name == constraintName) - return ikConstraint; - } - return null; - }; - Skeleton.prototype.findTransformConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var transformConstraints = this.transformConstraints; - for (var i = 0, n = transformConstraints.length; i < n; i++) { - var constraint = transformConstraints[i]; - if (constraint.data.name == constraintName) - return constraint; - } - return null; - }; - Skeleton.prototype.findPathConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var pathConstraints = this.pathConstraints; - for (var i = 0, n = pathConstraints.length; i < n; i++) { - var constraint = pathConstraints[i]; - if (constraint.data.name == constraintName) - return constraint; - } - return null; - }; - Skeleton.prototype.getBounds = function (offset, size, temp) { - if (temp === void 0) { temp = new Array(2); } - if (offset == null) - throw new Error("offset cannot be null."); - if (size == null) - throw new Error("size cannot be null."); - var drawOrder = this.drawOrder; - var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - for (var i = 0, n = drawOrder.length; i < n; i++) { - var slot = drawOrder[i]; - var verticesLength = 0; - var vertices = null; - var attachment = slot.getAttachment(); - if (attachment instanceof spine.RegionAttachment) { - verticesLength = 8; - vertices = spine.Utils.setArraySize(temp, verticesLength, 0); - attachment.computeWorldVertices(slot.bone, vertices, 0, 2); - } - else if (attachment instanceof spine.MeshAttachment) { - var mesh = attachment; - verticesLength = mesh.worldVerticesLength; - vertices = spine.Utils.setArraySize(temp, verticesLength, 0); - mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2); - } - if (vertices != null) { - for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { - var x = vertices[ii], y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - } - offset.set(minX, minY); - size.set(maxX - minX, maxY - minY); - }; - Skeleton.prototype.update = function (delta) { - this.time += delta; - }; - return Skeleton; - }()); - spine.Skeleton = Skeleton; + var Skeleton = (function () { + function Skeleton(data) { + this._updateCache = new Array(); + this.updateCacheReset = new Array(); + this.time = 0; + this.scaleX = 1; + this.scaleY = 1; + this.x = 0; + this.y = 0; + if (data == null) + throw new Error("data cannot be null."); + this.data = data; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) { + var boneData = data.bones[i]; + var bone = void 0; + if (boneData.parent == null) + bone = new spine.Bone(boneData, this, null); + else { + var parent_1 = this.bones[boneData.parent.index]; + bone = new spine.Bone(boneData, this, parent_1); + parent_1.children.push(bone); + } + this.bones.push(bone); + } + this.slots = new Array(); + this.drawOrder = new Array(); + for (var i = 0; i < data.slots.length; i++) { + var slotData = data.slots[i]; + var bone = this.bones[slotData.boneData.index]; + var slot = new spine.Slot(slotData, bone); + this.slots.push(slot); + this.drawOrder.push(slot); + } + this.ikConstraints = new Array(); + for (var i = 0; i < data.ikConstraints.length; i++) { + var ikConstraintData = data.ikConstraints[i]; + this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this)); + } + this.transformConstraints = new Array(); + for (var i = 0; i < data.transformConstraints.length; i++) { + var transformConstraintData = data.transformConstraints[i]; + this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this)); + } + this.pathConstraints = new Array(); + for (var i = 0; i < data.pathConstraints.length; i++) { + var pathConstraintData = data.pathConstraints[i]; + this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this)); + } + this.color = new spine.Color(1, 1, 1, 1); + this.updateCache(); + } + Skeleton.prototype.updateCache = function () { + var updateCache = this._updateCache; + updateCache.length = 0; + this.updateCacheReset.length = 0; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].sorted = false; + var ikConstraints = this.ikConstraints; + var transformConstraints = this.transformConstraints; + var pathConstraints = this.pathConstraints; + var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length; + var constraintCount = ikCount + transformCount + pathCount; + outer: for (var i = 0; i < constraintCount; i++) { + for (var ii = 0; ii < ikCount; ii++) { + var constraint = ikConstraints[ii]; + if (constraint.data.order == i) { + this.sortIkConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < transformCount; ii++) { + var constraint = transformConstraints[ii]; + if (constraint.data.order == i) { + this.sortTransformConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < pathCount; ii++) { + var constraint = pathConstraints[ii]; + if (constraint.data.order == i) { + this.sortPathConstraint(constraint); + continue outer; + } + } + } + for (var i = 0, n = bones.length; i < n; i++) + this.sortBone(bones[i]); + }; + Skeleton.prototype.sortIkConstraint = function (constraint) { + var target = constraint.target; + this.sortBone(target); + var constrained = constraint.bones; + var parent = constrained[0]; + this.sortBone(parent); + if (constrained.length > 1) { + var child = constrained[constrained.length - 1]; + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + this._updateCache.push(constraint); + this.sortReset(parent.children); + constrained[constrained.length - 1].sorted = true; + }; + Skeleton.prototype.sortPathConstraint = function (constraint) { + var slot = constraint.target; + var slotIndex = slot.data.index; + var slotBone = slot.bone; + if (this.skin != null) + this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); + if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin) + this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); + for (var i = 0, n = this.data.skins.length; i < n; i++) + this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone); + var attachment = slot.getAttachment(); + if (attachment instanceof spine.PathAttachment) + this.sortPathConstraintAttachmentWith(attachment, slotBone); + var constrained = constraint.bones; + var boneCount = constrained.length; + for (var i = 0; i < boneCount; i++) + this.sortBone(constrained[i]); + this._updateCache.push(constraint); + for (var i = 0; i < boneCount; i++) + this.sortReset(constrained[i].children); + for (var i = 0; i < boneCount; i++) + constrained[i].sorted = true; + }; + Skeleton.prototype.sortTransformConstraint = function (constraint) { + this.sortBone(constraint.target); + var constrained = constraint.bones; + var boneCount = constrained.length; + if (constraint.data.local) { + for (var i = 0; i < boneCount; i++) { + var child = constrained[i]; + this.sortBone(child.parent); + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + } + else { + for (var i = 0; i < boneCount; i++) { + this.sortBone(constrained[i]); + } + } + this._updateCache.push(constraint); + for (var ii = 0; ii < boneCount; ii++) + this.sortReset(constrained[ii].children); + for (var ii = 0; ii < boneCount; ii++) + constrained[ii].sorted = true; + }; + Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) { + var attachments = skin.attachments[slotIndex]; + if (!attachments) + return; + for (var key in attachments) { + this.sortPathConstraintAttachmentWith(attachments[key], slotBone); + } + }; + Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) { + if (!(attachment instanceof spine.PathAttachment)) + return; + var pathBones = attachment.bones; + if (pathBones == null) + this.sortBone(slotBone); + else { + var bones = this.bones; + var i = 0; + while (i < pathBones.length) { + var boneCount = pathBones[i++]; + for (var n = i + boneCount; i < n; i++) { + var boneIndex = pathBones[i]; + this.sortBone(bones[boneIndex]); + } + } + } + }; + Skeleton.prototype.sortBone = function (bone) { + if (bone.sorted) + return; + var parent = bone.parent; + if (parent != null) + this.sortBone(parent); + bone.sorted = true; + this._updateCache.push(bone); + }; + Skeleton.prototype.sortReset = function (bones) { + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.sorted) + this.sortReset(bone.children); + bone.sorted = false; + } + }; + Skeleton.prototype.updateWorldTransform = function () { + var updateCacheReset = this.updateCacheReset; + for (var i = 0, n = updateCacheReset.length; i < n; i++) { + var bone = updateCacheReset[i]; + bone.ax = bone.x; + bone.ay = bone.y; + bone.arotation = bone.rotation; + bone.ascaleX = bone.scaleX; + bone.ascaleY = bone.scaleY; + bone.ashearX = bone.shearX; + bone.ashearY = bone.shearY; + bone.appliedValid = true; + } + var updateCache = this._updateCache; + for (var i = 0, n = updateCache.length; i < n; i++) + updateCache[i].update(); + }; + Skeleton.prototype.setToSetupPose = function () { + this.setBonesToSetupPose(); + this.setSlotsToSetupPose(); + }; + Skeleton.prototype.setBonesToSetupPose = function () { + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + bones[i].setToSetupPose(); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + constraint.mix = constraint.data.mix; + constraint.bendDirection = constraint.data.bendDirection; + constraint.compress = constraint.data.compress; + constraint.stretch = constraint.data.stretch; + } + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + var data = constraint.data; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + constraint.scaleMix = data.scaleMix; + constraint.shearMix = data.shearMix; + } + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + var data = constraint.data; + constraint.position = data.position; + constraint.spacing = data.spacing; + constraint.rotateMix = data.rotateMix; + constraint.translateMix = data.translateMix; + } + }; + Skeleton.prototype.setSlotsToSetupPose = function () { + var slots = this.slots; + spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); + for (var i = 0, n = slots.length; i < n; i++) + slots[i].setToSetupPose(); + }; + Skeleton.prototype.getRootBone = function () { + if (this.bones.length == 0) + return null; + return this.bones[0]; + }; + Skeleton.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.data.name == boneName) + return bone; + } + return null; + }; + Skeleton.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].data.name == boneName) + return i; + return -1; + }; + Skeleton.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) + return slot; + } + return null; + }; + Skeleton.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].data.name == slotName) + return i; + return -1; + }; + Skeleton.prototype.setSkinByName = function (skinName) { + var skin = this.data.findSkin(skinName); + if (skin == null) + throw new Error("Skin not found: " + skinName); + this.setSkin(skin); + }; + Skeleton.prototype.setSkin = function (newSkin) { + if (newSkin != null) { + if (this.skin != null) + newSkin.attachAll(this, this.skin); + else { + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var name_1 = slot.data.attachmentName; + if (name_1 != null) { + var attachment = newSkin.getAttachment(i, name_1); + if (attachment != null) + slot.setAttachment(attachment); + } + } + } + } + this.skin = newSkin; + }; + Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) { + return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName); + }; + Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) { + if (attachmentName == null) + throw new Error("attachmentName cannot be null."); + if (this.skin != null) { + var attachment = this.skin.getAttachment(slotIndex, attachmentName); + if (attachment != null) + return attachment; + } + if (this.data.defaultSkin != null) + return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); + return null; + }; + Skeleton.prototype.setAttachment = function (slotName, attachmentName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.data.name == slotName) { + var attachment = null; + if (attachmentName != null) { + attachment = this.getAttachment(i, attachmentName); + if (attachment == null) + throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName); + } + slot.setAttachment(attachment); + return; + } + } + throw new Error("Slot not found: " + slotName); + }; + Skeleton.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var ikConstraint = ikConstraints[i]; + if (ikConstraint.data.name == constraintName) + return ikConstraint; + } + return null; + }; + Skeleton.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.data.name == constraintName) + return constraint; + } + return null; + }; + Skeleton.prototype.getBounds = function (offset, size, temp) { + if (temp === void 0) { temp = new Array(2); } + if (offset == null) + throw new Error("offset cannot be null."); + if (size == null) + throw new Error("size cannot be null."); + var drawOrder = this.drawOrder; + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var verticesLength = 0; + var vertices = null; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + verticesLength = 8; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + attachment.computeWorldVertices(slot.bone, vertices, 0, 2); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + verticesLength = mesh.worldVerticesLength; + vertices = spine.Utils.setArraySize(temp, verticesLength, 0); + mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2); + } + if (vertices != null) { + for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + } + offset.set(minX, minY); + size.set(maxX - minX, maxY - minY); + }; + Skeleton.prototype.update = function (delta) { + this.time += delta; + }; + return Skeleton; + }()); + spine.Skeleton = Skeleton; })(spine || (spine = {})); var spine; (function (spine) { - var SkeletonBounds = (function () { - function SkeletonBounds() { - this.minX = 0; - this.minY = 0; - this.maxX = 0; - this.maxY = 0; - this.boundingBoxes = new Array(); - this.polygons = new Array(); - this.polygonPool = new spine.Pool(function () { - return spine.Utils.newFloatArray(16); - }); - } - SkeletonBounds.prototype.update = function (skeleton, updateAabb) { - if (skeleton == null) - throw new Error("skeleton cannot be null."); - var boundingBoxes = this.boundingBoxes; - var polygons = this.polygons; - var polygonPool = this.polygonPool; - var slots = skeleton.slots; - var slotCount = slots.length; - boundingBoxes.length = 0; - polygonPool.freeAll(polygons); - polygons.length = 0; - for (var i = 0; i < slotCount; i++) { - var slot = slots[i]; - var attachment = slot.getAttachment(); - if (attachment instanceof spine.BoundingBoxAttachment) { - var boundingBox = attachment; - boundingBoxes.push(boundingBox); - var polygon = polygonPool.obtain(); - if (polygon.length != boundingBox.worldVerticesLength) { - polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength); - } - polygons.push(polygon); - boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2); - } - } - if (updateAabb) { - this.aabbCompute(); - } - else { - this.minX = Number.POSITIVE_INFINITY; - this.minY = Number.POSITIVE_INFINITY; - this.maxX = Number.NEGATIVE_INFINITY; - this.maxY = Number.NEGATIVE_INFINITY; - } - }; - SkeletonBounds.prototype.aabbCompute = function () { - var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) { - var polygon = polygons[i]; - var vertices = polygon; - for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) { - var x = vertices[ii]; - var y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - }; - SkeletonBounds.prototype.aabbContainsPoint = function (x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - }; - SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) { - var minX = this.minX; - var minY = this.minY; - var maxX = this.maxX; - var maxY = this.maxY; - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) - return false; - var m = (y2 - y1) / (x2 - x1); - var y = m * (minX - x1) + y1; - if (y > minY && y < maxY) - return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) - return true; - var x = (minY - y1) / m + x1; - if (x > minX && x < maxX) - return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) - return true; - return false; - }; - SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - }; - SkeletonBounds.prototype.containsPoint = function (x, y) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.containsPointPolygon(polygons[i], x, y)) - return this.boundingBoxes[i]; - return null; - }; - SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) { - var vertices = polygon; - var nn = polygon.length; - var prevIndex = nn - 2; - var inside = false; - for (var ii = 0; ii < nn; ii += 2) { - var vertexY = vertices[ii + 1]; - var prevY = vertices[prevIndex + 1]; - if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { - var vertexX = vertices[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) - inside = !inside; - } - prevIndex = ii; - } - return inside; - }; - SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) - return this.boundingBoxes[i]; - return null; - }; - SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) { - var vertices = polygon; - var nn = polygon.length; - var width12 = x1 - x2, height12 = y1 - y2; - var det1 = x1 * y2 - y1 * x2; - var x3 = vertices[nn - 2], y3 = vertices[nn - 1]; - for (var ii = 0; ii < nn; ii += 2) { - var x4 = vertices[ii], y4 = vertices[ii + 1]; - var det2 = x3 * y4 - y3 * x4; - var width34 = x3 - x4, height34 = y3 - y4; - var det3 = width12 * height34 - height12 * width34; - var x = (det1 * width34 - width12 * det2) / det3; - if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { - var y = (det1 * height34 - height12 * det2) / det3; - if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) - return true; - } - x3 = x4; - y3 = y4; - } - return false; - }; - SkeletonBounds.prototype.getPolygon = function (boundingBox) { - if (boundingBox == null) - throw new Error("boundingBox cannot be null."); - var index = this.boundingBoxes.indexOf(boundingBox); - return index == -1 ? null : this.polygons[index]; - }; - SkeletonBounds.prototype.getWidth = function () { - return this.maxX - this.minX; - }; - SkeletonBounds.prototype.getHeight = function () { - return this.maxY - this.minY; - }; - return SkeletonBounds; - }()); - spine.SkeletonBounds = SkeletonBounds; + var SkeletonBounds = (function () { + function SkeletonBounds() { + this.minX = 0; + this.minY = 0; + this.maxX = 0; + this.maxY = 0; + this.boundingBoxes = new Array(); + this.polygons = new Array(); + this.polygonPool = new spine.Pool(function () { + return spine.Utils.newFloatArray(16); + }); + } + SkeletonBounds.prototype.update = function (skeleton, updateAabb) { + if (skeleton == null) + throw new Error("skeleton cannot be null."); + var boundingBoxes = this.boundingBoxes; + var polygons = this.polygons; + var polygonPool = this.polygonPool; + var slots = skeleton.slots; + var slotCount = slots.length; + boundingBoxes.length = 0; + polygonPool.freeAll(polygons); + polygons.length = 0; + for (var i = 0; i < slotCount; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.BoundingBoxAttachment) { + var boundingBox = attachment; + boundingBoxes.push(boundingBox); + var polygon = polygonPool.obtain(); + if (polygon.length != boundingBox.worldVerticesLength) { + polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength); + } + polygons.push(polygon); + boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2); + } + } + if (updateAabb) { + this.aabbCompute(); + } + else { + this.minX = Number.POSITIVE_INFINITY; + this.minY = Number.POSITIVE_INFINITY; + this.maxX = Number.NEGATIVE_INFINITY; + this.maxY = Number.NEGATIVE_INFINITY; + } + }; + SkeletonBounds.prototype.aabbCompute = function () { + var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + var vertices = polygon; + for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) { + var x = vertices[ii]; + var y = vertices[ii + 1]; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + } + this.minX = minX; + this.minY = minY; + this.maxX = maxX; + this.maxY = maxY; + }; + SkeletonBounds.prototype.aabbContainsPoint = function (x, y) { + return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; + }; + SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) { + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) + return false; + var m = (y2 - y1) / (x2 - x1); + var y = m * (minX - x1) + y1; + if (y > minY && y < maxY) + return true; + y = m * (maxX - x1) + y1; + if (y > minY && y < maxY) + return true; + var x = (minY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + x = (maxY - y1) / m + x1; + if (x > minX && x < maxX) + return true; + return false; + }; + SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) { + return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; + }; + SkeletonBounds.prototype.containsPoint = function (x, y) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.containsPointPolygon(polygons[i], x, y)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) { + var vertices = polygon; + var nn = polygon.length; + var prevIndex = nn - 2; + var inside = false; + for (var ii = 0; ii < nn; ii += 2) { + var vertexY = vertices[ii + 1]; + var prevY = vertices[prevIndex + 1]; + if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { + var vertexX = vertices[ii]; + if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) + inside = !inside; + } + prevIndex = ii; + } + return inside; + }; + SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) { + var polygons = this.polygons; + for (var i = 0, n = polygons.length; i < n; i++) + if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) + return this.boundingBoxes[i]; + return null; + }; + SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) { + var vertices = polygon; + var nn = polygon.length; + var width12 = x1 - x2, height12 = y1 - y2; + var det1 = x1 * y2 - y1 * x2; + var x3 = vertices[nn - 2], y3 = vertices[nn - 1]; + for (var ii = 0; ii < nn; ii += 2) { + var x4 = vertices[ii], y4 = vertices[ii + 1]; + var det2 = x3 * y4 - y3 * x4; + var width34 = x3 - x4, height34 = y3 - y4; + var det3 = width12 * height34 - height12 * width34; + var x = (det1 * width34 - width12 * det2) / det3; + if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { + var y = (det1 * height34 - height12 * det2) / det3; + if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) + return true; + } + x3 = x4; + y3 = y4; + } + return false; + }; + SkeletonBounds.prototype.getPolygon = function (boundingBox) { + if (boundingBox == null) + throw new Error("boundingBox cannot be null."); + var index = this.boundingBoxes.indexOf(boundingBox); + return index == -1 ? null : this.polygons[index]; + }; + SkeletonBounds.prototype.getWidth = function () { + return this.maxX - this.minX; + }; + SkeletonBounds.prototype.getHeight = function () { + return this.maxY - this.minY; + }; + return SkeletonBounds; + }()); + spine.SkeletonBounds = SkeletonBounds; })(spine || (spine = {})); var spine; (function (spine) { - var SkeletonClipping = (function () { - function SkeletonClipping() { - this.triangulator = new spine.Triangulator(); - this.clippingPolygon = new Array(); - this.clipOutput = new Array(); - this.clippedVertices = new Array(); - this.clippedTriangles = new Array(); - this.scratch = new Array(); - } - SkeletonClipping.prototype.clipStart = function (slot, clip) { - if (this.clipAttachment != null) - return 0; - this.clipAttachment = clip; - var n = clip.worldVerticesLength; - var vertices = spine.Utils.setArraySize(this.clippingPolygon, n); - clip.computeWorldVertices(slot, 0, n, vertices, 0, 2); - var clippingPolygon = this.clippingPolygon; - SkeletonClipping.makeClockwise(clippingPolygon); - var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); - for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) { - var polygon = clippingPolygons[i]; - SkeletonClipping.makeClockwise(polygon); - polygon.push(polygon[0]); - polygon.push(polygon[1]); - } - return clippingPolygons.length; - }; - SkeletonClipping.prototype.clipEndWithSlot = function (slot) { - if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data) - this.clipEnd(); - }; - SkeletonClipping.prototype.clipEnd = function () { - if (this.clipAttachment == null) - return; - this.clipAttachment = null; - this.clippingPolygons = null; - this.clippedVertices.length = 0; - this.clippedTriangles.length = 0; - this.clippingPolygon.length = 0; - }; - SkeletonClipping.prototype.isClipping = function () { - return this.clipAttachment != null; - }; - SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) { - var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; - var clippedTriangles = this.clippedTriangles; - var polygons = this.clippingPolygons; - var polygonsCount = this.clippingPolygons.length; - var vertexSize = twoColor ? 12 : 8; - var index = 0; - clippedVertices.length = 0; - clippedTriangles.length = 0; - outer: for (var i = 0; i < trianglesLength; i += 3) { - var vertexOffset = triangles[i] << 1; - var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; - var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 1] << 1; - var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; - var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 2] << 1; - var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; - var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; - for (var p = 0; p < polygonsCount; p++) { - var s = clippedVertices.length; - if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { - var clipOutputLength = clipOutput.length; - if (clipOutputLength == 0) - continue; - var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; - var d = 1 / (d0 * d2 + d1 * (y1 - y3)); - var clipOutputCount = clipOutputLength >> 1; - var clipOutputItems = this.clipOutput; - var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize); - for (var ii = 0; ii < clipOutputLength; ii += 2) { - var x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; - clippedVerticesItems[s] = x; - clippedVerticesItems[s + 1] = y; - clippedVerticesItems[s + 2] = light.r; - clippedVerticesItems[s + 3] = light.g; - clippedVerticesItems[s + 4] = light.b; - clippedVerticesItems[s + 5] = light.a; - var c0 = x - x3, c1 = y - y3; - var a = (d0 * c0 + d1 * c1) * d; - var b = (d4 * c0 + d2 * c1) * d; - var c = 1 - a - b; - clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c; - clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c; - if (twoColor) { - clippedVerticesItems[s + 8] = dark.r; - clippedVerticesItems[s + 9] = dark.g; - clippedVerticesItems[s + 10] = dark.b; - clippedVerticesItems[s + 11] = dark.a; - } - s += vertexSize; - } - s = clippedTriangles.length; - var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); - clipOutputCount--; - for (var ii = 1; ii < clipOutputCount; ii++) { - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = (index + ii); - clippedTrianglesItems[s + 2] = (index + ii + 1); - s += 3; - } - index += clipOutputCount + 1; - } - else { - var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize); - clippedVerticesItems[s] = x1; - clippedVerticesItems[s + 1] = y1; - clippedVerticesItems[s + 2] = light.r; - clippedVerticesItems[s + 3] = light.g; - clippedVerticesItems[s + 4] = light.b; - clippedVerticesItems[s + 5] = light.a; - if (!twoColor) { - clippedVerticesItems[s + 6] = u1; - clippedVerticesItems[s + 7] = v1; - clippedVerticesItems[s + 8] = x2; - clippedVerticesItems[s + 9] = y2; - clippedVerticesItems[s + 10] = light.r; - clippedVerticesItems[s + 11] = light.g; - clippedVerticesItems[s + 12] = light.b; - clippedVerticesItems[s + 13] = light.a; - clippedVerticesItems[s + 14] = u2; - clippedVerticesItems[s + 15] = v2; - clippedVerticesItems[s + 16] = x3; - clippedVerticesItems[s + 17] = y3; - clippedVerticesItems[s + 18] = light.r; - clippedVerticesItems[s + 19] = light.g; - clippedVerticesItems[s + 20] = light.b; - clippedVerticesItems[s + 21] = light.a; - clippedVerticesItems[s + 22] = u3; - clippedVerticesItems[s + 23] = v3; - } - else { - clippedVerticesItems[s + 6] = u1; - clippedVerticesItems[s + 7] = v1; - clippedVerticesItems[s + 8] = dark.r; - clippedVerticesItems[s + 9] = dark.g; - clippedVerticesItems[s + 10] = dark.b; - clippedVerticesItems[s + 11] = dark.a; - clippedVerticesItems[s + 12] = x2; - clippedVerticesItems[s + 13] = y2; - clippedVerticesItems[s + 14] = light.r; - clippedVerticesItems[s + 15] = light.g; - clippedVerticesItems[s + 16] = light.b; - clippedVerticesItems[s + 17] = light.a; - clippedVerticesItems[s + 18] = u2; - clippedVerticesItems[s + 19] = v2; - clippedVerticesItems[s + 20] = dark.r; - clippedVerticesItems[s + 21] = dark.g; - clippedVerticesItems[s + 22] = dark.b; - clippedVerticesItems[s + 23] = dark.a; - clippedVerticesItems[s + 24] = x3; - clippedVerticesItems[s + 25] = y3; - clippedVerticesItems[s + 26] = light.r; - clippedVerticesItems[s + 27] = light.g; - clippedVerticesItems[s + 28] = light.b; - clippedVerticesItems[s + 29] = light.a; - clippedVerticesItems[s + 30] = u3; - clippedVerticesItems[s + 31] = v3; - clippedVerticesItems[s + 32] = dark.r; - clippedVerticesItems[s + 33] = dark.g; - clippedVerticesItems[s + 34] = dark.b; - clippedVerticesItems[s + 35] = dark.a; - } - s = clippedTriangles.length; - var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3); - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = (index + 1); - clippedTrianglesItems[s + 2] = (index + 2); - index += 3; - continue outer; - } - } - } - }; - SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) { - var originalOutput = output; - var clipped = false; - var input = null; - if (clippingArea.length % 4 >= 2) { - input = output; - output = this.scratch; - } - else - input = this.scratch; - input.length = 0; - input.push(x1); - input.push(y1); - input.push(x2); - input.push(y2); - input.push(x3); - input.push(y3); - input.push(x1); - input.push(y1); - output.length = 0; - var clippingVertices = clippingArea; - var clippingVerticesLast = clippingArea.length - 4; - for (var i = 0;; i += 2) { - var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; - var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3]; - var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2; - var inputVertices = input; - var inputVerticesLength = input.length - 2, outputStart = output.length; - for (var ii = 0; ii < inputVerticesLength; ii += 2) { - var inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; - var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3]; - var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0; - if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) { - if (side2) { - output.push(inputX2); - output.push(inputY2); - continue; - } - var c0 = inputY2 - inputY, c2 = inputX2 - inputX; - var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); - if (Math.abs(s) > 0.000001) { - var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; - output.push(edgeX + (edgeX2 - edgeX) * ua); - output.push(edgeY + (edgeY2 - edgeY) * ua); - } - else { - output.push(edgeX); - output.push(edgeY); - } - } - else if (side2) { - var c0 = inputY2 - inputY, c2 = inputX2 - inputX; - var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); - if (Math.abs(s) > 0.000001) { - var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; - output.push(edgeX + (edgeX2 - edgeX) * ua); - output.push(edgeY + (edgeY2 - edgeY) * ua); - } - else { - output.push(edgeX); - output.push(edgeY); - } - output.push(inputX2); - output.push(inputY2); - } - clipped = true; - } - if (outputStart == output.length) { - originalOutput.length = 0; - return true; - } - output.push(output[0]); - output.push(output[1]); - if (i == clippingVerticesLast) - break; - var temp = output; - output = input; - output.length = 0; - input = temp; - } - if (originalOutput != output) { - originalOutput.length = 0; - for (var i = 0, n = output.length - 2; i < n; i++) - originalOutput[i] = output[i]; - } - else - originalOutput.length = originalOutput.length - 2; - return clipped; - }; - SkeletonClipping.makeClockwise = function (polygon) { - var vertices = polygon; - var verticeslength = polygon.length; - var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; - for (var i = 0, n = verticeslength - 3; i < n; i += 2) { - p1x = vertices[i]; - p1y = vertices[i + 1]; - p2x = vertices[i + 2]; - p2y = vertices[i + 3]; - area += p1x * p2y - p2x * p1y; - } - if (area < 0) - return; - for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { - var x = vertices[i], y = vertices[i + 1]; - var other = lastX - i; - vertices[i] = vertices[other]; - vertices[i + 1] = vertices[other + 1]; - vertices[other] = x; - vertices[other + 1] = y; - } - }; - return SkeletonClipping; - }()); - spine.SkeletonClipping = SkeletonClipping; + var SkeletonClipping = (function () { + function SkeletonClipping() { + this.triangulator = new spine.Triangulator(); + this.clippingPolygon = new Array(); + this.clipOutput = new Array(); + this.clippedVertices = new Array(); + this.clippedTriangles = new Array(); + this.scratch = new Array(); + } + SkeletonClipping.prototype.clipStart = function (slot, clip) { + if (this.clipAttachment != null) + return 0; + this.clipAttachment = clip; + var n = clip.worldVerticesLength; + var vertices = spine.Utils.setArraySize(this.clippingPolygon, n); + clip.computeWorldVertices(slot, 0, n, vertices, 0, 2); + var clippingPolygon = this.clippingPolygon; + SkeletonClipping.makeClockwise(clippingPolygon); + var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); + for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) { + var polygon = clippingPolygons[i]; + SkeletonClipping.makeClockwise(polygon); + polygon.push(polygon[0]); + polygon.push(polygon[1]); + } + return clippingPolygons.length; + }; + SkeletonClipping.prototype.clipEndWithSlot = function (slot) { + if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data) + this.clipEnd(); + }; + SkeletonClipping.prototype.clipEnd = function () { + if (this.clipAttachment == null) + return; + this.clipAttachment = null; + this.clippingPolygons = null; + this.clippedVertices.length = 0; + this.clippedTriangles.length = 0; + this.clippingPolygon.length = 0; + }; + SkeletonClipping.prototype.isClipping = function () { + return this.clipAttachment != null; + }; + SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) { + var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; + var clippedTriangles = this.clippedTriangles; + var polygons = this.clippingPolygons; + var polygonsCount = this.clippingPolygons.length; + var vertexSize = twoColor ? 12 : 8; + var index = 0; + clippedVertices.length = 0; + clippedTriangles.length = 0; + outer: for (var i = 0; i < trianglesLength; i += 3) { + var vertexOffset = triangles[i] << 1; + var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; + var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 1] << 1; + var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; + var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; + vertexOffset = triangles[i + 2] << 1; + var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; + var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; + for (var p = 0; p < polygonsCount; p++) { + var s = clippedVertices.length; + if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { + var clipOutputLength = clipOutput.length; + if (clipOutputLength == 0) + continue; + var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; + var d = 1 / (d0 * d2 + d1 * (y1 - y3)); + var clipOutputCount = clipOutputLength >> 1; + var clipOutputItems = this.clipOutput; + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize); + for (var ii = 0; ii < clipOutputLength; ii += 2) { + var x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; + clippedVerticesItems[s] = x; + clippedVerticesItems[s + 1] = y; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + var c0 = x - x3, c1 = y - y3; + var a = (d0 * c0 + d1 * c1) * d; + var b = (d4 * c0 + d2 * c1) * d; + var c = 1 - a - b; + clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c; + clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c; + if (twoColor) { + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + } + s += vertexSize; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); + clipOutputCount--; + for (var ii = 1; ii < clipOutputCount; ii++) { + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + ii); + clippedTrianglesItems[s + 2] = (index + ii + 1); + s += 3; + } + index += clipOutputCount + 1; + } + else { + var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize); + clippedVerticesItems[s] = x1; + clippedVerticesItems[s + 1] = y1; + clippedVerticesItems[s + 2] = light.r; + clippedVerticesItems[s + 3] = light.g; + clippedVerticesItems[s + 4] = light.b; + clippedVerticesItems[s + 5] = light.a; + if (!twoColor) { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = x2; + clippedVerticesItems[s + 9] = y2; + clippedVerticesItems[s + 10] = light.r; + clippedVerticesItems[s + 11] = light.g; + clippedVerticesItems[s + 12] = light.b; + clippedVerticesItems[s + 13] = light.a; + clippedVerticesItems[s + 14] = u2; + clippedVerticesItems[s + 15] = v2; + clippedVerticesItems[s + 16] = x3; + clippedVerticesItems[s + 17] = y3; + clippedVerticesItems[s + 18] = light.r; + clippedVerticesItems[s + 19] = light.g; + clippedVerticesItems[s + 20] = light.b; + clippedVerticesItems[s + 21] = light.a; + clippedVerticesItems[s + 22] = u3; + clippedVerticesItems[s + 23] = v3; + } + else { + clippedVerticesItems[s + 6] = u1; + clippedVerticesItems[s + 7] = v1; + clippedVerticesItems[s + 8] = dark.r; + clippedVerticesItems[s + 9] = dark.g; + clippedVerticesItems[s + 10] = dark.b; + clippedVerticesItems[s + 11] = dark.a; + clippedVerticesItems[s + 12] = x2; + clippedVerticesItems[s + 13] = y2; + clippedVerticesItems[s + 14] = light.r; + clippedVerticesItems[s + 15] = light.g; + clippedVerticesItems[s + 16] = light.b; + clippedVerticesItems[s + 17] = light.a; + clippedVerticesItems[s + 18] = u2; + clippedVerticesItems[s + 19] = v2; + clippedVerticesItems[s + 20] = dark.r; + clippedVerticesItems[s + 21] = dark.g; + clippedVerticesItems[s + 22] = dark.b; + clippedVerticesItems[s + 23] = dark.a; + clippedVerticesItems[s + 24] = x3; + clippedVerticesItems[s + 25] = y3; + clippedVerticesItems[s + 26] = light.r; + clippedVerticesItems[s + 27] = light.g; + clippedVerticesItems[s + 28] = light.b; + clippedVerticesItems[s + 29] = light.a; + clippedVerticesItems[s + 30] = u3; + clippedVerticesItems[s + 31] = v3; + clippedVerticesItems[s + 32] = dark.r; + clippedVerticesItems[s + 33] = dark.g; + clippedVerticesItems[s + 34] = dark.b; + clippedVerticesItems[s + 35] = dark.a; + } + s = clippedTriangles.length; + var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3); + clippedTrianglesItems[s] = index; + clippedTrianglesItems[s + 1] = (index + 1); + clippedTrianglesItems[s + 2] = (index + 2); + index += 3; + continue outer; + } + } + } + }; + SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) { + var originalOutput = output; + var clipped = false; + var input = null; + if (clippingArea.length % 4 >= 2) { + input = output; + output = this.scratch; + } + else + input = this.scratch; + input.length = 0; + input.push(x1); + input.push(y1); + input.push(x2); + input.push(y2); + input.push(x3); + input.push(y3); + input.push(x1); + input.push(y1); + output.length = 0; + var clippingVertices = clippingArea; + var clippingVerticesLast = clippingArea.length - 4; + for (var i = 0;; i += 2) { + var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; + var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3]; + var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2; + var inputVertices = input; + var inputVerticesLength = input.length - 2, outputStart = output.length; + for (var ii = 0; ii < inputVerticesLength; ii += 2) { + var inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; + var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3]; + var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0; + if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) { + if (side2) { + output.push(inputX2); + output.push(inputY2); + continue; + } + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + } + else if (side2) { + var c0 = inputY2 - inputY, c2 = inputX2 - inputX; + var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); + if (Math.abs(s) > 0.000001) { + var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; + output.push(edgeX + (edgeX2 - edgeX) * ua); + output.push(edgeY + (edgeY2 - edgeY) * ua); + } + else { + output.push(edgeX); + output.push(edgeY); + } + output.push(inputX2); + output.push(inputY2); + } + clipped = true; + } + if (outputStart == output.length) { + originalOutput.length = 0; + return true; + } + output.push(output[0]); + output.push(output[1]); + if (i == clippingVerticesLast) + break; + var temp = output; + output = input; + output.length = 0; + input = temp; + } + if (originalOutput != output) { + originalOutput.length = 0; + for (var i = 0, n = output.length - 2; i < n; i++) + originalOutput[i] = output[i]; + } + else + originalOutput.length = originalOutput.length - 2; + return clipped; + }; + SkeletonClipping.makeClockwise = function (polygon) { + var vertices = polygon; + var verticeslength = polygon.length; + var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; + for (var i = 0, n = verticeslength - 3; i < n; i += 2) { + p1x = vertices[i]; + p1y = vertices[i + 1]; + p2x = vertices[i + 2]; + p2y = vertices[i + 3]; + area += p1x * p2y - p2x * p1y; + } + if (area < 0) + return; + for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { + var x = vertices[i], y = vertices[i + 1]; + var other = lastX - i; + vertices[i] = vertices[other]; + vertices[i + 1] = vertices[other + 1]; + vertices[other] = x; + vertices[other + 1] = y; + } + }; + return SkeletonClipping; + }()); + spine.SkeletonClipping = SkeletonClipping; })(spine || (spine = {})); var spine; (function (spine) { - var SkeletonData = (function () { - function SkeletonData() { - this.bones = new Array(); - this.slots = new Array(); - this.skins = new Array(); - this.events = new Array(); - this.animations = new Array(); - this.ikConstraints = new Array(); - this.transformConstraints = new Array(); - this.pathConstraints = new Array(); - this.fps = 0; - } - SkeletonData.prototype.findBone = function (boneName) { - if (boneName == null) - throw new Error("boneName cannot be null."); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (bone.name == boneName) - return bone; - } - return null; - }; - SkeletonData.prototype.findBoneIndex = function (boneName) { - if (boneName == null) - throw new Error("boneName cannot be null."); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) - return i; - return -1; - }; - SkeletonData.prototype.findSlot = function (slotName) { - if (slotName == null) - throw new Error("slotName cannot be null."); - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.name == slotName) - return slot; - } - return null; - }; - SkeletonData.prototype.findSlotIndex = function (slotName) { - if (slotName == null) - throw new Error("slotName cannot be null."); - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].name == slotName) - return i; - return -1; - }; - SkeletonData.prototype.findSkin = function (skinName) { - if (skinName == null) - throw new Error("skinName cannot be null."); - var skins = this.skins; - for (var i = 0, n = skins.length; i < n; i++) { - var skin = skins[i]; - if (skin.name == skinName) - return skin; - } - return null; - }; - SkeletonData.prototype.findEvent = function (eventDataName) { - if (eventDataName == null) - throw new Error("eventDataName cannot be null."); - var events = this.events; - for (var i = 0, n = events.length; i < n; i++) { - var event_4 = events[i]; - if (event_4.name == eventDataName) - return event_4; - } - return null; - }; - SkeletonData.prototype.findAnimation = function (animationName) { - if (animationName == null) - throw new Error("animationName cannot be null."); - var animations = this.animations; - for (var i = 0, n = animations.length; i < n; i++) { - var animation = animations[i]; - if (animation.name == animationName) - return animation; - } - return null; - }; - SkeletonData.prototype.findIkConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var constraint = ikConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - }; - SkeletonData.prototype.findTransformConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var transformConstraints = this.transformConstraints; - for (var i = 0, n = transformConstraints.length; i < n; i++) { - var constraint = transformConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - }; - SkeletonData.prototype.findPathConstraint = function (constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - var pathConstraints = this.pathConstraints; - for (var i = 0, n = pathConstraints.length; i < n; i++) { - var constraint = pathConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - }; - SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) { - if (pathConstraintName == null) - throw new Error("pathConstraintName cannot be null."); - var pathConstraints = this.pathConstraints; - for (var i = 0, n = pathConstraints.length; i < n; i++) - if (pathConstraints[i].name == pathConstraintName) - return i; - return -1; - }; - return SkeletonData; - }()); - spine.SkeletonData = SkeletonData; + var SkeletonData = (function () { + function SkeletonData() { + this.bones = new Array(); + this.slots = new Array(); + this.skins = new Array(); + this.events = new Array(); + this.animations = new Array(); + this.ikConstraints = new Array(); + this.transformConstraints = new Array(); + this.pathConstraints = new Array(); + this.fps = 0; + } + SkeletonData.prototype.findBone = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (bone.name == boneName) + return bone; + } + return null; + }; + SkeletonData.prototype.findBoneIndex = function (boneName) { + if (boneName == null) + throw new Error("boneName cannot be null."); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) + if (bones[i].name == boneName) + return i; + return -1; + }; + SkeletonData.prototype.findSlot = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + if (slot.name == slotName) + return slot; + } + return null; + }; + SkeletonData.prototype.findSlotIndex = function (slotName) { + if (slotName == null) + throw new Error("slotName cannot be null."); + var slots = this.slots; + for (var i = 0, n = slots.length; i < n; i++) + if (slots[i].name == slotName) + return i; + return -1; + }; + SkeletonData.prototype.findSkin = function (skinName) { + if (skinName == null) + throw new Error("skinName cannot be null."); + var skins = this.skins; + for (var i = 0, n = skins.length; i < n; i++) { + var skin = skins[i]; + if (skin.name == skinName) + return skin; + } + return null; + }; + SkeletonData.prototype.findEvent = function (eventDataName) { + if (eventDataName == null) + throw new Error("eventDataName cannot be null."); + var events = this.events; + for (var i = 0, n = events.length; i < n; i++) { + var event_4 = events[i]; + if (event_4.name == eventDataName) + return event_4; + } + return null; + }; + SkeletonData.prototype.findAnimation = function (animationName) { + if (animationName == null) + throw new Error("animationName cannot be null."); + var animations = this.animations; + for (var i = 0, n = animations.length; i < n; i++) { + var animation = animations[i]; + if (animation.name == animationName) + return animation; + } + return null; + }; + SkeletonData.prototype.findIkConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var ikConstraints = this.ikConstraints; + for (var i = 0, n = ikConstraints.length; i < n; i++) { + var constraint = ikConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findTransformConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var transformConstraints = this.transformConstraints; + for (var i = 0, n = transformConstraints.length; i < n; i++) { + var constraint = transformConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraint = function (constraintName) { + if (constraintName == null) + throw new Error("constraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) { + var constraint = pathConstraints[i]; + if (constraint.name == constraintName) + return constraint; + } + return null; + }; + SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) { + if (pathConstraintName == null) + throw new Error("pathConstraintName cannot be null."); + var pathConstraints = this.pathConstraints; + for (var i = 0, n = pathConstraints.length; i < n; i++) + if (pathConstraints[i].name == pathConstraintName) + return i; + return -1; + }; + return SkeletonData; + }()); + spine.SkeletonData = SkeletonData; })(spine || (spine = {})); var spine; (function (spine) { - var SkeletonJson = (function () { - function SkeletonJson(attachmentLoader) { - this.scale = 1; - this.linkedMeshes = new Array(); - this.attachmentLoader = attachmentLoader; - } - SkeletonJson.prototype.readSkeletonData = function (json) { - var scale = this.scale; - var skeletonData = new spine.SkeletonData(); - var root = typeof (json) === "string" ? JSON.parse(json) : json; - var skeletonMap = root.skeleton; - if (skeletonMap != null) { - skeletonData.hash = skeletonMap.hash; - skeletonData.version = skeletonMap.spine; - skeletonData.width = skeletonMap.width; - skeletonData.height = skeletonMap.height; - skeletonData.fps = skeletonMap.fps; - skeletonData.imagesPath = skeletonMap.images; - } - if (root.bones) { - for (var i = 0; i < root.bones.length; i++) { - var boneMap = root.bones[i]; - var parent_2 = null; - var parentName = this.getValue(boneMap, "parent", null); - if (parentName != null) { - parent_2 = skeletonData.findBone(parentName); - if (parent_2 == null) - throw new Error("Parent bone not found: " + parentName); - } - var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2); - data.length = this.getValue(boneMap, "length", 0) * scale; - data.x = this.getValue(boneMap, "x", 0) * scale; - data.y = this.getValue(boneMap, "y", 0) * scale; - data.rotation = this.getValue(boneMap, "rotation", 0); - data.scaleX = this.getValue(boneMap, "scaleX", 1); - data.scaleY = this.getValue(boneMap, "scaleY", 1); - data.shearX = this.getValue(boneMap, "shearX", 0); - data.shearY = this.getValue(boneMap, "shearY", 0); - data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal")); - skeletonData.bones.push(data); - } - } - if (root.slots) { - for (var i = 0; i < root.slots.length; i++) { - var slotMap = root.slots[i]; - var slotName = slotMap.name; - var boneName = slotMap.bone; - var boneData = skeletonData.findBone(boneName); - if (boneData == null) - throw new Error("Slot bone not found: " + boneName); - var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData); - var color = this.getValue(slotMap, "color", null); - if (color != null) - data.color.setFromString(color); - var dark = this.getValue(slotMap, "dark", null); - if (dark != null) { - data.darkColor = new spine.Color(1, 1, 1, 1); - data.darkColor.setFromString(dark); - } - data.attachmentName = this.getValue(slotMap, "attachment", null); - data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, "blend", "normal")); - skeletonData.slots.push(data); - } - } - if (root.ik) { - for (var i = 0; i < root.ik.length; i++) { - var constraintMap = root.ik[i]; - var data = new spine.IkConstraintData(constraintMap.name); - data.order = this.getValue(constraintMap, "order", 0); - for (var j = 0; j < constraintMap.bones.length; j++) { - var boneName = constraintMap.bones[j]; - var bone = skeletonData.findBone(boneName); - if (bone == null) - throw new Error("IK bone not found: " + boneName); - data.bones.push(bone); - } - var targetName = constraintMap.target; - data.target = skeletonData.findBone(targetName); - if (data.target == null) - throw new Error("IK target bone not found: " + targetName); - data.mix = this.getValue(constraintMap, "mix", 1); - data.bendDirection = this.getValue(constraintMap, "bendPositive", true) ? 1 : -1; - data.compress = this.getValue(constraintMap, "compress", false); - data.stretch = this.getValue(constraintMap, "stretch", false); - data.uniform = this.getValue(constraintMap, "uniform", false); - skeletonData.ikConstraints.push(data); - } - } - if (root.transform) { - for (var i = 0; i < root.transform.length; i++) { - var constraintMap = root.transform[i]; - var data = new spine.TransformConstraintData(constraintMap.name); - data.order = this.getValue(constraintMap, "order", 0); - for (var j = 0; j < constraintMap.bones.length; j++) { - var boneName = constraintMap.bones[j]; - var bone = skeletonData.findBone(boneName); - if (bone == null) - throw new Error("Transform constraint bone not found: " + boneName); - data.bones.push(bone); - } - var targetName = constraintMap.target; - data.target = skeletonData.findBone(targetName); - if (data.target == null) - throw new Error("Transform constraint target bone not found: " + targetName); - data.local = this.getValue(constraintMap, "local", false); - data.relative = this.getValue(constraintMap, "relative", false); - data.offsetRotation = this.getValue(constraintMap, "rotation", 0); - data.offsetX = this.getValue(constraintMap, "x", 0) * scale; - data.offsetY = this.getValue(constraintMap, "y", 0) * scale; - data.offsetScaleX = this.getValue(constraintMap, "scaleX", 0); - data.offsetScaleY = this.getValue(constraintMap, "scaleY", 0); - data.offsetShearY = this.getValue(constraintMap, "shearY", 0); - data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); - data.translateMix = this.getValue(constraintMap, "translateMix", 1); - data.scaleMix = this.getValue(constraintMap, "scaleMix", 1); - data.shearMix = this.getValue(constraintMap, "shearMix", 1); - skeletonData.transformConstraints.push(data); - } - } - if (root.path) { - for (var i = 0; i < root.path.length; i++) { - var constraintMap = root.path[i]; - var data = new spine.PathConstraintData(constraintMap.name); - data.order = this.getValue(constraintMap, "order", 0); - for (var j = 0; j < constraintMap.bones.length; j++) { - var boneName = constraintMap.bones[j]; - var bone = skeletonData.findBone(boneName); - if (bone == null) - throw new Error("Transform constraint bone not found: " + boneName); - data.bones.push(bone); - } - var targetName = constraintMap.target; - data.target = skeletonData.findSlot(targetName); - if (data.target == null) - throw new Error("Path target slot not found: " + targetName); - data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, "positionMode", "percent")); - data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, "spacingMode", "length")); - data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, "rotateMode", "tangent")); - data.offsetRotation = this.getValue(constraintMap, "rotation", 0); - data.position = this.getValue(constraintMap, "position", 0); - if (data.positionMode == spine.PositionMode.Fixed) - data.position *= scale; - data.spacing = this.getValue(constraintMap, "spacing", 0); - if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) - data.spacing *= scale; - data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); - data.translateMix = this.getValue(constraintMap, "translateMix", 1); - skeletonData.pathConstraints.push(data); - } - } - if (root.skins) { - for (var skinName in root.skins) { - var skinMap = root.skins[skinName]; - var skin = new spine.Skin(skinName); - for (var slotName in skinMap) { - var slotIndex = skeletonData.findSlotIndex(slotName); - if (slotIndex == -1) - throw new Error("Slot not found: " + slotName); - var slotMap = skinMap[slotName]; - for (var entryName in slotMap) { - var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData); - if (attachment != null) - skin.addAttachment(slotIndex, entryName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") - skeletonData.defaultSkin = skin; - } - } - for (var i = 0, n = this.linkedMeshes.length; i < n; i++) { - var linkedMesh = this.linkedMeshes[i]; - var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); - if (skin == null) - throw new Error("Skin not found: " + linkedMesh.skin); - var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); - if (parent_3 == null) - throw new Error("Parent mesh not found: " + linkedMesh.parent); - linkedMesh.mesh.setParentMesh(parent_3); - linkedMesh.mesh.updateUVs(); - } - this.linkedMeshes.length = 0; - if (root.events) { - for (var eventName in root.events) { - var eventMap = root.events[eventName]; - var data = new spine.EventData(eventName); - data.intValue = this.getValue(eventMap, "int", 0); - data.floatValue = this.getValue(eventMap, "float", 0); - data.stringValue = this.getValue(eventMap, "string", ""); - data.audioPath = this.getValue(eventMap, "audio", null); - if (data.audioPath != null) { - data.volume = this.getValue(eventMap, "volume", 1); - data.balance = this.getValue(eventMap, "balance", 0); - } - skeletonData.events.push(data); - } - } - if (root.animations) { - for (var animationName in root.animations) { - var animationMap = root.animations[animationName]; - this.readAnimation(animationMap, animationName, skeletonData); - } - } - return skeletonData; - }; - SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) { - var scale = this.scale; - name = this.getValue(map, "name", name); - var type = this.getValue(map, "type", "region"); - switch (type) { - case "region": { - var path = this.getValue(map, "path", name); - var region = this.attachmentLoader.newRegionAttachment(skin, name, path); - if (region == null) - return null; - region.path = path; - region.x = this.getValue(map, "x", 0) * scale; - region.y = this.getValue(map, "y", 0) * scale; - region.scaleX = this.getValue(map, "scaleX", 1); - region.scaleY = this.getValue(map, "scaleY", 1); - region.rotation = this.getValue(map, "rotation", 0); - region.width = map.width * scale; - region.height = map.height * scale; - var color = this.getValue(map, "color", null); - if (color != null) - region.color.setFromString(color); - region.updateOffset(); - return region; - } - case "boundingbox": { - var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - if (box == null) - return null; - this.readVertices(map, box, map.vertexCount << 1); - var color = this.getValue(map, "color", null); - if (color != null) - box.color.setFromString(color); - return box; - } - case "mesh": - case "linkedmesh": { - var path = this.getValue(map, "path", name); - var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); - if (mesh == null) - return null; - mesh.path = path; - var color = this.getValue(map, "color", null); - if (color != null) - mesh.color.setFromString(color); - var parent_4 = this.getValue(map, "parent", null); - if (parent_4 != null) { - mesh.inheritDeform = this.getValue(map, "deform", true); - this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, "skin", null), slotIndex, parent_4)); - return mesh; - } - var uvs = map.uvs; - this.readVertices(map, mesh, uvs.length); - mesh.triangles = map.triangles; - mesh.regionUVs = uvs; - mesh.updateUVs(); - mesh.hullLength = this.getValue(map, "hull", 0) * 2; - return mesh; - } - case "path": { - var path = this.attachmentLoader.newPathAttachment(skin, name); - if (path == null) - return null; - path.closed = this.getValue(map, "closed", false); - path.constantSpeed = this.getValue(map, "constantSpeed", true); - var vertexCount = map.vertexCount; - this.readVertices(map, path, vertexCount << 1); - var lengths = spine.Utils.newArray(vertexCount / 3, 0); - for (var i = 0; i < map.lengths.length; i++) - lengths[i] = map.lengths[i] * scale; - path.lengths = lengths; - var color = this.getValue(map, "color", null); - if (color != null) - path.color.setFromString(color); - return path; - } - case "point": { - var point = this.attachmentLoader.newPointAttachment(skin, name); - if (point == null) - return null; - point.x = this.getValue(map, "x", 0) * scale; - point.y = this.getValue(map, "y", 0) * scale; - point.rotation = this.getValue(map, "rotation", 0); - var color = this.getValue(map, "color", null); - if (color != null) - point.color.setFromString(color); - return point; - } - case "clipping": { - var clip = this.attachmentLoader.newClippingAttachment(skin, name); - if (clip == null) - return null; - var end = this.getValue(map, "end", null); - if (end != null) { - var slot = skeletonData.findSlot(end); - if (slot == null) - throw new Error("Clipping end slot not found: " + end); - clip.endSlot = slot; - } - var vertexCount = map.vertexCount; - this.readVertices(map, clip, vertexCount << 1); - var color = this.getValue(map, "color", null); - if (color != null) - clip.color.setFromString(color); - return clip; - } - } - return null; - }; - SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) { - var scale = this.scale; - attachment.worldVerticesLength = verticesLength; - var vertices = map.vertices; - if (verticesLength == vertices.length) { - var scaledVertices = spine.Utils.toFloatArray(vertices); - if (scale != 1) { - for (var i = 0, n = vertices.length; i < n; i++) - scaledVertices[i] *= scale; - } - attachment.vertices = scaledVertices; - return; - } - var weights = new Array(); - var bones = new Array(); - for (var i = 0, n = vertices.length; i < n;) { - var boneCount = vertices[i++]; - bones.push(boneCount); - for (var nn = i + boneCount * 4; i < nn; i += 4) { - bones.push(vertices[i]); - weights.push(vertices[i + 1] * scale); - weights.push(vertices[i + 2] * scale); - weights.push(vertices[i + 3]); - } - } - attachment.bones = bones; - attachment.vertices = spine.Utils.toFloatArray(weights); - }; - SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) { - var scale = this.scale; - var timelines = new Array(); - var duration = 0; - if (map.slots) { - for (var slotName in map.slots) { - var slotMap = map.slots[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - if (slotIndex == -1) - throw new Error("Slot not found: " + slotName); - for (var timelineName in slotMap) { - var timelineMap = slotMap[timelineName]; - if (timelineName == "attachment") { - var timeline = new spine.AttachmentTimeline(timelineMap.length); - timeline.slotIndex = slotIndex; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - timeline.setFrame(frameIndex++, valueMap.time, valueMap.name); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - else if (timelineName == "color") { - var timeline = new spine.ColorTimeline(timelineMap.length); - timeline.slotIndex = slotIndex; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - var color = new spine.Color(); - color.setFromString(valueMap.color); - timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]); - } - else if (timelineName == "twoColor") { - var timeline = new spine.TwoColorTimeline(timelineMap.length); - timeline.slotIndex = slotIndex; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - var light = new spine.Color(); - var dark = new spine.Color(); - light.setFromString(valueMap.light); - dark.setFromString(valueMap.dark); - timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]); - } - else - throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"); - } - } - } - if (map.bones) { - for (var boneName in map.bones) { - var boneMap = map.bones[boneName]; - var boneIndex = skeletonData.findBoneIndex(boneName); - if (boneIndex == -1) - throw new Error("Bone not found: " + boneName); - for (var timelineName in boneMap) { - var timelineMap = boneMap[timelineName]; - if (timelineName === "rotate") { - var timeline = new spine.RotateTimeline(timelineMap.length); - timeline.boneIndex = boneIndex; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - timeline.setFrame(frameIndex, valueMap.time, valueMap.angle); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]); - } - else if (timelineName === "translate" || timelineName === "scale" || timelineName === "shear") { - var timeline = null; - var timelineScale = 1; - if (timelineName === "scale") - timeline = new spine.ScaleTimeline(timelineMap.length); - else if (timelineName === "shear") - timeline = new spine.ShearTimeline(timelineMap.length); - else { - timeline = new spine.TranslateTimeline(timelineMap.length); - timelineScale = scale; - } - timeline.boneIndex = boneIndex; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - var x = this.getValue(valueMap, "x", 0), y = this.getValue(valueMap, "y", 0); - timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]); - } - else - throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"); - } - } - } - if (map.ik) { - for (var constraintName in map.ik) { - var constraintMap = map.ik[constraintName]; - var constraint = skeletonData.findIkConstraint(constraintName); - var timeline = new spine.IkConstraintTimeline(constraintMap.length); - timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint); - var frameIndex = 0; - for (var i = 0; i < constraintMap.length; i++) { - var valueMap = constraintMap[i]; - timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "mix", 1), this.getValue(valueMap, "bendPositive", true) ? 1 : -1, this.getValue(valueMap, "compress", false), this.getValue(valueMap, "stretch", false)); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]); - } - } - if (map.transform) { - for (var constraintName in map.transform) { - var constraintMap = map.transform[constraintName]; - var constraint = skeletonData.findTransformConstraint(constraintName); - var timeline = new spine.TransformConstraintTimeline(constraintMap.length); - timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint); - var frameIndex = 0; - for (var i = 0; i < constraintMap.length; i++) { - var valueMap = constraintMap[i]; - timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1), this.getValue(valueMap, "scaleMix", 1), this.getValue(valueMap, "shearMix", 1)); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]); - } - } - if (map.paths) { - for (var constraintName in map.paths) { - var constraintMap = map.paths[constraintName]; - var index = skeletonData.findPathConstraintIndex(constraintName); - if (index == -1) - throw new Error("Path constraint not found: " + constraintName); - var data = skeletonData.pathConstraints[index]; - for (var timelineName in constraintMap) { - var timelineMap = constraintMap[timelineName]; - if (timelineName === "position" || timelineName === "spacing") { - var timeline = null; - var timelineScale = 1; - if (timelineName === "spacing") { - timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length); - if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) - timelineScale = scale; - } - else { - timeline = new spine.PathConstraintPositionTimeline(timelineMap.length); - if (data.positionMode == spine.PositionMode.Fixed) - timelineScale = scale; - } - timeline.pathConstraintIndex = index; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]); - } - else if (timelineName === "mix") { - var timeline = new spine.PathConstraintMixTimeline(timelineMap.length); - timeline.pathConstraintIndex = index; - var frameIndex = 0; - for (var i = 0; i < timelineMap.length; i++) { - var valueMap = timelineMap[i]; - timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1)); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]); - } - } - } - } - if (map.deform) { - for (var deformName in map.deform) { - var deformMap = map.deform[deformName]; - var skin = skeletonData.findSkin(deformName); - if (skin == null) - throw new Error("Skin not found: " + deformName); - for (var slotName in deformMap) { - var slotMap = deformMap[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - if (slotIndex == -1) - throw new Error("Slot not found: " + slotMap.name); - for (var timelineName in slotMap) { - var timelineMap = slotMap[timelineName]; - var attachment = skin.getAttachment(slotIndex, timelineName); - if (attachment == null) - throw new Error("Deform attachment not found: " + timelineMap.name); - var weighted = attachment.bones != null; - var vertices = attachment.vertices; - var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; - var timeline = new spine.DeformTimeline(timelineMap.length); - timeline.slotIndex = slotIndex; - timeline.attachment = attachment; - var frameIndex = 0; - for (var j = 0; j < timelineMap.length; j++) { - var valueMap = timelineMap[j]; - var deform = void 0; - var verticesValue = this.getValue(valueMap, "vertices", null); - if (verticesValue == null) - deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices; - else { - deform = spine.Utils.newFloatArray(deformLength); - var start = this.getValue(valueMap, "offset", 0); - spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); - if (scale != 1) { - for (var i = start, n = i + verticesValue.length; i < n; i++) - deform[i] *= scale; - } - if (!weighted) { - for (var i = 0; i < deformLength; i++) - deform[i] += vertices[i]; - } - } - timeline.setFrame(frameIndex, valueMap.time, deform); - this.readCurve(valueMap, timeline, frameIndex); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - } - } - } - var drawOrderNode = map.drawOrder; - if (drawOrderNode == null) - drawOrderNode = map.draworder; - if (drawOrderNode != null) { - var timeline = new spine.DrawOrderTimeline(drawOrderNode.length); - var slotCount = skeletonData.slots.length; - var frameIndex = 0; - for (var j = 0; j < drawOrderNode.length; j++) { - var drawOrderMap = drawOrderNode[j]; - var drawOrder = null; - var offsets = this.getValue(drawOrderMap, "offsets", null); - if (offsets != null) { - drawOrder = spine.Utils.newArray(slotCount, -1); - var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0); - var originalIndex = 0, unchangedIndex = 0; - for (var i = 0; i < offsets.length; i++) { - var offsetMap = offsets[i]; - var slotIndex = skeletonData.findSlotIndex(offsetMap.slot); - if (slotIndex == -1) - throw new Error("Slot not found: " + offsetMap.slot); - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - drawOrder[originalIndex + offsetMap.offset] = originalIndex++; - } - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - for (var i = slotCount - 1; i >= 0; i--) - if (drawOrder[i] == -1) - drawOrder[i] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - if (map.events) { - var timeline = new spine.EventTimeline(map.events.length); - var frameIndex = 0; - for (var i = 0; i < map.events.length; i++) { - var eventMap = map.events[i]; - var eventData = skeletonData.findEvent(eventMap.name); - if (eventData == null) - throw new Error("Event not found: " + eventMap.name); - var event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData); - event_5.intValue = this.getValue(eventMap, "int", eventData.intValue); - event_5.floatValue = this.getValue(eventMap, "float", eventData.floatValue); - event_5.stringValue = this.getValue(eventMap, "string", eventData.stringValue); - if (event_5.data.audioPath != null) { - event_5.volume = this.getValue(eventMap, "volume", 1); - event_5.balance = this.getValue(eventMap, "balance", 0); - } - timeline.setFrame(frameIndex++, event_5); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - if (isNaN(duration)) { - throw new Error("Error while parsing animation, duration is NaN"); - } - skeletonData.animations.push(new spine.Animation(name, timelines, duration)); - }; - SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) { - if (!map.curve) - return; - if (map.curve === "stepped") - timeline.setStepped(frameIndex); - else if (Object.prototype.toString.call(map.curve) === '[object Array]') { - var curve = map.curve; - timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); - } - }; - SkeletonJson.prototype.getValue = function (map, prop, defaultValue) { - return map[prop] !== undefined ? map[prop] : defaultValue; - }; - SkeletonJson.blendModeFromString = function (str) { - str = str.toLowerCase(); - if (str == "normal") - return spine.BlendMode.Normal; - if (str == "additive") - return spine.BlendMode.Additive; - if (str == "multiply") - return spine.BlendMode.Multiply; - if (str == "screen") - return spine.BlendMode.Screen; - throw new Error("Unknown blend mode: " + str); - }; - SkeletonJson.positionModeFromString = function (str) { - str = str.toLowerCase(); - if (str == "fixed") - return spine.PositionMode.Fixed; - if (str == "percent") - return spine.PositionMode.Percent; - throw new Error("Unknown position mode: " + str); - }; - SkeletonJson.spacingModeFromString = function (str) { - str = str.toLowerCase(); - if (str == "length") - return spine.SpacingMode.Length; - if (str == "fixed") - return spine.SpacingMode.Fixed; - if (str == "percent") - return spine.SpacingMode.Percent; - throw new Error("Unknown position mode: " + str); - }; - SkeletonJson.rotateModeFromString = function (str) { - str = str.toLowerCase(); - if (str == "tangent") - return spine.RotateMode.Tangent; - if (str == "chain") - return spine.RotateMode.Chain; - if (str == "chainscale") - return spine.RotateMode.ChainScale; - throw new Error("Unknown rotate mode: " + str); - }; - SkeletonJson.transformModeFromString = function (str) { - str = str.toLowerCase(); - if (str == "normal") - return spine.TransformMode.Normal; - if (str == "onlytranslation") - return spine.TransformMode.OnlyTranslation; - if (str == "norotationorreflection") - return spine.TransformMode.NoRotationOrReflection; - if (str == "noscale") - return spine.TransformMode.NoScale; - if (str == "noscaleorreflection") - return spine.TransformMode.NoScaleOrReflection; - throw new Error("Unknown transform mode: " + str); - }; - return SkeletonJson; - }()); - spine.SkeletonJson = SkeletonJson; - var LinkedMesh = (function () { - function LinkedMesh(mesh, skin, slotIndex, parent) { - this.mesh = mesh; - this.skin = skin; - this.slotIndex = slotIndex; - this.parent = parent; - } - return LinkedMesh; - }()); + var SkeletonJson = (function () { + function SkeletonJson(attachmentLoader) { + this.scale = 1; + this.linkedMeshes = new Array(); + this.attachmentLoader = attachmentLoader; + } + SkeletonJson.prototype.readSkeletonData = function (json) { + var scale = this.scale; + var skeletonData = new spine.SkeletonData(); + var root = typeof (json) === "string" ? JSON.parse(json) : json; + var skeletonMap = root.skeleton; + if (skeletonMap != null) { + skeletonData.hash = skeletonMap.hash; + skeletonData.version = skeletonMap.spine; + skeletonData.width = skeletonMap.width; + skeletonData.height = skeletonMap.height; + skeletonData.fps = skeletonMap.fps; + skeletonData.imagesPath = skeletonMap.images; + } + if (root.bones) { + for (var i = 0; i < root.bones.length; i++) { + var boneMap = root.bones[i]; + var parent_2 = null; + var parentName = this.getValue(boneMap, "parent", null); + if (parentName != null) { + parent_2 = skeletonData.findBone(parentName); + if (parent_2 == null) + throw new Error("Parent bone not found: " + parentName); + } + var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2); + data.length = this.getValue(boneMap, "length", 0) * scale; + data.x = this.getValue(boneMap, "x", 0) * scale; + data.y = this.getValue(boneMap, "y", 0) * scale; + data.rotation = this.getValue(boneMap, "rotation", 0); + data.scaleX = this.getValue(boneMap, "scaleX", 1); + data.scaleY = this.getValue(boneMap, "scaleY", 1); + data.shearX = this.getValue(boneMap, "shearX", 0); + data.shearY = this.getValue(boneMap, "shearY", 0); + data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal")); + skeletonData.bones.push(data); + } + } + if (root.slots) { + for (var i = 0; i < root.slots.length; i++) { + var slotMap = root.slots[i]; + var slotName = slotMap.name; + var boneName = slotMap.bone; + var boneData = skeletonData.findBone(boneName); + if (boneData == null) + throw new Error("Slot bone not found: " + boneName); + var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData); + var color = this.getValue(slotMap, "color", null); + if (color != null) + data.color.setFromString(color); + var dark = this.getValue(slotMap, "dark", null); + if (dark != null) { + data.darkColor = new spine.Color(1, 1, 1, 1); + data.darkColor.setFromString(dark); + } + data.attachmentName = this.getValue(slotMap, "attachment", null); + data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, "blend", "normal")); + skeletonData.slots.push(data); + } + } + if (root.ik) { + for (var i = 0; i < root.ik.length; i++) { + var constraintMap = root.ik[i]; + var data = new spine.IkConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("IK bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("IK target bone not found: " + targetName); + data.mix = this.getValue(constraintMap, "mix", 1); + data.bendDirection = this.getValue(constraintMap, "bendPositive", true) ? 1 : -1; + data.compress = this.getValue(constraintMap, "compress", false); + data.stretch = this.getValue(constraintMap, "stretch", false); + data.uniform = this.getValue(constraintMap, "uniform", false); + skeletonData.ikConstraints.push(data); + } + } + if (root.transform) { + for (var i = 0; i < root.transform.length; i++) { + var constraintMap = root.transform[i]; + var data = new spine.TransformConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findBone(targetName); + if (data.target == null) + throw new Error("Transform constraint target bone not found: " + targetName); + data.local = this.getValue(constraintMap, "local", false); + data.relative = this.getValue(constraintMap, "relative", false); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.offsetX = this.getValue(constraintMap, "x", 0) * scale; + data.offsetY = this.getValue(constraintMap, "y", 0) * scale; + data.offsetScaleX = this.getValue(constraintMap, "scaleX", 0); + data.offsetScaleY = this.getValue(constraintMap, "scaleY", 0); + data.offsetShearY = this.getValue(constraintMap, "shearY", 0); + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + data.scaleMix = this.getValue(constraintMap, "scaleMix", 1); + data.shearMix = this.getValue(constraintMap, "shearMix", 1); + skeletonData.transformConstraints.push(data); + } + } + if (root.path) { + for (var i = 0; i < root.path.length; i++) { + var constraintMap = root.path[i]; + var data = new spine.PathConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); + for (var j = 0; j < constraintMap.bones.length; j++) { + var boneName = constraintMap.bones[j]; + var bone = skeletonData.findBone(boneName); + if (bone == null) + throw new Error("Transform constraint bone not found: " + boneName); + data.bones.push(bone); + } + var targetName = constraintMap.target; + data.target = skeletonData.findSlot(targetName); + if (data.target == null) + throw new Error("Path target slot not found: " + targetName); + data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, "positionMode", "percent")); + data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, "spacingMode", "length")); + data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, "rotateMode", "tangent")); + data.offsetRotation = this.getValue(constraintMap, "rotation", 0); + data.position = this.getValue(constraintMap, "position", 0); + if (data.positionMode == spine.PositionMode.Fixed) + data.position *= scale; + data.spacing = this.getValue(constraintMap, "spacing", 0); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + data.spacing *= scale; + data.rotateMix = this.getValue(constraintMap, "rotateMix", 1); + data.translateMix = this.getValue(constraintMap, "translateMix", 1); + skeletonData.pathConstraints.push(data); + } + } + if (root.skins) { + for (var skinName in root.skins) { + var skinMap = root.skins[skinName]; + var skin = new spine.Skin(skinName); + for (var slotName in skinMap) { + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + var slotMap = skinMap[slotName]; + for (var entryName in slotMap) { + var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData); + if (attachment != null) + skin.addAttachment(slotIndex, entryName, attachment); + } + } + skeletonData.skins.push(skin); + if (skin.name == "default") + skeletonData.defaultSkin = skin; + } + } + for (var i = 0, n = this.linkedMeshes.length; i < n; i++) { + var linkedMesh = this.linkedMeshes[i]; + var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); + if (skin == null) + throw new Error("Skin not found: " + linkedMesh.skin); + var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); + if (parent_3 == null) + throw new Error("Parent mesh not found: " + linkedMesh.parent); + linkedMesh.mesh.setParentMesh(parent_3); + linkedMesh.mesh.updateUVs(); + } + this.linkedMeshes.length = 0; + if (root.events) { + for (var eventName in root.events) { + var eventMap = root.events[eventName]; + var data = new spine.EventData(eventName); + data.intValue = this.getValue(eventMap, "int", 0); + data.floatValue = this.getValue(eventMap, "float", 0); + data.stringValue = this.getValue(eventMap, "string", ""); + data.audioPath = this.getValue(eventMap, "audio", null); + if (data.audioPath != null) { + data.volume = this.getValue(eventMap, "volume", 1); + data.balance = this.getValue(eventMap, "balance", 0); + } + skeletonData.events.push(data); + } + } + if (root.animations) { + for (var animationName in root.animations) { + var animationMap = root.animations[animationName]; + this.readAnimation(animationMap, animationName, skeletonData); + } + } + return skeletonData; + }; + SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) { + var scale = this.scale; + name = this.getValue(map, "name", name); + var type = this.getValue(map, "type", "region"); + switch (type) { + case "region": { + var path = this.getValue(map, "path", name); + var region = this.attachmentLoader.newRegionAttachment(skin, name, path); + if (region == null) + return null; + region.path = path; + region.x = this.getValue(map, "x", 0) * scale; + region.y = this.getValue(map, "y", 0) * scale; + region.scaleX = this.getValue(map, "scaleX", 1); + region.scaleY = this.getValue(map, "scaleY", 1); + region.rotation = this.getValue(map, "rotation", 0); + region.width = map.width * scale; + region.height = map.height * scale; + var color = this.getValue(map, "color", null); + if (color != null) + region.color.setFromString(color); + region.updateOffset(); + return region; + } + case "boundingbox": { + var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); + if (box == null) + return null; + this.readVertices(map, box, map.vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + box.color.setFromString(color); + return box; + } + case "mesh": + case "linkedmesh": { + var path = this.getValue(map, "path", name); + var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); + if (mesh == null) + return null; + mesh.path = path; + var color = this.getValue(map, "color", null); + if (color != null) + mesh.color.setFromString(color); + var parent_4 = this.getValue(map, "parent", null); + if (parent_4 != null) { + mesh.inheritDeform = this.getValue(map, "deform", true); + this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, "skin", null), slotIndex, parent_4)); + return mesh; + } + var uvs = map.uvs; + this.readVertices(map, mesh, uvs.length); + mesh.triangles = map.triangles; + mesh.regionUVs = uvs; + mesh.updateUVs(); + mesh.hullLength = this.getValue(map, "hull", 0) * 2; + return mesh; + } + case "path": { + var path = this.attachmentLoader.newPathAttachment(skin, name); + if (path == null) + return null; + path.closed = this.getValue(map, "closed", false); + path.constantSpeed = this.getValue(map, "constantSpeed", true); + var vertexCount = map.vertexCount; + this.readVertices(map, path, vertexCount << 1); + var lengths = spine.Utils.newArray(vertexCount / 3, 0); + for (var i = 0; i < map.lengths.length; i++) + lengths[i] = map.lengths[i] * scale; + path.lengths = lengths; + var color = this.getValue(map, "color", null); + if (color != null) + path.color.setFromString(color); + return path; + } + case "point": { + var point = this.attachmentLoader.newPointAttachment(skin, name); + if (point == null) + return null; + point.x = this.getValue(map, "x", 0) * scale; + point.y = this.getValue(map, "y", 0) * scale; + point.rotation = this.getValue(map, "rotation", 0); + var color = this.getValue(map, "color", null); + if (color != null) + point.color.setFromString(color); + return point; + } + case "clipping": { + var clip = this.attachmentLoader.newClippingAttachment(skin, name); + if (clip == null) + return null; + var end = this.getValue(map, "end", null); + if (end != null) { + var slot = skeletonData.findSlot(end); + if (slot == null) + throw new Error("Clipping end slot not found: " + end); + clip.endSlot = slot; + } + var vertexCount = map.vertexCount; + this.readVertices(map, clip, vertexCount << 1); + var color = this.getValue(map, "color", null); + if (color != null) + clip.color.setFromString(color); + return clip; + } + } + return null; + }; + SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) { + var scale = this.scale; + attachment.worldVerticesLength = verticesLength; + var vertices = map.vertices; + if (verticesLength == vertices.length) { + var scaledVertices = spine.Utils.toFloatArray(vertices); + if (scale != 1) { + for (var i = 0, n = vertices.length; i < n; i++) + scaledVertices[i] *= scale; + } + attachment.vertices = scaledVertices; + return; + } + var weights = new Array(); + var bones = new Array(); + for (var i = 0, n = vertices.length; i < n;) { + var boneCount = vertices[i++]; + bones.push(boneCount); + for (var nn = i + boneCount * 4; i < nn; i += 4) { + bones.push(vertices[i]); + weights.push(vertices[i + 1] * scale); + weights.push(vertices[i + 2] * scale); + weights.push(vertices[i + 3]); + } + } + attachment.bones = bones; + attachment.vertices = spine.Utils.toFloatArray(weights); + }; + SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) { + var scale = this.scale; + var timelines = new Array(); + var duration = 0; + if (map.slots) { + for (var slotName in map.slots) { + var slotMap = map.slots[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotName); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + if (timelineName == "attachment") { + var timeline = new spine.AttachmentTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex++, valueMap.time, valueMap.name); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + else if (timelineName == "color") { + var timeline = new spine.ColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var color = new spine.Color(); + color.setFromString(valueMap.color); + timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]); + } + else if (timelineName == "twoColor") { + var timeline = new spine.TwoColorTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var light = new spine.Color(); + var dark = new spine.Color(); + light.setFromString(valueMap.light); + dark.setFromString(valueMap.dark); + timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"); + } + } + } + if (map.bones) { + for (var boneName in map.bones) { + var boneMap = map.bones[boneName]; + var boneIndex = skeletonData.findBoneIndex(boneName); + if (boneIndex == -1) + throw new Error("Bone not found: " + boneName); + for (var timelineName in boneMap) { + var timelineMap = boneMap[timelineName]; + if (timelineName === "rotate") { + var timeline = new spine.RotateTimeline(timelineMap.length); + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, valueMap.angle); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]); + } + else if (timelineName === "translate" || timelineName === "scale" || timelineName === "shear") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "scale") + timeline = new spine.ScaleTimeline(timelineMap.length); + else if (timelineName === "shear") + timeline = new spine.ShearTimeline(timelineMap.length); + else { + timeline = new spine.TranslateTimeline(timelineMap.length); + timelineScale = scale; + } + timeline.boneIndex = boneIndex; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + var x = this.getValue(valueMap, "x", 0), y = this.getValue(valueMap, "y", 0); + timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]); + } + else + throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"); + } + } + } + if (map.ik) { + for (var constraintName in map.ik) { + var constraintMap = map.ik[constraintName]; + var constraint = skeletonData.findIkConstraint(constraintName); + var timeline = new spine.IkConstraintTimeline(constraintMap.length); + timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "mix", 1), this.getValue(valueMap, "bendPositive", true) ? 1 : -1, this.getValue(valueMap, "compress", false), this.getValue(valueMap, "stretch", false)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]); + } + } + if (map.transform) { + for (var constraintName in map.transform) { + var constraintMap = map.transform[constraintName]; + var constraint = skeletonData.findTransformConstraint(constraintName); + var timeline = new spine.TransformConstraintTimeline(constraintMap.length); + timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint); + var frameIndex = 0; + for (var i = 0; i < constraintMap.length; i++) { + var valueMap = constraintMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1), this.getValue(valueMap, "scaleMix", 1), this.getValue(valueMap, "shearMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]); + } + } + if (map.paths) { + for (var constraintName in map.paths) { + var constraintMap = map.paths[constraintName]; + var index = skeletonData.findPathConstraintIndex(constraintName); + if (index == -1) + throw new Error("Path constraint not found: " + constraintName); + var data = skeletonData.pathConstraints[index]; + for (var timelineName in constraintMap) { + var timelineMap = constraintMap[timelineName]; + if (timelineName === "position" || timelineName === "spacing") { + var timeline = null; + var timelineScale = 1; + if (timelineName === "spacing") { + timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length); + if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed) + timelineScale = scale; + } + else { + timeline = new spine.PathConstraintPositionTimeline(timelineMap.length); + if (data.positionMode == spine.PositionMode.Fixed) + timelineScale = scale; + } + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]); + } + else if (timelineName === "mix") { + var timeline = new spine.PathConstraintMixTimeline(timelineMap.length); + timeline.pathConstraintIndex = index; + var frameIndex = 0; + for (var i = 0; i < timelineMap.length; i++) { + var valueMap = timelineMap[i]; + timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1)); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]); + } + } + } + } + if (map.deform) { + for (var deformName in map.deform) { + var deformMap = map.deform[deformName]; + var skin = skeletonData.findSkin(deformName); + if (skin == null) + throw new Error("Skin not found: " + deformName); + for (var slotName in deformMap) { + var slotMap = deformMap[slotName]; + var slotIndex = skeletonData.findSlotIndex(slotName); + if (slotIndex == -1) + throw new Error("Slot not found: " + slotMap.name); + for (var timelineName in slotMap) { + var timelineMap = slotMap[timelineName]; + var attachment = skin.getAttachment(slotIndex, timelineName); + if (attachment == null) + throw new Error("Deform attachment not found: " + timelineMap.name); + var weighted = attachment.bones != null; + var vertices = attachment.vertices; + var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; + var timeline = new spine.DeformTimeline(timelineMap.length); + timeline.slotIndex = slotIndex; + timeline.attachment = attachment; + var frameIndex = 0; + for (var j = 0; j < timelineMap.length; j++) { + var valueMap = timelineMap[j]; + var deform = void 0; + var verticesValue = this.getValue(valueMap, "vertices", null); + if (verticesValue == null) + deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices; + else { + deform = spine.Utils.newFloatArray(deformLength); + var start = this.getValue(valueMap, "offset", 0); + spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); + if (scale != 1) { + for (var i = start, n = i + verticesValue.length; i < n; i++) + deform[i] *= scale; + } + if (!weighted) { + for (var i = 0; i < deformLength; i++) + deform[i] += vertices[i]; + } + } + timeline.setFrame(frameIndex, valueMap.time, deform); + this.readCurve(valueMap, timeline, frameIndex); + frameIndex++; + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + } + } + } + var drawOrderNode = map.drawOrder; + if (drawOrderNode == null) + drawOrderNode = map.draworder; + if (drawOrderNode != null) { + var timeline = new spine.DrawOrderTimeline(drawOrderNode.length); + var slotCount = skeletonData.slots.length; + var frameIndex = 0; + for (var j = 0; j < drawOrderNode.length; j++) { + var drawOrderMap = drawOrderNode[j]; + var drawOrder = null; + var offsets = this.getValue(drawOrderMap, "offsets", null); + if (offsets != null) { + drawOrder = spine.Utils.newArray(slotCount, -1); + var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0); + var originalIndex = 0, unchangedIndex = 0; + for (var i = 0; i < offsets.length; i++) { + var offsetMap = offsets[i]; + var slotIndex = skeletonData.findSlotIndex(offsetMap.slot); + if (slotIndex == -1) + throw new Error("Slot not found: " + offsetMap.slot); + while (originalIndex != slotIndex) + unchanged[unchangedIndex++] = originalIndex++; + drawOrder[originalIndex + offsetMap.offset] = originalIndex++; + } + while (originalIndex < slotCount) + unchanged[unchangedIndex++] = originalIndex++; + for (var i = slotCount - 1; i >= 0; i--) + if (drawOrder[i] == -1) + drawOrder[i] = unchanged[--unchangedIndex]; + } + timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (map.events) { + var timeline = new spine.EventTimeline(map.events.length); + var frameIndex = 0; + for (var i = 0; i < map.events.length; i++) { + var eventMap = map.events[i]; + var eventData = skeletonData.findEvent(eventMap.name); + if (eventData == null) + throw new Error("Event not found: " + eventMap.name); + var event_5 = new spine.Event(spine.Utils.toSinglePrecision(eventMap.time), eventData); + event_5.intValue = this.getValue(eventMap, "int", eventData.intValue); + event_5.floatValue = this.getValue(eventMap, "float", eventData.floatValue); + event_5.stringValue = this.getValue(eventMap, "string", eventData.stringValue); + if (event_5.data.audioPath != null) { + event_5.volume = this.getValue(eventMap, "volume", 1); + event_5.balance = this.getValue(eventMap, "balance", 0); + } + timeline.setFrame(frameIndex++, event_5); + } + timelines.push(timeline); + duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); + } + if (isNaN(duration)) { + throw new Error("Error while parsing animation, duration is NaN"); + } + skeletonData.animations.push(new spine.Animation(name, timelines, duration)); + }; + SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) { + if (!map.curve) + return; + if (map.curve === "stepped") + timeline.setStepped(frameIndex); + else if (Object.prototype.toString.call(map.curve) === '[object Array]') { + var curve = map.curve; + timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); + } + }; + SkeletonJson.prototype.getValue = function (map, prop, defaultValue) { + return map[prop] !== undefined ? map[prop] : defaultValue; + }; + SkeletonJson.blendModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.BlendMode.Normal; + if (str == "additive") + return spine.BlendMode.Additive; + if (str == "multiply") + return spine.BlendMode.Multiply; + if (str == "screen") + return spine.BlendMode.Screen; + throw new Error("Unknown blend mode: " + str); + }; + SkeletonJson.positionModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "fixed") + return spine.PositionMode.Fixed; + if (str == "percent") + return spine.PositionMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.spacingModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "length") + return spine.SpacingMode.Length; + if (str == "fixed") + return spine.SpacingMode.Fixed; + if (str == "percent") + return spine.SpacingMode.Percent; + throw new Error("Unknown position mode: " + str); + }; + SkeletonJson.rotateModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "tangent") + return spine.RotateMode.Tangent; + if (str == "chain") + return spine.RotateMode.Chain; + if (str == "chainscale") + return spine.RotateMode.ChainScale; + throw new Error("Unknown rotate mode: " + str); + }; + SkeletonJson.transformModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return spine.TransformMode.Normal; + if (str == "onlytranslation") + return spine.TransformMode.OnlyTranslation; + if (str == "norotationorreflection") + return spine.TransformMode.NoRotationOrReflection; + if (str == "noscale") + return spine.TransformMode.NoScale; + if (str == "noscaleorreflection") + return spine.TransformMode.NoScaleOrReflection; + throw new Error("Unknown transform mode: " + str); + }; + return SkeletonJson; + }()); + spine.SkeletonJson = SkeletonJson; + var LinkedMesh = (function () { + function LinkedMesh(mesh, skin, slotIndex, parent) { + this.mesh = mesh; + this.skin = skin; + this.slotIndex = slotIndex; + this.parent = parent; + } + return LinkedMesh; + }()); })(spine || (spine = {})); var spine; (function (spine) { - var Skin = (function () { - function Skin(name) { - this.attachments = new Array(); - if (name == null) - throw new Error("name cannot be null."); - this.name = name; - } - Skin.prototype.addAttachment = function (slotIndex, name, attachment) { - if (attachment == null) - throw new Error("attachment cannot be null."); - var attachments = this.attachments; - if (slotIndex >= attachments.length) - attachments.length = slotIndex + 1; - if (!attachments[slotIndex]) - attachments[slotIndex] = {}; - attachments[slotIndex][name] = attachment; - }; - Skin.prototype.getAttachment = function (slotIndex, name) { - var dictionary = this.attachments[slotIndex]; - return dictionary ? dictionary[name] : null; - }; - Skin.prototype.attachAll = function (skeleton, oldSkin) { - var slotIndex = 0; - for (var i = 0; i < skeleton.slots.length; i++) { - var slot = skeleton.slots[i]; - var slotAttachment = slot.getAttachment(); - if (slotAttachment && slotIndex < oldSkin.attachments.length) { - var dictionary = oldSkin.attachments[slotIndex]; - for (var key in dictionary) { - var skinAttachment = dictionary[key]; - if (slotAttachment == skinAttachment) { - var attachment = this.getAttachment(slotIndex, key); - if (attachment != null) - slot.setAttachment(attachment); - break; - } - } - } - slotIndex++; - } - }; - return Skin; - }()); - spine.Skin = Skin; + var Skin = (function () { + function Skin(name) { + this.attachments = new Array(); + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + Skin.prototype.addAttachment = function (slotIndex, name, attachment) { + if (attachment == null) + throw new Error("attachment cannot be null."); + var attachments = this.attachments; + if (slotIndex >= attachments.length) + attachments.length = slotIndex + 1; + if (!attachments[slotIndex]) + attachments[slotIndex] = {}; + attachments[slotIndex][name] = attachment; + }; + Skin.prototype.getAttachment = function (slotIndex, name) { + var dictionary = this.attachments[slotIndex]; + return dictionary ? dictionary[name] : null; + }; + Skin.prototype.attachAll = function (skeleton, oldSkin) { + var slotIndex = 0; + for (var i = 0; i < skeleton.slots.length; i++) { + var slot = skeleton.slots[i]; + var slotAttachment = slot.getAttachment(); + if (slotAttachment && slotIndex < oldSkin.attachments.length) { + var dictionary = oldSkin.attachments[slotIndex]; + for (var key in dictionary) { + var skinAttachment = dictionary[key]; + if (slotAttachment == skinAttachment) { + var attachment = this.getAttachment(slotIndex, key); + if (attachment != null) + slot.setAttachment(attachment); + break; + } + } + } + slotIndex++; + } + }; + return Skin; + }()); + spine.Skin = Skin; })(spine || (spine = {})); var spine; (function (spine) { - var Slot = (function () { - function Slot(data, bone) { - this.attachmentVertices = new Array(); - if (data == null) - throw new Error("data cannot be null."); - if (bone == null) - throw new Error("bone cannot be null."); - this.data = data; - this.bone = bone; - this.color = new spine.Color(); - this.darkColor = data.darkColor == null ? null : new spine.Color(); - this.setToSetupPose(); - } - Slot.prototype.getAttachment = function () { - return this.attachment; - }; - Slot.prototype.setAttachment = function (attachment) { - if (this.attachment == attachment) - return; - this.attachment = attachment; - this.attachmentTime = this.bone.skeleton.time; - this.attachmentVertices.length = 0; - }; - Slot.prototype.setAttachmentTime = function (time) { - this.attachmentTime = this.bone.skeleton.time - time; - }; - Slot.prototype.getAttachmentTime = function () { - return this.bone.skeleton.time - this.attachmentTime; - }; - Slot.prototype.setToSetupPose = function () { - this.color.setFromColor(this.data.color); - if (this.darkColor != null) - this.darkColor.setFromColor(this.data.darkColor); - if (this.data.attachmentName == null) - this.attachment = null; - else { - this.attachment = null; - this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)); - } - }; - return Slot; - }()); - spine.Slot = Slot; + var Slot = (function () { + function Slot(data, bone) { + this.attachmentVertices = new Array(); + if (data == null) + throw new Error("data cannot be null."); + if (bone == null) + throw new Error("bone cannot be null."); + this.data = data; + this.bone = bone; + this.color = new spine.Color(); + this.darkColor = data.darkColor == null ? null : new spine.Color(); + this.setToSetupPose(); + } + Slot.prototype.getAttachment = function () { + return this.attachment; + }; + Slot.prototype.setAttachment = function (attachment) { + if (this.attachment == attachment) + return; + this.attachment = attachment; + this.attachmentTime = this.bone.skeleton.time; + this.attachmentVertices.length = 0; + }; + Slot.prototype.setAttachmentTime = function (time) { + this.attachmentTime = this.bone.skeleton.time - time; + }; + Slot.prototype.getAttachmentTime = function () { + return this.bone.skeleton.time - this.attachmentTime; + }; + Slot.prototype.setToSetupPose = function () { + this.color.setFromColor(this.data.color); + if (this.darkColor != null) + this.darkColor.setFromColor(this.data.darkColor); + if (this.data.attachmentName == null) + this.attachment = null; + else { + this.attachment = null; + this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)); + } + }; + return Slot; + }()); + spine.Slot = Slot; })(spine || (spine = {})); var spine; (function (spine) { - var SlotData = (function () { - function SlotData(index, name, boneData) { - this.color = new spine.Color(1, 1, 1, 1); - if (index < 0) - throw new Error("index must be >= 0."); - if (name == null) - throw new Error("name cannot be null."); - if (boneData == null) - throw new Error("boneData cannot be null."); - this.index = index; - this.name = name; - this.boneData = boneData; - } - return SlotData; - }()); - spine.SlotData = SlotData; + var SlotData = (function () { + function SlotData(index, name, boneData) { + this.color = new spine.Color(1, 1, 1, 1); + if (index < 0) + throw new Error("index must be >= 0."); + if (name == null) + throw new Error("name cannot be null."); + if (boneData == null) + throw new Error("boneData cannot be null."); + this.index = index; + this.name = name; + this.boneData = boneData; + } + return SlotData; + }()); + spine.SlotData = SlotData; })(spine || (spine = {})); var spine; (function (spine) { - var Texture = (function () { - function Texture(image) { - this._image = image; - } - Texture.prototype.getImage = function () { - return this._image; - }; - Texture.filterFromString = function (text) { - switch (text.toLowerCase()) { - case "nearest": return TextureFilter.Nearest; - case "linear": return TextureFilter.Linear; - case "mipmap": return TextureFilter.MipMap; - case "mipmapnearestnearest": return TextureFilter.MipMapNearestNearest; - case "mipmaplinearnearest": return TextureFilter.MipMapLinearNearest; - case "mipmapnearestlinear": return TextureFilter.MipMapNearestLinear; - case "mipmaplinearlinear": return TextureFilter.MipMapLinearLinear; - default: throw new Error("Unknown texture filter " + text); - } - }; - Texture.wrapFromString = function (text) { - switch (text.toLowerCase()) { - case "mirroredtepeat": return TextureWrap.MirroredRepeat; - case "clamptoedge": return TextureWrap.ClampToEdge; - case "repeat": return TextureWrap.Repeat; - default: throw new Error("Unknown texture wrap " + text); - } - }; - return Texture; - }()); - spine.Texture = Texture; - var TextureFilter; - (function (TextureFilter) { - TextureFilter[TextureFilter["Nearest"] = 9728] = "Nearest"; - TextureFilter[TextureFilter["Linear"] = 9729] = "Linear"; - TextureFilter[TextureFilter["MipMap"] = 9987] = "MipMap"; - TextureFilter[TextureFilter["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; - TextureFilter[TextureFilter["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; - TextureFilter[TextureFilter["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; - TextureFilter[TextureFilter["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; - })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {})); - var TextureWrap; - (function (TextureWrap) { - TextureWrap[TextureWrap["MirroredRepeat"] = 33648] = "MirroredRepeat"; - TextureWrap[TextureWrap["ClampToEdge"] = 33071] = "ClampToEdge"; - TextureWrap[TextureWrap["Repeat"] = 10497] = "Repeat"; - })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {})); - var TextureRegion = (function () { - function TextureRegion() { - this.u = 0; - this.v = 0; - this.u2 = 0; - this.v2 = 0; - this.width = 0; - this.height = 0; - this.rotate = false; - this.offsetX = 0; - this.offsetY = 0; - this.originalWidth = 0; - this.originalHeight = 0; - } - return TextureRegion; - }()); - spine.TextureRegion = TextureRegion; - var FakeTexture = (function (_super) { - __extends(FakeTexture, _super); - function FakeTexture() { - return _super !== null && _super.apply(this, arguments) || this; - } - FakeTexture.prototype.setFilters = function (minFilter, magFilter) { }; - FakeTexture.prototype.setWraps = function (uWrap, vWrap) { }; - FakeTexture.prototype.dispose = function () { }; - return FakeTexture; - }(Texture)); - spine.FakeTexture = FakeTexture; + var Texture = (function () { + function Texture(image) { + this._image = image; + } + Texture.prototype.getImage = function () { + return this._image; + }; + Texture.filterFromString = function (text) { + switch (text.toLowerCase()) { + case "nearest": return TextureFilter.Nearest; + case "linear": return TextureFilter.Linear; + case "mipmap": return TextureFilter.MipMap; + case "mipmapnearestnearest": return TextureFilter.MipMapNearestNearest; + case "mipmaplinearnearest": return TextureFilter.MipMapLinearNearest; + case "mipmapnearestlinear": return TextureFilter.MipMapNearestLinear; + case "mipmaplinearlinear": return TextureFilter.MipMapLinearLinear; + default: throw new Error("Unknown texture filter " + text); + } + }; + Texture.wrapFromString = function (text) { + switch (text.toLowerCase()) { + case "mirroredtepeat": return TextureWrap.MirroredRepeat; + case "clamptoedge": return TextureWrap.ClampToEdge; + case "repeat": return TextureWrap.Repeat; + default: throw new Error("Unknown texture wrap " + text); + } + }; + return Texture; + }()); + spine.Texture = Texture; + var TextureFilter; + (function (TextureFilter) { + TextureFilter[TextureFilter["Nearest"] = 9728] = "Nearest"; + TextureFilter[TextureFilter["Linear"] = 9729] = "Linear"; + TextureFilter[TextureFilter["MipMap"] = 9987] = "MipMap"; + TextureFilter[TextureFilter["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; + TextureFilter[TextureFilter["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; + TextureFilter[TextureFilter["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; + TextureFilter[TextureFilter["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; + })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {})); + var TextureWrap; + (function (TextureWrap) { + TextureWrap[TextureWrap["MirroredRepeat"] = 33648] = "MirroredRepeat"; + TextureWrap[TextureWrap["ClampToEdge"] = 33071] = "ClampToEdge"; + TextureWrap[TextureWrap["Repeat"] = 10497] = "Repeat"; + })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {})); + var TextureRegion = (function () { + function TextureRegion() { + this.u = 0; + this.v = 0; + this.u2 = 0; + this.v2 = 0; + this.width = 0; + this.height = 0; + this.rotate = false; + this.offsetX = 0; + this.offsetY = 0; + this.originalWidth = 0; + this.originalHeight = 0; + } + return TextureRegion; + }()); + spine.TextureRegion = TextureRegion; + var FakeTexture = (function (_super) { + __extends(FakeTexture, _super); + function FakeTexture() { + return _super !== null && _super.apply(this, arguments) || this; + } + FakeTexture.prototype.setFilters = function (minFilter, magFilter) { }; + FakeTexture.prototype.setWraps = function (uWrap, vWrap) { }; + FakeTexture.prototype.dispose = function () { }; + return FakeTexture; + }(Texture)); + spine.FakeTexture = FakeTexture; })(spine || (spine = {})); var spine; (function (spine) { - var TextureAtlas = (function () { - function TextureAtlas(atlasText, textureLoader) { - this.pages = new Array(); - this.regions = new Array(); - this.load(atlasText, textureLoader); - } - TextureAtlas.prototype.load = function (atlasText, textureLoader) { - if (textureLoader == null) - throw new Error("textureLoader cannot be null."); - var reader = new TextureAtlasReader(atlasText); - var tuple = new Array(4); - var page = null; - while (true) { - var line = reader.readLine(); - if (line == null) - break; - line = line.trim(); - if (line.length == 0) - page = null; - else if (!page) { - page = new TextureAtlasPage(); - page.name = line; - if (reader.readTuple(tuple) == 2) { - page.width = parseInt(tuple[0]); - page.height = parseInt(tuple[1]); - reader.readTuple(tuple); - } - reader.readTuple(tuple); - page.minFilter = spine.Texture.filterFromString(tuple[0]); - page.magFilter = spine.Texture.filterFromString(tuple[1]); - var direction = reader.readValue(); - page.uWrap = spine.TextureWrap.ClampToEdge; - page.vWrap = spine.TextureWrap.ClampToEdge; - if (direction == "x") - page.uWrap = spine.TextureWrap.Repeat; - else if (direction == "y") - page.vWrap = spine.TextureWrap.Repeat; - else if (direction == "xy") - page.uWrap = page.vWrap = spine.TextureWrap.Repeat; - page.texture = textureLoader(line); - page.texture.setFilters(page.minFilter, page.magFilter); - page.texture.setWraps(page.uWrap, page.vWrap); - page.width = page.texture.getImage().width; - page.height = page.texture.getImage().height; - this.pages.push(page); - } - else { - var region = new TextureAtlasRegion(); - region.name = line; - region.page = page; - region.rotate = reader.readValue() == "true"; - reader.readTuple(tuple); - var x = parseInt(tuple[0]); - var y = parseInt(tuple[1]); - reader.readTuple(tuple); - var width = parseInt(tuple[0]); - var height = parseInt(tuple[1]); - region.u = x / page.width; - region.v = y / page.height; - if (region.rotate) { - region.u2 = (x + height) / page.width; - region.v2 = (y + width) / page.height; - } - else { - region.u2 = (x + width) / page.width; - region.v2 = (y + height) / page.height; - } - region.x = x; - region.y = y; - region.width = Math.abs(width); - region.height = Math.abs(height); - if (reader.readTuple(tuple) == 4) { - if (reader.readTuple(tuple) == 4) { - reader.readTuple(tuple); - } - } - region.originalWidth = parseInt(tuple[0]); - region.originalHeight = parseInt(tuple[1]); - reader.readTuple(tuple); - region.offsetX = parseInt(tuple[0]); - region.offsetY = parseInt(tuple[1]); - region.index = parseInt(reader.readValue()); - region.texture = page.texture; - this.regions.push(region); - } - } - }; - TextureAtlas.prototype.findRegion = function (name) { - for (var i = 0; i < this.regions.length; i++) { - if (this.regions[i].name == name) { - return this.regions[i]; - } - } - return null; - }; - TextureAtlas.prototype.dispose = function () { - for (var i = 0; i < this.pages.length; i++) { - this.pages[i].texture.dispose(); - } - }; - return TextureAtlas; - }()); - spine.TextureAtlas = TextureAtlas; - var TextureAtlasReader = (function () { - function TextureAtlasReader(text) { - this.index = 0; - this.lines = text.split(/\r\n|\r|\n/); - } - TextureAtlasReader.prototype.readLine = function () { - if (this.index >= this.lines.length) - return null; - return this.lines[this.index++]; - }; - TextureAtlasReader.prototype.readValue = function () { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) - throw new Error("Invalid line: " + line); - return line.substring(colon + 1).trim(); - }; - TextureAtlasReader.prototype.readTuple = function (tuple) { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) - throw new Error("Invalid line: " + line); - var i = 0, lastMatch = colon + 1; - for (; i < 3; i++) { - var comma = line.indexOf(",", lastMatch); - if (comma == -1) - break; - tuple[i] = line.substr(lastMatch, comma - lastMatch).trim(); - lastMatch = comma + 1; - } - tuple[i] = line.substring(lastMatch).trim(); - return i + 1; - }; - return TextureAtlasReader; - }()); - var TextureAtlasPage = (function () { - function TextureAtlasPage() { - } - return TextureAtlasPage; - }()); - spine.TextureAtlasPage = TextureAtlasPage; - var TextureAtlasRegion = (function (_super) { - __extends(TextureAtlasRegion, _super); - function TextureAtlasRegion() { - return _super !== null && _super.apply(this, arguments) || this; - } - return TextureAtlasRegion; - }(spine.TextureRegion)); - spine.TextureAtlasRegion = TextureAtlasRegion; + var TextureAtlas = (function () { + function TextureAtlas(atlasText, textureLoader) { + this.pages = new Array(); + this.regions = new Array(); + this.load(atlasText, textureLoader); + } + TextureAtlas.prototype.load = function (atlasText, textureLoader) { + if (textureLoader == null) + throw new Error("textureLoader cannot be null."); + var reader = new TextureAtlasReader(atlasText); + var tuple = new Array(4); + var page = null; + while (true) { + var line = reader.readLine(); + if (line == null) + break; + line = line.trim(); + if (line.length == 0) + page = null; + else if (!page) { + page = new TextureAtlasPage(); + page.name = line; + if (reader.readTuple(tuple) == 2) { + page.width = parseInt(tuple[0]); + page.height = parseInt(tuple[1]); + reader.readTuple(tuple); + } + reader.readTuple(tuple); + page.minFilter = spine.Texture.filterFromString(tuple[0]); + page.magFilter = spine.Texture.filterFromString(tuple[1]); + var direction = reader.readValue(); + page.uWrap = spine.TextureWrap.ClampToEdge; + page.vWrap = spine.TextureWrap.ClampToEdge; + if (direction == "x") + page.uWrap = spine.TextureWrap.Repeat; + else if (direction == "y") + page.vWrap = spine.TextureWrap.Repeat; + else if (direction == "xy") + page.uWrap = page.vWrap = spine.TextureWrap.Repeat; + page.texture = textureLoader(line); + page.texture.setFilters(page.minFilter, page.magFilter); + page.texture.setWraps(page.uWrap, page.vWrap); + page.width = page.texture.getImage().width; + page.height = page.texture.getImage().height; + this.pages.push(page); + } + else { + var region = new TextureAtlasRegion(); + region.name = line; + region.page = page; + region.rotate = reader.readValue() == "true"; + reader.readTuple(tuple); + var x = parseInt(tuple[0]); + var y = parseInt(tuple[1]); + reader.readTuple(tuple); + var width = parseInt(tuple[0]); + var height = parseInt(tuple[1]); + region.u = x / page.width; + region.v = y / page.height; + if (region.rotate) { + region.u2 = (x + height) / page.width; + region.v2 = (y + width) / page.height; + } + else { + region.u2 = (x + width) / page.width; + region.v2 = (y + height) / page.height; + } + region.x = x; + region.y = y; + region.width = Math.abs(width); + region.height = Math.abs(height); + if (reader.readTuple(tuple) == 4) { + if (reader.readTuple(tuple) == 4) { + reader.readTuple(tuple); + } + } + region.originalWidth = parseInt(tuple[0]); + region.originalHeight = parseInt(tuple[1]); + reader.readTuple(tuple); + region.offsetX = parseInt(tuple[0]); + region.offsetY = parseInt(tuple[1]); + region.index = parseInt(reader.readValue()); + region.texture = page.texture; + this.regions.push(region); + } + } + }; + TextureAtlas.prototype.findRegion = function (name) { + for (var i = 0; i < this.regions.length; i++) { + if (this.regions[i].name == name) { + return this.regions[i]; + } + } + return null; + }; + TextureAtlas.prototype.dispose = function () { + for (var i = 0; i < this.pages.length; i++) { + this.pages[i].texture.dispose(); + } + }; + return TextureAtlas; + }()); + spine.TextureAtlas = TextureAtlas; + var TextureAtlasReader = (function () { + function TextureAtlasReader(text) { + this.index = 0; + this.lines = text.split(/\r\n|\r|\n/); + } + TextureAtlasReader.prototype.readLine = function () { + if (this.index >= this.lines.length) + return null; + return this.lines[this.index++]; + }; + TextureAtlasReader.prototype.readValue = function () { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + return line.substring(colon + 1).trim(); + }; + TextureAtlasReader.prototype.readTuple = function (tuple) { + var line = this.readLine(); + var colon = line.indexOf(":"); + if (colon == -1) + throw new Error("Invalid line: " + line); + var i = 0, lastMatch = colon + 1; + for (; i < 3; i++) { + var comma = line.indexOf(",", lastMatch); + if (comma == -1) + break; + tuple[i] = line.substr(lastMatch, comma - lastMatch).trim(); + lastMatch = comma + 1; + } + tuple[i] = line.substring(lastMatch).trim(); + return i + 1; + }; + return TextureAtlasReader; + }()); + var TextureAtlasPage = (function () { + function TextureAtlasPage() { + } + return TextureAtlasPage; + }()); + spine.TextureAtlasPage = TextureAtlasPage; + var TextureAtlasRegion = (function (_super) { + __extends(TextureAtlasRegion, _super); + function TextureAtlasRegion() { + return _super !== null && _super.apply(this, arguments) || this; + } + return TextureAtlasRegion; + }(spine.TextureRegion)); + spine.TextureAtlasRegion = TextureAtlasRegion; })(spine || (spine = {})); var spine; (function (spine) { - var TransformConstraint = (function () { - function TransformConstraint(data, skeleton) { - this.rotateMix = 0; - this.translateMix = 0; - this.scaleMix = 0; - this.shearMix = 0; - this.temp = new spine.Vector2(); - if (data == null) - throw new Error("data cannot be null."); - if (skeleton == null) - throw new Error("skeleton cannot be null."); - this.data = data; - this.rotateMix = data.rotateMix; - this.translateMix = data.translateMix; - this.scaleMix = data.scaleMix; - this.shearMix = data.shearMix; - this.bones = new Array(); - for (var i = 0; i < data.bones.length; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); - } - TransformConstraint.prototype.apply = function () { - this.update(); - }; - TransformConstraint.prototype.update = function () { - if (this.data.local) { - if (this.data.relative) - this.applyRelativeLocal(); - else - this.applyAbsoluteLocal(); - } - else { - if (this.data.relative) - this.applyRelativeWorld(); - else - this.applyAbsoluteWorld(); - } - }; - TransformConstraint.prototype.applyAbsoluteWorld = function () { - var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; - var target = this.target; - var ta = target.a, tb = target.b, tc = target.c, td = target.d; - var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; - var offsetRotation = this.data.offsetRotation * degRadReflect; - var offsetShearY = this.data.offsetShearY * degRadReflect; - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var modified = false; - if (rotateMix != 0) { - var a = bone.a, b = bone.b, c = bone.c, d = bone.d; - var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation; - if (r > spine.MathUtils.PI) - r -= spine.MathUtils.PI2; - else if (r < -spine.MathUtils.PI) - r += spine.MathUtils.PI2; - r *= rotateMix; - var cos = Math.cos(r), sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - modified = true; - } - if (translateMix != 0) { - var temp = this.temp; - target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); - bone.worldX += (temp.x - bone.worldX) * translateMix; - bone.worldY += (temp.y - bone.worldY) * translateMix; - modified = true; - } - if (scaleMix > 0) { - var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c); - var ts = Math.sqrt(ta * ta + tc * tc); - if (s > 0.00001) - s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s; - bone.a *= s; - bone.c *= s; - s = Math.sqrt(bone.b * bone.b + bone.d * bone.d); - ts = Math.sqrt(tb * tb + td * td); - if (s > 0.00001) - s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s; - bone.b *= s; - bone.d *= s; - modified = true; - } - if (shearMix > 0) { - var b = bone.b, d = bone.d; - var by = Math.atan2(d, b); - var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a)); - if (r > spine.MathUtils.PI) - r -= spine.MathUtils.PI2; - else if (r < -spine.MathUtils.PI) - r += spine.MathUtils.PI2; - r = by + (r + offsetShearY) * shearMix; - var s = Math.sqrt(b * b + d * d); - bone.b = Math.cos(r) * s; - bone.d = Math.sin(r) * s; - modified = true; - } - if (modified) - bone.appliedValid = false; - } - }; - TransformConstraint.prototype.applyRelativeWorld = function () { - var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; - var target = this.target; - var ta = target.a, tb = target.b, tc = target.c, td = target.d; - var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; - var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect; - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var modified = false; - if (rotateMix != 0) { - var a = bone.a, b = bone.b, c = bone.c, d = bone.d; - var r = Math.atan2(tc, ta) + offsetRotation; - if (r > spine.MathUtils.PI) - r -= spine.MathUtils.PI2; - else if (r < -spine.MathUtils.PI) - r += spine.MathUtils.PI2; - r *= rotateMix; - var cos = Math.cos(r), sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - modified = true; - } - if (translateMix != 0) { - var temp = this.temp; - target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); - bone.worldX += temp.x * translateMix; - bone.worldY += temp.y * translateMix; - modified = true; - } - if (scaleMix > 0) { - var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1; - bone.a *= s; - bone.c *= s; - s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1; - bone.b *= s; - bone.d *= s; - modified = true; - } - if (shearMix > 0) { - var r = Math.atan2(td, tb) - Math.atan2(tc, ta); - if (r > spine.MathUtils.PI) - r -= spine.MathUtils.PI2; - else if (r < -spine.MathUtils.PI) - r += spine.MathUtils.PI2; - var b = bone.b, d = bone.d; - r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix; - var s = Math.sqrt(b * b + d * d); - bone.b = Math.cos(r) * s; - bone.d = Math.sin(r) * s; - modified = true; - } - if (modified) - bone.appliedValid = false; - } - }; - TransformConstraint.prototype.applyAbsoluteLocal = function () { - var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; - var target = this.target; - if (!target.appliedValid) - target.updateAppliedTransform(); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (!bone.appliedValid) - bone.updateAppliedTransform(); - var rotation = bone.arotation; - if (rotateMix != 0) { - var r = target.arotation - rotation + this.data.offsetRotation; - r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; - rotation += r * rotateMix; - } - var x = bone.ax, y = bone.ay; - if (translateMix != 0) { - x += (target.ax - x + this.data.offsetX) * translateMix; - y += (target.ay - y + this.data.offsetY) * translateMix; - } - var scaleX = bone.ascaleX, scaleY = bone.ascaleY; - if (scaleMix != 0) { - if (scaleX > 0.00001) - scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX; - if (scaleY > 0.00001) - scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY; - } - var shearY = bone.ashearY; - if (shearMix != 0) { - var r = target.ashearY - shearY + this.data.offsetShearY; - r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; - bone.shearY += r * shearMix; - } - bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); - } - }; - TransformConstraint.prototype.applyRelativeLocal = function () { - var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; - var target = this.target; - if (!target.appliedValid) - target.updateAppliedTransform(); - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (!bone.appliedValid) - bone.updateAppliedTransform(); - var rotation = bone.arotation; - if (rotateMix != 0) - rotation += (target.arotation + this.data.offsetRotation) * rotateMix; - var x = bone.ax, y = bone.ay; - if (translateMix != 0) { - x += (target.ax + this.data.offsetX) * translateMix; - y += (target.ay + this.data.offsetY) * translateMix; - } - var scaleX = bone.ascaleX, scaleY = bone.ascaleY; - if (scaleMix != 0) { - if (scaleX > 0.00001) - scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1; - if (scaleY > 0.00001) - scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1; - } - var shearY = bone.ashearY; - if (shearMix != 0) - shearY += (target.ashearY + this.data.offsetShearY) * shearMix; - bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); - } - }; - TransformConstraint.prototype.getOrder = function () { - return this.data.order; - }; - return TransformConstraint; - }()); - spine.TransformConstraint = TransformConstraint; + var TransformConstraint = (function () { + function TransformConstraint(data, skeleton) { + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.temp = new spine.Vector2(); + if (data == null) + throw new Error("data cannot be null."); + if (skeleton == null) + throw new Error("skeleton cannot be null."); + this.data = data; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + this.scaleMix = data.scaleMix; + this.shearMix = data.shearMix; + this.bones = new Array(); + for (var i = 0; i < data.bones.length; i++) + this.bones.push(skeleton.findBone(data.bones[i].name)); + this.target = skeleton.findBone(data.target.name); + } + TransformConstraint.prototype.apply = function () { + this.update(); + }; + TransformConstraint.prototype.update = function () { + if (this.data.local) { + if (this.data.relative) + this.applyRelativeLocal(); + else + this.applyAbsoluteLocal(); + } + else { + if (this.data.relative) + this.applyRelativeWorld(); + else + this.applyAbsoluteWorld(); + } + }; + TransformConstraint.prototype.applyAbsoluteWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect; + var offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += (temp.x - bone.worldX) * translateMix; + bone.worldY += (temp.y - bone.worldY) * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c); + var ts = Math.sqrt(ta * ta + tc * tc); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s; + bone.a *= s; + bone.c *= s; + s = Math.sqrt(bone.b * bone.b + bone.d * bone.d); + ts = Math.sqrt(tb * tb + td * td); + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var b = bone.b, d = bone.d; + var by = Math.atan2(d, b); + var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a)); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r = by + (r + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyRelativeWorld = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + var ta = target.a, tb = target.b, tc = target.c, td = target.d; + var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad; + var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect; + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + var modified = false; + if (rotateMix != 0) { + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var r = Math.atan2(tc, ta) + offsetRotation; + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + r *= rotateMix; + var cos = Math.cos(r), sin = Math.sin(r); + bone.a = cos * a - sin * c; + bone.b = cos * b - sin * d; + bone.c = sin * a + cos * c; + bone.d = sin * b + cos * d; + modified = true; + } + if (translateMix != 0) { + var temp = this.temp; + target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); + bone.worldX += temp.x * translateMix; + bone.worldY += temp.y * translateMix; + modified = true; + } + if (scaleMix > 0) { + var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1; + bone.a *= s; + bone.c *= s; + s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1; + bone.b *= s; + bone.d *= s; + modified = true; + } + if (shearMix > 0) { + var r = Math.atan2(td, tb) - Math.atan2(tc, ta); + if (r > spine.MathUtils.PI) + r -= spine.MathUtils.PI2; + else if (r < -spine.MathUtils.PI) + r += spine.MathUtils.PI2; + var b = bone.b, d = bone.d; + r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix; + var s = Math.sqrt(b * b + d * d); + bone.b = Math.cos(r) * s; + bone.d = Math.sin(r) * s; + modified = true; + } + if (modified) + bone.appliedValid = false; + } + }; + TransformConstraint.prototype.applyAbsoluteLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) { + var r = target.arotation - rotation + this.data.offsetRotation; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + rotation += r * rotateMix; + } + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax - x + this.data.offsetX) * translateMix; + y += (target.ay - y + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX; + if (scaleY > 0.00001) + scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY; + } + var shearY = bone.ashearY; + if (shearMix != 0) { + var r = target.ashearY - shearY + this.data.offsetShearY; + r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360; + bone.shearY += r * shearMix; + } + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.applyRelativeLocal = function () { + var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; + var target = this.target; + if (!target.appliedValid) + target.updateAppliedTransform(); + var bones = this.bones; + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (!bone.appliedValid) + bone.updateAppliedTransform(); + var rotation = bone.arotation; + if (rotateMix != 0) + rotation += (target.arotation + this.data.offsetRotation) * rotateMix; + var x = bone.ax, y = bone.ay; + if (translateMix != 0) { + x += (target.ax + this.data.offsetX) * translateMix; + y += (target.ay + this.data.offsetY) * translateMix; + } + var scaleX = bone.ascaleX, scaleY = bone.ascaleY; + if (scaleMix != 0) { + if (scaleX > 0.00001) + scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1; + if (scaleY > 0.00001) + scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1; + } + var shearY = bone.ashearY; + if (shearMix != 0) + shearY += (target.ashearY + this.data.offsetShearY) * shearMix; + bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); + } + }; + TransformConstraint.prototype.getOrder = function () { + return this.data.order; + }; + return TransformConstraint; + }()); + spine.TransformConstraint = TransformConstraint; })(spine || (spine = {})); var spine; (function (spine) { - var TransformConstraintData = (function () { - function TransformConstraintData(name) { - this.order = 0; - this.bones = new Array(); - this.rotateMix = 0; - this.translateMix = 0; - this.scaleMix = 0; - this.shearMix = 0; - this.offsetRotation = 0; - this.offsetX = 0; - this.offsetY = 0; - this.offsetScaleX = 0; - this.offsetScaleY = 0; - this.offsetShearY = 0; - this.relative = false; - this.local = false; - if (name == null) - throw new Error("name cannot be null."); - this.name = name; - } - return TransformConstraintData; - }()); - spine.TransformConstraintData = TransformConstraintData; + var TransformConstraintData = (function () { + function TransformConstraintData(name) { + this.order = 0; + this.bones = new Array(); + this.rotateMix = 0; + this.translateMix = 0; + this.scaleMix = 0; + this.shearMix = 0; + this.offsetRotation = 0; + this.offsetX = 0; + this.offsetY = 0; + this.offsetScaleX = 0; + this.offsetScaleY = 0; + this.offsetShearY = 0; + this.relative = false; + this.local = false; + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return TransformConstraintData; + }()); + spine.TransformConstraintData = TransformConstraintData; })(spine || (spine = {})); var spine; (function (spine) { - var Triangulator = (function () { - function Triangulator() { - this.convexPolygons = new Array(); - this.convexPolygonsIndices = new Array(); - this.indicesArray = new Array(); - this.isConcaveArray = new Array(); - this.triangles = new Array(); - this.polygonPool = new spine.Pool(function () { - return new Array(); - }); - this.polygonIndicesPool = new spine.Pool(function () { - return new Array(); - }); - } - Triangulator.prototype.triangulate = function (verticesArray) { - var vertices = verticesArray; - var vertexCount = verticesArray.length >> 1; - var indices = this.indicesArray; - indices.length = 0; - for (var i = 0; i < vertexCount; i++) - indices[i] = i; - var isConcave = this.isConcaveArray; - isConcave.length = 0; - for (var i = 0, n = vertexCount; i < n; ++i) - isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices); - var triangles = this.triangles; - triangles.length = 0; - while (vertexCount > 3) { - var previous = vertexCount - 1, i = 0, next = 1; - while (true) { - outer: if (!isConcave[i]) { - var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; - var p1x = vertices[p1], p1y = vertices[p1 + 1]; - var p2x = vertices[p2], p2y = vertices[p2 + 1]; - var p3x = vertices[p3], p3y = vertices[p3 + 1]; - for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { - if (!isConcave[ii]) - continue; - var v = indices[ii] << 1; - var vx = vertices[v], vy = vertices[v + 1]; - if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { - if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { - if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) - break outer; - } - } - } - break; - } - if (next == 0) { - do { - if (!isConcave[i]) - break; - i--; - } while (i > 0); - break; - } - previous = i; - i = next; - next = (next + 1) % vertexCount; - } - triangles.push(indices[(vertexCount + i - 1) % vertexCount]); - triangles.push(indices[i]); - triangles.push(indices[(i + 1) % vertexCount]); - indices.splice(i, 1); - isConcave.splice(i, 1); - vertexCount--; - var previousIndex = (vertexCount + i - 1) % vertexCount; - var nextIndex = i == vertexCount ? 0 : i; - isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices); - isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices); - } - if (vertexCount == 3) { - triangles.push(indices[2]); - triangles.push(indices[0]); - triangles.push(indices[1]); - } - return triangles; - }; - Triangulator.prototype.decompose = function (verticesArray, triangles) { - var vertices = verticesArray; - var convexPolygons = this.convexPolygons; - this.polygonPool.freeAll(convexPolygons); - convexPolygons.length = 0; - var convexPolygonsIndices = this.convexPolygonsIndices; - this.polygonIndicesPool.freeAll(convexPolygonsIndices); - convexPolygonsIndices.length = 0; - var polygonIndices = this.polygonIndicesPool.obtain(); - polygonIndices.length = 0; - var polygon = this.polygonPool.obtain(); - polygon.length = 0; - var fanBaseIndex = -1, lastWinding = 0; - for (var i = 0, n = triangles.length; i < n; i += 3) { - var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; - var x1 = vertices[t1], y1 = vertices[t1 + 1]; - var x2 = vertices[t2], y2 = vertices[t2 + 1]; - var x3 = vertices[t3], y3 = vertices[t3 + 1]; - var merged = false; - if (fanBaseIndex == t1) { - var o = polygon.length - 4; - var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); - var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]); - if (winding1 == lastWinding && winding2 == lastWinding) { - polygon.push(x3); - polygon.push(y3); - polygonIndices.push(t3); - merged = true; - } - } - if (!merged) { - if (polygon.length > 0) { - convexPolygons.push(polygon); - convexPolygonsIndices.push(polygonIndices); - } - else { - this.polygonPool.free(polygon); - this.polygonIndicesPool.free(polygonIndices); - } - polygon = this.polygonPool.obtain(); - polygon.length = 0; - polygon.push(x1); - polygon.push(y1); - polygon.push(x2); - polygon.push(y2); - polygon.push(x3); - polygon.push(y3); - polygonIndices = this.polygonIndicesPool.obtain(); - polygonIndices.length = 0; - polygonIndices.push(t1); - polygonIndices.push(t2); - polygonIndices.push(t3); - lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3); - fanBaseIndex = t1; - } - } - if (polygon.length > 0) { - convexPolygons.push(polygon); - convexPolygonsIndices.push(polygonIndices); - } - for (var i = 0, n = convexPolygons.length; i < n; i++) { - polygonIndices = convexPolygonsIndices[i]; - if (polygonIndices.length == 0) - continue; - var firstIndex = polygonIndices[0]; - var lastIndex = polygonIndices[polygonIndices.length - 1]; - polygon = convexPolygons[i]; - var o = polygon.length - 4; - var prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; - var prevX = polygon[o + 2], prevY = polygon[o + 3]; - var firstX = polygon[0], firstY = polygon[1]; - var secondX = polygon[2], secondY = polygon[3]; - var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); - for (var ii = 0; ii < n; ii++) { - if (ii == i) - continue; - var otherIndices = convexPolygonsIndices[ii]; - if (otherIndices.length != 3) - continue; - var otherFirstIndex = otherIndices[0]; - var otherSecondIndex = otherIndices[1]; - var otherLastIndex = otherIndices[2]; - var otherPoly = convexPolygons[ii]; - var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; - if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) - continue; - var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); - var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY); - if (winding1 == winding && winding2 == winding) { - otherPoly.length = 0; - otherIndices.length = 0; - polygon.push(x3); - polygon.push(y3); - polygonIndices.push(otherLastIndex); - prevPrevX = prevX; - prevPrevY = prevY; - prevX = x3; - prevY = y3; - ii = 0; - } - } - } - for (var i = convexPolygons.length - 1; i >= 0; i--) { - polygon = convexPolygons[i]; - if (polygon.length == 0) { - convexPolygons.splice(i, 1); - this.polygonPool.free(polygon); - polygonIndices = convexPolygonsIndices[i]; - convexPolygonsIndices.splice(i, 1); - this.polygonIndicesPool.free(polygonIndices); - } - } - return convexPolygons; - }; - Triangulator.isConcave = function (index, vertexCount, vertices, indices) { - var previous = indices[(vertexCount + index - 1) % vertexCount] << 1; - var current = indices[index] << 1; - var next = indices[(index + 1) % vertexCount] << 1; - return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); - }; - Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) { - return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; - }; - Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) { - var px = p2x - p1x, py = p2y - p1y; - return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; - }; - return Triangulator; - }()); - spine.Triangulator = Triangulator; + var Triangulator = (function () { + function Triangulator() { + this.convexPolygons = new Array(); + this.convexPolygonsIndices = new Array(); + this.indicesArray = new Array(); + this.isConcaveArray = new Array(); + this.triangles = new Array(); + this.polygonPool = new spine.Pool(function () { + return new Array(); + }); + this.polygonIndicesPool = new spine.Pool(function () { + return new Array(); + }); + } + Triangulator.prototype.triangulate = function (verticesArray) { + var vertices = verticesArray; + var vertexCount = verticesArray.length >> 1; + var indices = this.indicesArray; + indices.length = 0; + for (var i = 0; i < vertexCount; i++) + indices[i] = i; + var isConcave = this.isConcaveArray; + isConcave.length = 0; + for (var i = 0, n = vertexCount; i < n; ++i) + isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices); + var triangles = this.triangles; + triangles.length = 0; + while (vertexCount > 3) { + var previous = vertexCount - 1, i = 0, next = 1; + while (true) { + outer: if (!isConcave[i]) { + var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; + var p1x = vertices[p1], p1y = vertices[p1 + 1]; + var p2x = vertices[p2], p2y = vertices[p2 + 1]; + var p3x = vertices[p3], p3y = vertices[p3 + 1]; + for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { + if (!isConcave[ii]) + continue; + var v = indices[ii] << 1; + var vx = vertices[v], vy = vertices[v + 1]; + if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { + if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { + if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) + break outer; + } + } + } + break; + } + if (next == 0) { + do { + if (!isConcave[i]) + break; + i--; + } while (i > 0); + break; + } + previous = i; + i = next; + next = (next + 1) % vertexCount; + } + triangles.push(indices[(vertexCount + i - 1) % vertexCount]); + triangles.push(indices[i]); + triangles.push(indices[(i + 1) % vertexCount]); + indices.splice(i, 1); + isConcave.splice(i, 1); + vertexCount--; + var previousIndex = (vertexCount + i - 1) % vertexCount; + var nextIndex = i == vertexCount ? 0 : i; + isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices); + isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices); + } + if (vertexCount == 3) { + triangles.push(indices[2]); + triangles.push(indices[0]); + triangles.push(indices[1]); + } + return triangles; + }; + Triangulator.prototype.decompose = function (verticesArray, triangles) { + var vertices = verticesArray; + var convexPolygons = this.convexPolygons; + this.polygonPool.freeAll(convexPolygons); + convexPolygons.length = 0; + var convexPolygonsIndices = this.convexPolygonsIndices; + this.polygonIndicesPool.freeAll(convexPolygonsIndices); + convexPolygonsIndices.length = 0; + var polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + var polygon = this.polygonPool.obtain(); + polygon.length = 0; + var fanBaseIndex = -1, lastWinding = 0; + for (var i = 0, n = triangles.length; i < n; i += 3) { + var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; + var x1 = vertices[t1], y1 = vertices[t1 + 1]; + var x2 = vertices[t2], y2 = vertices[t2 + 1]; + var x3 = vertices[t3], y3 = vertices[t3 + 1]; + var merged = false; + if (fanBaseIndex == t1) { + var o = polygon.length - 4; + var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); + var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]); + if (winding1 == lastWinding && winding2 == lastWinding) { + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(t3); + merged = true; + } + } + if (!merged) { + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + else { + this.polygonPool.free(polygon); + this.polygonIndicesPool.free(polygonIndices); + } + polygon = this.polygonPool.obtain(); + polygon.length = 0; + polygon.push(x1); + polygon.push(y1); + polygon.push(x2); + polygon.push(y2); + polygon.push(x3); + polygon.push(y3); + polygonIndices = this.polygonIndicesPool.obtain(); + polygonIndices.length = 0; + polygonIndices.push(t1); + polygonIndices.push(t2); + polygonIndices.push(t3); + lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3); + fanBaseIndex = t1; + } + } + if (polygon.length > 0) { + convexPolygons.push(polygon); + convexPolygonsIndices.push(polygonIndices); + } + for (var i = 0, n = convexPolygons.length; i < n; i++) { + polygonIndices = convexPolygonsIndices[i]; + if (polygonIndices.length == 0) + continue; + var firstIndex = polygonIndices[0]; + var lastIndex = polygonIndices[polygonIndices.length - 1]; + polygon = convexPolygons[i]; + var o = polygon.length - 4; + var prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; + var prevX = polygon[o + 2], prevY = polygon[o + 3]; + var firstX = polygon[0], firstY = polygon[1]; + var secondX = polygon[2], secondY = polygon[3]; + var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); + for (var ii = 0; ii < n; ii++) { + if (ii == i) + continue; + var otherIndices = convexPolygonsIndices[ii]; + if (otherIndices.length != 3) + continue; + var otherFirstIndex = otherIndices[0]; + var otherSecondIndex = otherIndices[1]; + var otherLastIndex = otherIndices[2]; + var otherPoly = convexPolygons[ii]; + var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; + if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) + continue; + var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); + var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY); + if (winding1 == winding && winding2 == winding) { + otherPoly.length = 0; + otherIndices.length = 0; + polygon.push(x3); + polygon.push(y3); + polygonIndices.push(otherLastIndex); + prevPrevX = prevX; + prevPrevY = prevY; + prevX = x3; + prevY = y3; + ii = 0; + } + } + } + for (var i = convexPolygons.length - 1; i >= 0; i--) { + polygon = convexPolygons[i]; + if (polygon.length == 0) { + convexPolygons.splice(i, 1); + this.polygonPool.free(polygon); + polygonIndices = convexPolygonsIndices[i]; + convexPolygonsIndices.splice(i, 1); + this.polygonIndicesPool.free(polygonIndices); + } + } + return convexPolygons; + }; + Triangulator.isConcave = function (index, vertexCount, vertices, indices) { + var previous = indices[(vertexCount + index - 1) % vertexCount] << 1; + var current = indices[index] << 1; + var next = indices[(index + 1) % vertexCount] << 1; + return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); + }; + Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) { + return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; + }; + Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) { + var px = p2x - p1x, py = p2y - p1y; + return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; + }; + return Triangulator; + }()); + spine.Triangulator = Triangulator; })(spine || (spine = {})); var spine; (function (spine) { - var IntSet = (function () { - function IntSet() { - this.array = new Array(); - } - IntSet.prototype.add = function (value) { - var contains = this.contains(value); - this.array[value | 0] = value | 0; - return !contains; - }; - IntSet.prototype.contains = function (value) { - return this.array[value | 0] != undefined; - }; - IntSet.prototype.remove = function (value) { - this.array[value | 0] = undefined; - }; - IntSet.prototype.clear = function () { - this.array.length = 0; - }; - return IntSet; - }()); - spine.IntSet = IntSet; - var Color = (function () { - function Color(r, g, b, a) { - if (r === void 0) { r = 0; } - if (g === void 0) { g = 0; } - if (b === void 0) { b = 0; } - if (a === void 0) { a = 0; } - this.r = r; - this.g = g; - this.b = b; - this.a = a; - } - Color.prototype.set = function (r, g, b, a) { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - this.clamp(); - return this; - }; - Color.prototype.setFromColor = function (c) { - this.r = c.r; - this.g = c.g; - this.b = c.b; - this.a = c.a; - return this; - }; - Color.prototype.setFromString = function (hex) { - hex = hex.charAt(0) == '#' ? hex.substr(1) : hex; - this.r = parseInt(hex.substr(0, 2), 16) / 255.0; - this.g = parseInt(hex.substr(2, 2), 16) / 255.0; - this.b = parseInt(hex.substr(4, 2), 16) / 255.0; - this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0; - return this; - }; - Color.prototype.add = function (r, g, b, a) { - this.r += r; - this.g += g; - this.b += b; - this.a += a; - this.clamp(); - return this; - }; - Color.prototype.clamp = function () { - if (this.r < 0) - this.r = 0; - else if (this.r > 1) - this.r = 1; - if (this.g < 0) - this.g = 0; - else if (this.g > 1) - this.g = 1; - if (this.b < 0) - this.b = 0; - else if (this.b > 1) - this.b = 1; - if (this.a < 0) - this.a = 0; - else if (this.a > 1) - this.a = 1; - return this; - }; - Color.WHITE = new Color(1, 1, 1, 1); - Color.RED = new Color(1, 0, 0, 1); - Color.GREEN = new Color(0, 1, 0, 1); - Color.BLUE = new Color(0, 0, 1, 1); - Color.MAGENTA = new Color(1, 0, 1, 1); - return Color; - }()); - spine.Color = Color; - var MathUtils = (function () { - function MathUtils() { - } - MathUtils.clamp = function (value, min, max) { - if (value < min) - return min; - if (value > max) - return max; - return value; - }; - MathUtils.cosDeg = function (degrees) { - return Math.cos(degrees * MathUtils.degRad); - }; - MathUtils.sinDeg = function (degrees) { - return Math.sin(degrees * MathUtils.degRad); - }; - MathUtils.signum = function (value) { - return value > 0 ? 1 : value < 0 ? -1 : 0; - }; - MathUtils.toInt = function (x) { - return x > 0 ? Math.floor(x) : Math.ceil(x); - }; - MathUtils.cbrt = function (x) { - var y = Math.pow(Math.abs(x), 1 / 3); - return x < 0 ? -y : y; - }; - MathUtils.randomTriangular = function (min, max) { - return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); - }; - MathUtils.randomTriangularWith = function (min, max, mode) { - var u = Math.random(); - var d = max - min; - if (u <= (mode - min) / d) - return min + Math.sqrt(u * d * (mode - min)); - return max - Math.sqrt((1 - u) * d * (max - mode)); - }; - MathUtils.PI = 3.1415927; - MathUtils.PI2 = MathUtils.PI * 2; - MathUtils.radiansToDegrees = 180 / MathUtils.PI; - MathUtils.radDeg = MathUtils.radiansToDegrees; - MathUtils.degreesToRadians = MathUtils.PI / 180; - MathUtils.degRad = MathUtils.degreesToRadians; - return MathUtils; - }()); - spine.MathUtils = MathUtils; - var Interpolation = (function () { - function Interpolation() { - } - Interpolation.prototype.apply = function (start, end, a) { - return start + (end - start) * this.applyInternal(a); - }; - return Interpolation; - }()); - spine.Interpolation = Interpolation; - var Pow = (function (_super) { - __extends(Pow, _super); - function Pow(power) { - var _this = _super.call(this) || this; - _this.power = 2; - _this.power = power; - return _this; - } - Pow.prototype.applyInternal = function (a) { - if (a <= 0.5) - return Math.pow(a * 2, this.power) / 2; - return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1; - }; - return Pow; - }(Interpolation)); - spine.Pow = Pow; - var PowOut = (function (_super) { - __extends(PowOut, _super); - function PowOut(power) { - return _super.call(this, power) || this; - } - PowOut.prototype.applyInternal = function (a) { - return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1; - }; - return PowOut; - }(Pow)); - spine.PowOut = PowOut; - var Utils = (function () { - function Utils() { - } - Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) { - for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { - dest[j] = source[i]; - } - }; - Utils.setArraySize = function (array, size, value) { - if (value === void 0) { value = 0; } - var oldSize = array.length; - if (oldSize == size) - return array; - array.length = size; - if (oldSize < size) { - for (var i = oldSize; i < size; i++) - array[i] = value; - } - return array; - }; - Utils.ensureArrayCapacity = function (array, size, value) { - if (value === void 0) { value = 0; } - if (array.length >= size) - return array; - return Utils.setArraySize(array, size, value); - }; - Utils.newArray = function (size, defaultValue) { - var array = new Array(size); - for (var i = 0; i < size; i++) - array[i] = defaultValue; - return array; - }; - Utils.newFloatArray = function (size) { - if (Utils.SUPPORTS_TYPED_ARRAYS) { - return new Float32Array(size); - } - else { - var array = new Array(size); - for (var i = 0; i < array.length; i++) - array[i] = 0; - return array; - } - }; - Utils.newShortArray = function (size) { - if (Utils.SUPPORTS_TYPED_ARRAYS) { - return new Int16Array(size); - } - else { - var array = new Array(size); - for (var i = 0; i < array.length; i++) - array[i] = 0; - return array; - } - }; - Utils.toFloatArray = function (array) { - return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; - }; - Utils.toSinglePrecision = function (value) { - return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; - }; - Utils.webkit602BugfixHelper = function (alpha, blend) { - }; - Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== "undefined"; - return Utils; - }()); - spine.Utils = Utils; - var DebugUtils = (function () { - function DebugUtils() { - } - DebugUtils.logBones = function (skeleton) { - for (var i = 0; i < skeleton.bones.length; i++) { - var bone = skeleton.bones[i]; - console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY); - } - }; - return DebugUtils; - }()); - spine.DebugUtils = DebugUtils; - var Pool = (function () { - function Pool(instantiator) { - this.items = new Array(); - this.instantiator = instantiator; - } - Pool.prototype.obtain = function () { - return this.items.length > 0 ? this.items.pop() : this.instantiator(); - }; - Pool.prototype.free = function (item) { - if (item.reset) - item.reset(); - this.items.push(item); - }; - Pool.prototype.freeAll = function (items) { - for (var i = 0; i < items.length; i++) { - if (items[i].reset) - items[i].reset(); - this.items[i] = items[i]; - } - }; - Pool.prototype.clear = function () { - this.items.length = 0; - }; - return Pool; - }()); - spine.Pool = Pool; - var Vector2 = (function () { - function Vector2(x, y) { - if (x === void 0) { x = 0; } - if (y === void 0) { y = 0; } - this.x = x; - this.y = y; - } - Vector2.prototype.set = function (x, y) { - this.x = x; - this.y = y; - return this; - }; - Vector2.prototype.length = function () { - var x = this.x; - var y = this.y; - return Math.sqrt(x * x + y * y); - }; - Vector2.prototype.normalize = function () { - var len = this.length(); - if (len != 0) { - this.x /= len; - this.y /= len; - } - return this; - }; - return Vector2; - }()); - spine.Vector2 = Vector2; - var TimeKeeper = (function () { - function TimeKeeper() { - this.maxDelta = 0.064; - this.framesPerSecond = 0; - this.delta = 0; - this.totalTime = 0; - this.lastTime = Date.now() / 1000; - this.frameCount = 0; - this.frameTime = 0; - } - TimeKeeper.prototype.update = function () { - var now = Date.now() / 1000; - this.delta = now - this.lastTime; - this.frameTime += this.delta; - this.totalTime += this.delta; - if (this.delta > this.maxDelta) - this.delta = this.maxDelta; - this.lastTime = now; - this.frameCount++; - if (this.frameTime > 1) { - this.framesPerSecond = this.frameCount / this.frameTime; - this.frameTime = 0; - this.frameCount = 0; - } - }; - return TimeKeeper; - }()); - spine.TimeKeeper = TimeKeeper; - var WindowedMean = (function () { - function WindowedMean(windowSize) { - if (windowSize === void 0) { windowSize = 32; } - this.addedValues = 0; - this.lastValue = 0; - this.mean = 0; - this.dirty = true; - this.values = new Array(windowSize); - } - WindowedMean.prototype.hasEnoughData = function () { - return this.addedValues >= this.values.length; - }; - WindowedMean.prototype.addValue = function (value) { - if (this.addedValues < this.values.length) - this.addedValues++; - this.values[this.lastValue++] = value; - if (this.lastValue > this.values.length - 1) - this.lastValue = 0; - this.dirty = true; - }; - WindowedMean.prototype.getMean = function () { - if (this.hasEnoughData()) { - if (this.dirty) { - var mean = 0; - for (var i = 0; i < this.values.length; i++) { - mean += this.values[i]; - } - this.mean = mean / this.values.length; - this.dirty = false; - } - return this.mean; - } - else { - return 0; - } - }; - return WindowedMean; - }()); - spine.WindowedMean = WindowedMean; + var IntSet = (function () { + function IntSet() { + this.array = new Array(); + } + IntSet.prototype.add = function (value) { + var contains = this.contains(value); + this.array[value | 0] = value | 0; + return !contains; + }; + IntSet.prototype.contains = function (value) { + return this.array[value | 0] != undefined; + }; + IntSet.prototype.remove = function (value) { + this.array[value | 0] = undefined; + }; + IntSet.prototype.clear = function () { + this.array.length = 0; + }; + return IntSet; + }()); + spine.IntSet = IntSet; + var Color = (function () { + function Color(r, g, b, a) { + if (r === void 0) { r = 0; } + if (g === void 0) { g = 0; } + if (b === void 0) { b = 0; } + if (a === void 0) { a = 0; } + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + Color.prototype.set = function (r, g, b, a) { + this.r = r; + this.g = g; + this.b = b; + this.a = a; + this.clamp(); + return this; + }; + Color.prototype.setFromColor = function (c) { + this.r = c.r; + this.g = c.g; + this.b = c.b; + this.a = c.a; + return this; + }; + Color.prototype.setFromString = function (hex) { + hex = hex.charAt(0) == '#' ? hex.substr(1) : hex; + this.r = parseInt(hex.substr(0, 2), 16) / 255.0; + this.g = parseInt(hex.substr(2, 2), 16) / 255.0; + this.b = parseInt(hex.substr(4, 2), 16) / 255.0; + this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0; + return this; + }; + Color.prototype.add = function (r, g, b, a) { + this.r += r; + this.g += g; + this.b += b; + this.a += a; + this.clamp(); + return this; + }; + Color.prototype.clamp = function () { + if (this.r < 0) + this.r = 0; + else if (this.r > 1) + this.r = 1; + if (this.g < 0) + this.g = 0; + else if (this.g > 1) + this.g = 1; + if (this.b < 0) + this.b = 0; + else if (this.b > 1) + this.b = 1; + if (this.a < 0) + this.a = 0; + else if (this.a > 1) + this.a = 1; + return this; + }; + Color.WHITE = new Color(1, 1, 1, 1); + Color.RED = new Color(1, 0, 0, 1); + Color.GREEN = new Color(0, 1, 0, 1); + Color.BLUE = new Color(0, 0, 1, 1); + Color.MAGENTA = new Color(1, 0, 1, 1); + return Color; + }()); + spine.Color = Color; + var MathUtils = (function () { + function MathUtils() { + } + MathUtils.clamp = function (value, min, max) { + if (value < min) + return min; + if (value > max) + return max; + return value; + }; + MathUtils.cosDeg = function (degrees) { + return Math.cos(degrees * MathUtils.degRad); + }; + MathUtils.sinDeg = function (degrees) { + return Math.sin(degrees * MathUtils.degRad); + }; + MathUtils.signum = function (value) { + return value > 0 ? 1 : value < 0 ? -1 : 0; + }; + MathUtils.toInt = function (x) { + return x > 0 ? Math.floor(x) : Math.ceil(x); + }; + MathUtils.cbrt = function (x) { + var y = Math.pow(Math.abs(x), 1 / 3); + return x < 0 ? -y : y; + }; + MathUtils.randomTriangular = function (min, max) { + return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); + }; + MathUtils.randomTriangularWith = function (min, max, mode) { + var u = Math.random(); + var d = max - min; + if (u <= (mode - min) / d) + return min + Math.sqrt(u * d * (mode - min)); + return max - Math.sqrt((1 - u) * d * (max - mode)); + }; + MathUtils.PI = 3.1415927; + MathUtils.PI2 = MathUtils.PI * 2; + MathUtils.radiansToDegrees = 180 / MathUtils.PI; + MathUtils.radDeg = MathUtils.radiansToDegrees; + MathUtils.degreesToRadians = MathUtils.PI / 180; + MathUtils.degRad = MathUtils.degreesToRadians; + return MathUtils; + }()); + spine.MathUtils = MathUtils; + var Interpolation = (function () { + function Interpolation() { + } + Interpolation.prototype.apply = function (start, end, a) { + return start + (end - start) * this.applyInternal(a); + }; + return Interpolation; + }()); + spine.Interpolation = Interpolation; + var Pow = (function (_super) { + __extends(Pow, _super); + function Pow(power) { + var _this = _super.call(this) || this; + _this.power = 2; + _this.power = power; + return _this; + } + Pow.prototype.applyInternal = function (a) { + if (a <= 0.5) + return Math.pow(a * 2, this.power) / 2; + return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1; + }; + return Pow; + }(Interpolation)); + spine.Pow = Pow; + var PowOut = (function (_super) { + __extends(PowOut, _super); + function PowOut(power) { + return _super.call(this, power) || this; + } + PowOut.prototype.applyInternal = function (a) { + return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1; + }; + return PowOut; + }(Pow)); + spine.PowOut = PowOut; + var Utils = (function () { + function Utils() { + } + Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) { + for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { + dest[j] = source[i]; + } + }; + Utils.setArraySize = function (array, size, value) { + if (value === void 0) { value = 0; } + var oldSize = array.length; + if (oldSize == size) + return array; + array.length = size; + if (oldSize < size) { + for (var i = oldSize; i < size; i++) + array[i] = value; + } + return array; + }; + Utils.ensureArrayCapacity = function (array, size, value) { + if (value === void 0) { value = 0; } + if (array.length >= size) + return array; + return Utils.setArraySize(array, size, value); + }; + Utils.newArray = function (size, defaultValue) { + var array = new Array(size); + for (var i = 0; i < size; i++) + array[i] = defaultValue; + return array; + }; + Utils.newFloatArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Float32Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.newShortArray = function (size) { + if (Utils.SUPPORTS_TYPED_ARRAYS) { + return new Int16Array(size); + } + else { + var array = new Array(size); + for (var i = 0; i < array.length; i++) + array[i] = 0; + return array; + } + }; + Utils.toFloatArray = function (array) { + return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; + }; + Utils.toSinglePrecision = function (value) { + return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; + }; + Utils.webkit602BugfixHelper = function (alpha, blend) { + }; + Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== "undefined"; + return Utils; + }()); + spine.Utils = Utils; + var DebugUtils = (function () { + function DebugUtils() { + } + DebugUtils.logBones = function (skeleton) { + for (var i = 0; i < skeleton.bones.length; i++) { + var bone = skeleton.bones[i]; + console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY); + } + }; + return DebugUtils; + }()); + spine.DebugUtils = DebugUtils; + var Pool = (function () { + function Pool(instantiator) { + this.items = new Array(); + this.instantiator = instantiator; + } + Pool.prototype.obtain = function () { + return this.items.length > 0 ? this.items.pop() : this.instantiator(); + }; + Pool.prototype.free = function (item) { + if (item.reset) + item.reset(); + this.items.push(item); + }; + Pool.prototype.freeAll = function (items) { + for (var i = 0; i < items.length; i++) { + if (items[i].reset) + items[i].reset(); + this.items[i] = items[i]; + } + }; + Pool.prototype.clear = function () { + this.items.length = 0; + }; + return Pool; + }()); + spine.Pool = Pool; + var Vector2 = (function () { + function Vector2(x, y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + this.x = x; + this.y = y; + } + Vector2.prototype.set = function (x, y) { + this.x = x; + this.y = y; + return this; + }; + Vector2.prototype.length = function () { + var x = this.x; + var y = this.y; + return Math.sqrt(x * x + y * y); + }; + Vector2.prototype.normalize = function () { + var len = this.length(); + if (len != 0) { + this.x /= len; + this.y /= len; + } + return this; + }; + return Vector2; + }()); + spine.Vector2 = Vector2; + var TimeKeeper = (function () { + function TimeKeeper() { + this.maxDelta = 0.064; + this.framesPerSecond = 0; + this.delta = 0; + this.totalTime = 0; + this.lastTime = Date.now() / 1000; + this.frameCount = 0; + this.frameTime = 0; + } + TimeKeeper.prototype.update = function () { + var now = Date.now() / 1000; + this.delta = now - this.lastTime; + this.frameTime += this.delta; + this.totalTime += this.delta; + if (this.delta > this.maxDelta) + this.delta = this.maxDelta; + this.lastTime = now; + this.frameCount++; + if (this.frameTime > 1) { + this.framesPerSecond = this.frameCount / this.frameTime; + this.frameTime = 0; + this.frameCount = 0; + } + }; + return TimeKeeper; + }()); + spine.TimeKeeper = TimeKeeper; + var WindowedMean = (function () { + function WindowedMean(windowSize) { + if (windowSize === void 0) { windowSize = 32; } + this.addedValues = 0; + this.lastValue = 0; + this.mean = 0; + this.dirty = true; + this.values = new Array(windowSize); + } + WindowedMean.prototype.hasEnoughData = function () { + return this.addedValues >= this.values.length; + }; + WindowedMean.prototype.addValue = function (value) { + if (this.addedValues < this.values.length) + this.addedValues++; + this.values[this.lastValue++] = value; + if (this.lastValue > this.values.length - 1) + this.lastValue = 0; + this.dirty = true; + }; + WindowedMean.prototype.getMean = function () { + if (this.hasEnoughData()) { + if (this.dirty) { + var mean = 0; + for (var i = 0; i < this.values.length; i++) { + mean += this.values[i]; + } + this.mean = mean / this.values.length; + this.dirty = false; + } + return this.mean; + } + else { + return 0; + } + }; + return WindowedMean; + }()); + spine.WindowedMean = WindowedMean; })(spine || (spine = {})); (function () { - if (!Math.fround) { - Math.fround = (function (array) { - return function (x) { - return array[0] = x, array[0]; - }; - })(new Float32Array(1)); - } + if (!Math.fround) { + Math.fround = (function (array) { + return function (x) { + return array[0] = x, array[0]; + }; + })(new Float32Array(1)); + } })(); var spine; (function (spine) { - var Attachment = (function () { - function Attachment(name) { - if (name == null) - throw new Error("name cannot be null."); - this.name = name; - } - return Attachment; - }()); - spine.Attachment = Attachment; - var VertexAttachment = (function (_super) { - __extends(VertexAttachment, _super); - function VertexAttachment(name) { - var _this = _super.call(this, name) || this; - _this.id = (VertexAttachment.nextID++ & 65535) << 11; - _this.worldVerticesLength = 0; - return _this; - } - VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) { - count = offset + (count >> 1) * stride; - var skeleton = slot.bone.skeleton; - var deformArray = slot.attachmentVertices; - var vertices = this.vertices; - var bones = this.bones; - if (bones == null) { - if (deformArray.length > 0) - vertices = deformArray; - var bone = slot.bone; - var x = bone.worldX; - var y = bone.worldY; - var a = bone.a, b = bone.b, c = bone.c, d = bone.d; - for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) { - var vx = vertices[v_1], vy = vertices[v_1 + 1]; - worldVertices[w] = vx * a + vy * b + x; - worldVertices[w + 1] = vx * c + vy * d + y; - } - return; - } - var v = 0, skip = 0; - for (var i = 0; i < start; i += 2) { - var n = bones[v]; - v += n + 1; - skip += n; - } - var skeletonBones = skeleton.bones; - if (deformArray.length == 0) { - for (var w = offset, b = skip * 3; w < count; w += stride) { - var wx = 0, wy = 0; - var n = bones[v++]; - n += v; - for (; v < n; v++, b += 3) { - var bone = skeletonBones[bones[v]]; - var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; - wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; - wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; - } - worldVertices[w] = wx; - worldVertices[w + 1] = wy; - } - } - else { - var deform = deformArray; - for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { - var wx = 0, wy = 0; - var n = bones[v++]; - n += v; - for (; v < n; v++, b += 3, f += 2) { - var bone = skeletonBones[bones[v]]; - var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; - wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; - wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; - } - worldVertices[w] = wx; - worldVertices[w + 1] = wy; - } - } - }; - VertexAttachment.prototype.applyDeform = function (sourceAttachment) { - return this == sourceAttachment; - }; - VertexAttachment.nextID = 0; - return VertexAttachment; - }(Attachment)); - spine.VertexAttachment = VertexAttachment; + var Attachment = (function () { + function Attachment(name) { + if (name == null) + throw new Error("name cannot be null."); + this.name = name; + } + return Attachment; + }()); + spine.Attachment = Attachment; + var VertexAttachment = (function (_super) { + __extends(VertexAttachment, _super); + function VertexAttachment(name) { + var _this = _super.call(this, name) || this; + _this.id = (VertexAttachment.nextID++ & 65535) << 11; + _this.worldVerticesLength = 0; + return _this; + } + VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) { + count = offset + (count >> 1) * stride; + var skeleton = slot.bone.skeleton; + var deformArray = slot.attachmentVertices; + var vertices = this.vertices; + var bones = this.bones; + if (bones == null) { + if (deformArray.length > 0) + vertices = deformArray; + var bone = slot.bone; + var x = bone.worldX; + var y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) { + var vx = vertices[v_1], vy = vertices[v_1 + 1]; + worldVertices[w] = vx * a + vy * b + x; + worldVertices[w + 1] = vx * c + vy * d + y; + } + return; + } + var v = 0, skip = 0; + for (var i = 0; i < start; i += 2) { + var n = bones[v]; + v += n + 1; + skip += n; + } + var skeletonBones = skeleton.bones; + if (deformArray.length == 0) { + for (var w = offset, b = skip * 3; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + else { + var deform = deformArray; + for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { + var wx = 0, wy = 0; + var n = bones[v++]; + n += v; + for (; v < n; v++, b += 3, f += 2) { + var bone = skeletonBones[bones[v]]; + var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; + wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; + wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; + } + worldVertices[w] = wx; + worldVertices[w + 1] = wy; + } + } + }; + VertexAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment; + }; + VertexAttachment.nextID = 0; + return VertexAttachment; + }(Attachment)); + spine.VertexAttachment = VertexAttachment; })(spine || (spine = {})); var spine; (function (spine) { - var AttachmentType; - (function (AttachmentType) { - AttachmentType[AttachmentType["Region"] = 0] = "Region"; - AttachmentType[AttachmentType["BoundingBox"] = 1] = "BoundingBox"; - AttachmentType[AttachmentType["Mesh"] = 2] = "Mesh"; - AttachmentType[AttachmentType["LinkedMesh"] = 3] = "LinkedMesh"; - AttachmentType[AttachmentType["Path"] = 4] = "Path"; - AttachmentType[AttachmentType["Point"] = 5] = "Point"; - })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {})); + var AttachmentType; + (function (AttachmentType) { + AttachmentType[AttachmentType["Region"] = 0] = "Region"; + AttachmentType[AttachmentType["BoundingBox"] = 1] = "BoundingBox"; + AttachmentType[AttachmentType["Mesh"] = 2] = "Mesh"; + AttachmentType[AttachmentType["LinkedMesh"] = 3] = "LinkedMesh"; + AttachmentType[AttachmentType["Path"] = 4] = "Path"; + AttachmentType[AttachmentType["Point"] = 5] = "Point"; + })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {})); })(spine || (spine = {})); var spine; (function (spine) { - var BoundingBoxAttachment = (function (_super) { - __extends(BoundingBoxAttachment, _super); - function BoundingBoxAttachment(name) { - var _this = _super.call(this, name) || this; - _this.color = new spine.Color(1, 1, 1, 1); - return _this; - } - return BoundingBoxAttachment; - }(spine.VertexAttachment)); - spine.BoundingBoxAttachment = BoundingBoxAttachment; + var BoundingBoxAttachment = (function (_super) { + __extends(BoundingBoxAttachment, _super); + function BoundingBoxAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return BoundingBoxAttachment; + }(spine.VertexAttachment)); + spine.BoundingBoxAttachment = BoundingBoxAttachment; })(spine || (spine = {})); var spine; (function (spine) { - var ClippingAttachment = (function (_super) { - __extends(ClippingAttachment, _super); - function ClippingAttachment(name) { - var _this = _super.call(this, name) || this; - _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1); - return _this; - } - return ClippingAttachment; - }(spine.VertexAttachment)); - spine.ClippingAttachment = ClippingAttachment; + var ClippingAttachment = (function (_super) { + __extends(ClippingAttachment, _super); + function ClippingAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1); + return _this; + } + return ClippingAttachment; + }(spine.VertexAttachment)); + spine.ClippingAttachment = ClippingAttachment; })(spine || (spine = {})); var spine; (function (spine) { - var MeshAttachment = (function (_super) { - __extends(MeshAttachment, _super); - function MeshAttachment(name) { - var _this = _super.call(this, name) || this; - _this.color = new spine.Color(1, 1, 1, 1); - _this.inheritDeform = false; - _this.tempColor = new spine.Color(0, 0, 0, 0); - return _this; - } - MeshAttachment.prototype.updateUVs = function () { - var regionUVs = this.regionUVs; - if (this.uvs == null || this.uvs.length != regionUVs.length) - this.uvs = spine.Utils.newFloatArray(regionUVs.length); - var uvs = this.uvs; - var u = 0, v = 0, width = 0, height = 0; - if (this.region instanceof spine.TextureAtlasRegion) { - var region = this.region; - var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height; - if (region.rotate) { - u = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth; - v = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight; - width = region.originalHeight / textureWidth; - height = region.originalWidth / textureHeight; - for (var i = 0, n = uvs.length; i < n; i += 2) { - uvs[i] = u + regionUVs[i + 1] * width; - uvs[i + 1] = v + height - regionUVs[i] * height; - } - return; - } - u = region.u - region.offsetX / textureWidth; - v = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight; - width = region.originalWidth / textureWidth; - height = region.originalHeight / textureHeight; - } - else if (this.region == null) { - u = v = 0; - width = height = 1; - } - else { - u = this.region.u; - v = this.region.v; - width = this.region.u2 - u; - height = this.region.v2 - v; - } - for (var i = 0, n = uvs.length; i < n; i += 2) { - uvs[i] = u + regionUVs[i] * width; - uvs[i + 1] = v + regionUVs[i + 1] * height; - } - }; - MeshAttachment.prototype.applyDeform = function (sourceAttachment) { - return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment); - }; - MeshAttachment.prototype.getParentMesh = function () { - return this.parentMesh; - }; - MeshAttachment.prototype.setParentMesh = function (parentMesh) { - this.parentMesh = parentMesh; - if (parentMesh != null) { - this.bones = parentMesh.bones; - this.vertices = parentMesh.vertices; - this.worldVerticesLength = parentMesh.worldVerticesLength; - this.regionUVs = parentMesh.regionUVs; - this.triangles = parentMesh.triangles; - this.hullLength = parentMesh.hullLength; - this.worldVerticesLength = parentMesh.worldVerticesLength; - } - }; - return MeshAttachment; - }(spine.VertexAttachment)); - spine.MeshAttachment = MeshAttachment; + var MeshAttachment = (function (_super) { + __extends(MeshAttachment, _super); + function MeshAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(1, 1, 1, 1); + _this.inheritDeform = false; + _this.tempColor = new spine.Color(0, 0, 0, 0); + return _this; + } + MeshAttachment.prototype.updateUVs = function () { + var regionUVs = this.regionUVs; + if (this.uvs == null || this.uvs.length != regionUVs.length) + this.uvs = spine.Utils.newFloatArray(regionUVs.length); + var uvs = this.uvs; + var u = 0, v = 0, width = 0, height = 0; + if (this.region instanceof spine.TextureAtlasRegion) { + var region = this.region; + var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height; + if (region.rotate) { + u = region.u - (region.originalHeight - region.offsetY - region.height) / textureWidth; + v = region.v - (region.originalWidth - region.offsetX - region.width) / textureHeight; + width = region.originalHeight / textureWidth; + height = region.originalWidth / textureHeight; + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i + 1] * width; + uvs[i + 1] = v + height - regionUVs[i] * height; + } + return; + } + u = region.u - region.offsetX / textureWidth; + v = region.v - (region.originalHeight - region.offsetY - region.height) / textureHeight; + width = region.originalWidth / textureWidth; + height = region.originalHeight / textureHeight; + } + else if (this.region == null) { + u = v = 0; + width = height = 1; + } + else { + u = this.region.u; + v = this.region.v; + width = this.region.u2 - u; + height = this.region.v2 - v; + } + for (var i = 0, n = uvs.length; i < n; i += 2) { + uvs[i] = u + regionUVs[i] * width; + uvs[i + 1] = v + regionUVs[i + 1] * height; + } + }; + MeshAttachment.prototype.applyDeform = function (sourceAttachment) { + return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment); + }; + MeshAttachment.prototype.getParentMesh = function () { + return this.parentMesh; + }; + MeshAttachment.prototype.setParentMesh = function (parentMesh) { + this.parentMesh = parentMesh; + if (parentMesh != null) { + this.bones = parentMesh.bones; + this.vertices = parentMesh.vertices; + this.worldVerticesLength = parentMesh.worldVerticesLength; + this.regionUVs = parentMesh.regionUVs; + this.triangles = parentMesh.triangles; + this.hullLength = parentMesh.hullLength; + this.worldVerticesLength = parentMesh.worldVerticesLength; + } + }; + return MeshAttachment; + }(spine.VertexAttachment)); + spine.MeshAttachment = MeshAttachment; })(spine || (spine = {})); var spine; (function (spine) { - var PathAttachment = (function (_super) { - __extends(PathAttachment, _super); - function PathAttachment(name) { - var _this = _super.call(this, name) || this; - _this.closed = false; - _this.constantSpeed = false; - _this.color = new spine.Color(1, 1, 1, 1); - return _this; - } - return PathAttachment; - }(spine.VertexAttachment)); - spine.PathAttachment = PathAttachment; + var PathAttachment = (function (_super) { + __extends(PathAttachment, _super); + function PathAttachment(name) { + var _this = _super.call(this, name) || this; + _this.closed = false; + _this.constantSpeed = false; + _this.color = new spine.Color(1, 1, 1, 1); + return _this; + } + return PathAttachment; + }(spine.VertexAttachment)); + spine.PathAttachment = PathAttachment; })(spine || (spine = {})); var spine; (function (spine) { - var PointAttachment = (function (_super) { - __extends(PointAttachment, _super); - function PointAttachment(name) { - var _this = _super.call(this, name) || this; - _this.color = new spine.Color(0.38, 0.94, 0, 1); - return _this; - } - PointAttachment.prototype.computeWorldPosition = function (bone, point) { - point.x = this.x * bone.a + this.y * bone.b + bone.worldX; - point.y = this.x * bone.c + this.y * bone.d + bone.worldY; - return point; - }; - PointAttachment.prototype.computeWorldRotation = function (bone) { - var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation); - var x = cos * bone.a + sin * bone.b; - var y = cos * bone.c + sin * bone.d; - return Math.atan2(y, x) * spine.MathUtils.radDeg; - }; - return PointAttachment; - }(spine.VertexAttachment)); - spine.PointAttachment = PointAttachment; + var PointAttachment = (function (_super) { + __extends(PointAttachment, _super); + function PointAttachment(name) { + var _this = _super.call(this, name) || this; + _this.color = new spine.Color(0.38, 0.94, 0, 1); + return _this; + } + PointAttachment.prototype.computeWorldPosition = function (bone, point) { + point.x = this.x * bone.a + this.y * bone.b + bone.worldX; + point.y = this.x * bone.c + this.y * bone.d + bone.worldY; + return point; + }; + PointAttachment.prototype.computeWorldRotation = function (bone) { + var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation); + var x = cos * bone.a + sin * bone.b; + var y = cos * bone.c + sin * bone.d; + return Math.atan2(y, x) * spine.MathUtils.radDeg; + }; + return PointAttachment; + }(spine.VertexAttachment)); + spine.PointAttachment = PointAttachment; })(spine || (spine = {})); var spine; (function (spine) { - var RegionAttachment = (function (_super) { - __extends(RegionAttachment, _super); - function RegionAttachment(name) { - var _this = _super.call(this, name) || this; - _this.x = 0; - _this.y = 0; - _this.scaleX = 1; - _this.scaleY = 1; - _this.rotation = 0; - _this.width = 0; - _this.height = 0; - _this.color = new spine.Color(1, 1, 1, 1); - _this.offset = spine.Utils.newFloatArray(8); - _this.uvs = spine.Utils.newFloatArray(8); - _this.tempColor = new spine.Color(1, 1, 1, 1); - return _this; - } - RegionAttachment.prototype.updateOffset = function () { - var regionScaleX = this.width / this.region.originalWidth * this.scaleX; - var regionScaleY = this.height / this.region.originalHeight * this.scaleY; - var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; - var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; - var localX2 = localX + this.region.width * regionScaleX; - var localY2 = localY + this.region.height * regionScaleY; - var radians = this.rotation * Math.PI / 180; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - var localXCos = localX * cos + this.x; - var localXSin = localX * sin; - var localYCos = localY * cos + this.y; - var localYSin = localY * sin; - var localX2Cos = localX2 * cos + this.x; - var localX2Sin = localX2 * sin; - var localY2Cos = localY2 * cos + this.y; - var localY2Sin = localY2 * sin; - var offset = this.offset; - offset[RegionAttachment.OX1] = localXCos - localYSin; - offset[RegionAttachment.OY1] = localYCos + localXSin; - offset[RegionAttachment.OX2] = localXCos - localY2Sin; - offset[RegionAttachment.OY2] = localY2Cos + localXSin; - offset[RegionAttachment.OX3] = localX2Cos - localY2Sin; - offset[RegionAttachment.OY3] = localY2Cos + localX2Sin; - offset[RegionAttachment.OX4] = localX2Cos - localYSin; - offset[RegionAttachment.OY4] = localYCos + localX2Sin; - }; - RegionAttachment.prototype.setRegion = function (region) { - this.region = region; - var uvs = this.uvs; - if (region.rotate) { - uvs[2] = region.u; - uvs[3] = region.v2; - uvs[4] = region.u; - uvs[5] = region.v; - uvs[6] = region.u2; - uvs[7] = region.v; - uvs[0] = region.u2; - uvs[1] = region.v2; - } - else { - uvs[0] = region.u; - uvs[1] = region.v2; - uvs[2] = region.u; - uvs[3] = region.v; - uvs[4] = region.u2; - uvs[5] = region.v; - uvs[6] = region.u2; - uvs[7] = region.v2; - } - }; - RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) { - var vertexOffset = this.offset; - var x = bone.worldX, y = bone.worldY; - var a = bone.a, b = bone.b, c = bone.c, d = bone.d; - var offsetX = 0, offsetY = 0; - offsetX = vertexOffset[RegionAttachment.OX1]; - offsetY = vertexOffset[RegionAttachment.OY1]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[RegionAttachment.OX2]; - offsetY = vertexOffset[RegionAttachment.OY2]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[RegionAttachment.OX3]; - offsetY = vertexOffset[RegionAttachment.OY3]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[RegionAttachment.OX4]; - offsetY = vertexOffset[RegionAttachment.OY4]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - }; - RegionAttachment.OX1 = 0; - RegionAttachment.OY1 = 1; - RegionAttachment.OX2 = 2; - RegionAttachment.OY2 = 3; - RegionAttachment.OX3 = 4; - RegionAttachment.OY3 = 5; - RegionAttachment.OX4 = 6; - RegionAttachment.OY4 = 7; - RegionAttachment.X1 = 0; - RegionAttachment.Y1 = 1; - RegionAttachment.C1R = 2; - RegionAttachment.C1G = 3; - RegionAttachment.C1B = 4; - RegionAttachment.C1A = 5; - RegionAttachment.U1 = 6; - RegionAttachment.V1 = 7; - RegionAttachment.X2 = 8; - RegionAttachment.Y2 = 9; - RegionAttachment.C2R = 10; - RegionAttachment.C2G = 11; - RegionAttachment.C2B = 12; - RegionAttachment.C2A = 13; - RegionAttachment.U2 = 14; - RegionAttachment.V2 = 15; - RegionAttachment.X3 = 16; - RegionAttachment.Y3 = 17; - RegionAttachment.C3R = 18; - RegionAttachment.C3G = 19; - RegionAttachment.C3B = 20; - RegionAttachment.C3A = 21; - RegionAttachment.U3 = 22; - RegionAttachment.V3 = 23; - RegionAttachment.X4 = 24; - RegionAttachment.Y4 = 25; - RegionAttachment.C4R = 26; - RegionAttachment.C4G = 27; - RegionAttachment.C4B = 28; - RegionAttachment.C4A = 29; - RegionAttachment.U4 = 30; - RegionAttachment.V4 = 31; - return RegionAttachment; - }(spine.Attachment)); - spine.RegionAttachment = RegionAttachment; + var RegionAttachment = (function (_super) { + __extends(RegionAttachment, _super); + function RegionAttachment(name) { + var _this = _super.call(this, name) || this; + _this.x = 0; + _this.y = 0; + _this.scaleX = 1; + _this.scaleY = 1; + _this.rotation = 0; + _this.width = 0; + _this.height = 0; + _this.color = new spine.Color(1, 1, 1, 1); + _this.offset = spine.Utils.newFloatArray(8); + _this.uvs = spine.Utils.newFloatArray(8); + _this.tempColor = new spine.Color(1, 1, 1, 1); + return _this; + } + RegionAttachment.prototype.updateOffset = function () { + var regionScaleX = this.width / this.region.originalWidth * this.scaleX; + var regionScaleY = this.height / this.region.originalHeight * this.scaleY; + var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; + var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; + var localX2 = localX + this.region.width * regionScaleX; + var localY2 = localY + this.region.height * regionScaleY; + var radians = this.rotation * Math.PI / 180; + var cos = Math.cos(radians); + var sin = Math.sin(radians); + var localXCos = localX * cos + this.x; + var localXSin = localX * sin; + var localYCos = localY * cos + this.y; + var localYSin = localY * sin; + var localX2Cos = localX2 * cos + this.x; + var localX2Sin = localX2 * sin; + var localY2Cos = localY2 * cos + this.y; + var localY2Sin = localY2 * sin; + var offset = this.offset; + offset[RegionAttachment.OX1] = localXCos - localYSin; + offset[RegionAttachment.OY1] = localYCos + localXSin; + offset[RegionAttachment.OX2] = localXCos - localY2Sin; + offset[RegionAttachment.OY2] = localY2Cos + localXSin; + offset[RegionAttachment.OX3] = localX2Cos - localY2Sin; + offset[RegionAttachment.OY3] = localY2Cos + localX2Sin; + offset[RegionAttachment.OX4] = localX2Cos - localYSin; + offset[RegionAttachment.OY4] = localYCos + localX2Sin; + }; + RegionAttachment.prototype.setRegion = function (region) { + this.region = region; + var uvs = this.uvs; + if (region.rotate) { + uvs[2] = region.u; + uvs[3] = region.v2; + uvs[4] = region.u; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v; + uvs[0] = region.u2; + uvs[1] = region.v2; + } + else { + uvs[0] = region.u; + uvs[1] = region.v2; + uvs[2] = region.u; + uvs[3] = region.v; + uvs[4] = region.u2; + uvs[5] = region.v; + uvs[6] = region.u2; + uvs[7] = region.v2; + } + }; + RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) { + var vertexOffset = this.offset; + var x = bone.worldX, y = bone.worldY; + var a = bone.a, b = bone.b, c = bone.c, d = bone.d; + var offsetX = 0, offsetY = 0; + offsetX = vertexOffset[RegionAttachment.OX1]; + offsetY = vertexOffset[RegionAttachment.OY1]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX2]; + offsetY = vertexOffset[RegionAttachment.OY2]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX3]; + offsetY = vertexOffset[RegionAttachment.OY3]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + offset += stride; + offsetX = vertexOffset[RegionAttachment.OX4]; + offsetY = vertexOffset[RegionAttachment.OY4]; + worldVertices[offset] = offsetX * a + offsetY * b + x; + worldVertices[offset + 1] = offsetX * c + offsetY * d + y; + }; + RegionAttachment.OX1 = 0; + RegionAttachment.OY1 = 1; + RegionAttachment.OX2 = 2; + RegionAttachment.OY2 = 3; + RegionAttachment.OX3 = 4; + RegionAttachment.OY3 = 5; + RegionAttachment.OX4 = 6; + RegionAttachment.OY4 = 7; + RegionAttachment.X1 = 0; + RegionAttachment.Y1 = 1; + RegionAttachment.C1R = 2; + RegionAttachment.C1G = 3; + RegionAttachment.C1B = 4; + RegionAttachment.C1A = 5; + RegionAttachment.U1 = 6; + RegionAttachment.V1 = 7; + RegionAttachment.X2 = 8; + RegionAttachment.Y2 = 9; + RegionAttachment.C2R = 10; + RegionAttachment.C2G = 11; + RegionAttachment.C2B = 12; + RegionAttachment.C2A = 13; + RegionAttachment.U2 = 14; + RegionAttachment.V2 = 15; + RegionAttachment.X3 = 16; + RegionAttachment.Y3 = 17; + RegionAttachment.C3R = 18; + RegionAttachment.C3G = 19; + RegionAttachment.C3B = 20; + RegionAttachment.C3A = 21; + RegionAttachment.U3 = 22; + RegionAttachment.V3 = 23; + RegionAttachment.X4 = 24; + RegionAttachment.Y4 = 25; + RegionAttachment.C4R = 26; + RegionAttachment.C4G = 27; + RegionAttachment.C4B = 28; + RegionAttachment.C4A = 29; + RegionAttachment.U4 = 30; + RegionAttachment.V4 = 31; + return RegionAttachment; + }(spine.Attachment)); + spine.RegionAttachment = RegionAttachment; })(spine || (spine = {})); var spine; (function (spine) { - var JitterEffect = (function () { - function JitterEffect(jitterX, jitterY) { - this.jitterX = 0; - this.jitterY = 0; - this.jitterX = jitterX; - this.jitterY = jitterY; - } - JitterEffect.prototype.begin = function (skeleton) { - }; - JitterEffect.prototype.transform = function (position, uv, light, dark) { - position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); - position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); - }; - JitterEffect.prototype.end = function () { - }; - return JitterEffect; - }()); - spine.JitterEffect = JitterEffect; + var JitterEffect = (function () { + function JitterEffect(jitterX, jitterY) { + this.jitterX = 0; + this.jitterY = 0; + this.jitterX = jitterX; + this.jitterY = jitterY; + } + JitterEffect.prototype.begin = function (skeleton) { + }; + JitterEffect.prototype.transform = function (position, uv, light, dark) { + position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY); + }; + JitterEffect.prototype.end = function () { + }; + return JitterEffect; + }()); + spine.JitterEffect = JitterEffect; })(spine || (spine = {})); var spine; (function (spine) { - var SwirlEffect = (function () { - function SwirlEffect(radius) { - this.centerX = 0; - this.centerY = 0; - this.radius = 0; - this.angle = 0; - this.worldX = 0; - this.worldY = 0; - this.radius = radius; - } - SwirlEffect.prototype.begin = function (skeleton) { - this.worldX = skeleton.x + this.centerX; - this.worldY = skeleton.y + this.centerY; - }; - SwirlEffect.prototype.transform = function (position, uv, light, dark) { - var radAngle = this.angle * spine.MathUtils.degreesToRadians; - var x = position.x - this.worldX; - var y = position.y - this.worldY; - var dist = Math.sqrt(x * x + y * y); - if (dist < this.radius) { - var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius); - var cos = Math.cos(theta); - var sin = Math.sin(theta); - position.x = cos * x - sin * y + this.worldX; - position.y = sin * x + cos * y + this.worldY; - } - }; - SwirlEffect.prototype.end = function () { - }; - SwirlEffect.interpolation = new spine.PowOut(2); - return SwirlEffect; - }()); - spine.SwirlEffect = SwirlEffect; + var SwirlEffect = (function () { + function SwirlEffect(radius) { + this.centerX = 0; + this.centerY = 0; + this.radius = 0; + this.angle = 0; + this.worldX = 0; + this.worldY = 0; + this.radius = radius; + } + SwirlEffect.prototype.begin = function (skeleton) { + this.worldX = skeleton.x + this.centerX; + this.worldY = skeleton.y + this.centerY; + }; + SwirlEffect.prototype.transform = function (position, uv, light, dark) { + var radAngle = this.angle * spine.MathUtils.degreesToRadians; + var x = position.x - this.worldX; + var y = position.y - this.worldY; + var dist = Math.sqrt(x * x + y * y); + if (dist < this.radius) { + var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius); + var cos = Math.cos(theta); + var sin = Math.sin(theta); + position.x = cos * x - sin * y + this.worldX; + position.y = sin * x + cos * y + this.worldY; + } + }; + SwirlEffect.prototype.end = function () { + }; + SwirlEffect.interpolation = new spine.PowOut(2); + return SwirlEffect; + }()); + spine.SwirlEffect = SwirlEffect; })(spine || (spine = {})); var spine; (function (spine) { - var canvas; - (function (canvas) { - var AssetManager = (function (_super) { - __extends(AssetManager, _super); - function AssetManager(pathPrefix) { - if (pathPrefix === void 0) { pathPrefix = ""; } - return _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this; - } - return AssetManager; - }(spine.AssetManager)); - canvas.AssetManager = AssetManager; - })(canvas = spine.canvas || (spine.canvas = {})); + var canvas; + (function (canvas) { + var AssetManager = (function (_super) { + __extends(AssetManager, _super); + function AssetManager(pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + return _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this; + } + return AssetManager; + }(spine.AssetManager)); + canvas.AssetManager = AssetManager; + })(canvas = spine.canvas || (spine.canvas = {})); })(spine || (spine = {})); var spine; (function (spine) { - var canvas; - (function (canvas) { - var CanvasTexture = (function (_super) { - __extends(CanvasTexture, _super); - function CanvasTexture(image) { - return _super.call(this, image) || this; - } - CanvasTexture.prototype.setFilters = function (minFilter, magFilter) { }; - CanvasTexture.prototype.setWraps = function (uWrap, vWrap) { }; - CanvasTexture.prototype.dispose = function () { }; - return CanvasTexture; - }(spine.Texture)); - canvas.CanvasTexture = CanvasTexture; - })(canvas = spine.canvas || (spine.canvas = {})); + var canvas; + (function (canvas) { + var CanvasTexture = (function (_super) { + __extends(CanvasTexture, _super); + function CanvasTexture(image) { + return _super.call(this, image) || this; + } + CanvasTexture.prototype.setFilters = function (minFilter, magFilter) { }; + CanvasTexture.prototype.setWraps = function (uWrap, vWrap) { }; + CanvasTexture.prototype.dispose = function () { }; + return CanvasTexture; + }(spine.Texture)); + canvas.CanvasTexture = CanvasTexture; + })(canvas = spine.canvas || (spine.canvas = {})); })(spine || (spine = {})); var spine; (function (spine) { - var canvas; - (function (canvas) { - var SkeletonRenderer = (function () { - function SkeletonRenderer(context) { - this.triangleRendering = false; - this.debugRendering = false; - this.vertices = spine.Utils.newFloatArray(8 * 1024); - this.tempColor = new spine.Color(); - this.ctx = context; - } - SkeletonRenderer.prototype.draw = function (skeleton) { - if (this.triangleRendering) - this.drawTriangles(skeleton); - else - this.drawImages(skeleton); - }; - SkeletonRenderer.prototype.drawImages = function (skeleton) { - var ctx = this.ctx; - var drawOrder = skeleton.drawOrder; - if (this.debugRendering) - ctx.strokeStyle = "green"; - ctx.save(); - for (var i = 0, n = drawOrder.length; i < n; i++) { - var slot = drawOrder[i]; - var attachment = slot.getAttachment(); - var regionAttachment = null; - var region = null; - var image = null; - if (attachment instanceof spine.RegionAttachment) { - regionAttachment = attachment; - region = regionAttachment.region; - image = region.texture.getImage(); - } - else - continue; - var skeleton_1 = slot.bone.skeleton; - var skeletonColor = skeleton_1.color; - var slotColor = slot.color; - var regionColor = regionAttachment.color; - var alpha = skeletonColor.a * slotColor.a * regionColor.a; - var color = this.tempColor; - color.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha); - var att = attachment; - var bone = slot.bone; - var w = region.width; - var h = region.height; - ctx.save(); - ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY); - ctx.translate(attachment.offset[0], attachment.offset[1]); - ctx.rotate(attachment.rotation * Math.PI / 180); - var atlasScale = att.width / w; - ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY); - ctx.translate(w / 2, h / 2); - if (attachment.region.rotate) { - var t = w; - w = h; - h = t; - ctx.rotate(-Math.PI / 2); - } - ctx.scale(1, -1); - ctx.translate(-w / 2, -h / 2); - if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { - ctx.globalAlpha = color.a; - } - ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h); - if (this.debugRendering) - ctx.strokeRect(0, 0, w, h); - ctx.restore(); - } - ctx.restore(); - }; - SkeletonRenderer.prototype.drawTriangles = function (skeleton) { - var blendMode = null; - var vertices = this.vertices; - var triangles = null; - var drawOrder = skeleton.drawOrder; - for (var i = 0, n = drawOrder.length; i < n; i++) { - var slot = drawOrder[i]; - var attachment = slot.getAttachment(); - var texture = null; - var region = null; - if (attachment instanceof spine.RegionAttachment) { - var regionAttachment = attachment; - vertices = this.computeRegionVertices(slot, regionAttachment, false); - triangles = SkeletonRenderer.QUAD_TRIANGLES; - region = regionAttachment.region; - texture = region.texture.getImage(); - } - else if (attachment instanceof spine.MeshAttachment) { - var mesh = attachment; - vertices = this.computeMeshVertices(slot, mesh, false); - triangles = mesh.triangles; - texture = mesh.region.renderObject.texture.getImage(); - } - else - continue; - if (texture != null) { - var slotBlendMode = slot.data.blendMode; - if (slotBlendMode != blendMode) { - blendMode = slotBlendMode; - } - var skeleton_2 = slot.bone.skeleton; - var skeletonColor = skeleton_2.color; - var slotColor = slot.color; - var attachmentColor = attachment.color; - var alpha = skeletonColor.a * slotColor.a * attachmentColor.a; - var color = this.tempColor; - color.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha); - var ctx = this.ctx; - if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { - ctx.globalAlpha = color.a; - } - for (var j = 0; j < triangles.length; j += 3) { - var t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8; - var x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7]; - var x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7]; - var x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7]; - this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2); - if (this.debugRendering) { - ctx.strokeStyle = "green"; - ctx.beginPath(); - ctx.moveTo(x0, y0); - ctx.lineTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.lineTo(x0, y0); - ctx.stroke(); - } - } - } - } - this.ctx.globalAlpha = 1; - }; - SkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) { - var ctx = this.ctx; - u0 *= img.width; - v0 *= img.height; - u1 *= img.width; - v1 *= img.height; - u2 *= img.width; - v2 *= img.height; - ctx.beginPath(); - ctx.moveTo(x0, y0); - ctx.lineTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.closePath(); - x1 -= x0; - y1 -= y0; - x2 -= x0; - y2 -= y0; - u1 -= u0; - v1 -= v0; - u2 -= u0; - v2 -= v0; - var det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0; - ctx.save(); - ctx.transform(a, b, c, d, e, f); - ctx.clip(); - ctx.drawImage(img, 0, 0); - ctx.restore(); - }; - SkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) { - var skeleton = slot.bone.skeleton; - var skeletonColor = skeleton.color; - var slotColor = slot.color; - var regionColor = region.color; - var alpha = skeletonColor.a * slotColor.a * regionColor.a; - var multiplier = pma ? alpha : 1; - var color = this.tempColor; - color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); - region.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE); - var vertices = this.vertices; - var uvs = region.uvs; - vertices[spine.RegionAttachment.C1R] = color.r; - vertices[spine.RegionAttachment.C1G] = color.g; - vertices[spine.RegionAttachment.C1B] = color.b; - vertices[spine.RegionAttachment.C1A] = color.a; - vertices[spine.RegionAttachment.U1] = uvs[0]; - vertices[spine.RegionAttachment.V1] = uvs[1]; - vertices[spine.RegionAttachment.C2R] = color.r; - vertices[spine.RegionAttachment.C2G] = color.g; - vertices[spine.RegionAttachment.C2B] = color.b; - vertices[spine.RegionAttachment.C2A] = color.a; - vertices[spine.RegionAttachment.U2] = uvs[2]; - vertices[spine.RegionAttachment.V2] = uvs[3]; - vertices[spine.RegionAttachment.C3R] = color.r; - vertices[spine.RegionAttachment.C3G] = color.g; - vertices[spine.RegionAttachment.C3B] = color.b; - vertices[spine.RegionAttachment.C3A] = color.a; - vertices[spine.RegionAttachment.U3] = uvs[4]; - vertices[spine.RegionAttachment.V3] = uvs[5]; - vertices[spine.RegionAttachment.C4R] = color.r; - vertices[spine.RegionAttachment.C4G] = color.g; - vertices[spine.RegionAttachment.C4B] = color.b; - vertices[spine.RegionAttachment.C4A] = color.a; - vertices[spine.RegionAttachment.U4] = uvs[6]; - vertices[spine.RegionAttachment.V4] = uvs[7]; - return vertices; - }; - SkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) { - var skeleton = slot.bone.skeleton; - var skeletonColor = skeleton.color; - var slotColor = slot.color; - var regionColor = mesh.color; - var alpha = skeletonColor.a * slotColor.a * regionColor.a; - var multiplier = pma ? alpha : 1; - var color = this.tempColor; - color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); - var numVertices = mesh.worldVerticesLength / 2; - if (this.vertices.length < mesh.worldVerticesLength) { - this.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength); - } - var vertices = this.vertices; - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE); - var uvs = mesh.uvs; - for (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) { - vertices[v++] = color.r; - vertices[v++] = color.g; - vertices[v++] = color.b; - vertices[v++] = color.a; - vertices[v++] = uvs[u++]; - vertices[v++] = uvs[u++]; - v += 2; - } - return vertices; - }; - SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; - SkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4; - return SkeletonRenderer; - }()); - canvas.SkeletonRenderer = SkeletonRenderer; - })(canvas = spine.canvas || (spine.canvas = {})); + var canvas; + (function (canvas) { + var SkeletonRenderer = (function () { + function SkeletonRenderer(context) { + this.triangleRendering = false; + this.debugRendering = false; + this.vertices = spine.Utils.newFloatArray(8 * 1024); + this.tempColor = new spine.Color(); + this.ctx = context; + } + SkeletonRenderer.prototype.draw = function (skeleton) { + if (this.triangleRendering) + this.drawTriangles(skeleton); + else + this.drawImages(skeleton); + }; + SkeletonRenderer.prototype.drawImages = function (skeleton) { + var ctx = this.ctx; + var drawOrder = skeleton.drawOrder; + if (this.debugRendering) + ctx.strokeStyle = "green"; + ctx.save(); + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var attachment = slot.getAttachment(); + var regionAttachment = null; + var region = null; + var image = null; + if (attachment instanceof spine.RegionAttachment) { + regionAttachment = attachment; + region = regionAttachment.region; + image = region.texture.getImage(); + } + else + continue; + var skeleton_1 = slot.bone.skeleton; + var skeletonColor = skeleton_1.color; + var slotColor = slot.color; + var regionColor = regionAttachment.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha); + var att = attachment; + var bone = slot.bone; + var w = region.width; + var h = region.height; + ctx.save(); + ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY); + ctx.translate(attachment.offset[0], attachment.offset[1]); + ctx.rotate(attachment.rotation * Math.PI / 180); + var atlasScale = att.width / w; + ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY); + ctx.translate(w / 2, h / 2); + if (attachment.region.rotate) { + var t = w; + w = h; + h = t; + ctx.rotate(-Math.PI / 2); + } + ctx.scale(1, -1); + ctx.translate(-w / 2, -h / 2); + if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { + ctx.globalAlpha = color.a; + } + ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h); + if (this.debugRendering) + ctx.strokeRect(0, 0, w, h); + ctx.restore(); + } + ctx.restore(); + }; + SkeletonRenderer.prototype.drawTriangles = function (skeleton) { + var blendMode = null; + var vertices = this.vertices; + var triangles = null; + var drawOrder = skeleton.drawOrder; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var slot = drawOrder[i]; + var attachment = slot.getAttachment(); + var texture = null; + var region = null; + if (attachment instanceof spine.RegionAttachment) { + var regionAttachment = attachment; + vertices = this.computeRegionVertices(slot, regionAttachment, false); + triangles = SkeletonRenderer.QUAD_TRIANGLES; + region = regionAttachment.region; + texture = region.texture.getImage(); + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + vertices = this.computeMeshVertices(slot, mesh, false); + triangles = mesh.triangles; + texture = mesh.region.renderObject.texture.getImage(); + } + else + continue; + if (texture != null) { + var slotBlendMode = slot.data.blendMode; + if (slotBlendMode != blendMode) { + blendMode = slotBlendMode; + } + var skeleton_2 = slot.bone.skeleton; + var skeletonColor = skeleton_2.color; + var slotColor = slot.color; + var attachmentColor = attachment.color; + var alpha = skeletonColor.a * slotColor.a * attachmentColor.a; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha); + var ctx = this.ctx; + if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { + ctx.globalAlpha = color.a; + } + for (var j = 0; j < triangles.length; j += 3) { + var t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8; + var x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7]; + var x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7]; + var x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7]; + this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2); + if (this.debugRendering) { + ctx.strokeStyle = "green"; + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.lineTo(x0, y0); + ctx.stroke(); + } + } + } + } + this.ctx.globalAlpha = 1; + }; + SkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) { + var ctx = this.ctx; + u0 *= img.width; + v0 *= img.height; + u1 *= img.width; + v1 *= img.height; + u2 *= img.width; + v2 *= img.height; + ctx.beginPath(); + ctx.moveTo(x0, y0); + ctx.lineTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.closePath(); + x1 -= x0; + y1 -= y0; + x2 -= x0; + y2 -= y0; + u1 -= u0; + v1 -= v0; + u2 -= u0; + v2 -= v0; + var det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0; + ctx.save(); + ctx.transform(a, b, c, d, e, f); + ctx.clip(); + ctx.drawImage(img, 0, 0); + ctx.restore(); + }; + SkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) { + var skeleton = slot.bone.skeleton; + var skeletonColor = skeleton.color; + var slotColor = slot.color; + var regionColor = region.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var multiplier = pma ? alpha : 1; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); + region.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE); + var vertices = this.vertices; + var uvs = region.uvs; + vertices[spine.RegionAttachment.C1R] = color.r; + vertices[spine.RegionAttachment.C1G] = color.g; + vertices[spine.RegionAttachment.C1B] = color.b; + vertices[spine.RegionAttachment.C1A] = color.a; + vertices[spine.RegionAttachment.U1] = uvs[0]; + vertices[spine.RegionAttachment.V1] = uvs[1]; + vertices[spine.RegionAttachment.C2R] = color.r; + vertices[spine.RegionAttachment.C2G] = color.g; + vertices[spine.RegionAttachment.C2B] = color.b; + vertices[spine.RegionAttachment.C2A] = color.a; + vertices[spine.RegionAttachment.U2] = uvs[2]; + vertices[spine.RegionAttachment.V2] = uvs[3]; + vertices[spine.RegionAttachment.C3R] = color.r; + vertices[spine.RegionAttachment.C3G] = color.g; + vertices[spine.RegionAttachment.C3B] = color.b; + vertices[spine.RegionAttachment.C3A] = color.a; + vertices[spine.RegionAttachment.U3] = uvs[4]; + vertices[spine.RegionAttachment.V3] = uvs[5]; + vertices[spine.RegionAttachment.C4R] = color.r; + vertices[spine.RegionAttachment.C4G] = color.g; + vertices[spine.RegionAttachment.C4B] = color.b; + vertices[spine.RegionAttachment.C4A] = color.a; + vertices[spine.RegionAttachment.U4] = uvs[6]; + vertices[spine.RegionAttachment.V4] = uvs[7]; + return vertices; + }; + SkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) { + var skeleton = slot.bone.skeleton; + var skeletonColor = skeleton.color; + var slotColor = slot.color; + var regionColor = mesh.color; + var alpha = skeletonColor.a * slotColor.a * regionColor.a; + var multiplier = pma ? alpha : 1; + var color = this.tempColor; + color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha); + var numVertices = mesh.worldVerticesLength / 2; + if (this.vertices.length < mesh.worldVerticesLength) { + this.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength); + } + var vertices = this.vertices; + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE); + var uvs = mesh.uvs; + for (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) { + vertices[v++] = color.r; + vertices[v++] = color.g; + vertices[v++] = color.b; + vertices[v++] = color.a; + vertices[v++] = uvs[u++]; + vertices[v++] = uvs[u++]; + v += 2; + } + return vertices; + }; + SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; + SkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4; + return SkeletonRenderer; + }()); + canvas.SkeletonRenderer = SkeletonRenderer; + })(canvas = spine.canvas || (spine.canvas = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var AssetManager = (function (_super) { - __extends(AssetManager, _super); - function AssetManager(context, pathPrefix) { - if (pathPrefix === void 0) { pathPrefix = ""; } - return _super.call(this, function (image) { - return new spine.webgl.GLTexture(context, image); - }, pathPrefix) || this; - } - return AssetManager; - }(spine.AssetManager)); - webgl.AssetManager = AssetManager; - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var AssetManager = (function (_super) { + __extends(AssetManager, _super); + function AssetManager(context, pathPrefix) { + if (pathPrefix === void 0) { pathPrefix = ""; } + return _super.call(this, function (image) { + return new spine.webgl.GLTexture(context, image); + }, pathPrefix) || this; + } + return AssetManager; + }(spine.AssetManager)); + webgl.AssetManager = AssetManager; + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var OrthoCamera = (function () { - function OrthoCamera(viewportWidth, viewportHeight) { - this.position = new webgl.Vector3(0, 0, 0); - this.direction = new webgl.Vector3(0, 0, -1); - this.up = new webgl.Vector3(0, 1, 0); - this.near = 0; - this.far = 100; - this.zoom = 1; - this.viewportWidth = 0; - this.viewportHeight = 0; - this.projectionView = new webgl.Matrix4(); - this.inverseProjectionView = new webgl.Matrix4(); - this.projection = new webgl.Matrix4(); - this.view = new webgl.Matrix4(); - this.tmp = new webgl.Vector3(); - this.viewportWidth = viewportWidth; - this.viewportHeight = viewportHeight; - this.update(); - } - OrthoCamera.prototype.update = function () { - var projection = this.projection; - var view = this.view; - var projectionView = this.projectionView; - var inverseProjectionView = this.inverseProjectionView; - var zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight; - projection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far); - view.lookAt(this.position, this.direction, this.up); - projectionView.set(projection.values); - projectionView.multiply(view); - inverseProjectionView.set(projectionView.values).invert(); - }; - OrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) { - var x = screenCoords.x, y = screenHeight - screenCoords.y - 1; - var tmp = this.tmp; - tmp.x = (2 * x) / screenWidth - 1; - tmp.y = (2 * y) / screenHeight - 1; - tmp.z = (2 * screenCoords.z) - 1; - tmp.project(this.inverseProjectionView); - screenCoords.set(tmp.x, tmp.y, tmp.z); - return screenCoords; - }; - OrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) { - this.viewportWidth = viewportWidth; - this.viewportHeight = viewportHeight; - }; - return OrthoCamera; - }()); - webgl.OrthoCamera = OrthoCamera; - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var OrthoCamera = (function () { + function OrthoCamera(viewportWidth, viewportHeight) { + this.position = new webgl.Vector3(0, 0, 0); + this.direction = new webgl.Vector3(0, 0, -1); + this.up = new webgl.Vector3(0, 1, 0); + this.near = 0; + this.far = 100; + this.zoom = 1; + this.viewportWidth = 0; + this.viewportHeight = 0; + this.projectionView = new webgl.Matrix4(); + this.inverseProjectionView = new webgl.Matrix4(); + this.projection = new webgl.Matrix4(); + this.view = new webgl.Matrix4(); + this.tmp = new webgl.Vector3(); + this.viewportWidth = viewportWidth; + this.viewportHeight = viewportHeight; + this.update(); + } + OrthoCamera.prototype.update = function () { + var projection = this.projection; + var view = this.view; + var projectionView = this.projectionView; + var inverseProjectionView = this.inverseProjectionView; + var zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight; + projection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far); + view.lookAt(this.position, this.direction, this.up); + projectionView.set(projection.values); + projectionView.multiply(view); + inverseProjectionView.set(projectionView.values).invert(); + }; + OrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) { + var x = screenCoords.x, y = screenHeight - screenCoords.y - 1; + var tmp = this.tmp; + tmp.x = (2 * x) / screenWidth - 1; + tmp.y = (2 * y) / screenHeight - 1; + tmp.z = (2 * screenCoords.z) - 1; + tmp.project(this.inverseProjectionView); + screenCoords.set(tmp.x, tmp.y, tmp.z); + return screenCoords; + }; + OrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) { + this.viewportWidth = viewportWidth; + this.viewportHeight = viewportHeight; + }; + return OrthoCamera; + }()); + webgl.OrthoCamera = OrthoCamera; + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var GLTexture = (function (_super) { - __extends(GLTexture, _super); - function GLTexture(context, image, useMipMaps) { - if (useMipMaps === void 0) { useMipMaps = false; } - var _this = _super.call(this, image) || this; - _this.texture = null; - _this.boundUnit = 0; - _this.useMipMaps = false; - _this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - _this.useMipMaps = useMipMaps; - _this.restore(); - _this.context.addRestorable(_this); - return _this; - } - GLTexture.prototype.setFilters = function (minFilter, magFilter) { - var gl = this.context.gl; - this.bind(); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); - }; - GLTexture.prototype.setWraps = function (uWrap, vWrap) { - var gl = this.context.gl; - this.bind(); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap); - }; - GLTexture.prototype.update = function (useMipMaps) { - var gl = this.context.gl; - if (!this.texture) { - this.texture = this.context.gl.createTexture(); - } - this.bind(); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - if (useMipMaps) - gl.generateMipmap(gl.TEXTURE_2D); - }; - GLTexture.prototype.restore = function () { - this.texture = null; - this.update(this.useMipMaps); - }; - GLTexture.prototype.bind = function (unit) { - if (unit === void 0) { unit = 0; } - var gl = this.context.gl; - this.boundUnit = unit; - gl.activeTexture(gl.TEXTURE0 + unit); - gl.bindTexture(gl.TEXTURE_2D, this.texture); - }; - GLTexture.prototype.unbind = function () { - var gl = this.context.gl; - gl.activeTexture(gl.TEXTURE0 + this.boundUnit); - gl.bindTexture(gl.TEXTURE_2D, null); - }; - GLTexture.prototype.dispose = function () { - this.context.removeRestorable(this); - var gl = this.context.gl; - gl.deleteTexture(this.texture); - }; - return GLTexture; - }(spine.Texture)); - webgl.GLTexture = GLTexture; - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var GLTexture = (function (_super) { + __extends(GLTexture, _super); + function GLTexture(context, image, useMipMaps) { + if (useMipMaps === void 0) { useMipMaps = false; } + var _this = _super.call(this, image) || this; + _this.texture = null; + _this.boundUnit = 0; + _this.useMipMaps = false; + _this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + _this.useMipMaps = useMipMaps; + _this.restore(); + _this.context.addRestorable(_this); + return _this; + } + GLTexture.prototype.setFilters = function (minFilter, magFilter) { + var gl = this.context.gl; + this.bind(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); + }; + GLTexture.prototype.setWraps = function (uWrap, vWrap) { + var gl = this.context.gl; + this.bind(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap); + }; + GLTexture.prototype.update = function (useMipMaps) { + var gl = this.context.gl; + if (!this.texture) { + this.texture = this.context.gl.createTexture(); + } + this.bind(); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + if (useMipMaps) + gl.generateMipmap(gl.TEXTURE_2D); + }; + GLTexture.prototype.restore = function () { + this.texture = null; + this.update(this.useMipMaps); + }; + GLTexture.prototype.bind = function (unit) { + if (unit === void 0) { unit = 0; } + var gl = this.context.gl; + this.boundUnit = unit; + gl.activeTexture(gl.TEXTURE0 + unit); + gl.bindTexture(gl.TEXTURE_2D, this.texture); + }; + GLTexture.prototype.unbind = function () { + var gl = this.context.gl; + gl.activeTexture(gl.TEXTURE0 + this.boundUnit); + gl.bindTexture(gl.TEXTURE_2D, null); + }; + GLTexture.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + gl.deleteTexture(this.texture); + }; + return GLTexture; + }(spine.Texture)); + webgl.GLTexture = GLTexture; + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var Input = (function () { - function Input(element) { - this.lastX = 0; - this.lastY = 0; - this.buttonDown = false; - this.currTouch = null; - this.touchesPool = new spine.Pool(function () { - return new spine.webgl.Touch(0, 0, 0); - }); - this.listeners = new Array(); - this.element = element; - this.setupCallbacks(element); - } - Input.prototype.setupCallbacks = function (element) { - var _this = this; - var mouseDown = function (ev) { - if (ev instanceof MouseEvent) { - var rect = element.getBoundingClientRect(); - var x = ev.clientX - rect.left; - var y = ev.clientY - rect.top; - var listeners = _this.listeners; - for (var i = 0; i < listeners.length; i++) { - listeners[i].down(x, y); - } - _this.lastX = x; - _this.lastY = y; - _this.buttonDown = true; - document.addEventListener("mousemove", mouseMove); - document.addEventListener("mouseup", mouseUp); - } - }; - var mouseMove = function (ev) { - if (ev instanceof MouseEvent) { - var rect = element.getBoundingClientRect(); - var x = ev.clientX - rect.left; - var y = ev.clientY - rect.top; - var listeners = _this.listeners; - for (var i = 0; i < listeners.length; i++) { - if (_this.buttonDown) { - listeners[i].dragged(x, y); - } - else { - listeners[i].moved(x, y); - } - } - _this.lastX = x; - _this.lastY = y; - } - }; - var mouseUp = function (ev) { - if (ev instanceof MouseEvent) { - var rect = element.getBoundingClientRect(); - var x = ev.clientX - rect.left; - var y = ev.clientY - rect.top; - var listeners = _this.listeners; - for (var i = 0; i < listeners.length; i++) { - listeners[i].up(x, y); - } - _this.lastX = x; - _this.lastY = y; - _this.buttonDown = false; - document.removeEventListener("mousemove", mouseMove); - document.removeEventListener("mouseup", mouseUp); - } - }; - element.addEventListener("mousedown", mouseDown, true); - element.addEventListener("mousemove", mouseMove, true); - element.addEventListener("mouseup", mouseUp, true); - element.addEventListener("touchstart", function (ev) { - if (_this.currTouch != null) - return; - var touches = ev.changedTouches; - for (var i = 0; i < touches.length; i++) { - var touch = touches[i]; - var rect = element.getBoundingClientRect(); - var x = touch.clientX - rect.left; - var y = touch.clientY - rect.top; - _this.currTouch = _this.touchesPool.obtain(); - _this.currTouch.identifier = touch.identifier; - _this.currTouch.x = x; - _this.currTouch.y = y; - break; - } - var listeners = _this.listeners; - for (var i_16 = 0; i_16 < listeners.length; i_16++) { - listeners[i_16].down(_this.currTouch.x, _this.currTouch.y); - } - console.log("Start " + _this.currTouch.x + ", " + _this.currTouch.y); - _this.lastX = _this.currTouch.x; - _this.lastY = _this.currTouch.y; - _this.buttonDown = true; - ev.preventDefault(); - }, false); - element.addEventListener("touchend", function (ev) { - var touches = ev.changedTouches; - for (var i = 0; i < touches.length; i++) { - var touch = touches[i]; - if (_this.currTouch.identifier === touch.identifier) { - var rect = element.getBoundingClientRect(); - var x = _this.currTouch.x = touch.clientX - rect.left; - var y = _this.currTouch.y = touch.clientY - rect.top; - _this.touchesPool.free(_this.currTouch); - var listeners = _this.listeners; - for (var i_17 = 0; i_17 < listeners.length; i_17++) { - listeners[i_17].up(x, y); - } - console.log("End " + x + ", " + y); - _this.lastX = x; - _this.lastY = y; - _this.buttonDown = false; - _this.currTouch = null; - break; - } - } - ev.preventDefault(); - }, false); - element.addEventListener("touchcancel", function (ev) { - var touches = ev.changedTouches; - for (var i = 0; i < touches.length; i++) { - var touch = touches[i]; - if (_this.currTouch.identifier === touch.identifier) { - var rect = element.getBoundingClientRect(); - var x = _this.currTouch.x = touch.clientX - rect.left; - var y = _this.currTouch.y = touch.clientY - rect.top; - _this.touchesPool.free(_this.currTouch); - var listeners = _this.listeners; - for (var i_18 = 0; i_18 < listeners.length; i_18++) { - listeners[i_18].up(x, y); - } - console.log("End " + x + ", " + y); - _this.lastX = x; - _this.lastY = y; - _this.buttonDown = false; - _this.currTouch = null; - break; - } - } - ev.preventDefault(); - }, false); - element.addEventListener("touchmove", function (ev) { - if (_this.currTouch == null) - return; - var touches = ev.changedTouches; - for (var i = 0; i < touches.length; i++) { - var touch = touches[i]; - if (_this.currTouch.identifier === touch.identifier) { - var rect = element.getBoundingClientRect(); - var x = touch.clientX - rect.left; - var y = touch.clientY - rect.top; - var listeners = _this.listeners; - for (var i_19 = 0; i_19 < listeners.length; i_19++) { - listeners[i_19].dragged(x, y); - } - console.log("Drag " + x + ", " + y); - _this.lastX = _this.currTouch.x = x; - _this.lastY = _this.currTouch.y = y; - break; - } - } - ev.preventDefault(); - }, false); - }; - Input.prototype.addListener = function (listener) { - this.listeners.push(listener); - }; - Input.prototype.removeListener = function (listener) { - var idx = this.listeners.indexOf(listener); - if (idx > -1) { - this.listeners.splice(idx, 1); - } - }; - return Input; - }()); - webgl.Input = Input; - var Touch = (function () { - function Touch(identifier, x, y) { - this.identifier = identifier; - this.x = x; - this.y = y; - } - return Touch; - }()); - webgl.Touch = Touch; - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + webgl.M00 = 0; + webgl.M01 = 4; + webgl.M02 = 8; + webgl.M03 = 12; + webgl.M10 = 1; + webgl.M11 = 5; + webgl.M12 = 9; + webgl.M13 = 13; + webgl.M20 = 2; + webgl.M21 = 6; + webgl.M22 = 10; + webgl.M23 = 14; + webgl.M30 = 3; + webgl.M31 = 7; + webgl.M32 = 11; + webgl.M33 = 15; + var Matrix4 = (function () { + function Matrix4() { + this.temp = new Float32Array(16); + this.values = new Float32Array(16); + var v = this.values; + v[webgl.M00] = 1; + v[webgl.M11] = 1; + v[webgl.M22] = 1; + v[webgl.M33] = 1; + } + Matrix4.prototype.set = function (values) { + this.values.set(values); + return this; + }; + Matrix4.prototype.transpose = function () { + var t = this.temp; + var v = this.values; + t[webgl.M00] = v[webgl.M00]; + t[webgl.M01] = v[webgl.M10]; + t[webgl.M02] = v[webgl.M20]; + t[webgl.M03] = v[webgl.M30]; + t[webgl.M10] = v[webgl.M01]; + t[webgl.M11] = v[webgl.M11]; + t[webgl.M12] = v[webgl.M21]; + t[webgl.M13] = v[webgl.M31]; + t[webgl.M20] = v[webgl.M02]; + t[webgl.M21] = v[webgl.M12]; + t[webgl.M22] = v[webgl.M22]; + t[webgl.M23] = v[webgl.M32]; + t[webgl.M30] = v[webgl.M03]; + t[webgl.M31] = v[webgl.M13]; + t[webgl.M32] = v[webgl.M23]; + t[webgl.M33] = v[webgl.M33]; + return this.set(t); + }; + Matrix4.prototype.identity = function () { + var v = this.values; + v[webgl.M00] = 1; + v[webgl.M01] = 0; + v[webgl.M02] = 0; + v[webgl.M03] = 0; + v[webgl.M10] = 0; + v[webgl.M11] = 1; + v[webgl.M12] = 0; + v[webgl.M13] = 0; + v[webgl.M20] = 0; + v[webgl.M21] = 0; + v[webgl.M22] = 1; + v[webgl.M23] = 0; + v[webgl.M30] = 0; + v[webgl.M31] = 0; + v[webgl.M32] = 0; + v[webgl.M33] = 1; + return this; + }; + Matrix4.prototype.invert = function () { + var v = this.values; + var t = this.temp; + var l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] + + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] + - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] + - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] + + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] + + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] + - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] + - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + if (l_det == 0) + throw new Error("non-invertible matrix"); + var inv_det = 1.0 / l_det; + t[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32] + - v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32] + + v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32] + - v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33]; + t[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22] + + v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23]; + t[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32] + + v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32] + - v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33]; + t[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32] + + v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33]; + t[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22] + - v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23]; + t[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31] + - v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33]; + t[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31] + + v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33]; + t[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31] + - v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33]; + t[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21] + + v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23]; + t[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31] + + v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32]; + t[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31] + - v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32]; + t[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31] + + v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32]; + t[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21] + - v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22]; + v[webgl.M00] = t[webgl.M00] * inv_det; + v[webgl.M01] = t[webgl.M01] * inv_det; + v[webgl.M02] = t[webgl.M02] * inv_det; + v[webgl.M03] = t[webgl.M03] * inv_det; + v[webgl.M10] = t[webgl.M10] * inv_det; + v[webgl.M11] = t[webgl.M11] * inv_det; + v[webgl.M12] = t[webgl.M12] * inv_det; + v[webgl.M13] = t[webgl.M13] * inv_det; + v[webgl.M20] = t[webgl.M20] * inv_det; + v[webgl.M21] = t[webgl.M21] * inv_det; + v[webgl.M22] = t[webgl.M22] * inv_det; + v[webgl.M23] = t[webgl.M23] * inv_det; + v[webgl.M30] = t[webgl.M30] * inv_det; + v[webgl.M31] = t[webgl.M31] * inv_det; + v[webgl.M32] = t[webgl.M32] * inv_det; + v[webgl.M33] = t[webgl.M33] * inv_det; + return this; + }; + Matrix4.prototype.determinant = function () { + var v = this.values; + return v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] + + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] + - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] + - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] + + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] + + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] + - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] + - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; + }; + Matrix4.prototype.translate = function (x, y, z) { + var v = this.values; + v[webgl.M03] += x; + v[webgl.M13] += y; + v[webgl.M23] += z; + return this; + }; + Matrix4.prototype.copy = function () { + return new Matrix4().set(this.values); + }; + Matrix4.prototype.projection = function (near, far, fovy, aspectRatio) { + this.identity(); + var l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0)); + var l_a1 = (far + near) / (near - far); + var l_a2 = (2 * far * near) / (near - far); + var v = this.values; + v[webgl.M00] = l_fd / aspectRatio; + v[webgl.M10] = 0; + v[webgl.M20] = 0; + v[webgl.M30] = 0; + v[webgl.M01] = 0; + v[webgl.M11] = l_fd; + v[webgl.M21] = 0; + v[webgl.M31] = 0; + v[webgl.M02] = 0; + v[webgl.M12] = 0; + v[webgl.M22] = l_a1; + v[webgl.M32] = -1; + v[webgl.M03] = 0; + v[webgl.M13] = 0; + v[webgl.M23] = l_a2; + v[webgl.M33] = 0; + return this; + }; + Matrix4.prototype.ortho2d = function (x, y, width, height) { + return this.ortho(x, x + width, y, y + height, 0, 1); + }; + Matrix4.prototype.ortho = function (left, right, bottom, top, near, far) { + this.identity(); + var x_orth = 2 / (right - left); + var y_orth = 2 / (top - bottom); + var z_orth = -2 / (far - near); + var tx = -(right + left) / (right - left); + var ty = -(top + bottom) / (top - bottom); + var tz = -(far + near) / (far - near); + var v = this.values; + v[webgl.M00] = x_orth; + v[webgl.M10] = 0; + v[webgl.M20] = 0; + v[webgl.M30] = 0; + v[webgl.M01] = 0; + v[webgl.M11] = y_orth; + v[webgl.M21] = 0; + v[webgl.M31] = 0; + v[webgl.M02] = 0; + v[webgl.M12] = 0; + v[webgl.M22] = z_orth; + v[webgl.M32] = 0; + v[webgl.M03] = tx; + v[webgl.M13] = ty; + v[webgl.M23] = tz; + v[webgl.M33] = 1; + return this; + }; + Matrix4.prototype.multiply = function (matrix) { + var t = this.temp; + var v = this.values; + var m = matrix.values; + t[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30]; + t[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31]; + t[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32]; + t[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33]; + t[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30]; + t[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31]; + t[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32]; + t[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33]; + t[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30]; + t[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31]; + t[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32]; + t[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33]; + t[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30]; + t[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31]; + t[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32]; + t[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33]; + return this.set(this.temp); + }; + Matrix4.prototype.multiplyLeft = function (matrix) { + var t = this.temp; + var v = this.values; + var m = matrix.values; + t[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30]; + t[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31]; + t[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32]; + t[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33]; + t[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30]; + t[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31]; + t[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32]; + t[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33]; + t[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30]; + t[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31]; + t[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32]; + t[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33]; + t[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30]; + t[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31]; + t[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32]; + t[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33]; + return this.set(this.temp); + }; + Matrix4.prototype.lookAt = function (position, direction, up) { + Matrix4.initTemps(); + var xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis; + zAxis.setFrom(direction).normalize(); + xAxis.setFrom(direction).normalize(); + xAxis.cross(up).normalize(); + yAxis.setFrom(xAxis).cross(zAxis).normalize(); + this.identity(); + var val = this.values; + val[webgl.M00] = xAxis.x; + val[webgl.M01] = xAxis.y; + val[webgl.M02] = xAxis.z; + val[webgl.M10] = yAxis.x; + val[webgl.M11] = yAxis.y; + val[webgl.M12] = yAxis.z; + val[webgl.M20] = -zAxis.x; + val[webgl.M21] = -zAxis.y; + val[webgl.M22] = -zAxis.z; + Matrix4.tmpMatrix.identity(); + Matrix4.tmpMatrix.values[webgl.M03] = -position.x; + Matrix4.tmpMatrix.values[webgl.M13] = -position.y; + Matrix4.tmpMatrix.values[webgl.M23] = -position.z; + this.multiply(Matrix4.tmpMatrix); + return this; + }; + Matrix4.initTemps = function () { + if (Matrix4.xAxis === null) + Matrix4.xAxis = new webgl.Vector3(); + if (Matrix4.yAxis === null) + Matrix4.yAxis = new webgl.Vector3(); + if (Matrix4.zAxis === null) + Matrix4.zAxis = new webgl.Vector3(); + }; + Matrix4.xAxis = null; + Matrix4.yAxis = null; + Matrix4.zAxis = null; + Matrix4.tmpMatrix = new Matrix4(); + return Matrix4; + }()); + webgl.Matrix4 = Matrix4; + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var LoadingScreen = (function () { - function LoadingScreen(renderer) { - this.logo = null; - this.spinner = null; - this.angle = 0; - this.fadeOut = 0; - this.timeKeeper = new spine.TimeKeeper(); - this.backgroundColor = new spine.Color(0.135, 0.135, 0.135, 1); - this.tempColor = new spine.Color(); - this.firstDraw = 0; - this.renderer = renderer; - this.timeKeeper.maxDelta = 9; - if (LoadingScreen.logoImg === null) { - var isSafari = navigator.userAgent.indexOf("Safari") > -1; - LoadingScreen.logoImg = new Image(); - LoadingScreen.logoImg.src = LoadingScreen.SPINE_LOGO_DATA; - if (!isSafari) - LoadingScreen.logoImg.crossOrigin = "anonymous"; - LoadingScreen.logoImg.onload = function (ev) { - LoadingScreen.loaded++; - }; - LoadingScreen.spinnerImg = new Image(); - LoadingScreen.spinnerImg.src = LoadingScreen.SPINNER_DATA; - if (!isSafari) - LoadingScreen.spinnerImg.crossOrigin = "anonymous"; - LoadingScreen.spinnerImg.onload = function (ev) { - LoadingScreen.loaded++; - }; - } - } - LoadingScreen.prototype.draw = function (complete) { - if (complete === void 0) { complete = false; } - if (complete && this.fadeOut > LoadingScreen.FADE_SECONDS) - return; - this.timeKeeper.update(); - var a = Math.abs(Math.sin(this.timeKeeper.totalTime + 0.75)); - this.angle -= this.timeKeeper.delta / 1.4 * 360 * (1 + 1.5 * Math.pow(a, 5)); - var renderer = this.renderer; - var canvas = renderer.canvas; - var gl = renderer.context.gl; - renderer.resize(webgl.ResizeMode.Stretch); - var oldX = renderer.camera.position.x, oldY = renderer.camera.position.y; - renderer.camera.position.set(canvas.width / 2, canvas.height / 2, 0); - renderer.camera.viewportWidth = canvas.width; - renderer.camera.viewportHeight = canvas.height; - if (!complete) { - gl.clearColor(this.backgroundColor.r, this.backgroundColor.g, this.backgroundColor.b, this.backgroundColor.a); - gl.clear(gl.COLOR_BUFFER_BIT); - this.tempColor.a = 1; - } - else { - this.fadeOut += this.timeKeeper.delta * (this.timeKeeper.totalTime < 1 ? 2 : 1); - if (this.fadeOut > LoadingScreen.FADE_SECONDS) { - renderer.camera.position.set(oldX, oldY, 0); - return; - } - a = 1 - this.fadeOut / LoadingScreen.FADE_SECONDS; - this.tempColor.setFromColor(this.backgroundColor); - this.tempColor.a = 1 - (a - 1) * (a - 1); - renderer.begin(); - renderer.quad(true, 0, 0, canvas.width, 0, canvas.width, canvas.height, 0, canvas.height, this.tempColor, this.tempColor, this.tempColor, this.tempColor); - renderer.end(); - } - this.tempColor.set(1, 1, 1, this.tempColor.a); - if (LoadingScreen.loaded != 2) - return; - if (this.logo === null) { - this.logo = new webgl.GLTexture(renderer.context, LoadingScreen.logoImg); - this.spinner = new webgl.GLTexture(renderer.context, LoadingScreen.spinnerImg); - } - this.logo.update(false); - this.spinner.update(false); - var logoWidth = this.logo.getImage().width; - var logoHeight = this.logo.getImage().height; - var spinnerWidth = this.spinner.getImage().width; - var spinnerHeight = this.spinner.getImage().height; - renderer.batcher.setBlendMode(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); - renderer.begin(); - renderer.drawTexture(this.logo, (canvas.width - logoWidth) / 2, (canvas.height - logoHeight) / 2, logoWidth, logoHeight, this.tempColor); - renderer.drawTextureRotated(this.spinner, (canvas.width - spinnerWidth) / 2, (canvas.height - spinnerHeight) / 2, spinnerWidth, spinnerHeight, spinnerWidth / 2, spinnerHeight / 2, this.angle, this.tempColor); - renderer.end(); - renderer.camera.position.set(oldX, oldY, 0); - }; - LoadingScreen.FADE_SECONDS = 1; - LoadingScreen.loaded = 0; - LoadingScreen.spinnerImg = null; - LoadingScreen.logoImg = null; - LoadingScreen.SPINNER_DATA = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAAACXBIWXMAAAsTAAALEwEAmpwYAAALB2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC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uq6Vjhf2owGvozDKmG9dyiQCeTSAiwXVdNIP1A2uls7QkYhW/fgzVgIeXVOe6ISFOnSOjjn+uuHsK5F2NM1hLG/jSGfpjoSdjLSJg7Cp7FjaR7ZzXEGcinBJDF8DnZ1Ho7wPrYNadHdINGCLdVMdrU6nMdimqHYgiaF2kn4IXJ8FMJY6iPRxsPqTksbc55ZJP2vHgOnuYwD2tU4k/eycaT891g0F5YDZ7qfQ3SidTAZgG4By4FwHgBtYBpYbZ/l/2EJnC9N0gaQAAAAASUVORK5CYII="; - return LoadingScreen; - }()); - webgl.LoadingScreen = LoadingScreen; - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var Mesh = (function () { + function Mesh(context, attributes, maxVertices, maxIndices) { + this.attributes = attributes; + this.verticesLength = 0; + this.dirtyVertices = false; + this.indicesLength = 0; + this.dirtyIndices = false; + this.elementsPerVertex = 0; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.elementsPerVertex = 0; + for (var i = 0; i < attributes.length; i++) { + this.elementsPerVertex += attributes[i].numElements; + } + this.vertices = new Float32Array(maxVertices * this.elementsPerVertex); + this.indices = new Uint16Array(maxIndices); + this.context.addRestorable(this); + } + Mesh.prototype.getAttributes = function () { return this.attributes; }; + Mesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; }; + Mesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; }; + Mesh.prototype.setVerticesLength = function (length) { + this.dirtyVertices = true; + this.verticesLength = length; + }; + Mesh.prototype.getVertices = function () { return this.vertices; }; + Mesh.prototype.maxIndices = function () { return this.indices.length; }; + Mesh.prototype.numIndices = function () { return this.indicesLength; }; + Mesh.prototype.setIndicesLength = function (length) { + this.dirtyIndices = true; + this.indicesLength = length; + }; + Mesh.prototype.getIndices = function () { return this.indices; }; + ; + Mesh.prototype.getVertexSizeInFloats = function () { + var size = 0; + for (var i = 0; i < this.attributes.length; i++) { + var attribute = this.attributes[i]; + size += attribute.numElements; + } + return size; + }; + Mesh.prototype.setVertices = function (vertices) { + this.dirtyVertices = true; + if (vertices.length > this.vertices.length) + throw Error("Mesh can't store more than " + this.maxVertices() + " vertices"); + this.vertices.set(vertices, 0); + this.verticesLength = vertices.length; + }; + Mesh.prototype.setIndices = function (indices) { + this.dirtyIndices = true; + if (indices.length > this.indices.length) + throw Error("Mesh can't store more than " + this.maxIndices() + " indices"); + this.indices.set(indices, 0); + this.indicesLength = indices.length; + }; + Mesh.prototype.draw = function (shader, primitiveType) { + this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex); + }; + Mesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) { + var gl = this.context.gl; + if (this.dirtyVertices || this.dirtyIndices) + this.update(); + this.bind(shader); + if (this.indicesLength > 0) { + gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2); + } + else { + gl.drawArrays(primitiveType, offset, count); + } + this.unbind(shader); + }; + Mesh.prototype.bind = function (shader) { + var gl = this.context.gl; + gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); + var offset = 0; + for (var i = 0; i < this.attributes.length; i++) { + var attrib = this.attributes[i]; + var location_1 = shader.getAttributeLocation(attrib.name); + gl.enableVertexAttribArray(location_1); + gl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4); + offset += attrib.numElements; + } + if (this.indicesLength > 0) + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); + }; + Mesh.prototype.unbind = function (shader) { + var gl = this.context.gl; + for (var i = 0; i < this.attributes.length; i++) { + var attrib = this.attributes[i]; + var location_2 = shader.getAttributeLocation(attrib.name); + gl.disableVertexAttribArray(location_2); + } + gl.bindBuffer(gl.ARRAY_BUFFER, null); + if (this.indicesLength > 0) + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); + }; + Mesh.prototype.update = function () { + var gl = this.context.gl; + if (this.dirtyVertices) { + if (!this.verticesBuffer) { + this.verticesBuffer = gl.createBuffer(); + } + gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); + gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW); + this.dirtyVertices = false; + } + if (this.dirtyIndices) { + if (!this.indicesBuffer) { + this.indicesBuffer = gl.createBuffer(); + } + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW); + this.dirtyIndices = false; + } + }; + Mesh.prototype.restore = function () { + this.verticesBuffer = null; + this.indicesBuffer = null; + this.update(); + }; + Mesh.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + gl.deleteBuffer(this.verticesBuffer); + gl.deleteBuffer(this.indicesBuffer); + }; + return Mesh; + }()); + webgl.Mesh = Mesh; + var VertexAttribute = (function () { + function VertexAttribute(name, type, numElements) { + this.name = name; + this.type = type; + this.numElements = numElements; + } + return VertexAttribute; + }()); + webgl.VertexAttribute = VertexAttribute; + var Position2Attribute = (function (_super) { + __extends(Position2Attribute, _super); + function Position2Attribute() { + return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this; + } + return Position2Attribute; + }(VertexAttribute)); + webgl.Position2Attribute = Position2Attribute; + var Position3Attribute = (function (_super) { + __extends(Position3Attribute, _super); + function Position3Attribute() { + return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this; + } + return Position3Attribute; + }(VertexAttribute)); + webgl.Position3Attribute = Position3Attribute; + var TexCoordAttribute = (function (_super) { + __extends(TexCoordAttribute, _super); + function TexCoordAttribute(unit) { + if (unit === void 0) { unit = 0; } + return _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? "" : unit), VertexAttributeType.Float, 2) || this; + } + return TexCoordAttribute; + }(VertexAttribute)); + webgl.TexCoordAttribute = TexCoordAttribute; + var ColorAttribute = (function (_super) { + __extends(ColorAttribute, _super); + function ColorAttribute() { + return _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this; + } + return ColorAttribute; + }(VertexAttribute)); + webgl.ColorAttribute = ColorAttribute; + var Color2Attribute = (function (_super) { + __extends(Color2Attribute, _super); + function Color2Attribute() { + return _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this; + } + return Color2Attribute; + }(VertexAttribute)); + webgl.Color2Attribute = Color2Attribute; + var VertexAttributeType; + (function (VertexAttributeType) { + VertexAttributeType[VertexAttributeType["Float"] = 0] = "Float"; + })(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {})); + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - webgl.M00 = 0; - webgl.M01 = 4; - webgl.M02 = 8; - webgl.M03 = 12; - webgl.M10 = 1; - webgl.M11 = 5; - webgl.M12 = 9; - webgl.M13 = 13; - webgl.M20 = 2; - webgl.M21 = 6; - webgl.M22 = 10; - webgl.M23 = 14; - webgl.M30 = 3; - webgl.M31 = 7; - webgl.M32 = 11; - webgl.M33 = 15; - var Matrix4 = (function () { - function Matrix4() { - this.temp = new Float32Array(16); - this.values = new Float32Array(16); - var v = this.values; - v[webgl.M00] = 1; - v[webgl.M11] = 1; - v[webgl.M22] = 1; - v[webgl.M33] = 1; - } - Matrix4.prototype.set = function (values) { - this.values.set(values); - return this; - }; - Matrix4.prototype.transpose = function () { - var t = this.temp; - var v = this.values; - t[webgl.M00] = v[webgl.M00]; - t[webgl.M01] = v[webgl.M10]; - t[webgl.M02] = v[webgl.M20]; - t[webgl.M03] = v[webgl.M30]; - t[webgl.M10] = v[webgl.M01]; - t[webgl.M11] = v[webgl.M11]; - t[webgl.M12] = v[webgl.M21]; - t[webgl.M13] = v[webgl.M31]; - t[webgl.M20] = v[webgl.M02]; - t[webgl.M21] = v[webgl.M12]; - t[webgl.M22] = v[webgl.M22]; - t[webgl.M23] = v[webgl.M32]; - t[webgl.M30] = v[webgl.M03]; - t[webgl.M31] = v[webgl.M13]; - t[webgl.M32] = v[webgl.M23]; - t[webgl.M33] = v[webgl.M33]; - return this.set(t); - }; - Matrix4.prototype.identity = function () { - var v = this.values; - v[webgl.M00] = 1; - v[webgl.M01] = 0; - v[webgl.M02] = 0; - v[webgl.M03] = 0; - v[webgl.M10] = 0; - v[webgl.M11] = 1; - v[webgl.M12] = 0; - v[webgl.M13] = 0; - v[webgl.M20] = 0; - v[webgl.M21] = 0; - v[webgl.M22] = 1; - v[webgl.M23] = 0; - v[webgl.M30] = 0; - v[webgl.M31] = 0; - v[webgl.M32] = 0; - v[webgl.M33] = 1; - return this; - }; - Matrix4.prototype.invert = function () { - var v = this.values; - var t = this.temp; - var l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] - + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] - - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] - - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] - + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] - + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] - - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] - - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; - if (l_det == 0) - throw new Error("non-invertible matrix"); - var inv_det = 1.0 / l_det; - t[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32] - - v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; - t[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32] - + v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33]; - t[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32] - - v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33]; - t[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22] - + v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23]; - t[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32] - + v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33]; - t[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32] - - v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33]; - t[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32] - + v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33]; - t[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22] - - v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23]; - t[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31] - - v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33]; - t[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31] - + v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33]; - t[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31] - - v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33]; - t[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21] - + v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23]; - t[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31] - + v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32]; - t[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31] - - v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32]; - t[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31] - + v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32]; - t[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21] - - v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22]; - v[webgl.M00] = t[webgl.M00] * inv_det; - v[webgl.M01] = t[webgl.M01] * inv_det; - v[webgl.M02] = t[webgl.M02] * inv_det; - v[webgl.M03] = t[webgl.M03] * inv_det; - v[webgl.M10] = t[webgl.M10] * inv_det; - v[webgl.M11] = t[webgl.M11] * inv_det; - v[webgl.M12] = t[webgl.M12] * inv_det; - v[webgl.M13] = t[webgl.M13] * inv_det; - v[webgl.M20] = t[webgl.M20] * inv_det; - v[webgl.M21] = t[webgl.M21] * inv_det; - v[webgl.M22] = t[webgl.M22] * inv_det; - v[webgl.M23] = t[webgl.M23] * inv_det; - v[webgl.M30] = t[webgl.M30] * inv_det; - v[webgl.M31] = t[webgl.M31] * inv_det; - v[webgl.M32] = t[webgl.M32] * inv_det; - v[webgl.M33] = t[webgl.M33] * inv_det; - return this; - }; - Matrix4.prototype.determinant = function () { - var v = this.values; - return v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03] - + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03] - - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13] - - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13] - + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23] - + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23] - - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33] - - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33]; - }; - Matrix4.prototype.translate = function (x, y, z) { - var v = this.values; - v[webgl.M03] += x; - v[webgl.M13] += y; - v[webgl.M23] += z; - return this; - }; - Matrix4.prototype.copy = function () { - return new Matrix4().set(this.values); - }; - Matrix4.prototype.projection = function (near, far, fovy, aspectRatio) { - this.identity(); - var l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0)); - var l_a1 = (far + near) / (near - far); - var l_a2 = (2 * far * near) / (near - far); - var v = this.values; - v[webgl.M00] = l_fd / aspectRatio; - v[webgl.M10] = 0; - v[webgl.M20] = 0; - v[webgl.M30] = 0; - v[webgl.M01] = 0; - v[webgl.M11] = l_fd; - v[webgl.M21] = 0; - v[webgl.M31] = 0; - v[webgl.M02] = 0; - v[webgl.M12] = 0; - v[webgl.M22] = l_a1; - v[webgl.M32] = -1; - v[webgl.M03] = 0; - v[webgl.M13] = 0; - v[webgl.M23] = l_a2; - v[webgl.M33] = 0; - return this; - }; - Matrix4.prototype.ortho2d = function (x, y, width, height) { - return this.ortho(x, x + width, y, y + height, 0, 1); - }; - Matrix4.prototype.ortho = function (left, right, bottom, top, near, far) { - this.identity(); - var x_orth = 2 / (right - left); - var y_orth = 2 / (top - bottom); - var z_orth = -2 / (far - near); - var tx = -(right + left) / (right - left); - var ty = -(top + bottom) / (top - bottom); - var tz = -(far + near) / (far - near); - var v = this.values; - v[webgl.M00] = x_orth; - v[webgl.M10] = 0; - v[webgl.M20] = 0; - v[webgl.M30] = 0; - v[webgl.M01] = 0; - v[webgl.M11] = y_orth; - v[webgl.M21] = 0; - v[webgl.M31] = 0; - v[webgl.M02] = 0; - v[webgl.M12] = 0; - v[webgl.M22] = z_orth; - v[webgl.M32] = 0; - v[webgl.M03] = tx; - v[webgl.M13] = ty; - v[webgl.M23] = tz; - v[webgl.M33] = 1; - return this; - }; - Matrix4.prototype.multiply = function (matrix) { - var t = this.temp; - var v = this.values; - var m = matrix.values; - t[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30]; - t[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31]; - t[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32]; - t[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33]; - t[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30]; - t[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31]; - t[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32]; - t[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33]; - t[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30]; - t[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31]; - t[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32]; - t[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33]; - t[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30]; - t[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31]; - t[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32]; - t[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33]; - return this.set(this.temp); - }; - Matrix4.prototype.multiplyLeft = function (matrix) { - var t = this.temp; - var v = this.values; - var m = matrix.values; - t[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30]; - t[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31]; - t[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32]; - t[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33]; - t[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30]; - t[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31]; - t[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32]; - t[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33]; - t[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30]; - t[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31]; - t[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32]; - t[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33]; - t[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30]; - t[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31]; - t[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32]; - t[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33]; - return this.set(this.temp); - }; - Matrix4.prototype.lookAt = function (position, direction, up) { - Matrix4.initTemps(); - var xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis; - zAxis.setFrom(direction).normalize(); - xAxis.setFrom(direction).normalize(); - xAxis.cross(up).normalize(); - yAxis.setFrom(xAxis).cross(zAxis).normalize(); - this.identity(); - var val = this.values; - val[webgl.M00] = xAxis.x; - val[webgl.M01] = xAxis.y; - val[webgl.M02] = xAxis.z; - val[webgl.M10] = yAxis.x; - val[webgl.M11] = yAxis.y; - val[webgl.M12] = yAxis.z; - val[webgl.M20] = -zAxis.x; - val[webgl.M21] = -zAxis.y; - val[webgl.M22] = -zAxis.z; - Matrix4.tmpMatrix.identity(); - Matrix4.tmpMatrix.values[webgl.M03] = -position.x; - Matrix4.tmpMatrix.values[webgl.M13] = -position.y; - Matrix4.tmpMatrix.values[webgl.M23] = -position.z; - this.multiply(Matrix4.tmpMatrix); - return this; - }; - Matrix4.initTemps = function () { - if (Matrix4.xAxis === null) - Matrix4.xAxis = new webgl.Vector3(); - if (Matrix4.yAxis === null) - Matrix4.yAxis = new webgl.Vector3(); - if (Matrix4.zAxis === null) - Matrix4.zAxis = new webgl.Vector3(); - }; - Matrix4.xAxis = null; - Matrix4.yAxis = null; - Matrix4.zAxis = null; - Matrix4.tmpMatrix = new Matrix4(); - return Matrix4; - }()); - webgl.Matrix4 = Matrix4; - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var PolygonBatcher = (function () { + function PolygonBatcher(context, twoColorTint, maxVertices) { + if (twoColorTint === void 0) { twoColorTint = true; } + if (maxVertices === void 0) { maxVertices = 10920; } + this.isDrawing = false; + this.shader = null; + this.lastTexture = null; + this.verticesLength = 0; + this.indicesLength = 0; + if (maxVertices > 10920) + throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + var attributes = twoColorTint ? + [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] : + [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()]; + this.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3); + this.srcBlend = this.context.gl.SRC_ALPHA; + this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; + } + PolygonBatcher.prototype.begin = function (shader) { + var gl = 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 = shader; + this.lastTexture = null; + this.isDrawing = true; + gl.enable(gl.BLEND); + gl.blendFunc(this.srcBlend, this.dstBlend); + }; + PolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) { + var gl = this.context.gl; + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + if (this.isDrawing) { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + }; + PolygonBatcher.prototype.draw = function (texture, vertices, indices) { + if (texture != this.lastTexture) { + this.flush(); + this.lastTexture = texture; + } + else if (this.verticesLength + vertices.length > this.mesh.getVertices().length || + this.indicesLength + indices.length > this.mesh.getIndices().length) { + this.flush(); + } + var indexStart = this.mesh.numVertices(); + this.mesh.getVertices().set(vertices, this.verticesLength); + this.verticesLength += vertices.length; + this.mesh.setVerticesLength(this.verticesLength); + var indicesArray = this.mesh.getIndices(); + for (var i = this.indicesLength, j = 0; j < indices.length; i++, j++) + indicesArray[i] = indices[j] + indexStart; + this.indicesLength += indices.length; + this.mesh.setIndicesLength(this.indicesLength); + }; + PolygonBatcher.prototype.flush = function () { + var gl = this.context.gl; + if (this.verticesLength == 0) + return; + this.lastTexture.bind(); + this.mesh.draw(this.shader, gl.TRIANGLES); + this.verticesLength = 0; + this.indicesLength = 0; + this.mesh.setVerticesLength(0); + this.mesh.setIndicesLength(0); + this.drawCalls++; + }; + PolygonBatcher.prototype.end = function () { + var gl = this.context.gl; + if (!this.isDrawing) + throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()"); + if (this.verticesLength > 0 || this.indicesLength > 0) + this.flush(); + this.shader = null; + this.lastTexture = null; + this.isDrawing = false; + gl.disable(gl.BLEND); + }; + PolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; }; + PolygonBatcher.prototype.dispose = function () { + this.mesh.dispose(); + }; + return PolygonBatcher; + }()); + webgl.PolygonBatcher = PolygonBatcher; + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var Mesh = (function () { - function Mesh(context, attributes, maxVertices, maxIndices) { - this.attributes = attributes; - this.verticesLength = 0; - this.dirtyVertices = false; - this.indicesLength = 0; - this.dirtyIndices = false; - this.elementsPerVertex = 0; - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - this.elementsPerVertex = 0; - for (var i = 0; i < attributes.length; i++) { - this.elementsPerVertex += attributes[i].numElements; - } - this.vertices = new Float32Array(maxVertices * this.elementsPerVertex); - this.indices = new Uint16Array(maxIndices); - this.context.addRestorable(this); - } - Mesh.prototype.getAttributes = function () { return this.attributes; }; - Mesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; }; - Mesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; }; - Mesh.prototype.setVerticesLength = function (length) { - this.dirtyVertices = true; - this.verticesLength = length; - }; - Mesh.prototype.getVertices = function () { return this.vertices; }; - Mesh.prototype.maxIndices = function () { return this.indices.length; }; - Mesh.prototype.numIndices = function () { return this.indicesLength; }; - Mesh.prototype.setIndicesLength = function (length) { - this.dirtyIndices = true; - this.indicesLength = length; - }; - Mesh.prototype.getIndices = function () { return this.indices; }; - ; - Mesh.prototype.getVertexSizeInFloats = function () { - var size = 0; - for (var i = 0; i < this.attributes.length; i++) { - var attribute = this.attributes[i]; - size += attribute.numElements; - } - return size; - }; - Mesh.prototype.setVertices = function (vertices) { - this.dirtyVertices = true; - if (vertices.length > this.vertices.length) - throw Error("Mesh can't store more than " + this.maxVertices() + " vertices"); - this.vertices.set(vertices, 0); - this.verticesLength = vertices.length; - }; - Mesh.prototype.setIndices = function (indices) { - this.dirtyIndices = true; - if (indices.length > this.indices.length) - throw Error("Mesh can't store more than " + this.maxIndices() + " indices"); - this.indices.set(indices, 0); - this.indicesLength = indices.length; - }; - Mesh.prototype.draw = function (shader, primitiveType) { - this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex); - }; - Mesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) { - var gl = this.context.gl; - if (this.dirtyVertices || this.dirtyIndices) - this.update(); - this.bind(shader); - if (this.indicesLength > 0) { - gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2); - } - else { - gl.drawArrays(primitiveType, offset, count); - } - this.unbind(shader); - }; - Mesh.prototype.bind = function (shader) { - var gl = this.context.gl; - gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); - var offset = 0; - for (var i = 0; i < this.attributes.length; i++) { - var attrib = this.attributes[i]; - var location_1 = shader.getAttributeLocation(attrib.name); - gl.enableVertexAttribArray(location_1); - gl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4); - offset += attrib.numElements; - } - if (this.indicesLength > 0) - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); - }; - Mesh.prototype.unbind = function (shader) { - var gl = this.context.gl; - for (var i = 0; i < this.attributes.length; i++) { - var attrib = this.attributes[i]; - var location_2 = shader.getAttributeLocation(attrib.name); - gl.disableVertexAttribArray(location_2); - } - gl.bindBuffer(gl.ARRAY_BUFFER, null); - if (this.indicesLength > 0) - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); - }; - Mesh.prototype.update = function () { - var gl = this.context.gl; - if (this.dirtyVertices) { - if (!this.verticesBuffer) { - this.verticesBuffer = gl.createBuffer(); - } - gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW); - this.dirtyVertices = false; - } - if (this.dirtyIndices) { - if (!this.indicesBuffer) { - this.indicesBuffer = gl.createBuffer(); - } - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW); - this.dirtyIndices = false; - } - }; - Mesh.prototype.restore = function () { - this.verticesBuffer = null; - this.indicesBuffer = null; - this.update(); - }; - Mesh.prototype.dispose = function () { - this.context.removeRestorable(this); - var gl = this.context.gl; - gl.deleteBuffer(this.verticesBuffer); - gl.deleteBuffer(this.indicesBuffer); - }; - return Mesh; - }()); - webgl.Mesh = Mesh; - var VertexAttribute = (function () { - function VertexAttribute(name, type, numElements) { - this.name = name; - this.type = type; - this.numElements = numElements; - } - return VertexAttribute; - }()); - webgl.VertexAttribute = VertexAttribute; - var Position2Attribute = (function (_super) { - __extends(Position2Attribute, _super); - function Position2Attribute() { - return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this; - } - return Position2Attribute; - }(VertexAttribute)); - webgl.Position2Attribute = Position2Attribute; - var Position3Attribute = (function (_super) { - __extends(Position3Attribute, _super); - function Position3Attribute() { - return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this; - } - return Position3Attribute; - }(VertexAttribute)); - webgl.Position3Attribute = Position3Attribute; - var TexCoordAttribute = (function (_super) { - __extends(TexCoordAttribute, _super); - function TexCoordAttribute(unit) { - if (unit === void 0) { unit = 0; } - return _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? "" : unit), VertexAttributeType.Float, 2) || this; - } - return TexCoordAttribute; - }(VertexAttribute)); - webgl.TexCoordAttribute = TexCoordAttribute; - var ColorAttribute = (function (_super) { - __extends(ColorAttribute, _super); - function ColorAttribute() { - return _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this; - } - return ColorAttribute; - }(VertexAttribute)); - webgl.ColorAttribute = ColorAttribute; - var Color2Attribute = (function (_super) { - __extends(Color2Attribute, _super); - function Color2Attribute() { - return _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this; - } - return Color2Attribute; - }(VertexAttribute)); - webgl.Color2Attribute = Color2Attribute; - var VertexAttributeType; - (function (VertexAttributeType) { - VertexAttributeType[VertexAttributeType["Float"] = 0] = "Float"; - })(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {})); - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var SceneRenderer = (function () { + function SceneRenderer(canvas, context, twoColorTint) { + if (twoColorTint === void 0) { twoColorTint = true; } + this.twoColorTint = false; + 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 spine.Color(1, 1, 1, 1); + this.canvas = canvas; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.twoColorTint = twoColorTint; + this.camera = new webgl.OrthoCamera(canvas.width, canvas.height); + this.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context); + this.batcher = new webgl.PolygonBatcher(this.context, twoColorTint); + this.shapesShader = webgl.Shader.newColored(this.context); + this.shapes = new webgl.ShapeRenderer(this.context); + this.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint); + this.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context); + } + SceneRenderer.prototype.begin = function () { + this.camera.update(); + this.enableRenderer(this.batcher); + }; + SceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + if (slotRangeStart === void 0) { slotRangeStart = -1; } + if (slotRangeEnd === void 0) { slotRangeEnd = -1; } + this.enableRenderer(this.batcher); + this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha; + this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd); + }; + SceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + if (ignoredBones === void 0) { ignoredBones = null; } + this.enableRenderer(this.shapes); + this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha; + this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones); + }; + SceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u; + quad[i++] = v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u2; + quad[i++] = v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u2; + quad[i++] = v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = u; + quad[i++] = v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) { + if (color === void 0) { color = null; } + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var worldOriginX = x + pivotX; + var worldOriginY = y + pivotY; + var fx = -pivotX; + var fy = -pivotY; + var fx2 = width - pivotX; + var fy2 = height - pivotY; + var p1x = fx; + var p1y = fy; + var p2x = fx; + var p2y = fy2; + var p3x = fx2; + var p3y = fy2; + var p4x = fx2; + var p4y = fy; + var x1 = 0; + var y1 = 0; + var x2 = 0; + var y2 = 0; + var x3 = 0; + var y3 = 0; + var x4 = 0; + var y4 = 0; + if (angle != 0) { + var cos = spine.MathUtils.cosDeg(angle); + var sin = spine.MathUtils.sinDeg(angle); + x1 = cos * p1x - sin * p1y; + y1 = sin * p1x + cos * p1y; + x4 = cos * p2x - sin * p2y; + y4 = sin * p2x + cos * p2y; + x3 = cos * p3x - sin * p3y; + y3 = sin * p3x + cos * p3y; + x2 = x3 + (x1 - x4); + y2 = y3 + (y1 - y4); + } + else { + x1 = p1x; + y1 = p1y; + x4 = p2x; + y4 = p2y; + x3 = p3x; + y3 = p3y; + x2 = p4x; + y2 = p4y; + } + x1 += worldOriginX; + y1 += worldOriginY; + x2 += worldOriginX; + y2 += worldOriginY; + x3 += worldOriginX; + y3 += worldOriginY; + x4 += worldOriginX; + y4 += worldOriginY; + var i = 0; + quad[i++] = x1; + quad[i++] = y1; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x2; + quad[i++] = y2; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 1; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x3; + quad[i++] = y3; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 1; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x4; + quad[i++] = y4; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = 0; + quad[i++] = 0; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) { + if (color === void 0) { color = null; } + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + this.enableRenderer(this.batcher); + if (color === null) + color = this.WHITE; + var quad = this.QUAD; + var i = 0; + quad[i++] = x; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u; + quad[i++] = region.v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u2; + quad[i++] = region.v2; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x + width; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u2; + quad[i++] = region.v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + quad[i++] = x; + quad[i++] = y + height; + quad[i++] = color.r; + quad[i++] = color.g; + quad[i++] = color.b; + quad[i++] = color.a; + quad[i++] = region.u; + quad[i++] = region.v; + if (this.twoColorTint) { + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + quad[i++] = 0; + } + this.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES); + }; + SceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + this.enableRenderer(this.shapes); + this.shapes.line(x, y, x2, y2, color); + }; + SceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + this.enableRenderer(this.shapes); + this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3); + }; + SceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + if (color4 === void 0) { color4 = null; } + this.enableRenderer(this.shapes); + this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4); + }; + SceneRenderer.prototype.rect = function (filled, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.rect(filled, x, y, width, height, color); + }; + SceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.rectLine(filled, x1, y1, x2, y2, width, color); + }; + SceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.polygon(polygonVertices, offset, count, color); + }; + SceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { + if (color === void 0) { color = null; } + if (segments === void 0) { segments = 0; } + this.enableRenderer(this.shapes); + this.shapes.circle(filled, x, y, radius, color, segments); + }; + SceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { + if (color === void 0) { color = null; } + this.enableRenderer(this.shapes); + this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color); + }; + SceneRenderer.prototype.end = function () { + if (this.activeRenderer === this.batcher) + this.batcher.end(); + else if (this.activeRenderer === this.shapes) + this.shapes.end(); + this.activeRenderer = null; + }; + SceneRenderer.prototype.resize = function (resizeMode) { + var canvas = this.canvas; + var w = canvas.clientWidth; + var h = canvas.clientHeight; + if (canvas.width != w || canvas.height != h) { + canvas.width = w; + canvas.height = h; + } + this.context.gl.viewport(0, 0, canvas.width, canvas.height); + if (resizeMode === ResizeMode.Stretch) { + } + else if (resizeMode === ResizeMode.Expand) { + this.camera.setViewport(w, h); + } + else if (resizeMode === ResizeMode.Fit) { + var sourceWidth = canvas.width, sourceHeight = canvas.height; + var targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight; + var targetRatio = targetHeight / targetWidth; + var sourceRatio = sourceHeight / sourceWidth; + var scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight; + this.camera.viewportWidth = sourceWidth * scale; + this.camera.viewportHeight = sourceHeight * scale; + } + this.camera.update(); + }; + SceneRenderer.prototype.enableRenderer = function (renderer) { + if (this.activeRenderer === renderer) + return; + this.end(); + if (renderer instanceof webgl.PolygonBatcher) { + this.batcherShader.bind(); + this.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); + this.batcherShader.setUniformi("u_texture", 0); + this.batcher.begin(this.batcherShader); + this.activeRenderer = this.batcher; + } + else if (renderer instanceof webgl.ShapeRenderer) { + this.shapesShader.bind(); + this.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); + this.shapes.begin(this.shapesShader); + this.activeRenderer = this.shapes; + } + else { + this.activeRenderer = this.skeletonDebugRenderer; + } + }; + SceneRenderer.prototype.dispose = function () { + this.batcher.dispose(); + this.batcherShader.dispose(); + this.shapes.dispose(); + this.shapesShader.dispose(); + this.skeletonDebugRenderer.dispose(); + }; + return SceneRenderer; + }()); + webgl.SceneRenderer = SceneRenderer; + var ResizeMode; + (function (ResizeMode) { + ResizeMode[ResizeMode["Stretch"] = 0] = "Stretch"; + ResizeMode[ResizeMode["Expand"] = 1] = "Expand"; + ResizeMode[ResizeMode["Fit"] = 2] = "Fit"; + })(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {})); + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var PolygonBatcher = (function () { - function PolygonBatcher(context, twoColorTint, maxVertices) { - if (twoColorTint === void 0) { twoColorTint = true; } - if (maxVertices === void 0) { maxVertices = 10920; } - this.isDrawing = false; - this.shader = null; - this.lastTexture = null; - this.verticesLength = 0; - this.indicesLength = 0; - if (maxVertices > 10920) - throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - var attributes = twoColorTint ? - [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] : - [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()]; - this.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3); - this.srcBlend = this.context.gl.SRC_ALPHA; - this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; - } - PolygonBatcher.prototype.begin = function (shader) { - var gl = 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 = shader; - this.lastTexture = null; - this.isDrawing = true; - gl.enable(gl.BLEND); - gl.blendFunc(this.srcBlend, this.dstBlend); - }; - PolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) { - var gl = this.context.gl; - this.srcBlend = srcBlend; - this.dstBlend = dstBlend; - if (this.isDrawing) { - this.flush(); - gl.blendFunc(this.srcBlend, this.dstBlend); - } - }; - PolygonBatcher.prototype.draw = function (texture, vertices, indices) { - if (texture != this.lastTexture) { - this.flush(); - this.lastTexture = texture; - } - else if (this.verticesLength + vertices.length > this.mesh.getVertices().length || - this.indicesLength + indices.length > this.mesh.getIndices().length) { - this.flush(); - } - var indexStart = this.mesh.numVertices(); - this.mesh.getVertices().set(vertices, this.verticesLength); - this.verticesLength += vertices.length; - this.mesh.setVerticesLength(this.verticesLength); - var indicesArray = this.mesh.getIndices(); - for (var i = this.indicesLength, j = 0; j < indices.length; i++, j++) - indicesArray[i] = indices[j] + indexStart; - this.indicesLength += indices.length; - this.mesh.setIndicesLength(this.indicesLength); - }; - PolygonBatcher.prototype.flush = function () { - var gl = this.context.gl; - if (this.verticesLength == 0) - return; - this.lastTexture.bind(); - this.mesh.draw(this.shader, gl.TRIANGLES); - this.verticesLength = 0; - this.indicesLength = 0; - this.mesh.setVerticesLength(0); - this.mesh.setIndicesLength(0); - this.drawCalls++; - }; - PolygonBatcher.prototype.end = function () { - var gl = this.context.gl; - if (!this.isDrawing) - throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()"); - if (this.verticesLength > 0 || this.indicesLength > 0) - this.flush(); - this.shader = null; - this.lastTexture = null; - this.isDrawing = false; - gl.disable(gl.BLEND); - }; - PolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; }; - PolygonBatcher.prototype.dispose = function () { - this.mesh.dispose(); - }; - return PolygonBatcher; - }()); - webgl.PolygonBatcher = PolygonBatcher; - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var Shader = (function () { + function Shader(context, vertexShader, fragmentShader) { + this.vertexShader = vertexShader; + this.fragmentShader = fragmentShader; + this.vs = null; + this.fs = null; + this.program = null; + this.tmp2x2 = new Float32Array(2 * 2); + this.tmp3x3 = new Float32Array(3 * 3); + this.tmp4x4 = new Float32Array(4 * 4); + this.vsSource = vertexShader; + this.fsSource = fragmentShader; + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.context.addRestorable(this); + this.compile(); + } + Shader.prototype.getProgram = function () { return this.program; }; + Shader.prototype.getVertexShader = function () { return this.vertexShader; }; + Shader.prototype.getFragmentShader = function () { return this.fragmentShader; }; + Shader.prototype.getVertexShaderSource = function () { return this.vsSource; }; + Shader.prototype.getFragmentSource = function () { return this.fsSource; }; + Shader.prototype.compile = function () { + var gl = this.context.gl; + try { + this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader); + this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader); + this.program = this.compileProgram(this.vs, this.fs); + } + catch (e) { + this.dispose(); + throw e; + } + }; + Shader.prototype.compileShader = function (type, source) { + var gl = this.context.gl; + var shader = gl.createShader(type); + gl.shaderSource(shader, source); + gl.compileShader(shader); + if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { + var error = "Couldn't compile shader: " + gl.getShaderInfoLog(shader); + gl.deleteShader(shader); + if (!gl.isContextLost()) + throw new Error(error); + } + return shader; + }; + Shader.prototype.compileProgram = function (vs, fs) { + var gl = this.context.gl; + var program = gl.createProgram(); + gl.attachShader(program, vs); + gl.attachShader(program, fs); + gl.linkProgram(program); + if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { + var error = "Couldn't compile shader program: " + gl.getProgramInfoLog(program); + gl.deleteProgram(program); + if (!gl.isContextLost()) + throw new Error(error); + } + return program; + }; + Shader.prototype.restore = function () { + this.compile(); + }; + Shader.prototype.bind = function () { + this.context.gl.useProgram(this.program); + }; + Shader.prototype.unbind = function () { + this.context.gl.useProgram(null); + }; + Shader.prototype.setUniformi = function (uniform, value) { + this.context.gl.uniform1i(this.getUniformLocation(uniform), value); + }; + Shader.prototype.setUniformf = function (uniform, value) { + this.context.gl.uniform1f(this.getUniformLocation(uniform), value); + }; + Shader.prototype.setUniform2f = function (uniform, value, value2) { + this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2); + }; + Shader.prototype.setUniform3f = function (uniform, value, value2, value3) { + this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3); + }; + Shader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) { + this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4); + }; + Shader.prototype.setUniform2x2f = function (uniform, value) { + var gl = this.context.gl; + this.tmp2x2.set(value); + gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2); + }; + Shader.prototype.setUniform3x3f = function (uniform, value) { + var gl = this.context.gl; + this.tmp3x3.set(value); + gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3); + }; + Shader.prototype.setUniform4x4f = function (uniform, value) { + var gl = this.context.gl; + this.tmp4x4.set(value); + gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4); + }; + Shader.prototype.getUniformLocation = function (uniform) { + var gl = this.context.gl; + var location = gl.getUniformLocation(this.program, uniform); + if (!location && !gl.isContextLost()) + throw new Error("Couldn't find location for uniform " + uniform); + return location; + }; + Shader.prototype.getAttributeLocation = function (attribute) { + var gl = this.context.gl; + var location = gl.getAttribLocation(this.program, attribute); + if (location == -1 && !gl.isContextLost()) + throw new Error("Couldn't find location for attribute " + attribute); + return location; + }; + Shader.prototype.dispose = function () { + this.context.removeRestorable(this); + var gl = this.context.gl; + if (this.vs) { + gl.deleteShader(this.vs); + this.vs = null; + } + if (this.fs) { + gl.deleteShader(this.fs); + this.fs = null; + } + if (this.program) { + gl.deleteProgram(this.program); + this.program = null; + } + }; + Shader.newColoredTextured = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.newTwoColoredTextured = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR2 + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_dark = " + Shader.COLOR2 + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.newColored = function (context) { + var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tuniform mat4 " + Shader.MVP_MATRIX + ";\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = " + Shader.COLOR + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; + var fs = "\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"; + return new Shader(context, vs, fs); + }; + Shader.MVP_MATRIX = "u_projTrans"; + Shader.POSITION = "a_position"; + Shader.COLOR = "a_color"; + Shader.COLOR2 = "a_color2"; + Shader.TEXCOORDS = "a_texCoords"; + Shader.SAMPLER = "u_texture"; + return Shader; + }()); + webgl.Shader = Shader; + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var SceneRenderer = (function () { - function SceneRenderer(canvas, context, twoColorTint) { - if (twoColorTint === void 0) { twoColorTint = true; } - this.twoColorTint = false; - 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 spine.Color(1, 1, 1, 1); - this.canvas = canvas; - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - this.twoColorTint = twoColorTint; - this.camera = new webgl.OrthoCamera(canvas.width, canvas.height); - this.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context); - this.batcher = new webgl.PolygonBatcher(this.context, twoColorTint); - this.shapesShader = webgl.Shader.newColored(this.context); - this.shapes = new webgl.ShapeRenderer(this.context); - this.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint); - this.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context); - } - SceneRenderer.prototype.begin = function () { - this.camera.update(); - this.enableRenderer(this.batcher); - }; - SceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) { - if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } - if (slotRangeStart === void 0) { slotRangeStart = -1; } - if (slotRangeEnd === void 0) { slotRangeEnd = -1; } - this.enableRenderer(this.batcher); - this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha; - this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd); - }; - SceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) { - if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } - if (ignoredBones === void 0) { ignoredBones = null; } - this.enableRenderer(this.shapes); - this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha; - this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones); - }; - SceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.batcher); - if (color === null) - color = this.WHITE; - var quad = this.QUAD; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); - }; - SceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.batcher); - if (color === null) - color = this.WHITE; - var quad = this.QUAD; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u; - quad[i++] = v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u2; - quad[i++] = v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u2; - quad[i++] = v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u; - quad[i++] = v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); - }; - SceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) { - if (color === void 0) { color = null; } - if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } - this.enableRenderer(this.batcher); - if (color === null) - color = this.WHITE; - var quad = this.QUAD; - var worldOriginX = x + pivotX; - var worldOriginY = y + pivotY; - var fx = -pivotX; - var fy = -pivotY; - var fx2 = width - pivotX; - var fy2 = height - pivotY; - var p1x = fx; - var p1y = fy; - var p2x = fx; - var p2y = fy2; - var p3x = fx2; - var p3y = fy2; - var p4x = fx2; - var p4y = fy; - var x1 = 0; - var y1 = 0; - var x2 = 0; - var y2 = 0; - var x3 = 0; - var y3 = 0; - var x4 = 0; - var y4 = 0; - if (angle != 0) { - var cos = spine.MathUtils.cosDeg(angle); - var sin = spine.MathUtils.sinDeg(angle); - x1 = cos * p1x - sin * p1y; - y1 = sin * p1x + cos * p1y; - x4 = cos * p2x - sin * p2y; - y4 = sin * p2x + cos * p2y; - x3 = cos * p3x - sin * p3y; - y3 = sin * p3x + cos * p3y; - x2 = x3 + (x1 - x4); - y2 = y3 + (y1 - y4); - } - else { - x1 = p1x; - y1 = p1y; - x4 = p2x; - y4 = p2y; - x3 = p3x; - y3 = p3y; - x2 = p4x; - y2 = p4y; - } - x1 += worldOriginX; - y1 += worldOriginY; - x2 += worldOriginX; - y2 += worldOriginY; - x3 += worldOriginX; - y3 += worldOriginY; - x4 += worldOriginX; - y4 += worldOriginY; - var i = 0; - quad[i++] = x1; - quad[i++] = y1; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x2; - quad[i++] = y2; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x3; - quad[i++] = y3; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x4; - quad[i++] = y4; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - this.batcher.draw(texture, quad, this.QUAD_TRIANGLES); - }; - SceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) { - if (color === void 0) { color = null; } - if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } - this.enableRenderer(this.batcher); - if (color === null) - color = this.WHITE; - var quad = this.QUAD; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u; - quad[i++] = region.v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u2; - quad[i++] = region.v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u2; - quad[i++] = region.v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u; - quad[i++] = region.v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - this.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES); - }; - SceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) { - if (color === void 0) { color = null; } - if (color2 === void 0) { color2 = null; } - this.enableRenderer(this.shapes); - this.shapes.line(x, y, x2, y2, color); - }; - SceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { - if (color === void 0) { color = null; } - if (color2 === void 0) { color2 = null; } - if (color3 === void 0) { color3 = null; } - this.enableRenderer(this.shapes); - this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3); - }; - SceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { - if (color === void 0) { color = null; } - if (color2 === void 0) { color2 = null; } - if (color3 === void 0) { color3 = null; } - if (color4 === void 0) { color4 = null; } - this.enableRenderer(this.shapes); - this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4); - }; - SceneRenderer.prototype.rect = function (filled, x, y, width, height, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.shapes); - this.shapes.rect(filled, x, y, width, height, color); - }; - SceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.shapes); - this.shapes.rectLine(filled, x1, y1, x2, y2, width, color); - }; - SceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.shapes); - this.shapes.polygon(polygonVertices, offset, count, color); - }; - SceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { - if (color === void 0) { color = null; } - if (segments === void 0) { segments = 0; } - this.enableRenderer(this.shapes); - this.shapes.circle(filled, x, y, radius, color, segments); - }; - SceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { - if (color === void 0) { color = null; } - this.enableRenderer(this.shapes); - this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color); - }; - SceneRenderer.prototype.end = function () { - if (this.activeRenderer === this.batcher) - this.batcher.end(); - else if (this.activeRenderer === this.shapes) - this.shapes.end(); - this.activeRenderer = null; - }; - SceneRenderer.prototype.resize = function (resizeMode) { - var canvas = this.canvas; - var w = canvas.clientWidth; - var h = canvas.clientHeight; - if (canvas.width != w || canvas.height != h) { - canvas.width = w; - canvas.height = h; - } - this.context.gl.viewport(0, 0, canvas.width, canvas.height); - if (resizeMode === ResizeMode.Stretch) { - } - else if (resizeMode === ResizeMode.Expand) { - this.camera.setViewport(w, h); - } - else if (resizeMode === ResizeMode.Fit) { - var sourceWidth = canvas.width, sourceHeight = canvas.height; - var targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight; - var targetRatio = targetHeight / targetWidth; - var sourceRatio = sourceHeight / sourceWidth; - var scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight; - this.camera.viewportWidth = sourceWidth * scale; - this.camera.viewportHeight = sourceHeight * scale; - } - this.camera.update(); - }; - SceneRenderer.prototype.enableRenderer = function (renderer) { - if (this.activeRenderer === renderer) - return; - this.end(); - if (renderer instanceof webgl.PolygonBatcher) { - this.batcherShader.bind(); - this.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); - this.batcherShader.setUniformi("u_texture", 0); - this.batcher.begin(this.batcherShader); - this.activeRenderer = this.batcher; - } - else if (renderer instanceof webgl.ShapeRenderer) { - this.shapesShader.bind(); - this.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values); - this.shapes.begin(this.shapesShader); - this.activeRenderer = this.shapes; - } - else { - this.activeRenderer = this.skeletonDebugRenderer; - } - }; - SceneRenderer.prototype.dispose = function () { - this.batcher.dispose(); - this.batcherShader.dispose(); - this.shapes.dispose(); - this.shapesShader.dispose(); - this.skeletonDebugRenderer.dispose(); - }; - return SceneRenderer; - }()); - webgl.SceneRenderer = SceneRenderer; - var ResizeMode; - (function (ResizeMode) { - ResizeMode[ResizeMode["Stretch"] = 0] = "Stretch"; - ResizeMode[ResizeMode["Expand"] = 1] = "Expand"; - ResizeMode[ResizeMode["Fit"] = 2] = "Fit"; - })(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {})); - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var ShapeRenderer = (function () { + function ShapeRenderer(context, maxVertices) { + if (maxVertices === void 0) { maxVertices = 10920; } + this.isDrawing = false; + this.shapeType = ShapeType.Filled; + this.color = new spine.Color(1, 1, 1, 1); + this.vertexIndex = 0; + this.tmp = new spine.Vector2(); + if (maxVertices > 10920) + throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + this.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0); + this.srcBlend = this.context.gl.SRC_ALPHA; + this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; + } + ShapeRenderer.prototype.begin = function (shader) { + if (this.isDrawing) + throw new Error("ShapeRenderer.begin() has already been called"); + this.shader = shader; + this.vertexIndex = 0; + this.isDrawing = true; + var gl = this.context.gl; + gl.enable(gl.BLEND); + gl.blendFunc(this.srcBlend, this.dstBlend); + }; + ShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) { + var gl = this.context.gl; + this.srcBlend = srcBlend; + this.dstBlend = dstBlend; + if (this.isDrawing) { + this.flush(); + gl.blendFunc(this.srcBlend, this.dstBlend); + } + }; + ShapeRenderer.prototype.setColor = function (color) { + this.color.setFromColor(color); + }; + ShapeRenderer.prototype.setColorWith = function (r, g, b, a) { + this.color.set(r, g, b, a); + }; + ShapeRenderer.prototype.point = function (x, y, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Point, 1); + if (color === null) + color = this.color; + this.vertex(x, y, color); + }; + ShapeRenderer.prototype.line = function (x, y, x2, y2, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Line, 2); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + this.vertex(x, y, color); + this.vertex(x2, y2, color); + }; + ShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + if (color2 === null) + color2 = this.color; + if (color3 === null) + color3 = this.color; + if (filled) { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + } + else { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x2, y2, color); + this.vertex(x3, y3, color2); + this.vertex(x3, y3, color); + this.vertex(x, y, color2); + } + }; + ShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { + if (color === void 0) { color = null; } + if (color2 === void 0) { color2 = null; } + if (color3 === void 0) { color3 = null; } + if (color4 === void 0) { color4 = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + if (color === null) + color = this.color; + if (color2 === null) + color2 = this.color; + if (color3 === null) + color3 = this.color; + if (color4 === null) + color4 = this.color; + if (filled) { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + this.vertex(x3, y3, color3); + this.vertex(x4, y4, color4); + this.vertex(x, y, color); + } + else { + this.vertex(x, y, color); + this.vertex(x2, y2, color2); + this.vertex(x2, y2, color2); + this.vertex(x3, y3, color3); + this.vertex(x3, y3, color3); + this.vertex(x4, y4, color4); + this.vertex(x4, y4, color4); + this.vertex(x, y, color); + } + }; + ShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) { + if (color === void 0) { color = null; } + this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color); + }; + ShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { + if (color === void 0) { color = null; } + this.check(filled ? ShapeType.Filled : ShapeType.Line, 8); + if (color === null) + color = this.color; + var t = this.tmp.set(y2 - y1, x1 - x2); + t.normalize(); + width *= 0.5; + var tx = t.x * width; + var ty = t.y * width; + if (!filled) { + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x1 - tx, y1 - ty, color); + } + else { + this.vertex(x1 + tx, y1 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x2 - tx, y2 - ty, color); + this.vertex(x2 + tx, y2 + ty, color); + this.vertex(x1 - tx, y1 - ty, color); + } + }; + ShapeRenderer.prototype.x = function (x, y, size) { + this.line(x - size, y - size, x + size, y + size); + this.line(x - size, y + size, x + size, y - size); + }; + ShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { + if (color === void 0) { color = null; } + if (count < 3) + throw new Error("Polygon must contain at least 3 vertices"); + this.check(ShapeType.Line, count * 2); + if (color === null) + color = this.color; + var vertices = this.mesh.getVertices(); + var idx = this.vertexIndex; + offset <<= 1; + count <<= 1; + var firstX = polygonVertices[offset]; + var firstY = polygonVertices[offset + 1]; + var last = offset + count; + for (var i = offset, n = offset + count - 2; i < n; i += 2) { + var x1 = polygonVertices[i]; + var y1 = polygonVertices[i + 1]; + var x2 = 0; + var y2 = 0; + if (i + 2 >= last) { + x2 = firstX; + y2 = firstY; + } + else { + x2 = polygonVertices[i + 2]; + y2 = polygonVertices[i + 3]; + } + this.vertex(x1, y1, color); + this.vertex(x2, y2, color); + } + }; + ShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { + if (color === void 0) { color = null; } + if (segments === void 0) { segments = 0; } + if (segments === 0) + segments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0); + if (segments <= 0) + throw new Error("segments must be > 0."); + if (color === null) + color = this.color; + var angle = 2 * spine.MathUtils.PI / segments; + var cos = Math.cos(angle); + var sin = Math.sin(angle); + var cx = radius, cy = 0; + if (!filled) { + this.check(ShapeType.Line, segments * 2 + 2); + for (var i = 0; i < segments; i++) { + this.vertex(x + cx, y + cy, color); + var temp_1 = cx; + cx = cos * cx - sin * cy; + cy = sin * temp_1 + cos * cy; + this.vertex(x + cx, y + cy, color); + } + this.vertex(x + cx, y + cy, color); + } + else { + this.check(ShapeType.Filled, segments * 3 + 3); + segments--; + for (var i = 0; i < segments; i++) { + this.vertex(x, y, color); + this.vertex(x + cx, y + cy, color); + var temp_2 = cx; + cx = cos * cx - sin * cy; + cy = sin * temp_2 + cos * cy; + this.vertex(x + cx, y + cy, color); + } + this.vertex(x, y, color); + this.vertex(x + cx, y + cy, color); + } + var temp = cx; + cx = radius; + cy = 0; + this.vertex(x + cx, y + cy, color); + }; + ShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { + if (color === void 0) { color = null; } + this.check(ShapeType.Line, segments * 2 + 2); + if (color === null) + color = this.color; + var subdiv_step = 1 / segments; + var subdiv_step2 = subdiv_step * subdiv_step; + var subdiv_step3 = subdiv_step * subdiv_step * subdiv_step; + var pre1 = 3 * subdiv_step; + var pre2 = 3 * subdiv_step2; + var pre4 = 6 * subdiv_step2; + var pre5 = 6 * subdiv_step3; + var tmp1x = x1 - cx1 * 2 + cx2; + var tmp1y = y1 - cy1 * 2 + cy2; + var tmp2x = (cx1 - cx2) * 3 - x1 + x2; + var tmp2y = (cy1 - cy2) * 3 - y1 + y2; + var fx = x1; + var fy = y1; + var dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3; + var dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3; + var ddfx = tmp1x * pre4 + tmp2x * pre5; + var ddfy = tmp1y * pre4 + tmp2y * pre5; + var dddfx = tmp2x * pre5; + var dddfy = tmp2y * pre5; + while (segments-- > 0) { + this.vertex(fx, fy, color); + fx += dfx; + fy += dfy; + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + this.vertex(fx, fy, color); + } + this.vertex(fx, fy, color); + this.vertex(x2, y2, color); + }; + ShapeRenderer.prototype.vertex = function (x, y, color) { + var idx = this.vertexIndex; + var vertices = this.mesh.getVertices(); + vertices[idx++] = x; + vertices[idx++] = y; + vertices[idx++] = color.r; + vertices[idx++] = color.g; + vertices[idx++] = color.b; + vertices[idx++] = color.a; + this.vertexIndex = idx; + }; + ShapeRenderer.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 = false; + }; + ShapeRenderer.prototype.flush = function () { + if (this.vertexIndex == 0) + return; + this.mesh.setVerticesLength(this.vertexIndex); + this.mesh.draw(this.shader, this.shapeType); + this.vertexIndex = 0; + }; + ShapeRenderer.prototype.check = function (shapeType, numVertices) { + if (!this.isDrawing) + throw new Error("ShapeRenderer.begin() has not been called"); + if (this.shapeType == shapeType) { + if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) + this.flush(); + else + return; + } + else { + this.flush(); + this.shapeType = shapeType; + } + }; + ShapeRenderer.prototype.dispose = function () { + this.mesh.dispose(); + }; + return ShapeRenderer; + }()); + webgl.ShapeRenderer = ShapeRenderer; + var ShapeType; + (function (ShapeType) { + ShapeType[ShapeType["Point"] = 0] = "Point"; + ShapeType[ShapeType["Line"] = 1] = "Line"; + ShapeType[ShapeType["Filled"] = 4] = "Filled"; + })(ShapeType = webgl.ShapeType || (webgl.ShapeType = {})); + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var Shader = (function () { - function Shader(context, vertexShader, fragmentShader) { - this.vertexShader = vertexShader; - this.fragmentShader = fragmentShader; - this.vs = null; - this.fs = null; - this.program = null; - this.tmp2x2 = new Float32Array(2 * 2); - this.tmp3x3 = new Float32Array(3 * 3); - this.tmp4x4 = new Float32Array(4 * 4); - this.vsSource = vertexShader; - this.fsSource = fragmentShader; - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - this.context.addRestorable(this); - this.compile(); - } - Shader.prototype.getProgram = function () { return this.program; }; - Shader.prototype.getVertexShader = function () { return this.vertexShader; }; - Shader.prototype.getFragmentShader = function () { return this.fragmentShader; }; - Shader.prototype.getVertexShaderSource = function () { return this.vsSource; }; - Shader.prototype.getFragmentSource = function () { return this.fsSource; }; - Shader.prototype.compile = function () { - var gl = this.context.gl; - try { - this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader); - this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader); - this.program = this.compileProgram(this.vs, this.fs); - } - catch (e) { - this.dispose(); - throw e; - } - }; - Shader.prototype.compileShader = function (type, source) { - var gl = this.context.gl; - var shader = gl.createShader(type); - gl.shaderSource(shader, source); - gl.compileShader(shader); - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { - var error = "Couldn't compile shader: " + gl.getShaderInfoLog(shader); - gl.deleteShader(shader); - if (!gl.isContextLost()) - throw new Error(error); - } - return shader; - }; - Shader.prototype.compileProgram = function (vs, fs) { - var gl = this.context.gl; - var program = gl.createProgram(); - gl.attachShader(program, vs); - gl.attachShader(program, fs); - gl.linkProgram(program); - if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { - var error = "Couldn't compile shader program: " + gl.getProgramInfoLog(program); - gl.deleteProgram(program); - if (!gl.isContextLost()) - throw new Error(error); - } - return program; - }; - Shader.prototype.restore = function () { - this.compile(); - }; - Shader.prototype.bind = function () { - this.context.gl.useProgram(this.program); - }; - Shader.prototype.unbind = function () { - this.context.gl.useProgram(null); - }; - Shader.prototype.setUniformi = function (uniform, value) { - this.context.gl.uniform1i(this.getUniformLocation(uniform), value); - }; - Shader.prototype.setUniformf = function (uniform, value) { - this.context.gl.uniform1f(this.getUniformLocation(uniform), value); - }; - Shader.prototype.setUniform2f = function (uniform, value, value2) { - this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2); - }; - Shader.prototype.setUniform3f = function (uniform, value, value2, value3) { - this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3); - }; - Shader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) { - this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4); - }; - Shader.prototype.setUniform2x2f = function (uniform, value) { - var gl = this.context.gl; - this.tmp2x2.set(value); - gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2); - }; - Shader.prototype.setUniform3x3f = function (uniform, value) { - var gl = this.context.gl; - this.tmp3x3.set(value); - gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3); - }; - Shader.prototype.setUniform4x4f = function (uniform, value) { - var gl = this.context.gl; - this.tmp4x4.set(value); - gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4); - }; - Shader.prototype.getUniformLocation = function (uniform) { - var gl = this.context.gl; - var location = gl.getUniformLocation(this.program, uniform); - if (!location && !gl.isContextLost()) - throw new Error("Couldn't find location for uniform " + uniform); - return location; - }; - Shader.prototype.getAttributeLocation = function (attribute) { - var gl = this.context.gl; - var location = gl.getAttribLocation(this.program, attribute); - if (location == -1 && !gl.isContextLost()) - throw new Error("Couldn't find location for attribute " + attribute); - return location; - }; - Shader.prototype.dispose = function () { - this.context.removeRestorable(this); - var gl = this.context.gl; - if (this.vs) { - gl.deleteShader(this.vs); - this.vs = null; - } - if (this.fs) { - gl.deleteShader(this.fs); - this.fs = null; - } - if (this.program) { - gl.deleteProgram(this.program); - this.program = null; - } - }; - Shader.newColoredTextured = function (context) { - var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; - var fs = "\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"; - return new Shader(context, vs, fs); - }; - Shader.newTwoColoredTextured = function (context) { - var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR2 + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.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 = " + Shader.COLOR + ";\n\t\t\t\t\tv_dark = " + Shader.COLOR2 + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; - var fs = "\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"; - return new Shader(context, vs, fs); - }; - Shader.newColored = function (context) { - var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tuniform mat4 " + Shader.MVP_MATRIX + ";\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = " + Shader.COLOR + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t"; - var fs = "\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"; - return new Shader(context, vs, fs); - }; - Shader.MVP_MATRIX = "u_projTrans"; - Shader.POSITION = "a_position"; - Shader.COLOR = "a_color"; - Shader.COLOR2 = "a_color2"; - Shader.TEXCOORDS = "a_texCoords"; - Shader.SAMPLER = "u_texture"; - return Shader; - }()); - webgl.Shader = Shader; - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var SkeletonDebugRenderer = (function () { + function SkeletonDebugRenderer(context) { + this.boneLineColor = new spine.Color(1, 0, 0, 1); + this.boneOriginColor = new spine.Color(0, 1, 0, 1); + this.attachmentLineColor = new spine.Color(0, 0, 1, 0.5); + this.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5); + this.pathColor = new spine.Color().setFromString("FF7F00"); + this.clipColor = new spine.Color(0.8, 0, 0, 2); + this.aabbColor = new spine.Color(0, 1, 0, 0.5); + this.drawBones = true; + this.drawRegionAttachments = true; + this.drawBoundingBoxes = true; + this.drawMeshHull = true; + this.drawMeshTriangles = true; + this.drawPaths = true; + this.drawSkeletonXY = false; + this.drawClipping = true; + this.premultipliedAlpha = false; + this.scale = 1; + this.boneWidth = 2; + this.bounds = new spine.SkeletonBounds(); + this.temp = new Array(); + this.vertices = spine.Utils.newFloatArray(2 * 1024); + this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); + } + SkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) { + if (ignoredBones === void 0) { ignoredBones = null; } + var skeletonX = skeleton.x; + var skeletonY = skeleton.y; + var gl = this.context.gl; + var srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA; + shapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA); + var bones = skeleton.bones; + if (this.drawBones) { + shapes.setColor(this.boneLineColor); + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) + continue; + if (bone.parent == null) + continue; + var x = skeletonX + bone.data.length * bone.a + bone.worldX; + var y = skeletonY + bone.data.length * bone.c + bone.worldY; + shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale); + } + if (this.drawSkeletonXY) + shapes.x(skeletonX, skeletonY, 4 * this.scale); + } + if (this.drawRegionAttachments) { + shapes.setColor(this.attachmentLineColor); + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (attachment instanceof spine.RegionAttachment) { + var regionAttachment = attachment; + var vertices = this.vertices; + regionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2); + shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]); + shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]); + shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]); + shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]); + } + } + } + if (this.drawMeshHull || this.drawMeshTriangles) { + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.MeshAttachment)) + continue; + var mesh = attachment; + var vertices = this.vertices; + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2); + var triangles = mesh.triangles; + var hullLength = mesh.hullLength; + if (this.drawMeshTriangles) { + shapes.setColor(this.triangleLineColor); + for (var ii = 0, nn = triangles.length; ii < nn; ii += 3) { + var v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2; + shapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]); + } + } + if (this.drawMeshHull && hullLength > 0) { + shapes.setColor(this.attachmentLineColor); + hullLength = (hullLength >> 1) * 2; + var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1]; + for (var ii = 0, nn = hullLength; ii < nn; ii += 2) { + var x = vertices[ii], y = vertices[ii + 1]; + shapes.line(x, y, lastX, lastY); + lastX = x; + lastY = y; + } + } + } + } + if (this.drawBoundingBoxes) { + var bounds = this.bounds; + bounds.update(skeleton, true); + shapes.setColor(this.aabbColor); + shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight()); + var polygons = bounds.polygons; + var boxes = bounds.boundingBoxes; + for (var i = 0, n = polygons.length; i < n; i++) { + var polygon = polygons[i]; + shapes.setColor(boxes[i].color); + shapes.polygon(polygon, 0, polygon.length); + } + } + if (this.drawPaths) { + var slots = skeleton.slots; + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.PathAttachment)) + continue; + var path = attachment; + var nn = path.worldVerticesLength; + var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); + path.computeWorldVertices(slot, 0, nn, world, 0, 2); + var color = this.pathColor; + var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0; + if (path.closed) { + shapes.setColor(color); + var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1]; + x2 = world[nn - 4]; + y2 = world[nn - 3]; + shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); + shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); + shapes.line(x1, y1, cx1, cy1); + shapes.line(x2, y2, cx2, cy2); + } + nn -= 4; + for (var ii = 4; ii < nn; ii += 6) { + var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3]; + x2 = world[ii + 4]; + y2 = world[ii + 5]; + shapes.setColor(color); + shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); + shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); + shapes.line(x1, y1, cx1, cy1); + shapes.line(x2, y2, cx2, cy2); + x1 = x2; + y1 = y2; + } + } + } + if (this.drawBones) { + shapes.setColor(this.boneOriginColor); + for (var i = 0, n = bones.length; i < n; i++) { + var bone = bones[i]; + if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) + continue; + shapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8); + } + } + if (this.drawClipping) { + var slots = skeleton.slots; + shapes.setColor(this.clipColor); + for (var i = 0, n = slots.length; i < n; i++) { + var slot = slots[i]; + var attachment = slot.getAttachment(); + if (!(attachment instanceof spine.ClippingAttachment)) + continue; + var clip = attachment; + var nn = clip.worldVerticesLength; + var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); + clip.computeWorldVertices(slot, 0, nn, world, 0, 2); + for (var i_16 = 0, n_2 = world.length; i_16 < n_2; i_16 += 2) { + var x = world[i_16]; + var y = world[i_16 + 1]; + var x2 = world[(i_16 + 2) % world.length]; + var y2 = world[(i_16 + 3) % world.length]; + shapes.line(x, y, x2, y2); + } + } + } + }; + SkeletonDebugRenderer.prototype.dispose = function () { + }; + SkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1); + SkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1); + return SkeletonDebugRenderer; + }()); + webgl.SkeletonDebugRenderer = SkeletonDebugRenderer; + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var ShapeRenderer = (function () { - function ShapeRenderer(context, maxVertices) { - if (maxVertices === void 0) { maxVertices = 10920; } - this.isDrawing = false; - this.shapeType = ShapeType.Filled; - this.color = new spine.Color(1, 1, 1, 1); - this.vertexIndex = 0; - this.tmp = new spine.Vector2(); - if (maxVertices > 10920) - throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - this.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0); - this.srcBlend = this.context.gl.SRC_ALPHA; - this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA; - } - ShapeRenderer.prototype.begin = function (shader) { - if (this.isDrawing) - throw new Error("ShapeRenderer.begin() has already been called"); - this.shader = shader; - this.vertexIndex = 0; - this.isDrawing = true; - var gl = this.context.gl; - gl.enable(gl.BLEND); - gl.blendFunc(this.srcBlend, this.dstBlend); - }; - ShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) { - var gl = this.context.gl; - this.srcBlend = srcBlend; - this.dstBlend = dstBlend; - if (this.isDrawing) { - this.flush(); - gl.blendFunc(this.srcBlend, this.dstBlend); - } - }; - ShapeRenderer.prototype.setColor = function (color) { - this.color.setFromColor(color); - }; - ShapeRenderer.prototype.setColorWith = function (r, g, b, a) { - this.color.set(r, g, b, a); - }; - ShapeRenderer.prototype.point = function (x, y, color) { - if (color === void 0) { color = null; } - this.check(ShapeType.Point, 1); - if (color === null) - color = this.color; - this.vertex(x, y, color); - }; - ShapeRenderer.prototype.line = function (x, y, x2, y2, color) { - if (color === void 0) { color = null; } - this.check(ShapeType.Line, 2); - var vertices = this.mesh.getVertices(); - var idx = this.vertexIndex; - if (color === null) - color = this.color; - this.vertex(x, y, color); - this.vertex(x2, y2, color); - }; - ShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) { - if (color === void 0) { color = null; } - if (color2 === void 0) { color2 = null; } - if (color3 === void 0) { color3 = null; } - this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); - var vertices = this.mesh.getVertices(); - var idx = this.vertexIndex; - if (color === null) - color = this.color; - if (color2 === null) - color2 = this.color; - if (color3 === null) - color3 = this.color; - if (filled) { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - } - else { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x2, y2, color); - this.vertex(x3, y3, color2); - this.vertex(x3, y3, color); - this.vertex(x, y, color2); - } - }; - ShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { - if (color === void 0) { color = null; } - if (color2 === void 0) { color2 = null; } - if (color3 === void 0) { color3 = null; } - if (color4 === void 0) { color4 = null; } - this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); - var vertices = this.mesh.getVertices(); - var idx = this.vertexIndex; - if (color === null) - color = this.color; - if (color2 === null) - color2 = this.color; - if (color3 === null) - color3 = this.color; - if (color4 === null) - color4 = this.color; - if (filled) { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - this.vertex(x3, y3, color3); - this.vertex(x4, y4, color4); - this.vertex(x, y, color); - } - else { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - this.vertex(x3, y3, color3); - this.vertex(x4, y4, color4); - this.vertex(x4, y4, color4); - this.vertex(x, y, color); - } - }; - ShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) { - if (color === void 0) { color = null; } - this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color); - }; - ShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) { - if (color === void 0) { color = null; } - this.check(filled ? ShapeType.Filled : ShapeType.Line, 8); - if (color === null) - color = this.color; - var t = this.tmp.set(y2 - y1, x1 - x2); - t.normalize(); - width *= 0.5; - var tx = t.x * width; - var ty = t.y * width; - if (!filled) { - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x1 - tx, y1 - ty, color); - } - else { - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - } - }; - ShapeRenderer.prototype.x = function (x, y, size) { - this.line(x - size, y - size, x + size, y + size); - this.line(x - size, y + size, x + size, y - size); - }; - ShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) { - if (color === void 0) { color = null; } - if (count < 3) - throw new Error("Polygon must contain at least 3 vertices"); - this.check(ShapeType.Line, count * 2); - if (color === null) - color = this.color; - var vertices = this.mesh.getVertices(); - var idx = this.vertexIndex; - offset <<= 1; - count <<= 1; - var firstX = polygonVertices[offset]; - var firstY = polygonVertices[offset + 1]; - var last = offset + count; - for (var i = offset, n = offset + count - 2; i < n; i += 2) { - var x1 = polygonVertices[i]; - var y1 = polygonVertices[i + 1]; - var x2 = 0; - var y2 = 0; - if (i + 2 >= last) { - x2 = firstX; - y2 = firstY; - } - else { - x2 = polygonVertices[i + 2]; - y2 = polygonVertices[i + 3]; - } - this.vertex(x1, y1, color); - this.vertex(x2, y2, color); - } - }; - ShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) { - if (color === void 0) { color = null; } - if (segments === void 0) { segments = 0; } - if (segments === 0) - segments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0); - if (segments <= 0) - throw new Error("segments must be > 0."); - if (color === null) - color = this.color; - var angle = 2 * spine.MathUtils.PI / segments; - var cos = Math.cos(angle); - var sin = Math.sin(angle); - var cx = radius, cy = 0; - if (!filled) { - this.check(ShapeType.Line, segments * 2 + 2); - for (var i = 0; i < segments; i++) { - this.vertex(x + cx, y + cy, color); - var temp_1 = cx; - cx = cos * cx - sin * cy; - cy = sin * temp_1 + cos * cy; - this.vertex(x + cx, y + cy, color); - } - this.vertex(x + cx, y + cy, color); - } - else { - this.check(ShapeType.Filled, segments * 3 + 3); - segments--; - for (var i = 0; i < segments; i++) { - this.vertex(x, y, color); - this.vertex(x + cx, y + cy, color); - var temp_2 = cx; - cx = cos * cx - sin * cy; - cy = sin * temp_2 + cos * cy; - this.vertex(x + cx, y + cy, color); - } - this.vertex(x, y, color); - this.vertex(x + cx, y + cy, color); - } - var temp = cx; - cx = radius; - cy = 0; - this.vertex(x + cx, y + cy, color); - }; - ShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { - if (color === void 0) { color = null; } - this.check(ShapeType.Line, segments * 2 + 2); - if (color === null) - color = this.color; - var subdiv_step = 1 / segments; - var subdiv_step2 = subdiv_step * subdiv_step; - var subdiv_step3 = subdiv_step * subdiv_step * subdiv_step; - var pre1 = 3 * subdiv_step; - var pre2 = 3 * subdiv_step2; - var pre4 = 6 * subdiv_step2; - var pre5 = 6 * subdiv_step3; - var tmp1x = x1 - cx1 * 2 + cx2; - var tmp1y = y1 - cy1 * 2 + cy2; - var tmp2x = (cx1 - cx2) * 3 - x1 + x2; - var tmp2y = (cy1 - cy2) * 3 - y1 + y2; - var fx = x1; - var fy = y1; - var dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3; - var dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3; - var ddfx = tmp1x * pre4 + tmp2x * pre5; - var ddfy = tmp1y * pre4 + tmp2y * pre5; - var dddfx = tmp2x * pre5; - var dddfy = tmp2y * pre5; - while (segments-- > 0) { - this.vertex(fx, fy, color); - fx += dfx; - fy += dfy; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - this.vertex(fx, fy, color); - } - this.vertex(fx, fy, color); - this.vertex(x2, y2, color); - }; - ShapeRenderer.prototype.vertex = function (x, y, color) { - var idx = this.vertexIndex; - var vertices = this.mesh.getVertices(); - vertices[idx++] = x; - vertices[idx++] = y; - vertices[idx++] = color.r; - vertices[idx++] = color.g; - vertices[idx++] = color.b; - vertices[idx++] = color.a; - this.vertexIndex = idx; - }; - ShapeRenderer.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 = false; - }; - ShapeRenderer.prototype.flush = function () { - if (this.vertexIndex == 0) - return; - this.mesh.setVerticesLength(this.vertexIndex); - this.mesh.draw(this.shader, this.shapeType); - this.vertexIndex = 0; - }; - ShapeRenderer.prototype.check = function (shapeType, numVertices) { - if (!this.isDrawing) - throw new Error("ShapeRenderer.begin() has not been called"); - if (this.shapeType == shapeType) { - if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) - this.flush(); - else - return; - } - else { - this.flush(); - this.shapeType = shapeType; - } - }; - ShapeRenderer.prototype.dispose = function () { - this.mesh.dispose(); - }; - return ShapeRenderer; - }()); - webgl.ShapeRenderer = ShapeRenderer; - var ShapeType; - (function (ShapeType) { - ShapeType[ShapeType["Point"] = 0] = "Point"; - ShapeType[ShapeType["Line"] = 1] = "Line"; - ShapeType[ShapeType["Filled"] = 4] = "Filled"; - })(ShapeType = webgl.ShapeType || (webgl.ShapeType = {})); - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var Renderable = (function () { + function Renderable(vertices, numVertices, numFloats) { + this.vertices = vertices; + this.numVertices = numVertices; + this.numFloats = numFloats; + } + return Renderable; + }()); + ; + var SkeletonRenderer = (function () { + function SkeletonRenderer(context, twoColorTint) { + if (twoColorTint === void 0) { twoColorTint = true; } + this.premultipliedAlpha = false; + this.vertexEffect = null; + this.tempColor = new spine.Color(); + this.tempColor2 = new spine.Color(); + this.vertexSize = 2 + 2 + 4; + this.twoColorTint = false; + this.renderable = new Renderable(null, 0, 0); + this.clipper = new spine.SkeletonClipping(); + this.temp = new spine.Vector2(); + this.temp2 = new spine.Vector2(); + this.temp3 = new spine.Color(); + this.temp4 = new spine.Color(); + this.twoColorTint = twoColorTint; + if (twoColorTint) + this.vertexSize += 4; + this.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024); + } + SkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) { + if (slotRangeStart === void 0) { slotRangeStart = -1; } + if (slotRangeEnd === void 0) { slotRangeEnd = -1; } + var clipper = this.clipper; + var premultipliedAlpha = this.premultipliedAlpha; + var twoColorTint = this.twoColorTint; + var blendMode = null; + var tempPos = this.temp; + var tempUv = this.temp2; + var tempLight = this.temp3; + var tempDark = this.temp4; + var renderable = this.renderable; + var uvs = null; + var triangles = null; + var drawOrder = skeleton.drawOrder; + var attachmentColor = null; + var skeletonColor = skeleton.color; + var vertexSize = twoColorTint ? 12 : 8; + var inRange = false; + if (slotRangeStart == -1) + inRange = true; + for (var i = 0, n = drawOrder.length; i < n; i++) { + var clippedVertexSize = clipper.isClipping() ? 2 : vertexSize; + var slot = drawOrder[i]; + if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) { + inRange = true; + } + if (!inRange) { + clipper.clipEndWithSlot(slot); + continue; + } + if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) { + inRange = false; + } + var attachment = slot.getAttachment(); + var texture = null; + if (attachment instanceof spine.RegionAttachment) { + var region = attachment; + renderable.vertices = this.vertices; + renderable.numVertices = 4; + renderable.numFloats = clippedVertexSize << 2; + region.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize); + triangles = SkeletonRenderer.QUAD_TRIANGLES; + uvs = region.uvs; + texture = region.region.renderObject.texture; + attachmentColor = region.color; + } + else if (attachment instanceof spine.MeshAttachment) { + var mesh = attachment; + renderable.vertices = this.vertices; + renderable.numVertices = (mesh.worldVerticesLength >> 1); + renderable.numFloats = renderable.numVertices * clippedVertexSize; + if (renderable.numFloats > renderable.vertices.length) { + renderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats); + } + mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize); + triangles = mesh.triangles; + texture = mesh.region.renderObject.texture; + uvs = mesh.uvs; + attachmentColor = mesh.color; + } + else if (attachment instanceof spine.ClippingAttachment) { + var clip = (attachment); + clipper.clipStart(slot, clip); + continue; + } + else { + clipper.clipEndWithSlot(slot); + continue; + } + if (texture != null) { + var slotColor = slot.color; + var finalColor = this.tempColor; + finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r; + finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g; + finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b; + finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a; + if (premultipliedAlpha) { + finalColor.r *= finalColor.a; + finalColor.g *= finalColor.a; + finalColor.b *= finalColor.a; + } + var darkColor = this.tempColor2; + if (slot.darkColor == null) + darkColor.set(0, 0, 0, 1.0); + else { + if (premultipliedAlpha) { + darkColor.r = slot.darkColor.r * finalColor.a; + darkColor.g = slot.darkColor.g * finalColor.a; + darkColor.b = slot.darkColor.b * finalColor.a; + } + else { + darkColor.setFromColor(slot.darkColor); + } + darkColor.a = premultipliedAlpha ? 1.0 : 0.0; + } + var slotBlendMode = slot.data.blendMode; + if (slotBlendMode != blendMode) { + blendMode = slotBlendMode; + batcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode)); + } + if (clipper.isClipping()) { + clipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint); + var clippedVertices = new Float32Array(clipper.clippedVertices); + var clippedTriangles = clipper.clippedTriangles; + if (this.vertexEffect != null) { + var vertexEffect = this.vertexEffect; + var verts = clippedVertices; + if (!twoColorTint) { + for (var v = 0, n_3 = clippedVertices.length; v < n_3; v += vertexSize) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); + tempUv.x = verts[v + 6]; + tempUv.y = verts[v + 7]; + tempDark.set(0, 0, 0, 0); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + } + } + else { + for (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); + tempUv.x = verts[v + 6]; + tempUv.y = verts[v + 7]; + tempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + verts[v + 8] = tempDark.r; + verts[v + 9] = tempDark.g; + verts[v + 10] = tempDark.b; + verts[v + 11] = tempDark.a; + } + } + } + batcher.draw(texture, clippedVertices, clippedTriangles); + } + else { + var verts = renderable.vertices; + if (this.vertexEffect != null) { + var vertexEffect = this.vertexEffect; + if (!twoColorTint) { + for (var v = 0, u = 0, n_5 = renderable.numFloats; v < n_5; v += vertexSize, u += 2) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempUv.x = uvs[u]; + tempUv.y = uvs[u + 1]; + tempLight.setFromColor(finalColor); + tempDark.set(0, 0, 0, 0); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + } + } + else { + for (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) { + tempPos.x = verts[v]; + tempPos.y = verts[v + 1]; + tempUv.x = uvs[u]; + tempUv.y = uvs[u + 1]; + tempLight.setFromColor(finalColor); + tempDark.setFromColor(darkColor); + vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); + verts[v] = tempPos.x; + verts[v + 1] = tempPos.y; + verts[v + 2] = tempLight.r; + verts[v + 3] = tempLight.g; + verts[v + 4] = tempLight.b; + verts[v + 5] = tempLight.a; + verts[v + 6] = tempUv.x; + verts[v + 7] = tempUv.y; + verts[v + 8] = tempDark.r; + verts[v + 9] = tempDark.g; + verts[v + 10] = tempDark.b; + verts[v + 11] = tempDark.a; + } + } + } + else { + if (!twoColorTint) { + for (var v = 2, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) { + verts[v] = finalColor.r; + verts[v + 1] = finalColor.g; + verts[v + 2] = finalColor.b; + verts[v + 3] = finalColor.a; + verts[v + 4] = uvs[u]; + verts[v + 5] = uvs[u + 1]; + } + } + else { + for (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) { + verts[v] = finalColor.r; + verts[v + 1] = finalColor.g; + verts[v + 2] = finalColor.b; + verts[v + 3] = finalColor.a; + verts[v + 4] = uvs[u]; + verts[v + 5] = uvs[u + 1]; + verts[v + 6] = darkColor.r; + verts[v + 7] = darkColor.g; + verts[v + 8] = darkColor.b; + verts[v + 9] = darkColor.a; + } + } + } + var view = renderable.vertices.subarray(0, renderable.numFloats); + batcher.draw(texture, view, triangles); + } + } + clipper.clipEndWithSlot(slot); + } + clipper.clipEnd(); + }; + SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; + return SkeletonRenderer; + }()); + webgl.SkeletonRenderer = SkeletonRenderer; + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var SkeletonDebugRenderer = (function () { - function SkeletonDebugRenderer(context) { - this.boneLineColor = new spine.Color(1, 0, 0, 1); - this.boneOriginColor = new spine.Color(0, 1, 0, 1); - this.attachmentLineColor = new spine.Color(0, 0, 1, 0.5); - this.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5); - this.pathColor = new spine.Color().setFromString("FF7F00"); - this.clipColor = new spine.Color(0.8, 0, 0, 2); - this.aabbColor = new spine.Color(0, 1, 0, 0.5); - this.drawBones = true; - this.drawRegionAttachments = true; - this.drawBoundingBoxes = true; - this.drawMeshHull = true; - this.drawMeshTriangles = true; - this.drawPaths = true; - this.drawSkeletonXY = false; - this.drawClipping = true; - this.premultipliedAlpha = false; - this.scale = 1; - this.boneWidth = 2; - this.bounds = new spine.SkeletonBounds(); - this.temp = new Array(); - this.vertices = spine.Utils.newFloatArray(2 * 1024); - this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context); - } - SkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) { - if (ignoredBones === void 0) { ignoredBones = null; } - var skeletonX = skeleton.x; - var skeletonY = skeleton.y; - var gl = this.context.gl; - var srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA; - shapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA); - var bones = skeleton.bones; - if (this.drawBones) { - shapes.setColor(this.boneLineColor); - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) - continue; - if (bone.parent == null) - continue; - var x = skeletonX + bone.data.length * bone.a + bone.worldX; - var y = skeletonY + bone.data.length * bone.c + bone.worldY; - shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale); - } - if (this.drawSkeletonXY) - shapes.x(skeletonX, skeletonY, 4 * this.scale); - } - if (this.drawRegionAttachments) { - shapes.setColor(this.attachmentLineColor); - var slots = skeleton.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var attachment = slot.getAttachment(); - if (attachment instanceof spine.RegionAttachment) { - var regionAttachment = attachment; - var vertices = this.vertices; - regionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2); - shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]); - shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]); - shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]); - shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]); - } - } - } - if (this.drawMeshHull || this.drawMeshTriangles) { - var slots = skeleton.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var attachment = slot.getAttachment(); - if (!(attachment instanceof spine.MeshAttachment)) - continue; - var mesh = attachment; - var vertices = this.vertices; - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2); - var triangles = mesh.triangles; - var hullLength = mesh.hullLength; - if (this.drawMeshTriangles) { - shapes.setColor(this.triangleLineColor); - for (var ii = 0, nn = triangles.length; ii < nn; ii += 3) { - var v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2; - shapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]); - } - } - if (this.drawMeshHull && hullLength > 0) { - shapes.setColor(this.attachmentLineColor); - hullLength = (hullLength >> 1) * 2; - var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1]; - for (var ii = 0, nn = hullLength; ii < nn; ii += 2) { - var x = vertices[ii], y = vertices[ii + 1]; - shapes.line(x, y, lastX, lastY); - lastX = x; - lastY = y; - } - } - } - } - if (this.drawBoundingBoxes) { - var bounds = this.bounds; - bounds.update(skeleton, true); - shapes.setColor(this.aabbColor); - shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight()); - var polygons = bounds.polygons; - var boxes = bounds.boundingBoxes; - for (var i = 0, n = polygons.length; i < n; i++) { - var polygon = polygons[i]; - shapes.setColor(boxes[i].color); - shapes.polygon(polygon, 0, polygon.length); - } - } - if (this.drawPaths) { - var slots = skeleton.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var attachment = slot.getAttachment(); - if (!(attachment instanceof spine.PathAttachment)) - continue; - var path = attachment; - var nn = path.worldVerticesLength; - var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); - path.computeWorldVertices(slot, 0, nn, world, 0, 2); - var color = this.pathColor; - var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0; - if (path.closed) { - shapes.setColor(color); - var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1]; - x2 = world[nn - 4]; - y2 = world[nn - 3]; - shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); - shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); - shapes.line(x1, y1, cx1, cy1); - shapes.line(x2, y2, cx2, cy2); - } - nn -= 4; - for (var ii = 4; ii < nn; ii += 6) { - var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3]; - x2 = world[ii + 4]; - y2 = world[ii + 5]; - shapes.setColor(color); - shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); - shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY); - shapes.line(x1, y1, cx1, cy1); - shapes.line(x2, y2, cx2, cy2); - x1 = x2; - y1 = y2; - } - } - } - if (this.drawBones) { - shapes.setColor(this.boneOriginColor); - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) - continue; - shapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8); - } - } - if (this.drawClipping) { - var slots = skeleton.slots; - shapes.setColor(this.clipColor); - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var attachment = slot.getAttachment(); - if (!(attachment instanceof spine.ClippingAttachment)) - continue; - var clip = attachment; - var nn = clip.worldVerticesLength; - var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0); - clip.computeWorldVertices(slot, 0, nn, world, 0, 2); - for (var i_20 = 0, n_2 = world.length; i_20 < n_2; i_20 += 2) { - var x = world[i_20]; - var y = world[i_20 + 1]; - var x2 = world[(i_20 + 2) % world.length]; - var y2 = world[(i_20 + 3) % world.length]; - shapes.line(x, y, x2, y2); - } - } - } - }; - SkeletonDebugRenderer.prototype.dispose = function () { - }; - SkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1); - SkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1); - return SkeletonDebugRenderer; - }()); - webgl.SkeletonDebugRenderer = SkeletonDebugRenderer; - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var Vector3 = (function () { + function Vector3(x, y, z) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (z === void 0) { z = 0; } + this.x = 0; + this.y = 0; + this.z = 0; + this.x = x; + this.y = y; + this.z = z; + } + Vector3.prototype.setFrom = function (v) { + this.x = v.x; + this.y = v.y; + this.z = v.z; + return this; + }; + Vector3.prototype.set = function (x, y, z) { + this.x = x; + this.y = y; + this.z = z; + return this; + }; + Vector3.prototype.add = function (v) { + this.x += v.x; + this.y += v.y; + this.z += v.z; + return this; + }; + Vector3.prototype.sub = function (v) { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + return this; + }; + Vector3.prototype.scale = function (s) { + this.x *= s; + this.y *= s; + this.z *= s; + return this; + }; + Vector3.prototype.normalize = function () { + var len = this.length(); + if (len == 0) + return this; + len = 1 / len; + this.x *= len; + this.y *= len; + this.z *= len; + return this; + }; + Vector3.prototype.cross = function (v) { + return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x); + }; + Vector3.prototype.multiply = function (matrix) { + var l_mat = matrix.values; + return this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]); + }; + Vector3.prototype.project = function (matrix) { + var l_mat = matrix.values; + var l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]); + return this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w); + }; + Vector3.prototype.dot = function (v) { + return this.x * v.x + this.y * v.y + this.z * v.z; + }; + Vector3.prototype.length = function () { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + }; + Vector3.prototype.distance = function (v) { + var a = v.x - this.x; + var b = v.y - this.y; + var c = v.z - this.z; + return Math.sqrt(a * a + b * b + c * c); + }; + return Vector3; + }()); + webgl.Vector3 = Vector3; + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); var spine; (function (spine) { - var webgl; - (function (webgl) { - var Renderable = (function () { - function Renderable(vertices, numVertices, numFloats) { - this.vertices = vertices; - this.numVertices = numVertices; - this.numFloats = numFloats; - } - return Renderable; - }()); - ; - var SkeletonRenderer = (function () { - function SkeletonRenderer(context, twoColorTint) { - if (twoColorTint === void 0) { twoColorTint = true; } - this.premultipliedAlpha = false; - this.vertexEffect = null; - this.tempColor = new spine.Color(); - this.tempColor2 = new spine.Color(); - this.vertexSize = 2 + 2 + 4; - this.twoColorTint = false; - this.renderable = new Renderable(null, 0, 0); - this.clipper = new spine.SkeletonClipping(); - this.temp = new spine.Vector2(); - this.temp2 = new spine.Vector2(); - this.temp3 = new spine.Color(); - this.temp4 = new spine.Color(); - this.twoColorTint = twoColorTint; - if (twoColorTint) - this.vertexSize += 4; - this.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024); - } - SkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) { - if (slotRangeStart === void 0) { slotRangeStart = -1; } - if (slotRangeEnd === void 0) { slotRangeEnd = -1; } - var clipper = this.clipper; - var premultipliedAlpha = this.premultipliedAlpha; - var twoColorTint = this.twoColorTint; - var blendMode = null; - var tempPos = this.temp; - var tempUv = this.temp2; - var tempLight = this.temp3; - var tempDark = this.temp4; - var renderable = this.renderable; - var uvs = null; - var triangles = null; - var drawOrder = skeleton.drawOrder; - var attachmentColor = null; - var skeletonColor = skeleton.color; - var vertexSize = twoColorTint ? 12 : 8; - var inRange = false; - if (slotRangeStart == -1) - inRange = true; - for (var i = 0, n = drawOrder.length; i < n; i++) { - var clippedVertexSize = clipper.isClipping() ? 2 : vertexSize; - var slot = drawOrder[i]; - if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) { - inRange = true; - } - if (!inRange) { - clipper.clipEndWithSlot(slot); - continue; - } - if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) { - inRange = false; - } - var attachment = slot.getAttachment(); - var texture = null; - if (attachment instanceof spine.RegionAttachment) { - var region = attachment; - renderable.vertices = this.vertices; - renderable.numVertices = 4; - renderable.numFloats = clippedVertexSize << 2; - region.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize); - triangles = SkeletonRenderer.QUAD_TRIANGLES; - uvs = region.uvs; - texture = region.region.renderObject.texture; - attachmentColor = region.color; - } - else if (attachment instanceof spine.MeshAttachment) { - var mesh = attachment; - renderable.vertices = this.vertices; - renderable.numVertices = (mesh.worldVerticesLength >> 1); - renderable.numFloats = renderable.numVertices * clippedVertexSize; - if (renderable.numFloats > renderable.vertices.length) { - renderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats); - } - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize); - triangles = mesh.triangles; - texture = mesh.region.renderObject.texture; - uvs = mesh.uvs; - attachmentColor = mesh.color; - } - else if (attachment instanceof spine.ClippingAttachment) { - var clip = (attachment); - clipper.clipStart(slot, clip); - continue; - } - else { - clipper.clipEndWithSlot(slot); - continue; - } - if (texture != null) { - var slotColor = slot.color; - var finalColor = this.tempColor; - finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r; - finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g; - finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b; - finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a; - if (premultipliedAlpha) { - finalColor.r *= finalColor.a; - finalColor.g *= finalColor.a; - finalColor.b *= finalColor.a; - } - var darkColor = this.tempColor2; - if (slot.darkColor == null) - darkColor.set(0, 0, 0, 1.0); - else { - if (premultipliedAlpha) { - darkColor.r = slot.darkColor.r * finalColor.a; - darkColor.g = slot.darkColor.g * finalColor.a; - darkColor.b = slot.darkColor.b * finalColor.a; - } - else { - darkColor.setFromColor(slot.darkColor); - } - darkColor.a = premultipliedAlpha ? 1.0 : 0.0; - } - var slotBlendMode = slot.data.blendMode; - if (slotBlendMode != blendMode) { - blendMode = slotBlendMode; - batcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode)); - } - if (clipper.isClipping()) { - clipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint); - var clippedVertices = new Float32Array(clipper.clippedVertices); - var clippedTriangles = clipper.clippedTriangles; - if (this.vertexEffect != null) { - var vertexEffect = this.vertexEffect; - var verts = clippedVertices; - if (!twoColorTint) { - for (var v = 0, n_3 = clippedVertices.length; v < n_3; v += vertexSize) { - tempPos.x = verts[v]; - tempPos.y = verts[v + 1]; - tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); - tempUv.x = verts[v + 6]; - tempUv.y = verts[v + 7]; - tempDark.set(0, 0, 0, 0); - vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); - verts[v] = tempPos.x; - verts[v + 1] = tempPos.y; - verts[v + 2] = tempLight.r; - verts[v + 3] = tempLight.g; - verts[v + 4] = tempLight.b; - verts[v + 5] = tempLight.a; - verts[v + 6] = tempUv.x; - verts[v + 7] = tempUv.y; - } - } - else { - for (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) { - tempPos.x = verts[v]; - tempPos.y = verts[v + 1]; - tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]); - tempUv.x = verts[v + 6]; - tempUv.y = verts[v + 7]; - tempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]); - vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); - verts[v] = tempPos.x; - verts[v + 1] = tempPos.y; - verts[v + 2] = tempLight.r; - verts[v + 3] = tempLight.g; - verts[v + 4] = tempLight.b; - verts[v + 5] = tempLight.a; - verts[v + 6] = tempUv.x; - verts[v + 7] = tempUv.y; - verts[v + 8] = tempDark.r; - verts[v + 9] = tempDark.g; - verts[v + 10] = tempDark.b; - verts[v + 11] = tempDark.a; - } - } - } - batcher.draw(texture, clippedVertices, clippedTriangles); - } - else { - var verts = renderable.vertices; - if (this.vertexEffect != null) { - var vertexEffect = this.vertexEffect; - if (!twoColorTint) { - for (var v = 0, u = 0, n_5 = renderable.numFloats; v < n_5; v += vertexSize, u += 2) { - tempPos.x = verts[v]; - tempPos.y = verts[v + 1]; - tempUv.x = uvs[u]; - tempUv.y = uvs[u + 1]; - tempLight.setFromColor(finalColor); - tempDark.set(0, 0, 0, 0); - vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); - verts[v] = tempPos.x; - verts[v + 1] = tempPos.y; - verts[v + 2] = tempLight.r; - verts[v + 3] = tempLight.g; - verts[v + 4] = tempLight.b; - verts[v + 5] = tempLight.a; - verts[v + 6] = tempUv.x; - verts[v + 7] = tempUv.y; - } - } - else { - for (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) { - tempPos.x = verts[v]; - tempPos.y = verts[v + 1]; - tempUv.x = uvs[u]; - tempUv.y = uvs[u + 1]; - tempLight.setFromColor(finalColor); - tempDark.setFromColor(darkColor); - vertexEffect.transform(tempPos, tempUv, tempLight, tempDark); - verts[v] = tempPos.x; - verts[v + 1] = tempPos.y; - verts[v + 2] = tempLight.r; - verts[v + 3] = tempLight.g; - verts[v + 4] = tempLight.b; - verts[v + 5] = tempLight.a; - verts[v + 6] = tempUv.x; - verts[v + 7] = tempUv.y; - verts[v + 8] = tempDark.r; - verts[v + 9] = tempDark.g; - verts[v + 10] = tempDark.b; - verts[v + 11] = tempDark.a; - } - } - } - else { - if (!twoColorTint) { - for (var v = 2, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) { - verts[v] = finalColor.r; - verts[v + 1] = finalColor.g; - verts[v + 2] = finalColor.b; - verts[v + 3] = finalColor.a; - verts[v + 4] = uvs[u]; - verts[v + 5] = uvs[u + 1]; - } - } - else { - for (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) { - verts[v] = finalColor.r; - verts[v + 1] = finalColor.g; - verts[v + 2] = finalColor.b; - verts[v + 3] = finalColor.a; - verts[v + 4] = uvs[u]; - verts[v + 5] = uvs[u + 1]; - verts[v + 6] = darkColor.r; - verts[v + 7] = darkColor.g; - verts[v + 8] = darkColor.b; - verts[v + 9] = darkColor.a; - } - } - } - var view = renderable.vertices.subarray(0, renderable.numFloats); - batcher.draw(texture, view, triangles); - } - } - clipper.clipEndWithSlot(slot); - } - clipper.clipEnd(); - }; - SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; - return SkeletonRenderer; - }()); - webgl.SkeletonRenderer = SkeletonRenderer; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var Vector3 = (function () { - function Vector3(x, y, z) { - if (x === void 0) { x = 0; } - if (y === void 0) { y = 0; } - if (z === void 0) { z = 0; } - this.x = 0; - this.y = 0; - this.z = 0; - this.x = x; - this.y = y; - this.z = z; - } - Vector3.prototype.setFrom = function (v) { - this.x = v.x; - this.y = v.y; - this.z = v.z; - return this; - }; - Vector3.prototype.set = function (x, y, z) { - this.x = x; - this.y = y; - this.z = z; - return this; - }; - Vector3.prototype.add = function (v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - return this; - }; - Vector3.prototype.sub = function (v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - return this; - }; - Vector3.prototype.scale = function (s) { - this.x *= s; - this.y *= s; - this.z *= s; - return this; - }; - Vector3.prototype.normalize = function () { - var len = this.length(); - if (len == 0) - return this; - len = 1 / len; - this.x *= len; - this.y *= len; - this.z *= len; - return this; - }; - Vector3.prototype.cross = function (v) { - return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x); - }; - Vector3.prototype.multiply = function (matrix) { - var l_mat = matrix.values; - return this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]); - }; - Vector3.prototype.project = function (matrix) { - var l_mat = matrix.values; - var l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]); - return this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w); - }; - Vector3.prototype.dot = function (v) { - return this.x * v.x + this.y * v.y + this.z * v.z; - }; - Vector3.prototype.length = function () { - return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); - }; - Vector3.prototype.distance = function (v) { - var a = v.x - this.x; - var b = v.y - this.y; - var c = v.z - this.z; - return Math.sqrt(a * a + b * b + c * c); - }; - return Vector3; - }()); - webgl.Vector3 = Vector3; - })(webgl = spine.webgl || (spine.webgl = {})); -})(spine || (spine = {})); -var spine; -(function (spine) { - var webgl; - (function (webgl) { - var ManagedWebGLRenderingContext = (function () { - function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) { - if (contextConfig === void 0) { contextConfig = { alpha: "true" }; } - var _this = this; - this.restorables = new Array(); - if (canvasOrContext instanceof HTMLCanvasElement) { - var canvas_1 = canvasOrContext; - this.gl = (canvas_1.getContext("webgl", contextConfig) || canvas_1.getContext("experimental-webgl", contextConfig)); - this.canvas = canvas_1; - canvas_1.addEventListener("webglcontextlost", function (e) { - var event = e; - if (e) { - e.preventDefault(); - } - }); - canvas_1.addEventListener("webglcontextrestored", function (e) { - for (var i = 0, n = _this.restorables.length; i < n; i++) { - _this.restorables[i].restore(); - } - }); - } - else { - this.gl = canvasOrContext; - this.canvas = this.gl.canvas; - } - } - ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) { - this.restorables.push(restorable); - }; - ManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) { - var index = this.restorables.indexOf(restorable); - if (index > -1) - this.restorables.splice(index, 1); - }; - return ManagedWebGLRenderingContext; - }()); - webgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext; - var WebGLBlendModeConverter = (function () { - function WebGLBlendModeConverter() { - } - WebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) { - switch (blendMode) { - case spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; - case spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE; - case spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; - case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; - default: throw new Error("Unknown blend mode: " + blendMode); - } - }; - WebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) { - if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } - switch (blendMode) { - case spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; - case spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; - case spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR; - case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE; - default: throw new Error("Unknown blend mode: " + blendMode); - } - }; - WebGLBlendModeConverter.ZERO = 0; - WebGLBlendModeConverter.ONE = 1; - WebGLBlendModeConverter.SRC_COLOR = 0x0300; - WebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301; - WebGLBlendModeConverter.SRC_ALPHA = 0x0302; - WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303; - WebGLBlendModeConverter.DST_ALPHA = 0x0304; - WebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305; - WebGLBlendModeConverter.DST_COLOR = 0x0306; - return WebGLBlendModeConverter; - }()); - webgl.WebGLBlendModeConverter = WebGLBlendModeConverter; - })(webgl = spine.webgl || (spine.webgl = {})); + var webgl; + (function (webgl) { + var ManagedWebGLRenderingContext = (function () { + function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) { + var _this = this; + if (contextConfig === void 0) { contextConfig = { alpha: "true" }; } + this.restorables = new Array(); + if (canvasOrContext instanceof HTMLCanvasElement) { + var canvas_1 = canvasOrContext; + this.gl = (canvas_1.getContext("webgl", contextConfig) || canvas_1.getContext("experimental-webgl", contextConfig)); + this.canvas = canvas_1; + canvas_1.addEventListener("webglcontextlost", function (e) { + var event = e; + if (e) { + e.preventDefault(); + } + }); + canvas_1.addEventListener("webglcontextrestored", function (e) { + for (var i = 0, n = _this.restorables.length; i < n; i++) { + _this.restorables[i].restore(); + } + }); + } + else { + this.gl = canvasOrContext; + this.canvas = this.gl.canvas; + } + } + ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) { + this.restorables.push(restorable); + }; + ManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) { + var index = this.restorables.indexOf(restorable); + if (index > -1) + this.restorables.splice(index, 1); + }; + return ManagedWebGLRenderingContext; + }()); + webgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext; + var WebGLBlendModeConverter = (function () { + function WebGLBlendModeConverter() { + } + WebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) { + switch (blendMode) { + case spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + case spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE; + case spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA; + default: throw new Error("Unknown blend mode: " + blendMode); + } + }; + WebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) { + if (premultipliedAlpha === void 0) { premultipliedAlpha = false; } + switch (blendMode) { + case spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; + case spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA; + case spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR; + case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE; + default: throw new Error("Unknown blend mode: " + blendMode); + } + }; + WebGLBlendModeConverter.ZERO = 0; + WebGLBlendModeConverter.ONE = 1; + WebGLBlendModeConverter.SRC_COLOR = 0x0300; + WebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301; + WebGLBlendModeConverter.SRC_ALPHA = 0x0302; + WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303; + WebGLBlendModeConverter.DST_ALPHA = 0x0304; + WebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305; + WebGLBlendModeConverter.DST_COLOR = 0x0306; + return WebGLBlendModeConverter; + }()); + webgl.WebGLBlendModeConverter = WebGLBlendModeConverter; + })(webgl = spine.webgl || (spine.webgl = {})); })(spine || (spine = {})); +//# sourceMappingURL=spine-both.js.map \ No newline at end of file diff --git a/plugins/spine/src/runtimes/spine-both.js.map b/plugins/spine/src/runtimes/spine-both.js.map new file mode 100644 index 000000000..51afbeaf2 --- /dev/null +++ b/plugins/spine/src/runtimes/spine-both.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spine-both.js","sourceRoot":"","sources":["../core/src/Animation.ts","../core/src/AnimationState.ts","../core/src/AnimationStateData.ts","../core/src/AssetManager.ts","../core/src/AtlasAttachmentLoader.ts","../core/src/BlendMode.ts","../core/src/Bone.ts","../core/src/BoneData.ts","../core/src/Constraint.ts","../core/src/Event.ts","../core/src/EventData.ts","../core/src/IkConstraint.ts","../core/src/IkConstraintData.ts","../core/src/PathConstraint.ts","../core/src/PathConstraintData.ts","../core/src/SharedAssetManager.ts","../core/src/Skeleton.ts","../core/src/SkeletonBounds.ts","../core/src/SkeletonClipping.ts","../core/src/SkeletonData.ts","../core/src/SkeletonJson.ts","../core/src/Skin.ts","../core/src/Slot.ts","../core/src/SlotData.ts","../core/src/Texture.ts","../core/src/TextureAtlas.ts","../core/src/TransformConstraint.ts","../core/src/TransformConstraintData.ts","../core/src/Triangulator.ts","../core/src/Updatable.ts","../core/src/Utils.ts","../core/src/VertexEffect.ts","../core/src/polyfills.ts","../core/src/attachments/Attachment.ts","../core/src/attachments/AttachmentLoader.ts","../core/src/attachments/AttachmentType.ts","../core/src/attachments/BoundingBoxAttachment.ts","../core/src/attachments/ClippingAttachment.ts","../core/src/attachments/MeshAttachment.ts","../core/src/attachments/PathAttachment.ts","../core/src/attachments/PointAttachment.ts","../core/src/attachments/RegionAttachment.ts","../core/src/vertexeffects/JitterEffect.ts","../core/src/vertexeffects/SwirlEffect.ts","../canvas/src/AssetManager.ts","../canvas/src/CanvasTexture.ts","../canvas/src/SkeletonRenderer.ts","../webgl/src/AssetManager.ts","../webgl/src/Camera.ts","../webgl/src/GLTexture.ts","../webgl/src/Matrix4.ts","../webgl/src/Mesh.ts","../webgl/src/PolygonBatcher.ts","../webgl/src/SceneRenderer.ts","../webgl/src/Shader.ts","../webgl/src/ShapeRenderer.ts","../webgl/src/SkeletonDebugRenderer.ts","../webgl/src/SkeletonRenderer.ts","../webgl/src/Vector3.ts","../webgl/src/WebGL.ts"],"names":[],"mappings":";;;;;;;;;;;;;AA6BA,IAAO,KAAK,CAs1CX;AAt1CD,WAAO,KAAK;IACX;QAKC,mBAAa,IAAY,EAAE,SAA0B,EAAE,QAAgB;YACtE,IAAI,IAAI,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAC1D,IAAI,SAAS,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACpE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1B,CAAC;QAED,yBAAK,GAAL,UAAO,QAAkB,EAAE,QAAgB,EAAE,IAAY,EAAE,IAAa,EAAE,MAAoB,EAAE,KAAa,EAAE,KAAe,EAAE,SAAuB;YACtJ,IAAI,QAAQ,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAElE,IAAI,IA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src/runtimes/spine-canvas.js.map new file mode 100644 index 000000000..d7f8e375a --- /dev/null +++ b/plugins/spine/src/runtimes/spine-canvas.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spine-canvas.js","sourceRoot":"","sources":["../core/src/Animation.ts","../core/src/AnimationState.ts","../core/src/AnimationStateData.ts","../core/src/AssetManager.ts","../core/src/AtlasAttachmentLoader.ts","../core/src/BlendMode.ts","../core/src/Bone.ts","../core/src/BoneData.ts","../core/src/Constraint.ts","../core/src/Event.ts","../core/src/EventData.ts","../core/src/IkConstraint.ts","../core/src/IkConstraintData.ts","../core/src/PathConstraint.ts","../core/src/PathConstraintData.ts","../core/src/SharedAssetManager.ts","../core/src/Skeleton.ts","../core/src/SkeletonBounds.ts","../core/src/SkeletonClipping.ts","../core/src/SkeletonData.ts","../core/src/SkeletonJson.ts","../core/src/Skin.ts","../core/src/Slot.ts","../core/src/SlotData.ts","../core/src/Texture.ts","../core/src/TextureAtlas.ts","../core/src/TransformConstraint.ts","../core/src/TransformConstraintData.ts","../core/src/Triangulator.ts","../core/src/Updatable.ts","../core/src/Utils.ts","../core/src/VertexEffect.ts","../core/src/polyfills.ts","../core/src/attachments/Attachment.ts","../core/src/attachments/AttachmentLoader.ts","../core/src/attachments/AttachmentType.ts","../core/src/attachments/BoundingBoxAttachment.ts","../core/src/attachments/ClippingAttachment.ts","../core/src/attachments/MeshAttachment.ts","../core/src/attachments/PathAttachment.ts","../core/src/attachments/PointAttachment.ts","../core/src/attachments/RegionAttachment.ts","../core/src/vertexeffects/JitterEffect.ts","../core/src/vertexeffects/SwirlEffect.ts","../canvas/src/AssetManager.ts","../canvas/src/CanvasTexture.ts","../canvas/src/SkeletonRenderer.ts"],"names":[],"mappings":";;;;;;;;;;AA6BA,IAAO,KAAK,CAs1CX;AAt1CD,WAAO,KAAK;IACX;QAKC,mBAAa,IAAY,EAAE,SAA0B,EAAE,QAAgB;YACtE,IAAI,IAAI,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,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,KAAL,KAAK,QAwSX"} \ No newline at end of file diff --git a/plugins/spine/src/runtimes/spine-webgl.js.map b/plugins/spine/src/runtimes/spine-webgl.js.map new file mode 100644 index 000000000..b8d2423a3 --- /dev/null +++ b/plugins/spine/src/runtimes/spine-webgl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spine-webgl.js","sourceRoot":"","sources":["../core/src/Animation.ts","../core/src/AnimationState.ts","../core/src/AnimationStateData.ts","../core/src/AssetManager.ts","../core/src/AtlasAttachmentLoader.ts","../core/src/BlendMode.ts","../core/src/Bone.ts","../core/src/BoneData.ts","../core/src/Constraint.ts","../core/src/Event.ts","../core/src/EventData.ts","../core/src/IkConstraint.ts","../core/src/IkConstraintData.ts","../core/src/PathConstraint.ts","../core/src/PathConstraintData.ts","../core/src/SharedAssetManager.ts","../core/src/Skeleton.ts","../core/src/SkeletonBounds.ts","../core/src/SkeletonClipping.ts","../core/src/SkeletonData.ts","../core/src/SkeletonJson.ts","../core/src/Skin.ts","../core/src/Slot.ts","../core/src/SlotData.ts","../core/src/Texture.ts","../core/src/TextureAtlas.ts","../core/src/TransformConstraint.ts","../core/src/TransformConstraintData.ts","../core/src/Triangulator.ts","../core/src/Updatable.ts","../core/src/Utils.ts","../core/src/VertexEffect.ts","../core/src/polyfills.ts","../core/src/attachments/Attachment.ts","../core/src/attachments/AttachmentLoader.ts","../core/src/attachments/AttachmentType.ts","../core/src/attachments/BoundingBoxAttachment.ts","../core/src/attachments/ClippingAttachment.ts","../core/src/attachments/MeshAttachment.ts","../core/src/attachments/PathAttachment.ts","../core/src/attachments/PointAttachment.ts","../core/src/attachments/RegionAttachment.ts","../core/src/vertexeffects/JitterEffect.ts","../core/src/vertexeffects/SwirlEffect.ts","../webgl/src/AssetManager.ts","../webgl/src/Camera.ts","../webgl/src/GLTexture.ts","../webgl/src/Input.ts","../webgl/src/LoadingScreen.ts","../webgl/src/Matrix4.ts","../webgl/src/Mesh.ts","../webgl/src/PolygonBatcher.ts","../webgl/src/Sce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BAAsB,GAAG,SAAS,CAAC,CAAC;iBAC7D;YACF,CAAC;YA5BM,4BAAI,GAAG,CAAC,CAAC;YACT,2BAAG,GAAG,CAAC,CAAC;YACR,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAA;YAqB1B,8BAAC;SAAA,AA9BD,IA8BC;QA9BY,6BAAuB,0BA8BnC,CAAA;IACF,CAAC,EAtEY,KAAK,GAAL,WAAK,KAAL,WAAK,QAsEjB;AAAD,CAAC,EAtEM,KAAK,KAAL,KAAK,QAsEX"} \ No newline at end of file diff --git a/plugins/spine/webpack.auto.config.js b/plugins/spine/webpack.auto.config.js index 252293fcc..ef4d92674 100644 --- a/plugins/spine/webpack.auto.config.js +++ b/plugins/spine/webpack.auto.config.js @@ -1,8 +1,8 @@ 'use strict'; const webpack = require('webpack'); -const CleanWebpackPlugin = require('clean-webpack-plugin'); const exec = require('child_process').exec; +const RemovePlugin = require('remove-files-webpack-plugin'); module.exports = { mode: 'development', @@ -10,14 +10,14 @@ module.exports = { context: `${__dirname}/src/`, entry: { - 'SpinePlugin': './SpinePlugin.js' + 'SpinePluginDebug': './SpinePlugin.js' }, output: { path: `${__dirname}/dist/`, filename: '[name].js', library: 'SpinePlugin', - libraryTarget: 'umd', + libraryTarget: 'window', sourceMapFilename: '[file].map', devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string @@ -45,22 +45,17 @@ module.exports = { } }, - /* - resolve: { - alias: { - 'SpineWebGL': './runtimes/spine-all.js', - 'SpineCanvas': './runtimes/spine-all.js', - 'SpineAuto': './runtimes/spine-all.js' - } - }, - */ - plugins: [ new webpack.DefinePlugin({ "typeof CANVAS_RENDERER": JSON.stringify(true), "typeof WEBGL_RENDERER": JSON.stringify(true) }), - new CleanWebpackPlugin([ 'dist' ]), + new RemovePlugin({ + before: { + root: './plugins/spine/dist/', + include: [ 'SpinePluginDebug.js', 'SpinePluginDebug.js.map' ] + } + }), { apply: (compiler) => { compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => { diff --git a/plugins/spine/webpack.auto.dist.config.js b/plugins/spine/webpack.auto.dist.config.js index ab9851722..78f60bd97 100644 --- a/plugins/spine/webpack.auto.dist.config.js +++ b/plugins/spine/webpack.auto.dist.config.js @@ -2,8 +2,8 @@ const webpack = require('webpack'); const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); -const CleanWebpackPlugin = require('clean-webpack-plugin'); const exec = require('child_process').exec; +const RemovePlugin = require('remove-files-webpack-plugin'); module.exports = { mode: 'production', @@ -11,19 +11,15 @@ module.exports = { context: `${__dirname}/src/`, entry: { - 'SpinePlugin': './SpineWebGLPlugin.js', - 'SpinePlugin.min': './SpineWebGLPlugin.js' + 'SpinePlugin': './SpinePlugin.js', + 'SpinePlugin.min': './SpinePlugin.js' }, output: { path: `${__dirname}/dist/`, filename: '[name].js', library: 'SpinePlugin', - libraryTarget: 'umd', - sourceMapFilename: '[file].map', - devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string - devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string - umdNamedDefine: true + libraryTarget: 'window' }, performance: { hints: false }, @@ -31,19 +27,11 @@ module.exports = { module: { rules: [ { - test: require.resolve('./src/runtimes/spine-canvas.js'), + test: require.resolve('./src/runtimes/spine-both.js'), use: 'imports-loader?this=>window' }, { - test: require.resolve('./src/runtimes/spine-canvas.js'), - use: 'exports-loader?spine' - }, - { - test: require.resolve('./src/runtimes/spine-webgl.js'), - use: 'imports-loader?this=>window' - }, - { - test: require.resolve('./src/runtimes/spine-webgl.js'), + test: require.resolve('./src/runtimes/spine-both.js'), use: 'exports-loader?spine' } ] @@ -51,8 +39,7 @@ module.exports = { resolve: { alias: { - 'SpineCanvas': './runtimes/spine-canvas.js', - 'SpineWebGL': './runtimes/spine-webgl.js' + 'Spine': './runtimes/spine-both.js' }, }, @@ -79,7 +66,12 @@ module.exports = { "typeof CANVAS_RENDERER": JSON.stringify(true), "typeof WEBGL_RENDERER": JSON.stringify(true) }), - new CleanWebpackPlugin([ 'dist' ]), + new RemovePlugin({ + before: { + root: './plugins/spine/dist/', + include: [ 'SpinePlugin.js', 'SpinePlugin.min.js' ] + } + }), { apply: (compiler) => { compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => { diff --git a/plugins/spine/webpack.canvas.config.js b/plugins/spine/webpack.canvas.config.js index ead98a894..ac1730046 100644 --- a/plugins/spine/webpack.canvas.config.js +++ b/plugins/spine/webpack.canvas.config.js @@ -1,8 +1,8 @@ 'use strict'; const webpack = require('webpack'); -const CleanWebpackPlugin = require('clean-webpack-plugin'); const exec = require('child_process').exec; +const RemovePlugin = require('remove-files-webpack-plugin'); module.exports = { mode: 'development', @@ -10,14 +10,14 @@ module.exports = { context: `${__dirname}/src/`, entry: { - 'SpineCanvasPlugin': './SpineCanvasPlugin.js' + 'SpineCanvasPluginDebug': './SpinePlugin.js' }, output: { path: `${__dirname}/dist/`, filename: '[name].js', - library: 'SpineCanvasPlugin', - libraryTarget: 'umd', + library: 'SpinePlugin', + libraryTarget: 'window', sourceMapFilename: '[file].map', devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string @@ -35,23 +35,14 @@ module.exports = { { test: require.resolve('./src/runtimes/spine-canvas.js'), use: 'exports-loader?spine' - }, - { - test: require.resolve('./src/runtimes/spine-webgl.js'), - use: 'imports-loader?this=>window' - }, - { - test: require.resolve('./src/runtimes/spine-webgl.js'), - use: 'exports-loader?spine' } ] }, resolve: { alias: { - 'SpineCanvas': './runtimes/spine-canvas.js', - 'SpineWebGL': './runtimes/spine-webgl.js' - }, + 'Spine': './runtimes/spine-canvas.js' + } }, plugins: [ @@ -59,7 +50,14 @@ module.exports = { "typeof CANVAS_RENDERER": JSON.stringify(true), "typeof WEBGL_RENDERER": JSON.stringify(false) }), - new CleanWebpackPlugin([ 'dist' ]), + new RemovePlugin({ + before: { + before: { + root: './plugins/spine/dist/', + include: [ 'SpineCanvasPluginDebug.js', 'SpineCanvasPluginDebug.js.map' ] + } + } + }), { apply: (compiler) => { compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => { diff --git a/plugins/spine/webpack.canvas.dist.config.js b/plugins/spine/webpack.canvas.dist.config.js index 4e275c6f8..a67725ca6 100644 --- a/plugins/spine/webpack.canvas.dist.config.js +++ b/plugins/spine/webpack.canvas.dist.config.js @@ -2,8 +2,8 @@ const webpack = require('webpack'); const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); -const CleanWebpackPlugin = require('clean-webpack-plugin'); const exec = require('child_process').exec; +const RemovePlugin = require('remove-files-webpack-plugin'); module.exports = { mode: 'production', @@ -11,19 +11,15 @@ module.exports = { context: `${__dirname}/src/`, entry: { - 'SpineCanvasPlugin': './SpineCanvasPlugin.js', - 'SpineCanvasPlugin.min': './SpineCanvasPlugin.js' + 'SpineCanvasPlugin': './SpinePlugin.js', + 'SpineCanvasPlugin.min': './SpinePlugin.js' }, output: { path: `${__dirname}/dist/`, filename: '[name].js', - library: 'SpineCanvasPlugin', - libraryTarget: 'umd', - sourceMapFilename: '[file].map', - devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string - devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string - umdNamedDefine: true + library: 'SpinePlugin', + libraryTarget: 'window' }, performance: { hints: false }, @@ -37,23 +33,14 @@ module.exports = { { test: require.resolve('./src/runtimes/spine-canvas.js'), use: 'exports-loader?spine' - }, - { - test: require.resolve('./src/runtimes/spine-webgl.js'), - use: 'imports-loader?this=>window' - }, - { - test: require.resolve('./src/runtimes/spine-webgl.js'), - use: 'exports-loader?spine' } ] }, resolve: { alias: { - 'SpineCanvas': './runtimes/spine-canvas.js', - 'SpineWebGL': './runtimes/spine-webgl.js' - }, + 'Spine': './runtimes/spine-canvas.js' + } }, optimization: { @@ -79,7 +66,14 @@ module.exports = { "typeof CANVAS_RENDERER": JSON.stringify(true), "typeof WEBGL_RENDERER": JSON.stringify(false) }), - new CleanWebpackPlugin([ 'dist' ]), + new RemovePlugin({ + before: { + before: { + root: './plugins/spine/dist/', + include: [ 'SpineCanvasPlugin.js', 'SpineCanvasPlugin.min.js' ] + } + } + }), { apply: (compiler) => { compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => { diff --git a/plugins/spine/webpack.webgl.config.js b/plugins/spine/webpack.webgl.config.js index 22d66647e..ea483c81b 100644 --- a/plugins/spine/webpack.webgl.config.js +++ b/plugins/spine/webpack.webgl.config.js @@ -1,8 +1,8 @@ 'use strict'; const webpack = require('webpack'); -const CleanWebpackPlugin = require('clean-webpack-plugin'); const exec = require('child_process').exec; +const RemovePlugin = require('remove-files-webpack-plugin'); module.exports = { mode: 'development', @@ -10,14 +10,14 @@ module.exports = { context: `${__dirname}/src/`, entry: { - 'SpineWebGLPlugin': './SpineWebGLPlugin.js' + 'SpineWebGLPluginDebug': './SpinePlugin.js' }, output: { path: `${__dirname}/dist/`, filename: '[name].js', - library: 'SpineWebGLPlugin', - libraryTarget: 'umd', + library: 'SpinePlugin', + libraryTarget: 'window', sourceMapFilename: '[file].map', devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string @@ -28,14 +28,6 @@ module.exports = { module: { rules: [ - { - test: require.resolve('./src/runtimes/spine-canvas.js'), - use: 'imports-loader?this=>window' - }, - { - test: require.resolve('./src/runtimes/spine-canvas.js'), - use: 'exports-loader?spine' - }, { test: require.resolve('./src/runtimes/spine-webgl.js'), use: 'imports-loader?this=>window' @@ -49,8 +41,7 @@ module.exports = { resolve: { alias: { - 'SpineCanvas': './runtimes/spine-canvas.js', - 'SpineWebGL': './runtimes/spine-webgl.js' + 'Spine': './runtimes/spine-webgl.js' }, }, @@ -59,7 +50,14 @@ module.exports = { "typeof CANVAS_RENDERER": JSON.stringify(false), "typeof WEBGL_RENDERER": JSON.stringify(true) }), - new CleanWebpackPlugin([ 'dist' ]), + new RemovePlugin({ + before: { + before: { + root: './plugins/spine/dist/', + include: [ 'SpineWebGLPluginDebug.js', 'SpineWebGLPluginDebug.js.map' ] + } + } + }), { apply: (compiler) => { compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => { diff --git a/plugins/spine/webpack.webgl.dist.config.js b/plugins/spine/webpack.webgl.dist.config.js index 35cf199e6..7ee50499f 100644 --- a/plugins/spine/webpack.webgl.dist.config.js +++ b/plugins/spine/webpack.webgl.dist.config.js @@ -2,8 +2,8 @@ const webpack = require('webpack'); const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); -const CleanWebpackPlugin = require('clean-webpack-plugin'); const exec = require('child_process').exec; +const RemovePlugin = require('remove-files-webpack-plugin'); module.exports = { mode: 'production', @@ -11,33 +11,21 @@ module.exports = { context: `${__dirname}/src/`, entry: { - 'SpineWebGLPlugin': './SpineWebGLPlugin.js', - 'SpineWebGLPlugin.min': './SpineWebGLPlugin.js' + 'SpineWebGLPlugin': './SpinePlugin.js', + 'SpineWebGLPlugin.min': './SpinePlugin.js' }, output: { path: `${__dirname}/dist/`, filename: '[name].js', - library: 'SpineWebGLPlugin', - libraryTarget: 'umd', - sourceMapFilename: '[file].map', - devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string - devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string - umdNamedDefine: true + library: 'SpinePlugin', + libraryTarget: 'window' }, performance: { hints: false }, module: { rules: [ - { - test: require.resolve('./src/runtimes/spine-canvas.js'), - use: 'imports-loader?this=>window' - }, - { - test: require.resolve('./src/runtimes/spine-canvas.js'), - use: 'exports-loader?spine' - }, { test: require.resolve('./src/runtimes/spine-webgl.js'), use: 'imports-loader?this=>window' @@ -51,9 +39,8 @@ module.exports = { resolve: { alias: { - 'SpineCanvas': './runtimes/spine-canvas.js', - 'SpineWebGL': './runtimes/spine-webgl.js' - }, + 'Spine': './runtimes/spine-webgl.js' + } }, optimization: { @@ -79,7 +66,14 @@ module.exports = { "typeof CANVAS_RENDERER": JSON.stringify(false), "typeof WEBGL_RENDERER": JSON.stringify(true) }), - new CleanWebpackPlugin([ 'dist' ]), + new RemovePlugin({ + before: { + before: { + root: './plugins/spine/dist/', + include: [ 'SpineWebGLPlugin.js', 'SpineWebGLPlugin.min.js' ] + } + } + }), { apply: (compiler) => { compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => { diff --git a/src/cameras/2d/Camera.js b/src/cameras/2d/Camera.js index 5163d77d8..ff1d423cd 100644 --- a/src/cameras/2d/Camera.js +++ b/src/cameras/2d/Camera.js @@ -620,7 +620,7 @@ var Camera = new Class({ * @since 3.0.0 * * @param {integer} [duration=100] - The duration of the effect in milliseconds. - * @param {number} [intensity=0.05] - The intensity of the shake. + * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. diff --git a/src/cameras/2d/effects/Shake.js b/src/cameras/2d/effects/Shake.js index 37a1e2b60..5872048a0 100644 --- a/src/cameras/2d/effects/Shake.js +++ b/src/cameras/2d/effects/Shake.js @@ -149,7 +149,7 @@ var Shake = new Class({ * @since 3.5.0 * * @param {integer} [duration=100] - The duration of the effect in milliseconds. - * @param {number} [intensity=0.05] - The intensity of the shake. + * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraShakeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. diff --git a/src/const.js b/src/const.js index c64b4e612..de17b7412 100644 --- a/src/const.js +++ b/src/const.js @@ -20,7 +20,7 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.19.0-beta1', + VERSION: '3.20.0-beta1', BlendModes: require('./renderer/BlendModes'), diff --git a/src/core/Config.js b/src/core/Config.js index 35a379884..e39780a3e 100644 --- a/src/core/Config.js +++ b/src/core/Config.js @@ -337,6 +337,11 @@ var Config = new Class({ */ this.antialias = GetValue(renderConfig, 'antialias', true); + /** + * @const {boolean} Phaser.Core.Config#antialiasGL - Sets the `antialias` property when the WebGL context is created. Setting this value does not impact any subsequent textures that are created, or the canvas style attributes. + */ + this.antialiasGL = GetValue(renderConfig, 'antialiasGL', true); + /** * @const {boolean} Phaser.Core.Config#desynchronized - When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details. */ diff --git a/src/core/Game.js b/src/core/Game.js index 496722c3b..4463b5114 100644 --- a/src/core/Game.js +++ b/src/core/Game.js @@ -248,7 +248,7 @@ var Game = new Class({ * You can disable the inclusion of the Sound Manager in your build by toggling the webpack `FEATURE_SOUND` flag. * * @name Phaser.Game#sound - * @type {Phaser.Sound.BaseSoundManager} + * @type {(Phaser.Sound.NoAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager)} * @since 3.0.0 */ this.sound = null; diff --git a/src/core/typedefs/RenderConfig.js b/src/core/typedefs/RenderConfig.js index c0d12fc4f..df2fc1bfc 100644 --- a/src/core/typedefs/RenderConfig.js +++ b/src/core/typedefs/RenderConfig.js @@ -3,6 +3,7 @@ * @since 3.0.0 * * @property {boolean} [antialias=true] - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. + * @property {boolean} [antialiasGL=true] - Sets the `antialias` property when the WebGL context is created. Setting this value does not impact any subsequent textures that are created, or the canvas style attributes. * @property {boolean} [desynchronized=false] - When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details. * @property {boolean} [pixelArt=false] - Sets `antialias` and `roundPixels` to true. This is the best setting for pixel-art games. * @property {boolean} [roundPixels=false] - Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. diff --git a/src/dom/CreateDOMContainer.js b/src/dom/CreateDOMContainer.js index bd6435b60..9d52b1a7c 100644 --- a/src/dom/CreateDOMContainer.js +++ b/src/dom/CreateDOMContainer.js @@ -18,7 +18,7 @@ var CreateDOMContainer = function (game) // DOM Element Container var div = document.createElement('div'); - div.style = [ + div.style.cssText = [ 'display: block;', 'width: ' + game.scale.width + 'px;', 'height: ' + game.scale.height + 'px;', diff --git a/src/gameobjects/components/Size.js b/src/gameobjects/components/Size.js index 31e1785aa..dbc1a18d1 100644 --- a/src/gameobjects/components/Size.js +++ b/src/gameobjects/components/Size.js @@ -65,7 +65,7 @@ var Size = { get: function () { - return this.scaleX * this.frame.realWidth; + return Math.abs(this.scaleX * this.frame.realWidth); }, set: function (value) @@ -90,7 +90,7 @@ var Size = { get: function () { - return this.scaleY * this.frame.realHeight; + return Math.abs(this.scaleY * this.frame.realHeight); }, set: function (value) diff --git a/src/gameobjects/components/Tint.js b/src/gameobjects/components/Tint.js index 8d5b2af73..339d40b7a 100644 --- a/src/gameobjects/components/Tint.js +++ b/src/gameobjects/components/Tint.js @@ -296,6 +296,7 @@ var Tint = { /** * 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 {integer} diff --git a/src/gameobjects/components/Transform.js b/src/gameobjects/components/Transform.js index f46f89041..6a26489fa 100644 --- a/src/gameobjects/components/Transform.js +++ b/src/gameobjects/components/Transform.js @@ -195,8 +195,9 @@ var Transform = { /** * The angle of this Game Object as expressed in degrees. - * - * Where 0 is to the right, 90 is down, 180 is left. + * + * 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. * @@ -221,6 +222,9 @@ var Transform = { /** * The angle of this Game Object in radians. + * + * 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 degrees, see the `angle` property instead. * diff --git a/src/gameobjects/components/TransformMatrix.js b/src/gameobjects/components/TransformMatrix.js index ff3ff85e0..d58fbdec1 100644 --- a/src/gameobjects/components/TransformMatrix.js +++ b/src/gameobjects/components/TransformMatrix.js @@ -5,6 +5,7 @@ */ var Class = require('../../utils/Class'); +var MATH_CONST = require('../../math/const'); var Vector2 = require('../../math/Vector2'); /** @@ -25,8 +26,8 @@ var Vector2 = require('../../math/Vector2'); * @since 3.0.0 * * @param {number} [a=1] - The Scale X value. - * @param {number} [b=0] - The Shear Y value. - * @param {number} [c=0] - The Shear 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. @@ -91,7 +92,7 @@ var TransformMatrix = new Class({ }, /** - * The Shear Y value. + * The Skew Y value. * * @name Phaser.GameObjects.Components.TransformMatrix#b * @type {number} @@ -112,7 +113,7 @@ var TransformMatrix = new Class({ }, /** - * The Shear X value. + * The Skew X value. * * @name Phaser.GameObjects.Components.TransformMatrix#c * @type {number} @@ -238,7 +239,7 @@ var TransformMatrix = new Class({ }, /** - * The rotation of the Matrix. + * The rotation of the Matrix. Value is in radians. * * @name Phaser.GameObjects.Components.TransformMatrix#rotation * @type {number} @@ -249,13 +250,53 @@ var TransformMatrix = new Class({ get: function () { - return Math.acos(this.a / this.scaleX) * (Math.atan(-this.c / this.a) < 0 ? -1 : 1); + return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1); } }, /** - * The horizontal scale of the Matrix. + * 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} @@ -266,13 +307,13 @@ var TransformMatrix = new Class({ get: function () { - return Math.sqrt((this.a * this.a) + (this.c * this.c)); + return Math.sqrt((this.a * this.a) + (this.b * this.b)); } }, /** - * The vertical scale of the Matrix. + * The decomposed vertical scale of the Matrix. This value is always positive. * * @name Phaser.GameObjects.Components.TransformMatrix#scaleY * @type {number} @@ -283,7 +324,7 @@ var TransformMatrix = new Class({ get: function () { - return Math.sqrt((this.b * this.b) + (this.d * this.d)); + return Math.sqrt((this.c * this.c) + (this.d * this.d)); } }, diff --git a/src/gameobjects/container/ContainerCanvasRenderer.js b/src/gameobjects/container/ContainerCanvasRenderer.js index 553a8ca97..e2d813d31 100644 --- a/src/gameobjects/container/ContainerCanvasRenderer.js +++ b/src/gameobjects/container/ContainerCanvasRenderer.js @@ -65,7 +65,7 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen continue; } - var childAlpha = child._alpha; + var childAlpha = child.alpha; var childBlendMode = child._blendMode; var childScrollFactorX = child.scrollFactorX; var childScrollFactorY = child.scrollFactorY; diff --git a/src/gameobjects/container/ContainerWebGLRenderer.js b/src/gameobjects/container/ContainerWebGLRenderer.js index b27ab678a..ed451b816 100644 --- a/src/gameobjects/container/ContainerWebGLRenderer.js +++ b/src/gameobjects/container/ContainerWebGLRenderer.js @@ -65,7 +65,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent continue; } - var childAlpha = child._alpha; + var childAlpha = child.alpha; var childScrollFactorX = child.scrollFactorX; var childScrollFactorY = child.scrollFactorY; diff --git a/src/gameobjects/rendertexture/RenderTexture.js b/src/gameobjects/rendertexture/RenderTexture.js index a9d399015..81e5fc911 100644 --- a/src/gameobjects/rendertexture/RenderTexture.js +++ b/src/gameobjects/rendertexture/RenderTexture.js @@ -349,7 +349,10 @@ var RenderTexture = new Class({ this.canvas.width = width; this.canvas.height = height; - + + this.texture.width = width; + this.texture.height = height; + if (this.gl) { var gl = this.gl; diff --git a/src/gameobjects/shader/Shader.js b/src/gameobjects/shader/Shader.js index 70e8c6834..163801fe5 100644 --- a/src/gameobjects/shader/Shader.js +++ b/src/gameobjects/shader/Shader.js @@ -345,16 +345,6 @@ var Shader = new Class({ */ this.texture = null; - /** - * Internal saved texture key. - * - * @name Phaser.GameObjects.Shader#_savedKey - * @type {boolean} - * @private - * @since 3.19.0 - */ - this._savedKey = ''; - this.setPosition(x, y); this.setSize(width, height); this.setOrigin(0.5, 0.5); @@ -448,12 +438,24 @@ var Shader = new Class({ if (key) { - this._savedKey = key; - this.texture = this.scene.sys.textures.addGLTexture(key, this.glTexture, width, height); } } + // And now render at least once, so our texture isn't blank on the first update + + if (this.shader) + { + var pipeline = renderer.currentPipeline; + + renderer.clearPipeline(); + + this.load(); + this.flush(); + + renderer.rebindPipeline(pipeline); + } + return this; }, @@ -792,7 +794,7 @@ var Shader = new Class({ * * @param {string} key - The key of the uniform to return the value for. * - * @return {this} This Shader instance. + * @return {any} A reference to the uniform object. This is not a copy, so modifying it will update the original object also. */ getUniform: function (key) { diff --git a/src/geom/circle/Circle.js b/src/geom/circle/Circle.js index 8f4916920..b357a679b 100644 --- a/src/geom/circle/Circle.js +++ b/src/geom/circle/Circle.js @@ -8,6 +8,7 @@ var Class = require('../../utils/Class'); var Contains = require('./Contains'); var GetPoint = require('./GetPoint'); var GetPoints = require('./GetPoints'); +var GEOM_CONST = require('../const'); var Random = require('./Random'); /** @@ -37,6 +38,17 @@ var Circle = new Class({ if (y === undefined) { y = 0; } if (radius === undefined) { radius = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.CIRCLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Circle#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.CIRCLE; + /** * The x position of the center of the circle. * diff --git a/src/geom/const.js b/src/geom/const.js new file mode 100644 index 000000000..94fb6172f --- /dev/null +++ b/src/geom/const.js @@ -0,0 +1,74 @@ +/** + * @author Richard Davey + * @copyright 2019 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 {integer} + * @since 3.19.0 + */ + CIRCLE: 0, + + /** + * An Ellipse Geometry object type. + * + * @name Phaser.Geom.ELLIPSE + * @type {integer} + * @since 3.19.0 + */ + ELLIPSE: 1, + + /** + * A Line Geometry object type. + * + * @name Phaser.Geom.LINE + * @type {integer} + * @since 3.19.0 + */ + LINE: 2, + + /** + * A Point Geometry object type. + * + * @name Phaser.Geom.POINT + * @type {integer} + * @since 3.19.0 + */ + POINT: 3, + + /** + * A Polygon Geometry object type. + * + * @name Phaser.Geom.POLYGON + * @type {integer} + * @since 3.19.0 + */ + POLYGON: 4, + + /** + * A Rectangle Geometry object type. + * + * @name Phaser.Geom.RECTANGLE + * @type {integer} + * @since 3.19.0 + */ + RECTANGLE: 5, + + /** + * A Triangle Geometry object type. + * + * @name Phaser.Geom.TRIANGLE + * @type {integer} + * @since 3.19.0 + */ + TRIANGLE: 6 + +}; + +module.exports = GEOM_CONST; diff --git a/src/geom/ellipse/Ellipse.js b/src/geom/ellipse/Ellipse.js index 1c6a022a1..0bbd35184 100644 --- a/src/geom/ellipse/Ellipse.js +++ b/src/geom/ellipse/Ellipse.js @@ -8,6 +8,7 @@ var Class = require('../../utils/Class'); var Contains = require('./Contains'); var GetPoint = require('./GetPoint'); var GetPoints = require('./GetPoints'); +var GEOM_CONST = require('../const'); var Random = require('./Random'); /** @@ -39,6 +40,17 @@ var Ellipse = new Class({ if (width === undefined) { width = 0; } if (height === undefined) { height = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.ELLIPSE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Ellipse#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.ELLIPSE; + /** * The x position of the center of the ellipse. * diff --git a/src/geom/index.js b/src/geom/index.js index 56bf71d79..96b3d4dce 100644 --- a/src/geom/index.js +++ b/src/geom/index.js @@ -4,11 +4,14 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var CONST = require('./const'); +var Extend = require('../utils/object/Extend'); + /** * @namespace Phaser.Geom */ -module.exports = { +var Geom = { Circle: require('./circle'), Ellipse: require('./ellipse'), @@ -20,3 +23,8 @@ module.exports = { Triangle: require('./triangle') }; + +// Merge in the consts +Geom = Extend(false, Geom, CONST); + +module.exports = Geom; diff --git a/src/geom/line/Line.js b/src/geom/line/Line.js index 9d7e2c37b..09b3f87b1 100644 --- a/src/geom/line/Line.js +++ b/src/geom/line/Line.js @@ -7,6 +7,7 @@ var Class = require('../../utils/Class'); var GetPoint = require('./GetPoint'); var GetPoints = require('./GetPoints'); +var GEOM_CONST = require('../const'); var Random = require('./Random'); var Vector2 = require('../../math/Vector2'); @@ -35,6 +36,17 @@ var Line = new Class({ if (x2 === undefined) { x2 = 0; } if (y2 === undefined) { y2 = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.LINE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Line#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.LINE; + /** * The x coordinate of the lines starting point. * diff --git a/src/geom/point/Point.js b/src/geom/point/Point.js index f9c146373..184e57a02 100644 --- a/src/geom/point/Point.js +++ b/src/geom/point/Point.js @@ -5,6 +5,7 @@ */ var Class = require('../../utils/Class'); +var GEOM_CONST = require('../const'); /** * @classdesc @@ -27,6 +28,17 @@ var Point = new Class({ 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 {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.POINT; + /** * The x coordinate of this Point. * diff --git a/src/geom/polygon/Polygon.js b/src/geom/polygon/Polygon.js index b48ca1cd2..2d04e1d9f 100644 --- a/src/geom/polygon/Polygon.js +++ b/src/geom/polygon/Polygon.js @@ -7,6 +7,7 @@ var Class = require('../../utils/Class'); var Contains = require('./Contains'); var GetPoints = require('./GetPoints'); +var GEOM_CONST = require('../const'); /** * @classdesc @@ -37,6 +38,17 @@ var Polygon = new Class({ function Polygon (points) { + /** + * The geometry constant type of this object: `GEOM_CONST.POLYGON`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Polygon#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.POLYGON; + /** * The area of this Polygon. * diff --git a/src/geom/rectangle/Rectangle.js b/src/geom/rectangle/Rectangle.js index 6aab90f17..d061e0ae9 100644 --- a/src/geom/rectangle/Rectangle.js +++ b/src/geom/rectangle/Rectangle.js @@ -8,6 +8,7 @@ var Class = require('../../utils/Class'); var Contains = require('./Contains'); var GetPoint = require('./GetPoint'); var GetPoints = require('./GetPoints'); +var GEOM_CONST = require('../const'); var Line = require('../line/Line'); var Random = require('./Random'); @@ -36,6 +37,17 @@ var Rectangle = new Class({ 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 {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.RECTANGLE; + /** * The X coordinate of the top left corner of the Rectangle. * diff --git a/src/geom/triangle/Triangle.js b/src/geom/triangle/Triangle.js index 9278b9e16..aab068f22 100644 --- a/src/geom/triangle/Triangle.js +++ b/src/geom/triangle/Triangle.js @@ -8,6 +8,7 @@ var Class = require('../../utils/Class'); var Contains = require('./Contains'); var GetPoint = require('./GetPoint'); var GetPoints = require('./GetPoints'); +var GEOM_CONST = require('../const'); var Line = require('../line/Line'); var Random = require('./Random'); @@ -42,6 +43,17 @@ var Triangle = new Class({ if (x3 === undefined) { x3 = 0; } if (y3 === undefined) { y3 = 0; } + /** + * The geometry constant type of this object: `GEOM_CONST.TRIANGLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Triangle#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.TRIANGLE; + /** * `x` coordinate of the first point. * diff --git a/src/input/CreateInteractiveObject.js b/src/input/CreateInteractiveObject.js index 04e4253f0..75af856fd 100644 --- a/src/input/CreateInteractiveObject.js +++ b/src/input/CreateInteractiveObject.js @@ -37,6 +37,7 @@ var CreateInteractiveObject = function (gameObject, hitArea, hitAreaCallback) hitArea: hitArea, hitAreaCallback: hitAreaCallback, + hitAreaDebug: null, // Has the dev specified their own shape, or is this bound to the texture size? customHitArea: false, diff --git a/src/input/InputManager.js b/src/input/InputManager.js index ac934ca40..b737a546b 100644 --- a/src/input/InputManager.js +++ b/src/input/InputManager.js @@ -458,7 +458,7 @@ var InputManager = new Class({ */ resetCursor: function (interactiveObject) { - if (interactiveObject.cursor) + if (interactiveObject.cursor && this.canvas) { this.canvas.style.cursor = this.defaultCursor; } diff --git a/src/input/InputPlugin.js b/src/input/InputPlugin.js index 99fffb99f..4e0fe7a20 100644 --- a/src/input/InputPlugin.js +++ b/src/input/InputPlugin.js @@ -16,6 +16,7 @@ var EllipseContains = require('../geom/ellipse/Contains'); var Events = require('./events'); var EventEmitter = require('eventemitter3'); var GetFastValue = require('../utils/object/GetFastValue'); +var GEOM_CONST = require('../geom/const'); var InputPluginCache = require('./InputPluginCache'); var IsPlainObject = require('../utils/object/IsPlainObject'); var PluginCache = require('../plugins/PluginCache'); @@ -1327,6 +1328,9 @@ var InputPlugin = new Class({ var dxRotated = dx * Math.cos(rotation) + dy * Math.sin(rotation); var dyRotated = dy * Math.cos(rotation) - dx * Math.sin(rotation); + dxRotated *= (1 / gameObject.parentContainer.scaleX); + dyRotated *= (1 / gameObject.parentContainer.scaleY); + dragX = dxRotated + input.dragStartX; dragY = dyRotated + input.dragStartY; } @@ -2340,6 +2344,145 @@ var InputPlugin = new Class({ return this.setHitArea(gameObjects, shape, callback); }, + /** + * Creates an Input Debug Shape for the given Game Object. + * + * The Game Object must have _already_ been enabled for input prior to calling this method. + * + * This is intended to assist you during development and debugging. + * + * Debug Shapes can only be created for Game Objects that are using standard Phaser Geometry for input, + * including: Circle, Ellipse, Line, Polygon, Rectangle and Triangle. + * + * Game Objects that are using their automatic hit areas are using Rectangles by default, so will also work. + * + * The Debug Shape is created and added to the display list and is then kept in sync with the Game Object + * it is connected with. Should you need to modify it yourself, such as to hide it, you can access it via + * the Game Object property: `GameObject.input.hitAreaDebug`. + * + * Calling this method on a Game Object that already has a Debug Shape will first destroy the old shape, + * before creating a new one. If you wish to remove the Debug Shape entirely, you should call the + * method `InputPlugin.removeDebug`. + * + * Note that the debug shape will only show the outline of the input area. If the input test is using a + * pixel perfect check, for example, then this is not displayed. If you are using a custom shape, that + * doesn't extend one of the base Phaser Geometry objects, as your hit area, then this method will not + * work. + * + * @method Phaser.Input.InputPlugin#enableDebug + * @since 3.19.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to create the input debug shape for. + * @param {number} [color=0x00ff00] - The outline color of the debug shape. + * + * @return {Phaser.Input.InputPlugin} This Input Plugin. + */ + enableDebug: function (gameObject, color) + { + if (color === undefined) { color = 0x00ff00; } + + var input = gameObject.input; + + if (!input || !input.hitArea) + { + return this; + } + + var shape = input.hitArea; + var shapeType = shape.type; + var debug = input.hitAreaDebug; + var factory = this.systems.add; + var updateList = this.systems.updateList; + + if (debug) + { + updateList.remove(debug); + + debug.destroy(); + + debug = null; + } + + switch (shapeType) + { + case GEOM_CONST.CIRCLE: + debug = factory.arc(0, 0, shape.radius); + break; + + case GEOM_CONST.ELLIPSE: + debug = factory.ellipse(0, 0, shape.width, shape.height); + break; + + case GEOM_CONST.LINE: + debug = factory.line(0, 0, shape.x1, shape.y1, shape.x2, shape.y2); + break; + + case GEOM_CONST.POLYGON: + debug = factory.polygon(0, 0, shape.points); + break; + + case GEOM_CONST.RECTANGLE: + debug = factory.rectangle(0, 0, shape.width, shape.height); + break; + + case GEOM_CONST.TRIANGLE: + debug = factory.triangle(0, 0, shape.x1, shape.y1, shape.x2, shape.y2, shape.x3, shape.y3); + break; + } + + if (debug) + { + debug.isFilled = false; + + debug.preUpdate = function () + { + debug.setStrokeStyle(1 / gameObject.scale, color); + + debug.setDisplayOrigin(gameObject.displayOriginX, gameObject.displayOriginY); + debug.setRotation(gameObject.rotation); + debug.setScale(gameObject.scaleX, gameObject.scaleY); + debug.setPosition(gameObject.x, gameObject.y); + debug.setScrollFactor(gameObject.scrollFactorX, gameObject.scrollFactorY); + }; + + updateList.add(debug); + + input.hitAreaDebug = debug; + } + + return this; + }, + + /** + * Removes an Input Debug Shape from the given Game Object. + * + * The shape is destroyed immediately and the `hitAreaDebug` property is set to `null`. + * + * @method Phaser.Input.InputPlugin#removeDebug + * @since 3.19.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to remove the input debug shape from. + * + * @return {Phaser.Input.InputPlugin} This Input Plugin. + */ + removeDebug: function (gameObject) + { + var input = gameObject.input; + + if (input && input.hitAreaDebug) + { + var debug = input.hitAreaDebug; + + this.systems.updateList.remove(debug); + + debug.destroy(); + + input.hitAreaDebug = null; + } + + return this; + }, + /** * Sets the Pointers to always poll. * diff --git a/src/input/Pointer.js b/src/input/Pointer.js index 65ea6c70f..7cce4d36a 100644 --- a/src/input/Pointer.js +++ b/src/input/Pointer.js @@ -259,6 +259,9 @@ var Pointer = new Class({ /** * The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. * * @name Phaser.Input.Pointer#worldX * @type {number} @@ -269,6 +272,9 @@ var Pointer = new Class({ /** * The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. * * @name Phaser.Input.Pointer#worldY * @type {number} @@ -486,6 +492,40 @@ var Pointer = new Class({ this.deltaZ = 0; }, + /** + * Takes a Camera and updates this Pointer's `worldX` and `worldY` values so they are + * the result of a translation through the given Camera. + * + * Note that the values will be automatically replaced the moment the Pointer is + * updated by an input event, such as a mouse move, so should be used immediately. + * + * @method Phaser.Input.Pointer#updateWorldPoint + * @since 3.19.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera which is being tested against. + * + * @return {this} This Pointer object. + */ + updateWorldPoint: function (camera) + { + var x = this.x; + var y = this.y; + + if (camera.resolution !== 1) + { + x += camera._x; + y += camera._y; + } + + // Stores the world point inside of tempPoint + var temp = camera.getWorldPoint(x, y); + + this.worldX = temp.x; + this.worldY = temp.y; + + return this; + }, + /** * Takes a Camera and returns a Vector2 containing the translated position of this Pointer * within that Camera. This can be used to convert this Pointers position into camera space. diff --git a/src/input/typedefs/InteractiveObject.js b/src/input/typedefs/InteractiveObject.js index 50e88d464..c98032de3 100644 --- a/src/input/typedefs/InteractiveObject.js +++ b/src/input/typedefs/InteractiveObject.js @@ -11,6 +11,7 @@ * @property {Phaser.Cameras.Scene2D.Camera} camera - The most recent Camera to be tested against this Interactive Object. * @property {any} hitArea - The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle. * @property {Phaser.Types.Input.HitAreaCallback} hitAreaCallback - The 'contains' check callback that the hit area shape will use for all hit tests. + * @property {Phaser.GameObjects.Shape} hitAreaDebug - If this Interactive Object has been enabled for debug, via `InputPlugin.enableDebug` then this property holds its debug shape. * @property {boolean} customHitArea - Was the hitArea for this Interactive Object created based on texture size (false), or a custom shape? (true) * @property {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @property {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. diff --git a/src/math/angle/CounterClockwise.js b/src/math/angle/CounterClockwise.js index 7be7583ec..ce9f6bb2a 100644 --- a/src/math/angle/CounterClockwise.js +++ b/src/math/angle/CounterClockwise.js @@ -28,6 +28,11 @@ var CONST = require('../const'); */ var CounterClockwise = function (angle) { + if (angle > Math.PI) + { + angle -= CONST.PI2; + } + return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); }; diff --git a/src/physics/arcade/Body.js b/src/physics/arcade/Body.js index d0ff9ad00..e33e2221b 100644 --- a/src/physics/arcade/Body.js +++ b/src/physics/arcade/Body.js @@ -1060,19 +1060,21 @@ var Body = new Class({ var bx = (this.worldBounce) ? -this.worldBounce.x : -this.bounce.x; var by = (this.worldBounce) ? -this.worldBounce.y : -this.bounce.y; + var wasSet = false; + if (pos.x < bounds.x && check.left) { pos.x = bounds.x; this.velocity.x *= bx; this.blocked.left = true; - this.blocked.none = false; + wasSet = true; } else if (this.right > bounds.right && check.right) { pos.x = bounds.right - this.width; this.velocity.x *= bx; this.blocked.right = true; - this.blocked.none = false; + wasSet = true; } if (pos.y < bounds.y && check.up) @@ -1080,17 +1082,22 @@ var Body = new Class({ pos.y = bounds.y; this.velocity.y *= by; this.blocked.up = true; - this.blocked.none = false; + wasSet = true; } else if (this.bottom > bounds.bottom && check.down) { pos.y = bounds.bottom - this.height; this.velocity.y *= by; this.blocked.down = true; + wasSet = true; + } + + if (wasSet) + { this.blocked.none = false; } - return !this.blocked.none; + return wasSet; }, /** diff --git a/src/physics/matter-js/CustomMain.js b/src/physics/matter-js/CustomMain.js index 3d613e51c..f9b46b8f4 100644 --- a/src/physics/matter-js/CustomMain.js +++ b/src/physics/matter-js/CustomMain.js @@ -4,6 +4,10 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +/** + * @namespace Phaser.Physics.Matter.Matter + */ + var Matter = require('./lib/core/Matter'); Matter.Body = require('./lib/body/Body'); diff --git a/src/physics/matter-js/index.js b/src/physics/matter-js/index.js index eb9ac849c..4532657db 100644 --- a/src/physics/matter-js/index.js +++ b/src/physics/matter-js/index.js @@ -17,6 +17,7 @@ module.exports = { PolyDecomp: require('./poly-decomp'), Sprite: require('./MatterSprite'), TileBody: require('./MatterTileBody'), + PhysicsEditorParser: require('./PhysicsEditorParser'), World: require('./World') }; diff --git a/src/renderer/webgl/WebGLRenderer.js b/src/renderer/webgl/WebGLRenderer.js index 933ba7a6b..b21cc58e7 100644 --- a/src/renderer/webgl/WebGLRenderer.js +++ b/src/renderer/webgl/WebGLRenderer.js @@ -59,7 +59,7 @@ var WebGLRenderer = new Class({ alpha: gameConfig.transparent, desynchronized: gameConfig.desynchronized, depth: false, - antialias: gameConfig.antialias, + antialias: gameConfig.antialiasGL, premultipliedAlpha: gameConfig.premultipliedAlpha, stencil: true, failIfMajorPerformanceCaveat: gameConfig.failIfMajorPerformanceCaveat, diff --git a/src/scale/ScaleManager.js b/src/scale/ScaleManager.js index d85483d49..f016dfdaf 100644 --- a/src/scale/ScaleManager.js +++ b/src/scale/ScaleManager.js @@ -260,6 +260,16 @@ var ScaleManager = new Class({ */ this.zoom = 1; + /** + * Internal flag set when the game zoom factor is modified. + * + * @name Phaser.Scale.ScaleManager#_resetZoom + * @type {boolean} + * @readonly + * @since 3.19.0 + */ + this._resetZoom = false; + /** * The scale factor between the baseSize and the canvasBounds. * @@ -554,6 +564,11 @@ var ScaleManager = new Class({ this.zoom = zoom; + if (zoom !== 1) + { + this._resetZoom = true; + } + // The modified game size, which is the w/h * resolution this.baseSize.setSize(width * resolution, height * resolution); @@ -868,6 +883,7 @@ var ScaleManager = new Class({ setZoom: function (value) { this.zoom = value; + this._resetZoom = true; return this.refresh(); }, @@ -884,6 +900,7 @@ var ScaleManager = new Class({ setMaxZoom: function () { this.zoom = this.getMaxZoom(); + this._resetZoom = true; return this.refresh(); }, @@ -996,10 +1013,12 @@ var ScaleManager = new Class({ styleHeight = Math.floor(styleHeight); } - if (zoom > 1) + if (this._resetZoom) { style.width = styleWidth + 'px'; style.height = styleHeight + 'px'; + + this._resetZoom = false; } } else if (this.scaleMode === CONST.SCALE_MODE.RESIZE) diff --git a/src/scene/Systems.js b/src/scene/Systems.js index 9181742b0..0781ba3ad 100644 --- a/src/scene/Systems.js +++ b/src/scene/Systems.js @@ -175,7 +175,7 @@ var Systems = new Class({ * In the default set-up you can access this from within a Scene via the `this.sound` property. * * @name Phaser.Scenes.Systems#sound - * @type {Phaser.Sound.BaseSoundManager} + * @type {(Phaser.Sound.NoAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager)} * @since 3.0.0 */ this.sound; diff --git a/src/structs/Size.js b/src/structs/Size.js index f67b351e4..206c71e22 100644 --- a/src/structs/Size.js +++ b/src/structs/Size.js @@ -482,7 +482,6 @@ var Size = new Class({ if ((fit && this.aspectRatio > newRatio) || (!fit && this.aspectRatio < newRatio)) { // We need to change the height to fit the width - // height = width / this.aspectRatio; width = SnapFloor(width, snap.x); @@ -499,7 +498,6 @@ var Size = new Class({ else if ((fit && this.aspectRatio < newRatio) || (!fit && this.aspectRatio > newRatio)) { // We need to change the width to fit the height - // width = height * this.aspectRatio; height = SnapFloor(height, snap.y); diff --git a/src/textures/CanvasTexture.js b/src/textures/CanvasTexture.js index 4a6049fc7..997420c99 100644 --- a/src/textures/CanvasTexture.js +++ b/src/textures/CanvasTexture.js @@ -7,6 +7,7 @@ var Class = require('../utils/Class'); var Clamp = require('../math/Clamp'); var Color = require('../display/color/Color'); +var CONST = require('../const'); var IsSizePowerOfTwo = require('../math/pow2/IsSizePowerOfTwo'); var Texture = require('./Texture'); @@ -201,6 +202,11 @@ var CanvasTexture = new Class({ this.pixels = this.imageData.data; } + if (this.manager.game.config.renderType === CONST.WEBGL) + { + this.refresh(); + } + return this; }, @@ -417,15 +423,18 @@ var CanvasTexture = new Class({ * @method Phaser.Textures.CanvasTexture#getPixels * @since 3.16.0 * - * @param {integer} x - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} width - The width of the region to get. Must be an integer. + * @param {integer} [x=0] - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [y=0] - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [width] - The width of the region to get. Must be an integer. Defaults to the canvas width if not given. * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. * * @return {Phaser.Types.Textures.PixelConfig[]} An array of Pixel objects. */ getPixels: function (x, y, width, height) { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.width; } if (height === undefined) { height = width; } x = Math.abs(Math.round(x)); diff --git a/src/textures/Frame.js b/src/textures/Frame.js index 8bf905496..47756c249 100644 --- a/src/textures/Frame.js +++ b/src/textures/Frame.js @@ -707,16 +707,18 @@ var Frame = new Class({ }, /** - * Destroys this Frames references. + * 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.texture = null; - this.source = null; + this.texture = null; + this.glTexture = null; + this.customData = null; + this.data = null; }, /** diff --git a/src/textures/Texture.js b/src/textures/Texture.js index 6c4e21aa4..e63b349d6 100644 --- a/src/textures/Texture.js +++ b/src/textures/Texture.js @@ -177,6 +177,35 @@ var Texture = new Class({ return frame; }, + /** + * Removes the given Frame from this Texture. The Frame is destroyed immediately. + * + * Any Game Objects using this Frame should stop using it _before_ you remove it, + * as it does not happen automatically. + * + * @method Phaser.Textures.Texture#remove + * @since 3.19.0 + * + * @param {string} name - The key of the Frame to remove. + * + * @return {boolean} True if a Frame with the matching key was removed from this Texture. + */ + remove: function (name) + { + if (this.has(name)) + { + var frame = this.get(name); + + frame.destroy(); + + delete this.frames[name]; + + return true; + } + + return false; + }, + /** * Checks to see if a Frame matching the given key exists within this Texture. * diff --git a/src/tweens/Timeline.js b/src/tweens/Timeline.js index cb1237f1f..68dcc8910 100644 --- a/src/tweens/Timeline.js +++ b/src/tweens/Timeline.js @@ -274,7 +274,7 @@ var Timeline = new Class({ * @method Phaser.Tweens.Timeline#dispatchTimelineEvent * @since 3.19.0 * - * @param {Phaser.Tweens.Events} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. */ dispatchTimelineEvent: function (event, callback) diff --git a/src/tweens/TweenManager.js b/src/tweens/TweenManager.js index 14ed48c5b..63a4671fc 100644 --- a/src/tweens/TweenManager.js +++ b/src/tweens/TweenManager.js @@ -265,12 +265,42 @@ var TweenManager = new Class({ }, /** - * Creates a stagger function and returns it. + * Creates a Stagger function to be used by a Tween property. + * + * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. + * + * This is only worth using if the tween has multiple targets. + * + * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 + * over the duration specified: + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(100) + * }); + * ``` + * + * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering + * from the center out, using a cubic ease. + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' }) + * }); + * ``` * * @method Phaser.Tweens.TweenManager#stagger * @since 3.19.0 * - * @param {Phaser.Types.Tweens.StaggerBuilderConfig} config - The configuration object for the Stagger function. + * @param {Phaser.Types.Tweens.StaggerConfig} config - The configuration object for the Stagger function. * * @return {function} The stagger function. */ diff --git a/src/tweens/tween/Tween.js b/src/tweens/tween/Tween.js index 6dbd858a9..4e0614255 100644 --- a/src/tweens/tween/Tween.js +++ b/src/tweens/tween/Tween.js @@ -1228,7 +1228,7 @@ var Tween = new Class({ * @method Phaser.Tweens.Tween#dispatchTweenDataEvent * @since 3.19.0 * - * @param {Phaser.Tweens.Events} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData object that caused this event. */ @@ -1253,7 +1253,7 @@ var Tween = new Class({ * @method Phaser.Tweens.Tween#dispatchTweenEvent * @since 3.19.0 * - * @param {Phaser.Tweens.Events} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. */ dispatchTweenEvent: function (event, callback) diff --git a/src/tweens/typedefs/Event.js b/src/tweens/typedefs/Event.js new file mode 100644 index 000000000..1d69faec4 --- /dev/null +++ b/src/tweens/typedefs/Event.js @@ -0,0 +1,4 @@ +/** + * @typedef {string} Phaser.Types.Tweens.Event - A Tween Event. + * @since 3.19.0 + */ diff --git a/types/matter.d.ts b/types/matter.d.ts new file mode 100644 index 000000000..04ed8bd89 --- /dev/null +++ b/types/matter.d.ts @@ -0,0 +1,3501 @@ +// Type definitions for Matter.js - 0.10.1 +// Project: https://github.com/liabru/matter-js +// Definitions by: Ivane Gegia , +// David Asmuth , +// Piotr Pietrzak +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = Matter; +export as namespace Matter; + +declare namespace Matter { + /** + * Installs the given plugins on the `Matter` namespace. + * This is a short-hand for `Plugin.use`, see it for more information. + * Call this function once at the start of your code, with all of the plugins you wish to install as arguments. + * Avoid calling this function multiple times unless you intend to manually control installation order. + * @method use + * @param ...plugin {Function} The plugin(s) to install on `base` (multi-argument). + */ + export function use(...plugins: (Plugin | string)[]): void; + + /** + * The `Matter.Axes` module contains methods for creating and manipulating sets of axes. + * + * @class Axes + */ + export class Axes { + /** + * Creates a new set of axes from the given vertices. + * @method fromVertices + * @param {vertices} vertices + * @return {axes} A new axes from the given vertices + */ + static fromVertices(vertices: Array): Array; + /** + * Rotates a set of axes by the given angle. + * @method rotate + * @param {axes} axes + * @param {number} angle + */ + static rotate(axes: Array, angle: number): void; + } + + interface IChamfer { + radius?: number | Array; + quality?: number; + qualityMin?: number; + qualityMax?: number; + } + + interface IChamferableBodyDefinition extends IBodyDefinition { + chamfer?: IChamfer; + } + + /** + * The `Matter.Bodies` module contains factory methods for creating rigid body models + * with commonly used body configurations (such as rectangles, circles and other polygons). + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class Bodies + */ + export class Bodies { + /** + * Creates a new rigid body model with a circle hull. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method circle + * @param {number} x + * @param {number} y + * @param {number} radius + * @param {object} [options] + * @param {number} [maxSides] + * @return {body} A new circle body + */ + static circle(x: number, y: number, radius: number, options?: IBodyDefinition, maxSides?: number): Body; + + /** + * Creates a new rigid body model with a regular polygon hull with the given number of sides. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method polygon + * @param {number} x + * @param {number} y + * @param {number} sides + * @param {number} radius + * @param {object} [options] + * @return {body} A new regular polygon body + */ + static polygon(x: number, y: number, sides: number, radius: number, options?: IChamferableBodyDefinition): Body; + + /** + * Creates a new rigid body model with a rectangle hull. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method rectangle + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {object} [options] + * @return {body} A new rectangle body + */ + static rectangle(x: number, y: number, width: number, height: number, options?: IChamferableBodyDefinition): Body; + + /** + * Creates a new rigid body model with a trapezoid hull. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method trapezoid + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {number} slope + * @param {object} [options] + * @return {body} A new trapezoid body + */ + static trapezoid(x: number, y: number, width: number, height: number, slope: number, options?: IChamferableBodyDefinition): Body; + /** + * Creates a body using the supplied vertices (or an array containing multiple sets of vertices). + * If the vertices are convex, they will pass through as supplied. + * Otherwise if the vertices are concave, they will be decomposed if [poly-decomp.js](https://github.com/schteppe/poly-decomp.js) is available. + * Note that this process is not guaranteed to support complex sets of vertices (e.g. those with holes may fail). + * By default the decomposition will discard collinear edges (to improve performance). + * It can also optionally discard any parts that have an area less than `minimumArea`. + * If the vertices can not be decomposed, the result will fall back to using the convex hull. + * The options parameter is an object that specifies any `Matter.Body` properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method fromVertices + * @param {number} x + * @param {number} y + * @param [[vector]] vertexSets + * @param {object} [options] + * @param {bool} [flagInternal=false] + * @param {number} [removeCollinear=0.01] + * @param {number} [minimumArea=10] + * @return {body} + */ + static fromVertices(x: number, y: number, vertexSets: Array>, options?: IBodyDefinition, flagInternal?: boolean, removeCollinear?: number, minimumArea?: number): Body; + } + + export interface IBodyDefinition { + /** + * A `Number` specifying the angle of the body, in radians. + * + * @property angle + * @type number + * @default 0 + */ + angle?: number; + /** + * A `Number` that _measures_ the current angular speed of the body after the last `Body.update`. It is read-only and always positive (it's the magnitude of `body.angularVelocity`). + * + * @readOnly + * @property angularSpeed + * @type number + * @default 0 + */ + angularSpeed?: number; + /** + * A `Number` that _measures_ the current angular velocity of the body after the last `Body.update`. It is read-only. + * If you need to modify a body's angular velocity directly, you should apply a torque or simply change the body's `angle` (as the engine uses position-Verlet integration). + * + * @readOnly + * @property angularVelocity + * @type number + * @default 0 + */ + angularVelocity?: number; + /** + * A `Number` that _measures_ the area of the body's convex hull, calculated at creation by `Body.create`. + * + * @property area + * @type string + * @default + */ + area?: number; + /** + * An array of unique axis vectors (edge normals) used for collision detection. + * These are automatically calculated from the given convex hull (`vertices` array) in `Body.create`. + * They are constantly updated by `Body.update` during the simulation. + * + * @property axes + * @type vector[] + */ + axes?: Array; + /** + * A `Bounds` object that defines the AABB region for the body. + * It is automatically calculated from the given convex hull (`vertices` array) in `Body.create` and constantly updated by `Body.update` during simulation. + * + * @property bounds + * @type bounds + */ + bounds?: Bounds; + /** + * A `Number` that defines the density of the body, that is its mass per unit area. + * If you pass the density via `Body.create` the `mass` property is automatically calculated for you based on the size (area) of the object. + * This is generally preferable to simply setting mass and allows for more intuitive definition of materials (e.g. rock has a higher density than wood). + * + * @property density + * @type number + * @default 0.001 + */ + density?: number; + /** + * A `Vector` that specifies the force to apply in the current step. It is zeroed after every `Body.update`. See also `Body.applyForce`. + * + * @property force + * @type vector + * @default { x: 0, y: 0 } + */ + force?: Vector; + /** + * A `Number` that defines the friction of the body. The value is always positive and is in the range `(0, 1)`. + * A value of `0` means that the body may slide indefinitely. + * A value of `1` means the body may come to a stop almost instantly after a force is applied. + * + * The effects of the value may be non-linear. + * High values may be unstable depending on the body. + * The engine uses a Coulomb friction model including static and kinetic friction. + * Note that collision response is based on _pairs_ of bodies, and that `friction` values are _combined_ with the following formula: + * + * Math.min(bodyA.friction, bodyB.friction) + * + * @property friction + * @type number + * @default 0.1 + */ + friction?: number; + /** + * A `Number` that defines the air friction of the body (air resistance). + * A value of `0` means the body will never slow as it moves through space. + * The higher the value, the faster a body slows when moving through space. + * The effects of the value are non-linear. + * + * @property frictionAir + * @type number + * @default 0.01 + */ + frictionAir?: number; + /** + * An integer `Number` uniquely identifying number generated in `Body.create` by `Common.nextId`. + * + * @property id + * @type number + */ + id?: number; + /** + * A `Number` that defines the moment of inertia (i.e. second moment of area) of the body. + * It is automatically calculated from the given convex hull (`vertices` array) and density in `Body.create`. + * If you modify this value, you must also modify the `body.inverseInertia` property (`1 / inertia`). + * + * @property inertia + * @type number + */ + inertia?: number; + /** + * A `Number` that defines the inverse moment of inertia of the body (`1 / inertia`). + * If you modify this value, you must also modify the `body.inertia` property. + * + * @property inverseInertia + * @type number + */ + inverseInertia?: number; + /** + * A `Number` that defines the inverse mass of the body (`1 / mass`). + * If you modify this value, you must also modify the `body.mass` property. + * + * @property inverseMass + * @type number + */ + inverseMass?: number; + /** + * A flag that indicates whether a body is a sensor. Sensor triggers collision events, but doesn't react with colliding body physically. + * + * @property isSensor + * @type boolean + * @default false + */ + isSensor?: boolean; + /** + * A flag that indicates whether the body is considered sleeping. A sleeping body acts similar to a static body, except it is only temporary and can be awoken. + * If you need to set a body as sleeping, you should use `Sleeping.set` as this requires more than just setting this flag. + * + * @property isSleeping + * @type boolean + * @default false + */ + isSleeping?: boolean; + /** + * A flag that indicates whether a body is considered static. A static body can never change position or angle and is completely fixed. + * If you need to set a body as static after its creation, you should use `Body.setStatic` as this requires more than just setting this flag. + * + * @property isStatic + * @type boolean + * @default false + */ + isStatic?: boolean; + /** + * An arbitrary `String` name to help the user identify and manage bodies. + * + * @property label + * @type string + * @default "Body" + */ + + label?: string; + /** + * A `Number` that defines the mass of the body, although it may be more appropriate to specify the `density` property instead. + * If you modify this value, you must also modify the `body.inverseMass` property (`1 / mass`). + * + * @property mass + * @type number + */ + mass?: number; + /** + * A `Number` that _measures_ the amount of movement a body currently has (a combination of `speed` and `angularSpeed`). It is read-only and always positive. + * It is used and updated by the `Matter.Sleeping` module during simulation to decide if a body has come to rest. + * + * @readOnly + * @property motion + * @type number + * @default 0 + */ + motion?: number; + /** + * A `Vector` that specifies the current world-space position of the body. + * + * @property position + * @type vector + * @default { x: 0, y: */ + position?: Vector; + /** + * An `Object` that defines the rendering properties to be consumed by the module `Matter.Render`. + * + * @property render + * @type object + */ + render?: IBodyRenderOptions; + /** + * A `Number` that defines the restitution (elasticity) of the body. The value is always positive and is in the range `(0, 1)`. + * A value of `0` means collisions may be perfectly inelastic and no bouncing may occur. + * A value of `0.8` means the body may bounce back with approximately 80% of its kinetic energy. + * Note that collision response is based on _pairs_ of bodies, and that `restitution` values are _combined_ with the following formula: + * + * Math.max(bodyA.restitution, bodyB.restitution) + * + * @property restitution + * @type number + * @default 0 + */ + restitution?: number; + /** + * A `Number` that defines the number of updates in which this body must have near-zero velocity before it is set as sleeping by the `Matter.Sleeping` module (if sleeping is enabled by the engine). + * + * @property sleepThreshold + * @type number + * @default 60 + */ + sleepThreshold?: number; + /** + * A `Number` that specifies a tolerance on how far a body is allowed to 'sink' or rotate into other bodies. + * Avoid changing this value unless you understand the purpose of `slop` in physics engines. + * The default should generally suffice, although very large bodies may require larger values for stable stacking. + * + * @property slop + * @type number + * @default 0.05 + */ + slop?: number; + /** + * A `Number` that _measures_ the current speed of the body after the last `Body.update`. It is read-only and always positive (it's the magnitude of `body.velocity`). + * + * @readOnly + * @property speed + * @type number + * @default 0 + */ + speed?: number; + /** + * A `Number` that allows per-body time scaling, e.g. a force-field where bodies inside are in slow-motion, while others are at full speed. + * + * @property timeScale + * @type number + * @default 1 + */ + timeScale?: number; + /** + * A `Number` that specifies the torque (turning force) to apply in the current step. It is zeroed after every `Body.update`. + * + * @property torque + * @type number + * @default 0 + */ + torque?: number; + /** + * A `String` denoting the type of object. + * + * @property type + * @type string + * @default "body" + */ + type?: string; + /** + * A `Vector` that _measures_ the current velocity of the body after the last `Body.update`. It is read-only. + * If you need to modify a body's velocity directly, you should either apply a force or simply change the body's `position` (as the engine uses position-Verlet integration). + * + * @readOnly + * @property velocity + * @type vector + * @default { x: 0, y: 0 } + */ + velocity?: Vector; + /** + * An array of `Vector` objects that specify the convex hull of the rigid body. + * These should be provided about the origin `(0, 0)`. E.g. + * + * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }] + * + * When passed via `Body.create`, the vertices are translated relative to `body.position` (i.e. world-space, and constantly updated by `Body.update` during simulation). + * The `Vector` objects are also augmented with additional properties required for efficient collision detection. + * + * Other properties such as `inertia` and `bounds` are automatically calculated from the passed vertices (unless provided via `options`). + * Concave hulls are not currently supported. The module `Matter.Vertices` contains useful methods for working with vertices. + * + * @property vertices + * @type vector[] + */ + vertices?: Array; + /** + * An array of bodies that make up this body. + * The first body in the array must always be a self reference to the current body instance. + * All bodies in the `parts` array together form a single rigid compound body. + * Parts are allowed to overlap, have gaps or holes or even form concave bodies. + * Parts themselves should never be added to a `World`, only the parent body should be. + * Use `Body.setParts` when setting parts to ensure correct updates of all properties. + * + * @property parts + * @type body[] + */ + parts?: Array; + /** + * A self reference if the body is _not_ a part of another body. + * Otherwise this is a reference to the body that this is a part of. + * See `body.parts`. + * + * @property parent + * @type body + */ + parent?: Body; + /** + * A `Number` that defines the static friction of the body (in the Coulomb friction model). + * A value of `0` means the body will never 'stick' when it is nearly stationary and only dynamic `friction` is used. + * The higher the value (e.g. `10`), the more force it will take to initially get the body moving when nearly stationary. + * This value is multiplied with the `friction` property to make it easier to change `friction` and maintain an appropriate amount of static friction. + * + * @property frictionStatic + * @type number + * @default 0.5 + */ + frictionStatic?: number; + /** + * An `Object` that specifies the collision filtering properties of this body. + * + * Collisions between two bodies will obey the following rules: + * - If the two bodies have the same non-zero value of `collisionFilter.group`, + * they will always collide if the value is positive, and they will never collide + * if the value is negative. + * - If the two bodies have different values of `collisionFilter.group` or if one + * (or both) of the bodies has a value of 0, then the category/mask rules apply as follows: + * + * Each body belongs to a collision category, given by `collisionFilter.category`. This + * value is used as a bit field and the category should have only one bit set, meaning that + * the value of this property is a power of two in the range [1, 2^31]. Thus, there are 32 + * different collision categories available. + * + * Each body also defines a collision bitmask, given by `collisionFilter.mask` which specifies + * the categories it collides with (the value is the bitwise AND value of all these categories). + * + * Using the category/mask rules, two bodies `A` and `B` collide if each includes the other's + * category in its mask, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` + * are both true. + * + * @property collisionFilter + * @type object + */ + collisionFilter?: ICollisionFilter; + + } + + export interface IBodyRenderOptions { + + /** + * A flag that indicates if the body should be rendered. + * + * @property render.visible + * @type boolean + * @default true + */ + visible?: boolean; + + /** + * An `Object` that defines the sprite properties to use when rendering, if any. + * + * @property render.sprite + * @type object + */ + sprite?: IBodyRenderOptionsSprite; + + /** + * A String that defines the fill style to use when rendering the body (if a sprite is not defined). It is the same as when using a canvas, so it accepts CSS style property values. + Default: a random colour + */ + fillStyle?: string; + + /** + * A Number that defines the line width to use when rendering the body outline (if a sprite is not defined). A value of 0 means no outline will be rendered. + Default: 1.5 + */ + lineWidth?: number; + + /** + * A String that defines the stroke style to use when rendering the body outline (if a sprite is not defined). It is the same as when using a canvas, so it accepts CSS style property values. + Default: a random colour + */ + strokeStyle?: string; + + + /* + * Sets the opacity. 1.0 is fully opaque. 0.0 is fully translucent + */ + opacity?: number; + } + + export interface IBodyRenderOptionsSprite { + /** + * An `String` that defines the path to the image to use as the sprite texture, if any. + * + * @property render.sprite.texture + * @type string + */ + texture: string; + + /** + * A `Number` that defines the scaling in the x-axis for the sprite, if any. + * + * @property render.sprite.xScale + * @type number + * @default 1 + */ + xScale: number; + + /** + * A `Number` that defines the scaling in the y-axis for the sprite, if any. + * + * @property render.sprite.yScale + * @type number + * @default 1 + */ + yScale: number; + } + + /** + * The `Matter.Body` module contains methods for creating and manipulating body models. + * A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`. + * Factories for commonly used body configurations (such as rectangles, circles and other polygons) can be found in the module `Matter.Bodies`. + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + + * @class Body + */ + export class Body { + /** + * Applies a force to a body from a given world-space position, including resulting torque. + * @method applyForce + * @param {body} body + * @param {vector} position + * @param {vector} force + */ + static applyForce(body: Body, position: Vector, force: Vector): void; + + /** + * Creates a new rigid body model. The options parameter is an object that specifies any properties you wish to override the defaults. + * All properties have default values, and many are pre-calculated automatically based on other properties. + * See the properties section below for detailed information on what you can pass via the `options` object. + * @method create + * @param {} options + * @return {body} body + */ + static create(options: IBodyDefinition): Body; + /** + * Rotates a body by a given angle relative to its current angle, without imparting any angular velocity. + * @method rotate + * @param {body} body + * @param {number} rotation + */ + static rotate(body: Body, rotation: number): void; + /** + * Returns the next unique group index for which bodies will collide. + * If `isNonColliding` is `true`, returns the next unique group index for which bodies will _not_ collide. + * See `body.collisionFilter` for more information. + * @method nextGroup + * @param {bool} [isNonColliding=false] + * @return {Number} Unique group index + */ + static nextGroup(isNonColliding: boolean): number; + /** + * Returns the next unique category bitfield (starting after the initial default category `0x0001`). + * There are 32 available. See `body.collisionFilter` for more information. + * @method nextCategory + * @return {Number} Unique category bitfield + */ + static nextCategory(): number; + /** + * Given a property and a value (or map of), sets the property(s) on the body, using the appropriate setter functions if they exist. + * Prefer to use the actual setter functions in performance critical situations. + * @method set + * @param {body} body + * @param {} settings A property name (or map of properties and values) to set on the body. + * @param {} value The value to set if `settings` is a single property name. + */ + static set(body: Body, settings: any, value?: any): void; + /** + * Sets the mass of the body. Inverse mass and density are automatically updated to reflect the change. + * @method setMass + * @param {body} body + * @param {number} mass + */ + static setMass(body: Body, mass: number): void; + /** + * Sets the density of the body. Mass is automatically updated to reflect the change. + * @method setDensity + * @param {body} body + * @param {number} density + */ + static setDensity(body: Body, density: number): void; + /** + * Sets the moment of inertia (i.e. second moment of area) of the body of the body. + * Inverse inertia is automatically updated to reflect the change. Mass is not changed. + * @method setInertia + * @param {body} body + * @param {number} inertia + */ + static setInertia(body: Body, interna: number): void; + /** + * Sets the body's vertices and updates body properties accordingly, including inertia, area and mass (with respect to `body.density`). + * Vertices will be automatically transformed to be orientated around their centre of mass as the origin. + * They are then automatically translated to world space based on `body.position`. + * + * The `vertices` argument should be passed as an array of `Matter.Vector` points (or a `Matter.Vertices` array). + * Vertices must form a convex hull, concave hulls are not supported. + * + * @method setVertices + * @param {body} body + * @param {vector[]} vertices + */ + static setVertices(body: Body, vertices: Array): void; + /** + * Sets the parts of the `body` and updates mass, inertia and centroid. + * Each part will have its parent set to `body`. + * By default the convex hull will be automatically computed and set on `body`, unless `autoHull` is set to `false.` + * Note that this method will ensure that the first part in `body.parts` will always be the `body`. + * @method setParts + * @param {body} body + * @param [body] parts + * @param {bool} [autoHull=true] + */ + static setParts(body: Body, parts: Body[], autoHull?: boolean): void; + /** + * Sets the position of the body instantly. Velocity, angle, force etc. are unchanged. + * @method setPosition + * @param {body} body + * @param {vector} position + */ + static setPosition(body: Body, position: Vector): void; + /** + * Sets the angle of the body instantly. Angular velocity, position, force etc. are unchanged. + * @method setAngle + * @param {body} body + * @param {number} angle + */ + static setAngle(body: Body, angle: number): void; + /** + * Sets the linear velocity of the body instantly. Position, angle, force etc. are unchanged. See also `Body.applyForce`. + * @method setVelocity + * @param {body} body + * @param {vector} velocity + */ + static setVelocity(body: Body, velocity: Vector): void; + /** + * Sets the angular velocity of the body instantly. Position, angle, force etc. are unchanged. See also `Body.applyForce`. + * @method setAngularVelocity + * @param {body} body + * @param {number} velocity + */ + static setAngularVelocity(body: Body, velocity: number): void; + + + + /** + * Sets the body as static, including isStatic flag and setting mass and inertia to Infinity. + * @method setStatic + * @param {body} body + * @param {bool} isStatic + */ + static setStatic(body: Body, isStatic: boolean): void; + + /** + * Scales the body, including updating physical properties (mass, area, axes, inertia), from a world-space point (default is body centre). + * @method scale + * @param {body} body + * @param {number} scaleX + * @param {number} scaleY + * @param {vector} [point] + */ + static scale(body: Body, scaleX: number, scaleY: number, point?: Vector): void; + + /** + * Moves a body by a given vector relative to its current position, without imparting any velocity. + * @method translate + * @param {body} body + * @param {vector} translation + */ + static translate(body: Body, translation: Vector): void; + + /** + * Performs a simulation step for the given `body`, including updating position and angle using Verlet integration. + * @method update + * @param {body} body + * @param {number} deltaTime + * @param {number} timeScale + * @param {number} correction + */ + static update(body: Body, deltaTime: number, timeScale: number, correction: number): void; + + /** + * A `Number` specifying the angle of the body, in radians. + * + * @property angle + * @type number + * @default 0 + */ + angle: number; + /** + * A `Number` that _measures_ the current angular speed of the body after the last `Body.update`. It is read-only and always positive (it's the magnitude of `body.angularVelocity`). + * + * @readOnly + * @property angularSpeed + * @type number + * @default 0 + */ + angularSpeed: number; + /** + * A `Number` that _measures_ the current angular velocity of the body after the last `Body.update`. It is read-only. + * If you need to modify a body's angular velocity directly, you should apply a torque or simply change the body's `angle` (as the engine uses position-Verlet integration). + * + * @readOnly + * @property angularVelocity + * @type number + * @default 0 + */ + angularVelocity: number; + /** + * A `Number` that _measures_ the area of the body's convex hull, calculated at creation by `Body.create`. + * + * @property area + * @type string + * @default + */ + area: number; + /** + * An array of unique axis vectors (edge normals) used for collision detection. + * These are automatically calculated from the given convex hull (`vertices` array) in `Body.create`. + * They are constantly updated by `Body.update` during the simulation. + * + * @property axes + * @type vector[] + */ + axes: Array; + /** + * A `Bounds` object that defines the AABB region for the body. + * It is automatically calculated from the given convex hull (`vertices` array) in `Body.create` and constantly updated by `Body.update` during simulation. + * + * @property bounds + * @type bounds + */ + bounds: Bounds; + /** + * A `Number` that defines the density of the body, that is its mass per unit area. + * If you pass the density via `Body.create` the `mass` property is automatically calculated for you based on the size (area) of the object. + * This is generally preferable to simply setting mass and allows for more intuitive definition of materials (e.g. rock has a higher density than wood). + * + * @property density + * @type number + * @default 0.001 + */ + density: number; + /** + * A `Vector` that specifies the force to apply in the current step. It is zeroed after every `Body.update`. See also `Body.applyForce`. + * + * @property force + * @type vector + * @default { x: 0, y: 0 } + */ + force: Vector; + /** + * A `Number` that defines the friction of the body. The value is always positive and is in the range `(0, 1)`. + * A value of `0` means that the body may slide indefinitely. + * A value of `1` means the body may come to a stop almost instantly after a force is applied. + * + * The effects of the value may be non-linear. + * High values may be unstable depending on the body. + * The engine uses a Coulomb friction model including static and kinetic friction. + * Note that collision response is based on _pairs_ of bodies, and that `friction` values are _combined_ with the following formula: + * + * Math.min(bodyA.friction, bodyB.friction) + * + * @property friction + * @type number + * @default 0.1 + */ + friction: number; + /** + * A `Number` that defines the air friction of the body (air resistance). + * A value of `0` means the body will never slow as it moves through space. + * The higher the value, the faster a body slows when moving through space. + * The effects of the value are non-linear. + * + * @property frictionAir + * @type number + * @default 0.01 + */ + frictionAir: number; + /** + * An integer `Number` uniquely identifying number generated in `Body.create` by `Common.nextId`. + * + * @property id + * @type number + */ + id: number; + /** + * A `Number` that defines the moment of inertia (i.e. second moment of area) of the body. + * It is automatically calculated from the given convex hull (`vertices` array) and density in `Body.create`. + * If you modify this value, you must also modify the `body.inverseInertia` property (`1 / inertia`). + * + * @property inertia + * @type number + */ + inertia: number; + /** + * A `Number` that defines the inverse moment of inertia of the body (`1 / inertia`). + * If you modify this value, you must also modify the `body.inertia` property. + * + * @property inverseInertia + * @type number + */ + inverseInertia: number; + /** + * A `Number` that defines the inverse mass of the body (`1 / mass`). + * If you modify this value, you must also modify the `body.mass` property. + * + * @property inverseMass + * @type number + */ + inverseMass: number; + /** + * A flag that indicates whether the body is considered sleeping. A sleeping body acts similar to a static body, except it is only temporary and can be awoken. + * If you need to set a body as sleeping, you should use `Sleeping.set` as this requires more than just setting this flag. + * + * @property isSleeping + * @type boolean + * @default false + */ + isSleeping: boolean; + /** + * A flag that indicates whether a body is considered static. A static body can never change position or angle and is completely fixed. + * If you need to set a body as static after its creation, you should use `Body.setStatic` as this requires more than just setting this flag. + * + * @property isStatic + * @type boolean + * @default false + */ + isStatic: boolean; + /** + * A flag that indicates whether a body is a sensor. Sensor triggers collision events, but doesn't react with colliding body physically. + * + * @property isSensor + * @type boolean + * @default false + */ + isSensor: boolean; + /** + * An arbitrary `String` name to help the user identify and manage bodies. + * + * @property label + * @type string + * @default "Body" + */ + + label: string; + /** + * A `Number` that defines the mass of the body, although it may be more appropriate to specify the `density` property instead. + * If you modify this value, you must also modify the `body.inverseMass` property (`1 / mass`). + * + * @property mass + * @type number + */ + mass: number; + /** + * A `Number` that _measures_ the amount of movement a body currently has (a combination of `speed` and `angularSpeed`). It is read-only and always positive. + * It is used and updated by the `Matter.Sleeping` module during simulation to decide if a body has come to rest. + * + * @readOnly + * @property motion + * @type number + * @default 0 + */ + motion: number; + /** + * A `Vector` that specifies the current world-space position of the body. + * + * @property position + * @type vector + * @default { x: 0, y: */ + position: Vector; + /** + * An `Object` that defines the rendering properties to be consumed by the module `Matter.Render`. + * + * @property render + * @type object + */ + render: IBodyRenderOptions; + /** + * A `Number` that defines the restitution (elasticity) of the body. The value is always positive and is in the range `(0, 1)`. + * A value of `0` means collisions may be perfectly inelastic and no bouncing may occur. + * A value of `0.8` means the body may bounce back with approximately 80% of its kinetic energy. + * Note that collision response is based on _pairs_ of bodies, and that `restitution` values are _combined_ with the following formula: + * + * Math.max(bodyA.restitution, bodyB.restitution) + * + * @property restitution + * @type number + * @default 0 + */ + restitution: number; + /** + * A `Number` that defines the number of updates in which this body must have near-zero velocity before it is set as sleeping by the `Matter.Sleeping` module (if sleeping is enabled by the engine). + * + * @property sleepThreshold + * @type number + * @default 60 + */ + sleepThreshold: number; + /** + * A `Number` that specifies a tolerance on how far a body is allowed to 'sink' or rotate into other bodies. + * Avoid changing this value unless you understand the purpose of `slop` in physics engines. + * The default should generally suffice, although very large bodies may require larger values for stable stacking. + * + * @property slop + * @type number + * @default 0.05 + */ + slop: number; + /** + * A `Number` that _measures_ the current speed of the body after the last `Body.update`. It is read-only and always positive (it's the magnitude of `body.velocity`). + * + * @readOnly + * @property speed + * @type number + * @default 0 + */ + speed: number; + /** + * A `Number` that allows per-body time scaling, e.g. a force-field where bodies inside are in slow-motion, while others are at full speed. + * + * @property timeScale + * @type number + * @default 1 + */ + timeScale: number; + /** + * A `Number` that specifies the torque (turning force) to apply in the current step. It is zeroed after every `Body.update`. + * + * @property torque + * @type number + * @default 0 + */ + torque: number; + /** + * A `String` denoting the type of object. + * + * @property type + * @type string + * @default "body" + */ + type: string; + /** + * A `Vector` that _measures_ the current velocity of the body after the last `Body.update`. It is read-only. + * If you need to modify a body's velocity directly, you should either apply a force or simply change the body's `position` (as the engine uses position-Verlet integration). + * + * @readOnly + * @property velocity + * @type vector + * @default { x: 0, y: 0 } + */ + velocity: Vector; + /** + * An array of `Vector` objects that specify the convex hull of the rigid body. + * These should be provided about the origin `(0, 0)`. E.g. + * + * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }] + * + * When passed via `Body.create`, the vertices are translated relative to `body.position` (i.e. world-space, and constantly updated by `Body.update` during simulation). + * The `Vector` objects are also augmented with additional properties required for efficient collision detection. + * + * Other properties such as `inertia` and `bounds` are automatically calculated from the passed vertices (unless provided via `options`). + * Concave hulls are not currently supported. The module `Matter.Vertices` contains useful methods for working with vertices. + * + * @property vertices + * @type vector[] + */ + vertices: Array; + /** + * An array of bodies that make up this body. + * The first body in the array must always be a self reference to the current body instance. + * All bodies in the `parts` array together form a single rigid compound body. + * Parts are allowed to overlap, have gaps or holes or even form concave bodies. + * Parts themselves should never be added to a `World`, only the parent body should be. + * Use `Body.setParts` when setting parts to ensure correct updates of all properties. + * + * @property parts + * @type body[] + */ + parts: Array; + /** + * A self reference if the body is _not_ a part of another body. + * Otherwise this is a reference to the body that this is a part of. + * See `body.parts`. + * + * @property parent + * @type body + */ + parent: Body; + /** + * A `Number` that defines the static friction of the body (in the Coulomb friction model). + * A value of `0` means the body will never 'stick' when it is nearly stationary and only dynamic `friction` is used. + * The higher the value (e.g. `10`), the more force it will take to initially get the body moving when nearly stationary. + * This value is multiplied with the `friction` property to make it easier to change `friction` and maintain an appropriate amount of static friction. + * + * @property frictionStatic + * @type number + * @default 0.5 + */ + frictionStatic: number; + /** + * An `Object` that specifies the collision filtering properties of this body. + * + * Collisions between two bodies will obey the following rules: + * - If the two bodies have the same non-zero value of `collisionFilter.group`, + * they will always collide if the value is positive, and they will never collide + * if the value is negative. + * - If the two bodies have different values of `collisionFilter.group` or if one + * (or both) of the bodies has a value of 0, then the category/mask rules apply as follows: + * + * Each body belongs to a collision category, given by `collisionFilter.category`. This + * value is used as a bit field and the category should have only one bit set, meaning that + * the value of this property is a power of two in the range [1, 2^31]. Thus, there are 32 + * different collision categories available. + * + * Each body also defines a collision bitmask, given by `collisionFilter.mask` which specifies + * the categories it collides with (the value is the bitwise AND value of all these categories). + * + * Using the category/mask rules, two bodies `A` and `B` collide if each includes the other's + * category in its mask, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` + * are both true. + * + * @property collisionFilter + * @type object + */ + collisionFilter: ICollisionFilter; + + } + + export interface IBound { + min: { x: number, y: number } + max: { x: number, y: number } + } + + /** + * The `Matter.Bounds` module contains methods for creating and manipulating axis-aligned bounding boxes (AABB). + * + * @class Bounds + */ + export class Bounds { + /** + * Creates a new axis-aligned bounding box (AABB) for the given vertices. + * @method create + * @param {vertices} vertices + * @return {bounds} A new bounds object + */ + static create (vertices: Vertices): Bounds; + /** + * Updates bounds using the given vertices and extends the bounds given a velocity. + * @method update + * @param {bounds} bounds + * @param {vertices} vertices + * @param {vector} velocity + */ + static update(bounds: Bounds, vertices: Vertices, velocity: Vector): void; + /** + * Returns true if the bounds contains the given point. + * @method contains + * @param {bounds} bounds + * @param {vector} point + * @return {boolean} True if the bounds contain the point, otherwise false + */ + static contains(bounds: Bounds, point: Vector): boolean; + /** + * Returns true if the two bounds intersect. + * @method overlaps + * @param {bounds} boundsA + * @param {bounds} boundsB + * @return {boolean} True if the bounds overlap, otherwise false + */ + static overlaps(boundsA: Bounds, boundsB: Bounds): boolean; + /** + * Translates the bounds by the given vector. + * @method translate + * @param {bounds} bounds + * @param {vector} vector + */ + static translate(bounds: Bounds, vector: Vector): void; + /** + * Shifts the bounds to the given position. + * @method shift + * @param {bounds} bounds + * @param {vector} position + */ + static shift(bounds: Bounds, position: Vector): void; + } + + export interface ICompositeDefinition { + /** + * An array of `Body` that are _direct_ children of this composite. + * To add or remove bodies you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property. + * If you wish to recursively find all descendants, you should use the `Composite.allBodies` method. + * + * @property bodies + * @type body[] + * @default [] + */ + bodies?: Array; + + /** + * An array of `Composite` that are _direct_ children of this composite. + * To add or remove composites you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property. + * If you wish to recursively find all descendants, you should use the `Composite.allComposites` method. + * + * @property composites + * @type composite[] + * @default [] + */ + composites?: Array; + + /** + * An array of `Constraint` that are _direct_ children of this composite. + * To add or remove constraints you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property. + * If you wish to recursively find all descendants, you should use the `Composite.allConstraints` method. + * + * @property constraints + * @type constraint[] + * @default [] + */ + constraints?: Array; + + /** + * An integer `Number` uniquely identifying number generated in `Composite.create` by `Common.nextId`. + * + * @property id + * @type number + */ + id?: number; + + /** + * A flag that specifies whether the composite has been modified during the current step. + * Most `Matter.Composite` methods will automatically set this flag to `true` to inform the engine of changes to be handled. + * If you need to change it manually, you should use the `Composite.setModified` method. + * + * @property isModified + * @type boolean + * @default false + */ + isModified?: boolean; + + /** + * An arbitrary `String` name to help the user identify and manage composites. + * + * @property label + * @type string + * @default "Composite" + */ + label?: string; + + /** + * The `Composite` that is the parent of this composite. It is automatically managed by the `Matter.Composite` methods. + * + * @property parent + * @type composite + * @default null + */ + parent?: Composite; + + /** + * A `String` denoting the type of object. + * + * @property type + * @type string + * @default "composite" + */ + type?: String; + } + + /** + * The `Matter.Composite` module contains methods for creating and manipulating composite bodies. + * A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure. + * It is important to use the functions in this module to modify composites, rather than directly modifying their properties. + * Note that the `Matter.World` object is also a type of `Matter.Composite` and as such all composite methods here can also operate on a `Matter.World`. + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class Composite + */ + export class Composite { + /** + * Generic add function. Adds one or many body(s), constraint(s) or a composite(s) to the given composite. + * Triggers `beforeAdd` and `afterAdd` events on the `composite`. + * @method add + * @param {composite} composite + * @param {} object + * @return {composite} The original composite with the objects added + */ + static add(composite: Composite, object: Body | Composite | Constraint): Composite; + + /** + * Returns all bodies in the given composite, including all bodies in its children, recursively. + * @method allBodies + * @param {composite} composite + * @return {body[]} All the bodies + */ + static allBodies(composite: Composite): Array; + + /** + * Returns all composites in the given composite, including all composites in its children, recursively. + * @method allComposites + * @param {composite} composite + * @return {composite[]} All the composites + */ + static allComposites(composite: Composite): Array; + + /** + * Returns all constraints in the given composite, including all constraints in its children, recursively. + * @method allConstraints + * @param {composite} composite + * @return {constraint[]} All the constraints + */ + static allConstraints(composite: Composite): Array; + + /** + * Removes all bodies, constraints and composites from the given composite. + * Optionally clearing its children recursively. + * @method clear + * @param {composite} composite + * @param {boolean} keepStatic + * @param {boolean} [deep=false] + */ + static clear(composite: Composite, keepStatic: boolean, deep?: boolean): void; + + /** + * Creates a new composite. The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properites section below for detailed information on what you can pass via the `options` object. + * @method create + * @param {} [options] + * @return {composite} A new composite + */ + static create(options?: ICompositeDefinition): Composite; + + /** + * Searches the composite recursively for an object matching the type and id supplied, null if not found. + * @method get + * @param {composite} composite + * @param {number} id + * @param {string} type + * @return {object} The requested object, if found + */ + static get(composite: Composite, id: number, type: string): Body | Composite | Constraint; + + /** + * Moves the given object(s) from compositeA to compositeB (equal to a remove followed by an add). + * @method move + * @param {compositeA} compositeA + * @param {object[]} objects + * @param {compositeB} compositeB + * @return {composite} Returns compositeA + */ + static move(compositeA: Composite, objects: Array, compositeB: Composite): Composite; + + /** + * Assigns new ids for all objects in the composite, recursively. + * @method rebase + * @param {composite} composite + * @return {composite} Returns composite + */ + static rebase(composite: Composite): Composite; + + /** + * Generic remove function. Removes one or many body(s), constraint(s) or a composite(s) to the given composite. + * Optionally searching its children recursively. + * Triggers `beforeRemove` and `afterRemove` events on the `composite`. + * @method remove + * @param {composite} composite + * @param {} object + * @param {boolean} [deep=false] + * @return {composite} The original composite with the objects removed + */ + static remove(composite: Composite, object: Body | Composite | Constraint, deep?: boolean): Composite; + + + + /** + * Sets the composite's `isModified` flag. + * If `updateParents` is true, all parents will be set (default: false). + * If `updateChildren` is true, all children will be set (default: false). + * @method setModified + * @param {composite} composite + * @param {boolean} isModified + * @param {boolean} [updateParents=false] + * @param {boolean} [updateChildren=false] + */ + static setModified(composite: Composite, isModified: boolean, updateParents?: boolean, updateChildren?: boolean): void; + /** + * Translates all children in the composite by a given vector relative to their current positions, + * without imparting any velocity. + * @method translate + * @param {composite} composite + * @param {vector} translation + * @param {bool} [recursive=true] + */ + static translate(composite: Composite, translation: Vector, recursive?: boolean): void; + /** + * Rotates all children in the composite by a given angle about the given point, without imparting any angular velocity. + * @method rotate + * @param {composite} composite + * @param {number} rotation + * @param {vector} point + * @param {bool} [recursive=true] + */ + static rotate(composite: Composite, rotation: number, point: Vector, recursive?: boolean): void; + /** + * Scales all children in the composite, including updating physical properties (mass, area, axes, inertia), from a world-space point. + * @method scale + * @param {composite} composite + * @param {number} scaleX + * @param {number} scaleY + * @param {vector} point + * @param {bool} [recursive=true] + */ + static scale(composite: Composite, scaleX: number, scaleY: number, point: Vector, recursive?: boolean): void; + + + /** + * An array of `Body` that are _direct_ children of this composite. + * To add or remove bodies you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property. + * If you wish to recursively find all descendants, you should use the `Composite.allBodies` method. + * + * @property bodies + * @type body[] + * @default [] + */ + bodies: Array; + + /** + * An array of `Composite` that are _direct_ children of this composite. + * To add or remove composites you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property. + * If you wish to recursively find all descendants, you should use the `Composite.allComposites` method. + * + * @property composites + * @type composite[] + * @default [] + */ + composites: Array; + + /** + * An array of `Constraint` that are _direct_ children of this composite. + * To add or remove constraints you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property. + * If you wish to recursively find all descendants, you should use the `Composite.allConstraints` method. + * + * @property constraints + * @type constraint[] + * @default [] + */ + constraints: Array; + + /** + * An integer `Number` uniquely identifying number generated in `Composite.create` by `Common.nextId`. + * + * @property id + * @type number + */ + id: number; + + /** + * A flag that specifies whether the composite has been modified during the current step. + * Most `Matter.Composite` methods will automatically set this flag to `true` to inform the engine of changes to be handled. + * If you need to change it manually, you should use the `Composite.setModified` method. + * + * @property isModified + * @type boolean + * @default false + */ + isModified: boolean; + + /** + * An arbitrary `String` name to help the user identify and manage composites. + * + * @property label + * @type string + * @default "Composite" + */ + label: string; + + /** + * The `Composite` that is the parent of this composite. It is automatically managed by the `Matter.Composite` methods. + * + * @property parent + * @type composite + * @default null + */ + parent: Composite; + + /** + * A `String` denoting the type of object. + * + * @property type + * @type string + * @default "composite" + */ + type: String; + + } + + /** + * The `Matter.Composites` module contains factory methods for creating composite bodies + * with commonly used configurations (such as stacks and chains). + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class Composites + */ + export class Composites { + /** + * Creates a composite with simple car setup of bodies and constraints. + * @method car + * @param {number} xx + * @param {number} yy + * @param {number} width + * @param {number} height + * @param {number} wheelSize + * @return {composite} A new composite car body + */ + static car(xx: number, yy: number, width: number, height: number, wheelSize: number): Composite; + + /** + * Chains all bodies in the given composite together using constraints. + * @method chain + * @param {composite} composite + * @param {number} xOffsetA + * @param {number} yOffsetA + * @param {number} xOffsetB + * @param {number} yOffsetB + * @param {object} options + * @return {composite} A new composite containing objects chained together with constraints + */ + static chain(composite: Composite, xOffsetA: number, yOffsetA: number, xOffsetB: number, yOffsetB: number, options: any): Composite; + + /** + * Connects bodies in the composite with constraints in a grid pattern, with optional cross braces. + * @method mesh + * @param {composite} composite + * @param {number} columns + * @param {number} rows + * @param {boolean} crossBrace + * @param {object} options + * @return {composite} The composite containing objects meshed together with constraints + */ + static mesh(composite: Composite, columns: number, rows: number, crossBrace: boolean, options: any): Composite; + + /** + * Creates a composite with a Newton's Cradle setup of bodies and constraints. + * @method newtonsCradle + * @param {number} xx + * @param {number} yy + * @param {number} number + * @param {number} size + * @param {number} length + * @return {composite} A new composite newtonsCradle body + */ + newtonsCradle(xx: number, yy: number, _number: number, size: number, length: number): Composite; + + /** + * Create a new composite containing bodies created in the callback in a pyramid arrangement. + * This function uses the body's bounds to prevent overlaps. + * @method pyramid + * @param {number} xx + * @param {number} yy + * @param {number} columns + * @param {number} rows + * @param {number} columnGap + * @param {number} rowGap + * @param {function} callback + * @return {composite} A new composite containing objects created in the callback + */ + static pyramid(xx: number, yy: number, columns: number, rows: number, columnGap: number, rowGap: number, callback: Function): Composite; + + /** + * Creates a simple soft body like object. + * @method softBody + * @param {number} xx + * @param {number} yy + * @param {number} columns + * @param {number} rows + * @param {number} columnGap + * @param {number} rowGap + * @param {boolean} crossBrace + * @param {number} particleRadius + * @param {} particleOptions + * @param {} constraintOptions + * @return {composite} A new composite softBody + */ + static softBody(xx: number, yy: number, columns: number, rows: number, columnGap: number, rowGap: number, crossBrace: boolean, particleRadius: number, particleOptions: any, constraintOptions: any): Composite; + + /** + * Create a new composite containing bodies created in the callback in a grid arrangement. + * This function uses the body's bounds to prevent overlaps. + * @method stack + * @param {number} xx + * @param {number} yy + * @param {number} columns + * @param {number} rows + * @param {number} columnGap + * @param {number} rowGap + * @param {function} callback + * @return {composite} A new composite containing objects created in the callback + */ + static stack(xx: number, yy: number, columns: number, rows: number, columnGap: number, rowGap: number, callback: Function): Composite; + } + + export interface IConstraintDefinition { + /** + * The first possible `Body` that this constraint is attached to. + * + * @property bodyA + * @type body + * @default null + */ + bodyA?: Body; + + /** + * The second possible `Body` that this constraint is attached to. + * + * @property bodyB + * @type body + * @default null + */ + bodyB?: Body; + + /** + * An integer `Number` uniquely identifying number generated in `Composite.create` by `Common.nextId`. + * + * @property id + * @type number + */ + id?: number; + + /** + * An arbitrary `String` name to help the user identify and manage bodies. + * + * @property label + * @type string + * @default "Constraint" + */ + label?: string; + + /** + * A `Number` that specifies the target resting length of the constraint. + * It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * + * @property length + * @type number + */ + length?: number; + + /** + * A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyA` if defined, otherwise a world-space position. + * + * @property pointA + * @type vector + * @default { x: 0, y: 0 } + */ + pointA?: Vector; + + /** + * A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyA` if defined, otherwise a world-space position. + * + * @property pointB + * @type vector + * @default { x: 0, y: 0 } + */ + pointB?: Vector; + + /** + * An `Object` that defines the rendering properties to be consumed by the module `Matter.Render`. + * + * @property render + * @type object + */ + render?: IConstraintRenderDefinition; + + /** + * A `Number` that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. + * A value of `1` means the constraint should be very stiff. + * A value of `0.2` means the constraint acts like a soft spring. + * + * @property stiffness + * @type number + * @default 1 + */ + stiffness?: number; + + /** + * A `Number` that specifies the damping of the constraint, + * i.e. the amount of resistance applied to each body based on their velocities to limit the amount of oscillation. + * Damping will only be apparent when the constraint also has a very low `stiffness`. + * A value of `0.1` means the constraint will apply heavy damping, resulting in little to no oscillation. + * A value of `0` means the constraint will apply no damping. + * + * @property damping + * @type number + * @default 0 + */ + damping?: number; + + /** + * A `String` denoting the type of object. + * + * @property type + * @type string + * @default "constraint" + */ + type?: string; + } + + export interface IConstraintRenderDefinition { + /** + * A `Number` that defines the line width to use when rendering the constraint outline. + * A value of `0` means no outline will be rendered. + * + * @property render.lineWidth + * @type number + * @default 2 + */ + lineWidth: number; + + /** + * A `String` that defines the stroke style to use when rendering the constraint outline. + * It is the same as when using a canvas, so it accepts CSS style property values. + * + * @property render.strokeStyle + * @type string + * @default a random colour + */ + strokeStyle: string; + + /** + * A flag that indicates if the constraint should be rendered. + * + * @property render.visible + * @type boolean + * @default true + */ + visible: boolean; + } + + + /** + * The `Matter.Constraint` module contains methods for creating and manipulating constraints. + * Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position). + * The stiffness of constraints can be modified to create springs or elastic. + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class Constraint + */ + export class Constraint { + /** + * Creates a new constraint. + * All properties have default values, and many are pre-calculated automatically based on other properties. + * See the properties section below for detailed information on what you can pass via the `options` object. + * @method create + * @param {} options + * @return {constraint} constraint + */ + static create(options: IConstraintDefinition): Constraint; + + /** + * The first possible `Body` that this constraint is attached to. + * + * @property bodyA + * @type body + * @default null + */ + bodyA: Body; + + /** + * The second possible `Body` that this constraint is attached to. + * + * @property bodyB + * @type body + * @default null + */ + bodyB: Body; + + /** + * An integer `Number` uniquely identifying number generated in `Composite.create` by `Common.nextId`. + * + * @property id + * @type number + */ + id: number; + + /** + * An arbitrary `String` name to help the user identify and manage bodies. + * + * @property label + * @type string + * @default "Constraint" + */ + label: string; + + /** + * A `Number` that specifies the target resting length of the constraint. + * It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * + * @property length + * @type number + */ + length: number; + + /** + * A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyA` if defined, otherwise a world-space position. + * + * @property pointA + * @type vector + * @default { x: 0, y: 0 } + */ + pointA: Vector; + + /** + * A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyA` if defined, otherwise a world-space position. + * + * @property pointB + * @type vector + * @default { x: 0, y: 0 } + */ + pointB: Vector; + + /** + * An `Object` that defines the rendering properties to be consumed by the module `Matter.Render`. + * + * @property render + * @type object + */ + render: IConstraintRenderDefinition; + + /** + * A `Number` that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. + * A value of `1` means the constraint should be very stiff. + * A value of `0.2` means the constraint acts like a soft spring. + * + * @property stiffness + * @type number + * @default 1 + */ + stiffness: number; + + /** + * A `Number` that specifies the damping of the constraint, + * i.e. the amount of resistance applied to each body based on their velocities to limit the amount of oscillation. + * Damping will only be apparent when the constraint also has a very low `stiffness`. + * A value of `0.1` means the constraint will apply heavy damping, resulting in little to no oscillation. + * A value of `0` means the constraint will apply no damping. + * + * @property damping + * @type number + * @default 0 + */ + damping: number; + + /** + * A `String` denoting the type of object. + * + * @property type + * @type string + * @default "constraint" + */ + type: string; + } + + + + export interface IEngineDefinition { + /** + * An integer `Number` that specifies the number of position iterations to perform each update. + * The higher the value, the higher quality the simulation will be at the expense of performance. + * + * @property positionIterations + * @type number + * @default 6 + */ + positionIterations?: number; + /** + * An integer `Number` that specifies the number of velocity iterations to perform each update. + * The higher the value, the higher quality the simulation will be at the expense of performance. + * + * @property velocityIterations + * @type number + * @default 4 + */ + velocityIterations?: number; + /** + * An integer `Number` that specifies the number of constraint iterations to perform each update. + * The higher the value, the higher quality the simulation will be at the expense of performance. + * The default value of `2` is usually very adequate. + * + * @property constraintIterations + * @type number + * @default 2 + */ + constraintIterations?: number; + + /** + * A flag that specifies whether the engine should allow sleeping via the `Matter.Sleeping` module. + * Sleeping can improve stability and performance, but often at the expense of accuracy. + * + * @property enableSleeping + * @type boolean + * @default false + */ + enableSleeping?: boolean; + /** + * An `Object` containing properties regarding the timing systems of the engine. + * + * @property timing + * @type object + */ + timing?: IEngineTimingOptions; + /** + * An instance of a broadphase controller. The default value is a `Matter.Grid` instance created by `Engine.create`. + * + * @property broadphase + * @type grid + * @default a Matter.Grid instance + */ + grid?: Grid; + /** + * A `World` composite object that will contain all simulated bodies and constraints. + * + * @property world + * @type world + * @default a Matter.World instance + */ + world?: World; + + } + + export interface IEngineTimingOptions { + /** + * A `Number` that specifies the global scaling factor of time for all bodies. + * A value of `0` freezes the simulation. + * A value of `0.1` gives a slow-motion effect. + * A value of `1.2` gives a speed-up effect. + * + * @property timing.timeScale + * @type number + * @default 1 + */ + timeScale: number; + + /** + * A `Number` that specifies the current simulation-time in milliseconds starting from `0`. + * It is incremented on every `Engine.update` by the given `delta` argument. + * + * @property timing.timestamp + * @type number + * @default 0 + */ + timestamp: number; + } + + /** + * The `Matter.Engine` module contains methods for creating and manipulating engines. + * An engine is a controller that manages updating the simulation of the world. + * See `Matter.Runner` for an optional game loop utility. + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class Engine + */ + export class Engine { + /** + * Clears the engine including the world, pairs and broadphase. + * @method clear + * @param {engine} engine + */ + static clear(engine: Engine): void; + + /** + * Creates a new engine. The options parameter is an object that specifies any properties you wish to override the defaults. + * All properties have default values, and many are pre-calculated automatically based on other properties. + * See the properties section below for detailed information on what you can pass via the `options` object. + * @method create + * @param {HTMLElement} element + * @param {object} [options] + * @return {engine} engine + * @deprecated + */ + static create(element?: HTMLElement | IEngineDefinition, options?: IEngineDefinition): Engine; + + /** + * Creates a new engine. The options parameter is an object that specifies any properties you wish to override the defaults. + * All properties have default values, and many are pre-calculated automatically based on other properties. + * See the properties section below for detailed information on what you can pass via the `options` object. + * @method create + * @param {object} [options] + * @return {engine} engine + * @deprecated + */ + static create(options?: IEngineDefinition): Engine; + + /** + * Merges two engines by keeping the configuration of `engineA` but replacing the world with the one from `engineB`. + * @method merge + * @param {engine} engineA + * @param {engine} engineB + */ + static merge(engineA: Engine, engineB: Engine): void; + + + /** + * Moves the simulation forward in time by `delta` ms. + * The `correction` argument is an optional `Number` that specifies the time correction factor to apply to the update. + * This can help improve the accuracy of the simulation in cases where `delta` is changing between updates. + * The value of `correction` is defined as `delta / lastDelta`, i.e. the percentage change of `delta` over the last step. + * Therefore the value is always `1` (no correction) when `delta` constant (or when no correction is desired, which is the default). + * See the paper on Time Corrected Verlet for more information. + * + * Triggers `beforeUpdate` and `afterUpdate` events. + * Triggers `collisionStart`, `collisionActive` and `collisionEnd` events. + * @method update + * @param {engine} engine + * @param {number} [delta=16.666] + * @param {number} [correction=1] + */ + static update(engine: Engine, delta?: number, correction?: number): Engine; + + /** + * An alias for `Runner.run`, see `Matter.Runner` for more information. + * @method run + * @param {engine} engine + */ + static run(enige: Engine): void; + + /** + * An instance of a broadphase controller. The default value is a `Matter.Grid` instance created by `Engine.create`. + * + * @property broadphase + * @type grid + * @default a Matter.Grid instance + */ + broadphase: Grid; + /** + * An integer `Number` that specifies the number of constraint iterations to perform each update. + * The higher the value, the higher quality the simulation will be at the expense of performance. + * The default value of `2` is usually very adequate. + * + * @property constraintIterations + * @type number + * @default 2 + */ + constraintIterations: number; + + /** + * A flag that specifies whether the engine is running or not. + */ + enabled: boolean; + + /** + * A flag that specifies whether the engine should allow sleeping via the `Matter.Sleeping` module. + * Sleeping can improve stability and performance, but often at the expense of accuracy. + * + * @property enableSleeping + * @type boolean + * @default false + */ + enableSleeping: boolean; + + /** + * Collision pair set for this `Engine`. + */ + pairs: any; + + /** + * An integer `Number` that specifies the number of position iterations to perform each update. + * The higher the value, the higher quality the simulation will be at the expense of performance. + * + * @property positionIterations + * @type number + * @default 6 + */ + positionIterations: number; + + /** + * An instance of a `Render` controller. The default value is a `Matter.Render` instance created by `Engine.create`. + * One may also develop a custom renderer module based on `Matter.Render` and pass an instance of it to `Engine.create` via `options.render`. + * + * A minimal custom renderer object must define at least three functions: `create`, `clear` and `world` (see `Matter.Render`). + * It is also possible to instead pass the _module_ reference via `options.render.controller` and `Engine.create` will instantiate one for you. + * + * @property render + * @type render + * @default a Matter.Render instance + */ + render: Render; + + /** + * An `Object` containing properties regarding the timing systems of the engine. + * + * @property timing + * @type object + */ + timing: IEngineTimingOptions; + + /** + * An integer `Number` that specifies the number of velocity iterations to perform each update. + * The higher the value, the higher quality the simulation will be at the expense of performance. + * + * @property velocityIterations + * @type number + * @default 4 + */ + velocityIterations: number; + + /** + * A `World` composite object that will contain all simulated bodies and constraints. + * + * @property world + * @type world + * @default a Matter.World instance + */ + world: World; + } + + + export interface IGridDefinition { + + } + + /** + * The `Matter.Grid` module contains methods for creating and manipulating collision broadphase grid structures. + * + * @class Grid + */ + export class Grid { + /** + * Creates a new grid. + * @method create + * @param {} options + * @return {grid} A new grid + */ + static create(options?: IGridDefinition): Grid; + + /** + * Updates the grid. + * @method update + * @param {grid} grid + * @param {body[]} bodies + * @param {engine} engine + * @param {boolean} forceUpdate + */ + static update(grid: Grid, bodies: Array, engine: Engine, forceUpdate: boolean): void; + + /** + * Clears the grid. + * @method clear + * @param {grid} grid + */ + static clear(grid: Grid): void; + + } + + export interface IMouseConstraintDefinition { + /** + * The `Constraint` object that is used to move the body during interaction. + * + * @property constraint + * @type constraint + */ + constraint?: Constraint; + + /** + * An `Object` that specifies the collision filter properties. + * The collision filter allows the user to define which types of body this mouse constraint can interact with. + * See `body.collisionFilter` for more information. + * + * @property collisionFilter + * @type object + */ + collisionFilter?: ICollisionFilter; + + /** + * The `Body` that is currently being moved by the user, or `null` if no body. + * + * @property body + * @type body + * @default null + */ + body?: Body; + + /** + * The `Mouse` instance in use. If not supplied in `MouseConstraint.create`, one will be created. + * + * @property mouse + * @type mouse + * @default mouse + */ + mouse?: Mouse; + + /** + * A `String` denoting the type of object. + * + * @property type + * @type string + * @default "constraint" + */ + + type?: string; + } + + /** + * The `Matter.MouseConstraint` module contains methods for creating mouse constraints. + * Mouse constraints are used for allowing user interaction, providing the ability to move bodies via the mouse or touch. + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class MouseConstraint + */ + export class MouseConstraint { + /** + * Creates a new mouse constraint. + * All properties have default values, and many are pre-calculated automatically based on other properties. + * See the properties section below for detailed information on what you can pass via the `options` object. + * @method create + * @param {engine} engine + * @param {} options + * @return {MouseConstraint} A new MouseConstraint + */ + static create(engine: Engine, options?: IMouseConstraintDefinition): MouseConstraint; + + /** + * The `Constraint` object that is used to move the body during interaction. + * + * @property constraint + * @type constraint + */ + constraint: Constraint; + + /** + * An `Object` that specifies the collision filter properties. + * The collision filter allows the user to define which types of body this mouse constraint can interact with. + * See `body.collisionFilter` for more information. + * + * @property collisionFilter + * @type object + */ + collisionFilter: ICollisionFilter; + + /** + * The `Body` that is currently being moved by the user, or `null` if no body. + * + * @property body + * @type body + * @default null + */ + body: Body; + + /** + * The `Mouse` instance in use. If not supplied in `MouseConstraint.create`, one will be created. + * + * @property mouse + * @type mouse + * @default mouse + */ + mouse: Mouse; + + /** + * A `String` denoting the type of object. + * + * @property type + * @type string + * @default "constraint" + */ + + type: string; + } + + /** + * The `Matter.Pairs` module contains methods for creating and manipulating collision pair sets. + * + * @class Pairs + */ + export class Pairs { + /** + * Clears the given pairs structure. + * @method clear + * @param {pairs} pairs + * @return {pairs} pairs + */ + static clear(pairs: any): any; + } + + export interface IPair { + id: number; + bodyA: Body; + bodyB: Body; + contacts: any; + activeContacts: any; + separation: number; + isActive: boolean; + timeCreated: number; + timeUpdated: number, + inverseMass: number; + friction: number; + frictionStatic: number; + restitution: number; + slop: number; + } + + /** + * The `Matter.Query` module contains methods for performing collision queries. + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class Query + */ + export class Query { + /** + * Casts a ray segment against a set of bodies and returns all collisions, ray width is optional. Intersection points are not provided. + * @method ray + * @param {body[]} bodies + * @param {vector} startPoint + * @param {vector} endPoint + * @param {number} [rayWidth] + * @return {object[]} Collisions + */ + static ray(bodies: Array, startPoint: Vector, endPoint: Vector, rayWidth?: number): Array; + + /** + * Returns all bodies whose bounds are inside (or outside if set) the given set of bounds, from the given set of bodies. + * @method region + * @param {body[]} bodies + * @param {bounds} bounds + * @param {bool} [outside=false] + * @return {body[]} The bodies matching the query + */ + static region(bodies: Array, bounds: Bounds, outside?: boolean): Array; + + /** + * Returns all bodies whose vertices contain the given point, from the given set of bodies. + * @method point + * @param {body[]} bodies + * @param {vector} point + * @return {body[]} The bodies matching the query + */ + static point(bodies: Array, point: Vector): Array; + } + + export interface IRenderDefinition { + /** + * A back-reference to the `Matter.Render` module. + * + * @property controller + * @type render + */ + controller?: any; + /** + * A reference to the `Matter.Engine` instance to be used. + * + * @property engine + * @type engine + */ + engine: Engine; + /** + * A reference to the element where the canvas is to be inserted (if `render.canvas` has not been specified) + * + * @property element + * @type HTMLElement + * @default null + * @deprecated + */ + element?: HTMLElement; + /** + * The canvas element to render to. If not specified, one will be created if `render.element` has been specified. + * + * @property canvas + * @type HTMLCanvasElement + * @default null + */ + canvas?: HTMLCanvasElement; + + /** + * The configuration options of the renderer. + * + * @property options + * @type {} + */ + options?: IRendererOptions; + + /** + * A `Bounds` object that specifies the drawing view region. + * Rendering will be automatically transformed and scaled to fit within the canvas size (`render.options.width` and `render.options.height`). + * This allows for creating views that can pan or zoom around the scene. + * You must also set `render.options.hasBounds` to `true` to enable bounded rendering. + * + * @property bounds + * @type bounds + */ + bounds?: Bounds; + + /** + * The 2d rendering context from the `render.canvas` element. + * + * @property context + * @type CanvasRenderingContext2D + */ + context?: CanvasRenderingContext2D; + + /** + * The sprite texture cache. + * + * @property textures + * @type {} + */ + textures?: any; + + + } + + export interface IRendererOptions { + /** + * The target width in pixels of the `render.canvas` to be created. + * + * @property options.width + * @type number + * @default 800 + */ + width?: number; + + /** + * The target height in pixels of the `render.canvas` to be created. + * + * @property options.height + * @type number + * @default 600 + */ + height?: number; + + /** + * A flag that specifies if `render.bounds` should be used when rendering. + * + * @property options.hasBounds + * @type boolean + * @default false + */ + hasBounds?: boolean; + + /** + * Render wireframes only + * @type boolean + * @default true + */ + wireframes?: boolean; + } + + /** + * The `Matter.Render` module is a simple HTML5 canvas based renderer for visualising instances of `Matter.Engine`. + * It is intended for development and debugging purposes, but may also be suitable for simple games. + * It includes a number of drawing options including wireframe, vector with support for sprites and viewports. + * + * @class Render + */ + export class Render { + /** + * Creates a new renderer. The options parameter is an object that specifies any properties you wish to override the defaults. + * All properties have default values, and many are pre-calculated automatically based on other properties. + * See the properties section below for detailed information on what you can pass via the `options` object. + * @method create + * @param {object} [options] + * @return {render} A new renderer + */ + static create(options: IRenderDefinition): Render; + /** + * Continuously updates the render canvas on the `requestAnimationFrame` event. + * @method run + * @param {render} render + */ + static run(render: Render): void; + /** + * Ends execution of `Render.run` on the given `render`, by canceling the animation frame request event loop. + * @method stop + * @param {render} render + */ + static stop(render: Render): void; + /** + * Sets the pixel ratio of the renderer and updates the canvas. + * To automatically detect the correct ratio, pass the string `'auto'` for `pixelRatio`. + * @method setPixelRatio + * @param {render} render + * @param {number} pixelRatio + */ + static setPixelRatio(render: Render, pixelRatio: number): void; + /** + * Renders the given `engine`'s `Matter.World` object. + * This is the entry point for all rendering and should be called every time the scene changes. + * @method world + * @param {engine} engine + */ + static world(render: Render): void; + + /** + * A back-reference to the `Matter.Render` module. + * + * @property controller + * @type render + */ + controller: any; + /** + * A reference to the element where the canvas is to be inserted (if `render.canvas` has not been specified) + * + * @property element + * @type HTMLElement + * @default null + */ + element: HTMLElement; + /** + * The canvas element to render to. If not specified, one will be created if `render.element` has been specified. + * + * @property canvas + * @type HTMLCanvasElement + * @default null + */ + canvas: HTMLCanvasElement; + + /** + * The configuration options of the renderer. + * + * @property options + * @type {} + */ + options: IRendererOptions; + + /** + * A `Bounds` object that specifies the drawing view region. + * Rendering will be automatically transformed and scaled to fit within the canvas size (`render.options.width` and `render.options.height`). + * This allows for creating views that can pan or zoom around the scene. + * You must also set `render.options.hasBounds` to `true` to enable bounded rendering. + * + * @property bounds + * @type bounds + */ + bounds: Bounds; + + /** + * The 2d rendering context from the `render.canvas` element. + * + * @property context + * @type CanvasRenderingContext2D + */ + context: CanvasRenderingContext2D; + + /** + * The sprite texture cache. + * + * @property textures + * @type {} + */ + textures: any; + } + + + + export interface IRunnerOptions { + /** + * A `Boolean` that specifies if the runner should use a fixed timestep (otherwise it is variable). + * If timing is fixed, then the apparent simulation speed will change depending on the frame rate (but behaviour will be deterministic). + * If the timing is variable, then the apparent simulation speed will be constant (approximately, but at the cost of determininism). + * + * @property isFixed + * @type boolean + * @default false + */ + isFixed?: boolean; + + /** + * A `Number` that specifies the time step between updates in milliseconds. + * If `engine.timing.isFixed` is set to `true`, then `delta` is fixed. + * If it is `false`, then `delta` can dynamically change to maintain the correct apparent simulation speed. + * + * @property delta + * @type number + * @default 1000 / 60 + */ + delta?: number; + } + + /** + * The `Matter.Runner` module is an optional utility which provides a game loop, + * that handles updating and rendering a `Matter.Engine` for you within a browser. + * It is intended for demo and testing purposes, but may be adequate for simple games. + * If you are using your own game loop instead, then you do not need the `Matter.Runner` module. + * Instead just call `Engine.update(engine, delta)` in your own loop. + * Note that the method `Engine.run` is an alias for `Runner.run`. + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class Runner + */ + export class Runner { + /** + * Creates a new Runner. The options parameter is an object that specifies any properties you wish to override the defaults. + * @method create + * @param {} options + */ + static create(options:IRunnerOptions): Runner; + /** + * Continuously ticks a `Matter.Engine` by calling `Runner.tick` on the `requestAnimationFrame` event. + * @method run + * @param {engine} engine + */ + static run(runner: Runner, engine: Engine): Runner; + /** + * Continuously ticks a `Matter.Engine` by calling `Runner.tick` on the `requestAnimationFrame` event. + * @method run + * @param {engine} engine + */ + static run(engine: Engine): Runner; + /** + * A game loop utility that updates the engine and renderer by one step (a 'tick'). + * Features delta smoothing, time correction and fixed or dynamic timing. + * Triggers `beforeTick`, `tick` and `afterTick` events on the engine. + * Consider just `Engine.update(engine, delta)` if you're using your own loop. + * @method tick + * @param {runner} runner + * @param {engine} engine + * @param {number} time + */ + static tick(runner: Runner, engine: Engine, time: number): void; + /** + * Ends execution of `Runner.run` on the given `runner`, by canceling the animation frame request event loop. + * If you wish to only temporarily pause the engine, see `engine.enabled` instead. + * @method stop + * @param {runner} runner + */ + static stop(runner: Runner): void; + /** + * Alias for `Runner.run`. + * @method start + * @param {runner} runner + * @param {engine} engine + */ + static start(runner: Runner, engine: Engine): void; + + /** + * A flag that specifies whether the runner is running or not. + * + * @property enabled + * @type boolean + * @default true + */ + enabled: boolean; + + /** + * A `Boolean` that specifies if the runner should use a fixed timestep (otherwise it is variable). + * If timing is fixed, then the apparent simulation speed will change depending on the frame rate (but behaviour will be deterministic). + * If the timing is variable, then the apparent simulation speed will be constant (approximately, but at the cost of determininism). + * + * @property isFixed + * @type boolean + * @default false + */ + isFixed: boolean; + + /** + * A `Number` that specifies the time step between updates in milliseconds. + * If `engine.timing.isFixed` is set to `true`, then `delta` is fixed. + * If it is `false`, then `delta` can dynamically change to maintain the correct apparent simulation speed. + * + * @property delta + * @type number + * @default 1000 / 60 + */ + delta: number; + } + + /** + * The `Matter.Sleeping` module contains methods to manage the sleeping state of bodies. + * + * @class Sleeping + */ + export class Sleeping { + static set(body: Body, isSleeping: boolean): void; + } + + /** + * The `Matter.Svg` module contains methods for converting SVG images into an array of vector points. + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class Svg + */ + export class Svg { + /** + * Converts an SVG path into an array of vector points. + * If the input path forms a concave shape, you must decompose the result into convex parts before use. + * See `Bodies.fromVertices` which provides support for this. + * Note that this function is not guaranteed to support complex paths (such as those with holes). + * @method pathToVertices + * @param {SVGPathElement} path + * @param {Number} [sampleLength=15] + * @return {Vector[]} points + */ + static pathToVertices(path: SVGPathElement, sampleLength: number): Array; + } + + /** + * The `Matter.Vector` module contains methods for creating and manipulating vectors. + * Vectors are the basis of all the geometry related operations in the engine. + * A `Matter.Vector` object is of the form `{ x: 0, y: 0 }`. + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class Vector + */ + export class Vector { + + x: number; + y: number; + + /** + * Creates a new vector. + * @method create + * @param {number} x + * @param {number} y + * @return {vector} A new vector + */ + static create(x?: number, y?: number): Vector; + + /** + * Returns a new vector with `x` and `y` copied from the given `vector`. + * @method clone + * @param {vector} vector + * @return {vector} A new cloned vector + */ + static clone(vector: Vector): Vector; + + + /** + * Returns the cross-product of three vectors. + * @method cross3 + * @param {vector} vectorA + * @param {vector} vectorB + * @param {vector} vectorC + * @return {number} The cross product of the three vectors + */ + static cross3(vectorA: Vector, vectorB: Vector, vectorC: Vector):number; + + /** + * Adds the two vectors. + * @method add + * @param {vector} vectorA + * @param {vector} vectorB + * @param {vector} [output] + * @return {vector} A new vector of vectorA and vectorB added + */ + static add(vectorA: Vector, vectorB: Vector, output?: Vector): Vector; + + /** + * Returns the angle in radians between the two vectors relative to the x-axis. + * @method angle + * @param {vector} vectorA + * @param {vector} vectorB + * @return {number} The angle in radians + */ + static angle(vectorA: Vector, vectorB: Vector): number; + + /** + * Returns the cross-product of two vectors. + * @method cross + * @param {vector} vectorA + * @param {vector} vectorB + * @return {number} The cross product of the two vectors + */ + static cross(vectorA: Vector, vectorB: Vector): number; + + /** + * Divides a vector and a scalar. + * @method div + * @param {vector} vector + * @param {number} scalar + * @return {vector} A new vector divided by scalar + */ + static div(vector: Vector, scalar: number): Vector; + + /** + * Returns the dot-product of two vectors. + * @method dot + * @param {vector} vectorA + * @param {vector} vectorB + * @return {number} The dot product of the two vectors + */ + static dot(vectorA: Vector, vectorB: Vector): Number; + + /** + * Returns the magnitude (length) of a vector. + * @method magnitude + * @param {vector} vector + * @return {number} The magnitude of the vector + */ + static magnitude(vector: Vector): number; + + /** + * Returns the magnitude (length) of a vector (therefore saving a `sqrt` operation). + * @method magnitudeSquared + * @param {vector} vector + * @return {number} The squared magnitude of the vector + */ + static magnitudeSquared(vector: Vector): number; + + /** + * Multiplies a vector and a scalar. + * @method mult + * @param {vector} vector + * @param {number} scalar + * @return {vector} A new vector multiplied by scalar + */ + static mult(vector: Vector, scalar: number): Vector; + + /** + * Negates both components of a vector such that it points in the opposite direction. + * @method neg + * @param {vector} vector + * @return {vector} The negated vector + */ + static neg(vector: Vector): Vector; + + /** + * Normalises a vector (such that its magnitude is `1`). + * @method normalise + * @param {vector} vector + * @return {vector} A new vector normalised + */ + static normalise(vector: Vector): Vector; + + /** + * Returns the perpendicular vector. Set `negate` to true for the perpendicular in the opposite direction. + * @method perp + * @param {vector} vector + * @param {bool} [negate=false] + * @return {vector} The perpendicular vector + */ + static perp(vector: Vector, negate?: boolean): Vector; + + /** + * Rotates the vector about (0, 0) by specified angle. + * @method rotate + * @param {vector} vector + * @param {number} angle + * @return {vector} A new vector rotated about (0, 0) + */ + static rotate(vector: Vector, angle: number): Vector; + + /** + * Rotates the vector about a specified point by specified angle. + * @method rotateAbout + * @param {vector} vector + * @param {number} angle + * @param {vector} point + * @param {vector} [output] + * @return {vector} A new vector rotated about the point + */ + static rotateAbout(vector: Vector, angle: number, point: Vector, output?: Vector): Vector; + + /** + * Subtracts the two vectors. + * @method sub + * @param {vector} vectorA + * @param {vector} vectorB + * @param {vector} [output] + * @return {vector} A new vector of vectorA and vectorB subtracted + */ + static sub(vectorA: Vector, vectorB: Vector, optional?: Vector): Vector; + } + + /** + * The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. + * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. + * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class Vertices + */ + export class Vertices { + /** + * Returns the average (mean) of the set of vertices. + * @method mean + * @param {vertices} vertices + * @return {vector} The average point + */ + static mean(vertices: Array): Array; + + /** + * Sorts the input vertices into clockwise order in place. + * @method clockwiseSort + * @param {vertices} vertices + * @return {vertices} vertices + */ + static clockwiseSort(vertices: Array): Array; + + /** + * Returns true if the vertices form a convex shape (vertices must be in clockwise order). + * @method isConvex + * @param {vertices} vertices + * @return {bool} `true` if the `vertices` are convex, `false` if not (or `null` if not computable). + */ + static isConvex(vertices: Array): boolean; + + /** + * Returns the convex hull of the input vertices as a new array of points. + * @method hull + * @param {vertices} vertices + * @return [vertex] vertices + */ + static hull(vertices: Array): Array; + + /** + * Returns the area of the set of vertices. + * @method area + * @param {vertices} vertices + * @param {bool} signed + * @return {number} The area + */ + static area(vertices: Array, signed: boolean): number; + + /** + * Returns the centre (centroid) of the set of vertices. + * @method centre + * @param {vertices} vertices + * @return {vector} The centre point + */ + static centre(vertices: Array): Vector; + + /** + * Chamfers a set of vertices by giving them rounded corners, returns a new set of vertices. + * The radius parameter is a single number or an array to specify the radius for each vertex. + * @method chamfer + * @param {vertices} vertices + * @param {number[]} radius + * @param {number} quality + * @param {number} qualityMin + * @param {number} qualityMax + */ + static chamfer(vertices: Array, radius: number | Array, quality: number, qualityMin: number, qualityMax: number): void; + + + /** + * Returns `true` if the `point` is inside the set of `vertices`. + * @method contains + * @param {vertices} vertices + * @param {vector} point + * @return {boolean} True if the vertices contains point, otherwise false + */ + static contains(vertices: Array, point: Vector): boolean; + + /** + * Creates a new set of `Matter.Body` compatible vertices. + * The `points` argument accepts an array of `Matter.Vector` points orientated around the origin `(0, 0)`, for example: + * + * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }] + * + * The `Vertices.create` method returns a new array of vertices, which are similar to Matter.Vector objects, + * but with some additional references required for efficient collision detection routines. + * + * Note that the `body` argument is not optional, a `Matter.Body` reference must be provided. + * + * @method create + * @param {vector[]} points + * @param {body} body + */ + static create(points: Array, body: Body): void; + + /** + * Parses a string containing ordered x y pairs separated by spaces (and optionally commas), + * into a `Matter.Vertices` object for the given `Matter.Body`. + * For parsing SVG paths, see `Svg.pathToVertices`. + * @method fromPath + * @param {string} path + * @param {body} body + * @return {vertices} vertices + */ + static fromPath(path: string, body: Body): Array; + + /** + * Returns the moment of inertia (second moment of area) of the set of vertices given the total mass. + * @method inertia + * @param {vertices} vertices + * @param {number} mass + * @return {number} The polygon's moment of inertia + */ + static inertia(vertices: Array, mass: number): number; + + /** + * Rotates the set of vertices in-place. + * @method rotate + * @param {vertices} vertices + * @param {number} angle + * @param {vector} point + */ + static rotate(vertices: Array, angle: number, point: Vector): void; + + /** + * Scales the vertices from a point (default is centre) in-place. + * @method scale + * @param {vertices} vertices + * @param {number} scaleX + * @param {number} scaleY + * @param {vector} point + */ + static scale(vertices: Array, scaleX: number, scaleY: number, point: Vector): void; + + /** + * Translates the set of vertices in-place. + * @method translate + * @param {vertices} vertices + * @param {vector} vector + * @param {number} scalar + */ + static translate(vertices: Array, vector: Vector, scalar: number): void; + } + + interface IWorldDefinition extends ICompositeDefinition { + gravity?: Gravity; + bounds?: Bounds; + } + + interface Gravity extends Vector { + scale: number; + } + + /** + * The `Matter.World` module contains methods for creating and manipulating the world composite. + * A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`. + * A `Matter.World` has a few additional properties including `gravity` and `bounds`. + * It is important to use the functions in the `Matter.Composite` module to modify the world composite, rather than directly modifying its properties. + * There are also a few methods here that alias those in `Matter.Composite` for easier readability. + * + * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + * + * @class World + * @extends Composite + */ + export class World extends Composite { + /** + * Add objects or arrays of objects of types: Body, Constraint, Composite + * @param world + * @param body + * @returns world + */ + static add(world: World, body: Body | Array | Composite | Array | Constraint | Array | MouseConstraint): World; + + /** + * An alias for Composite.addBody since World is also a Composite + * @method addBody + * @param {world} world + * @param {body} body + * @return {world} The original world with the body added + */ + static addBody(world: World, body: Body): World; + + /** + * An alias for Composite.add since World is also a Composite + * @method addComposite + * @param {world} world + * @param {composite} composite + * @return {world} The original world with the objects from composite added + */ + static addComposite(world: World, composite: Composite): World; + + /** + * An alias for Composite.addConstraint since World is also a Composite + * @method addConstraint + * @param {world} world + * @param {constraint} constraint + * @return {world} The original world with the constraint added + */ + static addConstraint(world: World, constraint: Constraint): World; + + /** + * An alias for Composite.clear since World is also a Composite + * @method clear + * @param {world} world + * @param {boolean} keepStatic + */ + static clear(world: World, keepStatic: boolean): void; + + /** + * Creates a new world composite. The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section below for detailed information on what you can pass via the `options` object. + * @method create + * @constructor + * @param {} options + * @return {world} A new world + */ + static create(options: IWorldDefinition): World; + + gravity: Gravity; + bounds: Bounds; + + } + + export interface ICollisionFilter { + category: number; + mask: number; + group: number; + } + + export interface IMousePoint { + x: number; + y: number; + } + + export class Mouse { + static create(element: HTMLElement): Mouse; + static setElement(mouse: Mouse, element: HTMLElement): void; + static clearSourceEvents(mouse: Mouse): void; + static setOffset(mouse: Mouse, offset: Vector): void; + static setScale(mouse: Mouse, scale: Vector): void; + + element: HTMLElement; + absolute: IMousePoint; + position: IMousePoint; + mousedownPosition: IMousePoint; + mouseupPosition: IMousePoint; + offset: IMousePoint; + scale: IMousePoint; + wheelDelta: number; + button: number; + pixelRatio: number; + } + + export interface IEvent { + /** + * The name of the event + */ + name: string; + /** + * The source object of the event + */ + source: T; + } + + export interface IEventComposite extends IEvent { + /** + * EventObjects (may be a single body, constraint, composite or a mixed array of these) + */ + object: any; + } + + export interface IEventTimestamped extends IEvent { + /** + * The engine.timing.timestamp of the event + */ + timestamp: number; + } + + export interface IEventCollision extends IEventTimestamped { + /** + * The collision pair + */ + pairs: Array; + } + + + export class Events { + + /** + * Fired when a body starts sleeping (where `this` is the body). + * + * @event sleepStart + * @this {body} The body that has started sleeping + * @param {} event An event object + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Body, name: "sleepStart", callback: (e: IEvent) => void): void; + /** + * Fired when a body ends sleeping (where `this` is the body). + * + * @event sleepEnd + * @this {body} The body that has ended sleeping + * @param {} event An event object + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Body, name: "sleepEnd", callback: (e: IEvent) => void): void; + + /** + * Fired when a call to `Composite.add` is made, before objects have been added. + * + * @event beforeAdd + * @param {} event An event object + * @param {} event.object The object(s) to be added (may be a single body, constraint, composite or a mixed array of these) + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "beforeAdd", callback: (e: IEventComposite) => void): void; + + /** + * Fired when a call to `Composite.add` is made, after objects have been added. + * + * @event afterAdd + * @param {} event An event object + * @param {} event.object The object(s) that have been added (may be a single body, constraint, composite or a mixed array of these) + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "afterAdd", callback: (e: IEventComposite) => void): void; + + /** + * Fired when a call to `Composite.remove` is made, before objects have been removed. + * + * @event beforeRemove + * @param {} event An event object + * @param {} event.object The object(s) to be removed (may be a single body, constraint, composite or a mixed array of these) + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "beforeRemove", callback: (e: IEventComposite) => void): void; + + /** + * Fired when a call to `Composite.remove` is made, after objects have been removed. + * + * @event afterRemove + * @param {} event An event object + * @param {} event.object The object(s) that have been removed (may be a single body, constraint, composite or a mixed array of these) + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "afterRemove", callback: (e: IEventComposite) => void): void; + + + /** + * Fired after engine update and all collision events + * + * @event afterUpdate + * @param {} event An event object + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "afterUpdate", callback: (e: IEventTimestamped) => void): void; + + /** + * Fired before rendering + * + * @event beforeRender + * @param {} event An event object + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "beforeRender", callback: (e: IEventTimestamped) => void): void; + /** + * Fired after rendering + * + * @event afterRender + * @param {} event An event object + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "afterRender", callback: (e: IEventTimestamped) => void): void; + + + /** + * Fired just before an update + * + * @event beforeUpdate + * @param {} event An event object + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "beforeUpdate", callback: (e: IEventTimestamped) => void): void; + + /** + * Fired after engine update, provides a list of all pairs that are colliding in the current tick (if any) + * + * @event collisionActive + * @param {} event An event object + * @param {} event.pairs List of affected pairs + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "collisionActive", callback: (e: IEventCollision) => void): void; + + + /** + * Fired after engine update, provides a list of all pairs that have ended collision in the current tick (if any) + * + * @event collisionEnd + * @param {} event An event object + * @param {} event.pairs List of affected pairs + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "collisionEnd", callback: (e: IEventCollision) => void): void; + + /** + * Fired after engine update, provides a list of all pairs that have started to collide in the current tick (if any) + * + * @event collisionStart + * @param {} event An event object + * @param {} event.pairs List of affected pairs + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "collisionStart", callback: (e: IEventCollision) => void): void; + + /** + * Fired at the start of a tick, before any updates to the engine or timing + * + * @event beforeTick + * @param {} event An event object + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "beforeTick", callback: (e: IEventTimestamped) => void): void; + + /** + * Fired after engine timing updated, but just before update + * + * @event tick + * @param {} event An event object + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "tick", callback: (e: IEventTimestamped) => void): void; + + /** + * Fired at the end of a tick, after engine update and after rendering + * + * @event afterTick + * @param {} event An event object + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "afterTick", callback: (e: IEventTimestamped) => void): void; + + /** + * Fired before rendering + * + * @event beforeRender + * @param {} event An event object + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "beforeRender", callback: (e: IEventTimestamped) => void): void; + + /** + * Fired after rendering + * + * @event afterRender + * @param {} event An event object + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + static on(obj: Engine, name: "afterRender", callback: (e: IEventTimestamped) => void): void; + + /** + * Fired when the mouse is down (or a touch has started) during the last step + * @param obj + * @param name + * @param callback + */ + static on(obj: MouseConstraint, name: "mousedown", callback: (e: any) => void): void; + + /** + * Fired when the mouse has moved (or a touch moves) during the last step + * @param obj + * @param name + * @param callback + */ + static on(obj: MouseConstraint, name: "mousemove", callback: (e: any) => void): void; + + /** + * Fired when the mouse is up (or a touch has ended) during the last step + * @param obj + * @param name + * @param callback + */ + static on(obj: MouseConstraint, name: "mouseup", callback: (e: any) => void): void; + + + static on(obj: any, name: string, callback: (e: any) => void): void; + + /** + * Removes the given event callback. If no callback, clears all callbacks in eventNames. If no eventNames, clears all events. + * + * @param obj + * @param eventName + * @param callback + */ + static off(obj: any, eventName: string, callback: (e: any) => void): void; + + /** + * Fires all the callbacks subscribed to the given object's eventName, in the order they subscribed, if any. + * + * @param object + * @param eventNames + * @param event + */ + static trigger(object: any, eventNames: string, event?: (e: any) => void): void; + + } + + type Dependency = {name: string, range: string} + | {name: string, version: string} + | string; + + export class Plugin { + name: string; + version: string; + install: () => void; + for?: string; + + /** + * Registers a plugin object so it can be resolved later by name. + * @method register + * @param plugin {} The plugin to register. + * @return {object} The plugin. + */ + static register(plugin: Plugin): Plugin; + + /** + * Resolves a dependency to a plugin object from the registry if it exists. + * The `dependency` may contain a version, but only the name matters when resolving. + * @method resolve + * @param dependency {string} The dependency. + * @return {object} The plugin if resolved, otherwise `undefined`. + */ + static resolve(dependency: string): Plugin | undefined; + + /** + * Returns `true` if the object meets the minimum standard to be considered a plugin. + * This means it must define the following properties: + * - `name` + * - `version` + * - `install` + * @method isPlugin + * @param obj {} The obj to test. + * @return {boolean} `true` if the object can be considered a plugin otherwise `false`. + */ + static isPlugin(obj: {}): boolean; + + /** + * Returns a pretty printed plugin name and version. + * @method toString + * @param plugin {} The plugin. + * @return {string} Pretty printed plugin name and version. + */ + static toString(plugin: string | Plugin): string; + + /** + * Returns `true` if `plugin.for` is applicable to `module` by comparing against `module.name` and `module.version`. + * If `plugin.for` is not specified then it is assumed to be applicable. + * The value of `plugin.for` is a string of the format `'module-name'` or `'module-name@version'`. + * @method isFor + * @param plugin {} The plugin. + * @param module {} The module. + * @return {boolean} `true` if `plugin.for` is applicable to `module`, otherwise `false`. + */ + static isFor(plugin: Plugin, module: {name?: string, [_: string]: any}): boolean; + + /** + * Installs the plugins by calling `plugin.install` on each plugin specified in `plugins` if passed, otherwise `module.uses`. + * For installing plugins on `Matter` see the convenience function `Matter.use`. + * Plugins may be specified either by their name or a reference to the plugin object. + * Plugins themselves may specify further dependencies, but each plugin is installed only once. + * Order is important, a topological sort is performed to find the best resulting order of installation. + * This sorting attempts to satisfy every dependency's requested ordering, but may not be exact in all cases. + * This function logs the resulting status of each dependency in the console, along with any warnings. + * - A green tick ✅ indicates a dependency was resolved and installed. + * - An orange diamond 🔶 indicates a dependency was resolved but a warning was thrown for it or one if its dependencies. + * - A red cross ❌ indicates a dependency could not be resolved. + * Avoid calling this function multiple times on the same module unless you intend to manually control installation order. + * @method use + * @param module {} The module install plugins on. + * @param [plugins=module.uses] {} The plugins to install on module (optional, defaults to `module.uses`). + */ + static use( + module: {uses?: (Plugin | string)[]; [_: string]: any}, + plugins: (Plugin | string)[] + ): void; + + /** + * Recursively finds all of a module's dependencies and returns a flat dependency graph. + * @method dependencies + * @param module {} The module. + * @return {object} A dependency graph. + */ + static dependencies( + module: Dependency, + tracked?: {[_: string]: string[]} + ): {[_: string]: string[]} | string | undefined + + /** + * Parses a dependency string into its components. + * The `dependency` is a string of the format `'module-name'` or `'module-name@version'`. + * See documentation for `Plugin.versionParse` for a description of the format. + * This function can also handle dependencies that are already resolved (e.g. a module object). + * @method dependencyParse + * @param dependency {string} The dependency of the format `'module-name'` or `'module-name@version'`. + * @return {object} The dependency parsed into its components. + */ + static dependencyParse(dependency: Dependency) : {name: string, range: string}; + + /** + * Parses a version string into its components. + * Versions are strictly of the format `x.y.z` (as in [semver](http://semver.org/)). + * Versions may optionally have a prerelease tag in the format `x.y.z-alpha`. + * Ranges are a strict subset of [npm ranges](https://docs.npmjs.com/misc/semver#advanced-range-syntax). + * Only the following range types are supported: + * - Tilde ranges e.g. `~1.2.3` + * - Caret ranges e.g. `^1.2.3` + * - Exact version e.g. `1.2.3` + * - Any version `*` + * @method versionParse + * @param range {string} The version string. + * @return {object} The version range parsed into its components. + */ + static versionParse(range: string) : { + isRange: boolean, + version: string, + range: string, + operator: string + parts: number[], + prerelease: string, + number: number + }; + + /** + * Returns `true` if `version` satisfies the given `range`. + * See documentation for `Plugin.versionParse` for a description of the format. + * If a version or range is not specified, then any version (`*`) is assumed to satisfy. + * @method versionSatisfies + * @param version {string} The version string. + * @param range {string} The range string. + * @return {boolean} `true` if `version` satisfies `range`, otherwise `false`. + */ + static versionSatisfies(version: string, range: string): boolean; + + } +} diff --git a/types/phaser.d.ts b/types/phaser.d.ts index 8eb1194f4..7ee271dd3 100644 --- a/types/phaser.d.ts +++ b/types/phaser.d.ts @@ -2414,7 +2414,7 @@ declare namespace Phaser { * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - shake(duration?: integer, intensity?: number, force?: boolean, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + shake(duration?: integer, intensity?: number | Phaser.Math.Vector2, force?: boolean, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; /** * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, @@ -2699,6 +2699,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -3271,7 +3272,7 @@ declare namespace Phaser { * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - start(duration?: integer, intensity?: number, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraShakeCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + start(duration?: integer, intensity?: number | Phaser.Math.Vector2, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraShakeCallback, context?: any): Phaser.Cameras.Scene2D.Camera; /** * The pre-render step for this effect. Called automatically by the Camera. @@ -3957,7 +3958,7 @@ declare namespace Phaser { * * You can disable the inclusion of the Sound Manager in your build by toggling the webpack `FEATURE_SOUND` flag. */ - sound: Phaser.Sound.BaseSoundManager; + sound: Phaser.Sound.NoAudioSoundManager | Phaser.Sound.HTML5AudioSoundManager | Phaser.Sound.WebAudioSoundManager; /** * An instance of the Time Step. @@ -4523,6 +4524,24 @@ declare namespace Phaser { */ const BOOT: any; + /** + * The Game Context Lost Event. + * + * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Lost event from the browser. + * + * The partner event is `CONTEXT_RESTORED`. + */ + const CONTEXT_LOST: any; + + /** + * The Game Context Restored Event. + * + * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Restored event from the browser. + * + * The partner event is `CONTEXT_LOST`. + */ + const CONTEXT_RESTORED: any; + /** * The Game Destroy Event. * @@ -5050,12 +5069,12 @@ declare namespace Phaser { getEndPoint(out?: Phaser.Math.Vector2): Phaser.Math.Vector2; /** - * [description] + * Get total curve arc length */ getLength(): number; /** - * [description] + * Get list of cumulative segment lengths * @param divisions [description] */ getLengths(divisions?: integer): number[]; @@ -5092,7 +5111,10 @@ declare namespace Phaser { getStartPoint(out?: O): O; /** - * [description] + * Returns a unit vector tangent at t + * In case any sub curve does not implement its tangent derivation, + * 2 points a small delta apart will be used to find its gradient + * which seems to give a reasonable approximation * @param t [description] * @param out [description] */ @@ -5141,7 +5163,7 @@ declare namespace Phaser { * @param yRadius The vertical radius of ellipse. Default 0. * @param startAngle The start angle of the ellipse, in degrees. Default 0. * @param endAngle The end angle of the ellipse, in degrees. Default 360. - * @param clockwise Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) Default false. + * @param clockwise Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). Default false. * @param rotation The rotation of the ellipse, in degrees. Default 0. */ constructor(x?: number | Phaser.Types.Curves.EllipseCurveConfig, y?: number, xRadius?: number, yRadius?: number, startAngle?: integer, endAngle?: integer, clockwise?: boolean, rotation?: integer); @@ -5507,14 +5529,14 @@ declare namespace Phaser { /** * Creates an ellipse curve positioned at the previous end point, using the given parameters. - * @param xRadius The horizontal radius of the ellipse. - * @param yRadius The vertical radius of the ellipse. - * @param startAngle The start angle of the ellipse, in degrees. - * @param endAngle The end angle of the ellipse, in degrees. - * @param clockwise Whether the ellipse should be rotated clockwise (`true`) or counter-clockwise (`false`). - * @param rotation The rotation of the ellipse, in degrees. + * @param xRadius The horizontal radius of ellipse. Default 0. + * @param yRadius The vertical radius of ellipse. Default 0. + * @param startAngle The start angle of the ellipse, in degrees. Default 0. + * @param endAngle The end angle of the ellipse, in degrees. Default 360. + * @param clockwise Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). Default false. + * @param rotation The rotation of the ellipse, in degrees. Default 0. */ - ellipseTo(xRadius: number, yRadius: number, startAngle: number, endAngle: number, clockwise: boolean, rotation: number): Phaser.Curves.Path; + ellipseTo(xRadius?: number, yRadius?: number, startAngle?: integer, endAngle?: integer, clockwise?: boolean, rotation?: number): Phaser.Curves.Path; /** * Creates a Path from a Path Configuration object. @@ -5587,7 +5609,7 @@ declare namespace Phaser { getStartPoint(out?: O): O; /** - * [description] + * Creates a line curve from the previous end point to x/y * @param x [description] * @param y [description] */ @@ -5612,7 +5634,7 @@ declare namespace Phaser { toJSON(): Phaser.Types.Curves.JSONPath; /** - * [description] + * cacheLengths must be recalculated. */ updateArcLengths(): void; @@ -8372,6 +8394,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -8423,7 +8446,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -8432,6 +8456,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -9248,6 +9275,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -9299,7 +9327,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -9308,6 +9337,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -9936,7 +9968,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -9945,6 +9978,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -11416,6 +11452,7 @@ declare namespace Phaser { tintBottomRight: integer; /** * 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. */ tint: integer; /** @@ -11472,7 +11509,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -11480,6 +11518,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -11575,8 +11616,8 @@ declare namespace Phaser { /** * * @param a The Scale X value. Default 1. - * @param b The Shear Y value. Default 0. - * @param c The Shear X value. Default 0. + * @param b The Skew Y value. Default 0. + * @param c The Skew X value. Default 0. * @param d The Scale Y value. Default 1. * @param tx The Translate X value. Default 0. * @param ty The Translate Y value. Default 0. @@ -11599,12 +11640,12 @@ declare namespace Phaser { a: number; /** - * The Shear Y value. + * The Skew Y value. */ b: number; /** - * The Shear X value. + * The Skew X value. */ c: number; @@ -11634,17 +11675,23 @@ declare namespace Phaser { ty: number; /** - * The rotation of the Matrix. + * The rotation of the Matrix. Value is in radians. */ readonly rotation: number; /** - * The horizontal scale of the Matrix. + * The rotation of the Matrix, normalized to be within the Phaser right-handed + * clockwise rotation space. Value is in radians. + */ + readonly rotationNormalized: number; + + /** + * The decomposed horizontal scale of the Matrix. This value is always positive. */ readonly scaleX: number; /** - * The vertical scale of the Matrix. + * The decomposed vertical scale of the Matrix. This value is always positive. */ readonly scaleY: number; @@ -12640,7 +12687,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -12649,6 +12697,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -13525,7 +13576,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -13534,6 +13586,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -14176,6 +14231,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -14227,7 +14283,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -14236,6 +14293,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -14515,10 +14575,10 @@ declare namespace Phaser { * * 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. - * @param key The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. + * @param 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. */ - setData(key: string | object, data: any): this; + setData(key: string | object, data?: any): this; /** * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. @@ -15580,7 +15640,7 @@ declare namespace Phaser { /** * Creates a new Tween object. * - * Note: This method will only be available Tweens have been built into Phaser. + * Note: This method will only be available if Tweens have been built into Phaser. * @param config The Tween configuration. */ tween(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; @@ -16400,7 +16460,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -16409,6 +16470,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -17648,6 +17712,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -17699,7 +17764,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -17708,6 +17774,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -18540,7 +18609,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -18549,6 +18619,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -20211,7 +20284,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -20220,6 +20294,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -21226,6 +21303,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -21277,7 +21355,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -21286,6 +21365,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -22000,7 +22082,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -22009,6 +22092,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -22262,6 +22348,11 @@ declare namespace Phaser { */ gl: WebGLRenderingContext; + /** + * A reference to the WebGLTexture that is being rendered to in a WebGL Context. + */ + readonly glTexture: WebGLTexture; + /** * Sets the size of this Game Object. * @param width The width of this Game Object. @@ -22458,6 +22549,60 @@ declare namespace Phaser { */ drawFrame(key: string, frame?: string | integer, x?: number, y?: number, alpha?: number, tint?: number): this; + /** + * Takes a snapshot of the given area of this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture the whole Render Texture see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param x The x coordinate to grab from. + * @param y The y coordinate to grab from. + * @param width The width of the area to grab. + * @param height The height of the area to grab. + * @param callback The Function to invoke after the snapshot image is created. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshotArea(x: integer, y: integer, width: integer, height: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + + /** + * Takes a snapshot of the whole of this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture just a portion of the Render Texture see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param callback The Function to invoke after the snapshot image is created. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshot(callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + + /** + * Takes a snapshot of the given pixel from this Render Texture. + * + * The snapshot is taken immediately. + * + * To capture the whole Render Texture see the `snapshot` method. To capture a specific portion, see `snapshotArea`. + * + * Unlike the other two snapshot methods, this one will send your callback a `Color` object containing the color data for + * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, + * using less memory, than the other snapshot methods. + * @param x The x coordinate of the pixel to get. + * @param y The y coordinate of the pixel to get. + * @param callback The Function to invoke after the snapshot pixel data is extracted. + */ + snapshotPixel(x: integer, y: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; + /** * Internal destroy handler, called as part of the destroy process. */ @@ -23066,6 +23211,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -23117,7 +23263,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -23126,6 +23273,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -23360,6 +23510,76 @@ declare namespace Phaser { */ pointer: Phaser.Input.Pointer; + /** + * A reference to the GL Frame Buffer this Shader is drawing to. + * This property is only set if you have called `Shader.setRenderToTexture`. + */ + framebuffer: WebGLFramebuffer; + + /** + * A reference to the WebGLTexture this Shader is rendering to. + * This property is only set if you have called `Shader.setRenderToTexture`. + */ + glTexture: WebGLTexture; + + /** + * A flag that indicates if this Shader has been set to render to a texture instead of the display list. + * + * This property is `true` if you have called `Shader.setRenderToTexture`, otherwise it's `false`. + * + * A Shader that is rendering to a texture _does not_ appear on the display list. + */ + readonly renderToTexture: boolean; + + /** + * A reference to the Phaser.Textures.Texture that has been stored in the Texture Manager for this Shader. + * + * This property is only set if you have called `Shader.setRenderToTexture`, otherwise it is `null`. + */ + texture: Phaser.Textures.Texture; + + /** + * 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. + * @param camera The Camera to check against this Game Object. + */ + willRender(camera: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Changes this Shader so instead of rendering to the display list it renders to a + * WebGL Framebuffer and WebGL Texture instead. This allows you to use the output + * of this shader as an input for another shader, by mapping a sampler2D uniform + * to it. + * + * After calling this method the `Shader.framebuffer` and `Shader.glTexture` properties + * are populated. + * + * Additionally, you can provide a key to this method. Doing so will create a Phaser Texture + * from this Shader and save it into the Texture Manager, allowing you to then use it for + * any texture-based Game Object, such as a Sprite or Image: + * + * ```javascript + * var shader = this.add.shader('myShader', x, y, width, height); + * + * shader.setRenderToTexture('doodle'); + * + * this.add.image(400, 300, 'doodle'); + * ``` + * + * Note that it stores an active reference to this Shader. That means as this shader updates, + * so does the texture and any object using it to render with. Also, if you destroy this + * shader, be sure to clear any objects that may have been using it as a texture too. + * + * You can access the Phaser Texture that is created via the `Shader.texture` property. + * + * By default it will create a single base texture. You can add frames to the texture + * by using the `Texture.add` method. After doing this, you can then allow Game Objects + * to use a specific frame from a Render Texture. + * @param key The unique key to store the texture as within the global Texture Manager. + * @param flipY Does this texture need vertically flipping before rendering? This should usually be set to `true` if being fed from a buffer. Default false. + */ + setRenderToTexture(key?: string, flipY?: boolean): this; + /** * Sets the fragment and, optionally, the vertex shader source code that this Shader will use. * This will immediately delete the active shader program, if set, and then create a new one @@ -23389,11 +23609,40 @@ declare namespace Phaser { */ projOrtho(left: number, right: number, bottom: number, top: number): void; + /** + * Sets a sampler2D uniform on this shader where the source texture is a WebGLTexture. + * + * This allows you to feed the output from one Shader into another: + * + * ```javascript + * let shader1 = this.add.shader(baseShader1, 0, 0, 512, 512).setRenderToTexture(); + * let shader2 = this.add.shader(baseShader2, 0, 0, 512, 512).setRenderToTexture('output'); + * + * shader1.setSampler2DBuffer('iChannel0', shader2.glTexture, 512, 512); + * shader2.setSampler2DBuffer('iChannel0', shader1.glTexture, 512, 512); + * ``` + * + * In the above code, the result of baseShader1 is fed into Shader2 as the `iChannel0` sampler2D uniform. + * The result of baseShader2 is then fed back into shader1 again, creating a feedback loop. + * + * If you wish to use an image from the Texture Manager as a sampler2D input for this shader, + * see the `Shader.setSampler2D` method. + * @param uniformKey The key of the sampler2D uniform to be updated, i.e. `iChannel0`. + * @param texture A WebGLTexture reference. + * @param width The width of the texture. + * @param height The height of the texture. + * @param textureIndex The texture index. Default 0. + * @param textureData Additional texture data. + */ + setSampler2DBuffer(uniformKey: string, texture: WebGLTexture, width: integer, height: integer, textureIndex?: integer, textureData?: any): this; + /** * Sets a sampler2D uniform on this shader. * * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * + * If you wish to use another Shader as a sampler2D input for this shader, see the `Shader.setSampler2DBuffer` method. * @param uniformKey The key of the sampler2D uniform to be updated, i.e. `iChannel0`. * @param textureKey The key of the texture, as stored in the Texture Manager. Must already be loaded. * @param textureIndex The texture index. Default 0. @@ -23476,7 +23725,7 @@ declare namespace Phaser { * for flush to be called. * @param matrix2D The transform matrix to use during rendering. */ - load(matrix2D: Phaser.GameObjects.Components.TransformMatrix): void; + load(matrix2D?: Phaser.GameObjects.Components.TransformMatrix): void; /** * Called automatically during render. @@ -23872,7 +24121,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -23881,6 +24131,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -24591,7 +24844,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -24600,6 +24854,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -25263,7 +25520,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -25272,6 +25530,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -25930,7 +26191,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -25939,6 +26201,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -26682,7 +26947,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -26691,6 +26957,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -27401,7 +27670,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -27410,6 +27680,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -28134,7 +28407,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -28143,6 +28417,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -28823,7 +29100,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -28832,6 +29110,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -29493,7 +29774,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -29502,6 +29784,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -30146,7 +30431,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -30155,6 +30441,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -30889,7 +31178,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -30898,6 +31188,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -31585,7 +31878,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -31594,6 +31888,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -32255,7 +32552,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -32264,6 +32562,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -33121,6 +33422,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -33172,7 +33474,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -33181,6 +33484,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -33337,7 +33643,7 @@ declare namespace Phaser { * @param text The text this Text object will display. * @param style The text style configuration object. */ - constructor(scene: Phaser.Scene, x: number, y: number, text: string | string[], style: Phaser.Types.GameObjects.Text.TextSyle); + constructor(scene: Phaser.Scene, x: number, y: number, text: string | string[], style: Phaser.Types.GameObjects.Text.TextStyle); /** * Returns an object containing dimensions of the Text object. @@ -34351,6 +34657,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -34402,7 +34709,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -34411,6 +34719,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -34532,7 +34843,7 @@ declare namespace Phaser { * @param text The Text object that this TextStyle is styling. * @param style The style settings to set. */ - constructor(text: Phaser.GameObjects.Text, style: Phaser.Types.GameObjects.Text.TextSyle); + constructor(text: Phaser.GameObjects.Text, style: Phaser.Types.GameObjects.Text.TextStyle); /** * The Text object that this TextStyle is styling. @@ -34660,7 +34971,7 @@ declare namespace Phaser { * @param updateText Whether to update the text immediately. Default true. * @param setDefaults Use the default values is not set, or the local values. Default false. */ - setStyle(style: Phaser.Types.GameObjects.Text.TextSyle, updateText?: boolean, setDefaults?: boolean): Phaser.GameObjects.Text; + setStyle(style: Phaser.Types.GameObjects.Text.TextStyle, updateText?: boolean, setDefaults?: boolean): Phaser.GameObjects.Text; /** * Synchronize the font settings to the given Canvas Rendering Context. @@ -35680,6 +35991,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -35731,7 +36043,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -35740,6 +36053,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -36220,7 +36536,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -36229,6 +36546,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -36421,6 +36741,12 @@ declare namespace Phaser { */ static Area(circle: Phaser.Geom.Circle): number; + /** + * The geometry constant type of this object: `GEOM_CONST.CIRCLE`. + * Used for fast type comparisons. + */ + readonly type: integer; + /** * The x position of the center of the circle. */ @@ -36627,6 +36953,41 @@ declare namespace Phaser { } + /** + * A Circle Geometry object type. + */ + var CIRCLE: integer; + + /** + * An Ellipse Geometry object type. + */ + var ELLIPSE: integer; + + /** + * A Line Geometry object type. + */ + var LINE: integer; + + /** + * A Point Geometry object type. + */ + var POINT: integer; + + /** + * A Polygon Geometry object type. + */ + var POLYGON: integer; + + /** + * A Rectangle Geometry object type. + */ + var RECTANGLE: integer; + + /** + * A Triangle Geometry object type. + */ + var TRIANGLE: integer; + /** * An Ellipse object. * @@ -36700,6 +37061,12 @@ declare namespace Phaser { */ static CopyFrom(source: Phaser.Geom.Ellipse, dest: O): O; + /** + * The geometry constant type of this object: `GEOM_CONST.ELLIPSE`. + * Used for fast type comparisons. + */ + readonly type: integer; + /** * The x position of the center of the ellipse. */ @@ -37229,6 +37596,12 @@ declare namespace Phaser { */ static Length(line: Phaser.Geom.Line): number; + /** + * The geometry constant type of this object: `GEOM_CONST.LINE`. + * Used for fast type comparisons. + */ + readonly type: integer; + /** * The x coordinate of the lines starting point. */ @@ -37505,6 +37878,12 @@ declare namespace Phaser { */ static Negative(point: Phaser.Geom.Point, out?: O): O; + /** + * The geometry constant type of this object: `GEOM_CONST.POINT`. + * Used for fast type comparisons. + */ + readonly type: integer; + /** * The x coordinate of this Point. */ @@ -37621,6 +38000,12 @@ declare namespace Phaser { */ static Perimeter(polygon: Phaser.Geom.Polygon): number; + /** + * The geometry constant type of this object: `GEOM_CONST.POLYGON`. + * Used for fast type comparisons. + */ + readonly type: integer; + /** * The area of this Polygon. */ @@ -37778,7 +38163,7 @@ declare namespace Phaser { * * Unlike the `FitOutside` function, there may be some space inside the source area not covered. * @param target The target rectangle to adjust. - * @param source The source rectangle to envlope the target in. + * @param source The source rectangle to envelop the target in. */ static FitInside(target: O, source: Phaser.Geom.Rectangle): O; @@ -37843,7 +38228,8 @@ declare namespace Phaser { static GetPoints(rectangle: Phaser.Geom.Rectangle, step: number, quantity: integer, out?: O): O; /** - * [description] + * The size of the Rectangle object, expressed as a Point object + * with the values of the width and height properties. * @param rect [description] * @param out [description] */ @@ -37870,7 +38256,8 @@ declare namespace Phaser { static Intersection(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, out?: Phaser.Geom.Rectangle): O; /** - * [description] + * Return an array of points from the perimeter of the rectangle + * each spaced out based on the quantity or step required * @param rect [description] * @param step [description] * @param quantity [description] @@ -37953,6 +38340,12 @@ declare namespace Phaser { */ static RandomOutside(outer: Phaser.Geom.Rectangle, inner: Phaser.Geom.Rectangle, out?: O): O; + /** + * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. + * Used for fast type comparisons. + */ + readonly type: integer; + /** * The X coordinate of the top left corner of the Rectangle. */ @@ -38329,6 +38722,12 @@ declare namespace Phaser { */ static RotateAroundXY(triangle: O, x: number, y: number, angle: number): O; + /** + * The geometry constant type of this object: `GEOM_CONST.TRIANGLE`. + * Used for fast type comparisons. + */ + readonly type: integer; + /** * `x` coordinate of the first point. */ @@ -40341,6 +40740,43 @@ declare namespace Phaser { */ setHitAreaTriangle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + /** + * Creates an Input Debug Shape for the given Game Object. + * + * The Game Object must have _already_ been enabled for input prior to calling this method. + * + * This is intended to assist you during development and debugging. + * + * Debug Shapes can only be created for Game Objects that are using standard Phaser Geometry for input, + * including: Circle, Ellipse, Line, Polygon, Rectangle and Triangle. + * + * Game Objects that are using their automatic hit areas are using Rectangles by default, so will also work. + * + * The Debug Shape is created and added to the display list and is then kept in sync with the Game Object + * it is connected with. Should you need to modify it yourself, such as to hide it, you can access it via + * the Game Object property: `GameObject.input.hitAreaDebug`. + * + * Calling this method on a Game Object that already has a Debug Shape will first destroy the old shape, + * before creating a new one. If you wish to remove the Debug Shape entirely, you should call the + * method `InputPlugin.removeDebug`. + * + * Note that the debug shape will only show the outline of the input area. If the input test is using a + * pixel perfect check, for example, then this is not displayed. If you are using a custom shape, that + * doesn't extend one of the base Phaser Geometry objects, as your hit area, then this method will not + * work. + * @param gameObject The Game Object to create the input debug shape for. + * @param color The outline color of the debug shape. Default 0x00ff00. + */ + enableDebug(gameObject: Phaser.GameObjects.GameObject, color?: number): Phaser.Input.InputPlugin; + + /** + * Removes an Input Debug Shape from the given Game Object. + * + * The shape is destroyed immediately and the `hitAreaDebug` property is set to `null`. + * @param gameObject The Game Object to remove the input debug shape from. + */ + removeDebug(gameObject: Phaser.GameObjects.GameObject): Phaser.Input.InputPlugin; + /** * Sets the Pointers to always poll. * @@ -42248,11 +42684,17 @@ declare namespace Phaser { /** * The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. */ worldX: number; /** * The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. */ worldY: number; @@ -42341,9 +42783,15 @@ declare namespace Phaser { active: boolean; /** - * Time when this Pointer was most recently updated by a DOM Event. + * Is this pointer Pointer Locked? + * + * Only a mouse pointer can be locked and it only becomes locked when requested via + * the browsers Pointer Lock API. + * + * You can request this by calling the `this.input.mouse.requestPointerLock()` method from + * a `pointerdown` or `pointerup` event handler. */ - time: number; + readonly locked: boolean; /** * The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. @@ -42361,6 +42809,16 @@ declare namespace Phaser { */ deltaZ: number; + /** + * Takes a Camera and updates this Pointer's `worldX` and `worldY` values so they are + * the result of a translation through the given Camera. + * + * Note that the values will be automatically replaced the moment the Pointer is + * updated by an input event, such as a mouse move, so should be used immediately. + * @param camera The Camera which is being tested against. + */ + updateWorldPoint(camera: Phaser.Cameras.Scene2D.Camera): this; + /** * Takes a Camera and returns a Vector2 containing the translated position of this Pointer * within that Camera. This can be used to convert this Pointers position into camera space. @@ -42522,6 +42980,13 @@ declare namespace Phaser { */ y: number; + /** + * Time when this Pointer was most recently updated by a DOM Event. + * This comes directly from the `event.timeStamp` property. + * If no event has yet taken place, it will return zero. + */ + readonly time: number; + } namespace Touch { @@ -48085,6 +48550,19 @@ declare namespace Phaser { } + /** + * Returns a Vec2 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 Vec2 is returned. + * @param index The position within the grid to get the x/y value for. + * @param width The width of the grid. + * @param height The height of the grid. + * @param out An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. + */ + function ToXY(index: integer, width: integer, height: integer, out?: Phaser.Math.Vector2): Phaser.Math.Vector2; + /** * Takes the `x` and `y` coordinates and transforms them into the same space as * defined by the position, rotation and scale values. @@ -50480,6 +50958,10 @@ declare namespace Phaser { * The texture frame of each new Game Object. */ frame?: string | string[] | integer | integer[]; + /** + * The number of Game Objects to create. If set, this overrides the `frameQuantity` value. Use `frameQuantity` for more advanced control. + */ + quantity?: integer; /** * The visible state of each new Game Object. */ @@ -50491,7 +50973,7 @@ declare namespace Phaser { /** * The number of times each `key` × `frame` combination will be *repeated* (after the first combination). */ - repeat?: number; + repeat?: integer; /** * Select a `key` at random. */ @@ -50507,11 +50989,11 @@ declare namespace Phaser { /** * The number of times each `frame` should be combined with one `key`. */ - frameQuantity?: number; + frameQuantity?: integer; /** * The maximum number of new Game Objects to create. 0 is no maximum. */ - max?: number; + max?: integer; setXY?: object; /** * The horizontal position of each new Game Object. @@ -51222,7 +51704,7 @@ declare namespace Phaser { /** * A Text Style configuration object as used by the Text Game Object. */ - type TextSyle = { + type TextStyle = { /** * The font the Text object will render with. This is a Canvas style font string. */ @@ -51681,6 +52163,10 @@ declare namespace Phaser { * The 'contains' check callback that the hit area shape will use for all hit tests. */ hitAreaCallback: Phaser.Types.Input.HitAreaCallback; + /** + * If this Interactive Object has been enabled for debug, via `InputPlugin.enableDebug` then this property holds its debug shape. + */ + hitAreaDebug: Phaser.GameObjects.Shape; /** * Was the hitArea for this Interactive Object created based on texture size (false), or a custom shape? (true) */ @@ -53433,6 +53919,18 @@ declare namespace Phaser { * Is this a snapshot to get a single pixel, or an area? */ getPixel?: boolean; + /** + * Is this snapshot grabbing from a frame buffer or a canvas? + */ + isFramebuffer?: boolean; + /** + * The width of the frame buffer, if a frame buffer grab. + */ + bufferWidth?: integer; + /** + * The height of the frame buffer, if a frame buffer grab. + */ + bufferHeight?: integer; }; } @@ -53442,19 +53940,19 @@ declare namespace Phaser { namespace Scenes { type CreateSceneFromObjectConfig = { /** - * See {@link Phaser.Scene#init}. + * The scene's init callback. */ - init?: Function; + init?: Phaser.Types.Scenes.SceneInitCallback; /** - * See See {@link Phaser.Scene#preload}. + * The scene's preload callback. */ - preload?: Function; + preload?: Phaser.Types.Scenes.ScenePreloadCallback; /** - * See {@link Phaser.Scene#create}. + * The scene's create callback. */ - create?: Function; + create?: Phaser.Types.Scenes.SceneCreateCallback; /** - * See {@link Phaser.Scene#update}. + * The scene's update callback. See {@link Phaser.Scene#update}. */ update?: Function; /** @@ -53467,6 +53965,26 @@ declare namespace Phaser { "extend.data"?: any; }; + /** + * Can be defined on your own Scenes. Use it to create your game objects. + * This method is called by the Scene Manager when the scene starts, after `init()` and `preload()`. + * If the LoaderPlugin started after `preload()`, then this method is called only after loading is complete. + */ + type SceneCreateCallback = (data: object)=>void; + + /** + * Can be defined on your own Scenes. + * This method is called by the Scene Manager when the scene starts, before `preload()` and `create()`. + */ + type SceneInitCallback = (data: object)=>void; + + /** + * Can be defined on your own Scenes. Use it to load assets. + * This method is called by the Scene Manager, after `init()` and before `create()`, only if the Scene has a LoaderPlugin. + * After this method completes, if the LoaderPlugin's queue isn't empty, the LoaderPlugin will start automatically. + */ + type ScenePreloadCallback = ()=>void; + type SceneTransitionConfig = { /** * The Scene key to transition to. @@ -54156,9 +54674,16 @@ declare namespace Phaser { flipY?: boolean; }; - type GetEndCallback = (target: any, key: string, value: number)=>void; + /** + * A Tween Event. + */ + type Event = string; - type GetStartCallback = (target: any, key: string, value: number)=>void; + type GetActiveCallback = (target: any, key: string, value: number, targetIndex: integer, totalTargets: integer, tween: Phaser.Tweens.Tween)=>void; + + type GetEndCallback = (target: any, key: string, value: number, targetIndex: integer, totalTargets: integer, tween: Phaser.Tweens.Tween)=>void; + + type GetStartCallback = (target: any, key: string, value: number, targetIndex: integer, totalTargets: integer, tween: Phaser.Tweens.Tween)=>void; type NumberTweenBuilderConfig = { /** @@ -54303,6 +54828,25 @@ declare namespace Phaser { onYoyoScope?: any; }; + type StaggerConfig = { + /** + * The value to start the stagger from. Can be used as a way to offset the stagger while still using a range for the value. + */ + start?: number; + /** + * An ease to apply across the staggered values. Can either be a string, such as 'sine.inout', or a function. + */ + ease?: string | Function; + /** + * The index to start the stagger from. Can be the strings `first`, `last` or `center`, or an integer representing the stagger position. + */ + from?: string | integer; + /** + * Set the stagger to run across a grid by providing an array where element 0 is the width of the grid and element 1 is the height. Combine with the 'from' property to control direction. + */ + grid?: integer[]; + }; + type TimelineBuilderConfig = { /** * An array of tween configuration objects to create and add into the new Timeline. If this doesn't exist or is empty, the Timeline will start off paused and none of the other configuration settings will be read. If it's a function, it will be called and its return value will be used as the array. @@ -54566,7 +55110,7 @@ declare namespace Phaser { */ onRepeatScope?: any; /** - * A function to call when the tween starts. + * A function to call when the tween starts playback, after any delays have expired. */ onStart?: Phaser.Types.Tweens.TweenOnStartCallback; /** @@ -54601,6 +55145,18 @@ declare namespace Phaser { * Scope (this) for `onYoyo`. */ onYoyoScope?: any; + /** + * A function to call when the tween becomes active within the Tween Manager. + */ + onActive?: Phaser.Types.Tweens.TweenOnActiveCallback; + /** + * Additional parameters to pass to `onActive`. + */ + onActiveParams?: any[]; + /** + * Scope (this) for `onActive`. + */ + onActiveScope?: any; }; type TweenDataConfig = { @@ -54608,18 +55164,26 @@ declare namespace Phaser { * The target to tween. */ target: any; + /** + * The target index within the Tween targets array. + */ + index: integer; /** * The property of the target being tweened. */ key: string; + /** + * If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + */ + getActiveValue: Phaser.Types.Tweens.GetActiveCallback; /** * The returned value sets what the property will be at the END of the Tween. */ - getEndValue: Function; + getEndValue: Phaser.Types.Tweens.GetEndCallback; /** * The returned value sets what the property will be at the START of the Tween. */ - getStartValue: Function; + getStartValue: Phaser.Types.Tweens.GetStartCallback; /** * The ease function this tween uses. */ @@ -54725,6 +55289,8 @@ declare namespace Phaser { repeatDelay: Function; }; + type TweenOnActiveCallback = (tween: Phaser.Tweens.Tween, target: any, ...param: any[])=>void; + type TweenOnCompleteCallback = (tween: Phaser.Tweens.Tween, targets: any[], ...param: any[])=>void; type TweenOnLoopCallback = (tween: Phaser.Tweens.Tween, targets: any[], ...param: any[])=>void; @@ -54742,6 +55308,10 @@ declare namespace Phaser { * What the property will be at the END of the Tween. */ value?: number | string | Phaser.Types.Tweens.GetEndCallback | Phaser.Types.Tweens.TweenPropConfig; + /** + * What the property will be set to immediately when this tween becomes active. + */ + getActive?: Phaser.Types.Tweens.GetActiveCallback; /** * What the property will be at the END of the Tween. */ @@ -55518,6 +56088,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -55569,7 +56140,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -55578,6 +56150,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -56976,6 +57551,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -57027,7 +57603,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -57036,6 +57613,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -61881,6 +62461,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -61932,7 +62513,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -61941,6 +62523,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -63104,6 +63689,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -63155,7 +63741,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -63164,6 +63751,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -64171,6 +64761,9 @@ declare namespace Phaser { } + namespace Matter { + } + namespace Events { type AfterUpdateEvent = { /** @@ -64575,42 +65168,42 @@ declare namespace Phaser { /** * [description] - * @param bodyA [description] - * @param bodyB [description] - * @param length [description] - * @param stiffness [description] Default 1. + * @param bodyA The first possible `Body` that this constraint is attached to. + * @param bodyB The second possible `Body` that this constraint is attached to. + * @param length A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * @param stiffness A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. Default 1. * @param options [description] Default {}. */ - joint(bodyA: MatterJS.Body, bodyB: MatterJS.Body, length: number, stiffness?: number, options?: object): MatterJS.Constraint; + joint(bodyA: MatterJS.Body, bodyB: MatterJS.Body, length?: number, stiffness?: number, options?: object): MatterJS.Constraint; /** * [description] * @param bodyA The first possible `Body` that this constraint is attached to. * @param bodyB The second possible `Body` that this constraint is attached to. - * @param length A Number that specifies the target resting length of the constraint. It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB` + * @param length A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. * @param stiffness A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. Default 1. * @param options [description] Default {}. */ - spring(bodyA: MatterJS.Body, bodyB: MatterJS.Body, length: number, stiffness?: number, options?: object): MatterJS.Constraint; + spring(bodyA: MatterJS.Body, bodyB: MatterJS.Body, length?: number, stiffness?: number, options?: object): MatterJS.Constraint; /** * [description] - * @param bodyA [description] - * @param bodyB [description] - * @param length [description] - * @param stiffness [description] Default 1. + * @param bodyA The first possible `Body` that this constraint is attached to. + * @param bodyB The second possible `Body` that this constraint is attached to. + * @param length A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * @param stiffness A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. Default 1. * @param options [description] Default {}. */ constraint(bodyA: MatterJS.Body, bodyB: MatterJS.Body, length?: number, stiffness?: number, options?: object): MatterJS.Constraint; /** * [description] - * @param bodyB [description] - * @param length [description] - * @param stiffness [description] Default 1. + * @param bodyB The second possible `Body` that this constraint is attached to. + * @param length A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * @param stiffness A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. Default 1. * @param options [description] Default {}. */ - worldConstraint(bodyB: MatterJS.Body, length: number, stiffness?: number, options?: object): MatterJS.Constraint; + worldConstraint(bodyB: MatterJS.Body, length?: number, stiffness?: number, options?: object): MatterJS.Constraint; /** * [description] @@ -65426,6 +66019,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -65477,7 +66071,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -65486,6 +66081,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -66667,6 +67265,7 @@ declare namespace Phaser { /** * 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. */ tint: integer; @@ -66718,7 +67317,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -66727,6 +67327,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -68130,6 +68733,15 @@ declare namespace Phaser { */ registerGameObject(key: string, factoryCallback?: Function, creatorCallback?: Function): void; + /** + * Removes a previously registered Game Object from the global Game Object Factory and / or Creator. + * This is usually called from within your Plugin destruction code to help clean-up after your plugin has been removed. + * @param key The key of the Game Object to be removed from the factories. + * @param removeFromFactory Should the Game Object be removed from the Game Object Factory? Default true. + * @param removeFromCreator Should the Game Object be removed from the Game Object Creator? Default true. + */ + removeGameObject(key: string, removeFromFactory?: boolean, removeFromCreator?: boolean): void; + /** * Registers a new file type with the global File Types Manager, making it available to all Loader * Plugins created after this. @@ -68474,18 +69086,6 @@ declare namespace Phaser { */ resize(width?: number, height?: number): void; - /** - * A NOOP method for handling lost context. Intentionally empty. - * @param callback Ignored parameter. - */ - onContextLost(callback: Function): void; - - /** - * A NOOP method for handling restored context. Intentionally empty. - * @param callback Ignored parameter. - */ - onContextRestored(callback: Function): void; - /** * Resets the transformation matrix of the current context to the identity matrix, thus resetting any transformation. */ @@ -68530,6 +69130,25 @@ declare namespace Phaser { */ postRender(): void; + /** + * Takes a snapshot of the given area of the given canvas. + * + * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render. + * + * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets + * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param canvas The canvas to grab from. + * @param callback The Function to invoke after the snapshot image is created. + * @param getPixel Grab a single pixel as a Color object, or an area as an Image object? Default false. + * @param x The x coordinate to grab from. Default 0. + * @param y The y coordinate to grab from. Default 0. + * @param width The width of the area to grab. Default canvas.width. + * @param height The height of the area to grab. Default canvas.height. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshotCanvas(canvas: HTMLCanvasElement, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, getPixel?: boolean, x?: integer, y?: integer, width?: integer, height?: integer, type?: string, encoderOptions?: number): this; + /** * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. * @@ -69670,16 +70289,6 @@ declare namespace Phaser { */ canvas: HTMLCanvasElement; - /** - * An array of functions to invoke if the WebGL context is lost. - */ - lostContextCallbacks: WebGLContextCallback[]; - - /** - * An array of functions to invoke if the WebGL context is restored. - */ - restoredContextCallbacks: WebGLContextCallback[]; - /** * An array of blend modes supported by the WebGL Renderer. * @@ -69693,7 +70302,7 @@ declare namespace Phaser { nativeTextures: any[]; /** - * Set to `true` if the WebGL context of the renderer is lost. + * This property is set to `true` if the WebGL context of the renderer is lost. */ contextLost: boolean; @@ -69764,6 +70373,18 @@ declare namespace Phaser { */ scissorStack: Uint32Array; + /** + * The handler to invoke when the context is lost. + * This should not be changed and is set in the boot method. + */ + contextLostHandler: Function; + + /** + * The handler to invoke when the context is restored. + * This should not be changed and is set in the boot method. + */ + contextRestoredHandler: Function; + /** * The underlying WebGL context of the renderer. */ @@ -69831,6 +70452,24 @@ declare namespace Phaser { */ glFuncMap: any; + /** + * The `type` of the Game Object being currently rendered. + * This can be used by advanced render functions for batching look-ahead. + */ + currentType: string; + + /** + * Is the `type` of the Game Object being currently rendered different than the + * type of the object before it in the display list? I.e. it's a 'new' type. + */ + newType: boolean; + + /** + * Does the `type` of the next Game Object in the display list match that + * of the object being currently rendered? + */ + nextTypeMatch: boolean; + /** * Creates a new WebGLRenderingContext and initializes all internal state. * @param config The configuration object for the renderer. @@ -69854,20 +70493,6 @@ declare namespace Phaser { */ resize(width?: number, height?: number, resolution?: number): this; - /** - * Adds a callback to be invoked when the WebGL context has been restored by the browser. - * @param callback The callback to be invoked on context restoration. - * @param target The context of the callback. - */ - onContextRestored(callback: WebGLContextCallback, target: object): this; - - /** - * Adds a callback to be invoked when the WebGL context has been lost by the browser. - * @param callback The callback to be invoked on context loss. - * @param target The context of the callback. - */ - onContextLost(callback: WebGLContextCallback, target: object): this; - /** * Checks if a WebGL extension is supported * @param extensionName Name of the WebGL extension @@ -69984,10 +70609,12 @@ declare namespace Phaser { /** * Creates a new custom blend mode for the renderer. + * + * See https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Blending_modes * @param func An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. * @param equation The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. */ - addBlendMode(func: Function, equation: Function): integer; + addBlendMode(func: GLenum[], equation: GLenum): integer; /** * Updates the function bound to a given custom blend mode. @@ -70213,6 +70840,29 @@ declare namespace Phaser { */ snapshotPixel(x: integer, y: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; + /** + * Takes a snapshot of the given area of the given frame buffer. + * + * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param framebuffer The framebuffer to grab from. + * @param bufferWidth The width of the framebuffer. + * @param bufferHeight The height of the framebuffer. + * @param callback The Function to invoke after the snapshot image is created. + * @param getPixel Grab a single pixel as a Color object, or an area as an Image object? Default false. + * @param x The x coordinate to grab from. Default 0. + * @param y The y coordinate to grab from. Default 0. + * @param width The width of the area to grab. Default bufferWidth. + * @param height The height of the area to grab. Default bufferHeight. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshotFramebuffer(framebuffer: WebGLFramebuffer, bufferWidth: integer, bufferHeight: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, getPixel?: boolean, x?: integer, y?: integer, width?: integer, height?: integer, type?: string, encoderOptions?: number): this; + /** * Creates a WebGL Texture based on the given canvas element. * @param srcCanvas The Canvas element that will be used to populate the texture. @@ -70760,6 +71410,11 @@ declare namespace Phaser { */ zoom: number; + /** + * Internal flag set when the game zoom factor is modified. + */ + readonly _resetZoom: boolean; + /** * The scale factor between the baseSize and the canvasBounds. */ @@ -72219,7 +72874,7 @@ declare namespace Phaser { * * In the default set-up you can access this from within a Scene via the `this.sound` property. */ - sound: Phaser.Sound.BaseSoundManager; + sound: Phaser.Sound.NoAudioSoundManager | Phaser.Sound.HTML5AudioSoundManager | Phaser.Sound.WebAudioSoundManager; /** * A reference to the global Texture Manager. @@ -72434,6 +73089,8 @@ declare namespace Phaser { /** * A base Phaser.Scene class which can be extended for your own use. + * + * You can also define the optional methods {@link Phaser.Types.Scenes.SceneInitCallback init()}, {@link Phaser.Types.Scenes.ScenePreloadCallback preload()}, and {@link Phaser.Types.Scenes.SceneCreateCallback create()}. */ class Scene { /** @@ -74635,7 +75292,7 @@ declare namespace Phaser { * @param width The width of the canvas. * @param height The height of the canvas. */ - constructor(manager: Phaser.Textures.CanvasTexture, key: string, source: HTMLCanvasElement, width: integer, height: integer); + constructor(manager: Phaser.Textures.TextureManager, key: string, source: HTMLCanvasElement, width: integer, height: integer); /** * The source Canvas Element. @@ -74763,12 +75420,12 @@ declare namespace Phaser { * * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. - * @param x The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param y The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param width The width of the region to get. Must be an integer. + * @param x The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. Default 0. + * @param y The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. Default 0. + * @param width The width of the region to get. Must be an integer. Defaults to the canvas width if not given. * @param height The height of the region to get. Must be an integer. If not given will be set to the `width`. */ - getPixels(x: integer, y: integer, width: integer, height?: integer): Phaser.Types.Textures.PixelConfig[]; + getPixels(x?: integer, y?: integer, width?: integer, height?: integer): Phaser.Types.Textures.PixelConfig[]; /** * Returns the Image Data index for the given pixel in this CanvasTexture. @@ -75117,7 +75774,7 @@ declare namespace Phaser { clone(): Phaser.Textures.Frame; /** - * Destroys this Frames references. + * Destroys this Frame by nulling its reference to the parent Texture and and data objects. */ destroy(): void; @@ -75249,6 +75906,15 @@ declare namespace Phaser { */ add(name: integer | string, sourceIndex: integer, x: number, y: number, width: number, height: number): Phaser.Textures.Frame; + /** + * Removes the given Frame from this Texture. The Frame is destroyed immediately. + * + * Any Game Objects using this Frame should stop using it _before_ you remove it, + * as it does not happen automatically. + * @param name The key of the Frame to remove. + */ + remove(name: string): boolean; + /** * Checks to see if a Frame matching the given key exists within this Texture. * @param name The key of the Frame to check for. @@ -75402,6 +76068,10 @@ declare namespace Phaser { * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data. * * You can also provide the image type and encoder options. + * + * This will only work with bitmap based texture frames, such as those created from Texture Atlases. + * It will not work with GL Texture objects, such as Shaders, or Render Textures. For those please + * see the WebGL Snapshot function instead. * @param key The unique string-based key of the Texture. * @param frame The string-based name, or integer based index, of the Frame to get from the Texture. * @param type [description] Default 'image/png'. @@ -75417,6 +76087,17 @@ declare namespace Phaser { */ addImage(key: string, source: HTMLImageElement, dataSource?: HTMLImageElement | HTMLCanvasElement): Phaser.Textures.Texture; + /** + * Takes a WebGL Texture and creates a Phaser Texture from it, which is added to the Texture Manager using the given key. + * + * This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites. + * + * This is a WebGL only feature. + * @param key The unique string-based key of the Texture. + * @param glTexture The source Render Texture. + */ + addGLTexture(key: string, glTexture: WebGLTexture): Phaser.Textures.Texture; + /** * Adds a Render Texture to the Texture Manager using the given key. * This allows you to then use the Render Texture as a normal texture for texture based Game Objects like Sprites. @@ -75642,7 +76323,7 @@ declare namespace Phaser { * @param width Optional width of the source image. If not given it's derived from the source itself. * @param height Optional height of the source image. If not given it's derived from the source itself. */ - constructor(texture: Phaser.Textures.Texture, source: HTMLImageElement | HTMLCanvasElement, width?: integer, height?: integer); + constructor(texture: Phaser.Textures.Texture, source: HTMLImageElement | HTMLCanvasElement | Phaser.GameObjects.RenderTexture | WebGLTexture, width?: integer, height?: integer); /** * The Texture this TextureSource belongs to. @@ -75656,9 +76337,9 @@ declare namespace Phaser { /** * The source of the image data. - * This is either an Image Element, a Canvas Element or a RenderTexture. + * This is either an Image Element, a Canvas Element, a RenderTexture or a WebGLTexture. */ - source: HTMLImageElement | HTMLCanvasElement | Phaser.GameObjects.RenderTexture; + source: HTMLImageElement | HTMLCanvasElement | Phaser.GameObjects.RenderTexture | WebGLTexture; /** * The image data. @@ -75704,13 +76385,19 @@ declare namespace Phaser { */ isRenderTexture: boolean; + /** + * Is the source image a WebGLTexture? + */ + isGLTexture: boolean; + /** * Are the source image dimensions a power of two? */ isPowerOf2: boolean; /** - * The WebGL Texture of the source image. + * The WebGL Texture of the source image. If this TextureSource is driven from a WebGLTexture + * already, then this is a reference to that WebGLTexture. */ glTexture: WebGLTexture; @@ -76897,7 +77584,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -76906,6 +77594,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -78568,7 +79259,8 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. * - * Where 0 is to the right, 90 is down, 180 is left. + * 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. */ @@ -78577,6 +79269,9 @@ declare namespace Phaser { /** * The angle of this Game Object in radians. * + * 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 degrees, see the `angle` property instead. */ rotation: number; @@ -80559,7 +81254,7 @@ declare namespace Phaser { /** * Forces the Timer Event to immediately expire, thus scheduling its removal in the next frame. - * @param dispatchCallback If `true` (by default `false`), the function of the Timer Event will be called before its removal from its Clock. + * @param dispatchCallback If `true`, the function of the Timer Event will be called before its removal. Default false. */ remove(dispatchCallback?: boolean): void; @@ -80585,25 +81280,31 @@ declare namespace Phaser { function GetBoolean(source: object, key: string, defaultValue: any): any; /** - * [description] - * @param ease [description] - * @param easeParams [description] + * This internal function is used to return the correct ease function for a Tween. + * + * It can take a variety of input, including an EaseMap based string, or a custom function. + * @param ease The ease to find. This can be either a string from the EaseMap, or a custom function. + * @param easeParams An optional array of ease parameters to go with the ease. */ - function GetEaseFunction(ease: string | Function, easeParams: any[]): Function; + function GetEaseFunction(ease: string | Function, easeParams?: number[]): Function; /** - * [description] - * @param source [description] - * @param key [description] - * @param defaultValue [description] + * Internal function used by the Tween Builder to create a function that will return + * the given value from the source. + * @param source The source object to get the value from. + * @param key The property to get from the source. + * @param defaultValue A default value to return should the source not have the property set. */ - function GetNewValue(source: object, key: string, defaultValue: any): Function; + function GetNewValue(source: any, key: string, defaultValue: any): Function; /** - * [description] - * @param config The configuration object of the tween to get the target(s) from. + * Internal function used by the Tween Builder to return an array of properties + * that the Tween will be operating on. It takes a tween configuration object + * and then checks that none of the `props` entries start with an underscore, or that + * none of the direct properties are on the Reserved list. + * @param config The configuration object of the Tween to get the properties from. */ - function GetProps(config: object): any[]; + function GetProps(config: Phaser.Types.Tweens.TweenBuilderConfig): string[]; /** * Extracts an array of targets from a Tween configuration object. @@ -80614,15 +81315,32 @@ declare namespace Phaser { function GetTargets(config: object): any[]; /** - * Returns an array of all tweens in the given config - * @param config [description] + * Internal function used by the Timeline Builder. + * + * It returns an array of all tweens in the given timeline config. + * @param config The configuration object for the Timeline. */ - function GetTweens(config: object): any[]; + function GetTweens(config: Phaser.Types.Tweens.TimelineBuilderConfig): Phaser.Tweens.Tween[]; /** - * Returns `getStart` and `getEnd` functions for a Tween's Data based on a target property and end value. + * Returns `getActive`, `getStart` and `getEnd` functions for a TweenData based on a target property and end value. * - * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. A string can be provided to specify a relative end value which consists of an operation (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current value, or `/=` to divide the current value) followed by its operand. A function can be provided to allow greater control over the end value; it will receive the target object being tweened, the name of the property being tweened, and the current value of the property as its arguments. If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` property is provided, the property will be used as the effective value under the same rules described here. + * `getActive` if not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * `getEnd` is invoked once any start delays have expired and returns what the value should tween to. + * `getStart` is invoked when the tween reaches the end and needs to either repeat or yoyo, it returns the value to go back to. + * + * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. + * A string can be provided to specify a relative end value which consists of an operation + * (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current + * value, or `/=` to divide the current value) followed by its operand. + * + * A function can be provided to allow greater control over the end value; it will receive the target + * object being tweened, the name of the property being tweened, and the current value of the property + * as its arguments. + * + * If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` + * callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` + * property is provided, the property will be used as the effective value under the same rules described here. * @param key The name of the property to modify. * @param propertyValue The ending value of the property, as described above. */ @@ -80636,6 +81354,43 @@ declare namespace Phaser { */ function NumberTweenBuilder(parent: Phaser.Tweens.TweenManager | Phaser.Tweens.Timeline, config: Phaser.Types.Tweens.NumberTweenBuilderConfig, defaults: Phaser.Types.Tweens.TweenConfigDefaults): Phaser.Tweens.Tween; + /** + * Creates a Stagger function to be used by a Tween property. + * + * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. + * + * This is only worth using if the tween has multiple targets. + * + * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 + * over the duration specified: + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(100) + * }); + * ``` + * + * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering + * from the center out, using a cubic ease. + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' }) + * }); + * ``` + * @param value The amount to stagger by, or an array containing two elements representing the min and max values to stagger between. + * @param config A Stagger Configuration object. + */ + function StaggerBuilder(value: number | number[], config?: Phaser.Types.Tweens.StaggerConfig): Function; + /** * Builds a Timeline of Tweens based on a configuration object. * @param manager The Tween Manager to which the Timeline will belong. @@ -80778,6 +81533,181 @@ declare namespace Phaser { */ const TIMELINE_UPDATE: any; + /** + * The Tween Active Event. + * + * This event is dispatched by a Tween when it becomes active within the Tween Manager. + * + * An 'active' Tween is one that is now progressing, although it may not yet be updating + * any target properties, due to settings such as `delay`. If you need an event for when + * the Tween starts actually updating its first property, see `TWEEN_START`. + * + * Listen to it from a Tween instance using `Tween.on('active', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('active', listener); + * ``` + */ + const TWEEN_ACTIVE: any; + + /** + * The Tween Complete Event. + * + * This event is dispatched by a Tween when it completes playback entirely, factoring in repeats and loops. + * + * If the Tween has been set to loop or repeat infinitely, this event will not be dispatched + * unless the `Tween.stop` method is called. + * + * If a Tween has a `completeDelay` set, this event will fire after that delay expires. + * + * Listen to it from a Tween instance using `Tween.on('complete', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('complete', listener); + * ``` + */ + const TWEEN_COMPLETE: any; + + /** + * The Tween Loop Event. + * + * This event is dispatched by a Tween when it loops. + * + * This event will only be dispatched if the Tween has a loop count set. + * + * If a Tween has a `loopDelay` set, this event will fire after that delay expires. + * + * The difference between `loop` and `repeat` is that `repeat` is a property setting, + * where-as `loop` applies to the entire Tween. + * + * Listen to it from a Tween instance using `Tween.on('loop', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * loop: 6 + * }); + * tween.on('loop', listener); + * ``` + */ + const TWEEN_LOOP: any; + + /** + * The Tween Repeat Event. + * + * This event is dispatched by a Tween when one of the properties it is tweening repeats. + * + * This event will only be dispatched if the Tween has a property with a repeat count set. + * + * If a Tween has a `repeatDelay` set, this event will fire after that delay expires. + * + * The difference between `loop` and `repeat` is that `repeat` is a property setting, + * where-as `loop` applies to the entire Tween. + * + * Listen to it from a Tween instance using `Tween.on('repeat', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * repeat: 4 + * }); + * tween.on('repeat', listener); + * ``` + */ + const TWEEN_REPEAT: any; + + /** + * The Tween Start Event. + * + * This event is dispatched by a Tween when it starts tweening its first property. + * + * A Tween will only emit this event once, as it can only start once. + * + * If a Tween has a `delay` set, this event will fire after that delay expires. + * + * Listen to it from a Tween instance using `Tween.on('start', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000 + * }); + * tween.on('start', listener); + * ``` + */ + const TWEEN_START: any; + + /** + * The Tween Update Event. + * + * This event is dispatched by a Tween every time it updates _any_ of the properties it is tweening. + * + * A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property. + * + * **Note:** This is a very high frequency event and may be dispatched multiple times, every single frame. + * + * Listen to it from a Tween instance using `Tween.on('update', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * }); + * tween.on('update', listener); + * ``` + */ + const TWEEN_UPDATE: any; + + /** + * The Tween Yoyo Event. + * + * This event is dispatched by a Tween whenever a property it is tweening yoyos. + * + * This event will only be dispatched if the Tween has a property with `yoyo` set. + * + * If the Tween has a `hold` value, this event is dispatched when the hold expires. + * + * This event is dispatched for every property, and for every target, that yoyos. + * For example, if a Tween was updating 2 properties and had 10 targets, this event + * would be dispatched 20 times (twice per target). So be careful how you use it! + * + * Listen to it from a Tween instance using `Tween.on('yoyo', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * x: 500, + * ease: 'Power1', + * duration: 3000, + * yoyo: true + * }); + * tween.on('yoyo', listener); + * ``` + */ + const TWEEN_YOYO: any; + } /** @@ -80890,6 +81820,31 @@ declare namespace Phaser { */ totalProgress: number; + /** + * An object containing the different Tween callback functions. + * + * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. + * + * `onComplete` When the Timeline finishes playback fully or `Timeline.stop` is called. Never invoked if timeline is set to repeat infinitely. + * `onLoop` When a Timeline loops. + * `onStart` When the Timeline starts playing. + * `onUpdate` When a Timeline updates a child Tween. + * `onYoyo` When a Timeline starts a yoyo. + */ + callbacks: object; + + /** + * The context in which all callbacks are invoked. + */ + callbackScope: any; + + /** + * Internal method that will emit a Timeline based Event and invoke the given callback. + * @param event The Event to be dispatched. + * @param callback The callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchTimelineEvent(event: Phaser.Types.Tweens.Event, callback: Function): void; + /** * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. * A value of 0.5 runs 50% slower, and so on. @@ -81128,7 +82083,7 @@ declare namespace Phaser { * on a duration and type of ease. They are rarely instantiated directly and instead should be * created via the TweenManager. */ - class Tween { + class Tween extends Phaser.Events.EventEmitter { /** * * @param parent A reference to the parent of this Tween. Either the Tween Manager or a Tween Timeline instance. @@ -81195,6 +82150,25 @@ declare namespace Phaser { */ loopCounter: number; + /** + * Time in ms/frames before the 'onStart' event fires. + * This is the shortest `delay` value across all of the TweenDatas of this Tween. + */ + startDelay: number; + + /** + * Has this Tween started playback yet? + * This boolean is toggled when the Tween leaves the 'delayed' state and starts running. + */ + readonly hasStarted: boolean; + + /** + * Is this Tween currently seeking? + * This boolean is toggled in the `Tween.seek` method. + * When a tween is seeking it will not dispatch any events or callbacks. + */ + readonly isSeeking: boolean; + /** * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = -1 (as it never completes) */ @@ -81256,10 +82230,25 @@ declare namespace Phaser { totalProgress: number; /** - * An object containing the various Tween callback references. + * An object containing the different Tween callback functions. + * + * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. + * + * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. + * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. + * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely. + * `onUpdate` When a TweenData updates a property on a source target during playback. + * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. */ callbacks: object; + /** + * The context in which all callbacks are invoked. + */ + callbackScope: any; + /** * Returns the current value of the Tween. */ @@ -81319,6 +82308,12 @@ declare namespace Phaser { */ init(): boolean; + /** + * Internal method that makes this Tween active within the TweenManager + * and emits the onActive event and callback. + */ + makeActive(): void; + /** * Internal method that advances to the next state of the Tween during playback. */ @@ -81355,19 +82350,44 @@ declare namespace Phaser { resume(): this; /** - * Attempts to seek to a specific position in a Tween. + * Seeks to a specific point in the Tween. + * + * **Note:** You cannot seek a Tween that repeats or loops forever, or that has an unusually long total duration. + * + * The given position is a value between 0 and 1 which represents how far through the Tween to seek to. + * A value of 0.5 would seek to half-way through the Tween, where-as a value of zero would seek to the start. + * + * Note that the seek takes the entire duration of the Tween into account, including delays, loops and repeats. + * For example, a Tween that lasts for 2 seconds, but that loops 3 times, would have a total duration of 6 seconds, + * so seeking to 0.5 would seek to 3 seconds into the Tween, as that's half-way through its _entire_ duration. + * + * Seeking works by resetting the Tween to its initial values and then iterating through the Tween at `delta` + * jumps per step. The longer the Tween, the longer this can take. * @param toPosition A value between 0 and 1 which represents the progress point to seek to. + * @param delta The size of each step when seeking through the Tween. A higher value completes faster but at a cost of less precision. Default 16.6. */ - seek(toPosition: number): this; + seek(toPosition: number, delta?: number): this; /** * Sets an event based callback to be invoked during playback. - * @param type Type of the callback. - * @param callback Callback function. + * + * Calling this method will replace a previously set callback for the given type, if any exists. + * + * The types available are: + * + * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. + * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. + * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely. + * `onUpdate` When a TweenData updates a property on a source target during playback. + * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. + * @param type Type of the callback to set. + * @param callback The function to invoke when this callback happens. * @param params An array of parameters for specified callbacks types. * @param scope The context the callback will be invoked in. */ - setCallback(type: string, callback: Function, params?: any[], scope?: object): this; + setCallback(type: string, callback: Function, params?: any[], scope?: any): this; /** * Flags the Tween as being complete, whatever stage of progress it is at. @@ -81402,6 +82422,21 @@ declare namespace Phaser { */ update(timestamp: number, delta: number): boolean; + /** + * Internal method that will emit a TweenData based Event and invoke the given callback. + * @param event The Event to be dispatched. + * @param callback The callback to be invoked. Can be `null` or `undefined` to skip invocation. + * @param tweenData The TweenData object that caused this event. + */ + dispatchTweenDataEvent(event: Phaser.Types.Tweens.Event, callback: Function, tweenData: Phaser.Types.Tweens.TweenDataConfig): void; + + /** + * Internal method that will emit a Tween based Event and invoke the given callback. + * @param event The Event to be dispatched. + * @param callback The callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchTweenEvent(event: Phaser.Types.Tweens.Event, callback: Function): void; + /** * Internal method used as part of the playback process that sets a tween to play in reverse. * @param tween The Tween to update. @@ -81422,20 +82457,24 @@ declare namespace Phaser { * Internal method that advances the TweenData based on the time value given. * @param tween The Tween to update. * @param tweenData The TweenData property to update. - * @param delta Either a value in ms, or 1 if Tween.useFrames is true + * @param delta Either a value in ms, or 1 if Tween.useFrames is true. */ updateTweenData(tween: Phaser.Tweens.Tween, tweenData: Phaser.Types.Tweens.TweenDataConfig, delta: number): boolean; } /** - * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. + * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. + * A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. * - * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, Tweens should be created using the GameObjectFactory or GameObjectCreator. + * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, + * Tweens should be created using the GameObjectFactory or GameObjectCreator. * @param target The target to tween. + * @param index The target index within the Tween targets array. * @param key The property of the target to tween. * @param getEnd What the property will be at the END of the Tween. * @param getStart What the property will be at the START of the Tween. + * @param getActive If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * @param ease The ease function this tween uses. * @param delay Time in ms/frames before tween will start. * @param duration Duration of the tween in ms/frames. @@ -81446,7 +82485,7 @@ declare namespace Phaser { * @param flipX Should toggleFlipX be called when yoyo or repeat happens? * @param flipY Should toggleFlipY be called when yoyo or repeat happens? */ - function TweenData(target: object, key: string, getEnd: Function, getStart: Function, ease: Function, delay: number, duration: number, yoyo: boolean, hold: number, repeat: number, repeatDelay: number, flipX: boolean, flipY: boolean): Phaser.Types.Tweens.TweenDataConfig; + function TweenData(target: any, index: integer, key: string, getEnd: Function, getStart: Function, getActive: Function, ease: Function, delay: number, duration: number, yoyo: boolean, hold: number, repeat: number, repeatDelay: number, flipX: boolean, flipY: boolean): Phaser.Types.Tweens.TweenDataConfig; /** * The Tween Manager is a default Scene Plugin which controls and updates Tweens and Timelines. @@ -81511,6 +82550,42 @@ declare namespace Phaser { */ addCounter(config: Phaser.Types.Tweens.NumberTweenBuilderConfig): Phaser.Tweens.Tween; + /** + * Creates a Stagger function to be used by a Tween property. + * + * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. + * + * This is only worth using if the tween has multiple targets. + * + * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 + * over the duration specified: + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(100) + * }); + * ``` + * + * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering + * from the center out, using a cubic ease. + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' }) + * }); + * ``` + * @param config The configuration object for the Stagger function. + */ + stagger(config: Phaser.Types.Tweens.StaggerConfig): Function; + /** * Updates the Tween Manager's internal lists at the start of the frame. * @@ -82222,6 +83297,9 @@ declare namespace Phaser { /** * Creates a new Object using all values from obj1 and obj2. * If a value exists in both obj1 and obj2, the value in obj1 is used. + * + * This is only a shallow copy. Deeply nested objects are not cloned, so be sure to only use this + * function on shallow objects. * @param obj1 The first object. * @param obj2 The second object. */ diff --git a/types/spine-canvas.d.ts b/types/spine-canvas.d.ts new file mode 100644 index 000000000..ab2f02355 --- /dev/null +++ b/types/spine-canvas.d.ts @@ -0,0 +1,1280 @@ +declare module spine { + class Animation { + name: string; + timelines: Array; + duration: number; + constructor(name: string, timelines: Array, duration: number); + apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + static binarySearch(values: ArrayLike, target: number, step?: number): number; + static linearSearch(values: ArrayLike, target: number, step: number): number; + } + interface Timeline { + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + getPropertyId(): number; + } + enum MixBlend { + setup = 0, + first = 1, + replace = 2, + add = 3, + } + enum MixDirection { + in = 0, + out = 1, + } + enum TimelineType { + rotate = 0, + translate = 1, + scale = 2, + shear = 3, + attachment = 4, + color = 5, + deform = 6, + event = 7, + drawOrder = 8, + ikConstraint = 9, + transformConstraint = 10, + pathConstraintPosition = 11, + pathConstraintSpacing = 12, + pathConstraintMix = 13, + twoColor = 14, + } + abstract class CurveTimeline implements Timeline { + static LINEAR: number; + static STEPPED: number; + static BEZIER: number; + static BEZIER_SIZE: number; + private curves; + abstract getPropertyId(): number; + constructor(frameCount: number); + getFrameCount(): number; + setLinear(frameIndex: number): void; + setStepped(frameIndex: number): void; + getCurveType(frameIndex: number): number; + setCurve(frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number): void; + getCurvePercent(frameIndex: number, percent: number): number; + abstract apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class RotateTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_ROTATION: number; + static ROTATION: number; + boneIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, degrees: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class TranslateTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_X: number; + static PREV_Y: number; + static X: number; + static Y: number; + boneIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, x: number, y: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class ScaleTimeline extends TranslateTimeline { + constructor(frameCount: number); + getPropertyId(): number; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class ShearTimeline extends TranslateTimeline { + constructor(frameCount: number); + getPropertyId(): number; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class ColorTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_R: number; + static PREV_G: number; + static PREV_B: number; + static PREV_A: number; + static R: number; + static G: number; + static B: number; + static A: number; + slotIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class TwoColorTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_R: number; + static PREV_G: number; + static PREV_B: number; + static PREV_A: number; + static PREV_R2: number; + static PREV_G2: number; + static PREV_B2: number; + static R: number; + static G: number; + static B: number; + static A: number; + static R2: number; + static G2: number; + static B2: number; + slotIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class AttachmentTimeline implements Timeline { + slotIndex: number; + frames: ArrayLike; + attachmentNames: Array; + constructor(frameCount: number); + getPropertyId(): number; + getFrameCount(): number; + setFrame(frameIndex: number, time: number, attachmentName: string): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class DeformTimeline extends CurveTimeline { + slotIndex: number; + attachment: VertexAttachment; + frames: ArrayLike; + frameVertices: Array>; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, vertices: ArrayLike): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class EventTimeline implements Timeline { + frames: ArrayLike; + events: Array; + constructor(frameCount: number); + getPropertyId(): number; + getFrameCount(): number; + setFrame(frameIndex: number, event: Event): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class DrawOrderTimeline implements Timeline { + frames: ArrayLike; + drawOrders: Array>; + constructor(frameCount: number); + getPropertyId(): number; + getFrameCount(): number; + setFrame(frameIndex: number, time: number, drawOrder: Array): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class IkConstraintTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_MIX: number; + static PREV_BEND_DIRECTION: number; + static PREV_COMPRESS: number; + static PREV_STRETCH: number; + static MIX: number; + static BEND_DIRECTION: number; + static COMPRESS: number; + static STRETCH: number; + ikConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, mix: number, bendDirection: number, compress: boolean, stretch: boolean): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class TransformConstraintTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_ROTATE: number; + static PREV_TRANSLATE: number; + static PREV_SCALE: number; + static PREV_SHEAR: number; + static ROTATE: number; + static TRANSLATE: number; + static SCALE: number; + static SHEAR: number; + transformConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class PathConstraintPositionTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_VALUE: number; + static VALUE: number; + pathConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, value: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline { + constructor(frameCount: number); + getPropertyId(): number; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class PathConstraintMixTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_ROTATE: number; + static PREV_TRANSLATE: number; + static ROTATE: number; + static TRANSLATE: number; + pathConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } +} +declare module spine { + class AnimationState { + static emptyAnimation: Animation; + static SUBSEQUENT: number; + static FIRST: number; + static HOLD: number; + static HOLD_MIX: number; + data: AnimationStateData; + tracks: TrackEntry[]; + events: Event[]; + listeners: AnimationStateListener2[]; + queue: EventQueue; + propertyIDs: IntSet; + animationsChanged: boolean; + timeScale: number; + trackEntryPool: Pool; + constructor(data: AnimationStateData); + update(delta: number): void; + updateMixingFrom(to: TrackEntry, delta: number): boolean; + apply(skeleton: Skeleton): boolean; + applyMixingFrom(to: TrackEntry, skeleton: Skeleton, blend: MixBlend): number; + applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, blend: MixBlend, timelinesRotation: Array, i: number, firstFrame: boolean): void; + queueEvents(entry: TrackEntry, animationTime: number): void; + clearTracks(): void; + clearTrack(trackIndex: number): void; + setCurrent(index: number, current: TrackEntry, interrupt: boolean): void; + setAnimation(trackIndex: number, animationName: string, loop: boolean): TrackEntry; + setAnimationWith(trackIndex: number, animation: Animation, loop: boolean): TrackEntry; + addAnimation(trackIndex: number, animationName: string, loop: boolean, delay: number): TrackEntry; + addAnimationWith(trackIndex: number, animation: Animation, loop: boolean, delay: number): TrackEntry; + setEmptyAnimation(trackIndex: number, mixDuration: number): TrackEntry; + addEmptyAnimation(trackIndex: number, mixDuration: number, delay: number): TrackEntry; + setEmptyAnimations(mixDuration: number): void; + expandToIndex(index: number): TrackEntry; + trackEntry(trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry): TrackEntry; + disposeNext(entry: TrackEntry): void; + _animationsChanged(): void; + setTimelineModes(entry: TrackEntry): void; + hasTimeline(entry: TrackEntry, id: number): boolean; + getCurrent(trackIndex: number): TrackEntry; + addListener(listener: AnimationStateListener2): void; + removeListener(listener: AnimationStateListener2): void; + clearListeners(): void; + clearListenerNotifications(): void; + } + class TrackEntry { + animation: Animation; + next: TrackEntry; + mixingFrom: TrackEntry; + mixingTo: TrackEntry; + listener: AnimationStateListener2; + trackIndex: number; + loop: boolean; + holdPrevious: boolean; + eventThreshold: number; + attachmentThreshold: number; + drawOrderThreshold: number; + animationStart: number; + animationEnd: number; + animationLast: number; + nextAnimationLast: number; + delay: number; + trackTime: number; + trackLast: number; + nextTrackLast: number; + trackEnd: number; + timeScale: number; + alpha: number; + mixTime: number; + mixDuration: number; + interruptAlpha: number; + totalAlpha: number; + mixBlend: MixBlend; + timelineMode: number[]; + timelineHoldMix: TrackEntry[]; + timelinesRotation: number[]; + reset(): void; + getAnimationTime(): number; + setAnimationLast(animationLast: number): void; + isComplete(): boolean; + resetRotationDirections(): void; + } + class EventQueue { + objects: Array; + drainDisabled: boolean; + animState: AnimationState; + constructor(animState: AnimationState); + start(entry: TrackEntry): void; + interrupt(entry: TrackEntry): void; + end(entry: TrackEntry): void; + dispose(entry: TrackEntry): void; + complete(entry: TrackEntry): void; + event(entry: TrackEntry, event: Event): void; + drain(): void; + clear(): void; + } + enum EventType { + start = 0, + interrupt = 1, + end = 2, + dispose = 3, + complete = 4, + event = 5, + } + interface AnimationStateListener2 { + start(entry: TrackEntry): void; + interrupt(entry: TrackEntry): void; + end(entry: TrackEntry): void; + dispose(entry: TrackEntry): void; + complete(entry: TrackEntry): void; + event(entry: TrackEntry, event: Event): void; + } + abstract class AnimationStateAdapter2 implements AnimationStateListener2 { + start(entry: TrackEntry): void; + interrupt(entry: TrackEntry): void; + end(entry: TrackEntry): void; + dispose(entry: TrackEntry): void; + complete(entry: TrackEntry): void; + event(entry: TrackEntry, event: Event): void; + } +} +declare module spine { + class AnimationStateData { + skeletonData: SkeletonData; + animationToMixTime: Map; + defaultMix: number; + constructor(skeletonData: SkeletonData); + setMix(fromName: string, toName: string, duration: number): void; + setMixWith(from: Animation, to: Animation, duration: number): void; + getMix(from: Animation, to: Animation): number; + } +} +declare module spine { + class AssetManager implements Disposable { + private pathPrefix; + private textureLoader; + private assets; + private errors; + private toLoad; + private loaded; + constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string); + private static downloadText(url, success, error); + private static downloadBinary(url, success, error); + loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void; + loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void; + loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void; + loadTextureAtlas(path: string, success?: (path: string, atlas: TextureAtlas) => void, error?: (path: string, error: string) => void): void; + get(path: string): any; + remove(path: string): void; + removeAll(): void; + isLoadingComplete(): boolean; + getToLoad(): number; + getLoaded(): number; + dispose(): void; + hasErrors(): boolean; + getErrors(): Map; + } +} +declare module spine { + class AtlasAttachmentLoader implements AttachmentLoader { + atlas: TextureAtlas; + constructor(atlas: TextureAtlas); + newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment; + newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment; + newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment; + newPathAttachment(skin: Skin, name: string): PathAttachment; + newPointAttachment(skin: Skin, name: string): PointAttachment; + newClippingAttachment(skin: Skin, name: string): ClippingAttachment; + } +} +declare module spine { + enum BlendMode { + Normal = 0, + Additive = 1, + Multiply = 2, + Screen = 3, + } +} +declare module spine { + class Bone implements Updatable { + data: BoneData; + skeleton: Skeleton; + parent: Bone; + children: Bone[]; + x: number; + y: number; + rotation: number; + scaleX: number; + scaleY: number; + shearX: number; + shearY: number; + ax: number; + ay: number; + arotation: number; + ascaleX: number; + ascaleY: number; + ashearX: number; + ashearY: number; + appliedValid: boolean; + a: number; + b: number; + worldX: number; + c: number; + d: number; + worldY: number; + sorted: boolean; + constructor(data: BoneData, skeleton: Skeleton, parent: Bone); + update(): void; + updateWorldTransform(): void; + updateWorldTransformWith(x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number): void; + setToSetupPose(): void; + getWorldRotationX(): number; + getWorldRotationY(): number; + getWorldScaleX(): number; + getWorldScaleY(): number; + updateAppliedTransform(): void; + worldToLocal(world: Vector2): Vector2; + localToWorld(local: Vector2): Vector2; + worldToLocalRotation(worldRotation: number): number; + localToWorldRotation(localRotation: number): number; + rotateWorld(degrees: number): void; + } +} +declare module spine { + class BoneData { + index: number; + name: string; + parent: BoneData; + length: number; + x: number; + y: number; + rotation: number; + scaleX: number; + scaleY: number; + shearX: number; + shearY: number; + transformMode: TransformMode; + constructor(index: number, name: string, parent: BoneData); + } + enum TransformMode { + Normal = 0, + OnlyTranslation = 1, + NoRotationOrReflection = 2, + NoScale = 3, + NoScaleOrReflection = 4, + } +} +declare module spine { + interface Constraint extends Updatable { + getOrder(): number; + } +} +declare module spine { + class Event { + data: EventData; + intValue: number; + floatValue: number; + stringValue: string; + time: number; + volume: number; + balance: number; + constructor(time: number, data: EventData); + } +} +declare module spine { + class EventData { + name: string; + intValue: number; + floatValue: number; + stringValue: string; + audioPath: string; + volume: number; + balance: number; + constructor(name: string); + } +} +declare module spine { + class IkConstraint implements Constraint { + data: IkConstraintData; + bones: Array; + target: Bone; + bendDirection: number; + compress: boolean; + stretch: boolean; + mix: number; + constructor(data: IkConstraintData, skeleton: Skeleton); + getOrder(): number; + apply(): void; + update(): void; + apply1(bone: Bone, targetX: number, targetY: number, compress: boolean, stretch: boolean, uniform: boolean, alpha: number): void; + apply2(parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, stretch: boolean, alpha: number): void; + } +} +declare module spine { + class IkConstraintData { + name: string; + order: number; + bones: BoneData[]; + target: BoneData; + bendDirection: number; + compress: boolean; + stretch: boolean; + uniform: boolean; + mix: number; + constructor(name: string); + } +} +declare module spine { + class PathConstraint implements Constraint { + static NONE: number; + static BEFORE: number; + static AFTER: number; + static epsilon: number; + data: PathConstraintData; + bones: Array; + target: Slot; + position: number; + spacing: number; + rotateMix: number; + translateMix: number; + spaces: number[]; + positions: number[]; + world: number[]; + curves: number[]; + lengths: number[]; + segments: number[]; + constructor(data: PathConstraintData, skeleton: Skeleton); + apply(): void; + update(): void; + computeWorldPositions(path: PathAttachment, spacesCount: number, tangents: boolean, percentPosition: boolean, percentSpacing: boolean): number[]; + addBeforePosition(p: number, temp: Array, i: number, out: Array, o: number): void; + addAfterPosition(p: number, temp: Array, i: number, out: Array, o: number): void; + addCurvePosition(p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, out: Array, o: number, tangents: boolean): void; + getOrder(): number; + } +} +declare module spine { + class PathConstraintData { + name: string; + order: number; + bones: BoneData[]; + target: SlotData; + positionMode: PositionMode; + spacingMode: SpacingMode; + rotateMode: RotateMode; + offsetRotation: number; + position: number; + spacing: number; + rotateMix: number; + translateMix: number; + constructor(name: string); + } + enum PositionMode { + Fixed = 0, + Percent = 1, + } + enum SpacingMode { + Length = 0, + Fixed = 1, + Percent = 2, + } + enum RotateMode { + Tangent = 0, + Chain = 1, + ChainScale = 2, + } +} +declare module spine { + class SharedAssetManager implements Disposable { + private pathPrefix; + private clientAssets; + private queuedAssets; + private rawAssets; + private errors; + constructor(pathPrefix?: string); + private queueAsset(clientId, textureLoader, path); + loadText(clientId: string, path: string): void; + loadJson(clientId: string, path: string): void; + loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void; + get(clientId: string, path: string): any; + private updateClientAssets(clientAssets); + isLoadingComplete(clientId: string): boolean; + dispose(): void; + hasErrors(): boolean; + getErrors(): Map; + } +} +declare module spine { + class Skeleton { + data: SkeletonData; + bones: Array; + slots: Array; + drawOrder: Array; + ikConstraints: Array; + transformConstraints: Array; + pathConstraints: Array; + _updateCache: Updatable[]; + updateCacheReset: Updatable[]; + skin: Skin; + color: Color; + time: number; + scaleX: number; + scaleY: number; + x: number; + y: number; + constructor(data: SkeletonData); + updateCache(): void; + sortIkConstraint(constraint: IkConstraint): void; + sortPathConstraint(constraint: PathConstraint): void; + sortTransformConstraint(constraint: TransformConstraint): void; + sortPathConstraintAttachment(skin: Skin, slotIndex: number, slotBone: Bone): void; + sortPathConstraintAttachmentWith(attachment: Attachment, slotBone: Bone): void; + sortBone(bone: Bone): void; + sortReset(bones: Array): void; + updateWorldTransform(): void; + setToSetupPose(): void; + setBonesToSetupPose(): void; + setSlotsToSetupPose(): void; + getRootBone(): Bone; + findBone(boneName: string): Bone; + findBoneIndex(boneName: string): number; + findSlot(slotName: string): Slot; + findSlotIndex(slotName: string): number; + setSkinByName(skinName: string): void; + setSkin(newSkin: Skin): void; + getAttachmentByName(slotName: string, attachmentName: string): Attachment; + getAttachment(slotIndex: number, attachmentName: string): Attachment; + setAttachment(slotName: string, attachmentName: string): void; + findIkConstraint(constraintName: string): IkConstraint; + findTransformConstraint(constraintName: string): TransformConstraint; + findPathConstraint(constraintName: string): PathConstraint; + getBounds(offset: Vector2, size: Vector2, temp?: Array): void; + update(delta: number): void; + } +} +declare module spine { + class SkeletonBounds { + minX: number; + minY: number; + maxX: number; + maxY: number; + boundingBoxes: BoundingBoxAttachment[]; + polygons: ArrayLike[]; + private polygonPool; + update(skeleton: Skeleton, updateAabb: boolean): void; + aabbCompute(): void; + aabbContainsPoint(x: number, y: number): boolean; + aabbIntersectsSegment(x1: number, y1: number, x2: number, y2: number): boolean; + aabbIntersectsSkeleton(bounds: SkeletonBounds): boolean; + containsPoint(x: number, y: number): BoundingBoxAttachment; + containsPointPolygon(polygon: ArrayLike, x: number, y: number): boolean; + intersectsSegment(x1: number, y1: number, x2: number, y2: number): BoundingBoxAttachment; + intersectsSegmentPolygon(polygon: ArrayLike, x1: number, y1: number, x2: number, y2: number): boolean; + getPolygon(boundingBox: BoundingBoxAttachment): ArrayLike; + getWidth(): number; + getHeight(): number; + } +} +declare module spine { + class SkeletonClipping { + private triangulator; + private clippingPolygon; + private clipOutput; + clippedVertices: number[]; + clippedTriangles: number[]; + private scratch; + private clipAttachment; + private clippingPolygons; + clipStart(slot: Slot, clip: ClippingAttachment): number; + clipEndWithSlot(slot: Slot): void; + clipEnd(): void; + isClipping(): boolean; + clipTriangles(vertices: ArrayLike, verticesLength: number, triangles: ArrayLike, trianglesLength: number, uvs: ArrayLike, light: Color, dark: Color, twoColor: boolean): void; + clip(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, clippingArea: Array, output: Array): boolean; + static makeClockwise(polygon: ArrayLike): void; + } +} +declare module spine { + class SkeletonData { + name: string; + bones: BoneData[]; + slots: SlotData[]; + skins: Skin[]; + defaultSkin: Skin; + events: EventData[]; + animations: Animation[]; + ikConstraints: IkConstraintData[]; + transformConstraints: TransformConstraintData[]; + pathConstraints: PathConstraintData[]; + width: number; + height: number; + version: string; + hash: string; + fps: number; + imagesPath: string; + findBone(boneName: string): BoneData; + findBoneIndex(boneName: string): number; + findSlot(slotName: string): SlotData; + findSlotIndex(slotName: string): number; + findSkin(skinName: string): Skin; + findEvent(eventDataName: string): EventData; + findAnimation(animationName: string): Animation; + findIkConstraint(constraintName: string): IkConstraintData; + findTransformConstraint(constraintName: string): TransformConstraintData; + findPathConstraint(constraintName: string): PathConstraintData; + findPathConstraintIndex(pathConstraintName: string): number; + } +} +declare module spine { + class SkeletonJson { + attachmentLoader: AttachmentLoader; + scale: number; + private linkedMeshes; + constructor(attachmentLoader: AttachmentLoader); + readSkeletonData(json: string | any): SkeletonData; + readAttachment(map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment; + readVertices(map: any, attachment: VertexAttachment, verticesLength: number): void; + readAnimation(map: any, name: string, skeletonData: SkeletonData): void; + readCurve(map: any, timeline: CurveTimeline, frameIndex: number): void; + getValue(map: any, prop: string, defaultValue: any): any; + static blendModeFromString(str: string): BlendMode; + static positionModeFromString(str: string): PositionMode; + static spacingModeFromString(str: string): SpacingMode; + static rotateModeFromString(str: string): RotateMode; + static transformModeFromString(str: string): TransformMode; + } +} +declare module spine { + class Skin { + name: string; + attachments: Map[]; + constructor(name: string); + addAttachment(slotIndex: number, name: string, attachment: Attachment): void; + getAttachment(slotIndex: number, name: string): Attachment; + attachAll(skeleton: Skeleton, oldSkin: Skin): void; + } +} +declare module spine { + class Slot { + data: SlotData; + bone: Bone; + color: Color; + darkColor: Color; + private attachment; + private attachmentTime; + attachmentVertices: number[]; + constructor(data: SlotData, bone: Bone); + getAttachment(): Attachment; + setAttachment(attachment: Attachment): void; + setAttachmentTime(time: number): void; + getAttachmentTime(): number; + setToSetupPose(): void; + } +} +declare module spine { + class SlotData { + index: number; + name: string; + boneData: BoneData; + color: Color; + darkColor: Color; + attachmentName: string; + blendMode: BlendMode; + constructor(index: number, name: string, boneData: BoneData); + } +} +declare module spine { + abstract class Texture { + protected _image: HTMLImageElement; + constructor(image: HTMLImageElement); + getImage(): HTMLImageElement; + abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; + abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; + abstract dispose(): void; + static filterFromString(text: string): TextureFilter; + static wrapFromString(text: string): TextureWrap; + } + enum TextureFilter { + Nearest = 9728, + Linear = 9729, + MipMap = 9987, + MipMapNearestNearest = 9984, + MipMapLinearNearest = 9985, + MipMapNearestLinear = 9986, + MipMapLinearLinear = 9987, + } + enum TextureWrap { + MirroredRepeat = 33648, + ClampToEdge = 33071, + Repeat = 10497, + } + class TextureRegion { + renderObject: any; + u: number; + v: number; + u2: number; + v2: number; + width: number; + height: number; + rotate: boolean; + offsetX: number; + offsetY: number; + originalWidth: number; + originalHeight: number; + } + class FakeTexture extends Texture { + setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; + setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; + dispose(): void; + } +} +declare module spine { + class TextureAtlas implements Disposable { + pages: TextureAtlasPage[]; + regions: TextureAtlasRegion[]; + constructor(atlasText: string, textureLoader: (path: string) => any); + private load(atlasText, textureLoader); + findRegion(name: string): TextureAtlasRegion; + dispose(): void; + } + class TextureAtlasPage { + name: string; + minFilter: TextureFilter; + magFilter: TextureFilter; + uWrap: TextureWrap; + vWrap: TextureWrap; + texture: Texture; + width: number; + height: number; + } + class TextureAtlasRegion extends TextureRegion { + page: TextureAtlasPage; + name: string; + x: number; + y: number; + index: number; + rotate: boolean; + texture: Texture; + } +} +declare module spine { + class TransformConstraint implements Constraint { + data: TransformConstraintData; + bones: Array; + target: Bone; + rotateMix: number; + translateMix: number; + scaleMix: number; + shearMix: number; + temp: Vector2; + constructor(data: TransformConstraintData, skeleton: Skeleton); + apply(): void; + update(): void; + applyAbsoluteWorld(): void; + applyRelativeWorld(): void; + applyAbsoluteLocal(): void; + applyRelativeLocal(): void; + getOrder(): number; + } +} +declare module spine { + class TransformConstraintData { + name: string; + order: number; + bones: BoneData[]; + target: BoneData; + rotateMix: number; + translateMix: number; + scaleMix: number; + shearMix: number; + offsetRotation: number; + offsetX: number; + offsetY: number; + offsetScaleX: number; + offsetScaleY: number; + offsetShearY: number; + relative: boolean; + local: boolean; + constructor(name: string); + } +} +declare module spine { + class Triangulator { + private convexPolygons; + private convexPolygonsIndices; + private indicesArray; + private isConcaveArray; + private triangles; + private polygonPool; + private polygonIndicesPool; + triangulate(verticesArray: ArrayLike): Array; + decompose(verticesArray: Array, triangles: Array): Array>; + private static isConcave(index, vertexCount, vertices, indices); + private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y); + private static winding(p1x, p1y, p2x, p2y, p3x, p3y); + } +} +declare module spine { + interface Updatable { + update(): void; + } +} +declare module spine { + interface Map { + [key: string]: T; + } + class IntSet { + array: number[]; + add(value: number): boolean; + contains(value: number): boolean; + remove(value: number): void; + clear(): void; + } + interface Disposable { + dispose(): void; + } + interface Restorable { + restore(): void; + } + class Color { + r: number; + g: number; + b: number; + a: number; + static WHITE: Color; + static RED: Color; + static GREEN: Color; + static BLUE: Color; + static MAGENTA: Color; + constructor(r?: number, g?: number, b?: number, a?: number); + set(r: number, g: number, b: number, a: number): this; + setFromColor(c: Color): this; + setFromString(hex: string): this; + add(r: number, g: number, b: number, a: number): this; + clamp(): this; + } + class MathUtils { + static PI: number; + static PI2: number; + static radiansToDegrees: number; + static radDeg: number; + static degreesToRadians: number; + static degRad: number; + static clamp(value: number, min: number, max: number): number; + static cosDeg(degrees: number): number; + static sinDeg(degrees: number): number; + static signum(value: number): number; + static toInt(x: number): number; + static cbrt(x: number): number; + static randomTriangular(min: number, max: number): number; + static randomTriangularWith(min: number, max: number, mode: number): number; + } + abstract class Interpolation { + protected abstract applyInternal(a: number): number; + apply(start: number, end: number, a: number): number; + } + class Pow extends Interpolation { + protected power: number; + constructor(power: number); + applyInternal(a: number): number; + } + class PowOut extends Pow { + constructor(power: number); + applyInternal(a: number): number; + } + class Utils { + static SUPPORTS_TYPED_ARRAYS: boolean; + static arrayCopy(source: ArrayLike, sourceStart: number, dest: ArrayLike, destStart: number, numElements: number): void; + static setArraySize(array: Array, size: number, value?: any): Array; + static ensureArrayCapacity(array: Array, size: number, value?: any): Array; + static newArray(size: number, defaultValue: T): Array; + static newFloatArray(size: number): ArrayLike; + static newShortArray(size: number): ArrayLike; + static toFloatArray(array: Array): number[] | Float32Array; + static toSinglePrecision(value: number): number; + static webkit602BugfixHelper(alpha: number, blend: MixBlend): void; + } + class DebugUtils { + static logBones(skeleton: Skeleton): void; + } + class Pool { + private items; + private instantiator; + constructor(instantiator: () => T); + obtain(): T; + free(item: T): void; + freeAll(items: ArrayLike): void; + clear(): void; + } + class Vector2 { + x: number; + y: number; + constructor(x?: number, y?: number); + set(x: number, y: number): Vector2; + length(): number; + normalize(): this; + } + class TimeKeeper { + maxDelta: number; + framesPerSecond: number; + delta: number; + totalTime: number; + private lastTime; + private frameCount; + private frameTime; + update(): void; + } + interface ArrayLike { + length: number; + [n: number]: T; + } + class WindowedMean { + values: Array; + addedValues: number; + lastValue: number; + mean: number; + dirty: boolean; + constructor(windowSize?: number); + hasEnoughData(): boolean; + addValue(value: number): void; + getMean(): number; + } +} +declare module spine { + interface VertexEffect { + begin(skeleton: Skeleton): void; + transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void; + end(): void; + } +} +interface Math { + fround(n: number): number; +} +declare module spine { + abstract class Attachment { + name: string; + constructor(name: string); + } + abstract class VertexAttachment extends Attachment { + private static nextID; + id: number; + bones: Array; + vertices: ArrayLike; + worldVerticesLength: number; + constructor(name: string); + computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike, offset: number, stride: number): void; + applyDeform(sourceAttachment: VertexAttachment): boolean; + } +} +declare module spine { + interface AttachmentLoader { + newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment; + newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment; + newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment; + newPathAttachment(skin: Skin, name: string): PathAttachment; + newPointAttachment(skin: Skin, name: string): PointAttachment; + newClippingAttachment(skin: Skin, name: string): ClippingAttachment; + } +} +declare module spine { + enum AttachmentType { + Region = 0, + BoundingBox = 1, + Mesh = 2, + LinkedMesh = 3, + Path = 4, + Point = 5, + } +} +declare module spine { + class BoundingBoxAttachment extends VertexAttachment { + color: Color; + constructor(name: string); + } +} +declare module spine { + class ClippingAttachment extends VertexAttachment { + endSlot: SlotData; + color: Color; + constructor(name: string); + } +} +declare module spine { + class MeshAttachment extends VertexAttachment { + region: TextureRegion; + path: string; + regionUVs: ArrayLike; + uvs: ArrayLike; + triangles: Array; + color: Color; + hullLength: number; + private parentMesh; + inheritDeform: boolean; + tempColor: Color; + constructor(name: string); + updateUVs(): void; + applyDeform(sourceAttachment: VertexAttachment): boolean; + getParentMesh(): MeshAttachment; + setParentMesh(parentMesh: MeshAttachment): void; + } +} +declare module spine { + class PathAttachment extends VertexAttachment { + lengths: Array; + closed: boolean; + constantSpeed: boolean; + color: Color; + constructor(name: string); + } +} +declare module spine { + class PointAttachment extends VertexAttachment { + x: number; + y: number; + rotation: number; + color: Color; + constructor(name: string); + computeWorldPosition(bone: Bone, point: Vector2): Vector2; + computeWorldRotation(bone: Bone): number; + } +} +declare module spine { + class RegionAttachment extends Attachment { + static OX1: number; + static OY1: number; + static OX2: number; + static OY2: number; + static OX3: number; + static OY3: number; + static OX4: number; + static OY4: number; + static X1: number; + static Y1: number; + static C1R: number; + static C1G: number; + static C1B: number; + static C1A: number; + static U1: number; + static V1: number; + static X2: number; + static Y2: number; + static C2R: number; + static C2G: number; + static C2B: number; + static C2A: number; + static U2: number; + static V2: number; + static X3: number; + static Y3: number; + static C3R: number; + static C3G: number; + static C3B: number; + static C3A: number; + static U3: number; + static V3: number; + static X4: number; + static Y4: number; + static C4R: number; + static C4G: number; + static C4B: number; + static C4A: number; + static U4: number; + static V4: number; + x: number; + y: number; + scaleX: number; + scaleY: number; + rotation: number; + width: number; + height: number; + color: Color; + path: string; + rendererObject: any; + region: TextureRegion; + offset: ArrayLike; + uvs: ArrayLike; + tempColor: Color; + constructor(name: string); + updateOffset(): void; + setRegion(region: TextureRegion): void; + computeWorldVertices(bone: Bone, worldVertices: ArrayLike, offset: number, stride: number): void; + } +} +declare module spine { + class JitterEffect implements VertexEffect { + jitterX: number; + jitterY: number; + constructor(jitterX: number, jitterY: number); + begin(skeleton: Skeleton): void; + transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void; + end(): void; + } +} +declare module spine { + class SwirlEffect implements VertexEffect { + static interpolation: PowOut; + centerX: number; + centerY: number; + radius: number; + angle: number; + private worldX; + private worldY; + constructor(radius: number); + begin(skeleton: Skeleton): void; + transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void; + end(): void; + } +} +declare module spine.canvas { + class AssetManager extends spine.AssetManager { + constructor(pathPrefix?: string); + } +} +declare module spine.canvas { + class CanvasTexture extends Texture { + constructor(image: HTMLImageElement); + setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; + setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; + dispose(): void; + } +} +declare module spine.canvas { + class SkeletonRenderer { + static QUAD_TRIANGLES: number[]; + static VERTEX_SIZE: number; + private ctx; + triangleRendering: boolean; + debugRendering: boolean; + private vertices; + private tempColor; + constructor(context: CanvasRenderingContext2D); + draw(skeleton: Skeleton): void; + private drawImages(skeleton); + private drawTriangles(skeleton); + private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2); + private computeRegionVertices(slot, region, pma); + private computeMeshVertices(slot, mesh, pma); + } +} diff --git a/types/spine-webgl.d.ts b/types/spine-webgl.d.ts new file mode 100644 index 000000000..08153f383 --- /dev/null +++ b/types/spine-webgl.d.ts @@ -0,0 +1,1684 @@ +declare module spine { + class Animation { + name: string; + timelines: Array; + duration: number; + constructor(name: string, timelines: Array, duration: number); + apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + static binarySearch(values: ArrayLike, target: number, step?: number): number; + static linearSearch(values: ArrayLike, target: number, step: number): number; + } + interface Timeline { + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + getPropertyId(): number; + } + enum MixBlend { + setup = 0, + first = 1, + replace = 2, + add = 3, + } + enum MixDirection { + in = 0, + out = 1, + } + enum TimelineType { + rotate = 0, + translate = 1, + scale = 2, + shear = 3, + attachment = 4, + color = 5, + deform = 6, + event = 7, + drawOrder = 8, + ikConstraint = 9, + transformConstraint = 10, + pathConstraintPosition = 11, + pathConstraintSpacing = 12, + pathConstraintMix = 13, + twoColor = 14, + } + abstract class CurveTimeline implements Timeline { + static LINEAR: number; + static STEPPED: number; + static BEZIER: number; + static BEZIER_SIZE: number; + private curves; + abstract getPropertyId(): number; + constructor(frameCount: number); + getFrameCount(): number; + setLinear(frameIndex: number): void; + setStepped(frameIndex: number): void; + getCurveType(frameIndex: number): number; + setCurve(frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number): void; + getCurvePercent(frameIndex: number, percent: number): number; + abstract apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class RotateTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_ROTATION: number; + static ROTATION: number; + boneIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, degrees: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class TranslateTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_X: number; + static PREV_Y: number; + static X: number; + static Y: number; + boneIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, x: number, y: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class ScaleTimeline extends TranslateTimeline { + constructor(frameCount: number); + getPropertyId(): number; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class ShearTimeline extends TranslateTimeline { + constructor(frameCount: number); + getPropertyId(): number; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class ColorTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_R: number; + static PREV_G: number; + static PREV_B: number; + static PREV_A: number; + static R: number; + static G: number; + static B: number; + static A: number; + slotIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class TwoColorTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_R: number; + static PREV_G: number; + static PREV_B: number; + static PREV_A: number; + static PREV_R2: number; + static PREV_G2: number; + static PREV_B2: number; + static R: number; + static G: number; + static B: number; + static A: number; + static R2: number; + static G2: number; + static B2: number; + slotIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class AttachmentTimeline implements Timeline { + slotIndex: number; + frames: ArrayLike; + attachmentNames: Array; + constructor(frameCount: number); + getPropertyId(): number; + getFrameCount(): number; + setFrame(frameIndex: number, time: number, attachmentName: string): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class DeformTimeline extends CurveTimeline { + slotIndex: number; + attachment: VertexAttachment; + frames: ArrayLike; + frameVertices: Array>; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, vertices: ArrayLike): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class EventTimeline implements Timeline { + frames: ArrayLike; + events: Array; + constructor(frameCount: number); + getPropertyId(): number; + getFrameCount(): number; + setFrame(frameIndex: number, event: Event): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class DrawOrderTimeline implements Timeline { + frames: ArrayLike; + drawOrders: Array>; + constructor(frameCount: number); + getPropertyId(): number; + getFrameCount(): number; + setFrame(frameIndex: number, time: number, drawOrder: Array): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class IkConstraintTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_MIX: number; + static PREV_BEND_DIRECTION: number; + static PREV_COMPRESS: number; + static PREV_STRETCH: number; + static MIX: number; + static BEND_DIRECTION: number; + static COMPRESS: number; + static STRETCH: number; + ikConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, mix: number, bendDirection: number, compress: boolean, stretch: boolean): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class TransformConstraintTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_ROTATE: number; + static PREV_TRANSLATE: number; + static PREV_SCALE: number; + static PREV_SHEAR: number; + static ROTATE: number; + static TRANSLATE: number; + static SCALE: number; + static SHEAR: number; + transformConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class PathConstraintPositionTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_VALUE: number; + static VALUE: number; + pathConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, value: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline { + constructor(frameCount: number); + getPropertyId(): number; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class PathConstraintMixTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_ROTATE: number; + static PREV_TRANSLATE: number; + static ROTATE: number; + static TRANSLATE: number; + pathConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } +} +declare module spine { + class AnimationState { + static emptyAnimation: Animation; + static SUBSEQUENT: number; + static FIRST: number; + static HOLD: number; + static HOLD_MIX: number; + data: AnimationStateData; + tracks: TrackEntry[]; + events: Event[]; + listeners: AnimationStateListener2[]; + queue: EventQueue; + propertyIDs: IntSet; + animationsChanged: boolean; + timeScale: number; + trackEntryPool: Pool; + constructor(data: AnimationStateData); + update(delta: number): void; + updateMixingFrom(to: TrackEntry, delta: number): boolean; + apply(skeleton: Skeleton): boolean; + applyMixingFrom(to: TrackEntry, skeleton: Skeleton, blend: MixBlend): number; + applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, blend: MixBlend, timelinesRotation: Array, i: number, firstFrame: boolean): void; + queueEvents(entry: TrackEntry, animationTime: number): void; + clearTracks(): void; + clearTrack(trackIndex: number): void; + setCurrent(index: number, current: TrackEntry, interrupt: boolean): void; + setAnimation(trackIndex: number, animationName: string, loop: boolean): TrackEntry; + setAnimationWith(trackIndex: number, animation: Animation, loop: boolean): TrackEntry; + addAnimation(trackIndex: number, animationName: string, loop: boolean, delay: number): TrackEntry; + addAnimationWith(trackIndex: number, animation: Animation, loop: boolean, delay: number): TrackEntry; + setEmptyAnimation(trackIndex: number, mixDuration: number): TrackEntry; + addEmptyAnimation(trackIndex: number, mixDuration: number, delay: number): TrackEntry; + setEmptyAnimations(mixDuration: number): void; + expandToIndex(index: number): TrackEntry; + trackEntry(trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry): TrackEntry; + disposeNext(entry: TrackEntry): void; + _animationsChanged(): void; + setTimelineModes(entry: TrackEntry): void; + hasTimeline(entry: TrackEntry, id: number): boolean; + getCurrent(trackIndex: number): TrackEntry; + addListener(listener: AnimationStateListener2): void; + removeListener(listener: AnimationStateListener2): void; + clearListeners(): void; + clearListenerNotifications(): void; + } + class TrackEntry { + animation: Animation; + next: TrackEntry; + mixingFrom: TrackEntry; + mixingTo: TrackEntry; + listener: AnimationStateListener2; + trackIndex: number; + loop: boolean; + holdPrevious: boolean; + eventThreshold: number; + attachmentThreshold: number; + drawOrderThreshold: number; + animationStart: number; + animationEnd: number; + animationLast: number; + nextAnimationLast: number; + delay: number; + trackTime: number; + trackLast: number; + nextTrackLast: number; + trackEnd: number; + timeScale: number; + alpha: number; + mixTime: number; + mixDuration: number; + interruptAlpha: number; + totalAlpha: number; + mixBlend: MixBlend; + timelineMode: number[]; + timelineHoldMix: TrackEntry[]; + timelinesRotation: number[]; + reset(): void; + getAnimationTime(): number; + setAnimationLast(animationLast: number): void; + isComplete(): boolean; + resetRotationDirections(): void; + } + class EventQueue { + objects: Array; + drainDisabled: boolean; + animState: AnimationState; + constructor(animState: AnimationState); + start(entry: TrackEntry): void; + interrupt(entry: TrackEntry): void; + end(entry: TrackEntry): void; + dispose(entry: TrackEntry): void; + complete(entry: TrackEntry): void; + event(entry: TrackEntry, event: Event): void; + drain(): void; + clear(): void; + } + enum EventType { + start = 0, + interrupt = 1, + end = 2, + dispose = 3, + complete = 4, + event = 5, + } + interface AnimationStateListener2 { + start(entry: TrackEntry): void; + interrupt(entry: TrackEntry): void; + end(entry: TrackEntry): void; + dispose(entry: TrackEntry): void; + complete(entry: TrackEntry): void; + event(entry: TrackEntry, event: Event): void; + } + abstract class AnimationStateAdapter2 implements AnimationStateListener2 { + start(entry: TrackEntry): void; + interrupt(entry: TrackEntry): void; + end(entry: TrackEntry): void; + dispose(entry: TrackEntry): void; + complete(entry: TrackEntry): void; + event(entry: TrackEntry, event: Event): void; + } +} +declare module spine { + class AnimationStateData { + skeletonData: SkeletonData; + animationToMixTime: Map; + defaultMix: number; + constructor(skeletonData: SkeletonData); + setMix(fromName: string, toName: string, duration: number): void; + setMixWith(from: Animation, to: Animation, duration: number): void; + getMix(from: Animation, to: Animation): number; + } +} +declare module spine { + class AssetManager implements Disposable { + private pathPrefix; + private textureLoader; + private assets; + private errors; + private toLoad; + private loaded; + constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string); + private static downloadText(url, success, error); + private static downloadBinary(url, success, error); + loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void; + loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void; + loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void; + loadTextureAtlas(path: string, success?: (path: string, atlas: TextureAtlas) => void, error?: (path: string, error: string) => void): void; + get(path: string): any; + remove(path: string): void; + removeAll(): void; + isLoadingComplete(): boolean; + getToLoad(): number; + getLoaded(): number; + dispose(): void; + hasErrors(): boolean; + getErrors(): Map; + } +} +declare module spine { + class AtlasAttachmentLoader implements AttachmentLoader { + atlas: TextureAtlas; + constructor(atlas: TextureAtlas); + newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment; + newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment; + newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment; + newPathAttachment(skin: Skin, name: string): PathAttachment; + newPointAttachment(skin: Skin, name: string): PointAttachment; + newClippingAttachment(skin: Skin, name: string): ClippingAttachment; + } +} +declare module spine { + enum BlendMode { + Normal = 0, + Additive = 1, + Multiply = 2, + Screen = 3, + } +} +declare module spine { + class Bone implements Updatable { + data: BoneData; + skeleton: Skeleton; + parent: Bone; + children: Bone[]; + x: number; + y: number; + rotation: number; + scaleX: number; + scaleY: number; + shearX: number; + shearY: number; + ax: number; + ay: number; + arotation: number; + ascaleX: number; + ascaleY: number; + ashearX: number; + ashearY: number; + appliedValid: boolean; + a: number; + b: number; + worldX: number; + c: number; + d: number; + worldY: number; + sorted: boolean; + constructor(data: BoneData, skeleton: Skeleton, parent: Bone); + update(): void; + updateWorldTransform(): void; + updateWorldTransformWith(x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number): void; + setToSetupPose(): void; + getWorldRotationX(): number; + getWorldRotationY(): number; + getWorldScaleX(): number; + getWorldScaleY(): number; + updateAppliedTransform(): void; + worldToLocal(world: Vector2): Vector2; + localToWorld(local: Vector2): Vector2; + worldToLocalRotation(worldRotation: number): number; + localToWorldRotation(localRotation: number): number; + rotateWorld(degrees: number): void; + } +} +declare module spine { + class BoneData { + index: number; + name: string; + parent: BoneData; + length: number; + x: number; + y: number; + rotation: number; + scaleX: number; + scaleY: number; + shearX: number; + shearY: number; + transformMode: TransformMode; + constructor(index: number, name: string, parent: BoneData); + } + enum TransformMode { + Normal = 0, + OnlyTranslation = 1, + NoRotationOrReflection = 2, + NoScale = 3, + NoScaleOrReflection = 4, + } +} +declare module spine { + interface Constraint extends Updatable { + getOrder(): number; + } +} +declare module spine { + class Event { + data: EventData; + intValue: number; + floatValue: number; + stringValue: string; + time: number; + volume: number; + balance: number; + constructor(time: number, data: EventData); + } +} +declare module spine { + class EventData { + name: string; + intValue: number; + floatValue: number; + stringValue: string; + audioPath: string; + volume: number; + balance: number; + constructor(name: string); + } +} +declare module spine { + class IkConstraint implements Constraint { + data: IkConstraintData; + bones: Array; + target: Bone; + bendDirection: number; + compress: boolean; + stretch: boolean; + mix: number; + constructor(data: IkConstraintData, skeleton: Skeleton); + getOrder(): number; + apply(): void; + update(): void; + apply1(bone: Bone, targetX: number, targetY: number, compress: boolean, stretch: boolean, uniform: boolean, alpha: number): void; + apply2(parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, stretch: boolean, alpha: number): void; + } +} +declare module spine { + class IkConstraintData { + name: string; + order: number; + bones: BoneData[]; + target: BoneData; + bendDirection: number; + compress: boolean; + stretch: boolean; + uniform: boolean; + mix: number; + constructor(name: string); + } +} +declare module spine { + class PathConstraint implements Constraint { + static NONE: number; + static BEFORE: number; + static AFTER: number; + static epsilon: number; + data: PathConstraintData; + bones: Array; + target: Slot; + position: number; + spacing: number; + rotateMix: number; + translateMix: number; + spaces: number[]; + positions: number[]; + world: number[]; + curves: number[]; + lengths: number[]; + segments: number[]; + constructor(data: PathConstraintData, skeleton: Skeleton); + apply(): void; + update(): void; + computeWorldPositions(path: PathAttachment, spacesCount: number, tangents: boolean, percentPosition: boolean, percentSpacing: boolean): number[]; + addBeforePosition(p: number, temp: Array, i: number, out: Array, o: number): void; + addAfterPosition(p: number, temp: Array, i: number, out: Array, o: number): void; + addCurvePosition(p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, out: Array, o: number, tangents: boolean): void; + getOrder(): number; + } +} +declare module spine { + class PathConstraintData { + name: string; + order: number; + bones: BoneData[]; + target: SlotData; + positionMode: PositionMode; + spacingMode: SpacingMode; + rotateMode: RotateMode; + offsetRotation: number; + position: number; + spacing: number; + rotateMix: number; + translateMix: number; + constructor(name: string); + } + enum PositionMode { + Fixed = 0, + Percent = 1, + } + enum SpacingMode { + Length = 0, + Fixed = 1, + Percent = 2, + } + enum RotateMode { + Tangent = 0, + Chain = 1, + ChainScale = 2, + } +} +declare module spine { + class SharedAssetManager implements Disposable { + private pathPrefix; + private clientAssets; + private queuedAssets; + private rawAssets; + private errors; + constructor(pathPrefix?: string); + private queueAsset(clientId, textureLoader, path); + loadText(clientId: string, path: string): void; + loadJson(clientId: string, path: string): void; + loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void; + get(clientId: string, path: string): any; + private updateClientAssets(clientAssets); + isLoadingComplete(clientId: string): boolean; + dispose(): void; + hasErrors(): boolean; + getErrors(): Map; + } +} +declare module spine { + class Skeleton { + data: SkeletonData; + bones: Array; + slots: Array; + drawOrder: Array; + ikConstraints: Array; + transformConstraints: Array; + pathConstraints: Array; + _updateCache: Updatable[]; + updateCacheReset: Updatable[]; + skin: Skin; + color: Color; + time: number; + scaleX: number; + scaleY: number; + x: number; + y: number; + constructor(data: SkeletonData); + updateCache(): void; + sortIkConstraint(constraint: IkConstraint): void; + sortPathConstraint(constraint: PathConstraint): void; + sortTransformConstraint(constraint: TransformConstraint): void; + sortPathConstraintAttachment(skin: Skin, slotIndex: number, slotBone: Bone): void; + sortPathConstraintAttachmentWith(attachment: Attachment, slotBone: Bone): void; + sortBone(bone: Bone): void; + sortReset(bones: Array): void; + updateWorldTransform(): void; + setToSetupPose(): void; + setBonesToSetupPose(): void; + setSlotsToSetupPose(): void; + getRootBone(): Bone; + findBone(boneName: string): Bone; + findBoneIndex(boneName: string): number; + findSlot(slotName: string): Slot; + findSlotIndex(slotName: string): number; + setSkinByName(skinName: string): void; + setSkin(newSkin: Skin): void; + getAttachmentByName(slotName: string, attachmentName: string): Attachment; + getAttachment(slotIndex: number, attachmentName: string): Attachment; + setAttachment(slotName: string, attachmentName: string): void; + findIkConstraint(constraintName: string): IkConstraint; + findTransformConstraint(constraintName: string): TransformConstraint; + findPathConstraint(constraintName: string): PathConstraint; + getBounds(offset: Vector2, size: Vector2, temp?: Array): void; + update(delta: number): void; + } +} +declare module spine { + class SkeletonBounds { + minX: number; + minY: number; + maxX: number; + maxY: number; + boundingBoxes: BoundingBoxAttachment[]; + polygons: ArrayLike[]; + private polygonPool; + update(skeleton: Skeleton, updateAabb: boolean): void; + aabbCompute(): void; + aabbContainsPoint(x: number, y: number): boolean; + aabbIntersectsSegment(x1: number, y1: number, x2: number, y2: number): boolean; + aabbIntersectsSkeleton(bounds: SkeletonBounds): boolean; + containsPoint(x: number, y: number): BoundingBoxAttachment; + containsPointPolygon(polygon: ArrayLike, x: number, y: number): boolean; + intersectsSegment(x1: number, y1: number, x2: number, y2: number): BoundingBoxAttachment; + intersectsSegmentPolygon(polygon: ArrayLike, x1: number, y1: number, x2: number, y2: number): boolean; + getPolygon(boundingBox: BoundingBoxAttachment): ArrayLike; + getWidth(): number; + getHeight(): number; + } +} +declare module spine { + class SkeletonClipping { + private triangulator; + private clippingPolygon; + private clipOutput; + clippedVertices: number[]; + clippedTriangles: number[]; + private scratch; + private clipAttachment; + private clippingPolygons; + clipStart(slot: Slot, clip: ClippingAttachment): number; + clipEndWithSlot(slot: Slot): void; + clipEnd(): void; + isClipping(): boolean; + clipTriangles(vertices: ArrayLike, verticesLength: number, triangles: ArrayLike, trianglesLength: number, uvs: ArrayLike, light: Color, dark: Color, twoColor: boolean): void; + clip(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, clippingArea: Array, output: Array): boolean; + static makeClockwise(polygon: ArrayLike): void; + } +} +declare module spine { + class SkeletonData { + name: string; + bones: BoneData[]; + slots: SlotData[]; + skins: Skin[]; + defaultSkin: Skin; + events: EventData[]; + animations: Animation[]; + ikConstraints: IkConstraintData[]; + transformConstraints: TransformConstraintData[]; + pathConstraints: PathConstraintData[]; + width: number; + height: number; + version: string; + hash: string; + fps: number; + imagesPath: string; + findBone(boneName: string): BoneData; + findBoneIndex(boneName: string): number; + findSlot(slotName: string): SlotData; + findSlotIndex(slotName: string): number; + findSkin(skinName: string): Skin; + findEvent(eventDataName: string): EventData; + findAnimation(animationName: string): Animation; + findIkConstraint(constraintName: string): IkConstraintData; + findTransformConstraint(constraintName: string): TransformConstraintData; + findPathConstraint(constraintName: string): PathConstraintData; + findPathConstraintIndex(pathConstraintName: string): number; + } +} +declare module spine { + class SkeletonJson { + attachmentLoader: AttachmentLoader; + scale: number; + private linkedMeshes; + constructor(attachmentLoader: AttachmentLoader); + readSkeletonData(json: string | any): SkeletonData; + readAttachment(map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment; + readVertices(map: any, attachment: VertexAttachment, verticesLength: number): void; + readAnimation(map: any, name: string, skeletonData: SkeletonData): void; + readCurve(map: any, timeline: CurveTimeline, frameIndex: number): void; + getValue(map: any, prop: string, defaultValue: any): any; + static blendModeFromString(str: string): BlendMode; + static positionModeFromString(str: string): PositionMode; + static spacingModeFromString(str: string): SpacingMode; + static rotateModeFromString(str: string): RotateMode; + static transformModeFromString(str: string): TransformMode; + } +} +declare module spine { + class Skin { + name: string; + attachments: Map[]; + constructor(name: string); + addAttachment(slotIndex: number, name: string, attachment: Attachment): void; + getAttachment(slotIndex: number, name: string): Attachment; + attachAll(skeleton: Skeleton, oldSkin: Skin): void; + } +} +declare module spine { + class Slot { + data: SlotData; + bone: Bone; + color: Color; + darkColor: Color; + private attachment; + private attachmentTime; + attachmentVertices: number[]; + constructor(data: SlotData, bone: Bone); + getAttachment(): Attachment; + setAttachment(attachment: Attachment): void; + setAttachmentTime(time: number): void; + getAttachmentTime(): number; + setToSetupPose(): void; + } +} +declare module spine { + class SlotData { + index: number; + name: string; + boneData: BoneData; + color: Color; + darkColor: Color; + attachmentName: string; + blendMode: BlendMode; + constructor(index: number, name: string, boneData: BoneData); + } +} +declare module spine { + abstract class Texture { + protected _image: HTMLImageElement; + constructor(image: HTMLImageElement); + getImage(): HTMLImageElement; + abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; + abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; + abstract dispose(): void; + static filterFromString(text: string): TextureFilter; + static wrapFromString(text: string): TextureWrap; + } + enum TextureFilter { + Nearest = 9728, + Linear = 9729, + MipMap = 9987, + MipMapNearestNearest = 9984, + MipMapLinearNearest = 9985, + MipMapNearestLinear = 9986, + MipMapLinearLinear = 9987, + } + enum TextureWrap { + MirroredRepeat = 33648, + ClampToEdge = 33071, + Repeat = 10497, + } + class TextureRegion { + renderObject: any; + u: number; + v: number; + u2: number; + v2: number; + width: number; + height: number; + rotate: boolean; + offsetX: number; + offsetY: number; + originalWidth: number; + originalHeight: number; + } + class FakeTexture extends Texture { + setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; + setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; + dispose(): void; + } +} +declare module spine { + class TextureAtlas implements Disposable { + pages: TextureAtlasPage[]; + regions: TextureAtlasRegion[]; + constructor(atlasText: string, textureLoader: (path: string) => any); + private load(atlasText, textureLoader); + findRegion(name: string): TextureAtlasRegion; + dispose(): void; + } + class TextureAtlasPage { + name: string; + minFilter: TextureFilter; + magFilter: TextureFilter; + uWrap: TextureWrap; + vWrap: TextureWrap; + texture: Texture; + width: number; + height: number; + } + class TextureAtlasRegion extends TextureRegion { + page: TextureAtlasPage; + name: string; + x: number; + y: number; + index: number; + rotate: boolean; + texture: Texture; + } +} +declare module spine { + class TransformConstraint implements Constraint { + data: TransformConstraintData; + bones: Array; + target: Bone; + rotateMix: number; + translateMix: number; + scaleMix: number; + shearMix: number; + temp: Vector2; + constructor(data: TransformConstraintData, skeleton: Skeleton); + apply(): void; + update(): void; + applyAbsoluteWorld(): void; + applyRelativeWorld(): void; + applyAbsoluteLocal(): void; + applyRelativeLocal(): void; + getOrder(): number; + } +} +declare module spine { + class TransformConstraintData { + name: string; + order: number; + bones: BoneData[]; + target: BoneData; + rotateMix: number; + translateMix: number; + scaleMix: number; + shearMix: number; + offsetRotation: number; + offsetX: number; + offsetY: number; + offsetScaleX: number; + offsetScaleY: number; + offsetShearY: number; + relative: boolean; + local: boolean; + constructor(name: string); + } +} +declare module spine { + class Triangulator { + private convexPolygons; + private convexPolygonsIndices; + private indicesArray; + private isConcaveArray; + private triangles; + private polygonPool; + private polygonIndicesPool; + triangulate(verticesArray: ArrayLike): Array; + decompose(verticesArray: Array, triangles: Array): Array>; + private static isConcave(index, vertexCount, vertices, indices); + private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y); + private static winding(p1x, p1y, p2x, p2y, p3x, p3y); + } +} +declare module spine { + interface Updatable { + update(): void; + } +} +declare module spine { + interface Map { + [key: string]: T; + } + class IntSet { + array: number[]; + add(value: number): boolean; + contains(value: number): boolean; + remove(value: number): void; + clear(): void; + } + interface Disposable { + dispose(): void; + } + interface Restorable { + restore(): void; + } + class Color { + r: number; + g: number; + b: number; + a: number; + static WHITE: Color; + static RED: Color; + static GREEN: Color; + static BLUE: Color; + static MAGENTA: Color; + constructor(r?: number, g?: number, b?: number, a?: number); + set(r: number, g: number, b: number, a: number): this; + setFromColor(c: Color): this; + setFromString(hex: string): this; + add(r: number, g: number, b: number, a: number): this; + clamp(): this; + } + class MathUtils { + static PI: number; + static PI2: number; + static radiansToDegrees: number; + static radDeg: number; + static degreesToRadians: number; + static degRad: number; + static clamp(value: number, min: number, max: number): number; + static cosDeg(degrees: number): number; + static sinDeg(degrees: number): number; + static signum(value: number): number; + static toInt(x: number): number; + static cbrt(x: number): number; + static randomTriangular(min: number, max: number): number; + static randomTriangularWith(min: number, max: number, mode: number): number; + } + abstract class Interpolation { + protected abstract applyInternal(a: number): number; + apply(start: number, end: number, a: number): number; + } + class Pow extends Interpolation { + protected power: number; + constructor(power: number); + applyInternal(a: number): number; + } + class PowOut extends Pow { + constructor(power: number); + applyInternal(a: number): number; + } + class Utils { + static SUPPORTS_TYPED_ARRAYS: boolean; + static arrayCopy(source: ArrayLike, sourceStart: number, dest: ArrayLike, destStart: number, numElements: number): void; + static setArraySize(array: Array, size: number, value?: any): Array; + static ensureArrayCapacity(array: Array, size: number, value?: any): Array; + static newArray(size: number, defaultValue: T): Array; + static newFloatArray(size: number): ArrayLike; + static newShortArray(size: number): ArrayLike; + static toFloatArray(array: Array): number[] | Float32Array; + static toSinglePrecision(value: number): number; + static webkit602BugfixHelper(alpha: number, blend: MixBlend): void; + } + class DebugUtils { + static logBones(skeleton: Skeleton): void; + } + class Pool { + private items; + private instantiator; + constructor(instantiator: () => T); + obtain(): T; + free(item: T): void; + freeAll(items: ArrayLike): void; + clear(): void; + } + class Vector2 { + x: number; + y: number; + constructor(x?: number, y?: number); + set(x: number, y: number): Vector2; + length(): number; + normalize(): this; + } + class TimeKeeper { + maxDelta: number; + framesPerSecond: number; + delta: number; + totalTime: number; + private lastTime; + private frameCount; + private frameTime; + update(): void; + } + interface ArrayLike { + length: number; + [n: number]: T; + } + class WindowedMean { + values: Array; + addedValues: number; + lastValue: number; + mean: number; + dirty: boolean; + constructor(windowSize?: number); + hasEnoughData(): boolean; + addValue(value: number): void; + getMean(): number; + } +} +declare module spine { + interface VertexEffect { + begin(skeleton: Skeleton): void; + transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void; + end(): void; + } +} +interface Math { + fround(n: number): number; +} +declare module spine { + abstract class Attachment { + name: string; + constructor(name: string); + } + abstract class VertexAttachment extends Attachment { + private static nextID; + id: number; + bones: Array; + vertices: ArrayLike; + worldVerticesLength: number; + constructor(name: string); + computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike, offset: number, stride: number): void; + applyDeform(sourceAttachment: VertexAttachment): boolean; + } +} +declare module spine { + interface AttachmentLoader { + newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment; + newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment; + newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment; + newPathAttachment(skin: Skin, name: string): PathAttachment; + newPointAttachment(skin: Skin, name: string): PointAttachment; + newClippingAttachment(skin: Skin, name: string): ClippingAttachment; + } +} +declare module spine { + enum AttachmentType { + Region = 0, + BoundingBox = 1, + Mesh = 2, + LinkedMesh = 3, + Path = 4, + Point = 5, + } +} +declare module spine { + class BoundingBoxAttachment extends VertexAttachment { + color: Color; + constructor(name: string); + } +} +declare module spine { + class ClippingAttachment extends VertexAttachment { + endSlot: SlotData; + color: Color; + constructor(name: string); + } +} +declare module spine { + class MeshAttachment extends VertexAttachment { + region: TextureRegion; + path: string; + regionUVs: ArrayLike; + uvs: ArrayLike; + triangles: Array; + color: Color; + hullLength: number; + private parentMesh; + inheritDeform: boolean; + tempColor: Color; + constructor(name: string); + updateUVs(): void; + applyDeform(sourceAttachment: VertexAttachment): boolean; + getParentMesh(): MeshAttachment; + setParentMesh(parentMesh: MeshAttachment): void; + } +} +declare module spine { + class PathAttachment extends VertexAttachment { + lengths: Array; + closed: boolean; + constantSpeed: boolean; + color: Color; + constructor(name: string); + } +} +declare module spine { + class PointAttachment extends VertexAttachment { + x: number; + y: number; + rotation: number; + color: Color; + constructor(name: string); + computeWorldPosition(bone: Bone, point: Vector2): Vector2; + computeWorldRotation(bone: Bone): number; + } +} +declare module spine { + class RegionAttachment extends Attachment { + static OX1: number; + static OY1: number; + static OX2: number; + static OY2: number; + static OX3: number; + static OY3: number; + static OX4: number; + static OY4: number; + static X1: number; + static Y1: number; + static C1R: number; + static C1G: number; + static C1B: number; + static C1A: number; + static U1: number; + static V1: number; + static X2: number; + static Y2: number; + static C2R: number; + static C2G: number; + static C2B: number; + static C2A: number; + static U2: number; + static V2: number; + static X3: number; + static Y3: number; + static C3R: number; + static C3G: number; + static C3B: number; + static C3A: number; + static U3: number; + static V3: number; + static X4: number; + static Y4: number; + static C4R: number; + static C4G: number; + static C4B: number; + static C4A: number; + static U4: number; + static V4: number; + x: number; + y: number; + scaleX: number; + scaleY: number; + rotation: number; + width: number; + height: number; + color: Color; + path: string; + rendererObject: any; + region: TextureRegion; + offset: ArrayLike; + uvs: ArrayLike; + tempColor: Color; + constructor(name: string); + updateOffset(): void; + setRegion(region: TextureRegion): void; + computeWorldVertices(bone: Bone, worldVertices: ArrayLike, offset: number, stride: number): void; + } +} +declare module spine { + class JitterEffect implements VertexEffect { + jitterX: number; + jitterY: number; + constructor(jitterX: number, jitterY: number); + begin(skeleton: Skeleton): void; + transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void; + end(): void; + } +} +declare module spine { + class SwirlEffect implements VertexEffect { + static interpolation: PowOut; + centerX: number; + centerY: number; + radius: number; + angle: number; + private worldX; + private worldY; + constructor(radius: number); + begin(skeleton: Skeleton): void; + transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void; + end(): void; + } +} +declare module spine.webgl { + class AssetManager extends spine.AssetManager { + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, pathPrefix?: string); + } +} +declare module spine.webgl { + class OrthoCamera { + position: Vector3; + direction: Vector3; + up: Vector3; + near: number; + far: number; + zoom: number; + viewportWidth: number; + viewportHeight: number; + projectionView: Matrix4; + inverseProjectionView: Matrix4; + projection: Matrix4; + view: Matrix4; + private tmp; + constructor(viewportWidth: number, viewportHeight: number); + update(): void; + screenToWorld(screenCoords: Vector3, screenWidth: number, screenHeight: number): Vector3; + setViewport(viewportWidth: number, viewportHeight: number): void; + } +} +declare module spine.webgl { + class GLTexture extends Texture implements Disposable, Restorable { + private context; + private texture; + private boundUnit; + private useMipMaps; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean); + setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; + setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; + update(useMipMaps: boolean): void; + restore(): void; + bind(unit?: number): void; + unbind(): void; + dispose(): void; + } +} +declare module spine.webgl { + class Input { + element: HTMLElement; + lastX: number; + lastY: number; + buttonDown: boolean; + currTouch: Touch; + touchesPool: Pool; + private listeners; + constructor(element: HTMLElement); + private setupCallbacks(element); + addListener(listener: InputListener): void; + removeListener(listener: InputListener): void; + } + class Touch { + identifier: number; + x: number; + y: number; + constructor(identifier: number, x: number, y: number); + } + interface InputListener { + down(x: number, y: number): void; + up(x: number, y: number): void; + moved(x: number, y: number): void; + dragged(x: number, y: number): void; + } +} +declare module spine.webgl { + class LoadingScreen { + static FADE_SECONDS: number; + private static loaded; + private static spinnerImg; + private static logoImg; + private renderer; + private logo; + private spinner; + private angle; + private fadeOut; + private timeKeeper; + backgroundColor: Color; + private tempColor; + private firstDraw; + private static SPINNER_DATA; + private static SPINE_LOGO_DATA; + constructor(renderer: SceneRenderer); + draw(complete?: boolean): void; + } +} +declare module spine.webgl { + const M00 = 0; + const M01 = 4; + const M02 = 8; + const M03 = 12; + const M10 = 1; + const M11 = 5; + const M12 = 9; + const M13 = 13; + const M20 = 2; + const M21 = 6; + const M22 = 10; + const M23 = 14; + const M30 = 3; + const M31 = 7; + const M32 = 11; + const M33 = 15; + class Matrix4 { + temp: Float32Array; + values: Float32Array; + private static xAxis; + private static yAxis; + private static zAxis; + private static tmpMatrix; + constructor(); + set(values: ArrayLike): Matrix4; + transpose(): Matrix4; + identity(): Matrix4; + invert(): Matrix4; + determinant(): number; + translate(x: number, y: number, z: number): Matrix4; + copy(): Matrix4; + projection(near: number, far: number, fovy: number, aspectRatio: number): Matrix4; + ortho2d(x: number, y: number, width: number, height: number): Matrix4; + ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4; + multiply(matrix: Matrix4): Matrix4; + multiplyLeft(matrix: Matrix4): Matrix4; + lookAt(position: Vector3, direction: Vector3, up: Vector3): this; + static initTemps(): void; + } +} +declare module spine.webgl { + class Mesh implements Disposable, Restorable { + private attributes; + private context; + private vertices; + private verticesBuffer; + private verticesLength; + private dirtyVertices; + private indices; + private indicesBuffer; + private indicesLength; + private dirtyIndices; + private elementsPerVertex; + getAttributes(): VertexAttribute[]; + maxVertices(): number; + numVertices(): number; + setVerticesLength(length: number): void; + getVertices(): Float32Array; + maxIndices(): number; + numIndices(): number; + setIndicesLength(length: number): void; + getIndices(): Uint16Array; + getVertexSizeInFloats(): number; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, attributes: VertexAttribute[], maxVertices: number, maxIndices: number); + setVertices(vertices: Array): void; + setIndices(indices: Array): void; + draw(shader: Shader, primitiveType: number): void; + drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void; + bind(shader: Shader): void; + unbind(shader: Shader): void; + private update(); + restore(): void; + dispose(): void; + } + class VertexAttribute { + name: string; + type: VertexAttributeType; + numElements: number; + constructor(name: string, type: VertexAttributeType, numElements: number); + } + class Position2Attribute extends VertexAttribute { + constructor(); + } + class Position3Attribute extends VertexAttribute { + constructor(); + } + class TexCoordAttribute extends VertexAttribute { + constructor(unit?: number); + } + class ColorAttribute extends VertexAttribute { + constructor(); + } + class Color2Attribute extends VertexAttribute { + constructor(); + } + enum VertexAttributeType { + Float = 0, + } +} +declare module spine.webgl { + class PolygonBatcher implements Disposable { + private context; + private drawCalls; + private isDrawing; + private mesh; + private shader; + private lastTexture; + private verticesLength; + private indicesLength; + private srcBlend; + private dstBlend; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint?: boolean, maxVertices?: number); + begin(shader: Shader): void; + setBlendMode(srcBlend: number, dstBlend: number): void; + draw(texture: GLTexture, vertices: ArrayLike, indices: Array): void; + private flush(); + end(): void; + getDrawCalls(): number; + dispose(): void; + } +} +declare module spine.webgl { + class SceneRenderer implements Disposable { + context: ManagedWebGLRenderingContext; + canvas: HTMLCanvasElement; + camera: OrthoCamera; + batcher: PolygonBatcher; + private twoColorTint; + private batcherShader; + private shapes; + private shapesShader; + private activeRenderer; + skeletonRenderer: SkeletonRenderer; + skeletonDebugRenderer: SkeletonDebugRenderer; + private QUAD; + private QUAD_TRIANGLES; + private WHITE; + constructor(canvas: HTMLCanvasElement, context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint?: boolean); + begin(): void; + drawSkeleton(skeleton: Skeleton, premultipliedAlpha?: boolean, slotRangeStart?: number, slotRangeEnd?: number): void; + drawSkeletonDebug(skeleton: Skeleton, premultipliedAlpha?: boolean, ignoredBones?: Array): void; + drawTexture(texture: GLTexture, x: number, y: number, width: number, height: number, color?: Color): void; + drawTextureUV(texture: GLTexture, x: number, y: number, width: number, height: number, u: number, v: number, u2: number, v2: number, color?: Color): void; + drawTextureRotated(texture: GLTexture, x: number, y: number, width: number, height: number, pivotX: number, pivotY: number, angle: number, color?: Color, premultipliedAlpha?: boolean): void; + drawRegion(region: TextureAtlasRegion, x: number, y: number, width: number, height: number, color?: Color, premultipliedAlpha?: boolean): void; + line(x: number, y: number, x2: number, y2: number, color?: Color, color2?: Color): void; + triangle(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color): void; + quad(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color): void; + rect(filled: boolean, x: number, y: number, width: number, height: number, color?: Color): void; + rectLine(filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color): void; + polygon(polygonVertices: ArrayLike, offset: number, count: number, color?: Color): void; + circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void; + curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void; + end(): void; + resize(resizeMode: ResizeMode): void; + private enableRenderer(renderer); + dispose(): void; + } + enum ResizeMode { + Stretch = 0, + Expand = 1, + Fit = 2, + } +} +declare module spine.webgl { + class Shader implements Disposable, Restorable { + private vertexShader; + private fragmentShader; + static MVP_MATRIX: string; + static POSITION: string; + static COLOR: string; + static COLOR2: string; + static TEXCOORDS: string; + static SAMPLER: string; + private context; + private vs; + private vsSource; + private fs; + private fsSource; + private program; + private tmp2x2; + private tmp3x3; + private tmp4x4; + getProgram(): WebGLProgram; + getVertexShader(): string; + getFragmentShader(): string; + getVertexShaderSource(): string; + getFragmentSource(): string; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string); + private compile(); + private compileShader(type, source); + private compileProgram(vs, fs); + restore(): void; + bind(): void; + unbind(): void; + setUniformi(uniform: string, value: number): void; + setUniformf(uniform: string, value: number): void; + setUniform2f(uniform: string, value: number, value2: number): void; + setUniform3f(uniform: string, value: number, value2: number, value3: number): void; + setUniform4f(uniform: string, value: number, value2: number, value3: number, value4: number): void; + setUniform2x2f(uniform: string, value: ArrayLike): void; + setUniform3x3f(uniform: string, value: ArrayLike): void; + setUniform4x4f(uniform: string, value: ArrayLike): void; + getUniformLocation(uniform: string): WebGLUniformLocation; + getAttributeLocation(attribute: string): number; + dispose(): void; + static newColoredTextured(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader; + static newTwoColoredTextured(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader; + static newColored(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader; + } +} +declare module spine.webgl { + class ShapeRenderer implements Disposable { + private context; + private isDrawing; + private mesh; + private shapeType; + private color; + private shader; + private vertexIndex; + private tmp; + private srcBlend; + private dstBlend; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, maxVertices?: number); + begin(shader: Shader): void; + setBlendMode(srcBlend: number, dstBlend: number): void; + setColor(color: Color): void; + setColorWith(r: number, g: number, b: number, a: number): void; + point(x: number, y: number, color?: Color): void; + line(x: number, y: number, x2: number, y2: number, color?: Color): void; + triangle(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color): void; + quad(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color): void; + rect(filled: boolean, x: number, y: number, width: number, height: number, color?: Color): void; + rectLine(filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color): void; + x(x: number, y: number, size: number): void; + polygon(polygonVertices: ArrayLike, offset: number, count: number, color?: Color): void; + circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void; + curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void; + private vertex(x, y, color); + end(): void; + private flush(); + private check(shapeType, numVertices); + dispose(): void; + } + enum ShapeType { + Point = 0, + Line = 1, + Filled = 4, + } +} +declare module spine.webgl { + class SkeletonDebugRenderer implements Disposable { + boneLineColor: Color; + boneOriginColor: Color; + attachmentLineColor: Color; + triangleLineColor: Color; + pathColor: Color; + clipColor: Color; + aabbColor: Color; + drawBones: boolean; + drawRegionAttachments: boolean; + drawBoundingBoxes: boolean; + drawMeshHull: boolean; + drawMeshTriangles: boolean; + drawPaths: boolean; + drawSkeletonXY: boolean; + drawClipping: boolean; + premultipliedAlpha: boolean; + scale: number; + boneWidth: number; + private context; + private bounds; + private temp; + private vertices; + private static LIGHT_GRAY; + private static GREEN; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext); + draw(shapes: ShapeRenderer, skeleton: Skeleton, ignoredBones?: Array): void; + dispose(): void; + } +} +declare module spine.webgl { + class SkeletonRenderer { + static QUAD_TRIANGLES: number[]; + premultipliedAlpha: boolean; + vertexEffect: VertexEffect; + private tempColor; + private tempColor2; + private vertices; + private vertexSize; + private twoColorTint; + private renderable; + private clipper; + private temp; + private temp2; + private temp3; + private temp4; + constructor(context: ManagedWebGLRenderingContext, twoColorTint?: boolean); + draw(batcher: PolygonBatcher, skeleton: Skeleton, slotRangeStart?: number, slotRangeEnd?: number): void; + } +} +declare module spine.webgl { + class Vector3 { + x: number; + y: number; + z: number; + constructor(x?: number, y?: number, z?: number); + setFrom(v: Vector3): Vector3; + set(x: number, y: number, z: number): Vector3; + add(v: Vector3): Vector3; + sub(v: Vector3): Vector3; + scale(s: number): Vector3; + normalize(): Vector3; + cross(v: Vector3): Vector3; + multiply(matrix: Matrix4): Vector3; + project(matrix: Matrix4): Vector3; + dot(v: Vector3): number; + length(): number; + distance(v: Vector3): number; + } +} +declare module spine.webgl { + class ManagedWebGLRenderingContext { + canvas: HTMLCanvasElement; + gl: WebGLRenderingContext; + private restorables; + constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig?: any); + addRestorable(restorable: Restorable): void; + removeRestorable(restorable: Restorable): void; + } + class WebGLBlendModeConverter { + static ZERO: number; + static ONE: number; + static SRC_COLOR: number; + static ONE_MINUS_SRC_COLOR: number; + static SRC_ALPHA: number; + static ONE_MINUS_SRC_ALPHA: number; + static DST_ALPHA: number; + static ONE_MINUS_DST_ALPHA: number; + static DST_COLOR: number; + static getDestGLBlendMode(blendMode: BlendMode): number; + static getSourceGLBlendMode(blendMode: BlendMode, premultipliedAlpha?: boolean): number; + } +} diff --git a/types/spine.d.ts b/types/spine.d.ts new file mode 100644 index 000000000..26e5a2439 --- /dev/null +++ b/types/spine.d.ts @@ -0,0 +1,1667 @@ +declare module spine { + class Animation { + name: string; + timelines: Array; + duration: number; + constructor(name: string, timelines: Array, duration: number); + apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + static binarySearch(values: ArrayLike, target: number, step?: number): number; + static linearSearch(values: ArrayLike, target: number, step: number): number; + } + interface Timeline { + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + getPropertyId(): number; + } + enum MixBlend { + setup = 0, + first = 1, + replace = 2, + add = 3 + } + enum MixDirection { + in = 0, + out = 1 + } + enum TimelineType { + rotate = 0, + translate = 1, + scale = 2, + shear = 3, + attachment = 4, + color = 5, + deform = 6, + event = 7, + drawOrder = 8, + ikConstraint = 9, + transformConstraint = 10, + pathConstraintPosition = 11, + pathConstraintSpacing = 12, + pathConstraintMix = 13, + twoColor = 14 + } + abstract class CurveTimeline implements Timeline { + static LINEAR: number; + static STEPPED: number; + static BEZIER: number; + static BEZIER_SIZE: number; + private curves; + abstract getPropertyId(): number; + constructor(frameCount: number); + getFrameCount(): number; + setLinear(frameIndex: number): void; + setStepped(frameIndex: number): void; + getCurveType(frameIndex: number): number; + setCurve(frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number): void; + getCurvePercent(frameIndex: number, percent: number): number; + abstract apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class RotateTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_ROTATION: number; + static ROTATION: number; + boneIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, degrees: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class TranslateTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_X: number; + static PREV_Y: number; + static X: number; + static Y: number; + boneIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, x: number, y: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class ScaleTimeline extends TranslateTimeline { + constructor(frameCount: number); + getPropertyId(): number; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class ShearTimeline extends TranslateTimeline { + constructor(frameCount: number); + getPropertyId(): number; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class ColorTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_R: number; + static PREV_G: number; + static PREV_B: number; + static PREV_A: number; + static R: number; + static G: number; + static B: number; + static A: number; + slotIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class TwoColorTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_R: number; + static PREV_G: number; + static PREV_B: number; + static PREV_A: number; + static PREV_R2: number; + static PREV_G2: number; + static PREV_B2: number; + static R: number; + static G: number; + static B: number; + static A: number; + static R2: number; + static G2: number; + static B2: number; + slotIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class AttachmentTimeline implements Timeline { + slotIndex: number; + frames: ArrayLike; + attachmentNames: Array; + constructor(frameCount: number); + getPropertyId(): number; + getFrameCount(): number; + setFrame(frameIndex: number, time: number, attachmentName: string): void; + apply(skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class DeformTimeline extends CurveTimeline { + slotIndex: number; + attachment: VertexAttachment; + frames: ArrayLike; + frameVertices: Array>; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, vertices: ArrayLike): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class EventTimeline implements Timeline { + frames: ArrayLike; + events: Array; + constructor(frameCount: number); + getPropertyId(): number; + getFrameCount(): number; + setFrame(frameIndex: number, event: Event): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class DrawOrderTimeline implements Timeline { + frames: ArrayLike; + drawOrders: Array>; + constructor(frameCount: number); + getPropertyId(): number; + getFrameCount(): number; + setFrame(frameIndex: number, time: number, drawOrder: Array): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class IkConstraintTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_MIX: number; + static PREV_BEND_DIRECTION: number; + static PREV_COMPRESS: number; + static PREV_STRETCH: number; + static MIX: number; + static BEND_DIRECTION: number; + static COMPRESS: number; + static STRETCH: number; + ikConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, mix: number, bendDirection: number, compress: boolean, stretch: boolean): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class TransformConstraintTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_ROTATE: number; + static PREV_TRANSLATE: number; + static PREV_SCALE: number; + static PREV_SHEAR: number; + static ROTATE: number; + static TRANSLATE: number; + static SCALE: number; + static SHEAR: number; + transformConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class PathConstraintPositionTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_VALUE: number; + static VALUE: number; + pathConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, value: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline { + constructor(frameCount: number); + getPropertyId(): number; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } + class PathConstraintMixTimeline extends CurveTimeline { + static ENTRIES: number; + static PREV_TIME: number; + static PREV_ROTATE: number; + static PREV_TRANSLATE: number; + static ROTATE: number; + static TRANSLATE: number; + pathConstraintIndex: number; + frames: ArrayLike; + constructor(frameCount: number); + getPropertyId(): number; + setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number): void; + apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection): void; + } +} +declare module spine { + class AnimationState { + static emptyAnimation: Animation; + static SUBSEQUENT: number; + static FIRST: number; + static HOLD: number; + static HOLD_MIX: number; + data: AnimationStateData; + tracks: TrackEntry[]; + events: Event[]; + listeners: AnimationStateListener2[]; + queue: EventQueue; + propertyIDs: IntSet; + animationsChanged: boolean; + timeScale: number; + trackEntryPool: Pool; + constructor(data: AnimationStateData); + update(delta: number): void; + updateMixingFrom(to: TrackEntry, delta: number): boolean; + apply(skeleton: Skeleton): boolean; + applyMixingFrom(to: TrackEntry, skeleton: Skeleton, blend: MixBlend): number; + applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, blend: MixBlend, timelinesRotation: Array, i: number, firstFrame: boolean): void; + queueEvents(entry: TrackEntry, animationTime: number): void; + clearTracks(): void; + clearTrack(trackIndex: number): void; + setCurrent(index: number, current: TrackEntry, interrupt: boolean): void; + setAnimation(trackIndex: number, animationName: string, loop: boolean): TrackEntry; + setAnimationWith(trackIndex: number, animation: Animation, loop: boolean): TrackEntry; + addAnimation(trackIndex: number, animationName: string, loop: boolean, delay: number): TrackEntry; + addAnimationWith(trackIndex: number, animation: Animation, loop: boolean, delay: number): TrackEntry; + setEmptyAnimation(trackIndex: number, mixDuration: number): TrackEntry; + addEmptyAnimation(trackIndex: number, mixDuration: number, delay: number): TrackEntry; + setEmptyAnimations(mixDuration: number): void; + expandToIndex(index: number): TrackEntry; + trackEntry(trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry): TrackEntry; + disposeNext(entry: TrackEntry): void; + _animationsChanged(): void; + setTimelineModes(entry: TrackEntry): void; + hasTimeline(entry: TrackEntry, id: number): boolean; + getCurrent(trackIndex: number): TrackEntry; + addListener(listener: AnimationStateListener2): void; + removeListener(listener: AnimationStateListener2): void; + clearListeners(): void; + clearListenerNotifications(): void; + } + class TrackEntry { + animation: Animation; + next: TrackEntry; + mixingFrom: TrackEntry; + mixingTo: TrackEntry; + listener: AnimationStateListener2; + trackIndex: number; + loop: boolean; + holdPrevious: boolean; + eventThreshold: number; + attachmentThreshold: number; + drawOrderThreshold: number; + animationStart: number; + animationEnd: number; + animationLast: number; + nextAnimationLast: number; + delay: number; + trackTime: number; + trackLast: number; + nextTrackLast: number; + trackEnd: number; + timeScale: number; + alpha: number; + mixTime: number; + mixDuration: number; + interruptAlpha: number; + totalAlpha: number; + mixBlend: MixBlend; + timelineMode: number[]; + timelineHoldMix: TrackEntry[]; + timelinesRotation: number[]; + reset(): void; + getAnimationTime(): number; + setAnimationLast(animationLast: number): void; + isComplete(): boolean; + resetRotationDirections(): void; + } + class EventQueue { + objects: Array; + drainDisabled: boolean; + animState: AnimationState; + constructor(animState: AnimationState); + start(entry: TrackEntry): void; + interrupt(entry: TrackEntry): void; + end(entry: TrackEntry): void; + dispose(entry: TrackEntry): void; + complete(entry: TrackEntry): void; + event(entry: TrackEntry, event: Event): void; + drain(): void; + clear(): void; + } + enum EventType { + start = 0, + interrupt = 1, + end = 2, + dispose = 3, + complete = 4, + event = 5 + } + interface AnimationStateListener2 { + start(entry: TrackEntry): void; + interrupt(entry: TrackEntry): void; + end(entry: TrackEntry): void; + dispose(entry: TrackEntry): void; + complete(entry: TrackEntry): void; + event(entry: TrackEntry, event: Event): void; + } + abstract class AnimationStateAdapter2 implements AnimationStateListener2 { + start(entry: TrackEntry): void; + interrupt(entry: TrackEntry): void; + end(entry: TrackEntry): void; + dispose(entry: TrackEntry): void; + complete(entry: TrackEntry): void; + event(entry: TrackEntry, event: Event): void; + } +} +declare module spine { + class AnimationStateData { + skeletonData: SkeletonData; + animationToMixTime: Map; + defaultMix: number; + constructor(skeletonData: SkeletonData); + setMix(fromName: string, toName: string, duration: number): void; + setMixWith(from: Animation, to: Animation, duration: number): void; + getMix(from: Animation, to: Animation): number; + } +} +declare module spine { + class AssetManager implements Disposable { + private pathPrefix; + private textureLoader; + private assets; + private errors; + private toLoad; + private loaded; + constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string); + private static downloadText; + private static downloadBinary; + loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void; + loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void; + loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void; + loadTextureAtlas(path: string, success?: (path: string, atlas: TextureAtlas) => void, error?: (path: string, error: string) => void): void; + get(path: string): any; + remove(path: string): void; + removeAll(): void; + isLoadingComplete(): boolean; + getToLoad(): number; + getLoaded(): number; + dispose(): void; + hasErrors(): boolean; + getErrors(): Map; + } +} +declare module spine { + class AtlasAttachmentLoader implements AttachmentLoader { + atlas: TextureAtlas; + constructor(atlas: TextureAtlas); + newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment; + newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment; + newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment; + newPathAttachment(skin: Skin, name: string): PathAttachment; + newPointAttachment(skin: Skin, name: string): PointAttachment; + newClippingAttachment(skin: Skin, name: string): ClippingAttachment; + } +} +declare module spine { + enum BlendMode { + Normal = 0, + Additive = 1, + Multiply = 2, + Screen = 3 + } +} +declare module spine { + class Bone implements Updatable { + data: BoneData; + skeleton: Skeleton; + parent: Bone; + children: Bone[]; + x: number; + y: number; + rotation: number; + scaleX: number; + scaleY: number; + shearX: number; + shearY: number; + ax: number; + ay: number; + arotation: number; + ascaleX: number; + ascaleY: number; + ashearX: number; + ashearY: number; + appliedValid: boolean; + a: number; + b: number; + worldX: number; + c: number; + d: number; + worldY: number; + sorted: boolean; + constructor(data: BoneData, skeleton: Skeleton, parent: Bone); + update(): void; + updateWorldTransform(): void; + updateWorldTransformWith(x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number): void; + setToSetupPose(): void; + getWorldRotationX(): number; + getWorldRotationY(): number; + getWorldScaleX(): number; + getWorldScaleY(): number; + updateAppliedTransform(): void; + worldToLocal(world: Vector2): Vector2; + localToWorld(local: Vector2): Vector2; + worldToLocalRotation(worldRotation: number): number; + localToWorldRotation(localRotation: number): number; + rotateWorld(degrees: number): void; + } +} +declare module spine { + class BoneData { + index: number; + name: string; + parent: BoneData; + length: number; + x: number; + y: number; + rotation: number; + scaleX: number; + scaleY: number; + shearX: number; + shearY: number; + transformMode: TransformMode; + constructor(index: number, name: string, parent: BoneData); + } + enum TransformMode { + Normal = 0, + OnlyTranslation = 1, + NoRotationOrReflection = 2, + NoScale = 3, + NoScaleOrReflection = 4 + } +} +declare module spine { + interface Constraint extends Updatable { + getOrder(): number; + } +} +declare module spine { + class Event { + data: EventData; + intValue: number; + floatValue: number; + stringValue: string; + time: number; + volume: number; + balance: number; + constructor(time: number, data: EventData); + } +} +declare module spine { + class EventData { + name: string; + intValue: number; + floatValue: number; + stringValue: string; + audioPath: string; + volume: number; + balance: number; + constructor(name: string); + } +} +declare module spine { + class IkConstraint implements Constraint { + data: IkConstraintData; + bones: Array; + target: Bone; + bendDirection: number; + compress: boolean; + stretch: boolean; + mix: number; + constructor(data: IkConstraintData, skeleton: Skeleton); + getOrder(): number; + apply(): void; + update(): void; + apply1(bone: Bone, targetX: number, targetY: number, compress: boolean, stretch: boolean, uniform: boolean, alpha: number): void; + apply2(parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, stretch: boolean, alpha: number): void; + } +} +declare module spine { + class IkConstraintData { + name: string; + order: number; + bones: BoneData[]; + target: BoneData; + bendDirection: number; + compress: boolean; + stretch: boolean; + uniform: boolean; + mix: number; + constructor(name: string); + } +} +declare module spine { + class PathConstraint implements Constraint { + static NONE: number; + static BEFORE: number; + static AFTER: number; + static epsilon: number; + data: PathConstraintData; + bones: Array; + target: Slot; + position: number; + spacing: number; + rotateMix: number; + translateMix: number; + spaces: number[]; + positions: number[]; + world: number[]; + curves: number[]; + lengths: number[]; + segments: number[]; + constructor(data: PathConstraintData, skeleton: Skeleton); + apply(): void; + update(): void; + computeWorldPositions(path: PathAttachment, spacesCount: number, tangents: boolean, percentPosition: boolean, percentSpacing: boolean): number[]; + addBeforePosition(p: number, temp: Array, i: number, out: Array, o: number): void; + addAfterPosition(p: number, temp: Array, i: number, out: Array, o: number): void; + addCurvePosition(p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, out: Array, o: number, tangents: boolean): void; + getOrder(): number; + } +} +declare module spine { + class PathConstraintData { + name: string; + order: number; + bones: BoneData[]; + target: SlotData; + positionMode: PositionMode; + spacingMode: SpacingMode; + rotateMode: RotateMode; + offsetRotation: number; + position: number; + spacing: number; + rotateMix: number; + translateMix: number; + constructor(name: string); + } + enum PositionMode { + Fixed = 0, + Percent = 1 + } + enum SpacingMode { + Length = 0, + Fixed = 1, + Percent = 2 + } + enum RotateMode { + Tangent = 0, + Chain = 1, + ChainScale = 2 + } +} +declare module spine { + class SharedAssetManager implements Disposable { + private pathPrefix; + private clientAssets; + private queuedAssets; + private rawAssets; + private errors; + constructor(pathPrefix?: string); + private queueAsset; + loadText(clientId: string, path: string): void; + loadJson(clientId: string, path: string): void; + loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void; + get(clientId: string, path: string): any; + private updateClientAssets; + isLoadingComplete(clientId: string): boolean; + dispose(): void; + hasErrors(): boolean; + getErrors(): Map; + } +} +declare module spine { + class Skeleton { + data: SkeletonData; + bones: Array; + slots: Array; + drawOrder: Array; + ikConstraints: Array; + transformConstraints: Array; + pathConstraints: Array; + _updateCache: Updatable[]; + updateCacheReset: Updatable[]; + skin: Skin; + color: Color; + time: number; + scaleX: number; + scaleY: number; + x: number; + y: number; + constructor(data: SkeletonData); + updateCache(): void; + sortIkConstraint(constraint: IkConstraint): void; + sortPathConstraint(constraint: PathConstraint): void; + sortTransformConstraint(constraint: TransformConstraint): void; + sortPathConstraintAttachment(skin: Skin, slotIndex: number, slotBone: Bone): void; + sortPathConstraintAttachmentWith(attachment: Attachment, slotBone: Bone): void; + sortBone(bone: Bone): void; + sortReset(bones: Array): void; + updateWorldTransform(): void; + setToSetupPose(): void; + setBonesToSetupPose(): void; + setSlotsToSetupPose(): void; + getRootBone(): Bone; + findBone(boneName: string): Bone; + findBoneIndex(boneName: string): number; + findSlot(slotName: string): Slot; + findSlotIndex(slotName: string): number; + setSkinByName(skinName: string): void; + setSkin(newSkin: Skin): void; + getAttachmentByName(slotName: string, attachmentName: string): Attachment; + getAttachment(slotIndex: number, attachmentName: string): Attachment; + setAttachment(slotName: string, attachmentName: string): void; + findIkConstraint(constraintName: string): IkConstraint; + findTransformConstraint(constraintName: string): TransformConstraint; + findPathConstraint(constraintName: string): PathConstraint; + getBounds(offset: Vector2, size: Vector2, temp?: Array): void; + update(delta: number): void; + } +} +declare module spine { + class SkeletonBounds { + minX: number; + minY: number; + maxX: number; + maxY: number; + boundingBoxes: BoundingBoxAttachment[]; + polygons: ArrayLike[]; + private polygonPool; + update(skeleton: Skeleton, updateAabb: boolean): void; + aabbCompute(): void; + aabbContainsPoint(x: number, y: number): boolean; + aabbIntersectsSegment(x1: number, y1: number, x2: number, y2: number): boolean; + aabbIntersectsSkeleton(bounds: SkeletonBounds): boolean; + containsPoint(x: number, y: number): BoundingBoxAttachment; + containsPointPolygon(polygon: ArrayLike, x: number, y: number): boolean; + intersectsSegment(x1: number, y1: number, x2: number, y2: number): BoundingBoxAttachment; + intersectsSegmentPolygon(polygon: ArrayLike, x1: number, y1: number, x2: number, y2: number): boolean; + getPolygon(boundingBox: BoundingBoxAttachment): ArrayLike; + getWidth(): number; + getHeight(): number; + } +} +declare module spine { + class SkeletonClipping { + private triangulator; + private clippingPolygon; + private clipOutput; + clippedVertices: number[]; + clippedTriangles: number[]; + private scratch; + private clipAttachment; + private clippingPolygons; + clipStart(slot: Slot, clip: ClippingAttachment): number; + clipEndWithSlot(slot: Slot): void; + clipEnd(): void; + isClipping(): boolean; + clipTriangles(vertices: ArrayLike, verticesLength: number, triangles: ArrayLike, trianglesLength: number, uvs: ArrayLike, light: Color, dark: Color, twoColor: boolean): void; + clip(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, clippingArea: Array, output: Array): boolean; + static makeClockwise(polygon: ArrayLike): void; + } +} +declare module spine { + class SkeletonData { + name: string; + bones: BoneData[]; + slots: SlotData[]; + skins: Skin[]; + defaultSkin: Skin; + events: EventData[]; + animations: Animation[]; + ikConstraints: IkConstraintData[]; + transformConstraints: TransformConstraintData[]; + pathConstraints: PathConstraintData[]; + width: number; + height: number; + version: string; + hash: string; + fps: number; + imagesPath: string; + findBone(boneName: string): BoneData; + findBoneIndex(boneName: string): number; + findSlot(slotName: string): SlotData; + findSlotIndex(slotName: string): number; + findSkin(skinName: string): Skin; + findEvent(eventDataName: string): EventData; + findAnimation(animationName: string): Animation; + findIkConstraint(constraintName: string): IkConstraintData; + findTransformConstraint(constraintName: string): TransformConstraintData; + findPathConstraint(constraintName: string): PathConstraintData; + findPathConstraintIndex(pathConstraintName: string): number; + } +} +declare module spine { + class SkeletonJson { + attachmentLoader: AttachmentLoader; + scale: number; + private linkedMeshes; + constructor(attachmentLoader: AttachmentLoader); + readSkeletonData(json: string | any): SkeletonData; + readAttachment(map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment; + readVertices(map: any, attachment: VertexAttachment, verticesLength: number): void; + readAnimation(map: any, name: string, skeletonData: SkeletonData): void; + readCurve(map: any, timeline: CurveTimeline, frameIndex: number): void; + getValue(map: any, prop: string, defaultValue: any): any; + static blendModeFromString(str: string): BlendMode; + static positionModeFromString(str: string): PositionMode; + static spacingModeFromString(str: string): SpacingMode; + static rotateModeFromString(str: string): RotateMode; + static transformModeFromString(str: string): TransformMode; + } +} +declare module spine { + class Skin { + name: string; + attachments: Map[]; + constructor(name: string); + addAttachment(slotIndex: number, name: string, attachment: Attachment): void; + getAttachment(slotIndex: number, name: string): Attachment; + attachAll(skeleton: Skeleton, oldSkin: Skin): void; + } +} +declare module spine { + class Slot { + data: SlotData; + bone: Bone; + color: Color; + darkColor: Color; + private attachment; + private attachmentTime; + attachmentVertices: number[]; + constructor(data: SlotData, bone: Bone); + getAttachment(): Attachment; + setAttachment(attachment: Attachment): void; + setAttachmentTime(time: number): void; + getAttachmentTime(): number; + setToSetupPose(): void; + } +} +declare module spine { + class SlotData { + index: number; + name: string; + boneData: BoneData; + color: Color; + darkColor: Color; + attachmentName: string; + blendMode: BlendMode; + constructor(index: number, name: string, boneData: BoneData); + } +} +declare module spine { + abstract class Texture { + protected _image: HTMLImageElement; + constructor(image: HTMLImageElement); + getImage(): HTMLImageElement; + abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; + abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; + abstract dispose(): void; + static filterFromString(text: string): TextureFilter; + static wrapFromString(text: string): TextureWrap; + } + enum TextureFilter { + Nearest = 9728, + Linear = 9729, + MipMap = 9987, + MipMapNearestNearest = 9984, + MipMapLinearNearest = 9985, + MipMapNearestLinear = 9986, + MipMapLinearLinear = 9987 + } + enum TextureWrap { + MirroredRepeat = 33648, + ClampToEdge = 33071, + Repeat = 10497 + } + class TextureRegion { + renderObject: any; + u: number; + v: number; + u2: number; + v2: number; + width: number; + height: number; + rotate: boolean; + offsetX: number; + offsetY: number; + originalWidth: number; + originalHeight: number; + } + class FakeTexture extends Texture { + setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; + setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; + dispose(): void; + } +} +declare module spine { + class TextureAtlas implements Disposable { + pages: TextureAtlasPage[]; + regions: TextureAtlasRegion[]; + constructor(atlasText: string, textureLoader: (path: string) => any); + private load; + findRegion(name: string): TextureAtlasRegion; + dispose(): void; + } + class TextureAtlasPage { + name: string; + minFilter: TextureFilter; + magFilter: TextureFilter; + uWrap: TextureWrap; + vWrap: TextureWrap; + texture: Texture; + width: number; + height: number; + } + class TextureAtlasRegion extends TextureRegion { + page: TextureAtlasPage; + name: string; + x: number; + y: number; + index: number; + rotate: boolean; + texture: Texture; + } +} +declare module spine { + class TransformConstraint implements Constraint { + data: TransformConstraintData; + bones: Array; + target: Bone; + rotateMix: number; + translateMix: number; + scaleMix: number; + shearMix: number; + temp: Vector2; + constructor(data: TransformConstraintData, skeleton: Skeleton); + apply(): void; + update(): void; + applyAbsoluteWorld(): void; + applyRelativeWorld(): void; + applyAbsoluteLocal(): void; + applyRelativeLocal(): void; + getOrder(): number; + } +} +declare module spine { + class TransformConstraintData { + name: string; + order: number; + bones: BoneData[]; + target: BoneData; + rotateMix: number; + translateMix: number; + scaleMix: number; + shearMix: number; + offsetRotation: number; + offsetX: number; + offsetY: number; + offsetScaleX: number; + offsetScaleY: number; + offsetShearY: number; + relative: boolean; + local: boolean; + constructor(name: string); + } +} +declare module spine { + class Triangulator { + private convexPolygons; + private convexPolygonsIndices; + private indicesArray; + private isConcaveArray; + private triangles; + private polygonPool; + private polygonIndicesPool; + triangulate(verticesArray: ArrayLike): Array; + decompose(verticesArray: Array, triangles: Array): Array>; + private static isConcave; + private static positiveArea; + private static winding; + } +} +declare module spine { + interface Updatable { + update(): void; + } +} +declare module spine { + interface Map { + [key: string]: T; + } + class IntSet { + array: number[]; + add(value: number): boolean; + contains(value: number): boolean; + remove(value: number): void; + clear(): void; + } + interface Disposable { + dispose(): void; + } + interface Restorable { + restore(): void; + } + class Color { + r: number; + g: number; + b: number; + a: number; + static WHITE: Color; + static RED: Color; + static GREEN: Color; + static BLUE: Color; + static MAGENTA: Color; + constructor(r?: number, g?: number, b?: number, a?: number); + set(r: number, g: number, b: number, a: number): this; + setFromColor(c: Color): this; + setFromString(hex: string): this; + add(r: number, g: number, b: number, a: number): this; + clamp(): this; + } + class MathUtils { + static PI: number; + static PI2: number; + static radiansToDegrees: number; + static radDeg: number; + static degreesToRadians: number; + static degRad: number; + static clamp(value: number, min: number, max: number): number; + static cosDeg(degrees: number): number; + static sinDeg(degrees: number): number; + static signum(value: number): number; + static toInt(x: number): number; + static cbrt(x: number): number; + static randomTriangular(min: number, max: number): number; + static randomTriangularWith(min: number, max: number, mode: number): number; + } + abstract class Interpolation { + protected abstract applyInternal(a: number): number; + apply(start: number, end: number, a: number): number; + } + class Pow extends Interpolation { + protected power: number; + constructor(power: number); + applyInternal(a: number): number; + } + class PowOut extends Pow { + constructor(power: number); + applyInternal(a: number): number; + } + class Utils { + static SUPPORTS_TYPED_ARRAYS: boolean; + static arrayCopy(source: ArrayLike, sourceStart: number, dest: ArrayLike, destStart: number, numElements: number): void; + static setArraySize(array: Array, size: number, value?: any): Array; + static ensureArrayCapacity(array: Array, size: number, value?: any): Array; + static newArray(size: number, defaultValue: T): Array; + static newFloatArray(size: number): ArrayLike; + static newShortArray(size: number): ArrayLike; + static toFloatArray(array: Array): number[] | Float32Array; + static toSinglePrecision(value: number): number; + static webkit602BugfixHelper(alpha: number, blend: MixBlend): void; + } + class DebugUtils { + static logBones(skeleton: Skeleton): void; + } + class Pool { + private items; + private instantiator; + constructor(instantiator: () => T); + obtain(): T; + free(item: T): void; + freeAll(items: ArrayLike): void; + clear(): void; + } + class Vector2 { + x: number; + y: number; + constructor(x?: number, y?: number); + set(x: number, y: number): Vector2; + length(): number; + normalize(): this; + } + class TimeKeeper { + maxDelta: number; + framesPerSecond: number; + delta: number; + totalTime: number; + private lastTime; + private frameCount; + private frameTime; + update(): void; + } + interface ArrayLike { + length: number; + [n: number]: T; + } + class WindowedMean { + values: Array; + addedValues: number; + lastValue: number; + mean: number; + dirty: boolean; + constructor(windowSize?: number); + hasEnoughData(): boolean; + addValue(value: number): void; + getMean(): number; + } +} +declare module spine { + interface VertexEffect { + begin(skeleton: Skeleton): void; + transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void; + end(): void; + } +} +interface Math { + fround(n: number): number; +} +declare module spine { + abstract class Attachment { + name: string; + constructor(name: string); + } + abstract class VertexAttachment extends Attachment { + private static nextID; + id: number; + bones: Array; + vertices: ArrayLike; + worldVerticesLength: number; + constructor(name: string); + computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike, offset: number, stride: number): void; + applyDeform(sourceAttachment: VertexAttachment): boolean; + } +} +declare module spine { + interface AttachmentLoader { + newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment; + newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment; + newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment; + newPathAttachment(skin: Skin, name: string): PathAttachment; + newPointAttachment(skin: Skin, name: string): PointAttachment; + newClippingAttachment(skin: Skin, name: string): ClippingAttachment; + } +} +declare module spine { + enum AttachmentType { + Region = 0, + BoundingBox = 1, + Mesh = 2, + LinkedMesh = 3, + Path = 4, + Point = 5 + } +} +declare module spine { + class BoundingBoxAttachment extends VertexAttachment { + color: Color; + constructor(name: string); + } +} +declare module spine { + class ClippingAttachment extends VertexAttachment { + endSlot: SlotData; + color: Color; + constructor(name: string); + } +} +declare module spine { + class MeshAttachment extends VertexAttachment { + region: TextureRegion; + path: string; + regionUVs: ArrayLike; + uvs: ArrayLike; + triangles: Array; + color: Color; + hullLength: number; + private parentMesh; + inheritDeform: boolean; + tempColor: Color; + constructor(name: string); + updateUVs(): void; + applyDeform(sourceAttachment: VertexAttachment): boolean; + getParentMesh(): MeshAttachment; + setParentMesh(parentMesh: MeshAttachment): void; + } +} +declare module spine { + class PathAttachment extends VertexAttachment { + lengths: Array; + closed: boolean; + constantSpeed: boolean; + color: Color; + constructor(name: string); + } +} +declare module spine { + class PointAttachment extends VertexAttachment { + x: number; + y: number; + rotation: number; + color: Color; + constructor(name: string); + computeWorldPosition(bone: Bone, point: Vector2): Vector2; + computeWorldRotation(bone: Bone): number; + } +} +declare module spine { + class RegionAttachment extends Attachment { + static OX1: number; + static OY1: number; + static OX2: number; + static OY2: number; + static OX3: number; + static OY3: number; + static OX4: number; + static OY4: number; + static X1: number; + static Y1: number; + static C1R: number; + static C1G: number; + static C1B: number; + static C1A: number; + static U1: number; + static V1: number; + static X2: number; + static Y2: number; + static C2R: number; + static C2G: number; + static C2B: number; + static C2A: number; + static U2: number; + static V2: number; + static X3: number; + static Y3: number; + static C3R: number; + static C3G: number; + static C3B: number; + static C3A: number; + static U3: number; + static V3: number; + static X4: number; + static Y4: number; + static C4R: number; + static C4G: number; + static C4B: number; + static C4A: number; + static U4: number; + static V4: number; + x: number; + y: number; + scaleX: number; + scaleY: number; + rotation: number; + width: number; + height: number; + color: Color; + path: string; + rendererObject: any; + region: TextureRegion; + offset: ArrayLike; + uvs: ArrayLike; + tempColor: Color; + constructor(name: string); + updateOffset(): void; + setRegion(region: TextureRegion): void; + computeWorldVertices(bone: Bone, worldVertices: ArrayLike, offset: number, stride: number): void; + } +} +declare module spine { + class JitterEffect implements VertexEffect { + jitterX: number; + jitterY: number; + constructor(jitterX: number, jitterY: number); + begin(skeleton: Skeleton): void; + transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void; + end(): void; + } +} +declare module spine { + class SwirlEffect implements VertexEffect { + static interpolation: PowOut; + centerX: number; + centerY: number; + radius: number; + angle: number; + private worldX; + private worldY; + constructor(radius: number); + begin(skeleton: Skeleton): void; + transform(position: Vector2, uv: Vector2, light: Color, dark: Color): void; + end(): void; + } +} +declare module spine.canvas { + class AssetManager extends spine.AssetManager { + constructor(pathPrefix?: string); + } +} +declare module spine.canvas { + class CanvasTexture extends Texture { + constructor(image: HTMLImageElement); + setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; + setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; + dispose(): void; + } +} +declare module spine.canvas { + class SkeletonRenderer { + static QUAD_TRIANGLES: number[]; + static VERTEX_SIZE: number; + private ctx; + triangleRendering: boolean; + debugRendering: boolean; + private vertices; + private tempColor; + constructor(context: CanvasRenderingContext2D); + draw(skeleton: Skeleton): void; + private drawImages; + private drawTriangles; + private drawTriangle; + private computeRegionVertices; + private computeMeshVertices; + } +} +declare module spine.webgl { + class AssetManager extends spine.AssetManager { + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, pathPrefix?: string); + } +} +declare module spine.webgl { + class OrthoCamera { + position: Vector3; + direction: Vector3; + up: Vector3; + near: number; + far: number; + zoom: number; + viewportWidth: number; + viewportHeight: number; + projectionView: Matrix4; + inverseProjectionView: Matrix4; + projection: Matrix4; + view: Matrix4; + private tmp; + constructor(viewportWidth: number, viewportHeight: number); + update(): void; + screenToWorld(screenCoords: Vector3, screenWidth: number, screenHeight: number): Vector3; + setViewport(viewportWidth: number, viewportHeight: number): void; + } +} +declare module spine.webgl { + class GLTexture extends Texture implements Disposable, Restorable { + private context; + private texture; + private boundUnit; + private useMipMaps; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean); + setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; + setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; + update(useMipMaps: boolean): void; + restore(): void; + bind(unit?: number): void; + unbind(): void; + dispose(): void; + } +} +declare module spine.webgl { + const M00 = 0; + const M01 = 4; + const M02 = 8; + const M03 = 12; + const M10 = 1; + const M11 = 5; + const M12 = 9; + const M13 = 13; + const M20 = 2; + const M21 = 6; + const M22 = 10; + const M23 = 14; + const M30 = 3; + const M31 = 7; + const M32 = 11; + const M33 = 15; + class Matrix4 { + temp: Float32Array; + values: Float32Array; + private static xAxis; + private static yAxis; + private static zAxis; + private static tmpMatrix; + constructor(); + set(values: ArrayLike): Matrix4; + transpose(): Matrix4; + identity(): Matrix4; + invert(): Matrix4; + determinant(): number; + translate(x: number, y: number, z: number): Matrix4; + copy(): Matrix4; + projection(near: number, far: number, fovy: number, aspectRatio: number): Matrix4; + ortho2d(x: number, y: number, width: number, height: number): Matrix4; + ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4; + multiply(matrix: Matrix4): Matrix4; + multiplyLeft(matrix: Matrix4): Matrix4; + lookAt(position: Vector3, direction: Vector3, up: Vector3): this; + static initTemps(): void; + } +} +declare module spine.webgl { + class Mesh implements Disposable, Restorable { + private attributes; + private context; + private vertices; + private verticesBuffer; + private verticesLength; + private dirtyVertices; + private indices; + private indicesBuffer; + private indicesLength; + private dirtyIndices; + private elementsPerVertex; + getAttributes(): VertexAttribute[]; + maxVertices(): number; + numVertices(): number; + setVerticesLength(length: number): void; + getVertices(): Float32Array; + maxIndices(): number; + numIndices(): number; + setIndicesLength(length: number): void; + getIndices(): Uint16Array; + getVertexSizeInFloats(): number; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, attributes: VertexAttribute[], maxVertices: number, maxIndices: number); + setVertices(vertices: Array): void; + setIndices(indices: Array): void; + draw(shader: Shader, primitiveType: number): void; + drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void; + bind(shader: Shader): void; + unbind(shader: Shader): void; + private update; + restore(): void; + dispose(): void; + } + class VertexAttribute { + name: string; + type: VertexAttributeType; + numElements: number; + constructor(name: string, type: VertexAttributeType, numElements: number); + } + class Position2Attribute extends VertexAttribute { + constructor(); + } + class Position3Attribute extends VertexAttribute { + constructor(); + } + class TexCoordAttribute extends VertexAttribute { + constructor(unit?: number); + } + class ColorAttribute extends VertexAttribute { + constructor(); + } + class Color2Attribute extends VertexAttribute { + constructor(); + } + enum VertexAttributeType { + Float = 0 + } +} +declare module spine.webgl { + class PolygonBatcher implements Disposable { + private context; + private drawCalls; + private isDrawing; + private mesh; + private shader; + private lastTexture; + private verticesLength; + private indicesLength; + private srcBlend; + private dstBlend; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint?: boolean, maxVertices?: number); + begin(shader: Shader): void; + setBlendMode(srcBlend: number, dstBlend: number): void; + draw(texture: GLTexture, vertices: ArrayLike, indices: Array): void; + private flush; + end(): void; + getDrawCalls(): number; + dispose(): void; + } +} +declare module spine.webgl { + class SceneRenderer implements Disposable { + context: ManagedWebGLRenderingContext; + canvas: HTMLCanvasElement; + camera: OrthoCamera; + batcher: PolygonBatcher; + private twoColorTint; + private batcherShader; + private shapes; + private shapesShader; + private activeRenderer; + skeletonRenderer: SkeletonRenderer; + skeletonDebugRenderer: SkeletonDebugRenderer; + private QUAD; + private QUAD_TRIANGLES; + private WHITE; + constructor(canvas: HTMLCanvasElement, context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint?: boolean); + begin(): void; + drawSkeleton(skeleton: Skeleton, premultipliedAlpha?: boolean, slotRangeStart?: number, slotRangeEnd?: number): void; + drawSkeletonDebug(skeleton: Skeleton, premultipliedAlpha?: boolean, ignoredBones?: Array): void; + drawTexture(texture: GLTexture, x: number, y: number, width: number, height: number, color?: Color): void; + drawTextureUV(texture: GLTexture, x: number, y: number, width: number, height: number, u: number, v: number, u2: number, v2: number, color?: Color): void; + drawTextureRotated(texture: GLTexture, x: number, y: number, width: number, height: number, pivotX: number, pivotY: number, angle: number, color?: Color, premultipliedAlpha?: boolean): void; + drawRegion(region: TextureAtlasRegion, x: number, y: number, width: number, height: number, color?: Color, premultipliedAlpha?: boolean): void; + line(x: number, y: number, x2: number, y2: number, color?: Color, color2?: Color): void; + triangle(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color): void; + quad(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color): void; + rect(filled: boolean, x: number, y: number, width: number, height: number, color?: Color): void; + rectLine(filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color): void; + polygon(polygonVertices: ArrayLike, offset: number, count: number, color?: Color): void; + circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void; + curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void; + end(): void; + resize(resizeMode: ResizeMode): void; + private enableRenderer; + dispose(): void; + } + enum ResizeMode { + Stretch = 0, + Expand = 1, + Fit = 2 + } +} +declare module spine.webgl { + class Shader implements Disposable, Restorable { + private vertexShader; + private fragmentShader; + static MVP_MATRIX: string; + static POSITION: string; + static COLOR: string; + static COLOR2: string; + static TEXCOORDS: string; + static SAMPLER: string; + private context; + private vs; + private vsSource; + private fs; + private fsSource; + private program; + private tmp2x2; + private tmp3x3; + private tmp4x4; + getProgram(): WebGLProgram; + getVertexShader(): string; + getFragmentShader(): string; + getVertexShaderSource(): string; + getFragmentSource(): string; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string); + private compile; + private compileShader; + private compileProgram; + restore(): void; + bind(): void; + unbind(): void; + setUniformi(uniform: string, value: number): void; + setUniformf(uniform: string, value: number): void; + setUniform2f(uniform: string, value: number, value2: number): void; + setUniform3f(uniform: string, value: number, value2: number, value3: number): void; + setUniform4f(uniform: string, value: number, value2: number, value3: number, value4: number): void; + setUniform2x2f(uniform: string, value: ArrayLike): void; + setUniform3x3f(uniform: string, value: ArrayLike): void; + setUniform4x4f(uniform: string, value: ArrayLike): void; + getUniformLocation(uniform: string): WebGLUniformLocation; + getAttributeLocation(attribute: string): number; + dispose(): void; + static newColoredTextured(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader; + static newTwoColoredTextured(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader; + static newColored(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader; + } +} +declare module spine.webgl { + class ShapeRenderer implements Disposable { + private context; + private isDrawing; + private mesh; + private shapeType; + private color; + private shader; + private vertexIndex; + private tmp; + private srcBlend; + private dstBlend; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, maxVertices?: number); + begin(shader: Shader): void; + setBlendMode(srcBlend: number, dstBlend: number): void; + setColor(color: Color): void; + setColorWith(r: number, g: number, b: number, a: number): void; + point(x: number, y: number, color?: Color): void; + line(x: number, y: number, x2: number, y2: number, color?: Color): void; + triangle(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color): void; + quad(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color): void; + rect(filled: boolean, x: number, y: number, width: number, height: number, color?: Color): void; + rectLine(filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color): void; + x(x: number, y: number, size: number): void; + polygon(polygonVertices: ArrayLike, offset: number, count: number, color?: Color): void; + circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void; + curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void; + private vertex; + end(): void; + private flush; + private check; + dispose(): void; + } + enum ShapeType { + Point = 0, + Line = 1, + Filled = 4 + } +} +declare module spine.webgl { + class SkeletonDebugRenderer implements Disposable { + boneLineColor: Color; + boneOriginColor: Color; + attachmentLineColor: Color; + triangleLineColor: Color; + pathColor: Color; + clipColor: Color; + aabbColor: Color; + drawBones: boolean; + drawRegionAttachments: boolean; + drawBoundingBoxes: boolean; + drawMeshHull: boolean; + drawMeshTriangles: boolean; + drawPaths: boolean; + drawSkeletonXY: boolean; + drawClipping: boolean; + premultipliedAlpha: boolean; + scale: number; + boneWidth: number; + private context; + private bounds; + private temp; + private vertices; + private static LIGHT_GRAY; + private static GREEN; + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext); + draw(shapes: ShapeRenderer, skeleton: Skeleton, ignoredBones?: Array): void; + dispose(): void; + } +} +declare module spine.webgl { + class SkeletonRenderer { + static QUAD_TRIANGLES: number[]; + premultipliedAlpha: boolean; + vertexEffect: VertexEffect; + private tempColor; + private tempColor2; + private vertices; + private vertexSize; + private twoColorTint; + private renderable; + private clipper; + private temp; + private temp2; + private temp3; + private temp4; + constructor(context: ManagedWebGLRenderingContext, twoColorTint?: boolean); + draw(batcher: PolygonBatcher, skeleton: Skeleton, slotRangeStart?: number, slotRangeEnd?: number): void; + } +} +declare module spine.webgl { + class Vector3 { + x: number; + y: number; + z: number; + constructor(x?: number, y?: number, z?: number); + setFrom(v: Vector3): Vector3; + set(x: number, y: number, z: number): Vector3; + add(v: Vector3): Vector3; + sub(v: Vector3): Vector3; + scale(s: number): Vector3; + normalize(): Vector3; + cross(v: Vector3): Vector3; + multiply(matrix: Matrix4): Vector3; + project(matrix: Matrix4): Vector3; + dot(v: Vector3): number; + length(): number; + distance(v: Vector3): number; + } +} +declare module spine.webgl { + class ManagedWebGLRenderingContext { + canvas: HTMLCanvasElement; + gl: WebGLRenderingContext; + private restorables; + constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig?: any); + addRestorable(restorable: Restorable): void; + removeRestorable(restorable: Restorable): void; + } + class WebGLBlendModeConverter { + static ZERO: number; + static ONE: number; + static SRC_COLOR: number; + static ONE_MINUS_SRC_COLOR: number; + static SRC_ALPHA: number; + static ONE_MINUS_SRC_ALPHA: number; + static DST_ALPHA: number; + static ONE_MINUS_DST_ALPHA: number; + static DST_COLOR: number; + static getDestGLBlendMode(blendMode: BlendMode): number; + static getSourceGLBlendMode(blendMode: BlendMode, premultipliedAlpha?: boolean): number; + } +}